### Setup External Packages Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/tools/ble/ble_agent/README.md Upgrades pip and wheel, then installs project dependencies from requirements.txt. Use the --proxy argument if your network requires it. ```bash python -m pip install --upgrade pip [--proxy ] pip install --upgrade wheel [--proxy ] pip install -r requirements.txt [--proxy ] ``` -------------------------------- ### Setup External Packages Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/tools/ble/ble_agent/ble_device/README.md Installs necessary Python packages, including upgrading pip and wheel. Use the [--proxy] option if your network requires it. ```bash python -m pip install --upgrade pip [--proxy ] pip install --upgrade wheel [--proxy ] pip install -r requirements.txt [--proxy ] ``` -------------------------------- ### Install Device Configuration and Include Directories Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/tfm/platform/ext/target/arm/musca_b1/CMakeLists.txt Installs device configuration and include directories to the NS installation path. ```cmake install(DIRECTORY Device/Config Device/Include DESTINATION ${INSTALL_PLATFORM_NS_DIR}/Device ) ``` -------------------------------- ### Build Examples for Simulator Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/freertos/portable/ThirdParty/XCC/Xtensa/readme_xtensa.txt Build all example projects for the default platform, which is the simulator. ```bash cd demos/cadence/sim xt-make all ``` -------------------------------- ### Install Device and HAL Files Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/tfm/platform/ext/target/stm/common/stm32h5xx/CMakeLists.txt Installs device-specific startup and system files, along with HAL headers and sources, to the platform's installation directory. ```cmake install(FILES ${CMAKE_CURRENT_LIST_DIR}/Device/Source/startup_stm32h5xx_ns.c ${CMAKE_CURRENT_LIST_DIR}/Device/Source/Templates/system_stm32h5xx.c DESTINATION ${INSTALL_PLATFORM_NS_DIR}/Device/Source) install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/hal/Inc ${CMAKE_CURRENT_LIST_DIR}/hal/Src ${STM_COMMON_DIR}/hal/CMSIS_Driver DESTINATION ${INSTALL_PLATFORM_NS_DIR}/hal) install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/Device/Include DESTINATION ${INSTALL_PLATFORM_NS_DIR}/Device) install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/boards DESTINATION ${INSTALL_PLATFORM_NS_DIR}) ``` -------------------------------- ### Example Command Line Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/ti/zigbee/application/onoff_switch_ota_client/README.md Command to run the tilogger utility for the onoff_switch example. ```bash tilogger --elf examples/rtos/LP_EM_CC2755P20/zigbee/onoff_switch/freertos/ticlang/onoff_switch.out uart COM24 115200 stdout ``` -------------------------------- ### Install Partition and Native Driver Directories Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/tfm/platform/ext/target/arm/musca_b1/CMakeLists.txt Installs the 'partition' and 'Native_Driver' directories to the NS installation path. ```cmake install(DIRECTORY partition Native_Driver DESTINATION ${INSTALL_PLATFORM_NS_DIR} ) ``` -------------------------------- ### Install Executables and Programs Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/mbedtls/programs/psa/CMakeLists.txt Installs the built executable targets to the 'bin' directory with specific file permissions. Also installs shell scripts like 'key_ladder_demo.sh' to the 'bin' directory. ```cmake install(TARGETS ${executables} DESTINATION "bin" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) install(PROGRAMS key_ladder_demo.sh DESTINATION "bin") ``` -------------------------------- ### Install Platform Configuration Files Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/tfm/platform/ext/target/arm/mps3/corstone310/an555/CMakeLists.txt Installs the 'config.cmake' and 'check_config.cmake' files from the target platform path to the non-secure installation directory. These files are essential for configuring and validating the platform build. ```cmake install(FILES ${TARGET_PLATFORM_PATH}/config.cmake ${TARGET_PLATFORM_PATH}/check_config.cmake DESTINATION ${INSTALL_PLATFORM_NS_DIR}) ``` -------------------------------- ### Setup CMake Build Environment Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/CMakeLists.txt Sets the common installation directory for CMake and includes a common configuration script. This establishes the build environment. ```cmake set(CMAKE_COMMON_INSTALL_DIR ${CMAKE_SOURCE_DIR}) include(source/cmake/scripts/cmake-common/Configure.cmake) project(coresdk LANGUAGES) ``` -------------------------------- ### Build and Prepare OTA Images (Step-by-Step) Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/ti/zigbee/application/onoff_switch_ota_client/README.md This sequence covers activating the environment, generating build configurations, and building both the initial V1 image and the V2 OTA update image. ```bash source activate.sh python3 tools/ex_gen/gen.py -l -b # V1 (flash to device): gmake -C examples/rtos//zigbee/onoff_switch_ota_client_onchip/freertos/ticlang # V2 (OTA update image): OTA_VER=2.0.0+0 gmake -C examples/rtos//zigbee/onoff_switch_ota_client_onchip/freertos/ticlang ``` -------------------------------- ### Platform Configuration Checker Example Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/tfm/docs/integration_guide/platform/porting_tfm_to_a_new_hardware.rst An optional CMake file to enforce specific configurations or prevent unsupported setups within the TF-M build system. ```cmake # check_config.cmake ``` -------------------------------- ### Build Examples for KC705 Board Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/freertos/portable/ThirdParty/XCC/Xtensa/readme_xtensa.txt Build all example projects targeting the Xilinx KC705 FPGA development board. ```bash xt-make all TARGET=kc705 ``` -------------------------------- ### Build Examples for ML605 Board Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/freertos/portable/ThirdParty/XCC/Xtensa/readme_xtensa.txt Build all example projects targeting the Xilinx ML605 FPGA development board. ```bash xt-make all TARGET=ml605 ``` -------------------------------- ### Replay File Transport Example: Stdout and Wireshark Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/tools/log/tiutils/README.md Replay logs from a specified JSON file and output them to stdout and Wireshark. Attempts to start and configure Wireshark. ```bash tilogger from-replayfile path/to/replayFile.json wireshark --start ``` -------------------------------- ### Get Current Directory Path with f_getcwd Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/fatfs/documents/doc/getcwd.html This example demonstrates how to use the f_getcwd function to retrieve the current directory path. Ensure the buffer size is correctly specified. Available when FF_FS_RPATH is 2. ```c TCHAR str[256]; fr = _f_getcwd_(str, sizeof str / sizeof *str); /* Get current directory path */ ``` -------------------------------- ### UART Transport Example: Stdout and Wireshark Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/tools/log/tiutils/README.md Listen for UART input, pipe output to stdout and Wireshark. Attempts to start and configure Wireshark. Requires symbol file path, COM port, and baudrate. ```bash tilogger uart --elf my_elf.out COM4 3000000 stdout wireshark --start ``` -------------------------------- ### Get Symmetric IAK Key Identifier Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/tfm/docs/design_docs/services/symmetric_initial_attest.rst Retrieves the key identifier of the symmetric IAK, which is used as the 'kid' parameter in COSE Header. This function is optional if the device does not install a key identifier for the symmetric IAK. ```APIDOC ## attest_plat_get_symmetric_iak_id() ### Description Gets the key identifier of the symmetric IAK as the ``kid`` parameter in COSE Header. This is optional if the device doesn't install a key identifier for symmetric IAK. ### Function Signature ```c enum tfm_plat_err_t attest_plat_get_symmetric_iak_id(void *kid_buf, size_t buf_len, size_t *kid_len); ``` ### Parameters #### Input/Output Parameters - **kid_buf** (void *) - Buffer to store the IAK identifier. - **buf_len** (size_t) - The length of ``kid_buf``. - **kid_len** (size_t *) - The length of the IAK identifier. ### Return Value Returns error code specified in ``enum tfm_plat_err_t``. ``` -------------------------------- ### Build Examples with Custom Build Directory Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/freertos/portable/ThirdParty/XCC/Xtensa/readme_xtensa.txt Build example projects, specifying a custom root directory for the build output using BLDROOT. ```bash xt-make all BLDROOT= ``` -------------------------------- ### Basic tilogger Usage with ITM and Wireshark Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/tools/log/tiutils/Readme.html A simple example demonstrating how to use tilogger to parse ITM transport data from a COM port and output it to Wireshark. Requires the ELF symbol file and Wireshark installation. ```bash tilogger --elf path/to/elf.out itm COM3 12000000 wireshark --start ``` -------------------------------- ### FatFs f_fdisk and f_mkfs Example Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/fatfs/documents/doc/fdisk.html Demonstrates how to divide a physical drive into two partitions using f_fdisk and then create FAT file systems on these new partitions using f_mkfs. Ensure FF_MAX_SS is defined appropriately for the work buffer size. ```c /* Initialize a brand-new disk drive mapped to physical drive 0 */ DWORD plist[] = {50, 50, 0, 0}; /* Divide drive into two partitions */ BYTE work[FF_MAX_SS]; _f_fdisk_(0, plist, work); /* Divide physical drive 0 */ f_mkfs("0:", FM_ANY, work, sizeof work); /* Create FAT volume on the logical drive 0 */ f_mkfs("1:", FM_ANY, work, sizeof work); /* Create FAT volume on the logical drive 1 */ ``` -------------------------------- ### Include Example Partition Kconfig Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/tfm/docs/integration_guide/services/tfm_secure_partition_addition.rst Add the example partition's Kconfig file to the main Kconfig file. ```kconfig rsource ``example/Kconfig`` ``` -------------------------------- ### Get Free Clusters and Volume Information Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/fatfs/documents/doc/getfree.html This example demonstrates how to use f_getfree to retrieve the number of free clusters and total volume information for a specific drive. It then calculates and prints the total and available free space in KiB. ```c FATFS *fs; DWORD fre_clust, fre_sect, tot_sect; /* Get volume information and free clusters of drive 1 */ res = _f_getfree_("1:", &fre_clust, &fs); if (res) die(res); /* Get total sectors and free sectors */ tot_sect = (fs->n_fatent - 2) * fs->csize; fre_sect = fre_clust * fs->csize; /* Print the free space (assuming 512 bytes/sector) */ printf("%10lu KiB total drive space.\n%10lu KiB available.\n", tot_sect / 2, fre_sect / 2); ``` -------------------------------- ### Example User Record File Content Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/tools/common/crc_tool/user_record_example.txt This snippet shows the content of a user record text file. It includes hexadecimal integers separated by whitespace and newlines, with comments explaining the format and integer numbering. Blank lines and lines starting with '#' are ignored. ```text # Example of user record txt file format, blank lines and lines starting with "#" will be ignored. # Format is a series of hexadecimal integers separated by whitespace/newlines. # Integers are inserted in little endian. # Integers must consist of an even number of hex characters. # 1 is invalid, 01 is valid # Here is the actual data, the integers are numbered in order to be recognized later: # integer #1 #2 #3 #4 #5 0x0123456789ABCDEF EF 0123 0000 0x0ABCDE # Newline can also be used as divider # Integer #6 BCDE ``` -------------------------------- ### Install Platform Specific Directories Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/tfm/platform/ext/target/nuvoton/m2351/CMakeLists.txt Installs platform-specific directories to the non-secure installation directory. ```cmake install(DIRECTORY ${TARGET_PLATFORM_PATH}/device ${TARGET_PLATFORM_PATH}/bsp ${TARGET_PLATFORM_PATH}/../common/cmsis_drivers ${TARGET_PLATFORM_PATH}/../common/retarget DESTINATION ${INSTALL_PLATFORM_NS_DIR}) ``` -------------------------------- ### Format Drive and Create File Example Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/fatfs/documents/doc/mkfs.html This C code snippet demonstrates how to format a drive using _f_mkfs, mount the filesystem, create a new file, write data to it, close the file, and unmount the filesystem. It includes error checking for each operation. ```c int main (void) { FATFS fs; FIL fil; FRESULT res; UINT bw; BYTE work[FF_MAX_SS]; res = _f_mkfs("", FM_ANY, 0, work, sizeof work); if (res) ... f_mount(&fs, "", 0); res = f_open(&fil, "hello.txt", FA_CREATE_NEW | FA_WRITE); if (res) ... f_write(&fil, "Hello, World!\r\n", 15, &bw); if (bw != 15) ... f_close(&fil); f_mount(0, "", 0); ... ``` -------------------------------- ### Run Device Provisioning Helper Script Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/tfm/docs/platform/cypress/psoc64/cypress_psoc64_spec.rst Execute the reprov_helper.py script to provision device certificates. Use --help for a full list of options if not using defaults. ```bash python3 reprov_helper.py ``` -------------------------------- ### Install Linker Scripts Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/tfm/platform/ext/target/nordic_nrf/common/core/CMakeLists.txt Installs platform-specific linker scripts to the designated installation directory. ```cmake DESTINATION ${INSTALL_PLATFORM_NS_DIR}/linker_scripts) ``` -------------------------------- ### Install BL2 Preprocessing File Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/tfm/platform/ext/target/stm/stm32h573i_dk/CMakeLists.txt Installs the generated BL2 preprocessing file to the installation prefix. ```cmake install(FILES ${BL2_FILE_TO_PREPROCESS} DESTINATION ${CMAKE_INSTALL_PREFIX} ) ``` -------------------------------- ### Build Examples with Custom CFLAGS Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/freertos/portable/ThirdParty/XCC/Xtensa/readme_xtensa.txt Build example projects, overriding default compilation options by specifying custom CFLAGS. ```bash xt-make all TARGET=sim CFLAGS="-O2 -Os -g" ``` -------------------------------- ### Install P256-M Library Target Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/mbedtls/3rdparty/p256-m/CMakeLists.txt Installs the P256-M library target to the specified installation directory. ```cmake install(TARGETS ${p256m_target} EXPORT MbedTLSTargets DESTINATION ${CMAKE_INSTALL_LIBDIR} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) ``` -------------------------------- ### Example Specific Partition Load Information Structure (C) Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/tfm/docs/design_docs/services/secure_partition_manager.rst Illustrates an example of a specific partition's load information structure, extending the common structure with partition-specific details like dependencies. This allows for variable-sized load information. ```c struct partition_example_load_info_t { struct partition_load_info_t ldi; /* Common info info */ uint32_t deps[10]; /* Dependencies */ /* ... other infos ... */ }; ``` -------------------------------- ### Install Device Include Directory Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/tfm/platform/ext/target/stm/common/stm32u5xx/CMakeLists.txt Installs the Device/Include directory to the platform's non-secure installation directory. ```cmake install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Device/Include DESTINATION ${INSTALL_PLATFORM_NS_DIR}/Device ) ``` -------------------------------- ### Build MemXS Test Application Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/hsmddk/include/TestTools/MemXS/docs/readme_memxs.txt Navigate to the build directory and execute the make command to build the memxs executable. Ensure the Driver Framework user-space library is available. ```bash cd $TOP_DIR/MemXS/build make ``` -------------------------------- ### Install Platform Specific Files Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/tfm/platform/ext/target/nuvoton/m2351/CMakeLists.txt Installs platform-specific C source files to the non-secure installation directory. ```cmake install(FILES ${TARGET_PLATFORM_PATH}/device/source/startup_m2351.c ${PLATFORM_DIR}/ext/target/nuvoton/common/native_drivers/arm_uart_drv.c ${PLATFORM_DIR}/ext/target/nuvoton/common/native_drivers/timer_cmsdk.c DESTINATION ${INSTALL_PLATFORM_NS_DIR}) ``` -------------------------------- ### Directly Build Documentation (Linux) Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/tfm/docs/building/documentation_generation.rst Builds both the User Guide and Reference Manual directly using Sphinx command-line tools. This involves copying the Sphinx configuration and running the build from the 'build_docs' directory. ```bash # Build the documentation from build_docs directory cd mkdir build_docs cp docs/conf.py build_docs/conf.py cd build_docs sphinx-build ./ user_guide ``` -------------------------------- ### Run Demo Application with VAL Driver Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/hsmddk/include/Examples/DemoApp_OTPKeyBlob/docs/readme_da_otpkeyblob.txt Loads necessary drivers, creates a device node, runs the demo application, and then unloads the drivers and removes the device node. ```bash # insmod driver_gc_k.ko # insmod driver_val_k.ko # major_nr=`awk "\$2=="vexp_c" {print \$1}" /proc/devices` # mknod /dev/vexp_c c ${major_nr} 0 # ./da_otpkeyblob_up # rmmod driver_val_k # rmmod driver_gc_k # rm /dev/vexp_c ``` -------------------------------- ### Install CMSIS Driver Configuration Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/tfm/platform/ext/target/arm/musca_b1/CMakeLists.txt Installs the CMSIS driver configuration directory to the NS installation path. ```cmake install(DIRECTORY CMSIS_Driver/Config DESTINATION ${INSTALL_PLATFORM_NS_DIR}/CMSIS_Driver ) ``` -------------------------------- ### Run Demo Application in User Mode (VAL Driver) Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/hsmddk/include/Examples/DemoApp_SecureDebug/docs/readme_da_securedebug.txt Loads necessary drivers, creates a device node, runs the user mode application, and then unloads the drivers. This sequence is for the VAL driver. ```bash # insmod driver_gc_k.ko # insmod driver_val_k.ko # major_nr=`awk "\$2==\"vexp_c\" {print \$1}" /proc/devices` # mknod /dev/vexp_c c ${major_nr} 0 # ./da_securedebug_up # rmmod driver_val_k # rmmod driver_gc_k # rm /dev/vexp_c ``` -------------------------------- ### Install Virtual Environment Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/tools/ble/ble_agent/README.md Installs and activates a virtual environment for the project. Use the --proxy argument if your network requires it. ```bash cd c:\Python310\python.exe -m pip install virtualenv [--proxy ] c:\Python310\python.exe -m venv .venv .venv\Scripts\activate ``` -------------------------------- ### Install TFM Test Configurations Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/tfm/platform/ext/target/arm/mps2/an519/CMakeLists.txt Installs the 'tests' directory from the active platform directory to the installation destination. ```cmake install(DIRECTORY ${TARGET_PLATFORM_PATH}/tests DESTINATION ${INSTALL_PLATFORM_NS_DIR}) ``` -------------------------------- ### Client Hello Cipher Suites Writing Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/mbedtls/docs/architecture/tls13-support.md Example of writing client hello cipher suites. Ensure buffer space is checked before writing and update the buffer pointer accordingly. ```c ret = ssl_tls13_write_client_hello_cipher_suites( ssl, buf, end, &output_len ); if( ret != 0 ) return( ret ); buf += output_len; ``` -------------------------------- ### Install Python Scripts Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/tfm/platform/ext/target/stm/common/stm32u5xx/CMakeLists.txt Installs utility Python scripts required for the build process to the specified installation prefix. ```cmake install(FILES ${STM_COMMON_DIR}/scripts/stm_tool.py ${STM_COMMON_DIR}/scripts/bin2hex.py ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../bl2/ext/mcuboot/scripts/macro_parser.py DESTINATION ${CMAKE_INSTALL_PREFIX}/scripts ) ``` -------------------------------- ### Install Non-Secure Platform Directories Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/tfm/platform/ext/target/stm/stm32h573i_dk/CMakeLists.txt Installs the non-secure specific directories (ns/, include/) of the platform to the installation path. ```cmake install(DIRECTORY ${TARGET_PLATFORM_PATH}/ns/ DESTINATION ${INSTALL_PLATFORM_NS_DIR}) install(DIRECTORY ${TARGET_PLATFORM_PATH}/include DESTINATION ${INSTALL_PLATFORM_NS_DIR}) ``` -------------------------------- ### Install Common BSP Include Directory Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/tfm/platform/ext/target/nuvoton/m2351/CMakeLists.txt Installs the common BSP include directory to the non-secure installation directory. ```cmake install(DIRECTORY ${TARGET_PLATFORM_PATH}/../common/bsp/Include ``` -------------------------------- ### Creating Directories with f_mkdir Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/fatfs/documents/doc/mkdir.html This example demonstrates how to use the f_mkdir function to create nested directories. It shows sequential creation of 'sub1', 'sub1/sub2', and 'sub1/sub2/sub3'. Error handling is included to check the return value of each call. ```c res = _f_mkdir_("sub1"); if (res) die(res); res = _f_mkdir_("sub1/sub2"); if (res) die(res); res = _f_mkdir_("sub1/sub2/sub3"); if (res) die(res); ``` -------------------------------- ### Build TF-M User Guide (Windows) Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/tfm/docs/building/documentation_generation.rst Builds the TF-M User Guide in HTML and PDF formats using CMake with the 'Unix Makefiles' generator. The output will be in 'build_docs/user_guide'. ```bash cd cmake -S docs -B build_docs -G"Unix Makefiles" cmake --build build_docs -- tfm_docs_userguide_html tfm_docs_userguide_pdf ``` -------------------------------- ### Install Device Source Files Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/tfm/platform/ext/target/arm/musca_b1/CMakeLists.txt Installs device-specific source files for the Musca-B1 platform to the NS installation directory. ```cmake install(FILES Device/Source/startup_musca.c Device/Source/system_core_init.c Device/Source/device_definition.c DESTINATION ${INSTALL_PLATFORM_NS_DIR}/Device/Source ) ``` -------------------------------- ### Initialize SCFG Key Ring Configuration Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/ti/common/secure_boot/README.md Run `sbtool` to generate the `sb_key_ring_init.h` configuration file using the generated private keys. This file is needed if the Authentication Method in SysConfig is not 'No Authentication'. ```bash sbtool init --key-update-key kui-rsa-3k-pkcs-priv.pem --app-key app-rsa-3k-pkcs-priv.pem --ssb-key ssb-rsa-3k-pkcs-priv.pem ``` -------------------------------- ### Load Drivers and Run OTP Program (VAL API) Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/hsmddk/include/Examples/DemoApp_OTPProgram/docs/readme_da_otpprogram.txt Loads the Global Control and VAL drivers, creates the /dev/vexp_c device node, and runs the da_otpprogram_up application. Includes steps to unload drivers and remove the device node. ```bash # insmod driver_gc_k.ko # insmod driver_val_k.ko # major_nr=`awk "\$2=="vexp_c" {print \$1}" /proc/devices` # mknod /dev/vexp_c c ${major_nr} 0 # ./da_otpprogram_up # rmmod driver_val_k # rmmod driver_gc_k # rm /dev/vexp_c ``` -------------------------------- ### Install Common Driver Headers Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/tfm/platform/ext/target/arm/musca_b1/CMakeLists.txt Installs common driver header files to the Non-Secure (NS) installation directory. ```cmake install(FILES ${PLATFORM_DIR}/ext/driver/Driver_Common.h ${PLATFORM_DIR}/ext/driver/Driver_Flash.h ${PLATFORM_DIR}/ext/driver/Driver_USART.h DESTINATION ${INSTALL_PLATFORM_NS_DIR}/ext/driver) ``` -------------------------------- ### Install Build Scripts Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/tfm/platform/ext/target/stm/common/stm32u5xx/CMakeLists.txt Installs various shell scripts used for build, preprocessing, and post-build operations to the installation prefix. ```cmake install(FILES ${STM_COMMON_DIR}/scripts/regression.sh ${PREPROCESSOR_FILE} ${STM_COMMON_DIR}/scripts/TFM_UPDATE.sh ${STM_COMMON_DIR}/scripts/TFM_BIN2HEX.sh ${STM_COMMON_DIR}/scripts/postbuild.sh PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ DESTINATION ${CMAKE_INSTALL_PREFIX} ) ``` -------------------------------- ### Enable Example Partition in CMake Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/tfm/docs/integration_guide/services/tfm_secure_partition_addition.rst Set the TFM_PARTITION_EXAMPLE configuration option to ON in the base CMake configuration file. ```cmake set(TFM_PARTITION_EXAMPLE OFF CACHE BOOL "Enable the example partition") ``` -------------------------------- ### Load Drivers and Run VAL Demo Application Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/hsmddk/include/Examples/DemoApp_VAL_Specials/docs/readme_da_val_specials.txt Loads the Global Control and VAL drivers, creates the /dev/vexp_c device node, runs the da_val_specials_up application, and then unloads the drivers and removes the device node. ```bash # insmod driver_gc_k.ko # insmod driver_val_k.ko # major_nr=`awk "\$2==\"vexp_c\" {print \$1}" /proc/devices` # mknod /dev/vexp_c c ${major_nr} 0 # ./da_val_specials_up [ ...] # rmmod driver_val_k # rmmod driver_gc_k # rm /dev/vexp_c ``` -------------------------------- ### Install Platform Files for Non-Secure Build Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/tfm/platform/ext/target/nuvoton/m2354/CMakeLists.txt Installs platform-specific source files (startup, drivers) to the non-secure installation directory. ```cmake install(FILES ${TARGET_PLATFORM_PATH}/device/source/startup_m2354.c ${PLATFORM_DIR}/ext/target/nuvoton/common/native_drivers/arm_uart_drv.c ${PLATFORM_DIR}/ext/target/nuvoton/common/native_drivers/timer_cmsdk.c DESTINATION ${INSTALL_PLATFORM_NS_DIR}) ``` -------------------------------- ### Build and Install Project Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/tfm/docs/platform/stm/b_u585i_iot02a/readme.rst Builds the project and installs the necessary artifacts. This command is used after the CMake configuration step. ```bash > cmake --build ./ -- install ``` -------------------------------- ### Install Platform Header Files Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/tfm/platform/ext/target/stm/stm32h573i_dk/CMakeLists.txt Installs platform-specific header files for flash layout and region definitions to the installation prefix. ```cmake install(FILES ${STM32H573I_DK_DIR}/include/flash_layout.h ${STM32H573I_DK_DIR}/include/region_defs.h DESTINATION ${CMAKE_INSTALL_PREFIX} ) ``` -------------------------------- ### Build Demo Application Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/hsmddk/include/Examples/DemoApp_OTPKeyBlob/docs/readme_da_otpkeyblob.txt Builds the da_otpkeyblob module and user mode application using the make command. ```bash # cd Examples/DemoApp_OTPKeyBlob/build # make ``` -------------------------------- ### Install TFM Platform Configuration Files Source: https://github.com/texasinstruments/simplelink-lowpower-f3-sdk/blob/main/source/third_party/tfm/platform/ext/target/arm/mps2/an519/CMakeLists.txt Installs cpuarch.cmake and config.cmake files from the active platform directory to the installation destination. ```cmake install(FILES ${TARGET_PLATFORM_PATH}/cpuarch.cmake ${TARGET_PLATFORM_PATH}/config.cmake DESTINATION ${INSTALL_PLATFORM_NS_DIR}) ```