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

Commit 4e8219e

Browse files
authored
Merge pull request #2295 from aggarw13/release
Merge release-candidate into release
2 parents 987d969 + 2ae712d commit 4e8219e

File tree

6,691 files changed

+675142
-2393571
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

6,691 files changed

+675142
-2393571
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ doxygen_warnings.txt
1010
*.d
1111
*.elf
1212
*.hex
13+
!/vendors/cypress/MTB/psoc6/psoc64tfm/COMPONENT_TFM_S_FW/tfm_s_unsigned.hex
1314
*.bin
15+
*.pyc
1416

1517
RemoteSystemsTempFiles/*
1618

.gitmodules

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,17 @@
1616
[submodule "lwip"]
1717
path = libraries/3rdparty/lwip
1818
url = https://github.com/lwip-tcpip/lwip.git
19+
[submodule "libraries/3rdparty/CMock"]
20+
path = libraries/3rdparty/CMock
21+
url = https://github.com/ThrowTheSwitch/CMock.git
22+
[submodule "vendors/espressif/esp-idf"]
23+
path = vendors/espressif/esp-idf
24+
url = https://github.com/espressif/esp-afr-sdk.git
25+
branch = release/v3.3
26+
[submodule "mbedtls"]
27+
path = libraries/3rdparty/mbedtls
28+
url = https://github.com/ARMmbed/mbedtls.git
29+
branch = mbedtls-2.16.7
30+
[submodule "libraries/abstractions/pkcs11/psa"]
31+
path = libraries/abstractions/pkcs11/psa
32+
url = https://github.com/Linaro/freertos-pkcs11-psa.git

CHANGELOG.md

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,79 @@
1-
# Change Log for FreeRTOS
1+
# Change Log
2+
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.
3+
4+
## 202007.00 July 2020
5+
6+
### New Features
7+
8+
#### Over the Air Update V1.2.0
9+
10+
- Updated the over-the-air (OTA) agent with the ability to pause and resume an in-progress update.
11+
- 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.
12+
- 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.
13+
14+
#### New Board: Cypress PSoC 64 Standard Secure AWS Wi-Fi Bluetooth Pioneer Kit
15+
- New Board: The <b>Cypress PSoC 64</b> board is now qualified with FreeRTOS.
16+
17+
#### New Board: ESP32-WROOM-32SE
18+
19+
- New Board: <b>ESP32-WROOM-32SE</b> is now available in the FreeRTOS Console.
20+
21+
### Updates
22+
23+
#### FreeRTOS+POSIX Utils V1.2.0
24+
25+
- 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.
26+
27+
#### MQTT Client Library V2.2.0
28+
29+
- 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.
30+
- 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.
31+
32+
#### Secure Sockets LwIP V1.2.0
33+
34+
- 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.
35+
- 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.
36+
37+
#### PKCS#11 V2.1.0
38+
39+
- Added doxygen to various PKCS #11 files.
40+
- Added improved logging for mbed TLS return codes in iot_pkcs11_mbedtls.c.
41+
42+
#### Bluetooth Low Energy (BLE) Hardware Abstraction Library (HAL) V5.0.0
43+
44+
- Change status parameter type for GATT Client callbacks to match Bluetooth 5.0.
45+
- Add pxMultiAdvSetInstRawData API to set raw advertisement data for multi-advertisement instances.
46+
- Mark pxBondedCb callback and ucTimeout variables as deprecated.
47+
48+
#### Bluetooth Low Energy Management Library V2.1.0
49+
50+
- Added new API IotBle_SetDeviceName() to set the BLE device name at runtime.
51+
- Fixed IotBle_On() and IotBle_Off() APIs.
52+
- Accommodate larger-than-expected writes to RXLargeMesg Gatt characteristic.
53+
54+
#### FreeRTOS+TCP V2.3.0
55+
56+
- Added ability to cache multiple IP addresses per DNS entry.
57+
- Defensive security improvements:
58+
- 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.
59+
- 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.
60+
- 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.
61+
62+
#### Mbed TLS v2.16.7
63+
64+
- Upgraded the version of Mbed TLS to v2.16.7.
65+
- 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).
66+
67+
#### Over the Air Update V1.2.0
68+
69+
- 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.
70+
71+
#### Espressif
72+
73+
- Support OTA via HTTP over the BLE channel for ESP32 (when SPIRAM is enabled).
74+
- 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.
75+
- Replaced ESP-IDF code to be a submodule pointer to the official ESP-IDF repository.
76+
- Updated LwIP as the default networking stack.
277

378
## 202002.00 2/18/2020
479

CMakeLists.txt

Lines changed: 79 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,54 +6,100 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
66
endif()
77

88
project(amazon-freertos)
9-
set(PROJECT_VERSION "202002.00")
10-
set(PROJECT_VERSION_MAJOR "202002")
9+
set(PROJECT_VERSION "202007.00")
10+
set(PROJECT_VERSION_MAJOR "202007")
1111
set(PROJECT_VERSION_MINOR "00")
1212

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

1616
# Add 3rdparty modules.
17-
add_subdirectory("libraries/3rdparty")
17+
if (NOT AFR_ENABLE_UNIT_TESTS)
18+
add_subdirectory("libraries/3rdparty")
19+
endif()
1820

1921
# -------------------------------------------------------------------------------------------------
2022
# Configure target board
2123
# -------------------------------------------------------------------------------------------------
22-
# Get list of supported boards.
23-
afr_get_boards(AFR_SUPPORTED_BOARDS)
24-
25-
set(AFR_BOARD "vendor.board" CACHE STRING "Target board chosen by the user at configure time")
26-
set_property(CACHE AFR_BOARD PROPERTY STRINGS ${AFR_SUPPORTED_BOARDS})
27-
28-
string(REGEX MATCH [[(.+)\.(.+)]] __match_result ${AFR_BOARD})
29-
set(AFR_VENDOR_NAME ${CMAKE_MATCH_1} CACHE INTERNAL "MCU vendor name")
30-
set(AFR_BOARD_NAME ${CMAKE_MATCH_2} CACHE INTERNAL "MCU board name")
31-
32-
# Abort if the target board is not supported, i.e., corresponding folder is not present.
33-
if(NOT AFR_BOARD IN_LIST AFR_SUPPORTED_BOARDS)
34-
message(FATAL_ERROR "Board is not supported: ${AFR_BOARD}")
35-
endif()
36-
37-
# Import board CMake build.
38-
set(AFR_VENDOR_PATH "vendors/${AFR_VENDOR_NAME}" CACHE INTERNAL "")
39-
include("${AFR_VENDOR_PATH}/manifest.cmake")
40-
if(DEFINED AFR_MANIFEST_BOARD_DIR_${AFR_BOARD_NAME})
41-
set(AFR_BOARD_PATH "${AFR_VENDOR_PATH}/${AFR_MANIFEST_BOARD_DIR_${AFR_BOARD_NAME}}" CACHE INTERNAL "")
42-
elseif(DEFINED AFR_MANIFEST_BOARD_DIR)
43-
set(AFR_BOARD_PATH "${AFR_VENDOR_PATH}/${AFR_MANIFEST_BOARD_DIR}/${AFR_BOARD_NAME}" CACHE INTERNAL "")
24+
# If AFR_BOARD_PATH is provided, load CMakeList.txt file from this path instead of searching within our
25+
# directory tree. Note that AFR_BOARD_PATH is also defined in the other branch, so if this is the
26+
# second run of cmake this branch will be triggered anyway. But if the user provides AFR_BOARD_PATH,
27+
# we will not have the AFR_VENDOR_PATH, so we can use it to detect if this is just the second run
28+
# of a normal use case or user indeed passed AFR_BOARD_PATH.
29+
# Note: this feature is generally only meant for vendor partners doing a qualification, end users who
30+
# are consuming only this repo should not use it.
31+
if(DEFINED AFR_BOARD_PATH)
32+
if(NOT DEFINED AFR_VENDOR_PATH)
33+
# Add type to this variable so it will display in GUI, value will not change.
34+
set(AFR_BOARD_PATH "" CACHE STRING "Custom board path provided by user")
35+
message("Loading board code from a custom location: ${AFR_BOARD_PATH}.")
36+
endif()
37+
if(NOT DEFINED AFR_BOARD_NAME)
38+
get_filename_component(AFR_BOARD_NAME "${AFR_BOARD_PATH}" NAME CACHE)
39+
endif()
4440
else()
45-
message(FATAL_ERROR "Could not import board CMakeLists.txt.")
41+
# Get list of supported boards.
42+
afr_get_boards(AFR_SUPPORTED_BOARDS)
43+
44+
set(AFR_BOARD "vendor.board" CACHE STRING "Target board chosen by the user at configure time")
45+
set_property(CACHE AFR_BOARD PROPERTY STRINGS ${AFR_SUPPORTED_BOARDS})
46+
47+
string(REGEX MATCH [[(.+)\.(.+)]] __match_result ${AFR_BOARD})
48+
set(AFR_VENDOR_NAME ${CMAKE_MATCH_1} CACHE INTERNAL "MCU vendor name")
49+
set(AFR_BOARD_NAME ${CMAKE_MATCH_2} CACHE INTERNAL "MCU board name")
50+
51+
# Abort if the target board is not supported, i.e., corresponding folder is not present.
52+
if(NOT AFR_BOARD IN_LIST AFR_SUPPORTED_BOARDS)
53+
message(FATAL_ERROR "Board is not supported: ${AFR_BOARD}")
54+
endif()
55+
56+
# Import board CMake build.
57+
set(AFR_VENDOR_PATH "vendors/${AFR_VENDOR_NAME}" CACHE INTERNAL "")
58+
include("${AFR_VENDOR_PATH}/manifest.cmake")
59+
if(DEFINED AFR_MANIFEST_BOARD_DIR_${AFR_BOARD_NAME})
60+
set(AFR_BOARD_PATH "${AFR_VENDOR_PATH}/${AFR_MANIFEST_BOARD_DIR_${AFR_BOARD_NAME}}" CACHE INTERNAL "")
61+
elseif(DEFINED AFR_MANIFEST_BOARD_DIR)
62+
set(AFR_BOARD_PATH "${AFR_VENDOR_PATH}/${AFR_MANIFEST_BOARD_DIR}/${AFR_BOARD_NAME}" CACHE INTERNAL "")
63+
else()
64+
message(FATAL_ERROR "Could not import board CMakeLists.txt.")
65+
endif()
4666
endif()
67+
4768
# Use include here because we need portable layer targets defined by vendor to be at
4869
# the same directory level as our library components.
4970
include("${AFR_BOARD_PATH}/CMakeLists.txt")
71+
if (AFR_ENABLE_UNIT_TESTS)
72+
return()
73+
endif()
74+
75+
# -------------------------------------------------------------------------------------------------
76+
# Conditionally set mbedtls config
77+
# -------------------------------------------------------------------------------------------------
78+
# Use the FreeRTOS mbedTLS config file required by demos if there's not a preexisting one
79+
get_target_property(mbedtls_comp_defs afr_3rdparty_mbedtls COMPILE_DEFINITIONS)
80+
string(FIND "${mbedtls_comp_defs}" "MBEDTLS_CONFIG_FILE" mbedtls_config_pos)
81+
if( "${mbedtls_config_pos}" EQUAL "-1")
82+
target_include_directories(
83+
afr_3rdparty_mbedtls
84+
PUBLIC
85+
"${AFR_3RDPARTY_DIR}/mbedtls_config"
86+
)
87+
target_compile_definitions(
88+
afr_3rdparty_mbedtls
89+
PUBLIC
90+
-DMBEDTLS_CONFIG_FILE="aws_mbedtls_config.h"
91+
-DCONFIG_MEDTLS_USE_AFR_MEMORY
92+
)
93+
94+
endif()
5095

5196
# -------------------------------------------------------------------------------------------------
5297
# FreeRTOS modules
5398
# -------------------------------------------------------------------------------------------------
5499
# Do not prefix the output library file.
55100
set(CMAKE_STATIC_LIBRARY_PREFIX "")
56101

102+
57103
# Initialize all modules.
58104
add_subdirectory("libraries")
59105
add_subdirectory("demos")
@@ -63,6 +109,13 @@ add_subdirectory("tests")
63109
afr_status("=========================Resolving dependencies==========================")
64110
afr_resolve_dependencies()
65111

112+
if(DEFINED CBMC)
113+
add_subdirectory("tools/cbmc/proofs")
114+
list(FILTER cbmc_proof_names EXCLUDE REGEX "^$")
115+
list(TRANSFORM cbmc_proof_names APPEND "-goto" OUTPUT_VARIABLE all_proof_targets)
116+
add_custom_target("cbmc" DEPENDS ${all_proof_targets})
117+
endif()
118+
66119
# -------------------------------------------------------------------------------------------------
67120
# Summary
68121
# -------------------------------------------------------------------------------------------------

CONTRIBUTING.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ documentation, we greatly value feedback and contributions from our community.
66
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
77
information to effectively respond to your bug report or contribution.
88

9+
## Code of Conduct
10+
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
11+
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
12+
opensource-codeofconduct@amazon.com with any additional questions or comments.
13+
14+
15+
## Security issue notifications
16+
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.
917

1018
## Reporting Bugs/Feature Requests
1119

@@ -38,6 +46,7 @@ To send us a pull request, please:
3846
1. Send us a pull request, answering any default questions in the pull request interface.
3947
NOTE: Please make sure the default option (Allow edits from maintainers) is left checked.
4048
1. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
49+
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).
4150

4251
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
4352
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
@@ -53,17 +62,6 @@ All Pull Requests must be approved by our review team before it can be merged in
5362
## Finding contributions to work on
5463
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.
5564

56-
57-
## Code of Conduct
58-
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
59-
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
60-
opensource-codeofconduct@amazon.com with any additional questions or comments.
61-
62-
63-
## Security issue notifications
64-
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.
65-
66-
6765
## Licensing
6866

6967
See the LICENSE file for our project's licensing. We will ask you to confirm the licensing of your contribution.

PreLoad.cmake

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
# Set your compiler path here if it's not in the PATH environment variable.
2-
set(AFR_TOOLCHAIN_PATH "" CACHE INTERNAL "")
1+
# This file is to provide an easy interface to specify vendor, board, and compiler for FreeRTOS.
2+
# It is supposed to be processed first by cmake before the top level CMakeLists.txt file. Note the
3+
# behavior of this file is not officially supported by CMake. After CMake 3.17, there's a better
4+
# way for this, https://cmake.org/cmake/help/v3.17/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE_BEFORE.html
35

46
# If VENDOR or BOARD is specified, try to find a match.
57
if(DEFINED VENDOR OR DEFINED BOARD)
@@ -22,7 +24,7 @@ if(DEFINED VENDOR OR DEFINED BOARD)
2224
list(JOIN matched_boards ", " matched_boards)
2325
message(FATAL_ERROR "Multiple matching boards found: ${matched_boards}")
2426
else()
25-
set(AFR_BOARD "${matched_boards}" CACHE INTERNAL "")
27+
set(AFR_BOARD "${matched_boards}" CACHE STRING "")
2628
endif()
2729
endif()
2830

0 commit comments

Comments
 (0)