Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Commit

Permalink
Merge pull request #2295 from aggarw13/release
Browse files Browse the repository at this point in the history
Merge release-candidate into release
  • Loading branch information
aggarg authored Jul 17, 2020
2 parents 987d969 + 2ae712d commit 4e8219e
Show file tree
Hide file tree
Showing 6,691 changed files with 675,142 additions and 2,393,571 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ doxygen_warnings.txt
*.d
*.elf
*.hex
!/vendors/cypress/MTB/psoc6/psoc64tfm/COMPONENT_TFM_S_FW/tfm_s_unsigned.hex
*.bin
*.pyc

RemoteSystemsTempFiles/*

Expand Down
14 changes: 14 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,17 @@
[submodule "lwip"]
path = libraries/3rdparty/lwip
url = https://github.com/lwip-tcpip/lwip.git
[submodule "libraries/3rdparty/CMock"]
path = libraries/3rdparty/CMock
url = https://github.com/ThrowTheSwitch/CMock.git
[submodule "vendors/espressif/esp-idf"]
path = vendors/espressif/esp-idf
url = https://github.com/espressif/esp-afr-sdk.git
branch = release/v3.3
[submodule "mbedtls"]
path = libraries/3rdparty/mbedtls
url = https://github.com/ARMmbed/mbedtls.git
branch = mbedtls-2.16.7
[submodule "libraries/abstractions/pkcs11/psa"]
path = libraries/abstractions/pkcs11/psa
url = https://github.com/Linaro/freertos-pkcs11-psa.git
77 changes: 76 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,79 @@
# Change Log for FreeRTOS
# Change Log
This repository contains the `FreeRTOS AWS Reference Integrations`, which are pre-integrated FreeRTOS projects that demonstrate connectivity with AWS IoT. The repository contains projects for many different microcontroller evaluation boards.

## 202007.00 July 2020

### New Features

#### Over the Air Update V1.2.0

- Updated the over-the-air (OTA) agent with the ability to pause and resume an in-progress update.
- Updated the OTA demo to demonstrate how to suspend an in-progress OTA update should the MQTT connection disconnect, then resume the same update when the MQTT connection reconnects. In line with best practice, the reconnect logic uses an exponential backoff and jitter algorithm to prevent the MQTT server getting overwhelmed with connection requests if a fleet of devices get disconnected and then attempt to reconnect at the same time.
- For testing purposes only, it is now possible to use the OTA agent to downgrade a version number or revert to an older version. This new functionality is disabled by default.

#### New Board: Cypress PSoC 64 Standard Secure AWS Wi-Fi Bluetooth Pioneer Kit
- New Board: The <b>Cypress PSoC 64</b> board is now qualified with FreeRTOS.

#### New Board: ESP32-WROOM-32SE

- New Board: <b>ESP32-WROOM-32SE</b> is now available in the FreeRTOS Console.

### Updates

#### FreeRTOS+POSIX Utils V1.2.0

- Update the UTILS_TimespecAdd utility function to support both signed and unsigned definitions of `struct timespec.tv_sec`. (Some implementations use unsigned definition of `struct timespec.tv_sec` to address the *2038* problem on 32-bit systems. ) This change is backwards compatible.

#### MQTT Client Library V2.2.0

- Improved the Keep-Alive mechanism: The MQTT library will not send PING requests when connection is not idle, which fixes a disconnect issue during OTA. In prior versions, MQTT would sometimes disconnect during OTA due to timeouts for server PING response.
- Bug fix for Keep-Alive interval: The MQTT library was incorrectly sending PING requests at intervals greater than the keep alive period sent in the CONNECT request. This change fixes the problem.

#### Secure Sockets LwIP V1.2.0

- Fix invalid memory access - ss_ctx_t context is shared and sent to a user callback. If the socket is closed and subsequently freed during callback execution, the callback can potentially access the invalid context.
- Fix two separate issues for potential invalid memory access; at one place by validating socket handle before de-referencing, and at another place by freeing memory only if it had been previously allocated.

#### PKCS#11 V2.1.0

- Added doxygen to various PKCS #11 files.
- Added improved logging for mbed TLS return codes in iot_pkcs11_mbedtls.c.

#### Bluetooth Low Energy (BLE) Hardware Abstraction Library (HAL) V5.0.0

- Change status parameter type for GATT Client callbacks to match Bluetooth 5.0.
- Add pxMultiAdvSetInstRawData API to set raw advertisement data for multi-advertisement instances.
- Mark pxBondedCb callback and ucTimeout variables as deprecated.

#### Bluetooth Low Energy Management Library V2.1.0

- Added new API IotBle_SetDeviceName() to set the BLE device name at runtime.
- Fixed IotBle_On() and IotBle_Off() APIs.
- Accommodate larger-than-expected writes to RXLargeMesg Gatt characteristic.

#### FreeRTOS+TCP V2.3.0

- Added ability to cache multiple IP addresses per DNS entry.
- Defensive security improvements:
- In compliance with the UDP protocol specification, prior versions of FreeRTOS+TCP accepted UDP packets that had their checksum set to 0. FreeRTOS+TCP V2.3.0 adds a new configuration parameter, `ipconfigUDP_PASS_ZERO_CHECKSUM_PACKETS`, that enables users to opt to drop UDP packets that have their checksum set to 0. **Note:** This new setting defaults to 0, so it defaults to dropping UDP packets that have their checksum set to 0.
- Prior versions of FreeRTOS+TCP accept IP packets that contain IP options, although those options are not processed. FreeRTOS+TCP V2.3.0 adds a new configuration parameter, `ipconfigIP_PASS_PACKETS_WITH_IP_OPTIONS`, that enables users to opt to drop IP packets that contain IP options.
- Setting configuration parameter, `ipconfigDRIVER_INCLUDED_RX_IP_CHECKSUM`, to 1 offloads IP checksum and length checking to the hardware. From FreeRTOS+TCP V2.3.0, the length is checked in software even when it has already been checked in hardware.

#### Mbed TLS v2.16.7

- Upgraded the version of Mbed TLS to v2.16.7.
- Replaced copy of Mbed TLS with a submodule reference to the official [Mbed TLS GitHub repository](https://github.com/ARMmbed/mbedtls/tree/mbedtls-2.16.7).

#### Over the Air Update V1.2.0

- Fixed an issue encountered when an OTA job is force cancelled while the related download is in progress. It was caused due to the self-start timer starting after the OTA job document is received. The fix starts the self-start timer when the OTA agent on the device starts.

#### Espressif

- Support OTA via HTTP over the BLE channel for ESP32 (when SPIRAM is enabled).
- Added ESP-IDF component for WiFi provisioning in SoftAP mode. This allows provisioning devices with Wi-Fi credentials via a web-server running on the device and a provisioning mobile application. This mode requires the use of lwIP as the networking stack.
- Replaced ESP-IDF code to be a submodule pointer to the official ESP-IDF repository.
- Updated LwIP as the default networking stack.

## 202002.00 2/18/2020

Expand Down
105 changes: 79 additions & 26 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,54 +6,100 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
endif()

project(amazon-freertos)
set(PROJECT_VERSION "202002.00")
set(PROJECT_VERSION_MAJOR "202002")
set(PROJECT_VERSION "202007.00")
set(PROJECT_VERSION_MAJOR "202007")
set(PROJECT_VERSION_MINOR "00")

# Import global configurations.
include("tools/cmake/afr.cmake")

# Add 3rdparty modules.
add_subdirectory("libraries/3rdparty")
if (NOT AFR_ENABLE_UNIT_TESTS)
add_subdirectory("libraries/3rdparty")
endif()

# -------------------------------------------------------------------------------------------------
# Configure target board
# -------------------------------------------------------------------------------------------------
# Get list of supported boards.
afr_get_boards(AFR_SUPPORTED_BOARDS)

set(AFR_BOARD "vendor.board" CACHE STRING "Target board chosen by the user at configure time")
set_property(CACHE AFR_BOARD PROPERTY STRINGS ${AFR_SUPPORTED_BOARDS})

string(REGEX MATCH [[(.+)\.(.+)]] __match_result ${AFR_BOARD})
set(AFR_VENDOR_NAME ${CMAKE_MATCH_1} CACHE INTERNAL "MCU vendor name")
set(AFR_BOARD_NAME ${CMAKE_MATCH_2} CACHE INTERNAL "MCU board name")

# Abort if the target board is not supported, i.e., corresponding folder is not present.
if(NOT AFR_BOARD IN_LIST AFR_SUPPORTED_BOARDS)
message(FATAL_ERROR "Board is not supported: ${AFR_BOARD}")
endif()

# Import board CMake build.
set(AFR_VENDOR_PATH "vendors/${AFR_VENDOR_NAME}" CACHE INTERNAL "")
include("${AFR_VENDOR_PATH}/manifest.cmake")
if(DEFINED AFR_MANIFEST_BOARD_DIR_${AFR_BOARD_NAME})
set(AFR_BOARD_PATH "${AFR_VENDOR_PATH}/${AFR_MANIFEST_BOARD_DIR_${AFR_BOARD_NAME}}" CACHE INTERNAL "")
elseif(DEFINED AFR_MANIFEST_BOARD_DIR)
set(AFR_BOARD_PATH "${AFR_VENDOR_PATH}/${AFR_MANIFEST_BOARD_DIR}/${AFR_BOARD_NAME}" CACHE INTERNAL "")
# If AFR_BOARD_PATH is provided, load CMakeList.txt file from this path instead of searching within our
# directory tree. Note that AFR_BOARD_PATH is also defined in the other branch, so if this is the
# second run of cmake this branch will be triggered anyway. But if the user provides AFR_BOARD_PATH,
# we will not have the AFR_VENDOR_PATH, so we can use it to detect if this is just the second run
# of a normal use case or user indeed passed AFR_BOARD_PATH.
# Note: this feature is generally only meant for vendor partners doing a qualification, end users who
# are consuming only this repo should not use it.
if(DEFINED AFR_BOARD_PATH)
if(NOT DEFINED AFR_VENDOR_PATH)
# Add type to this variable so it will display in GUI, value will not change.
set(AFR_BOARD_PATH "" CACHE STRING "Custom board path provided by user")
message("Loading board code from a custom location: ${AFR_BOARD_PATH}.")
endif()
if(NOT DEFINED AFR_BOARD_NAME)
get_filename_component(AFR_BOARD_NAME "${AFR_BOARD_PATH}" NAME CACHE)
endif()
else()
message(FATAL_ERROR "Could not import board CMakeLists.txt.")
# Get list of supported boards.
afr_get_boards(AFR_SUPPORTED_BOARDS)

set(AFR_BOARD "vendor.board" CACHE STRING "Target board chosen by the user at configure time")
set_property(CACHE AFR_BOARD PROPERTY STRINGS ${AFR_SUPPORTED_BOARDS})

string(REGEX MATCH [[(.+)\.(.+)]] __match_result ${AFR_BOARD})
set(AFR_VENDOR_NAME ${CMAKE_MATCH_1} CACHE INTERNAL "MCU vendor name")
set(AFR_BOARD_NAME ${CMAKE_MATCH_2} CACHE INTERNAL "MCU board name")

# Abort if the target board is not supported, i.e., corresponding folder is not present.
if(NOT AFR_BOARD IN_LIST AFR_SUPPORTED_BOARDS)
message(FATAL_ERROR "Board is not supported: ${AFR_BOARD}")
endif()

# Import board CMake build.
set(AFR_VENDOR_PATH "vendors/${AFR_VENDOR_NAME}" CACHE INTERNAL "")
include("${AFR_VENDOR_PATH}/manifest.cmake")
if(DEFINED AFR_MANIFEST_BOARD_DIR_${AFR_BOARD_NAME})
set(AFR_BOARD_PATH "${AFR_VENDOR_PATH}/${AFR_MANIFEST_BOARD_DIR_${AFR_BOARD_NAME}}" CACHE INTERNAL "")
elseif(DEFINED AFR_MANIFEST_BOARD_DIR)
set(AFR_BOARD_PATH "${AFR_VENDOR_PATH}/${AFR_MANIFEST_BOARD_DIR}/${AFR_BOARD_NAME}" CACHE INTERNAL "")
else()
message(FATAL_ERROR "Could not import board CMakeLists.txt.")
endif()
endif()

# Use include here because we need portable layer targets defined by vendor to be at
# the same directory level as our library components.
include("${AFR_BOARD_PATH}/CMakeLists.txt")
if (AFR_ENABLE_UNIT_TESTS)
return()
endif()

# -------------------------------------------------------------------------------------------------
# Conditionally set mbedtls config
# -------------------------------------------------------------------------------------------------
# Use the FreeRTOS mbedTLS config file required by demos if there's not a preexisting one
get_target_property(mbedtls_comp_defs afr_3rdparty_mbedtls COMPILE_DEFINITIONS)
string(FIND "${mbedtls_comp_defs}" "MBEDTLS_CONFIG_FILE" mbedtls_config_pos)
if( "${mbedtls_config_pos}" EQUAL "-1")
target_include_directories(
afr_3rdparty_mbedtls
PUBLIC
"${AFR_3RDPARTY_DIR}/mbedtls_config"
)
target_compile_definitions(
afr_3rdparty_mbedtls
PUBLIC
-DMBEDTLS_CONFIG_FILE="aws_mbedtls_config.h"
-DCONFIG_MEDTLS_USE_AFR_MEMORY
)

endif()

# -------------------------------------------------------------------------------------------------
# FreeRTOS modules
# -------------------------------------------------------------------------------------------------
# Do not prefix the output library file.
set(CMAKE_STATIC_LIBRARY_PREFIX "")


# Initialize all modules.
add_subdirectory("libraries")
add_subdirectory("demos")
Expand All @@ -63,6 +109,13 @@ add_subdirectory("tests")
afr_status("=========================Resolving dependencies==========================")
afr_resolve_dependencies()

if(DEFINED CBMC)
add_subdirectory("tools/cbmc/proofs")
list(FILTER cbmc_proof_names EXCLUDE REGEX "^$")
list(TRANSFORM cbmc_proof_names APPEND "-goto" OUTPUT_VARIABLE all_proof_targets)
add_custom_target("cbmc" DEPENDS ${all_proof_targets})
endif()

# -------------------------------------------------------------------------------------------------
# Summary
# -------------------------------------------------------------------------------------------------
Expand Down
20 changes: 9 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ documentation, we greatly value feedback and contributions from our community.
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
information to effectively respond to your bug report or contribution.

## Code of Conduct
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
[email protected] with any additional questions or comments.


## Security issue notifications
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.

## Reporting Bugs/Feature Requests

Expand Down Expand Up @@ -38,6 +46,7 @@ To send us a pull request, please:
1. Send us a pull request, answering any default questions in the pull request interface.
NOTE: Please make sure the default option (Allow edits from maintainers) is left checked.
1. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
1. Pull requests should not be too large. This makes them difficult to meaningfully review. We recommend submitting changes in a series of smaller pull requests, each of which is thematically cohesive (i.e., focusing on a single set of related ideas/changes).

GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
Expand All @@ -53,17 +62,6 @@ All Pull Requests must be approved by our review team before it can be merged in
## Finding contributions to work on
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start.


## Code of Conduct
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
[email protected] with any additional questions or comments.


## Security issue notifications
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.


## Licensing

See the LICENSE file for our project's licensing. We will ask you to confirm the licensing of your contribution.
Expand Down
8 changes: 5 additions & 3 deletions PreLoad.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Set your compiler path here if it's not in the PATH environment variable.
set(AFR_TOOLCHAIN_PATH "" CACHE INTERNAL "")
# This file is to provide an easy interface to specify vendor, board, and compiler for FreeRTOS.
# It is supposed to be processed first by cmake before the top level CMakeLists.txt file. Note the
# behavior of this file is not officially supported by CMake. After CMake 3.17, there's a better
# way for this, https://cmake.org/cmake/help/v3.17/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE_BEFORE.html

# If VENDOR or BOARD is specified, try to find a match.
if(DEFINED VENDOR OR DEFINED BOARD)
Expand All @@ -22,7 +24,7 @@ if(DEFINED VENDOR OR DEFINED BOARD)
list(JOIN matched_boards ", " matched_boards)
message(FATAL_ERROR "Multiple matching boards found: ${matched_boards}")
else()
set(AFR_BOARD "${matched_boards}" CACHE INTERNAL "")
set(AFR_BOARD "${matched_boards}" CACHE STRING "")
endif()
endif()

Expand Down
Loading

0 comments on commit 4e8219e

Please sign in to comment.