diff --git a/LA_OPT_NXP_Software_License.htm b/LA_OPT_NXP_Software_License.htm new file mode 100644 index 000000000..1c2887890 Binary files /dev/null and b/LA_OPT_NXP_Software_License.htm differ diff --git a/SW-Content-Register.txt b/SW-Content-Register.txt index fdef11c52..68477fd59 100644 --- a/SW-Content-Register.txt +++ b/SW-Content-Register.txt @@ -1,15 +1,13 @@ -NXP Software Content Register -Outgoing License: LA_OPT_NXP_SOFTWARE_License v46 - Additional distribution license granted, license in Section 2.3 applies -License in File: LICENSE.htm -Release Version: 2.6.13 +Release Name: MCUXpresso Software Development Kit (SDK) +Release Version: 2.6.14 +Package License: LA_OPT_NXP_Software_License.htm - Additional Distribution License, Section 2.3 applies KSDK_Peripheral_Driver Description: Peripheral drivers are designed for the most common use cases identified for the underlying hardware block. Author: Freescale Version: 2.x.x - Outgoing License: BSD-3-Clause - License File: COPYING-BSD-3 + License: Open Source - BSD-3-Clause Format: source code name: KSDK Peripheral Driver Location: devices//drivers @@ -18,8 +16,7 @@ Amazon_FreeRTOS Author: Real Time Engineers, Ltd. Description: IoT operating system for microcontrollers Format: source code - Outgoing License: MIT - License File: + License: MIT. See ,/rtos/amazon-freertos/License. Location: rtos/amazon-freertos name: Amazon FreeRTOS @@ -30,8 +27,7 @@ FreeRTOS_heap_newlib Author: Dave Nadler, Nadler & Associates Consulting Description: Newlib allocator for FreeRTOS Format: source code - Outgoing License: BSD-3-Clause - License File: COPYING-BSD-3 + License: Open Source - BSD-3-Clause Location: rtos/amazon-freertos/lib/FreeRTOS/portable/MemMang / @@ -41,22 +37,17 @@ FreeRTOS_heap_newlib Author: Dave Nadler, Nadler & Associates tml version: 1.0.0 -mbedtls Author: ARM - Description: Cryptographic and SSL/TLS Library +ntag_i2c_plus Author: NXP + Description: NTAG I2C plus communication library Format: source code - Outgoing License: Apache-2.0 - License File: - middleware/mbedtls/apache-2.0.txt - Location: middleware/mbedtls - name: MBED TLS stack - URL: https://tls.mbed.org/ - version: 2.13.1 + License: Open Source - BSD-3-Clause + Location: middleware/ntag_i2c_plus + name: NTAG I2C plus + version: 1.0.0 cmsisdsp name: CMSIS DSP Library Format: source code - Outgoing License: Apache-2.0 - License File: - See CMSIS/LICENSE.txt + License: Apache License 2.0, See CMSIS/LICENSE.txt parentversion: 1.5.2 Author: ARM version: 1.5.2 (CMSIS download 5.3.0) @@ -74,19 +65,137 @@ cmsiscore Author: ARM ag/5.3.0 name: CMSIS Core header files Format: source code - Outgoing License: Apache-2.0 - License File: - See CMSIS/LICENSE.txt + License: Apache License 2.0, See CMSIS/LICENSE.txt Location: CMSIS/Include version: 5.1.1 (CMSIS Download 5.3.0) Description: Industry-standard header files - distributes by ARM for cortex-M cores + distributes by ARM for cortex-M cores -ntag_i2c_plus Author: NXP - Description: NTAG I2C plus communication library +HostSDK version: 1.8.0.2 + Location: tools/wireless/hsdk + Description: Network Protocol stack serial bus + drivers and application code + License: Open Source - BSD-3-Clause + Author: NXP + name: HostSDK + Format: Binaries, Source code and header files + +FWK version: 5.7.12 + Location: middleware/wireless/framework + Description: Connectivity Framework middleware for + Connectivity stacks + License: Open Source - BSD-3-Clause + Author: NXP + name: Connectivity Framework + Format: source code and header Files + +SecLib version: 5.7.12 + Location: + middleware/wireless/framework/SecLib/lib_crypto_*. + a + Description: Connectivity Security Library + License: Proprietary, See EULA + LA_OPT_NXP_Software_License.htm + Author: NXP + name: Connectivity SecLib + Format: Binary libraries + +BLE version: 1.7.4 + Location: middleware/wireless/bluetooth + Description: Bluetooth Low Energy Software + License: Open Source - BSD-3-Clause + Author: NXP + name: Bluetooth Low Energy Application Source + Format: Source code and header Files + +BLE_HostLib version: 1.7.4 + Location: middleware/wireless/bluetooth/host/lib + Description: Bluetooth Low Energy Stack (HCI, + L2CAP, ATT, GATT, GAP and SM) + License: Proprietary, See EULA + LA_OPT_NXP_Software_License.htm + Author: NXP + name: Bluetooth Low Energy Host Firmware + Format: Binary libraries + +BLE_ControllerLib version: 9.4.21.4 + Location: middleware/wireless/ble_controller/lib + Description: Bluetooth Low Energy Controller + Firmware. Host Command Interface (HCI). + License: Proprietary, See EULA + LA_OPT_NXP_Software_License.htm + Author: RivieraWaves/CEVA + name: Bluetooth Low Energy Controller Firmware + Format: Binary libraries + +ieee_802_15_4 version: 5.3.12 + Location: middleware/wireless/ieee-802.15.4 + Description: NXP Wireless IEEE 802.15.4 + License: Proprietary, See EULA + LA_OPT_NXP_Software_License.htm + Author: NXP + name: Wireless 802.15.4 + Format: Binary libraries & header files + +mbedtls Author: ARM + Description: Cryptographic and SSL/TLS Library Format: source code - Outgoing License: BSD-3-Clause - License File: COPYING-BSD-3 - Location: middleware/ntag_i2c_plus - name: NTAG I2C plus - version: 1.0.0 \ No newline at end of file + License: Apache-2.0, + middleware/mbedtls/apache-2.0.txt + Location: middleware/mbedtls + name: MBED TLS stack + URL: https://tls.mbed.org/ + version: 2.13.1 + +ZigBee 3.0 Author: NXP + Name: JN518x ZigBee 3.0 Stack + Version: 1.0.12 + Location: middleware/wireless/zigbee + Description: ZigBee 3.0 protocol stack for JN518x + License: Proprietary, See EULA + LA_OPT_NXP_Software_License.htm + Format: object and source code + +ZigBee 3.0 ECB decrypt Author: Niyaz PK + Name: ECB decryption + Version: 1.0.12 + Location: + middleware/wireless/zigbee/BDB/Source/TouchLink + Description: ECB decryption implementation + License: Public domain + URL: + http://comp.ist.utl.pt/ec-csc/Code/Ciphers/AES_Enc + rypt.cpp + Format: source code + +ZigBee 3.0 Eclipse Plugins Author: NXP + Name: ZigBee 3.0 Eclipse Plugins + Version: 1.0.12 + Location: middleware/wireless/zigbee/tools + Description: ZigBee 3.0 plugins for Eclipse for + configuration of stack parameters + License: Eclipse Public License 1.0 + URL: http://www.eclipse.org/emf + Format: object code + +ZigBee 3.0 PDUMConfig tool Author: NXP + Name: ZigBee 3.0 PDU Manager Configuration Tool + Version: 1.0.12 + Location: middleware/wireless/zigbee/tools + Description: Converts configuration data file into + C source and header files. Built with MS .NET + framework and py2exe components + License: MIT License + URL: http://www.py2exe.org + Format: object code + +ZigBee 3.0 ZPSConfig tool Author: NXP + Name: ZigBee 3.0 ZPS Configuration Tool + Version: 1.0.12 + Location: middleware/wireless/zigbee/tools + Description: Converts configuration data file into + C source and header files. Built with MS .NET + framework and py2exe components + License: MIT License + URL: http://www.py2exe.org + Format: object code diff --git a/boards/k32w041adk6/project_template/board.h b/boards/k32w041adk6/project_template/board.h index 70f743a4e..a628889fe 100644 --- a/boards/k32w041adk6/project_template/board.h +++ b/boards/k32w041adk6/project_template/board.h @@ -24,7 +24,9 @@ /* The UART to use for debug messages. */ #define BOARD_DEBUG_UART_TYPE kSerialPort_Uart +#ifndef BOARD_DEBUG_UART_BAUDRATE #define BOARD_DEBUG_UART_BAUDRATE 115200U +#endif #define BOARD_DEBUG_UART_BASEADDR (uint32_t) USART0 #define BOARD_DEBUG_UART_INSTANCE 0U #define BOARD_DEBUG_UART_CLK_FREQ CLOCK_GetFreq(kCLOCK_Fro32M) diff --git a/boards/k32w041amdk6/project_template/board.h b/boards/k32w041amdk6/project_template/board.h index 70f743a4e..a628889fe 100644 --- a/boards/k32w041amdk6/project_template/board.h +++ b/boards/k32w041amdk6/project_template/board.h @@ -24,7 +24,9 @@ /* The UART to use for debug messages. */ #define BOARD_DEBUG_UART_TYPE kSerialPort_Uart +#ifndef BOARD_DEBUG_UART_BAUDRATE #define BOARD_DEBUG_UART_BAUDRATE 115200U +#endif #define BOARD_DEBUG_UART_BASEADDR (uint32_t) USART0 #define BOARD_DEBUG_UART_INSTANCE 0U #define BOARD_DEBUG_UART_CLK_FREQ CLOCK_GetFreq(kCLOCK_Fro32M) diff --git a/boards/k32w061dk6/project_template/board.h b/boards/k32w061dk6/project_template/board.h index 70f743a4e..a628889fe 100644 --- a/boards/k32w061dk6/project_template/board.h +++ b/boards/k32w061dk6/project_template/board.h @@ -24,7 +24,9 @@ /* The UART to use for debug messages. */ #define BOARD_DEBUG_UART_TYPE kSerialPort_Uart +#ifndef BOARD_DEBUG_UART_BAUDRATE #define BOARD_DEBUG_UART_BAUDRATE 115200U +#endif #define BOARD_DEBUG_UART_BASEADDR (uint32_t) USART0 #define BOARD_DEBUG_UART_INSTANCE 0U #define BOARD_DEBUG_UART_CLK_FREQ CLOCK_GetFreq(kCLOCK_Fro32M) diff --git a/boards/qn9090dk6/project_template/board.h b/boards/qn9090dk6/project_template/board.h index 70f743a4e..a628889fe 100644 --- a/boards/qn9090dk6/project_template/board.h +++ b/boards/qn9090dk6/project_template/board.h @@ -24,7 +24,9 @@ /* The UART to use for debug messages. */ #define BOARD_DEBUG_UART_TYPE kSerialPort_Uart +#ifndef BOARD_DEBUG_UART_BAUDRATE #define BOARD_DEBUG_UART_BAUDRATE 115200U +#endif #define BOARD_DEBUG_UART_BASEADDR (uint32_t) USART0 #define BOARD_DEBUG_UART_INSTANCE 0U #define BOARD_DEBUG_UART_CLK_FREQ CLOCK_GetFreq(kCLOCK_Fro32M) diff --git a/tools/imagetool/dk6_image_tool.py b/tools/imagetool/dk6_image_tool.py index 5c7554d6a..8420cdbb3 100644 --- a/tools/imagetool/dk6_image_tool.py +++ b/tools/imagetool/dk6_image_tool.py @@ -202,13 +202,13 @@ def HandleExtFlashSection(elf_file_name, extflash_section, sect_name): extflash_section.size)) try: - elf_file_extension = elf_file_name.split(".")[1] + elf_file_extension = os.path.splitext(elf_file_name)[1] except IndexError: print("Compiled file has no extension, adding default extension") - elf_file_extension = 'elf' + elf_file_extension = '.elf' - extflash_elf_name = elf_file_name.split(".")[0] + '_extflash.' + elf_file_extension - extflash_bin_name = extflash_elf_name.split(".")[0] + '.bin' + extflash_elf_name = os.path.splitext(elf_file_name)[0] + '_extflash' + elf_file_extension + extflash_bin_name = os.path.splitext(extflash_elf_name)[0] + '.bin' extract_section = subprocess.check_output(['arm-none-eabi-objcopy', '--only-section=' + sect_name, @@ -885,20 +885,20 @@ def BuildImageElf(args, elf_bin_file, bin_file_name, verbose): is_ext_flash_section = True try: - elf_file_extension = elf_file_name.split(".")[1] + elf_file_extension = os.path.splitext(elf_file_name)[1] except IndexError: print("Compiled file has no extension, adding default extension") - elf_file_extension = 'elf' + elf_file_extension = '.elf' - concatenated_elf_file_name = elf_file_name.split(".")[0] + '_concatenated.' + \ + concatenated_elf_file_name = os.path.splitext(elf_file_name)[0] + '_concatenated' + \ elf_file_extension - concatenated_bin_file_name = elf_file_name.split(".")[0] + '_concatenated.bin' + concatenated_bin_file_name = os.path.splitext(elf_file_name)[0] + '_concatenated.bin' ext_flash_section_descriptor_concat, ext_flash_section_descriptor, ext_flash_hash, extra_section_desc_size = HandleExtFlashSection( elf_file_name, extflash_section, '.ext_flash_text') # need to reload sections as .ext_flash_text is removed from sections sections = parse_sections(elf_file_name) # Do a copy of the .elf file used later for concatenated binary - concatenated_elf_file_name = elf_file_name.split(".")[0] + '_concatenated.' + elf_file_extension + concatenated_elf_file_name = os.path.splitext(elf_file_name)[0] + '_concatenated' + elf_file_extension shutil.copy(elf_file_name, concatenated_elf_file_name) # Update last section of both files error, boot_block_offset, img_total_len = UpdateLastSection(elf_file_name, sections, args, image_addr, @@ -1035,6 +1035,25 @@ def BuildImageElf(args, elf_bin_file, bin_file_name, verbose): print("Error while signing image") return -10 delete_file('postbuild_process_ongoing') + else: + if args.SimpleHashVerification: + from Crypto.Hash import SHA256 + print("Using simple hash verification") + # read again the whole file and compute the hash + bin_output = subprocess.check_output(['arm-none-eabi-objcopy', '-O', 'binary', elf_file_name, bin_file_name]) + with open(bin_file_name, 'rb') as in_file: + message = in_file.read() + hash = SHA256.new(message) + # append hash to last section. Note that signing parameter is set to True, but the signature + # is just the hash of the image. This just leverages the mechanism that adds the signature at + # the end of the image. + error, boot_block_offset, img_total_len = UpdateLastSection(elf_file_name, sections, args, + image_addr, stated_size, + cert_file_path, True, hash.digest(), 0, b'', b'') + if error != 0: + print("Error while adding hash of image") + return -11 + delete_file('postbuild_process_ongoing') bin_output = subprocess.check_output(['arm-none-eabi-objcopy', '-O', @@ -1050,7 +1069,7 @@ def BuildImageElf(args, elf_bin_file, bin_file_name, verbose): concatenated_elf_file_name, concatenated_bin_file_name]) - extflash_bin_name = elf_file_name.split(".")[0] + '_extflash.bin' + extflash_bin_name = os.path.splitext(elf_file_name)[0] + '_extflash.bin' if (os.path.exists(extflash_bin_name) != 0): os.system("cat " + extflash_bin_name + " >> " + concatenated_bin_file_name); @@ -1118,10 +1137,13 @@ def BuildImageElf(args, elf_bin_file, bin_file_name, verbose): parser.add_argument('-OtaHwMax', '--OtaHwVersionMax', type=int, help="define max of Hw versions compatible with OTA file. Implies inclusion in OTA header") +parser.add_argument('-SimpleHashVerification', '--SimpleHashVerification', action='store_true', + help="When option is selected, the hash of the image is appended at the end. Should be used without secure boot.") + args = parser.parse_args() elf_file_name = os.path.abspath(args.in_file) -bin_file_name = elf_file_name.split(".")[0] + '_temp.bin' +bin_file_name = os.path.splitext(elf_file_name)[0] + '_temp.bin' if args.out_file is None: args.out_file = elf_file_name diff --git a/tools/imagetool/sign_images.sh b/tools/imagetool/sign_images.sh index ca2306270..10fd90462 100644 --- a/tools/imagetool/sign_images.sh +++ b/tools/imagetool/sign_images.sh @@ -64,9 +64,14 @@ is_python_package_installed "pycrypto" is_python_package_installed "pycryptodome" CURR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +ADDITIONAL_ARGS="" -if [ $# -eq 2 ]; then - SIGNING_TOOL=$2/dk6_image_tool.py +if [ $# -ge 2 ]; then + ADDITIONAL_ARGS=$2 +fi + +if [ $# -eq 3 ]; then + SIGNING_TOOL=$3/dk6_image_tool.py else SIGNING_TOOL=$CURR_DIR/dk6_image_tool.py fi @@ -77,7 +82,7 @@ if [ "$#" -gt 0 ]; then DIR_WITH_ELFS=$1 for FILENAME in $DIR_WITH_ELFS/*; do - MIME_SET="$(file -ib $FILENAME)" + MIME_SET="$(file -b --mime $FILENAME)" if [[ $MIME_SET == *"$MIME_PATTERN"* ]]; then OTA_ENABLED=0 @@ -88,7 +93,7 @@ if [ "$#" -gt 0 ]; then OTA_ENABLED=1 fi - python3 $SIGNING_TOOL -i="$OTA_ENABLED" $FILENAME + python3 $SIGNING_TOOL -i="$OTA_ENABLED" $ADDITIONAL_ARGS $FILENAME arm-none-eabi-objcopy -O binary $FILENAME $FILENAME.bin fi done diff --git a/west.yml b/west.yml index fc26ea9f4..021840224 100644 --- a/west.yml +++ b/west.yml @@ -24,28 +24,28 @@ manifest: path: core projects: - name: mcux-sdk-examples - revision: 6735550f5a41dfb997d4dd3ce6eebfe1f1d41054 + revision: 567747d8e460b3b677bcf0ed3b119f4fdc3386c7 path: examples remote: nxp-mcuxpresso - name: mcux-sdk-middleware-connectivity-framework - revision: 2ccc3df70ee5b73c451fceee13e6172518412518 + revision: b5380f902609005111c0545476833b9f94d2694d path: middleware/wireless/framework remote: nxp - name: mcux-sdk-middleware-bluetooth-controller path: middleware/wireless/ble_controller - revision: 0e4effc707a0d5569160b9335bc2e57c17255f01 + revision: 469b73d5b42a8b7077eb1334aa1fc985fc902207 remote: nxp - name: mcux-sdk-middleware-bluetooth-host path: middleware/wireless/bluetooth - revision: e5a1b7b9e3b44b49c6c0318edfc3acac74b342d8 + revision: 9a115d68989e791d519cab03b62dd759f75dfc76 remote: nxp - name: mcux-sdk-middleware-ieee_802.15.4 path: middleware/wireless/ieee-802.15.4 - revision: e8c96197346a7e37ce3a872096a22bf4aee47e3d + revision: c7ea1af78df4342930c70e6eab6f5dc543204e30 remote: nxp - name: mcux-sdk-middleware-zigbee path: middleware/wireless/zigbee - revision: 77dc56b1e2d8fabe66361702ce45fc989dbd7940 + revision: ae221683648919ddbd5f2472cb9b8f832ef72292 remote: nxp-mcuxpresso - name: amazon-freertos path: rtos/amazon-freertos