├── .devcontainer ├── Dockerfile └── devcontainer.json ├── .github ├── .cSpellWords.txt ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── config.yml │ ├── documentation-issue.md │ └── feature-request.md ├── pull_request_template.md └── workflows │ ├── build.yaml │ └── ci.yml ├── .gitignore ├── .gitlab-ci.yml ├── .gitmodules ├── .pre-commit-config.yaml ├── .vscode ├── launch.json ├── settings.json └── tasks.json ├── CHANGELOG.md ├── CMakeLists.txt ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── DCO.txt ├── LICENSE ├── NOTICE.txt ├── README.md ├── applications ├── blinky │ ├── CMakeLists.txt │ ├── TfmInitialCache.cmake │ ├── configs │ │ ├── CMakeLists.txt │ │ ├── app_config │ │ │ ├── CMakeLists.txt │ │ │ └── app_config.h │ │ ├── freertos_config │ │ │ ├── CMakeLists.txt │ │ │ └── FreeRTOSConfig.h │ │ └── tfm_config │ │ │ └── project_config.h │ ├── main.c │ └── tests │ │ ├── corstone300_pass_output.log │ │ ├── corstone310_pass_output.log │ │ ├── corstone315_pass_output.log │ │ ├── corstone320_pass_output.log │ │ └── fail_output.log ├── freertos_iot_libraries_tests │ ├── CMakeLists.txt │ ├── TfmInitialCache.cmake │ ├── configs │ │ ├── CMakeLists.txt │ │ ├── app_config │ │ │ ├── CMakeLists.txt │ │ │ └── app_config.h │ │ ├── aws_configs │ │ │ ├── CMakeLists.txt │ │ │ ├── MQTTFileDownloader_config.h │ │ │ ├── aws_clientcredential.h │ │ │ ├── aws_mqtt_config.h │ │ │ ├── aws_secure_sockets_config.h │ │ │ ├── core_mqtt_config.h │ │ │ ├── core_pkcs11_config.h │ │ │ ├── demo_config.h │ │ │ ├── iot_default_root_certificates.h │ │ │ ├── mqtt_demo_mutual_auth_config.h │ │ │ ├── ota_config.h │ │ │ └── ota_demo_config.h │ │ ├── freertos_config │ │ │ ├── CMakeLists.txt │ │ │ ├── FreeRTOSConfig.h │ │ │ └── FreeRTOSIPConfig.h │ │ ├── mbedtls_config │ │ │ ├── CMakeLists.txt │ │ │ ├── aws_mbedtls_config.h │ │ │ └── threading_alt.h │ │ └── tfm_config │ │ │ └── project_config.h │ ├── integration_tests_platform_function.c │ ├── main.c │ ├── test_execution_config.h │ ├── test_param_config.h │ └── unistd.h ├── helpers │ ├── CMakeLists.txt │ ├── crt_helpers │ │ ├── CMakeLists.txt │ │ ├── inc │ │ │ └── app_strnlen.h │ │ └── src │ │ │ └── app_strnlen.c │ ├── device_advisor │ │ ├── CMakeLists.txt │ │ ├── inc │ │ │ └── aws_device_advisor_task.h │ │ └── src │ │ │ └── aws_device_advisor_task.c │ ├── ethosu │ │ └── src │ │ │ └── ethosu_platform_adaptation.c │ ├── events │ │ ├── CMakeLists.txt │ │ ├── inc │ │ │ └── events.h │ │ ├── mocks │ │ │ ├── CMakeLists.txt │ │ │ ├── inc │ │ │ │ └── events.h │ │ │ └── src │ │ │ │ └── events.c │ │ └── src │ │ │ └── events.c │ ├── hdlcd │ │ ├── CMakeLists.txt │ │ ├── hdlcd_helper.c │ │ └── hdlcd_helper.h │ ├── logging │ │ ├── CMakeLists.txt │ │ ├── inc │ │ │ ├── iot_logging_task.h │ │ │ ├── logging_levels.h │ │ │ └── logging_stack.h │ │ ├── mocks │ │ │ ├── CMakeLists.txt │ │ │ └── inc │ │ │ │ ├── logging_levels.h │ │ │ │ └── logging_stack.h │ │ └── src │ │ │ └── iot_logging_task_dynamic_buffers.c │ ├── ota_orchestrator │ │ ├── CMakeLists.txt │ │ ├── inc │ │ │ ├── mqtt_helpers.h │ │ │ ├── ota_appversion32.h │ │ │ ├── ota_orchestrator_helpers.h │ │ │ ├── ota_os_freertos.h │ │ │ ├── ota_register_callback.h │ │ │ └── ota_types_definitions.h │ │ └── src │ │ │ ├── mqtt_helpers.c │ │ │ ├── ota_orchestrator.c │ │ │ ├── ota_orchestrator_helpers.c │ │ │ └── ota_os_freertos.c │ ├── provisioning │ │ ├── CMakeLists.txt │ │ ├── cmake │ │ │ └── SetProvisioningLinkOptions.cmake │ │ ├── dev_mode_key_provisioning.c │ │ ├── dev_mode_key_provisioning.h │ │ ├── provisioning_config.h │ │ ├── provisioning_data.c │ │ ├── provisioning_data.h │ │ ├── provisioning_data.ld │ │ └── provisioning_data.sct │ └── sntp │ │ ├── CMakeLists.txt │ │ ├── inc │ │ ├── core_sntp_config.h │ │ └── sntp_client_task.h │ │ └── src │ │ └── sntp_client_task.c ├── keyword_detection │ ├── CMakeLists.txt │ ├── TfmInitialCache.cmake │ ├── blink_task.c │ ├── blink_task.h │ ├── configs │ │ ├── CMakeLists.txt │ │ ├── app_config │ │ │ ├── CMakeLists.txt │ │ │ └── app_config.h │ │ ├── aws_configs │ │ │ ├── CMakeLists.txt │ │ │ ├── MQTTFileDownloader_config.h │ │ │ ├── aws_clientcredential.h │ │ │ ├── aws_mqtt_config.h │ │ │ ├── aws_secure_sockets_config.h │ │ │ ├── core_mqtt_config.h │ │ │ ├── core_pkcs11_config.h │ │ │ ├── demo_config.h │ │ │ ├── iot_default_root_certificates.h │ │ │ ├── mqtt_agent_demo_config.h │ │ │ ├── mqtt_demo_mutual_auth_config.h │ │ │ ├── ota_config.h │ │ │ └── ota_demo_config.h │ │ ├── freertos_config │ │ │ ├── CMakeLists.txt │ │ │ ├── FreeRTOSConfig.h │ │ │ └── FreeRTOSIPConfig.h │ │ ├── mbedtls_config │ │ │ ├── CMakeLists.txt │ │ │ ├── aws_mbedtls_config.h │ │ │ └── threading_alt.h │ │ └── tfm_config │ │ │ └── project_config.h │ ├── main.c │ ├── ml-model-update-demo │ │ ├── faulty_kws_micronet_m.tflite │ │ └── kws_micronet_m.tflite │ ├── ml_interface.cc │ ├── ml_interface.h │ ├── model_config.cc │ ├── resources │ │ ├── test.wav │ │ └── use_case_resources.json │ └── tests │ │ ├── corstone300_model_pass_output.log │ │ ├── corstone300_pass_output.log │ │ ├── corstone310_model_pass_output.log │ │ ├── corstone310_pass_output.log │ │ ├── corstone315_model_pass_output.log │ │ ├── corstone315_pass_output.log │ │ ├── corstone320_model_pass_output.log │ │ ├── corstone320_pass_output.log │ │ └── fail_output.log ├── object_detection │ ├── CMakeLists.txt │ ├── TfmInitialCache.cmake │ ├── blink_task.c │ ├── blink_task.h │ ├── configs │ │ ├── CMakeLists.txt │ │ ├── app_config │ │ │ ├── CMakeLists.txt │ │ │ └── app_config.h │ │ ├── arm_2d_config │ │ │ ├── CMakeLists.txt │ │ │ └── arm_2d_cfg.h │ │ ├── aws_configs │ │ │ ├── CMakeLists.txt │ │ │ ├── MQTTFileDownloader_config.h │ │ │ ├── aws_clientcredential.h │ │ │ ├── aws_mqtt_config.h │ │ │ ├── aws_secure_sockets_config.h │ │ │ ├── core_mqtt_config.h │ │ │ ├── core_pkcs11_config.h │ │ │ ├── demo_config.h │ │ │ ├── iot_default_root_certificates.h │ │ │ ├── mqtt_agent_demo_config.h │ │ │ ├── mqtt_demo_mutual_auth_config.h │ │ │ ├── ota_config.h │ │ │ └── ota_demo_config.h │ │ ├── freertos_config │ │ │ ├── CMakeLists.txt │ │ │ ├── FreeRTOSConfig.h │ │ │ └── FreeRTOSIPConfig.h │ │ ├── isp_config │ │ │ ├── CMakeLists.txt │ │ │ ├── acamera_firmware_config.h │ │ │ └── acamera_interface_config.h │ │ ├── mbedtls_config │ │ │ ├── CMakeLists.txt │ │ │ ├── aws_mbedtls_config.h │ │ │ └── threading_alt.h │ │ └── tfm_config │ │ │ └── project_config.h │ ├── isp │ │ ├── CMakeLists.txt │ │ ├── acamera_callbacks.c │ │ ├── isp_app.c │ │ ├── isp_config.c │ │ └── isp_config.h │ ├── main.c │ ├── ml_interface.cc │ ├── ml_interface.h │ ├── resources │ │ ├── test.frm │ │ └── use_case_resources.json │ └── tests │ │ ├── corstone300_pass_output.log │ │ ├── corstone310_pass_output.log │ │ ├── corstone315_pass_output.log │ │ ├── corstone320_pass_output.log │ │ └── fail_output.log └── speech_recognition │ ├── CMakeLists.txt │ ├── TfmInitialCache.cmake │ ├── blink_task.c │ ├── blink_task.h │ ├── configs │ ├── CMakeLists.txt │ ├── app_config │ │ ├── CMakeLists.txt │ │ └── app_config.h │ ├── audio_configs │ │ └── audio_config.h │ ├── aws_configs │ │ ├── CMakeLists.txt │ │ ├── MQTTFileDownloader_config.h │ │ ├── aws_clientcredential.h │ │ ├── aws_mqtt_config.h │ │ ├── aws_secure_sockets_config.h │ │ ├── core_mqtt_config.h │ │ ├── core_pkcs11_config.h │ │ ├── demo_config.h │ │ ├── iot_default_root_certificates.h │ │ ├── mqtt_agent_demo_config.h │ │ ├── mqtt_demo_mutual_auth_config.h │ │ ├── ota_config.h │ │ └── ota_demo_config.h │ ├── freertos_config │ │ ├── CMakeLists.txt │ │ ├── FreeRTOSConfig.h │ │ └── FreeRTOSIPConfig.h │ ├── mbedtls_config │ │ ├── CMakeLists.txt │ │ ├── aws_mbedtls_config.h │ │ └── threading_alt.h │ └── tfm_config │ │ └── project_config.h │ ├── dsp │ ├── inc │ │ ├── AppNodes.h │ │ ├── GenericNodes.h │ │ ├── dsp_interfaces.h │ │ └── scheduler.h │ └── src │ │ ├── dsp_interfaces.cpp │ │ ├── dsp_task.cc │ │ └── scheduler.cpp │ ├── dsp_task.h │ ├── main.c │ ├── ml_interface.cc │ ├── ml_interface.h │ ├── model_config.cc │ ├── model_config.h │ ├── resources │ ├── test.wav │ └── use_case_resources.json │ └── tests │ ├── corstone300_pass_output.log │ ├── corstone310_pass_output.log │ ├── corstone315_pass_output.log │ ├── corstone320_pass_output.log │ └── fail_output.log ├── bsp ├── CMakeLists.txt ├── cmake │ └── SetLinkerOptions.cmake ├── common │ ├── bsp_serial.c │ ├── bsp_serial.h │ ├── mps3_leds.c │ ├── mps3_leds.h │ └── syscalls_stub.c ├── corstone300 │ ├── an552_ns.ld │ ├── an552_ns.sct │ ├── an552_ns_keyword_ml_model_update.ld │ └── include │ │ ├── FreeRTOSConfig_target.h │ │ ├── RTE_Components.h │ │ ├── device_cfg.h │ │ ├── ethos-u55.h │ │ └── provisioning_config_target.h ├── corstone310 │ ├── an555_ns.ld │ ├── an555_ns.sct │ ├── an555_ns_keyword_ml_model_update.ld │ └── include │ │ ├── FreeRTOSConfig_target.h │ │ ├── RTE_Components.h │ │ ├── device_cfg.h │ │ ├── ethos-u55.h │ │ └── provisioning_config_target.h ├── corstone315 │ ├── corstone_315_ns.ld │ ├── corstone_315_ns.sct │ ├── corstone_315_ns_keyword_ml_model_update.ld │ └── include │ │ ├── FreeRTOSConfig_target.h │ │ ├── RTE_Components.h │ │ ├── device_cfg.h │ │ └── provisioning_config_target.h ├── corstone320 │ ├── corstone_320_ns.ld │ ├── corstone_320_ns.sct │ ├── corstone_320_ns_keyword_ml_model_update.ld │ └── include │ │ ├── FreeRTOSConfig_target.h │ │ ├── RTE_Components.h │ │ ├── device_cfg.h │ │ └── provisioning_config_target.h ├── isp_mali-c55 │ ├── CMakeLists.txt │ └── integration │ │ ├── CMakeLists.txt │ │ ├── app │ │ ├── acamera_uart.c │ │ └── acamera_uart.h │ │ ├── inc │ │ └── system │ │ │ ├── system_cdma_platform.h │ │ │ └── system_semaphore_platform.h │ │ └── src │ │ ├── calibration │ │ ├── acamera_calibrations_dynamic_fs_lin_dummy.c │ │ ├── acamera_calibrations_dynamic_linear_dummy.c │ │ ├── acamera_calibrations_dynamic_native_dummy.c │ │ ├── acamera_calibrations_static_fs_lin_dummy.c │ │ ├── acamera_calibrations_static_linear_dummy.c │ │ ├── acamera_calibrations_static_native_dummy.c │ │ └── acamera_get_calibrations_dummy.c │ │ ├── sensor │ │ └── fvp_sensor_drv.c │ │ └── system │ │ ├── system_cdma.c │ │ ├── system_hw_io.c │ │ ├── system_i2c.c │ │ ├── system_interrupts.c │ │ ├── system_isp_io.c │ │ ├── system_log.c │ │ ├── system_semaphore.c │ │ ├── system_spi.c │ │ ├── system_spinlock.c │ │ ├── system_stdlib.c │ │ ├── system_sw_io.c │ │ └── system_timer.c └── patches │ └── 0001-bsp-Add-CMSIS-Driver-implementation-for-VSI.patch ├── cmake ├── CompilerFlagsARMCLANG.cmake ├── CompilerFlagsGNUARM.cmake └── TfmInitialCacheCommon.cmake ├── components ├── CMakeLists.txt ├── README.md ├── ai │ ├── CMakeLists.txt │ ├── ml_embedded_evaluation_kit │ │ ├── CMakeLists.txt │ │ └── integration │ │ │ ├── README.md │ │ │ ├── cmake │ │ │ ├── ConvertAudioSourceToCode.cmake │ │ │ ├── SetupMlEmbeddedEvaluationKitLibraries.cmake │ │ │ └── model │ │ │ │ ├── GenerateASRModel.cmake │ │ │ │ ├── GenerateKWSModel.cmake │ │ │ │ └── GenerateObjectDetectionModel.cmake │ │ │ └── patches │ │ │ ├── 0001-User-defined-resources-download-path.patch │ │ │ ├── 0002-Use-CMSIS_device_header-instead-of-RTE_Components.h.patch │ │ │ ├── 0003-Make-ETHOSU_ARCH-configurable-in-TensorFlow-CMake.patch │ │ │ ├── 0004-Override-EthosU55-NPU-default-IRQ-handler.patch │ │ │ └── 0005-Patch-tensorflow.patch │ └── speexdsp │ │ ├── CMakeLists.txt │ │ └── integration │ │ ├── CMakeLists.txt │ │ └── inc │ │ ├── config.h │ │ ├── os_support_custom.h │ │ └── speexdsp_config_types.h ├── aws_iot │ ├── CMakeLists.txt │ ├── aws_iot_core_mqtt_file_streams_embedded_c │ │ ├── CMakeLists.txt │ │ └── integration │ │ │ ├── CMakeLists.txt │ │ │ └── patches │ │ │ └── 0001-Use-custom-strnlen-implementation.patch │ ├── cmake │ │ ├── AWSIoTHelpers.cmake │ │ └── GenerateAWSUpdateDigestAndSignature.cmake │ ├── corejson │ │ ├── CMakeLists.txt │ │ └── integration │ │ │ └── CMakeLists.txt │ ├── coremqtt │ │ ├── CMakeLists.txt │ │ ├── integration │ │ │ └── CMakeLists.txt │ │ └── library_mocks │ │ │ ├── CMakeLists.txt │ │ │ ├── inc │ │ │ ├── core_mqtt.h │ │ │ └── core_mqtt_serializer.h │ │ │ ├── interface │ │ │ └── transport_interface.h │ │ │ └── src │ │ │ └── core_mqtt.c │ ├── coremqtt_agent │ │ ├── CMakeLists.txt │ │ ├── integration │ │ │ ├── CMakeLists.txt │ │ │ ├── inc │ │ │ │ ├── freertos_agent_message.h │ │ │ │ ├── freertos_command_pool.h │ │ │ │ ├── mqtt_agent_task.h │ │ │ │ └── subscription_manager.h │ │ │ ├── integration_mocks │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── inc │ │ │ │ │ ├── freertos_agent_message.h │ │ │ │ │ ├── freertos_command_pool.h │ │ │ │ │ ├── mqtt_agent_task.h │ │ │ │ │ └── subscription_manager.h │ │ │ │ └── src │ │ │ │ │ ├── freertos_agent_message.c │ │ │ │ │ ├── freertos_command_pool.c │ │ │ │ │ ├── mqtt_agent_task.c │ │ │ │ │ └── subscription_manager.c │ │ │ ├── src │ │ │ │ ├── freertos_agent_message.c │ │ │ │ ├── freertos_command_pool.c │ │ │ │ ├── mqtt_agent_task.c │ │ │ │ └── subscription_manager.c │ │ │ └── tests │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── config_mocks │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── inc │ │ │ │ │ ├── FreeRTOSConfig.h │ │ │ │ │ ├── app_config.h │ │ │ │ │ ├── core_mqtt_config.h │ │ │ │ │ ├── core_pkcs11_config.h │ │ │ │ │ ├── demo_config.h │ │ │ │ │ └── iot_default_root_certificates.h │ │ │ │ ├── test_freertos_agent_message.cpp │ │ │ │ ├── test_freertos_command_pool.cpp │ │ │ │ ├── test_mqtt_agent_task.cpp │ │ │ │ └── test_subscription_manager.cpp │ │ └── library_mocks │ │ │ ├── CMakeLists.txt │ │ │ ├── inc │ │ │ ├── core_mqtt_agent.h │ │ │ └── core_mqtt_agent_message_interface.h │ │ │ └── src │ │ │ └── core_mqtt_agent.c │ ├── corepkcs11 │ │ ├── CMakeLists.txt │ │ └── integration │ │ │ └── CMakeLists.txt │ ├── coresntp │ │ ├── CMakeLists.txt │ │ └── integration │ │ │ └── CMakeLists.txt │ ├── jobs_for_aws_iot_embedded_sdk │ │ ├── CMakeLists.txt │ │ └── integration │ │ │ ├── CMakeLists.txt │ │ │ └── patches │ │ │ ├── 0001-Check-for-RSA-signature-instead-of-ECDSA.patch │ │ │ ├── 0002-Use-custom-strnlen-implementation.patch │ │ │ └── 0003-Add-functionality-for-sending-and-retrieving-updated.patch │ └── tinycbor │ │ ├── CMakeLists.txt │ │ └── integration │ │ └── CMakeLists.txt ├── connectivity │ ├── CMakeLists.txt │ ├── backoff_algorithm │ │ ├── CMakeLists.txt │ │ ├── integration │ │ │ └── CMakeLists.txt │ │ └── library_mocks │ │ │ ├── CMakeLists.txt │ │ │ ├── inc │ │ │ └── backoff_algorithm.h │ │ │ └── src │ │ │ └── backoff_algorithm.c │ ├── freertos_plus_tcp │ │ ├── CMakeLists.txt │ │ ├── integration │ │ │ ├── CMakeLists.txt │ │ │ ├── inc │ │ │ │ └── transport_interface_api.h │ │ │ ├── integration_mocks │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── inc │ │ │ │ │ └── transport_interface_api.h │ │ │ │ └── src │ │ │ │ │ └── transport_interface_api.c │ │ │ └── src │ │ │ │ ├── network_startup.c │ │ │ │ └── transport_mbedtls.c │ │ └── library_mocks │ │ │ └── CMakeLists.txt │ ├── iot_socket │ │ ├── CMakeLists.txt │ │ └── integration │ │ │ └── CMakeLists.txt │ └── iot_vsocket │ │ ├── CMakeLists.txt │ │ ├── integration │ │ ├── CMakeLists.txt │ │ ├── inc │ │ │ └── transport_interface_api.h │ │ ├── integration_mocks │ │ │ ├── CMakeLists.txt │ │ │ ├── inc │ │ │ │ └── transport_interface_api.h │ │ │ └── src │ │ │ │ └── transport_interface_api.c │ │ ├── patches │ │ │ └── 0001-Replace-CMSIS-RTX-APIs-with-FreeRTOS-APIs.patch │ │ └── src │ │ │ ├── network_startup.c │ │ │ └── transport_tls_iot_socket.c │ │ └── library_mocks │ │ └── CMakeLists.txt ├── freertos_kernel │ ├── CMakeLists.txt │ ├── integration │ │ └── src │ │ │ └── heap_management.c │ └── library_mocks │ │ ├── CMakeLists.txt │ │ ├── inc │ │ ├── FreeRTOS.h │ │ ├── event_groups.h │ │ ├── portmacro.h │ │ ├── projdefs.h │ │ ├── queue.h │ │ ├── semphr.h │ │ └── task.h │ │ └── src │ │ ├── event_groups.c │ │ ├── queue.c │ │ ├── semphr.c │ │ └── tasks.c ├── graphics │ ├── CMakeLists.txt │ └── arm-2d │ │ ├── CMakeLists.txt │ │ └── integration │ │ └── CMakeLists.txt ├── security │ ├── CMakeLists.txt │ ├── freertos_ota_pal_psa │ │ ├── CMakeLists.txt │ │ ├── integration │ │ │ ├── CMakeLists.txt │ │ │ └── patches │ │ │ │ ├── 0001-ota-abort-Fix-successful-abortion-check.patch │ │ │ │ ├── 0002-Update-FreeRTOS-OTA-PAL-PSA-to-work-with-new-modular.patch │ │ │ │ ├── 0003-component-ID-Add-ML-model-file-path.patch │ │ │ │ ├── 0004-app-version-Do-not-store-version-in-a-global-var.patch │ │ │ │ └── 0005-PAL-Implement-component-version-getter.patch │ │ └── library_mocks │ │ │ ├── CMakeLists.txt │ │ │ ├── inc │ │ │ ├── ota_pal.h │ │ │ └── version │ │ │ │ └── application_version.h │ │ │ └── src │ │ │ └── version │ │ │ └── application_version.c │ ├── freertos_pkcs11_psa │ │ ├── CMakeLists.txt │ │ └── integration │ │ │ ├── CMakeLists.txt │ │ │ └── patches │ │ │ └── 0001-crypto-Define-device-private-key-as-volatile.patch │ ├── mbedtls │ │ ├── CMakeLists.txt │ │ ├── integration │ │ │ ├── CMakeLists.txt │ │ │ ├── inc │ │ │ │ └── iot_tls.h │ │ │ └── src │ │ │ │ ├── iot_tls.c │ │ │ │ └── mbedtls_freertos_port.c │ │ └── library_mocks │ │ │ ├── CMakeLists.txt │ │ │ ├── inc │ │ │ └── psa │ │ │ │ ├── crypto.h │ │ │ │ └── crypto_types.h │ │ │ └── src │ │ │ └── psa │ │ │ └── crypto.c │ └── trusted_firmware-m │ │ ├── CMakeLists.txt │ │ ├── integration │ │ ├── CMakeLists.txt │ │ ├── cmake │ │ │ ├── MergeTfmImages.cmake │ │ │ ├── SignTfmImage.cmake │ │ │ └── TfmNsToolchain.cmake │ │ └── patches │ │ │ ├── 0001-corstone300-Add-ML-model-component.patch │ │ │ ├── 0002-corstone310-Add-ML-model-component.patch │ │ │ ├── 0003-mps4-Add-ML-model-component.patch │ │ │ └── 0004-mps4-Provision-dummy-ROTPK-key.patch │ │ └── library_mocks │ │ ├── CMakeLists.txt │ │ └── inc │ │ └── psa │ │ ├── crypto_types.h │ │ ├── error.h │ │ ├── fwu_config.h │ │ └── update.h └── tools │ ├── CMakeLists.txt │ ├── fff │ └── CMakeLists.txt │ ├── freertos_libraries_integration_tests │ ├── CMakeLists.txt │ └── integration │ │ ├── CMakeLists.txt │ │ └── patches │ │ └── 0001-Reduce-the-TRANSPORT_TEST_BUFFER_WRITABLE_LENGTH.patch │ ├── googletest │ └── CMakeLists.txt │ └── unity │ └── CMakeLists.txt ├── cspell.config.yaml ├── docs ├── applications │ ├── aws_iot │ │ ├── aws_iot_cloud_connection.md │ │ └── setting_up_aws_connectivity.md │ ├── blinky.md │ ├── device_advisor │ │ └── running_aws_iot_core_device_advisor_tests.md │ ├── device_provisioning │ │ └── device_provisioning.md │ ├── keyword_detection.md │ ├── ml_model_update │ │ └── ml-model-update.md │ ├── object_detection.md │ └── speech_recognition.md ├── components │ ├── aws_iot │ │ └── aws_tool.md │ └── security │ │ ├── mbedtls │ │ └── mbedtls.md │ │ └── trusted_firmware-m │ │ └── trusted_firmware-m.md ├── development_environment │ ├── introduction.md │ ├── linux_dev_env.md │ ├── pre_commit_and_towncrier_setup.md │ └── vscode_dev_env_build_and_debug.md ├── project_organisation.md ├── release_checklist.md └── unit_testing.md ├── manifest.yml ├── release_changes ├── .gitkeep ├── 202407151057.change ├── 202410251136.change.md ├── 202411121523.change.md ├── 202411201651.change.md ├── 202411211131.change.md ├── 202411251654.change.md ├── 202412112209.change.md ├── 202412161811.change.md ├── 202501081605.change.md ├── 202501231700.change.md ├── 202501301446.change.md ├── 202503171512.change.md ├── 202503181254.change.md ├── 202503281420.change.md ├── 202504031422.change.md └── 202505221237.change.md └── tools ├── ci ├── aws_cleanup.py ├── generate_credentials.sh ├── gitlint │ ├── .gitlint │ └── gitlint-user-rules.py ├── hooks │ ├── banned_api.py │ └── banned_api_list.txt ├── license │ └── license.schema ├── pipeline-baseline-fri.yml ├── pyproject.toml ├── setup.cfg ├── towncrier │ └── template.rst └── tpip-checker │ ├── tpip_checker.md │ └── tpip_checker.py ├── cmake ├── AddUnitTest.cmake ├── ApplyPatches.cmake └── ConvertElfToBin.cmake ├── plugin └── .gitkeep ├── scripts ├── arm_vsi0.py ├── build.sh ├── check_listed_dependencies.py ├── container_post_startup.sh ├── createIoTThings.py ├── createIoTThings_settings.json ├── frm_converter.py ├── generate_credentials.py ├── generate_credentials_header.py ├── run.sh ├── run_dependencies_check.sh ├── run_uncrustify.sh └── setup_python_vsi.sh ├── tests ├── aws_test_util.py ├── conftest.py ├── test_applications.py ├── test_blinky_output.py └── test_integration.py └── uncrustify.cfg /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | /* Copyright 2024 Arm Limited and/or its affiliates 3 | * 4 | * SPDX-License-Identifier: MIT 5 | */ 6 | "name": "Arm Featured Reference Integration", 7 | "build": { 8 | "dockerfile": "Dockerfile", 9 | "args": { 10 | "SHELL_CHOICE": "zsh" 11 | } 12 | }, 13 | // "workspaceFolder": "/workspace", 14 | "mounts": [ 15 | "source=${localWorkspaceFolderBasename}-bashhistory,target=/commandhistory,type=volume" 16 | ], 17 | "customizations": { 18 | "vscode": { 19 | "extensions": [ 20 | "ms-vscode.cpptools-extension-pack", 21 | "zachflower.uncrustify", 22 | "marus25.cortex-debug" 23 | ], 24 | "settings": { 25 | "terminal.integrated.profiles.linux": { 26 | "zsh (login)": { 27 | "path": "zsh", 28 | "args": [ 29 | "-l" 30 | ] 31 | }, 32 | "bash (login)": { 33 | "path": "bash", 34 | "args": [ 35 | "-l" 36 | ] 37 | } 38 | }, 39 | "terminal.integrated.defaultProfile.linux": "zsh", 40 | "terminal.integrated.defaultProfile.windows": "C:\\Windows\\System32\\bash.exe" 41 | } 42 | } 43 | }, 44 | "remoteUser": "ubuntu", 45 | "postCreateCommand": "bash /workspaces/iot-reference-arm-corstone3xx/tools/scripts/container_post_startup.sh", 46 | "remoteEnv": { 47 | "PATH": "${containerEnv:PATH}" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Each line is a file pattern followed by one or more owners. 2 | 3 | # These owners will be the default owners for everything in 4 | # the repo. Unless a later match takes precedence, 5 | # @global-owner1 and @global-owner2 will be requested for 6 | # review when someone opens a pull request. 7 | * @FreeRTOS/pr-bar-raiser 8 | 9 | # Order is important; the last matching pattern takes the most 10 | # precedence. When someone opens a pull request that only 11 | # modifies JS files, only @js-owner and not the global 12 | # owner(s) will be requested for a review. 13 | # *.c FreeRTOS/pr-bar-raiser 14 | 15 | # You can also use email addresses if you prefer. They'll be 16 | # used to look up users just like we do for commit author 17 | # emails. 18 | # *.go docs@example.com 19 | 20 | # In this example, @doctocat owns any files in the build/logs 21 | # directory at the root of the repository and any of its 22 | # subdirectories. 23 | # /build/logs/ @doctocat 24 | 25 | # The `docs/*` pattern will match files like 26 | # `docs/getting-started.md` but not further nested files like 27 | # `docs/build-app/troubleshooting.md`. 28 | # docs/* docs@example.com 29 | 30 | # In this example, @octocat owns any file in an apps directory 31 | # anywhere in your repository. 32 | # apps/ @octocat 33 | 34 | # In this example, @doctocat owns any file in the `/docs` 35 | # directory in the root of your repository and any of its 36 | # subdirectories. 37 | # /docs/ @doctocat 38 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve Arm Corstone-3xx FreeRTOS IoT 4 | Reference. Please use this for confirmed bugs only. If you suspect 5 | something it is best to first discuss it on the FreeRTOS forums linked 6 | below. 7 | title: "[BUG]" 8 | labels: bug 9 | assignees: '' 10 | 11 | --- 12 | 13 | **Describe the bug** 14 | A concise description of what the bug is. If possible, that is the code is not 15 | proprietary, please upload the code in a [GitHub fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) 16 | such that we can reproduce the bug. 17 | 18 | **Host** 19 | - Host OS: [e.g. MacOS] 20 | - Version: [e.g. Mojave 10.14.6] 21 | 22 | **To Reproduce** 23 | - Use project ... and configure with ... 24 | - Run on ... and could observe ... 25 | 26 | **Expected behavior** 27 | A concise description of what you expected to happen. 28 | 29 | **Screenshots** 30 | If applicable, add screenshots to help explain your problem. 31 | 32 | **Additional context** 33 | Add any other context about the problem here. 34 | e.g. code snippet to reproduce the issue. 35 | e.g. stack trace, memory dump, debugger log, and many etc. 36 | 37 | 38 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: FreeRTOS Community Support Forum 4 | url: https://forums.freertos.org/ 5 | about: Please ask and answer questions about Arm Corstone-3xx FreeRTOS IoT Reference here. 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/documentation-issue.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Documentation issue 3 | about: Create a report to help us improve our documentation. 4 | title: "[DOC] " 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the issue** 11 | Please describe the issue and expected clarification in concise language. 12 | 13 | **Reference** 14 | Please attach the URL at which you are experiencing the issue. 15 | 16 | **Screenshot** 17 | If applicable, please attach screenshot. 18 | 19 | **Browser** 20 | - Browser: [e.g. Chrome] 21 | - Version: [e.g. 80.0.3987.132] 22 | 23 | 24 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Suggest an idea for this project 4 | title: "[Feature Request] " 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've 18 | considered. 19 | 20 | **Additional context** 21 | Add any other context or screenshots about the feature request here. 22 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | Description 4 | ----------- 5 | 6 | 7 | Test Steps 8 | ----------- 9 | 10 | 11 | Checklist: 12 | ---------- 13 | 14 | 15 | - [ ] I have tested my changes. No regression in existing tests. 16 | - [ ] I have modified and/or added unit-tests to cover the code changes in this Pull Request. 17 | 18 | Related Issue 19 | ----------- 20 | 21 | 22 | By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Build directory 2 | build 3 | build_tfm 4 | build_unit_test 5 | 6 | # Cache directory 7 | .cache 8 | 9 | # Python virtualenv 10 | .venv 11 | 12 | # Prerequisites 13 | *.d 14 | 15 | # Object files 16 | *.o 17 | *.obj 18 | *.elf 19 | 20 | # Linker output 21 | *.ilk 22 | *.map 23 | *.exp 24 | 25 | # Precompiled Headers 26 | *.gch 27 | *.pch 28 | 29 | # Libraries 30 | *.lib 31 | *.a 32 | *.la 33 | *.lo 34 | 35 | # Executables 36 | *.bin 37 | *.hex 38 | *.exe 39 | 40 | # Debug files 41 | *.dSYM/ 42 | *.su 43 | *.idb 44 | *.pdb 45 | 46 | # Binary / big files 47 | *.chm 48 | 49 | # Windows thumbnail cache files 50 | Thumbs.db 51 | Thumbs.db:encryptable 52 | ehthumbs.db 53 | ehthumbs_vista.db 54 | 55 | # Dump file 56 | *.stackdump 57 | 58 | # Folder config file 59 | [Dd]esktop.ini 60 | 61 | # Recycle Bin used on file shares 62 | $RECYCLE.BIN/ 63 | 64 | # General 65 | .DS_Store 66 | .AppleDouble 67 | .LSOverride 68 | 69 | # Thumbnails 70 | ._* 71 | 72 | # Directories potentially created on remote AFP share 73 | .AppleDB 74 | .AppleDesktop 75 | Network Trash Folder 76 | Temporary Items 77 | .apdisk 78 | 79 | # Visual Studio Code 80 | .vscode/* 81 | !.vscode/settings.json 82 | !.vscode/tasks.json 83 | !.vscode/launch.json 84 | !.vscode/extensions.json 85 | *.code-workspace 86 | 87 | # Local History for Visual Studio Code 88 | .history/ 89 | 90 | # Eclipse 91 | .metadata 92 | bin/ 93 | tmp/ 94 | *.tmp 95 | *.bak 96 | *.swp 97 | *~.nib 98 | local.properties 99 | .loadpath 100 | .recommenders 101 | 102 | # External tool builders 103 | .externalToolBuilders/ 104 | 105 | # PyDev specific (Python IDE for Eclipse) 106 | *.pydevproject 107 | 108 | # CDT- autotools 109 | .autotools 110 | 111 | __pycache__ 112 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // Copyright 2021-2025 Arm Limited and/or its affiliates 2 | // 3 | // SPDX-License-Identifier: MIT 4 | 5 | { 6 | "configurations": [ 7 | { 8 | "name": "Debug Arm Featured Reference Integration applications", 9 | "type": "cortex-debug", 10 | "request": "launch", 11 | "cwd": "${workspaceFolder}/build", 12 | "executable": "${input:FRIApplication}.axf", 13 | "servertype": "external", 14 | "gdbTarget": ":31627", 15 | "overrideLaunchCommands": [ 16 | "-enable-pretty-printing", 17 | "break main.c:main", 18 | "add-symbol-file ${workspaceFolder}/build_tfm/api_ns/bin/bl2.axf", 19 | "add-symbol-file ${workspaceFolder}/build_tfm/api_ns/bin/tfm_s.axf", 20 | ], 21 | "preLaunchTask": "Debug Arm Featured Reference Integration applications", 22 | "showDevDebugOutput": "raw" 23 | } 24 | ], 25 | "inputs": [ 26 | { 27 | "type": "pickString", 28 | "id": "FRIApplication", 29 | "description": "Which FRI application do you want to launch?", 30 | "options": [ 31 | "blinky", 32 | "keyword-detection", 33 | "speech-recognition", 34 | "object-detection", 35 | "freertos-iot-libraries-tests" 36 | ], 37 | "default": "blinky" 38 | }, 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Copyright 2024 Arm Limited and/or its affiliates 2 | // 3 | // SPDX-License-Identifier: MIT 4 | 5 | { 6 | "C_Cpp.errorSquiggles": "disabled" 7 | } 8 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | cmake_minimum_required(VERSION 3.21.0 FATAL_ERROR) 6 | 7 | project(iot-reference-arm-corstone3xx LANGUAGES C CXX ASM) 8 | 9 | list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/tools/cmake) 10 | 11 | 12 | if(NOT CMAKE_BUILD_TYPE) 13 | set(CMAKE_BUILD_TYPE "Release" CACHE STRING "The build type" FORCE) 14 | endif() 15 | 16 | if(CMAKE_CROSSCOMPILING) 17 | set(CMAKE_EXECUTABLE_SUFFIX ".axf" PARENT_SCOPE) 18 | 19 | set(CMAKE_EXPORT_COMPILE_COMMANDS ON PARENT_SCOPE) 20 | endif() 21 | 22 | # CMAKE_PROJECT_NAME is the sub-project to build. E.g. 'blinky-example', or any other application. 23 | # We only unit test if the build script has set CMAKE_PROJECT_NAME to the name of the project, and 24 | # not an application's name (i.e. 'iot-reference-arm-corstone3xx'). 25 | if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) 26 | include(CTest) 27 | include(AddUnitTest) 28 | # Include helpers mocks. 29 | add_subdirectory(applications/helpers) 30 | endif() 31 | 32 | 33 | if(CMAKE_CROSSCOMPILING) 34 | add_subdirectory(bsp) 35 | add_subdirectory(components EXCLUDE_FROM_ALL) 36 | else() 37 | add_subdirectory(components) 38 | endif() 39 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | ## Code of Conduct 2 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). 3 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact 4 | opensource-codeofconduct@amazon.com with any additional questions or comments. 5 | -------------------------------------------------------------------------------- /DCO.txt: -------------------------------------------------------------------------------- 1 | Developer Certificate of Origin 2 | Version 1.1 3 | 4 | Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 5 | 1 Letterman Drive 6 | Suite D4700 7 | San Francisco, CA, 94129 8 | 9 | Everyone is permitted to copy and distribute verbatim copies of this 10 | license document, but changing it is not allowed. 11 | 12 | 13 | Developer's Certificate of Origin 1.1 14 | 15 | By making a contribution to this project, I certify that: 16 | 17 | (a) The contribution was created in whole or in part by me and I 18 | have the right to submit it under the open source license 19 | indicated in the file; or 20 | 21 | (b) The contribution is based upon previous work that, to the best 22 | of my knowledge, is covered under an appropriate open source 23 | license and I have the right under that license to submit that 24 | work with modifications, whether created in whole or in part 25 | by me, under the same open source license (unless I am 26 | permitted to submit under a different license), as indicated 27 | in the file; or 28 | 29 | (c) The contribution was provided directly to me by some other 30 | person who certified (a), (b) or (c) and I have not modified 31 | it. 32 | 33 | (d) I understand and agree that this project and the contribution 34 | are public and that a record of the contribution (including all 35 | personal information I submit with it, including my sign-off) is 36 | maintained indefinitely and may be redistributed consistent with 37 | this project or the open source license(s) involved. 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright 2023 Arm Limited and/or its affiliates 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /applications/blinky/TfmInitialCache.cmake: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | include(${ROOT}/cmake/TfmInitialCacheCommon.cmake) 6 | 7 | set(MCUBOOT_IMAGE_VERSION_NS 0.0.1 CACHE STRING "MCUBOOT_IMAGE_VERSION_NS" FORCE) 8 | set(MCUBOOT_IMAGE_NUMBER 2 CACHE STRING "MCUBOOT_IMAGE_NUMBER" FORCE) 9 | set(DEFAULT_MCUBOOT_FLASH_MAP ON CACHE STRING "DEFAULT_MCUBOOT_FLASH_MAP" FORCE) 10 | set(PROJECT_CONFIG_HEADER_FILE ${ROOT}/applications/blinky/configs/tfm_config/project_config.h CACHE FILEPATH "PROJECT_CONFIG_HEADER_FILE" FORCE) 11 | -------------------------------------------------------------------------------- /applications/blinky/configs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_subdirectory(app_config) 6 | add_subdirectory(freertos_config) 7 | -------------------------------------------------------------------------------- /applications/blinky/configs/app_config/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_library(app-config INTERFACE) 6 | 7 | target_include_directories(app-config 8 | INTERFACE 9 | . 10 | ) 11 | -------------------------------------------------------------------------------- /applications/blinky/configs/app_config/app_config.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023-2024 Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | 6 | /** @brief Set logging task as high priority task */ 7 | #define appCONFIG_LOGGING_TASK_PRIORITY ( configMAX_PRIORITIES - 1 ) 8 | #define appCONFIG_LOGGING_TASK_STACK_SIZE ( 2048 ) 9 | #define appCONFIG_LOGGING_MESSAGE_QUEUE_LENGTH ( 32 ) 10 | -------------------------------------------------------------------------------- /applications/blinky/configs/freertos_config/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2025 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | target_include_directories(freertos_config SYSTEM 6 | INTERFACE 7 | . 8 | ) 9 | 10 | target_compile_definitions(freertos_config 11 | INTERFACE 12 | projCOVERAGE_TEST=0 13 | ) 14 | 15 | target_link_libraries(freertos_config 16 | INTERFACE 17 | tfm_api_ns 18 | app-config 19 | ) 20 | -------------------------------------------------------------------------------- /applications/blinky/tests/corstone300_pass_output.log: -------------------------------------------------------------------------------- 1 | Waiting for provisioning bundle 2 | Running provisioning bundle 3 | Booting TF-M v2.2.0 4 | psa_framework_version is: 257 5 | LED on 6 | LED off 7 | LED on 8 | LED off 9 | -------------------------------------------------------------------------------- /applications/blinky/tests/corstone310_pass_output.log: -------------------------------------------------------------------------------- 1 | Waiting for provisioning bundle 2 | Running provisioning bundle 3 | Booting TF-M v2.2.0 4 | psa_framework_version is: 257 5 | LED on 6 | LED off 7 | LED on 8 | LED off 9 | -------------------------------------------------------------------------------- /applications/blinky/tests/corstone315_pass_output.log: -------------------------------------------------------------------------------- 1 | Waiting for DM provisioning bundle 2 | Running DM provisioning bundle 3 | Booting TF-M v2.2.0 4 | psa_framework_version is: 257 5 | LED on 6 | LED off 7 | LED on 8 | LED off 9 | -------------------------------------------------------------------------------- /applications/blinky/tests/corstone320_pass_output.log: -------------------------------------------------------------------------------- 1 | Waiting for DM provisioning bundle 2 | Running DM provisioning bundle 3 | Booting TF-M v2.2.0 4 | psa_framework_version is: 257 5 | LED on 6 | LED off 7 | LED on 8 | LED off 9 | -------------------------------------------------------------------------------- /applications/blinky/tests/fail_output.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeRTOS/iot-reference-arm-corstone3xx/0b2f65dcfc62a5f1cddf0e58f73118558165e8fa/applications/blinky/tests/fail_output.log -------------------------------------------------------------------------------- /applications/freertos_iot_libraries_tests/TfmInitialCache.cmake: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | include(${ROOT}/cmake/TfmInitialCacheCommon.cmake) 6 | 7 | # Trusted Firmware-M setup 8 | set(TFM_MBEDCRYPTO_CONFIG_CLIENT_PATH "${ROOT}/applications/freertos_iot_libraries_tests/configs/mbedtls_config/aws_mbedtls_config.h" CACHE FILEPATH "TFM_MBEDCRYPTO_CONFIG_CLIENT_PATH" FORCE) 9 | set(PROJECT_CONFIG_HEADER_FILE ${ROOT}/applications/freertos_iot_libraries_tests/configs/tfm_config/project_config.h CACHE FILEPATH "PROJECT_CONFIG_HEADER_FILE" FORCE) 10 | set(MCUBOOT_IMAGE_NUMBER 2 CACHE STRING "MCUBOOT_IMAGE_NUMBER" FORCE) 11 | set(DEFAULT_MCUBOOT_FLASH_MAP ON CACHE BOOL "DEFAULT_MCUBOOT_FLASH_MAP" FORCE) 12 | set(MCUBOOT_DATA_SHARING ON CACHE BOOL "MCUBOOT_DATA_SHARING" FORCE) 13 | set(MCUBOOT_UPGRADE_STRATEGY "SWAP_USING_SCRATCH" CACHE STRING "MCUBOOT_UPGRADE_STRATEGY" FORCE) 14 | set(MCUBOOT_IMAGE_VERSION_NS "0.0.10+0" CACHE STRING "MCUBOOT_IMAGE_VERSION_NS" FORCE) 15 | set(PLATFORM_HAS_FIRMWARE_UPDATE_SUPPORT ON CACHE BOOL "PLATFORM_HAS_FIRMWARE_UPDATE_SUPPORT" FORCE) 16 | set(TFM_PARTITION_FIRMWARE_UPDATE ON CACHE BOOL "TFM_PARTITION_FIRMWARE_UPDATE" FORCE) 17 | -------------------------------------------------------------------------------- /applications/freertos_iot_libraries_tests/configs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_subdirectory(app_config) 6 | add_subdirectory(aws_configs) 7 | add_subdirectory(freertos_config) 8 | add_subdirectory(mbedtls_config) 9 | -------------------------------------------------------------------------------- /applications/freertos_iot_libraries_tests/configs/app_config/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_library(app-config INTERFACE) 6 | 7 | target_include_directories(app-config 8 | INTERFACE 9 | . 10 | ) 11 | -------------------------------------------------------------------------------- /applications/freertos_iot_libraries_tests/configs/app_config/app_config.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023-2024 Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | 6 | 7 | /** 8 | * @brief Stack size and priority for MQTT agent task. 9 | * Stack size is capped to an adequate value based on requirements from MbedTLS stack 10 | * for establishing a TLS connection. Task priority of MQTT agent is set to a priority 11 | * higher than other MQTT application tasks, so that the agent can drain the queue 12 | * as work is being produced. 13 | */ 14 | #define appCONFIG_MQTT_AGENT_TASK_STACK_SIZE ( 4096 ) 15 | #define appCONFIG_MQTT_AGENT_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 ) 16 | 17 | /** 18 | * @brief Stack size and priority for OTA MQTT agent task. 19 | * Stack size is capped to an adequate value based on requirements from MbedTLS stack 20 | * for establishing a TLS connection. Task priority of OTA MQTT agent is set to a priority 21 | * higher than other MQTT application tasks, so that the agent can drain the queue 22 | * as work is being produced. 23 | */ 24 | #define appCONFIG_OTA_MQTT_AGENT_TASK_STACK_SIZE ( 4096 ) 25 | #define appCONFIG_OTA_MQTT_AGENT_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 ) 26 | 27 | /** @brief Set logging task as high priority task */ 28 | #define appCONFIG_LOGGING_TASK_PRIORITY ( configMAX_PRIORITIES - 1 ) 29 | #define appCONFIG_LOGGING_TASK_STACK_SIZE ( 2048 ) 30 | #define appCONFIG_LOGGING_MESSAGE_QUEUE_LENGTH ( 32 ) 31 | -------------------------------------------------------------------------------- /applications/freertos_iot_libraries_tests/configs/aws_configs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | target_include_directories(coremqtt-config 6 | INTERFACE 7 | . 8 | ) 9 | 10 | target_link_libraries(coremqtt-config 11 | INTERFACE 12 | helpers-logging 13 | ) 14 | 15 | target_compile_definitions(coremqtt-agent-config 16 | INTERFACE 17 | MQTT_AGENT_DO_NOT_USE_CUSTOM_CONFIG 18 | ) 19 | 20 | target_include_directories(corepkcs11-config 21 | INTERFACE 22 | . 23 | ) 24 | 25 | target_include_directories(freertos-ota-pal-psa-config 26 | INTERFACE 27 | . 28 | ) 29 | 30 | target_include_directories(freertos-pkcs11-psa-config 31 | INTERFACE 32 | . 33 | ) 34 | -------------------------------------------------------------------------------- /applications/freertos_iot_libraries_tests/configs/aws_configs/MQTTFileDownloader_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Amazon.com, Inc. and its affiliates. All Rights Reserved. 3 | * Copyright 2024 Arm Limited and/or its affiliates 4 | * 5 | * 6 | * SPDX-License-Identifier: MIT 7 | * Licensed under the MIT License. See the LICENSE accompanying this file 8 | * for the specific language governing permissions and limitations under 9 | * the License. 10 | */ 11 | 12 | /** 13 | * @file MQTTFileDownloader_config.h 14 | * @brief MQTT File Streams options. 15 | */ 16 | 17 | #ifndef MQTT_FILE_DOWNLOADER_CONFIG_H 18 | #define MQTT_FILE_DOWNLOADER_CONFIG_H 19 | 20 | /* Standard includes */ 21 | #include 22 | 23 | /** 24 | * @ingroup mqtt_file_downloader_const_types 25 | * @brief Configure the Maximum size of the data payload. The 26 | * smallest value is 256 bytes, maximum is 128KB. For more see 27 | * https://docs.aws.amazon.com/general/latest/gr/iot-core.html 28 | */ 29 | #define mqttFileDownloader_CONFIG_BLOCK_SIZE 4096U 30 | 31 | #endif /* MQTT_FILE_DOWNLOADER_CONFIG_H */ 32 | -------------------------------------------------------------------------------- /applications/freertos_iot_libraries_tests/configs/freertos_config/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2025 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | target_include_directories(freertos_config SYSTEM 6 | INTERFACE 7 | . 8 | ) 9 | 10 | target_compile_definitions(freertos_config 11 | INTERFACE 12 | projCOVERAGE_TEST=0 13 | ) 14 | 15 | target_link_libraries(freertos_config 16 | INTERFACE 17 | tfm_api_ns 18 | app-config 19 | ) 20 | -------------------------------------------------------------------------------- /applications/freertos_iot_libraries_tests/configs/mbedtls_config/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2025 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | target_include_directories(mbedtls-config 6 | INTERFACE 7 | . 8 | ) 9 | 10 | target_link_libraries(mbedtls-config 11 | INTERFACE 12 | freertos_kernel 13 | ) 14 | -------------------------------------------------------------------------------- /applications/freertos_iot_libraries_tests/unistd.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | 6 | /* dummy file for workaround missing ifdefs in AWS qual tests */ 7 | -------------------------------------------------------------------------------- /applications/helpers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_subdirectory(crt_helpers) 6 | add_subdirectory(device_advisor) 7 | add_subdirectory(events) 8 | add_subdirectory(hdlcd) 9 | add_subdirectory(logging) 10 | add_subdirectory(ota_orchestrator) 11 | add_subdirectory(provisioning) 12 | # sntp helper library depends on FreeRTOS-Plus-TCP connectivity stack as it 13 | # includes `FreeRTOS_IP.h` header file in one of its source files (sntp_client_task.c), 14 | # thus this library is only added in case of using FREERTOS_PLUS_TCP connectivity stack. 15 | if(CONNECTIVITY_STACK STREQUAL "FREERTOS_PLUS_TCP") 16 | add_subdirectory(sntp) 17 | endif() 18 | -------------------------------------------------------------------------------- /applications/helpers/crt_helpers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | if(BUILD_TESTING AND NOT CMAKE_CROSSCOMPILING) 6 | # Left empty for future mocks. 7 | else() 8 | add_library(crt-helpers) 9 | 10 | target_include_directories(crt-helpers 11 | PUBLIC 12 | inc/) 13 | 14 | target_sources(crt-helpers 15 | PUBLIC 16 | src/app_strnlen.c 17 | ) 18 | endif() 19 | -------------------------------------------------------------------------------- /applications/helpers/crt_helpers/inc/app_strnlen.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021-2024, Arm Limited. All rights reserved. 3 | * 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * 6 | */ 7 | 8 | #ifndef APP_STRNLEN_H 9 | 10 | #include 11 | 12 | /** 13 | * @brief Determine the length of a fixed-size string, excluding the terminating 14 | * null byte ('\0'), and at most `maxlen`. 15 | * 16 | * @param[in] s The string to determine the length of. 17 | * @param[in] maxlen The maximum number of characters of the string `s` that 18 | * should be checked. 19 | * 20 | * @return The length of the string, up to `maxlen`. 21 | */ 22 | size_t app_strnlen( const char * s, 23 | size_t maxlen ); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /applications/helpers/crt_helpers/src/app_strnlen.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021-2024, Arm Limited. All rights reserved. 3 | * 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * 6 | */ 7 | 8 | /* 9 | * This file is based on 10 | * https://git.trustedfirmware.org/plugins/gitiles/TF-M/trusted-firmware-m.git/+/c9352b59f2a501b5af3f648b3fc91065993c002f/secure_fw/partitions/lib/runtime/crt_strnlen.c 11 | */ 12 | 13 | #include 14 | 15 | size_t app_strnlen( const char * s, 16 | size_t maxlen ) 17 | { 18 | size_t idx; 19 | 20 | if( s == NULL ) 21 | { 22 | return 0; 23 | } 24 | 25 | for( idx = 0; idx < maxlen; idx++ ) 26 | { 27 | if( s[ idx ] == '\0' ) 28 | { 29 | return idx; 30 | } 31 | } 32 | 33 | return idx; 34 | } 35 | -------------------------------------------------------------------------------- /applications/helpers/device_advisor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | if(BUILD_TESTING AND NOT CMAKE_CROSSCOMPILING) 6 | # left empty for future mocks. 7 | else() 8 | add_library(helpers-device-advisor 9 | src/aws_device_advisor_task.c 10 | ) 11 | 12 | target_include_directories(helpers-device-advisor 13 | PUBLIC 14 | inc 15 | ) 16 | 17 | target_link_libraries(helpers-device-advisor 18 | coremqtt 19 | coremqtt-agent 20 | helpers-events 21 | ) 22 | endif() 23 | -------------------------------------------------------------------------------- /applications/helpers/device_advisor/inc/aws_device_advisor_task.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2024 Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | 6 | #ifndef __AWS_DEVICE_ADVISOR_TASK__H__ 7 | #define __AWS_DEVICE_ADVISOR_TASK__H__ 8 | 9 | /* app_config.h is included before checking the value of appCONFIG_DEVICE_ADVISOR_TEST_ACTIVE 10 | * because appCONFIG_DEVICE_ADVISOR_TEST_ACTIVE is defined with 0 or 1 in that header file. */ 11 | #include "app_config.h" 12 | 13 | #if ( appCONFIG_DEVICE_ADVISOR_TEST_ACTIVE == 1 ) 14 | 15 | #include 16 | 17 | /** 18 | * @brief Create the device advisor validation task. 19 | */ 20 | void vStartDeviceAdvisorTask( void ); 21 | 22 | /** 23 | * @brief The maximum amount of time in milliseconds to wait for the commands 24 | * to be posted to the MQTT agent should the MQTT agent's command queue be full. 25 | * Tasks wait in the Blocked state, so don't use any CPU time. 26 | */ 27 | #define deviceAdvisorMAX_COMMAND_SEND_BLOCK_TIME_MS ( 5000 ) 28 | 29 | #define deviceAdvisorTOPIC_FORMAT "device_advisor_test" 30 | #define deviceAdvisorTOPIC_BUFFER_LENGTH ( strlen( deviceAdvisorTOPIC_FORMAT ) ) 31 | #define deviceAdvisorTASK_STACK_SIZE ( 2048 ) 32 | #define deviceAdvisorTASK_PRIORITY ( tskIDLE_PRIORITY + 1 ) 33 | 34 | /** 35 | * @brief Size of statically allocated buffers for holding payloads. 36 | */ 37 | #define deviceAdvisorSTRING_BUFFER_LENGTH ( 20480 ) 38 | 39 | #endif /* if ( appCONFIG_DEVICE_ADVISOR_TEST_ACTIVE == 1 ) */ 40 | 41 | #endif /* __AWS_DEVICE_ADVISOR_TASK__H__ */ 42 | -------------------------------------------------------------------------------- /applications/helpers/events/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | if(BUILD_TESTING AND NOT CMAKE_CROSSCOMPILING) 6 | add_subdirectory(mocks) 7 | else() 8 | add_library(helpers-events 9 | src/events.c 10 | ) 11 | 12 | target_include_directories(helpers-events 13 | PUBLIC 14 | inc 15 | ) 16 | 17 | target_link_libraries(helpers-events 18 | freertos_kernel 19 | ) 20 | endif() 21 | -------------------------------------------------------------------------------- /applications/helpers/events/inc/events.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | 6 | #ifndef EVENT_H 7 | #define EVENT_H 8 | 9 | #include 10 | 11 | /* Kernel includes. */ 12 | #include "FreeRTOS.h" 13 | #include "event_groups.h" 14 | 15 | #define EVENT_MASK_NETWORK_UP 0x01 16 | #define EVENT_MASK_MQTT_INIT 0x02 17 | #define EVENT_MASK_MQTT_CONNECTED 0x04 18 | #define EVENT_MASK_ML_START 0x08 19 | #define EVENT_MASK_ML_STOP 0x10 20 | #define EVENT_MASK_DSP_START 0x20 21 | 22 | extern EventGroupHandle_t xSystemEvents; 23 | 24 | /** 25 | * @brief Create a system events group. 26 | * @return 0 if the event group was created successfully, -1 otherwise. 27 | */ 28 | int32_t xEventHelperInit( void ); 29 | 30 | /** 31 | * @brief Wait until network is up and running. 32 | */ 33 | void vWaitUntilNetworkIsUp( void ); 34 | 35 | /** 36 | * @brief Wait until MQTT agent is initialised. 37 | */ 38 | void vWaitUntilMQTTAgentReady( void ); 39 | 40 | /** 41 | * @brief Wait until MQTT agent is connected to an MQTT broker. 42 | */ 43 | void vWaitUntilMQTTAgentConnected( void ); 44 | 45 | /** 46 | * @brief Is MQTT agent connected to an MQTT broker. 47 | * @return true: MQTT agent connected to an MQTT broker 48 | * false: MQTT agent is not connected to an MQTT broker 49 | */ 50 | bool xIsMqttAgentConnected( void ); 51 | 52 | #endif /* EVENT_H */ 53 | -------------------------------------------------------------------------------- /applications/helpers/events/mocks/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_library(helpers-events-mock 6 | src/events.c 7 | ) 8 | 9 | target_include_directories(helpers-events-mock 10 | PUBLIC 11 | inc 12 | ) 13 | 14 | target_link_libraries(helpers-events-mock 15 | PRIVATE 16 | fff 17 | ) 18 | -------------------------------------------------------------------------------- /applications/helpers/events/mocks/inc/events.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023-2024 Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | 6 | #ifndef EVENT_H 7 | #define EVENT_H 8 | 9 | #include "fff.h" 10 | #include 11 | 12 | #define EVENT_MASK_MQTT_INIT 0x02 13 | #define EVENT_MASK_MQTT_CONNECTED 0x04 14 | 15 | typedef void * EventGroupHandle_t; 16 | 17 | extern EventGroupHandle_t xSystemEvents; 18 | 19 | DECLARE_FAKE_VALUE_FUNC( bool, 20 | xIsMqttAgentConnected ); 21 | DECLARE_FAKE_VOID_FUNC( vWaitUntilNetworkIsUp ); 22 | DECLARE_FAKE_VOID_FUNC( vWaitUntilMQTTAgentReady ); 23 | DECLARE_FAKE_VOID_FUNC( vWaitUntilMQTTAgentConnected ); 24 | 25 | 26 | #endif /* EVENT_H */ 27 | -------------------------------------------------------------------------------- /applications/helpers/events/mocks/src/events.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2023-2024 Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | 6 | #include "events.h" 7 | 8 | EventGroupHandle_t xSystemEvents; 9 | 10 | DEFINE_FAKE_VALUE_FUNC( bool, 11 | xIsMqttAgentConnected ); 12 | DEFINE_FAKE_VOID_FUNC( vWaitUntilNetworkIsUp ); 13 | DEFINE_FAKE_VOID_FUNC( vWaitUntilMQTTAgentReady ); 14 | DEFINE_FAKE_VOID_FUNC( vWaitUntilMQTTAgentConnected ); 15 | -------------------------------------------------------------------------------- /applications/helpers/hdlcd/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | if(BUILD_TESTING AND NOT CMAKE_CROSSCOMPILING) 6 | # left empty for future mocks. 7 | else() 8 | add_library(helpers-hdlcd STATIC) 9 | 10 | target_include_directories(helpers-hdlcd 11 | PUBLIC 12 | . 13 | ) 14 | 15 | target_sources(helpers-hdlcd 16 | PUBLIC 17 | hdlcd_helper.c 18 | ) 19 | 20 | target_link_libraries(helpers-hdlcd 21 | PUBLIC 22 | fri-bsp 23 | ) 24 | endif() 25 | -------------------------------------------------------------------------------- /applications/helpers/hdlcd/hdlcd_helper.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2024 Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | 6 | #ifndef __HDLCD_HELPER_H__ 7 | #define __HDLCD_HELPER_H__ 8 | 9 | #include "hdlcd_drv.h" 10 | #include 11 | 12 | #define RGB565_YELLOW 0xFFE0U 13 | #define RGB565_RED 0xF800U 14 | #define RGB32_YELLOW 0xFFFF00U 15 | #define RGB32_RED 0xFF0000U 16 | #define A2R10G10B10_YELLOW 0x3FFFFC00U 17 | #define A2R10G10B10_RED 0x3FF00000U 18 | 19 | typedef struct hdlcd_mode 20 | { 21 | uint32_t pixel_format; 22 | uint32_t bytes_per_pixel; 23 | uint32_t default_highlight_color; 24 | uint32_t default_mask_color; 25 | const struct hdlcd_pixel_cfg_t * const pixel_cfg; 26 | } hdlcd_mode_t; 27 | 28 | enum hdlcd_pixel_format 29 | { 30 | HDLCD_PIXEL_FORMAT_RGB565 = 0, 31 | HDLCD_PIXEL_FORMAT_RGB32 = 1, 32 | HDLCD_PIXEL_FORMAT_A2R10G10B10 = 2, 33 | HDLCD_PIXEL_FORMAT_NOT_SUPPORTED 34 | }; 35 | 36 | extern const hdlcd_mode_t HDLCD_MODES[ HDLCD_PIXEL_FORMAT_NOT_SUPPORTED ]; 37 | 38 | #endif /* __HDLCD_HELPER_H__ */ 39 | -------------------------------------------------------------------------------- /applications/helpers/logging/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | if(BUILD_TESTING AND NOT CMAKE_CROSSCOMPILING) 6 | add_subdirectory(mocks) 7 | else() 8 | add_library(helpers-logging 9 | src/iot_logging_task_dynamic_buffers.c 10 | ) 11 | 12 | target_include_directories(helpers-logging 13 | PUBLIC 14 | inc 15 | ) 16 | 17 | target_link_libraries(helpers-logging 18 | freertos_kernel 19 | ) 20 | endif() 21 | -------------------------------------------------------------------------------- /applications/helpers/logging/mocks/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_library(helpers-logging-mock 6 | INTERFACE 7 | ) 8 | 9 | target_include_directories(helpers-logging-mock 10 | INTERFACE 11 | inc 12 | ) 13 | 14 | target_link_libraries(helpers-logging-mock 15 | INTERFACE 16 | fff 17 | ) 18 | -------------------------------------------------------------------------------- /applications/helpers/logging/mocks/inc/logging_levels.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Common V1.1.3 3 | * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * Copyright 2024 Arm Limited and/or its affiliates 5 | * 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | */ 24 | 25 | #ifndef LOGGING_LEVELS_H_ 26 | #define LOGGING_LEVELS_H_ 27 | 28 | #endif /* LOGGING_LEVELS_H_ */ 29 | -------------------------------------------------------------------------------- /applications/helpers/ota_orchestrator/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2024-2025 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | if(BUILD_TESTING AND NOT CMAKE_CROSSCOMPILING) 6 | # Left empty for future mocks. 7 | else() 8 | add_library(ota-update 9 | src/mqtt_helpers.c 10 | src/ota_orchestrator_helpers.c 11 | src/ota_os_freertos.c 12 | src/ota_orchestrator.c 13 | ) 14 | 15 | target_include_directories(ota-update 16 | PUBLIC 17 | inc/ 18 | ) 19 | 20 | target_compile_definitions(ota-update 21 | PRIVATE 22 | -DMCUBOOT_IMAGE_NUMBER=${MCUBOOT_IMAGE_NUMBER} 23 | ) 24 | 25 | target_link_libraries(ota-update 26 | PUBLIC 27 | jobs-for-aws-iot-embedded-sdk 28 | aws-iot-core-mqtt-file-streams-embedded-c 29 | freertos_kernel 30 | corejson 31 | coremqtt 32 | coremqtt-agent 33 | tinycbor 34 | freertos-ota-pal-psa 35 | helpers-events 36 | backoff-algorithm 37 | crt-helpers 38 | PRIVATE 39 | helpers-logging 40 | ) 41 | endif() 42 | -------------------------------------------------------------------------------- /applications/helpers/ota_orchestrator/inc/ota_register_callback.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023-2024 Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | 6 | #ifndef OTA_REGISTER_CALLBACK_H 7 | #define OTA_REGISTER_CALLBACK_H 8 | 9 | /* Standard includes. */ 10 | #include 11 | #include 12 | 13 | /** 14 | * @brief Register OTA callbacks with the subscription manager. 15 | * 16 | * @param[in] pTopicFilter The topic filter for which a callback needs to be registered for. 17 | * @param[in] topicFilterLength Length of the topic filter. 18 | */ 19 | void prvRegisterOTACallback( const char * pTopicFilter, 20 | uint16_t topicFilterLength ); 21 | 22 | #endif /* OTA_REGISTER_CALLBACK_H */ 23 | -------------------------------------------------------------------------------- /applications/helpers/provisioning/provisioning_config.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | 6 | #include "provisioning_config_target.h" 7 | 8 | /* *INDENT-OFF* */ 9 | 10 | #ifndef _PROVISIONING_CONFIG_H_ 11 | #define _PROVISIONING_CONFIG_H_ 12 | 13 | #define PROVISIONING_MAGIC 0xC0DEFEED 14 | #define PROVISIONING_DATA_LEN ( 0x1000 ) 15 | #define PROVISIONING_DATA_HEADER_SIZE ( 0x4 ) 16 | #define PROVISIONING_PARAM_START ( PROVISIONING_DATA_START + PROVISIONING_DATA_HEADER_SIZE ) 17 | 18 | #endif /* _PROVISIONING_CONFIG_H_ */ 19 | 20 | /* *INDENT-ON* */ 21 | -------------------------------------------------------------------------------- /applications/helpers/provisioning/provisioning_data.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | 6 | #include "provisioning_data.h" 7 | #include "aws_clientcredential_keys.h" 8 | 9 | const ProvisioningParamsBundle_t provisioningBundle = 10 | { 11 | .provisioningMagic1 = PROVISIONING_MAGIC, 12 | .provisioningParams = 13 | { 14 | .pucJITPCertificate = keyJITR_DEVICE_CERTIFICATE_AUTHORITY_PEM, 15 | .pucClientCertificate = keyCLIENT_CERTIFICATE_PEM, 16 | .pucClientPrivateKey = keyCLIENT_PRIVATE_KEY_PEM 17 | }, 18 | .codeSigningPublicKey = keyCODE_SIGNING_PUBLIC_KEY_PEM, 19 | .provisioningMagic2 = PROVISIONING_MAGIC 20 | }; 21 | -------------------------------------------------------------------------------- /applications/helpers/provisioning/provisioning_data.ld: -------------------------------------------------------------------------------- 1 | ;/* Copyright 2023 Arm Limited and/or its affiliates 2 | ; * 3 | ; * SPDX-License-Identifier: MIT 4 | ; */ 5 | 6 | #include "provisioning_config.h" 7 | 8 | MEMORY 9 | { 10 | CODE (rx) : ORIGIN = PROVISIONING_DATA_START, LENGTH = PROVISIONING_DATA_LEN 11 | } 12 | 13 | SECTIONS 14 | { 15 | RO_DATA : 16 | { 17 | *(.rodata.provisioningBundle) 18 | *(.rodata*) 19 | } > CODE 20 | } 21 | -------------------------------------------------------------------------------- /applications/helpers/provisioning/provisioning_data.sct: -------------------------------------------------------------------------------- 1 | ;/* Copyright 2023 Arm Limited and/or its affiliates 2 | ; * 3 | ; * SPDX-License-Identifier: MIT 4 | ; */ 5 | 6 | #include "provisioning_config.h" 7 | 8 | LR_DATA PROVISIONING_DATA_START { 9 | RO_DATA PROVISIONING_DATA_START PROVISIONING_DATA_LEN{ 10 | * 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /applications/helpers/sntp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | if(BUILD_TESTING AND NOT CMAKE_CROSSCOMPILING) 6 | # left empty for future mocks. 7 | else() 8 | add_library(helpers-sntp 9 | src/sntp_client_task.c 10 | ) 11 | 12 | target_include_directories(helpers-sntp 13 | PUBLIC 14 | inc 15 | ) 16 | 17 | target_include_directories(coresntp-config 18 | INTERFACE 19 | inc 20 | ) 21 | 22 | target_link_libraries(helpers-sntp 23 | PUBLIC 24 | backoff-algorithm 25 | connectivity-stack 26 | corepkcs11 27 | coresntp 28 | mbedtls 29 | PRIVATE 30 | helpers-logging 31 | ) 32 | endif() 33 | -------------------------------------------------------------------------------- /applications/keyword_detection/blink_task.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2021-2023 Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | 6 | #ifndef BLINK_TASK_H 7 | #define BLINK_TASK_H 8 | 9 | #include 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | /* Blinks LEDs according the ML model state. 16 | */ 17 | void vBlinkTask( void * arg ); 18 | 19 | /* 20 | * @brief Create blink task using FreeRTOS task creation function. 21 | */ 22 | void vStartBlinkTask( void ); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | 28 | #endif /* ! BLINK_TASK_H*/ 29 | -------------------------------------------------------------------------------- /applications/keyword_detection/configs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_subdirectory(app_config) 6 | add_subdirectory(aws_configs) 7 | add_subdirectory(freertos_config) 8 | add_subdirectory(mbedtls_config) 9 | -------------------------------------------------------------------------------- /applications/keyword_detection/configs/app_config/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_library(app-config INTERFACE) 6 | 7 | target_include_directories(app-config 8 | INTERFACE 9 | . 10 | ) 11 | -------------------------------------------------------------------------------- /applications/keyword_detection/configs/aws_configs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | target_include_directories(coremqtt-config 6 | INTERFACE 7 | . 8 | ) 9 | 10 | target_compile_definitions(coremqtt-agent-config 11 | INTERFACE 12 | MQTT_AGENT_DO_NOT_USE_CUSTOM_CONFIG 13 | ) 14 | 15 | target_include_directories(corepkcs11-config 16 | INTERFACE 17 | . 18 | ) 19 | 20 | target_include_directories(freertos-ota-pal-psa-config 21 | INTERFACE 22 | . 23 | ) 24 | 25 | target_include_directories(freertos-pkcs11-psa-config 26 | INTERFACE 27 | . 28 | ) 29 | -------------------------------------------------------------------------------- /applications/keyword_detection/configs/aws_configs/MQTTFileDownloader_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Amazon.com, Inc. and its affiliates. All Rights Reserved. 3 | * Copyright 2024 Arm Limited and/or its affiliates 4 | * 5 | * 6 | * SPDX-License-Identifier: MIT 7 | * Licensed under the MIT License. See the LICENSE accompanying this file 8 | * for the specific language governing permissions and limitations under 9 | * the License. 10 | */ 11 | 12 | /** 13 | * @file MQTTFileDownloader_config.h 14 | * @brief MQTT File Streams options. 15 | */ 16 | 17 | #ifndef MQTT_FILE_DOWNLOADER_CONFIG_H 18 | #define MQTT_FILE_DOWNLOADER_CONFIG_H 19 | 20 | /* Standard includes */ 21 | #include 22 | 23 | /** 24 | * @ingroup mqtt_file_downloader_const_types 25 | * @brief Configure the Maximum size of the data payload. The 26 | * smallest value is 256 bytes, maximum is 128KB. For more see 27 | * https://docs.aws.amazon.com/general/latest/gr/iot-core.html 28 | */ 29 | #define mqttFileDownloader_CONFIG_BLOCK_SIZE 4096U 30 | 31 | #endif /* MQTT_FILE_DOWNLOADER_CONFIG_H */ 32 | -------------------------------------------------------------------------------- /applications/keyword_detection/configs/freertos_config/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2025 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | target_include_directories(freertos_config SYSTEM 6 | INTERFACE 7 | . 8 | ) 9 | 10 | target_compile_definitions(freertos_config 11 | INTERFACE 12 | projCOVERAGE_TEST=0 13 | ) 14 | 15 | target_link_libraries(freertos_config 16 | INTERFACE 17 | tfm_api_ns 18 | app-config 19 | ) 20 | -------------------------------------------------------------------------------- /applications/keyword_detection/configs/mbedtls_config/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2025 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | target_include_directories(mbedtls-config 6 | INTERFACE 7 | . 8 | ) 9 | 10 | target_link_libraries(mbedtls-config 11 | INTERFACE 12 | freertos_kernel 13 | ) 14 | -------------------------------------------------------------------------------- /applications/keyword_detection/ml-model-update-demo/faulty_kws_micronet_m.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeRTOS/iot-reference-arm-corstone3xx/0b2f65dcfc62a5f1cddf0e58f73118558165e8fa/applications/keyword_detection/ml-model-update-demo/faulty_kws_micronet_m.tflite -------------------------------------------------------------------------------- /applications/keyword_detection/ml-model-update-demo/kws_micronet_m.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeRTOS/iot-reference-arm-corstone3xx/0b2f65dcfc62a5f1cddf0e58f73118558165e8fa/applications/keyword_detection/ml-model-update-demo/kws_micronet_m.tflite -------------------------------------------------------------------------------- /applications/keyword_detection/model_config.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2021-2023 Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | 6 | #include 7 | 8 | extern const uint32_t g_NumMfcc = 10; 9 | extern const uint32_t g_NumAudioWins = 49; 10 | -------------------------------------------------------------------------------- /applications/keyword_detection/resources/test.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeRTOS/iot-reference-arm-corstone3xx/0b2f65dcfc62a5f1cddf0e58f73118558165e8fa/applications/keyword_detection/resources/test.wav -------------------------------------------------------------------------------- /applications/keyword_detection/resources/use_case_resources.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "kws", 4 | "url_prefix": [ 5 | "https://github.com/ARM-software/ML-zoo/raw/9f506fe52b39df545f0e6c5ff9223f671bc5ae00/models/keyword_spotting/micronet_medium/tflite_int8/" 6 | ], 7 | "resources": [ 8 | {"name": "ifm0.npy", "url": "{url_prefix:0}testing_input/input/0.npy"}, 9 | {"name": "ofm0.npy", "url": "{url_prefix:0}testing_output/Identity/0.npy"}, 10 | { 11 | "name": "kws_micronet_m.tflite", 12 | "url": "{url_prefix:0}kws_micronet_m.tflite" 13 | } 14 | ] 15 | } 16 | ] 17 | -------------------------------------------------------------------------------- /applications/keyword_detection/tests/corstone300_model_pass_output.log: -------------------------------------------------------------------------------- 1 | Waiting for provisioning bundle 2 | Running provisioning bundle 3 | Secure Component (ID 0) version=2.2.0 4 | Non-Secure Component (ID 1) version=0.0.10 5 | ML Model Component (ID 2) version=0.0.11 6 | Starting bootloader 7 | Booting TF-M v2.2.0 8 | PSA Framework version is: 257 9 | Secure Component (ID 0) version=2.2.0 10 | Non-Secure Component (ID 1) version=0.0.10 11 | ML Model Component (ID 2) version=0.0.42 12 | ML interface initialised 13 | ML_HEARD_ON 14 | ML UNKNOWN 15 | ML_HEARD_OFF 16 | ML UNKNOWN 17 | ML_HEARD_GO 18 | ML UNKNOWN 19 | -------------------------------------------------------------------------------- /applications/keyword_detection/tests/corstone300_pass_output.log: -------------------------------------------------------------------------------- 1 | Waiting for provisioning bundle 2 | Running provisioning bundle 3 | Secure Component (ID 0) version=2.2.0 4 | Non-Secure Component (ID 1) version=0.0.10 5 | Starting bootloader 6 | Booting TF-M v2.2.0 7 | PSA Framework version is: 257 8 | Secure Component (ID 0) version=2.2.0 9 | Non-Secure Component (ID 1) version=0.0.20 10 | ML interface initialised 11 | ML_HEARD_ON 12 | ML UNKNOWN 13 | ML_HEARD_OFF 14 | ML UNKNOWN 15 | ML_HEARD_GO 16 | ML UNKNOWN 17 | -------------------------------------------------------------------------------- /applications/keyword_detection/tests/corstone310_model_pass_output.log: -------------------------------------------------------------------------------- 1 | Waiting for provisioning bundle 2 | Running provisioning bundle 3 | Secure Component (ID 0) version=2.2.0 4 | Non-Secure Component (ID 1) version=0.0.10 5 | ML Model Component (ID 2) version=0.0.11 6 | Starting bootloader 7 | Booting TF-M v2.2.0 8 | PSA Framework version is: 257 9 | Secure Component (ID 0) version=2.2.0 10 | Non-Secure Component (ID 1) version=0.0.10 11 | ML Model Component (ID 2) version=0.0.42 12 | ML interface initialised 13 | ML_HEARD_ON 14 | ML UNKNOWN 15 | ML_HEARD_OFF 16 | ML UNKNOWN 17 | ML_HEARD_GO 18 | ML UNKNOWN 19 | -------------------------------------------------------------------------------- /applications/keyword_detection/tests/corstone310_pass_output.log: -------------------------------------------------------------------------------- 1 | Waiting for provisioning bundle 2 | Running provisioning bundle 3 | Secure Component (ID 0) version=2.2.0 4 | Non-Secure Component (ID 1) version=0.0.10 5 | Starting bootloader 6 | Booting TF-M v2.2.0 7 | PSA Framework version is: 257 8 | Secure Component (ID 0) version=2.2.0 9 | Non-Secure Component (ID 1) version=0.0.20 10 | ML interface initialised 11 | ML_HEARD_ON 12 | ML UNKNOWN 13 | ML_HEARD_OFF 14 | ML UNKNOWN 15 | ML_HEARD_GO 16 | ML UNKNOWN 17 | -------------------------------------------------------------------------------- /applications/keyword_detection/tests/corstone315_model_pass_output.log: -------------------------------------------------------------------------------- 1 | Waiting for DM provisioning bundle 2 | Running DM provisioning bundle 3 | Secure Component (ID 0) version=2.2.0 4 | Non-Secure Component (ID 1) version=0.0.10 5 | ML Model Component (ID 2) version=0.0.11 6 | Starting bootloader 7 | Booting TF-M v2.2.0 8 | PSA Framework version is: 257 9 | Secure Component (ID 0) version=2.2.0 10 | Non-Secure Component (ID 1) version=0.0.10 11 | ML Model Component (ID 2) version=0.0.42 12 | ML interface initialised 13 | ML_HEARD_ON 14 | ML UNKNOWN 15 | ML_HEARD_OFF 16 | ML UNKNOWN 17 | ML_HEARD_GO 18 | ML UNKNOWN 19 | -------------------------------------------------------------------------------- /applications/keyword_detection/tests/corstone315_pass_output.log: -------------------------------------------------------------------------------- 1 | Waiting for DM provisioning bundle 2 | Running DM provisioning bundle 3 | Secure Component (ID 0) version=2.2.0 4 | Non-Secure Component (ID 1) version=0.0.10 5 | Starting bootloader 6 | Booting TF-M v2.2.0 7 | PSA Framework version is: 257 8 | Secure Component (ID 0) version=2.2.0 9 | Non-Secure Component (ID 1) version=0.0.20 10 | ML interface initialised 11 | ML_HEARD_ON 12 | ML UNKNOWN 13 | ML_HEARD_OFF 14 | ML UNKNOWN 15 | ML_HEARD_GO 16 | ML UNKNOWN 17 | -------------------------------------------------------------------------------- /applications/keyword_detection/tests/corstone320_model_pass_output.log: -------------------------------------------------------------------------------- 1 | Waiting for DM provisioning bundle 2 | Running DM provisioning bundle 3 | Secure Component (ID 0) version=2.2.0 4 | Non-Secure Component (ID 1) version=0.0.10 5 | ML Model Component (ID 2) version=0.0.11 6 | Starting bootloader 7 | Booting TF-M v2.2.0 8 | PSA Framework version is: 257 9 | Secure Component (ID 0) version=2.2.0 10 | Non-Secure Component (ID 1) version=0.0.10 11 | ML Model Component (ID 2) version=0.0.42 12 | ML interface initialised 13 | ML_HEARD_ON 14 | ML UNKNOWN 15 | ML_HEARD_OFF 16 | ML UNKNOWN 17 | ML_HEARD_GO 18 | ML UNKNOWN 19 | -------------------------------------------------------------------------------- /applications/keyword_detection/tests/corstone320_pass_output.log: -------------------------------------------------------------------------------- 1 | Waiting for DM provisioning bundle 2 | Running DM provisioning bundle 3 | Secure Component (ID 0) version=2.2.0 4 | Non-Secure Component (ID 1) version=0.0.10 5 | Starting bootloader 6 | Booting TF-M v2.2.0 7 | PSA Framework version is: 257 8 | Secure Component (ID 0) version=2.2.0 9 | Non-Secure Component (ID 1) version=0.0.20 10 | ML interface initialised 11 | ML_HEARD_ON 12 | ML UNKNOWN 13 | ML_HEARD_OFF 14 | ML UNKNOWN 15 | ML_HEARD_GO 16 | ML UNKNOWN 17 | -------------------------------------------------------------------------------- /applications/keyword_detection/tests/fail_output.log: -------------------------------------------------------------------------------- 1 | Failed to provision device private key 2 | Failed job document content check 3 | Failed to execute state transition handler 4 | -------------------------------------------------------------------------------- /applications/object_detection/TfmInitialCache.cmake: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | include(${ROOT}/cmake/TfmInitialCacheCommon.cmake) 6 | 7 | set(TFM_MBEDCRYPTO_CONFIG_CLIENT_PATH "${ROOT}/applications/object_detection/configs/mbedtls_config/aws_mbedtls_config.h" CACHE FILEPATH "TFM_MBEDCRYPTO_CONFIG_CLIENT_PATH" FORCE) 8 | set(PROJECT_CONFIG_HEADER_FILE ${ROOT}/applications/object_detection/configs/tfm_config/project_config.h CACHE FILEPATH "PROJECT_CONFIG_HEADER_FILE" FORCE) 9 | set(MCUBOOT_IMAGE_NUMBER 2 CACHE STRING "MCUBOOT_IMAGE_NUMBER" FORCE) 10 | set(DEFAULT_MCUBOOT_FLASH_MAP ON CACHE BOOL "DEFAULT_MCUBOOT_FLASH_MAP" FORCE) 11 | set(MCUBOOT_UPGRADE_STRATEGY "SWAP_USING_SCRATCH" CACHE STRING "MCUBOOT_UPGRADE_STRATEGY" FORCE) 12 | set(MCUBOOT_IMAGE_VERSION_NS "0.0.10+0" CACHE STRING "MCUBOOT_IMAGE_VERSION_NS" FORCE) 13 | set(CONFIG_TFM_HALT_ON_CORE_PANIC ON CACHE BOOL "CONFIG_TFM_HALT_ON_CORE_PANIC" FORCE) 14 | set(MCUBOOT_DATA_SHARING ON CACHE BOOL "MCUBOOT_DATA_SHARING" FORCE) 15 | set(PLATFORM_HAS_FIRMWARE_UPDATE_SUPPORT ON CACHE BOOL "PLATFORM_HAS_FIRMWARE_UPDATE_SUPPORT" FORCE) 16 | set(TFM_PARTITION_FIRMWARE_UPDATE ON CACHE BOOL "TFM_PARTITION_FIRMWARE_UPDATE" FORCE) 17 | set(TFM_PARTITION_LOG_LEVEL TFM_PARTITION_LOG_LEVEL_INFO CACHE STRING "TFM_PARTITION_LOG_LEVEL" FORCE) 18 | set(CONFIG_TFM_ENABLE_MVE ON CACHE STRING "CONFIG_TFM_ENABLE_MVE" FORCE) 19 | set(CONFIG_TFM_ENABLE_MVE_FP ON CACHE STRING "CONFIG_TFM_ENABLE_MVE_FP" FORCE) 20 | -------------------------------------------------------------------------------- /applications/object_detection/blink_task.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2021-2024, Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | 6 | #ifndef BLINK_TASK_H 7 | #define BLINK_TASK_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /** 14 | * @brief Create blink task. 15 | */ 16 | void vStartBlinkTask( void ); 17 | 18 | /** 19 | * @brief Blinks LEDs according to ML processing. 20 | * 21 | * LED1 ON and LED2 OFF => heard YES 22 | * LED1 OFF and LED2 OFF => heard NO 23 | * LED1 OFF and LED2 blinking => no/unknown input 24 | * @param pvParameters Contextual data for the task. 25 | */ 26 | void vBlinkTask( void * pvParameters ); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif /* ! BLINK_TASK_H*/ 33 | -------------------------------------------------------------------------------- /applications/object_detection/configs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024, Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_subdirectory(app_config) 6 | add_subdirectory(arm_2d_config) 7 | add_subdirectory(aws_configs) 8 | add_subdirectory(isp_config) 9 | add_subdirectory(freertos_config) 10 | add_subdirectory(mbedtls_config) 11 | -------------------------------------------------------------------------------- /applications/object_detection/configs/app_config/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024, Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_library(app-config INTERFACE) 6 | 7 | target_include_directories(app-config 8 | INTERFACE 9 | . 10 | ) 11 | -------------------------------------------------------------------------------- /applications/object_detection/configs/arm_2d_config/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_library(arm_2d-config INTERFACE) 6 | 7 | target_include_directories(arm_2d-config 8 | INTERFACE 9 | . 10 | ) 11 | -------------------------------------------------------------------------------- /applications/object_detection/configs/aws_configs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024, Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | target_include_directories(coremqtt-config 6 | INTERFACE 7 | . 8 | ) 9 | 10 | target_compile_definitions(coremqtt-agent-config 11 | INTERFACE 12 | MQTT_AGENT_DO_NOT_USE_CUSTOM_CONFIG 13 | ) 14 | 15 | target_include_directories(corepkcs11-config 16 | INTERFACE 17 | . 18 | ) 19 | 20 | target_include_directories(freertos-ota-pal-psa-config 21 | INTERFACE 22 | . 23 | ) 24 | 25 | target_include_directories(freertos-pkcs11-psa-config 26 | INTERFACE 27 | . 28 | ) 29 | -------------------------------------------------------------------------------- /applications/object_detection/configs/aws_configs/MQTTFileDownloader_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Amazon.com, Inc. and its affiliates. All Rights Reserved. 3 | * Copyright 2024 Arm Limited and/or its affiliates 4 | * 5 | * 6 | * SPDX-License-Identifier: MIT 7 | * Licensed under the MIT License. See the LICENSE accompanying this file 8 | * for the specific language governing permissions and limitations under 9 | * the License. 10 | */ 11 | 12 | /** 13 | * @file MQTTFileDownloader_config.h 14 | * @brief MQTT File Streams options. 15 | */ 16 | 17 | #ifndef MQTT_FILE_DOWNLOADER_CONFIG_H 18 | #define MQTT_FILE_DOWNLOADER_CONFIG_H 19 | 20 | /* Standard includes */ 21 | #include 22 | 23 | /** 24 | * @ingroup mqtt_file_downloader_const_types 25 | * @brief Configure the Maximum size of the data payload. The 26 | * smallest value is 256 bytes, maximum is 128KB. For more see 27 | * https://docs.aws.amazon.com/general/latest/gr/iot-core.html 28 | */ 29 | #define mqttFileDownloader_CONFIG_BLOCK_SIZE 4096U 30 | 31 | #endif /* MQTT_FILE_DOWNLOADER_CONFIG_H */ 32 | -------------------------------------------------------------------------------- /applications/object_detection/configs/freertos_config/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2025, Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | target_include_directories(freertos_config SYSTEM 6 | INTERFACE 7 | . 8 | ) 9 | 10 | target_compile_definitions(freertos_config 11 | INTERFACE 12 | projCOVERAGE_TEST=0 13 | ) 14 | 15 | target_link_libraries(freertos_config 16 | INTERFACE 17 | tfm_api_ns 18 | app-config 19 | ) 20 | -------------------------------------------------------------------------------- /applications/object_detection/configs/isp_config/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_library(isp_firmware_config INTERFACE) 6 | 7 | target_include_directories(isp_firmware_config 8 | INTERFACE 9 | . 10 | ) 11 | 12 | target_link_libraries(isp_firmware_config 13 | INTERFACE 14 | arm-corstone-platform-bsp 15 | ) 16 | -------------------------------------------------------------------------------- /applications/object_detection/configs/mbedtls_config/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2025, Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | target_include_directories(mbedtls-config 6 | INTERFACE 7 | . 8 | ) 9 | 10 | target_link_libraries(mbedtls-config 11 | INTERFACE 12 | freertos_kernel 13 | ) 14 | -------------------------------------------------------------------------------- /applications/object_detection/isp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_library(isp-config INTERFACE) 6 | 7 | target_include_directories(isp-config 8 | INTERFACE 9 | . 10 | ) 11 | 12 | target_sources(isp-config 13 | INTERFACE 14 | acamera_callbacks.c 15 | isp_app.c 16 | isp_config.c 17 | ) 18 | 19 | target_link_libraries(isp-config 20 | INTERFACE 21 | isp_control 22 | ) 23 | -------------------------------------------------------------------------------- /applications/object_detection/ml_interface.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2021-2024, Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | 6 | #ifndef ML_INTERFACE_H 7 | #define ML_INTERFACE_H 8 | 9 | #include 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | struct DetectRegion_t 16 | { 17 | uint32_t ulX; 18 | uint32_t ulY; 19 | uint32_t ulW; 20 | uint32_t ulH; 21 | }; 22 | 23 | typedef struct 24 | { 25 | char * pcResult; 26 | } MLMqttMsg_t; 27 | 28 | /** 29 | * @brief Start the inference task. 30 | */ 31 | void vMlTaskInferenceStart( void ); 32 | 33 | /** 34 | * @brief Stop the inference task. 35 | */ 36 | void vMlTaskInferenceStop( void ); 37 | 38 | /** 39 | * @brief Task to perform ML processing. 40 | * It is gated by the net task which lets it run 41 | * if no ota job is present. 42 | * @param pvParameters Contextual data for the task. 43 | */ 44 | void vMlTask( void * pvParameters ); 45 | 46 | /** 47 | * @brief Task to communicate ML results via MQTT. 48 | * @param pvParameters Contextual data for the task. 49 | */ 50 | void vMlMqttTask( void * pvParameters ); 51 | 52 | /** 53 | * @brief Create ML MQTT task. 54 | */ 55 | void vStartMlMqttTask( void ); 56 | 57 | /** 58 | * @brief Create ML task. 59 | * @param pvParameters Contextual data for the task. 60 | */ 61 | void vStartMlTask( void * pvParameters ); 62 | 63 | int32_t lMLRunInference( const uint8_t * pucImg, 64 | struct DetectRegion_t * pxResults, 65 | uint32_t * pulResultsNum ); 66 | 67 | #ifdef __cplusplus 68 | } 69 | #endif 70 | 71 | #endif /* ! ML_INTERFACE_H */ 72 | -------------------------------------------------------------------------------- /applications/object_detection/resources/test.frm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeRTOS/iot-reference-arm-corstone3xx/0b2f65dcfc62a5f1cddf0e58f73118558165e8fa/applications/object_detection/resources/test.frm -------------------------------------------------------------------------------- /applications/object_detection/resources/use_case_resources.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "object_detection", 4 | "url_prefix": [ 5 | "https://github.com/emza-vs/ModelZoo/blob/v1.0/object_detection/" 6 | ], 7 | "resources": [ 8 | { 9 | "name": "yolo-fastest_192_face_v4.tflite", 10 | "url": "{url_prefix:0}yolo-fastest_192_face_v4.tflite?raw=true" 11 | } 12 | ] 13 | } 14 | ] 15 | -------------------------------------------------------------------------------- /applications/object_detection/tests/corstone300_pass_output.log: -------------------------------------------------------------------------------- 1 | Waiting for provisioning bundle 2 | Running provisioning bundle 3 | Secure Component (ID 0) version=2.2.0 4 | Non-Secure Component (ID 1) version=0.0.10 5 | Starting bootloader 6 | Booting TF-M v2.2.0 7 | PSA Framework version is: 257 8 | Secure Component (ID 0) version=2.2.0 9 | Non-Secure Component (ID 1) version=0.0.20 10 | Complete recognition: Detected faces: 2 11 | Complete recognition: Detected faces: 2 12 | Complete recognition: Detected faces: 2 13 | -------------------------------------------------------------------------------- /applications/object_detection/tests/corstone310_pass_output.log: -------------------------------------------------------------------------------- 1 | Waiting for provisioning bundle 2 | Running provisioning bundle 3 | Secure Component (ID 0) version=2.2.0 4 | Non-Secure Component (ID 1) version=0.0.10 5 | Starting bootloader 6 | Booting TF-M v2.2.0 7 | PSA Framework version is: 257 8 | Secure Component (ID 0) version=2.2.0 9 | Non-Secure Component (ID 1) version=0.0.20 10 | Complete recognition: Detected faces: 2 11 | Complete recognition: Detected faces: 2 12 | Complete recognition: Detected faces: 2 13 | -------------------------------------------------------------------------------- /applications/object_detection/tests/corstone315_pass_output.log: -------------------------------------------------------------------------------- 1 | Waiting for DM provisioning bundle 2 | Running DM provisioning bundle 3 | Secure Component (ID 0) version=2.2.0 4 | Non-Secure Component (ID 1) version=0.0.10 5 | Starting bootloader 6 | Booting TF-M v2.2.0 7 | PSA Framework version is: 257 8 | Secure Component (ID 0) version=2.2.0 9 | Non-Secure Component (ID 1) version=0.0.20 10 | Complete recognition: Detected faces: 2 11 | Complete recognition: Detected faces: 2 12 | Complete recognition: Detected faces: 2 13 | -------------------------------------------------------------------------------- /applications/object_detection/tests/corstone320_pass_output.log: -------------------------------------------------------------------------------- 1 | Waiting for DM provisioning bundle 2 | Running DM provisioning bundle 3 | Secure Component (ID 0) version=2.2.0 4 | Non-Secure Component (ID 1) version=0.0.10 5 | Starting bootloader 6 | Booting TF-M v2.2.0 7 | PSA Framework version is: 257 8 | Secure Component (ID 0) version=2.2.0 9 | Non-Secure Component (ID 1) version=0.0.20 10 | Complete recognition: Detected faces: 2 11 | Complete recognition: Detected faces: 2 12 | Complete recognition: Detected faces: 2 13 | -------------------------------------------------------------------------------- /applications/object_detection/tests/fail_output.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeRTOS/iot-reference-arm-corstone3xx/0b2f65dcfc62a5f1cddf0e58f73118558165e8fa/applications/object_detection/tests/fail_output.log -------------------------------------------------------------------------------- /applications/speech_recognition/TfmInitialCache.cmake: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | include(${ROOT}/cmake/TfmInitialCacheCommon.cmake) 6 | 7 | set(TFM_MBEDCRYPTO_CONFIG_CLIENT_PATH "${ROOT}/applications/speech_recognition/configs/mbedtls_config/aws_mbedtls_config.h" CACHE FILEPATH "TFM_MBEDCRYPTO_CONFIG_CLIENT_PATH" FORCE) 8 | 9 | set(PROJECT_CONFIG_HEADER_FILE ${ROOT}/applications/speech_recognition/configs/tfm_config/project_config.h CACHE FILEPATH "PROJECT_CONFIG_HEADER_FILE" FORCE) 10 | set(MCUBOOT_IMAGE_NUMBER 2 CACHE STRING "MCUBOOT_IMAGE_NUMBER" FORCE) 11 | set(DEFAULT_MCUBOOT_FLASH_MAP ON CACHE BOOL "DEFAULT_MCUBOOT_FLASH_MAP" FORCE) 12 | set(MCUBOOT_UPGRADE_STRATEGY "SWAP_USING_SCRATCH" CACHE STRING "MCUBOOT_UPGRADE_STRATEGY" FORCE) 13 | set(MCUBOOT_IMAGE_VERSION_NS "0.0.10+0" CACHE STRING "MCUBOOT_IMAGE_VERSION_NS" FORCE) 14 | set(CONFIG_TFM_HALT_ON_CORE_PANIC ON CACHE BOOL "CONFIG_TFM_HALT_ON_CORE_PANIC" FORCE) 15 | set(MCUBOOT_DATA_SHARING ON CACHE BOOL "MCUBOOT_DATA_SHARING" FORCE) 16 | set(PLATFORM_HAS_FIRMWARE_UPDATE_SUPPORT ON CACHE BOOL "PLATFORM_HAS_FIRMWARE_UPDATE_SUPPORT" FORCE) 17 | set(TFM_PARTITION_FIRMWARE_UPDATE ON CACHE BOOL "TFM_PARTITION_FIRMWARE_UPDATE" FORCE) 18 | set(TFM_PARTITION_LOG_LEVEL TFM_PARTITION_LOG_LEVEL_INFO CACHE STRING "TFM_PARTITION_LOG_LEVEL" FORCE) 19 | set(CONFIG_TFM_ENABLE_MVE ON CACHE STRING "CONFIG_TFM_ENABLE_MVE" FORCE) 20 | set(CONFIG_TFM_ENABLE_MVE_FP ON CACHE STRING "CONFIG_TFM_ENABLE_MVE_FP" FORCE) 21 | -------------------------------------------------------------------------------- /applications/speech_recognition/blink_task.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2021-2023 Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | 6 | #ifndef BLINK_TASK_H 7 | #define BLINK_TASK_H 8 | 9 | #include 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | /** 16 | * @brief Create blink task. 17 | */ 18 | void vStartBlinkTask( void ); 19 | 20 | /** 21 | * @brief Blinks LEDs according to ML processing. 22 | * 23 | * LED1 ON and LED2 OFF => heard YES 24 | * LED1 OFF and LED2 OFF => heard NO 25 | * LED1 OFF and LED2 blinking => no/unknown input 26 | * @param pvParameters Contextual data for the task. 27 | */ 28 | void vBlinkTask( void * pvParameters ); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | #endif /* ! BLINK_TASK_H*/ 35 | -------------------------------------------------------------------------------- /applications/speech_recognition/configs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_subdirectory(app_config) 6 | add_subdirectory(aws_configs) 7 | add_subdirectory(freertos_config) 8 | add_subdirectory(mbedtls_config) 9 | -------------------------------------------------------------------------------- /applications/speech_recognition/configs/app_config/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_library(app-config INTERFACE) 6 | 7 | target_include_directories(app-config 8 | INTERFACE 9 | . 10 | ) 11 | -------------------------------------------------------------------------------- /applications/speech_recognition/configs/audio_configs/audio_config.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2022-2023 Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | 6 | #ifndef _AUDIO_CONFIG_H_ 7 | #define _AUDIO_CONFIG_H_ 8 | 9 | #define AUDIO_BLOCK_NUM ( 4 ) 10 | #define AUDIO_BLOCK_SIZE ( 3200 ) 11 | #define AUDIO_BUFFER_SIZE ( AUDIO_BLOCK_NUM * AUDIO_BLOCK_SIZE ) 12 | 13 | #define DSP_BLOCK_SIZE 320 14 | #define SAMPLE_RATE 16000 15 | #define CHANNELS 1U 16 | #define SAMPLE_BITS 16U 17 | #define NOISE_LEVEL_REDUCTION 30 18 | 19 | #endif /* ifndef _AUDIO_CONFIG_H_ */ 20 | -------------------------------------------------------------------------------- /applications/speech_recognition/configs/aws_configs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | target_include_directories(coremqtt-config 6 | INTERFACE 7 | . 8 | ) 9 | 10 | target_compile_definitions(coremqtt-agent-config 11 | INTERFACE 12 | MQTT_AGENT_DO_NOT_USE_CUSTOM_CONFIG 13 | ) 14 | 15 | target_include_directories(corepkcs11-config 16 | INTERFACE 17 | . 18 | ) 19 | 20 | target_include_directories(freertos-ota-pal-psa-config 21 | INTERFACE 22 | . 23 | ) 24 | 25 | target_include_directories(freertos-pkcs11-psa-config 26 | INTERFACE 27 | . 28 | ) 29 | -------------------------------------------------------------------------------- /applications/speech_recognition/configs/aws_configs/MQTTFileDownloader_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Amazon.com, Inc. and its affiliates. All Rights Reserved. 3 | * Copyright 2024 Arm Limited and/or its affiliates 4 | * 5 | * 6 | * SPDX-License-Identifier: MIT 7 | * Licensed under the MIT License. See the LICENSE accompanying this file 8 | * for the specific language governing permissions and limitations under 9 | * the License. 10 | */ 11 | 12 | /** 13 | * @file MQTTFileDownloader_config.h 14 | * @brief MQTT File Streams options. 15 | */ 16 | 17 | #ifndef MQTT_FILE_DOWNLOADER_CONFIG_H 18 | #define MQTT_FILE_DOWNLOADER_CONFIG_H 19 | 20 | /* Standard includes */ 21 | #include 22 | 23 | /** 24 | * @ingroup mqtt_file_downloader_const_types 25 | * @brief Configure the Maximum size of the data payload. The 26 | * smallest value is 256 bytes, maximum is 128KB. For more see 27 | * https://docs.aws.amazon.com/general/latest/gr/iot-core.html 28 | */ 29 | #define mqttFileDownloader_CONFIG_BLOCK_SIZE 4096U 30 | 31 | #endif /* MQTT_FILE_DOWNLOADER_CONFIG_H */ 32 | -------------------------------------------------------------------------------- /applications/speech_recognition/configs/freertos_config/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2025 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | target_include_directories(freertos_config SYSTEM 6 | INTERFACE 7 | . 8 | ) 9 | 10 | target_compile_definitions(freertos_config 11 | INTERFACE 12 | projCOVERAGE_TEST=0 13 | ) 14 | 15 | target_link_libraries(freertos_config 16 | INTERFACE 17 | tfm_api_ns 18 | app-config 19 | ) 20 | -------------------------------------------------------------------------------- /applications/speech_recognition/configs/mbedtls_config/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2025 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | target_include_directories(mbedtls-config 6 | INTERFACE 7 | . 8 | ) 9 | 10 | target_link_libraries(mbedtls-config 11 | INTERFACE 12 | freertos_kernel 13 | ) 14 | -------------------------------------------------------------------------------- /applications/speech_recognition/dsp/inc/dsp_interfaces.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2022-2023 Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | 6 | #ifndef _DSP_INTERFACE_H_ 7 | #define _DSP_INTERFACE_H_ 8 | 9 | #include "semphr.h" 10 | 11 | extern void vSetAudioTimestamp( float timestamp ); 12 | extern float xGetAudioTimestamp(); 13 | 14 | /* Communication between DspAudioSource and ISR */ 15 | struct DspAudioSource 16 | { 17 | public: 18 | DspAudioSource( const int16_t * audiobuffer, 19 | size_t block_count ); 20 | 21 | const int16_t * pxGetCurrentBuffer(); 22 | 23 | #ifdef AUDIO_VSI 24 | void vWaitForNewBuffer(); 25 | 26 | static void prvNewAudioBlockReceived( void * ptr ); 27 | #endif 28 | 29 | private: 30 | size_t block_count; 31 | #ifdef AUDIO_VSI 32 | size_t block_under_write = 0; 33 | #endif 34 | size_t current_block = 0; 35 | const int16_t * audiobuffer; 36 | SemaphoreHandle_t semaphore = xSemaphoreCreateBinary(); 37 | }; 38 | 39 | class DSPML { 40 | public: 41 | DSPML( size_t bufferLengthInSamples ); 42 | ~DSPML(); 43 | 44 | void vCopyToDSPBufferFrom( int16_t * buf ); 45 | void vCopyFromMLBufferInto( int16_t * buf ); 46 | 47 | void vSwapBuffersAndWakeUpMLThread(); 48 | void vWaitForDSPData(); 49 | size_t xGetNbSamples() 50 | { 51 | return nbSamples; 52 | } 53 | 54 | private: 55 | SemaphoreHandle_t mutex = xSemaphoreCreateMutex(); 56 | SemaphoreHandle_t semaphore = xSemaphoreCreateBinary(); 57 | int16_t * bufferA, * bufferB, * dspBuffer, * mlBuffer; 58 | size_t nbSamples; 59 | }; 60 | 61 | #endif /* ifndef _DSP_INTERFACE_H_ */ 62 | -------------------------------------------------------------------------------- /applications/speech_recognition/dsp/inc/scheduler.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2022-2023 Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | 6 | /* 7 | * 8 | * Generated with CMSIS-DSP SDF Scripts. 9 | * The generated code is not covered by CMSIS-DSP license. 10 | * 11 | * The support classes and code is covered by CMSIS-DSP license. 12 | * 13 | */ 14 | 15 | #ifndef _SCHED_H_ 16 | #define _SCHED_H_ 17 | 18 | #include "queue.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" 22 | { 23 | #endif 24 | 25 | extern uint32_t ulScheduler( int * error, 26 | DspAudioSource * dspAudio, 27 | DSPML * dspMLConnection ); 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | #endif /* ifndef _SCHED_H_ */ 34 | -------------------------------------------------------------------------------- /applications/speech_recognition/dsp_task.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | 6 | #ifndef DSP_TASK_H 7 | #define DSP_TASK_H 8 | 9 | #include 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | typedef enum 16 | { 17 | DSP_EVENT_START, DSP_EVENT_STOP 18 | } dsp_event_t; 19 | typedef struct 20 | { 21 | dsp_event_t event; 22 | } dsp_msg_t; 23 | 24 | /** 25 | * @brief Create DSP task. 26 | * @param pvParameters Contextual data for the task. 27 | */ 28 | void vStartDSPTask( void * pvParameters ); 29 | 30 | /** 31 | * @brief Start the DSP task. 32 | */ 33 | void vDspStart( void ); 34 | 35 | /** 36 | * @brief Stop the DSP task. 37 | */ 38 | void vDspStop( void ); 39 | 40 | /** 41 | * @brief Task to digital signal processing 42 | * @param pvParameters Contextual data for the task. 43 | */ 44 | void vDspTask( void * pvParameters ); 45 | 46 | /** 47 | * @brief Get a new DSP ML Connection object 48 | */ 49 | void * pvDspGetMlConnection( void ); 50 | 51 | #ifdef __cplusplus 52 | } 53 | #endif 54 | 55 | #endif /* ! DSP_TASK_H*/ 56 | -------------------------------------------------------------------------------- /applications/speech_recognition/ml_interface.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2021-2023 Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | 6 | #ifndef ML_INTERFACE_H 7 | #define ML_INTERFACE_H 8 | 9 | #include 10 | #include 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | /** 17 | * @brief Start the inference task. 18 | */ 19 | void vMlTaskInferenceStart( void ); 20 | 21 | /** 22 | * @brief Stop the inference task. 23 | */ 24 | void vMlTaskInferenceStop( void ); 25 | 26 | /** 27 | * @brief Task to perform ML processing. 28 | * It is gated by the net task which lets it run 29 | * if no ota job is present. 30 | * @param pvParameters Contextual data for the task. 31 | */ 32 | void vMlTask( void * pvParameters ); 33 | 34 | /** 35 | * @brief Task to communicate ML results via MQTT. 36 | * @param pvParameters Contextual data for the task. 37 | */ 38 | void vMlMqttTask( void * pvParameters ); 39 | 40 | /** 41 | * @brief Create ML MQTT task. 42 | */ 43 | void vStartMlMqttTask( void ); 44 | 45 | /** 46 | * @brief Create ML task. 47 | * @param pvParameters Contextual data for the task. 48 | */ 49 | void vStartMlTask( void * pvParameters ); 50 | 51 | #ifdef __cplusplus 52 | } 53 | #endif 54 | 55 | #endif /* ! ML_INTERFACE_H */ 56 | -------------------------------------------------------------------------------- /applications/speech_recognition/model_config.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2021-2023 Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | 6 | #include "model_config.h" 7 | 8 | #include 9 | 10 | const uint32_t g_NumMfcc = 10; 11 | const uint32_t g_NumAudioWins = 49; 12 | 13 | const int g_FrameLength = 512; 14 | const int g_FrameStride = 160; 15 | const int g_ctxLen = 98; 16 | const float g_ScoreThreshold = 0.5; 17 | -------------------------------------------------------------------------------- /applications/speech_recognition/model_config.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2022-2023 Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | 6 | #ifndef MODEL_CONFIG_H 7 | #define MODEL_CONFIG_H 8 | 9 | #include 10 | 11 | extern const uint32_t g_NumMfcc; 12 | extern const uint32_t g_NumAudioWins; 13 | 14 | extern const int g_FrameLength; 15 | extern const int g_FrameStride; 16 | extern const int g_ctxLen; 17 | extern const float g_ScoreThreshold; 18 | 19 | /* Audio samples required to generate MFCC features */ 20 | /* 296 windows of 160 samples are required for inference to be processed. */ 21 | #define AUDIOFEATURELENGTH ( 296 * 160 ) 22 | 23 | #endif /* ifndef MODEL_CONFIG_H */ 24 | -------------------------------------------------------------------------------- /applications/speech_recognition/resources/test.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeRTOS/iot-reference-arm-corstone3xx/0b2f65dcfc62a5f1cddf0e58f73118558165e8fa/applications/speech_recognition/resources/test.wav -------------------------------------------------------------------------------- /applications/speech_recognition/resources/use_case_resources.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "asr", 4 | "url_prefix": [ 5 | "https://github.com/ARM-software/ML-zoo/raw/eb2170aac1317f00b128ab82bdb159cfcca36ea6/models/speech_recognition/tiny_wav2letter/tflite_pruned_int8/" 6 | ], 7 | "resources": [ 8 | { 9 | "name": "tiny_wav2letter_pruned_int8.tflite", 10 | "url": "{url_prefix:0}tiny_wav2letter_pruned_int8.tflite" 11 | }, 12 | { 13 | "name": "ifm0.npy", 14 | "url": "{url_prefix:0}testing_input/input_1_int8/0.npy" 15 | }, 16 | { 17 | "name": "ofm0.npy", 18 | "url": "{url_prefix:0}testing_output/Identity_int8/0.npy" 19 | } 20 | ] 21 | } 22 | ] 23 | -------------------------------------------------------------------------------- /applications/speech_recognition/tests/corstone300_pass_output.log: -------------------------------------------------------------------------------- 1 | Waiting for provisioning bundle 2 | Running provisioning bundle 3 | Secure Component (ID 0) version=2.2.0 4 | Non-Secure Component (ID 1) version=0.0.10 5 | Starting bootloader 6 | Booting TF-M v2.2.0 7 | PSA Framework version is: 257 8 | Secure Component (ID 0) version=2.2.0 9 | Non-Secure Component (ID 1) version=0.0.20 10 | Init speex 11 | ML interface initialised 12 | Complete recognition: turn down the temperature in the bedroom 13 | -------------------------------------------------------------------------------- /applications/speech_recognition/tests/corstone310_pass_output.log: -------------------------------------------------------------------------------- 1 | Waiting for provisioning bundle 2 | Running provisioning bundle 3 | Secure Component (ID 0) version=2.2.0 4 | Non-Secure Component (ID 1) version=0.0.10 5 | Starting bootloader 6 | Booting TF-M v2.2.0 7 | PSA Framework version is: 257 8 | Secure Component (ID 0) version=2.2.0 9 | Non-Secure Component (ID 1) version=0.0.20 10 | Init speex 11 | ML interface initialised 12 | Complete recognition: turn down the temperature in the bedroom 13 | -------------------------------------------------------------------------------- /applications/speech_recognition/tests/corstone315_pass_output.log: -------------------------------------------------------------------------------- 1 | Waiting for DM provisioning bundle 2 | Running DM provisioning bundle 3 | Secure Component (ID 0) version=2.2.0 4 | Non-Secure Component (ID 1) version=0.0.10 5 | Starting bootloader 6 | Booting TF-M v2.2.0 7 | PSA Framework version is: 257 8 | Secure Component (ID 0) version=2.2.0 9 | Non-Secure Component (ID 1) version=0.0.20 10 | Init speex 11 | ML interface initialised 12 | Complete recognition: turn down the temperature in the bedroom 13 | -------------------------------------------------------------------------------- /applications/speech_recognition/tests/corstone320_pass_output.log: -------------------------------------------------------------------------------- 1 | Waiting for DM provisioning bundle 2 | Running DM provisioning bundle 3 | Secure Component (ID 0) version=2.2.0 4 | Non-Secure Component (ID 1) version=0.0.10 5 | Starting bootloader 6 | Booting TF-M v2.2.0 7 | PSA Framework version is: 257 8 | Secure Component (ID 0) version=2.2.0 9 | Non-Secure Component (ID 1) version=0.0.20 10 | Init speex 11 | ML interface initialised 12 | Complete recognition: turn down the temperature in the bedroom 13 | -------------------------------------------------------------------------------- /applications/speech_recognition/tests/fail_output.log: -------------------------------------------------------------------------------- 1 | Failed to provision device private key 2 | Failed job document content check 3 | Failed to execute state transition handler 4 | -------------------------------------------------------------------------------- /bsp/common/bsp_serial.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017-2023 Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #ifndef __SERIAL_H__ 7 | #define __SERIAL_H__ 8 | 9 | 10 | #include 11 | 12 | /** 13 | * \brief Initializes default UART device 14 | */ 15 | void bsp_serial_init( void ); 16 | 17 | /** 18 | * \brief Prints a string through the default UART device 19 | */ 20 | void bsp_serial_print( char * str ); 21 | 22 | #endif /* __SERIAL_H__ */ 23 | -------------------------------------------------------------------------------- /bsp/common/syscalls_stub.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023, Arm Limited. All rights reserved. 3 | * 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * 6 | * Based on: https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git/tree/platform/ext/common/syscalls_stub.c?id=9ca8a5eb3c85eecee1303dffa262800ea0385584 7 | * 8 | */ 9 | 10 | /* 11 | * Note: Arm GNU toolchain version 12 and above require user defined definitions of the functions below. 12 | * However, in prior versions those definitions were provided as weakly linked definitions by the toolchain. 13 | * Provide them here as weakly linked functions to allow applications that consume the FRI to provide 14 | * their own definitions as intended by the toolchain. 15 | */ 16 | 17 | #ifdef __GNUC__ 18 | #if defined( __ARM_ARCH ) 19 | #include 20 | #include 21 | 22 | __attribute__( ( weak ) ) 23 | void _close( void ) 24 | { 25 | } 26 | 27 | __attribute__( ( weak ) ) 28 | void _fstat( void ) 29 | { 30 | } 31 | 32 | __attribute__( ( weak ) ) 33 | void _getpid( void ) 34 | { 35 | } 36 | 37 | __attribute__( ( weak ) ) 38 | void _isatty( void ) 39 | { 40 | } 41 | 42 | __attribute__( ( weak ) ) 43 | void _kill( void ) 44 | { 45 | } 46 | 47 | __attribute__( ( weak ) ) 48 | void _lseek( void ) 49 | { 50 | } 51 | 52 | __attribute__( ( weak ) ) 53 | void _read( void ) 54 | { 55 | } 56 | 57 | __attribute__( ( weak ) ) 58 | void _write( void ) 59 | { 60 | } 61 | #endif /* if defined( __ARM_ARCH ) */ 62 | #endif /* ifdef __GNUC__ */ 63 | -------------------------------------------------------------------------------- /bsp/corstone300/include/FreeRTOSConfig_target.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V10.4.1 3 | * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * Copyright 2023 Arm Limited and/or its affiliates 5 | * 6 | * SPDX-License-Identifier: MIT 7 | */ 8 | 9 | /* From the "Fast Models Reference Guide" (https://developer.arm.com/documentation/100964/1123/About-the-models), 10 | * "Programmer's View (PV) models of processors and devices work at a level 11 | * where functional behavior is equivalent to what a programmer would see using 12 | * the hardware. 13 | * 14 | * They sacrifice timing accuracy to achieve fast simulation execution speeds: 15 | * you can use the PV models for confirming software functionality, but you 16 | * must not rely on the accuracy of cycle counts, low-level component 17 | * interactions, or other hardware-specific behavior." 18 | * 19 | * As described above, FVPs sacrifice timing accuracy to achieve fast 20 | * simulation execution speeds. Therefore, we need this work around of setting 21 | * `configTICK_RATE_HZ` to `200` to simulate scheduler polling rate of 22 | * `1000 Hz` or 1 tick per millisecond. 23 | * 24 | * In addition, the macro `pdMS_TO_TICKS` is defined here to match the 1 tick 25 | * per millisecond instead of using the macro defined in 26 | * `FreeRTOS-kernel/include/projdefs.h` 27 | */ 28 | #define configTICK_RATE_HZ ( ( uint32_t ) 200 ) 29 | #define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) xTimeInMs ) 30 | #define TICKS_TO_pdMS( xTicks ) ( ( uint32_t ) xTicks ) 31 | -------------------------------------------------------------------------------- /bsp/corstone300/include/RTE_Components.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2024 Arm Limited. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /*-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- */ 18 | 19 | #ifndef __RTE_COMPONENTS_H 20 | #define __RTE_COMPONENTS_H 21 | 22 | /* USART (Universal synchronous - asynchronous receiver transmitter) [Driver_USART0] */ 23 | /* Configuration settings for Driver_USART0 in component ::Drivers:USART */ 24 | #define RTE_USART0 1 25 | 26 | /* IO (Input- Output) [arm_mps3_io_drv] */ 27 | /* Configuration settings for ARM MPS3 IO SCC in component ::Native Driver:arm_mps3_io_drv */ 28 | #define RTE_MPS3_IO 1 29 | 30 | #endif /* __RTE_COMPONENTS_H */ 31 | -------------------------------------------------------------------------------- /bsp/corstone300/include/ethos-u55.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2022-2023 Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #ifndef ETHOS_U55_H_ 7 | #define ETHOS_U55_H_ 8 | 9 | #define EthosU_IRQn ( 56 ) /* Ethos-Uxx Interrupt */ 10 | #define SEC_ETHOS_U55_BASE ( 0x48102000 ) /* Ethos-U55 base address*/ 11 | #define SEC_ETHOS_U55_TA0_BASE ( 0x48103000 ) /* Ethos-U55's timing adapter 0 base address */ 12 | #define SEC_ETHOS_U55_TA1_BASE ( 0x48103200 ) /* Ethos-U55's timing adapter 1 base address */ 13 | 14 | /* TA0 configuration */ 15 | #define TA0_BASE SEC_ETHOS_U55_TA0_BASE 16 | #define TA0_MAXR 0 17 | #define TA0_MAXW 0 18 | #define TA0_MAXRW 0 19 | #define TA0_RLATENCY 0 20 | #define TA0_WLATENCY 0 21 | #define TA0_PULSE_ON 0 22 | #define TA0_PULSE_OFF 0 23 | #define TA0_BWCAP 0 24 | #define TA0_PERFCTRL 0 25 | #define TA0_PERFCNT 0 26 | #define TA0_MODE 1 27 | #define TA0_HISTBIN 0 28 | #define TA0_HISTCNT 0 29 | 30 | /* TA1 configuration */ 31 | #define TA1_BASE SEC_ETHOS_U55_TA1_BASE 32 | #define TA1_MAXR 0 33 | #define TA1_MAXW 0 34 | #define TA1_MAXRW 0 35 | #define TA1_RLATENCY 0 36 | #define TA1_WLATENCY 0 37 | #define TA1_PULSE_ON 0 38 | #define TA1_PULSE_OFF 0 39 | #define TA1_BWCAP 0 40 | #define TA1_PERFCTRL 0 41 | #define TA1_PERFCNT 0 42 | #define TA1_MODE 1 43 | #define TA1_HISTBIN 0 44 | #define TA1_HISTCNT 0 45 | 46 | #endif /* ETHOS_U55_H_ */ 47 | -------------------------------------------------------------------------------- /bsp/corstone300/include/provisioning_config_target.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | 6 | #ifndef _PROVISIONING_CONFIG_TARGET_H_ 7 | #define _PROVISIONING_CONFIG_TARGET_H_ 8 | 9 | #define PROVISIONING_DATA_START ( 0x211FF000 ) 10 | 11 | #endif /* _PROVISIONING_CONFIG_TARGET_H_ */ 12 | -------------------------------------------------------------------------------- /bsp/corstone310/include/FreeRTOSConfig_target.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V10.4.1 3 | * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * Copyright 2023 Arm Limited and/or its affiliates 5 | * 6 | * SPDX-License-Identifier: MIT 7 | */ 8 | 9 | /* From the "Fast Models Reference Guide" (https://developer.arm.com/documentation/100964/1123/About-the-models), 10 | * "Programmer's View (PV) models of processors and devices work at a level 11 | * where functional behavior is equivalent to what a programmer would see using 12 | * the hardware. 13 | * 14 | * They sacrifice timing accuracy to achieve fast simulation execution speeds: 15 | * you can use the PV models for confirming software functionality, but you 16 | * must not rely on the accuracy of cycle counts, low-level component 17 | * interactions, or other hardware-specific behavior." 18 | * 19 | * As described above, FVPs sacrifice timing accuracy to achieve fast 20 | * simulation execution speeds. Therefore, we need this work around of setting 21 | * `configTICK_RATE_HZ` to set a higher scheduler polling rate. 22 | * For example, setting `configTICK_RATE_HZ` to `150` simulates scheduler polling rate 23 | * of `1000 Hz` or 1 tick per millisecond. 24 | * 25 | * In addition, the macro `pdMS_TO_TICKS` is defined here to match the 1 tick 26 | * per millisecond instead of using the macro defined in 27 | * `FreeRTOS-kernel/include/projdefs.h` 28 | */ 29 | #define configTICK_RATE_HZ ( ( uint32_t ) 150 ) 30 | #define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) xTimeInMs ) 31 | #define TICKS_TO_pdMS( xTicks ) ( ( uint32_t ) xTicks ) 32 | -------------------------------------------------------------------------------- /bsp/corstone310/include/RTE_Components.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2024 Arm Limited. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /*-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- */ 18 | 19 | #ifndef __RTE_COMPONENTS_H 20 | #define __RTE_COMPONENTS_H 21 | 22 | /* USART (Universal synchronous - asynchronous receiver transmitter) [Driver_USART0] */ 23 | /* Configuration settings for Driver_USART0 in component ::Drivers:USART */ 24 | #define RTE_USART0 1 25 | 26 | /* IO (Input- Output) [arm_mps3_io_drv] */ 27 | /* Configuration settings for ARM MPS3 IO SCC in component ::Native Driver:arm_mps3_io_drv */ 28 | #define RTE_MPS3_IO 1 29 | 30 | #endif /* __RTE_COMPONENTS_H */ 31 | -------------------------------------------------------------------------------- /bsp/corstone310/include/ethos-u55.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2022-2023 Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #ifndef ETHOS_U55_H_ 7 | #define ETHOS_U55_H_ 8 | 9 | #define EthosU_IRQn ( 16 ) /* Ethos-Uxx Interrupt */ 10 | #define SEC_ETHOS_U55_BASE ( 0x40004000 ) /* Ethos-U55 base address*/ 11 | #define SEC_ETHOS_U55_TA0_BASE ( 0x48103000 ) /* Ethos-U55's timing adapter 0 base address */ 12 | #define SEC_ETHOS_U55_TA1_BASE ( 0x48103200 ) /* Ethos-U55's timing adapter 1 base address */ 13 | 14 | /* TA0 configuration */ 15 | /* Disabled for CS310 as the TA is not available */ 16 | /* #define TA0_BASE SEC_ETHOS_U55_TA0_BASE */ 17 | #define TA0_MAXR 0 18 | #define TA0_MAXW 0 19 | #define TA0_MAXRW 0 20 | #define TA0_RLATENCY 0 21 | #define TA0_WLATENCY 0 22 | #define TA0_PULSE_ON 0 23 | #define TA0_PULSE_OFF 0 24 | #define TA0_BWCAP 0 25 | #define TA0_PERFCTRL 0 26 | #define TA0_PERFCNT 0 27 | #define TA0_MODE 1 28 | #define TA0_HISTBIN 0 29 | #define TA0_HISTCNT 0 30 | 31 | /* TA1 configuration */ 32 | /* Disabled for CS310 as the TA is not available */ 33 | /* #define TA1_BASE SEC_ETHOS_U55_TA1_BASE */ 34 | #define TA1_MAXR 0 35 | #define TA1_MAXW 0 36 | #define TA1_MAXRW 0 37 | #define TA1_RLATENCY 0 38 | #define TA1_WLATENCY 0 39 | #define TA1_PULSE_ON 0 40 | #define TA1_PULSE_OFF 0 41 | #define TA1_BWCAP 0 42 | #define TA1_PERFCTRL 0 43 | #define TA1_PERFCNT 0 44 | #define TA1_MODE 1 45 | #define TA1_HISTBIN 0 46 | #define TA1_HISTCNT 0 47 | 48 | #endif /* ETHOS_U55_H_ */ 49 | -------------------------------------------------------------------------------- /bsp/corstone310/include/provisioning_config_target.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | 6 | #ifndef _PROVISIONING_CONFIG_TARGET_H_ 7 | #define _PROVISIONING_CONFIG_TARGET_H_ 8 | 9 | #define PROVISIONING_DATA_START ( 0x213FF000 ) 10 | 11 | #endif /* _PROVISIONING_CONFIG_TARGET_H_ */ 12 | -------------------------------------------------------------------------------- /bsp/corstone315/include/FreeRTOSConfig_target.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V10.4.1 3 | * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * Copyright 2023-2024, Arm Limited and/or its affiliates 5 | * 6 | * SPDX-License-Identifier: MIT 7 | */ 8 | 9 | /* From the "Fast Models Reference Guide" (https://developer.arm.com/documentation/100964/1123/About-the-models), 10 | * "Programmer's View (PV) models of processors and devices work at a level 11 | * where functional behavior is equivalent to what a programmer would see using 12 | * the hardware. 13 | * 14 | * They sacrifice timing accuracy to achieve fast simulation execution speeds: 15 | * you can use the PV models for confirming software functionality, but you 16 | * must not rely on the accuracy of cycle counts, low-level component 17 | * interactions, or other hardware-specific behavior." 18 | * 19 | * As described above, FVPs sacrifice timing accuracy to achieve fast 20 | * simulation execution speeds. Therefore, we need this work around of setting 21 | * `configTICK_RATE_HZ` to set a higher scheduler polling rate. 22 | * For example, setting `configTICK_RATE_HZ` to `150` simulates scheduler polling rate 23 | * of `1000 Hz` or 1 tick per millisecond. 24 | * 25 | * In addition, the macro `pdMS_TO_TICKS` is defined here to match the 1 tick 26 | * per millisecond instead of using the macro defined in 27 | * `FreeRTOS-kernel/include/projdefs.h` 28 | */ 29 | #define configTICK_RATE_HZ ( ( uint32_t ) 150 ) 30 | #define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) xTimeInMs ) 31 | #define TICKS_TO_pdMS( xTicks ) ( ( uint32_t ) xTicks ) 32 | -------------------------------------------------------------------------------- /bsp/corstone315/include/RTE_Components.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2024, Arm Limited. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /*-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- */ 18 | 19 | #ifndef __RTE_COMPONENTS_H 20 | #define __RTE_COMPONENTS_H 21 | 22 | /* USART (Universal synchronous - asynchronous receiver transmitter) [Driver_USART0] */ 23 | /* Configuration settings for Driver_USART0 in component ::Drivers:USART */ 24 | #define RTE_USART0 1 25 | 26 | /* IO (Input- Output) [arm_mps3_io_drv] */ 27 | /* Configuration settings for ARM MPS3 IO SCC in component ::Native Driver:arm_mps3_io_drv */ 28 | #define RTE_MPS3_IO 1 29 | 30 | /* HDLCD [hdlcd_drv] */ 31 | /* Configuration settings for ARM MPS3 IO SCC in component ::Native Driver:hdlcd_drv */ 32 | #define RTE_HDLCD 1 33 | 34 | #endif /* __RTE_COMPONENTS_H */ 35 | -------------------------------------------------------------------------------- /bsp/corstone315/include/provisioning_config_target.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023-2024, Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | 6 | #ifndef _PROVISIONING_CONFIG_TARGET_H_ 7 | #define _PROVISIONING_CONFIG_TARGET_H_ 8 | 9 | #define PROVISIONING_DATA_START ( 0x213FF000 ) 10 | 11 | #endif /* _PROVISIONING_CONFIG_TARGET_H_ */ 12 | -------------------------------------------------------------------------------- /bsp/corstone320/include/FreeRTOSConfig_target.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V10.4.1 3 | * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * Copyright 2023-2024, Arm Limited and/or its affiliates 5 | * 6 | * SPDX-License-Identifier: MIT 7 | */ 8 | 9 | /* From the "Fast Models Reference Guide" (https://developer.arm.com/documentation/100964/1123/About-the-models), 10 | * "Programmer's View (PV) models of processors and devices work at a level 11 | * where functional behavior is equivalent to what a programmer would see using 12 | * the hardware. 13 | * 14 | * They sacrifice timing accuracy to achieve fast simulation execution speeds: 15 | * you can use the PV models for confirming software functionality, but you 16 | * must not rely on the accuracy of cycle counts, low-level component 17 | * interactions, or other hardware-specific behavior." 18 | * 19 | * As described above, FVPs sacrifice timing accuracy to achieve fast 20 | * simulation execution speeds. Therefore, we need this work around of setting 21 | * `configTICK_RATE_HZ` to set a higher scheduler polling rate. 22 | * For example, setting `configTICK_RATE_HZ` to `150` simulates scheduler polling rate 23 | * of `1000 Hz` or 1 tick per millisecond. 24 | * 25 | * In addition, the macro `pdMS_TO_TICKS` is defined here to match the 1 tick 26 | * per millisecond instead of using the macro defined in 27 | * `FreeRTOS-kernel/include/projdefs.h` 28 | */ 29 | #define configTICK_RATE_HZ ( ( uint32_t ) 150 ) 30 | #define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) xTimeInMs ) 31 | #define TICKS_TO_pdMS( xTicks ) ( ( uint32_t ) xTicks ) 32 | -------------------------------------------------------------------------------- /bsp/corstone320/include/RTE_Components.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2024, Arm Limited. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /*-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- */ 18 | 19 | #ifndef __RTE_COMPONENTS_H 20 | #define __RTE_COMPONENTS_H 21 | 22 | /* USART (Universal synchronous - asynchronous receiver transmitter) [Driver_USART0] */ 23 | /* Configuration settings for Driver_USART0 in component ::Drivers:USART */ 24 | #define RTE_USART0 1 25 | 26 | /* IO (Input- Output) [arm_mps3_io_drv] */ 27 | /* Configuration settings for ARM MPS3 IO SCC in component ::Native Driver:arm_mps3_io_drv */ 28 | #define RTE_MPS3_IO 1 29 | 30 | /* HDLCD [hdlcd_drv] */ 31 | /* Configuration settings for ARM MPS3 IO SCC in component ::Native Driver:hdlcd_drv */ 32 | #define RTE_HDLCD 1 33 | 34 | #endif /* __RTE_COMPONENTS_H */ 35 | -------------------------------------------------------------------------------- /bsp/corstone320/include/provisioning_config_target.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023-2024, Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | 6 | #ifndef _PROVISIONING_CONFIG_TARGET_H_ 7 | #define _PROVISIONING_CONFIG_TARGET_H_ 8 | 9 | #define PROVISIONING_DATA_START ( 0x213FF000 ) 10 | 11 | #endif /* _PROVISIONING_CONFIG_TARGET_H_ */ 12 | -------------------------------------------------------------------------------- /bsp/isp_mali-c55/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2021-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | set(isp_mali-c55_SOURCE_DIR 6 | ${CMAKE_CURRENT_LIST_DIR}/library 7 | CACHE INTERNAL 8 | "Path to ISP Mali-C55 driver source code" 9 | ) 10 | 11 | add_subdirectory(library) 12 | add_subdirectory(integration) 13 | -------------------------------------------------------------------------------- /bsp/isp_mali-c55/integration/app/acamera_uart.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 Arm Limited 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "stdint.h" 18 | 19 | typedef uint32_t acamera_uart_t; 20 | 21 | void acamera_uart_init( acamera_uart_t * uart ); 22 | 23 | int acamera_uart_read( void * p_ctrl, 24 | uint8_t * data, 25 | int size ); 26 | int acamera_uart_write( void * p_ctrl, 27 | const uint8_t * data, 28 | int size ); 29 | -------------------------------------------------------------------------------- /components/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | if(CMAKE_CROSSCOMPILING) 6 | # FreeRTOS must be first as other components depend on it 7 | add_subdirectory(freertos_kernel) 8 | 9 | add_subdirectory(ai EXCLUDE_FROM_ALL) 10 | add_subdirectory(aws_iot EXCLUDE_FROM_ALL) 11 | add_subdirectory(graphics EXCLUDE_FROM_ALL) 12 | add_subdirectory(connectivity EXCLUDE_FROM_ALL) 13 | add_subdirectory(security EXCLUDE_FROM_ALL) 14 | add_subdirectory(tools EXCLUDE_FROM_ALL) 15 | elseif(BUILD_TESTING AND NOT CMAKE_CROSSCOMPILING) 16 | # Test tools must be available before any component as they are used for unit testing 17 | add_subdirectory(tools) 18 | 19 | # FreeRTOS must be included before everything except tools as other components depend on it 20 | add_subdirectory(freertos_kernel) 21 | 22 | add_subdirectory(aws_iot) 23 | 24 | add_subdirectory(connectivity) 25 | 26 | add_subdirectory(security) 27 | endif() 28 | -------------------------------------------------------------------------------- /components/README.md: -------------------------------------------------------------------------------- 1 | # Components 2 | 3 | The `components` subdirectory contains external libraries along with other libraries 4 | that are developed as part of FRI. 5 | 6 | The libraries are grouped per category within the `components` subdirectory. 7 | 8 | `aws_iot`: Includes the components used to make a connection to AWS IoT Core. 9 | `connectivity`: Includes the components used to establish networking. 10 | `freertos_kernel`: Includes the FreeRTOS kernel. 11 | `security`: Includes components that enhance security. 12 | `tools`: Includes components providing tools used by applications. 13 | 14 | 15 | Each comprise two parts: 16 | * `library` - the external library source code. 17 | * `integration` - additional integration code for the library to build application. 18 | 19 | The `integration` subdirectory contains distinct directories: 20 | * `src` - contains integration source code files 21 | * `inc` - contains integration header files 22 | * `patches` - contains patch files to be applied to the library 23 | 24 | A modular approach is used to create the components. 25 | Two CMake targets are created for each component: 26 | * library target (if one is not already provided). 27 | * library configuration target for applications to customise the target for 28 | their use cases. 29 | -------------------------------------------------------------------------------- /components/ai/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_subdirectory(ml_embedded_evaluation_kit) 6 | add_subdirectory(speexdsp) 7 | -------------------------------------------------------------------------------- /components/ai/ml_embedded_evaluation_kit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2021-2025 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | set(ml_embedded_evaluation_kit_SOURCE_DIR 6 | ${CMAKE_CURRENT_LIST_DIR}/library 7 | CACHE INTERNAL 8 | "Path to ML Embedded Evaluation Kit source code" 9 | ) 10 | 11 | include(ApplyPatches) 12 | 13 | set(PATCH_FILES_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/integration/patches") 14 | set(PATCH_FILES 15 | "${PATCH_FILES_DIRECTORY}/0001-User-defined-resources-download-path.patch" 16 | "${PATCH_FILES_DIRECTORY}/0002-Use-CMSIS_device_header-instead-of-RTE_Components.h.patch" 17 | "${PATCH_FILES_DIRECTORY}/0003-Make-ETHOSU_ARCH-configurable-in-TensorFlow-CMake.patch" 18 | "${PATCH_FILES_DIRECTORY}/0004-Override-EthosU55-NPU-default-IRQ-handler.patch" 19 | ) 20 | iot_reference_arm_corstone3xx_apply_patches("${ml_embedded_evaluation_kit_SOURCE_DIR}" "${PATCH_FILES}") 21 | 22 | set(PATCH_FILES 23 | "${PATCH_FILES_DIRECTORY}/0005-Patch-tensorflow.patch" 24 | ) 25 | iot_reference_arm_corstone3xx_apply_patches("${ml_embedded_evaluation_kit_SOURCE_DIR}/dependencies/tensorflow/" "${PATCH_FILES}") 26 | -------------------------------------------------------------------------------- /components/ai/ml_embedded_evaluation_kit/integration/cmake/ConvertAudioSourceToCode.cmake: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | # Convert audio clip to C file 6 | function(iot_reference_arm_corstone3xx_convert_audio_source_to_code audio_path generated_path) 7 | add_custom_target(convert-audio 8 | BYPRODUCTS 9 | ${generated_path}/InputFiles.cc 10 | ${generated_path}/test.cc 11 | # use ml-embedded-evaluation-kit's Python Virtual Environment which 12 | # contains dependencies for gen_audio_cpp.py 13 | COMMAND bash -c " \ 14 | source ${CMAKE_CURRENT_BINARY_DIR}/mlek_resources_downloaded/env/bin/activate && \ 15 | python3 ${ml_embedded_evaluation_kit_SOURCE_DIR}/scripts/py/gen_audio_cpp.py \ 16 | --audio_path ${audio_path} \ 17 | --source_folder_path ${generated_path} \ 18 | --header_folder_path ${generated_path} " 19 | VERBATIM 20 | USES_TERMINAL 21 | ) 22 | endfunction() 23 | -------------------------------------------------------------------------------- /components/ai/ml_embedded_evaluation_kit/integration/patches/0003-Make-ETHOSU_ARCH-configurable-in-TensorFlow-CMake.patch: -------------------------------------------------------------------------------- 1 | From 2f6ec81d61c885b2e36af47d2cc223b4d4761904 Mon Sep 17 00:00:00 2001 2 | From: Ahmed Ismail 3 | Date: Thu, 28 Nov 2024 16:13:50 +0000 4 | Subject: [PATCH 3/4] Make ETHOSU_ARCH configurable in TensorFlow CMake 5 | MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 6 | Content-Transfer-Encoding: 8bit 7 | MIME-Version: 1.0 8 | Content-Type: text/plain; charset=UTF-8 9 | Content-Transfer-Encoding: 8bit 10 | 11 | Signed-off-by: Gergely Korcsák 12 | --- 13 | scripts/cmake/tensorflow_lite_micro.cmake | 6 +----- 14 | 1 file changed, 1 insertion(+), 5 deletions(-) 15 | 16 | diff --git a/scripts/cmake/tensorflow_lite_micro.cmake b/scripts/cmake/tensorflow_lite_micro.cmake 17 | index 734c713..c06854a 100644 18 | --- a/scripts/cmake/tensorflow_lite_micro.cmake 19 | +++ b/scripts/cmake/tensorflow_lite_micro.cmake 20 | @@ -130,11 +130,7 @@ else() 21 | if(ETHOS_U_NPU_ENABLED) 22 | # Arm Ethos-U55 NPU is the co-processor for ML workload: 23 | set(TENSORFLOW_LITE_MICRO_CO_PROCESSOR "ethos_u") 24 | - if(${ETHOS_U_NPU_ID} STREQUAL "U65") 25 | - set(TENSORFLOW_LITE_MICRO_CO_PROCESSOR_ARCH "u65") 26 | - else() 27 | - set(TENSORFLOW_LITE_MICRO_CO_PROCESSOR_ARCH "u55") 28 | - endif () 29 | + string(TOLOWER "${ETHOS_U_NPU_ID}" TENSORFLOW_LITE_MICRO_CO_PROCESSOR_ARCH) 30 | endif() 31 | 32 | set(TENSORFLOW_LITE_MICRO_OPTIMIZED_KERNEL "cmsis_nn") 33 | -- 34 | 2.34.1 35 | 36 | -------------------------------------------------------------------------------- /components/ai/ml_embedded_evaluation_kit/integration/patches/0005-Patch-tensorflow.patch: -------------------------------------------------------------------------------- 1 | From 15c53b15b6588c104081656a98be986e3f91670a Mon Sep 17 00:00:00 2001 2 | From: Ahmed Ismail 3 | Date: Thu, 28 Nov 2024 16:16:01 +0000 4 | Subject: [PATCH] Patch tensorflow MIME-Version: 1.0 Content-Type: text/plain; 5 | charset=UTF-8 Content-Transfer-Encoding: 8bit 6 | MIME-Version: 1.0 7 | Content-Type: text/plain; charset=UTF-8 8 | Content-Transfer-Encoding: 8bit 9 | 10 | Signed-off-by: Gergely Korcsák 11 | --- 12 | tensorflow/lite/micro/tools/make/ext_libs/ethos_u.inc | 4 ++++ 13 | 1 file changed, 4 insertions(+) 14 | 15 | diff --git a/tensorflow/lite/micro/tools/make/ext_libs/ethos_u.inc b/tensorflow/lite/micro/tools/make/ext_libs/ethos_u.inc 16 | index 73447cd7..4ef80aec 100644 17 | --- a/tensorflow/lite/micro/tools/make/ext_libs/ethos_u.inc 18 | +++ b/tensorflow/lite/micro/tools/make/ext_libs/ethos_u.inc 19 | @@ -74,6 +74,10 @@ else ifeq ($(ETHOSU_ARCH), u65) 20 | ETHOSU_FLAGS += \ 21 | -DETHOSU_ARCH=u65 \ 22 | -DETHOSU65 23 | +else ifeq ($(ETHOSU_ARCH), u85) 24 | + ETHOSU_FLAGS += \ 25 | + -DETHOSU_ARCH=u85 \ 26 | + -DETHOSU85 27 | else 28 | $(error "ETHOSU_ARCH=$(ETHOSU_ARCH) is not supported") 29 | endif 30 | -- 31 | 2.34.1 32 | 33 | -------------------------------------------------------------------------------- /components/ai/speexdsp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | set(speexdsp_SOURCE_DIR 6 | ${CMAKE_CURRENT_LIST_DIR}/library 7 | CACHE INTERNAL 8 | "Path to the Speex Codec source code" 9 | ) 10 | 11 | add_subdirectory(integration) 12 | -------------------------------------------------------------------------------- /components/ai/speexdsp/integration/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2022-2023 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_library(speexdsp 6 | ${speexdsp_SOURCE_DIR}/libspeexdsp/fftwrap.c 7 | ${speexdsp_SOURCE_DIR}/libspeexdsp/filterbank.c 8 | ${speexdsp_SOURCE_DIR}/libspeexdsp/mdf.c 9 | ${speexdsp_SOURCE_DIR}/libspeexdsp/preprocess.c 10 | ${speexdsp_SOURCE_DIR}/libspeexdsp/kiss_fft.c 11 | ${speexdsp_SOURCE_DIR}/libspeexdsp/kiss_fftr.c 12 | ) 13 | 14 | target_include_directories(speexdsp 15 | PUBLIC 16 | ${speexdsp_SOURCE_DIR}/include 17 | ${CMAKE_SOURCE_DIR}/lib/speexdsp/include 18 | ${CMAKE_SOURCE_DIR}/lib/speexdsp/libspeexdsp 19 | inc 20 | ) 21 | 22 | target_compile_definitions(speexdsp 23 | PUBLIC 24 | FIXED_POINT 25 | HAVE_CONFIG_H 26 | OS_SUPPORT_CUSTOM 27 | ) 28 | 29 | target_compile_options(speexdsp 30 | PRIVATE 31 | -Wno-double-promotion 32 | ) 33 | -------------------------------------------------------------------------------- /components/ai/speexdsp/integration/inc/config.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2022-2023, Arm Limited and Contributors. All rights reserved. 2 | * SPDX-License-Identifier: Apache-2.0 3 | */ 4 | 5 | /* Libseepx config */ 6 | #ifndef CONFIG_H 7 | #define CONFIG_H 8 | 9 | 10 | #define USE_KISS_FFT 11 | 12 | /* We don't support visibility on Win32 */ 13 | #define EXPORT 14 | 15 | #define SIZEOF_INT 4 16 | 17 | /* The size of `int16_t', as computed by sizeof. */ 18 | #define SIZEOF_INT16_T 2 19 | 20 | /* The size of `int32_t', as computed by sizeof. */ 21 | #define SIZEOF_INT32_T 4 22 | 23 | /* The size of `long', as computed by sizeof. */ 24 | #define SIZEOF_LONG 4 25 | 26 | /* The size of `short', as computed by sizeof. */ 27 | #define SIZEOF_SHORT 2 28 | 29 | /* The size of `uint16_t', as computed by sizeof. */ 30 | #define SIZEOF_UINT16_T 2 31 | 32 | /* The size of `uint32_t', as computed by sizeof. */ 33 | #define SIZEOF_UINT32_T 4 34 | 35 | /* The size of `u_int16_t', as computed by sizeof. */ 36 | #define SIZEOF_U_INT16_T 0 37 | 38 | /* The size of `u_int32_t', as computed by sizeof. */ 39 | #define SIZEOF_U_INT32_T 0 40 | 41 | 42 | #endif /* ifndef CONFIG_H */ 43 | -------------------------------------------------------------------------------- /components/ai/speexdsp/integration/inc/os_support_custom.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2022-2023, Arm Limited and Contributors. All rights reserved. 2 | * SPDX-License-Identifier: Apache-2.0 3 | */ 4 | 5 | #include 6 | #include 7 | 8 | #define OVERRIDE_SPEEX_FATAL 9 | #define OVERRIDE_SPEEX_WARNING 10 | #define OVERRIDE_SPEEX_WARNING_INT 11 | #define OVERRIDE_SPEEX_NOTIFY 12 | 13 | static inline void _speex_fatal( const char * str, 14 | const char * file, 15 | int line ) 16 | { 17 | printf( "Fatal (internal) error in %s, line %d: %s\r\n", file, line, str ); 18 | } 19 | 20 | static inline void speex_warning( const char * str ) 21 | { 22 | printf( "warning: %s\r\n", str ); 23 | } 24 | 25 | static inline void speex_warning_int( const char * str, 26 | int val ) 27 | { 28 | printf( "warning: %s %d\r\n", str, val ); 29 | } 30 | 31 | static inline void speex_notify( const char * str ) 32 | { 33 | printf( "notification: %s\r\n", str ); 34 | } 35 | -------------------------------------------------------------------------------- /components/ai/speexdsp/integration/inc/speexdsp_config_types.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2022-2023, Arm Limited and Contributors. All rights reserved. 2 | * SPDX-License-Identifier: Apache-2.0 3 | */ 4 | 5 | #ifndef __SPEEX_TYPES_H__ 6 | #define __SPEEX_TYPES_H__ 7 | 8 | #include 9 | 10 | typedef int16_t spx_int16_t; 11 | typedef uint16_t spx_uint16_t; 12 | typedef int32_t spx_int32_t; 13 | typedef uint32_t spx_uint32_t; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /components/aws_iot/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_subdirectory(corejson) 6 | add_subdirectory(coremqtt) 7 | add_subdirectory(coremqtt_agent) 8 | add_subdirectory(corepkcs11) 9 | # sntp helper library depends on FreeRTOS-Plus-TCP connectivity stack as it 10 | # includes `FreeRTOS_IP.h` header file in one of its source files (sntp_client_task.c), 11 | # thus the coresntp library is only added in case of using FREERTOS_PLUS_TCP connectivity stack. 12 | if(CONNECTIVITY_STACK STREQUAL "FREERTOS_PLUS_TCP") 13 | add_subdirectory(coresntp) 14 | endif() 15 | add_subdirectory(jobs_for_aws_iot_embedded_sdk) 16 | add_subdirectory(aws_iot_core_mqtt_file_streams_embedded_c) 17 | add_subdirectory(tinycbor) 18 | -------------------------------------------------------------------------------- /components/aws_iot/aws_iot_core_mqtt_file_streams_embedded_c/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | if(BUILD_TESTING AND NOT CMAKE_CROSSCOMPILING) 6 | # Left empty for future mocks. 7 | else() 8 | set(aws-iot-core-mqtt-file-streams-embedded-c_SOURCE_DIR 9 | ${CMAKE_CURRENT_LIST_DIR}/library 10 | CACHE INTERNAL 11 | "Path to MQTT File Streams source code" 12 | ) 13 | 14 | include(ApplyPatches) 15 | 16 | set(PATCH_FILES_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/integration/patches") 17 | set(PATCH_FILES 18 | "${PATCH_FILES_DIRECTORY}/0001-Use-custom-strnlen-implementation.patch" 19 | ) 20 | iot_reference_arm_corstone3xx_apply_patches("${aws-iot-core-mqtt-file-streams-embedded-c_SOURCE_DIR}" "${PATCH_FILES}") 21 | 22 | add_subdirectory(integration) 23 | endif() 24 | -------------------------------------------------------------------------------- /components/aws_iot/aws_iot_core_mqtt_file_streams_embedded_c/integration/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_library(aws-iot-core-mqtt-file-streams-embedded-c 6 | ${aws-iot-core-mqtt-file-streams-embedded-c_SOURCE_DIR}/source/MQTTFileDownloader_base64.c 7 | ${aws-iot-core-mqtt-file-streams-embedded-c_SOURCE_DIR}/source/MQTTFileDownloader_cbor.c 8 | ${aws-iot-core-mqtt-file-streams-embedded-c_SOURCE_DIR}/source/MQTTFileDownloader.c 9 | ) 10 | 11 | target_include_directories(aws-iot-core-mqtt-file-streams-embedded-c 12 | PUBLIC 13 | ${aws-iot-core-mqtt-file-streams-embedded-c_SOURCE_DIR}/source/include/ 14 | ) 15 | 16 | target_link_libraries(aws-iot-core-mqtt-file-streams-embedded-c 17 | PUBLIC 18 | corejson 19 | coremqtt 20 | coremqtt-agent 21 | crt-helpers 22 | tinycbor 23 | ) 24 | -------------------------------------------------------------------------------- /components/aws_iot/corejson/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | if(CMAKE_CROSSCOMPILING) 6 | set(corejson_SOURCE_DIR 7 | ${CMAKE_CURRENT_LIST_DIR}/library 8 | CACHE INTERNAL 9 | "Path to coreJSON source code" 10 | ) 11 | 12 | add_subdirectory(integration) 13 | endif() 14 | -------------------------------------------------------------------------------- /components/aws_iot/corejson/integration/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | include(${corejson_SOURCE_DIR}/jsonFilePaths.cmake) 6 | 7 | add_library(corejson 8 | ${JSON_SOURCES} 9 | ) 10 | 11 | target_include_directories(corejson 12 | PUBLIC 13 | ${JSON_INCLUDE_PUBLIC_DIRS} 14 | ) 15 | 16 | add_library(corejson-config INTERFACE) 17 | 18 | target_link_libraries(corejson 19 | PUBLIC 20 | corejson-config 21 | ) 22 | -------------------------------------------------------------------------------- /components/aws_iot/coremqtt/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | if(BUILD_TESTING AND NOT CMAKE_CROSSCOMPILING) 6 | add_subdirectory(library_mocks) 7 | else() 8 | set(coremqtt_SOURCE_DIR 9 | ${CMAKE_CURRENT_LIST_DIR}/library 10 | CACHE INTERNAL 11 | "Path to coreMQTT source code" 12 | ) 13 | 14 | add_subdirectory(integration) 15 | endif() 16 | -------------------------------------------------------------------------------- /components/aws_iot/coremqtt/integration/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | include(${coremqtt_SOURCE_DIR}/mqttFilePaths.cmake) 6 | 7 | add_library(coremqtt 8 | ${MQTT_SOURCES} 9 | ${MQTT_SERIALIZER_SOURCES} 10 | ) 11 | 12 | target_include_directories(coremqtt 13 | PUBLIC 14 | ${MQTT_INCLUDE_PUBLIC_DIRS} 15 | ) 16 | 17 | add_library(coremqtt-config INTERFACE) 18 | 19 | target_link_libraries(coremqtt 20 | PUBLIC 21 | coremqtt-config 22 | PRIVATE 23 | freertos_kernel 24 | helpers-logging 25 | ) 26 | -------------------------------------------------------------------------------- /components/aws_iot/coremqtt/library_mocks/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_library(coremqtt-mock 6 | src/core_mqtt.c 7 | ) 8 | 9 | target_include_directories(coremqtt-mock 10 | PUBLIC 11 | inc 12 | interface 13 | ../integration/inc 14 | ) 15 | 16 | target_link_libraries(coremqtt-mock 17 | PRIVATE 18 | fff 19 | ) 20 | -------------------------------------------------------------------------------- /components/aws_iot/coremqtt/library_mocks/interface/transport_interface.h: -------------------------------------------------------------------------------- 1 | /* 2 | * coreMQTT v2.1.1 3 | * Copyright (C) 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * Copyright 2024 Arm Limited and/or its affiliates 5 | * 6 | * SPDX-License-Identifier: MIT 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 9 | * this software and associated documentation files (the "Software"), to deal in 10 | * the Software without restriction, including without limitation the rights to 11 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 12 | * the Software, and to permit persons to whom the Software is furnished to do so, 13 | * subject to the following conditions: 14 | * 15 | * The above copyright notice and this permission notice shall be included in all 16 | * copies or substantial portions of the Software. 17 | * 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 20 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 21 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 22 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | */ 25 | 26 | #ifndef TRANSPORT_INTERFACE_H_ 27 | #define TRANSPORT_INTERFACE_H_ 28 | 29 | typedef struct TransportInterface 30 | { 31 | int recv; 32 | int send; 33 | int writev; 34 | int * pNetworkContext; 35 | } TransportInterface_t; 36 | 37 | 38 | #endif /* ifndef TRANSPORT_INTERFACE_H_ */ 39 | -------------------------------------------------------------------------------- /components/aws_iot/coremqtt_agent/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | if(BUILD_TESTING AND NOT CMAKE_CROSSCOMPILING) 6 | add_subdirectory(library_mocks) 7 | else() 8 | set(coremqtt_agent_SOURCE_DIR 9 | ${CMAKE_CURRENT_LIST_DIR}/library 10 | CACHE INTERNAL 11 | "Path to coreMQTT-Agent source code" 12 | ) 13 | endif() 14 | 15 | add_subdirectory(integration) 16 | -------------------------------------------------------------------------------- /components/aws_iot/coremqtt_agent/integration/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | if(BUILD_TESTING AND NOT CMAKE_CROSSCOMPILING) 6 | add_subdirectory(integration_mocks) 7 | add_subdirectory(tests) 8 | else() 9 | include(${coremqtt_agent_SOURCE_DIR}/mqttAgentFilePaths.cmake) 10 | 11 | add_library(coremqtt-agent 12 | ${MQTT_AGENT_SOURCES} 13 | src/mqtt_agent_task.c 14 | src/subscription_manager.c 15 | src/freertos_command_pool.c 16 | src/freertos_agent_message.c 17 | ) 18 | 19 | target_include_directories(coremqtt-agent 20 | PUBLIC 21 | ${MQTT_AGENT_INCLUDE_PUBLIC_DIRS} 22 | inc 23 | ) 24 | 25 | add_library(coremqtt-agent-config INTERFACE) 26 | 27 | target_link_libraries(coremqtt-agent 28 | PUBLIC 29 | coremqtt-agent-config 30 | PRIVATE 31 | backoff-algorithm 32 | connectivity-stack 33 | coremqtt 34 | freertos_kernel 35 | helpers-events 36 | helpers-logging 37 | tfm-ns-interface-mbedtls-config 38 | ) 39 | endif() 40 | -------------------------------------------------------------------------------- /components/aws_iot/coremqtt_agent/integration/integration_mocks/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_library(coremqtt-agent-integration-mock 6 | src/freertos_agent_message.c 7 | src/freertos_command_pool.c 8 | src/mqtt_agent_task.c 9 | src/subscription_manager.c 10 | ) 11 | 12 | target_include_directories(coremqtt-agent-integration-mock 13 | PUBLIC 14 | inc 15 | ) 16 | 17 | target_link_libraries(coremqtt-agent-integration-mock 18 | PRIVATE 19 | fff 20 | coremqtt-mock 21 | coremqtt-agent-mock 22 | freertos-kernel-mock 23 | ) 24 | -------------------------------------------------------------------------------- /components/aws_iot/coremqtt_agent/integration/integration_mocks/src/mqtt_agent_task.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS V202012.00 3 | * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * Copyright 2023-2024 Arm Limited and/or its affiliates 5 | * 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #include "mqtt_agent_task.h" 30 | 31 | MQTTAgentContext_t xGlobalMqttAgentContext; 32 | -------------------------------------------------------------------------------- /components/aws_iot/coremqtt_agent/integration/tests/config_mocks/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | # Add helpers for testing mqtt_agent_task.c. Helpers are application-specific. 6 | # E.g. app_config.h is a helper since it varies by application. 7 | add_library(coremqtt-agent-test-config-mocks 8 | INTERFACE 9 | ) 10 | target_include_directories(coremqtt-agent-test-config-mocks 11 | INTERFACE 12 | inc 13 | ) 14 | target_link_libraries(coremqtt-agent-test-config-mocks 15 | INTERFACE 16 | fff 17 | ) 18 | -------------------------------------------------------------------------------- /components/aws_iot/coremqtt_agent/integration/tests/config_mocks/inc/FreeRTOSConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V10.4.1 3 | * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * Copyright (c) 2022-2024, Arm Limited and Contributors. All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | * the Software, and to permit persons to whom the Software is furnished to do so, 11 | * subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | * 23 | * http://aws.amazon.com/freertos 24 | * http://www.FreeRTOS.org 25 | */ 26 | 27 | #ifndef FREERTOS_CONFIG_H 28 | #define FREERTOS_CONFIG_H 29 | 30 | #include "fff.h" 31 | 32 | DECLARE_FAKE_VOID_FUNC( vAssertCalled, 33 | const char *, 34 | unsigned long ); 35 | #define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled( __FILE__, __LINE__ ); 36 | 37 | #endif /* FREERTOS_CONFIG_H */ 38 | -------------------------------------------------------------------------------- /components/aws_iot/coremqtt_agent/integration/tests/config_mocks/inc/app_config.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023-2024 Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | 6 | #ifndef APP_CONFIG_H 7 | #define APP_CONFIG_H 8 | 9 | #define appCONFIG_MQTT_AGENT_TASK_STACK_SIZE 4096 10 | #define appCONFIG_MQTT_AGENT_TASK_PRIORITY 2 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /components/aws_iot/coremqtt_agent/integration/tests/config_mocks/inc/core_mqtt_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * Copyright 2024 Arm Limited and/or its affiliates 4 | * 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | * the Software, and to permit persons to whom the Software is furnished to do so, 11 | * subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | * 23 | * http://www.FreeRTOS.org 24 | * http://aws.amazon.com/freertos 25 | * 26 | */ 27 | 28 | #ifndef CORE_MQTT_CONFIG_H 29 | #define CORE_MQTT_CONFIG_H 30 | 31 | /* There is another config file in coremqtt_agent/mocks/inc that takes precedence over this one. */ 32 | 33 | #define MQTT_AGENT_COMMAND_QUEUE_LENGTH ( 32 ) 34 | #define MQTT_COMMAND_CONTEXTS_POOL_SIZE ( 32 ) 35 | 36 | #endif /* ifndef CORE_MQTT_CONFIG_H */ 37 | -------------------------------------------------------------------------------- /components/aws_iot/coremqtt_agent/integration/tests/config_mocks/inc/core_pkcs11_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Amazon FreeRTOS V1.1.4 3 | * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * Copyright (c) 2022-2024, Arm Limited and Contributors. All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | * the Software, and to permit persons to whom the Software is furnished to do so, 11 | * subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | * 23 | * http://aws.amazon.com/freertos 24 | * http://www.FreeRTOS.org 25 | */ 26 | 27 | #ifndef _AWS_PKCS11_CONFIG_H_ 28 | #define _AWS_PKCS11_CONFIG_H_ 29 | 30 | #define pkcs11configLABEL_DEVICE_CERTIFICATE_FOR_TLS "Device Cert" 31 | #define pkcs11configLABEL_DEVICE_PRIVATE_KEY_FOR_TLS "Device Priv TLS Key" 32 | #define configPKCS11_DEFAULT_USER_PIN "0000" 33 | 34 | #endif /* _AWS_PKCS11_CONFIG_H_ include guard. */ 35 | -------------------------------------------------------------------------------- /components/aws_iot/coremqtt_agent/integration/tests/config_mocks/inc/demo_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS V202010.00 3 | * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * Copyright 2024 Arm Limited and/or its affiliates 5 | * 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * http://www.FreeRTOS.org 25 | * http://aws.amazon.com/freertos 26 | * 27 | */ 28 | 29 | #ifndef DEMO_CONFIG_H 30 | #define DEMO_CONFIG_H 31 | 32 | #define democonfigMQTT_BROKER_ENDPOINT "dummy endpoint" 33 | #define democonfigMQTT_BROKER_PORT 8883 34 | #define democonfigCLIENT_IDENTIFIER "dummy client identifier" 35 | 36 | #endif /* DEMO_CONFIG_H */ 37 | -------------------------------------------------------------------------------- /components/aws_iot/coremqtt_agent/integration/tests/config_mocks/inc/iot_default_root_certificates.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Common V1.2.0 3 | * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * Copyright 2024 Arm Limited and/or its affiliates 5 | * 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * http://aws.amazon.com/freertos 25 | * http://www.FreeRTOS.org 26 | */ 27 | 28 | #ifndef __DEFAULT__ROOT__CERTIFICATES__H__ 29 | #define __DEFAULT__ROOT__CERTIFICATES__H__ 30 | 31 | static const char tlsATS1_ROOT_CERTIFICATE_PEM[] = "dummy"; 32 | static const uint32_t tlsATS1_ROOT_CERTIFICATE_LENGTH = sizeof( tlsATS1_ROOT_CERTIFICATE_PEM ); 33 | 34 | #endif /* ifndef __DEFAULT__ROOT__CERTIFICATES__H__ */ 35 | -------------------------------------------------------------------------------- /components/aws_iot/coremqtt_agent/library_mocks/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_library(coremqtt-agent-mock 6 | src/core_mqtt_agent.c 7 | ) 8 | 9 | target_include_directories(coremqtt-agent-mock 10 | PUBLIC 11 | inc 12 | ) 13 | 14 | target_link_libraries(coremqtt-agent-mock 15 | PRIVATE 16 | fff 17 | coremqtt-mock 18 | freertos-kernel-mock 19 | ) 20 | -------------------------------------------------------------------------------- /components/aws_iot/corepkcs11/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | if(CMAKE_CROSSCOMPILING) 6 | set(corepkcs11_SOURCE_DIR 7 | ${CMAKE_CURRENT_LIST_DIR}/library 8 | CACHE INTERNAL 9 | "Path to corePKCS11 source code" 10 | ) 11 | 12 | add_subdirectory(integration) 13 | endif() 14 | -------------------------------------------------------------------------------- /components/aws_iot/corepkcs11/integration/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | include(${corepkcs11_SOURCE_DIR}/pkcsFilePaths.cmake) 6 | 7 | # Do not use ${PKCS_SOURCES} because we are using the 8 | # PKCS11 to PSA Crypto wrappers from freertos-pkcs11-psa 9 | add_library(corepkcs11 10 | ${corepkcs11_SOURCE_DIR}/source/core_pkcs11.c 11 | ${corepkcs11_SOURCE_DIR}/source/core_pki_utils.c 12 | ) 13 | 14 | target_include_directories(corepkcs11 15 | PUBLIC 16 | ${PKCS_INCLUDE_PUBLIC_DIRS} 17 | ) 18 | 19 | add_library(corepkcs11-config INTERFACE) 20 | 21 | target_link_libraries(corepkcs11 22 | PUBLIC 23 | corepkcs11-config 24 | PRIVATE 25 | freertos_kernel 26 | freertos-pkcs11-psa 27 | mbedtls 28 | ) 29 | -------------------------------------------------------------------------------- /components/aws_iot/coresntp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | if(CMAKE_CROSSCOMPILING) 6 | set(coresntp_SOURCE_DIR 7 | ${CMAKE_CURRENT_LIST_DIR}/library 8 | CACHE INTERNAL 9 | "Path to coreSNTP source code" 10 | ) 11 | 12 | add_subdirectory(integration) 13 | endif() 14 | -------------------------------------------------------------------------------- /components/aws_iot/coresntp/integration/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | include(${coresntp_SOURCE_DIR}/coreSntpFilePaths.cmake) 6 | 7 | add_library(coresntp 8 | ${CORE_SNTP_SOURCES} 9 | ) 10 | 11 | target_include_directories(coresntp 12 | PUBLIC 13 | ${CORE_SNTP_INCLUDE_PUBLIC_DIRS} 14 | ) 15 | 16 | add_library(coresntp-config INTERFACE) 17 | 18 | target_link_libraries(coresntp 19 | PUBLIC 20 | coresntp-config 21 | PRIVATE 22 | helpers-logging 23 | ) 24 | -------------------------------------------------------------------------------- /components/aws_iot/jobs_for_aws_iot_embedded_sdk/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | if(BUILD_TESTING AND NOT CMAKE_CROSSCOMPILING) 6 | # Left empty for future mocks. 7 | else() 8 | set(jobs-for-aws-iot-embedded-sdk_SOURCE_DIR 9 | ${CMAKE_CURRENT_LIST_DIR}/library 10 | CACHE INTERNAL 11 | "Path to AWS IoT Jobs source code" 12 | ) 13 | 14 | include(ApplyPatches) 15 | 16 | set(PATCH_FILES_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/integration/patches") 17 | set(PATCH_FILES 18 | "${PATCH_FILES_DIRECTORY}/0001-Check-for-RSA-signature-instead-of-ECDSA.patch" 19 | "${PATCH_FILES_DIRECTORY}/0002-Use-custom-strnlen-implementation.patch" 20 | "${PATCH_FILES_DIRECTORY}/0003-Add-functionality-for-sending-and-retrieving-updated.patch" 21 | ) 22 | iot_reference_arm_corstone3xx_apply_patches("${jobs-for-aws-iot-embedded-sdk_SOURCE_DIR}" "${PATCH_FILES}") 23 | 24 | add_subdirectory(integration) 25 | endif() 26 | -------------------------------------------------------------------------------- /components/aws_iot/jobs_for_aws_iot_embedded_sdk/integration/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_library(jobs-for-aws-iot-embedded-sdk 6 | ${jobs-for-aws-iot-embedded-sdk_SOURCE_DIR}/source/otaJobParser/job_parser.c 7 | ${jobs-for-aws-iot-embedded-sdk_SOURCE_DIR}/source/otaJobParser/ota_job_handler.c 8 | ${jobs-for-aws-iot-embedded-sdk_SOURCE_DIR}/source/jobs.c 9 | ) 10 | 11 | target_include_directories(jobs-for-aws-iot-embedded-sdk 12 | PUBLIC 13 | ${jobs-for-aws-iot-embedded-sdk_SOURCE_DIR}/source/include/ 14 | ${jobs-for-aws-iot-embedded-sdk_SOURCE_DIR}/source/otaJobParser/include/ 15 | ) 16 | 17 | target_link_libraries(jobs-for-aws-iot-embedded-sdk 18 | PUBLIC 19 | freertos_kernel 20 | corejson 21 | coremqtt 22 | coremqtt-agent 23 | crt-helpers 24 | tinycbor 25 | ) 26 | -------------------------------------------------------------------------------- /components/aws_iot/tinycbor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | if(CMAKE_CROSSCOMPILING) 6 | set(tinycbor_SOURCE_DIR 7 | ${CMAKE_CURRENT_LIST_DIR}/library 8 | CACHE INTERNAL 9 | "Path to TinyCBOR source code" 10 | ) 11 | 12 | add_subdirectory(integration) 13 | endif() 14 | -------------------------------------------------------------------------------- /components/aws_iot/tinycbor/integration/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_library(tinycbor 6 | ${tinycbor_SOURCE_DIR}/src/cborpretty.c 7 | ${tinycbor_SOURCE_DIR}/src/cborpretty_stdio.c 8 | ${tinycbor_SOURCE_DIR}/src/cborencoder.c 9 | ${tinycbor_SOURCE_DIR}/src/cborencoder_close_container_checked.c 10 | ${tinycbor_SOURCE_DIR}/src/cborerrorstrings.c 11 | ${tinycbor_SOURCE_DIR}/src/cborparser.c 12 | ${tinycbor_SOURCE_DIR}/src/cborparser_dup_string.c 13 | ) 14 | 15 | target_include_directories(tinycbor 16 | PUBLIC 17 | ${tinycbor_SOURCE_DIR}/src 18 | ) 19 | 20 | add_library(tinycbor-config INTERFACE) 21 | 22 | target_link_libraries(tinycbor 23 | PUBLIC 24 | tinycbor-config 25 | ) 26 | -------------------------------------------------------------------------------- /components/connectivity/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_subdirectory(backoff_algorithm) 6 | 7 | set(CONNECTIVITY_STACK "FREERTOS_PLUS_TCP" CACHE STRING "Choose the connectivity stack (FREERTOS_PLUS_TCP|IOT_VSOCKET) to use ().") 8 | 9 | if(CONNECTIVITY_STACK STREQUAL "FREERTOS_PLUS_TCP") 10 | add_subdirectory(freertos_plus_tcp) 11 | elseif(CONNECTIVITY_STACK STREQUAL "IOT_VSOCKET") 12 | add_subdirectory(iot_socket) 13 | add_subdirectory(iot_vsocket) 14 | else() 15 | message(FATAL_ERROR "Invalid connectivity stack choice: ${CONNECTIVITY_STACK}") 16 | endif() 17 | -------------------------------------------------------------------------------- /components/connectivity/backoff_algorithm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | if(BUILD_TESTING AND NOT CMAKE_CROSSCOMPILING) 6 | add_subdirectory(library_mocks) 7 | else () 8 | set(backoff_algorithm_SOURCE_DIR 9 | ${CMAKE_CURRENT_LIST_DIR}/library 10 | CACHE INTERNAL 11 | "Path to backoffAlgorithm source code" 12 | ) 13 | 14 | add_subdirectory(integration) 15 | endif() 16 | -------------------------------------------------------------------------------- /components/connectivity/backoff_algorithm/integration/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | include(${backoff_algorithm_SOURCE_DIR}/backoffAlgorithmFilePaths.cmake) 6 | 7 | add_library(backoff-algorithm 8 | ${BACKOFF_ALGORITHM_SOURCES} 9 | ) 10 | 11 | target_include_directories(backoff-algorithm 12 | PUBLIC 13 | ${BACKOFF_ALGORITHM_INCLUDE_PUBLIC_DIRS} 14 | ) 15 | 16 | add_library(backoff-algorithm-config INTERFACE) 17 | 18 | target_link_libraries(backoff-algorithm 19 | PUBLIC 20 | backoff-algorithm-config 21 | ) 22 | -------------------------------------------------------------------------------- /components/connectivity/backoff_algorithm/library_mocks/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_library(backoff-algorithm-mock 6 | src/backoff_algorithm.c 7 | ) 8 | 9 | target_include_directories(backoff-algorithm-mock 10 | PUBLIC 11 | inc 12 | ) 13 | 14 | target_link_libraries(backoff-algorithm-mock 15 | PRIVATE 16 | fff 17 | ) 18 | -------------------------------------------------------------------------------- /components/connectivity/freertos_plus_tcp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024, Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | if(BUILD_TESTING AND NOT CMAKE_CROSSCOMPILING) 6 | add_subdirectory(library_mocks) 7 | else () 8 | set(freertos_plus_tcp_SOURCE_DIR 9 | ${CMAKE_CURRENT_LIST_DIR}/library 10 | CACHE INTERNAL 11 | "Path to FreeRTOS-Plus-TCP source code" 12 | ) 13 | 14 | if (${ARM_CORSTONE_BSP_TARGET_PLATFORM} STREQUAL "corstone300" OR ${ARM_CORSTONE_BSP_TARGET_PLATFORM} STREQUAL "corstone310") 15 | set(FREERTOS_PLUS_TCP_NETWORK_IF "MPS3_AN552" CACHE STRING "FreeRTOS Plus TCP Network Interface selection") 16 | elseif (${ARM_CORSTONE_BSP_TARGET_PLATFORM} STREQUAL "corstone315" OR ${ARM_CORSTONE_BSP_TARGET_PLATFORM} STREQUAL "corstone320") 17 | set(FREERTOS_PLUS_TCP_NETWORK_IF "MPS4_CS315" CACHE STRING "FreeRTOS Plus TCP Network Interface selection") 18 | endif() 19 | 20 | set(FREERTOS_PLUS_TCP_BUFFER_ALLOCATION "2" CACHE STRING "FreeRTOS buffer allocation model number. 1 .. 2.") 21 | 22 | add_subdirectory(library/source) 23 | add_subdirectory(library/tools) 24 | endif() 25 | add_subdirectory(integration) 26 | -------------------------------------------------------------------------------- /components/connectivity/freertos_plus_tcp/integration/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | if(BUILD_TESTING AND NOT CMAKE_CROSSCOMPILING) 6 | add_subdirectory(integration_mocks) 7 | add_library(connectivity-stack-mock ALIAS freertos-plus-tcp-integration-mock) 8 | else () 9 | target_sources(freertos_plus_tcp 10 | PRIVATE 11 | src/network_startup.c 12 | src/transport_mbedtls.c 13 | ) 14 | 15 | target_include_directories(freertos_plus_tcp SYSTEM 16 | PUBLIC 17 | inc 18 | ) 19 | 20 | target_link_libraries(freertos_plus_tcp 21 | PUBLIC 22 | # TODO: The CS315 network interface layer inside the FreeRTOS TCP/IP stack 23 | # https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/source/portable/NetworkInterface/MPS4_CS315/Device/Include/SSE315.h#L62 24 | # is done in such a way that it depends on fri-bsp. This dependency 25 | # should be removed. 26 | fri-bsp 27 | PRIVATE 28 | coremqtt 29 | helpers-events 30 | helpers-logging 31 | iot-tls 32 | ) 33 | 34 | add_library(connectivity-stack ALIAS freertos_plus_tcp) 35 | endif() 36 | -------------------------------------------------------------------------------- /components/connectivity/freertos_plus_tcp/integration/integration_mocks/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_library(freertos-plus-tcp-integration-mock 6 | src/transport_interface_api.c 7 | ) 8 | 9 | target_include_directories(freertos-plus-tcp-integration-mock 10 | PUBLIC 11 | inc 12 | ) 13 | 14 | target_link_libraries(freertos-plus-tcp-integration-mock 15 | PRIVATE 16 | fff 17 | ) 18 | -------------------------------------------------------------------------------- /components/connectivity/freertos_plus_tcp/library_mocks/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_library(freertos-plus-tcp-mock INTERFACE) 6 | 7 | target_include_directories(freertos-plus-tcp-mock 8 | INTERFACE 9 | inc 10 | ) 11 | 12 | target_link_libraries(freertos-plus-tcp-mock 13 | INTERFACE 14 | fff 15 | ) 16 | -------------------------------------------------------------------------------- /components/connectivity/iot_socket/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | if(BUILD_TESTING AND NOT CMAKE_CROSSCOMPILING) 6 | # left empty for future mocks. 7 | else () 8 | set(iot_socket_SOURCE_DIR 9 | ${CMAKE_CURRENT_LIST_DIR}/library 10 | CACHE INTERNAL 11 | "Path to IoT Socket source code" 12 | ) 13 | 14 | add_subdirectory(integration) 15 | endif() 16 | -------------------------------------------------------------------------------- /components/connectivity/iot_socket/integration/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_library(iot-socket-api INTERFACE) 6 | 7 | target_include_directories(iot-socket-api 8 | INTERFACE 9 | ${iot_socket_SOURCE_DIR}/include 10 | ) 11 | -------------------------------------------------------------------------------- /components/connectivity/iot_vsocket/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | if(BUILD_TESTING AND NOT CMAKE_CROSSCOMPILING) 6 | add_subdirectory(library_mocks) 7 | else () 8 | set(iot_vsocket_SOURCE_DIR 9 | ${CMAKE_CURRENT_LIST_DIR}/library 10 | CACHE INTERNAL 11 | "Path to Arm Virtual Hardware - IoT Virtual Socket source code" 12 | ) 13 | 14 | include(ApplyPatches) 15 | 16 | set(PATCH_FILES_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/integration/patches") 17 | set(PATCH_FILES "${PATCH_FILES_DIRECTORY}/0001-Replace-CMSIS-RTX-APIs-with-FreeRTOS-APIs.patch") 18 | iot_reference_arm_corstone3xx_apply_patches("${iot_vsocket_SOURCE_DIR}" "${PATCH_FILES}") 19 | 20 | endif() 21 | add_subdirectory(integration) 22 | -------------------------------------------------------------------------------- /components/connectivity/iot_vsocket/integration/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | if(BUILD_TESTING AND NOT CMAKE_CROSSCOMPILING) 6 | add_subdirectory(integration_mocks) 7 | add_library(connectivity-stack-mock ALIAS iot-vsocket-integration-mock) 8 | else() 9 | add_library(iot-vsocket 10 | ${iot_vsocket_SOURCE_DIR}/interface/vsocket/iot_socket.c 11 | src/network_startup.c 12 | src/transport_tls_iot_socket.c 13 | ) 14 | 15 | target_include_directories(iot-vsocket 16 | PUBLIC 17 | inc 18 | ${iot_vsocket_SOURCE_DIR}/interface/include 19 | ) 20 | 21 | target_link_libraries(iot-vsocket 22 | PRIVATE 23 | coremqtt 24 | helpers-events 25 | helpers-logging 26 | fri-bsp 27 | iot-socket-api 28 | iot-tls 29 | ) 30 | add_library(connectivity-stack ALIAS iot-vsocket) 31 | endif() 32 | -------------------------------------------------------------------------------- /components/connectivity/iot_vsocket/integration/integration_mocks/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_library(iot-vsocket-integration-mock 6 | src/transport_interface_api.c 7 | ) 8 | 9 | target_include_directories(iot-vsocket-integration-mock 10 | PUBLIC 11 | inc 12 | ) 13 | 14 | target_link_libraries(iot-vsocket-integration-mock 15 | PRIVATE 16 | fff 17 | ) 18 | -------------------------------------------------------------------------------- /components/connectivity/iot_vsocket/integration/src/network_startup.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2021-2023 Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #include 7 | 8 | #include "FreeRTOS.h" 9 | #include "events.h" 10 | 11 | int32_t network_startup( void ) 12 | { 13 | /* The iot-vsocket implementation utilizes the underlying host network 14 | * stack for network operation. It is assumed that the host network is 15 | * already operational by the time the application runs. */ 16 | EventBits_t uxBits = xEventGroupSetBits( xSystemEvents, EVENT_MASK_NETWORK_UP ); 17 | 18 | if( !( uxBits & EVENT_MASK_NETWORK_UP ) ) 19 | { 20 | /* During this stage of application intialisation, there are no other 21 | * tasks active except logging task. Hence the value returned by 22 | * xEventGroupSetBits must have EVENT_MASK_NETWORK_UP bit set. If not, 23 | * something went wrong during initialisation. Trigger an assert to 24 | * catch this. */ 25 | configASSERT( 0 ); 26 | } 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /components/connectivity/iot_vsocket/library_mocks/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_library(iot-vsocket-mock INTERFACE 6 | ) 7 | 8 | target_include_directories(iot-vsocket-mock 9 | INTERFACE 10 | inc 11 | ) 12 | 13 | target_link_libraries(iot-vsocket-mock 14 | INTERFACE 15 | fff 16 | ) 17 | -------------------------------------------------------------------------------- /components/freertos_kernel/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | if(BUILD_TESTING AND NOT CMAKE_CROSSCOMPILING) 6 | add_subdirectory(library_mocks) 7 | else() 8 | set(freertos_kernel_SOURCE_DIR 9 | ${CMAKE_CURRENT_LIST_DIR}/library 10 | CACHE INTERNAL 11 | "Path to FreeRTOS-Kernel source code" 12 | ) 13 | 14 | set(FREERTOS_HEAP "${CMAKE_CURRENT_LIST_DIR}/integration/src/heap_management.c" CACHE STRING "" FORCE) 15 | 16 | if(ARM_CORSTONE_BSP_TARGET_PLATFORM STREQUAL "corstone300") 17 | set(FREERTOS_PORT GCC_ARM_CM55_TFM) 18 | elseif(ARM_CORSTONE_BSP_TARGET_PLATFORM STREQUAL "corstone310" OR 19 | ARM_CORSTONE_BSP_TARGET_PLATFORM STREQUAL "corstone315" OR 20 | ARM_CORSTONE_BSP_TARGET_PLATFORM STREQUAL "corstone320") 21 | set(FREERTOS_PORT GCC_ARM_CM85_TFM) 22 | endif() 23 | 24 | # FreeRTOS requires the freertos_config library to exist first 25 | add_library(freertos_config INTERFACE) 26 | target_include_directories(freertos_config 27 | INTERFACE 28 | $<$:${IOT_REFERENCE_ARM_CORSTONE3XX_SOURCE_DIR}/bsp/corstone300/include> 29 | $<$:${IOT_REFERENCE_ARM_CORSTONE3XX_SOURCE_DIR}/bsp/corstone310/include> 30 | $<$:${IOT_REFERENCE_ARM_CORSTONE3XX_SOURCE_DIR}/bsp/corstone315/include> 31 | $<$:${IOT_REFERENCE_ARM_CORSTONE3XX_SOURCE_DIR}/bsp/corstone320/include> 32 | ) 33 | add_subdirectory(library) 34 | endif() 35 | -------------------------------------------------------------------------------- /components/freertos_kernel/integration/src/heap_management.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2024 Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | 6 | #include 7 | 8 | void * pvPortMalloc( size_t xWantedSize ) 9 | { 10 | return malloc( xWantedSize ); 11 | } 12 | 13 | void vPortFree( void * pv ) 14 | { 15 | free( pv ); 16 | } 17 | 18 | void * pvPortCalloc( size_t xNum, 19 | size_t xSize ) 20 | { 21 | return calloc( xNum, xSize ); 22 | } 23 | 24 | /* These are dummy implementations as C standard library does not provide 25 | * functions to get the statistics of heap memory. These dummy implementation are needed 26 | * as these APIs are used as part of FreeRTOS Plus TCP code which is unused in the FRI code (removed by the linker) 27 | * but ARMClang linker requires all the compiled symbols to be defined. 28 | */ 29 | size_t xPortGetFreeHeapSize( void ) 30 | { 31 | return 0; 32 | } 33 | 34 | size_t xPortGetMinimumEverFreeHeapSize( void ) 35 | { 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /components/freertos_kernel/library_mocks/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_library(freertos-kernel-mock 6 | src/event_groups.c 7 | src/semphr.c 8 | src/tasks.c 9 | src/queue.c 10 | ) 11 | 12 | target_include_directories(freertos-kernel-mock 13 | PUBLIC 14 | inc 15 | ) 16 | 17 | target_link_libraries(freertos-kernel-mock 18 | PRIVATE 19 | fff 20 | ) 21 | -------------------------------------------------------------------------------- /components/freertos_kernel/library_mocks/inc/portmacro.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.1.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * Copyright 2023-2024 Arm Limited and/or its affiliates 5 | * 6 | * 7 | * SPDX-License-Identifier: MIT 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 10 | * this software and associated documentation files (the "Software"), to deal in 11 | * the Software without restriction, including without limitation the rights to 12 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 13 | * the Software, and to permit persons to whom the Software is furnished to do so, 14 | * subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in all 17 | * copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 21 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 22 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 23 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 24 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | * 26 | * https://www.FreeRTOS.org 27 | * https://github.com/FreeRTOS 28 | * 29 | */ 30 | 31 | #ifndef PORTMACRO_H 32 | #define PORTMACRO_H 33 | 34 | typedef long BaseType_t; 35 | typedef unsigned short UBaseType_t; 36 | typedef unsigned long TickType_t; 37 | 38 | #define portMAX_DELAY ( TickType_t ) 0xFFFFFFFFUL 39 | 40 | #endif /* ifndef PORTMACRO_H */ 41 | -------------------------------------------------------------------------------- /components/graphics/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_subdirectory(arm-2d) 6 | -------------------------------------------------------------------------------- /components/graphics/arm-2d/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2021-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | set(arm-2d_SOURCE_DIR 6 | ${CMAKE_CURRENT_LIST_DIR}/library 7 | CACHE INTERNAL 8 | "Path to Arm-2d library source code" 9 | ) 10 | 11 | add_subdirectory(integration) 12 | -------------------------------------------------------------------------------- /components/graphics/arm-2d/integration/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2024-2025 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_library(arm-2d STATIC) 6 | 7 | target_include_directories(arm-2d 8 | PUBLIC 9 | ${arm-2d_SOURCE_DIR}/Library/Include 10 | ${arm-2d_SOURCE_DIR}/Helper/Include 11 | ) 12 | 13 | target_sources(arm-2d 14 | PRIVATE 15 | ${arm-2d_SOURCE_DIR}/Library/Source/arm_2d.c 16 | ${arm-2d_SOURCE_DIR}/Library/Source/__arm_2d_tile.c 17 | ${arm-2d_SOURCE_DIR}/Library/Source/arm_2d_draw.c 18 | ${arm-2d_SOURCE_DIR}/Library/Source/arm_2d_alpha_blending.c 19 | ${arm-2d_SOURCE_DIR}/Library/Source/arm_2d_helium.c 20 | ) 21 | 22 | target_link_libraries(arm-2d 23 | PUBLIC 24 | arm_2d-config 25 | cmsis-dsp 26 | ) 27 | -------------------------------------------------------------------------------- /components/security/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | # Trusted Firmware-M needs to be added before 6 | # the other security components as its build 7 | # byproducts are listed in the others. 8 | add_subdirectory(trusted_firmware-m) 9 | 10 | add_subdirectory(freertos_ota_pal_psa) 11 | add_subdirectory(freertos_pkcs11_psa) 12 | add_subdirectory(mbedtls) 13 | -------------------------------------------------------------------------------- /components/security/freertos_ota_pal_psa/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2025 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | if(CMAKE_CROSSCOMPILING) 6 | set(freertos_ota_pal_psa_SOURCE_DIR 7 | ${CMAKE_CURRENT_LIST_DIR}/library 8 | CACHE INTERNAL 9 | "Path to FreeRTOS OTA PAL based on PSA API source code" 10 | ) 11 | 12 | include(ApplyPatches) 13 | 14 | set(PATCH_FILES_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/integration/patches") 15 | set(PATCH_FILES 16 | "${PATCH_FILES_DIRECTORY}/0001-ota-abort-Fix-successful-abortion-check.patch" 17 | "${PATCH_FILES_DIRECTORY}/0002-Update-FreeRTOS-OTA-PAL-PSA-to-work-with-new-modular.patch" 18 | "${PATCH_FILES_DIRECTORY}/0003-component-ID-Add-ML-model-file-path.patch" 19 | "${PATCH_FILES_DIRECTORY}/0004-app-version-Do-not-store-version-in-a-global-var.patch" 20 | "${PATCH_FILES_DIRECTORY}/0005-PAL-Implement-component-version-getter.patch" 21 | ) 22 | iot_reference_arm_corstone3xx_apply_patches("${freertos_ota_pal_psa_SOURCE_DIR}" "${PATCH_FILES}") 23 | 24 | add_subdirectory(integration) 25 | else() 26 | add_subdirectory(library_mocks) 27 | endif() 28 | -------------------------------------------------------------------------------- /components/security/freertos_ota_pal_psa/integration/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024, Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_library(freertos-ota-pal-psa 6 | ${freertos_ota_pal_psa_SOURCE_DIR}/version/application_version.c 7 | ${freertos_ota_pal_psa_SOURCE_DIR}/ota_pal.c 8 | ) 9 | 10 | if(NOT ${AWS_OTA_SIGNATURE_TYPE} STREQUAL "") 11 | string(REGEX MATCH "^[A-Z]*" AWS_OTA_SIG_TYPE ${AWS_OTA_SIGNATURE_TYPE}) 12 | endif() 13 | 14 | target_compile_definitions(freertos-ota-pal-psa 15 | PRIVATE 16 | $<$:OTA_PAL_CODE_SIGNING_ALGO=OTA_PAL_CODE_SIGNING_RSA> 17 | $<$:OTA_PAL_SIGNATURE_FORMAT=OTA_PAL_SIGNATURE_RAW> 18 | $<$:OTA_PAL_CODE_SIGNING_ALGO=OTA_PAL_CODE_SIGNING_ECDSA> 19 | $<$:OTA_PAL_SIGNATURE_FORMAT=OTA_PAL_SIGNATURE_ASN1_DER> 20 | ) 21 | 22 | target_include_directories(freertos-ota-pal-psa 23 | PUBLIC 24 | ${freertos_ota_pal_psa_SOURCE_DIR} 25 | ) 26 | 27 | add_library(freertos-ota-pal-psa-config INTERFACE) 28 | 29 | target_link_libraries(freertos-ota-pal-psa 30 | PUBLIC 31 | freertos-ota-pal-psa-config 32 | PRIVATE 33 | corepkcs11 34 | freertos_kernel 35 | helpers-logging 36 | mbedtls 37 | jobs-for-aws-iot-embedded-sdk 38 | ota-update 39 | ) 40 | -------------------------------------------------------------------------------- /components/security/freertos_ota_pal_psa/integration/patches/0001-ota-abort-Fix-successful-abortion-check.patch: -------------------------------------------------------------------------------- 1 | From 2afe0bd72fc141a4122647e94ae73b8465b6da0e Mon Sep 17 00:00:00 2001 2 | From: Ahmed Ismail 3 | Date: Tue, 14 Jan 2025 17:14:24 +0000 4 | Subject: [PATCH 1/5] ota-abort: Fix successful abortion check 5 | 6 | PsaStatus variable should be initialized before 7 | being accessed as in the happy path scenario the 8 | variable wouldn't be modified as the psa_fwu_cancel() 9 | and psa_fwu_clean() functions wouldn't be failing. Hence 10 | the variable would be accessed before being initialized 11 | means that a garbage value would be checked 12 | which is not the correct case. 13 | 14 | Signed-off-by: Ahmed Ismail 15 | --- 16 | ota_pal.c | 2 +- 17 | 1 file changed, 1 insertion(+), 1 deletion(-) 18 | 19 | diff --git a/ota_pal.c b/ota_pal.c 20 | index 14b2e80..165c146 100644 21 | --- a/ota_pal.c 22 | +++ b/ota_pal.c 23 | @@ -282,7 +282,7 @@ OtaPalStatus_t otaPal_Abort( OtaFileContext_t * const pFileContext ) 24 | } 25 | else 26 | { 27 | - psa_status_t lPsaStatus; 28 | + psa_status_t lPsaStatus = PSA_SUCCESS; 29 | if( psa_fwu_cancel( xOTAComponentID ) != PSA_SUCCESS ) 30 | { 31 | lPsaStatus = OTA_PAL_COMBINE_ERR( OtaPalAbortFailed, 0 ); 32 | -- 33 | 2.34.1 34 | 35 | -------------------------------------------------------------------------------- /components/security/freertos_ota_pal_psa/integration/patches/0003-component-ID-Add-ML-model-file-path.patch: -------------------------------------------------------------------------------- 1 | From abc28629fb60834dd85bc9065132d413e416a4c0 Mon Sep 17 00:00:00 2001 2 | From: Ahmed Ismail 3 | Date: Tue, 14 Jan 2025 17:20:31 +0000 4 | Subject: [PATCH 3/5] component ID: Add ML model file path 5 | 6 | Update the PortConvertFilePathtoPSAComponentID function to support the 7 | ML model image file path, to enable the model-only OTA update. 8 | 9 | Signed-off-by: Filip Jagodzinski 10 | --- 11 | ota_pal.c | 7 +++++++ 12 | 1 file changed, 7 insertions(+) 13 | 14 | diff --git a/ota_pal.c b/ota_pal.c 15 | index 9b7e6f4..9641106 100644 16 | --- a/ota_pal.c 17 | +++ b/ota_pal.c 18 | @@ -228,6 +228,13 @@ static bool PortConvertFilePathtoPSAComponentID ( AfrOtaJobDocumentFields_t * co 19 | return true; 20 | } 21 | #endif 22 | +#ifdef FWU_COMPONENT_ID_ML_MODEL 23 | + if( memcmp( pFileContext->filepath, "ml_model image", strlen("ml_model image") ) == 0 ) 24 | + { 25 | + *pxComponent = FWU_COMPONENT_ID_ML_MODEL; 26 | + return true; 27 | + } 28 | +#endif 29 | #ifdef FWU_COMPONENT_ID_FULL 30 | if( memcmp( pFileContext->filepath, "combined image", strlen("combined image") ) == 0 ) 31 | { 32 | -- 33 | 2.34.1 34 | 35 | -------------------------------------------------------------------------------- /components/security/freertos_ota_pal_psa/library_mocks/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_library(freertos-ota-pal-psa-mock 6 | ./src/version/application_version.c 7 | ) 8 | 9 | target_include_directories(freertos-ota-pal-psa-mock 10 | PUBLIC 11 | inc 12 | 13 | inc/version 14 | ) 15 | 16 | target_link_libraries(freertos-ota-pal-psa-mock 17 | PRIVATE 18 | fff 19 | ) 20 | -------------------------------------------------------------------------------- /components/security/freertos_ota_pal_psa/library_mocks/inc/ota_pal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS V202107.00 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * Copyright 2024 Arm Limited and/or its affiliates 5 | * 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * http://aws.amazon.com/freertos 25 | * http://www.FreeRTOS.org 26 | */ 27 | 28 | 29 | #ifndef OTA_PAL_H_ 30 | #define OTA_PAL_H_ 31 | 32 | #endif /* OTA_PAL_H_ */ 33 | -------------------------------------------------------------------------------- /components/security/freertos_ota_pal_psa/library_mocks/src/version/application_version.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2024 Arm Limited. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in 6 | * the Software without restriction, including without limitation the rights to 7 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | * the Software, and to permit persons to whom the Software is furnished to do so, 9 | * subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | * 21 | */ 22 | 23 | #include "application_version.h" 24 | 25 | DEFINE_FAKE_VALUE_FUNC( int, 26 | GetImageVersionPSA, 27 | uint8_t ); 28 | 29 | const AppVersion32_t appFirmwareVersion; 30 | -------------------------------------------------------------------------------- /components/security/freertos_pkcs11_psa/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | if(BUILD_TESTING AND NOT CMAKE_CROSSCOMPILING) 6 | # left empty for future mocks. 7 | else () 8 | set(freertos_pkcs11_psa_SOURCE_DIR 9 | ${CMAKE_CURRENT_LIST_DIR}/library 10 | CACHE INTERNAL 11 | "Path to FreeRTOS PKCS#11 to PSA shim layer source code" 12 | ) 13 | 14 | # The patch 0001-crypto-Define-device-private-key-as-volatile.patch is only 15 | # needed when Mbed TLS on non-secure side is used as PSA crypto implementation. 16 | if(PSA_CRYPTO_IMPLEMENTATION STREQUAL "MBEDTLS") 17 | include(ApplyPatches) 18 | 19 | set(PATCH_FILES_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/integration/patches") 20 | set(PATCH_FILES 21 | "${PATCH_FILES_DIRECTORY}/0001-crypto-Define-device-private-key-as-volatile.patch" 22 | ) 23 | iot_reference_arm_corstone3xx_apply_patches("${freertos_pkcs11_psa_SOURCE_DIR}" "${PATCH_FILES}") 24 | endif() 25 | 26 | add_subdirectory(integration) 27 | endif() 28 | -------------------------------------------------------------------------------- /components/security/freertos_pkcs11_psa/integration/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2025 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | include(ExternalProject) 6 | 7 | add_library(freertos-pkcs11-psa 8 | ${freertos_pkcs11_psa_SOURCE_DIR}/iot_pkcs11_psa_input_format.c 9 | ${freertos_pkcs11_psa_SOURCE_DIR}/iot_pkcs11_psa_object_management.c 10 | ${freertos_pkcs11_psa_SOURCE_DIR}/iot_pkcs11_psa.c 11 | ) 12 | 13 | target_include_directories(freertos-pkcs11-psa 14 | PUBLIC 15 | ${freertos_pkcs11_psa_SOURCE_DIR} 16 | ) 17 | 18 | add_library(freertos-pkcs11-psa-config INTERFACE) 19 | 20 | target_link_libraries(freertos-pkcs11-psa 21 | PUBLIC 22 | freertos-pkcs11-psa-config 23 | tfm_api_ns 24 | PRIVATE 25 | corepkcs11 26 | freertos_kernel 27 | mbedtls 28 | ) 29 | -------------------------------------------------------------------------------- /components/security/mbedtls/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | if(BUILD_TESTING AND NOT CMAKE_CROSSCOMPILING) 6 | add_subdirectory(library_mocks) 7 | else () 8 | set(mbedtls_SOURCE_DIR 9 | ${CMAKE_CURRENT_LIST_DIR}/library 10 | CACHE INTERNAL 11 | "Path to Mbed TLS source code" 12 | ) 13 | # MbedTLS library configuration 14 | # Programs and testing builds are not required 15 | # Note: Mbed TLS specifies an old version of CMake which does not fully support 16 | # overriding a CACHE variable with a regular one, so we need to use the CACHE 17 | # keyword here. 18 | set(ENABLE_PROGRAMS OFF CACHE BOOL "" FORCE) 19 | set(ENABLE_TESTING OFF CACHE BOOL "" FORCE) 20 | 21 | add_subdirectory(library) 22 | 23 | add_subdirectory(integration) 24 | endif() 25 | -------------------------------------------------------------------------------- /components/security/mbedtls/library_mocks/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_library(mbedtls-mock 6 | src/psa/crypto.c 7 | ) 8 | 9 | target_include_directories(mbedtls-mock 10 | PUBLIC 11 | inc 12 | ) 13 | 14 | target_link_libraries(mbedtls-mock 15 | PRIVATE 16 | fff 17 | ) 18 | -------------------------------------------------------------------------------- /components/security/mbedtls/library_mocks/inc/psa/crypto.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright The Mbed TLS Contributors 3 | * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later 4 | */ 5 | 6 | #ifndef PSA_CRYPTO_H 7 | #define PSA_CRYPTO_H 8 | 9 | #include "fff.h" 10 | 11 | #include "crypto_types.h" 12 | #include 13 | #include 14 | 15 | DECLARE_FAKE_VALUE_FUNC( psa_status_t, psa_generate_random, uint8_t *, size_t ); 16 | 17 | #endif /* PSA_CRYPTO_H */ 18 | -------------------------------------------------------------------------------- /components/security/mbedtls/library_mocks/inc/psa/crypto_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright The Mbed TLS Contributors 3 | * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later 4 | */ 5 | 6 | #ifndef PSA_CRYPTO_TYPES_H 7 | #define PSA_CRYPTO_TYPES_H 8 | 9 | #include 10 | 11 | #ifndef PSA_SUCCESS 12 | typedef int32_t psa_status_t; 13 | #endif 14 | 15 | #endif /* PSA_CRYPTO_TYPES_H */ 16 | -------------------------------------------------------------------------------- /components/security/mbedtls/library_mocks/src/psa/crypto.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright The Mbed TLS Contributors 3 | * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later 4 | */ 5 | 6 | #include "psa/crypto.h" 7 | #include "psa/crypto_types.h" 8 | 9 | DEFINE_FAKE_VALUE_FUNC( psa_status_t, 10 | psa_generate_random, 11 | uint8_t *, 12 | size_t ); 13 | -------------------------------------------------------------------------------- /components/security/trusted_firmware-m/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2025, Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | 6 | set(trusted_firmware-m_SOURCE_DIR 7 | ${CMAKE_CURRENT_LIST_DIR}/library 8 | CACHE INTERNAL 9 | "Path to Trusted Firmware-M source code" 10 | ) 11 | 12 | if(BUILD_TESTING AND NOT CMAKE_CROSSCOMPILING) 13 | add_subdirectory(library_mocks) 14 | else() 15 | add_subdirectory(integration) 16 | endif() 17 | -------------------------------------------------------------------------------- /components/security/trusted_firmware-m/integration/cmake/SignTfmImage.cmake: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2025 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | list(APPEND CMAKE_MODULE_PATH ${IOT_REFERENCE_ARM_CORSTONE3XX_SOURCE_DIR}/tools/cmake) 6 | include(ConvertElfToBin) 7 | 8 | # This function is documented under `Image signing` section in `trusted_firmware-m.md` document located at 9 | # `${IOT_REFERENCE_ARM_CORSTONE3XX_SOURCE_DIR}/docs/components/security/` directory. 10 | function(iot_reference_arm_corstone3xx_tf_m_sign_image target unsigned_image_bin_name signed_bin_name signed_bin_version signature_layout_file pad) 11 | if(${pad}) 12 | set(pad_option "--pad") 13 | else() 14 | set(pad_option "") 15 | endif() 16 | 17 | add_custom_command( 18 | TARGET 19 | ${target} 20 | POST_BUILD 21 | DEPENDS 22 | $/${target}.bin 23 | COMMAND 24 | # Sign the non-secure (application) image for TF-M bootloader (BL2) 25 | python3 ${CONFIG_SPE_PATH}/image_signing/scripts/wrapper/wrapper.py 26 | -v ${signed_bin_version} 27 | --layout ${signature_layout_file} 28 | -k ${CONFIG_SPE_PATH}/image_signing/keys/image_ns_signing_private_key.pem 29 | --public-key-format full 30 | --align 1 --pad-header ${pad_option} -H 0x400 -s auto 31 | --measured-boot-record 32 | --confirm 33 | ${SECTORS_BIN_DIR}/${unsigned_image_bin_name}.bin 34 | $/${signed_bin_name}.bin 35 | COMMAND 36 | ${CMAKE_COMMAND} -E echo "-- signed: $/${signed_bin_name}.bin" 37 | VERBATIM 38 | ) 39 | endfunction() 40 | -------------------------------------------------------------------------------- /components/security/trusted_firmware-m/integration/cmake/TfmNsToolchain.cmake: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | list(APPEND CMAKE_MODULE_PATH ${CONFIG_SPE_PATH}/cmake) 6 | 7 | # A platform specific MCPU and architecture flags for NS side 8 | include(${CONFIG_SPE_PATH}/platform/cpuarch.cmake) 9 | # Include common configs exported from TF-M 10 | include(${CONFIG_SPE_PATH}/cmake/spe_config.cmake) 11 | 12 | if(NOT DEFINED TFM_TOOLCHAIN_FILE) 13 | if(${TOOLCHAIN} STREQUAL "GNU") 14 | set(TFM_TOOLCHAIN_FILE ${CONFIG_SPE_PATH}/cmake/toolchain_ns_GNUARM.cmake) 15 | elseif(${TOOLCHAIN} STREQUAL "ARMCLANG") 16 | set(TFM_TOOLCHAIN_FILE ${CONFIG_SPE_PATH}/cmake/toolchain_ns_ARMCLANG.cmake) 17 | endif() 18 | endif() 19 | 20 | if(${TOOLCHAIN} STREQUAL "GNU") 21 | include(${IOT_REFERENCE_ARM_CORSTONE3XX_SOURCE_DIR}/cmake/CompilerFlagsGNUARM.cmake) 22 | elseif(${TOOLCHAIN} STREQUAL "ARMCLANG") 23 | include(${IOT_REFERENCE_ARM_CORSTONE3XX_SOURCE_DIR}/cmake/CompilerFlagsARMCLANG.cmake) 24 | else() 25 | message(FATAL_ERROR "Unsupported toolchain: ${TOOLCHAIN}") 26 | endif() 27 | 28 | include(${TFM_TOOLCHAIN_FILE}) 29 | -------------------------------------------------------------------------------- /components/security/trusted_firmware-m/library_mocks/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | add_library(trusted-firmware-m-mock INTERFACE) 6 | 7 | target_include_directories(trusted-firmware-m-mock 8 | INTERFACE 9 | inc 10 | ) 11 | 12 | target_link_libraries(trusted-firmware-m-mock 13 | INTERFACE 14 | fff 15 | ) 16 | -------------------------------------------------------------------------------- /components/security/trusted_firmware-m/library_mocks/inc/psa/crypto_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright The Mbed TLS Contributors 3 | * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later 4 | */ 5 | 6 | #ifndef PSA_CRYPTO_TYPES_H 7 | #define PSA_CRYPTO_TYPES_H 8 | 9 | #ifndef PSA_SUCCESS 10 | typedef int32_t psa_status_t; 11 | #endif 12 | 13 | #endif /* PSA_CRYPTO_TYPES_H */ 14 | -------------------------------------------------------------------------------- /components/security/trusted_firmware-m/library_mocks/inc/psa/error.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2024, Arm Limited. All rights reserved. 3 | * 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * 6 | */ 7 | 8 | #ifndef __PSA_ERROR_H__ 9 | #define __PSA_ERROR_H__ 10 | 11 | #define PSA_SUCCESS ( ( psa_status_t ) 0 ) 12 | 13 | #define PSA_ERROR_PROGRAMMER_ERROR ( ( psa_status_t ) -129 ) 14 | 15 | 16 | #endif /* __PSA_ERROR_H__ */ 17 | -------------------------------------------------------------------------------- /components/security/trusted_firmware-m/library_mocks/inc/psa/fwu_config.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2024 Arm Limited and/or its affiliates 2 | * 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | 6 | #ifndef __FWU_CONFIG_H__ 7 | #define __FWU_CONFIG_H__ 8 | 9 | #define FWU_COMPONENT_ID_SECURE 0x00U 10 | #define FWU_COMPONENT_ID_NONSECURE 0x01U 11 | 12 | #endif /* __FWU_CONFIG_H__ */ 13 | -------------------------------------------------------------------------------- /components/security/trusted_firmware-m/library_mocks/inc/psa/update.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021-2024, Arm Limited. All rights reserved. 3 | * 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * 6 | */ 7 | 8 | #ifndef PSA_UPDATE_H 9 | #define PSA_UPDATE_H 10 | 11 | #endif /* PSA_UPDATE_H */ 12 | -------------------------------------------------------------------------------- /components/tools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2025 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | if(BUILD_TESTING AND NOT CMAKE_CROSSCOMPILING) 6 | add_subdirectory(fff) 7 | add_subdirectory(googletest) 8 | else() 9 | add_subdirectory(freertos_libraries_integration_tests) 10 | add_subdirectory(unity) 11 | endif() 12 | -------------------------------------------------------------------------------- /components/tools/fff/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | set(fff_SOURCE_DIR 6 | ${CMAKE_CURRENT_LIST_DIR}/library 7 | CACHE INTERNAL 8 | "Path to Fake Function Framework source code" 9 | ) 10 | 11 | add_subdirectory(library) 12 | -------------------------------------------------------------------------------- /components/tools/freertos_libraries_integration_tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | set(freertos_libraries_integration_tests_SOURCE_DIR 6 | ${CMAKE_CURRENT_LIST_DIR}/library 7 | CACHE INTERNAL 8 | "Path to FreeRTOS-Libraries-Integration-Tests source code" 9 | ) 10 | 11 | include(ApplyPatches) 12 | 13 | set(PATCH_FILES_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/integration/patches") 14 | set(PATCH_FILES 15 | "${PATCH_FILES_DIRECTORY}/0001-Reduce-the-TRANSPORT_TEST_BUFFER_WRITABLE_LENGTH.patch" 16 | ) 17 | iot_reference_arm_corstone3xx_apply_patches("${freertos_libraries_integration_tests_SOURCE_DIR}" "${PATCH_FILES}") 18 | 19 | add_subdirectory(integration) 20 | -------------------------------------------------------------------------------- /components/tools/freertos_libraries_integration_tests/integration/patches/0001-Reduce-the-TRANSPORT_TEST_BUFFER_WRITABLE_LENGTH.patch: -------------------------------------------------------------------------------- 1 | From 4ac525a90937f0f0f11c383b481285acef7e3125 Mon Sep 17 00:00:00 2001 2 | From: Ahmed Ismail 3 | Date: Mon, 1 Jul 2024 14:49:21 +0100 4 | Subject: [PATCH 1/3] Reduce the `TRANSPORT_TEST_BUFFER_WRITABLE_LENGTH` 5 | 6 | The `TRANSPORT_TEST_BUFFER_WRITABLE_LENGTH` is set to `2048`. Reduce it 7 | to `1350`, so that the test data can be sent in a single ethernet 8 | packet. 9 | 10 | Signed-off-by: Devaraj Ranganna 11 | --- 12 | src/transport_interface/transport_interface_test.c | 2 +- 13 | 1 file changed, 1 insertion(+), 1 deletion(-) 14 | 15 | diff --git a/src/transport_interface/transport_interface_test.c b/src/transport_interface/transport_interface_test.c 16 | index 32009dc..ccc6507 100644 17 | --- a/src/transport_interface/transport_interface_test.c 18 | +++ b/src/transport_interface/transport_interface_test.c 19 | @@ -59,7 +59,7 @@ 20 | * verified to remain unchanged after each test. 21 | */ 22 | #define TRANSPORT_TEST_BUFFER_PREFIX_GUARD_LENGTH ( 32U ) 23 | -#define TRANSPORT_TEST_BUFFER_WRITABLE_LENGTH ( 2048U ) 24 | +#define TRANSPORT_TEST_BUFFER_WRITABLE_LENGTH ( 1350U ) 25 | #define TRANSPORT_TEST_BUFFER_SUFFIX_GUARD_LENGTH ( 32U ) 26 | #define TRANSPORT_TEST_BUFFER_TOTAL_LENGTH \ 27 | ( TRANSPORT_TEST_BUFFER_PREFIX_GUARD_LENGTH + \ 28 | -- 29 | 2.34.1 30 | 31 | -------------------------------------------------------------------------------- /components/tools/googletest/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | set(googletest_SOURCE_DIR 6 | ${CMAKE_CURRENT_LIST_DIR}/library 7 | CACHE INTERNAL 8 | "Path to GoogleTest source code" 9 | ) 10 | 11 | add_subdirectory(library) 12 | -------------------------------------------------------------------------------- /components/tools/unity/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | set(unity_SOURCE_DIR 6 | ${CMAKE_CURRENT_LIST_DIR}/library 7 | CACHE INTERNAL 8 | "Path to Unity Test source code" 9 | ) 10 | 11 | set(UNITY_EXTENSION_FIXTURE ON CACHE BOOL "") 12 | 13 | add_subdirectory(library) 14 | -------------------------------------------------------------------------------- /cspell.config.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | $schema: https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json 3 | version: '0.2' 4 | # Allows things like stringLength 5 | allowCompoundWords: true 6 | 7 | # Read files not to spell check from the git ignore 8 | useGitignore: true 9 | 10 | # Language settings for C 11 | languageSettings: 12 | - caseSensitive: false 13 | enabled: true 14 | languageId: c 15 | locale: "*" 16 | 17 | # Add a dictionary, and the path to the word list 18 | dictionaryDefinitions: 19 | - name: freertos-words 20 | path: '.github/.cSpellWords.txt' 21 | addWords: true 22 | 23 | dictionaries: 24 | - freertos-words 25 | 26 | # Paths and files to ignore 27 | ignorePaths: 28 | - 'dependency' 29 | - 'ThirdParty' 30 | -------------------------------------------------------------------------------- /docs/development_environment/introduction.md: -------------------------------------------------------------------------------- 1 | # Setting Up your Development Environment 2 | 3 | This reference integration supports [Visual Studio Code](https://code.visualstudio.com/) 4 | development environment with the help of [devcontainers](https://code.visualstudio.com/docs/devcontainers/containers) 5 | and [Docker](https://docs.docker.com/get-started/overview). With Visual Studio 6 | Code, Linux (Ubuntu 22.04), Windows 11 and Mac OS 14.x operating systems are 7 | supported. Follow the steps described in the [document](./vscode_dev_env_build_and_debug.md) 8 | to setup Visual Stuido Code development environment. 9 | 10 | If you prefer not to use either Visual Stuido Code or Docker, then only 11 | Linux (Ubuntu 22.04) is supported as development environment. Follow the steps 12 | described in the [document](./linux_dev_env.md) 13 | to setup Linux (Ubuntu 22.04) development environment. 14 | -------------------------------------------------------------------------------- /docs/release_checklist.md: -------------------------------------------------------------------------------- 1 | # Arm FRI Release Checklist 2 | 3 | - [ ] Confirm Naming convention and Release Version with AWS 4 | - [ ] release date format 5 | - [ ] Feature Completeness as per AWS FRI Requirements 6 | - [ ] Passed required tests (Developer tests, in the future replaced with automated CI/CD tests and demo once FreeRTOS qualification/validation 2.0 tests completed) 7 | - [ ] network transport interface tests 8 | - [ ] corePKCS11 test 9 | - [ ] OTA PAL/E2E tests 10 | - [ ] Manual tests with key provisioning 11 | - [ ] Getting Started Guide (Update) 12 | - [ ] Github doc updates 13 | - [ ] ReadMe 14 | - [ ] Manifest 15 | - [ ] License 16 | - [ ] [FreeRTOS.org](https://freertos.org/) documentation changes 17 | - [ ] Project Introduction Page 18 | - [ ] Featured Reference Integration Landing Page (if add or remove project) 19 | - [ ] blog (if any) 20 | -------------------------------------------------------------------------------- /release_changes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeRTOS/iot-reference-arm-corstone3xx/0b2f65dcfc62a5f1cddf0e58f73118558165e8fa/release_changes/.gitkeep -------------------------------------------------------------------------------- /release_changes/202407151057.change: -------------------------------------------------------------------------------- 1 | ml-model: Add ML-Model component update feature to keyword-detection application. 2 | -------------------------------------------------------------------------------- /release_changes/202410251136.change.md: -------------------------------------------------------------------------------- 1 | ci: Enable scheduled blackduck scanning 2 | -------------------------------------------------------------------------------- /release_changes/202411121523.change.md: -------------------------------------------------------------------------------- 1 | components: Remove out-of-tree patches 2 | -------------------------------------------------------------------------------- /release_changes/202411201651.change.md: -------------------------------------------------------------------------------- 1 | ci: Enable gitlab-ci cache 2 | -------------------------------------------------------------------------------- /release_changes/202411211131.change.md: -------------------------------------------------------------------------------- 1 | ota: Update FRI to use new modular OTA structure 2 | -------------------------------------------------------------------------------- /release_changes/202411251654.change.md: -------------------------------------------------------------------------------- 1 | build: Integrate TF-M split-build 2 | -------------------------------------------------------------------------------- /release_changes/202412112209.change.md: -------------------------------------------------------------------------------- 1 | tests: Add FVP version logging 2 | -------------------------------------------------------------------------------- /release_changes/202412161811.change.md: -------------------------------------------------------------------------------- 1 | Update AWS libraries to `202406.01-LTS` 2 | -------------------------------------------------------------------------------- /release_changes/202501081605.change.md: -------------------------------------------------------------------------------- 1 | Modular OTA improvements: Print job metadata and check if new firmware version 2 | higher than previous version 3 | -------------------------------------------------------------------------------- /release_changes/202501231700.change.md: -------------------------------------------------------------------------------- 1 | ubuntu: Adapt to ubuntu v22.04 docker image changes. 2 | -------------------------------------------------------------------------------- /release_changes/202501301446.change.md: -------------------------------------------------------------------------------- 1 | ota-orchestrator: Add multiple enhancements and fixes. 2 | mqtt-agent: Increase MQTT Agent keep alive interval. 3 | -------------------------------------------------------------------------------- /release_changes/202503171512.change.md: -------------------------------------------------------------------------------- 1 | freertos-kernel: Bump to v11.2.0 release. 2 | mbedtls: Bump to v3.6.3 release. 3 | tf-m: Bump to v2.2.0 release. 4 | -------------------------------------------------------------------------------- /release_changes/202503181254.change.md: -------------------------------------------------------------------------------- 1 | run-script: Fix conflicts with DISPLAY system wide variable. 2 | mlek: Switch to public GitLab repo 3 | setuptools: Update to latest version 4 | -------------------------------------------------------------------------------- /release_changes/202503281420.change.md: -------------------------------------------------------------------------------- 1 | toolchains: Add recommended toolchain flags. 2 | -------------------------------------------------------------------------------- /release_changes/202504031422.change.md: -------------------------------------------------------------------------------- 1 | armclang: Fix map file generation. 2 | -------------------------------------------------------------------------------- /release_changes/202505221237.change.md: -------------------------------------------------------------------------------- 1 | armclang-map-file: Only add list option if CMake version greater than 4 2 | license: Exclude new gitlab tmp folder from license check 3 | -------------------------------------------------------------------------------- /tools/ci/gitlint/.gitlint: -------------------------------------------------------------------------------- 1 | # All these sections are optional. Each section with the exception of [general] represents 2 | # one rule and each key in it is an option for that specific rule. 3 | # 4 | # Rules and sections can be referenced by their full name or by id. For example 5 | # section "[body-max-line-length]" could also be written as "[B1]". Full section names are 6 | # used in here for clarity. 7 | # 8 | # For a full list of Gitlint rules please refer to https://jorisroovers.com/gitlint/rules/ 9 | 10 | [general] 11 | 12 | verbosity = 3 13 | 14 | # Enforce Developer’s Certificate of Origin in the commit body 15 | contrib=contrib-body-requires-signed-off-by 16 | 17 | # By default gitlint will ignore merge, revert, fixup and squash commits. 18 | # The following are thus technically not required to be explicitly set 19 | # but are shown for clarity. 20 | ignore-merge-commits=true 21 | ignore-revert-commits=true 22 | ignore-fixup-commits=true 23 | ignore-squash-commits=true 24 | 25 | # Ignore any data send to gitlint via stdin 26 | ignore-stdin=true 27 | 28 | [title-max-length] 29 | line-length=72 30 | 31 | # python-style regex that the commit-msg title must match 32 | # Note that the regex can contradict with other rules if not used correctly 33 | # For the FRI this rule enforces a lowercase alphanumerical prefix followed by a 34 | # ': ', with the actual title then captialized. 35 | [title-match-regex] 36 | regex=^[a-z0-9\-]+: [A-Z]{1} 37 | 38 | [body-max-line-length] 39 | line-length=72 40 | 41 | # Ignore all lines that contain URLs 42 | # Ignore all indented lines, as we require logs to be indented with four spaces 43 | [ignore-body-lines] 44 | regex=(.*(https*://)|(git@))|(^ ) 45 | -------------------------------------------------------------------------------- /tools/ci/hooks/banned_api_list.txt: -------------------------------------------------------------------------------- 1 | strcpy 2 | wcscpy 3 | strncpy 4 | strcat 5 | wcscat 6 | strncat 7 | sprintf 8 | vsprintf 9 | strtok 10 | atoi 11 | atol 12 | atoll 13 | itoa 14 | ltoa 15 | lltoa 16 | -------------------------------------------------------------------------------- /tools/ci/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools>=61", "wheel", "setuptools_scm[toml]>=3.4"] 3 | build-backend = "setuptools.build_meta" 4 | [tool.setuptools_scm] 5 | local_scheme = "no-local-version" 6 | root = "../.." 7 | 8 | [tool.towncrier] 9 | ignore = [".gitkeep"] 10 | directory = "../../release_changes" 11 | filename = "CHANGELOG.md" 12 | template = "towncrier/template.rst" 13 | 14 | [[tool.towncrier.type]] 15 | directory = "change" 16 | name = "Changes" 17 | showcontent = true 18 | 19 | [tool.black] 20 | diff = false 21 | color = true 22 | line-length = 88 23 | -------------------------------------------------------------------------------- /tools/ci/setup.cfg: -------------------------------------------------------------------------------- 1 | # Copyright 2022-2025 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | [metadata] 6 | name = iot-reference-arm-corstone3xx 7 | description = Featured FreeRTOS IoT Integration targeting an Arm Corstone-3xx platform based on Arm Cortex-M MCU. 8 | long_description = file: README.md 9 | long_description_content_type = text/markdown 10 | license = MIT 11 | license_files = ['LICENSE'] 12 | 13 | [options] 14 | packages = find: 15 | 16 | [options.entry_points] 17 | console_scripts = 18 | banned-api-hook = tools.ci.hooks.banned_api:main 19 | 20 | [options.package_data] 21 | * = *.txt 22 | -------------------------------------------------------------------------------- /tools/ci/towncrier/template.rst: -------------------------------------------------------------------------------- 1 | {# Template file used to add sections to the Changelog file #} 2 | # {{ versiondata.version }} ({{ versiondata.date }}) 3 | 4 | {% for section, _ in sections.items() %} 5 | {% if sections[section] %}{% for category, val in definitions.items() if category in sections[section]%}## {{definitions[category]['name']}} 6 | 7 | {% if definitions[category]['showcontent'] %}{% for text, values in sections[section][category].items() %}* {{text}} 8 | {% endfor %} 9 | {% else %} - {{ sections[section][category]['']|join(', ')}} 10 | {% endif %} {% if sections[section][category]|length == 0 %} No significant changes. 11 | {% else %} {% endif %} 12 | {% endfor %} {% else %} No significant changes. 13 | {% endif %} {% endfor %} 14 | -------------------------------------------------------------------------------- /tools/ci/tpip-checker/tpip_checker.md: -------------------------------------------------------------------------------- 1 | # tpip_checker.py 2 | 3 | ## Summary 4 | 5 | This script is designed to run as part of the pre-commit against newly raised 6 | merge requests. 7 | 8 | It's purpose is to look for possible areas in the merge request files that could 9 | affect third party IP (TPIP). 10 | 11 | ## How it works 12 | 13 | The script takes the diff from the merge request and parses it looking for the 14 | following: 15 | 16 | 1. For .gitmodules 17 | a) Any changes 18 | 19 | 2. For src files 20 | a) Search for a URL modification 21 | 22 | The list of designated source file types is not exhaustive and is controlled 23 | by the src_bld_suffixes list in the check_for_url_changes_in_source_files 24 | function. 25 | 26 | ## Output 27 | 28 | If any possible TPIP changes are found then a comment is added to the MR 29 | detailing what the changes are and in what file, (a clickable link to the file 30 | is provided). A warning label is also added to the MR stating that the MR is 31 | not to be merged until all the comments have been checked. 32 | 33 | ## Review process 34 | 35 | As part of the IP review, both the author and the IP reviewer should consider 36 | any comments highlighted by the script and if necessary address them. Once there 37 | are no comments left that need addressing the label can be manually removed. 38 | 39 | Note: if the MR is updated at any time the script will run again and if the 40 | comments have changed the MR comment will be automatically updated. Also if the 41 | label has previously been removed, it will automatically be re-added. 42 | 43 | ## License 44 | 45 | Source code is available under the terms of the MIT License. 46 | -------------------------------------------------------------------------------- /tools/cmake/AddUnitTest.cmake: -------------------------------------------------------------------------------- 1 | # Copyright 2023-2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | if(BUILD_TESTING AND NOT CMAKE_CROSSCOMPILING) 6 | include(GoogleTest) 7 | 8 | function(iot_reference_arm_corstone3xx_add_test target) 9 | target_link_libraries(${target} 10 | PRIVATE 11 | GTest::gtest_main 12 | ) 13 | 14 | target_compile_definitions (${target} 15 | PRIVATE 16 | UNIT_TESTING 17 | ) 18 | 19 | gtest_discover_tests(${target}) 20 | endfunction() 21 | endif() 22 | -------------------------------------------------------------------------------- /tools/plugin/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeRTOS/iot-reference-arm-corstone3xx/0b2f65dcfc62a5f1cddf0e58f73118558165e8fa/tools/plugin/.gitkeep -------------------------------------------------------------------------------- /tools/scripts/container_post_startup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2024 Arm Limited and/or its affiliates 4 | # 5 | # SPDX-License-Identifier: MIT 6 | 7 | # Change the ownership of /workspace to user `ubuntu` 8 | sudo chown -R ubuntu /workspaces 9 | 10 | # Check if the submodules have been initialised 11 | git submodule status | grep -E "\-[0-f]{10}" 12 | ERROR_CODE=$? 13 | if [ $ERROR_CODE == 0 ]; then 14 | git submodule update --init --recursive 15 | fi 16 | 17 | # Install the pre-commit hooks. 18 | rm -rf /tmp/build 19 | pip install . -t /tmp/build 20 | sudo cp /tmp/build/bin/banned-api-hook /usr/local/bin/banned-api-hook 21 | rm -rf iot_reference_arm_corstone3xx.egg-info 22 | pre-commit install 23 | 24 | # Return success 25 | exit 0; 26 | -------------------------------------------------------------------------------- /tools/scripts/run_dependencies_check.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2023 Arm Limited and/or its affiliates 4 | # 5 | # SPDX-License-Identifier: MIT 6 | 7 | python3 tools/scripts/check_listed_dependencies.py 8 | -------------------------------------------------------------------------------- /tools/scripts/run_uncrustify.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2023-2025 Arm Limited and/or its affiliates 4 | # 5 | # SPDX-License-Identifier: MIT 6 | 7 | # Ensure the new line is used to split the output of the `git submodule status` 8 | # command into an array 9 | IFS=$'\n' 10 | 11 | submodules_status=($(git submodule status)) 12 | 13 | exclude_pattern="-E " 14 | for submodule_status in "${submodules_status[@]}" 15 | do 16 | # Ensure the space is used to split the submodule status into an array 17 | IFS=" " 18 | submodule_status_parts=($submodule_status) 19 | submodule_path="${submodule_status_parts[1]}" 20 | exclude_pattern+="${submodule_path} -E " 21 | done 22 | exclude_pattern+="./build" 23 | 24 | fdfind -E $exclude_pattern -e c -e h -e cc -e cpp --exec uncrustify --no-backup --replace --if-changed -c tools/uncrustify.cfg 25 | # Uncrustify has a known problem where it does not keep track of braces that span multiple preprocessor blocks and therefore will 26 | # abort and complain about missing braces in code leading to returning an error which is not correct. We use git diff to check if 27 | # any files are changed after uncrustify runs, where this will return `1` (error) if any files were altered by uncrustify or `0` 28 | # otherwise. 29 | git diff --exit-code 30 | -------------------------------------------------------------------------------- /tools/scripts/setup_python_vsi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2024 Arm Limited and/or its affiliates 4 | # 5 | # SPDX-License-Identifier: MIT 6 | 7 | sudo apt-get -y update 8 | sudo apt-get -y install make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev liblzma-dev tk-dev 9 | mkdir /tmp/python_vsi_setup 10 | cd /tmp/python_vsi_setup 11 | wget https://www.python.org/ftp/python/3.9.18/Python-3.9.18.tgz 12 | tar xzf Python-3.9.18.tgz 13 | cd Python-3.9.18 14 | ./configure --prefix=/opt/python/3.9.18/ --enable-optimizations 15 | make -j "$(nproc)" 16 | sudo make altinstall 17 | sudo rm -rf /tmp/python_vsi_setup 18 | --------------------------------------------------------------------------------