Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Flipper-Zero/STM32CubeWB.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Labbene <ali.labbene@st.com>2019-10-18 17:55:06 +0300
committerAli Labbene <ali.labbene@st.com>2019-10-18 18:30:07 +0300
commit96abbb67db97bc53e38f9727adfae0e5c70b1498 (patch)
treedb8259483a5e5dcf22a1211c0f8ddbced96c0966
parentdb4dcc4bd418051b425a06dd7d471e3eb3ff4d67 (diff)
Release v1.3.0v1.3.0
-rw-r--r--Documentation/STM32CubeWBGettingStarted.pdfbin577141 -> 588649 bytes
-rw-r--r--Drivers/CMSIS/Device/ST/STM32WBxx/Include/stm32wb50xx.h13
-rw-r--r--Drivers/CMSIS/Device/ST/STM32WBxx/Include/stm32wb55xx.h13
-rw-r--r--Drivers/CMSIS/Device/ST/STM32WBxx/Include/stm32wbxx.h2
-rw-r--r--Drivers/CMSIS/Device/ST/STM32WBxx/Release_Notes.html48
-rw-r--r--Drivers/CMSIS/Device/ST/STM32WBxx/Source/Templates/gcc/linker/stm32wb50xx_flash_cm4.ld2
-rw-r--r--Drivers/CMSIS/Device/ST/STM32WBxx/Source/Templates/gcc/linker/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Drivers/CMSIS/Device/ST/STM32WBxx/Source/Templates/gcc/startup_stm32wb50xx_cm4.s64
-rw-r--r--Drivers/CMSIS/Device/ST/STM32WBxx/Source/Templates/gcc/startup_stm32wb55xx_cm4.s64
-rw-r--r--Drivers/STM32WBxx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h52
-rw-r--r--Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_cryp.h8
-rw-r--r--Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_dma.h2
-rw-r--r--Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_flash.h158
-rw-r--r--Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_gpio_ex.h7
-rw-r--r--Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_rcc.h10
-rw-r--r--Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_rcc_ex.h12
-rw-r--r--Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_tim.h16
-rw-r--r--Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_wwdg.h9
-rw-r--r--Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_ll_pwr.h23
-rw-r--r--Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_ll_rcc.h32
-rw-r--r--Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_ll_system.h4
-rw-r--r--Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_ll_tim.h19
-rw-r--r--Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_ll_utils.h112
-rw-r--r--Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_ll_wwdg.h6
-rw-r--r--Drivers/STM32WBxx_HAL_Driver/Release_Notes.html96
-rw-r--r--Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal.c6
-rw-r--r--Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_cryp.c223
-rw-r--r--Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_flash.c19
-rw-r--r--Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_irda.c42
-rw-r--r--Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pwr.c2
-rw-r--r--Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pwr_ex.c11
-rw-r--r--Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_smartcard.c2
-rw-r--r--Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_tim.c4
-rw-r--r--Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_tim_ex.c19
-rw-r--r--Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_uart.c8
-rw-r--r--Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_usart.c77
-rw-r--r--Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_wwdg.c32
-rw-r--r--Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_ll_utils.c108
-rw-r--r--License.md4
-rw-r--r--Middlewares/ST/STM32_WPAN/Release_Notes.html47
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/ble.h1
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/ble_common.h3
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/core/auto/ble_events.c68
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/core/auto/ble_events.h68
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/core/auto/ble_gap_aci.h18
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/core/ble_bufsize.h2
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/core/ble_defs.h9
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/core/ble_legacy.h9
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/core/ble_std.h10
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/core/doc/STM32WB_BLE_Wireless_Interface.html468
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/mesh/Inc/appli_test.h70
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/mesh/Inc/ble_mesh.h212
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/mesh/Inc/pal_nvm.h30
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/mesh/Inc/serial_if.h1
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/mesh/Library/libBle_Mesh_CM4_GCC.abin318204 -> 263996 bytes
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/mesh/Library/libBle_Mesh_CM4_IAR.abin427030 -> 446102 bytes
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/mesh/Library/libBle_Mesh_CM4_Keil.libbin457530 -> 478558 bytes
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/blob.h258
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/common.h32
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/generic.h233
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/light.h140
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/light_lc.h316
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/meshdfu_node.h205
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/sensors.h47
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/vendor.h44
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/blob.c516
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/common.c253
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/generic.c558
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/light.c737
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/light_lc.c1497
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/meshdfu_node.c207
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/sensors.c115
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/vendor.c326
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/mesh/PAL/STM32WB/pal_nvm.c65
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/mesh/Src/appli_test.c392
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/mesh/Src/mesh_cfg.c26
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/mesh/Src/serial_ctrl.c184
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/mesh/Src/serial_if.c333
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/svc/Inc/bvopus_service_stm.h201
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/svc/Inc/motenv_stm.h168
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/svc/Inc/opus_interface_stm.h212
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/svc/Inc/svc_ctl.h13
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/svc/Src/bvopus_service_stm.c818
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/svc/Src/mesh.c20
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/svc/Src/motenv_stm.c950
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/svc/Src/opus_interface_stm.c374
-rw-r--r--Middlewares/ST/STM32_WPAN/ble/svc/Src/svc_ctl.c24
-rw-r--r--Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/hw.h247
-rw-r--r--Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci/shci.c20
-rw-r--r--Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci/shci.h18
-rw-r--r--Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/hci_tl.c18
-rw-r--r--Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/hci_tl.h4
-rw-r--r--Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/mbox_def.h13
-rw-r--r--Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/shci_tl.c22
-rw-r--r--Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl.h23
-rw-r--r--Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_mbox.c96
-rw-r--r--Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_thread_hci.c14
-rw-r--r--Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_thread_hci.h3
-rw-r--r--Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_zigbee_hci.c3
-rw-r--r--Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_zigbee_hci.h2
-rw-r--r--Middlewares/ST/STM32_WPAN/mac_802_15_4/core/inc/802_15_4_mac_types.h2
-rw-r--r--Middlewares/ST/STM32_WPAN/stm32_wpan_common.h1
-rw-r--r--Middlewares/ST/STM32_WPAN/utilities/dbg_trace.h2
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/core/inc/stm32wbxx_core_interface_def.h350
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/core/inc/zigbee_config.h24
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/core/inc/zigbee_core.h48
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/core/inc/zigbee_errors.h23
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/core/inc/zigbee_interface.h43
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/core/inc/zigbee_types.h27
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/core/src/zigbee_core_wb.c4284
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/lib/stm32wb_zigbee_wb_lib.abin0 -> 731540 bytes
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/platform/flash_emulation.c78
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/platform/flash_emulation.h48
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/stack/include/M4/local.zigbee.h84
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/endian.h15
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/ieee802154.api.h1046
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/ieee802154.h335
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/llist.h104
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/mcp.h1653
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/mcp_enums.h437
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/pletoh.h61
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/readme.txt9
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/stack/include/zcl/key/zcl.cbke.h103
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/stack/include/zcl/key/zcl.key.h72
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/stack/include/zcl/zcl.h1292
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/stack/include/zcl/zcl.identify.h93
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/stack/include/zcl/zcl.onoff.h108
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/stack/include/zcl/zcl.touchlink.h125
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.aps.h892
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.bdb.h185
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.h621
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.nwk.h818
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.security.h334
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.startup.h196
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.zdo.h836
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.zgp.h243
-rw-r--r--Middlewares/ST/STM32_WPAN/zigbee/stack/zcl/local_zcl.h209
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/BLE_Beacon.ioc69
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Inc/app_common.h6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Inc/app_conf.h48
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Inc/stm32_lpm_if.h42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Inc/stm32wbxx_hal_conf.h9
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Inc/utilities_conf.h10
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/app_entry.c10
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/hw_timerserver.c42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/hw_uart.c137
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/main.c97
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/stm32wbxx_hal_msp.c44
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/stm32wbxx_it.c11
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/app_ble.c8
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/ble_conf.h10
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/ble_dbg_conf.h8
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/eddystone_tlm_service.c12
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/eddystone_tlm_service.h8
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/eddystone_uid_service.c12
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/eddystone_uid_service.h12
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/eddystone_url_service.c12
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/eddystone_url_service.h8
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/ibeacon.h7
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/BLE_BloodPressure.ioc69
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Inc/app_common.h6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Inc/app_conf.h46
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Inc/stm32_lpm_if.h42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Inc/stm32wbxx_hal_conf.h9
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Inc/utilities_conf.h10
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/app_entry.c9
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/hw_timerserver.c42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/hw_uart.c136
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/main.c97
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/stm32wbxx_hal_msp.c44
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/stm32wbxx_it.c11
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/STM32_WPAN/App/app_ble.c73
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/STM32_WPAN/App/ble_conf.h8
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/STM32_WPAN/App/ble_dbg_conf.h6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Inc/app_conf.h14
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Inc/stm32_lpm_if.h42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Inc/stm32wbxx_hal_conf.h4
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Inc/utilities_conf.h10
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Src/app_entry.c4
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Src/hw_timerserver.c42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Src/hw_uart.c2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Src/main.c65
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/STM32_WPAN/App/app_ble.c6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/STM32_WPAN/App/ble_conf.h2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/SW4STM32/Production/.cproject4
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/app_conf.h110
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/hw_conf.h2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/stm32_lpm_if.h42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/stm32wbxx_hal_conf.h4
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/stm32wbxx_it.h13
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/utilities_conf.h10
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Src/app_entry.c14
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Src/hw_timerserver.c42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Src/hw_uart.c2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Src/main.c65
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/EWARM/BLE_DataThroughput.ewp31
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/app_ble.c690
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/app_ble.h11
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/ble_conf.h19
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/ble_dbg_conf.h7
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/dt_client_app.c748
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/dt_client_app.h174
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/dt_server_app.c231
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/dt_server_app.h6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/dts.c18
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/dts.h15
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/SW4STM32/Production/.cproject2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/SW4STM32/Production/.project16
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/readme.txt7
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/BLE_HealthThermometer.ioc69
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Inc/app_common.h6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Inc/app_conf.h41
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Inc/stm32_lpm_if.h42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Inc/stm32wbxx_hal_conf.h9
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Inc/utilities_conf.h10
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/app_entry.c9
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/hw_timerserver.c42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/hw_uart.c136
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/main.c97
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/stm32wbxx_hal_msp.c44
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/stm32wbxx_it.c11
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/STM32_WPAN/App/app_ble.c35
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/STM32_WPAN/App/ble_conf.h8
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/STM32_WPAN/App/ble_dbg_conf.h6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/BLE_HeartRate.ioc86
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Binary/BLE_HeartRate_reference.hex2047
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Inc/app_common.h6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Inc/app_conf.h49
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Inc/stm32_lpm_if.h42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Inc/stm32wbxx_hal_conf.h9
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Inc/utilities_conf.h10
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/app_entry.c9
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/hw_timerserver.c42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/hw_uart.c136
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/main.c114
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/stm32wbxx_hal_msp.c44
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/stm32wbxx_it.c11
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/STM32_WPAN/App/app_ble.c65
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/STM32_WPAN/App/ble_conf.h8
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/STM32_WPAN/App/ble_dbg_conf.h6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/STM32_WPAN/App/hrs_app.c2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/BLE_HeartRateFreeRTOS.ioc59
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Inc/FreeRTOSConfig.h45
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Inc/app_common.h6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Inc/app_conf.h72
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Inc/stm32_lpm_if.h42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Inc/utilities_conf.h10
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/app_entry.c36
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/freertos_port.c4
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/hw_timerserver.c42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/hw_uart.c136
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/main.c106
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/stm32_lpm_if.c9
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/stm32wbxx_hal_msp.c45
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/stm32wbxx_it.c16
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/STM32_WPAN/App/app_ble.c78
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/STM32_WPAN/App/ble_conf.h6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/STM32_WPAN/App/ble_dbg_conf.h6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/STM32_WPAN/App/hrs_app.c3
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/SW4STM32/Production/.cproject2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Binary/BLE_HeartRate_ota_reference.binbin16276 -> 16512 bytes
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Inc/app_common.h6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Inc/app_conf.h42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Inc/stm32_lpm_if.h42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Inc/stm32wbxx_hal_conf.h9
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Inc/utilities_conf.h10
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/app_entry.c9
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/hw_timerserver.c42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/hw_uart.c136
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/main.c126
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/stm32wbxx_hal_msp.c44
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/stm32wbxx_it.c11
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/MDK-ARM/BLE_HeartRate_ota.uvprojx8
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/MDK-ARM/stm32wb55xx_flash_cm4.sct19
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/STM32_WPAN/App/app_ble.c6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/STM32_WPAN/App/ble_conf.h8
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/STM32_WPAN/App/ble_dbg_conf.h6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/STM32_WPAN/App/hrs_app.c2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Inc/app_conf.h32
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Inc/stm32_lpm_if.h42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Inc/stm32wbxx_hal_conf.h4
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Inc/utilities_conf.h10
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Src/app_entry.c5
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Src/hw_timerserver.c42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Src/hw_uart.c2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Src/main.c65
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Src/stm32wbxx_it.c1
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/MDK-ARM/BLE_Hid.uvoptx838
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/MDK-ARM/BLE_Hid.uvprojx196
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/STM32_WPAN/App/app_ble.c18
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/STM32_WPAN/App/ble_conf.h2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/SW4STM32/Production/.cproject2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/app_conf.h26
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/stm32_lpm_if.h42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/stm32wbxx_hal_conf.h4
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/stm32wbxx_it.h4
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/utilities_conf.h10
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Src/app_entry.c30
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Src/hw_timerserver.c42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Src/main.c85
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Src/stm32wbxx_it.c44
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/EWARM/BLE_MeshLightingDemo.ewp35
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/EWARM/stm32wb55xx_flash_cm4.icf22
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/MDK-ARM/BLE_MeshLightingDemo.uvoptx252
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/MDK-ARM/BLE_MeshLightingDemo.uvprojx104
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/MDK-ARM/stm32wb55xx_flash_cm4.sct1
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_config.c109
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_config.h144
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_handlers.c297
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_handlers.h35
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_generic.c230
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_generic.h39
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light.c570
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light.h95
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light_lc.c188
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light_lc.h92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_mesh.c528
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_mesh.h16
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_nvm.c667
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_nvm.h11
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_sensor.c222
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_sensor.h59
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_vendor.c158
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_vendor.h9
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/ble_conf.h2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/hal_common.h2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/mesh_cfg.h76
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/mesh_cfg_usr.h392
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/models_if.c144
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/models_if.h2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/pal_nvm.c487
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/Production/.cproject112
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/Production/.project45
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/Production/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/readme.txt15
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/app_common.h114
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/app_conf.h636
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/app_entry.h69
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/hw_conf.h220
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/main.h71
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/stm32_lpm_if.h81
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/stm32wbxx_hal_conf.h354
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/stm32wbxx_it.h77
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/utilities_conf.h68
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/app_entry.c419
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/hw_timerserver.c893
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/hw_uart.c318
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/main.c638
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/stm32_lpm_if.c275
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/stm32wbxx_hal_msp.c318
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/stm32wbxx_it.c293
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/system_stm32wbxx.c353
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/EWARM/ble_multi_app_at.ewd1419
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/EWARM/ble_multi_app_at.ewp1280
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/EWARM/ble_multi_app_at.eww7
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/EWARM/startup_stm32wb55xx_cm4.s517
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/EWARM/stm32wb55xx_flash_cm4.icf40
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/MDK-ARM/ble_multi_app_at.uvoptx1013
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/MDK-ARM/ble_multi_app_at.uvprojx756
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/MDK-ARM/startup_stm32wb55xx_cm4.s368
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/MDK-ARM/stm32wb55xx_flash_cm4.sct21
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_cl.c1142
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_cl.h79
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_common.c117
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_common.h68
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_hr.c1054
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_hr.h81
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_sv.c1271
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_sv.h82
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/ble_conf.h106
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/ble_dbg_conf.h199
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/dis_app.c221
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/dis_app.h77
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/hrs_app.c235
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/hrs_app.h81
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/p2p_client_app.c806
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/p2p_client_app.h86
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/p2p_server_app.c402
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/p2p_server_app.h82
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/uart_app.c521
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/uart_app.h59
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/Target/hw_ipcc.c517
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/SW4STM32/BLE_MultiAppAt/.cproject201
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/SW4STM32/BLE_MultiAppAt/.project349
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/SW4STM32/BLE_MultiAppAt/stm32wb55xx_flash_cm4.ld187
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/SW4STM32/startup_stm32wb55xx_cm4.s427
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/SW4STM32/syscalls.c204
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/readme.txt138
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Binary/BLE_Ota_reference.hex2177
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Inc/app_conf.h18
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Inc/stm32_lpm_if.h42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Inc/stm32wbxx_hal_conf.h4
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Inc/utilities_conf.h10
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Src/app_debug.c71
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Src/app_entry.c4
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Src/hw_timerserver.c42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Src/hw_uart.c2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Src/main.c65
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/STM32_WPAN/App/ble_conf.h2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/SW4STM32/Production/.cproject27
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Inc/app_conf.h18
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Inc/stm32_lpm_if.h42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Inc/stm32wbxx_hal_conf.h4
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Inc/utilities_conf.h10
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Src/app_entry.c4
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Src/hw_timerserver.c42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Src/hw_uart.c2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Src/main.c65
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/STM32_WPAN/App/app_ble.c6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/STM32_WPAN/App/ble_conf.h2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/SW4STM32/Production/.cproject2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/SW4STM32/Production/.project16
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/BLE_TransparentMode.ioc76
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Binary/BLE_TransparentMode_reference.hex2259
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Inc/app_common.h6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Inc/app_conf.h39
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Inc/stm32_lpm_if.h42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Inc/stm32wbxx_hal_conf.h9
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Inc/utilities_conf.h10
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/app_entry.c6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/hw_timerserver.c42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/hw_uart.c136
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/main.c97
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/stm32_lpm_if.c15
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/stm32wbxx_hal_msp.c48
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/stm32wbxx_it.c11
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/STM32_WPAN/App/ble_conf.h8
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/STM32_WPAN/App/ble_dbg_conf.h6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/STM32_WPAN/App/tm.c2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/BLE_p2pClient.ioc69
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Binary/BLE_p2pClient_reference.hex3967
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Inc/app_common.h6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Inc/app_conf.h49
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Inc/stm32_lpm_if.h42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Inc/stm32wbxx_hal_conf.h9
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Inc/utilities_conf.h10
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/app_entry.c9
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/hw_timerserver.c42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/hw_uart.c136
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/main.c97
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/stm32wbxx_hal_msp.c44
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/stm32wbxx_it.c11
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/STM32_WPAN/App/app_ble.c47
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/STM32_WPAN/App/ble_conf.h8
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/STM32_WPAN/App/ble_dbg_conf.h6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/STM32_WPAN/App/p2p_client_app.c3
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/BLE_p2pRouteur.ioc69
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Inc/app_common.h6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Inc/app_conf.h50
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Inc/stm32_lpm_if.h42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Inc/stm32wbxx_hal_conf.h9
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Inc/utilities_conf.h10
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/app_entry.c9
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/hw_timerserver.c42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/hw_uart.c136
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/main.c97
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/stm32wbxx_hal_msp.c44
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/stm32wbxx_it.c11
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/STM32_WPAN/App/app_ble.c41
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/STM32_WPAN/App/ble_conf.h8
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/STM32_WPAN/App/ble_dbg_conf.h6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/STM32_WPAN/App/p2p_routeur_app.c2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/BLE_p2pServer.ioc70
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Binary/BLE_p2pServer_reference.hex4107
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Inc/app_common.h6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Inc/app_conf.h46
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Inc/stm32_lpm_if.h42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Inc/stm32wbxx_hal_conf.h9
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Inc/utilities_conf.h10
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/app_entry.c9
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/hw_timerserver.c42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/hw_uart.c136
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/main.c97
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/stm32wbxx_hal_msp.c44
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/stm32wbxx_it.c11
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/STM32_WPAN/App/app_ble.c99
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/STM32_WPAN/App/ble_conf.h6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/STM32_WPAN/App/ble_dbg_conf.h6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Binary/BLE_p2pServer_ota_reference.binbin32048 -> 33120 bytes
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Inc/app_common.h6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Inc/app_conf.h36
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Inc/stm32_lpm_if.h42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Inc/stm32wbxx_hal_conf.h9
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Inc/utilities_conf.h10
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/app_entry.c9
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/hw_timerserver.c42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/hw_uart.c136
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/main.c97
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/stm32wbxx_hal_msp.c44
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/stm32wbxx_it.c11
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/MDK-ARM/BLE_p2pServer_ota.uvoptx124
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/MDK-ARM/BLE_p2pServer_ota.uvprojx10
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/STM32_WPAN/App/app_ble.c148
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/STM32_WPAN/App/ble_conf.h6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/STM32_WPAN/App/ble_dbg_conf.h6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Inc/app_conf.h31
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Inc/stm32_lpm_if.h42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Inc/stm32wbxx_hal_conf.h4
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Inc/utilities_conf.h10
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Src/app_entry.c3
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Src/hw_timerserver.c36
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Src/hw_uart.c427
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Src/main.c51
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/STM32_WPAN/App/app_ble.c12
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/STM32_WPAN/App/ble_conf.h6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/STM32_WPAN/App/ble_dbg_conf.h6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/SW4STM32/no_ota/.cproject26
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/CKS/CKS_Crypt/Core/Inc/app_conf.h7
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/CKS/CKS_Crypt/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/CKS/CKS_Crypt/Core/Inc/utilities_conf.h22
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/CKS/CKS_Crypt/Core/Src/main.c6
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/FatFs/FatFs_uSD_Standalone/SW4STM32/FatFs_uSD_Standalone/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/FatFs/FatFs_uSD_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Mail/SW4STM32/FreeRTOS_Mail/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Mail/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Mutexes/SW4STM32/FreeRTOS_Mutexes/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Mutexes/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Queues/SW4STM32/FreeRTOS_Queues/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Queues/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Semaphore/SW4STM32/FreeRTOS_Semaphore/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Semaphore/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_SemaphoreFromISR/SW4STM32/FreeRTOS_SemaphoreFromISR/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_SemaphoreFromISR/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Signal/SW4STM32/FreeRTOS_Signal/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Signal/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_SignalFromISR/SW4STM32/FreeRTOS_SignalFromISR/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_SignalFromISR/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_ThreadCreation/SW4STM32/FreeRTOS_ThreadCreation/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_ThreadCreation/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Timers/SW4STM32/FreeRTOS_Timers/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Timers/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Inc/app_conf.h1
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Inc/stm32_lpm_if.h42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Inc/stm32wbxx_hal_conf.h4
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Inc/utilities_conf.h10
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Src/main.c12
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/EWARM/Mac_802_15_4_FFD_Demo.ewd2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/STM32_WPAN/App/app_ffd_mac_802_15_4.c24
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/STM32_WPAN/App/app_ffd_mac_802_15_4_process.c41
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Inc/app_conf.h1
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Inc/stm32_lpm_if.h42
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Inc/stm32wbxx_hal_conf.h4
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Inc/utilities_conf.h10
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Src/main.c12
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/EWARM/Mac_802_15_4_RFD_Demo.ewd2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/STM32_WPAN/App/app_rfd_mac_802_15_4.c49
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/STM32_WPAN/App/app_rfd_mac_802_15_4_process.c1
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Inc/app_conf.h1
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Inc/stm32_lpm_if.h34
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Inc/stm32wbxx_it.h2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Inc/utilities_conf.h8
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Src/hw_uart.c136
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Src/main.c81
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Src/stm32wbxx_hal_msp.c2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/STM32_WPAN/App/app_thread.c30
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Thread_Cli_Cmd.ioc50
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/app_conf.h16
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/stm32_lpm_if.h34
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/stm32wbxx_it.h2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/utilities_conf.h8
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/hw_timerserver.c36
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/hw_uart.c136
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/main.c81
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/stm32wbxx_hal_msp.c2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/STM32_WPAN/App/app_thread.c115
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Thread_Coap_DataTransfer.ioc50
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Inc/app_conf.h1
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Inc/stm32_lpm_if.h34
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Inc/stm32wbxx_it.h2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Inc/utilities_conf.h8
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Src/hw_timerserver.c36
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Src/hw_uart.c136
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Src/main.c81
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Src/stm32wbxx_hal_msp.c2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/STM32_WPAN/App/app_thread.c97
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Thread_Coap_Generic.ioc50
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/app_common.h113
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/app_conf.h370
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/app_entry.h68
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/hw_conf.h219
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/main.h71
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/stm32_lpm_if.h81
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/stm32wbxx_hal_conf.h353
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/stm32wbxx_it.h83
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/stm_logging.h59
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/utilities_conf.h68
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/app_entry.c449
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/hw_timerserver.c893
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/hw_uart.c318
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/main.c618
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/stm32_lpm_if.c275
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/stm32wbxx_hal_msp.c334
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/stm32wbxx_it.c382
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/stm_logging.c215
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/system_stm32wbxx.c352
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/EWARM/Project.eww7
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/EWARM/Thread_Coap_Generic_Ota.ewd1419
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/EWARM/Thread_Coap_Generic_Ota.ewp1304
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/EWARM/startup_stm32wb55xx_cm4.s517
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/EWARM/stm32wb55xx_flash_cm4_ota.icf44
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/STM32_WPAN/App/app_thread.c1171
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/STM32_WPAN/App/app_thread.h129
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/STM32_WPAN/Target/hw_ipcc.c517
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/readme.txt175
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Inc/app_conf.h1
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Inc/stm32_lpm_if.h34
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Inc/stm32wbxx_it.h2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Inc/utilities_conf.h8
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Src/hw_timerserver.c36
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Src/hw_uart.c136
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Src/main.c81
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Src/stm32wbxx_hal_msp.c2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/STM32_WPAN/App/app_thread.c104
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Thread_Coap_Multiboard.ioc50
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Inc/app_conf.h1
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Inc/stm32_lpm_if.h34
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Inc/stm32wbxx_it.h2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Inc/utilities_conf.h8
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Src/hw_timerserver.c36
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Src/hw_uart.c136
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Src/main.c81
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Src/stm32wbxx_hal_msp.c2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/STM32_WPAN/App/app_thread.c37
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Thread_Commissioning.ioc50
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/app_conf.h1
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/stm32_lpm_if.h34
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/stm32wbxx_it.h2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/utilities_conf.h8
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/hw_timerserver.c36
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/hw_uart.c136
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/main.c81
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/stm32wbxx_hal_msp.c2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/STM32_WPAN/App/app_thread.c99
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Thread_FTD_Coap_Multicast.ioc50
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/app_common.h113
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/app_conf.h375
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/app_entry.h68
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/hw_conf.h219
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/main.h71
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/stm32_lpm_if.h81
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/stm32wbxx_hal_conf.h353
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/stm32wbxx_it.h83
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/stm_logging.h59
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/utilities_conf.h68
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/app_entry.c555
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/hw_timerserver.c893
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/hw_uart.c318
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/main.c618
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/stm32_lpm_if.c275
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/stm32wbxx_hal_msp.c334
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/stm32wbxx_it.c382
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/stm_logging.c215
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/system_stm32wbxx.c534
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/EWARM/Project.eww7
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/EWARM/Thread_Ota.ewd1419
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/EWARM/Thread_Ota.ewp1304
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/EWARM/startup_stm32wb55xx_cm4.s517
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/EWARM/stm32wb55xx_flash_cm4.icf40
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/EWARM/stm32wb55xx_sram_cm4.icf39
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/STM32_WPAN/App/app_thread.c1314
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/STM32_WPAN/App/app_thread.h154
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/STM32_WPAN/Target/hw_ipcc.c517
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/readme.txt228
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/app_common.h113
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/app_conf.h388
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/app_entry.h68
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/hw_conf.h219
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/main.h71
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/stm32_lpm_if.h81
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/stm32wbxx_hal_conf.h353
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/stm32wbxx_it.h85
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/stm_logging.h59
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/utilities_conf.h68
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/app_entry.c448
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/hw_timerserver.c893
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/hw_uart.c318
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/main.c618
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/stm32_lpm_if.c275
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/stm32wbxx_hal_msp.c334
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/stm32wbxx_it.c403
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/stm_logging.c215
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/system_stm32wbxx.c353
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/EWARM/Project.eww7
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/EWARM/Thread_Ota_Server.ewd1419
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/EWARM/Thread_Ota_Server.ewp1304
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/EWARM/startup_stm32wb55xx_cm4.s517
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/EWARM/stm32wb55xx_flash_cm4.icf40
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/EWARM/stm32wb55xx_sram_cm4.icf39
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/STM32_WPAN/App/app_thread.c1473
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/STM32_WPAN/App/app_thread.h152
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/STM32_WPAN/Target/hw_ipcc.c517
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/readme.txt228
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Inc/app_conf.h1
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Inc/stm32_lpm_if.h34
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Inc/stm32wbxx_it.h2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Inc/utilities_conf.h8
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Src/hw_timerserver.c36
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Src/hw_uart.c136
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Src/main.c79
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Src/stm32_lpm_if.c9
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Src/stm32wbxx_hal_msp.c14
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/STM32_WPAN/App/app_thread.c75
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Thread_SED_Coap_FreeRTOS.ioc53
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/app_conf.h7
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/hw_conf.h8
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/stm32_lpm_if.h34
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/stm32wbxx_it.h2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/utilities_conf.h8
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/hw_timerserver.c36
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/hw_uart.c136
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/main.c81
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/stm32wbxx_hal_msp.c14
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/STM32_WPAN/App/app_thread.c111
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Thread_SED_Coap_Multicast.ioc56
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/CDC_Standalone/SW4STM32/CDC_Standalone/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/CDC_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/DFU_Standalone/SW4STM32/DFU_Standalone/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/DFU_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/HID_Standalone/SW4STM32/HID_Standalone/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/HID_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/MSC_Standalone/SW4STM32/MSC_Standalone/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/MSC_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/app_common.h114
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/app_conf.h347
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/app_entry.h68
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/hw_conf.h219
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/main.h71
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/stm32_lpm_if.h81
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/stm32wbxx_hal_conf.h353
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/stm32wbxx_it.h83
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/stm_logging.h55
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/utilities_conf.h68
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/app_entry.c396
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/hw_timerserver.c893
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/hw_uart.c318
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/main.c521
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/stm32_lpm_if.c275
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/stm32wbxx_hal_msp.c334
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/stm32wbxx_it.c411
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/stm_logging.c205
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/system_stm32wbxx.c353
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/EWARM/Project.eww7
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/EWARM/Zigbee_OnOff_Coord.ewd1419
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/EWARM/Zigbee_OnOff_Coord.ewp1264
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/EWARM/startup_stm32wb55xx_cm4.s517
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/EWARM/stm32wb55xx_flash_cm4.icf47
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/STM32_WPAN/App/app_zigbee.c317
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/STM32_WPAN/App/app_zigbee.h61
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/STM32_WPAN/App/app_zigbee_demo.c393
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/STM32_WPAN/App/app_zigbee_demo_complete.c506
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/STM32_WPAN/Target/hw_ipcc.c491
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/readme.txt138
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/app_common.h114
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/app_conf.h347
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/app_entry.h68
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/hw_conf.h219
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/main.h71
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/stm32_lpm_if.h81
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/stm32wbxx_hal_conf.h353
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/stm32wbxx_it.h83
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/stm_logging.h55
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/utilities_conf.h68
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/app_entry.c396
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/hw_timerserver.c893
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/hw_uart.c318
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/main.c521
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/stm32_lpm_if.c275
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/stm32wbxx_hal_msp.c334
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/stm32wbxx_it.c411
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/stm_logging.c205
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/system_stm32wbxx.c353
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/EWARM/Project.eww7
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/EWARM/Zigbee_OnOff_Distrib.ewd1419
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/EWARM/Zigbee_OnOff_Distrib.ewp1264
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/EWARM/startup_stm32wb55xx_cm4.s517
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/EWARM/stm32wb55xx_flash_cm4.icf47
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/STM32_WPAN/App/app_zigbee.c317
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/STM32_WPAN/App/app_zigbee.h61
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/STM32_WPAN/App/app_zigbee_demo.c396
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/STM32_WPAN/Target/hw_ipcc.c491
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/readme.txt135
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/app_common.h114
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/app_conf.h347
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/app_entry.h68
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/hw_conf.h219
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/main.h71
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/stm32_lpm_if.h81
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/stm32wbxx_hal_conf.h353
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/stm32wbxx_it.h83
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/stm_logging.h55
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/utilities_conf.h68
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/app_entry.c396
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/hw_timerserver.c893
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/hw_uart.c318
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/main.c521
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/stm32_lpm_if.c275
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/stm32wbxx_hal_msp.c334
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/stm32wbxx_it.c411
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/stm_logging.c205
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/system_stm32wbxx.c353
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/EWARM/Project.eww7
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/EWARM/Zigbee_OnOff_Router.ewd1419
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/EWARM/Zigbee_OnOff_Router.ewp1264
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/EWARM/startup_stm32wb55xx_cm4.s517
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/EWARM/stm32wb55xx_flash_cm4.icf47
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/STM32_WPAN/App/app_zigbee.c317
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/STM32_WPAN/App/app_zigbee.h61
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/STM32_WPAN/App/app_zigbee_demo.c402
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/STM32_WPAN/Target/hw_ipcc.c491
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/readme.txt138
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Demonstrations/Adafruit_LCD_1_8_SD_Joystick/SW4STM32/Adafruit_LCD_1_8_SD_Joystick/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Demonstrations/Adafruit_LCD_1_8_SD_Joystick/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_AnalogWatchdog/SW4STM32/ADC_AnalogWatchdog/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_AnalogWatchdog/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_MultiChannelSingleConversion/SW4STM32/ADC_MultiChannelSingleConversion/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_MultiChannelSingleConversion/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_Oversampling/SW4STM32/ADC_Oversampling/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_Oversampling/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_SingleConversion_TriggerSW_IT/SW4STM32/ADC_SingleConversion_TriggerSW_IT/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_SingleConversion_TriggerSW_IT/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_SingleConversion_TriggerTimer_DMA/SW4STM32/ADC_SingleConversion_TriggerTimer_DMA/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_SingleConversion_TriggerTimer_DMA/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/BSP/BSP_Example/SW4STM32/BSP_Example/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/BSP/BSP_Example/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/COMP/COMP_CompareGpioVsVrefInt_IT/SW4STM32/COMP_CompareGpioVsVrefInt_IT/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/COMP/COMP_CompareGpioVsVrefInt_IT/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/COMP/COMP_CompareGpioVsVrefInt_Window_IT/SW4STM32/COMP_CompareGpioVsVrefInt_Window_IT/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/COMP/COMP_CompareGpioVsVrefInt_Window_IT/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/CRC/CRC_Example/SW4STM32/CRC_Example/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/CRC/CRC_Example/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/CRC/CRC_UserDefinedPolynomial/SW4STM32/CRC_UserDefinedPolynomial/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/CRC/CRC_UserDefinedPolynomial/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/CRYP/CRYP_AESModes/SW4STM32/CRYP_AESModes/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/CRYP/CRYP_AESModes/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/CRYP/CRYP_DMA/SW4STM32/CRYP_DMA/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/CRYP/CRYP_DMA/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/Cortex/CORTEXM_MPU/SW4STM32/CORTEXM_MPU/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/Cortex/CORTEXM_MPU/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/Cortex/CORTEXM_ModePrivilege/SW4STM32/CORTEXM_ModePrivilege/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/Cortex/CORTEXM_ModePrivilege/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/Cortex/CORTEXM_SysTick/SW4STM32/CORTEXM_SysTick/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/Cortex/CORTEXM_SysTick/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/DMA/DMA_FLASHToRAM/SW4STM32/DMA_FLASHToRAM/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/DMA/DMA_FLASHToRAM/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/DMA/DMA_MUXSYNC/SW4STM32/DMA_MUXSYNC/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/DMA/DMA_MUXSYNC/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/DMA/DMA_MUX_RequestGen/SW4STM32/DMA_MUX_RequestGen/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/DMA/DMA_MUX_RequestGen/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/FLASH/FLASH_EraseProgram/SW4STM32/FLASH_EraseProgram/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/FLASH/FLASH_EraseProgram/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/FLASH/FLASH_WriteProtection/SW4STM32/FLASH_WriteProtection/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/FLASH/FLASH_WriteProtection/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/GPIO/GPIO_EXTI/SW4STM32/GPIO_EXTI/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/GPIO/GPIO_EXTI/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/GPIO/GPIO_IOToggle/SW4STM32/GPIO_IOToggle/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/GPIO/GPIO_IOToggle/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase/SW4STM32/HAL_TimeBase/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase_RTC_ALARM/SW4STM32/HAL_TimeBase_RTC_ALARM/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase_RTC_ALARM/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase_RTC_WKUP/SW4STM32/HAL_TimeBase_RTC_WKUP/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase_RTC_WKUP/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase_TIM/SW4STM32/HAL_TimeBase_TIM/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase_TIM/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/HSEM/HSEM_ProcessSync/SW4STM32/HSEM_ProcessSync/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/HSEM/HSEM_ProcessSync/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/HSEM/HSEM_ReadLock/SW4STM32/HSEM_ReadLock/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/HSEM/HSEM_ReadLock/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_AdvComIT/SW4STM32/I2C_TwoBoards_AdvComIT/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_AdvComIT/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_ComDMA/SW4STM32/I2C_TwoBoards_ComDMA/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_ComDMA/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_ComIT/SW4STM32/I2C_TwoBoards_ComIT/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_ComIT/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_ComPolling/SW4STM32/I2C_TwoBoards_ComPolling/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_ComPolling/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_RestartAdvComIT/SW4STM32/I2C_TwoBoards_RestartAdvComIT/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_RestartAdvComIT/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_RestartComIT/SW4STM32/I2C_TwoBoards_RestartComIT/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_RestartComIT/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_WakeUpFromStop/SW4STM32/I2C_WakeUpFromStop/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_WakeUpFromStop/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_WakeUpFromStop2/SW4STM32/I2C_WakeUpFromStop2/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_WakeUpFromStop2/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/IWDG/IWDG_Reset/SW4STM32/IWDG_Reset/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/IWDG/IWDG_Reset/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/IWDG/IWDG_WindowMode/SW4STM32/IWDG_WindowMode/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/IWDG/IWDG_WindowMode/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/LCD/LCD_SegmentsDrive/SW4STM32/LCD_SegmentsDrive/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/LCD/LCD_SegmentsDrive/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_PWMExternalClock/SW4STM32/LPTIM_PWMExternalClock/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_PWMExternalClock/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_PWM_LSE/SW4STM32/LPTIM_PWM_LSE/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_PWM_LSE/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_PulseCounter/SW4STM32/LPTIM_PulseCounter/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_PulseCounter/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_Timeout/SW4STM32/LPTIM_Timeout/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_Timeout/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECCscalarMultiplication/SW4STM32/PKA_ECCscalarMultiplication/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECCscalarMultiplication/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECCscalarMultiplication_IT/SW4STM32/PKA_ECCscalarMultiplication_IT/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECCscalarMultiplication_IT/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Sign/SW4STM32/PKA_ECDSA_Sign/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Sign/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Sign_IT/SW4STM32/PKA_ECDSA_Sign_IT/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Sign_IT/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Verify/SW4STM32/PKA_ECDSA_Verify/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Verify/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Verify_IT/SW4STM32/PKA_ECDSA_Verify_IT/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Verify_IT/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiation/SW4STM32/PKA_ModularExponentiation/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiation/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiationCRT/SW4STM32/PKA_ModularExponentiationCRT/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiationCRT/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiationCRT_IT/SW4STM32/PKA_ModularExponentiationCRT_IT/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiationCRT_IT/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiation_IT/SW4STM32/PKA_ModularExponentiation_IT/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiation_IT/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_PointCheck/SW4STM32/PKA_PointCheck/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_PointCheck/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_PointCheck_IT/SW4STM32/PKA_PointCheck_IT/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_PointCheck_IT/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_LPRUN/SW4STM32/PWR_LPRUN/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_LPRUN/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_LPSLEEP/SW4STM32/PWR_LPSLEEP/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_LPSLEEP/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_PVD/SW4STM32/PWR_PVD/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_PVD/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_STANDBY_RTC/SW4STM32/PWR_STANDBY_RTC/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_STANDBY_RTC/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_STOP2_RTC/SW4STM32/PWR_STOP2_RTC/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_STOP2_RTC/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_STOP2_RTC/Src/main.c9
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_ExecuteInPlace/SW4STM32/QSPI_ExecuteInPlace/stm32wb55xx_flash_cm4.ld14
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_ExecuteInPlace/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_MemoryMapped/SW4STM32/QSPI_MemoryMapped/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_MemoryMapped/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_ReadWrite_DMA/SW4STM32/QSPI_ReadWrite_DMA/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_ReadWrite_DMA/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_ReadWrite_IT/SW4STM32/QSPI_ReadWrite_IT/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_ReadWrite_IT/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/RCC/RCC_CRS_Synchronization_IT/SW4STM32/RCC_CRS_Synchronization_IT/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/RCC/RCC_CRS_Synchronization_IT/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/RCC/RCC_CRS_Synchronization_Polling/SW4STM32/RCC_CRS_Synchronization_Polling/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/RCC/RCC_CRS_Synchronization_Polling/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/RCC/RCC_ClockConfig/SW4STM32/RCC_ClockConfig/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/RCC/RCC_ClockConfig/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/RNG/RNG_MultiRNG/SW4STM32/RNG_MultiRNG/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/RNG/RNG_MultiRNG/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/RNG/RNG_MultiRNG_IT/SW4STM32/RNG_MultiRNG_IT/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/RNG/RNG_MultiRNG_IT/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_Alarm/SW4STM32/RTC_Alarm/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_Alarm/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_Calendar/SW4STM32/RTC_Calendar/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_Calendar/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_LSI/SW4STM32/RTC_LSI/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_LSI/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_Tamper/SW4STM32/RTC_Tamper/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_Tamper/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_TimeStamp/SW4STM32/RTC_TimeStamp/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_TimeStamp/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComDMA_Master/SW4STM32/SPI_FullDuplex_ComDMA_Master/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComDMA_Master/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComDMA_Slave/SW4STM32/SPI_FullDuplex_ComDMA_Slave/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComDMA_Slave/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComIT_Master/SW4STM32/SPI_FullDuplex_ComIT_Master/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComIT_Master/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComIT_Slave/SW4STM32/SPI_FullDuplex_ComIT_Slave/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComIT_Slave/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComPolling_Master/SW4STM32/SPI_FullDuplex_ComPolling_Master/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComPolling_Master/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComPolling_Slave/SW4STM32/SPI_FullDuplex_ComPolling_Slave/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComPolling_Slave/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_DMA/SW4STM32/TIM_DMA/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_DMA/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_DMABurst/SW4STM32/TIM_DMABurst/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_DMABurst/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_InputCapture/SW4STM32/TIM_InputCapture/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_InputCapture/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OCActive/SW4STM32/TIM_OCActive/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OCActive/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OCInactive/SW4STM32/TIM_OCInactive/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OCInactive/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OCToggle/SW4STM32/TIM_OCToggle/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OCToggle/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OnePulse/SW4STM32/STM32WB55RG_Nucleo_TIM_OnePulse/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OnePulse/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_PWMInput/SW4STM32/TIM_PWMInput/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_PWMInput/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_PWMOutput/SW4STM32/TIM_PWMOutput/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_PWMOutput/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_TimeBase/SW4STM32/TIM_TimeBase/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_TimeBase/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_HyperTerminal_DMA/SW4STM32/UART_HyperTerminal_DMA/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_HyperTerminal_DMA/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_HyperTerminal_IT/SW4STM32/UART_HyperTerminal_IT/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_HyperTerminal_IT/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_Printf/SW4STM32/UART_Printf/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_Printf/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_TwoBoards_ComDMA/SW4STM32/UART_TwoBoards_ComDMA/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_TwoBoards_ComDMA/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_TwoBoards_ComIT/SW4STM32/UART_TwoBoards_ComIT/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_TwoBoards_ComIT/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_TwoBoards_ComPolling/SW4STM32/UART_TwoBoards_ComPolling/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_TwoBoards_ComPolling/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/WWDG/WWDG_Example/SW4STM32/WWDG_Example/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples/WWDG/WWDG_Example/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_AnalogWatchdog_Init/SW4STM32/ADC_AnalogWatchdog_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_AnalogWatchdog_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_ContinuousConversion_TriggerSW/SW4STM32/STM32WB55RG_Nucleo_ADC_ContinuousConversion_TriggerSW/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_ContinuousConversion_TriggerSW/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_ContinuousConversion_TriggerSW_Init/SW4STM32/ADC_ContinuousConversion_TriggerSW_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_ContinuousConversion_TriggerSW_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_ContinuousConversion_TriggerSW_LowPower_Init/SW4STM32/ADC_ContinuousConversion_TriggerSW_LowPower_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_ContinuousConversion_TriggerSW_LowPower_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_GroupsRegularInjected_Init/SW4STM32/ADC_GroupsRegularInjected_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_GroupsRegularInjected_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_Oversampling_Init/SW4STM32/ADC_Oversampling_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_Oversampling_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerSW_DMA_Init/SW4STM32/ADC_SingleConversion_TriggerSW_DMA_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerSW_DMA_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerSW_IT_Init/SW4STM32/ADC_SingleConversion_TriggerSW_IT_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerSW_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerSW_Init/SW4STM32/ADC_SingleConversion_TriggerSW_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerSW_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerTimer_DMA_Init/SW4STM32/ADC_SingleConversion_TriggerTimer_DMA_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerTimer_DMA_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_TemperatureSensor/SW4STM32/STM32WB55RG_Nucleo_ADC_TemperatureSensor/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_TemperatureSensor/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_IT/SW4STM32/STM32WB55RG_Nucleo_COMP_CompareGpioVsVrefInt_IT/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_IT/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_IT_Init/SW4STM32/COMP_CompareGpioVsVrefInt_IT_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_OutputGpio_Init/SW4STM32/COMP_CompareGpioVsVrefInt_OutputGpio_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_OutputGpio_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_Window_IT_Init/SW4STM32/COMP_CompareGpioVsVrefInt_Window_IT_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_Window_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CORTEX/CORTEX_MPU/SW4STM32/CORTEX_MPU/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CORTEX/CORTEX_MPU/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRC/CRC_CalculateAndCheck/SW4STM32/CRC_CalculateAndCheck/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRC/CRC_CalculateAndCheck/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRC/CRC_UserDefinedPolynomial/SW4STM32/CRC_UserDefinedPolynomial/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRC/CRC_UserDefinedPolynomial/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRS/CRS_Synchronization_IT/SW4STM32/CRS_Synchronization_IT/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRS/CRS_Synchronization_IT/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRS/CRS_Synchronization_Polling/SW4STM32/CRS_Synchronization_Polling/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRS/CRS_Synchronization_Polling/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/DMA/DMA_CopyFromFlashToMemory/SW4STM32/STM32WB55RG_Nucleo_DMA_CopyFromFlashToMemory/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/DMA/DMA_CopyFromFlashToMemory/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/DMA/DMA_CopyFromFlashToMemory_Init/SW4STM32/DMA_CopyFromFlashToMemory_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/DMA/DMA_CopyFromFlashToMemory_Init/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/EXTI/EXTI_ToggleLedOnIT/SW4STM32/STM32WB55RG_Nucleo_EXTI_ToggleLedOnIT/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/EXTI/EXTI_ToggleLedOnIT/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/EXTI/EXTI_ToggleLedOnIT_Init/SW4STM32/EXTI_ToggleLedOnIT_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/EXTI/EXTI_ToggleLedOnIT_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/GPIO/GPIO_InfiniteLedToggling/SW4STM32/STM32WB55RG_Nucleo_GPIO_InfiniteLedToggling/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/GPIO/GPIO_InfiniteLedToggling/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/GPIO/GPIO_InfiniteLedToggling_Init/SW4STM32/GPIO_InfiniteLedToggling_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/GPIO/GPIO_InfiniteLedToggling_Init/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/HSEM/HSEM_DualProcess/SW4STM32/HSEM_DualProcess/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/HSEM/HSEM_DualProcess/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/HSEM/HSEM_DualProcess_IT/SW4STM32/HSEM_DualProcess_IT/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/HSEM/HSEM_DualProcess_IT/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_AdvCommunication_DMAAndIT_Init/SW4STM32/I2C_OneBoard_AdvCommunication_DMAAndIT_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_AdvCommunication_DMAAndIT_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_DMAAndIT_Init/SW4STM32/I2C_OneBoard_Communication_DMAAndIT_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_DMAAndIT_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_IT/SW4STM32/STM32WB55RG_Nucleo_I2C_OneBoard_Communication_IT/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_IT/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_IT_Init/SW4STM32/I2C_OneBoard_Communication_IT_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_PollingAndIT_Init/SW4STM32/I2C_OneBoard_Communication_PollingAndIT_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_PollingAndIT_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_MasterRx_SlaveTx_IT_Init/SW4STM32/I2C_TwoBoards_MasterRx_SlaveTx_IT_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_MasterRx_SlaveTx_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_MasterTx_SlaveRx_DMA_Init/SW4STM32/I2C_TwoBoards_MasterTx_SlaveRx_DMA_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_MasterTx_SlaveRx_DMA_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_MasterTx_SlaveRx_Init/SW4STM32/I2C_TwoBoards_MasterTx_SlaveRx_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_MasterTx_SlaveRx_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_WakeUpFromStop2_IT_Init/SW4STM32/I2C_TwoBoards_WakeUpFromStop2_IT_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_WakeUpFromStop2_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_WakeUpFromStop_IT_Init/SW4STM32/I2C_TwoBoards_WakeUpFromStop_IT_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_WakeUpFromStop_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/IWDG/IWDG_RefreshUntilUserEvent_Init/SW4STM32/IWDG_RefreshUntilUserEvent_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/IWDG/IWDG_RefreshUntilUserEvent_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPTIM/LPTIM_PulseCounter/SW4STM32/STM32WB55RG_Nucleo_LPTIM_PulseCounter/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPTIM/LPTIM_PulseCounter/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPTIM/LPTIM_PulseCounter_Init/SW4STM32/LPTIM_PulseCounter_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPTIM/LPTIM_PulseCounter_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPUART/LPUART_WakeUpFromStop2_Init/SW4STM32/LPUART_WakeUpFromStop2_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPUART/LPUART_WakeUpFromStop2_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPUART/LPUART_WakeUpFromStop_Init/SW4STM32/LPUART_WakeUpFromStop_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPUART/LPUART_WakeUpFromStop_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PKA/PKA_ECDSA_Sign/SW4STM32/PKA_ECDSA_Sign/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PKA/PKA_ECDSA_Sign/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PKA/PKA_ModularExponentiation/SW4STM32/PKA_ModularExponentiation/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PKA/PKA_ModularExponentiation/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_EnterStandbyMode/SW4STM32/PWR_EnterStandbyMode/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_EnterStandbyMode/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_EnterStopMode/SW4STM32/PWR_EnterStopMode/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_EnterStopMode/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_EnterStopMode/Src/main.c9
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_OptimizedRunMode/SW4STM32/PWR_OptimizedRunMode/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_OptimizedRunMode/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_SMPS_16MHZ_HSI/SW4STM32/PWR_SMPS_16MHZ_HSI/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_SMPS_16MHZ_HSI/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_SMPS_64MHZ_MSI_PLL/SW4STM32/PWR_SMPS_64MHZ_MSI_PLL/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_SMPS_64MHZ_MSI_PLL/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_HWAutoMSICalibration/SW4STM32/RCC_HWAutoMSICalibration/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_HWAutoMSICalibration/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_OutputSystemClockOnMCO/SW4STM32/RCC_OutputSystemClockOnMCO/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_OutputSystemClockOnMCO/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_UseHSEasSystemClock/SW4STM32/RCC_UseHSEasSystemClock/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_UseHSEasSystemClock/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_UseHSI_PLLasSystemClock/SW4STM32/RCC_UseHSI_PLLasSystemClock/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_UseHSI_PLLasSystemClock/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RNG/RNG_GenerateRandomNumbers/SW4STM32/RNG_GenerateRandomNumbers/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RNG/RNG_GenerateRandomNumbers/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RNG/RNG_GenerateRandomNumbers_IT/SW4STM32/RNG_GenerateRandomNumbers_IT/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RNG/RNG_GenerateRandomNumbers_IT/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Alarm/SW4STM32/STM32WB55RG_Nucleo_RTC_Alarm/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Alarm/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Alarm_Init/SW4STM32/RTC_Alarm_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Alarm_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Calendar_Init/SW4STM32/RTC_Calendar_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Calendar_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_ExitStandbyWithWakeUpTimer_Init/SW4STM32/RTC_ExitStandbyWithWakeUpTimer_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_ExitStandbyWithWakeUpTimer_Init/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Tamper_Init/SW4STM32/RTC_Tamper_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Tamper_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_TimeStamp_Init/SW4STM32/RTC_TimeStamp_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_TimeStamp_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_OneBoard_HalfDuplex_DMA/SW4STM32/STM32WB55RG_Nucleo_SPI_OneBoard_HalfDuplex_DMA/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_OneBoard_HalfDuplex_DMA/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_OneBoard_HalfDuplex_DMA_Init/SW4STM32/SPI_OneBoard_HalfDuplex_DMA_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_OneBoard_HalfDuplex_DMA_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_OneBoard_HalfDuplex_IT_Init/SW4STM32/SPI_OneBoard_HalfDuplex_IT_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_OneBoard_HalfDuplex_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_DMA_Master_Init/SW4STM32/SPI_TwoBoards_FullDuplex_DMA_Master_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_DMA_Master_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_DMA_Slave_Init/SW4STM32/SPI_TwoBoards_FullDuplex_DMA_Slave_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_DMA_Slave_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_IT_Master_Init/SW4STM32/SPI_TwoBoards_FullDuplex_IT_Master_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_IT_Master_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_IT_Slave_Init/SW4STM32/SPI_TwoBoards_FullDuplex_IT_Slave_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_IT_Slave_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_BreakAndDeadtime/SW4STM32/STM32WB55RG_Nucleo_TIM_BreakAndDeadtime/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_BreakAndDeadtime/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_DMA_Init/SW4STM32/TIM_DMA_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_DMA_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_InputCapture_Init/SW4STM32/TIM_InputCapture_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_InputCapture_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_OnePulse/SW4STM32/STM32WB55RG_Nucleo_TIM_OnePulse/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_OnePulse/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_OutputCompare_Init/SW4STM32/TIM_OutputCompare_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_OutputCompare_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_PWMOutput/SW4STM32/STM32WB55RG_Nucleo_TIM_PWMOutput/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_PWMOutput/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_PWMOutput_Init/SW4STM32/TIM_PWMOutput_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_PWMOutput_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_TimeBase_Init/SW4STM32/TIM_TimeBase_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_TimeBase_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT/SW4STM32/STM32WB55RG_Nucleo_USART_Communication_Rx_IT/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_Continuous_Init/SW4STM32/USART_Communication_Rx_IT_Continuous_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_Continuous_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_Continuous_VCP_Init/SW4STM32/USART_Communication_Rx_IT_Continuous_VCP_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_Continuous_VCP_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_Init/SW4STM32/USART_Communication_Rx_IT_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_VCP_Init/SW4STM32/USART_Communication_Rx_IT_VCP_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_VCP_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_TxRx_DMA_Init/SW4STM32/USART_Communication_TxRx_DMA_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_TxRx_DMA_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_IT_Init/SW4STM32/USART_Communication_Tx_IT_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_IT_VCP_Init/SW4STM32/USART_Communication_Tx_IT_VCP_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_IT_VCP_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_Init/SW4STM32/USART_Communication_Tx_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_VCP_Init/SW4STM32/USART_Communication_Tx_VCP_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_VCP_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_WakeUpFromStop1_Init/SW4STM32/USART_WakeUpFromStop1_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_WakeUpFromStop1_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_WakeUpFromStop_Init/SW4STM32/USART_WakeUpFromStop_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_WakeUpFromStop_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/UTILS/UTILS_ConfigureSystemClock/SW4STM32/UTILS_ConfigureSystemClock/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/UTILS/UTILS_ConfigureSystemClock/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/UTILS/UTILS_ReadDeviceInfo/SW4STM32/UTILS_ReadDeviceInfo/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/UTILS/UTILS_ReadDeviceInfo/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/WWDG/WWDG_RefreshUntilUserEvent_Init/SW4STM32/WWDG_RefreshUntilUserEvent_Init/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/WWDG/WWDG_RefreshUntilUserEvent_Init/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/ADC/ADC_SingleConversion_TriggerSW_IT/SW4STM32/ADC_SingleConversion_TriggerSW_IT/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/ADC/ADC_SingleConversion_TriggerSW_IT/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/CRC/CRC_PolynomialUpdate/SW4STM32/CRC_PolynomialUpdate/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/CRC/CRC_PolynomialUpdate/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/DMA/DMA_FLASHToRAM/SW4STM32/DMA_FLASHToRAM/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/DMA/DMA_FLASHToRAM/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/I2C/I2C_OneBoard_ComSlave7_10bits_IT/SW4STM32/I2C_OneBoard_ComSlave7_10bits_IT/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/I2C/I2C_OneBoard_ComSlave7_10bits_IT/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/I2C/I2C_OneBoard_ComSlave7_10bits_IT/Src/stm32wbxx_hal_msp.c8
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/PWR/PWR_STOP1/SW4STM32/PWR_STOP1/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/PWR/PWR_STOP1/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_FullDuplex_ComPolling_Master/SW4STM32/SPI_FullDuplex_ComPolling_Master/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_FullDuplex_ComPolling_Master/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_FullDuplex_ComPolling_Slave/SW4STM32/SPI_FullDuplex_ComPolling_Slave/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_FullDuplex_ComPolling_Slave/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_HalfDuplex_ComPollingIT_Master/SW4STM32/SPI_HalfDuplex_ComPollingIT_Master/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_HalfDuplex_ComPollingIT_Master/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_HalfDuplex_ComPollingIT_Slave/SW4STM32/SPI_HalfDuplex_ComPollingIT_Slave/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_HalfDuplex_ComPollingIT_Slave/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/TIM/TIM_PWMInput/SW4STM32/TIM_PWMInput/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/TIM/TIM_PWMInput/SW4STM32/startup_stm32wb55xx_cm4.s92
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/UART/UART_HyperTerminal_IT/SW4STM32/UART_HyperTerminal_IT/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/UART/UART_HyperTerminal_IT/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/UART/UART_HyperTerminal_TxPolling_RxIT/SW4STM32/UART_HyperTerminal_TxPolling_RxIT/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/UART/UART_HyperTerminal_TxPolling_RxIT/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Release_Notes.html36
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Templates/SW4STM32/Templates/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Templates/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Templates_LL/SW4STM32/Templates_LL/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.Nucleo/Templates_LL/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Inc/app_conf.h15
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Inc/stm32_lpm_if.h42
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Inc/stm32wbxx_hal_conf.h4
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Inc/utilities_conf.h10
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Src/app_entry.c4
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Src/hw_timerserver.c42
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Src/hw_uart.c523
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Src/main.c65
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/STM32_WPAN/App/app_ble.c6
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/STM32_WPAN/App/ble_conf.h2
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/SW4STM32/Production/.cproject2
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/SW4STM32/Production/.project12
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/app_conf.h24
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/stm32_lpm_if.h42
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/stm32wbxx_hal_conf.h4
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/stm32wbxx_it.h4
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/utilities_conf.h10
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Src/app_entry.c18
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Src/hw_timerserver.c42
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Src/main.c85
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Src/stm32wbxx_it.c45
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/EWARM/BLE_MeshLightingDemo.ewp50
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/EWARM/stm32wb55xx_flash_cm4.icf22
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/MDK-ARM/BLE_MeshLightingDemo.uvoptx260
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/MDK-ARM/BLE_MeshLightingDemo.uvprojx55
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_config.c109
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_config.h144
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_handlers.c297
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_handlers.h35
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_generic.c234
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_generic.h42
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light.c572
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light.h101
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light_lc.c188
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light_lc.h90
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_mesh.c531
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_mesh.h16
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_nvm.c667
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_nvm.h11
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_sensor.c222
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_sensor.h60
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_vendor.c158
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_vendor.h9
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/ble_conf.h2
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/mesh_cfg.h76
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/mesh_cfg_usr.h392
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/models_if.c146
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/models_if.h2
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/pal_nvm.c487
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/BLE_Lighting_Demo/.cproject (renamed from Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/Production/.cproject)28
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/BLE_Lighting_Demo/.project434
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/BLE_Lighting_Demo/stm32wb55xx_flash_cm4.ld (renamed from Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/Production/stm32wb55xx_flash_cm4.ld)0
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/Production/.project398
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/readme.txt10
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Inc/app_conf.h16
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Inc/stm32_lpm_if.h42
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Inc/stm32wbxx_hal_conf.h4
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Inc/utilities_conf.h10
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Src/app_entry.c3
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Src/hw_timerserver.c42
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Src/main.c65
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/STM32_WPAN/App/ble_conf.h2
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/STM32_WPAN/App/tm.c2
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/SW4STM32/Production/.cproject2
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Binary/BLE_p2pClient_reference.hex2087
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Inc/app_conf.h19
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Inc/stm32_lpm_if.h42
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Inc/stm32wbxx_hal_conf.h4
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Inc/utilities_conf.h10
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Src/app_entry.c4
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Src/hw_timerserver.c42
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Src/hw_uart.c523
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Src/main.c65
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/STM32_WPAN/App/app_ble.c5
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/STM32_WPAN/App/ble_conf.h2
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/SW4STM32/Production/.cproject2
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Inc/app_conf.h19
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Inc/stm32_lpm_if.h42
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Inc/stm32wbxx_hal_conf.h4
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Inc/utilities_conf.h10
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Src/app_entry.c4
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Src/hw_timerserver.c42
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Src/hw_uart.c523
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Src/main.c65
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/STM32_WPAN/App/app_ble.c5
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/STM32_WPAN/App/ble_conf.h2
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/SW4STM32/Production/.cproject2
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/SW4STM32/Production/.project8
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Binary/BLE_p2pServer_reference.hex2066
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Inc/app_conf.h25
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Inc/stm32_lpm_if.h42
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Inc/stm32wbxx_hal_conf.h4
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Inc/utilities_conf.h10
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Src/app_entry.c4
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Src/hw_timerserver.c42
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Src/hw_uart.c523
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Src/main.c65
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/STM32_WPAN/App/app_ble.c6
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/SW4STM32/Production/.cproject2
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Inc/app_conf.h1
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Inc/stm32_lpm_if.h34
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Inc/stm32wbxx_hal_conf.h4
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Inc/utilities_conf.h8
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Src/hw_timerserver.c36
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Src/hw_uart.c2
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Src/main.c63
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/STM32_WPAN/App/app_thread.c25
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/app_conf.h1
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/stm32_lpm_if.h34
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/stm32wbxx_hal_conf.h4
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/utilities_conf.h8
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/hw_timerserver.c36
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/hw_uart.c2
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/main.c63
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/STM32_WPAN/App/app_thread.c43
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Inc/app_conf.h1
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Inc/stm32_lpm_if.h34
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Inc/stm32wbxx_hal_conf.h4
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Inc/utilities_conf.h8
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Src/hw_timerserver.c36
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Src/hw_uart.c2
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Src/main.c63
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/STM32_WPAN/App/app_thread.c79
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/app_conf.h1
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/stm32_lpm_if.h34
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/stm32wbxx_hal_conf.h4
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/utilities_conf.h8
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/hw_timerserver.c36
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/hw_uart.c2
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/main.c63
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/STM32_WPAN/App/app_thread.c25
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/app_conf.h1
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/hw_if.h250
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/stm32_lpm_if.h34
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/stm32wbxx_hal_conf.h4
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/utilities_conf.h8
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/hw_timerserver.c36
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/hw_uart.c2
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/main.c78
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/stm32_lpm_if.c14
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/STM32_WPAN/App/app_thread.c25
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/USB_Device/DFU_Standalone/SW4STM32/DFU_Standalone/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/USB_Device/DFU_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/USB_Device/HID_Standalone/SW4STM32/HID_Standalone/stm32wb55xx_flash_cm4.ld8
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Applications/USB_Device/HID_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Examples/BSP/SW4STM32/P-NUCLEO-WB55.USBDongle/stm32wb55xx_flash_cm4.ld2
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Examples/BSP/SW4STM32/startup_stm32wb55xx_cm4.s64
-rw-r--r--Projects/P-NUCLEO-WB55.USBDongle/Release_Notes.html17
-rw-r--r--Projects/STM32CubeProjectsList.html83
-rw-r--r--Projects/STM32WB_Copro_Wireless_Binaries/Release_Notes.html157
-rw-r--r--Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_BLE_HCILayer_fw.binbin94964 -> 97156 bytes
-rw-r--r--Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_BLE_Stack_fw.binbin162908 -> 165144 bytes
-rw-r--r--Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_BLE_Thread_fw.binbin503648 -> 505732 bytes
-rw-r--r--Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_Mac_802_15_4_fw.binbin62324 -> 61356 bytes
-rw-r--r--Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_Thread_FTD_fw.binbin346396 -> 346752 bytes
-rw-r--r--Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_Thread_MTD_fw.binbin257256 -> 257612 bytes
-rw-r--r--Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_zigbee_full_fw.binbin0 -> 420596 bytes
-rw-r--r--Release_Notes.html386
-rw-r--r--_htmresc/ReleaseNotes.html21
-rw-r--r--package.xml2
1462 files changed, 158009 insertions, 32163 deletions
diff --git a/Documentation/STM32CubeWBGettingStarted.pdf b/Documentation/STM32CubeWBGettingStarted.pdf
index c6d292a34..15d5ecd72 100644
--- a/Documentation/STM32CubeWBGettingStarted.pdf
+++ b/Documentation/STM32CubeWBGettingStarted.pdf
Binary files differ
diff --git a/Drivers/CMSIS/Device/ST/STM32WBxx/Include/stm32wb50xx.h b/Drivers/CMSIS/Device/ST/STM32WBxx/Include/stm32wb50xx.h
index f23a893f7..b99bc1de6 100644
--- a/Drivers/CMSIS/Device/ST/STM32WBxx/Include/stm32wb50xx.h
+++ b/Drivers/CMSIS/Device/ST/STM32WBxx/Include/stm32wb50xx.h
@@ -270,7 +270,7 @@ typedef struct
typedef struct
{
__IO uint32_t ACR; /*!< FLASH Access control register, Address offset: 0x00 */
- __IO uint32_t PDKEYR; /*!< FLASH Power-down in run mode flash key Address offset: 0x04 */
+ __IO uint32_t RESERVED; /*!< Reserved, Address offset: 0x04 */
__IO uint32_t KEYR; /*!< FLASH Key register, Address offset: 0x08 */
__IO uint32_t OPTKEYR; /*!< FLASH Option Key register, Address offset: 0x0C */
__IO uint32_t SR; /*!< FLASH Status register, Address offset: 0x10 */
@@ -774,7 +774,8 @@ typedef struct
#define SRAM2A_BASE (SRAM_BASE + 0x00030000UL)/*!< SRAM2A(32 KB) base address */
#define SRAM2B_BASE (SRAM_BASE + 0x00038000UL)/*!< SRAM2B(32 KB) base address */
-/* Size SRAMx */
+/* Memory Size */
+#define FLASH_SIZE (((uint32_t)(*((uint16_t *)FLASHSIZE_BASE)) & (0x07FFUL)) << 10U)
#define SRAM1_SIZE 0x00010000UL /*!< SRAM1 default size : 64 kB */
#define SRAM2A_SIZE 0x00008000UL /*!< SRAM2a default size : 32 kB */
#define SRAM2B_SIZE 0x00008000UL /*!< SRAM2b default size : 32 kB */
@@ -3838,7 +3839,7 @@ typedef struct
#define FLASH_CR_RDERRIE FLASH_CR_RDERRIE_Msk /*!< PCROP read error interrupt enable */
#define FLASH_CR_OBL_LAUNCH_Pos (27U)
#define FLASH_CR_OBL_LAUNCH_Msk (0x1UL << FLASH_CR_OBL_LAUNCH_Pos) /*!< 0x08000000 */
-#define FLASH_CR_OBL_LAUNCH FLASH_CR_OBL_LAUNCH_Msk /*!< Force the option bute loading */
+#define FLASH_CR_OBL_LAUNCH FLASH_CR_OBL_LAUNCH_Msk /*!< Force the option byte loading */
#define FLASH_CR_OPTLOCK_Pos (30U)
#define FLASH_CR_OPTLOCK_Msk (0x1UL << FLASH_CR_OPTLOCK_Pos) /*!< 0x40000000 */
#define FLASH_CR_OPTLOCK FLASH_CR_OPTLOCK_Msk /*!< Options lock */
@@ -6430,7 +6431,8 @@ typedef struct
/*
* @brief Specific device feature definitions
*/
-#define RCC_PLLSAI_SUPPORT
+#define RCC_MCO3_SUPPORT
+#define RCC_LSCO3_SUPPORT
/******************** Bit definition for RCC_CR register *****************/
#define RCC_CR_MSION_Pos (0U)
@@ -11164,9 +11166,6 @@ typedef struct
((INSTANCE) == TIM16) || \
((INSTANCE) == TIM17))
-/****************** TIM Instances : supporting synchronization ****************/
-#define IS_TIM_SYNCHRO_INSTANCE(INSTANCE) IS_TIM_MASTER_INSTANCE(INSTANCE)
-
/****************** TIM Instances : supporting ADC triggering through TRGO2 ***/
#define IS_TIM_TRGO2_INSTANCE(INSTANCE) ((INSTANCE) == TIM1)
diff --git a/Drivers/CMSIS/Device/ST/STM32WBxx/Include/stm32wb55xx.h b/Drivers/CMSIS/Device/ST/STM32WBxx/Include/stm32wb55xx.h
index c380163cc..ecf945401 100644
--- a/Drivers/CMSIS/Device/ST/STM32WBxx/Include/stm32wb55xx.h
+++ b/Drivers/CMSIS/Device/ST/STM32WBxx/Include/stm32wb55xx.h
@@ -302,7 +302,7 @@ typedef struct
typedef struct
{
__IO uint32_t ACR; /*!< FLASH Access control register, Address offset: 0x00 */
- __IO uint32_t PDKEYR; /*!< FLASH Power-down in run mode flash key Address offset: 0x04 */
+ __IO uint32_t RESERVED; /*!< Reserved, Address offset: 0x04 */
__IO uint32_t KEYR; /*!< FLASH Key register, Address offset: 0x08 */
__IO uint32_t OPTKEYR; /*!< FLASH Option Key register, Address offset: 0x0C */
__IO uint32_t SR; /*!< FLASH Status register, Address offset: 0x10 */
@@ -932,7 +932,8 @@ typedef struct
#define SRAM2A_BASE (SRAM_BASE + 0x00030000UL)/*!< SRAM2A(32 KB) base address */
#define SRAM2B_BASE (SRAM_BASE + 0x00038000UL)/*!< SRAM2B(32 KB) base address */
-/* Size SRAMx */
+/* Memory Size */
+#define FLASH_SIZE (((uint32_t)(*((uint16_t *)FLASHSIZE_BASE)) & (0x07FFUL)) << 10U)
#define SRAM1_SIZE 0x00030000UL /*!< SRAM1 default size : 192 kB */
#define SRAM2A_SIZE 0x00008000UL /*!< SRAM2a default size : 32 kB */
#define SRAM2B_SIZE 0x00008000UL /*!< SRAM2b default size : 32 kB */
@@ -4127,7 +4128,7 @@ typedef struct
#define FLASH_CR_RDERRIE FLASH_CR_RDERRIE_Msk /*!< PCROP read error interrupt enable */
#define FLASH_CR_OBL_LAUNCH_Pos (27U)
#define FLASH_CR_OBL_LAUNCH_Msk (0x1UL << FLASH_CR_OBL_LAUNCH_Pos) /*!< 0x08000000 */
-#define FLASH_CR_OBL_LAUNCH FLASH_CR_OBL_LAUNCH_Msk /*!< Force the option bute loading */
+#define FLASH_CR_OBL_LAUNCH FLASH_CR_OBL_LAUNCH_Msk /*!< Force the option byte loading */
#define FLASH_CR_OPTLOCK_Pos (30U)
#define FLASH_CR_OPTLOCK_Msk (0x1UL << FLASH_CR_OPTLOCK_Pos) /*!< 0x40000000 */
#define FLASH_CR_OPTLOCK FLASH_CR_OPTLOCK_Msk /*!< Options lock */
@@ -7266,7 +7267,8 @@ typedef struct
* @brief Specific device feature definitions
*/
#define RCC_SMPS_SUPPORT
-#define RCC_PLLSAI_SUPPORT
+#define RCC_MCO3_SUPPORT
+#define RCC_LSCO3_SUPPORT
/******************** Bit definition for RCC_CR register *****************/
#define RCC_CR_MSION_Pos (0U)
@@ -13634,9 +13636,6 @@ typedef struct
((INSTANCE) == TIM16) || \
((INSTANCE) == TIM17))
-/****************** TIM Instances : supporting synchronization ****************/
-#define IS_TIM_SYNCHRO_INSTANCE(INSTANCE) IS_TIM_MASTER_INSTANCE(INSTANCE)
-
/****************** TIM Instances : supporting ADC triggering through TRGO2 ***/
#define IS_TIM_TRGO2_INSTANCE(INSTANCE) ((INSTANCE) == TIM1)
diff --git a/Drivers/CMSIS/Device/ST/STM32WBxx/Include/stm32wbxx.h b/Drivers/CMSIS/Device/ST/STM32WBxx/Include/stm32wbxx.h
index 40b9ea747..4ed8421ef 100644
--- a/Drivers/CMSIS/Device/ST/STM32WBxx/Include/stm32wbxx.h
+++ b/Drivers/CMSIS/Device/ST/STM32WBxx/Include/stm32wbxx.h
@@ -69,7 +69,7 @@
* @brief CMSIS Device version number
*/
#define __STM32WBxx_CMSIS_VERSION_MAIN (0x01U) /*!< [31:24] main version */
-#define __STM32WBxx_CMSIS_VERSION_SUB1 (0x02U) /*!< [23:16] sub1 version */
+#define __STM32WBxx_CMSIS_VERSION_SUB1 (0x03U) /*!< [23:16] sub1 version */
#define __STM32WBxx_CMSIS_VERSION_SUB2 (0x00U) /*!< [15:8] sub2 version */
#define __STM32WBxx_CMSIS_VERSION_RC (0x00U) /*!< [7:0] release candidate */
#define __STM32WBxx_CMSIS_DEVICE_VERSION ((__STM32WBxx_CMSIS_VERSION_MAIN << 24)\
diff --git a/Drivers/CMSIS/Device/ST/STM32WBxx/Release_Notes.html b/Drivers/CMSIS/Device/ST/STM32WBxx/Release_Notes.html
index 5a2f2f277..7553a48ce 100644
--- a/Drivers/CMSIS/Device/ST/STM32WBxx/Release_Notes.html
+++ b/Drivers/CMSIS/Device/ST/STM32WBxx/Release_Notes.html
@@ -49,20 +49,58 @@
<div class="col-sm-12 col-lg-8">
<h1 id="update-history">Update History</h1>
<div class="collapse">
-<input type="checkbox" id="collapse-section3" checked aria-hidden="true"> <label for="collapse-section3" aria-hidden="true">V1.2.0 / 26-June-2019</label>
+<input type="checkbox" id="collapse-section4" checked aria-hidden="true"> <label for="collapse-section4" aria-hidden="true">v1.3.0 / 11-September-2019</label>
<div>
<h2 id="main-changes">Main Changes</h2>
+<p>Maintenance release for <strong>STM32WBxx</strong> devices (stm32wb55xx and stm32wb50xx devices)</p>
+<table>
+<thead>
+<tr class="header">
+<th style="text-align: left;">Fixed bugs headline</th>
+</tr>
+</thead>
+<tbody>
+<tr class="odd">
+<td style="text-align: left;">Remove IS_TIM_SYNCHRO_INSTANCE macro from CMSIS</td>
+</tr>
+<tr class="even">
+<td style="text-align: left;">Move FLASH_SIZE define from hal flash. h to cmsis device file</td>
+</tr>
+<tr class="odd">
+<td style="text-align: left;">Correct size of .bin files generated by SW4STM32</td>
+</tr>
+<tr class="even">
+<td style="text-align: left;">Remove RCC_PLLSAI_SUPPORT for STM32WB50</td>
+</tr>
+</tbody>
+</table>
+<h2 id="development-toolchains-and-compilers">Development Toolchains and Compilers</h2>
+<ul>
+<li>IAR Embedded Workbench for ARM (EWARM) toolchain V8.20.2</li>
+<li>RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.25</li>
+<li>System Workbench STM32 (SW4STM32) toolchain V2.7</li>
+</ul>
+<h2 id="supported-devices-and-boards">Supported Devices and boards</h2>
+<ul>
+<li>STM32WB55xx, STM32WB50xx devices</li>
+</ul>
+</div>
+</div>
+<div class="collapse">
+<input type="checkbox" id="collapse-section3" aria-hidden="true"> <label for="collapse-section3" aria-hidden="true">V1.2.0 / 26-June-2019</label>
+<div>
+<h2 id="main-changes-1">Main Changes</h2>
<h3 id="introduction-of-stm32wb50xx-device">Introduction of STM32WB50xx device</h3>
<p>First release for STM32WBxx CMSIS introducing <strong>stm32wb50xx</strong> devices.</p>
<h2 id="contents">Contents</h2>
<p>CMSIS devices files for stm32wb55xx, stm32wb50xx devices.</p>
-<h2 id="development-toolchains-and-compilers">Development Toolchains and Compilers</h2>
+<h2 id="development-toolchains-and-compilers-1">Development Toolchains and Compilers</h2>
<ul>
<li>IAR Embedded Workbench for ARM (EWARM) toolchain V8.20.2</li>
<li>RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.25</li>
<li>System Workbench STM32 (SW4STM32) toolchain V2.7</li>
</ul>
-<h2 id="supported-devices-and-boards">Supported Devices and boards</h2>
+<h2 id="supported-devices-and-boards-1">Supported Devices and boards</h2>
<ul>
<li>STM32WB55xx and STM32WB50xx devices</li>
</ul>
@@ -71,7 +109,7 @@
<div class="collapse">
<input type="checkbox" id="collapse-section2" aria-hidden="true"> <label for="collapse-section2" aria-hidden="true">V1.1.0 / 05-April-2019</label>
<div>
-<h2 id="main-changes-1">Main Changes</h2>
+<h2 id="main-changes-2">Main Changes</h2>
<h3 id="maintenance-release">Maintenance release</h3>
<p>Maintenance release for <strong>STM32WBxx</strong> devices (stm32wb55xx devices)</p>
<table>
@@ -95,7 +133,7 @@
<div class="collapse">
<input type="checkbox" id="collapse-section1" aria-hidden="true"> <label for="collapse-section1" aria-hidden="true">V1.0.0 / 06-February-2019</label>
<div>
-<h2 id="main-changes-2">Main Changes</h2>
+<h2 id="main-changes-3">Main Changes</h2>
<h3 id="first-release">First release</h3>
<p>Add support of STM32WB55xx.</p>
</div>
diff --git a/Drivers/CMSIS/Device/ST/STM32WBxx/Source/Templates/gcc/linker/stm32wb50xx_flash_cm4.ld b/Drivers/CMSIS/Device/ST/STM32WBxx/Source/Templates/gcc/linker/stm32wb50xx_flash_cm4.ld
index 4e0c6d804..4b71b9be5 100644
--- a/Drivers/CMSIS/Device/ST/STM32WBxx/Source/Templates/gcc/linker/stm32wb50xx_flash_cm4.ld
+++ b/Drivers/CMSIS/Device/ST/STM32WBxx/Source/Templates/gcc/linker/stm32wb50xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Drivers/CMSIS/Device/ST/STM32WBxx/Source/Templates/gcc/linker/stm32wb55xx_flash_cm4.ld b/Drivers/CMSIS/Device/ST/STM32WBxx/Source/Templates/gcc/linker/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Drivers/CMSIS/Device/ST/STM32WBxx/Source/Templates/gcc/linker/stm32wb55xx_flash_cm4.ld
+++ b/Drivers/CMSIS/Device/ST/STM32WBxx/Source/Templates/gcc/linker/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Drivers/CMSIS/Device/ST/STM32WBxx/Source/Templates/gcc/startup_stm32wb50xx_cm4.s b/Drivers/CMSIS/Device/ST/STM32WBxx/Source/Templates/gcc/startup_stm32wb50xx_cm4.s
index 026b5cb19..194a4f7fb 100644
--- a/Drivers/CMSIS/Device/ST/STM32WBxx/Source/Templates/gcc/startup_stm32wb50xx_cm4.s
+++ b/Drivers/CMSIS/Device/ST/STM32WBxx/Source/Templates/gcc/startup_stm32wb50xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Drivers/CMSIS/Device/ST/STM32WBxx/Source/Templates/gcc/startup_stm32wb55xx_cm4.s b/Drivers/CMSIS/Device/ST/STM32WBxx/Source/Templates/gcc/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Drivers/CMSIS/Device/ST/STM32WBxx/Source/Templates/gcc/startup_stm32wb55xx_cm4.s
+++ b/Drivers/CMSIS/Device/ST/STM32WBxx/Source/Templates/gcc/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Drivers/STM32WBxx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h b/Drivers/STM32WBxx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h
index e643dfd37..7e4d4585a 100644
--- a/Drivers/STM32WBxx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h
+++ b/Drivers/STM32WBxx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h
@@ -460,7 +460,9 @@
#define FLASH_FLAG_SNECCE_BANK2RR FLASH_FLAG_SNECCERR_BANK2
#define FLASH_FLAG_DBECCE_BANK2RR FLASH_FLAG_DBECCERR_BANK2
#define FLASH_FLAG_STRBER_BANK2R FLASH_FLAG_STRBERR_BANK2
-#endif
+#define FLASH_FLAG_WDW FLASH_FLAG_WBNE
+#define OB_WRP_SECTOR_All OB_WRP_SECTOR_ALL
+#endif /* STM32H7 */
/**
* @}
@@ -735,6 +737,33 @@
#define HRTIM_OUTPUTRESET_TIMFEV8_TIMECMP2 HRTIM_OUTPUTSET_TIMEV_8
#define HRTIM_OUTPUTRESET_TIMFEV9_TIMECMP3 HRTIM_OUTPUTSET_TIMEV_9
#endif /* STM32H7 */
+
+#if defined(STM32F3)
+#define HRTIM_OUTPUTSET_TIMEV_1 HRTIM_OUTPUTSET_TIMAEV1_TIMBCMP1
+#define HRTIM_OUTPUTSET_TIMEV_2 HRTIM_OUTPUTSET_TIMAEV2_TIMBCMP2
+#define HRTIM_OUTPUTSET_TIMEV_3 HRTIM_OUTPUTSET_TIMAEV3_TIMBCMP4
+#define HRTIM_OUTPUTSET_TIMEV_4 HRTIM_OUTPUTSET_TIMAEV4_TIMCCMP2
+#define HRTIM_OUTPUTSET_TIMEV_5 HRTIM_OUTPUTSET_TIMAEV5_TIMCCMP3
+#define HRTIM_OUTPUTSET_TIMEV_6 HRTIM_OUTPUTSET_TIMAEV6_TIMDCMP1
+#define HRTIM_OUTPUTSET_TIMEV_7 HRTIM_OUTPUTSET_TIMAEV7_TIMDCMP2
+#define HRTIM_OUTPUTSET_TIMEV_8 HRTIM_OUTPUTSET_TIMAEV8_TIMECMP3
+#define HRTIM_OUTPUTSET_TIMEV_9 HRTIM_OUTPUTSET_TIMAEV9_TIMECMP4
+
+#define HRTIM_OUTPUTRESET_TIMEV_1 HRTIM_OUTPUTRESET_TIMAEV1_TIMBCMP1
+#define HRTIM_OUTPUTRESET_TIMEV_2 HRTIM_OUTPUTRESET_TIMAEV2_TIMBCMP2
+#define HRTIM_OUTPUTRESET_TIMEV_3 HRTIM_OUTPUTRESET_TIMAEV3_TIMBCMP4
+#define HRTIM_OUTPUTRESET_TIMEV_4 HRTIM_OUTPUTRESET_TIMAEV4_TIMCCMP2
+#define HRTIM_OUTPUTRESET_TIMEV_5 HRTIM_OUTPUTRESET_TIMAEV5_TIMCCMP3
+#define HRTIM_OUTPUTRESET_TIMEV_6 HRTIM_OUTPUTRESET_TIMAEV6_TIMDCMP1
+#define HRTIM_OUTPUTRESET_TIMEV_7 HRTIM_OUTPUTRESET_TIMAEV7_TIMDCMP2
+#define HRTIM_OUTPUTRESET_TIMEV_8 HRTIM_OUTPUTRESET_TIMAEV8_TIMECMP3
+#define HRTIM_OUTPUTRESET_TIMEV_9 HRTIM_OUTPUTRESET_TIMAEV9_TIMECMP4
+
+#define HRTIM_EVENTSRC_1 HRTIM_EEV1SRC_GPIO
+#define HRTIM_EVENTSRC_2 HRTIM_EEV2SRC_GPIO
+#define HRTIM_EVENTSRC_3 HRTIM_EEV3SRC_GPIO
+#define HRTIM_EVENTSRC_4 HRTIM_EEV4SRC_GPIO
+#endif /* STM32F3 */
/**
* @}
*/
@@ -1380,6 +1409,13 @@
#endif
#define HAL_ADC_EnableBuffer_Cmd(cmd) (((cmd)==ENABLE) ? HAL_ADCEx_EnableVREFINT() : HAL_ADCEx_DisableVREFINT())
#define HAL_ADC_EnableBufferSensor_Cmd(cmd) (((cmd)==ENABLE) ? HAL_ADCEx_EnableVREFINTTempSensor() : HAL_ADCEx_DisableVREFINTTempSensor())
+#if defined(STM32H7A3xx) || defined(STM32H7B3xx) || defined(STM32H7A3xxQ) || defined(STM32H7B3xxQ)
+#define HAL_EnableSRDomainDBGStopMode HAL_EnableDomain3DBGStopMode
+#define HAL_DisableSRDomainDBGStopMode HAL_DisableDomain3DBGStopMode
+#define HAL_EnableSRDomainDBGStandbyMode HAL_EnableDomain3DBGStandbyMode
+#define HAL_DisableSRDomainDBGStandbyMode HAL_DisableDomain3DBGStandbyMode
+#endif /* STM32H7A3xx || STM32H7B3xx || STM32H7A3xxQ || STM32H7B3xxQ */
+
/**
* @}
*/
@@ -3242,7 +3278,7 @@
/** @defgroup HAL_RTC_Aliased_Macros HAL RTC Aliased Macros maintained for legacy purpose
* @{
*/
-#if defined (STM32G0) || defined (STM32L412xx) || defined (STM32L422xx) || defined (STM32L4P5xx) || defined (STM32L4Q5xx) || defined STM32G4
+#if defined (STM32G0) || defined (STM32L412xx) || defined (STM32L422xx) || defined (STM32L4P5xx) || defined (STM32L4Q5xx) || defined (STM32G4)
#else
#define __HAL_RTC_CLEAR_FLAG __HAL_RTC_EXTI_CLEAR_FLAG
#endif
@@ -3606,12 +3642,12 @@
* @{
*/
#if defined (STM32H7) || defined (STM32G4) || defined (STM32F3)
-#define HAL_HRTIM_WaveformCounterStart_IT HAL_HRTIM_WaveformCountStart_IT
-#define HAL_HRTIM_WaveformCounterStart_DMA HAL_HRTIM_WaveformCountStart_DMA
-#define HAL_HRTIM_WaveformCounterStart HAL_HRTIM_WaveformCountStart
-#define HAL_HRTIM_WaveformCounterStop_IT HAL_HRTIM_WaveformCountStop_IT
-#define HAL_HRTIM_WaveformCounterStop_DMA HAL_HRTIM_WaveformCountStop_DMA
-#define HAL_HRTIM_WaveformCounterStop HAL_HRTIM_WaveformCountStop
+#define HAL_HRTIM_WaveformCounterStart_IT HAL_HRTIM_WaveformCountStart_IT
+#define HAL_HRTIM_WaveformCounterStart_DMA HAL_HRTIM_WaveformCountStart_DMA
+#define HAL_HRTIM_WaveformCounterStart HAL_HRTIM_WaveformCountStart
+#define HAL_HRTIM_WaveformCounterStop_IT HAL_HRTIM_WaveformCountStop_IT
+#define HAL_HRTIM_WaveformCounterStop_DMA HAL_HRTIM_WaveformCountStop_DMA
+#define HAL_HRTIM_WaveformCounterStop HAL_HRTIM_WaveformCountStop
#endif
/**
* @}
diff --git a/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_cryp.h b/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_cryp.h
index 391636f1e..55fe0594c 100644
--- a/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_cryp.h
+++ b/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_cryp.h
@@ -182,7 +182,7 @@ typedef struct
uint32_t Key_saved[8]; /*!< copy of key registers */
- uint32_t Size_saved; /*!< copy of input buffer size */
+ uint16_t Size_saved; /*!< copy of input buffer size */
uint16_t CrypHeaderCount_saved; /*!< copy of CRYP header data counter when processing is suspended */
@@ -565,6 +565,12 @@ uint32_t HAL_CRYP_GetError(CRYP_HandleTypeDef *hcryp);
#define IS_CRYP_INIT(CONFIG)(((CONFIG) == CRYP_KEYIVCONFIG_ALWAYS) || \
((CONFIG) == CRYP_KEYIVCONFIG_ONCE))
+#define IS_CRYP_BUFFERSIZE(ALGO, DATAWIDTH, SIZE) \
+ (((((ALGO) == CRYP_AES_ECB) || ((ALGO) == CRYP_AES_CBC) || ((ALGO) == CRYP_AES_CTR)) && \
+ ((((DATAWIDTH) == CRYP_DATAWIDTHUNIT_WORD) && (((SIZE) % 4U) == 0U)) || \
+ (((DATAWIDTH) == CRYP_DATAWIDTHUNIT_BYTE) && (((SIZE) % 16U) == 0U)))) || \
+ (((ALGO)== CRYP_AES_GCM_GMAC) || ((ALGO) == CRYP_AES_CCM)))
+
/**
* @}
*/
diff --git a/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_dma.h b/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_dma.h
index 9467354f5..e575d61e9 100644
--- a/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_dma.h
+++ b/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_dma.h
@@ -204,8 +204,10 @@ typedef struct __DMA_HandleTypeDef
#define DMA_REQUEST_LPUART1_RX LL_DMAMUX_REQ_LPUART1_RX /*!< DMAMUX LP_UART1_RX request */
#define DMA_REQUEST_LPUART1_TX LL_DMAMUX_REQ_LPUART1_TX /*!< DMAMUX LP_UART1_RX request */
+#if defined (SAI1)
#define DMA_REQUEST_SAI1_A LL_DMAMUX_REQ_SAI1_A /*!< DMAMUX SAI1 A request */
#define DMA_REQUEST_SAI1_B LL_DMAMUX_REQ_SAI1_B /*!< DMAMUX SAI1 B request */
+#endif /* SAI1 */
#define DMA_REQUEST_QUADSPI LL_DMAMUX_REQ_QUADSPI /*!< DMAMUX QUADSPI request */
diff --git a/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_flash.h b/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_flash.h
index e0def218d..548518ffb 100644
--- a/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_flash.h
+++ b/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_flash.h
@@ -150,10 +150,10 @@ typedef struct
/** @defgroup FLASH_LATENCY FLASH Latency
* @{
*/
-#define FLASH_LATENCY_0 0x00000000UL /*!< FLASH Zero wait state */
-#define FLASH_LATENCY_1 FLASH_ACR_LATENCY_0 /*!< FLASH One wait state */
-#define FLASH_LATENCY_2 FLASH_ACR_LATENCY_1 /*!< FLASH Two wait states */
-#define FLASH_LATENCY_3 FLASH_ACR_LATENCY_2 /*!< FLASH Three wait states */
+#define FLASH_LATENCY_0 FLASH_ACR_LATENCY_0WS /*!< FLASH Zero wait state */
+#define FLASH_LATENCY_1 FLASH_ACR_LATENCY_1WS /*!< FLASH One wait state */
+#define FLASH_LATENCY_2 FLASH_ACR_LATENCY_2WS /*!< FLASH Two wait states */
+#define FLASH_LATENCY_3 FLASH_ACR_LATENCY_3WS /*!< FLASH Three wait states */
/**
* @}
*/
@@ -179,12 +179,14 @@ typedef struct
#define FLASH_FLAG_ECCC FLASH_ECCR_ECCC /*!< FLASH ECC correction */
#define FLASH_FLAG_ECCD FLASH_ECCR_ECCD /*!< FLASH ECC detection */
-#define FLASH_FLAG_SR_ERROR (FLASH_FLAG_OPERR | FLASH_FLAG_PROGERR | FLASH_FLAG_WRPERR | \
+#define FLASH_FLAG_SR_ERRORS (FLASH_FLAG_OPERR | FLASH_FLAG_PROGERR | FLASH_FLAG_WRPERR | \
FLASH_FLAG_PGAERR | FLASH_FLAG_SIZERR | FLASH_FLAG_PGSERR | \
FLASH_FLAG_MISERR | FLASH_FLAG_FASTERR | FLASH_FLAG_RDERR | \
FLASH_FLAG_OPTVERR) /*!< All SR error flags */
-#define FLASH_FLAG_ALL_ERRORS (FLASH_FLAG_SR_ERROR | FLASH_FLAG_ECCC | FLASH_FLAG_ECCD)
+#define FLASH_FLAG_ECCR_ERRORS (FLASH_FLAG_ECCC | FLASH_FLAG_ECCD)
+
+#define FLASH_FLAG_ALL_ERRORS (FLASH_FLAG_SR_ERRORS | FLASH_FLAG_ECCR_ERRORS)
/** @defgroup FLASH_INTERRUPT_DEFINITION FLASH Interrupts Definition
* @brief FLASH Interrupt definition
@@ -212,7 +214,6 @@ typedef struct
#define HAL_FLASH_ERROR_FAST FLASH_FLAG_FASTERR
#define HAL_FLASH_ERROR_RD FLASH_FLAG_RDERR
#define HAL_FLASH_ERROR_OPTV FLASH_FLAG_OPTVERR
-#define HAL_FLASH_ERROR_ECCD FLASH_FLAG_ECCD
/**
* @}
*/
@@ -480,39 +481,39 @@ typedef struct
* @{
*/
-#define SRAM2A_START_SECURE_ADDR_0 0x20030000U /* When in secure mode 0x20030000 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_START_SECURE_ADDR_1 0x20030400U /* When in secure mode 0x20030400 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_START_SECURE_ADDR_2 0x20030800U /* When in secure mode 0x20030800 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_START_SECURE_ADDR_3 0x20030C00U /* When in secure mode 0x20030C00 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_START_SECURE_ADDR_4 0x20031000U /* When in secure mode 0x20031000 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_START_SECURE_ADDR_5 0x20031400U /* When in secure mode 0x20031400 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_START_SECURE_ADDR_6 0x20031800U /* When in secure mode 0x20031800 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_START_SECURE_ADDR_7 0x20031C00U /* When in secure mode 0x20031C00 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_START_SECURE_ADDR_8 0x20032000U /* When in secure mode 0x20032000 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_START_SECURE_ADDR_9 0x20032400U /* When in secure mode 0x20032400 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_START_SECURE_ADDR_10 0x20032800U /* When in secure mode 0x20032800 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_START_SECURE_ADDR_11 0x20032C00U /* When in secure mode 0x20032C00 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_START_SECURE_ADDR_12 0x20033000U /* When in secure mode 0x20033000 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_START_SECURE_ADDR_13 0x20033400U /* When in secure mode 0x20033400 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_START_SECURE_ADDR_14 0x20033800U /* When in secure mode 0x20033800 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_START_SECURE_ADDR_15 0x20033C00U /* When in secure mode 0x20033C00 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_START_SECURE_ADDR_16 0x20034000U /* When in secure mode 0x20034000 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_START_SECURE_ADDR_17 0x20034400U /* When in secure mode 0x20034400 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_START_SECURE_ADDR_18 0x20034800U /* When in secure mode 0x20034800 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_START_SECURE_ADDR_19 0x20034C00U /* When in secure mode 0x20034C00 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_START_SECURE_ADDR_20 0x20035000U /* When in secure mode 0x20035000 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_START_SECURE_ADDR_21 0x20035400U /* When in secure mode 0x20035400 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_START_SECURE_ADDR_22 0x20035800U /* When in secure mode 0x20035800 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_START_SECURE_ADDR_23 0x20035C00U /* When in secure mode 0x20035C00 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_START_SECURE_ADDR_24 0x20036000U /* When in secure mode 0x20036000 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_START_SECURE_ADDR_25 0x20036400U /* When in secure mode 0x20036400 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_START_SECURE_ADDR_26 0x20036800U /* When in secure mode 0x20036800 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_START_SECURE_ADDR_27 0x20036C00U /* When in secure mode 0x20036C00 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_START_SECURE_ADDR_28 0x20037000U /* When in secure mode 0x20037000 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_START_SECURE_ADDR_29 0x20037400U /* When in secure mode 0x20037400 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_START_SECURE_ADDR_30 0x20037800U /* When in secure mode 0x20037800 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_START_SECURE_ADDR_31 0x20037C00U /* When in secure mode 0x20037C00 - 0x20037FFF is accessible only by M0 Plus */
-#define SRAM2A_FULL_UNSECURE 0x20040000U /* The RAM2A is accessible to M0 Plus and M4 */
+#define SRAM2A_START_SECURE_ADDR_0 (SRAM2A_BASE + 0x0000U) /* When in secure mode (SRAM2A_BASE + 0x0000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_START_SECURE_ADDR_1 (SRAM2A_BASE + 0x0400U) /* When in secure mode (SRAM2A_BASE + 0x0400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_START_SECURE_ADDR_2 (SRAM2A_BASE + 0x0800U) /* When in secure mode (SRAM2A_BASE + 0x0800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_START_SECURE_ADDR_3 (SRAM2A_BASE + 0x0C00U) /* When in secure mode (SRAM2A_BASE + 0x0C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_START_SECURE_ADDR_4 (SRAM2A_BASE + 0x1000U) /* When in secure mode (SRAM2A_BASE + 0x1000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_START_SECURE_ADDR_5 (SRAM2A_BASE + 0x1400U) /* When in secure mode (SRAM2A_BASE + 0x1400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_START_SECURE_ADDR_6 (SRAM2A_BASE + 0x1800U) /* When in secure mode (SRAM2A_BASE + 0x1800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_START_SECURE_ADDR_7 (SRAM2A_BASE + 0x1C00U) /* When in secure mode (SRAM2A_BASE + 0x1C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_START_SECURE_ADDR_8 (SRAM2A_BASE + 0x2000U) /* When in secure mode (SRAM2A_BASE + 0x2000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_START_SECURE_ADDR_9 (SRAM2A_BASE + 0x2400U) /* When in secure mode (SRAM2A_BASE + 0x2400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_START_SECURE_ADDR_10 (SRAM2A_BASE + 0x2800U) /* When in secure mode (SRAM2A_BASE + 0x2800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_START_SECURE_ADDR_11 (SRAM2A_BASE + 0x2C00U) /* When in secure mode (SRAM2A_BASE + 0x2C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_START_SECURE_ADDR_12 (SRAM2A_BASE + 0x3000U) /* When in secure mode (SRAM2A_BASE + 0x3000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_START_SECURE_ADDR_13 (SRAM2A_BASE + 0x3400U) /* When in secure mode (SRAM2A_BASE + 0x3400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_START_SECURE_ADDR_14 (SRAM2A_BASE + 0x3800U) /* When in secure mode (SRAM2A_BASE + 0x3800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_START_SECURE_ADDR_15 (SRAM2A_BASE + 0x3C00U) /* When in secure mode (SRAM2A_BASE + 0x3C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_START_SECURE_ADDR_16 (SRAM2A_BASE + 0x4000U) /* When in secure mode (SRAM2A_BASE + 0x4000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_START_SECURE_ADDR_17 (SRAM2A_BASE + 0x4400U) /* When in secure mode (SRAM2A_BASE + 0x4400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_START_SECURE_ADDR_18 (SRAM2A_BASE + 0x4800U) /* When in secure mode (SRAM2A_BASE + 0x4800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_START_SECURE_ADDR_19 (SRAM2A_BASE + 0x4C00U) /* When in secure mode (SRAM2A_BASE + 0x4C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_START_SECURE_ADDR_20 (SRAM2A_BASE + 0x5000U) /* When in secure mode (SRAM2A_BASE + 0x5000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_START_SECURE_ADDR_21 (SRAM2A_BASE + 0x5400U) /* When in secure mode (SRAM2A_BASE + 0x5400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_START_SECURE_ADDR_22 (SRAM2A_BASE + 0x5800U) /* When in secure mode (SRAM2A_BASE + 0x5800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_START_SECURE_ADDR_23 (SRAM2A_BASE + 0x5C00U) /* When in secure mode (SRAM2A_BASE + 0x5C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_START_SECURE_ADDR_24 (SRAM2A_BASE + 0x6000U) /* When in secure mode (SRAM2A_BASE + 0x6000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_START_SECURE_ADDR_25 (SRAM2A_BASE + 0x6400U) /* When in secure mode (SRAM2A_BASE + 0x6400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_START_SECURE_ADDR_26 (SRAM2A_BASE + 0x6800U) /* When in secure mode (SRAM2A_BASE + 0x6800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_START_SECURE_ADDR_27 (SRAM2A_BASE + 0x6C00U) /* When in secure mode (SRAM2A_BASE + 0x6C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_START_SECURE_ADDR_28 (SRAM2A_BASE + 0x7000U) /* When in secure mode (SRAM2A_BASE + 0x7000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_START_SECURE_ADDR_29 (SRAM2A_BASE + 0x7400U) /* When in secure mode (SRAM2A_BASE + 0x7400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_START_SECURE_ADDR_30 (SRAM2A_BASE + 0x7800U) /* When in secure mode (SRAM2A_BASE + 0x7800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_START_SECURE_ADDR_31 (SRAM2A_BASE + 0x7C00U) /* When in secure mode (SRAM2A_BASE + 0x7C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2A_FULL_UNSECURE (SRAM2A_BASE + 0x8000U) /* The RAM2A is accessible to M0 Plus and M4 */
/**
* @}
@@ -522,39 +523,39 @@ typedef struct
* @{
*/
-#define SRAM2B_START_SECURE_ADDR_0 0x20038000U /* When in secure mode 0x20038000 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_START_SECURE_ADDR_1 0x20038400U /* When in secure mode 0x20038400 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_START_SECURE_ADDR_2 0x20038800U /* When in secure mode 0x20038800 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_START_SECURE_ADDR_3 0x20038C00U /* When in secure mode 0x20038C00 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_START_SECURE_ADDR_4 0x20039000U /* When in secure mode 0x20039000 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_START_SECURE_ADDR_5 0x20039400U /* When in secure mode 0x20039400 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_START_SECURE_ADDR_6 0x20039800U /* When in secure mode 0x20039800 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_START_SECURE_ADDR_7 0x20039C00U /* When in secure mode 0x20039C00 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_START_SECURE_ADDR_8 0x2003A000U /* When in secure mode 0x2003A000 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_START_SECURE_ADDR_9 0x2003A400U /* When in secure mode 0x2003A400 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_START_SECURE_ADDR_10 0x2003A800U /* When in secure mode 0x2003A800 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_START_SECURE_ADDR_11 0x2003AC00U /* When in secure mode 0x2003AC00 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_START_SECURE_ADDR_12 0x2003B000U /* When in secure mode 0x2003B000 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_START_SECURE_ADDR_13 0x2003B400U /* When in secure mode 0x2003B400 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_START_SECURE_ADDR_14 0x2003B800U /* When in secure mode 0x2003B800 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_START_SECURE_ADDR_15 0x2003BC00U /* When in secure mode 0x2003BC00 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_START_SECURE_ADDR_16 0x2003C000U /* When in secure mode 0x2003C000 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_START_SECURE_ADDR_17 0x2003C400U /* When in secure mode 0x2003C400 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_START_SECURE_ADDR_18 0x2003C800U /* When in secure mode 0x2003C800 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_START_SECURE_ADDR_19 0x2003CC00U /* When in secure mode 0x2003CC00 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_START_SECURE_ADDR_20 0x2003D000U /* When in secure mode 0x2003D000 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_START_SECURE_ADDR_21 0x2003D400U /* When in secure mode 0x2003D400 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_START_SECURE_ADDR_22 0x2003D800U /* When in secure mode 0x2003D800 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_START_SECURE_ADDR_23 0x2003DC00U /* When in secure mode 0x2003DC00 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_START_SECURE_ADDR_24 0x2003E000U /* When in secure mode 0x2003E000 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_START_SECURE_ADDR_25 0x2003E400U /* When in secure mode 0x2003E400 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_START_SECURE_ADDR_26 0x2003E800U /* When in secure mode 0x2003E800 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_START_SECURE_ADDR_27 0x2003EC00U /* When in secure mode 0x2003EC00 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_START_SECURE_ADDR_28 0x2003F000U /* When in secure mode 0x2003F000 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_START_SECURE_ADDR_29 0x2003F400U /* When in secure mode 0x2003F400 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_START_SECURE_ADDR_30 0x2003F800U /* When in secure mode 0x2003F800 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_START_SECURE_ADDR_31 0x2003FC00U /* When in secure mode 0x2003FC00 - 0x2003FFFF is accessible only by M0 Plus */
-#define SRAM2B_FULL_UNSECURE 0x2003FF00U /* The RAM2B is accessible to M0 Plus and M4 */
+#define SRAM2B_START_SECURE_ADDR_0 (SRAM2B_BASE + 0x0000U) /* When in secure mode (SRAM2B_BASE + 0x0000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_START_SECURE_ADDR_1 (SRAM2B_BASE + 0x0400U) /* When in secure mode (SRAM2B_BASE + 0x0400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_START_SECURE_ADDR_2 (SRAM2B_BASE + 0x0800U) /* When in secure mode (SRAM2B_BASE + 0x0800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_START_SECURE_ADDR_3 (SRAM2B_BASE + 0x0C00U) /* When in secure mode (SRAM2B_BASE + 0x0C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_START_SECURE_ADDR_4 (SRAM2B_BASE + 0x1000U) /* When in secure mode (SRAM2B_BASE + 0x1000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_START_SECURE_ADDR_5 (SRAM2B_BASE + 0x1400U) /* When in secure mode (SRAM2B_BASE + 0x1400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_START_SECURE_ADDR_6 (SRAM2B_BASE + 0x1800U) /* When in secure mode (SRAM2B_BASE + 0x1800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_START_SECURE_ADDR_7 (SRAM2B_BASE + 0x1C00U) /* When in secure mode (SRAM2B_BASE + 0x1C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_START_SECURE_ADDR_8 (SRAM2B_BASE + 0x2000U) /* When in secure mode (SRAM2B_BASE + 0x2000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_START_SECURE_ADDR_9 (SRAM2B_BASE + 0x2400U) /* When in secure mode (SRAM2B_BASE + 0x2400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_START_SECURE_ADDR_10 (SRAM2B_BASE + 0x2800U) /* When in secure mode (SRAM2B_BASE + 0x2800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_START_SECURE_ADDR_11 (SRAM2B_BASE + 0x2C00U) /* When in secure mode (SRAM2B_BASE + 0x2C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_START_SECURE_ADDR_12 (SRAM2B_BASE + 0x3000U) /* When in secure mode (SRAM2B_BASE + 0x3000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_START_SECURE_ADDR_13 (SRAM2B_BASE + 0x3400U) /* When in secure mode (SRAM2B_BASE + 0x3400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_START_SECURE_ADDR_14 (SRAM2B_BASE + 0x3800U) /* When in secure mode (SRAM2B_BASE + 0x3800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_START_SECURE_ADDR_15 (SRAM2B_BASE + 0x3C00U) /* When in secure mode (SRAM2B_BASE + 0x3C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_START_SECURE_ADDR_16 (SRAM2B_BASE + 0x4000U) /* When in secure mode (SRAM2B_BASE + 0x4000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_START_SECURE_ADDR_17 (SRAM2B_BASE + 0x4400U) /* When in secure mode (SRAM2B_BASE + 0x4400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_START_SECURE_ADDR_18 (SRAM2B_BASE + 0x4800U) /* When in secure mode (SRAM2B_BASE + 0x4800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_START_SECURE_ADDR_19 (SRAM2B_BASE + 0x4C00U) /* When in secure mode (SRAM2B_BASE + 0x4C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_START_SECURE_ADDR_20 (SRAM2B_BASE + 0x5000U) /* When in secure mode (SRAM2B_BASE + 0x5000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_START_SECURE_ADDR_21 (SRAM2B_BASE + 0x5400U) /* When in secure mode (SRAM2B_BASE + 0x5400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_START_SECURE_ADDR_22 (SRAM2B_BASE + 0x5800U) /* When in secure mode (SRAM2B_BASE + 0x5800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_START_SECURE_ADDR_23 (SRAM2B_BASE + 0x5C00U) /* When in secure mode (SRAM2B_BASE + 0x5C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_START_SECURE_ADDR_24 (SRAM2B_BASE + 0x6000U) /* When in secure mode (SRAM2B_BASE + 0x6000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_START_SECURE_ADDR_25 (SRAM2B_BASE + 0x6400U) /* When in secure mode (SRAM2B_BASE + 0x6400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_START_SECURE_ADDR_26 (SRAM2B_BASE + 0x6800U) /* When in secure mode (SRAM2B_BASE + 0x6800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_START_SECURE_ADDR_27 (SRAM2B_BASE + 0x6C00U) /* When in secure mode (SRAM2B_BASE + 0x6C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_START_SECURE_ADDR_28 (SRAM2B_BASE + 0x7000U) /* When in secure mode (SRAM2B_BASE + 0x7000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_START_SECURE_ADDR_29 (SRAM2B_BASE + 0x7400U) /* When in secure mode (SRAM2B_BASE + 0x7400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_START_SECURE_ADDR_30 (SRAM2B_BASE + 0x7800U) /* When in secure mode (SRAM2B_BASE + 0x7800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_START_SECURE_ADDR_31 (SRAM2B_BASE + 0x7C00U) /* When in secure mode (SRAM2B_BASE + 0x7C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */
+#define SRAM2B_FULL_UNSECURE (SRAM2B_BASE + 0x8000U) /* The RAM2B is accessible to M0 Plus and M4 */
/**
* @}
@@ -707,7 +708,7 @@ typedef struct
* @arg @ref FLASH_FLAG_ECCD FLASH two ECC errors have been detected
* @retval The new state of FLASH_FLAG (SET or RESET).
*/
-#define __HAL_FLASH_GET_FLAG(__FLAG__) ((((__FLAG__) & (FLASH_FLAG_ECCC | FLASH_FLAG_ECCD)) != 0U) ? \
+#define __HAL_FLASH_GET_FLAG(__FLAG__) ((((__FLAG__) & (FLASH_FLAG_ECCR_ERRORS)) != 0U) ? \
(READ_BIT(FLASH->ECCR, (__FLAG__)) == (__FLAG__)) : \
(READ_BIT(FLASH->SR, (__FLAG__)) == (__FLAG__)))
/**
@@ -727,11 +728,13 @@ typedef struct
* @arg @ref FLASH_FLAG_OPTVERR FLASH Option validity error flag
* @arg @ref FLASH_FLAG_ECCC FLASH one ECC error has been detected and corrected
* @arg @ref FLASH_FLAG_ECCD FLASH two ECC errors have been detected
+ * @arg @ref FLASH_FLAG_SR_ERRORS FLASH All SR errors flags
+ * @arg @ref FLASH_FLAG_ECCR_ERRORS FLASH All ECCR errors flags
* @arg @ref FLASH_FLAG_ALL_ERRORS FLASH All errors flags
* @retval None
*/
-#define __HAL_FLASH_CLEAR_FLAG(__FLAG__) do { if(((__FLAG__) & (FLASH_FLAG_ECCC | FLASH_FLAG_ECCD)) != 0U) { SET_BIT(FLASH->ECCR, ((__FLAG__) & (FLASH_FLAG_ECCC | FLASH_FLAG_ECCD))); }\
- if(((__FLAG__) & ~(FLASH_FLAG_ECCC | FLASH_FLAG_ECCD)) != 0U) { WRITE_REG(FLASH->SR, ((__FLAG__) & ~(FLASH_FLAG_ECCC | FLASH_FLAG_ECCD))); }\
+#define __HAL_FLASH_CLEAR_FLAG(__FLAG__) do { if(((__FLAG__) & (FLASH_FLAG_ECCR_ERRORS)) != 0U) { SET_BIT(FLASH->ECCR, ((__FLAG__) & (FLASH_FLAG_ECCR_ERRORS))); }\
+ if(((__FLAG__) & ~(FLASH_FLAG_ECCR_ERRORS)) != 0U) { WRITE_REG(FLASH->SR, ((__FLAG__) & ~(FLASH_FLAG_ECCR_ERRORS))); }\
} while(0)
/**
* @}
@@ -808,12 +811,11 @@ HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout);
/** @defgroup FLASH_Private_Constants FLASH Private Constants
* @{
*/
-#define FLASH_SIZE (((uint32_t)(*((uint16_t *)FLASHSIZE_BASE)) & (0x07FFUL)) << 10U)
#define FLASH_END_ADDR (FLASH_BASE + FLASH_SIZE - 1U)
#define FLASH_BANK_SIZE FLASH_SIZE /*!< FLASH Bank Size */
#define FLASH_PAGE_SIZE 0x00001000U /*!< FLASH Page Size, 4 KBytes */
-#define FLASH_PAGE_NB 128U
+#define FLASH_PAGE_NB (FLASH_SIZE / FLASH_PAGE_SIZE)
#define FLASH_TIMEOUT_VALUE 1000U /*!< FLASH Execution Timeout, 1 s */
#define FLASH_PCROP_GRANULARITY_OFFSET 11U /*!< FLASH Code Readout Protection granularity offset */
diff --git a/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_gpio_ex.h b/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_gpio_ex.h
index e3c3fd304..fc10f8ebe 100644
--- a/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_gpio_ex.h
+++ b/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_gpio_ex.h
@@ -53,7 +53,9 @@
*
*/
- /* | AF0 | AF1 | AF2 | AF3 | AF4 | AF5 | AF6 | AF7 |
+#if defined (STM32WB55xx) || defined (STM32WB50xx)
+
+ /* | AF0 | AF1 | AF2 | AF3 | AF4 | AF5 | AF6 | AF7 |
*_____________________________________________________________________________________________
* |SYS_AF |TIM |TIM |SPI/SAI/TI|I2C | I2C | RF | USART |
*_____________________________________________________________________________________________
@@ -358,6 +360,9 @@
#define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x0f)
+#endif
+
+
/**
* @}
diff --git a/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_rcc.h b/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_rcc.h
index ba03291af..36c647b0d 100644
--- a/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_rcc.h
+++ b/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_rcc.h
@@ -110,7 +110,7 @@ extern "C" {
((__VALUE__) == RCC_PLLM_DIV7) || \
((__VALUE__) == RCC_PLLM_DIV8))
-#define IS_RCC_PLLN_VALUE(__VALUE__) ((8U <= (__VALUE__)) && ((__VALUE__) <= 86U))
+#define IS_RCC_PLLN_VALUE(__VALUE__) ((6U <= (__VALUE__)) && ((__VALUE__) <= 127U))
#define IS_RCC_PLLP_VALUE(__VALUE__) ((RCC_PLLP_DIV2 <= (__VALUE__)) && ((__VALUE__) <= RCC_PLLP_DIV32))
@@ -220,7 +220,7 @@ typedef struct
This parameter must be a value of @ref RCC_PLLM_Clock_Divider */
uint32_t PLLN; /*!< PLLN: Multiplication factor for PLL VCO output clock.
- This parameter must be a number between Min_Data = 8 and Max_Data = 86 */
+ This parameter must be a number between Min_Data = 6 and Max_Data = 127 */
uint32_t PLLP; /*!< PLLP: Division factor for SAI & ADC clock.
This parameter must be a value of @ref RCC_PLLP_Clock_Divider */
@@ -2861,13 +2861,13 @@ typedef struct
* @param __PLLM__ specifies the division factor for PLL VCO input clock.
* This parameter must be a value of @ref RCC_PLLM_Clock_Divider.
* @note You have to set the PLLM parameter correctly to ensure that the VCO input
- * frequency ranges from 4 to 16 MHz. It is recommended to select a frequency
+ * frequency ranges from 2.66 to 16 MHz. It is recommended to select a frequency
* of 16 MHz to limit PLL jitter.
*
* @param __PLLN__ specifies the multiplication factor for PLL VCO output clock.
- * This parameter must be a number between 8 and 86.
+ * This parameter must be a number between 6 and 127.
* @note You have to set the PLLN parameter correctly to ensure that the VCO
- * output frequency is between 64 and 344 MHz.
+ * output frequency is between 96 and 344 MHz.
*
* @param __PLLP__ specifies the division factor for ADC and SAI1 clock.
* This parameter must be a value of @ref RCC_PLLP_Clock_Divider.
diff --git a/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_rcc_ex.h b/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_rcc_ex.h
index 68fe89f8e..230929ec6 100644
--- a/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_rcc_ex.h
+++ b/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_rcc_ex.h
@@ -191,7 +191,7 @@ extern "C" {
#endif
#if defined(SAI1)
-#define IS_RCC_PLLSAI1N_VALUE(__VALUE__) ((8U <= (__VALUE__)) && ((__VALUE__) <= 86U))
+#define IS_RCC_PLLSAI1N_VALUE(__VALUE__) ((6U <= (__VALUE__)) && ((__VALUE__) <= 127U))
#define IS_RCC_PLLSAI1P_VALUE(__VALUE__) ((RCC_PLLP_DIV2 <= (__VALUE__)) && ((__VALUE__) <= RCC_PLLP_DIV32))
@@ -242,7 +242,7 @@ typedef struct
{
uint32_t PLLN; /*!< PLLN: specifies the multiplication factor for PLLSAI1 VCO output clock.
- This parameter must be a number between Min_Data=8 and Max_Data=86. */
+ This parameter must be a number between Min_Data=6 and Max_Data=127. */
uint32_t PLLP; /*!< PLLP: specifies the division factor for SAI clock.
This parameter must be a value of @ref RCC_PLLP_Clock_Divider */
@@ -757,9 +757,9 @@ typedef struct
* @ref __HAL_RCC_PLL_CONFIG() macro)
*
* @param __PLLN__ specifies the multiplication factor for PLLSAI1 VCO output clock.
- * This parameter must be a number between 4 and 86.
+ * This parameter must be a number between 6 and 127.
* @note You have to set the PLLN parameter correctly to ensure that the VCO
- * output frequency is between 64 and 344 MHz.
+ * output frequency is between 96 and 344 MHz.
* PLLSAI1 clock frequency = f(PLLSAI1) multiplied by PLLN
*
* @param __PLLP__ specifies the division factor for SAI clock.
@@ -789,9 +789,9 @@ typedef struct
* @ref __HAL_RCC_PLL_CONFIG() macro)
*
* @param __PLLN__ specifies the multiplication factor for PLLSAI1 VCO output clock.
- * This parameter must be a number between Min_Data=4 and Max_Data=86.
+ * This parameter must be a number between Min_Data=6 and Max_Data=127.
* @note You have to set the PLLN parameter correctly to ensure that the VCO
- * output frequency is between 64 and 344 MHz.
+ * output frequency is between 96 and 344 MHz.
* Use to set PLLSAI1 clock frequency = f(PLLSAI1) multiplied by PLLN
*
* @retval None
diff --git a/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_tim.h b/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_tim.h
index 3c12713bf..ce4b09ee4 100644
--- a/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_tim.h
+++ b/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_tim.h
@@ -167,7 +167,7 @@ typedef struct
This parameter can be a value of @ref TIM_Encoder_Mode */
uint32_t IC1Polarity; /*!< Specifies the active edge of the input signal.
- This parameter can be a value of @ref TIM_Input_Capture_Polarity */
+ This parameter can be a value of @ref TIM_Encoder_Input_Polarity */
uint32_t IC1Selection; /*!< Specifies the input.
This parameter can be a value of @ref TIM_Input_Capture_Selection */
@@ -179,7 +179,7 @@ typedef struct
This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */
uint32_t IC2Polarity; /*!< Specifies the active edge of the input signal.
- This parameter can be a value of @ref TIM_Input_Capture_Polarity */
+ This parameter can be a value of @ref TIM_Encoder_Input_Polarity */
uint32_t IC2Selection; /*!< Specifies the input.
This parameter can be a value of @ref TIM_Input_Capture_Selection */
@@ -616,6 +616,15 @@ typedef void (*pTIM_CallbackTypeDef)(TIM_HandleTypeDef *htim); /*!< pointer to
* @}
*/
+/** @defgroup TIM_Encoder_Input_Polarity TIM Encoder Input Polarity
+ * @{
+ */
+#define TIM_ENCODERINPUTPOLARITY_RISING TIM_INPUTCHANNELPOLARITY_RISING /*!< Encoder input with rising edge polarity */
+#define TIM_ENCODERINPUTPOLARITY_FALLING TIM_INPUTCHANNELPOLARITY_FALLING /*!< Encoder input with falling edge polarity */
+/**
+ * @}
+ */
+
/** @defgroup TIM_Input_Capture_Selection TIM Input Capture Selection
* @{
*/
@@ -1686,6 +1695,9 @@ mode.
#define IS_TIM_OCNIDLE_STATE(__STATE__) (((__STATE__) == TIM_OCNIDLESTATE_SET) || \
((__STATE__) == TIM_OCNIDLESTATE_RESET))
+#define IS_TIM_ENCODERINPUT_POLARITY(__POLARITY__) (((__POLARITY__) == TIM_ENCODERINPUTPOLARITY_RISING) || \
+ ((__POLARITY__) == TIM_ENCODERINPUTPOLARITY_FALLING))
+
#define IS_TIM_IC_POLARITY(__POLARITY__) (((__POLARITY__) == TIM_ICPOLARITY_RISING) || \
((__POLARITY__) == TIM_ICPOLARITY_FALLING) || \
((__POLARITY__) == TIM_ICPOLARITY_BOTHEDGE))
diff --git a/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_wwdg.h b/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_wwdg.h
index f20ee87c3..8d6978409 100644
--- a/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_wwdg.h
+++ b/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_wwdg.h
@@ -22,7 +22,7 @@
#define STM32WBxx_HAL_WWDG_H
#ifdef __cplusplus
- extern "C" {
+extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
@@ -89,12 +89,12 @@ typedef enum
{
HAL_WWDG_EWI_CB_ID = 0x00u, /*!< WWDG EWI callback ID */
HAL_WWDG_MSPINIT_CB_ID = 0x01u, /*!< WWDG MspInit callback ID */
-}HAL_WWDG_CallbackIDTypeDef;
+} HAL_WWDG_CallbackIDTypeDef;
/**
* @brief HAL WWDG Callback pointer definition
*/
-typedef void (*pWWDG_CallbackTypeDef)(WWDG_HandleTypeDef * hppp); /*!< pointer to a WWDG common callback functions */
+typedef void (*pWWDG_CallbackTypeDef)(WWDG_HandleTypeDef *hppp); /*!< pointer to a WWDG common callback functions */
#endif
/**
@@ -247,7 +247,8 @@ typedef void (*pWWDG_CallbackTypeDef)(WWDG_HandleTypeDef * hppp); /*!< pointer t
* @arg WWDG_IT_EWI: Early Wakeup Interrupt
* @retval state of __INTERRUPT__ (TRUE or FALSE).
*/
-#define __HAL_WWDG_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CFR & (__INTERRUPT__)) == (__INTERRUPT__))
+#define __HAL_WWDG_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CFR\
+ & (__INTERRUPT__)) == (__INTERRUPT__))
/**
* @}
diff --git a/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_ll_pwr.h b/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_ll_pwr.h
index 5e7a29709..d1a9b76b6 100644
--- a/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_ll_pwr.h
+++ b/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_ll_pwr.h
@@ -1062,7 +1062,7 @@ __STATIC_INLINE uint32_t LL_PWR_IsWakeUpPinPolarityLow(uint32_t WakeUpPin)
*/
__STATIC_INLINE void LL_PWR_EnableGPIOPullUp(uint32_t GPIO, uint32_t GPIONumber)
{
- SET_BIT(*((uint32_t *)GPIO), GPIONumber);
+ SET_BIT(*((__IO uint32_t *)GPIO), GPIONumber);
}
/**
@@ -1103,7 +1103,7 @@ __STATIC_INLINE void LL_PWR_EnableGPIOPullUp(uint32_t GPIO, uint32_t GPIONumber)
*/
__STATIC_INLINE void LL_PWR_DisableGPIOPullUp(uint32_t GPIO, uint32_t GPIONumber)
{
- CLEAR_BIT(*((uint32_t *)GPIO), GPIONumber);
+ CLEAR_BIT(*((__IO uint32_t *)GPIO), GPIONumber);
}
/**
@@ -1142,7 +1142,7 @@ __STATIC_INLINE void LL_PWR_DisableGPIOPullUp(uint32_t GPIO, uint32_t GPIONumber
*/
__STATIC_INLINE uint32_t LL_PWR_IsEnabledGPIOPullUp(uint32_t GPIO, uint32_t GPIONumber)
{
- return ((READ_BIT(*((uint32_t *)(GPIO)), GPIONumber) == (GPIONumber)) ? 1UL : 0UL);
+ return ((READ_BIT(*((__IO uint32_t *)GPIO), GPIONumber) == (GPIONumber)) ? 1UL : 0UL);
}
/**
@@ -1183,8 +1183,7 @@ __STATIC_INLINE uint32_t LL_PWR_IsEnabledGPIOPullUp(uint32_t GPIO, uint32_t GPIO
*/
__STATIC_INLINE void LL_PWR_EnableGPIOPullDown(uint32_t GPIO, uint32_t GPIONumber)
{
- register __IO uint32_t temp = (uint32_t)(GPIO) + 4UL;
- SET_BIT(*((uint32_t *)(temp)), GPIONumber);
+ SET_BIT(*((__IO uint32_t *)(GPIO + 4UL)), GPIONumber);
}
/**
@@ -1225,8 +1224,7 @@ __STATIC_INLINE void LL_PWR_EnableGPIOPullDown(uint32_t GPIO, uint32_t GPIONumbe
*/
__STATIC_INLINE void LL_PWR_DisableGPIOPullDown(uint32_t GPIO, uint32_t GPIONumber)
{
- register __IO uint32_t temp = (uint32_t)(GPIO) + 4UL;
- CLEAR_BIT(*((uint32_t *)(temp)), GPIONumber);
+ CLEAR_BIT(*((__IO uint32_t *)(GPIO + 4UL)), GPIONumber);
}
/**
@@ -1265,8 +1263,7 @@ __STATIC_INLINE void LL_PWR_DisableGPIOPullDown(uint32_t GPIO, uint32_t GPIONumb
*/
__STATIC_INLINE uint32_t LL_PWR_IsEnabledGPIOPullDown(uint32_t GPIO, uint32_t GPIONumber)
{
- register __IO uint32_t temp = (uint32_t)(GPIO) + 4UL;
- return ((READ_BIT(*((uint32_t *)(temp)), GPIONumber) == (GPIONumber)) ? 1UL : 0UL);
+ return ((READ_BIT(*((__IO uint32_t *)(GPIO + 4UL)), GPIONumber) == (GPIONumber)) ? 1UL : 0UL);
}
#if defined(PWR_CR5_SMPSEN)
@@ -1573,12 +1570,12 @@ __STATIC_INLINE uint32_t LL_PWR_SMPS_GetOutputVoltageLevel(void)
{
OutputVoltageLevelTrimmed = (int32_t)LL_PWR_SMPS_OUTPUT_VOLTAGE_1V20;
}
- else if(OutputVoltageLevelTrimmed > (int32_t)PWR_CR5_SMPSVOS)
- {
- OutputVoltageLevelTrimmed = (int32_t)LL_PWR_SMPS_OUTPUT_VOLTAGE_1V90;
- }
else
{
+ if(OutputVoltageLevelTrimmed > (int32_t)PWR_CR5_SMPSVOS)
+ {
+ OutputVoltageLevelTrimmed = (int32_t)LL_PWR_SMPS_OUTPUT_VOLTAGE_1V90;
+ }
}
return (uint32_t)OutputVoltageLevelTrimmed;
diff --git a/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_ll_rcc.h b/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_ll_rcc.h
index 5a3b92bc4..37cf24761 100644
--- a/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_ll_rcc.h
+++ b/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_ll_rcc.h
@@ -849,7 +849,7 @@ typedef struct
* @arg @ref LL_RCC_PLLM_DIV_6
* @arg @ref LL_RCC_PLLM_DIV_7
* @arg @ref LL_RCC_PLLM_DIV_8
- * @param __PLLN__ Between Min_Data = 8 and Max_Data = 86
+ * @param __PLLN__ Between Min_Data = 6 and Max_Data = 127
* @param __PLLR__ This parameter can be one of the following values:
* @arg @ref LL_RCC_PLLR_DIV_2
* @arg @ref LL_RCC_PLLR_DIV_3
@@ -878,7 +878,7 @@ typedef struct
* @arg @ref LL_RCC_PLLM_DIV_6
* @arg @ref LL_RCC_PLLM_DIV_7
* @arg @ref LL_RCC_PLLM_DIV_8
- * @param __PLLN__ Between Min_Data = 8 and Max_Data = 86
+ * @param __PLLN__ Between Min_Data = 6 and Max_Data = 127
* @param __PLLP__ This parameter can be one of the following values:
* @arg @ref LL_RCC_PLLP_DIV_2
* @arg @ref LL_RCC_PLLP_DIV_3
@@ -930,7 +930,7 @@ typedef struct
* @arg @ref LL_RCC_PLLM_DIV_6
* @arg @ref LL_RCC_PLLM_DIV_7
* @arg @ref LL_RCC_PLLM_DIV_8
- * @param __PLLN__ Between Min_Data = 8 and Max_Data = 86
+ * @param __PLLN__ Between Min_Data = 6 and Max_Data = 127
* @param __PLLP__ This parameter can be one of the following values:
* @arg @ref LL_RCC_PLLP_DIV_2
* @arg @ref LL_RCC_PLLP_DIV_3
@@ -982,7 +982,7 @@ typedef struct
* @arg @ref LL_RCC_PLLM_DIV_6
* @arg @ref LL_RCC_PLLM_DIV_7
* @arg @ref LL_RCC_PLLM_DIV_8
- * @param __PLLN__ Between Min_Data = 8 and Max_Data = 86
+ * @param __PLLN__ Between Min_Data = 6 and Max_Data = 127
* @param __PLLQ__ This parameter can be one of the following values:
* @arg @ref LL_RCC_PLLQ_DIV_2
* @arg @ref LL_RCC_PLLQ_DIV_3
@@ -1011,7 +1011,7 @@ typedef struct
* @arg @ref LL_RCC_PLLM_DIV_6
* @arg @ref LL_RCC_PLLM_DIV_7
* @arg @ref LL_RCC_PLLM_DIV_8
- * @param __PLLSAI1N__ Between 8 and 86
+ * @param __PLLSAI1N__ Between 6 and 127
* @param __PLLSAI1P__ This parameter can be one of the following values:
* @arg @ref LL_RCC_PLLSAI1P_DIV_2
* @arg @ref LL_RCC_PLLSAI1P_DIV_3
@@ -1064,7 +1064,7 @@ typedef struct
* @arg @ref LL_RCC_PLLM_DIV_6
* @arg @ref LL_RCC_PLLM_DIV_7
* @arg @ref LL_RCC_PLLM_DIV_8
- * @param __PLLSAI1N__ Between 8 and 86
+ * @param __PLLSAI1N__ Between 6 and 127
* @param __PLLSAI1Q__ This parameter can be one of the following values:
* @arg @ref LL_RCC_PLLSAI1Q_DIV_2
* @arg @ref LL_RCC_PLLSAI1Q_DIV_3
@@ -1093,7 +1093,7 @@ typedef struct
* @arg @ref LL_RCC_PLLM_DIV_6
* @arg @ref LL_RCC_PLLM_DIV_7
* @arg @ref LL_RCC_PLLM_DIV_8
- * @param __PLLSAI1N__ Between 8 and 86
+ * @param __PLLSAI1N__ Between 6 and 127
* @param __PLLSAI1R__ This parameter can be one of the following values:
* @arg @ref LL_RCC_PLLSAI1R_DIV_2
* @arg @ref LL_RCC_PLLSAI1R_DIV_3
@@ -2956,7 +2956,7 @@ __STATIC_INLINE uint32_t LL_RCC_PLL_IsReady(void)
* @arg @ref LL_RCC_PLLM_DIV_6
* @arg @ref LL_RCC_PLLM_DIV_7
* @arg @ref LL_RCC_PLLM_DIV_8
- * @param PLLN Between 8 and 86
+ * @param PLLN Between 6 and 127
* @param PLLR This parameter can be one of the following values:
* @arg @ref LL_RCC_PLLR_DIV_2
* @arg @ref LL_RCC_PLLR_DIV_4
@@ -2994,7 +2994,7 @@ __STATIC_INLINE void LL_RCC_PLL_ConfigDomain_SYS(uint32_t Source, uint32_t PLLM,
* @arg @ref LL_RCC_PLLM_DIV_6
* @arg @ref LL_RCC_PLLM_DIV_7
* @arg @ref LL_RCC_PLLM_DIV_8
- * @param PLLN Between 8 and 86
+ * @param PLLN Between 6 and 127
* @param PLLP This parameter can be one of the following values:
* @arg @ref LL_RCC_PLLP_DIV_2
* @arg @ref LL_RCC_PLLP_DIV_3
@@ -3059,7 +3059,7 @@ __STATIC_INLINE void LL_RCC_PLL_ConfigDomain_SAI(uint32_t Source, uint32_t PLLM,
* @arg @ref LL_RCC_PLLM_DIV_6
* @arg @ref LL_RCC_PLLM_DIV_7
* @arg @ref LL_RCC_PLLM_DIV_8
- * @param PLLN Between 8 and 86
+ * @param PLLN Between 6 and 127
* @param PLLP This parameter can be one of the following values:
* @arg @ref LL_RCC_PLLP_DIV_2
* @arg @ref LL_RCC_PLLP_DIV_3
@@ -3124,7 +3124,7 @@ __STATIC_INLINE void LL_RCC_PLL_ConfigDomain_ADC(uint32_t Source, uint32_t PLLM,
* @arg @ref LL_RCC_PLLM_DIV_6
* @arg @ref LL_RCC_PLLM_DIV_7
* @arg @ref LL_RCC_PLLM_DIV_8
- * @param PLLN Between 8 and 86
+ * @param PLLN Between 6 and 127
* @param PLLQ This parameter can be one of the following values:
* @arg @ref LL_RCC_PLLQ_DIV_2
* @arg @ref LL_RCC_PLLQ_DIV_3
@@ -3144,7 +3144,7 @@ __STATIC_INLINE void LL_RCC_PLL_ConfigDomain_48M(uint32_t Source, uint32_t PLLM,
/**
* @brief Get Main PLL multiplication factor for VCO
* @rmtoll PLLCFGR PLLN LL_RCC_PLL_GetN
- * @retval Between 8 and 86
+ * @retval Between 6 and 127
*/
__STATIC_INLINE uint32_t LL_RCC_PLL_GetN(void)
{
@@ -3402,7 +3402,7 @@ __STATIC_INLINE uint32_t LL_RCC_PLLSAI1_IsReady(void)
* @arg @ref LL_RCC_PLLM_DIV_6
* @arg @ref LL_RCC_PLLM_DIV_7
* @arg @ref LL_RCC_PLLM_DIV_8
- * @param PLLN Between 8 and 86
+ * @param PLLN Between 6 and 127
* @param PLLQ This parameter can be one of the following values:
* @arg @ref LL_RCC_PLLSAI1Q_DIV_2
* @arg @ref LL_RCC_PLLSAI1Q_DIV_3
@@ -3443,7 +3443,7 @@ __STATIC_INLINE void LL_RCC_PLLSAI1_ConfigDomain_48M(uint32_t Source, uint32_t P
* @arg @ref LL_RCC_PLLM_DIV_6
* @arg @ref LL_RCC_PLLM_DIV_7
* @arg @ref LL_RCC_PLLM_DIV_8
- * @param PLLN Between 8 and 86
+ * @param PLLN Between 6 and 127
* @param PLLP This parameter can be one of the following values:
* @arg @ref LL_RCC_PLLSAI1P_DIV_2
* @arg @ref LL_RCC_PLLSAI1P_DIV_3
@@ -3509,7 +3509,7 @@ __STATIC_INLINE void LL_RCC_PLLSAI1_ConfigDomain_SAI(uint32_t Source, uint32_t P
* @arg @ref LL_RCC_PLLM_DIV_6
* @arg @ref LL_RCC_PLLM_DIV_7
* @arg @ref LL_RCC_PLLM_DIV_8
- * @param PLLN Between 8 and 86
+ * @param PLLN Between 6 and 127
* @param PLLR This parameter can be one of the following values:
* @arg @ref LL_RCC_PLLSAI1R_DIV_2
* @arg @ref LL_RCC_PLLSAI1R_DIV_3
@@ -3529,7 +3529,7 @@ __STATIC_INLINE void LL_RCC_PLLSAI1_ConfigDomain_ADC(uint32_t Source, uint32_t P
/**
* @brief Get SAI1PLL multiplication factor for VCO
* @rmtoll PLLSAI1CFGR PLLN LL_RCC_PLLSAI1_GetN
- * @retval Between 8 and 86
+ * @retval Between 6 and 127
*/
__STATIC_INLINE uint32_t LL_RCC_PLLSAI1_GetN(void)
{
diff --git a/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_ll_system.h b/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_ll_system.h
index 2a313c87e..89bacd005 100644
--- a/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_ll_system.h
+++ b/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_ll_system.h
@@ -2182,8 +2182,8 @@ __STATIC_INLINE uint32_t LL_FLASH_GetUDN(void)
* @brief Return the Device ID
* @note The 64-bit UID64 may be used by Firmware to derive BLE 48-bit Device Address EUI-48 or
* 802.15.4 64-bit Device Address EUI-64.
- * For STM32WBxxxx devices, the device ID is 0x05
- * @retval Values between Min_Data=0x00 and Max_Data=0xFF (ex: Device ID is 0x05)
+ * For STM32WBxxxx devices, the device ID is 0x26
+ * @retval Values between Min_Data=0x00 and Max_Data=0xFF (ex: Device ID is 0x26 fo STM32WB55x)
*/
__STATIC_INLINE uint32_t LL_FLASH_GetDeviceID(void)
{
diff --git a/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_ll_tim.h b/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_ll_tim.h
index 5231a67b5..f7d2fc5c4 100644
--- a/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_ll_tim.h
+++ b/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_ll_tim.h
@@ -924,14 +924,15 @@ typedef struct
/** @defgroup TIM_LL_EC_ETRSOURCE External Trigger Source
* @{
*/
-#define LL_TIM_ETRSOURCE_GPIO 0x00000000U /*!< ETR input is connected to GPIO */
+#define LL_TIM_ETRSOURCE_LEGACY 0x00000000U /*!< ETR legacy mode */
#if defined(COMP1) && defined(COMP2)
#define LL_TIM_ETRSOURCE_COMP1 TIM1_AF1_ETRSEL_0 /*!< ETR input is connected to COMP1_OUT */
#define LL_TIM_ETRSOURCE_COMP2 TIM1_AF1_ETRSEL_1 /*!< ETR input is connected to COMP2_OUT */
#endif /* COMP1 && COMP2 */
-#define LL_TIM_ETRSOURCE_ADC1_AWD1 (TIM1_AF1_ETRSEL_1 | TIM1_AF1_ETRSEL_0) /*!< ETR input is connected to ADC1 analog watchdog 1 */
-#define LL_TIM_ETRSOURCE_ADC1_AWD2 TIM1_AF1_ETRSEL_2 /*!< ETR input is connected to ADC1 analog watchdog 2 */
-#define LL_TIM_ETRSOURCE_ADC1_AWD3 (TIM1_AF1_ETRSEL_2 | TIM1_AF1_ETRSEL_0) /*!< ETR input is connected to ADC1 analog watchdog 3 */
+#define LL_TIM_ETRSOURCE_GPIO LL_TIM_ETRSOURCE_LEGACY /*!< ETR input is connected to GPIO through TIMx ETR remapping capability */
+#define LL_TIM_ETRSOURCE_ADC1_AWD1 LL_TIM_ETRSOURCE_LEGACY /*!< ETR input is connected to ADC1 analog watchdog 1 through TIMx ETR remapping capability */
+#define LL_TIM_ETRSOURCE_ADC1_AWD2 LL_TIM_ETRSOURCE_LEGACY /*!< ETR input is connected to ADC1 analog watchdog 2 through TIMx ETR remapping capability */
+#define LL_TIM_ETRSOURCE_ADC1_AWD3 LL_TIM_ETRSOURCE_LEGACY /*!< ETR input is connected to ADC1 analog watchdog 3 through TIMx ETR remapping capability */
/**
* @}
*/
@@ -1129,7 +1130,7 @@ typedef struct
/** @defgroup TIM_LL_EC_TIM2_ITR1_RMP TIM2 Internal Trigger1 Remap
* @{
*/
-#define LL_TIM_TIM2_ITR1_RMP_NONE 0x00000000U /* !< No internal trigger on TIM2_ITR1 */
+#define LL_TIM_TIM2_ITR1_RMP_NONE TIM2_OR_RMP_MASK /* !< No internal trigger on TIM2_ITR1 */
#if defined(USB)
#define LL_TIM_TIM2_ITR1_RMP_USB_SOF (TIM2_OR_ITR1_RMP) /* !< TIM2_ITR1 is connected to USB SOF */
#endif /* USB */
@@ -3294,15 +3295,19 @@ __STATIC_INLINE void LL_TIM_ConfigETR(TIM_TypeDef *TIMx, uint32_t ETRPolarity, u
* @brief Select the external trigger (ETR) input source.
* @note Macro IS_TIM_ETRSEL_INSTANCE(TIMx) can be used to check whether or
* not a timer instance supports ETR source selection.
+ * @note When this function is called with LL_TIM_ETRSOURCE_GPIO,
+ * LL_TIM_ETRSOURCE_ADC1_AWD1, LL_TIM_ETRSOURCE_ADC1_AWD2 or
+ * LL_TIM_ETRSOURCE_ADC1_AWD3, ETR source relies on TIMx ETR remapping
+ * capability configured through the function @ref LL_TIM_SetRemap().
* @rmtoll AF1 ETRSEL LL_TIM_SetETRSource
* @param TIMx Timer instance
* @param ETRSource This parameter can be one of the following values:
* @arg @ref LL_TIM_ETRSOURCE_GPIO
- * @arg @ref LL_TIM_ETRSOURCE_COMP1
- * @arg @ref LL_TIM_ETRSOURCE_COMP2
* @arg @ref LL_TIM_ETRSOURCE_ADC1_AWD1
* @arg @ref LL_TIM_ETRSOURCE_ADC1_AWD2
* @arg @ref LL_TIM_ETRSOURCE_ADC1_AWD3
+ * @arg @ref LL_TIM_ETRSOURCE_COMP1
+ * @arg @ref LL_TIM_ETRSOURCE_COMP2
* @retval None
*/
__STATIC_INLINE void LL_TIM_SetETRSource(TIM_TypeDef *TIMx, uint32_t ETRSource)
diff --git a/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_ll_utils.h b/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_ll_utils.h
index 733cc15c5..e7c172211 100644
--- a/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_ll_utils.h
+++ b/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_ll_utils.h
@@ -18,11 +18,11 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
- * the "License"; You may not use this file except in compliance with the
+ * the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
@@ -101,7 +101,7 @@ typedef struct
@ref LL_RCC_PLL_ConfigDomain_SYS(). */
uint32_t PLLN; /*!< Multiplication factor for PLL VCO output clock.
- This parameter must be a number between Min_Data = 8 and Max_Data = 86
+ This parameter must be a number between Min_Data = 6 and Max_Data = 127
This feature can be modified afterwards using unitary function
@ref LL_RCC_PLL_ConfigDomain_SYS(). */
@@ -195,59 +195,59 @@ typedef struct
/** @defgroup UTILS_EF_DEVICE_ELECTRONIC_SIGNATURE DEVICE ELECTRONIC SIGNATURE
* @{
*/
- /**
- * @brief Get Word0 of the unique device identifier (UID based on 96 bits)
- * @retval UID[31:0]: X and Y coordinates on the wafer expressed in BCD format
- */
- __STATIC_INLINE uint32_t LL_GetUID_Word0(void)
- {
- return (uint32_t)(READ_REG(*((uint32_t *)UID_BASE_ADDRESS)));
- }
-
- /**
- * @brief Get Word1 of the unique device identifier (UID based on 96 bits)
- * @retval UID[63:32]: Wafer number (UID[39:32]) & LOT_NUM[23:0] (UID[63:40])
- */
- __STATIC_INLINE uint32_t LL_GetUID_Word1(void)
- {
- return (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE_ADDRESS + 4U))));
- }
-
- /**
- * @brief Get Word2 of the unique device identifier (UID based on 96 bits)
- * @retval UID[95:64]: Lot number (ASCII encoded) - LOT_NUM[55:24]
- */
- __STATIC_INLINE uint32_t LL_GetUID_Word2(void)
- {
- return (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE_ADDRESS + 8U))));
- }
-
- /**
- * @brief Get Flash memory size
- * @note This bitfield indicates the size of the device Flash memory expressed in
- * Kbytes. As an example, 0x040 corresponds to 64 Kbytes.
- * @retval FLASH_SIZE[15:0]: Flash memory size
- */
- __STATIC_INLINE uint32_t LL_GetFlashSize(void)
- {
- return (uint32_t)(READ_REG(*((uint32_t *)FLASHSIZE_BASE_ADDRESS)) & 0x0000FFFFUL);
- }
-
- /**
- * @brief Get Package type
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_UTILS_PACKAGETYPE_CSP100
- * @arg @ref LL_UTILS_PACKAGETYPE_CSP100_C
- * @arg @ref LL_UTILS_PACKAGETYPE_QFN68
- * @arg @ref LL_UTILS_PACKAGETYPE_QFN68_C
- * @arg @ref LL_UTILS_PACKAGETYPE_QFN48
- * @arg @ref LL_UTILS_PACKAGETYPE_QFN48_C
- *
- */
- __STATIC_INLINE uint32_t LL_GetPackageType(void)
- {
- return (uint32_t)(READ_REG(*((uint32_t *)PACKAGE_BASE_ADDRESS)) & 0x1FU);
- }
+/**
+ * @brief Get Word0 of the unique device identifier (UID based on 96 bits)
+ * @retval UID[31:0]: X and Y coordinates on the wafer expressed in BCD format
+ */
+__STATIC_INLINE uint32_t LL_GetUID_Word0(void)
+{
+ return (uint32_t)(READ_REG(*((uint32_t *)UID_BASE_ADDRESS)));
+}
+
+/**
+ * @brief Get Word1 of the unique device identifier (UID based on 96 bits)
+ * @retval UID[63:32]: Wafer number (UID[39:32]) & LOT_NUM[23:0] (UID[63:40])
+ */
+__STATIC_INLINE uint32_t LL_GetUID_Word1(void)
+{
+ return (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE_ADDRESS + 4U))));
+}
+
+/**
+ * @brief Get Word2 of the unique device identifier (UID based on 96 bits)
+ * @retval UID[95:64]: Lot number (ASCII encoded) - LOT_NUM[55:24]
+ */
+__STATIC_INLINE uint32_t LL_GetUID_Word2(void)
+{
+ return (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE_ADDRESS + 8U))));
+}
+
+/**
+ * @brief Get Flash memory size
+ * @note This bitfield indicates the size of the device Flash memory expressed in
+ * Kbytes. As an example, 0x040 corresponds to 64 Kbytes.
+ * @retval FLASH_SIZE[15:0]: Flash memory size
+ */
+__STATIC_INLINE uint32_t LL_GetFlashSize(void)
+{
+ return (uint32_t)(READ_REG(*((uint32_t *)FLASHSIZE_BASE_ADDRESS)) & 0x0000FFFFUL);
+}
+
+/**
+ * @brief Get Package type
+ * @retval Returned value can be one of the following values:
+ * @arg @ref LL_UTILS_PACKAGETYPE_CSP100
+ * @arg @ref LL_UTILS_PACKAGETYPE_CSP100_C
+ * @arg @ref LL_UTILS_PACKAGETYPE_QFN68
+ * @arg @ref LL_UTILS_PACKAGETYPE_QFN68_C
+ * @arg @ref LL_UTILS_PACKAGETYPE_QFN48
+ * @arg @ref LL_UTILS_PACKAGETYPE_QFN48_C
+ *
+ */
+__STATIC_INLINE uint32_t LL_GetPackageType(void)
+{
+ return (uint32_t)(READ_REG(*((uint32_t *)PACKAGE_BASE_ADDRESS)) & 0x1FU);
+}
/**
* @}
diff --git a/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_ll_wwdg.h b/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_ll_wwdg.h
index cb6c74b46..5bc7d87cf 100644
--- a/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_ll_wwdg.h
+++ b/Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_ll_wwdg.h
@@ -58,8 +58,8 @@ extern "C" {
*/
/** @defgroup WWDG_LL_EC_PRESCALER PRESCALER
-* @{
-*/
+ * @{
+ */
#define LL_WWDG_PRESCALER_1 0x00000000u /*!< WWDG counter clock = (PCLK1/4096)/1 */
#define LL_WWDG_PRESCALER_2 WWDG_CFR_WDGTB_0 /*!< WWDG counter clock = (PCLK1/4096)/2 */
#define LL_WWDG_PRESCALER_4 WWDG_CFR_WDGTB_1 /*!< WWDG counter clock = (PCLK1/4096)/4 */
@@ -183,7 +183,7 @@ __STATIC_INLINE uint32_t LL_WWDG_GetCounter(WWDG_TypeDef *WWDGx)
* @arg @ref LL_WWDG_PRESCALER_32
* @arg @ref LL_WWDG_PRESCALER_64
* @arg @ref LL_WWDG_PRESCALER_128
-* @retval None
+ * @retval None
*/
__STATIC_INLINE void LL_WWDG_SetPrescaler(WWDG_TypeDef *WWDGx, uint32_t Prescaler)
{
diff --git a/Drivers/STM32WBxx_HAL_Driver/Release_Notes.html b/Drivers/STM32WBxx_HAL_Driver/Release_Notes.html
index 3613db747..9eb79c70c 100644
--- a/Drivers/STM32WBxx_HAL_Driver/Release_Notes.html
+++ b/Drivers/STM32WBxx_HAL_Driver/Release_Notes.html
@@ -46,9 +46,91 @@
<div class="col-sm-12 col-lg-8">
<h1 id="update-history">Update History</h1>
<div class="collapse">
-<input type="checkbox" id="collapse-section3" checked aria-hidden="true"> <label for="collapse-section3" aria-hidden="true">V1.2.0 / 26-June-2019</label>
+<input type="checkbox" id="collapse-section4" checked aria-hidden="true"> <label for="collapse-section4" aria-hidden="true">v1.3.0 / 11-September-2019</label>
<div>
<h2 id="main-changes">Main Changes</h2>
+<h3 id="maitenance-release">Maitenance release</h3>
+<table>
+<thead>
+<tr class="header">
+<th>Peripheral</th>
+<th style="text-align: left;">Headline</th>
+</tr>
+</thead>
+<tbody>
+<tr class="odd">
+<td>CRYP</td>
+<td style="text-align: left;">Document a restriction regarding size field on HAL_CRYP_Encrypt_DMA, HAL_CRYP_Decrypt_DMA API.</td>
+</tr>
+<tr class="even">
+<td>CRYP</td>
+<td style="text-align: left;">Correct several MISRA C:2012 and Code Sonar compliancy improvements.</td>
+</tr>
+<tr class="odd">
+<td>FLASH</td>
+<td style="text-align: left;">Move FLASH_SIZE define from hal flash. h to cmsis device file</td>
+</tr>
+<tr class="even">
+<td>FLASH</td>
+<td style="text-align: left;">Correct ECC management in HAL FLASH driver</td>
+</tr>
+<tr class="odd">
+<td>FLASH</td>
+<td style="text-align: left;">Correct #define in stm32wbxx_hal_flash.h - FLASH_PAGE_NB</td>
+</tr>
+<tr class="even">
+<td>RCC</td>
+<td style="text-align: left;">Correct PLL characteristics</td>
+</tr>
+<tr class="odd">
+<td>TIMER</td>
+<td style="text-align: left;">Add assertion check inside HAL_TIMEx_MasterConfigSynchronization</td>
+</tr>
+<tr class="even">
+<td>TIMER</td>
+<td style="text-align: left;">Make LL_TIM_SetETRSource in line with RM0434</td>
+</tr>
+<tr class="odd">
+<td>WWDG</td>
+<td style="text-align: left;">Correct typical frequency computation description inside the header file</td>
+</tr>
+<tr class="even">
+<td>IRDA</td>
+<td style="text-align: left;">Improve the description of the APIs</td>
+</tr>
+<tr class="odd">
+<td>SMARTCARD</td>
+<td style="text-align: left;">Fix GCC compilation warning</td>
+</tr>
+<tr class="even">
+<td>UART</td>
+<td style="text-align: left;">Correct possible overflow with wordlength = 9bits and NO parity in HAL_UART_Transmit() and HAL_IRDA_Transmit()</td>
+</tr>
+<tr class="odd">
+<td>UART</td>
+<td style="text-align: left;">Fix GCC compilation warning</td>
+</tr>
+<tr class="even">
+<td>USART</td>
+<td style="text-align: left;">Correct possible overflow with wordlength = 9bits and NO parity in HAL_UART_Transmit() and HAL_IRDA_Transmit()</td>
+</tr>
+<tr class="odd">
+<td>USART</td>
+<td style="text-align: left;">Fix GCC compilation warning</td>
+</tr>
+</tbody>
+</table>
+<h2 id="backward-compatibility">Backward Compatibility</h2>
+<p>This release is compatible with the previous versions.</p>
+<h2 id="dependencies">Dependencies</h2>
+<p>This software release is compatible with:</p>
+<p>STM32CubeMX V5.4.0</p>
+</div>
+</div>
+<div class="collapse">
+<input type="checkbox" id="collapse-section3" aria-hidden="true"> <label for="collapse-section3" aria-hidden="true">V1.2.0 / 26-June-2019</label>
+<div>
+<h2 id="main-changes-1">Main Changes</h2>
<h3 id="stm32wb50xx-introduction-and-maintenance-release">STM32WB50xx introduction and maintenance release</h3>
<p>First release for STM32WBxx HAL drivers introducing <strong>stm32wb50xx</strong> devices.</p>
<table>
@@ -117,9 +199,9 @@
</tr>
</tbody>
</table>
-<h2 id="backward-compatibility">Backward Compatibility</h2>
+<h2 id="backward-compatibility-1">Backward Compatibility</h2>
<p>This release is compatible with the previous versions.</p>
-<h2 id="dependencies">Dependencies</h2>
+<h2 id="dependencies-1">Dependencies</h2>
<p>This software release is compatible with:</p>
<p>STM32CubeMX V5.3.0</p>
</div>
@@ -127,7 +209,7 @@
<div class="collapse">
<input type="checkbox" id="collapse-section2" aria-hidden="true"> <label for="collapse-section2" aria-hidden="true">V1.1.0 / 05-April-2019</label>
<div>
-<h2 id="main-changes-1">Main Changes</h2>
+<h2 id="main-changes-2">Main Changes</h2>
<h3 id="maintenance-release">Maintenance release</h3>
<p>Maintenance release of HAL and Low layers drivers supporting STM32WB55xx devices.</p>
<table>
@@ -181,9 +263,9 @@
</tr>
</tbody>
</table>
-<h2 id="backward-compatibility-1">Backward Compatibility</h2>
+<h2 id="backward-compatibility-2">Backward Compatibility</h2>
<p>This release is compatible with the previous versions.</p>
-<h2 id="dependencies-1">Dependencies</h2>
+<h2 id="dependencies-2">Dependencies</h2>
<p>This software release is compatible with:</p>
<p>STM32CubeMX V5.2.0</p>
</div>
@@ -191,7 +273,7 @@
<div class="collapse">
<input type="checkbox" id="collapse-section1" aria-hidden="true"> <label for="collapse-section1" aria-hidden="true">V1.0.0 / 06-February-2019</label>
<div>
-<h2 id="main-changes-2">Main Changes</h2>
+<h2 id="main-changes-3">Main Changes</h2>
<h3 id="first-release">First release</h3>
<p>First official release of HAL (Hardware Abstraction Layer) and LL (Low layers) drivers to support STM32WB55xx.</p>
</div>
diff --git a/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal.c b/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal.c
index 3d4ce0185..8513cb7f7 100644
--- a/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal.c
+++ b/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal.c
@@ -56,7 +56,7 @@
* @brief STM32WBxx HAL Driver version number
*/
#define __STM32WBxx_HAL_VERSION_MAIN (0x01U) /*!< [31:24] main version */
-#define __STM32WBxx_HAL_VERSION_SUB1 (0x02U) /*!< [23:16] sub1 version */
+#define __STM32WBxx_HAL_VERSION_SUB1 (0x03U) /*!< [23:16] sub1 version */
#define __STM32WBxx_HAL_VERSION_SUB2 (0x00U) /*!< [15:8] sub2 version */
#define __STM32WBxx_HAL_VERSION_RC (0x00U) /*!< [7:0] release candidate */
#define __STM32WBxx_HAL_VERSION ((__STM32WBxx_HAL_VERSION_MAIN << 24U)\
@@ -64,7 +64,9 @@
|(__STM32WBxx_HAL_VERSION_SUB2 << 8U )\
|(__STM32WBxx_HAL_VERSION_RC))
+#if defined(VREFBUF)
#define VREFBUF_TIMEOUT_VALUE 10U /* 10 ms */
+#endif
/**
* @}
@@ -700,7 +702,7 @@ void HAL_SYSCFG_DisableVREFBUF(void)
{
LL_VREFBUF_Disable();
}
-#endif
+#endif /* VREFBUF */
/**
* @brief Enable the I/O analog switch voltage booster
diff --git a/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_cryp.c b/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_cryp.c
index 0aa1b0033..fab75d482 100644
--- a/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_cryp.c
+++ b/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_cryp.c
@@ -161,18 +161,18 @@
GCM standard specifies that ciphertext has same bit length as the plaintext.
(##) The last block is composed of the length of A (on 64 bits) and the length of ciphertext
(on 64 bits)
-
- [..] A more detailed description of the GCM message structure is available below.
+
+ [..] A more detailed description of the GCM message structure is available below.
[..] This section describe The AES Counter with Cipher Block Chaining-Message
Authentication Code (CCM) supported by both CRYP1 and TinyAES peripheral:
(#) Specific parameters for CCM :
(##) B0 block : follows NIST Special Publication 800-38C,
- (##) B1 block (header)
+ (##) B1 block (header)
(##) CTRx block : control blocks
-
- [..] A detailed description of the CCM message structure is available below.
+
+ [..] A detailed description of the CCM message structure is available below.
(#) Four phases are performed in CCM for CRYP1 peripheral:
(##) Init phase: peripheral prepares the GCM hash subkey (H) and do the IV processing
@@ -189,13 +189,15 @@
(##) Final phase: peripheral generates the authenticated tag (T) using the last block of data.
*** Callback registration ***
- =============================================
+ =============================
+ [..]
The compilation define USE_HAL_CRYP_REGISTER_CALLBACKS when set to 1
allows the user to configure dynamically the driver callbacks.
Use Functions @ref HAL_CRYP_RegisterCallback() or HAL_CRYP_RegisterXXXCallback()
to register an interrupt callback.
+ [..]
Function @ref HAL_CRYP_RegisterCallback() allows to register following callbacks:
(+) InCpltCallback : Input FIFO transfer completed callback.
(+) OutCpltCallback : Output FIFO transfer completed callback.
@@ -205,6 +207,7 @@
This function takes as parameters the HAL peripheral handle, the Callback ID
and a pointer to the user callback function.
+ [..]
Use function @ref HAL_CRYP_UnRegisterCallback() to reset a callback to the default
weak function.
@ref HAL_CRYP_UnRegisterCallback() takes as parameters the HAL peripheral handle,
@@ -216,6 +219,7 @@
(+) MspInitCallback : CRYP MspInit.
(+) MspDeInitCallback : CRYP MspDeInit.
+ [..]
By default, after the @ref HAL_CRYP_Init() and when the state is HAL_CRYP_STATE_RESET
all callbacks are set to the corresponding weak functions :
examples @ref HAL_CRYP_InCpltCallback() , @ref HAL_CRYP_OutCpltCallback().
@@ -225,6 +229,7 @@
if not, MspInit or MspDeInit are not null, the @ref HAL_CRYP_Init() / @ref HAL_CRYP_DeInit()
keep and use the user MspInit/MspDeInit functions (registered beforehand)
+ [..]
Callbacks can be registered/unregistered in HAL_CRYP_STATE_READY state only.
Exception done MspInit/MspDeInit callbacks that can be registered/unregistered
in HAL_CRYP_STATE_READY or HAL_CRYP_STATE_RESET state,
@@ -233,14 +238,16 @@
using @ref HAL_CRYP_RegisterCallback() before calling @ref HAL_CRYP_DeInit()
or @ref HAL_CRYP_Init() function.
+ [..]
When The compilation define USE_HAL_CRYP_REGISTER_CALLBACKS is set to 0 or
not defined, the callback registration feature is not available and all callbacks
are set to the corresponding weak functions.
*** Suspend/Resume feature ***
- =============================================
+ ==============================
+ [..]
The compilation define USE_HAL_CRYP_SUSPEND_RESUME when set to 1
allows the user to resort to the suspend/resume feature.
A low priority block processing can be suspended to process a high priority block
@@ -915,11 +922,15 @@ void HAL_CRYP_ProcessSuspend(CRYP_HandleTypeDef *hcryp)
*/
HAL_StatusTypeDef HAL_CRYP_Suspend(CRYP_HandleTypeDef *hcryp)
{
+ HAL_CRYP_STATETypeDef state;
+
/* Request suspension */
HAL_CRYP_ProcessSuspend(hcryp);
- while ((HAL_CRYP_GetState(hcryp) != HAL_CRYP_STATE_SUSPENDED) && \
- (HAL_CRYP_GetState(hcryp) != HAL_CRYP_STATE_READY));
+ do
+ {
+ state = HAL_CRYP_GetState(hcryp);
+ } while ((state != HAL_CRYP_STATE_SUSPENDED) && (state != HAL_CRYP_STATE_READY));
if (HAL_CRYP_GetState(hcryp) == HAL_CRYP_STATE_READY)
{
@@ -953,7 +964,7 @@ HAL_StatusTypeDef HAL_CRYP_Suspend(CRYP_HandleTypeDef *hcryp)
hcryp->CrypOutCount_saved = hcryp->CrypOutCount;
hcryp->Phase_saved = hcryp->Phase;
hcryp->State_saved = hcryp->State;
- hcryp->Size_saved = ( (hcryp->Init.DataWidthUnit == CRYP_DATAWIDTHUNIT_WORD) ? hcryp->Size /4 : hcryp->Size);
+ hcryp->Size_saved = ( (hcryp->Init.DataWidthUnit == CRYP_DATAWIDTHUNIT_WORD) ? (hcryp->Size /4U) : hcryp->Size);
hcryp->AutoKeyDerivation_saved = hcryp->AutoKeyDerivation;
hcryp->CrypHeaderCount_saved = hcryp->CrypHeaderCount;
hcryp->SuspendRequest = HAL_CRYP_SUSPEND_NONE;
@@ -983,6 +994,12 @@ HAL_StatusTypeDef HAL_CRYP_Suspend(CRYP_HandleTypeDef *hcryp)
*/
HAL_StatusTypeDef HAL_CRYP_Resume(CRYP_HandleTypeDef *hcryp)
{
+ /* Check the CRYP handle allocation */
+ if (hcryp == NULL)
+ {
+ return HAL_ERROR;
+ }
+
if (hcryp->State_saved != HAL_CRYP_STATE_SUSPENDED)
{
/* CRYP was not suspended */
@@ -1009,10 +1026,7 @@ HAL_StatusTypeDef HAL_CRYP_Resume(CRYP_HandleTypeDef *hcryp)
hcryp->Init.pInitVect = hcryp->IV_saved;
}
__HAL_CRYP_DISABLE(hcryp);
- if (HAL_CRYP_Init(hcryp) != HAL_OK)
- {
- return HAL_ERROR;
- }
+ (void) HAL_CRYP_Init(hcryp);
}
else /* Authentication algorithms case */
{
@@ -1180,6 +1194,12 @@ HAL_StatusTypeDef HAL_CRYP_Encrypt(CRYP_HandleTypeDef *hcryp, uint32_t *Input, u
{
uint32_t algo;
HAL_StatusTypeDef status;
+#ifdef USE_FULL_ASSERT
+ uint32_t algo_assert = (hcryp->Instance->CR) & AES_CR_CHMOD;
+
+ /* Check input buffer size */
+ assert_param(IS_CRYP_BUFFERSIZE(algo_assert, hcryp->Init.DataWidthUnit, Size));
+#endif
if (hcryp->State == HAL_CRYP_STATE_READY)
{
@@ -1274,6 +1294,12 @@ HAL_StatusTypeDef HAL_CRYP_Decrypt(CRYP_HandleTypeDef *hcryp, uint32_t *Input, u
{
HAL_StatusTypeDef status;
uint32_t algo;
+#ifdef USE_FULL_ASSERT
+ uint32_t algo_assert = (hcryp->Instance->CR) & AES_CR_CHMOD;
+
+ /* Check input buffer size */
+ assert_param(IS_CRYP_BUFFERSIZE(algo_assert, hcryp->Init.DataWidthUnit, Size));
+#endif
if (hcryp->State == HAL_CRYP_STATE_READY)
{
@@ -1367,6 +1393,12 @@ HAL_StatusTypeDef HAL_CRYP_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint32_t *Input
{
HAL_StatusTypeDef status;
uint32_t algo;
+#ifdef USE_FULL_ASSERT
+ uint32_t algo_assert = (hcryp->Instance->CR) & AES_CR_CHMOD;
+
+ /* Check input buffer size */
+ assert_param(IS_CRYP_BUFFERSIZE(algo_assert, hcryp->Init.DataWidthUnit, Size));
+#endif
if (hcryp->State == HAL_CRYP_STATE_READY)
{
@@ -1383,8 +1415,8 @@ HAL_StatusTypeDef HAL_CRYP_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint32_t *Input
hcryp->ResumingFlag = 0U;
if (hcryp->Phase != CRYP_PHASE_HEADER_SUSPENDED)
{
- hcryp->CrypInCount = hcryp->CrypInCount_saved;
- hcryp->CrypOutCount = hcryp->CrypOutCount_saved;
+ hcryp->CrypInCount = (uint16_t) hcryp->CrypInCount_saved;
+ hcryp->CrypOutCount = (uint16_t) hcryp->CrypOutCount_saved;
}
else
{
@@ -1471,6 +1503,12 @@ HAL_StatusTypeDef HAL_CRYP_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint32_t *Input
{
HAL_StatusTypeDef status;
uint32_t algo;
+#ifdef USE_FULL_ASSERT
+ uint32_t algo_assert = (hcryp->Instance->CR) & AES_CR_CHMOD;
+
+ /* Check input buffer size */
+ assert_param(IS_CRYP_BUFFERSIZE(algo_assert, hcryp->Init.DataWidthUnit, Size));
+#endif
if (hcryp->State == HAL_CRYP_STATE_READY)
{
@@ -1487,8 +1525,8 @@ HAL_StatusTypeDef HAL_CRYP_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint32_t *Input
hcryp->ResumingFlag = 0U;
if (hcryp->Phase != CRYP_PHASE_HEADER_SUSPENDED)
{
- hcryp->CrypInCount = hcryp->CrypInCount_saved;
- hcryp->CrypOutCount = hcryp->CrypOutCount_saved;
+ hcryp->CrypInCount = (uint16_t) hcryp->CrypInCount_saved;
+ hcryp->CrypOutCount = (uint16_t) hcryp->CrypOutCount_saved;
}
else
{
@@ -1575,6 +1613,12 @@ HAL_StatusTypeDef HAL_CRYP_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint32_t *Inpu
HAL_StatusTypeDef status;
uint32_t algo;
uint32_t DoKeyIVConfig = 1U; /* By default, carry out peripheral Key and IV configuration */
+#ifdef USE_FULL_ASSERT
+ uint32_t algo_assert = (hcryp->Instance->CR) & AES_CR_CHMOD;
+
+ /* Check input buffer size */
+ assert_param(IS_CRYP_BUFFERSIZE(algo_assert, hcryp->Init.DataWidthUnit, Size));
+#endif
if (hcryp->State == HAL_CRYP_STATE_READY)
{
@@ -1695,6 +1739,12 @@ HAL_StatusTypeDef HAL_CRYP_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint32_t *Inpu
{
HAL_StatusTypeDef status;
uint32_t algo;
+#ifdef USE_FULL_ASSERT
+ uint32_t algo_assert = (hcryp->Instance->CR) & AES_CR_CHMOD;
+
+ /* Check input buffer size */
+ assert_param(IS_CRYP_BUFFERSIZE(algo_assert, hcryp->Init.DataWidthUnit, Size));
+#endif
if (hcryp->State == HAL_CRYP_STATE_READY)
{
@@ -5015,7 +5065,7 @@ static void CRYP_Read_SuspendRegisters(CRYP_HandleTypeDef *hcryp, uint32_t* Outp
__IO uint32_t count = 0U;
/* In case of GCM payload phase encryption, check that suspension can be carried out */
- if (READ_BIT(hcryp->Instance->CR, (AES_CR_CHMOD|AES_CR_GCMPH|AES_CR_MODE)) == (CRYP_AES_GCM_GMAC|AES_CR_GCMPH_1|0x0))
+ if (READ_BIT(hcryp->Instance->CR, (AES_CR_CHMOD|AES_CR_GCMPH|AES_CR_MODE)) == (CRYP_AES_GCM_GMAC|AES_CR_GCMPH_1|0x0U))
{
/* Wait for BUSY flag to be cleared */
@@ -5153,21 +5203,21 @@ static void CRYP_Write_KeyRegisters(CRYP_HandleTypeDef *hcryp, uint32_t* Input,
if (KeySize == CRYP_KEYSIZE_256B)
{
hcryp->Instance->KEYR7 = *(uint32_t*)(keyaddr);
- keyaddr+=4;
+ keyaddr+=4U;
hcryp->Instance->KEYR6 = *(uint32_t*)(keyaddr);
- keyaddr+=4;
+ keyaddr+=4U;
hcryp->Instance->KEYR5 = *(uint32_t*)(keyaddr);
- keyaddr+=4;
+ keyaddr+=4U;
hcryp->Instance->KEYR4 = *(uint32_t*)(keyaddr);
- keyaddr+=4;
+ keyaddr+=4U;
}
hcryp->Instance->KEYR3 = *(uint32_t*)(keyaddr);
- keyaddr+=4;
+ keyaddr+=4U;
hcryp->Instance->KEYR2 = *(uint32_t*)(keyaddr);
- keyaddr+=4;
+ keyaddr+=4U;
hcryp->Instance->KEYR1 = *(uint32_t*)(keyaddr);
- keyaddr+=4;
+ keyaddr+=4U;
hcryp->Instance->KEYR0 = *(uint32_t*)(keyaddr);
}
@@ -5179,9 +5229,10 @@ static void CRYP_Write_KeyRegisters(CRYP_HandleTypeDef *hcryp, uint32_t* Input,
*/
static void CRYP_PhaseProcessingResume(CRYP_HandleTypeDef *hcryp)
{
- uint32_t loopcounter = 0U;
- uint32_t lastwordsize =0;
- uint32_t npblb = 0U ;
+ uint32_t loopcounter;
+ uint16_t lastwordsize;
+ uint16_t npblb;
+ uint32_t cr_temp;
/* Case of header phase resumption =================================================*/
if (hcryp->Phase == CRYP_PHASE_HEADER_SUSPENDED)
@@ -5192,7 +5243,7 @@ static void CRYP_PhaseProcessingResume(CRYP_HandleTypeDef *hcryp)
/* Select header phase */
CRYP_SET_PHASE(hcryp, CRYP_PHASE_HEADER);
- if (((hcryp->Init.HeaderSize) - (hcryp->CrypHeaderCount) >= 4U))
+ if ((((hcryp->Init.HeaderSize) - (hcryp->CrypHeaderCount)) >= 4U))
{
/* Write the input block in the IN FIFO */
hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount );
@@ -5221,73 +5272,77 @@ static void CRYP_PhaseProcessingResume(CRYP_HandleTypeDef *hcryp)
}
}
/* Case of payload phase resumption =================================================*/
- else if (hcryp->Phase == CRYP_PHASE_PAYLOAD_SUSPENDED)
+ else
{
+ if (hcryp->Phase == CRYP_PHASE_PAYLOAD_SUSPENDED)
+ {
- /* Set the phase */
- hcryp->Phase = CRYP_PHASE_PROCESS;
+ /* Set the phase */
+ hcryp->Phase = CRYP_PHASE_PROCESS;
- /* Select payload phase once the header phase is performed */
- MODIFY_REG(hcryp->Instance->CR, AES_CR_GCMPH, CRYP_PHASE_PAYLOAD);
+ /* Select payload phase once the header phase is performed */
+ MODIFY_REG(hcryp->Instance->CR, AES_CR_GCMPH, CRYP_PHASE_PAYLOAD);
- /* Set to 0 the number of non-valid bytes using NPBLB register*/
- MODIFY_REG(hcryp->Instance->CR, AES_CR_NPBLB, 0U);
+ /* Set to 0 the number of non-valid bytes using NPBLB register*/
+ MODIFY_REG(hcryp->Instance->CR, AES_CR_NPBLB, 0U);
- if ((hcryp->Size/4) - (hcryp->CrypInCount) >= 4U)
- {
- /* Write the input block in the IN FIFO */
- hcryp->Instance->DINR = *(uint32_t *)(hcryp->pCrypInBuffPtr + hcryp->CrypInCount );
- hcryp->CrypInCount++;
- hcryp->Instance->DINR = *(uint32_t *)(hcryp->pCrypInBuffPtr + hcryp->CrypInCount );
- hcryp->CrypInCount++;
- hcryp->Instance->DINR = *(uint32_t *)(hcryp->pCrypInBuffPtr + hcryp->CrypInCount );
- hcryp->CrypInCount++;
- hcryp->Instance->DINR = *(uint32_t *)(hcryp->pCrypInBuffPtr + hcryp->CrypInCount );
- hcryp->CrypInCount++;
- if((hcryp->CrypInCount == hcryp->Size) && (hcryp->Init.Algorithm == CRYP_AES_GCM_GMAC))
+ if (((hcryp->Size/4U) - (hcryp->CrypInCount)) >= 4U)
{
- /* Call output transfer complete callback */
+ /* Write the input block in the IN FIFO */
+ hcryp->Instance->DINR = *(uint32_t *)(hcryp->pCrypInBuffPtr + hcryp->CrypInCount );
+ hcryp->CrypInCount++;
+ hcryp->Instance->DINR = *(uint32_t *)(hcryp->pCrypInBuffPtr + hcryp->CrypInCount );
+ hcryp->CrypInCount++;
+ hcryp->Instance->DINR = *(uint32_t *)(hcryp->pCrypInBuffPtr + hcryp->CrypInCount );
+ hcryp->CrypInCount++;
+ hcryp->Instance->DINR = *(uint32_t *)(hcryp->pCrypInBuffPtr + hcryp->CrypInCount );
+ hcryp->CrypInCount++;
+ if((hcryp->CrypInCount == hcryp->Size) && (hcryp->Init.Algorithm == CRYP_AES_GCM_GMAC))
+ {
+ /* Call output transfer complete callback */
#if (USE_HAL_CRYP_REGISTER_CALLBACKS == 1)
- /*Call registered Input complete callback*/
- hcryp->InCpltCallback(hcryp);
+ /*Call registered Input complete callback*/
+ hcryp->InCpltCallback(hcryp);
#else
- /*Call legacy weak Input complete callback*/
- HAL_CRYP_InCpltCallback(hcryp);
+ /*Call legacy weak Input complete callback*/
+ HAL_CRYP_InCpltCallback(hcryp);
#endif /* USE_HAL_CRYP_REGISTER_CALLBACKS */
+ }
}
- }
- else /* Last block of payload < 128bit*/
- {
- /* Compute the number of padding bytes in last block of payload */
- npblb = ((hcryp->Size/16U)+1U)*16U- (hcryp->Size);
- if((((hcryp->Instance->CR & AES_CR_MODE) == CRYP_OPERATINGMODE_ENCRYPT) && (hcryp->Init.Algorithm == CRYP_AES_GCM_GMAC)) ||
- (((hcryp->Instance->CR & AES_CR_MODE) == CRYP_OPERATINGMODE_DECRYPT) && (hcryp->Init.Algorithm == CRYP_AES_CCM)))
+ else /* Last block of payload < 128bit*/
{
- /* Specify the number of non-valid bytes using NPBLB register*/
- MODIFY_REG(hcryp->Instance->CR, AES_CR_NPBLB, npblb<< 20U);
- }
+ /* Compute the number of padding bytes in last block of payload */
+ npblb = (((hcryp->Size/16U)+1U)*16U) - (hcryp->Size);
+ cr_temp = hcryp->Instance->CR;
+ if((((cr_temp & AES_CR_MODE) == CRYP_OPERATINGMODE_ENCRYPT) && (hcryp->Init.Algorithm == CRYP_AES_GCM_GMAC)) ||
+ (((cr_temp& AES_CR_MODE) == CRYP_OPERATINGMODE_DECRYPT) && (hcryp->Init.Algorithm == CRYP_AES_CCM)))
+ {
+ /* Specify the number of non-valid bytes using NPBLB register*/
+ MODIFY_REG(hcryp->Instance->CR, AES_CR_NPBLB, ((uint32_t)npblb)<< 20U);
+ }
- /* Number of valid words (lastwordsize) in last block */
- if (npblb % 4U ==0U)
- {
- lastwordsize = (16U-npblb)/4U;
- }
- else
- {
- lastwordsize = (16U-npblb)/4U +1U;
- }
+ /* Number of valid words (lastwordsize) in last block */
+ if ((npblb % 4U) ==0U)
+ {
+ lastwordsize = (16U-npblb)/4U;
+ }
+ else
+ {
+ lastwordsize = ((16U-npblb)/4U) +1U;
+ }
- /* Last block optionally pad the data with zeros*/
- for(loopcounter = 0U; loopcounter < lastwordsize; loopcounter++)
- {
- hcryp->Instance->DINR = *(uint32_t *)(hcryp->pCrypInBuffPtr + hcryp->CrypInCount );
- hcryp->CrypInCount++;
- }
- while(loopcounter < 4U )
- {
- /* pad the data with zeros to have a complete block */
- hcryp->Instance->DINR = 0x0U;
- loopcounter++;
+ /* Last block optionally pad the data with zeros*/
+ for(loopcounter = 0U; loopcounter < lastwordsize; loopcounter++)
+ {
+ hcryp->Instance->DINR = *(uint32_t *)(hcryp->pCrypInBuffPtr + hcryp->CrypInCount );
+ hcryp->CrypInCount++;
+ }
+ while(loopcounter < 4U )
+ {
+ /* pad the data with zeros to have a complete block */
+ hcryp->Instance->DINR = 0x0U;
+ loopcounter++;
+ }
}
}
}
diff --git a/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_flash.c b/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_flash.c
index 237ce6b8b..ab3de969b 100644
--- a/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_flash.c
+++ b/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_flash.c
@@ -269,7 +269,7 @@ HAL_StatusTypeDef HAL_FLASH_Program_IT(uint32_t TypeProgram, uint32_t Address, u
pFlash.Address = Address;
/* Enable End of Operation and Error interrupts */
- __HAL_FLASH_ENABLE_IT(FLASH_IT_EOP | FLASH_IT_OPERR | FLASH_IT_ECCC);
+ __HAL_FLASH_ENABLE_IT(FLASH_IT_EOP | FLASH_IT_OPERR);
if (TypeProgram == FLASH_TYPEPROGRAM_DOUBLEWORD)
{
@@ -302,13 +302,11 @@ void HAL_FLASH_IRQHandler(void)
uint32_t param = 0xFFFFFFFFU;
uint32_t error;
- /* Save flash errors. Only ECC detection can be checked here as ECCC
- generates NMI */
- error = (FLASH->SR & FLASH_FLAG_SR_ERROR);
+ /* Check FLASH operation error flags */
+ error = (FLASH->SR & FLASH_FLAG_SR_ERRORS);
/* Clear Current operation */
CLEAR_BIT(FLASH->CR, pFlash.ProcedureOnGoing);
- error |= (FLASH->ECCR & FLASH_FLAG_ECCC);
/* A] Set parameter for user or error callbacks */
/* check operation was a program or erase */
@@ -381,7 +379,7 @@ void HAL_FLASH_IRQHandler(void)
if (pFlash.ProcedureOnGoing == FLASH_TYPENONE)
{
/* Disable End of Operation and Error interrupts */
- __HAL_FLASH_DISABLE_IT(FLASH_IT_EOP | FLASH_IT_OPERR | FLASH_IT_ECCC);
+ __HAL_FLASH_DISABLE_IT(FLASH_IT_EOP | FLASH_IT_OPERR);
/* Process Unlocked */
__HAL_UNLOCK(&pFlash);
@@ -581,7 +579,6 @@ HAL_StatusTypeDef HAL_FLASH_OB_Launch(void)
* @arg @ref HAL_FLASH_ERROR_FAST FLASH Fast programming error
* @arg @ref HAL_FLASH_ERROR_RD FLASH Read Protection error (PCROP)
* @arg @ref HAL_FLASH_ERROR_OPTV FLASH Option validity error
- * @arg @ref HAL_FLASH_ERROR_ECCD FLASH two ECC errors have been detected
*/
uint32_t HAL_FLASH_GetError(void)
{
@@ -623,8 +620,7 @@ HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout)
}
}
- /* check flash errors. Only ECC correction can be checked here as ECCD
- generates NMI */
+ /* Check FLASH operation error flags */
error = FLASH->SR;
/* Check FLASH End of Operation flag */
@@ -635,10 +631,7 @@ HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout)
}
/* Now update error variable to only error value */
- error &= FLASH_FLAG_SR_ERROR;
-
- /* Update error with ECC error value */
- error |= (FLASH->ECCR & FLASH_FLAG_ECCC);
+ error &= FLASH_FLAG_SR_ERRORS;
/* clear error flags */
__HAL_FLASH_CLEAR_FLAG(error);
diff --git a/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_irda.c b/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_irda.c
index b93149718..6768dcff1 100644
--- a/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_irda.c
+++ b/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_irda.c
@@ -782,10 +782,13 @@ HAL_StatusTypeDef HAL_IRDA_UnRegisterCallback(IRDA_HandleTypeDef *hirda, HAL_IRD
/**
* @brief Send an amount of data in blocking mode.
+ * @note When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01),
+ * the sent data is handled as a set of u16. In this case, Size must reflect the number
+ * of u16 available through pData.
* @param hirda Pointer to a IRDA_HandleTypeDef structure that contains
* the configuration information for the specified IRDA module.
- * @param pData Pointer to data buffer.
- * @param Size Amount of data to be sent.
+ * @param pData Pointer to data buffer (u8 or u16 data elements).
+ * @param Size Amount of data elements (u8 or u16) to be sent.
* @param Timeout Specify timeout value.
* @retval HAL status
*/
@@ -868,10 +871,13 @@ HAL_StatusTypeDef HAL_IRDA_Transmit(IRDA_HandleTypeDef *hirda, uint8_t *pData, u
/**
* @brief Receive an amount of data in blocking mode.
+ * @note When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01),
+ * the received data is handled as a set of u16. In this case, Size must reflect the number
+ * of u16 available through pData.
* @param hirda Pointer to a IRDA_HandleTypeDef structure that contains
* the configuration information for the specified IRDA module.
- * @param pData Pointer to data buffer.
- * @param Size Amount of data to be received.
+ * @param pData Pointer to data buffer (u8 or u16 data elements).
+ * @param Size Amount of data elements (u8 or u16) to be received.
* @param Timeout Specify timeout value.
* @retval HAL status
*/
@@ -956,10 +962,13 @@ HAL_StatusTypeDef HAL_IRDA_Receive(IRDA_HandleTypeDef *hirda, uint8_t *pData, ui
/**
* @brief Send an amount of data in interrupt mode.
+ * @note When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01),
+ * the sent data is handled as a set of u16. In this case, Size must reflect the number
+ * of u16 available through pData.
* @param hirda Pointer to a IRDA_HandleTypeDef structure that contains
* the configuration information for the specified IRDA module.
- * @param pData Pointer to data buffer.
- * @param Size Amount of data to be sent.
+ * @param pData Pointer to data buffer (u8 or u16 data elements).
+ * @param Size Amount of data elements (u8 or u16) to be sent.
* @retval HAL status
*/
HAL_StatusTypeDef HAL_IRDA_Transmit_IT(IRDA_HandleTypeDef *hirda, uint8_t *pData, uint16_t Size)
@@ -998,10 +1007,13 @@ HAL_StatusTypeDef HAL_IRDA_Transmit_IT(IRDA_HandleTypeDef *hirda, uint8_t *pData
/**
* @brief Receive an amount of data in interrupt mode.
+ * @note When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01),
+ * the received data is handled as a set of u16. In this case, Size must reflect the number
+ * of u16 available through pData.
* @param hirda Pointer to a IRDA_HandleTypeDef structure that contains
* the configuration information for the specified IRDA module.
- * @param pData Pointer to data buffer.
- * @param Size Amount of data to be received.
+ * @param pData Pointer to data buffer (u8 or u16 data elements).
+ * @param Size Amount of data elements (u8 or u16) to be received.
* @retval HAL status
*/
HAL_StatusTypeDef HAL_IRDA_Receive_IT(IRDA_HandleTypeDef *hirda, uint8_t *pData, uint16_t Size)
@@ -1047,10 +1059,13 @@ HAL_StatusTypeDef HAL_IRDA_Receive_IT(IRDA_HandleTypeDef *hirda, uint8_t *pData,
/**
* @brief Send an amount of data in DMA mode.
+ * @note When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01),
+ * the sent data is handled as a set of u16. In this case, Size must reflect the number
+ * of u16 available through pData.
* @param hirda Pointer to a IRDA_HandleTypeDef structure that contains
* the configuration information for the specified IRDA module.
- * @param pData pointer to data buffer.
- * @param Size amount of data to be sent.
+ * @param pData pointer to data buffer (u8 or u16 data elements).
+ * @param Size Amount of data elements (u8 or u16) to be sent.
* @retval HAL status
*/
HAL_StatusTypeDef HAL_IRDA_Transmit_DMA(IRDA_HandleTypeDef *hirda, uint8_t *pData, uint16_t Size)
@@ -1122,12 +1137,15 @@ HAL_StatusTypeDef HAL_IRDA_Transmit_DMA(IRDA_HandleTypeDef *hirda, uint8_t *pDat
/**
* @brief Receive an amount of data in DMA mode.
+ * @note When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01),
+ * the received data is handled as a set of u16. In this case, Size must reflect the number
+ * of u16 available through pData.
* @note When the IRDA parity is enabled (PCE = 1), the received data contains
* the parity bit (MSB position).
* @param hirda Pointer to a IRDA_HandleTypeDef structure that contains
* the configuration information for the specified IRDA module.
- * @param pData Pointer to data buffer.
- * @param Size Amount of data to be received.
+ * @param pData Pointer to data buffer (u8 or u16 data elements).
+ * @param Size Amount of data elements (u8 or u16) to be received.
* @retval HAL status
*/
HAL_StatusTypeDef HAL_IRDA_Receive_DMA(IRDA_HandleTypeDef *hirda, uint8_t *pData, uint16_t Size)
diff --git a/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pwr.c b/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pwr.c
index 4aec8ebfc..af8a039fd 100644
--- a/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pwr.c
+++ b/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pwr.c
@@ -560,6 +560,8 @@ void HAL_PWR_EnterSLEEPMode(uint32_t Regulator, uint8_t SLEEPEntry)
* startup delay is incurred when waking up.
* By keeping the internal regulator ON during Stop mode (Stop 0), the consumption
* is higher although the startup time is reduced.
+ * @note Case of Stop0 mode with SMPS: Before entering Stop 0 mode with SMPS Step Down converter enabled,
+ * the HSI16 must be kept on by enabling HSI kernel clock (set HSIKERON register bit).
* @note According to system power policy, system entering in Stop mode
* is depending on other CPU power mode.
* @param Regulator Specifies the regulator state in Stop mode.
diff --git a/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pwr_ex.c b/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pwr_ex.c
index 93554f680..3b394c622 100644
--- a/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pwr_ex.c
+++ b/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pwr_ex.c
@@ -1089,6 +1089,8 @@ HAL_StatusTypeDef HAL_PWREx_DisableLowPowerRunMode(void)
* is set; the MSI oscillator is selected if STOPWUCK is cleared.
* @note By keeping the internal regulator ON during Stop 0 mode, the consumption
* is higher although the startup time is reduced.
+ * @note Case of Stop0 mode with SMPS: Before entering Stop 0 mode with SMPS Step Down converter enabled,
+ * the HSI16 must be kept on by enabling HSI kernel clock (set HSIKERON register bit).
* @note According to system power policy, system entering in Stop mode
* is depending on other CPU power mode.
* @param STOPEntry specifies if Stop mode in entered with WFI or WFE instruction.
@@ -1197,6 +1199,15 @@ void HAL_PWREx_EnterSTOP1Mode(uint8_t STOPEntry)
* @note When exiting Stop 2 mode by issuing an interrupt or a wakeup event,
* the HSI RC oscillator is selected as system clock if STOPWUCK bit in RCC_CFGR register
* is set; the MSI oscillator is selected if STOPWUCK is cleared.
+ * @note Case of Stop2 mode and debugger probe attached: a workaround should be applied.
+ * Issue specified in "ES0394 - STM32WB55Cx/Rx/Vx device errata":
+ * 2.2.9 Incomplete Stop 2 mode entry after a wakeup from debug upon EXTI line 48 event
+ * "With the JTAG debugger enabled on GPIO pins and after a wakeup from debug triggered by an event on EXTI
+ * line 48 (CDBGPWRUPREQ), the device may enter in a state in which attempts to enter Stop 2 mode are not fully
+ * effective ..."
+ * Workaround implementation example using LL driver:
+ * LL_EXTI_DisableIT_32_63(LL_EXTI_LINE_48);
+ * LL_C2_EXTI_DisableIT_32_63(LL_EXTI_LINE_48);
* @note According to system power policy, system entering in Stop mode
* is depending on other CPU power mode.
* @param STOPEntry specifies if Stop mode in entered with WFI or WFE instruction.
diff --git a/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_smartcard.c b/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_smartcard.c
index 954da8736..a24a035a0 100644
--- a/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_smartcard.c
+++ b/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_smartcard.c
@@ -917,7 +917,7 @@ HAL_StatusTypeDef HAL_SMARTCARD_Receive(SMARTCARD_HandleTypeDef *hsmartcard, uin
return HAL_TIMEOUT;
}
*ptmpdata = (uint8_t)(hsmartcard->Instance->RDR & (uint8_t)0x00FF);
- *ptmpdata++;
+ ptmpdata++;
}
/* At end of Rx process, restore hsmartcard->RxState to Ready */
diff --git a/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_tim.c b/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_tim.c
index 9ebfa33a5..eeec81284 100644
--- a/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_tim.c
+++ b/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_tim.c
@@ -2632,8 +2632,8 @@ HAL_StatusTypeDef HAL_TIM_Encoder_Init(TIM_HandleTypeDef *htim, TIM_Encoder_Ini
assert_param(IS_TIM_ENCODER_MODE(sConfig->EncoderMode));
assert_param(IS_TIM_IC_SELECTION(sConfig->IC1Selection));
assert_param(IS_TIM_IC_SELECTION(sConfig->IC2Selection));
- assert_param(IS_TIM_IC_POLARITY(sConfig->IC1Polarity));
- assert_param(IS_TIM_IC_POLARITY(sConfig->IC2Polarity));
+ assert_param(IS_TIM_ENCODERINPUT_POLARITY(sConfig->IC1Polarity));
+ assert_param(IS_TIM_ENCODERINPUT_POLARITY(sConfig->IC2Polarity));
assert_param(IS_TIM_IC_PRESCALER(sConfig->IC1Prescaler));
assert_param(IS_TIM_IC_PRESCALER(sConfig->IC2Prescaler));
assert_param(IS_TIM_IC_FILTER(sConfig->IC1Filter));
diff --git a/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_tim_ex.c b/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_tim_ex.c
index 250406066..503cb0ccc 100644
--- a/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_tim_ex.c
+++ b/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_tim_ex.c
@@ -1647,7 +1647,7 @@ HAL_StatusTypeDef HAL_TIMEx_MasterConfigSynchronization(TIM_HandleTypeDef *htim,
uint32_t tmpsmcr;
/* Check the parameters */
- assert_param(IS_TIM_SYNCHRO_INSTANCE(htim->Instance));
+ assert_param(IS_TIM_MASTER_INSTANCE(htim->Instance));
assert_param(IS_TIM_TRGO_SOURCE(sMasterConfig->MasterOutputTrigger));
assert_param(IS_TIM_MSM_STATE(sMasterConfig->MasterSlaveMode));
@@ -1680,16 +1680,19 @@ HAL_StatusTypeDef HAL_TIMEx_MasterConfigSynchronization(TIM_HandleTypeDef *htim,
/* Select the TRGO source */
tmpcr2 |= sMasterConfig->MasterOutputTrigger;
- /* Reset the MSM Bit */
- tmpsmcr &= ~TIM_SMCR_MSM;
- /* Set master mode */
- tmpsmcr |= sMasterConfig->MasterSlaveMode;
-
/* Update TIMx CR2 */
htim->Instance->CR2 = tmpcr2;
- /* Update TIMx SMCR */
- htim->Instance->SMCR = tmpsmcr;
+ if (IS_TIM_SLAVE_INSTANCE(htim->Instance))
+ {
+ /* Reset the MSM Bit */
+ tmpsmcr &= ~TIM_SMCR_MSM;
+ /* Set master mode */
+ tmpsmcr |= sMasterConfig->MasterSlaveMode;
+
+ /* Update TIMx SMCR */
+ htim->Instance->SMCR = tmpsmcr;
+ }
/* Change the htim state */
htim->State = HAL_TIM_STATE_READY;
diff --git a/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_uart.c b/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_uart.c
index de225f788..22e88e606 100644
--- a/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_uart.c
+++ b/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_uart.c
@@ -1075,6 +1075,8 @@ HAL_StatusTypeDef HAL_UART_Transmit(UART_HandleTypeDef *huart, uint8_t *pData, u
pdata16bits = NULL;
}
+ __HAL_UNLOCK(huart);
+
while (huart->TxXferCount > 0U)
{
if (UART_WaitOnFlagUntilTimeout(huart, UART_FLAG_TXE, RESET, tickstart, Timeout) != HAL_OK)
@@ -1102,8 +1104,6 @@ HAL_StatusTypeDef HAL_UART_Transmit(UART_HandleTypeDef *huart, uint8_t *pData, u
/* At end of Tx process, restore huart->gState to Ready */
huart->gState = HAL_UART_STATE_READY;
- __HAL_UNLOCK(huart);
-
return HAL_OK;
}
else
@@ -1169,6 +1169,8 @@ HAL_StatusTypeDef HAL_UART_Receive(UART_HandleTypeDef *huart, uint8_t *pData, ui
pdata16bits = NULL;
}
+ __HAL_UNLOCK(huart);
+
/* as long as data have to be received */
while (huart->RxXferCount > 0U)
{
@@ -1192,8 +1194,6 @@ HAL_StatusTypeDef HAL_UART_Receive(UART_HandleTypeDef *huart, uint8_t *pData, ui
/* At end of Rx process, restore huart->RxState to Ready */
huart->RxState = HAL_UART_STATE_READY;
- __HAL_UNLOCK(huart);
-
return HAL_OK;
}
else
diff --git a/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_usart.c b/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_usart.c
index a17bd51de..e6c7363da 100644
--- a/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_usart.c
+++ b/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_usart.c
@@ -732,9 +732,12 @@ HAL_StatusTypeDef HAL_USART_UnRegisterCallback(USART_HandleTypeDef *husart, HAL_
/**
* @brief Simplex send an amount of data in blocking mode.
+ * @note When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01),
+ * the sent data is handled as a set of u16. In this case, Size must indicate the number
+ * of u16 provided through pTxData.
* @param husart USART handle.
- * @param pTxData Pointer to data buffer.
- * @param Size Amount of data to be sent.
+ * @param pTxData Pointer to data buffer (u8 or u16 data elements).
+ * @param Size Amount of data elements (u8 or u16) to be sent.
* @param Timeout Timeout duration.
* @retval HAL status
*/
@@ -826,10 +829,13 @@ HAL_StatusTypeDef HAL_USART_Transmit(USART_HandleTypeDef *husart, uint8_t *pTxDa
/**
* @brief Receive an amount of data in blocking mode.
- * @note To receive synchronous data, dummy data are simultaneously transmitted.
+ * @note To receive synchronous data, dummy data are simultaneously transmitted.
+ * @note When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01),
+ * the received data is handled as a set of u16. In this case, Size must indicate the number
+ * of u16 available through pRxData.
* @param husart USART handle.
- * @param pRxData Pointer to data buffer.
- * @param Size Amount of data to be received.
+ * @param pRxData Pointer to data buffer (u8 or u16 data elements).
+ * @param Size Amount of data elements (u8 or u16) to be received.
* @param Timeout Timeout duration.
* @retval HAL status
*/
@@ -936,10 +942,13 @@ HAL_StatusTypeDef HAL_USART_Receive(USART_HandleTypeDef *husart, uint8_t *pRxDat
/**
* @brief Full-Duplex Send and Receive an amount of data in blocking mode.
+ * @note When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01),
+ * the sent data and the received data are handled as sets of u16. In this case, Size must indicate the number
+ * of u16 available through pTxData and through pRxData.
* @param husart USART handle.
- * @param pTxData pointer to TX data buffer.
- * @param pRxData pointer to RX data buffer.
- * @param Size amount of data to be sent (same amount to be received).
+ * @param pTxData pointer to TX data buffer (u8 or u16 data elements).
+ * @param pRxData pointer to RX data buffer (u8 or u16 data elements).
+ * @param Size amount of data elements (u8 or u16) to be sent (same amount to be received).
* @param Timeout Timeout duration.
* @retval HAL status
*/
@@ -1082,9 +1091,12 @@ HAL_StatusTypeDef HAL_USART_TransmitReceive(USART_HandleTypeDef *husart, uint8_t
/**
* @brief Send an amount of data in interrupt mode.
+ * @note When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01),
+ * the sent data is handled as a set of u16. In this case, Size must indicate the number
+ * of u16 provided through pTxData.
* @param husart USART handle.
- * @param pTxData pointer to data buffer.
- * @param Size amount of data to be sent.
+ * @param pTxData pointer to data buffer (u8 or u16 data elements).
+ * @param Size amount of data elements (u8 or u16) to be sent.
* @retval HAL status
*/
HAL_StatusTypeDef HAL_USART_Transmit_IT(USART_HandleTypeDef *husart, uint8_t *pTxData, uint16_t Size)
@@ -1162,10 +1174,13 @@ HAL_StatusTypeDef HAL_USART_Transmit_IT(USART_HandleTypeDef *husart, uint8_t *pT
/**
* @brief Receive an amount of data in interrupt mode.
- * @note To receive synchronous data, dummy data are simultaneously transmitted.
+ * @note To receive synchronous data, dummy data are simultaneously transmitted.
+ * @note When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01),
+ * the received data is handled as a set of u16. In this case, Size must indicate the number
+ * of u16 available through pRxData.
* @param husart USART handle.
- * @param pRxData pointer to data buffer.
- * @param Size amount of data to be received.
+ * @param pRxData pointer to data buffer (u8 or u16 data elements).
+ * @param Size amount of data elements (u8 or u16) to be received.
* @retval HAL status
*/
HAL_StatusTypeDef HAL_USART_Receive_IT(USART_HandleTypeDef *husart, uint8_t *pRxData, uint16_t Size)
@@ -1264,10 +1279,13 @@ HAL_StatusTypeDef HAL_USART_Receive_IT(USART_HandleTypeDef *husart, uint8_t *pRx
/**
* @brief Full-Duplex Send and Receive an amount of data in interrupt mode.
+ * @note When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01),
+ * the sent data and the received data are handled as sets of u16. In this case, Size must indicate the number
+ * of u16 available through pTxData and through pRxData.
* @param husart USART handle.
- * @param pTxData pointer to TX data buffer.
- * @param pRxData pointer to RX data buffer.
- * @param Size amount of data to be sent (same amount to be received).
+ * @param pTxData pointer to TX data buffer (u8 or u16 data elements).
+ * @param pRxData pointer to RX data buffer (u8 or u16 data elements).
+ * @param Size amount of data elements (u8 or u16) to be sent (same amount to be received).
* @retval HAL status
*/
HAL_StatusTypeDef HAL_USART_TransmitReceive_IT(USART_HandleTypeDef *husart, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size)
@@ -1359,9 +1377,12 @@ HAL_StatusTypeDef HAL_USART_TransmitReceive_IT(USART_HandleTypeDef *husart, uint
/**
* @brief Send an amount of data in DMA mode.
+ * @note When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01),
+ * the sent data is handled as a set of u16. In this case, Size must indicate the number
+ * of u16 provided through pTxData.
* @param husart USART handle.
- * @param pTxData pointer to data buffer.
- * @param Size amount of data to be sent.
+ * @param pTxData pointer to data buffer (u8 or u16 data elements).
+ * @param Size amount of data elements (u8 or u16) to be sent.
* @retval HAL status
*/
HAL_StatusTypeDef HAL_USART_Transmit_DMA(USART_HandleTypeDef *husart, uint8_t *pTxData, uint16_t Size)
@@ -1441,10 +1462,13 @@ HAL_StatusTypeDef HAL_USART_Transmit_DMA(USART_HandleTypeDef *husart, uint8_t *p
* @brief Receive an amount of data in DMA mode.
* @note When the USART parity is enabled (PCE = 1), the received data contain
* the parity bit (MSB position).
- * @note The USART DMA transmit channel must be configured in order to generate the clock for the slave.
+ * @note The USART DMA transmit channel must be configured in order to generate the clock for the slave.
+ * @note When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01),
+ * the received data is handled as a set of u16. In this case, Size must indicate the number
+ * of u16 available through pRxData.
* @param husart USART handle.
- * @param pRxData pointer to data buffer.
- * @param Size amount of data to be received.
+ * @param pRxData pointer to data buffer (u8 or u16 data elements).
+ * @param Size amount of data elements (u8 or u16) to be received.
* @retval HAL status
*/
HAL_StatusTypeDef HAL_USART_Receive_DMA(USART_HandleTypeDef *husart, uint8_t *pRxData, uint16_t Size)
@@ -1556,10 +1580,13 @@ HAL_StatusTypeDef HAL_USART_Receive_DMA(USART_HandleTypeDef *husart, uint8_t *pR
/**
* @brief Full-Duplex Transmit Receive an amount of data in non-blocking mode.
* @note When the USART parity is enabled (PCE = 1) the data received contain the parity bit.
+ * @note When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01),
+ * the sent data and the received data are handled as sets of u16. In this case, Size must indicate the number
+ * of u16 available through pTxData and through pRxData.
* @param husart USART handle.
- * @param pTxData pointer to TX data buffer.
- * @param pRxData pointer to RX data buffer.
- * @param Size amount of data to be received/sent.
+ * @param pTxData pointer to TX data buffer (u8 or u16 data elements).
+ * @param pRxData pointer to RX data buffer (u8 or u16 data elements).
+ * @param Size amount of data elements (u8 or u16) to be received/sent.
* @retval HAL status
*/
HAL_StatusTypeDef HAL_USART_TransmitReceive_DMA(USART_HandleTypeDef *husart, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size)
@@ -3061,7 +3088,7 @@ static void USART_TxISR_8BIT_FIFOEN(USART_HandleTypeDef *husart)
else if (__HAL_USART_GET_FLAG(husart, USART_FLAG_TXFNF) == SET)
{
husart->Instance->TDR = (uint8_t)(*husart->pTxBuffPtr & (uint8_t)0xFF);
- *husart->pTxBuffPtr++;
+ husart->pTxBuffPtr++;
husart->TxXferCount--;
}
else
diff --git a/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_wwdg.c b/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_wwdg.c
index a4d72def9..11954768b 100644
--- a/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_wwdg.c
+++ b/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_wwdg.c
@@ -32,10 +32,10 @@
(++) min time (mS) = 1000 * (Counter - Window) / WWDG clock
(++) max time (mS) = 1000 * (Counter - 0x40) / WWDG clock
(+) Typical values:
- (++) Counter min (T[5;0] = 0x00) @56 MHz(PCLK1) with zero prescaler:
- max timeout before reset: approximately 73.14 microseconds
- (++) Counter max (T[5;0] = 0x3F) @56 MHz(PCLK1) with prescaler dividing by 128:
- max timeout before reset: approximately 599.18 milliseconds
+ (++) Counter min (T[5;0] = 0x00) @64 MHz (PCLK1) with zero prescaler:
+ max timeout before reset: approximately 64s
+ (++) Counter max (T[5;0] = 0x3F) @64 MHz (PCLK1) with prescaler dividing by 128:
+ max timeout before reset: approximately 524.28ms
==============================================================================
##### How to use this driver #####
@@ -85,13 +85,13 @@
[..]
When calling @ref HAL_WWDG_Init function, callbacks are reset to the
- corresponding legacy weak (surcharged) functions:
+ corresponding legacy weak (surcharged) functions:
@ref HAL_WWDG_EarlyWakeupCallback() and HAL_WWDG_MspInit() only if they have
not been registered before.
[..]
When compilation define USE_HAL_WWDG_REGISTER_CALLBACKS is set to 0 or
- not defined, the callback registering feature is not available
+ not defined, the callback registering feature is not available
and weak (surcharged) callbacks are used.
*** WWDG HAL driver macros list ***
@@ -143,8 +143,8 @@
*/
/** @defgroup WWDG_Exported_Functions_Group1 Initialization and Configuration functions
- * @brief Initialization and Configuration functions.
- *
+ * @brief Initialization and Configuration functions.
+ *
@verbatim
==============================================================================
##### Initialization and Configuration functions #####
@@ -183,12 +183,12 @@ HAL_StatusTypeDef HAL_WWDG_Init(WWDG_HandleTypeDef *hwwdg)
#if (USE_HAL_WWDG_REGISTER_CALLBACKS == 1)
/* Reset Callback pointers */
- if(hwwdg->EwiCallback == NULL)
+ if (hwwdg->EwiCallback == NULL)
{
hwwdg->EwiCallback = HAL_WWDG_EarlyWakeupCallback;
}
- if(hwwdg->MspInitCallback == NULL)
+ if (hwwdg->MspInitCallback == NULL)
{
hwwdg->MspInitCallback = HAL_WWDG_MspInit;
}
@@ -247,13 +247,13 @@ HAL_StatusTypeDef HAL_WWDG_RegisterCallback(WWDG_HandleTypeDef *hwwdg, HAL_WWDG_
{
HAL_StatusTypeDef status = HAL_OK;
- if(pCallback == NULL)
+ if (pCallback == NULL)
{
status = HAL_ERROR;
}
else
{
- switch(CallbackID)
+ switch (CallbackID)
{
case HAL_WWDG_EWI_CB_ID:
hwwdg->EwiCallback = pCallback;
@@ -275,7 +275,7 @@ HAL_StatusTypeDef HAL_WWDG_RegisterCallback(WWDG_HandleTypeDef *hwwdg, HAL_WWDG_
/**
* @brief Unregister a WWDG Callback
- * WWDG Callback is redirected to the weak (surcharged) predefined callback
+ * WWDG Callback is redirected to the weak (surcharged) predefined callback
* @param hwwdg WWDG handle
* @param CallbackID ID of the callback to be registered
* This parameter can be one of the following values:
@@ -287,7 +287,7 @@ HAL_StatusTypeDef HAL_WWDG_UnRegisterCallback(WWDG_HandleTypeDef *hwwdg, HAL_WWD
{
HAL_StatusTypeDef status = HAL_OK;
- switch(CallbackID)
+ switch (CallbackID)
{
case HAL_WWDG_EWI_CB_ID:
hwwdg->EwiCallback = HAL_WWDG_EarlyWakeupCallback;
@@ -311,8 +311,8 @@ HAL_StatusTypeDef HAL_WWDG_UnRegisterCallback(WWDG_HandleTypeDef *hwwdg, HAL_WWD
*/
/** @defgroup WWDG_Exported_Functions_Group2 IO operation functions
- * @brief IO operation functions
- *
+ * @brief IO operation functions
+ *
@verbatim
==============================================================================
##### IO operation functions #####
diff --git a/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_ll_utils.c b/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_ll_utils.c
index ec56897a7..ce9cbc16c 100644
--- a/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_ll_utils.c
+++ b/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_ll_utils.c
@@ -6,11 +6,11 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
- * the "License"; You may not use this file except in compliance with the
+ * the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
@@ -47,9 +47,9 @@
#endif
/* Defines used for PLL range */
-#define UTILS_PLLVCO_INPUT_MIN 4000000U /*!< Frequency min for PLLVCO input, in Hz */
-#define UTILS_PLLVCO_INPUT_MAX 16000000U /*!< Frequency max for PLLVCO input, in Hz */
-#define UTILS_PLLVCO_OUTPUT_MIN 64000000U /*!< Frequency min for PLLVCO output, in Hz */
+#define UTILS_PLLVCO_INPUT_MIN 2660000U /*!< Frequency min for PLLVCO input, in Hz */
+#define UTILS_PLLVCO_INPUT_MAX 16000000U /*!< Frequency max for PLLVCO input, in Hz */
+#define UTILS_PLLVCO_OUTPUT_MIN 96000000U /*!< Frequency min for PLLVCO output, in Hz */
#define UTILS_PLLVCO_OUTPUT_MAX 344000000U /*!< Frequency max for PLLVCO output, in Hz */
/* Defines used for HCLK2 frequency check */
@@ -99,7 +99,7 @@
|| ((__VALUE__) == LL_RCC_PLLM_DIV_7) \
|| ((__VALUE__) == LL_RCC_PLLM_DIV_8))
-#define IS_LL_UTILS_PLLN_VALUE(__VALUE__) ((8U <= (__VALUE__)) && ((__VALUE__) <= 86U))
+#define IS_LL_UTILS_PLLN_VALUE(__VALUE__) ((6U <= (__VALUE__)) && ((__VALUE__) <= 127U))
#define IS_LL_UTILS_PLLR_VALUE(__VALUE__) (((__VALUE__) == LL_RCC_PLLR_DIV_2) \
|| ((__VALUE__) == LL_RCC_PLLR_DIV_3) \
@@ -131,10 +131,10 @@
/** @defgroup UTILS_LL_Private_Functions UTILS Private functions
* @{
*/
- static uint32_t UTILS_GetPLLOutputFrequency(uint32_t PLL_InputFrequency,LL_UTILS_PLLInitTypeDef *UTILS_PLLInitStruct);
- static ErrorStatus UTILS_SetFlashLatency(uint32_t HCLK4_Frequency);
- static ErrorStatus UTILS_EnablePLLAndSwitchSystem(uint32_t SYSCLK_Frequency, LL_UTILS_ClkInitTypeDef *UTILS_ClkInitStruct);
- static ErrorStatus UTILS_PLL_IsBusy(void);
+static uint32_t UTILS_GetPLLOutputFrequency(uint32_t PLL_InputFrequency, LL_UTILS_PLLInitTypeDef *UTILS_PLLInitStruct);
+static ErrorStatus UTILS_SetFlashLatency(uint32_t HCLK4_Frequency);
+static ErrorStatus UTILS_EnablePLLAndSwitchSystem(uint32_t SYSCLK_Frequency, LL_UTILS_ClkInitTypeDef *UTILS_ClkInitStruct);
+static ErrorStatus UTILS_PLL_IsBusy(void);
/**
* @}
@@ -210,10 +210,10 @@ void LL_mDelay(uint32_t Delay)
[..]
System, HCLK1, HCLK2, AHBS, AHBRF and APB buses clocks configuration
- (+) The maximum frequency of the SYSCLK, HCLK1, HCLK4, PCLK1 and PCLK2
+ (+) The maximum frequency of the SYSCLK, HCLK1, HCLK4, PCLK1 and PCLK2
is 640000000 Hz.
....... (+) The maximum frequency of the HCLK2 is 320000000 Hz.
-
+
@endverbatim
@internal
Depending on the device voltage range, the maximum frequency should be
@@ -236,7 +236,7 @@ void LL_mDelay(uint32_t Delay)
@endinternal
* @{
*/
-
+
/**
* @brief This function sets directly SystemCoreClock CMSIS variable.
* @note Variable can be calculated also through SystemCoreClockUpdate function.
@@ -257,8 +257,8 @@ void LL_SetSystemCoreClock(uint32_t HCLKFrequency)
* @note The application needs to ensure that BUS prescalers are valid
* @note Function is based on the following formula:
* - PLL output frequency = (((MSI frequency / PLLM) * PLLN) / PLLR)
- * - PLLM: ensure that the VCO input frequency ranges from 4 to 16 MHz (PLLVCO_input = MSI frequency / PLLM)
- * - PLLN: ensure that the VCO output frequency is between 64 and 344 MHz (PLLVCO_output = PLLVCO_input * PLLN)
+ * - PLLM: ensure that the VCO input frequency ranges from 2.66 to 16 MHz (PLLVCO_input = MSI frequency / PLLM)
+ * - PLLN: ensure that the VCO output frequency is between 96 and 344 MHz (PLLVCO_output = PLLVCO_input * PLLN)
* - PLLR: ensure that max frequency at 64000000 Hz is reached (PLLVCO_output / PLLR)
* @param UTILS_PLLInitStruct pointer to a @ref LL_UTILS_PLLInitTypeDef structure that contains
* the configuration information for the PLL.
@@ -275,7 +275,7 @@ ErrorStatus LL_PLL_ConfigSystemClock_MSI(LL_UTILS_PLLInitTypeDef *UTILS_PLLInitS
uint32_t pllrfreq, hclk2freq, msi_range;
/* Check if one of the PLL is enabled */
- if(UTILS_PLL_IsBusy() == SUCCESS)
+ if (UTILS_PLL_IsBusy() == SUCCESS)
{
/* Get the current MSI range & check coherency */
msi_range = LL_RCC_MSI_GetRange();
@@ -287,7 +287,7 @@ ErrorStatus LL_PLL_ConfigSystemClock_MSI(LL_UTILS_PLLInitTypeDef *UTILS_PLLInitS
case LL_RCC_MSIRANGE_3: /* MSI = 800 KHz */
case LL_RCC_MSIRANGE_4: /* MSI = 1 MHz */
case LL_RCC_MSIRANGE_5: /* MSI = 2 MHz */
- /* PLLVCO input frequency can not in the range from 4 to 16 MHz*/
+ /* PLLVCO input frequency can not in the range from 2.66 to 16 MHz*/
status = ERROR;
break;
@@ -304,9 +304,9 @@ ErrorStatus LL_PLL_ConfigSystemClock_MSI(LL_UTILS_PLLInitTypeDef *UTILS_PLLInitS
/* PLL is ready, MSI range is valid and HCLK2 frequency is coherent
Main PLL configuration and activation */
- if(status != ERROR)
+ if (status != ERROR)
{
- /* Calculate the new PLL output frequency & verify all PLL stages are correct (VCO input ranges,
+ /* Calculate the new PLL output frequency & verify all PLL stages are correct (VCO input ranges,
VCO output ranges & SYSCLK max) when assert activated */
pllrfreq = UTILS_GetPLLOutputFrequency(__LL_RCC_CALC_MSI_FREQ(msi_range), UTILS_PLLInitStruct);
hclk2freq = __LL_RCC_CALC_HCLK2_FREQ(pllrfreq, UTILS_ClkInitStruct->CPU2CLKDivider);
@@ -321,7 +321,7 @@ ErrorStatus LL_PLL_ConfigSystemClock_MSI(LL_UTILS_PLLInitTypeDef *UTILS_PLLInitS
{
/* Enable MSI if not enabled */
- if(LL_RCC_MSI_IsReady() != 1U)
+ if (LL_RCC_MSI_IsReady() != 1U)
{
LL_RCC_MSI_Enable();
while ((LL_RCC_MSI_IsReady() != 1U))
@@ -355,8 +355,8 @@ ErrorStatus LL_PLL_ConfigSystemClock_MSI(LL_UTILS_PLLInitTypeDef *UTILS_PLLInitS
* @note The application needs to ensure that BUS prescalers are valid
* @note Function is based on the following formula:
* - PLL output frequency = (((HSI frequency / PLLM) * PLLN) / PLLR)
- * - PLLM: ensure that the VCO input frequency ranges from 4 to 16 MHz (PLLVCO_input = HSI frequency / PLLM)
- * - PLLN: ensure that the VCO output frequency is between 64 and 344 MHz (PLLVCO_output = PLLVCO_input * PLLN)
+ * - PLLM: ensure that the VCO input frequency ranges from 2.66 to 16 MHz (PLLVCO_input = HSI frequency / PLLM)
+ * - PLLN: ensure that the VCO output frequency is between 96 and 344 MHz (PLLVCO_output = PLLVCO_input * PLLN)
* - PLLR: ensure that max frequency at 64000000 Hz is reach (PLLVCO_output / PLLR)
* @param UTILS_PLLInitStruct pointer to a @ref LL_UTILS_PLLInitTypeDef structure that contains
* the configuration information for the PLL.
@@ -373,7 +373,7 @@ ErrorStatus LL_PLL_ConfigSystemClock_HSI(LL_UTILS_PLLInitTypeDef *UTILS_PLLInitS
uint32_t pllrfreq, hclk2freq;
/* Check if one of the PLL is enabled */
- if(UTILS_PLL_IsBusy() == SUCCESS)
+ if (UTILS_PLL_IsBusy() == SUCCESS)
{
/* Calculate the new PLL output frequency */
pllrfreq = UTILS_GetPLLOutputFrequency(HSI_VALUE, UTILS_PLLInitStruct);
@@ -388,7 +388,7 @@ ErrorStatus LL_PLL_ConfigSystemClock_HSI(LL_UTILS_PLLInitTypeDef *UTILS_PLLInitS
else
{
/* Enable HSI if not enabled */
- if(LL_RCC_HSI_IsReady() != 1U)
+ if (LL_RCC_HSI_IsReady() != 1U)
{
LL_RCC_HSI_Enable();
while (LL_RCC_HSI_IsReady() != 1U)
@@ -400,7 +400,7 @@ ErrorStatus LL_PLL_ConfigSystemClock_HSI(LL_UTILS_PLLInitTypeDef *UTILS_PLLInitS
/* Configure PLL */
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_HSI, UTILS_PLLInitStruct->PLLM, UTILS_PLLInitStruct->PLLN,
UTILS_PLLInitStruct->PLLR);
-
+
/* Enable PLL and switch system clock to PLL */
status = UTILS_EnablePLLAndSwitchSystem(pllrfreq, UTILS_ClkInitStruct);
}
@@ -421,8 +421,8 @@ ErrorStatus LL_PLL_ConfigSystemClock_HSI(LL_UTILS_PLLInitTypeDef *UTILS_PLLInitS
* @note The application needs to ensure that BUS prescalers are valid
* @note Function is based on the following formula:
* - PLL output frequency = (((HSE frequency / PLLM) * PLLN) / PLLR)
- * - PLLM: ensure that the VCO input frequency ranges from 4 to 16 MHz (PLLVCO_input = HSE frequency / PLLM)
- * - PLLN: ensure that the VCO output frequency is between 64 and 344 MHz (PLLVCO_output = PLLVCO_input * PLLN)
+ * - PLLM: ensure that the VCO input frequency ranges from 2.66 to 16 MHz (PLLVCO_input = HSE frequency / PLLM)
+ * - PLLN: ensure that the VCO output frequency is between 96 and 344 MHz (PLLVCO_output = PLLVCO_input * PLLN)
* - PLLR: ensure that max frequency at 64000000 Hz is reached (PLLVCO_output / PLLR)
* @param HSEBypass This parameter can be one of the following values:
* @arg @ref LL_UTILS_HSEBYPASS_ON
@@ -435,7 +435,7 @@ ErrorStatus LL_PLL_ConfigSystemClock_HSI(LL_UTILS_PLLInitTypeDef *UTILS_PLLInitS
* - SUCCESS: Max frequency configuration done
* - ERROR: Max frequency configuration not done
*/
-ErrorStatus LL_PLL_ConfigSystemClock_HSE(uint32_t HSEBypass,LL_UTILS_PLLInitTypeDef *UTILS_PLLInitStruct, LL_UTILS_ClkInitTypeDef *UTILS_ClkInitStruct)
+ErrorStatus LL_PLL_ConfigSystemClock_HSE(uint32_t HSEBypass, LL_UTILS_PLLInitTypeDef *UTILS_PLLInitStruct, LL_UTILS_ClkInitTypeDef *UTILS_ClkInitStruct)
{
ErrorStatus status;
uint32_t pllrfreq, hclk2freq;
@@ -444,7 +444,7 @@ ErrorStatus LL_PLL_ConfigSystemClock_HSE(uint32_t HSEBypass,LL_UTILS_PLLInitType
assert_param(IS_LL_UTILS_HSE_BYPASS(HSEBypass));
/* Check if one of the PLL is enabled */
- if(UTILS_PLL_IsBusy() == SUCCESS)
+ if (UTILS_PLL_IsBusy() == SUCCESS)
{
/* Calculate the new PLL output frequency */
pllrfreq = UTILS_GetPLLOutputFrequency(HSE_VALUE, UTILS_PLLInitStruct);
@@ -460,10 +460,10 @@ ErrorStatus LL_PLL_ConfigSystemClock_HSE(uint32_t HSEBypass,LL_UTILS_PLLInitType
{
/* Enable HSE if not enabled */
- if(LL_RCC_HSE_IsReady() != 1U)
+ if (LL_RCC_HSE_IsReady() != 1U)
{
/* Check if need to enable HSE bypass feature or not */
- if(HSEBypass == LL_UTILS_HSEBYPASS_ON)
+ if (HSEBypass == LL_UTILS_HSEBYPASS_ON)
{
LL_RCC_HSE_EnableBypass();
}
@@ -528,27 +528,27 @@ static ErrorStatus UTILS_SetFlashLatency(uint32_t HCLK4_Frequency)
/* Flash Clock source (HCLK4) range in MHz with a VCORE is range1 */
const uint32_t UTILS_CLK_SRC_RANGE_VOS1[] = {18000000U, 36000000U, 54000000U, UTILS_MAX_FREQUENCY_SCALE1};
- #if defined(PWR_CR1_VOS)
+#if defined(PWR_CR1_VOS)
/* Flash Clock source (HCLK4) range in MHz with a VCORE is range2 */
const uint32_t UTILS_CLK_SRC_RANGE_VOS2[] = {6000000U, 12000000U, UTILS_MAX_FREQUENCY_SCALE2};
- #endif
-
+#endif
+
/* Flash Latency range */
const uint32_t UTILS_LATENCY_RANGE[] = {LL_FLASH_LATENCY_0, LL_FLASH_LATENCY_1, LL_FLASH_LATENCY_2, LL_FLASH_LATENCY_3};
/* Frequency cannot be equal to 0 */
- if(HCLK4_Frequency == 0U)
+ if (HCLK4_Frequency == 0U)
{
status = ERROR;
}
else
{
- #if defined(PWR_CR1_VOS)
- if(LL_PWR_GetRegulVoltageScaling() == LL_PWR_REGU_VOLTAGE_SCALE1)
+#if defined(PWR_CR1_VOS)
+ if (LL_PWR_GetRegulVoltageScaling() == LL_PWR_REGU_VOLTAGE_SCALE1)
{
- for(index = 0; index < countof(UTILS_CLK_SRC_RANGE_VOS1); index++)
+ for (index = 0; index < countof(UTILS_CLK_SRC_RANGE_VOS1); index++)
{
- if(HCLK4_Frequency <= UTILS_CLK_SRC_RANGE_VOS1[index])
+ if (HCLK4_Frequency <= UTILS_CLK_SRC_RANGE_VOS1[index])
{
latency = UTILS_LATENCY_RANGE[index];
break;
@@ -557,25 +557,25 @@ static ErrorStatus UTILS_SetFlashLatency(uint32_t HCLK4_Frequency)
}
else /* SCALE2 */
{
- for(index = 0; index < countof(UTILS_CLK_SRC_RANGE_VOS2); index++)
+ for (index = 0; index < countof(UTILS_CLK_SRC_RANGE_VOS2); index++)
{
- if(HCLK4_Frequency <= UTILS_CLK_SRC_RANGE_VOS2[index])
+ if (HCLK4_Frequency <= UTILS_CLK_SRC_RANGE_VOS2[index])
{
latency = UTILS_LATENCY_RANGE[index];
break;
}
}
}
- #else
- for(index = 0; index < countof(UTILS_CLK_SRC_RANGE_VOS1); index++)
+#else
+ for (index = 0; index < countof(UTILS_CLK_SRC_RANGE_VOS1); index++)
{
- if(HCLK4_Frequency <= UTILS_CLK_SRC_RANGE_VOS1[index])
+ if (HCLK4_Frequency <= UTILS_CLK_SRC_RANGE_VOS1[index])
{
latency = UTILS_LATENCY_RANGE[index];
break;
}
}
- #endif
+#endif
LL_FLASH_SetLatency(latency);
@@ -605,11 +605,11 @@ static uint32_t UTILS_GetPLLOutputFrequency(uint32_t PLL_InputFrequency, LL_UTIL
assert_param(IS_LL_UTILS_PLLR_VALUE(UTILS_PLLInitStruct->PLLR));
/* Check different PLL parameters according to RM */
- /* - PLLM: ensure that the VCO input frequency ranges from 4 to 16 MHz. */
+ /* - PLLM: ensure that the VCO input frequency ranges from 2.66 to 16 MHz. */
pllfreq = PLL_InputFrequency / (((UTILS_PLLInitStruct->PLLM >> RCC_PLLCFGR_PLLM_Pos) + 1U));
assert_param(IS_LL_UTILS_PLLVCO_INPUT(pllfreq));
- /* - PLLN: ensure that the VCO output frequency is between 64 and 344 MHz.*/
+ /* - PLLN: ensure that the VCO output frequency is between 96 and 344 MHz.*/
pllfreq = pllfreq * (UTILS_PLLInitStruct->PLLN & (RCC_PLLCFGR_PLLN >> RCC_PLLCFGR_PLLN_Pos));
assert_param(IS_LL_UTILS_PLLVCO_OUTPUT(pllfreq));
@@ -631,14 +631,14 @@ static ErrorStatus UTILS_PLL_IsBusy(void)
ErrorStatus status = SUCCESS;
/* Check if PLL is busy*/
- if(LL_RCC_PLL_IsReady() != 0U)
+ if (LL_RCC_PLL_IsReady() != 0U)
{
/* PLL configuration cannot be modified */
status = ERROR;
}
#if defined(SAI1)
/* Check if PLLSAI1 is busy*/
- if(LL_RCC_PLLSAI1_IsReady() != 0U)
+ if (LL_RCC_PLLSAI1_IsReady() != 0U)
{
/* PLLSAI1 configuration cannot be modified */
status = ERROR;
@@ -676,14 +676,14 @@ static ErrorStatus UTILS_EnablePLLAndSwitchSystem(uint32_t SYSCLK_Frequency, LL_
hclks_frequency_current = __LL_RCC_CALC_HCLK4_FREQ(sysclk_current, LL_RCC_GetAHB4Prescaler());
/* Increasing the number of wait states because of higher CPU frequency */
- if(hclks_frequency_current < hclks_frequency_target)
+ if (hclks_frequency_current < hclks_frequency_target)
{
/* Set FLASH latency to highest latency */
status = UTILS_SetFlashLatency(hclks_frequency_target);
}
/* Update system clock configuration */
- if(status == SUCCESS)
+ if (status == SUCCESS)
{
/* Enable PLL */
LL_RCC_PLL_Enable();
@@ -707,16 +707,16 @@ static ErrorStatus UTILS_EnablePLLAndSwitchSystem(uint32_t SYSCLK_Frequency, LL_
LL_RCC_SetAPB1Prescaler(UTILS_ClkInitStruct->APB1CLKDivider);
LL_RCC_SetAPB2Prescaler(UTILS_ClkInitStruct->APB2CLKDivider);
}
-
+
/* Decreasing the number of wait states because of lower CPU frequency */
- if(hclks_frequency_current > hclks_frequency_target)
+ if (hclks_frequency_current > hclks_frequency_target)
{
/* Set FLASH latency to lowest latency */
status = UTILS_SetFlashLatency(hclks_frequency_target);
}
/* Update SystemCoreClock variable */
- if(status == SUCCESS)
+ if (status == SUCCESS)
{
LL_SetSystemCoreClock(__LL_RCC_CALC_HCLK1_FREQ(SYSCLK_Frequency, UTILS_ClkInitStruct->CPU1CLKDivider));
}
diff --git a/License.md b/License.md
index ee63042fb..899ea0ea8 100644
--- a/License.md
+++ b/License.md
@@ -1,7 +1,7 @@
| Component | License | Copyright |
|:--------- |:------- |:----------|
-| CMSIS | Apache License 2.0 | Copyright (c) 2009-2017 ARM Limited. All rights reserved. |
-| CMSIS Device | Apache License 2.0 | ARM Limited - STMicroelectronics |
+| CMSIS | BSD-3-Clause | Copyright (c) 2009-2017 ARM Limited. All rights reserved. |
+| CMSIS Device | BSD-3-Clause | STMicroelectronics |
| STM32WB HAL | BSD-3-Clause | STMicroelectronics |
| BSP P-NUCLEO-WB55.Nucleo | BSD-3-Clause | STMicroelectronics |
| BSP P-NUCLEO-WB55.USBDongle | BSD-3-Clause | STMicroelectronics |
diff --git a/Middlewares/ST/STM32_WPAN/Release_Notes.html b/Middlewares/ST/STM32_WPAN/Release_Notes.html
index c999ac76d..1e16f0623 100644
--- a/Middlewares/ST/STM32_WPAN/Release_Notes.html
+++ b/Middlewares/ST/STM32_WPAN/Release_Notes.html
@@ -39,6 +39,7 @@
<li><p>Bluetooth Low Energy 5 Certified Applications</p></li>
<li><p>802.15.4 Thread Certified Applications (based on <a href="thread\openthread\Release_Notes.html">OpenThread</a> stack)</p></li>
<li><p>802.15.4 MAC layer</p></li>
+<li><p>Zigbee Applications</p></li>
</ul>
<p><strong>NOTE</strong> : Depending on the kind of Application targeted, the appropriate Wireless Coprocessor Firmware needs to be loaded.</p>
<p>All available binaries are located under/Projects/STM32_Copro_Wireless_Binaries directory.</p>
@@ -48,11 +49,49 @@
<div class="col-sm-12 col-lg-8">
<h1 id="update-history">Update History</h1>
<div class="collapse">
-<input type="checkbox" id="collapse-section4" checked aria-hidden="true"> <label for="collapse-section4" aria-hidden="true">V1.2.0 / 27-June-2019</label>
+<input type="checkbox" id="collapse-section5" checked aria-hidden="true"> <label for="collapse-section5" aria-hidden="false">V1.3.0 / 4-September-2019</label>
<div>
<h2 id="main-changes">Main Changes</h2>
<p>General:</p>
<ul>
+<li>Introducing support of Zigbee</li>
+</ul>
+<p>Interface:</p>
+<ul>
+<li>Cleanup inclusion file dependencies</li>
+<li>Fix local buffer size used in command SHCI_C2_FUS_StoreUsrKey()</li>
+<li>ble user events are now reported one by one (hci_notify_asynch_evt is called for each packet reported)</li>
+<li>system users event are now reported one by one (shci_notify_asynch_evt is called for each packet reported)</li>
+</ul>
+<p>Zigbee:</p>
+<ul>
+<li>First release supporting Zigbee (FFD :Full Function Device)</li>
+<li>Supporting only On/Off Cluster</li>
+</ul>
+<p>BLE-Mesh:</p>
+<ul>
+<li>BLE-Mesh library version 1.10.004
+<ul>
+<li>Light LC Controller state machine for Occupancy detection is implemented</li>
+<li>Light LC Controller state machine for Ambient Lux Level is implemented</li>
+<li>Light LC Server Mode messages added</li>
+<li>Light LC Server Occupancy Mode messages added</li>
+<li>Light LC Server Property messages added</li>
+<li>Save State in NVM controlled by Macro ENABLE_SAVE_MODEL_STATE_NVM</li>
+<li>Mode of Save State in NVM selected by Macro SAVE_MODEL_STATE_FOR_ALL_MESSAGES and SAVE_MODEL_STATE_POWER_FAILURE_DETECTION</li>
+<li>Generic Power OnOff message added</li>
+<li>Generic Power OnOff Setup message added</li>
+<li>Generic Default Transition Time message added</li>
+</ul></li>
+</ul>
+</div>
+</div>
+<div class="collapse">
+<input type="checkbox" id="collapse-section4" aria-hidden="true"> <label for="collapse-section4" aria-hidden="true">V1.2.0 / 27-June-2019</label>
+<div>
+<h2 id="main-changes-1">Main Changes</h2>
+<p>General:</p>
+<ul>
<li>Following utilities : Scheduler and Low Power Manager reworked and moved to “Utilities” directory</li>
<li>Split tl_if.c into hci_tl_if.c (BLE) and shci_tl_if.c (System) to remove dependencies to the BLE library when the application is built on top of HCI.</li>
</ul>
@@ -76,7 +115,7 @@
<div class="collapse">
<input type="checkbox" id="collapse-section3" aria-hidden="true"> <label for="collapse-section3" aria-hidden="true">V1.1.1 / 10-May-2019</label>
<div>
-<h2 id="main-changes-1">Main Changes</h2>
+<h2 id="main-changes-2">Main Changes</h2>
<p>BLE:</p>
<ul>
<li>Fix race condition in transport layer when an operating system is used.</li>
@@ -122,7 +161,7 @@
<div class="collapse">
<input type="checkbox" id="collapse-section2" aria-hidden="true"> <label for="collapse-section2" aria-hidden="true">V1.1.0 / 29-March-2019</label>
<div>
-<h2 id="main-changes-2">Main Changes</h2>
+<h2 id="main-changes-3">Main Changes</h2>
<p>General:</p>
<ul>
<li>Licenses in utilities and patterns moved from sla0044 to 3-clauses BSD</li>
@@ -148,7 +187,7 @@
<div class="collapse">
<input type="checkbox" id="collapse-section1" aria-hidden="true"> <label for="collapse-section1" aria-hidden="true">V1.0.0 / 31-January-2019</label>
<div>
-<h2 id="main-changes-3">Main Changes</h2>
+<h2 id="main-changes-4">Main Changes</h2>
<p>First release</p>
</div>
</div>
diff --git a/Middlewares/ST/STM32_WPAN/ble/ble.h b/Middlewares/ST/STM32_WPAN/ble/ble.h
index d36d2617a..e6e0d3295 100644
--- a/Middlewares/ST/STM32_WPAN/ble/ble.h
+++ b/Middlewares/ST/STM32_WPAN/ble/ble.h
@@ -49,6 +49,7 @@ extern "C" {
#include "svc/Inc/ias.h"
#include "svc/Inc/lls.h"
#include "svc/Inc/tps.h"
+#include "svc/Inc/motenv_stm.h"
#include "svc/Inc/p2p_stm.h"
#include "svc/Inc/otas_stm.h"
#include "svc/Inc/mesh.h"
diff --git a/Middlewares/ST/STM32_WPAN/ble/ble_common.h b/Middlewares/ST/STM32_WPAN/ble/ble_common.h
index a22a01ddd..b464be9b4 100644
--- a/Middlewares/ST/STM32_WPAN/ble/ble_common.h
+++ b/Middlewares/ST/STM32_WPAN/ble/ble_common.h
@@ -34,9 +34,6 @@ extern "C" {
#include "ble_conf.h"
#include "ble_dbg_conf.h"
-#include "hw_conf.h"
-
-#include "hw.h"
/* -------------------------------- *
* Basic definitions *
diff --git a/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_events.c b/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_events.c
index 7429af5cf..bbd3578b6 100644
--- a/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_events.c
+++ b/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_events.c
@@ -1,7 +1,7 @@
/******************************************************************************
* @file ble_events.c
* @author MCD Application Team
- * @date 14 June 2019
+ * @date 19 July 2019
* @brief Source file for STM32WB (Event callbacks)
* Auto-generated file: do not edit!
******************************************************************************
@@ -224,7 +224,7 @@ reason parameter can be ignored by the Host. For example, this can be the
case if the Host has issued the Disconnect command and there was a parameter
error, or the command was not presently allowed, or a Connection_Handle
that didn't correspond to a connection was given.
- * @param Status Error code. See Core v5.0, Vol. 2, part D.
+ * @param Status Status error code.
* @param Connection_Handle Connection_Handle which was disconnected.
* Values:
- 0x0000 ... 0x0EFF
@@ -234,13 +234,11 @@ that didn't correspond to a connection was given.
- 0x01: Unknown HCI Command
- 0x02: Unknown Connection Identifier
- 0x03: Hardware Failure
- - 0x04: Page Timeout
- 0x05: Authentication Failure
- 0x06: PIN or Key Missing
- 0x07: Memory Capacity Exceeded
- 0x08: Connection Timeout
- 0x09: Connection Limit Exceeded
- - 0x0A: Synchronous Connection Limit to a Device Exceeded
- 0x0B: ACL Connection Already Exists
- 0x0C: Command Disallowed
- 0x0D: Connection Rejected Due To Limited Resources
@@ -257,9 +255,6 @@ that didn't correspond to a connection was given.
- 0x18: Pairing Not Allowed
- 0x19: Unknown LMP PDU
- 0x1A: Unsupported Remote Feature / Unsupported LMP Feature
- - 0x1B: SCO Offset Rejected
- - 0x1C: SCO Interval Rejected
- - 0x1D: SCO Air Mode Rejected
- 0x1E: Invalid LMP Parameters
- 0x1F: Unspecified Error
- 0x20: Unsupported LMP Parameter Value
@@ -269,19 +264,15 @@ that didn't correspond to a connection was given.
- 0x24: LMP PDU Not Allowed
- 0x25: Encryption Mode Not Acceptable
- 0x26: Link Key cannot be Changed
- - 0x27: Requested QoS Not Supported
- 0x28: Instant Passed
- 0x29: Pairing With Unit Key Not Supported
- 0x2A: Different Transaction Collision
- - 0x2C: QoS Unacceptable Parameter
- - 0x2D: QoS Rejected
- 0x2E: Channel Assessment Not Supported
- 0x2F: Insufficient Security
- 0x30: Parameter Out Of Mandatory Range
- 0x32: Role Switch Pending
- 0x34: Reserved Slot Violation
- 0x35: Role Switch Failed
- - 0x36: Extended Inquiry Response Too Large
- 0x37: Secure Simple Pairing Not Supported by Host
- 0x38: Host Busy - Pairing
- 0x39: Connection Rejected due to No Suitable Channel Found
@@ -290,7 +281,6 @@ that didn't correspond to a connection was given.
- 0x3C: Directed Advertising Timeout
- 0x3D: Connection Terminated Due to MIC Failure
- 0x3E: Connection Failed to be Established
- - 0x3F: MAC of the 802.11 AMP
- 0x41: Failed
- 0x42: Invalid parameters
- 0x43: Busy
@@ -299,9 +289,6 @@ that didn't correspond to a connection was given.
- 0x46: Not allowed
- 0x47: GATT error
- 0x48: Address not resolved
- - 0x49: Flash read failed
- - 0x4A: Flash write failed
- - 0x4B: Flash erase failed
- 0x50: Invalid CID
- 0x5A: CSRK not found
- 0x5B: IRK not found
@@ -350,7 +337,7 @@ parameter. When Secure_Connections_Host_Support is
'disabled' or the Connection_Handle refers to an LE link, the Controller shall
only use Encryption_Enabled values 0x00 (OFF) and 0x01 (ON).
(See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.7.8)
- * @param Status Error code. See Core v5.0, Vol. 2, part D.
+ * @param Status Status error code.
* @param Connection_Handle Connection handle for which the command is given.
* Values:
- 0x0000 ... 0x0EFF
@@ -390,7 +377,7 @@ event parameter shall be Link Layer VersNr parameter, the Manufacturer_Name
event parameter shall be the CompId parameter, and the Subversion
event parameter shall be the SubVersNr parameter.
(See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.7.12)
- * @param Status Error code. See Core v5.0, Vol. 2, part D.
+ * @param Status Status error code.
* @param Connection_Handle Connection handle for which the command is given.
* Values:
- 0x0000 ... 0x0EFF
@@ -498,7 +485,7 @@ If the Encryption Key Refresh Complete event was generated due to an
encryption pause and resume operation embedded within a role switch procedure,
the Encryption Key Refresh Complete event shall be sent prior to the
Role Change event.
- * @param Status Error code. See Core v5.0, Vol. 2, part D.
+ * @param Status Status error code.
* @param Connection_Handle Connection handle for which the command is given.
* Values:
- 0x0000 ... 0x0EFF
@@ -730,15 +717,15 @@ void aci_gap_bond_lost_event_process(uint8_t *buffer_in)
been terminated by the upper layer or has completed for any other reason
* @param Procedure_Code Terminated procedure.
* Values:
- - 0x01: LIMITED_DISCOVERY_PROC
- - 0x02: GENERAL_DISCOVERY_PROC
- - 0x04: NAME_DISCOVERY_PROC
- - 0x08: AUTO_CONNECTION_ESTABLISHMENT_PROC
- - 0x10: GENERAL_CONNECTION_ESTABLISHMENT_PROC
- - 0x20: SELECTIVE_CONNECTION_ESTABLISHMENT_PROC
- - 0x40: DIRECT_CONNECTION_ESTABLISHMENT_PROC
- - 0x80: OBSERVATION_PROC
- * @param Status Error code. See Core v5.0, Vol. 2, part D.
+ - 0x01: GAP_LIMITED_DISCOVERY_PROC
+ - 0x02: GAP_GENERAL_DISCOVERY_PROC
+ - 0x04: GAP_NAME_DISCOVERY_PROC
+ - 0x08: GAP_AUTO_CONNECTION_ESTABLISHMENT_PROC
+ - 0x10: GAP_GENERAL_CONNECTION_ESTABLISHMENT_PROC
+ - 0x20: GAP_SELECTIVE_CONNECTION_ESTABLISHMENT_PROC
+ - 0x40: GAP_DIRECT_CONNECTION_ESTABLISHMENT_PROC
+ - 0x80: GAP_OBSERVATION_PROC
+ * @param Status Status error code.
* @param Data_Length Length of Data in octets
* @param Data Procedure Specific Data:
- For Name Discovery Procedure: the name of the peer device if the procedure completed successfully.
@@ -1235,13 +1222,11 @@ successfully.
- 0x01: Unknown HCI Command
- 0x02: Unknown Connection Identifier
- 0x03: Hardware Failure
- - 0x04: Page Timeout
- 0x05: Authentication Failure
- 0x06: PIN or Key Missing
- 0x07: Memory Capacity Exceeded
- 0x08: Connection Timeout
- 0x09: Connection Limit Exceeded
- - 0x0A: Synchronous Connection Limit to a Device Exceeded
- 0x0B: ACL Connection Already Exists
- 0x0C: Command Disallowed
- 0x0D: Connection Rejected Due To Limited Resources
@@ -1258,9 +1243,6 @@ successfully.
- 0x18: Pairing Not Allowed
- 0x19: Unknown LMP PDU
- 0x1A: Unsupported Remote Feature / Unsupported LMP Feature
- - 0x1B: SCO Offset Rejected
- - 0x1C: SCO Interval Rejected
- - 0x1D: SCO Air Mode Rejected
- 0x1E: Invalid LMP Parameters
- 0x1F: Unspecified Error
- 0x20: Unsupported LMP Parameter Value
@@ -1270,19 +1252,15 @@ successfully.
- 0x24: LMP PDU Not Allowed
- 0x25: Encryption Mode Not Acceptable
- 0x26: Link Key cannot be Changed
- - 0x27: Requested QoS Not Supported
- 0x28: Instant Passed
- 0x29: Pairing With Unit Key Not Supported
- 0x2A: Different Transaction Collision
- - 0x2C: QoS Unacceptable Parameter
- - 0x2D: QoS Rejected
- 0x2E: Channel Assessment Not Supported
- 0x2F: Insufficient Security
- 0x30: Parameter Out Of Mandatory Range
- 0x32: Role Switch Pending
- 0x34: Reserved Slot Violation
- 0x35: Role Switch Failed
- - 0x36: Extended Inquiry Response Too Large
- 0x37: Secure Simple Pairing Not Supported by Host
- 0x38: Host Busy - Pairing
- 0x39: Connection Rejected due to No Suitable Channel Found
@@ -1291,7 +1269,6 @@ successfully.
- 0x3C: Directed Advertising Timeout
- 0x3D: Connection Terminated Due to MIC Failure
- 0x3E: Connection Failed to be Established
- - 0x3F: MAC of the 802.11 AMP
- 0x41: Failed
- 0x42: Invalid parameters
- 0x43: Busy
@@ -1300,9 +1277,6 @@ successfully.
- 0x46: Not allowed
- 0x47: GATT error
- 0x48: Address not resolved
- - 0x49: Flash read failed
- - 0x4A: Flash write failed
- - 0x4B: Flash erase failed
- 0x50: Invalid CID
- 0x5A: CSRK not found
- 0x5B: IRK not found
@@ -1622,7 +1596,7 @@ command and received a Command Status event if the connection
establishment failed or was successful.
The Master_Clock_Accuracy parameter is only valid for a slave. On a master,
this parameter shall be set to 0x00. See Bluetooth spec 5.0 vol 2 [part E] 7.7.65.1
- * @param Status Error code. See Core v5.0, Vol. 2, part D.
+ * @param Status Status error code.
* @param Connection_Handle Connection handle to be used to identify the connection with the peer device.
* Values:
- 0x0000 ... 0x0EFF
@@ -1716,7 +1690,7 @@ void hci_le_advertising_report_event_process(uint8_t *buffer_in)
process to update the connection has completed.
On a slave, if no connection parameters are updated, then this event shall not be issued.
On a master, this event shall be issued if the Connection_Update command was sent. See Bluetooth spec 5.0 vol 2 [part E] 7.7.65.3
- * @param Status Error code. See Core v5.0, Vol. 2, part D.
+ * @param Status Status error code.
* @param Connection_Handle Connection handle to be used to identify the connection with the peer device.
* Values:
- 0x0000 ... 0x0EFF
@@ -1752,7 +1726,7 @@ void hci_le_connection_update_complete_event_process(uint8_t *buffer_in)
* @brief The LE Read Remote Used Features Complete event is used to indicate the
completion of the process of the Controller obtaining the used features of the
remote Bluetooth device specified by the Connection_Handle event parameter.See Bluetooth spec 5.0 vol 2 [part E] 7.7.65.4
- * @param Status Error code. See Core v5.0, Vol. 2, part D.
+ * @param Status Status error code.
* @param Connection_Handle Connection handle to be used to identify the connection with the peer device.
* Values:
- 0x0000 ... 0x0EFF
@@ -1840,7 +1814,7 @@ void hci_le_data_length_change_event_process(uint8_t *buffer_in)
/**
* @brief This event is generated when local P-256 key generation is complete.
See Bluetooth spec 5.0 vol 2 [part E] 7.7.65.8
- * @param Status Error code. See Core v5.0, Vol. 2, part D.
+ * @param Status Status error code.
* @param Local_P256_Public_Key Local P-256 public key.
* @retval None
*/
@@ -1858,7 +1832,7 @@ void hci_le_read_local_p256_public_key_complete_event_process(uint8_t *buffer_in
/**
* @brief This event indicates that LE Diffie Hellman key generation has been completed
by the Controller. See Bluetooth spec 5.0 vol 2 [part E] 7.7.65.9
- * @param Status Error code. See Core v5.0, Vol. 2, part D.
+ * @param Status Status error code.
* @param DHKey Diffie Hellman Key
* @retval None
*/
@@ -1888,7 +1862,7 @@ command and received a Command Status event if the connection
establishment failed or was successful.
The Master_Clock_Accuracy parameter is only valid for a slave. On a master,
this parameter shall be set to 0x00. See Bluetooth spec 5.0 vol 2 [part E] 7.7.65.10
- * @param Status Error code. See Core v5.0, Vol. 2, part D.
+ * @param Status Status error code.
* @param Connection_Handle Connection handle to be used to identify the connection with the peer device.
* Values:
- 0x0000 ... 0x0EFF
@@ -1990,7 +1964,7 @@ this event shall be issued.
If an LE_Set_PHY command was sent and the Controller determines that
neither PHY will change as a result, it issues this event immediately.
See See Bluetooth spec 5.0 vol 2 [part E] 7.7.65.12
- * @param Status Error code. See Core v5.0, Vol. 2, part D.
+ * @param Status Status error code.
* @param Connection_Handle Connection handle to be used to identify the connection with the peer device.
* Values:
- 0x0000 ... 0x0EFF
diff --git a/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_events.h b/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_events.h
index 958c5eeaf..5a568f645 100644
--- a/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_events.h
+++ b/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_events.h
@@ -1,7 +1,7 @@
/******************************************************************************
* @file ble_events.h
* @author MCD Application Team
- * @date 14 June 2019
+ * @date 19 July 2019
* @brief Header file for STM32WB (Event callbacks)
* Auto-generated file: do not edit!
******************************************************************************
@@ -52,7 +52,7 @@ reason parameter can be ignored by the Host. For example, this can be the
case if the Host has issued the Disconnect command and there was a parameter
error, or the command was not presently allowed, or a Connection_Handle
that didn't correspond to a connection was given.
- * @param Status Error code. See Core v5.0, Vol. 2, part D.
+ * @param Status Status error code.
* @param Connection_Handle Connection_Handle which was disconnected.
* Values:
- 0x0000 ... 0x0EFF
@@ -62,13 +62,11 @@ that didn't correspond to a connection was given.
- 0x01: Unknown HCI Command
- 0x02: Unknown Connection Identifier
- 0x03: Hardware Failure
- - 0x04: Page Timeout
- 0x05: Authentication Failure
- 0x06: PIN or Key Missing
- 0x07: Memory Capacity Exceeded
- 0x08: Connection Timeout
- 0x09: Connection Limit Exceeded
- - 0x0A: Synchronous Connection Limit to a Device Exceeded
- 0x0B: ACL Connection Already Exists
- 0x0C: Command Disallowed
- 0x0D: Connection Rejected Due To Limited Resources
@@ -85,9 +83,6 @@ that didn't correspond to a connection was given.
- 0x18: Pairing Not Allowed
- 0x19: Unknown LMP PDU
- 0x1A: Unsupported Remote Feature / Unsupported LMP Feature
- - 0x1B: SCO Offset Rejected
- - 0x1C: SCO Interval Rejected
- - 0x1D: SCO Air Mode Rejected
- 0x1E: Invalid LMP Parameters
- 0x1F: Unspecified Error
- 0x20: Unsupported LMP Parameter Value
@@ -97,19 +92,15 @@ that didn't correspond to a connection was given.
- 0x24: LMP PDU Not Allowed
- 0x25: Encryption Mode Not Acceptable
- 0x26: Link Key cannot be Changed
- - 0x27: Requested QoS Not Supported
- 0x28: Instant Passed
- 0x29: Pairing With Unit Key Not Supported
- 0x2A: Different Transaction Collision
- - 0x2C: QoS Unacceptable Parameter
- - 0x2D: QoS Rejected
- 0x2E: Channel Assessment Not Supported
- 0x2F: Insufficient Security
- 0x30: Parameter Out Of Mandatory Range
- 0x32: Role Switch Pending
- 0x34: Reserved Slot Violation
- 0x35: Role Switch Failed
- - 0x36: Extended Inquiry Response Too Large
- 0x37: Secure Simple Pairing Not Supported by Host
- 0x38: Host Busy - Pairing
- 0x39: Connection Rejected due to No Suitable Channel Found
@@ -118,7 +109,6 @@ that didn't correspond to a connection was given.
- 0x3C: Directed Advertising Timeout
- 0x3D: Connection Terminated Due to MIC Failure
- 0x3E: Connection Failed to be Established
- - 0x3F: MAC of the 802.11 AMP
- 0x41: Failed
- 0x42: Invalid parameters
- 0x43: Busy
@@ -127,9 +117,6 @@ that didn't correspond to a connection was given.
- 0x46: Not allowed
- 0x47: GATT error
- 0x48: Address not resolved
- - 0x49: Flash read failed
- - 0x4A: Flash write failed
- - 0x4B: Flash erase failed
- 0x50: Invalid CID
- 0x5A: CSRK not found
- 0x5B: IRK not found
@@ -169,7 +156,7 @@ parameter. When Secure_Connections_Host_Support is
'disabled' or the Connection_Handle refers to an LE link, the Controller shall
only use Encryption_Enabled values 0x00 (OFF) and 0x01 (ON).
(See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.7.8)
- * @param Status Error code. See Core v5.0, Vol. 2, part D.
+ * @param Status Status error code.
* @param Connection_Handle Connection handle for which the command is given.
* Values:
- 0x0000 ... 0x0EFF
@@ -200,7 +187,7 @@ event parameter shall be Link Layer VersNr parameter, the Manufacturer_Name
event parameter shall be the CompId parameter, and the Subversion
event parameter shall be the SubVersNr parameter.
(See Bluetooth Specification v.5.0, Vol. 2, Part E, 7.7.12)
- * @param Status Error code. See Core v5.0, Vol. 2, part D.
+ * @param Status Status error code.
* @param Connection_Handle Connection handle for which the command is given.
* Values:
- 0x0000 ... 0x0EFF
@@ -272,7 +259,7 @@ If the Encryption Key Refresh Complete event was generated due to an
encryption pause and resume operation embedded within a role switch procedure,
the Encryption Key Refresh Complete event shall be sent prior to the
Role Change event.
- * @param Status Error code. See Core v5.0, Vol. 2, part D.
+ * @param Status Status error code.
* @param Connection_Handle Connection handle for which the command is given.
* Values:
- 0x0000 ... 0x0EFF
@@ -300,7 +287,7 @@ command and received a Command Status event if the connection
establishment failed or was successful.
The Master_Clock_Accuracy parameter is only valid for a slave. On a master,
this parameter shall be set to 0x00. See Bluetooth spec 5.0 vol 2 [part E] 7.7.65.1
- * @param Status Error code. See Core v5.0, Vol. 2, part D.
+ * @param Status Status error code.
* @param Connection_Handle Connection handle to be used to identify the connection with the peer device.
* Values:
- 0x0000 ... 0x0EFF
@@ -365,7 +352,7 @@ WEAK_FUNCTION(void hci_le_advertising_report_event(uint8_t Num_Reports,
process to update the connection has completed.
On a slave, if no connection parameters are updated, then this event shall not be issued.
On a master, this event shall be issued if the Connection_Update command was sent. See Bluetooth spec 5.0 vol 2 [part E] 7.7.65.3
- * @param Status Error code. See Core v5.0, Vol. 2, part D.
+ * @param Status Status error code.
* @param Connection_Handle Connection handle to be used to identify the connection with the peer device.
* Values:
- 0x0000 ... 0x0EFF
@@ -392,7 +379,7 @@ WEAK_FUNCTION(void hci_le_connection_update_complete_event(uint8_t Status,
* @brief The LE Read Remote Used Features Complete event is used to indicate the
completion of the process of the Controller obtaining the used features of the
remote Bluetooth device specified by the Connection_Handle event parameter.See Bluetooth spec 5.0 vol 2 [part E] 7.7.65.4
- * @param Status Error code. See Core v5.0, Vol. 2, part D.
+ * @param Status Status error code.
* @param Connection_Handle Connection handle to be used to identify the connection with the peer device.
* Values:
- 0x0000 ... 0x0EFF
@@ -453,7 +440,7 @@ WEAK_FUNCTION(void hci_le_data_length_change_event(uint16_t Connection_Handle,
/**
* @brief This event is generated when local P-256 key generation is complete.
See Bluetooth spec 5.0 vol 2 [part E] 7.7.65.8
- * @param Status Error code. See Core v5.0, Vol. 2, part D.
+ * @param Status Status error code.
* @param Local_P256_Public_Key Local P-256 public key.
* @retval None
*/
@@ -462,7 +449,7 @@ WEAK_FUNCTION(void hci_le_read_local_p256_public_key_complete_event(uint8_t Stat
/**
* @brief This event indicates that LE Diffie Hellman key generation has been completed
by the Controller. See Bluetooth spec 5.0 vol 2 [part E] 7.7.65.9
- * @param Status Error code. See Core v5.0, Vol. 2, part D.
+ * @param Status Status error code.
* @param DHKey Diffie Hellman Key
* @retval None
*/
@@ -483,7 +470,7 @@ command and received a Command Status event if the connection
establishment failed or was successful.
The Master_Clock_Accuracy parameter is only valid for a slave. On a master,
this parameter shall be set to 0x00. See Bluetooth spec 5.0 vol 2 [part E] 7.7.65.10
- * @param Status Error code. See Core v5.0, Vol. 2, part D.
+ * @param Status Status error code.
* @param Connection_Handle Connection handle to be used to identify the connection with the peer device.
* Values:
- 0x0000 ... 0x0EFF
@@ -567,7 +554,7 @@ this event shall be issued.
If an LE_Set_PHY command was sent and the Controller determines that
neither PHY will change as a result, it issues this event immediately.
See See Bluetooth spec 5.0 vol 2 [part E] 7.7.65.12
- * @param Status Error code. See Core v5.0, Vol. 2, part D.
+ * @param Status Status error code.
* @param Connection_Handle Connection handle to be used to identify the connection with the peer device.
* Values:
- 0x0000 ... 0x0EFF
@@ -668,15 +655,15 @@ WEAK_FUNCTION(void aci_gap_bond_lost_event(void));
been terminated by the upper layer or has completed for any other reason
* @param Procedure_Code Terminated procedure.
* Values:
- - 0x01: LIMITED_DISCOVERY_PROC
- - 0x02: GENERAL_DISCOVERY_PROC
- - 0x04: NAME_DISCOVERY_PROC
- - 0x08: AUTO_CONNECTION_ESTABLISHMENT_PROC
- - 0x10: GENERAL_CONNECTION_ESTABLISHMENT_PROC
- - 0x20: SELECTIVE_CONNECTION_ESTABLISHMENT_PROC
- - 0x40: DIRECT_CONNECTION_ESTABLISHMENT_PROC
- - 0x80: OBSERVATION_PROC
- * @param Status Error code. See Core v5.0, Vol. 2, part D.
+ - 0x01: GAP_LIMITED_DISCOVERY_PROC
+ - 0x02: GAP_GENERAL_DISCOVERY_PROC
+ - 0x04: GAP_NAME_DISCOVERY_PROC
+ - 0x08: GAP_AUTO_CONNECTION_ESTABLISHMENT_PROC
+ - 0x10: GAP_GENERAL_CONNECTION_ESTABLISHMENT_PROC
+ - 0x20: GAP_SELECTIVE_CONNECTION_ESTABLISHMENT_PROC
+ - 0x40: GAP_DIRECT_CONNECTION_ESTABLISHMENT_PROC
+ - 0x80: GAP_OBSERVATION_PROC
+ * @param Status Status error code.
* @param Data_Length Length of Data in octets
* @param Data Procedure Specific Data:
- For Name Discovery Procedure: the name of the peer device if the procedure completed successfully.
@@ -918,13 +905,11 @@ successfully.
- 0x01: Unknown HCI Command
- 0x02: Unknown Connection Identifier
- 0x03: Hardware Failure
- - 0x04: Page Timeout
- 0x05: Authentication Failure
- 0x06: PIN or Key Missing
- 0x07: Memory Capacity Exceeded
- 0x08: Connection Timeout
- 0x09: Connection Limit Exceeded
- - 0x0A: Synchronous Connection Limit to a Device Exceeded
- 0x0B: ACL Connection Already Exists
- 0x0C: Command Disallowed
- 0x0D: Connection Rejected Due To Limited Resources
@@ -941,9 +926,6 @@ successfully.
- 0x18: Pairing Not Allowed
- 0x19: Unknown LMP PDU
- 0x1A: Unsupported Remote Feature / Unsupported LMP Feature
- - 0x1B: SCO Offset Rejected
- - 0x1C: SCO Interval Rejected
- - 0x1D: SCO Air Mode Rejected
- 0x1E: Invalid LMP Parameters
- 0x1F: Unspecified Error
- 0x20: Unsupported LMP Parameter Value
@@ -953,19 +935,15 @@ successfully.
- 0x24: LMP PDU Not Allowed
- 0x25: Encryption Mode Not Acceptable
- 0x26: Link Key cannot be Changed
- - 0x27: Requested QoS Not Supported
- 0x28: Instant Passed
- 0x29: Pairing With Unit Key Not Supported
- 0x2A: Different Transaction Collision
- - 0x2C: QoS Unacceptable Parameter
- - 0x2D: QoS Rejected
- 0x2E: Channel Assessment Not Supported
- 0x2F: Insufficient Security
- 0x30: Parameter Out Of Mandatory Range
- 0x32: Role Switch Pending
- 0x34: Reserved Slot Violation
- 0x35: Role Switch Failed
- - 0x36: Extended Inquiry Response Too Large
- 0x37: Secure Simple Pairing Not Supported by Host
- 0x38: Host Busy - Pairing
- 0x39: Connection Rejected due to No Suitable Channel Found
@@ -974,7 +952,6 @@ successfully.
- 0x3C: Directed Advertising Timeout
- 0x3D: Connection Terminated Due to MIC Failure
- 0x3E: Connection Failed to be Established
- - 0x3F: MAC of the 802.11 AMP
- 0x41: Failed
- 0x42: Invalid parameters
- 0x43: Busy
@@ -983,9 +960,6 @@ successfully.
- 0x46: Not allowed
- 0x47: GATT error
- 0x48: Address not resolved
- - 0x49: Flash read failed
- - 0x4A: Flash write failed
- - 0x4B: Flash erase failed
- 0x50: Invalid CID
- 0x5A: CSRK not found
- 0x5B: IRK not found
diff --git a/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_gap_aci.h b/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_gap_aci.h
index 2a7f0b261..0e0d1de7d 100644
--- a/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_gap_aci.h
+++ b/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_gap_aci.h
@@ -1,7 +1,7 @@
/******************************************************************************
* @file ble_gap_aci.h
* @author MCD Application Team
- * @date 23 May 2019
+ * @date 19 July 2019
* @brief Header file for STM32WB (gap_aci)
* Auto-generated file: do not edit!
******************************************************************************
@@ -1016,14 +1016,14 @@ returned with the procedure code set to the corresponding procedure.
* @param Procedure_Code GAP procedure bitmap.
* Values:
- 0x00: No events
- - 0x01: LIMITED_DISCOVERY_PROC
- - 0x02: GENERAL_DISCOVERY_PROC
- - 0x04: NAME_DISCOVERY_PROC
- - 0x08: AUTO_CONNECTION_ESTABLISHMENT_PROC
- - 0x10: GENERAL_CONNECTION_ESTABLISHMENT_PROC
- - 0x20: SELECTIVE_CONNECTION_ESTABLISHMENT_PROC
- - 0x40: DIRECT_CONNECTION_ESTABLISHMENT_PROC
- - 0x80: OBSERVATION_PROC
+ - 0x01: GAP_LIMITED_DISCOVERY_PROC
+ - 0x02: GAP_GENERAL_DISCOVERY_PROC
+ - 0x04: GAP_NAME_DISCOVERY_PROC
+ - 0x08: GAP_AUTO_CONNECTION_ESTABLISHMENT_PROC
+ - 0x10: GAP_GENERAL_CONNECTION_ESTABLISHMENT_PROC
+ - 0x20: GAP_SELECTIVE_CONNECTION_ESTABLISHMENT_PROC
+ - 0x40: GAP_DIRECT_CONNECTION_ESTABLISHMENT_PROC
+ - 0x80: GAP_OBSERVATION_PROC
* @retval Value indicating success or error code.
*/
tBleStatus aci_gap_terminate_gap_proc(uint8_t Procedure_Code);
diff --git a/Middlewares/ST/STM32_WPAN/ble/core/ble_bufsize.h b/Middlewares/ST/STM32_WPAN/ble/core/ble_bufsize.h
index d2dcdf317..3135910c1 100644
--- a/Middlewares/ST/STM32_WPAN/ble/core/ble_bufsize.h
+++ b/Middlewares/ST/STM32_WPAN/ble/core/ble_bufsize.h
@@ -102,7 +102,7 @@
* - a part, that may be considered "fixed", i.e. independent from the above
* mentioned parameters.
*/
-#define BLE_FIXED_BUFFER_SIZE_BYTES(llo) ((llo) ? 6068 : 6504)
+#define BLE_FIXED_BUFFER_SIZE_BYTES(llo) ((llo) ? 6064 : 6504)
/*
* BLE_PER_LINK_SIZE_BYTES: additional memory size used per link
diff --git a/Middlewares/ST/STM32_WPAN/ble/core/ble_defs.h b/Middlewares/ST/STM32_WPAN/ble/core/ble_defs.h
index d4db16eec..2c9a00f5a 100644
--- a/Middlewares/ST/STM32_WPAN/ble/core/ble_defs.h
+++ b/Middlewares/ST/STM32_WPAN/ble/core/ble_defs.h
@@ -33,9 +33,6 @@
#define BLE_STATUS_NOT_ALLOWED 0x46
#define BLE_STATUS_ERROR 0x47
#define BLE_STATUS_ADDR_NOT_RESOLVED 0x48
-#define FLASH_READ_FAILED 0x49
-#define FLASH_WRITE_FAILED 0x4A
-#define FLASH_ERASE_FAILED 0x4B
#define BLE_STATUS_INVALID_CID 0x50
#define TIMER_NOT_VALID_LAYER 0x54
#define TIMER_INSUFFICIENT_RESOURCES 0x55
@@ -137,9 +134,13 @@
#define AD_TYPE_SEC_MGR_OOB_FLAGS 0x11
#define AD_TYPE_SLAVE_CONN_INTERVAL 0x12
#define AD_TYPE_SERV_SOLICIT_16_BIT_UUID_LIST 0x14
-#define AD_TYPE_SERV_SOLICIT_32_BIT_UUID_LIST 0x1F
#define AD_TYPE_SERV_SOLICIT_128_BIT_UUID_LIST 0x15
#define AD_TYPE_SERVICE_DATA 0x16
+#define AD_TYPE_APPEARANCE 0x19
+#define AD_TYPE_ADVERTISING_INTERVAL 0x1A
+#define AD_TYPE_LE_ROLE 0x1C
+#define AD_TYPE_SERV_SOLICIT_32_BIT_UUID_LIST 0x1F
+#define AD_TYPE_URI 0x24
#define AD_TYPE_MANUFACTURER_SPECIFIC_DATA 0xFF
diff --git a/Middlewares/ST/STM32_WPAN/ble/core/ble_legacy.h b/Middlewares/ST/STM32_WPAN/ble/core/ble_legacy.h
index 7a6230941..297687a5f 100644
--- a/Middlewares/ST/STM32_WPAN/ble/core/ble_legacy.h
+++ b/Middlewares/ST/STM32_WPAN/ble/core/ble_legacy.h
@@ -127,7 +127,6 @@ typedef uint8_t tBDAddr[6];
/* Error Codes as specified by the specification
- * according to the spec the error codes range from 0x00 to 0x3F
*/
#define ERR_CMD_SUCCESS 0x00
#define ERR_UNKNOWN_HCI_COMMAND 0x01
@@ -159,4 +158,12 @@ typedef uint8_t tBDAddr[6];
/* ------------------------------------------------------------------------- */
+#define FLASH_READ_FAILED 0x49
+#define FLASH_WRITE_FAILED 0x4A
+#define FLASH_ERASE_FAILED 0x4B
+
+
+/* ------------------------------------------------------------------------- */
+
+
#endif /* BLE_LEGACY_H__ */
diff --git a/Middlewares/ST/STM32_WPAN/ble/core/ble_std.h b/Middlewares/ST/STM32_WPAN/ble/core/ble_std.h
index 051f9451d..269443bf3 100644
--- a/Middlewares/ST/STM32_WPAN/ble/core/ble_std.h
+++ b/Middlewares/ST/STM32_WPAN/ble/core/ble_std.h
@@ -92,6 +92,16 @@
#define HCI_RX_PHY_LE_2M 0x02
#define HCI_RX_PHY_LE_CODED 0x03
+/* HCI_LE_Set_PHY */
+#define HCI_ALL_PHYS_TX_NO_PREF 0x01
+#define HCI_ALL_PHYS_RX_NO_PREF 0x02
+#define HCI_TX_PHYS_LE_1M_PREF 0x01
+#define HCI_TX_PHYS_LE_2M_PREF 0x02
+#define HCI_TX_PHYS_LE_CODED_PREF 0x04
+#define HCI_RX_PHYS_LE_1M_PREF 0x01
+#define HCI_RX_PHYS_LE_2M_PREF 0x02
+#define HCI_RX_PHYS_LE_CODED_PREF 0x04
+
#endif /* BLE_STD_H__ */
diff --git a/Middlewares/ST/STM32_WPAN/ble/core/doc/STM32WB_BLE_Wireless_Interface.html b/Middlewares/ST/STM32_WPAN/ble/core/doc/STM32WB_BLE_Wireless_Interface.html
index a80a6cfea..ea0bccc7c 100644
--- a/Middlewares/ST/STM32_WPAN/ble/core/doc/STM32WB_BLE_Wireless_Interface.html
+++ b/Middlewares/ST/STM32_WPAN/ble/core/doc/STM32WB_BLE_Wireless_Interface.html
@@ -636,7 +636,7 @@ padding-right: 0px;
}
td.gsib_a {padding:0px;padding-top:4px;padding-left:3px;}
-</style></head><body><font face="arial"><h1>STM32WB BLE Wireless Interface</h1><p>This document describes the STM32WB BLE Application Commands Interface (ACI) and Host Commands Interface (HCI).</p><p><a href="https://www.st.com/en/microcontrollers/stm32wb-series.html">STM32WB Series Website</a></p><h2>Revision history</h2><p>December 2018 - Rev 1.0 - Rational: 1st Release for interface 1.0 </p><p>February 2019 - Rev 1.1 - Modified hci_hardware_event comments</p><p>March 2019 - Rev 1.2 - Removed hal datapump event documentation </p><p>March 2019 - Rev 1.3 - Modification ACI_HAL_FW_ERROR_EVENT error code</p><p>March 2019 - Rev 1.4 - Change default mask of HCI_SET_EVENT_MASK </p><p>May 2019 - Rev 1.5 - ACI_GATT_NOTIFICATION_EXT_EVENT added</p><p>June 2019 - Rev 1.6 - Change comment on usage of Char Handles in multiple ACI_GATT commands + Added ACI_GATT_NOTIFICATION_EXT_EVENT</p><p>June 2019 - Rev 1.7 - Change descriptions of ACI_ATT_READ_BY_TYPE_REQ and ACI_GATT_READ_USING_CHAR_UUID</p><h2>Contents</h2><p><a href="#HCI/ACI commands_anchor">HCI/ACI commands</a></p><p><a href="#HCI/ACI events_anchor">HCI/ACI events</a></p><p><a href="#Error codes_anchor">Error codes</a></p><h1><a name="HCI/ACI commands_anchor">HCI/ACI commands</a></h1><p><a href="#HCI commands_anchor">HCI commands</a></p><p><a href="#HCI TESTING commands_anchor">HCI TESTING commands</a></p><p><a href="#ACI HAL commands_anchor">ACI HAL commands</a></p><p><a href="#ACI GAP commands_anchor">ACI GAP commands</a></p><p><a href="#ACI GATT/ATT commands_anchor">ACI GATT/ATT commands</a></p><p><a href="#ACI L2CAP commands_anchor">ACI L2CAP commands</a></p><h2><a name="HCI commands_anchor">HCI commands</a></h2><h3>HCI commands</h3><table width="800" border="1" class="reference">
+</style></head><body><font face="arial"><h1>STM32WB BLE Wireless Interface</h1><p>This document describes the STM32WB BLE Application Commands Interface (ACI) and Host Commands Interface (HCI).</p><p><a href="https://www.st.com/en/microcontrollers/stm32wb-series.html">STM32WB Series website</a></p><h2>Revision history</h2><p>December 2018 - Rev 1.0 - Rational: 1st Release for interface 1.0 </p><p>February 2019 - Rev 1.1 - Modified hci_hardware_event comments</p><p>March 2019 - Rev 1.2 - Removed hal datapump event documentation </p><p>March 2019 - Rev 1.3 - Modification ACI_HAL_FW_ERROR_EVENT error code</p><p>March 2019 - Rev 1.4 - Change default mask of HCI_SET_EVENT_MASK </p><p>May 2019 - Rev 1.5 - ACI_GATT_NOTIFICATION_EXT_EVENT added</p><p>June 2019 - Rev 1.6 - Change comment on usage of Char Handles in multiple ACI_GATT commands + Added ACI_GATT_NOTIFICATION_EXT_EVENT</p><p>June 2019 - Rev 1.7 - Change descriptions of ACI_ATT_READ_BY_TYPE_REQ and ACI_GATT_READ_USING_CHAR_UUID</p><p>July 2019 - Rev 1.8 - Reworked error codes section + Added GAP_ prefix to the GAP procedure bitmap definitions</p><h2>Contents</h2><p><a href="#HCI/ACI commands_anchor">HCI/ACI commands</a></p><p><a href="#HCI/ACI events_anchor">HCI/ACI events</a></p><p><a href="#Status error codes_anchor">Status error codes</a></p><h1><a name="HCI/ACI commands_anchor">HCI/ACI commands</a></h1><p><a href="#HCI commands_anchor">HCI commands</a></p><p><a href="#HCI TESTING commands_anchor">HCI TESTING commands</a></p><p><a href="#ACI HAL commands_anchor">ACI HAL commands</a></p><p><a href="#ACI GAP commands_anchor">ACI GAP commands</a></p><p><a href="#ACI GATT/ATT commands_anchor">ACI GATT/ATT commands</a></p><p><a href="#ACI L2CAP commands_anchor">ACI L2CAP commands</a></p><h2><a name="HCI commands_anchor">HCI commands</a></h2><h3>HCI commands</h3><table width="800" border="1" class="reference">
<tr><th>Command</th><th>OpCode</th></tr>
<tr><td><a href="#HCI_DISCONNECT_anchor">HCI_DISCONNECT</a></td><td><p>0x0406</p>
</td></tr>
@@ -775,7 +775,7 @@ since immediately after <a href="#HCI_DISCONNECTION_COMPLETE_EVENT_anchor">HCI_D
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#HCI_DISCONNECTION_COMPLETE_EVENT_anchor">HCI_DISCONNECTION_COMPLETE_EVENT</a></li><h2><a name="HCI_READ_REMOTE_VERSION_INFORMATION_anchor">HCI_READ_REMOTE_VERSION_INFORMATION</a></h2><h3>Description</h3><p>This command will obtain the values for the version information for the remote
device identified by the Connection_Handle parameter. The Connection_Handle
@@ -790,7 +790,7 @@ must be a Connection_Handle for an ACL or LE connection.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#HCI_READ_REMOTE_VERSION_INFORMATION_COMPLETE_EVENT_anchor">HCI_READ_REMOTE_VERSION_INFORMATION_COMPLETE_EVENT</a></li><h2><a name="HCI_SET_EVENT_MASK_anchor">HCI_SET_EVENT_MASK</a></h2><h3>Description</h3><p>The Set_Event_Mask command is used to control which events are generated
by the HCI for the Host.
@@ -810,7 +810,7 @@ occurs. The event mask allows the Host to control how much it is interrupted.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="HCI_RESET_anchor">HCI_RESET</a></h2><h3>Description</h3><p>The Reset command will reset the Link Layer on an LE
Controller.
@@ -828,7 +828,7 @@ event related to the Reset command has been received.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="HCI_READ_TRANSMIT_POWER_LEVEL_anchor">HCI_READ_TRANSMIT_POWER_LEVEL</a></h2><h3>Description</h3><p>This command reads the values for the Transmit_Power_Level parameter for
the specified Connection_Handle. The Connection_Handle shall be a Connection_Handle
@@ -847,7 +847,7 @@ for an ACL connection.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Connection_Handle</p>
</td><td><p>2</p>
@@ -883,7 +883,7 @@ exist. See Bluetooth Spec v.5.0, Vol. 2, Part E, 7.3.38</p><h3>Input parameters<
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><h2><a name="HCI_HOST_BUFFER_SIZE_anchor">HCI_HOST_BUFFER_SIZE</a></h2><h3>Description</h3><p>The Host_Buffer_Size command is used by the Host to notify the Controller
about the maximum size of the data portion of HCI ACL and synchronous Data
@@ -938,7 +938,7 @@ Packet header. See Bluetooth Spec v.5.0, Vol. 2, Part E, 7.3.39</p><h3>Input par
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><h2><a name="HCI_HOST_NUMBER_OF_COMPLETED_PACKETS_anchor">HCI_HOST_NUMBER_OF_COMPLETED_PACKETS</a></h2><h3>Description</h3><p>The Host_Number_Of_Completed_Packets command is used by the Host to
indicate to the Controller the number of HCI Data Packets that have been
@@ -992,7 +992,7 @@ The HCI Revision and LMP/PAL Subversion are implementation dependent.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>HCI_Version</p>
</td><td><p>1</p>
@@ -1025,7 +1025,7 @@ that command is also supported.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Supported_Commands</p>
</td><td><p>64</p>
@@ -1040,7 +1040,7 @@ Part C, Link Manager Protocol Specification on page 227.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>LMP_Features</p>
</td><td><p>8</p>
@@ -1056,7 +1056,7 @@ BD_ADDR.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>BD_ADDR</p>
</td><td><p>6</p>
@@ -1078,7 +1078,7 @@ be read, the RSSI metric shall be set to 127.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Connection_Handle</p>
</td><td><p>2</p>
@@ -1107,7 +1107,7 @@ of how the LE_Event_Mask is set.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="HCI_LE_READ_BUFFER_SIZE_anchor">HCI_LE_READ_BUFFER_SIZE</a></h2><h3>Description</h3><p>The LE_Read_Buffer_Size command is used to read the maximum size of the
data portion of HCI LE ACL Data Packets sent from the Host to the Controller.
@@ -1137,7 +1137,7 @@ include the length of the HCI Data Packet header.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>HC_LE_ACL_Data_Packet_Length</p>
</td><td><p>2</p>
@@ -1156,7 +1156,7 @@ buffers of the Controller.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>LE_Features</p>
</td><td><p>8</p>
@@ -1174,7 +1174,7 @@ Random Device Address in the Controller (see [Vol 6] Part B, Section 1.3).
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="HCI_LE_SET_ADVERTISING_PARAMETERS_anchor">HCI_LE_SET_ADVERTISING_PARAMETERS</a></h2><h3>Description</h3><p>The LE_Set_Advertising_Parameters command is used by the Host to set the
advertising parameters.
@@ -1265,7 +1265,7 @@ Default: 00000111b (all channels enabled).</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="HCI_LE_READ_ADVERTISING_CHANNEL_TX_POWER_anchor">HCI_LE_READ_ADVERTISING_CHANNEL_TX_POWER</a></h2><h3>Description</h3><p>The LE_Read_Advertising_Channel_Tx_Power command is used by the Host
to read the transmit power level used for LE advertising channel packets.
@@ -1273,7 +1273,7 @@ to read the transmit power level used for LE advertising channel packets.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Transmit_Power_Level</p>
</td><td><p>1</p>
@@ -1299,7 +1299,7 @@ packets, as defined in [Vol 3] Part C, Section 11.,
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="HCI_LE_SET_SCAN_RESPONSE_DATA_anchor">HCI_LE_SET_SCAN_RESPONSE_DATA</a></h2><h3>Description</h3><p>This command is used to provide data used in Scanning Packets that have a
data field.
@@ -1319,7 +1319,7 @@ Scanning Packets, as defined in [Vol 3] Part C, Section 11.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="HCI_LE_SET_ADVERTISE_ENABLE_anchor">HCI_LE_SET_ADVERTISE_ENABLE</a></h2><h3>Description</h3><p>The LE_Set_Advertise_Enable command is used to request the Controller to
start or stop advertising. The Controller manages the timing of advertisements
@@ -1340,7 +1340,7 @@ disabled.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><li><a href="#HCI_LE_CONNECTION_COMPLETE_EVENT_anchor">HCI_LE_CONNECTION_COMPLETE_EVENT</a></li><h2><a name="HCI_LE_SET_SCAN_PARAMETERS_anchor">HCI_LE_SET_SCAN_PARAMETERS</a></h2><h3>Description</h3><p>The LE_Set_Scan_Parameters command is used to set the scan parameters.
The LE_Scan_Type parameter controls the type of scan to perform.
@@ -1413,7 +1413,7 @@ the White List.Directed advertisement packets where initiator address is RPA and
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="HCI_LE_SET_SCAN_ENABLE_anchor">HCI_LE_SET_SCAN_ENABLE</a></h2><h3>Description</h3><p>The LE_Set_Scan_Enable command is used to start scanning. Scanning is
used to discover advertising devices nearby.
@@ -1434,7 +1434,7 @@ advertising reports for each packet received.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><li><a href="#HCI_LE_ADVERTISING_REPORT_EVENT_anchor">HCI_LE_ADVERTISING_REPORT_EVENT</a></li><h2><a name="HCI_LE_CREATE_CONNECTION_anchor">HCI_LE_CREATE_CONNECTION</a></h2><h3>Description</h3><p>The LE_Create_Connection command is used to create a Link Layer connection
to a connectable advertiser.
@@ -1561,7 +1561,7 @@ Time = N * 0.625 msec.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#HCI_LE_CONNECTION_COMPLETE_EVENT_anchor">HCI_LE_CONNECTION_COMPLETE_EVENT</a></li><h2><a name="HCI_LE_CREATE_CONNECTION_CANCEL_anchor">HCI_LE_CREATE_CONNECTION_CANCEL</a></h2><h3>Description</h3><p>The LE_Create_Connection_Cancel command is used to cancel the LE_Create_Connection
command. This command shall only be issued after the
@@ -1572,7 +1572,7 @@ Connection Complete event.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><li><a href="#HCI_LE_CONNECTION_COMPLETE_EVENT_anchor">HCI_LE_CONNECTION_COMPLETE_EVENT</a></li><h2><a name="HCI_LE_READ_WHITE_LIST_SIZE_anchor">HCI_LE_READ_WHITE_LIST_SIZE</a></h2><h3>Description</h3><p>The LE_Read_White_List_Size command is used to read the total number of
white list entries that can be stored in the Controller.
@@ -1580,7 +1580,7 @@ white list entries that can be stored in the Controller.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>White_List_Size</p>
</td><td><p>1</p>
@@ -1597,7 +1597,7 @@ command is outstanding.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="HCI_LE_ADD_DEVICE_TO_WHITE_LIST_anchor">HCI_LE_ADD_DEVICE_TO_WHITE_LIST</a></h2><h3>Description</h3><p>The LE_Add_Device_To_White_List command is used to add a single device
to the white list stored in the Controller.
@@ -1621,7 +1621,7 @@ to be added to the white list.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="HCI_LE_REMOVE_DEVICE_FROM_WHITE_LIST_anchor">HCI_LE_REMOVE_DEVICE_FROM_WHITE_LIST</a></h2><h3>Description</h3><p>The LE_Remove_Device_From_White_List command is used to remove a single
device from the white list stored in the Controller.
@@ -1647,7 +1647,7 @@ is outstanding.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="HCI_LE_CONNECTION_UPDATE_anchor">HCI_LE_CONNECTION_UPDATE</a></h2><h3>Description</h3><p>The LE_Connection_Update command is used to change the Link Layer connection
parameters of a connection. This command is supported only on master side.
@@ -1710,7 +1710,7 @@ Time = N * 0.625 msec.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#HCI_LE_CONNECTION_UPDATE_COMPLETE_EVENT_anchor">HCI_LE_CONNECTION_UPDATE_COMPLETE_EVENT</a></li><h2><a name="HCI_LE_SET_HOST_CHANNEL_CLASSIFICATION_anchor">HCI_LE_SET_HOST_CHANNEL_CLASSIFICATION</a></h2><h3>Description</h3><p>The LE_Set_Host_Channel_Classification command allows the Host to specify
a channel classification for data channels based on its "local information". This
@@ -1738,7 +1738,7 @@ At least one channel shall be marked as unknown.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="HCI_LE_READ_CHANNEL_MAP_anchor">HCI_LE_READ_CHANNEL_MAP</a></h2><h3>Description</h3><p>The LE_Read_Channel_Map command returns the current Channel_Map for
the specified Connection_Handle. The returned value indicates the state of the
@@ -1756,7 +1756,7 @@ acknowledgement.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Connection_Handle</p>
</td><td><p>2</p>
@@ -1785,7 +1785,7 @@ This command may be issued on both the master and slave.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#HCI_LE_READ_REMOTE_USED_FEATURES_COMPLETE_EVENT_anchor">HCI_LE_READ_REMOTE_USED_FEATURES_COMPLETE_EVENT</a></li><h2><a name="HCI_LE_ENCRYPT_anchor">HCI_LE_ENCRYPT</a></h2><h3>Description</h3><p>The LE_Encrypt command is used to request the Controller to encrypt the
Plaintext_Data in the command using the Key given in the command and
@@ -1806,7 +1806,7 @@ fips197/fips-197.pdf).
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Encrypted_Data</p>
</td><td><p>16</p>
@@ -1820,7 +1820,7 @@ supported.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Random_Number</p>
</td><td><p>8</p>
@@ -1860,7 +1860,7 @@ This command shall only be used when the local device's role is Master.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#HCI_ENCRYPTION_CHANGE_EVENT_anchor">HCI_ENCRYPTION_CHANGE_EVENT</a></li><li><a href="#HCI_ENCRYPTION_KEY_REFRESH_COMPLETE_EVENT_anchor">HCI_ENCRYPTION_KEY_REFRESH_COMPLETE_EVENT</a></li><h2><a name="HCI_LE_LONG_TERM_KEY_REQUEST_REPLY_anchor">HCI_LE_LONG_TERM_KEY_REQUEST_REPLY</a></h2><h3>Description</h3><p>The LE_Long_Term_Key_Request_Reply command is used to reply to an LE
Long Term Key Request event from the Controller, and specifies the
@@ -1880,7 +1880,7 @@ Long_Term_Key is used as defined in [Vol 6] Part B, Section 5.1.3.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Connection_Handle</p>
</td><td><p>2</p>
@@ -1899,7 +1899,7 @@ provide a Long Term Key for this Connection_Handle.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Connection_Handle</p>
</td><td><p>2</p>
@@ -1918,7 +1918,7 @@ the corresponding Scanning types and Master Role combination are set.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>LE_States</p>
</td><td><p>8</p>
@@ -1949,7 +1949,7 @@ should use to transmit a single Link Layer packet on this connection.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Connection_Handle</p>
</td><td><p>2</p>
@@ -1963,7 +1963,7 @@ connections (see Bluetooth Specification v5.0 [Vol 6] Part B, Section 4.5.10). <
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>SuggestedMaxTxOctets</p>
</td><td><p>2</p>
@@ -1996,7 +1996,7 @@ transmission time to be used for new connections.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="HCI_LE_READ_LOCAL_P256_PUBLIC_KEY_anchor">HCI_LE_READ_LOCAL_P256_PUBLIC_KEY</a></h2><h3>Description</h3><p>The LE_Read_Local_P-256_Public_Key command is used to return the local
P-256 public key from the Controller. The Controller shall generate a new P-
@@ -2005,7 +2005,7 @@ P-256 public key from the Controller. The Controller shall generate a new P-
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#HCI_LE_READ_LOCAL_P256_PUBLIC_KEY_COMPLETE_EVENT_anchor">HCI_LE_READ_LOCAL_P256_PUBLIC_KEY_COMPLETE_EVENT</a></li><h2><a name="HCI_LE_GENERATE_DHKEY_anchor">HCI_LE_GENERATE_DHKEY</a></h2><h3>Description</h3><p>The LE_Generate_DHKey command is used to initiate generation of a Diffie-
Hellman key in the Controller for use over the LE transport. This command
@@ -2025,7 +2025,7 @@ Little Endian Format</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#HCI_LE_GENERATE_DHKEY_COMPLETE_EVENT_anchor">HCI_LE_GENERATE_DHKEY_COMPLETE_EVENT</a></li><h2><a name="HCI_LE_ADD_DEVICE_TO_RESOLVING_LIST_anchor">HCI_LE_ADD_DEVICE_TO_RESOLVING_LIST</a></h2><h3>Description</h3><p>The LE_Add_Device_To_Resolving_List command is used to add one device
to the list of address translations used to resolve Resolvable Private Addresses
@@ -2061,7 +2061,7 @@ full, it shall respond with error code 0x07 (Memory Capacity Exceeded).
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="HCI_LE_REMOVE_DEVICE_FROM_RESOLVING_LIST_anchor">HCI_LE_REMOVE_DEVICE_FROM_RESOLVING_LIST</a></h2><h3>Description</h3><p>The LE_Remove_Device_From_Resolving_List command is used to remove
one device from the list of address translations used to resolve Resolvable
@@ -2090,7 +2090,7 @@ Identifier).
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="HCI_LE_CLEAR_RESOLVING_LIST_anchor">HCI_LE_CLEAR_RESOLVING_LIST</a></h2><h3>Description</h3><p>The LE_Clear_Resolving_List command is used to remove all devices from the
list of address translations used to resolve Resolvable Private Addresses in the
@@ -2106,7 +2106,7 @@ the Controller.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="HCI_LE_READ_RESOLVING_LIST_SIZE_anchor">HCI_LE_READ_RESOLVING_LIST_SIZE</a></h2><h3>Description</h3><p>The LE_Read_Resolving_List_Size command is used to read the total number
of address translation entries in the resolving list that can be stored in the
@@ -2115,7 +2115,7 @@ Controller.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Resolving_List_Size</p>
</td><td><p>1</p>
@@ -2143,7 +2143,7 @@ Connection Identifier).
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Peer_Resolvable_Address</p>
</td><td><p>6</p>
@@ -2171,7 +2171,7 @@ Connection Identifier).
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Local_Resolvable_Address</p>
</td><td><p>6</p>
@@ -2197,7 +2197,7 @@ This command can be used at any time except when:
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="HCI_LE_SET_RESOLVABLE_PRIVATE_ADDRESS_TIMEOUT_anchor">HCI_LE_SET_RESOLVABLE_PRIVATE_ADDRESS_TIMEOUT</a></h2><h3>Description</h3><p>The LE_Set_Resolvable_Private_Address_Timeout command set the length of
time the controller uses a Resolvable Private Address before a new resolvable
@@ -2215,7 +2215,7 @@ Default: N= 0x0384 (900 secs or 15 minutes)</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="HCI_LE_READ_MAXIMUM_DATA_LENGTH_anchor">HCI_LE_READ_MAXIMUM_DATA_LENGTH</a></h2><h3>Description</h3><p>The LE_Read_Maximum_Data_Length command allows the Host to read the
Controller’s maximum supported payload octets and packet duration times for
@@ -2225,7 +2225,7 @@ see Bluetooth Specification v5.0 [Vol 6] Part B, Section 4.5.10). </p><h3>Input
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>supportedMaxTxOctets</p>
</td><td><p>2</p>
@@ -2258,7 +2258,7 @@ receiver PHY on the connection identified by the Connection_Handle. see Bluetoot
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Connection_Handle</p>
</td><td><p>2</p>
@@ -2304,7 +2304,7 @@ least one bit shall be set to 1. See Bluetooth Specification [Vol2] Part E Secti
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="HCI_LE_SET_PHY_anchor">HCI_LE_SET_PHY</a></h2><h3>Description</h3><p>The LE_Set_PHY command is used to set the PHY preferences for the
connection identified by the Connection_Handle. The Controller might not be
@@ -2361,7 +2361,7 @@ see Bluetooth Specification v5.0 [Vol 6] Part B, Section 7.8.49 </p><h3>Input pa
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#HCI_LE_PHY_UPDATE_COMPLETE_EVENT_anchor">HCI_LE_PHY_UPDATE_COMPLETE_EVENT</a></li><h2><a name="HCI TESTING commands_anchor">HCI TESTING commands</a></h2><h3>HCI TESTING commands</h3><table width="800" border="1" class="reference">
<tr><th>Command</th><th>OpCode</th></tr>
@@ -2388,7 +2388,7 @@ Frequency Range : 2402 MHz to 2480 MHz</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="HCI_LE_TRANSMITTER_TEST_anchor">HCI_LE_TRANSMITTER_TEST</a></h2><h3>Description</h3><p>This command is used to start a test where the DUT generates test reference
packets at a fixed interval. The Controller shall transmit at maximum power.
@@ -2414,7 +2414,7 @@ Frequency Range : 2402 MHz to 2480 MHz</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="HCI_LE_TEST_END_anchor">HCI_LE_TEST_END</a></h2><h3>Description</h3><p>This command is used to stop any test which is in progress. The Number_Of_Packets
for a transmitter test shall be reported as 0x0000. The Number_Of_Packets
@@ -2424,7 +2424,7 @@ packets.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Number_Of_Packets</p>
</td><td><p>2</p>
@@ -2451,7 +2451,7 @@ Frequency Range : 2402 MHz to 2480 MHz</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="HCI_LE_ENHANCED_TRANSMITTER_TEST_anchor">HCI_LE_ENHANCED_TRANSMITTER_TEST</a></h2><h3>Description</h3><p>This command is used to start a test where the DUT generates test reference
packets at a fixed interval. The Controller shall transmit at maximum power.
@@ -2481,7 +2481,7 @@ Frequency Range : 2402 MHz to 2480 MHz</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI HAL commands_anchor">ACI HAL commands</a></h2><h3>ACI HAL commands</h3><table width="800" border="1" class="reference">
<tr><th>Command</th><th>OpCode</th></tr>
@@ -2527,7 +2527,7 @@ Frequency Range : 2402 MHz to 2480 MHz</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Build_Number</p>
</td><td><p>2</p>
@@ -2562,7 +2562,7 @@ which has to be written. The valid offsets are:</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_HAL_READ_CONFIG_DATA_anchor">ACI_HAL_READ_CONFIG_DATA</a></h2><h3>Description</h3><p>This command requests the value in the low level configure data structure.
The number of read bytes changes for different Offset. </p><h3>Input parameters</h3><table width="800" border="1" class="reference">
@@ -2585,7 +2585,7 @@ which has to be read. The valid offsets are:</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Data_Length</p>
</td><td><p>1</p>
@@ -2619,7 +2619,7 @@ components.Here the values are given at the IC pin</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_HAL_LE_TX_TEST_PACKET_NUMBER_anchor">ACI_HAL_LE_TX_TEST_PACKET_NUMBER</a></h2><h3>Description</h3><p>This command returns the number of packets sent in Direct Test Mode.
When the Direct TX test is started, a 32-bit counter is used to count how many packets have been transmitted.
@@ -2629,7 +2629,7 @@ The counter is not cleared until the next Direct TX test starts. </p><h3>Input p
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Number_Of_Packets</p>
</td><td><p>4</p>
@@ -2657,19 +2657,19 @@ frequency deviation (250kHz).</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_HAL_TONE_STOP_anchor">ACI_HAL_TONE_STOP</a></h2><h3>Description</h3><p>This command is used to stop the previously started <a href="#ACI_HAL_TONE_START_anchor">ACI_HAL_TONE_START</a> command.</p><h3>Input parameters</h3><p>None</p><h3>Output parameters</h3><table width="800" border="1" class="reference">
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_HAL_GET_LINK_STATUS_anchor">ACI_HAL_GET_LINK_STATUS</a></h2><h3>Description</h3><p>This command returns the status of the 8 Bluetooth low energy links managed by the device</p><h3>Input parameters</h3><p>None</p><h3>Output parameters</h3><table width="800" border="1" class="reference">
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Link_Status</p>
</td><td><p>8</p>
@@ -2690,14 +2690,14 @@ Only the radio activities enabled in the mask will be reported to application by
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><li><a href="#ACI_HAL_END_OF_RADIO_ACTIVITY_EVENT_anchor">ACI_HAL_END_OF_RADIO_ACTIVITY_EVENT</a></li><h2><a name="ACI_HAL_GET_ANCHOR_PERIOD_anchor">ACI_HAL_GET_ANCHOR_PERIOD</a></h2><h3>Description</h3><p>This command returns information about the Anchor Period to help application in selecting
slot timings when operating in multi-link scenarios.</p><h3>Input parameters</h3><p>None</p><h3>Output parameters</h3><table width="800" border="1" class="reference">
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Anchor_Period</p>
</td><td><p>4</p>
@@ -2719,7 +2719,7 @@ T = N * 0.625 ms.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_HAL_SET_SMP_ENG_CONFIG_anchor">ACI_HAL_SET_SMP_ENG_CONFIG</a></h2><h3>Description</h3><p>This command is used to provide a specific engineering setup to the Security Manager Protocol Layer. It may be used during development/debug only!</p><h3>Input parameters</h3><table width="800" border="1" class="reference">
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
@@ -2731,13 +2731,13 @@ T = N * 0.625 ms.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_HAL_GET_PM_DEBUG_INFO_anchor">ACI_HAL_GET_PM_DEBUG_INFO</a></h2><h3>Description</h3><p>This command is used to retrieve TX, RX and total buffer count allocated for ACL packets.</p><h3>Input parameters</h3><p>None</p><h3>Output parameters</h3><table width="800" border="1" class="reference">
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Allocated_For_TX</p>
</td><td><p>1</p>
@@ -2761,7 +2761,7 @@ T = N * 0.625 ms.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>reg_val</p>
</td><td><p>1</p>
@@ -2781,13 +2781,13 @@ T = N * 0.625 ms.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_HAL_READ_RAW_RSSI_anchor">ACI_HAL_READ_RAW_RSSI</a></h2><h3>Description</h3><p>This command returns the raw value of the RSSI </p><h3>Input parameters</h3><p>None</p><h3>Output parameters</h3><table width="800" border="1" class="reference">
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Value</p>
</td><td><p>3</p>
@@ -2806,19 +2806,19 @@ frequency deviation (250kHz).</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_HAL_RX_STOP_anchor">ACI_HAL_RX_STOP</a></h2><h3>Description</h3><p>This command stop a previous ACI_HAL_RX_START command </p><h3>Input parameters</h3><p>None</p><h3>Output parameters</h3><table width="800" border="1" class="reference">
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_HAL_STACK_RESET_anchor">ACI_HAL_STACK_RESET</a></h2><h3>Description</h3><p>This command is equivalent to HCI_RESET but ensures the sleep mode is entered' immediately after its completion</p><h3>Input parameters</h3><p>None</p><h3>Output parameters</h3><table width="800" border="1" class="reference">
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI GAP commands_anchor">ACI GAP commands</a></h2><h3>ACI GAP commands</h3><table width="800" border="1" class="reference">
<tr><th>Command</th><th>OpCode</th></tr>
@@ -2910,7 +2910,7 @@ frequency deviation (250kHz).</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_SET_LIMITED_DISCOVERABLE_anchor">ACI_GAP_SET_LIMITED_DISCOVERABLE</a></h2><h3>Description</h3><p>Put the device in limited discoverable mode (as defined in Bluetooth Specification v.5.0,
Vol. 3, Part C, section 9.2.3). The device will be discoverable for maximum period of TGAP
@@ -3006,7 +3006,7 @@ connIntervalmax = Slave_Conn_Interval_Max x 1.25ms</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_GAP_LIMITED_DISCOVERABLE_EVENT_anchor">ACI_GAP_LIMITED_DISCOVERABLE_EVENT</a></li><h2><a name="ACI_GAP_SET_DISCOVERABLE_anchor">ACI_GAP_SET_DISCOVERABLE</a></h2><h3>Description</h3><p>Put the device in general discoverable mode (as defined in Bluetooth Specification v.5.0,
Vol. 3, Part C, section 9.2.4). The device will be discoverable until the host issues
@@ -3103,7 +3103,7 @@ connIntervalmax = Slave_Conn_Interval_Max x 1.25ms</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_SET_DIRECT_CONNECTABLE_anchor">ACI_GAP_SET_DIRECT_CONNECTABLE</a></h2><h3>Description</h3><p>Set the device in direct connectable mode (as defined in Bluetooth Specification v.5.0,
Vol. 3, Part C, section 9.3.3). Device uses direct connectable mode to advertise using High Duty
@@ -3156,7 +3156,7 @@ Time = N * 0.625 msec.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><li><a href="#HCI_LE_CONNECTION_COMPLETE_EVENT_anchor">HCI_LE_CONNECTION_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_SET_IO_CAPABILITY_anchor">ACI_GAP_SET_IO_CAPABILITY</a></h2><h3>Description</h3><p>Set the IO capabilities of the device. This command has to be given only when the device is
not in a connected state.</p><h3>Input parameters</h3><table width="800" border="1" class="reference">
@@ -3169,7 +3169,7 @@ not in a connected state.</p><h3>Input parameters</h3><table width="800" border=
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_SET_AUTHENTICATION_REQUIREMENT_anchor">ACI_GAP_SET_AUTHENTICATION_REQUIREMENT</a></h2><h3>Description</h3><p>Set the authentication requirements for the device. If the OOB_Enable is set to 0, the
following 16 octets of OOB_Data will be ignored on reception. This command has to be
@@ -3222,7 +3222,7 @@ Any random value between 0 to 999999</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_SET_AUTHORIZATION_REQUIREMENT_anchor">ACI_GAP_SET_AUTHORIZATION_REQUIREMENT</a></h2><h3>Description</h3><p>Set the authorization requirements of the device. This command has to be given when connected
to a device if authorization is required to access services which require authorization.</p><h3>Input parameters</h3><table width="800" border="1" class="reference">
@@ -3243,7 +3243,7 @@ ACI_GAP_AUTHORIZATION_REQ_EVENT will be sent to the Host.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_PASS_KEY_RESP_anchor">ACI_GAP_PASS_KEY_RESP</a></h2><h3>Description</h3><p>This command should be send by the host in response to <a href="#ACI_GAP_PASS_KEY_REQ_EVENT_anchor">ACI_GAP_PASS_KEY_REQ_EVENT</a>
event. The command parameter contains the pass key which will be used during the pairing process.</p><h3>Input parameters</h3><table width="800" border="1" class="reference">
@@ -3261,7 +3261,7 @@ Must be a six-digit decimal number.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><li><a href="#ACI_GAP_PAIRING_COMPLETE_EVENT_anchor">ACI_GAP_PAIRING_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_AUTHORIZATION_RESP_anchor">ACI_GAP_AUTHORIZATION_RESP</a></h2><h3>Description</h3><p>Authorize a device to access attributes. This command should be send by the host in
response to <a href="#ACI_GAP_AUTHORIZATION_REQ_EVENT_anchor">ACI_GAP_AUTHORIZATION_REQ_EVENT</a> event.</p><h3>Input parameters</h3><table width="800" border="1" class="reference">
@@ -3278,7 +3278,7 @@ response to <a href="#ACI_GAP_AUTHORIZATION_REQ_EVENT_anchor">ACI_GAP_AUTHORIZAT
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_INIT_anchor">ACI_GAP_INIT</a></h2><h3>Description</h3><p>Initialize the GAP layer. Register the GAP service with the GATT.
All the standard GAP characteristics will also be added:
@@ -3302,7 +3302,7 @@ All the standard GAP characteristics will also be added:
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Service_Handle</p>
</td><td><p>2</p>
@@ -3341,7 +3341,7 @@ parameters for this command.Advertiser filter policy is internally set to 0x00</
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_SET_UNDIRECTED_CONNECTABLE_anchor">ACI_GAP_SET_UNDIRECTED_CONNECTABLE</a></h2><h3>Description</h3><p>Put the device into undirected connectable mode.
If privacy is enabled in the device, a resolvable private address is generated and used as the
@@ -3379,7 +3379,7 @@ Time = N * 0.625 msec.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_SLAVE_SECURITY_REQ_anchor">ACI_GAP_SLAVE_SECURITY_REQ</a></h2><h3>Description</h3><p>Send a slave security request to the master.
This command has to be issued to notify the master of the security requirements of the slave.
@@ -3393,7 +3393,7 @@ The master may encrypt the link, initiate the pairing procedure, or reject the r
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_GAP_SLAVE_SECURITY_INITIATED_EVENT_anchor">ACI_GAP_SLAVE_SECURITY_INITIATED_EVENT</a></li><h2><a name="ACI_GAP_UPDATE_ADV_DATA_anchor">ACI_GAP_UPDATE_ADV_DATA</a></h2><h3>Description</h3><p>This command can be used to update the advertising data for a particular AD type. If the AD
type specified does not exist, then it is added to the advertising data. If the overall
@@ -3412,7 +3412,7 @@ rejected and the old data is retained.</p><h3>Input parameters</h3><table width=
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_DELETE_AD_TYPE_anchor">ACI_GAP_DELETE_AD_TYPE</a></h2><h3>Description</h3><p>This command can be used to delete the specified AD type from the advertisement data if
present.</p><h3>Input parameters</h3><table width="800" border="1" class="reference">
@@ -3425,7 +3425,7 @@ present.</p><h3>Input parameters</h3><table width="800" border="1" class="refere
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_GET_SECURITY_LEVEL_anchor">ACI_GAP_GET_SECURITY_LEVEL</a></h2><h3>Description</h3><p>This command can be used to get the current security settings of the device.</p><h3>Input parameters</h3><table width="800" border="1" class="reference">
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
@@ -3437,7 +3437,7 @@ present.</p><h3>Input parameters</h3><table width="800" border="1" class="refere
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Security_Mode</p>
</td><td><p>1</p>
@@ -3457,7 +3457,7 @@ present.</p><h3>Input parameters</h3><table width="800" border="1" class="refere
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_CONFIGURE_WHITELIST_anchor">ACI_GAP_CONFIGURE_WHITELIST</a></h2><h3>Description</h3><p>Add addresses of bonded devices into the controller's whitelist.
The command will return an error if there are no devices in the database or if it was
@@ -3465,7 +3465,7 @@ unable to add the device into the whitelist.</p><h3>Input parameters</h3><p>None
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_TERMINATE_anchor">ACI_GAP_TERMINATE</a></h2><h3>Description</h3><p>Command the controller to terminate the connection.
A <a href="#HCI_DISCONNECTION_COMPLETE_EVENT_anchor">HCI_DISCONNECTION_COMPLETE_EVENT</a> event will be generated when the link is disconnected. It is important to leave an 100 ms blank window
@@ -3484,13 +3484,13 @@ system could save important information in non volatile memory.</p><h3>Input par
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#HCI_DISCONNECTION_COMPLETE_EVENT_anchor">HCI_DISCONNECTION_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_CLEAR_SECURITY_DB_anchor">ACI_GAP_CLEAR_SECURITY_DB</a></h2><h3>Description</h3><p>Clear the security database. All the devices in the security database will be removed.</p><h3>Input parameters</h3><p>None</p><h3>Output parameters</h3><table width="800" border="1" class="reference">
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_ALLOW_REBOND_anchor">ACI_GAP_ALLOW_REBOND</a></h2><h3>Description</h3><p>Allows the security manager to complete the pairing procedure and re-bond with the master.
This command should be given by the application when it receives the
@@ -3505,7 +3505,7 @@ command is not given on receiving the event, the bonding procedure will timeout.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_START_LIMITED_DISCOVERY_PROC_anchor">ACI_GAP_START_LIMITED_DISCOVERY_PROC</a></h2><h3>Description</h3><p>Start the limited discovery procedure. The controller is commanded to start active scanning.
When this procedure is started, only the devices in limited discoverable mode are returned
@@ -3551,7 +3551,7 @@ Time = N * 0.625 msec.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#HCI_LE_ADVERTISING_REPORT_EVENT_anchor">HCI_LE_ADVERTISING_REPORT_EVENT</a></li><li><a href="#ACI_GAP_PROC_COMPLETE_EVENT_anchor">ACI_GAP_PROC_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_START_GENERAL_DISCOVERY_PROC_anchor">ACI_GAP_START_GENERAL_DISCOVERY_PROC</a></h2><h3>Description</h3><p>Start the general discovery procedure. The controller is commanded to start active
scanning. The procedure is terminated when either the upper layers issue a command
@@ -3594,7 +3594,7 @@ Time = N * 0.625 msec.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#HCI_LE_ADVERTISING_REPORT_EVENT_anchor">HCI_LE_ADVERTISING_REPORT_EVENT</a></li><li><a href="#ACI_GAP_PROC_COMPLETE_EVENT_anchor">ACI_GAP_PROC_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_START_NAME_DISCOVERY_PROC_anchor">ACI_GAP_START_NAME_DISCOVERY_PROC</a></h2><h3>Description</h3><p>Start the name discovery procedure. A LE_Create_Connection call will be made to the
controller by GAP with the initiator filter policy set to "ignore whitelist and process
@@ -3676,7 +3676,7 @@ Time = N * 0.625 msec.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_GAP_PROC_COMPLETE_EVENT_anchor">ACI_GAP_PROC_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_START_AUTO_CONNECTION_ESTABLISH_PROC_anchor">ACI_GAP_START_AUTO_CONNECTION_ESTABLISH_PROC</a></h2><h3>Description</h3><p>Start the auto connection establishment procedure. The devices specified are added to the
white list of the controller and a LE_Create_Connection call will be made to the controller by
@@ -3764,7 +3764,7 @@ to be added to the white list.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_GAP_PROC_COMPLETE_EVENT_anchor">ACI_GAP_PROC_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_START_GENERAL_CONNECTION_ESTABLISH_PROC_anchor">ACI_GAP_START_GENERAL_CONNECTION_ESTABLISH_PROC</a></h2><h3>Description</h3><p>Start a general connection establishment procedure. The host enables scanning in the
controller with the scanner filter policy set to "accept all advertising packets" and from the
@@ -3831,7 +3831,7 @@ Time = N * 0.625 msec.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_GAP_PROC_COMPLETE_EVENT_anchor">ACI_GAP_PROC_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_START_SELECTIVE_CONNECTION_ESTABLISH_PROC_anchor">ACI_GAP_START_SELECTIVE_CONNECTION_ESTABLISH_PROC</a></h2><h3>Description</h3><p>Start a selective connection establishment procedure. The GAP adds the specified device
addresses into white list and enables scanning in the controller with the scanner filter policy
@@ -3907,7 +3907,7 @@ to be added to the white list.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_GAP_PROC_COMPLETE_EVENT_anchor">ACI_GAP_PROC_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_CREATE_CONNECTION_anchor">ACI_GAP_CREATE_CONNECTION</a></h2><h3>Description</h3><p>Start the direct connection establishment procedure. A LE_Create_Connection call will be
made to the controller by GAP with the initiator filter policy set to "ignore whitelist and
@@ -3992,7 +3992,7 @@ Time = N * 0.625 msec.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#HCI_LE_CONNECTION_COMPLETE_EVENT_anchor">HCI_LE_CONNECTION_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_TERMINATE_GAP_PROC_anchor">ACI_GAP_TERMINATE_GAP_PROC</a></h2><h3>Description</h3><p>Terminate the specified GATT procedure. An <a href="#ACI_GAP_PROC_COMPLETE_EVENT_anchor">ACI_GAP_PROC_COMPLETE_EVENT</a> event is
returned with the procedure code set to the corresponding procedure.</p><h3>Input parameters</h3><table width="800" border="1" class="reference">
@@ -4000,12 +4000,12 @@ returned with the procedure code set to the corresponding procedure.</p><h3>Inpu
<tr><td><p>Procedure_Code</p>
</td><td><p>1</p>
</td><td><p>GAP procedure bitmap.</p>
-</td><td><li>0x00: No events</li><li>0x01: LIMITED_DISCOVERY_PROC</li><li>0x02: GENERAL_DISCOVERY_PROC</li><li>0x04: NAME_DISCOVERY_PROC</li><li>0x08: AUTO_CONNECTION_ESTABLISHMENT_PROC</li><li>0x10: GENERAL_CONNECTION_ESTABLISHMENT_PROC</li><li>0x20: SELECTIVE_CONNECTION_ESTABLISHMENT_PROC</li><li>0x40: DIRECT_CONNECTION_ESTABLISHMENT_PROC</li><li>0x80: OBSERVATION_PROC</li></td></tr>
+</td><td><li>0x00: No events</li><li>0x01: GAP_LIMITED_DISCOVERY_PROC</li><li>0x02: GAP_GENERAL_DISCOVERY_PROC</li><li>0x04: GAP_NAME_DISCOVERY_PROC</li><li>0x08: GAP_AUTO_CONNECTION_ESTABLISHMENT_PROC</li><li>0x10: GAP_GENERAL_CONNECTION_ESTABLISHMENT_PROC</li><li>0x20: GAP_SELECTIVE_CONNECTION_ESTABLISHMENT_PROC</li><li>0x40: GAP_DIRECT_CONNECTION_ESTABLISHMENT_PROC</li><li>0x80: GAP_OBSERVATION_PROC</li></td></tr>
</table><h3>Output parameters</h3><table width="800" border="1" class="reference">
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><li><a href="#ACI_GAP_PROC_COMPLETE_EVENT_anchor">ACI_GAP_PROC_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_START_CONNECTION_UPDATE_anchor">ACI_GAP_START_CONNECTION_UPDATE</a></h2><h3>Description</h3><p>Start the connection update procedure (only when role is Master). A <a href="#HCI_LE_CONNECTION_UPDATE_anchor">HCI_LE_CONNECTION_UPDATE</a> is called.
On completion of the procedure, an <a href="#HCI_LE_CONNECTION_UPDATE_COMPLETE_EVENT_anchor">HCI_LE_CONNECTION_UPDATE_COMPLETE_EVENT</a> event is returned to
@@ -4053,7 +4053,7 @@ Time = N * 0.625 msec.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#HCI_LE_CONNECTION_UPDATE_COMPLETE_EVENT_anchor">HCI_LE_CONNECTION_UPDATE_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_SEND_PAIRING_REQ_anchor">ACI_GAP_SEND_PAIRING_REQ</a></h2><h3>Description</h3><p>Send the SM pairing request to start a pairing process. The authentication requirements and
IO capabilities should be set before issuing this command using the
@@ -4075,7 +4075,7 @@ A <a href="#ACI_GAP_PAIRING_COMPLETE_EVENT_anchor">ACI_GAP_PAIRING_COMPLETE_EVEN
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_GAP_PAIRING_COMPLETE_EVENT_anchor">ACI_GAP_PAIRING_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_RESOLVE_PRIVATE_ADDR_anchor">ACI_GAP_RESOLVE_PRIVATE_ADDR</a></h2><h3>Description</h3><p>This command tries to resolve the address provided with the IRKs present in its database. If
the address is resolved successfully with any one of the IRKs present in the database, it
@@ -4090,7 +4090,7 @@ IRK in the database.</p><h3>Input parameters</h3><table width="800" border="1" c
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Actual_Address</p>
</td><td><p>6</p>
@@ -4144,7 +4144,7 @@ to be added to the white list.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_START_OBSERVATION_PROC_anchor">ACI_GAP_START_OBSERVATION_PROC</a></h2><h3>Description</h3><p>Starts an Observation procedure, when the device is in Observer Role. The host enables
scanning in the controller. The advertising reports are sent to the upper layer using standard
@@ -4202,14 +4202,14 @@ Time = N * 0.625 msec.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#HCI_LE_ADVERTISING_REPORT_EVENT_anchor">HCI_LE_ADVERTISING_REPORT_EVENT</a></li><h2><a name="ACI_GAP_GET_BONDED_DEVICES_anchor">ACI_GAP_GET_BONDED_DEVICES</a></h2><h3>Description</h3><p>This command gets the list of the devices which are bonded. It returns the
number of addresses and the corresponding address types and values.</p><h3>Input parameters</h3><p>None</p><h3>Output parameters</h3><table width="800" border="1" class="reference">
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Num_of_Addresses</p>
</td><td><p>1</p>
@@ -4240,7 +4240,7 @@ command will return BLE_STATUS_SUCCESS.</p><h3>Input parameters</h3><table width
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_NUMERIC_COMPARISON_VALUE_CONFIRM_YESNO_anchor">ACI_GAP_NUMERIC_COMPARISON_VALUE_CONFIRM_YESNO</a></h2><h3>Description</h3><p>This command allows the User to validate/confirm or not the Numeric Comparison value showed through the ACI_GAP_Numeric_Comparison_Value_Event.</p><h3>Input parameters</h3><table width="800" border="1" class="reference">
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
@@ -4257,7 +4257,7 @@ command will return BLE_STATUS_SUCCESS.</p><h3>Input parameters</h3><table width
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_PASSKEY_INPUT_anchor">ACI_GAP_PASSKEY_INPUT</a></h2><h3>Description</h3><p>This command permits to signal to the Stack the input type detected during Passkey input.</p><h3>Input parameters</h3><table width="800" border="1" class="reference">
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
@@ -4273,7 +4273,7 @@ command will return BLE_STATUS_SUCCESS.</p><h3>Input parameters</h3><table width
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_GET_OOB_DATA_anchor">ACI_GAP_GET_OOB_DATA</a></h2><h3>Description</h3><p>This command is sent by the User to get (i.e. to extract from the Stack) the OOB data generated by the Stack itself.</p><h3>Input parameters</h3><table width="800" border="1" class="reference">
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
@@ -4285,7 +4285,7 @@ command will return BLE_STATUS_SUCCESS.</p><h3>Input parameters</h3><table width
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Address_Type</p>
</td><td><p>1</p>
@@ -4337,7 +4337,7 @@ command will return BLE_STATUS_SUCCESS.</p><h3>Input parameters</h3><table width
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_ADD_DEVICES_TO_RESOLVING_LIST_anchor">ACI_GAP_ADD_DEVICES_TO_RESOLVING_LIST</a></h2><h3>Description</h3><p>This command is used to add one device to the list of address translations used to resolve Resolvable Private Addresses in the Controller.</p><h3>Input parameters</h3><table width="800" border="1" class="reference">
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
@@ -4361,7 +4361,7 @@ command will return BLE_STATUS_SUCCESS.</p><h3>Input parameters</h3><table width
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GAP_REMOVE_BONDED_DEVICE_anchor">ACI_GAP_REMOVE_BONDED_DEVICE</a></h2><h3>Description</h3><p>This command is used to remove a specified device from bonding table</p><h3>Input parameters</h3><table width="800" border="1" class="reference">
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
@@ -4377,7 +4377,7 @@ command will return BLE_STATUS_SUCCESS.</p><h3>Input parameters</h3><table width
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI GATT/ATT commands_anchor">ACI GATT/ATT commands</a></h2><h3>ACI GATT/ATT commands</h3><table width="800" border="1" class="reference">
<tr><th>Command</th><th>OpCode</th></tr>
@@ -4478,7 +4478,7 @@ connection is opened. This command has to be given before using any of the GAP f
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GATT_ADD_SERVICE_anchor">ACI_GATT_ADD_SERVICE</a></h2><h3>Description</h3><p>Add a service to GATT Server. When a service is created in the server, the host needs to
reserve the handle ranges for this service using Max_Attribute_Records parameter. This
@@ -4508,7 +4508,7 @@ The attributes for characteristics and descriptors are allocated from the attrib
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Service_Handle</p>
</td><td><p>2</p>
@@ -4544,7 +4544,7 @@ attribute and return the handle of this attribute in Included_handle.</p><h3>Inp
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Include_Handle</p>
</td><td><p>2</p>
@@ -4593,7 +4593,7 @@ a variable length.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Char_Handle</p>
</td><td><p>2</p>
@@ -4658,7 +4658,7 @@ a variable length.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Char_Desc_Handle</p>
</td><td><p>2</p>
@@ -4705,7 +4705,7 @@ specified for the attribute while adding the characteristic.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GATT_DEL_CHAR_anchor">ACI_GATT_DEL_CHAR</a></h2><h3>Description</h3><p>Delete the specified characteristic from the service.</p><h3>Input parameters</h3><table width="800" border="1" class="reference">
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
@@ -4721,7 +4721,7 @@ specified for the attribute while adding the characteristic.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GATT_DEL_SERVICE_anchor">ACI_GATT_DEL_SERVICE</a></h2><h3>Description</h3><p>Delete the specified service from the GATT server database.</p><h3>Input parameters</h3><table width="800" border="1" class="reference">
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
@@ -4733,7 +4733,7 @@ specified for the attribute while adding the characteristic.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GATT_DEL_INCLUDE_SERVICE_anchor">ACI_GATT_DEL_INCLUDE_SERVICE</a></h2><h3>Description</h3><p>Delete the Include definition from the service.</p><h3>Input parameters</h3><table width="800" border="1" class="reference">
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
@@ -4749,7 +4749,7 @@ specified for the attribute while adding the characteristic.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GATT_SET_EVENT_MASK_anchor">ACI_GATT_SET_EVENT_MASK</a></h2><h3>Description</h3><p>Mask events from the GATT. The default configuration is all the events masked.</p><h3>Input parameters</h3><table width="800" border="1" class="reference">
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
@@ -4761,7 +4761,7 @@ specified for the attribute while adding the characteristic.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GATT_EXCHANGE_CONFIG_anchor">ACI_GATT_EXCHANGE_CONFIG</a></h2><h3>Description</h3><p>Perform an ATT MTU exchange procedure.
When the ATT MTU exchange procedure is completed, a <a href="#ACI_ATT_EXCHANGE_MTU_RESP_EVENT_anchor">ACI_ATT_EXCHANGE_MTU_RESP_EVENT</a>
@@ -4776,7 +4776,7 @@ to indicate the end of the procedure.</p><h3>Input parameters</h3><table width="
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_ATT_EXCHANGE_MTU_RESP_EVENT_anchor">ACI_ATT_EXCHANGE_MTU_RESP_EVENT</a></li><h2><a name="ACI_ATT_FIND_INFO_REQ_anchor">ACI_ATT_FIND_INFO_REQ</a></h2><h3>Description</h3><p>Send a Find Information Request.
This command is used to obtain the mapping of attribute handles with their associated
@@ -4800,7 +4800,7 @@ a <a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_ATT_FIND_INFO_RESP_EVENT_anchor">ACI_ATT_FIND_INFO_RESP_EVENT</a></li><li><a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a></li><h2><a name="ACI_ATT_FIND_BY_TYPE_VALUE_REQ_anchor">ACI_ATT_FIND_BY_TYPE_VALUE_REQ</a></h2><h3>Description</h3><p>Send a Find By Type Value Request
The Find By Type Value Request is used to obtain the handles of attributes that
@@ -4836,7 +4836,7 @@ The end of the procedure is indicated by a <a href="#ACI_GATT_PROC_COMPLETE_EVEN
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_ATT_FIND_BY_TYPE_VALUE_RESP_EVENT_anchor">ACI_ATT_FIND_BY_TYPE_VALUE_RESP_EVENT</a></li><li><a href="#ACI_GATT_ERROR_RESP_EVENT_anchor">ACI_GATT_ERROR_RESP_EVENT</a></li><li><a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a></li><h2><a name="ACI_ATT_READ_BY_TYPE_REQ_anchor">ACI_ATT_READ_BY_TYPE_REQ</a></h2><h3>Description</h3><p>Send a Read By Type Request.
The Read By Type Request is used to obtain the values of attributes where the attribute
@@ -4867,7 +4867,7 @@ The responses are given through the <a href="#ACI_ATT_READ_BY_TYPE_RESP_EVENT_an
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_ATT_READ_BY_TYPE_RESP_EVENT_anchor">ACI_ATT_READ_BY_TYPE_RESP_EVENT</a></li><li><a href="#ACI_GATT_ERROR_RESP_EVENT_anchor">ACI_GATT_ERROR_RESP_EVENT</a></li><li><a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a></li><h2><a name="ACI_ATT_READ_BY_GROUP_TYPE_REQ_anchor">ACI_ATT_READ_BY_GROUP_TYPE_REQ</a></h2><h3>Description</h3><p>Send a Read By Group Type Request.
The Read By Group Type Request is used to obtain the values of grouping attributes where
@@ -4901,7 +4901,7 @@ The end of the procedure is indicated by a <a href="#ACI_GATT_PROC_COMPLETE_EVEN
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_ATT_READ_BY_GROUP_TYPE_RESP_EVENT_anchor">ACI_ATT_READ_BY_GROUP_TYPE_RESP_EVENT</a></li><li><a href="#ACI_GATT_ERROR_RESP_EVENT_anchor">ACI_GATT_ERROR_RESP_EVENT</a></li><li><a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a></li><h2><a name="ACI_ATT_PREPARE_WRITE_REQ_anchor">ACI_ATT_PREPARE_WRITE_REQ</a></h2><h3>Description</h3><p>Send a Prepare Write Request.
The Prepare Write Request is used to request the server to prepare to write the value of an attribute.
@@ -4932,7 +4932,7 @@ The end of the procedure is indicated by a <a href="#ACI_GATT_PROC_COMPLETE_EVEN
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_ATT_PREPARE_WRITE_RESP_EVENT_anchor">ACI_ATT_PREPARE_WRITE_RESP_EVENT</a></li><li><a href="#ACI_GATT_ERROR_RESP_EVENT_anchor">ACI_GATT_ERROR_RESP_EVENT</a></li><li><a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a></li><h2><a name="ACI_ATT_EXECUTE_WRITE_REQ_anchor">ACI_ATT_EXECUTE_WRITE_REQ</a></h2><h3>Description</h3><p>Send an Execute Write Request.
The Execute Write Request is used to request the server to write or cancel the write
@@ -4952,7 +4952,7 @@ The end of the procedure is indicated by a <a href="#ACI_GATT_PROC_COMPLETE_EVEN
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_ATT_EXEC_WRITE_RESP_EVENT_anchor">ACI_ATT_EXEC_WRITE_RESP_EVENT</a></li><li><a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a></li><h2><a name="ACI_GATT_DISC_ALL_PRIMARY_SERVICES_anchor">ACI_GATT_DISC_ALL_PRIMARY_SERVICES</a></h2><h3>Description</h3><p>Start the GATT client procedure to discover all primary services on the server.
The responses of the procedure are given through the <a href="#ACI_ATT_READ_BY_GROUP_TYPE_RESP_EVENT_anchor">ACI_ATT_READ_BY_GROUP_TYPE_RESP_EVENT</a> event.</p><h3>Input parameters</h3><table width="800" border="1" class="reference">
@@ -4965,7 +4965,7 @@ The responses of the procedure are given through the <a href="#ACI_ATT_READ_BY_G
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_ATT_READ_BY_GROUP_TYPE_RESP_EVENT_anchor">ACI_ATT_READ_BY_GROUP_TYPE_RESP_EVENT</a></li><li><a href="#ACI_GATT_ERROR_RESP_EVENT_anchor">ACI_GATT_ERROR_RESP_EVENT</a></li><li><a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a></li><h2><a name="ACI_GATT_DISC_PRIMARY_SERVICE_BY_UUID_anchor">ACI_GATT_DISC_PRIMARY_SERVICE_BY_UUID</a></h2><h3>Description</h3><p>Start the procedure to discover the primary services of the specified UUID on the server.
The responses of the procedure are given through the <a href="#ACI_ATT_FIND_BY_TYPE_VALUE_RESP_EVENT_anchor">ACI_ATT_FIND_BY_TYPE_VALUE_RESP_EVENT</a> event.
@@ -4987,7 +4987,7 @@ The end of the procedure is indicated by a <a href="#ACI_GATT_PROC_COMPLETE_EVEN
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_ATT_FIND_BY_TYPE_VALUE_RESP_EVENT_anchor">ACI_ATT_FIND_BY_TYPE_VALUE_RESP_EVENT</a></li><li><a href="#ACI_GATT_ERROR_RESP_EVENT_anchor">ACI_GATT_ERROR_RESP_EVENT</a></li><li><a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a></li><h2><a name="ACI_GATT_FIND_INCLUDED_SERVICES_anchor">ACI_GATT_FIND_INCLUDED_SERVICES</a></h2><h3>Description</h3><p>Start the procedure to find all included services.
The responses of the procedure are given through the <a href="#ACI_ATT_READ_BY_TYPE_RESP_EVENT_anchor">ACI_ATT_READ_BY_TYPE_RESP_EVENT</a> event.
@@ -5009,7 +5009,7 @@ The end of the procedure is indicated by a <a href="#ACI_GATT_PROC_COMPLETE_EVEN
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_ATT_READ_BY_TYPE_RESP_EVENT_anchor">ACI_ATT_READ_BY_TYPE_RESP_EVENT</a></li><li><a href="#ACI_GATT_ERROR_RESP_EVENT_anchor">ACI_GATT_ERROR_RESP_EVENT</a></li><li><a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a></li><h2><a name="ACI_GATT_DISC_ALL_CHAR_OF_SERVICE_anchor">ACI_GATT_DISC_ALL_CHAR_OF_SERVICE</a></h2><h3>Description</h3><p>Start the procedure to discover all the characteristics of a given service.
When the procedure is completed, a <a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a> event is generated.
@@ -5032,7 +5032,7 @@ Before procedure completion the response packets are given through
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_ATT_READ_BY_TYPE_RESP_EVENT_anchor">ACI_ATT_READ_BY_TYPE_RESP_EVENT</a></li><li><a href="#ACI_GATT_ERROR_RESP_EVENT_anchor">ACI_GATT_ERROR_RESP_EVENT</a></li><li><a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a></li><h2><a name="ACI_GATT_DISC_CHAR_BY_UUID_anchor">ACI_GATT_DISC_CHAR_BY_UUID</a></h2><h3>Description</h3><p>Start the procedure to discover all the characteristics specified by a UUID.
When the procedure is completed, a <a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a> event is generated.
@@ -5063,7 +5063,7 @@ Before procedure completion the response packets are given through
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_GATT_DISC_READ_CHAR_BY_UUID_RESP_EVENT_anchor">ACI_GATT_DISC_READ_CHAR_BY_UUID_RESP_EVENT</a></li><li><a href="#ACI_GATT_ERROR_RESP_EVENT_anchor">ACI_GATT_ERROR_RESP_EVENT</a></li><li><a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a></li><h2><a name="ACI_GATT_DISC_ALL_CHAR_DESC_anchor">ACI_GATT_DISC_ALL_CHAR_DESC</a></h2><h3>Description</h3><p>Start the procedure to discover all characteristic descriptors on the server.
When the procedure is completed, a <a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a> event is generated.
@@ -5086,7 +5086,7 @@ Before procedure completion the response packets are given through
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_ATT_FIND_INFO_RESP_EVENT_anchor">ACI_ATT_FIND_INFO_RESP_EVENT</a></li><li><a href="#ACI_GATT_ERROR_RESP_EVENT_anchor">ACI_GATT_ERROR_RESP_EVENT</a></li><li><a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a></li><h2><a name="ACI_GATT_READ_CHAR_VALUE_anchor">ACI_GATT_READ_CHAR_VALUE</a></h2><h3>Description</h3><p>Start the procedure to read the attribute value.
When the procedure is completed, a <a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a> event is generated.
@@ -5104,7 +5104,7 @@ Before procedure completion the response packet is given through <a href="#ACI_A
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_ATT_READ_RESP_EVENT_anchor">ACI_ATT_READ_RESP_EVENT</a></li><li><a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a></li><h2><a name="ACI_GATT_READ_USING_CHAR_UUID_anchor">ACI_GATT_READ_USING_CHAR_UUID</a></h2><h3>Description</h3><p>This command sends a Read By Type Request packet to the server in order to read the value attribute of the characteristics specified by the UUID.
When the procedure is completed, an <a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a> event is generated.
@@ -5135,7 +5135,7 @@ Note: the number of bytes of a value reported by <a href="#ACI_GATT_DISC_READ_CH
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_GATT_DISC_READ_CHAR_BY_UUID_RESP_EVENT_anchor">ACI_GATT_DISC_READ_CHAR_BY_UUID_RESP_EVENT</a></li><li><a href="#ACI_GATT_ERROR_RESP_EVENT_anchor">ACI_GATT_ERROR_RESP_EVENT</a></li><li><a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a></li><h2><a name="ACI_GATT_READ_LONG_CHAR_VALUE_anchor">ACI_GATT_READ_LONG_CHAR_VALUE</a></h2><h3>Description</h3><p>Start the procedure to read a long characteristic value.
When the procedure is completed, a <a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a> event is generated.
@@ -5157,7 +5157,7 @@ Before procedure completion the response packets are given through <a href="#ACI
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_ATT_READ_BLOB_RESP_EVENT_anchor">ACI_ATT_READ_BLOB_RESP_EVENT</a></li><li><a href="#ACI_GATT_ERROR_RESP_EVENT_anchor">ACI_GATT_ERROR_RESP_EVENT</a></li><li><a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a></li><h2><a name="ACI_GATT_READ_MULTIPLE_CHAR_VALUE_anchor">ACI_GATT_READ_MULTIPLE_CHAR_VALUE</a></h2><h3>Description</h3><p>Start a procedure to read multiple characteristic values from a server.
This sub-procedure is used to read multiple Characteristic Values from a server when the
@@ -5182,7 +5182,7 @@ Before procedure completion the response packets are given through
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_ATT_READ_MULTIPLE_RESP_EVENT_anchor">ACI_ATT_READ_MULTIPLE_RESP_EVENT</a></li><li><a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a></li><h2><a name="ACI_GATT_WRITE_CHAR_VALUE_anchor">ACI_GATT_WRITE_CHAR_VALUE</a></h2><h3>Description</h3><p>Start the procedure to write a characteristic value.
When the procedure is completed, a <a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a> event is generated.</p><h3>Input parameters</h3><table width="800" border="1" class="reference">
@@ -5207,7 +5207,7 @@ When the procedure is completed, a <a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_GATT_ERROR_RESP_EVENT_anchor">ACI_GATT_ERROR_RESP_EVENT</a></li><li><a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a></li><h2><a name="ACI_GATT_WRITE_LONG_CHAR_VALUE_anchor">ACI_GATT_WRITE_LONG_CHAR_VALUE</a></h2><h3>Description</h3><p>Start the procedure to write a long characteristic value.
When the procedure is completed, a <a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a> event is generated.
@@ -5238,7 +5238,7 @@ events are raised.</p><h3>Input parameters</h3><table width="800" border="1" cla
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a></li><li><a href="#ACI_ATT_PREPARE_WRITE_RESP_EVENT_anchor">ACI_ATT_PREPARE_WRITE_RESP_EVENT</a></li><li><a href="#ACI_ATT_EXEC_WRITE_RESP_EVENT_anchor">ACI_ATT_EXEC_WRITE_RESP_EVENT</a></li><h2><a name="ACI_GATT_WRITE_CHAR_RELIABLE_anchor">ACI_GATT_WRITE_CHAR_RELIABLE</a></h2><h3>Description</h3><p>Start the procedure to write a characteristic reliably.
When the procedure is completed, a <a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a> event is generated.
@@ -5269,7 +5269,7 @@ events are raised.</p><h3>Input parameters</h3><table width="800" border="1" cla
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a></li><li><a href="#ACI_ATT_PREPARE_WRITE_RESP_EVENT_anchor">ACI_ATT_PREPARE_WRITE_RESP_EVENT</a></li><li><a href="#ACI_ATT_EXEC_WRITE_RESP_EVENT_anchor">ACI_ATT_EXEC_WRITE_RESP_EVENT</a></li><h2><a name="ACI_GATT_WRITE_LONG_CHAR_DESC_anchor">ACI_GATT_WRITE_LONG_CHAR_DESC</a></h2><h3>Description</h3><p>Start the procedure to write a long characteristic descriptor.
When the procedure is completed, a <a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a> event is generated.
@@ -5300,7 +5300,7 @@ events are raised.</p><h3>Input parameters</h3><table width="800" border="1" cla
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a></li><li><a href="#ACI_ATT_PREPARE_WRITE_RESP_EVENT_anchor">ACI_ATT_PREPARE_WRITE_RESP_EVENT</a></li><li><a href="#ACI_ATT_EXEC_WRITE_RESP_EVENT_anchor">ACI_ATT_EXEC_WRITE_RESP_EVENT</a></li><h2><a name="ACI_GATT_READ_LONG_CHAR_DESC_anchor">ACI_GATT_READ_LONG_CHAR_DESC</a></h2><h3>Description</h3><p>Start the procedure to read a long characteristic value.
When the procedure is completed, a <a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a> event is
@@ -5323,7 +5323,7 @@ generated. Before procedure completion the response packets are given through
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_ATT_READ_BLOB_RESP_EVENT_anchor">ACI_ATT_READ_BLOB_RESP_EVENT</a></li><li><a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a></li><h2><a name="ACI_GATT_WRITE_CHAR_DESC_anchor">ACI_GATT_WRITE_CHAR_DESC</a></h2><h3>Description</h3><p>Start the procedure to write a characteristic descriptor.
When the procedure is completed, a <a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a> event is generated.</p><h3>Input parameters</h3><table width="800" border="1" class="reference">
@@ -5348,7 +5348,7 @@ When the procedure is completed, a <a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a></li><h2><a name="ACI_GATT_READ_CHAR_DESC_anchor">ACI_GATT_READ_CHAR_DESC</a></h2><h3>Description</h3><p>Start the procedure to read the descriptor specified.
When the procedure is completed, a <a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a> event is generated.
@@ -5366,7 +5366,7 @@ Before procedure completion the response packet is given through <a href="#ACI_A
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_ATT_READ_RESP_EVENT_anchor">ACI_ATT_READ_RESP_EVENT</a></li><li><a href="#ACI_GATT_PROC_COMPLETE_EVENT_anchor">ACI_GATT_PROC_COMPLETE_EVENT</a></li><h2><a name="ACI_GATT_WRITE_WITHOUT_RESP_anchor">ACI_GATT_WRITE_WITHOUT_RESP</a></h2><h3>Description</h3><p>Start the procedure to write a characteristic value without waiting for any response from the
server. No events are generated after this command is executed.</p><h3>Input parameters</h3><table width="800" border="1" class="reference">
@@ -5391,7 +5391,7 @@ server. No events are generated after this command is executed.</p><h3>Input par
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GATT_SIGNED_WRITE_WITHOUT_RESP_anchor">ACI_GATT_SIGNED_WRITE_WITHOUT_RESP</a></h2><h3>Description</h3><p>Start a signed write without response from the server.
The procedure is used to write a characteristic value with an authentication signature without waiting
@@ -5417,7 +5417,7 @@ for any response from the server. It cannot be used when the link is encrypted.<
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GATT_CONFIRM_INDICATION_anchor">ACI_GATT_CONFIRM_INDICATION</a></h2><h3>Description</h3><p>Allow application to confirm indication. This command has to be sent when the application
receives the event <a href="#ACI_GATT_INDICATION_EVENT_anchor">ACI_GATT_INDICATION_EVENT</a>.</p><h3>Input parameters</h3><table width="800" border="1" class="reference">
@@ -5430,7 +5430,7 @@ receives the event <a href="#ACI_GATT_INDICATION_EVENT_anchor">ACI_GATT_INDICATI
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GATT_WRITE_RESP_anchor">ACI_GATT_WRITE_RESP</a></h2><h3>Description</h3><p>Allow or reject a write request from a client.
This command has to be sent by the application when it receives the
@@ -5466,7 +5466,7 @@ the error code has to be set to the error code that has to be passed to the clie
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GATT_ALLOW_READ_anchor">ACI_GATT_ALLOW_READ</a></h2><h3>Description</h3><p>Allow the GATT server to send a response to a read request from a client.
The application has to send this command when it receives the
@@ -5485,7 +5485,7 @@ Otherwise the GATT procedure will be timeout.</p><h3>Input parameters</h3><table
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GATT_SET_SECURITY_PERMISSION_anchor">ACI_GATT_SET_SECURITY_PERMISSION</a></h2><h3>Description</h3><p>This command sets the security permission for the attribute handle specified. Currently the
setting of security permission is allowed only for client configuration descriptor.</p><h3>Input parameters</h3><table width="800" border="1" class="reference">
@@ -5506,7 +5506,7 @@ setting of security permission is allowed only for client configuration descript
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GATT_SET_DESC_VALUE_anchor">ACI_GATT_SET_DESC_VALUE</a></h2><h3>Description</h3><p>This command sets the value of the descriptor specified by charDescHandle.</p><h3>Input parameters</h3><table width="800" border="1" class="reference">
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
@@ -5538,7 +5538,7 @@ setting of security permission is allowed only for client configuration descript
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GATT_READ_HANDLE_VALUE_anchor">ACI_GATT_READ_HANDLE_VALUE</a></h2><h3>Description</h3><p>Reads the value of the attribute handle specified from the local GATT database.</p><h3>Input parameters</h3><table width="800" border="1" class="reference">
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
@@ -5558,7 +5558,7 @@ setting of security permission is allowed only for client configuration descript
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Length</p>
</td><td><p>2</p>
@@ -5617,7 +5617,7 @@ setting of security permission is allowed only for client configuration descript
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GATT_DENY_READ_anchor">ACI_GATT_DENY_READ</a></h2><h3>Description</h3><p>Deny the GATT server to send a response to a read request from a client.
The application may send this command when it receives the <a href="#ACI_GATT_READ_PERMIT_REQ_EVENT_anchor">ACI_GATT_READ_PERMIT_REQ_EVENT</a> or <a href="#ACI_GATT_READ_MULTI_PERMIT_REQ_EVENT_anchor">ACI_GATT_READ_MULTI_PERMIT_REQ_EVENT</a>.
@@ -5638,7 +5638,7 @@ the <a href="#ACI_GATT_READ_PERMIT_REQ_EVENT_anchor">ACI_GATT_READ_PERMIT_REQ_EV
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI_GATT_SET_ACCESS_PERMISSION_anchor">ACI_GATT_SET_ACCESS_PERMISSION</a></h2><h3>Description</h3><p>This command sets the access permission for the attribute handle specified.</p><h3>Input parameters</h3><table width="800" border="1" class="reference">
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
@@ -5658,7 +5658,7 @@ the <a href="#ACI_GATT_READ_PERMIT_REQ_EVENT_anchor">ACI_GATT_READ_PERMIT_REQ_EV
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h2><a name="ACI L2CAP commands_anchor">ACI L2CAP commands</a></h2><h3>ACI L2CAP commands</h3><table width="800" border="1" class="reference">
<tr><th>Command</th><th>OpCode</th></tr>
@@ -5698,7 +5698,7 @@ Time = N * 1.25 msec.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_STATUS_EVENT_anchor">HCI_COMMAND_STATUS_EVENT</a></li><li><a href="#ACI_L2CAP_CONNECTION_UPDATE_RESP_EVENT_anchor">ACI_L2CAP_CONNECTION_UPDATE_RESP_EVENT</a></li><h2><a name="ACI_L2CAP_CONNECTION_PARAMETER_UPDATE_RESP_anchor">ACI_L2CAP_CONNECTION_PARAMETER_UPDATE_RESP</a></h2><h3>Description</h3><p>Accept or reject a connection update. This command should be sent in response
to a <a href="#ACI_L2CAP_CONNECTION_UPDATE_REQ_EVENT_anchor">ACI_L2CAP_CONNECTION_UPDATE_REQ_EVENT</a> event from the controller. The accept parameter has to be
@@ -5752,7 +5752,7 @@ Time = N * 0.625 msec.</p>
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
</table><h3>Events generated</h3><li><a href="#HCI_COMMAND_COMPLETE_EVENT_anchor">HCI_COMMAND_COMPLETE_EVENT</a></li><h1><a name="HCI/ACI events_anchor">HCI/ACI events</a></h1><p><a href="#HCI events_anchor">HCI events</a></p><p><a href="#HCI LE meta events_anchor">HCI LE meta events</a></p><p><a href="#ACI GAP events_anchor">ACI GAP events</a></p><p><a href="#ACI GATT/ATT events_anchor">ACI GATT/ATT events</a></p><p><a href="#ACI L2CAP events_anchor">ACI L2CAP events</a></p><p><a href="#ACI HAL events_anchor">ACI HAL events</a></p><h2><a name="HCI events_anchor">HCI events</a></h2><h3>HCI events</h3><table width="800" border="1" class="reference">
<tr><th>Event name</th><th>Event Code</th></tr>
@@ -5785,7 +5785,7 @@ that didn't correspond to a connection was given.</p><h3>Event parameters</h3><t
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Connection_Handle</p>
</td><td><p>2</p>
@@ -5794,7 +5794,7 @@ that didn't correspond to a connection was given.</p><h3>Event parameters</h3><t
<tr><td><p>Reason</p>
</td><td><p>1</p>
</td><td><p>Reason for disconnection.</p>
-</td><td><li>0x00: Success</li><li>0x01: Unknown HCI Command</li><li>0x02: Unknown Connection Identifier</li><li>0x03: Hardware Failure</li><li>0x04: Page Timeout</li><li>0x05: Authentication Failure</li><li>0x06: PIN or Key Missing</li><li>0x07: Memory Capacity Exceeded</li><li>0x08: Connection Timeout</li><li>0x09: Connection Limit Exceeded</li><li>0x0A: Synchronous Connection Limit to a Device Exceeded</li><li>0x0B: ACL Connection Already Exists</li><li>0x0C: Command Disallowed</li><li>0x0D: Connection Rejected Due To Limited Resources</li><li>0x0E: Connection Rejected Due To Security Reasons</li><li>0x0F: Connection Rejected due to Unacceptable BD_ADDR</li><li>0x10: Connection Accept Timeout Exceeded</li><li>0x11: Unsupported Feature Or Parameter Value</li><li>0x12: Invalid HCI Command Parameters</li><li>0x13: Remote User Terminated Connection</li><li>0x14: Remote Device Terminated Connection due to Low Resources</li><li>0x15: Remote Device Terminated Connection due to Power Off</li><li>0x16: Connection Terminated By Local Host</li><li>0x17: Repeated Attempts</li><li>0x18: Pairing Not Allowed</li><li>0x19: Unknown LMP PDU</li><li>0x1A: Unsupported Remote Feature / Unsupported LMP Feature</li><li>0x1B: SCO Offset Rejected</li><li>0x1C: SCO Interval Rejected</li><li>0x1D: SCO Air Mode Rejected</li><li>0x1E: Invalid LMP Parameters</li><li>0x1F: Unspecified Error</li><li>0x20: Unsupported LMP Parameter Value</li><li>0x21: Role Change Not Allowed</li><li>0x22: LMP Response Timeout / LL Response Timeout</li><li>0x23: LMP Error Transaction Collision</li><li>0x24: LMP PDU Not Allowed</li><li>0x25: Encryption Mode Not Acceptable</li><li>0x26: Link Key cannot be Changed</li><li>0x27: Requested QoS Not Supported</li><li>0x28: Instant Passed</li><li>0x29: Pairing With Unit Key Not Supported</li><li>0x2A: Different Transaction Collision</li><li>0x2C: QoS Unacceptable Parameter</li><li>0x2D: QoS Rejected</li><li>0x2E: Channel Assessment Not Supported</li><li>0x2F: Insufficient Security</li><li>0x30: Parameter Out Of Mandatory Range</li><li>0x32: Role Switch Pending</li><li>0x34: Reserved Slot Violation</li><li>0x35: Role Switch Failed</li><li>0x36: Extended Inquiry Response Too Large</li><li>0x37: Secure Simple Pairing Not Supported by Host</li><li>0x38: Host Busy - Pairing</li><li>0x39: Connection Rejected due to No Suitable Channel Found</li><li>0x3A: Controller Busy</li><li>0x3B: Unacceptable Connection Interval</li><li>0x3C: Directed Advertising Timeout</li><li>0x3D: Connection Terminated Due to MIC Failure</li><li>0x3E: Connection Failed to be Established</li><li>0x3F: MAC of the 802.11 AMP</li><li>0x41: Failed</li><li>0x42: Invalid parameters</li><li>0x43: Busy</li><li>0x44: Invalid length</li><li>0x45: Pending</li><li>0x46: Not allowed</li><li>0x47: GATT error</li><li>0x48: Address not resolved</li><li>0x49: Flash read failed</li><li>0x4A: Flash write failed</li><li>0x4B: Flash erase failed</li><li>0x50: Invalid CID</li><li>0x5A: CSRK not found</li><li>0x5B: IRK not found</li><li>0x5C: Device not found in DB</li><li>0x5D: Security DB full</li><li>0x5E: Device not bonded</li><li>0x5F: Device in blacklist</li><li>0x60: Invalid handle</li><li>0x61: Invalid parameter</li><li>0x62: Out of handles</li><li>0x63: Invalid operation</li><li>0x64: Insufficient resources</li><li>0x65: Insufficient encryption key size</li><li>0x66: Characteristic already exist</li><li>0x82: No valid slot</li><li>0x83: Short window</li><li>0x84: New interval failed</li><li>0x85: Too large interval</li><li>0x86: Slot length failed</li></td></tr>
+</td><td><li>0x00: Success</li><li>0x01: Unknown HCI Command</li><li>0x02: Unknown Connection Identifier</li><li>0x03: Hardware Failure</li><li>0x05: Authentication Failure</li><li>0x06: PIN or Key Missing</li><li>0x07: Memory Capacity Exceeded</li><li>0x08: Connection Timeout</li><li>0x09: Connection Limit Exceeded</li><li>0x0B: ACL Connection Already Exists</li><li>0x0C: Command Disallowed</li><li>0x0D: Connection Rejected Due To Limited Resources</li><li>0x0E: Connection Rejected Due To Security Reasons</li><li>0x0F: Connection Rejected due to Unacceptable BD_ADDR</li><li>0x10: Connection Accept Timeout Exceeded</li><li>0x11: Unsupported Feature Or Parameter Value</li><li>0x12: Invalid HCI Command Parameters</li><li>0x13: Remote User Terminated Connection</li><li>0x14: Remote Device Terminated Connection due to Low Resources</li><li>0x15: Remote Device Terminated Connection due to Power Off</li><li>0x16: Connection Terminated By Local Host</li><li>0x17: Repeated Attempts</li><li>0x18: Pairing Not Allowed</li><li>0x19: Unknown LMP PDU</li><li>0x1A: Unsupported Remote Feature / Unsupported LMP Feature</li><li>0x1E: Invalid LMP Parameters</li><li>0x1F: Unspecified Error</li><li>0x20: Unsupported LMP Parameter Value</li><li>0x21: Role Change Not Allowed</li><li>0x22: LMP Response Timeout / LL Response Timeout</li><li>0x23: LMP Error Transaction Collision</li><li>0x24: LMP PDU Not Allowed</li><li>0x25: Encryption Mode Not Acceptable</li><li>0x26: Link Key cannot be Changed</li><li>0x28: Instant Passed</li><li>0x29: Pairing With Unit Key Not Supported</li><li>0x2A: Different Transaction Collision</li><li>0x2E: Channel Assessment Not Supported</li><li>0x2F: Insufficient Security</li><li>0x30: Parameter Out Of Mandatory Range</li><li>0x32: Role Switch Pending</li><li>0x34: Reserved Slot Violation</li><li>0x35: Role Switch Failed</li><li>0x37: Secure Simple Pairing Not Supported by Host</li><li>0x38: Host Busy - Pairing</li><li>0x39: Connection Rejected due to No Suitable Channel Found</li><li>0x3A: Controller Busy</li><li>0x3B: Unacceptable Connection Interval</li><li>0x3C: Directed Advertising Timeout</li><li>0x3D: Connection Terminated Due to MIC Failure</li><li>0x3E: Connection Failed to be Established</li><li>0x41: Failed</li><li>0x42: Invalid parameters</li><li>0x43: Busy</li><li>0x44: Invalid length</li><li>0x45: Pending</li><li>0x46: Not allowed</li><li>0x47: GATT error</li><li>0x48: Address not resolved</li><li>0x50: Invalid CID</li><li>0x5A: CSRK not found</li><li>0x5B: IRK not found</li><li>0x5C: Device not found in DB</li><li>0x5D: Security DB full</li><li>0x5E: Device not bonded</li><li>0x5F: Device in blacklist</li><li>0x60: Invalid handle</li><li>0x61: Invalid parameter</li><li>0x62: Out of handles</li><li>0x63: Invalid operation</li><li>0x64: Insufficient resources</li><li>0x65: Insufficient encryption key size</li><li>0x66: Characteristic already exist</li><li>0x82: No valid slot</li><li>0x83: Short window</li><li>0x84: New interval failed</li><li>0x85: Too large interval</li><li>0x86: Slot length failed</li></td></tr>
</table><h2><a name="HCI_ENCRYPTION_CHANGE_EVENT_anchor">HCI_ENCRYPTION_CHANGE_EVENT</a></h2><h3>Description</h3><p>The Encryption Change event is used to indicate that the change of the encryption
mode has been completed. The Connection_Handle will be a Connection_Handle
for an ACL connection. The Encryption_Enabled event parameter
@@ -5812,7 +5812,7 @@ only use Encryption_Enabled values 0x00 (OFF) and 0x01 (ON).
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Connection_Handle</p>
</td><td><p>2</p>
@@ -5842,7 +5842,7 @@ event parameter shall be the SubVersNr parameter.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Connection_Handle</p>
</td><td><p>2</p>
@@ -5921,7 +5921,7 @@ Role Change event.</p><h3>Event parameters</h3><table width="800" border="1" cla
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Connection_Handle</p>
</td><td><p>2</p>
@@ -5974,7 +5974,7 @@ is set to 1 or more.</p><h3>Event parameters</h3><table width="800" border="1" c
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Num_HCI_Command_Packets</p>
</td><td><p>1</p>
@@ -6022,7 +6022,7 @@ this parameter shall be set to 0x00. See Bluetooth spec 5.0 vol 2 [part E] 7.7.6
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Connection_Handle</p>
</td><td><p>2</p>
@@ -6111,7 +6111,7 @@ On a master, this event shall be issued if the Connection_Update command was sen
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Connection_Handle</p>
</td><td><p>2</p>
@@ -6138,7 +6138,7 @@ remote Bluetooth device specified by the Connection_Handle event parameter.See B
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Connection_Handle</p>
</td><td><p>2</p>
@@ -6201,7 +6201,7 @@ Link Layer packet on this connection (connEffectiveMaxRxTime defined in [Vol 6]
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Local_P256_Public_Key</p>
</td><td><p>64</p>
@@ -6212,7 +6212,7 @@ by the Controller. See Bluetooth spec 5.0 vol 2 [part E] 7.7.65.9</p><h3>Event p
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>DHKey</p>
</td><td><p>32</p>
@@ -6235,7 +6235,7 @@ this parameter shall be set to 0x00. See Bluetooth spec 5.0 vol 2 [part E] 7.7.6
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Connection_Handle</p>
</td><td><p>2</p>
@@ -6339,7 +6339,7 @@ neither PHY will change as a result, it issues this event immediately.
<tr><th>Parameter</th><th>Size</th><th>Description</th><th>Possible values</th></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Connection_Handle</p>
</td><td><p>2</p>
@@ -6419,10 +6419,10 @@ been terminated by the upper layer or has completed for any other reason</p><h3>
<tr><td><p>Procedure_Code</p>
</td><td><p>1</p>
</td><td><p>Terminated procedure.</p>
-</td><td><li>0x01: LIMITED_DISCOVERY_PROC</li><li>0x02: GENERAL_DISCOVERY_PROC</li><li>0x04: NAME_DISCOVERY_PROC</li><li>0x08: AUTO_CONNECTION_ESTABLISHMENT_PROC</li><li>0x10: GENERAL_CONNECTION_ESTABLISHMENT_PROC</li><li>0x20: SELECTIVE_CONNECTION_ESTABLISHMENT_PROC</li><li>0x40: DIRECT_CONNECTION_ESTABLISHMENT_PROC</li><li>0x80: OBSERVATION_PROC</li></td></tr>
+</td><td><li>0x01: GAP_LIMITED_DISCOVERY_PROC</li><li>0x02: GAP_GENERAL_DISCOVERY_PROC</li><li>0x04: GAP_NAME_DISCOVERY_PROC</li><li>0x08: GAP_AUTO_CONNECTION_ESTABLISHMENT_PROC</li><li>0x10: GAP_GENERAL_CONNECTION_ESTABLISHMENT_PROC</li><li>0x20: GAP_SELECTIVE_CONNECTION_ESTABLISHMENT_PROC</li><li>0x40: GAP_DIRECT_CONNECTION_ESTABLISHMENT_PROC</li><li>0x80: GAP_OBSERVATION_PROC</li></td></tr>
<tr><td><p>Status</p>
</td><td><p>1</p>
-</td><td><p>Error code. See Core v5.0, Vol. 2, part D.</p>
+</td><td><p>Status error code.</p>
</td><td></td></tr>
<tr><td><p>Data_Length</p>
</td><td><p>1</p>
@@ -6753,7 +6753,7 @@ successfully.</p><h3>Event parameters</h3><table width="800" border="1" class="r
<tr><td><p>Error_Code</p>
</td><td><p>1</p>
</td><td><p>Indicates whether the procedure completed with an error or was successful</p>
-</td><td><li>0x00: Success</li><li>0x01: Unknown HCI Command</li><li>0x02: Unknown Connection Identifier</li><li>0x03: Hardware Failure</li><li>0x04: Page Timeout</li><li>0x05: Authentication Failure</li><li>0x06: PIN or Key Missing</li><li>0x07: Memory Capacity Exceeded</li><li>0x08: Connection Timeout</li><li>0x09: Connection Limit Exceeded</li><li>0x0A: Synchronous Connection Limit to a Device Exceeded</li><li>0x0B: ACL Connection Already Exists</li><li>0x0C: Command Disallowed</li><li>0x0D: Connection Rejected Due To Limited Resources</li><li>0x0E: Connection Rejected Due To Security Reasons</li><li>0x0F: Connection Rejected due to Unacceptable BD_ADDR</li><li>0x10: Connection Accept Timeout Exceeded</li><li>0x11: Unsupported Feature Or Parameter Value</li><li>0x12: Invalid HCI Command Parameters</li><li>0x13: Remote User Terminated Connection</li><li>0x14: Remote Device Terminated Connection due to Low Resources</li><li>0x15: Remote Device Terminated Connection due to Power Off</li><li>0x16: Connection Terminated By Local Host</li><li>0x17: Repeated Attempts</li><li>0x18: Pairing Not Allowed</li><li>0x19: Unknown LMP PDU</li><li>0x1A: Unsupported Remote Feature / Unsupported LMP Feature</li><li>0x1B: SCO Offset Rejected</li><li>0x1C: SCO Interval Rejected</li><li>0x1D: SCO Air Mode Rejected</li><li>0x1E: Invalid LMP Parameters</li><li>0x1F: Unspecified Error</li><li>0x20: Unsupported LMP Parameter Value</li><li>0x21: Role Change Not Allowed</li><li>0x22: LMP Response Timeout / LL Response Timeout</li><li>0x23: LMP Error Transaction Collision</li><li>0x24: LMP PDU Not Allowed</li><li>0x25: Encryption Mode Not Acceptable</li><li>0x26: Link Key cannot be Changed</li><li>0x27: Requested QoS Not Supported</li><li>0x28: Instant Passed</li><li>0x29: Pairing With Unit Key Not Supported</li><li>0x2A: Different Transaction Collision</li><li>0x2C: QoS Unacceptable Parameter</li><li>0x2D: QoS Rejected</li><li>0x2E: Channel Assessment Not Supported</li><li>0x2F: Insufficient Security</li><li>0x30: Parameter Out Of Mandatory Range</li><li>0x32: Role Switch Pending</li><li>0x34: Reserved Slot Violation</li><li>0x35: Role Switch Failed</li><li>0x36: Extended Inquiry Response Too Large</li><li>0x37: Secure Simple Pairing Not Supported by Host</li><li>0x38: Host Busy - Pairing</li><li>0x39: Connection Rejected due to No Suitable Channel Found</li><li>0x3A: Controller Busy</li><li>0x3B: Unacceptable Connection Interval</li><li>0x3C: Directed Advertising Timeout</li><li>0x3D: Connection Terminated Due to MIC Failure</li><li>0x3E: Connection Failed to be Established</li><li>0x3F: MAC of the 802.11 AMP</li><li>0x41: Failed</li><li>0x42: Invalid parameters</li><li>0x43: Busy</li><li>0x44: Invalid length</li><li>0x45: Pending</li><li>0x46: Not allowed</li><li>0x47: GATT error</li><li>0x48: Address not resolved</li><li>0x49: Flash read failed</li><li>0x4A: Flash write failed</li><li>0x4B: Flash erase failed</li><li>0x50: Invalid CID</li><li>0x5A: CSRK not found</li><li>0x5B: IRK not found</li><li>0x5C: Device not found in DB</li><li>0x5D: Security DB full</li><li>0x5E: Device not bonded</li><li>0x5F: Device in blacklist</li><li>0x60: Invalid handle</li><li>0x61: Invalid parameter</li><li>0x62: Out of handles</li><li>0x63: Invalid operation</li><li>0x64: Insufficient resources</li><li>0x65: Insufficient encryption key size</li><li>0x66: Characteristic already exist</li><li>0x82: No valid slot</li><li>0x83: Short window</li><li>0x84: New interval failed</li><li>0x85: Too large interval</li><li>0x86: Slot length failed</li></td></tr>
+</td><td><li>0x00: Success</li><li>0x01: Unknown HCI Command</li><li>0x02: Unknown Connection Identifier</li><li>0x03: Hardware Failure</li><li>0x05: Authentication Failure</li><li>0x06: PIN or Key Missing</li><li>0x07: Memory Capacity Exceeded</li><li>0x08: Connection Timeout</li><li>0x09: Connection Limit Exceeded</li><li>0x0B: ACL Connection Already Exists</li><li>0x0C: Command Disallowed</li><li>0x0D: Connection Rejected Due To Limited Resources</li><li>0x0E: Connection Rejected Due To Security Reasons</li><li>0x0F: Connection Rejected due to Unacceptable BD_ADDR</li><li>0x10: Connection Accept Timeout Exceeded</li><li>0x11: Unsupported Feature Or Parameter Value</li><li>0x12: Invalid HCI Command Parameters</li><li>0x13: Remote User Terminated Connection</li><li>0x14: Remote Device Terminated Connection due to Low Resources</li><li>0x15: Remote Device Terminated Connection due to Power Off</li><li>0x16: Connection Terminated By Local Host</li><li>0x17: Repeated Attempts</li><li>0x18: Pairing Not Allowed</li><li>0x19: Unknown LMP PDU</li><li>0x1A: Unsupported Remote Feature / Unsupported LMP Feature</li><li>0x1E: Invalid LMP Parameters</li><li>0x1F: Unspecified Error</li><li>0x20: Unsupported LMP Parameter Value</li><li>0x21: Role Change Not Allowed</li><li>0x22: LMP Response Timeout / LL Response Timeout</li><li>0x23: LMP Error Transaction Collision</li><li>0x24: LMP PDU Not Allowed</li><li>0x25: Encryption Mode Not Acceptable</li><li>0x26: Link Key cannot be Changed</li><li>0x28: Instant Passed</li><li>0x29: Pairing With Unit Key Not Supported</li><li>0x2A: Different Transaction Collision</li><li>0x2E: Channel Assessment Not Supported</li><li>0x2F: Insufficient Security</li><li>0x30: Parameter Out Of Mandatory Range</li><li>0x32: Role Switch Pending</li><li>0x34: Reserved Slot Violation</li><li>0x35: Role Switch Failed</li><li>0x37: Secure Simple Pairing Not Supported by Host</li><li>0x38: Host Busy - Pairing</li><li>0x39: Connection Rejected due to No Suitable Channel Found</li><li>0x3A: Controller Busy</li><li>0x3B: Unacceptable Connection Interval</li><li>0x3C: Directed Advertising Timeout</li><li>0x3D: Connection Terminated Due to MIC Failure</li><li>0x3E: Connection Failed to be Established</li><li>0x41: Failed</li><li>0x42: Invalid parameters</li><li>0x43: Busy</li><li>0x44: Invalid length</li><li>0x45: Pending</li><li>0x46: Not allowed</li><li>0x47: GATT error</li><li>0x48: Address not resolved</li><li>0x50: Invalid CID</li><li>0x5A: CSRK not found</li><li>0x5B: IRK not found</li><li>0x5C: Device not found in DB</li><li>0x5D: Security DB full</li><li>0x5E: Device not bonded</li><li>0x5F: Device in blacklist</li><li>0x60: Invalid handle</li><li>0x61: Invalid parameter</li><li>0x62: Out of handles</li><li>0x63: Invalid operation</li><li>0x64: Insufficient resources</li><li>0x65: Insufficient encryption key size</li><li>0x66: Characteristic already exist</li><li>0x82: No valid slot</li><li>0x83: Short window</li><li>0x84: New interval failed</li><li>0x85: Too large interval</li><li>0x86: Slot length failed</li></td></tr>
</table><h2><a name="ACI_GATT_ERROR_RESP_EVENT_anchor">ACI_GATT_ERROR_RESP_EVENT</a></h2><h3>Description</h3><p>This event is generated when an Error Response is received from the server. The error
response can be given by the server at the end of one of the GATT discovery procedures.
This does not mean that the procedure ended with an error, but this error event is part of the
@@ -7116,7 +7116,7 @@ Units: dBm</p>
</td><td><p>Data_Length</p>
</td><td><p>The error event info</p>
</td><td></tr>
-</table><h1><a name="Error codes_anchor">Error codes</a></h1><h2>Status error codes</h2><table width="800" border="1" class="reference">
+</table><h1><a name="Status error codes_anchor">Status error codes</a></h1><p>Status error codes are used for the return status of all commands. Only the codes from 0 to 0x3E are used for HCI commands (see Core Specification v5.0, Vol. 2, part D), while more codes are defined for ACI commands (see table below).</p><h2></h2><table width="800" border="1" class="reference">
<tr><th>Status error code</th><th>Description</th></tr>
<tr><td><p>0x00</p>
</td><td><p>Success</p>
@@ -7130,9 +7130,6 @@ Units: dBm</p>
<tr><td><p>0x03</p>
</td><td><p>Hardware Failure</p>
</td></tr>
-<tr><td><p>0x04</p>
-</td><td><p>Page Timeout</p>
-</td></tr>
<tr><td><p>0x05</p>
</td><td><p>Authentication Failure</p>
</td></tr>
@@ -7148,9 +7145,6 @@ Units: dBm</p>
<tr><td><p>0x09</p>
</td><td><p>Connection Limit Exceeded</p>
</td></tr>
-<tr><td><p>0x0A</p>
-</td><td><p>Synchronous Connection Limit to a Device Exceeded</p>
-</td></tr>
<tr><td><p>0x0B</p>
</td><td><p>ACL Connection Already Exists</p>
</td></tr>
@@ -7199,15 +7193,6 @@ Units: dBm</p>
<tr><td><p>0x1A</p>
</td><td><p>Unsupported Remote Feature / Unsupported LMP Feature</p>
</td></tr>
-<tr><td><p>0x1B</p>
-</td><td><p>SCO Offset Rejected</p>
-</td></tr>
-<tr><td><p>0x1C</p>
-</td><td><p>SCO Interval Rejected</p>
-</td></tr>
-<tr><td><p>0x1D</p>
-</td><td><p>SCO Air Mode Rejected</p>
-</td></tr>
<tr><td><p>0x1E</p>
</td><td><p>Invalid LMP Parameters</p>
</td></tr>
@@ -7235,9 +7220,6 @@ Units: dBm</p>
<tr><td><p>0x26</p>
</td><td><p>Link Key cannot be Changed</p>
</td></tr>
-<tr><td><p>0x27</p>
-</td><td><p>Requested QoS Not Supported</p>
-</td></tr>
<tr><td><p>0x28</p>
</td><td><p>Instant Passed</p>
</td></tr>
@@ -7247,12 +7229,6 @@ Units: dBm</p>
<tr><td><p>0x2A</p>
</td><td><p>Different Transaction Collision</p>
</td></tr>
-<tr><td><p>0x2C</p>
-</td><td><p>QoS Unacceptable Parameter</p>
-</td></tr>
-<tr><td><p>0x2D</p>
-</td><td><p>QoS Rejected</p>
-</td></tr>
<tr><td><p>0x2E</p>
</td><td><p>Channel Assessment Not Supported</p>
</td></tr>
@@ -7271,9 +7247,6 @@ Units: dBm</p>
<tr><td><p>0x35</p>
</td><td><p>Role Switch Failed</p>
</td></tr>
-<tr><td><p>0x36</p>
-</td><td><p>Extended Inquiry Response Too Large</p>
-</td></tr>
<tr><td><p>0x37</p>
</td><td><p>Secure Simple Pairing Not Supported by Host</p>
</td></tr>
@@ -7298,9 +7271,6 @@ Units: dBm</p>
<tr><td><p>0x3E</p>
</td><td><p>Connection Failed to be Established</p>
</td></tr>
-<tr><td><p>0x3F</p>
-</td><td><p>MAC of the 802.11 AMP</p>
-</td></tr>
<tr><td><p>0x41</p>
</td><td><p>Failed</p>
</td></tr>
@@ -7325,15 +7295,6 @@ Units: dBm</p>
<tr><td><p>0x48</p>
</td><td><p>Address not resolved</p>
</td></tr>
-<tr><td><p>0x49</p>
-</td><td><p>Flash read failed</p>
-</td></tr>
-<tr><td><p>0x4A</p>
-</td><td><p>Flash write failed</p>
-</td></tr>
-<tr><td><p>0x4B</p>
-</td><td><p>Flash erase failed</p>
-</td></tr>
<tr><td><p>0x50</p>
</td><td><p>Invalid CID</p>
</td></tr>
@@ -7391,57 +7352,4 @@ Units: dBm</p>
<tr><td><p>0x86</p>
</td><td><p>Slot length failed</p>
</td></tr>
-</table><h2>ATT error codes</h2><table width="800" border="1" class="reference">
-<tr><th>ATT error code</th><th>Description</th></tr>
-<tr><td><p>0x01</p>
-</td><td><p>Invalid handle</p>
-</td></tr>
-<tr><td><p>0x02</p>
-</td><td><p>Read not permitted</p>
-</td></tr>
-<tr><td><p>0x03</p>
-</td><td><p>Write not permitted</p>
-</td></tr>
-<tr><td><p>0x04</p>
-</td><td><p>Invalid PDU</p>
-</td></tr>
-<tr><td><p>0x05</p>
-</td><td><p>Insufficient authentication</p>
-</td></tr>
-<tr><td><p>0x06</p>
-</td><td><p>Request not supported</p>
-</td></tr>
-<tr><td><p>0x07</p>
-</td><td><p>Invalid offset</p>
-</td></tr>
-<tr><td><p>0x08</p>
-</td><td><p>Insufficient authorization</p>
-</td></tr>
-<tr><td><p>0x09</p>
-</td><td><p>Prepare queue full</p>
-</td></tr>
-<tr><td><p>0x0A</p>
-</td><td><p>Attribute not found</p>
-</td></tr>
-<tr><td><p>0x0B</p>
-</td><td><p>Attribute not long</p>
-</td></tr>
-<tr><td><p>0x0C</p>
-</td><td><p>Insufficient encryption key size</p>
-</td></tr>
-<tr><td><p>0x0D</p>
-</td><td><p>Invalid attribute value length</p>
-</td></tr>
-<tr><td><p>0x0E</p>
-</td><td><p>Unlikely error</p>
-</td></tr>
-<tr><td><p>0x0F</p>
-</td><td><p>Insufficient encryption</p>
-</td></tr>
-<tr><td><p>0x10</p>
-</td><td><p>Unsupported group type</p>
-</td></tr>
-<tr><td><p>0x11</p>
-</td><td><p>Insufficient resources</p>
-</td></tr>
</table></font></body></html> \ No newline at end of file
diff --git a/Middlewares/ST/STM32_WPAN/ble/mesh/Inc/appli_test.h b/Middlewares/ST/STM32_WPAN/ble/mesh/Inc/appli_test.h
new file mode 100644
index 000000000..890b79263
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/ble/mesh/Inc/appli_test.h
@@ -0,0 +1,70 @@
+/**
+******************************************************************************
+* @file response_test.h
+* @author BLE Mesh Team
+* @version V1.10.000
+* @date 15-Jan-2019
+* @brief Header file for the serial interface file
+******************************************************************************
+* @attention
+*
+* <h2><center>&copy; COPYRIGHT(c) 2018 STMicroelectronics</center></h2>
+*
+* Redistribution and use in source and binary forms, with or without modification,
+* are permitted provided that the following conditions are met:
+* 1. Redistributions of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+* 3. Neither the name of STMicroelectronics nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+* Initial BLE-Mesh is built over Motorolas Mesh over Bluetooth Low Energy
+* (MoBLE) technology. The present solution is developed and maintained for both
+* Mesh library and Applications solely by STMicroelectronics.
+*
+******************************************************************************
+*/
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __RESPONSE_TEST_H
+#define __RESPONSE_TEST_H
+
+/* Includes ------------------------------------------------------------------*/
+#include "types.h"
+
+/* Exported macro ------------------------------------------------------------*/
+#define TEST_1_WAIT_PERIOD 2000
+#define TEST_2_WAIT_PERIOD 100
+#define TEST_3_WAIT_PERIOD 5000
+#define TEST_READ_PERIOD 2000
+#define CLOCK_FLAG_ENABLE 1
+#define CLOCK_FLAG_DISABLE 0
+#define DATA_BYTE_SEND 100
+/* Exported variables ------------------------------------------------------- */
+/* Exported Functions Prototypes ---------------------------------------------*/
+void SerialResponse_Process(char *rcvdStringBuff, uint16_t rcvdStringSize);
+MOBLE_RESULT Test_ApplicationTest_Set01(MOBLEUINT32 testCount,MOBLE_ADDRESS src ,MOBLE_ADDRESS dst);
+MOBLE_RESULT Packet_ResponseTimeStamp(MOBLEUINT32 rcvTimeStamp);
+MOBLE_RESULT Test_ApplicationTest_Set02(MOBLEUINT32 testCount ,MOBLE_ADDRESS src ,MOBLE_ADDRESS dst);
+MOBLE_RESULT Test_ApplicationTest_Set03(MOBLE_ADDRESS src ,MOBLE_ADDRESS dst);
+MOBLEUINT8 processDelay(MOBLEUINT16 waitPeriod);
+
+
+#endif /* __RESPONSE_TEST_H */
+
+/******************* (C) COPYRIGHT 2018 STMicroelectronics *****END OF FILE****/
+
diff --git a/Middlewares/ST/STM32_WPAN/ble/mesh/Inc/ble_mesh.h b/Middlewares/ST/STM32_WPAN/ble/mesh/Inc/ble_mesh.h
index 3fcd403f3..f75e1273a 100644
--- a/Middlewares/ST/STM32_WPAN/ble/mesh/Inc/ble_mesh.h
+++ b/Middlewares/ST/STM32_WPAN/ble/mesh/Inc/ble_mesh.h
@@ -44,8 +44,8 @@
#define _BLE_MESH_
#include "types.h"
-
-#define BLE_MESH_APPLICATION_VERSION "1.10.000"
+//#include "hal_types.h"
+#define BLUENRG_MESH_APPLICATION_VERSION "1.10.004"
/**
* \mainpage ST BLE-Mesh Solutions Bluetooth LE Mesh Library
*
@@ -111,6 +111,21 @@
*/
#include <stdint.h>
+/**
+* \brief Output OOB Action values (provisioner)
+*/
+#define OUTPUT_OOB_ACTION_BIT_BLINK (1 << 0) /**< Blink */
+#define OUTPUT_OOB_ACTION_BIT_BEEP (1 << 1) /**< Beep */
+#define OUTPUT_OOB_ACTION_BIT_VIBRATE (1 << 2) /**< Vibrate */
+#define OUTPUT_OOB_ACTION_BIT_DISPLAY_NUM (1 << 3) /**< Display Numeric */
+
+/**
+* \brief Input OOB Action values (unprovisioned node)
+*/
+#define INPUT_OOB_ACTION_BIT_PUSH (1 << 0) /**< Push */
+#define INPUT_OOB_ACTION_BIT_TWIST (1 << 1) /**< Twist */
+#define INPUT_OOB_ACTION_BIT_ENTER_NUM (1 << 2) /**< Enter Number */
+
/** \brief List of status values for responses. */
typedef enum _MOBLE_COMMAND_STATUS
{
@@ -180,9 +195,18 @@ typedef struct
*/
typedef struct
{
+ uint8_t pubKeyTypeOob; /* Used Public Key: OOB / No OOB */
+ const uint8_t *pubKey; /* Pointer to array containing Public Key of the device */
+ const uint8_t *privKey; /* Pointer to array containing Private Key of the device*/
uint8_t staticOobSize; /* Size of Static OOB array */
const uint8_t *staticOob; /* Pointer to array containing Static OOB info of the device */
-} unprov_node_info_params_t;
+ uint8_t OutputOobSize; /* Size of Output OOB value */
+ uint8_t OutputOobAction; /* Size of Output OOB Action */
+ void (*OutputOOBAuthCb)(MOBLEUINT8* oobData, MOBLEUINT8 size); /* Callback to Output OOB data */
+ uint8_t InputOobSize; /* Size of Input OOB value */
+ uint8_t InputOobAction; /* Size of Input OOB Action */
+ MOBLEUINT8* (*InputOOBAuthCb)(MOBLEUINT8 size); /* Callback to Input OOB data */
+} prvn_params_t;
/**
* Structure contains neighbor table initialization parameters
@@ -253,8 +277,9 @@ typedef struct
* \param[in] response Flag if response is required.
* \return MOBLE_RESULT_SUCCESS on success.
*/
- MOBLE_RESULT (*OnResponseData)(MOBLE_ADDRESS peer, MOBLEUINT8 elementIndex,
- MOBLEUINT8 const * data, MOBLEUINT32 length);
+ MOBLE_RESULT (*OnResponseData)(MOBLE_ADDRESS peer_addr, MOBLE_ADDRESS dst_peer,
+ MOBLEUINT8 command, MOBLEUINT8 const *pRxData,
+ MOBLEUINT32 dataLength, MOBLEBOOL response);
} MOBLE_VENDOR_CB_MAP;
@@ -376,6 +401,59 @@ typedef struct
} MODEL_SIG_cb_t;
+/** \brief Callback map */
+typedef struct
+{
+ /** \brief Get opcode table callback.
+ * This function is a callback to get status opcode form the received opcode
+ * from client side.
+ * \param[in] Pointer to get the opcode table address
+ * \param[in] length of the opcode.
+ * \return MOBLE_RESULT_SUCCESS on success.
+ */
+
+ MOBLE_RESULT (*ModelVendor_GetOpcodeTableCb)(const MODEL_OpcodeTableParam_t **data,
+ MOBLEUINT16 *length);
+
+ /** \brief get message/status message process callback
+ * This function called when there will acknowleged message received or Get message is
+ * is received to get the status of the message.
+ * \param[in] peer Source network address.
+ * \param[in] dst_peer Destination address set by peer.
+ * \param[in] opcode to be processed
+ * \param[in] data Data buffer. to be sent back in status
+ * \param[in] length Data buffer length in bytes.
+ * \param[in] response Flag if response is required.
+ * \return MOBLE_RESULT_SUCCESS on success.
+ */
+ MOBLE_RESULT (*ModelVendor_GetRequestCb)(MOBLE_ADDRESS peer_addr,
+ MOBLE_ADDRESS dst_peer,
+ MOBLEUINT16 opcode,
+ MOBLEUINT8 *data,
+ MOBLEUINT32 *res_length,
+ MOBLEUINT8 const *pData,
+ MOBLEUINT32 length,
+ MOBLEBOOL response);
+
+ /** \brief set message process callback
+ * This function called when there will set message is received.
+ * \param[in] peer Source network address.
+ * \param[in] dst_peer Destination address set by peer.
+ * \param[in] opcode to be processed
+ * \param[in] data Data buffer. to be sent back in status
+ * \param[in] length Data buffer length in bytes.
+ * \param[in] response Flag if response is required.
+ * \return MOBLE_RESULT_SUCCESS on success.
+ */
+ MOBLE_RESULT (*ModelVendor_SetRequestCb)(MOBLE_ADDRESS peer_addr,
+ MOBLE_ADDRESS dst_peer,
+ MOBLEUINT16 opcode,
+ MOBLEUINT8 const *data,
+ MOBLEUINT32 length,
+ MOBLEBOOL response);
+
+} MODEL_Vendor_cb_t;
+
typedef struct
{
MOBLEUINT8* pbuff_dyn ;
@@ -395,6 +473,7 @@ typedef struct
const neighbor_table_init_params_t* pNeighborTableParams;
const uint16_t features;
const uint8_t prvnBearer;
+ const prvn_params_t* pPrvnParams;
const DynBufferParam_t* pDynBufferParam;
} Mesh_Initialization_t;
@@ -470,6 +549,24 @@ MOBLE_RESULT BLEMesh_SetRemoteData(MOBLE_ADDRESS peer, MOBLEUINT8 elementIndex,
MOBLEUINT32 length, MOBLEBOOL response,
MOBLEUINT8 isVendor);
+/** \brief Vendor Model Set remote data on the given peer.
+* User is responsible for serializing data into a data buffer.
+* \param[in] peer Destination address. May be set to MOBLE_ADDRESS_ALL_NODES to broadcast data.
+* \param[in] src_addr index of the element which is generating the data
+* \param[in] command vendor model commands
+* \param[in] data Data buffer.
+* \param[in] length Length of data in bytes.
+* \param[in] response If 'MOBLE_TRUE', used to get the response. If 'MOBLE_FALSE', no response
+* \return MOBLE_RESULT_SUCCESS on success.
+*/
+MOBLE_RESULT Vendor_WriteRemoteData (MOBLEUINT32 vendorModelId,
+ MOBLE_ADDRESS src_addr,
+ MOBLE_ADDRESS dst_peer,
+ MOBLEUINT8 command,
+ MOBLEUINT8 const *data,
+ MOBLEUINT32 length,
+ MOBLEBOOL response);
+
/** \brief Read remote data on the given peer.
* User is responsible for serializing data into \a data buffer. Vendor_ReadLocalDataCb
* callback will be called on the remote device.
@@ -479,9 +576,13 @@ MOBLE_RESULT BLEMesh_SetRemoteData(MOBLE_ADDRESS peer, MOBLEUINT8 elementIndex,
* \param[in] command vendor model commands
* \return MOBLE_RESULT_SUCCESS on success.
*/
-MOBLE_RESULT BLEMesh_ReadRemoteData(MOBLE_ADDRESS peer, MOBLEUINT8 elementIndex, MOBLEUINT16 command);
+MOBLE_RESULT BLEMesh_ReadRemoteData(MOBLE_ADDRESS peer,
+ MOBLEUINT8 elementIndex,
+ MOBLEUINT16 command,
+ MOBLEUINT8 const * data,
+ MOBLEUINT32 length);
-/** \brief Send response on received packet.
+/** \brief Send response on received packet.The usage of this API is depracated and replaced with VendorModel_SendResponse
* \param[in] peer Destination address. Must be a device address (0b0xxx xxxx xxxx xxxx, but not 0).
* \param[in] dst Source Address of Node
* \param[in] status Status of response.
@@ -494,6 +595,19 @@ MOBLE_RESULT BLEMesh_SendResponse(MOBLE_ADDRESS peer, MOBLE_ADDRESS dst,
MOBLEUINT8 status, MOBLEUINT8 const * data,
MOBLEUINT32 length);
+/** \brief Send response on received packet.
+* \param[in] peer Destination address. Must be a device address (0b0xxx xxxx xxxx xxxx, but not 0).
+* \param[in] dst Source Address of Node
+* \param[in] status Status of response.
+* \param[in] data Data buffer.
+* \param[in] length Length of data in bytes. Maximum accepted length is 8.
+* If length is zero, no associated data is sent with the report.
+* \return MOBLE_RESULT_SUCCESS on success.
+*/
+MOBLE_RESULT VendorModel_SendResponse(MOBLEUINT16 vendorModelId, MOBLE_ADDRESS peer, MOBLE_ADDRESS dst,
+ MOBLEUINT8 status, MOBLEUINT8 const * data,
+ MOBLEUINT32 length);
+
/** \brief Sensor Send response on received packet.
* \param[in] peer Destination address. Must be a device address (0b0xxx xxxx xxxx xxxx, but not 0).
* \param[in] data Data buffer.
@@ -516,12 +630,6 @@ MOBLE_RESULT BLEMesh_InitUnprovisionedNode(void);
*/
MOBLE_RESULT BLEMesh_InitProvisionedNode(void);
-/** \brief Getting Info of unprovisioned node.
-* \param None.
-* \return MOBLE_RESULT_SUCCESS on success.
-*/
-MOBLE_RESULT BLEMesh_UnprovisionedNodeInfo(const unprov_node_info_params_t *);
-
/** \brief Check if node configures as Unprovisioned node.
* \return MOBLE_TRUE if node configured as Unprovisioned node. MOBLE_FALSE otherwise.
*/
@@ -615,6 +723,43 @@ MOBLE_RESULT BLEMesh_SetRelayRetransmitCount(MOBLEUINT8 count);
*/
MOBLEUINT8 BLEMesh_GetRelayRetransmitCount(void);
+/** \brief Enable or disable relay feature. Feature can be changed only if it is supported
+* 0 - disable, 1 - enable
+* \return MOBLE_RESULT_FALSE if no change occur
+* MOBLE_RESULT_SUCCESS on success
+*/
+MOBLE_RESULT BLEMesh_SetRelayFeatureState(MOBLEUINT8 state);
+
+/** \brief Enable or disable proxy feature. Feature can be changed only if it is supported
+* 0 - disable, 1 - enable
+* \return MOBLE_RESULT_FALSE if no change occur
+* MOBLE_RESULT_SUCCESS on success
+*/
+MOBLE_RESULT BLEMesh_SetProxyFeatureState(MOBLEUINT8 state);
+
+/** \brief Enable or disable friend feature. Feature can be changed only if it is supported
+* 0 - disable, 1 - enable
+* \return MOBLE_RESULT_FALSE if no change occur
+* MOBLE_RESULT_SUCCESS on success
+*/
+MOBLE_RESULT BLEMesh_SetFriendFeatureState(MOBLEUINT8 state);
+
+/** \brief Disable low power feature only if it is supported and enabled
+* 0 - disable, low power feature can't be enabled using BluenrgMesh_SetLowPowerFeatureState
+* \return MOBLE_RESULT_FALSE if no change occur
+* MOBLE_RESULT_SUCCESS on success
+*/
+MOBLE_RESULT BLEMesh_SetLowPowerFeatureState(MOBLEUINT8 state);
+
+/** \brief Get features state
+* Bit0: Relay feature. 0 - disabled, 1 - enabled
+* Bit1: Proxy feature. 0 - disabled, 1 - enabled
+* Bit2: Friend feature. 0 - disabled, 1 - enabled
+* Bit3: Low Power feature. 0 - disabled, 1 - enabled
+* \return Features state
+*/
+MOBLEUINT16 BLEMesh_GetFeatures(void);
+
/** \brief Set callback for handling heartbeat messages.
*
* \param[in] cb Callback
@@ -647,10 +792,18 @@ void BLEMesh_ProvisionCallback(void);
/** \brief Set SIG Model callback map.
* \param[in] map callback map. If NULL, nothing is done.
+* \count[in] count of the number of models defined in Application
* \return MOBLE_RESULT_SUCCESS on success.
*/
MOBLE_RESULT BLEMesh_SetSIGModelsCbMap(const MODEL_SIG_cb_t* pSig_cb, MOBLEUINT32 count);
+/** \brief GetApplicationVendorModels
+* \param[in] map callback map. If NULL, nothing is done.
+* \count[in] count of the number of models defined in Application
+* \return MOBLE_RESULT_SUCCESS on success.
+*/
+void GetApplicationVendorModels(const MODEL_Vendor_cb_t** pModelsTable, MOBLEUINT32* VendorModelscount);
+
/** \brief Returns sleep duration.
* going to sleep (or no call to BLEMesh_Process()) for this duration does not affect operation of mesh library
* \return Sleep duration.
@@ -749,6 +902,19 @@ MOBLE_RESULT BLEMesh_SetProxyServAdvInterval(MOBLEUINT16 interval);
*/
MOBLE_RESULT BLEMesh_SetSecureBeaconInterval(MOBLEUINT16 interval);
+/** \brief Set interval of custom beacon, 0 value results in stop.
+* \param[in] interval (ms) of beacons, min interval value is 1000 ms
+* \return MOBLE_RESULT_SUCCESS on success.
+*/
+MOBLE_RESULT BLEMesh_SetCustomBeaconInterval(MOBLEUINT16 interval);
+
+/** \brief Set custom beacon data.
+* If size > 31 bytes, beacon is rejected
+* \param[out] beacon data buffer
+* \param[out] size of beacon data
+*/
+void BLEMesh_CustomBeaconGeneratorCallback(void* buffer, MOBLEUINT8* size);
+
/**
* @brief ApplicationGetSigModelList: This function provides the list of the
* SIG Models to the calling function
@@ -812,14 +978,14 @@ void BLEMesh_NeighborRefreshedCallback(const MOBLEUINT8* bdAddr,
* \param[in] reference to a variable which will be updated according to number of entries in neighbor table.
* \return MOBLE_RESULT_SUCCESS on success.
*/
-MOBLE_RESULT BluenrgMesh_GetNeighborState(neighbor_params_t* pNeighborTable, MOBLEUINT8* pNoOfNeighborPresent);
+MOBLE_RESULT BLEMesh_GetNeighborState(neighbor_params_t* pNeighborTable, MOBLEUINT8* pNoOfNeighborPresent);
/** \brief Set system faults. Will be used by Health Model. Supporting All Bluetooth assigned FaultValues.
* \param[in] pFaultArray FaultValue Array pointer. (FaultValue Range: 0x010x32)
* \param[in] faultArraySize Size of the fault array. Max supported array size is 5.
* \return MOBLE_RESULT_SUCCESS on success.
*/
-MOBLE_RESULT BluenrgMesh_SetFault(MOBLEUINT8 *pFaultArray, MOBLEUINT8 faultArraySize);
+MOBLE_RESULT BLEMesh_SetFault(MOBLEUINT8 *pFaultArray, MOBLEUINT8 faultArraySize);
/** \brief Clears already set system faults. Will be used by Health Model.
* \param[in] pFaultArray Fault Array pointer
@@ -828,6 +994,22 @@ MOBLE_RESULT BluenrgMesh_SetFault(MOBLEUINT8 *pFaultArray, MOBLEUINT8 faultArray
*/
MOBLE_RESULT BLEMesh_ClearFault(MOBLEUINT8 *pFaultArray, MOBLEUINT8 faultArraySize);
+/** \brief Bluetooth LE Mesh Library shutdown
+*
+* This function should be called to shutdown Bluetooth LE Mesh Library
+* To resume the operation, \a BluenrgMesh_Resume should be called.
+* \return MOBLE_RESULT_FAIL if already shut down, MOBLE_RESULT_SUCCESS otherwise.
+*/
+MOBLE_RESULT BLEMesh_Shutdown(void);
+
+/** \brief Restore Bluetooth LE Mesh Library after shutdown
+*
+* This function should be called to restore previously shutdown Bluetooth LE Mesh Library
+* in order to resume library operation.
+* \return MOBLE_RESULT_FAIL if already up and running, MOBLE_RESULT_SUCCESS otherwise.
+*/
+MOBLE_RESULT BLEMesh_Resume(void);
#endif /* __BLE_MESH_ */
+
/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Middlewares/ST/STM32_WPAN/ble/mesh/Inc/pal_nvm.h b/Middlewares/ST/STM32_WPAN/ble/mesh/Inc/pal_nvm.h
index a4a320ff4..1a179fd25 100644
--- a/Middlewares/ST/STM32_WPAN/ble/mesh/Inc/pal_nvm.h
+++ b/Middlewares/ST/STM32_WPAN/ble/mesh/Inc/pal_nvm.h
@@ -43,10 +43,20 @@
#ifndef __PAL_NVM_H
#define __PAL_NVM_H
+#define ATOMIC_SECTION_BEGIN() uint32_t uwPRIMASK_Bit = __get_PRIMASK(); \
+ __disable_irq()
+/* Must be called in the same or in a lower scope of ATOMIC_SECTION_BEGIN */
+#define ATOMIC_SECTION_END() __set_PRIMASK(uwPRIMASK_Bit)
+
/* Includes ------------------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
/* Exported variables ------------------------------------------------------- */
+extern const void* mobleNvmBase;
+
+/* Private define ------------------------------------------------------------*/
+#define NVM_BASE ((unsigned int)mobleNvmBase)
+
typedef enum
{
MOBLE_NVM_COMPARE_EQUAL,
@@ -55,11 +65,23 @@ typedef enum
} MOBLE_NVM_COMPARE;
/* Exported Functions Prototypes ---------------------------------------------*/
-MOBLE_RESULT MoblePalNvmRead(MOBLEUINT32 address, void *buf, MOBLEUINT32 size, MOBLEBOOL backup);
+MOBLE_RESULT MoblePalNvmRead(MOBLEUINT32 address,
+ MOBLEUINT32 offset,
+ void *buf,
+ MOBLEUINT32 size,
+ MOBLEBOOL backup);
MOBLE_RESULT MoblePalNvmBackupRead(MOBLEUINT32 address, void *buf, MOBLEUINT32 size);
-MOBLE_RESULT MoblePalNvmWrite(MOBLEUINT32 address, void const *buf, MOBLEUINT32 size);
+MOBLE_RESULT MoblePalNvmWrite(MOBLEUINT32 address,
+ MOBLEUINT32 offset,
+ void const *buf,
+ MOBLEUINT32 size);
MOBLEBOOL MoblePalNvmIsWriteProtected(void);
-MOBLE_RESULT MoblePalNvmCompare(MOBLEUINT32 offset, void const *buf, MOBLEUINT32 size, MOBLE_NVM_COMPARE* result);
-MOBLE_RESULT MoblePalNvmErase(MOBLEUINT32 offset);
+MOBLE_RESULT MoblePalNvmCompare(MOBLEUINT32 address,
+ MOBLEUINT32 offset,
+ void const *buf,
+ MOBLEUINT32 size,
+ MOBLE_NVM_COMPARE* result);
+MOBLE_RESULT MoblePalNvmErase(MOBLEUINT32 address,
+ MOBLEUINT32 offset);
#endif /* __PAL_NVM_H */
diff --git a/Middlewares/ST/STM32_WPAN/ble/mesh/Inc/serial_if.h b/Middlewares/ST/STM32_WPAN/ble/mesh/Inc/serial_if.h
index c2069675d..55fe849cf 100644
--- a/Middlewares/ST/STM32_WPAN/ble/mesh/Inc/serial_if.h
+++ b/Middlewares/ST/STM32_WPAN/ble/mesh/Inc/serial_if.h
@@ -49,6 +49,7 @@
/* Exported macro ------------------------------------------------------------*/
/* Exported variables ------------------------------------------------------- */
/* Exported Functions Prototypes ---------------------------------------------*/
+void Serial_Init(void);
void Serial_PrintStringCb(const char *message);
void Serial_InterfaceProcess(void);
MOBLEUINT8 Serial_CharToHexConvert(char addr);
diff --git a/Middlewares/ST/STM32_WPAN/ble/mesh/Library/libBle_Mesh_CM4_GCC.a b/Middlewares/ST/STM32_WPAN/ble/mesh/Library/libBle_Mesh_CM4_GCC.a
index e9dac3f38..a21405272 100644
--- a/Middlewares/ST/STM32_WPAN/ble/mesh/Library/libBle_Mesh_CM4_GCC.a
+++ b/Middlewares/ST/STM32_WPAN/ble/mesh/Library/libBle_Mesh_CM4_GCC.a
Binary files differ
diff --git a/Middlewares/ST/STM32_WPAN/ble/mesh/Library/libBle_Mesh_CM4_IAR.a b/Middlewares/ST/STM32_WPAN/ble/mesh/Library/libBle_Mesh_CM4_IAR.a
index 895fe8ac0..d1d21c137 100644
--- a/Middlewares/ST/STM32_WPAN/ble/mesh/Library/libBle_Mesh_CM4_IAR.a
+++ b/Middlewares/ST/STM32_WPAN/ble/mesh/Library/libBle_Mesh_CM4_IAR.a
Binary files differ
diff --git a/Middlewares/ST/STM32_WPAN/ble/mesh/Library/libBle_Mesh_CM4_Keil.lib b/Middlewares/ST/STM32_WPAN/ble/mesh/Library/libBle_Mesh_CM4_Keil.lib
index a8889500b..d499334d3 100644
--- a/Middlewares/ST/STM32_WPAN/ble/mesh/Library/libBle_Mesh_CM4_Keil.lib
+++ b/Middlewares/ST/STM32_WPAN/ble/mesh/Library/libBle_Mesh_CM4_Keil.lib
Binary files differ
diff --git a/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/blob.h b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/blob.h
new file mode 100644
index 000000000..08af6f55e
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/blob.h
@@ -0,0 +1,258 @@
+/**
+******************************************************************************
+* @file blob.h
+* @author BLE Mesh Team
+* @version V1.10.000
+* @date 15-May-2019
+* @brief BLE-Mesh Block transfer Server implementation header file
+******************************************************************************
+* @attention
+*
+* <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
+*
+* Redistribution and use in source and binary forms, with or without modification,
+* are permitted provided that the following conditions are met:
+* 1. Redistributions of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+* 3. Neither the name of STMicroelectronics nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+* Initial BlueNRG-Mesh is built over Motorolas Mesh over Bluetooth Low Energy
+* (MoBLE) technology. The present solution is developed and maintained for both
+* Mesh library and Applications solely by STMicroelectronics.
+*
+******************************************************************************
+*/
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __BLOB_H
+#define __BLOB_H
+
+/* Includes ------------------------------------------------------------------*/
+#include "types.h"
+#include "bluenrg_mesh.h"
+
+/* Exported macro ------------------------------------------------------------*/
+
+/******************************************************************************/
+/********** Following Section defines the Opcodes for the Messages ************/
+/* 7.1.1 Numerical summary of opcodes **/
+/******************************************************************************/
+
+#define BLOB_TRANSFER_GET 0XB701
+#define BLOB_TRANSFER_START 0XB702
+#define BLOB_TRANSFER_CANCEL 0XB703
+#define BLOB_TRANSFER_STATUS 0XB704
+#define BLOB_BLOCK_GET 0XB707
+#define BLOB_BLOCK_START 0XB705
+#define BLOB_BLOCK_STATUS 0X7E
+#define BLOB_CHUNK_TRANSFER 0X7D
+#define BLOB_INFORMATION_GET 0XB70A
+#define BLOB_INFORMATION_STATUS 0XB70B
+
+/******************************************************************************/
+/* 7.1.2 Summary of status codes **/
+/******************************************************************************/
+
+typedef enum {
+ BLOB_SUCCESS_STATUS,
+ BLOB_OUT_OF_SEQUENCE_BLOCK_NUMBER_STATUS,
+ BLOB_INVALID_BLOCK_NUMBER_STATUS,
+ BLOB_WRONG_BLOCK_SIZE_STATUS,
+ BLOB_WRONG_CHUNK_SIZE_STATUS,
+ BLOB_INVALID_STATE_STATUS,
+ BLOB_INVALID_PARAMETER_STATUS,
+ BLOB_WRONG_BLOB_ID_STATUS,
+ BLOB_STORAGE_LIMIT_STATUS,
+ BLOB_PROHIBITED_MIN_STATUS,
+ BLOB_PROHIBITED_MAX_STATUS = 0x3F,
+} BLOB_Status_types_t;
+
+//#define BLOB_SUCCESS_STATUS 0x00
+//#define BLOB_OUT_OF_SEQUENCE_BLOCK_NUMBER_STATUS 0x01
+//#define BLOB_INVALID_BLOCK_NUMBER_STATUS 0x02
+//#define BLOB_WRONG_BLOCK_SIZE_STATUS 0x03
+//#define BLOB_WRONG_CHUNK_SIZE_STATUS 0x04
+//#define BLOB_INVALID_STATE_STATUS 0x05
+//#define BLOB_INVALID_PARAMETER_STATUS 0x06
+//#define BLOB_WRONG_BLOB_ID_STATUS 0x07
+//#define BLOB_STORAGE_LIMIT_STATUS 0x08
+//#define BLOB_PROHIBITED_MIN_STATUS 0x09
+//#define BLOB_PROHIBITED_MAX_STATUS 0x3F
+
+/******************************************************************************/
+/* 7.1.4.1 BLOB Transfer Phase ***/
+/******************************************************************************/
+
+//#define BLOB_IDLE_STATE 0x00
+//#define BLOB_WAITING_FOR_NEXT_BLOCK_STATE 0x01
+//#define BLOB_WAITING_FOR_NEXT_CHUNK_STATE 0x02
+//#define BLOB_COMPLETE_STATE 0x03
+//#define BLOB_SUSPENDED_STATE 0x04
+//#define BLOB_INACTIVE_STATE 0x05
+//#define BLOB_PROHIBITED_MIN_STATE 0x06
+//#define BLOB_PROHIBITED_MAX_STATE 0xFF
+
+typedef enum {
+ BLOB_IDLE_STATE, //0x00
+ BLOB_WAITING_FOR_NEXT_BLOCK_STATE, //0x01
+ BLOB_WAITING_FOR_NEXT_CHUNK_STATE, //0x02
+ BLOB_COMPLETE_STATE, //0x03
+ BLOB_SUSPENDED_STATE, //0x04
+ BLOB_INACTIVE_STATE, //0x05
+ BLOB_PROHIBITED_MIN_STATE, //0x06
+ BLOB_PROHIBITED_MAX_STATE = 0xFF, //0xFF
+} BLOB_Transfer_Phase_types_t;
+
+/******************************************************************************/
+/********** Following Section defines the SIG MODEL IDs ************/
+/******************************************************************************/
+#define BLOB_TRANSFER_MODEL_SERVER 0XFF00
+#define BLOB_TRANSFER_MODEL_CLIENT 0XFF01
+
+/******************************************************************************/
+/********** SIG MODEL IDs ends ************/
+/******************************************************************************/
+
+#define BLOB_ID_SIZE 8
+#define BLOB_MAX_FILE_SIZE (256*1024) /* This is for 256K Bytes */
+#define BLOB_MIN_BLOCK_SIZE (1*1024) /* 1024 means = 1K block size for simplicity */
+#define BLOB_MAX_BLOCK_SIZE (1*1024) /* Min and Max kept same for simplicity */
+#define BLOB_MAX_BLOCK_NUMBER (BLOB_MAX_FILE_SIZE/BLOB_MIN_BLOCK_SIZE)
+#define BLOB_MAX_BLOCK_BITMAP_BYTE_SIZE ((uint16_t) (BLOB_MAX_BLOCK_NUMBER+7)/ 8 ) /* Number of bits required to represent maximum block number */
+
+#define BLOB_MAX_CHUNK_SIZE (128)
+#define BLOB_MAX_CHUNK_NUMBER ( BLOB_MAX_BLOCK_SIZE/BLOB_MAX_CHUNK_SIZE )
+#define BLOB_MAX_CHUNK_BITMAP_BYTE_SIZE ( (uint16_t) (BLOB_MAX_CHUNK_NUMBER+7)/8 ) /* Make it round number of bytes */
+
+#define BLOB_MIN_BLOCK_SIZE_LOG 10 /* 2^10 = 1024 */
+#define BLOB_MAX_BLOCK_SIZE_LOG 10 /* 2^10 = 1024 */
+
+#define BLOB_NON_SEQUENTIAL_BLOCK_RECEPTION 0x00 /* If a bit is set, the
+ functionality is supported, for simplicity, we expect linear blocks */
+
+
+
+typedef enum {
+ ALL_CHUNKS_MISSING =0x00,
+ NO_MISSING_CHUNKS = 0x01,
+ SOME_CHUNKS_MISSING = 0x02,
+ FORMAT_PROHIBITED =0x03,
+} format_types_t;
+
+
+
+#pragma pack(1)
+typedef struct
+{
+ MOBLEUINT8 blob_id[BLOB_ID_SIZE];
+ MOBLEUINT32 blob_size;
+ MOBLEUINT8 blob_block_size_log;
+ MOBLEINT16 mtu_size;
+ MOBLEINT16 Timeout;
+} _Blob_Transfer_Param_t;
+
+
+#pragma pack(1)
+typedef struct
+{
+ MOBLEINT16 Block_Number;
+ MOBLEINT16 Chunk_Size;
+} Blob_Block_Param_t;
+
+
+typedef union {
+ _Blob_Transfer_Param_t uBlob_Transfer_param;
+ MOBLEUINT8 pBlob_Transfer_Param[sizeof(_Blob_Transfer_Param_t)];
+}Blob_Transfer_param_t;
+
+
+typedef struct
+{
+ uint8_t Status : 6;
+ uint8_t Padding : 2;
+ uint8_t Phase;
+ uint8_t blob_id[BLOB_ID_SIZE]; /* Optional: C.1: If the BLOB ID field is
+ present, then the BLOB Size field may be
+ present; otherwise this field shall not be present. */
+ uint32_t BLOB_Size; /* C.2: If the BLOB Size field is present,
+ then the BLOB Block Size Log, Client MTU Size,
+ Timeout, and Blocks Not Received fields shall be present;
+ otherwise these fields shall not be present. */
+ uint8_t BLOB_Block_Size_Log;
+ uint16_t Client_MTU_Size;
+ uint16_t Timeout;
+ uint8_t Blocks_Not_Received_Variable[BLOB_MAX_BLOCK_BITMAP_BYTE_SIZE];
+} Transfer_Status_data_t;
+
+typedef struct
+{
+ uint8_t Status :6; // Status code of the block transfer
+ uint8_t Format :2; // Indicates the format used to report missing chunks
+ uint16_t Block_Number; // 16 Blocks number in a set of blocks
+ uint16_t Chunk_Size; // 16 Chunk Size in bytes for this block
+ uint8_t Missing_Chunks_Variable[BLOB_MAX_CHUNK_BITMAP_BYTE_SIZE]; // Bit field of missing chunks for this block (C.1)
+} BLOB_Block_Status_t;
+
+
+typedef struct
+{
+ uint8_t Min_Block_Size_Log; //1 Minimum block size: 2(Min Block Size Log)
+ uint8_t Max_Block_Size_Log; //1 Maximum block size: 2(Max Block Size Log)
+ uint16_t Max_Chunks_Number; //2 Maximum number of chunks in block
+ uint16_t Max_Chunk_Size; //2 Maximum size of chunk supported by the server
+ uint32_t Max_BLOB_Size; //4 Maximum BLOB size supported by the server
+ uint16_t MTU_size; //2 Maximum payload size supported by the server
+ uint8_t Functionalities; //1 Bitmask of functionalities supported
+} BLOB_Information_Status_t;
+
+MOBLE_RESULT Mbt_ModelServer_GetOpcodeTableCb(const MODEL_OpcodeTableParam_t **data,
+ MOBLEUINT16 *length);
+
+MOBLE_RESULT Mbt_ModelServer_GetStatusRequestCb(MOBLE_ADDRESS peer_addr,
+ MOBLE_ADDRESS dst_peer,
+ MOBLEUINT16 opcode,
+ MOBLEUINT8 *pResponsedata,
+ MOBLEUINT32 *plength,
+ MOBLEUINT8 const *pRxData,
+ MOBLEUINT32 dataLength,
+ MOBLEBOOL response);
+
+MOBLE_RESULT Mbt_ModelServer_ProcessMessageCb(MOBLE_ADDRESS peer_addr,
+ MOBLE_ADDRESS dst_peer,
+ MOBLEUINT16 opcode,
+ MOBLEUINT8 const *pRxData,
+ MOBLEUINT32 dataLength,
+ MOBLEBOOL response);
+
+
+MOBLE_RESULT BLOB_Transfer_Get(MOBLEUINT8 const*, MOBLEUINT32);
+MOBLE_RESULT BLOB_Transfer_Start(MOBLEUINT8 const*, MOBLEUINT32 );
+MOBLE_RESULT BLOB_Transfer_Cancel(MOBLEUINT8 const*, MOBLEUINT32 );
+MOBLE_RESULT BLOB_Block_Get(MOBLEUINT8 const*, MOBLEUINT32);
+MOBLE_RESULT BLOB_Block_Start(MOBLEUINT8 const*, MOBLEUINT32 );
+MOBLE_RESULT BLOB_Chunk_Transfer(MOBLEUINT8 const* , MOBLEUINT32 );
+MOBLE_RESULT BLOB_Information_Get(MOBLEUINT8 const*, MOBLEUINT32);
+MOBLE_RESULT BLOB_Transfer_Status(MOBLEUINT8 const *pMsgData, MOBLEUINT32* plength);
+MOBLE_RESULT BLOB_Block_Status(MOBLEUINT8 const *pMsgData, MOBLEUINT32* plength);
+MOBLE_RESULT BLOB_Information_Status(MOBLEUINT8 const *pMsgData, MOBLEUINT32* plength);
+
+#endif /* __BLOB_H */
+
+/******************* (C) COPYRIGHT 2017 STMicroelectronics *****END OF FILE****/
+
diff --git a/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/common.h b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/common.h
index 9899383f8..12527cdd9 100644
--- a/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/common.h
+++ b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/common.h
@@ -38,8 +38,8 @@
*
******************************************************************************
*/
-#ifndef __MODEL_COMMON_H
-#define __MODEL_COMMON_H
+#ifndef __COMMON_H
+#define __COMMON_H
/* Includes ------------------------------------------------------------------*/
#include "types.h"
@@ -50,6 +50,7 @@
#define GENERIC_VALID_FLAG_OFFSET 0
#define GENERIC_ON_OFF_NVM_OFFSET 1
#define GENERIC_LEVEL_NVM_OFFSET 2
+#define GENERIC_POWER_ON_OFF_NVM_OFFSET 4
/* 16 bytes are reserved for light
* Light model nvm offset is 16 bytes ahead of generic model */
#define LIGHT_VALID_FLAG_OFFSET 0
@@ -57,6 +58,20 @@
#define LIGHT_CTL_NVM_OFFSET 3
#define LIGHT_HSL_NVM_OFFSET 7
+/* Buffer index limit for the generic data */
+#define GENERIC_DATA_LIMIT 15
+
+#define FLAG_SET 1
+#define FLAG_RESET 0
+
+#define VALUE_UPDATE_SET 0X01
+#define VALUE_UPDATE_RESET 0X00
+
+#define CLK_FLAG_ENABLE 1
+#define CLK_FLAG_DISABLE 0
+
+#define PWM_ZERO_VALUE 1
+
typedef MOBLE_RESULT (*APPLI_SAVE_MODEL_STATE_CB)(MOBLEUINT8* stateBuff, MOBLEUINT8 size);
/** @addtogroup MODEL_GENERIC
@@ -69,13 +84,14 @@ typedef MOBLE_RESULT (*APPLI_SAVE_MODEL_STATE_CB)(MOBLEUINT8* stateBuff, MOBLEUI
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
-
+#pragma pack(1)
typedef struct displayFloatToInt_s
{
MOBLEINT8 sign; /* 0 means positive, 1 means negative*/
MOBLEUINT32 out_int;
MOBLEUINT32 out_dec;
} displayFloatToInt_t;
+#pragma pack(4)
MOBLE_RESULT Chk_OptionalParamValidity(MOBLEUINT8 param_length, MOBLEUINT8
mandatory_length, MOBLEUINT8 param,
@@ -109,6 +125,14 @@ MOBLEUINT16 PWM_CoolValue(float colourValue ,float brightValue);
MOBLEUINT16 PWM_WarmValue(float colourValue ,float brightValue);
void floatToInt(float in, displayFloatToInt_t *out_value, MOBLEINT32 dec_prec);
void TraceHeader(const char* func_name, int mode);
-/* MOBLE_RESULT SaveModelsStateNvm(MOBLEUINT8 flag); */
+MOBLE_RESULT SaveModelsStateNvm(MOBLEUINT8 flag);
+MOBLEUINT8 BLE_GetElementNumber(void);
+
+void Test_Process(void);
+void ModelSave_Process(void);
+void BLEMesh_PacketResponseTime(MOBLEUINT8 *testFunctionParm);
+MOBLEUINT8 BLE_waitPeriod(MOBLEUINT32 waitPeriod);
+MOBLEUINT8 Time_Conversion(MOBLEUINT32 lc_Time);
+void Model_RestoreStates(MOBLEUINT8 const *pModelState_Load, MOBLEUINT8 size);
#endif
diff --git a/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/generic.h b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/generic.h
index 5acac43f2..0d7e3c890 100644
--- a/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/generic.h
+++ b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/generic.h
@@ -56,96 +56,95 @@
/* 7.1 Messages summary Page 298 */
/* Generic OnOff Server Model Opcode */
-#define GENERIC_ON_OFF_GET 0x8201
-#define GENERIC_ON_OFF_SET_ACK 0x8202
-#define GENERIC_ON_OFF_SET_UNACK 0x8203
-#define GENERIC_ON_OFF_STATUS 0x8204
+#define GENERIC_ON_OFF_GET 0x8201
+#define GENERIC_ON_OFF_SET_ACK 0x8202
+#define GENERIC_ON_OFF_SET_UNACK 0x8203
+#define GENERIC_ON_OFF_STATUS 0x8204
/* Generic Level Server Model Opcode */
-#define GENERIC_LEVEL_GET 0x8205
-#define GENERIC_LEVEL_SET_ACK 0x8206
-#define GENERIC_LEVEL_SET_UNACK 0x8207
-#define GENERIC_LEVEL_STATUS 0x8208
-#define GENERIC_LEVEL_DELTA_SET 0x8209
-#define GENERIC_LEVEL_DELTA_SET_UNACK 0x820A
-#define GENERIC_LEVEL_DELTA_MOVE_SET 0x820B
-#define GENERIC_LEVEL_DELTA_MOVE_SET_UNACK 0x820C
-#define GENERIC_LEVEL_DELTA_MOVE_SET_UNACK 0x820C
+#define GENERIC_LEVEL_GET 0x8205
+#define GENERIC_LEVEL_SET_ACK 0x8206
+#define GENERIC_LEVEL_SET_UNACK 0x8207
+#define GENERIC_LEVEL_STATUS 0x8208
+#define GENERIC_LEVEL_DELTA_SET 0x8209
+#define GENERIC_LEVEL_DELTA_SET_UNACK 0x820A
+#define GENERIC_LEVEL_DELTA_MOVE_SET 0x820B
+#define GENERIC_LEVEL_DELTA_MOVE_SET_UNACK 0x820C
/* Generic Default Transition Time Server Model Opcode */
-#define GENERIC_DEFAULT_TRANSITION_TIME_GET 0x820D
-#define GENERIC_DEFAULT_TRANSITION_TIME_SET 0x820E
-#define GENERIC_DEFAULT_TRANSITION_TIME_SET_UNACK 0x820F
-#define GENERIC_DEFAULT_TRANSITION_TIME_STATUS 0x8210
+#define GENERIC_DEFAULT_TRANSITION_TIME_GET 0x820D
+#define GENERIC_DEFAULT_TRANSITION_TIME_SET 0x820E
+#define GENERIC_DEFAULT_TRANSITION_TIME_SET_UNACK 0x820F
+#define GENERIC_DEFAULT_TRANSITION_TIME_STATUS 0x8210
/* Generic Power OnOff Server Model Opcode */
-#define GENERIC_ONPOWERUP_GET 0x8211
-#define GENERIC_ONPOWERUP_STATUS 0x8212
+#define GENERIC_POWER_ON_OFF_GET 0x8211
+#define GENERIC_POWER_ON_OFF_STATUS 0x8212
/* Generic Power OnOff Setup Server Model Opcode */
-#define GENERIC_ONPOWERUP_SET 0x8213
-#define GENERIC_ONPOWERUP_SET_UNACK 0x8214
+#define GENERIC_POWER_ON_OFF_SET 0x8213
+#define GENERIC_POWER_ON_OFF_SET_UNACK 0x8214
/* Generic Power Level Server Model Opcode */
-#define GENERIC_POWER_LEVEL_GET 0X8215
-#define GENERIC_POWER_LEVEL_SET 0X8216
-#define GENERIC_POWER_LEVEL_SET_UNACK 0X8217
-#define GENERIC_POWER_LEVEL_STATUS 0X8218
-#define GENERIC_POWER_LAST_GET 0X8219
-#define GENERIC_POWER_LAST_STATUS 0X821A
-#define GENERIC_POWER_DEFAULT_GET 0X821B
-#define GENERIC_POWER_DEFAULT_STATUS 0X821C
-#define GENERIC_POWER_RANGE_GET 0X821D
-#define GENERIC_POWER_RANGE_STATUS 0X821E
+#define GENERIC_POWER_LEVEL_GET 0X8215
+#define GENERIC_POWER_LEVEL_SET 0X8216
+#define GENERIC_POWER_LEVEL_SET_UNACK 0X8217
+#define GENERIC_POWER_LEVEL_STATUS 0X8218
+#define GENERIC_POWER_LAST_GET 0X8219
+#define GENERIC_POWER_LAST_STATUS 0X821A
+#define GENERIC_POWER_DEFAULT_GET 0X821B
+#define GENERIC_POWER_DEFAULT_STATUS 0X821C
+#define GENERIC_POWER_RANGE_GET 0X821D
+#define GENERIC_POWER_RANGE_STATUS 0X821E
/* Generic Power Level Setup Server Model Opcode */
-#define GENERIC_POWER_DEFAULT_SET 0X821F
-#define GENERIC_POWER_DEFAULT_SET_UNACK 0X8220
-#define GENERIC_POWER_RANGE_SET 0X8221
-#define GENERIC_POWER_RANGE_SET_UNACK 0X8222
+#define GENERIC_POWER_DEFAULT_SET 0X821F
+#define GENERIC_POWER_DEFAULT_SET_UNACK 0X8220
+#define GENERIC_POWER_RANGE_SET 0X8221
+#define GENERIC_POWER_RANGE_SET_UNACK 0X8222
/* Generic Battery Server Model Opcode */
-#define GENERIC_BATTERY_GET 0X8223
-#define GENERIC_BATTERY_STATUS 0X8224
+#define GENERIC_BATTERY_GET 0X8223
+#define GENERIC_BATTERY_STATUS 0X8224
/* Generic Location Server Model Opcode */
-#define GENERIC_LOCATION_GLOBAL_GET 0X8225
-#define GENERIC_LOCATION_GLOBAL_STATUS 0X40
-#define GENERIC_LOCATION_LOCAL_GET 0X8226
-#define GENERIC_LOCATION_LOCAL_STATUS 0X8227
+#define GENERIC_LOCATION_GLOBAL_GET 0X8225
+#define GENERIC_LOCATION_GLOBAL_STATUS 0X40
+#define GENERIC_LOCATION_LOCAL_GET 0X8226
+#define GENERIC_LOCATION_LOCAL_STATUS 0X8227
/* Generic Location Setup Server Model Opcode */
-#define GENERIC_LOCATION_GLOBAL_SET 0X41
-#define GENERIC_LOCATION_GLOBAL_SET_UNACK 0X42
-#define GENERIC_LOCATION_LOCAL_SET 0X8228
-#define GENERIC_LOCATION_LOCAL_SET_UNACK 0X8229
+#define GENERIC_LOCATION_GLOBAL_SET 0X41
+#define GENERIC_LOCATION_GLOBAL_SET_UNACK 0X42
+#define GENERIC_LOCATION_LOCAL_SET 0X8228
+#define GENERIC_LOCATION_LOCAL_SET_UNACK 0X8229
/* Generic Manufacturer Property Server Model Opcode */
-#define GENERIC_MANUFACTURER_PROPERTIES_GET 0X822A
-#define GENERIC_MANUFACTURER_PROPERTIES_STATUS 0X43
-#define GENERIC_MANUFACTURER_PROPERTY_GET 0X822B
-#define GENERIC_MANUFACTURER_PROPERTY_SET 0X44
-#define GENERIC_MANUFACTURER_PROPERTY_SET_UNACK 0X45
-#define GENERIC_MANUFACTURER_PROPERTY_STATUS 0X46
+#define GENERIC_MANUFACTURER_PROPERTIES_GET 0X822A
+#define GENERIC_MANUFACTURER_PROPERTIES_STATUS 0X43
+#define GENERIC_MANUFACTURER_PROPERTY_GET 0X822B
+#define GENERIC_MANUFACTURER_PROPERTY_SET 0X44
+#define GENERIC_MANUFACTURER_PROPERTY_SET_UNACK 0X45
+#define GENERIC_MANUFACTURER_PROPERTY_STATUS 0X46
/* Generic Admin Property Server Model Opcode */
-#define GENERIC_ADMIN_PROPERTIES_GET 0X822C
-#define GENERIC_ADMIN_PROPERTIES_STATUS 0X47
-#define GENERIC_ADMIN_PROPERTY_GET 0X822D
-#define GENERIC_ADMIN_PROPERTY_SET 0X48
-#define GENERIC_ADMIN_PROPERTY_SET_UNACK 0X49
-#define GENERIC_ADMIN_PROPERTY_STATUS 0X4A
+#define GENERIC_ADMIN_PROPERTIES_GET 0X822C
+#define GENERIC_ADMIN_PROPERTIES_STATUS 0X47
+#define GENERIC_ADMIN_PROPERTY_GET 0X822D
+#define GENERIC_ADMIN_PROPERTY_SET 0X48
+#define GENERIC_ADMIN_PROPERTY_SET_UNACK 0X49
+#define GENERIC_ADMIN_PROPERTY_STATUS 0X4A
/* Generic User Property Server Model Opcode */
-#define GENERIC_USER_PROPERTIES_GET 0X822E
-#define GENERIC_USER_PROPERTIES_STATUS 0X4B
-#define GENERIC_USER_PROPERTY_GET 0X822F
-#define GENERIC_USER_PROPERTY_SET 0X4C
-#define GENERIC_USER_PROPERTY_SET_UNACK 0X4D
-#define GENERIC_USER_PROPERTY_STATUS 0X4E
+#define GENERIC_USER_PROPERTIES_GET 0X822E
+#define GENERIC_USER_PROPERTIES_STATUS 0X4B
+#define GENERIC_USER_PROPERTY_GET 0X822F
+#define GENERIC_USER_PROPERTY_SET 0X4C
+#define GENERIC_USER_PROPERTY_SET_UNACK 0X4D
+#define GENERIC_USER_PROPERTY_STATUS 0X4E
/******************************************************************************/
/********** Following Section defines the SERVER SIG MODEL IDs ************/
@@ -195,6 +194,17 @@
#define STEP_HEX_VALUE_2 0X02
#define STEP_HEX_VALUE_3 0X03
+/****Generic Power on off states****/
+#define GENERIC_POWER_OFF_STATE 0X00
+#define GENERIC_POWER_ON_STATE 0X01
+#define GENERIC_POWER_RESTORE_STATE 0X02
+
+#define LEVEL_MIN_VALID_RANGE 0x00
+#define LEVEL_MAX_VALID_RANGE 0x7FFF
+
+#define TRANSITION_MIN_VALID_RANGE 0x00
+#define TRANSITION_MAX_VALID_RANGE 0xFE
+
#define MAX_BATTERY_LEVEL 0X64
#define PROHIBITED_MIN_BATTERY_LEVEL 0X65
#define PROHIBITED_MAX_BATTERY_LEVEL 0XFE
@@ -212,11 +222,19 @@
#define APPLI_LED_OFF 0X00
#define APPLI_LED_ON 0X01
-#define PWM_LEVEL_OFF 0X00
-#define PWM_LEVEL_FULL 0X7FFD
+#define INTENSITY_LEVEL_ZERO 0X00
+#define INTENSITY_LEVEL_FULL 31990U
+
+#define NO_TRANSITION 0X01
+#define IN_TRANSITION 0X02
+#define DEFAULT_TRANSITION 0X03
+
+#define GENERIC_ON_OFF_NVM_FLAG 0X01
+#define GENERIC_LEVEL_NVM_FLAG 0X02
-#define GENERIC_ON_OFF_FLAG 0X01
-#define GENERIC_LEVEL_FLAG 0X02
+#define GENERIC_TRANSITION_STOP 0X00
+#define GENERIC_ON_OFF_TRANSITION_START 0X01
+#define GENERIC_LEVEL_TRANSITION_START 0X02
#define PACKET_CACHE_SIZE 2
/* Exported variables ------------------------------------------------------- */
@@ -231,7 +249,6 @@ typedef struct
} Generic_TemporaryStatus_t;
/*****************************************************/
/* Transition time variables */
-#pragma pack(1)
typedef struct
{
MOBLEINT8 StepValue ;
@@ -241,17 +258,14 @@ typedef struct
}Generic_TimeParam_t;
/* Transition Flag variables */
-#pragma pack(1)
typedef struct
{
MOBLEUINT8 GenericTransitionFlag;
MOBLEUINT8 GenericOptionalParam;
- MOBLEUINT8 GenericTransitionEnd;
}Generic_ModelFlag_t;
/*****************************************************/
/* Generic On Off state Messages */
-#pragma pack(1)
typedef struct
{
MOBLEUINT8 TargetOnOffState;
@@ -260,16 +274,15 @@ typedef struct
MOBLEUINT8 Delay_Time;
} Generic_OnOffParam_t;
-#pragma pack(1)
typedef struct
{
- MOBLEUINT16 Present_OnOff;
+ MOBLEUINT8 Present_OnOff_State;
+ MOBLEUINT16 Present_OnOff_Value;
MOBLEUINT16 Target_OnOff;
MOBLEUINT8 RemainingTime;
}Generic_OnOffStatus_t;
/* Generic Level state Messages */
-#pragma pack(1)
typedef struct
{
MOBLEINT16 TargetLevel;
@@ -278,7 +291,6 @@ typedef struct
MOBLEUINT8 Delay_Time;
} Generic_LevelParam_t;
-#pragma pack(1)
typedef struct
{
MOBLEINT16 Present_Level16;
@@ -288,7 +300,6 @@ typedef struct
MOBLEINT16 Last_Present_Level16;
}Generic_LevelStatus_t;
-#pragma pack(1)
typedef struct
{
MOBLEINT32 TargetDeltaLevel32;
@@ -297,7 +308,6 @@ typedef struct
MOBLEUINT8 Delay_Time;
} Generic_DeltaLevelParam_t;
-#pragma pack(1)
typedef struct
{
MOBLEUINT16 TargetMoveLevel16;
@@ -305,26 +315,27 @@ typedef struct
MOBLEUINT8 Transition_Time;
MOBLEUINT8 Delay_Time;
} Generic_LevelMoveParam_t;
+/******************************************************/
+/* Generic Power on off messages*/
+typedef struct
+{
+ MOBLEUINT8 PowerOnOffState;
+}Generic_PowerOnOffParam_t;
-
-/** \brief Callback map for application from middle layer .
- this will call the function related to the function pointer in the
- model_if.c file
- const Appli_Generic_cb_t GenericAppli_cb =
+/******************************************************/
+/* Generic Default transition time messages*/
+typedef struct
{
- Appli_Generic_OnOff_Set,
- Appli_Generic_Level_Set,
- Appli_Generic_LevelDelta_Set,
- Appli_Generic_LevelMove_Set,
- };
+ MOBLEUINT8 DefaultTransitionTime;
+}Generic_DefaultTransitionParam_t;
-**/
typedef struct
{
/* Pointer to the function Appli_Generic_OnOff_Set used for callback
from the middle layer to Application layer
*/
MOBLE_RESULT (*OnOff_Set_cb)(Generic_OnOffStatus_t*, uint8_t);
+
/* Pointer to the function Appli_Generic_Level_Set used for callback
from the middle layer to Application layer
*/
@@ -339,29 +350,33 @@ typedef struct
from the middle layer to Application layer
*/
MOBLE_RESULT (*LevelDeltaMove_Set_cb)(Generic_LevelStatus_t*, MOBLEUINT8);
+
+ /* Pointer to the function Appli_Generic_PowerOnOff_Set used for callback
+ from the middle layer to Application layer
+ */
+ MOBLE_RESULT (*GenericPowerOnOff_cb)(Generic_PowerOnOffParam_t*, MOBLEUINT8);
+
+ /* Pointer to the function Generic_DefaultTransitionTime_Set used for callback
+ from the middle layer to Application layer
+ */
+ MOBLE_RESULT (*GenericDefaultTransition_cb)(Generic_DefaultTransitionParam_t*, MOBLEUINT8);
+
} Appli_Generic_cb_t;
-
-/** \brief Callback map for application from middle layer .
- this will call the function related to the function pointer in the
- model_if.c file
- These function are used to get the values of Parameters from application layer
- to the middle layer for processing.
- const Appli_Generic_State_cb_t Appli_GenericState_cb =
- {
- Appli_Generic_GetOnOffStatus,
- Appli_Generic_GetLevelStatus,
- };
-
-**/
typedef struct
{
MOBLE_RESULT (*GetOnOffStatus_cb)(MOBLEUINT8*);
+ MOBLE_RESULT (*GetOnOffValue_cb)(MOBLEUINT8*);
+
MOBLE_RESULT (*GetLevelStatus_cb)(MOBLEUINT8*);
+ MOBLE_RESULT (*GetPowerOnOffStatus_cb)(MOBLEUINT8*);
+
+ MOBLE_RESULT (*GetDefaultTransitionStatus_cb)(MOBLEUINT8*);
+
}Appli_Generic_State_cb_t;
-
+#pragma pack(4)
extern const Appli_Generic_State_cb_t Appli_GenericState_cb;
extern const Appli_Generic_cb_t GenericAppli_cb;
@@ -378,6 +393,10 @@ MOBLE_RESULT Generic_Level_Set(const MOBLEUINT8*, MOBLEUINT32);
MOBLE_RESULT Generic_LevelDelta_Set(const MOBLEUINT8*, MOBLEUINT32);
MOBLE_RESULT Generic_LevelMove_Set(const MOBLEUINT8*, MOBLEUINT32);
MOBLE_RESULT Generic_Level_Status(MOBLEUINT8* , MOBLEUINT32*);
+MOBLE_RESULT Generic_PowerOnOff_Set(const MOBLEUINT8*, MOBLEUINT32 length);
+MOBLE_RESULT Generic_PowerOnOff_Status(MOBLEUINT8*, MOBLEUINT32*);
+MOBLE_RESULT Generic_DefaultTransitionTime_Set(const MOBLEUINT8*, MOBLEUINT32 length);
+MOBLE_RESULT Generic_DefaultTransitionTime_Status(MOBLEUINT8 *pTransition_status , MOBLEUINT32 *plength);
MOBLE_RESULT GenericModelServer_GetOpcodeTableCb(const MODEL_OpcodeTableParam_t **data,
@@ -417,8 +436,16 @@ MOBLE_RESULT Generic_TransitionBehaviourMulti_Param(MOBLEUINT8 *GetValue);
MOBLE_RESULT GenericOnOffStateUpdate_Process(void);
MOBLE_RESULT GenericLevelStateUpdate_Process(void);
-MOBLE_RESULT Generic_SaveStateNvm(MOBLEUINT8 flag);
+void Generic_OnOffDefaultTransitionValue(void);
+void Generic_LevelDefaultTransitionValue(MOBLEUINT16 levelValue);
+
void Generic_RestoreStates(MOBLEUINT8 const *pModelState_Load, MOBLEUINT8 size);
+
+MOBLE_RESULT Generic_Client_OnOff_Status(MOBLEUINT8 const *pOnOff_status, MOBLEUINT32 plength);
+MOBLE_RESULT Generic_Client_Level_Status(MOBLEUINT8 const *plevel_status, MOBLEUINT32 plength);
+MOBLE_RESULT Generic_Client_PowerOnOff_Status(MOBLEUINT8 const *powerOnOff_status , MOBLEUINT32 plength);
+MOBLE_RESULT Generic_Client_DefaultTransitionTime_Status(MOBLEUINT8 const *pTransition_status , MOBLEUINT32 plength);
+
#endif /* __GENERIC_H */
/******************* (C) COPYRIGHT 2017 STMicroelectronics *****END OF FILE****/
diff --git a/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/light.h b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/light.h
index 5c00d41ae..45377dbe0 100644
--- a/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/light.h
+++ b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/light.h
@@ -40,8 +40,8 @@
*/
/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __LIGHT_MODEL_H
-#define __LIGHT_MODEL_H
+#ifndef __LIGHT_H
+#define __LIGHT_H
/* Includes ------------------------------------------------------------------*/
#include "types.h"
@@ -125,22 +125,6 @@
#define LIGHT_XYL_DEFAULT_SET_UNACK 0x828E
#define LIGHT_XYL_RANGE_SET 0x828F
#define LIGHT_XYL_RANGE_SET_UNACK 0x8290
-#define LIGHT_LC_MODE_GET 0x8291
-#define LIGHT_LC_MODE_SET 0x8292
-#define LIGHT_LC_MODE_SET_UNACK 0x8293
-#define LIGHT_LC_MODE_STATUS 0x8294
-#define LIGHT_LC_OM_GET 0x8295
-#define LIGHT_LC_OM_SET 0x8296
-#define LIGHT_LC_OM_SET_UNACK 0x8297
-#define LIGHT_LC_OM_STATUS 0x8298
-#define LIGHT_LC_LIGHT_ONOFF_GET 0x8299
-#define LIGHT_LC_LIGHT_ONOFF_SET 0x829A
-#define LIGHT_LC_LIGHT_ONOFF_SET_UNACK 0x829B
-#define LIGHT_LC_LIGHT_ONOFF_STATUS 0x829C
-#define LIGHT_LC_PROPERTY_GET 0x829D
-#define LIGHT_LC_PROPERTY_SET 0x62
-#define LIGHT_LC_PROPERTY_SET_UNACK 0x63
-#define LIGHT_LC_PROPERTY_STATUS 0x64
/******************************************************************************/
/********** Following Section defines the SIG MODEL IDs ************/
@@ -157,8 +141,6 @@
#define LIGHT_MODEL_SERVER_HSL_SATURATION_MODEL_ID 0x130B
#define LIGHT_MODEL_SERVER_XYL_MODEL_ID 0x130C
#define LIGHT_MODEL_SERVER_XYL_SETUP_MODEL_ID 0x130D
-#define LIGHT_MODEL_SERVER_LC_MODEL_ID 0x130F
-#define LIGHT_MODEL_SERVER_LC_SETUP_MODEL_ID 0x1310
/******************************************************************************/
/********** SIG MODEL IDs ends ************/
@@ -173,9 +155,6 @@
#define MAX_VALID_RANGE 0xFFFF
#define RANGE_INVALID_VALUE 0x00
-#define LEVEL_MIN_VALID_RANGE 0x00
-#define LEVEL_MAX_VALID_RANGE 0x7FFF
-
/* Macros for Ctl Temperature range value */
#define MIN_CTL_TEMP_RANGE 0X0320
#define MAX_CTL_TEMP_RANGE 0X4E20
@@ -189,11 +168,34 @@
#define BINDING_LIGHT_CTL_LIGHTNESS_SET 0X00
/* Macros used for light restore value */
-#define LIGHT_LIGHTNESS_FLAG 0X03
-#define LIGHT_CTL_FLAG 0X04
-#define LIGHT_HSL_FLAG 0X05
+#define LIGHT_LIGHTNESS_NVM_FLAG 0X03
+#define LIGHT_CTL_NVM_FLAG 0X04
+#define LIGHT_HSL_NVM_FLAG 0X05
+
+/* Define the following Macros to change the step resolution and step count value */
+#define TRANSITION_SCALER 1
+#define PWM_DEFAULT_VALUE 10000U
+#define PWM_VALUE_OFF 1
+
+/******************************************************************************/
+/* Macros are used to update the PWM state according to the condition. */
+#define RESUME_STATE 1
+#define RESET_STATE 2
+#define DEFAULT_STATE 3
+#define LOAD_STATE 4
+
+
+/* Macros for the Light model transition flag */
+#define LIGHT_TRANSITION_STOP 0X00
+#define LIGHT_LIGHTNESS_TRANSITION_START 0X01
+#define LIGHT_LINEAR_TRANSITION_START 0X02
+#define LIGHT_CTL_TRANSITION_START 0X03
+#define LIGHT_TEMPERATURE_TRANSITION_START 0X04
+#define LIGHT_HSL_TRANSITION_START 0X05
+#define LIGHT_HSL_HUE_TRANSITION_START 0X06
+#define LIGHT_HSL_SATURATION_TRANSITION_START 0X07
/* Exported variables ------------------------------------------------------- */
-/* Transition flog of models*/
+/* Transition flag of models*/
#pragma pack(1)
typedef struct
{
@@ -203,7 +205,6 @@ typedef struct
/**************************************/
/* Transitiojn time variables*/
-#pragma pack(1)
typedef struct
{
MOBLEINT8 StepValue ;
@@ -213,7 +214,6 @@ typedef struct
/**************************************/
/* Light Lightness message parameters*/
-#pragma pack(1)
typedef struct
{
MOBLEUINT16 TargetLightnessStatus;
@@ -223,7 +223,6 @@ typedef struct
MOBLEUINT8 Delay_Time;
} Light_LightnessParam_t;
-#pragma pack(1)
typedef struct
{
MOBLEUINT16 PresentValue16;
@@ -231,19 +230,16 @@ typedef struct
MOBLEUINT8 RemainingTime;
} Light_LightnessStatus_t;
-#pragma pack(1)
typedef struct
{
MOBLEUINT16 LightnessLastStatus;
} Light_LightnessLastParam_t;
-#pragma pack(1)
typedef struct
{
MOBLEUINT16 LightnessDefaultStatus;
} Light_LightnessDefaultParam_t;
-#pragma pack(1)
typedef struct
{
MOBLEUINT8 StatusCode;
@@ -253,7 +249,6 @@ typedef struct
/**************************************/
/* Light Ctl message parameters*/
-#pragma pack(1)
typedef struct
{
MOBLEUINT16 CTL_Lightness;
@@ -266,7 +261,6 @@ typedef struct
MOBLEUINT16 Last_Temperature;
}Light_CtlParam_t;
-#pragma pack(1)
typedef struct
{
MOBLEUINT16 PresentCtlLightness16;
@@ -278,7 +272,6 @@ typedef struct
MOBLEUINT8 RemainingTime;
}Light_CtlStatus_t;
-#pragma pack(1)
typedef struct
{
MOBLEUINT16 PresentParam_1;
@@ -291,7 +284,6 @@ typedef struct
}Light_TemporaryStatus_t;
/* Light CTL Temperature Range Parameter */
-#pragma pack(1)
typedef struct
{
MOBLEUINT8 StatusCode;
@@ -337,28 +329,6 @@ typedef struct
MOBLEUINT16 HslMaxSaturation16;
}Light_HslRangeParam_t;
/**************************************/
-
-
-/** \brief Callback map for application from middle layer .
- this will call the function related to the function pointer in the
- model_if.c file
- const Appli_Light_cb_t LightAppli_cb =
- {
- Appli_Light_Lightness_Set,
- Appli_Light_Lightness_Linear_Set,
- Appli_Light_Lightness_Default_Set,
- Appli_Light_Lightness_Range_Set,
- Appli_Light_Ctl_Set,
- Appli_Light_CtlTemperature_Set,
- Appli_Light_CtlTemperature_Range_Set,
- Appli_Light_CtlDefault_Set,
- Appli_Light_Hsl_Set,
- Appli_Light_HslHue_Set,
- Appli_Light_HslSaturation_Set,
- Appli_Light_HslDefault_Set,
- Appli_Light_HslRange_Set
- };
-**/
typedef struct
{
/* Pointer to the function Appli_Light_Lightness_Set used for callback
@@ -427,30 +397,6 @@ typedef struct
MOBLE_RESULT (*Light_HslRange_Set_cb)(Light_HslRangeParam_t*, MOBLEUINT8);
} Appli_Light_cb_t;
-
-/** \brief Callback map for application from middle layer .
- this will call the function related to the function pointer in the
- model_if.c file
- These function are used to get the values of Parameters from application layer
- to the middle layer for processing.
- const Appli_Light_GetStatus_cb_t Appli_Light_GetStatus_cb =
- {
- Appli_Light_GetLightnessStatus,
- Appli_Light_GetLightnessLinearStatus,
- Appli_Light_GetLightnessDefaultStatus,
- Appli_Light_GetLightnessRangeStatus,
- Appli_Light_GetCtlLightStatus,
- Appli_Light_GetCtlTemperatureStatus,
- Appli_Light_GetCtlTemperatureRange,
- Appli_Light_GetCtlDefaultStatus,
- Appli_Light_GetHslStatus,
- Appli_Light_GetHslHueStatus,
- Appli_Light_GetHslSaturationStatus,
- Appli_Light_GetHslHueRange,
- Appli_Light_GetHslSatRange
- };
-
-**/
typedef struct
{
@@ -468,6 +414,7 @@ typedef struct
MOBLE_RESULT (*GetLightHslHueRange_cb)(MOBLEUINT8*);
MOBLE_RESULT (*GetLightHslSatRange_cb)(MOBLEUINT8*);
}Appli_Light_GetStatus_cb_t;
+#pragma pack(4)
extern const Appli_Light_GetStatus_cb_t Appli_Light_GetStatus_cb;
@@ -528,16 +475,15 @@ MOBLE_RESULT LightModelServer_ProcessMessageCb(MOBLE_ADDRESS peer_addr,
void Lighting_Process(void);
MOBLE_RESULT BLEMesh_AddLightingModels(void);
-void Light_Linear_ActualImplicitBinding(MOBLEUINT8 bindingFlag);
void Light_BindingCtlToLightness_Actual(MOBLEUINT8 bindingFlag);
void Light_BindingTemperatureToTemperatureRange(void);
void LightActual_GenericOnOffBinding(Light_LightnessParam_t* lightActual);
void LightActual_GenericLevelBinding(Light_LightnessParam_t* lightActual);
void Light_CtlTemp_GenericLevelBinding(Light_CtlParam_t* bCtlTempParam);
-
+void Light_Linear_ActualImplicitBinding(MOBLEUINT8 bindingFlag ,MOBLEUINT32 length);
MOBLEUINT16 Light_Actual_LinearBinding(void);
-MOBLEUINT16 Light_Linear_ActualBinding(void);
+MOBLEUINT16 Light_Linear_ActualBinding(MOBLEUINT32 length);
void Light_Actual_RangeBinding(Light_LightnessParam_t* lightActual);
void Light_CtlTemperature_TempRangeBinding(Light_CtlParam_t* ctlTemperature);
void Light_HslHue_GenericLevelBinding(Light_HslParam_t* bHslHueParam);
@@ -561,9 +507,29 @@ MOBLE_RESULT LightHslHueStateUpdate_Process(void);
MOBLE_RESULT LightHslSaturationStateUpdate_Process(void);
void Light_HslHue_RangeBinding(Light_HslParam_t* bHslHueParam);
-MOBLE_RESULT Light_SaveStateNvm(MOBLEUINT8 flag);
void Light_RestoreStates(MOBLEUINT8 const *pModelState_Load, MOBLEUINT8 size);
+void Light_LightnessDefaultTransitionValue(Light_LightnessParam_t* pLightnessValue);
+void Light_CTLDefaultTransitionValue(Light_CtlParam_t* pCTLValue);
+void Light_CTLTemperatureDefaultTransitionValue(Light_CtlParam_t* pCTLValue);
+
+MOBLE_RESULT Light_Client_Lightness_Status(MOBLEUINT8 const *pLightness_status, MOBLEUINT32 pLength);
+MOBLE_RESULT Light_Client_Lightness_Linear_Status(MOBLEUINT8 const *pLightnessLinear_status, MOBLEUINT32 pLength);
+MOBLE_RESULT Light_Client_Lightness_Last_Status(MOBLEUINT8 const *pLightnessLast_status, MOBLEUINT32 pLength);
+MOBLE_RESULT Light_Client_Lightness_Default_Status(MOBLEUINT8 const *pLightnessDefault_status, MOBLEUINT32 pLength);
+MOBLE_RESULT Light_Client_Lightness_Range_Status(MOBLEUINT8 const *pLightnessRange_status, MOBLEUINT32 pLength);
+MOBLE_RESULT Light_Client_Ctl_Status(MOBLEUINT8 const *pLightCtl_status, MOBLEUINT32 pLength);
+MOBLE_RESULT Light_Client_CtlTemperature_Range_Status(MOBLEUINT8 const *pCtlTempRange_status, MOBLEUINT32 pLength);
+MOBLE_RESULT Light_Client_CtlDefault_Status(MOBLEUINT8 const *pCtlDefault_status, MOBLEUINT32 pLength);
+MOBLE_RESULT Light_Client_CtlTemperature_Status(MOBLEUINT8 const *pLightCtlTemp_status, MOBLEUINT32 pLength);
+MOBLE_RESULT Light_Client_Hsl_Status(MOBLEUINT8 const *pHsl_status, MOBLEUINT32 pLength);
+MOBLE_RESULT Light_Client_HslDefault_Status(MOBLEUINT8 const *pHslDefault_status, MOBLEUINT32 pLength);
+MOBLE_RESULT Light_Client_HslRange_Status(MOBLEUINT8 const *pHslRange_status, MOBLEUINT32 pLength);
+MOBLE_RESULT Light_Client_HslTarget_Status(MOBLEUINT8 const *pHslTarget_status, MOBLEUINT32 pLength);
+MOBLE_RESULT Light_Client_HslHue_Status(MOBLEUINT8 const *pHslHue_status, MOBLEUINT32 pLength);
+MOBLE_RESULT Light_Client_HslSaturation_Status(MOBLEUINT8 const *pHslSaturation_status, MOBLEUINT32 pLength);
+
+
#endif /* __LIGHT_MODEL_H */
/******************* (C) COPYRIGHT 2017 STMicroelectronics *****END OF FILE****/
diff --git a/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/light_lc.h b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/light_lc.h
new file mode 100644
index 000000000..17e82c412
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/light_lc.h
@@ -0,0 +1,316 @@
+/**
+******************************************************************************
+* @file light_control.h
+* @author BLE Mesh Team
+* @version V1.10.000
+* @date 15-Jan-2019
+* @brief Header file for the user application file
+******************************************************************************
+* @attention
+*
+* <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
+*
+* Redistribution and use in source and binary forms, with or without modification,
+* are permitted provided that the following conditions are met:
+* 1. Redistributions of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+* 3. Neither the name of STMicroelectronics nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+* Initial BLE-Mesh is built over Motorolas Mesh over Bluetooth Low Energy
+* (MoBLE) technology. The present solution is developed and maintained for both
+* Mesh library and Applications solely by STMicroelectronics.
+*
+******************************************************************************
+*/
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __LIGHT_LC_H
+#define __LIGHT_LC_H
+
+/* Includes ------------------------------------------------------------------*/
+#include "types.h"
+#include "ble_mesh.h"
+
+
+/* Exported macro ------------------------------------------------------------*/
+/******************************************************************************/
+/********** Following Section defines the Opcodes for the Messages ************/
+/******************************************************************************/
+#define LIGHT_LC_MODE_GET 0X8291
+#define LIGHT_LC_MODE_SET 0X8292
+#define LIGHT_LC_MODE_SET_UNACK 0X8293
+#define LIGHT_LC_MODE_STATUS 0X8294
+#define LIGHT_LC_OM_GET 0X8295
+#define LIGHT_LC_OM_SET 0X8296
+#define LIGHT_LC_OM_SET_UNACK 0X8297
+#define LIGHT_LC_OM_STATUS 0X8298
+#define LIGHT_LC_ON_OFF_GET 0X8299
+#define LIGHT_LC_ON_OFF_SET 0X829A
+#define LIGHT_LC_ON_OFF_SET_UNACK 0X829B
+#define LIGHT_LC_ON_OFF_STATUS 0X829C
+#define LIGHT_LC_PROPERTY_GET 0X829D
+#define LIGHT_LC_PROPERTY_SET 0X62
+#define LIGHT_LC_PROPERTY_SET_UNACK 0X63
+#define LIGHT_LC_PROPERTY_STATUS 0X64
+
+#define LIGHT_MODEL_SERVER_LC_MODEL_ID 0x130F
+#define LIGHT_MODEL_SERVER_LC_SETUP_MODEL_ID 0x1310
+
+#define LIGHT_LC_TRANSITION_STOP 0X00
+#define LIGHT_LC_ON_OFF_TRANSITION_START 0X01
+
+/* Property id for the light LC model */
+#define LIGHT_CONTROL_LUX_LEVEL_ON_ID 0X002B
+#define LIGHT_CONTROL_LUX_LEVEL_PROLONG_ID 0X002C
+#define LIGHT_CONTROL_LUX_LEVEL_STANDBY_ID 0X002D
+#define LIGHT_CONTROL_LIGHTNESS_ON_ID 0X002E
+#define LIGHT_CONTROL_LIGHTNESS_PROLONG_ID 0X002F
+#define LIGHT_CONTROL_LIGHTNESS_STANDBY_ID 0X0030
+#define LIGHT_CONTROL_REGULATOR_ACCURACY_ID 0X0031
+#define LIGHT_CONTROL_REGULATOR_KID_ID 0X0032
+#define LIGHT_CONTROL_REGULATOR_KIU_ID 0X0033
+#define LIGHT_CONTROL_REGULATOR_KPD_ID 0X0034
+#define LIGHT_CONTROL_REGULATOR_KPU_ID 0X0035
+#define LIGHT_CONTROL_TIME_FADE_ID 0X0036
+#define LIGHT_CONTROL_TIME_FADE_ON_ID 0X0037
+#define LIGHT_CONTROL_TIME_FADE_STANDBY_AUTO_ID 0X0038
+#define LIGHT_CONTROL_TIME_FADE_STANDBY_MANUAL_ID 0X0039
+#define LIGHT_CONTROL_TIME_PROLONG_ID 0X003B
+#define LIGHT_CONTROL_TIME_RUN_ON_ID 0X003C
+
+/* Exported variables ------------------------------------------------------- */
+#define LIGHT_CONTROL_AMBIENT_LUXLEVEL_ON 0XEA60
+#define LIGHT_CONTROL_AMBIENT_LUXLEVEL_PROLONG 0XC350
+#define LIGHT_CONTROL_AMBIENT_LUXLEVEL_STANDBY 0X0000
+#define LIGHT_CONTROL_LIGHTNESS_ON_VALUE 0xFFFF
+#define LIGHT_CONTROL_LIGHTNESS_PROLONG_VALUE 0xFFF/*0x7FFF*/
+#define LIGHT_CONTROL_LIGHTNESS_STANDBY_VALUE 0x01
+#define LIGHT_CONTROL_TIME_FADE_ON_VALUE 0x0a
+#define LIGHT_CONTROL_TIME_RUN_ON_VALUE 0x2710
+#define LIGHT_CONTROL_TIME_FADE_VALUE 0x0a
+#define LIGHT_CONTROL_TIME_PROLONG_VALUE 0X1388
+#define LIGHT_CONTROL_TIME_FADE_STANDBY_AUTO_VALUE 0x0a
+#define LIGHT_CONTROL_TIME_FADE_STANDBY_MANUAL_VALUE 0X0a
+#define LIGHT_CONTROL_KID 0X01
+#define LIGHT_CONTROL_KIU 0X02
+#define LIGHT_CONTROL_KPD 0X03
+#define LIGHT_CONTROL_KPU 0X04
+#define LIGHT_CONTROL_REGULATOR_ACCURACY_VALUE 0X100
+
+
+#define TRANSITION_STEP_VALUE 0X0A
+#define LC_MODE_ENABLE 0X01
+#define LC_MODE_DISABLE 0X00
+/* Light control mode messages*/
+#pragma pack(1)
+typedef struct
+{
+ MOBLEUINT8 LC_mode;
+ MOBLEUINT8 LC_OM;
+ MOBLEUINT8 Light_OnOff;
+ MOBLEUINT8 Tid;
+ MOBLEUINT8 Transition_Time;
+ MOBLEUINT8 Delay;
+}Light_LC_Param_t;
+
+typedef struct
+{
+ MOBLEUINT32 Property_Value;
+}Light_LC_Value_t;
+
+/* Property values for variable length */
+typedef struct
+{
+ MOBLEUINT16 Property_ID;
+ MOBLEUINT16 Property_Value_16;
+}
+Light_LC_PropertyTable16_t;
+
+typedef struct
+{
+ MOBLEUINT16 Property_ID;
+ float Property_Value_float;
+}
+Light_LC_PropertyTablefloat_t;
+
+typedef struct
+{
+ MOBLEUINT16 Property_ID;
+ MOBLEUINT16 Property_Value_8b;
+}
+Light_LC_PropertyTable8b_t;
+
+typedef struct
+{
+ MOBLEUINT16 Property_ID;
+ MOBLEUINT32 Property_Value_24b;
+}
+Light_LC_PropertyTable24b_t;
+
+
+/* Table for all the Property id and corresponding value */
+typedef struct {
+Light_LC_PropertyTable8b_t LC_PropertyTable8b[1];
+Light_LC_PropertyTable16_t LC_PropertyTable16b[3];
+Light_LC_PropertyTable24b_t LC_PropertyTable24b[9];
+Light_LC_PropertyTablefloat_t LC_PropertyTableFloat[4];
+}Light_Property_Table_t;
+
+typedef struct
+{
+ MOBLEUINT8 Present_OnOff_State;
+ MOBLEUINT16 Target_OnOff;
+ MOBLEUINT8 RemainingTime;
+}Light_LC_OnOffState_t;
+
+/* Transition time variables */
+typedef struct
+{
+ MOBLEINT8 StepValue ;
+ MOBLEUINT8 ResBitValue;
+ MOBLEUINT32 Res_Value;
+ MOBLEUINT32 TotalTime;
+}Light_LC_TimeParam_t;
+
+/* Transition Flag variables */
+typedef struct
+{
+ MOBLEUINT8 LightLcTransitionFlag;
+ MOBLEUINT8 LightLcOptionalParam;
+}Light_LC_ModelFlag_t;
+#pragma pack(4)
+
+/* Light LC state machine states */
+typedef enum
+{
+ LC_STANDBY,
+ LC_FADE_ON,
+ LC_RUN,
+ LC_FADE,
+ LC_PROLONG,
+ LC_FADE_STANDBY_AUTO,
+ LC_FADE_STANDBY_MANUAL
+}Lc_States_e;
+
+/* Light LC state machine states */
+typedef enum
+{
+ LC_NO_EVENT,
+ LC_LIGHT_ON,
+ LC_OCCUPANCY_ON,
+ LC_LIGHT_OFF,
+ LC_OCCUPANCY_OFF,
+ LC_TIMER_OFF
+}Lc_Event_e;
+
+typedef struct
+{
+ Lc_States_e Lc_States;
+}Light_LC_States;
+
+
+#pragma pack(1)
+typedef struct
+{
+ /* Pointer to the function Appli_LightLC_Mode_Set used for callback
+ from the middle layer to Application layer
+ */
+ MOBLE_RESULT (*LightLC_Mode_Set_cb)(Light_LC_Param_t*, MOBLEUINT8);
+
+ /* Pointer to the function Appli_LightLC_OM_Set used for callback
+ from the middle layer to Application layer
+ */
+ MOBLE_RESULT (*LightLC_OM_Set_cb)(Light_LC_Param_t*, MOBLEUINT8);
+
+ /* Pointer to the function Appli_LightLC_OnOff_Set used for callback
+ from the middle layer to Application layer
+ */
+ MOBLE_RESULT (*LightLC_OnOff_Set_cb)(Light_LC_OnOffState_t*, MOBLEUINT8);
+
+ /* Pointer to the function Appli_LightLC_Property_Set used for callback
+ from the middle layer to Application layer
+ */
+
+} Appli_Light_Ctrl_cb_t;
+
+typedef struct
+{
+ MOBLE_RESULT (*GetLightLC_ModeState_cb)(MOBLEUINT8*);
+ MOBLE_RESULT (*GetLightLC_OMState_cb)(MOBLEUINT8*);
+ MOBLE_RESULT (*GetLightLC_OnOffState_cb)(MOBLEUINT8*);
+ MOBLEUINT16 (*GetLightLC_AmbientLuxLevel_cb)(void);
+ MOBLEUINT16 (*GetLightLC_PIregulatorOut_cb)(MOBLEUINT16,MOBLEUINT16);
+}Appli_LightLC_GetStatus_cb_t;
+#pragma pack(4)
+
+extern const Appli_Light_Ctrl_cb_t LightLCAppli_cb;
+extern const Appli_LightLC_GetStatus_cb_t Appli_LightLC_GetStatus_cb;
+
+MOBLE_RESULT Light_LC_ModelServer_GetOpcodeTableCb(const MODEL_OpcodeTableParam_t **data,
+ MOBLEUINT16 *length);
+
+MOBLE_RESULT Light_LC_ModelServer_GetStatusRequestCb(MOBLE_ADDRESS peer_addr,
+ MOBLE_ADDRESS dst_peer,
+ MOBLEUINT16 opcode,
+ MOBLEUINT8 *pResponsedata,
+ MOBLEUINT32 *plength,
+ MOBLEUINT8 const *pRxData,
+ MOBLEUINT32 dataLength,
+ MOBLEBOOL response);
+
+MOBLE_RESULT Light_LC_ModelServer_ProcessMessageCb(MOBLE_ADDRESS peer_addr,
+ MOBLE_ADDRESS dst_peer,
+ MOBLEUINT16 opcode,
+ MOBLEUINT8 const *pRxData,
+ MOBLEUINT32 dataLength,
+ MOBLEBOOL response
+ );
+
+MOBLE_RESULT Light_LC_ModeSet(MOBLEUINT8 const *lcMode_param, MOBLEUINT32 length);
+MOBLE_RESULT Light_LC_ModeStatus(MOBLEUINT8* lcMode_status, MOBLEUINT32 *plength);
+MOBLE_RESULT Light_LC_OMSet(MOBLEUINT8 const *lcOM_param, MOBLEUINT32 length);
+MOBLE_RESULT Light_LC_OMStatus(MOBLEUINT8* lcOM_status, MOBLEUINT32 *plength);
+MOBLE_RESULT Light_LC_OnOffSet(MOBLEUINT8 const *lcOnOff_param, MOBLEUINT32 length);
+MOBLE_RESULT Light_LC_OnOffStatus(MOBLEUINT8* lcOnOff_status, MOBLEUINT32 *plength);
+MOBLE_RESULT Light_LC_PropertySet(MOBLEUINT8 const *lcProp_param, MOBLEUINT32 length);
+MOBLE_RESULT Light_LC_PropertyStatus( MOBLEUINT8* lcData_param, MOBLEUINT32* plength ,
+ MOBLEUINT8 const *pData, MOBLEUINT32 length);
+
+MOBLE_RESULT Light_LC_SetPropertyID_value(MOBLEUINT32 Prop_Value,
+ MOBLEUINT16 prop_ID);
+
+MOBLEUINT32 Light_LC_GetPropertyID_value(MOBLEUINT16 property_ID);
+MOBLEUINT32 Light_LC_GetStepValue(MOBLEUINT8 stepParam);
+MOBLEUINT32 Get_TimeToWait(MOBLEUINT16 Proprety_ID);
+MOBLEUINT16 Light_LC_LuxLevelOutputValue(MOBLEUINT16 property_ID);
+MOBLEUINT16 Light_LC_MaxLightnessValue(MOBLEUINT16 Param1,MOBLEUINT16 Param2);
+void Light_LC_Fsm(void);
+
+void Light_control_Process(void);
+
+MOBLE_RESULT Light_LC_Client_Mode_Status(MOBLEUINT8 const *pLightLc_status, MOBLEUINT32 pLength);
+MOBLE_RESULT Light_LC_Client_OM_Status(MOBLEUINT8 const *pLightLc_status, MOBLEUINT32 pLength);
+MOBLE_RESULT Light_LC_Client_ON_OFF_Status(MOBLEUINT8 const *pLightLc_status, MOBLEUINT32 pLength);
+MOBLE_RESULT Light_LC_Client_Property_Status(MOBLEUINT8 const *pLightLc_status, MOBLEUINT32 pLength);
+
+
+#endif /* __LIGHT_LC_H */
+
+/******************* (C) COPYRIGHT 2017 STMicroelectronics *****END OF FILE****/
+
diff --git a/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/meshdfu_node.h b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/meshdfu_node.h
new file mode 100644
index 000000000..a883ef5dd
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/meshdfu_node.h
@@ -0,0 +1,205 @@
+/**
+******************************************************************************
+* @file meshdfu_node.h
+* @author BLE Mesh Team
+* @version V1.10.000
+* @date 15-May-2019
+* @brief BLE-Mesh Device Firmware Upgrade/ FOTA over the mesh header file
+******************************************************************************
+* @attention
+*
+* <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
+*
+* Redistribution and use in source and binary forms, with or without modification,
+* are permitted provided that the following conditions are met:
+* 1. Redistributions of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+* 3. Neither the name of STMicroelectronics nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+* Initial BlueNRG-Mesh is built over Motorolas Mesh over Bluetooth Low Energy
+* (MoBLE) technology. The present solution is developed and maintained for both
+* Mesh library and Applications solely by STMicroelectronics.
+*
+******************************************************************************
+*/
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __MESHDFU_NODE_H
+#define __MESHDFU_NODE_H
+
+/* Includes ------------------------------------------------------------------*/
+#include "types.h"
+#include "bluenrg_mesh.h"
+
+/* Exported macro ------------------------------------------------------------*/
+
+/******************************************************************************/
+/********** Following Section defines the Opcodes for the Messages ************/
+/******************************************************************************/
+#define FIRMWARE_INFORMATION_GET 0XB601
+#define FIRMWARE_INFORMATION_STATUS 0XB602
+#define FIRMWARE_UPDATE_GET 0XB603
+#define FIRMWARE_VALIDATION_DATA_CHECK 0XB604
+#define FIRMWARE_UPDATE_CHECK 0XB60A /* Error here in Doc */
+#define FIRMWARE_VALIDATION_DATA_STATUS 0XB605
+#define FIRMWARE_UPDATE_START 0XB606
+#define FIRMWARE_UPDATE_CANCEL 0XB607
+#define FIRMWARE_UPDATE_APPLY 0XB608
+#define FIRMWARE_UPDATE_STATUS 0XB609
+
+
+#define FIRMWARE_DISTRIBUTION_GET 0XB60A
+#define FIRMWARE_DISTRIBUTION_START 0XB60B
+#define FIRMWARE_DISTRIBUTION_CANCEL 0XB60C
+#define FIRMWARE_DISTRIBUTION_STATUS 0XB60D
+#define FIRMWARE_DISTRIBUTION_RESULTS_NODES_GET 0XB60E
+#define FIRMWARE_DISTRIBUTION_RESULTS_STATUSNODES_LIST 0XB60F
+#define FIRMWARE_DISTRIBUTION_NODE_LISTS_ADD 0XB610
+#define FIRMWARE_DISTRIBUTION_NODE_LISTS_CLEARDELETE_ALL 0XB611
+#define FIRMWARE_DISTRIBUTION_NODE_LISTS_STATUS 0XB612
+#define FIRMWARE_DISTRIBUTION_CAPABILITIES_GET 0XB613
+#define FIRMWARE_DISTRIBUTION_CAPABILITIES_STATUS 0XB614
+#define FIRMWARE_DISTRIBUTION_UPLOADFIRMWARE_GET 0XB615
+#define FIRMWARE_DISTRIBUTION_FIRMWARE_ADDUPLOAD_START 0XB616
+#define FIRMWARE_DISTRIBUTION_FIRMWARE_ADD_OOBUPLOAD_OOB_START 0XB617
+#define FIRMWARE_DISTRIBUTION_FIRMWARE_DELETEUPLOAD_CANCEL 0XB618
+#define FIRMWARE_DISTRIBUTION_UPLOAD_FIRMWARE_STATUS 0XB619
+#define FIRMWARE_DISTRIBUTION_FIRMWARE_LIST_GET 0XB61A
+#define FIRMWARE_DISTRIBUTION_FIRMWARE_LISTSTATUS_STATUS 0XB61B
+#define FIRMWARE_DISTRIBUTION_FIRMWARE_GET_BY_INDEX 0XB61C
+#define FIRMWARE_DISTRIBUTION_FIRMWARE_DELETE 0XB61D
+#define FIRMWARE_DISTRIBUTION_FIRMWARE_DELETE_ALL 0XB61E
+
+
+
+
+/******************************************************************************/
+/********** Following Section defines the SIG MODEL IDs ************/
+/******************************************************************************/
+#define FIRMWARE_UPDATE_SERVER 0xFE00
+#define FIRMWARE_UPDATE_CLIENT 0xFE01
+#define FIRMWARE_DISTRIBUTION_SERVER 0xFE02
+#define FIRMWARE_DISTRIBUTION_CLIENT 0xFE03
+
+
+/******************************************************************************/
+/** Following Section defines the Firmware Update Phases : in a 3-bit value **/
+/******************************************************************************/
+#define MESHDFU_NODE_IDLE_STATE 0x00
+#define MESHDFU_NODE_TRANSFER_ERROR_STATE 0x01
+#define MESHDFU_NODE_INPROGRESS_STATE 0x02
+#define MESHDFU_NODE_DFU_READY_STATE 0x03
+#define MESHDFU_NODE_VERIFICATION_FAILED_STATE 0x04
+#define MESHDFU_NODE_RFU_MIN_STATE 0x05
+#define MESHDFU_NODE_RFU_MAX_STATE 0x07
+
+/******************************************************************************/
+/** Firmware Update Additional Information : state is 5-bit wide bitfield *****/
+/******************************************************************************/
+
+#define MESHDFU_NODE_PROVISIONING_NEEDED_INFO 0x01
+#define MESHDFU_NODE_COMPOSITION_CHANGE_EXPECTED_INFO 0x02 /* 1 << 2 */
+
+/******************************************************************************/
+/** 10.1.5.2 Out-of-Band Retrieval Supported *****/
+/******************************************************************************/
+
+#define OOB_RETRIEVAL_NOT_SUPPORTED 0x00
+#define OOB_RETRIEVAL_OOB_SUPPORTED 0x01
+#define OOB_RETRIEVAL_PROHIBITED_MIN 0x02
+#define OOB_RETRIEVAL_PROHIBITED_MAX 0xFF
+
+/******************************************************************************/
+/** 10.1.6.1 Distribution Phase *****/
+/******************************************************************************/
+
+#define DISTRIBUTION_PHASE_NOT_ACTIVE 0x00
+#define DISTRIBUTION_PHASE_IS_ACTIVE 0x01
+#define DISTRIBUTION_PHASE_IS_COMPLETE 0x02
+#define DISTRIBUTION_PHASE_IS_PROHIBITED_MIN 0x03
+#define DISTRIBUTION_PHASE_IS_PROHIBITED_MAX 0xFF
+
+/******************************************************************************/
+/** 10.1.6.2 Update Policy *****/
+/******************************************************************************/
+
+#define UPDATE_POLICY_VERIFY_ONLY 0x00
+#define UPDATE_POLICY_VERIFY_AND_APPLY 0x01
+#define UPDATE_POLICY_PROHIBITED_MIN 0x02
+#define UPDATE_POLICY_PROHIBITED_MAX 0xFF
+
+/******************************************************************************/
+/** 10.1.7.2 Upload Phase
+ The Upload Phase state indicates the phase of a firmware image delivery to
+ a Firmware Distribution Server. The firmware binary can be delivered
+ via OOB mechanism or BLOB Transfer Server model *****/
+/******************************************************************************/
+
+#define UPLOAD_PHASE_IDLE 0x00
+#define UPLOAD_PHASE_IN_PROGRESS 0x01
+#define UPLOAD_TRANSFER_ERROR 0x02
+#define UPLOAD_PHASE_PROHIBITED_MIN 0x03
+#define UPLOAD_PHASE_PROHIBITED_MAX 0xFF
+
+
+/******************************************************************************/
+/** 10.2.4 Distributor: Firmware Update Status Code *****/
+/******************************************************************************/
+#define MESHDFU_SUCCESS_STATUS 0x00
+#define MESHDFU_VALIDATION_FAILED_STATUS 0x01
+#define MESHDFU_INVALID_ID_STATUS 0x02
+#define MESHDFU_DISTRIBUTOR_BUSY_STATUS 0x03
+#define MESHDFU_OUT_OF_RESOURCES_STATUS 0x04
+#define MESHDFU_BLOB_TRANSFER_BUSY_STATUS 0x05
+ /* 0x06 is missing */
+#define MESHDFU_FIRMWARE_ID_STATUS 0x07
+#define MESHDFU_TEMPORARILY_UNABLE_STATUS 0x08
+#define MESHDFU_INVALID_COMMAND_STATUS 0x09
+#define MESHDFU_PROHIBITED_MIN_STATUS 0x0A
+#define MESHDFU_PROHIBITED_MAX_STATUS 0xFF
+
+
+/******************************************************************************/
+/********** SIG MODEL IDs ends ************/
+/******************************************************************************/
+MOBLE_RESULT MeshDfuNode_ModelServer_GetOpcodeTableCb(const MODEL_OpcodeTableParam_t **data,
+ MOBLEUINT16 *length);
+
+MOBLE_RESULT MeshDfuNode_ModelServer_GetStatusRequestCb(MOBLE_ADDRESS peer_addr,
+ MOBLE_ADDRESS dst_peer,
+ MOBLEUINT16 opcode,
+ MOBLEUINT8 *pResponsedata,
+ MOBLEUINT32 *plength,
+ MOBLEUINT8 const *pRxData,
+ MOBLEUINT32 dataLength,
+ MOBLEBOOL response);
+
+MOBLE_RESULT MeshDfuNode_ModelServer_ProcessMessageCb(MOBLE_ADDRESS peer_addr,
+ MOBLE_ADDRESS dst_peer,
+ MOBLEUINT16 opcode,
+ MOBLEUINT8 const *pRxData,
+ MOBLEUINT32 dataLength,
+ MOBLEBOOL response);
+
+
+
+#endif /* __MESHDFU_NODE_H */
+
+/******************* (C) COPYRIGHT 2017 STMicroelectronics *****END OF FILE****/
+
diff --git a/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/sensors.h b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/sensors.h
index 43e6f2cce..e65f07ca6 100644
--- a/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/sensors.h
+++ b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/sensors.h
@@ -40,8 +40,8 @@
*/
/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __SENSOR_H
-#define __SENSOR_H
+#ifndef __SENSORS_H
+#define __SENSORS_H
/* Includes ------------------------------------------------------------------*/
#include "types.h"
@@ -53,8 +53,12 @@
/********** Following Section defines the Opcodes for the Messages ************/
/******************************************************************************/
/* Sensors Property ID */
-#define TEMPERATURE_PID 0X0071
-#define PRESSURE_PID 0X2A6D
+#define TEMPERATURE_PID 0x0071// 0x004F
+#define PRESSURE_PID 0x2A6D
+#define HUMIDITY_PID 0x2A6F
+#define MAGNETO_METER_PID 0x2AA1
+#define ACCELERO_METER_PID 0x2BA1
+#define GYROSCOPE_PID 0x2BA2
/* 7.1 Messages summary Page 300 */
/* Sensor Server Model Opcode */
@@ -96,21 +100,22 @@
/*
structure for the Property id for the sensors Present inside the firmware.
*/
+#pragma pack(1)
typedef struct
{
MOBLEUINT16 Property_ID;
-
} MODEL_Property_IDTableParam_t;
+#pragma pack(4)
/* Sensor Cadence Parameters */
typedef struct
{
- MOBLEUINT16 Property_ID;
MOBLEUINT8 FastCadenceDevisor;
MOBLEUINT8 StatusTriggerType;
MOBLEUINT8 triggerDeltaDown;
MOBLEUINT8 triggerDeltaUp;
MOBLEUINT8 StatusMinInterval;
+ MOBLEUINT16 Property_ID;
float FastCadenceLow;
float FastCadenceHigh;
}Sensor_CadenceParam_t;
@@ -126,27 +131,15 @@ typedef struct
}Sensor_SettingParam_t;
/* Sensor Coloumn Parameters */
-#pragma pack(1)
+
typedef struct
{
MOBLEUINT16 Property_ID;
- MOBLEUINT16 RowValueX;
- MOBLEUINT16 RowValueWidth;
- MOBLEUINT16 RowValueY;
+ MOBLEUINT16 RawValueX;
+ MOBLEUINT16 RawValueWidth;
+ MOBLEUINT16 RawValueY;
}Sensor_ColumnParam_t;
-/** \brief Callback map for application from middle layer .
- this will call the function related to the function pointer in the
- model_if.c file
- const Appli_Sensor_cb_t SensorAppli_cb =
- {
- Appli_Sensor_Cadence_Set,
- Appli_Sensor_Data_Status,
- Appli_Sensor_Descriptor_Status ,
- Appli_Sensor_Setting_Set
- };
-
-**/
typedef struct
{
/* Pointer to the function Appli_Sensor_Cadence_Set used for callback
@@ -171,10 +164,10 @@ typedef struct
} Appli_Sensor_cb_t;
-
/* function pointer for application to get the value from application to middle
layer file
*/
+
typedef struct
{
MOBLE_RESULT (*GetSettingStatus_cb)(MOBLEUINT8*);
@@ -182,6 +175,7 @@ typedef struct
MOBLE_RESULT (*GetSetting_IDStatus_cb)(MOBLEUINT8*);
}Appli_Sensor_GetStatus_cb_t;
+#pragma pack(4)
extern const Appli_Sensor_GetStatus_cb_t Appli_Sensor_GetStatus_cb;
extern const Appli_Sensor_cb_t SensorAppli_cb;
@@ -216,10 +210,9 @@ MOBLE_RESULT Sensor_Setting_Status_PID(MOBLEUINT8* pSetting_param, MOBLEUINT32 *
const MOBLEUINT8 *pData,MOBLEUINT32 length);
MOBLE_RESULT Sensor_Setting_Status_SettingID(MOBLEUINT8* pSetting_param, MOBLEUINT32 *plength,
const MOBLEUINT8 *pData,MOBLEUINT32 length);
-MOBLE_RESULT Sensor_Cadence_Status(MOBLEUINT8* pCadencestatus_param, MOBLEUINT32 *plength,
- MOBLEUINT8 const *pData, MOBLEUINT32 length);
-#endif /* __Sensor_H */
-/******************* (C) COPYRIGHT 2017 STMicroelectronics *****END OF FILE****/
+#endif /* __SENSORS_H */
+
+/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/vendor.h b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/vendor.h
index cb9884fb0..b0b4cee7b 100644
--- a/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/vendor.h
+++ b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc/vendor.h
@@ -45,10 +45,19 @@
/* Includes ------------------------------------------------------------------*/
#include "types.h"
+#include "ble_mesh.h"
/* Exported macro ------------------------------------------------------------*/
-#define MODEL_BLUEMESH_MID 0x00010030
+/* Refer to 3.7.2 Model identifier */
+#define VENDOR_STMICRO_CID 0x0030 /* 16-bit Company Identifier */
+#define VENDOR_STMICRO_MODEL_ID1 0x0001 /* 16-bit vendor-assigned model identifier */
+#define VENDORMODEL_STMICRO_ID1 (MOBLEUINT32)(((MOBLEUINT32)VENDOR_STMICRO_MODEL_ID1 << 16)|(VENDOR_STMICRO_CID))
+
+/******************* Read, write and response mask for Vendor opcode **********/
+#define VENDOR_CMD_RESPONSE 0x20
+#define VENDOR_CMD_READ_nWRITE 0x10
+/******************************************************************************/
/*******************Commands Received from Android/IoS*************************/
#define APPLI_TEST_CMD 0x1U
@@ -131,8 +140,10 @@ typedef struct
MOBLE_RESULT (*DeviceInfoCommand_cb)(MOBLEUINT8 const *, MOBLEUINT32);
MOBLE_RESULT (*TestCommand_cb)(MOBLEUINT8 const *, MOBLEUINT32);
void (*LEDControl_cb)(void);
+ void (*GetTestCount)(MOBLEUINT8*);
} Appli_Vendor_cb_t;
+#pragma pack(4)
extern const Appli_Vendor_cb_t VendorAppli_cb;
@@ -144,10 +155,37 @@ MOBLE_RESULT Vendor_WriteLocalDataCb(MOBLE_ADDRESS peer_addr, MOBLE_ADDRESS dst_
MOBLE_RESULT Vendor_ReadLocalDataCb(MOBLE_ADDRESS peer_addr, MOBLE_ADDRESS dst_peer,
MOBLEUINT8 command, MOBLEUINT8 const *data,
MOBLEUINT32 length, MOBLEBOOL response);
-MOBLE_RESULT Vendor_OnResponseDataCb(MOBLE_ADDRESS peer_addr, MOBLEUINT8 elementIndex,
- MOBLEUINT8 const * data, MOBLEUINT32 length);
+
+MOBLE_RESULT Vendor_OnResponseDataCb(MOBLE_ADDRESS peer_addr, MOBLE_ADDRESS dst_peer,
+ MOBLEUINT8 command, MOBLEUINT8 const *pRxData,
+ MOBLEUINT32 dataLength, MOBLEBOOL response);
+
void Vendor_Process(void);
void Vendor_Publish(MOBLE_ADDRESS publishAddr, MOBLEUINT8 elementIndex);
+void Vendor_TestRemoteData(MOBLE_ADDRESS src,MOBLE_ADDRESS dst,MOBLEUINT8 elementIndex);
+void Vendor_TestCounterInc(MOBLE_ADDRESS src ,MOBLE_ADDRESS dst ,MOBLEUINT8 elementIndex);
+
+MOBLE_RESULT VendorModel_PID1_GetOpcodeTableCb(const MODEL_OpcodeTableParam_t **data,
+ MOBLEUINT16 *length);
+
+MOBLE_RESULT VendorModel_PID1_GetStatusRequestCb(MOBLE_ADDRESS peer_addr,
+ MOBLE_ADDRESS dst_peer,
+ MOBLEUINT16 opcode,
+ MOBLEUINT8 *pResponsedata,
+ MOBLEUINT32 *plength,
+ MOBLEUINT8 const *pRxData,
+ MOBLEUINT32 dataLength,
+ MOBLEBOOL response);
+
+
+MOBLE_RESULT VendorModel_PID1_ProcessMessageCb(MOBLE_ADDRESS peer_addr,
+ MOBLE_ADDRESS dst_peer,
+ MOBLEUINT16 opcode,
+ MOBLEUINT8 const *pRxData,
+ MOBLEUINT32 dataLength,
+ MOBLEBOOL response
+ );
+
#endif /* __VENDOR_H */
diff --git a/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/blob.c b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/blob.c
new file mode 100644
index 000000000..48d0fbd09
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/blob.c
@@ -0,0 +1,516 @@
+/**
+******************************************************************************
+* @file blob.c
+* @author BLE Mesh Team
+* @version V1.10.000
+* @date 15-May-2019
+* @brief BLE-Mesh Block transfer Server implementation
+******************************************************************************
+* @attention
+*
+* <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
+*
+* Redistribution and use in source and binary forms, with or without modification,
+* are permitted provided that the following conditions are met:
+* 1. Redistributions of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+* 3. Neither the name of STMicroelectronics nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+* Initial BlueNRG-Mesh is built over Motorolas Mesh over Bluetooth Low Energy
+* (MoBLE) technology. The present solution is developed and maintained for both
+* Mesh library and Applications solely by STMicroelectronics.
+*
+******************************************************************************
+*/
+/* Includes ------------------------------------------------------------------*/
+#include "hal_common.h"
+#include "mesh_cfg.h"
+#include "common.h"
+#include <string.h>
+#include "compiler.h"
+#include "Math.h"
+#include "blob.h"
+
+
+/** @addtogroup Model_Callbacks
+* @{
+*/
+
+/* Private define ------------------------------------------------------------*/
+/* Private macro -------------------------------------------------------------*/
+/* Private variables ---------------------------------------------------------*/
+
+#pragma pack(1)
+Blob_Transfer_param_t Blob_Transfer_param;
+Blob_Block_Param_t Blob_Block_Param;
+uint8_t Blob_Blocks_Not_Received[BLOB_MAX_BLOCK_BITMAP_BYTE_SIZE];
+uint8_t Missing_Chunks_Array[BLOB_MAX_CHUNK_BITMAP_BYTE_SIZE];
+
+const MODEL_OpcodeTableParam_t Mbt_Opcodes_Table[] = {
+ /*MOBLEUINT32 opcode, MOBLEBOOL reliable, MOBLEUINT16 min_payload_size,
+ MOBLEUINT16 max_payload_size;
+ Here in this array, Handler is not defined; */
+#ifdef ENABLE_BLOB_MODEL_SERVER
+ {BLOB_TRANSFER_GET, MOBLE_TRUE, 0, 0, BLOB_TRANSFER_STATUS, 2, 23},
+ {BLOB_TRANSFER_START, MOBLE_TRUE, 17, 17, BLOB_TRANSFER_STATUS, 2, 23},
+ {BLOB_TRANSFER_CANCEL, MOBLE_TRUE, 8, 8, BLOB_TRANSFER_STATUS, 2, 23},
+ {BLOB_BLOCK_GET, MOBLE_TRUE, 0, 0, BLOB_BLOCK_STATUS, 5, 7},
+ {BLOB_BLOCK_START, MOBLE_TRUE, 4, 4, BLOB_BLOCK_STATUS, 5, 7},
+ {BLOB_CHUNK_TRANSFER, MOBLE_FALSE, 2, 258, 0, 0, 0},
+ {BLOB_INFORMATION_GET, MOBLE_TRUE, 0, 0, BLOB_INFORMATION_STATUS, 13, 13},
+
+ /* Following status messages may need commenting */
+ {BLOB_TRANSFER_STATUS, MOBLE_FALSE, 17, 17, 0, 0, 0},
+ {BLOB_BLOCK_STATUS, MOBLE_FALSE, 5, 7, 0, 0, 0},
+ {BLOB_INFORMATION_STATUS, MOBLE_FALSE, 13,13, 0, 0, 0},
+#endif
+ {0}
+};
+/* Private function prototypes -----------------------------------------------*/
+/* Private functions ---------------------------------------------------------*/
+
+/**
+* @brief Mbt_ModelServer_GetOpcodeTableCb: This function is call-back
+ from the library to send Model Opcode Table info to library
+* @param MODEL_OpcodeTableParam_t: Pointer to the Light Model opcode array
+* @param length: Pointer to the Length of Light Model opcode array
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Mbt_ModelServer_GetOpcodeTableCb(const MODEL_OpcodeTableParam_t **data,
+ MOBLEUINT16 *length)
+{
+ *data = Mbt_Opcodes_Table;
+ *length = sizeof(Mbt_Opcodes_Table)/sizeof(Mbt_Opcodes_Table[0]);
+
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Mbt_ModelServer_GetStatusRequestCb : This function is call-back
+ from the library to send response to the message from peer
+* @param peer_addr: Address of the peer
+* @param dst_peer: destination send by peer for this node. It can be a
+* unicast or group address
+* @param opcode: Received opcode of the Status message callback
+* @param pResponsedata: Pointer to the buffer to be updated with status
+* @param plength: Pointer to the Length of the data, to be updated by application
+* @param pRxData: Pointer to the data received in packet.
+* @param dataLength: length of the data in packet.
+* @param response: Value to indicate wheather message is acknowledged meassage or not.
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Mbt_ModelServer_GetStatusRequestCb(MOBLE_ADDRESS peer_addr,
+ MOBLE_ADDRESS dst_peer,
+ MOBLEUINT16 opcode,
+ MOBLEUINT8 *pResponsedata,
+ MOBLEUINT32 *plength,
+ MOBLEUINT8 const *pRxData,
+ MOBLEUINT32 dataLength,
+ MOBLEBOOL response)
+{
+ switch(opcode)
+ {
+ case BLOB_TRANSFER_STATUS:
+ {
+ BLOB_Transfer_Status(pResponsedata, plength);
+ break;
+ }
+ case BLOB_BLOCK_STATUS:
+ {
+ BLOB_Block_Status(pResponsedata, plength);
+ break;
+ }
+ case BLOB_INFORMATION_STATUS:
+ {
+ BLOB_Information_Status(pResponsedata, plength);
+ break;
+ }
+
+ default:
+ {
+ break;
+ }
+ } /* Switch ends */
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Mbt_ModelServer_ProcessMessageCb: This is a callback function from
+ the library whenever a Light Model message is received
+* @param peer_addr: Address of the peer
+* @param dst_peer: destination send by peer for this node. It can be a
+* unicast or group address
+* @param opcode: Received opcode of the Status message callback
+* @param pData: Pointer to the buffer to be updated with status
+* @param length: Length of the parameters received
+* @param response: if TRUE, the message is an acknowledged message
+* @param pRxData: Pointer to the data received in packet.
+* @param dataLength: length of the data in packet.
+* @param response: Value to indicate wheather message is acknowledged meassage or not.
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Mbt_ModelServer_ProcessMessageCb(MOBLE_ADDRESS peer_addr,
+ MOBLE_ADDRESS dst_peer,
+ MOBLEUINT16 opcode,
+ MOBLEUINT8 const *pMsgData,
+ MOBLEUINT32 dataLength,
+ MOBLEBOOL response
+ )
+{
+ MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
+
+
+ switch(opcode)
+ {
+ case BLOB_TRANSFER_GET:
+ {
+ result = BLOB_Transfer_Get(pMsgData, dataLength);
+ /* The Status shall be send from Model_SendResponse via
+ Mbt_ModelServer_GetStatusRequestCb*/
+ break;
+ }
+ case BLOB_TRANSFER_START:
+ {
+ result = BLOB_Transfer_Start(pMsgData, dataLength);
+ break;
+ }
+ case BLOB_TRANSFER_CANCEL:
+ {
+ result = BLOB_Transfer_Cancel(pMsgData, dataLength);
+ break;
+ }
+ case BLOB_BLOCK_GET:
+ {
+ result = BLOB_Block_Get(pMsgData, dataLength);
+ break;
+ }
+ case BLOB_BLOCK_START:
+ {
+ result = BLOB_Transfer_Start(pMsgData, dataLength);
+ break;
+ }
+ case BLOB_CHUNK_TRANSFER:
+ {
+ result = BLOB_Chunk_Transfer(pMsgData, dataLength);
+ break;
+ }
+ case BLOB_INFORMATION_GET:
+ {
+ result = BLOB_Information_Get(pMsgData, dataLength);
+ break;
+ }
+
+ default:
+ {
+ break;
+ }
+ } /* Switch ends */
+
+ if((result == MOBLE_RESULT_SUCCESS) && (response == MOBLE_TRUE))
+ {
+ Model_SendResponse(peer_addr,dst_peer,opcode,pMsgData,dataLength);
+ }
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief BLOB_Transfer_Get: This is a function which is called when the
+ client calls for BLOB Transfer Get
+* @param pMsgData: Message pointer containing the received parameters
+* @param length: length of the message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT BLOB_Transfer_Get(MOBLEUINT8 const *pMsgData, MOBLEUINT32 length)
+{
+ /* BLOB Transfer Get is an acknowledged message used to get the current value
+ of a BLOB Transfer Server state.
+ The response to the BLOB Transfer Get message is a
+ BLOB Transfer Status message.
+*/
+
+ if (length != 0 )
+ {
+ /* There are no parameters for this message */
+ return MOBLE_RESULT_INVALIDARG;
+ }
+
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief BLOB_Transfer_Start: This is a function which is called when the
+ client calls for BLOB Transfer Start function
+* @param pMsgData: Message pointer containing the received parameters
+* @param length: length of the message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT BLOB_Transfer_Start(MOBLEUINT8 const *pMsgData, MOBLEUINT32 length)
+{
+ /* BLOB Transfer Start is an acknowledged message used to start a
+ new BLOB transfer.
+ The response to the BLOB Transfer Start message is a
+ BLOB Transfer Status message.
+ */
+
+ MOBLE_RESULT result;
+
+
+ if (length != sizeof(Blob_Transfer_param_t) )
+ {
+ /* The message has no optional parameters, hence the lenght must match
+ with the expected size */
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else
+ {
+ /* Copy all the data in the parameters */
+ memcpy(Blob_Transfer_param.pBlob_Transfer_Param, pMsgData, length);
+ result = MOBLE_RESULT_SUCCESS;
+ }
+
+ return result;
+}
+
+/**
+* @brief BLOB_Transfer_Cancel: This is a function which is called when the
+ client calls for BLOB Transfer CANCEL function
+* @param pMsgData: Message pointer containing the received parameters
+* @param length: length of the message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT BLOB_Transfer_Cancel(MOBLEUINT8 const *pMsgData, MOBLEUINT32 length)
+{
+ /* BLOB Transfer Cancel is an acknowledged message used to cancel the ongoing
+ Transfer BLOB Procedure.
+ The response to the BLOB Transfer Cancel message is a
+ BLOB Transfer Status message.
+ The BLOB ID field shall indicate the ID of the BLOB thats transfer is
+ supposed to be canceled.
+ */
+
+ MOBLE_RESULT result;
+
+
+ if (length != BLOB_ID_SIZE )
+ {
+ /* The message shall receive the Blob_id to Cancel
+ if the length is not matching, this is an error */
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else if ( memcmp(Blob_Transfer_param.uBlob_Transfer_param.blob_id, pMsgData, length) != 0 )
+ {
+ /* If Blob id received for cancelling the message is not matching with
+ the Blob under progress, this is still an error */
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else
+ {
+ /* Cancel the ongoing transfer, reset the state machine */
+
+ /* DO SOMETHING HERE !!!! */
+ result = MOBLE_RESULT_SUCCESS;
+ }
+
+ return result;
+}
+
+/**
+* @brief BLOB_Block_Get: This is a function which is called when the
+ client calls for BLOB Block Get
+* @param node: There are no parameters to this function
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT BLOB_Block_Get(MOBLEUINT8 const *pMsgData, MOBLEUINT32 length)
+{
+ /* The BLOB Block Get is an acknowledged message used to get the
+ status of the current block transfer.
+ The response to the BLOB Block Get message is a BLOB Block Status message.
+ There are no parameters for this message.
+
+*/
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief BLOB_Block_Start: This is a function which is called when the
+ client calls for BLOB Block Start function
+* @param pMsgData: Message pointer containing the received parameters
+* @param length: length of the message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT BLOB_Block_Start(MOBLEUINT8 const *pMsgData, MOBLEUINT32 length)
+{
+ /*
+ BLOB Block Start is an acknowledged message used to
+ start block transfer to the server.
+ The response to the BLOB Block Start message is a BLOB Block Status message
+
+ The Block Number field shall indicate the new value of the Block Number state (see Section 7.1.3.2.1).
+ The Chunk Size field shall indicate the new value of the Chunk Size state (see Section 7.1.3.2.2).
+ */
+
+ MOBLE_RESULT result;
+
+
+ if (length != sizeof(Blob_Block_Param_t) )
+ {
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else
+ {
+ /* Copy all the data in the parameters */
+ // memcpy(Blob_Block_Param , pMsgData, length);
+ //Blob_Block_Param.Block_Number;
+ Blob_Block_Param.Block_Number = *((MOBLEUINT16*)pMsgData);
+ Blob_Block_Param.Chunk_Size = *((MOBLEUINT16*)pMsgData);
+ result = MOBLE_RESULT_SUCCESS;
+ }
+
+ return result;
+}
+
+
+
+/**
+* @brief BLOB_Chunk_Transfer: This is a function which is called when the
+ client calls for BLOB CHUNK Transfer function
+* @param pMsgData: Message pointer containing the received parameters
+* @param length: length of the message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT BLOB_Chunk_Transfer(MOBLEUINT8 const *pMsgData, MOBLEUINT32 length)
+{
+ /*
+ The BLOB Chunk Transfer is an unacknowledged message used to deliver a chunk
+ of the current block to a server.
+
+ The Chunk Number field shall indicate the chunks number in a sequence of
+ chunks in a block.
+ The Chunk Data field shall contain between 1 and Chunk Size state bytes of
+ the BLOB data. It shall be Chunk Size state bytes in size, except for the
+ last chunk in the block, which may be shorter if Chunk Size state is not a
+ divisor of Block Size.
+ */
+
+ //MOBLE_RESULT result;
+// MOBLEUINT8 *pChunkData;
+// MOBLEUINT16 chunk_index;
+
+ /* Copy the Chunk data to the Application */
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief BLOB_Information_Get: This is a function which is called when the
+ client calls for BLOB Information Get function
+* @param pMsgData: Message pointer containing the received parameters
+* @param length: length of the message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT BLOB_Information_Get(MOBLEUINT8 const *pMsgData, MOBLEUINT32 length)
+{
+ /* The BLOB Information Get is an acknowledged message used to get the
+ BLOB transfer capabilities of the server.
+ The response to the BLOB Information Get message is a
+ BLOB Information Status message.
+*/
+
+ if (length != 0 )
+ {
+ /* There are no parameters for this message */
+ return MOBLE_RESULT_INVALIDARG;
+ }
+
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief BLOB_Transfer_Status: This is a function which is called when the
+ Server needs to send the Transfer Status message to Client
+* @param pMsgData: Message pointer containing the received parameters
+* @param length: length of the message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT BLOB_Transfer_Status(MOBLEUINT8 const *pResponsedata, MOBLEUINT32 *plength)
+{
+ Transfer_Status_data_t* pTransfer_Status;
+
+ pTransfer_Status = (Transfer_Status_data_t*)(pResponsedata);
+ pTransfer_Status->Status = (uint8_t)(BLOB_SUCCESS_STATUS); //modify
+ pTransfer_Status->Padding = 0;
+ pTransfer_Status->Phase = (uint8_t)BLOB_IDLE_STATE; //modify
+
+ memcpy( pTransfer_Status->blob_id, Blob_Transfer_param.pBlob_Transfer_Param, sizeof(_Blob_Transfer_Param_t) );
+// pTransfer_Status->BLOB_Size;
+// BLOB_Block_Size_Log;
+// Client_MTU_Size;
+// Timeout;
+ memcpy (pTransfer_Status->Blocks_Not_Received_Variable, Blob_Blocks_Not_Received, BLOB_MAX_BLOCK_BITMAP_BYTE_SIZE);
+ *plength = sizeof (Transfer_Status_data_t);
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief BLOB_Block_Status: This is a function which is called when the
+ Server needs to send the BLOB Block Status message to Client
+* @param pMsgData: Message pointer containing the received parameters
+* @param length: length of the message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT BLOB_Block_Status(MOBLEUINT8 const *pResponsedata, MOBLEUINT32* plength)
+{
+ BLOB_Block_Status_t* pblock_status;
+
+ pblock_status = (BLOB_Block_Status_t*)(pResponsedata);
+ pblock_status->Status = (uint8_t)(BLOB_SUCCESS_STATUS); //modify
+ pblock_status->Format = 0; //modify
+ pblock_status->Block_Number = 0; //modify
+ pblock_status->Chunk_Size = 0; //modify
+ memcpy (pblock_status->Missing_Chunks_Variable, Missing_Chunks_Array, BLOB_MAX_CHUNK_BITMAP_BYTE_SIZE);
+ *plength = sizeof (BLOB_Block_Status_t);
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief BLOB_Information_Status: This is a function which is called when the
+ Server needs to send the BLOB Information Status message to Client
+* @param pMsgData: Message pointer containing the received parameters
+* @param length: length of the message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT BLOB_Information_Status(MOBLEUINT8 const *pResponsedata, MOBLEUINT32* plength)
+{
+ BLOB_Information_Status_t* pblobInfoStatus;
+
+ pblobInfoStatus = (BLOB_Information_Status_t*) pResponsedata;
+ pblobInfoStatus->Min_Block_Size_Log = (uint8_t)BLOB_MIN_BLOCK_SIZE_LOG;
+ pblobInfoStatus->Min_Block_Size_Log = (uint8_t)BLOB_MAX_BLOCK_SIZE_LOG;
+ pblobInfoStatus->Max_Chunks_Number = (uint16_t)BLOB_MAX_CHUNK_NUMBER;
+ pblobInfoStatus->Max_BLOB_Size = (uint32_t) BLOB_MAX_FILE_SIZE;
+ pblobInfoStatus->MTU_size= (uint16_t)BLOB_MAX_CHUNK_SIZE;
+ pblobInfoStatus->Functionalities= (uint8_t)BLOB_NON_SEQUENTIAL_BLOCK_RECEPTION;
+ *plength = sizeof (BLOB_Information_Status_t);
+ return MOBLE_RESULT_SUCCESS;
+}
+
+
+/******************* (C) COPYRIGHT 2017 STMicroelectronics *****END OF FILE****/
+
+
+
diff --git a/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/common.c b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/common.c
index b8e580ff4..9ac302ba4 100644
--- a/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/common.c
+++ b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/common.c
@@ -44,6 +44,8 @@
#include "generic.h"
#include "light.h"
#include "common.h"
+#include "vendor.h"
+#include "light_lc.h"
#include <string.h>
@@ -58,6 +60,10 @@
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
+extern const APPLI_SAVE_MODEL_STATE_CB SaveModelState_cb;
+extern MOBLEUINT8 NumberOfElements;
+MOBLEUINT8 PowerOnOff_flag = FLAG_RESET;
+extern MOBLEUINT8 RestoreFlag;
/**
* @brief Chk_ParamValidity: This function is to check validity of Parameters
* @param param: Parameter
@@ -383,7 +389,6 @@ float Ratio_CalculateValue(MOBLEUINT16 setValue , MOBLEUINT16 maxRange , MOBLEIN
}
-
/**
* @brief PWM_CoolValue: This function is used to calculate the value for the
cool temperature for the light.
@@ -436,6 +441,252 @@ void TraceHeader(const char* func_name, int mode)
printf("%ld %s - <<<ERROR>>>", Clock_Time(), func_name);
}
+/**
+* @brief Prepare and save buffer of Generic and Light models state in NVM
+* @param void
+* @retval MOBLE_RESULT_SUCCESS on success
+*/
+MOBLE_RESULT SaveModelsStateNvm(MOBLEUINT8 flag)
+{
+ MOBLEUINT8 Model_GetBuff[APP_NVM_MODEL_SIZE];/* 16 bytes for generic model and 16 bytes for light model */
+ MOBLE_RESULT result = MOBLE_RESULT_FAIL;
+
+ memset(Model_GetBuff, 0x00, APP_NVM_MODEL_SIZE);
+
+ Model_GetBuff[GENERIC_VALID_FLAG_OFFSET] = flag;
+
+#ifdef ENABLE_GENERIC_MODEL_SERVER_ONOFF
+ (Appli_GenericState_cb.GetOnOffStatus_cb)(&Model_GetBuff[GENERIC_ON_OFF_NVM_OFFSET]);
+#endif
+
+#ifdef ENABLE_GENERIC_MODEL_SERVER_LEVEL
+ (Appli_GenericState_cb.GetLevelStatus_cb)(&Model_GetBuff[GENERIC_LEVEL_NVM_OFFSET]);
+#endif
+
+#ifdef ENABLE_GENERIC_MODEL_SERVER_POWER_ONOFF
+ (Appli_GenericState_cb.GetPowerOnOffStatus_cb)(&Model_GetBuff[GENERIC_POWER_ON_OFF_NVM_OFFSET]);
+#endif
+
+#ifdef ENABLE_LIGHT_MODEL_SERVER_LIGHTNESS
+ (Appli_Light_GetStatus_cb.GetLightLightness_cb)(&Model_GetBuff[GENERIC_DATA_LIMIT+LIGHT_LIGHTNESS_NVM_OFFSET]);
+#endif
+
+#ifdef ENABLE_LIGHT_MODEL_SERVER_CTL
+ (Appli_Light_GetStatus_cb.GetLightCtl_cb)(Model_GetBuff+GENERIC_DATA_LIMIT+LIGHT_CTL_NVM_OFFSET);
+#endif
+
+#ifdef ENABLE_LIGHT_MODEL_SERVER_HSL
+ (Appli_Light_GetStatus_cb.GetLightHsl_cb)(Model_GetBuff+GENERIC_DATA_LIMIT+LIGHT_HSL_NVM_OFFSET);
+#endif
+ if (SaveModelState_cb != NULL)
+ {
+ result = SaveModelState_cb(Model_GetBuff, APP_NVM_MODEL_SIZE);
+ }
+
+ if (MOBLE_FAILED(result))
+ {
+ TRACE_M(TF_MISC, "Failed to save model state \r\n");
+ }
+ else if (result == MOBLE_RESULT_FALSE)
+ {
+ TRACE_M(TF_MISC, "Not able to save model state. Try again \r\n");
+ }
+
+ return result;
+}
+
+/*
+* @brief function to call light middle layer function for restoration of
+* saved states.
+* @param void.
+* return void.
+*/
+void Model_RestoreStates(MOBLEUINT8 const *pModelState_Load, MOBLEUINT8 size)
+{
+
+ if (size > 0)
+ {
+ switch(pModelState_Load[0])
+ {
+#ifdef ENABLE_GENERIC_MODEL_SERVER_ONOFF
+ case GENERIC_ON_OFF_NVM_FLAG:
+ {
+ /* checking the Power on off retrieved value according to the given
+ in standered and taking decision for Generic on off.
+ */
+ MOBLEUINT8 pData[2];
+
+ if(pModelState_Load[4] == GENERIC_POWER_OFF_STATE)
+ {
+ pData[0] = APPLI_LED_OFF;
+ Generic_OnOff_Set(pData,1);
+ }
+ else if(pModelState_Load[4] == GENERIC_POWER_ON_STATE)
+ {
+ pData[0] = APPLI_LED_ON;
+ Generic_OnOff_Set(pData,1);
+ }
+ else if(pModelState_Load[4] == GENERIC_POWER_RESTORE_STATE)
+ {
+ Generic_OnOff_Set(pModelState_Load+GENERIC_ON_OFF_NVM_OFFSET, 1);
+ }
+ else
+ {
+ TRACE_M(TF_GENERIC, "Power On Off value invalid %d \r\n", pModelState_Load[0]);
+ }
+
+ break;
+ }
+#endif
+
+#ifdef ENABLE_GENERIC_MODEL_SERVER_LEVEL
+ case GENERIC_LEVEL_NVM_FLAG:
+ {
+ Generic_Level_Set(pModelState_Load+GENERIC_LEVEL_NVM_OFFSET,2);
+ break;
+ }
+#endif
+
+#ifdef ENABLE_LIGHT_MODEL_SERVER_LIGHTNESS
+ case LIGHT_LIGHTNESS_NVM_FLAG:
+ {
+ Light_Lightness_Set((pModelState_Load+GENERIC_DATA_LIMIT+LIGHT_LIGHTNESS_NVM_OFFSET), 2);
+ break;
+ }
+#endif
+
+#ifdef ENABLE_LIGHT_MODEL_SERVER_CTL
+ case LIGHT_CTL_NVM_FLAG:
+ {
+ Light_Ctl_Set((pModelState_Load+GENERIC_DATA_LIMIT+LIGHT_CTL_NVM_OFFSET), 4);
+ break;
+ }
+#endif
+
+#ifdef ENABLE_LIGHT_MODEL_SERVER_HSL
+ case LIGHT_HSL_NVM_FLAG:
+ {
+ Light_Hsl_Set((pModelState_Load+GENERIC_DATA_LIMIT+LIGHT_HSL_NVM_OFFSET), 6);
+ break;
+ }
+#endif
+ default:
+ {
+ TRACE_M(TF_LIGHT, "data is invalid %d \r\n", pModelState_Load[0]);
+ break;
+ }
+ }
+ }
+
+}
+/**
+* @brief Function used to select the element number
+* @param void
+* @retval element number
+*/
+MOBLEUINT8 BLE_GetElementNumber(void)
+{
+
+ MOBLEUINT8 elementNumber = 0;
+
+ /*Select the Element Number for which publication address is required*/
+
+ if (NumberOfElements == 1)
+ {
+ elementNumber = 0x01;
+ }
+
+ else if(NumberOfElements == 2)
+ {
+ elementNumber = 0x02; /*Element 2 is configured as switch*/
+ }
+
+ else if(NumberOfElements == 3)
+ {
+ elementNumber = 0x03; /*Element 3 is configured as switch*/
+ }
+ return elementNumber;
+}
+
+/**
+* @brief Function used to save the states of the node, when power down is detected.
+* @param void
+* @retval void
+*/
+void ModelSave_Process(void)
+{
+ if(PowerOnOff_flag == FLAG_SET)
+ {
+ SaveModelsStateNvm(RestoreFlag);
+ PowerOnOff_flag = FLAG_RESET;
+ }
+}
+
+/**
+* @brief Function used to calculate the delay.
+* @param MOBLEUINT16
+* @retval MOBLEUINT8
+*/
+MOBLEUINT8 BLE_waitPeriod(MOBLEUINT32 waitPeriod)
+{
+ static MOBLEUINT8 Clockflag = 0;
+ static MOBLEUINT32 Check_time;
+
+
+ if(Clockflag == CLK_FLAG_DISABLE)
+ {
+ Check_time = Clock_Time();
+ Clockflag = CLK_FLAG_ENABLE;
+ }
+/* The function will called untill the testcount will not become zero */
+
+ if(((Clock_Time()- Check_time) >= waitPeriod))
+ {
+ Clockflag = CLK_FLAG_DISABLE;
+ return 0x01;
+
+ }
+ return 0x00;
+}
+
+/**
+* @brief Function used to convert the time vale in standered Transition time.
+* @param MOBLEUINT16
+* @retval MOBLEUINT8
+*/
+MOBLEUINT8 Time_Conversion(MOBLEUINT32 lc_Time)
+{
+ MOBLEUINT32 timeValue;
+ MOBLEUINT8 timeResolution = 0;
+ timeValue = lc_Time/TRANSITION_STEP_VALUE;
+ MOBLEUINT8 totalTime;
+
+ if((timeValue > (MOBLEUINT32)STEP_RESOLUTION_2) && (timeValue <= (MOBLEUINT32)STEP_RESOLUTION_3))
+ {
+ timeResolution = STEP_HEX_VALUE_3;
+ }
+ else if((timeValue >STEP_RESOLUTION_1) && (timeValue <= STEP_RESOLUTION_2 ))
+ {
+ timeResolution = STEP_HEX_VALUE_2;
+ }
+ else if((timeValue >STEP_RESOLUTION_0) && (timeValue <= STEP_RESOLUTION_1))
+ {
+ timeResolution = STEP_HEX_VALUE_1;
+ }
+ else if(timeValue <= STEP_RESOLUTION_0 )
+ {
+ timeResolution = STEP_HEX_VALUE_0;
+ }
+ else
+ {
+ /* No Comment */
+ }
+
+ totalTime = timeResolution << 6;
+ totalTime |= TRANSITION_STEP_VALUE;
+
+ return totalTime;
+}
/******************* (C) COPYRIGHT 2017 STMicroelectronics *****END OF FILE****/
diff --git a/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/generic.c b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/generic.c
index a8cfd0011..e72ee0558 100644
--- a/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/generic.c
+++ b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/generic.c
@@ -69,52 +69,72 @@ static Generic_LevelStatus_t Generic_LevelStatus;
static Generic_OnOffStatus_t Generic_OnOffStatus;
+Generic_DefaultTransitionParam_t Generic_DefaultTransitionParam = {0x06};
+
static Generic_ModelFlag_t Generic_ModelFlag;
+extern MOBLEUINT16 CommandStatus;
+MOBLEUINT8 GeneicUpdateFlag = 0;
+MOBLEUINT8 Generic_Trnsn_Cmplt = 0;
+MOBLEUINT16 Generic_Rx_Opcode;
+MOBLEUINT8 OptionalValid = 0;
+
const MODEL_OpcodeTableParam_t Generic_Opcodes_Table[] = {
/* Generic OnOff Server */
/* MOBLEUINT32 opcode, MOBLEBOOL reliable, MOBLEUINT16 min_payload_size,
MOBLEUINT16 max_payload_size;
Here in this array, Handler is not defined; */
#ifdef ENABLE_GENERIC_MODEL_SERVER_ONOFF
- {GENERIC_ON_OFF_GET, MOBLE_TRUE, 0, 0, GENERIC_ON_OFF_STATUS , 1, 3},
- {GENERIC_ON_OFF_SET_ACK, MOBLE_TRUE, 2, 4, GENERIC_ON_OFF_STATUS , 1, 3},
- {GENERIC_ON_OFF_SET_UNACK, MOBLE_FALSE, 2, 4, 0, 0, 0},
+ {GENERIC_ON_OFF_GET, MOBLE_TRUE, 0, 0, GENERIC_ON_OFF_STATUS , 1, 3},
+ {GENERIC_ON_OFF_SET_ACK, MOBLE_TRUE, 2, 4, GENERIC_ON_OFF_STATUS , 1, 3},
+ {GENERIC_ON_OFF_SET_UNACK, MOBLE_FALSE, 2, 4, 0 , 1, 3},
+ {GENERIC_ON_OFF_STATUS, MOBLE_FALSE, 1, 3, 0 , 1, 3},
#endif
#ifdef ENABLE_GENERIC_MODEL_SERVER_LEVEL
- /* Generic Level Server */
- {GENERIC_LEVEL_GET, MOBLE_TRUE, 0, 0, GENERIC_LEVEL_STATUS , 2 , 5},
- {GENERIC_LEVEL_SET_ACK, MOBLE_TRUE, 3, 5, GENERIC_LEVEL_STATUS , 2 , 5},
- {GENERIC_LEVEL_SET_UNACK, MOBLE_FALSE, 3, 5, 0, 0 , 0},
- {GENERIC_LEVEL_DELTA_SET, MOBLE_TRUE, 5, 7, GENERIC_LEVEL_STATUS , 2 , 5},
- {GENERIC_LEVEL_DELTA_SET_UNACK, MOBLE_FALSE, 5, 7, 0, 0, 0},
- {GENERIC_LEVEL_DELTA_MOVE_SET, MOBLE_TRUE, 3, 5, GENERIC_LEVEL_STATUS , 2 , 5},
- {GENERIC_LEVEL_DELTA_MOVE_SET_UNACK, MOBLE_FALSE, 3, 5, 0, 0 , 0},
+ /* Generic Level Server */
+ {GENERIC_LEVEL_GET, MOBLE_TRUE, 0, 0, GENERIC_LEVEL_STATUS , 2 , 5},
+ {GENERIC_LEVEL_SET_ACK, MOBLE_TRUE, 3, 5, GENERIC_LEVEL_STATUS , 2 , 5},
+ {GENERIC_LEVEL_SET_UNACK, MOBLE_FALSE, 3, 5, 0 , 2 , 5},
+ {GENERIC_LEVEL_DELTA_SET, MOBLE_TRUE, 5, 7, GENERIC_LEVEL_STATUS , 2 , 5},
+ {GENERIC_LEVEL_DELTA_SET_UNACK, MOBLE_FALSE, 5, 7, 0, 0, 0},
+ {GENERIC_LEVEL_DELTA_MOVE_SET, MOBLE_TRUE, 3, 5, GENERIC_LEVEL_STATUS , 2 , 5},
+ {GENERIC_LEVEL_DELTA_MOVE_SET_UNACK, MOBLE_FALSE, 3, 5, 0, 0 , 0},
+ {GENERIC_LEVEL_STATUS, MOBLE_FALSE, 2, 5, 0 , 2 , 5},
+#endif
+#ifdef ENABLE_GENERIC_MODEL_SERVER_POWER_ONOFF
+ {GENERIC_POWER_ON_OFF_SET, MOBLE_TRUE, 1, 1, GENERIC_POWER_ON_OFF_STATUS, 1,1},
+ {GENERIC_POWER_ON_OFF_SET_UNACK, MOBLE_FALSE, 1, 1, 0, 1,1},
+ {GENERIC_POWER_ON_OFF_GET , MOBLE_TRUE, 1, 1, GENERIC_POWER_ON_OFF_STATUS, 1,1},
+ {GENERIC_POWER_ON_OFF_STATUS , MOBLE_FALSE, 1, 1, 0, 1,1},
#endif
#ifdef ENABLE_GENERIC_MODEL_SERVER_DEFAULT_TRANSITION_TIME
- /* Generic Default Transition Time Server Model */
- {GENERIC_DEFAULT_TRANSITION_TIME_GET, MOBLE_TRUE, 0, 0, GENERIC_DEFAULT_TRANSITION_TIME_STATUS , 1, 1},
- {GENERIC_DEFAULT_TRANSITION_TIME_SET, MOBLE_TRUE, 1, 1, GENERIC_DEFAULT_TRANSITION_TIME_STATUS , 1, 1},
- {GENERIC_DEFAULT_TRANSITION_TIME_SET_UNACK, MOBLE_FALSE, 1, 1, 0 ,0 ,0},
+ /* Generic Default Transition Time Server Model */
+ {GENERIC_DEFAULT_TRANSITION_TIME_GET, MOBLE_TRUE, 0, 0, GENERIC_DEFAULT_TRANSITION_TIME_STATUS , 1, 1},
+ {GENERIC_DEFAULT_TRANSITION_TIME_SET, MOBLE_TRUE, 1, 1, GENERIC_DEFAULT_TRANSITION_TIME_STATUS , 1, 1},
+ {GENERIC_DEFAULT_TRANSITION_TIME_SET_UNACK, MOBLE_FALSE, 1, 1, 0 ,0 ,0},
+ {GENERIC_DEFAULT_TRANSITION_TIME_STATUS, MOBLE_FALSE, 1, 1, 0 ,1, 1},
#endif
#ifdef ENABLE_GENERIC_MODEL_SERVER_BATTERY
- /* Generic Battery Server Model */
- {GENERIC_BATTERY_GET, MOBLE_TRUE, 0, 0, GENERIC_BATTERY_STATUS , 8 , 8},
+ /* Generic Battery Server Model */
+ {GENERIC_BATTERY_GET, MOBLE_TRUE, 0, 0, GENERIC_BATTERY_STATUS , 8 , 8},
#endif
- {0}
+ {0}
};
-extern MOBLEUINT16 CommandStatus;
/* Private function prototypes -----------------------------------------------*/
WEAK_FUNCTION (MOBLE_RESULT Appli_Generic_OnOff_Set(Generic_OnOffStatus_t* pGeneric_OnOffParam,
- MOBLEUINT8 OptionalValid));
+ MOBLEUINT8 OptionalValid));
WEAK_FUNCTION (MOBLE_RESULT Appli_Generic_Level_Set(Generic_LevelStatus_t* plevelParam,
- MOBLEUINT8 OptionalValid));
+ MOBLEUINT8 OptionalValid));
WEAK_FUNCTION (MOBLE_RESULT Appli_Generic_LevelDelta_Set(Generic_LevelStatus_t* pdeltalevelParam,
- MOBLEUINT8 OptionalValid));
+ MOBLEUINT8 OptionalValid));
WEAK_FUNCTION (MOBLE_RESULT Appli_Generic_LevelMove_Set(Generic_LevelStatus_t* pdeltaMoveParam,
- MOBLEUINT8 OptionalValid));
+ MOBLEUINT8 OptionalValid));
+WEAK_FUNCTION (MOBLE_RESULT Appli_Generic_PowerOnOff_Set(Generic_PowerOnOffParam_t* pPowerOnOffParam,
+ MOBLEUINT8 OptionalValid));
+WEAK_FUNCTION (MOBLE_RESULT Appli_Generic_DefaultTransitionTime_Set(Generic_DefaultTransitionParam_t* pDefaultTimeParam,
+ MOBLEUINT8 OptionalValid));
/* Private functions ---------------------------------------------------------*/
@@ -134,75 +154,82 @@ MOBLE_RESULT Generic_OnOff_Set(MOBLEUINT8 const *pOnOff_param, MOBLEUINT32 lengt
Transition Time: 1B Format as defined in Section 3.1.3. (Optional)
Delay: 1B Message execution delay in 5 millisecond steps (C.1)
*/
+ Generic_OnOffParam_t Generic_OnOffParam;
TRACE_M(TF_GENERIC,"Generic_OnOff_Set callback received \r\n");
- Generic_OnOffParam_t Generic_OnOffParam;
-
Generic_OnOffParam.TargetOnOffState = pOnOff_param[0];
Generic_OnOffParam.Generic_TID = pOnOff_param[1];
CommandStatus = pOnOff_param[0];
+
if(length > 2)
{
- /* Transition_Time & Delay_Time Present */
- Generic_OnOffParam.Transition_Time = pOnOff_param[2];
- Generic_OnOffParam.Delay_Time = pOnOff_param[3];
-
- /* Copy the received data in status message which needs
- to be set in application messages
- */
- Generic_OnOffStatus.Target_OnOff = Generic_OnOffParam.TargetOnOffState;;
- Generic_OnOffStatus.RemainingTime = Generic_OnOffParam.Transition_Time;
+ /* Transition_Time & Delay_Time Present */
+ Generic_OnOffParam.Transition_Time = pOnOff_param[2];
+ Generic_OnOffParam.Delay_Time = pOnOff_param[3];
- /* copy status parameters in Temporary parameters for transition
- process
- */
-#ifdef GENERIC_ONOFF_PWM_STATE_ENABLE
- /*
- The Deafult value for the pwm set for generic on off
- */
+ /* Copy the received data in status message which needs
+ to be set in application messages
+ */
+ Generic_OnOffStatus.Target_OnOff = Generic_OnOffParam.TargetOnOffState;
+ Generic_OnOffStatus.RemainingTime = Generic_OnOffParam.Transition_Time;
+ /* copy status parameters in Temporary parameters for transition
+ process
+ */
+ if(Generic_OnOffParam.TargetOnOffState == 1)
+ {
Generic_TemporaryStatus.TargetValue16 = PWM_TIME_PERIOD;
-#else
- Generic_TemporaryStatus.TargetValue16 = Generic_OnOffStatus.Target_OnOff;
-#endif
- Generic_TemporaryStatus.RemainingTime = Generic_OnOffStatus.RemainingTime;
- /* Function to calculate time parameters, step resolution
- step size for transition state machine
- */
- Generic_GetStepValue(pOnOff_param[2]);
-
- /*option parameter flag, enable to sent all required parameter in status.*/
- Generic_ModelFlag.GenericOptionalParam = 1;
- /*Flag to enable the on Off transition state machine */
- Generic_ModelFlag.GenericTransitionFlag = 1;
+ Generic_OnOffStatus.Present_OnOff_Value = 1;
+ }
+ else
+ {
+ Generic_TemporaryStatus.TargetValue16 = 1;
+ }
+ Generic_TemporaryStatus.RemainingTime = Generic_OnOffStatus.RemainingTime;
+ /* Function to calculate time parameters, step resolution
+ step size for transition state machine
+ */
+ Generic_GetStepValue(pOnOff_param[2]);
+ /*option parameter flag, enable to sent all required parameter in status.*/
+ Generic_ModelFlag.GenericOptionalParam = 1;
+ /*Flag to enable the on Off transition state machine */
+ Generic_ModelFlag.GenericTransitionFlag = GENERIC_ON_OFF_TRANSITION_START;
+ OptionalValid = IN_TRANSITION;
}
else
{
- /* When no optional parameter received, target value will
- be set as present value in application.
+ /* when default transition time enabled,and the target time is not given by client
+ the transition time will be used from default value
*/
-#ifdef GENERIC_ONOFF_PWM_STATE_ENABLE
- if(Generic_OnOffParam.TargetOnOffState == 1)
- {
- Generic_OnOffStatus.Present_OnOff = PWM_TIME_PERIOD;
- }
- else
- {
- Generic_OnOffStatus.Present_OnOff = Generic_OnOffParam.TargetOnOffState; ;
- }
+#ifdef ENABLE_GENERIC_MODEL_SERVER_DEFAULT_TRANSITION_TIME
+ if(Generic_OnOffParam.TargetOnOffState == 1)
+ {
+ Generic_TemporaryStatus.TargetValue16 = PWM_TIME_PERIOD;
+ Generic_OnOffStatus.Present_OnOff_Value = 1;
+ }
+ else
+ {
+ Generic_TemporaryStatus.TargetValue16 = 1;
+ }
+ Generic_OnOffDefaultTransitionValue();
+ OptionalValid = DEFAULT_TRANSITION;
#else
- Generic_OnOffStatus.Present_OnOff = Generic_OnOffParam.TargetOnOffState;
-#endif
+ /* When no optional parameter received, target value will be set as present
+ value in application.
+ */
+ Generic_OnOffStatus.Present_OnOff_State = Generic_OnOffParam.TargetOnOffState;
+ OptionalValid = NO_TRANSITION;
+#endif
}
- /* Application Callback */
- (GenericAppli_cb.OnOff_Set_cb)(&Generic_OnOffStatus, 0);
+ /* Application Callback */
+ (GenericAppli_cb.OnOff_Set_cb)(&Generic_OnOffStatus, OptionalValid);
#ifdef ENABLE_MODEL_BINDING
- /* Binding of data b/w Generic on off and Light lightness Actual model */
- GenericOnOff_LightActualBinding(&Generic_OnOffParam);
+ /* Binding of data b/w Generic on off and Light lightness Actual model */
+ GenericOnOff_LightActualBinding(&Generic_OnOffParam);
#endif
- return MOBLE_RESULT_SUCCESS;
+ return MOBLE_RESULT_SUCCESS;
}
@@ -226,11 +253,11 @@ MOBLE_RESULT Generic_OnOff_Status(MOBLEUINT8* pOnOff_status, MOBLEUINT32 *plengt
/* Function call back to get the values from application*/
(Appli_GenericState_cb.GetOnOffStatus_cb)(Generic_GetBuff);
- Generic_OnOffStatus.Present_OnOff = Generic_GetBuff[0];
+ Generic_OnOffStatus.Present_OnOff_State = Generic_GetBuff[0];
if((Generic_ModelFlag.GenericOptionalParam == 1) || (Generic_TimeParam.StepValue != 0))
{
- *pOnOff_status = Generic_OnOffStatus.Present_OnOff;
+ *pOnOff_status = Generic_OnOffStatus.Present_OnOff_State;
*(pOnOff_status+1) = Generic_OnOffStatus.Target_OnOff;
*(pOnOff_status+2) = Generic_OnOffStatus.RemainingTime;
*plength = 3;
@@ -240,9 +267,10 @@ MOBLE_RESULT Generic_OnOff_Status(MOBLEUINT8* pOnOff_status, MOBLEUINT32 *plengt
{ /* When no optional parameter received, target value will
be sent in status message.
*/
- *pOnOff_status = Generic_OnOffStatus.Present_OnOff;
+ *pOnOff_status = Generic_OnOffStatus.Present_OnOff_State;
*plength = 1;
}
+
return MOBLE_RESULT_SUCCESS;
}
@@ -293,16 +321,21 @@ MOBLE_RESULT Generic_Level_Set(const MOBLEUINT8* plevel_param, MOBLEUINT32 lengt
*/
Generic_GetStepValue(plevel_param[3]);
/*option parameter flag, enable to sent all required parameter in status.*/
-
+ Generic_ModelFlag.GenericOptionalParam = 1;
/*transition process enable flag. */
- Generic_ModelFlag.GenericTransitionFlag = 2;
+ Generic_ModelFlag.GenericTransitionFlag = GENERIC_LEVEL_TRANSITION_START;
}
else
{
+#ifdef ENABLE_GENERIC_MODEL_SERVER_DEFAULT_TRANSITION_TIME
+
+ Generic_LevelDefaultTransitionValue(setValue);
+#else
/* When no optional parameter received, target value will
be set as present value in application.
*/
Generic_LevelStatus.Present_Level16= setValue;
+#endif
}
Generic_LevelStatus.Last_Present_Level16 = Generic_LevelStatus.Present_Level16;
@@ -380,7 +413,7 @@ MOBLE_RESULT Generic_LevelDelta_Set(const MOBLEUINT8* plevel_param, MOBLEUINT32
Generic_ModelFlag.GenericOptionalParam = 1;
/*transition process enable flag. */
- Generic_ModelFlag.GenericTransitionFlag = 2;
+ Generic_ModelFlag.GenericTransitionFlag = GENERIC_LEVEL_TRANSITION_START;
}
else
{
@@ -444,9 +477,8 @@ MOBLE_RESULT Generic_LevelMove_Set(const MOBLEUINT8* plevel_param, MOBLEUINT32 l
Generic_GetStepValue(plevel_param[3]);
/*option parameter flag, enable to sent all required parameter in status.*/
Generic_ModelFlag.GenericOptionalParam = 1;
-
/*transition process enable flag. */
- Generic_ModelFlag.GenericTransitionFlag = 2;
+ Generic_ModelFlag.GenericTransitionFlag = GENERIC_LEVEL_TRANSITION_START;
}
else
{
@@ -517,6 +549,99 @@ MOBLE_RESULT Generic_Level_Status(MOBLEUINT8* plevel_status, MOBLEUINT32 *plengt
return MOBLE_RESULT_SUCCESS;
}
+/**
+* @brief Generic_PowerOnOff_Set: This function is called for both
+Acknowledged and unacknowledged message
+* @param powerOnOff_param: Pointer to the parameters received for message
+* @param length: Length of the parameters received for message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Generic_PowerOnOff_Set(const MOBLEUINT8 *powerOnOff_param , MOBLEUINT32 length)
+{
+ /*
+ 3.2.4.2 Generic Power On Off Time
+ Following is the set message:
+ powerOnOff_param:1B parameter is received to set the power on off model.
+ */
+ TRACE_M(TF_GENERIC,"Generic_PowerOnOff_Set callback received \r\n");
+
+ Generic_PowerOnOffParam_t Generic_PowerOnOffParam;
+ Generic_PowerOnOffParam.PowerOnOffState = powerOnOff_param[0];
+
+ /* Application Callback */
+ (GenericAppli_cb.GenericPowerOnOff_cb)(&Generic_PowerOnOffParam, length);
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Generic_PowerOnOff_Status
+* @param powerOnOff_status: Pointer to the status message, which needs to be updated
+* @param plength: Pointer to the Length of the Status message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Generic_PowerOnOff_Status(MOBLEUINT8 *powerOnOff_status , MOBLEUINT32 *plength)
+{
+ /*
+ 3.2.4.4 Generic OnPowerUp Status
+ Following is the status message:
+ powerOnOff_status: 1B is the status parameter of the Power on off model.
+ */
+ MOBLEUINT8 Generic_GetBuff[2] ;
+ TRACE_M(TF_GENERIC,"Generic_PowerOnOff_Status callback received \r\n");
+ /* Function call back to get the values from application*/
+ (Appli_GenericState_cb.GetPowerOnOffStatus_cb)(Generic_GetBuff);
+
+ *(powerOnOff_status) = Generic_GetBuff[0];
+ *plength = 1;
+
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Generic_DefaultTransitionTime_Set: This function is called for both
+Acknowledged and unacknowledged message
+* @param defaultTransition_param: Pointer to the parameters received for message
+* @param length: Length of the parameters received for message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Generic_DefaultTransitionTime_Set(const MOBLEUINT8 *defaultTransition_param , MOBLEUINT32 length)
+{
+ /*
+ 3.2.3.2 Generic Default Transition Time Set
+ Following is the set message:
+ defaultTime_param:1B parameter is received to set the Default transition time model.
+ */
+ TRACE_M(TF_GENERIC,"Generic_DefaultTransitionTime_Set callback received \r\n");
+
+ Generic_DefaultTransitionParam.DefaultTransitionTime = defaultTransition_param[0];
+ /* Application Callback */
+ (GenericAppli_cb.GenericDefaultTransition_cb)(&Generic_DefaultTransitionParam, length);
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Generic_DefaultTransitionTime_Status
+* @param pTransition_status: Pointer to the status message, which needs to be updated
+* @param plength: Pointer to the Length of the Status message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Generic_DefaultTransitionTime_Status(MOBLEUINT8 *pTransition_status , MOBLEUINT32 *plength)
+{
+ /*
+ 3.2.3.4 Generic Default Transition Time Status
+ Following is the status message:
+ powerOnOff_status: 1B is the status parameter of the Default transition time model.
+ */
+ MOBLEUINT8 Generic_GetBuff[2] ;
+ TRACE_M(TF_GENERIC,"Generic_DefaultTransitionTime_Status callback received \r\n");
+ /* Function call back to get the values from application*/
+ (Appli_GenericState_cb.GetDefaultTransitionStatus_cb)(Generic_GetBuff);
+
+ *(pTransition_status) = Generic_GetBuff[0];
+ *plength = 1;
+
+ return MOBLE_RESULT_SUCCESS;
+}
/**
* @brief GenericModelServer_GetOpcodeTableCb: This function is call-back
@@ -559,25 +684,39 @@ MOBLE_RESULT GenericModelServer_GetStatusRequestCb(MOBLE_ADDRESS peer_addr,
MOBLEBOOL response)
{
- TRACE_M(TF_GENERIC,"response status enbale \n\r");
+ TRACE_M(TF_GENERIC,"response status enable \n\r");
switch(opcode)
{
+#ifdef ENABLE_GENERIC_MODEL_SERVER_ONOFF
case GENERIC_ON_OFF_STATUS:
{
-#ifdef ENABLE_GENERIC_MODEL_SERVER_ONOFF
Generic_OnOff_Status(pResponsedata, plength);
-#endif
break;
}
+#endif
+#ifdef ENABLE_GENERIC_MODEL_SERVER_LEVEL
case GENERIC_LEVEL_STATUS:
{
-
-#ifdef ENABLE_GENERIC_MODEL_SERVER_LEVEL
Generic_Level_Status(pResponsedata, plength);
+ break;
+ }
#endif
+
+#ifdef ENABLE_GENERIC_MODEL_SERVER_POWER_ONOFF
+ case GENERIC_POWER_ON_OFF_STATUS:
+ {
+ Generic_PowerOnOff_Status(pResponsedata, plength);
break;
}
+#endif
+
+#ifdef ENABLE_GENERIC_MODEL_SERVER_DEFAULT_TRANSITION_TIME
+ case GENERIC_DEFAULT_TRANSITION_TIME_STATUS:
+ {
+ Generic_DefaultTransitionTime_Status(pResponsedata, plength);
+ }
+#endif
default:
{
break;
@@ -616,6 +755,7 @@ MOBLE_RESULT GenericModelServer_ProcessMessageCb(MOBLE_ADDRESS peer_addr,
TRACE_M(TF_GENERIC,"dst_peer = %.2X , peer_add = %.2X, opcode= %.2X ,response= %.2X \r\n ",
dst_peer, peer_addr, opcode , response);
+ Generic_Rx_Opcode = opcode;
switch(opcode)
{
#ifdef ENABLE_GENERIC_MODEL_SERVER_ONOFF
@@ -647,6 +787,12 @@ MOBLE_RESULT GenericModelServer_ProcessMessageCb(MOBLE_ADDRESS peer_addr,
break;
}
+
+ case GENERIC_ON_OFF_STATUS:
+ {
+ Generic_Client_OnOff_Status(pRxData,dataLength);
+ break;
+ }
#endif
#ifdef ENABLE_GENERIC_MODEL_SERVER_LEVEL
@@ -673,12 +819,7 @@ MOBLE_RESULT GenericModelServer_ProcessMessageCb(MOBLE_ADDRESS peer_addr,
Transition Time 1 Format as defined in Section 3.1.3. (Optional)
Delay 1 Message execution delay in 5 milliseconds steps (C.1)
*/
-
- result = Chk_ParamMinMaxValidity(LEVEL_MIN_VALID_RANGE ,pRxData , LEVEL_MAX_VALID_RANGE );
- if(result == MOBLE_RESULT_SUCCESS)
- {
Generic_LevelDelta_Set(pRxData,dataLength);
- }
break;
}
@@ -693,7 +834,51 @@ MOBLE_RESULT GenericModelServer_ProcessMessageCb(MOBLE_ADDRESS peer_addr,
}
break;
}
+ case GENERIC_LEVEL_STATUS:
+ {
+ Generic_Client_Level_Status(pRxData,dataLength);
+ break;
+ }
#endif
+
+#ifdef ENABLE_GENERIC_MODEL_SERVER_POWER_ONOFF
+
+ case GENERIC_POWER_ON_OFF_SET:
+ case GENERIC_POWER_ON_OFF_SET_UNACK:
+ {
+ result = Chk_ParamValidity(pRxData[0], GENERIC_POWER_RESTORE_STATE);
+ if(result == MOBLE_RESULT_SUCCESS)
+ {
+ Generic_PowerOnOff_Set(pRxData, dataLength);
+ }
+ break;
+ }
+ case GENERIC_POWER_ON_OFF_STATUS:
+ {
+ Generic_Client_PowerOnOff_Status(pRxData,dataLength);
+ break;
+ }
+#endif
+
+#ifdef ENABLE_GENERIC_MODEL_SERVER_DEFAULT_TRANSITION_TIME
+
+ case GENERIC_DEFAULT_TRANSITION_TIME_SET:
+ case GENERIC_DEFAULT_TRANSITION_TIME_SET_UNACK:
+ {
+ result = Chk_ParamValidity(pRxData[0], TRANSITION_MAX_VALID_RANGE);
+ if(result == MOBLE_RESULT_SUCCESS)
+ {
+ Generic_DefaultTransitionTime_Set(pRxData, dataLength);
+ }
+ break;
+ }
+ case GENERIC_DEFAULT_TRANSITION_TIME_STATUS:
+ {
+ Generic_Client_DefaultTransitionTime_Status(pRxData, dataLength);
+ break;
+ }
+#endif
+
default:
{
break;
@@ -704,6 +889,14 @@ MOBLE_RESULT GenericModelServer_ProcessMessageCb(MOBLE_ADDRESS peer_addr,
{
Model_SendResponse(peer_addr, dst_peer,opcode, pRxData,dataLength);
}
+
+ /*
+ Publish the status to publish address if the publication is set by client
+ publication is independent of the response of the message.if thek condition
+ for publication is full filled as per specification then the status will be
+ published.
+ */
+
return MOBLE_RESULT_SUCCESS;
}
@@ -732,17 +925,17 @@ MOBLE_RESULT Generic_TransitionBehaviourSingle_Param(MOBLEUINT8 *GetValue)
Generic_TemporaryStatus.PresentValue16 = GetValue[1] << 8;
Generic_TemporaryStatus.PresentValue16 |= GetValue[0];
-
/*if condition to wait untill the time is equal to the given resolution time */
if(((Clock_Time()- Check_time) >= Generic_TimeParam.Res_Value))
{
-
if(Generic_TimeParam.StepValue == 0)
{
Generic_TimeParam.StepValue = 1;
}
+
if(Generic_TemporaryStatus.TargetValue16 > Generic_TemporaryStatus.PresentValue16)
{
+ Generic_OnOffStatus.Present_OnOff_State = 1;
/* target range = total range to be covered */
targetRange = Generic_TemporaryStatus.TargetValue16 - Generic_TemporaryStatus.PresentValue16;
/*target slot = time to cover in single step */
@@ -750,8 +943,9 @@ MOBLE_RESULT Generic_TransitionBehaviourSingle_Param(MOBLEUINT8 *GetValue)
/* target slot added to present value to achieve target value */
Generic_TemporaryStatus.PresentValue16 += targetSlot;
}
- else
+ else if(Generic_TemporaryStatus.TargetValue16 < Generic_TemporaryStatus.PresentValue16)
{
+ Generic_OnOffStatus.Present_OnOff_State = 0;
/* condition execute when transition is negative */
/* target range = total range to be covered */
targetRange = Generic_TemporaryStatus.PresentValue16 - Generic_TemporaryStatus.TargetValue16;
@@ -760,21 +954,26 @@ MOBLE_RESULT Generic_TransitionBehaviourSingle_Param(MOBLEUINT8 *GetValue)
/*target slot = time to cover in single step */
Generic_TemporaryStatus.PresentValue16 -= targetSlot;
}
+ else
+ {
+
+ }
Generic_TimeParam.StepValue--;
/* updating the remaining time after each step covered*/
Generic_TemporaryStatus.RemainingTime = Generic_TimeParam.StepValue | (Generic_TimeParam.ResBitValue << 6) ;
Check_time = 0;
Clockflag = 0;
+ GeneicUpdateFlag = VALUE_UPDATE_SET;
/* when transition is completed, disable the transition by disabling
transition flag
*/
if(Generic_TimeParam.StepValue <= 0)
{
- Generic_ModelFlag.GenericTransitionEnd = Generic_ModelFlag.GenericTransitionFlag;
- Generic_ModelFlag.GenericTransitionFlag = 0;
+ Generic_ModelFlag.GenericTransitionFlag = GENERIC_TRANSITION_STOP;
+ Generic_Trnsn_Cmplt = 1;
}
- TRACE_M(TF_GENERIC,"Inside virtual application at %d, Current state 0x%.2x, Target state 0x%.2x, Remaining Time 0x%.2x \n\r",
+ TRACE_M(TF_GENERIC,"Inside virtual application at %ld, Current state 0x%.2x, Target state 0x%.2x, Remaining Time 0x%.2x \n\r",
Clock_Time(), Generic_TemporaryStatus.PresentValue16,Generic_TemporaryStatus.TargetValue16,Generic_TemporaryStatus.RemainingTime);
}
return MOBLE_RESULT_SUCCESS;
@@ -794,6 +993,7 @@ MOBLE_RESULT Generic_TransitionBehaviourMulti_Param(MOBLEUINT8 *GetValue)
static MOBLEUINT32 Check_time;
MOBLEUINT16 targetRange;
MOBLEUINT16 targetSlot;
+
/* Taking the time stamp for particular time */
if(Clockflag == 0)
{
@@ -835,14 +1035,16 @@ MOBLE_RESULT Generic_TransitionBehaviourMulti_Param(MOBLEUINT8 *GetValue)
Check_time = 0;
Clockflag = 0;
+ GeneicUpdateFlag = VALUE_UPDATE_SET;
/* when transition is completed, disable the transition by disabling
transition flag
*/
if(Generic_TimeParam.StepValue <= 0)
{
- Generic_ModelFlag.GenericTransitionFlag = 0;
+ Generic_ModelFlag.GenericTransitionFlag = GENERIC_TRANSITION_STOP;
+ Generic_Trnsn_Cmplt = 1;
}
- TRACE_M(TF_GENERIC,"Inside virtual level application at %d, Current state 0x%.2x , target state 0x%.2x , Remaining Time 0x%.2x \n\r",
+ TRACE_M(TF_GENERIC,"Inside virtual level application at %ld, Current state 0x%.2x , target state 0x%.2x , Remaining Time 0x%.2x \n\r",
Clock_Time(),Generic_TemporaryStatus.PresentValue16,Generic_TemporaryStatus.TargetValue16,
Generic_TemporaryStatus.RemainingTime);
}
@@ -877,7 +1079,7 @@ void Generic_GetStepValue(MOBLEUINT8 stepParam)
Generic_TimeParam.StepValue = (Generic_TimeParam.StepValue * TRANSITION_SCALER);
}
- TRACE_M(TF_GENERIC," step resolution 0x%.2x, number of step 0x%.2x \r\n",
+ TRACE_M(TF_GENERIC," step resolution 0x%.2lx, number of step 0x%.2x \r\n",
Generic_TimeParam.Res_Value , Generic_TimeParam.StepValue );
}
@@ -895,25 +1097,33 @@ void Generic_Process(void)
#endif
#ifdef ENABLE_GENERIC_MODEL_SERVER_ONOFF
- if(Generic_ModelFlag.GenericTransitionFlag == 1)
+ if(Generic_ModelFlag.GenericTransitionFlag == GENERIC_ON_OFF_TRANSITION_START)
{
- (Appli_GenericState_cb.GetOnOffStatus_cb)(Generic_GetBuff);
+ (Appli_GenericState_cb.GetOnOffValue_cb)(Generic_GetBuff);
Generic_TransitionBehaviourSingle_Param(Generic_GetBuff);
+ if(GeneicUpdateFlag == VALUE_UPDATE_SET)
+ {
GenericOnOffStateUpdate_Process();
- (GenericAppli_cb.OnOff_Set_cb)(&Generic_OnOffStatus, 0);
+ (GenericAppli_cb.OnOff_Set_cb)(&Generic_OnOffStatus, OptionalValid);
+ GeneicUpdateFlag = VALUE_UPDATE_RESET;
+ }
}
#endif
#ifdef ENABLE_GENERIC_MODEL_SERVER_LEVEL
- if(Generic_ModelFlag.GenericTransitionFlag == 2)
+ if(Generic_ModelFlag.GenericTransitionFlag == GENERIC_LEVEL_TRANSITION_START)
{
(Appli_GenericState_cb.GetLevelStatus_cb)(Generic_GetBuff);
Generic_TransitionBehaviourMulti_Param(Generic_GetBuff);
+ if(GeneicUpdateFlag == VALUE_UPDATE_SET)
+ {
GenericLevelStateUpdate_Process();
(GenericAppli_cb.Level_Set_cb)(&Generic_LevelStatus, 0);
+ GeneicUpdateFlag = VALUE_UPDATE_RESET;
+ }
+
}
#endif
-
}
@@ -955,8 +1165,7 @@ void Generic_Publish(MOBLE_ADDRESS publishAddress, MOBLEUINT8 elementIndex)
*/
MOBLE_RESULT GenericOnOffStateUpdate_Process(void)
{
- Generic_OnOffStatus.Present_OnOff = Generic_TemporaryStatus.PresentValue16;
- Generic_OnOffStatus.Target_OnOff = Generic_TemporaryStatus.TargetValue16;
+ Generic_OnOffStatus.Present_OnOff_Value = Generic_TemporaryStatus.PresentValue16;
Generic_OnOffStatus.RemainingTime = Generic_TemporaryStatus.RemainingTime;
return MOBLE_RESULT_SUCCESS;
@@ -1037,7 +1246,7 @@ void GenericOnOff_LightActualBinding(Generic_OnOffParam_t* onOff_param)
/* implicit binding of lightness linear with generic on off set.
generic on off set -> actual lightness -> linear lightness set.
*/
- Light_Linear_ActualImplicitBinding(BINDING_LIGHT_LIGHTNESS_ACTUAL_SET);
+ Light_Linear_ActualImplicitBinding(BINDING_LIGHT_LIGHTNESS_ACTUAL_SET , 0);
}
@@ -1085,8 +1294,8 @@ void GenericLevel_CtlTempBinding(Generic_LevelParam_t * bLevelParam)
Light_CtlStatus_t bCtlTempstatus;
MOBLEUINT32 productValue;
- productValue = (bLevelParam->TargetLevel + 32768) * (0x4E20 - 0x0320) ;
- bCtlTempstatus.PresentCtlTemperature16 = 0x0320 + ((productValue) /65535);
+ productValue = (bLevelParam->TargetLevel + 32768) * (MAX_CTL_TEMP_RANGE - MIN_CTL_TEMP_RANGE) ;
+ bCtlTempstatus.PresentCtlTemperature16 = MIN_CTL_TEMP_RANGE + ((productValue) /65535);
/* Application callback */
(LightAppli_cb.Light_CtlTemperature_Set_cb)(&bCtlTempstatus, 0);
}
@@ -1130,42 +1339,103 @@ void GenericLevel_HslSaturationBinding(Generic_LevelParam_t * bLevelParam)
}
/*
-* @brief Save generic states in nvm
-* @param void.
+* @brief function to assign the Pwm value to the target value of the generic on off
+* saved states.
+* @param void:
* return void.
*/
-MOBLE_RESULT Generic_SaveStateNvm(MOBLEUINT8 flag)
+void Generic_OnOffDefaultTransitionValue(void)
{
- return MOBLE_RESULT_SUCCESS;
+ Generic_TemporaryStatus.RemainingTime = Generic_DefaultTransitionParam.DefaultTransitionTime;
+ Generic_GetStepValue((MOBLEUINT8)Generic_DefaultTransitionParam.DefaultTransitionTime);
+ Generic_ModelFlag.GenericTransitionFlag = GENERIC_ON_OFF_TRANSITION_START;
+ Generic_ModelFlag.GenericOptionalParam = 1;
}
/*
-* @brief function to call Generic middle layer function for restoration of
-* saved states.
-* @param void.
+* @brief function called in generic level when the default transition time is enabled.
+* @param levelValue: generic level target value
* return void.
*/
-void Generic_RestoreStates(MOBLEUINT8 const *pModelState_Load, MOBLEUINT8 size)
+void Generic_LevelDefaultTransitionValue(MOBLEUINT16 levelValue)
+{
+ Generic_TemporaryStatus.TargetValue16 = levelValue;
+ Generic_TemporaryStatus.RemainingTime = Generic_DefaultTransitionParam.DefaultTransitionTime;
+ Generic_GetStepValue((MOBLEUINT8)Generic_DefaultTransitionParam.DefaultTransitionTime);
+ Generic_ModelFlag.GenericTransitionFlag = GENERIC_LEVEL_TRANSITION_START;
+ Generic_ModelFlag.GenericOptionalParam = 1;
+}
+
+/*
+* @brief Generic_Client_OnOff_Status: Function called when status of the model
+ received on the client.
+* @param pOnOff_status: ointer to the parameters received for message
+* @param plength: Length of the parameters received for message
+* return MOBLE_RESULT_SUCCESS.
+*/
+MOBLE_RESULT Generic_Client_OnOff_Status(MOBLEUINT8 const *pOnOff_status, MOBLEUINT32 plength)
+{
+ MOBLEUINT32 i;
+
+ TRACE_M(TF_SERIAL_CTRL,"Generic_OnOff_Status callback received \r\n");
+ for(i = 0; i < plength; i++)
+ TRACE_M(TF_SERIAL_CTRL,"Generic_OnOff_Status: %d\r\n",
+ pOnOff_status[i]);
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/*
+* @brief Generic_Client_Level_Status: Function called when status of the model
+ received on the client.
+* @param plevel_status: ointer to the parameters received for message
+* @param plength: Length of the parameters received for message
+* return MOBLE_RESULT_SUCCESS.
+*/
+MOBLE_RESULT Generic_Client_Level_Status(MOBLEUINT8 const *plevel_status, MOBLEUINT32 plength)
+{
+ MOBLEUINT32 i;
+
+ TRACE_M(TF_GENERIC,"Generic_Level_Status callback received \r\n");
+ for(i = 0; i < plength; i++)
+ TRACE_M(TF_SERIAL_CTRL,"Generic_Level_Status: %d\r\n",
+ plevel_status[i]);
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/*
+* @brief Generic_Client_PowerOnOff_Status: Function called when status of the model
+ received on the client.
+* @param powerOnOff_status: ointer to the parameters received for message
+* @param plength: Length of the parameters received for message
+* return MOBLE_RESULT_SUCCESS.
+*/
+MOBLE_RESULT Generic_Client_PowerOnOff_Status(MOBLEUINT8 const *powerOnOff_status , MOBLEUINT32 plength)
{
- if (size > 0)
- {
- if (pModelState_Load[0] == GENERIC_ON_OFF_FLAG)
- {
- Generic_OnOff_Set(pModelState_Load+GENERIC_ON_OFF_NVM_OFFSET, 1);
- }
- else if(pModelState_Load[0] == GENERIC_LEVEL_FLAG)
- {
- Generic_Level_Set(pModelState_Load+GENERIC_LEVEL_NVM_OFFSET,2);
- }
- else
- {
- TRACE_M(TF_GENERIC, "data is invalid %d \r\n", pModelState_Load[0]);
- }
- }
- else
- {
- TRACE_M(TF_GENERIC, "size is invalid \r\n");
- }
+ MOBLEUINT32 i;
+
+ TRACE_M(TF_GENERIC,"Generic_PowerOnOff_Status callback received \r\n");
+ for(i = 0; i < plength; i++)
+ TRACE_M(TF_SERIAL_CTRL,"Generic_PowerOnOff_Status: %d\r\n",
+ powerOnOff_status[i]);
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/*
+* @brief Generic_Client_DefaultTransitionTime_Status: Function called when status of the model
+ received on the client.
+* @param pTransition_status: ointer to the parameters received for message
+* @param plength: Length of the parameters received for message
+* return MOBLE_RESULT_SUCCESS.
+*/
+MOBLE_RESULT Generic_Client_DefaultTransitionTime_Status(MOBLEUINT8 const *pTransition_status , MOBLEUINT32 plength)
+{
+ MOBLEUINT32 i;
+
+ TRACE_M(TF_GENERIC,"Generic_DefaultTransitionTime_Status callback received \r\n");
+ for(i = 0; i < plength; i++)
+ TRACE_M(TF_SERIAL_CTRL,"Generic_DefaultTransitionTime_Status: %d\r\n",
+ pTransition_status[i]);
+ return MOBLE_RESULT_SUCCESS;
}
/* Weak function are defined to support the original function if they are not
@@ -1178,26 +1448,36 @@ WEAK_FUNCTION (MOBLE_RESULT Appli_Generic_OnOff_Set(Generic_OnOffStatus_t* pGene
return MOBLE_RESULT_SUCCESS;
}
-
WEAK_FUNCTION (MOBLE_RESULT Appli_Generic_Level_Set(Generic_LevelStatus_t* plevelParam,
MOBLEUINT8 OptionalValid))
{
return MOBLE_RESULT_SUCCESS;
}
-
WEAK_FUNCTION (MOBLE_RESULT Appli_Generic_LevelDelta_Set(Generic_LevelStatus_t* pdeltalevelParam,
+ MOBLEUINT8 OptionalValid))
+{
+ return MOBLE_RESULT_SUCCESS;
+}
+
+WEAK_FUNCTION (MOBLE_RESULT Appli_Generic_LevelMove_Set(Generic_LevelStatus_t* pdeltaMoveParam,
MOBLEUINT8 OptionalValid))
{
return MOBLE_RESULT_SUCCESS;
}
+WEAK_FUNCTION (MOBLE_RESULT Appli_Generic_PowerOnOff_Set(Generic_PowerOnOffParam_t* pPowerOnOffParam,
+ MOBLEUINT8 OptionalValid))
+{
+ return MOBLE_RESULT_SUCCESS;
+}
-WEAK_FUNCTION (MOBLE_RESULT Appli_Generic_LevelMove_Set(Generic_LevelStatus_t* pdeltaMoveParam,
+WEAK_FUNCTION (MOBLE_RESULT Appli_Generic_DefaultTransitionTime_Set(Generic_DefaultTransitionParam_t* pDefaultTimeParam,
MOBLEUINT8 OptionalValid))
{
return MOBLE_RESULT_SUCCESS;
}
+
/**
* @}
*/
diff --git a/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/light.c b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/light.c
index be60a4ae7..3dd2265d7 100644
--- a/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/light.c
+++ b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/light.c
@@ -4,7 +4,7 @@
* @author BLE Mesh Team
* @version V1.10.000
* @date 15-Jan-2019
-* @brief User Application file
+* @brief Light Model middleware implementation
******************************************************************************
* @attention
*
@@ -78,74 +78,90 @@ static Light_HslParam_t Light_HslParam;
static Light_HslStatus_t Light_HslStatus;
static Light_HslRangeParam_t Light_HslRangeParam;
+extern Generic_DefaultTransitionParam_t Generic_DefaultTransitionParam;
+MOBLEUINT8 Light_Trnsn_Cmplt;
+MOBLEUINT8 LightUpdateFlag = 0;
+
const MODEL_OpcodeTableParam_t Light_Opcodes_Table[] = {
#ifdef ENABLE_LIGHT_MODEL_SERVER_LIGHTNESS
{LIGHT_LIGHTNESS_GET, MOBLE_TRUE, 0, 0, LIGHT_LIGHTNESS_STATUS, 2, 5},
{LIGHT_LIGHTNESS_SET, MOBLE_TRUE, 3, 5, LIGHT_LIGHTNESS_STATUS, 2, 5},
- {LIGHT_LIGHTNESS_SET_UNACK, MOBLE_FALSE, 3, 5, 0, 0, 0},
+ {LIGHT_LIGHTNESS_SET_UNACK, MOBLE_FALSE, 3, 5, 0, 2, 5},
+ {LIGHT_LIGHTNESS_STATUS, MOBLE_FALSE, 2, 5, 0, 2, 5},
{LIGHT_LIGHTNESS_LINEAR_GET, MOBLE_TRUE, 0, 0, LIGHT_LIGHTNESS_LINEAR_STATUS, 2, 5},
{LIGHT_LIGHTNESS_LINEAR_SET, MOBLE_TRUE, 3, 5, LIGHT_LIGHTNESS_LINEAR_STATUS, 2, 5},
- {LIGHT_LIGHTNESS_LINEAR_SET_UNACK, MOBLE_FALSE, 3, 5, 0, 0, 0},
- {LIGHT_LIGHTNESS_LAST_GET, MOBLE_TRUE, 0, 0, LIGHT_LIGHTNESS_LAST_STATUS, 2, 2},
- {LIGHT_LIGHTNESS_LAST_STATUS, MOBLE_TRUE, 2, 2, LIGHT_LIGHTNESS_LAST_STATUS, 2, 2},
+ {LIGHT_LIGHTNESS_LINEAR_SET_UNACK, MOBLE_FALSE, 3, 5, 0, 2, 5},
+ {LIGHT_LIGHTNESS_LINEAR_STATUS, MOBLE_FALSE, 2, 5, 0, 2, 5},
{LIGHT_LIGHTNESS_DEFAULT_GET, MOBLE_TRUE, 0, 0, LIGHT_LIGHTNESS_DEFAULT_STATUS,2, 2},
+ {LIGHT_LIGHTNESS_DEFAULT_STATUS, MOBLE_FALSE, 2, 2, 0,2, 2},
{LIGHT_LIGHTNESS_RANGE_GET, MOBLE_TRUE, 0, 0, LIGHT_LIGHTNESS_RANGE_STATUS, 5, 5},
+ {LIGHT_LIGHTNESS_RANGE_STATUS, MOBLE_FALSE, 5, 5, 0, 5, 5},
#endif
#ifdef ENABLE_LIGHT_MODEL_SERVER_LIGHTNESS_SETUP
{LIGHT_LIGHTNESS_DEFAULT_SET, MOBLE_TRUE, 2, 2, LIGHT_LIGHTNESS_DEFAULT_STATUS, 2, 2},
- {LIGHT_LIGHTNESS_DEFAULT_SET_UNACK, MOBLE_FALSE, 2, 2, LIGHT_LIGHTNESS_DEFAULT_STATUS, 2, 2},
- {LIGHT_LIGHTNESS_RANGE_SET, MOBLE_TRUE, 2, 4, LIGHT_LIGHTNESS_RANGE_STATUS, 5, 5},
- {LIGHT_LIGHTNESS_RANGE_SET_UNACK, MOBLE_FALSE, 2, 4, LIGHT_LIGHTNESS_RANGE_STATUS, 5, 5},
+ {LIGHT_LIGHTNESS_DEFAULT_SET_UNACK, MOBLE_FALSE, 2, 2, 0, 2, 2},
+ {LIGHT_LIGHTNESS_RANGE_SET, MOBLE_TRUE, 4, 4, LIGHT_LIGHTNESS_RANGE_STATUS, 5, 5},
+ {LIGHT_LIGHTNESS_RANGE_SET_UNACK, MOBLE_FALSE, 4, 4, 0, 5, 5},
#endif
#ifdef ENABLE_LIGHT_MODEL_SERVER_CTL
{LIGHT_CTL_GET, MOBLE_TRUE, 0, 0, LIGHT_CTL_STATUS, 4, 9},
{LIGHT_CTL_SET, MOBLE_TRUE, 7, 9, LIGHT_CTL_STATUS, 4, 9},
- {LIGHT_CTL_SET_UNACK, MOBLE_FALSE, 7, 9, 0, 4, 9},
+ {LIGHT_CTL_SET_UNACK, MOBLE_FALSE, 7, 9, 0, 4, 9},
+ {LIGHT_CTL_STATUS, MOBLE_FALSE, 4, 9, 0, 4, 9},
{LIGHT_CTL_TEMPERATURE_RANGE_GET, MOBLE_TRUE, 0, 0, LIGHT_CTL_TEMPERATURE_RANGE_STATUS, 5, 5},
+ {LIGHT_CTL_TEMPERATURE_RANGE_STATUS, MOBLE_FALSE, 5, 5, 0, 5, 5},
{LIGHT_CTL_DEFAULT_GET, MOBLE_TRUE, 0, 0, LIGHT_CTL_DEFAULT_STATUS, 6, 6},
+ {LIGHT_CTL_DEFAULT_STATUS, MOBLE_TRUE, 6, 6, 0, 6, 6},
#endif
#ifdef ENABLE_LIGHT_MODEL_SERVER_CTL_SETUP
{LIGHT_CTL_DEFAULT_SET, MOBLE_TRUE, 6, 6, LIGHT_CTL_DEFAULT_STATUS, 6, 6},
- {LIGHT_CTL_DEFAULT_SET_UNACK, MOBLE_FALSE, 6, 6, LIGHT_CTL_DEFAULT_STATUS, 6, 6},
+ {LIGHT_CTL_DEFAULT_SET_UNACK, MOBLE_FALSE, 6, 6, 0, 6, 6},
{LIGHT_CTL_TEMPERATURE_RANGE_SET, MOBLE_TRUE, 4, 4, LIGHT_CTL_TEMPERATURE_RANGE_STATUS, 5, 5},
- {LIGHT_CTL_TEMPERATURE_RANGE_SET_UNACK, MOBLE_FALSE, 4, 4, LIGHT_CTL_TEMPERATURE_RANGE_STATUS, 5, 5},
+ {LIGHT_CTL_TEMPERATURE_RANGE_SET_UNACK, MOBLE_FALSE, 4, 4, 0, 5, 5},
#endif
#ifdef ENABLE_LIGHT_MODEL_SERVER_CTL_TEMPERATURE
{LIGHT_CTL_TEMPERATURE_GET, MOBLE_TRUE, 0, 0, LIGHT_CTL_TEMPERATURE_STATUS, 4, 9},
{LIGHT_CTL_TEMPERATURE_SET, MOBLE_TRUE, 5, 7, LIGHT_CTL_TEMPERATURE_STATUS, 4, 9},
- {LIGHT_CTL_TEMPERATURE_SET_UNACK, MOBLE_FALSE, 5, 7, LIGHT_CTL_TEMPERATURE_STATUS, 4, 9},
+ {LIGHT_CTL_TEMPERATURE_SET_UNACK, MOBLE_FALSE, 5, 7, 0, 4, 9},
+ {LIGHT_CTL_TEMPERATURE_STATUS, MOBLE_FALSE, 4, 9, 0, 4, 9},
#endif
#ifdef ENABLE_LIGHT_MODEL_SERVER_HSL
+ {LIGHT_HSL_GET, MOBLE_TRUE, 0, 0, LIGHT_HSL_STATUS, 6, 7},
{LIGHT_HSL_SET, MOBLE_TRUE, 7, 9, LIGHT_HSL_STATUS, 6, 7},
- {LIGHT_HSL_SET_UNACK, MOBLE_FALSE, 7, 9, LIGHT_HSL_STATUS, 6, 7},
- {LIGHT_HSL_GET, MOBLE_TRUE, 0, 0, LIGHT_HSL_STATUS, 6, 7},
+ {LIGHT_HSL_SET_UNACK, MOBLE_FALSE, 7, 9, 0, 6, 7},
+ {LIGHT_HSL_STATUS, MOBLE_FALSE, 6, 7, 0, 6, 7},
{LIGHT_HSL_TARGET_GET, MOBLE_TRUE, 0, 0, LIGHT_HSL_TARGET_STATUS, 6, 7},
+ {LIGHT_HSL_TARGET_STATUS, MOBLE_FALSE, 6, 7, 0, 6, 7},
{LIGHT_HSL_DEFAULT_GET, MOBLE_TRUE, 0, 0, LIGHT_HSL_DEFAULT_STATUS, 6, 6},
+ {LIGHT_HSL_DEFAULT_STATUS, MOBLE_FALSE, 6, 6, 0, 6, 6},
{LIGHT_HSL_RANGE_GET, MOBLE_TRUE, 0, 0, LIGHT_HSL_RANGE_STATUS, 9, 9},
+ {LIGHT_HSL_RANGE_STATUS, MOBLE_TRUE, 9, 9, 0, 9, 9},
#endif
#ifdef ENABLE_LIGHT_MODEL_SERVER_HSL_SETUP
{LIGHT_HSL_RANGE_SET, MOBLE_TRUE, 8, 8, LIGHT_HSL_RANGE_STATUS, 9, 9},
- {LIGHT_HSL_RANGE_SET_UNACK, MOBLE_FALSE, 8, 8, LIGHT_HSL_RANGE_STATUS, 9, 9},
+ {LIGHT_HSL_RANGE_SET_UNACK, MOBLE_FALSE, 8, 8, 0, 9, 9},
{LIGHT_HSL_DEFAULT_SET, MOBLE_TRUE, 6, 6, LIGHT_HSL_DEFAULT_STATUS, 6, 6},
- {LIGHT_HSL_DEFAULT_SET_UNACK, MOBLE_FALSE, 6, 6, LIGHT_HSL_DEFAULT_STATUS, 6, 6},
+ {LIGHT_HSL_DEFAULT_SET_UNACK, MOBLE_FALSE, 6, 6, 0, 6, 6},
#endif
#ifdef ENABLE_LIGHT_MODEL_SERVER_HSL_HUE
{LIGHT_HSL_HUE_GET, MOBLE_TRUE, 0, 0, LIGHT_HSL_HUE_STATUS, 2, 5},
{LIGHT_HSL_HUE_SET, MOBLE_TRUE, 3, 5, LIGHT_HSL_HUE_STATUS, 2, 5},
- {LIGHT_HSL_HUE_SET_UNACK, MOBLE_FALSE, 3, 5, LIGHT_HSL_HUE_STATUS, 2, 5},
+ {LIGHT_HSL_HUE_SET_UNACK, MOBLE_FALSE, 3, 5, 0, 2, 5},
+ {LIGHT_HSL_HUE_STATUS, MOBLE_FALSE, 2, 5, 0, 2, 5},
#endif
#ifdef ENABLE_LIGHT_MODEL_SERVER_HSL_SATURATION
{LIGHT_HSL_SATURATION_GET, MOBLE_TRUE, 0, 0, LIGHT_HSL_SATURATION_STATUS, 2, 5},
{LIGHT_HSL_SATURATION_SET, MOBLE_TRUE, 3, 5, LIGHT_HSL_SATURATION_STATUS, 2, 5},
- {LIGHT_HSL_SATURATION_SET_UNACK, MOBLE_FALSE, 3, 5, LIGHT_HSL_SATURATION_STATUS, 2, 5},
+ {LIGHT_HSL_SATURATION_SET_UNACK, MOBLE_FALSE, 3, 5, 0, 2, 5},
+ {LIGHT_HSL_SATURATION_STATUS, MOBLE_FALSE, 2, 5, 0, 2, 5},
#endif
{0}
};
@@ -200,8 +216,7 @@ WEAK_FUNCTION(void Light_UpdatePWMValue(MOBLEUINT8 state));
/**
* @brief Light_Lightness_Set: This function is called for both Acknowledged and
-unacknowledged message. The Acknowledgement is taken care by
-the Library
+* unacknowledged message. The Acknowledgement is taken care by the Library
* @param plightness_param : Pointer to the parameters received for message
* @param length : Length of the parameters received for message
* @retval MOBLE_RESULT
@@ -221,7 +236,7 @@ MOBLE_RESULT Light_Lightness_Set(const MOBLEUINT8* plightness_param, MOBLEUINT32
Light_LightnessParam.TID = plightness_param[2];
/* Binding of actual lightness value with lightness range */
- Light_Actual_RangeBinding(&Light_LightnessParam);
+ //Light_Actual_RangeBinding(&Light_LightnessParam);
/* Check for Optional Parameters */
if (length > 3)
{
@@ -245,22 +260,27 @@ MOBLE_RESULT Light_Lightness_Set(const MOBLEUINT8* plightness_param, MOBLEUINT32
*/
Light_GetStepValue(plightness_param[3]);
/*option parameter flag, enable to sent all required parameter in status.*/
- Light_ModelFlag.LightTransitionFlag = 1;
+ Light_ModelFlag.LightTransitionFlag = LIGHT_LIGHTNESS_TRANSITION_START;
Light_ModelFlag.LightOptionalParam = 1;
}
else
{
+#ifdef ENABLE_GENERIC_MODEL_SERVER_DEFAULT_TRANSITION_TIME
+ Light_LightnessDefaultTransitionValue(&Light_LightnessParam);
+#else
/* When no optional parameter received, target value will
be set as present value in application.
*/
Light_LightnessStatus.PresentValue16 = Light_LightnessParam.TargetLightnessStatus;
+#endif
+
}
/* Application Callback */
(LightAppli_cb.Lightness_Set_cb)(&Light_LightnessStatus, 0);
#ifdef ENABLE_MODEL_BINDING
/* Binding of actual light lightness with linear light lightness */
- Light_Linear_ActualImplicitBinding(BINDING_LIGHT_LIGHTNESS_ACTUAL_SET);
+ Light_Linear_ActualImplicitBinding(BINDING_LIGHT_LIGHTNESS_ACTUAL_SET , length);
/* Binding of Light Ctl with Actual Light Lightness */
Light_BindingCtlToLightness_Actual(BINDING_LIGHT_LIGHTNESS_ACTUAL_SET);
@@ -278,7 +298,6 @@ MOBLE_RESULT Light_Lightness_Set(const MOBLEUINT8* plightness_param, MOBLEUINT32
return MOBLE_RESULT_SUCCESS;
}
-
/**
* @brief Light Lightness Status
* @param pLightness_status: Pointer to the status message, which needs to be updated
@@ -336,8 +355,7 @@ MOBLE_RESULT Light_Lightness_Status(MOBLEUINT8* pLightness_status, MOBLEUINT32*
/**
* @brief Light_Lightness_Linear_Set: This function is called for both Acknowledged and
-unacknowledged message. The Acknowledgement is taken care by
-the Library
+* unacknowledged message. The Acknowledgement is taken care by the Library
* @param plightnessLinear_param : Pointer to the parameters received for message
* @param length : Length of the parameters received for message
* @retval MOBLE_RESULT
@@ -378,9 +396,10 @@ MOBLE_RESULT Light_Lightness_Linear_Set(const MOBLEUINT8* plightnessLinear_param
/* Function to calculate time parameters, step resolution
step size for transition state machine.
*/
+
Light_GetStepValue(plightnessLinear_param[3]);
/*transition process enable flag. */
- Light_ModelFlag.LightTransitionFlag = 2;
+ Light_ModelFlag.LightTransitionFlag = LIGHT_LIGHTNESS_TRANSITION_START;
/*option parameter flag, enable to sent all required parameter in status.*/
Light_ModelFlag.LightOptionalParam = 1;
}
@@ -394,7 +413,11 @@ MOBLE_RESULT Light_Lightness_Linear_Set(const MOBLEUINT8* plightnessLinear_param
#ifdef ENABLE_MODEL_BINDING
/* Binding of data of light lightness with light linear */
- Light_Linear_ActualImplicitBinding(BINDING_LIGHT_LIGHTNESS_LINEAR_SET);
+ Light_Linear_ActualImplicitBinding(BINDING_LIGHT_LIGHTNESS_LINEAR_SET , length);
+#endif
+
+#ifdef ENABLE_LIGHT_MODEL_SERVER_LC
+ Light_Linear_ActualBinding(length);
#endif
return MOBLE_RESULT_SUCCESS;
}
@@ -484,8 +507,7 @@ MOBLE_RESULT Light_Lightness_Last_Status(MOBLEUINT8* pLightnessLast_status, MOBL
/**
* @brief Light_Lightness_Default_Set: This function is called for both Acknowledged and
-unacknowledged message. The Acknowledgement is taken care by
-the Library
+* unacknowledged message. The Acknowledgement is taken care by the Library
* @param plightnessDefault_param : Pointer to the parameters received for message
* @param length : Length of the parameters received for message
* @retval MOBLE_RESULT
@@ -537,8 +559,7 @@ MOBLE_RESULT Light_Lightness_Default_Status(MOBLEUINT8* pLightnessDefault_status
/**
* @brief Light_Lightness_Range_Set: This function is called for both Acknowledged and
-unacknowledged message. The Acknowledgement is taken care by
-the Library
+* unacknowledged message. The Acknowledgement is taken care by the Library
* @param plightnessRange_param : Pointer to the parameters received for message
* @param length : Length of the parameters received for message
* @retval MOBLE_RESULT
@@ -602,8 +623,7 @@ MOBLE_RESULT Light_Lightness_Range_Status(MOBLEUINT8* pLightnessRange_status, MO
/**
* @brief Light_CTL_Set: This function is called for both Acknowledged and
-unacknowledged message. The Acknowledgement is taken care by
-the Library
+* unacknowledged message. The Acknowledgement is taken care by the Library
* @param pLightCtl_param : Pointer to the parameters received for message
* @param length : Length of the parameters received for message
* @retval MOBLE_RESULT
@@ -654,15 +674,19 @@ MOBLE_RESULT Light_Ctl_Set(const MOBLEUINT8* pLightCtl_param, MOBLEUINT32 length
Light_GetStepValue(pLightCtl_param[7]);
Light_ModelFlag.LightOptionalParam = 1;
- Light_ModelFlag.LightTransitionFlag = 3;
+ Light_ModelFlag.LightTransitionFlag = LIGHT_CTL_TRANSITION_START;
}
else
{
+#ifdef ENABLE_GENERIC_MODEL_SERVER_DEFAULT_TRANSITION_TIME
+ Light_CTLDefaultTransitionValue(&Light_CtlParam);
+#else
/* When no optional parameter received, target value will
be set as present value in application.
*/
Light_CtlStatus.PresentCtlLightness16 = Light_CtlParam.CTL_Lightness;
Light_CtlStatus.PresentCtlTemperature16 = Light_CtlParam.CTL_Temperature;
+#endif
}
/* Application Callback */
(LightAppli_cb.Light_Ctl_Set_cb)(&Light_CtlStatus, 0);
@@ -731,8 +755,7 @@ MOBLE_RESULT Light_Ctl_Status(MOBLEUINT8* pLightCtl_status, MOBLEUINT32 *pLength
/**
* @brief Light_CTLTemperature_Set: This function is called for both Acknowledged and
-unacknowledged message. The Acknowledgement is taken care by
-the Library
+* unacknowledged message. The Acknowledgement is taken care by the Library
* @param pLightCtlTemp_param : Pointer to the parameters received for message
* @param length : Length of the parameters received for message
* @retval MOBLE_RESULT
@@ -758,7 +781,6 @@ MOBLE_RESULT Light_CtlTemperature_Set(const MOBLEUINT8* pLightCtlTemp_param, MOB
Light_CtlParam.CTL_TID = pLightCtlTemp_param[4] << 8;
/* Binding with ctl temperature range value */
- Light_CtlTemperature_TempRangeBinding(&Light_CtlParam);
if(length > 7)
{
@@ -772,20 +794,23 @@ MOBLE_RESULT Light_CtlTemperature_Set(const MOBLEUINT8* pLightCtlTemp_param, MOB
Light_TemporaryStatus.TargetParam_1 = Light_CtlStatus.TargetCtlTemperature16;
Light_TemporaryStatus.TargetParam_2 = Light_CtlStatus.TargetCtlDeltaUv16;
Light_ModelFlag.LightOptionalParam = 1;
- Light_ModelFlag.LightTransitionFlag = 4;
+ Light_ModelFlag.LightTransitionFlag = LIGHT_TEMPERATURE_TRANSITION_START;
}
else
{
+#ifdef ENABLE_GENERIC_MODEL_SERVER_DEFAULT_TRANSITION_TIME
+ Light_CTLTemperatureDefaultTransitionValue(&Light_CtlParam);
+#else
/* When no optional parameter received, target value will
be set as present value in application.
*/
Light_CtlStatus.PresentCtlTemperature16 = Light_CtlParam.CTL_Temperature;
Light_CtlStatus.PresentCtlDelta16 = Light_CtlParam.CTL_DeltaUv;
+#endif
}
/* Application Callback */
(LightAppli_cb.Light_CtlTemperature_Set_cb)(&Light_CtlStatus, OptionalValid);
-
#ifdef ENABLE_MODEL_BINDING
/* Binding of data Ctl Temperature with Generic Level */
Light_CtlTemp_GenericLevelBinding(&Light_CtlParam);
@@ -854,8 +879,7 @@ MOBLE_RESULT Light_CtlTemperature_Status(MOBLEUINT8* pLightCtlTemp_status, MOBLE
/**
* @brief Light_CtlTemperature_Range_Set: This function is called for both Acknowledged and
-unacknowledged message. The Acknowledgement is taken care by
-the Library.
+* unacknowledged message. The Acknowledgement is taken care by the Library.
* @param plightCtlTempRange_param : Pointer to the parameters received for message.
* @param length : Length of the parameters received for message.
* @retval MOBLE_RESULT
@@ -916,7 +940,7 @@ MOBLE_RESULT Light_CtlTemperature_Range_Status(MOBLEUINT8* pCtlTempRange_status,
*/
MOBLEUINT8 Light_GetBuff[5];
- TRACE_M(TF_LIGHT,"Light_Lightness_Range_Status callback received \r\n");
+ TRACE_M(TF_LIGHT,"Light_CtlTemperature_Range_Status callback received \r\n");
/* Function call back to get the values from application*/
(Appli_Light_GetStatus_cb.GetLightCtlTempRange_cb)(Light_GetBuff);
@@ -936,8 +960,7 @@ MOBLE_RESULT Light_CtlTemperature_Range_Status(MOBLEUINT8* pCtlTempRange_status,
/**
* @brief Light_CtlDefault_Set: This function is called for both Acknowledged and
-unacknowledged message. The Acknowledgement is taken care by
-the Library.
+* unacknowledged message. The Acknowledgement is taken care by the Library.
* @param pCtlDefault_param : Pointer to the parameters received for message.
* @param length : Length of the parameters received for message.
* @retval MOBLE_RESULT
@@ -1007,8 +1030,7 @@ MOBLE_RESULT Light_CtlDefault_Status(MOBLEUINT8* pCtlDefault_status, MOBLEUINT32
/**
* @brief Light_Hsl_Set: This function is called for both Acknowledged and
-unacknowledged message. The Acknowledgement is taken care by
-the Library
+* unacknowledged message. The Acknowledgement is taken care by the Library
* @param pHsl_param : Pointer to the parameters received for message
* @param length : Length of the parameters received for message
* @retval MOBLE_RESULT
@@ -1054,7 +1076,7 @@ MOBLE_RESULT Light_Hsl_Set(const MOBLEUINT8* pHsl_param, MOBLEUINT32 length)
Light_GetStepValue(pHsl_param[7]);
Light_ModelFlag.LightOptionalParam = 1;
- Light_ModelFlag.LightTransitionFlag = 5;
+ Light_ModelFlag.LightTransitionFlag = LIGHT_HSL_TRANSITION_START;
}
else
{
@@ -1127,8 +1149,7 @@ MOBLE_RESULT Light_Hsl_Status(MOBLEUINT8* pHsl_status, MOBLEUINT32 *pLength)
/**
* @brief Light_HslHue_Set: This function is called for both Acknowledged and
-unacknowledged message. The Acknowledgement is taken care by
-the Library
+* unacknowledged message. The Acknowledgement is taken care by the Library
* @param pHslHue_param : Pointer to the parameters received for message
* @param length : Length of the parameters received for message
* @retval MOBLE_RESULT
@@ -1170,7 +1191,7 @@ MOBLE_RESULT Light_HslHue_Set(const MOBLEUINT8* pHslHue_param, MOBLEUINT32 lengt
Light_GetStepValue(pHslHue_param[3]);
Light_ModelFlag.LightOptionalParam = 1;
- Light_ModelFlag.LightTransitionFlag = 6;
+ Light_ModelFlag.LightTransitionFlag = LIGHT_HSL_HUE_TRANSITION_START;
}
else
{
@@ -1233,8 +1254,7 @@ MOBLE_RESULT Light_HslHue_Status(MOBLEUINT8* pHslHue_status, MOBLEUINT32 *pLengt
/**
* @brief Light_HslSaturation_Set: This function is called for both Acknowledged and
-unacknowledged message. The Acknowledgement is taken care by
-the Library
+* unacknowledged message. The Acknowledgement is taken care by the Library
* @param pHslSaturation_param : Pointer to the parameters received for message
* @param length : Length of the parameters received for message
* @retval MOBLE_RESULT
@@ -1276,7 +1296,7 @@ MOBLE_RESULT Light_HslSaturation_Set(const MOBLEUINT8* pHslSaturation_param, MOB
Light_GetStepValue(pHslSaturation_param[3]);
Light_ModelFlag.LightOptionalParam = 1;
- Light_ModelFlag.LightTransitionFlag = 7;
+ Light_ModelFlag.LightTransitionFlag = LIGHT_HSL_SATURATION_TRANSITION_START;
}
else
{
@@ -1339,8 +1359,7 @@ MOBLE_RESULT Light_HslSaturation_Status(MOBLEUINT8* pHslSaturation_status, MOBLE
/**
* @brief Light_HslDefault_Set: This function is called for both Acknowledged and
-unacknowledged message. The Acknowledgement is taken care by
-the Library
+* unacknowledged message. The Acknowledgement is taken care by the Library
* @param pHslDefault_param : Pointer to the parameters received for message
* @param length : Length of the parameters received for message
* @retval MOBLE_RESULT
@@ -1354,7 +1373,7 @@ MOBLE_RESULT Light_HslDefault_Set(const MOBLEUINT8* pHslDefault_param, MOBLEUINT
*/
MOBLEUINT8 OptionalValid = 0;
- TRACE_M(TF_LIGHT,"Light_HslSaturation_Set callback received \r\n");
+ TRACE_M(TF_LIGHT,"Light_HslDefault_Set callback received \r\n");
Light_HslStatus.PresentHslLightness16 = (MOBLEUINT16)pHslDefault_param[1] << 8;
Light_HslStatus.PresentHslLightness16 |= (MOBLEUINT16)pHslDefault_param[0];
@@ -1408,8 +1427,7 @@ MOBLE_RESULT Light_HslDefault_Status(MOBLEUINT8* pHslDefault_status, MOBLEUINT32
/**
* @brief Light_HslRange_Set: This function is called for both Acknowledged and
-unacknowledged message. The Acknowledgement is taken care by
-the Library
+* unacknowledged message. The Acknowledgement is taken care by the Library
* @param pHslRange_param : Pointer to the parameters received for message
* @param length : Length of the parameters received for message
* @retval MOBLE_RESULT
@@ -1423,7 +1441,7 @@ MOBLE_RESULT Light_HslRange_Set(const MOBLEUINT8* pHslRange_param, MOBLEUINT32 l
Saturation Range Max The value of the Saturation Range Max field of the Light HSL Saturation Range state
*/
MOBLEUINT8 OptionalValid = 0;
- TRACE_M(TF_LIGHT,"Light_HslSaturation_Set callback received \r\n");
+ TRACE_M(TF_LIGHT,"Light_HslRange_Set callback received \r\n");
Light_HslRangeParam.HslHueMinRange16 = (MOBLEUINT16)pHslRange_param[1] << 8;
Light_HslRangeParam.HslHueMinRange16 |= (MOBLEUINT16)pHslRange_param[0];
@@ -1547,6 +1565,7 @@ MOBLE_RESULT LightModelServer_GetStatusRequestCb(MOBLE_ADDRESS peer_addr,
MOBLEUINT32 dataLength,
MOBLEBOOL response)
{
+ TRACE_M(TF_LIGHT,"response status enable \n\r");
switch(opcode)
{
#ifdef ENABLE_LIGHT_MODEL_SERVER_LIGHTNESS
@@ -1612,6 +1631,21 @@ MOBLE_RESULT LightModelServer_GetStatusRequestCb(MOBLE_ADDRESS peer_addr,
Light_Hsl_Status(pResponsedata , plength);
break;
}
+ case LIGHT_HSL_DEFAULT_STATUS:
+ {
+ Light_HslDefault_Status(pResponsedata , plength);
+ break;
+ }
+ case LIGHT_HSL_RANGE_STATUS:
+ {
+ Light_HslRange_Status(pResponsedata , plength);
+ break;
+ }
+ case LIGHT_HSL_TARGET_STATUS:
+ {
+ Light_HslTarget_Status(pResponsedata , plength);
+ break;
+ }
#endif
#ifdef ENABLE_LIGHT_MODEL_SERVER_HSL_HUE
@@ -1629,25 +1663,6 @@ MOBLE_RESULT LightModelServer_GetStatusRequestCb(MOBLE_ADDRESS peer_addr,
break;
}
#endif
-
-#ifdef ENABLE_LIGHT_MODEL_SERVER_HSL
-
- case LIGHT_HSL_DEFAULT_STATUS:
- {
- Light_HslDefault_Status(pResponsedata , plength);
- break;
- }
- case LIGHT_HSL_RANGE_STATUS:
- {
- Light_HslRange_Status(pResponsedata , plength);
- break;
- }
- case LIGHT_HSL_TARGET_STATUS:
- {
- Light_HslTarget_Status(pResponsedata , plength);
- break;
- }
-#endif
default:
{
break;
@@ -1681,7 +1696,9 @@ MOBLE_RESULT LightModelServer_ProcessMessageCb(MOBLE_ADDRESS peer_addr,
)
{
MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
+
TRACE_M(TF_LIGHT,"dst_peer = %.2X , peer_add = %.2X, opcode= %.2X,response= %.2X \r\n ",dst_peer, peer_addr, opcode,response);
+
switch(opcode)
{
@@ -1698,7 +1715,6 @@ MOBLE_RESULT LightModelServer_ProcessMessageCb(MOBLE_ADDRESS peer_addr,
}
break;
}
-
case LIGHT_LIGHTNESS_LINEAR_SET:
case LIGHT_LIGHTNESS_LINEAR_SET_UNACK:
{
@@ -1710,6 +1726,31 @@ MOBLE_RESULT LightModelServer_ProcessMessageCb(MOBLE_ADDRESS peer_addr,
}
break;
}
+ case LIGHT_LIGHTNESS_STATUS:
+ {
+ Light_Client_Lightness_Status(pRxData, dataLength);
+ break;
+ }
+ case LIGHT_LIGHTNESS_LINEAR_STATUS:
+ {
+ Light_Client_Lightness_Linear_Status(pRxData, dataLength);
+ break;
+ }
+ case LIGHT_LIGHTNESS_LAST_STATUS:
+ {
+ Light_Client_Lightness_Last_Status(pRxData, dataLength);
+ break;
+ }
+ case LIGHT_LIGHTNESS_DEFAULT_STATUS:
+ {
+ Light_Client_Lightness_Default_Status(pRxData, dataLength);
+ break;
+ }
+ case LIGHT_LIGHTNESS_RANGE_STATUS:
+ {
+ Light_Client_Lightness_Range_Status(pRxData, dataLength);
+ break;
+ }
#endif
#ifdef ENABLE_LIGHT_MODEL_SERVER_LIGHTNESS_SETUP
@@ -1751,6 +1792,21 @@ MOBLE_RESULT LightModelServer_ProcessMessageCb(MOBLE_ADDRESS peer_addr,
}
break;
}
+ case LIGHT_CTL_STATUS:
+ {
+ Light_Client_Ctl_Status(pRxData, dataLength);
+ break;
+ }
+ case LIGHT_CTL_TEMPERATURE_RANGE_STATUS:
+ {
+ Light_Client_CtlTemperature_Range_Status(pRxData, dataLength);
+ break;
+ }
+ case LIGHT_CTL_DEFAULT_STATUS:
+ {
+ Light_Client_CtlDefault_Status(pRxData, dataLength);
+ break;
+ }
#endif
#ifdef ENABLE_LIGHT_MODEL_SERVER_CTL_TEMPERATURE
@@ -1766,6 +1822,11 @@ MOBLE_RESULT LightModelServer_ProcessMessageCb(MOBLE_ADDRESS peer_addr,
}
break;
}
+ case LIGHT_CTL_TEMPERATURE_STATUS:
+ {
+ Light_Client_CtlTemperature_Status(pRxData, dataLength);
+ break;
+ }
#endif
#ifdef ENABLE_LIGHT_MODEL_SERVER_CTL_SETUP
@@ -1811,6 +1872,26 @@ MOBLE_RESULT LightModelServer_ProcessMessageCb(MOBLE_ADDRESS peer_addr,
}
break;
}
+ case LIGHT_HSL_STATUS:
+ {
+ Light_Client_Hsl_Status(pRxData, dataLength);
+ break;
+ }
+ case LIGHT_HSL_DEFAULT_STATUS:
+ {
+ Light_Client_HslDefault_Status(pRxData, dataLength);
+ break;
+ }
+ case LIGHT_HSL_RANGE_STATUS:
+ {
+ Light_Client_HslRange_Status(pRxData, dataLength);
+ break;
+ }
+ case LIGHT_HSL_TARGET_STATUS:
+ {
+ Light_Client_HslTarget_Status(pRxData, dataLength);
+ break;
+ }
#endif
#ifdef ENABLE_LIGHT_MODEL_SERVER_HSL_HUE
@@ -1826,6 +1907,11 @@ MOBLE_RESULT LightModelServer_ProcessMessageCb(MOBLE_ADDRESS peer_addr,
}
break;
}
+ case LIGHT_HSL_HUE_STATUS:
+ {
+ Light_Client_HslHue_Status(pRxData, dataLength);
+ break;
+ }
#endif
#ifdef ENABLE_LIGHT_MODEL_SERVER_HSL_SETUP
@@ -1852,6 +1938,11 @@ MOBLE_RESULT LightModelServer_ProcessMessageCb(MOBLE_ADDRESS peer_addr,
Light_HslSaturation_Set(pRxData, dataLength);
break;
}
+ case LIGHT_HSL_SATURATION_STATUS:
+ {
+ Light_Client_HslSaturation_Status(pRxData, dataLength);
+ break;
+ }
#endif
default:
{
@@ -1864,6 +1955,12 @@ MOBLE_RESULT LightModelServer_ProcessMessageCb(MOBLE_ADDRESS peer_addr,
Model_SendResponse(peer_addr, dst_peer,opcode,pRxData, dataLength);
}
+ /*
+ Publish the status to publish address if the publication is set by client
+ publication is independent of the response of the message.if the condition
+ for publication is full filled as per specification then the status will be
+ published.
+ */
return MOBLE_RESULT_SUCCESS;
}
@@ -1922,7 +2019,7 @@ MOBLE_RESULT Light_TransitionBehaviourSingle_Param(MOBLEUINT8 *GetValue)
Light_TimeParam.StepValue--;
/* updating the remaining time after each step covered*/
Light_TemporaryStatus.RemainingTime = Light_TimeParam.StepValue | (Light_TimeParam.ResBitValue << 6) ;
-
+ LightUpdateFlag = VALUE_UPDATE_SET;
Check_time = 0;
Clockflag = 0;
@@ -1931,12 +2028,12 @@ MOBLE_RESULT Light_TransitionBehaviourSingle_Param(MOBLEUINT8 *GetValue)
*/
if(Light_TimeParam.StepValue == 0)
{
- Light_ModelFlag.LightTransitionFlag = 0;
+ Light_ModelFlag.LightTransitionFlag = LIGHT_TRANSITION_STOP;
+ Light_Trnsn_Cmplt = 1;
}
- TRACE_M(TF_LIGHT,"Inside light lightness transmition time at %d, Current state 0x%.2x ,\
- target state 0x%.2x , Remaining Time 0x%.2x\n\r", Clock_Time(),\
- Light_TemporaryStatus.PresentParam_1,Light_TemporaryStatus.TargetParam_1,\
+ TRACE_M(TF_LIGHT,"Inside light lightness transmition time at %ld, Current state 0x%.2x ,target state 0x%.2x , Remaining Time 0x%.2x\n\r",
+ Clock_Time(),Light_TemporaryStatus.PresentParam_1,Light_TemporaryStatus.TargetParam_1,\
Light_TemporaryStatus.RemainingTime);
@@ -2040,7 +2137,7 @@ MOBLE_RESULT Light_TransitionBehaviourMulti_Param(MOBLEUINT8 *GetValue , MOBLEUI
Light_TimeParam.StepValue--;
/* updating the remaining time after each step covered*/
Light_TemporaryStatus.RemainingTime = Light_TimeParam.StepValue | (Light_TimeParam.ResBitValue << 6) ;
-
+ LightUpdateFlag = VALUE_UPDATE_SET;
Check_time = 0;
Clockflag = 0;
/* when transition is completed, disable the transition by disabling
@@ -2049,9 +2146,10 @@ MOBLE_RESULT Light_TransitionBehaviourMulti_Param(MOBLEUINT8 *GetValue , MOBLEUI
if(Light_TimeParam.StepValue <= 0)
{
- Light_ModelFlag.LightTransitionFlag = 0;
+ Light_ModelFlag.LightTransitionFlag = LIGHT_TRANSITION_STOP;
+ Light_Trnsn_Cmplt = 1;
}
- TRACE_M(TF_LIGHT,"Inside light transmition %d,PV1 0x%.2x ,TV1 0x%.2x ,PV2 0x%.2x , TV2 0x%.2x,PV3 0x%.2x ,TV3 0x%.2x, RT 0x%.2x \n\r",
+ TRACE_M(TF_LIGHT,"Inside light transmition %ld,PV1 0x%.2x ,TV1 0x%.2x ,PV2 0x%.2x , TV2 0x%.2x,PV3 0x%.2x ,TV3 0x%.2x, RT 0x%.2x \n\r",
Clock_Time(),Light_TemporaryStatus.PresentParam_1,Light_TemporaryStatus.TargetParam_1,
Light_TemporaryStatus.PresentParam_2,Light_TemporaryStatus.TargetParam_2,
Light_TemporaryStatus.PresentParam_3, Light_TemporaryStatus.TargetParam_3,
@@ -2090,19 +2188,19 @@ void Light_GetStepValue(MOBLEUINT8 stepParam)
Light_TimeParam.StepValue = (Light_TimeParam.StepValue * TRANSITION_SCALER);
}
- TRACE_M(TF_LIGHT," step resolution 0x%.2x, number of step 0x%.2x \r\n",Light_TimeParam.Res_Value ,
+ TRACE_M(TF_LIGHT," step resolution 0x%.2lx, number of step 0x%.2x \r\n",Light_TimeParam.Res_Value ,
Light_TimeParam.StepValue );
}
/**
-* @brief Function to execute the trnsition state machine for
-particular Light Model
+* @brief Function to execute the transition state machine for particular Light Model
* @param void
* @retval void
*/
void Lighting_Process(void)
{
+
#if defined ENABLE_LIGHT_MODEL_SERVER_LIGHTNESS || defined ENABLE_LIGHT_MODEL_SERVER_CTL \
|| defined ENABLE_LIGHT_MODEL_SERVER_HSL
@@ -2110,62 +2208,91 @@ void Lighting_Process(void)
#endif
#ifdef ENABLE_LIGHT_MODEL_SERVER_LIGHTNESS
- if(Light_ModelFlag.LightTransitionFlag == 1)
+ if(Light_ModelFlag.LightTransitionFlag == LIGHT_LIGHTNESS_TRANSITION_START)
{
(Appli_Light_GetStatus_cb.GetLightLightness_cb)(Light_GetBuff);
Light_TransitionBehaviourSingle_Param(Light_GetBuff);
+ if(LightUpdateFlag == VALUE_UPDATE_SET)
+ {
LightLightnessStateUpdate_Process();
(LightAppli_cb.Lightness_Set_cb)(&Light_LightnessStatus,0);
+ LightUpdateFlag = VALUE_UPDATE_RESET;
+ }
}
- if(Light_ModelFlag.LightTransitionFlag == 2)
+ if(Light_ModelFlag.LightTransitionFlag == LIGHT_LINEAR_TRANSITION_START)
{
+
(Appli_Light_GetStatus_cb.GetLightLightnessLinear_cb)(Light_GetBuff);
Light_TransitionBehaviourSingle_Param(Light_GetBuff);
+ if(LightUpdateFlag == VALUE_UPDATE_SET)
+ {
LightLinearStateUpdate_Process();
(LightAppli_cb.Lightness_Linear_Set_cb)(&Light_LightnessStatus,0);
+ LightUpdateFlag = VALUE_UPDATE_RESET;
+ }
}
#endif
#ifdef ENABLE_LIGHT_MODEL_SERVER_CTL
- if(Light_ModelFlag.LightTransitionFlag == 3)
+ if(Light_ModelFlag.LightTransitionFlag == LIGHT_CTL_TRANSITION_START)
{
(Appli_Light_GetStatus_cb.GetLightCtl_cb)(Light_GetBuff);
Light_TransitionBehaviourMulti_Param(Light_GetBuff , 0);
+ if(LightUpdateFlag == VALUE_UPDATE_SET)
+ {
LightCtlStateUpdate_Process();
(LightAppli_cb.Light_Ctl_Set_cb)(&Light_CtlStatus , 0);
+ LightUpdateFlag = VALUE_UPDATE_RESET;
+ }
}
- if(Light_ModelFlag.LightTransitionFlag == 4)
+ if(Light_ModelFlag.LightTransitionFlag == LIGHT_TEMPERATURE_TRANSITION_START)
{
(Appli_Light_GetStatus_cb.GetLightCtlTemp_cb)(Light_GetBuff);
Light_TransitionBehaviourMulti_Param(Light_GetBuff , 0);
- LightCtlStateUpdate_Process();
+ if(LightUpdateFlag == VALUE_UPDATE_SET)
+ {
+ LightCtlTemperatureStateUpdate_Process();
(LightAppli_cb.Light_CtlTemperature_Set_cb)(&Light_CtlStatus , 0);
+ LightUpdateFlag = VALUE_UPDATE_RESET;
+ }
}
#endif
#ifdef ENABLE_LIGHT_MODEL_SERVER_HSL
- if(Light_ModelFlag.LightTransitionFlag == 5)
+ if(Light_ModelFlag.LightTransitionFlag == LIGHT_HSL_TRANSITION_START)
{
(Appli_Light_GetStatus_cb.GetLightHsl_cb)(Light_GetBuff);
Light_TransitionBehaviourMulti_Param(Light_GetBuff , 3);
+ if(LightUpdateFlag == VALUE_UPDATE_SET)
+ {
LightHslStateUpdate_Process();
(LightAppli_cb.Light_Hsl_Set_cb)(&Light_HslStatus , 0);
+ LightUpdateFlag = VALUE_UPDATE_RESET;
+ }
}
- if(Light_ModelFlag.LightTransitionFlag == 6)
+ if(Light_ModelFlag.LightTransitionFlag == LIGHT_HSL_HUE_TRANSITION_START)
{
(Appli_Light_GetStatus_cb.GetLightHslHue_cb)(Light_GetBuff);
Light_TransitionBehaviourSingle_Param(Light_GetBuff);
+ if(LightUpdateFlag == VALUE_UPDATE_SET)
+ {
LightHslHueStateUpdate_Process();
(LightAppli_cb.Light_HslHue_Set_cb)(&Light_HslStatus , 0);
+ LightUpdateFlag = VALUE_UPDATE_RESET;
+ }
}
- if(Light_ModelFlag.LightTransitionFlag == 7)
+ if(Light_ModelFlag.LightTransitionFlag == LIGHT_HSL_SATURATION_TRANSITION_START)
{
(Appli_Light_GetStatus_cb.GetLightHslSaturation_cb)(Light_GetBuff);
Light_TransitionBehaviourSingle_Param(Light_GetBuff);
+ if(LightUpdateFlag == VALUE_UPDATE_SET)
+ {
LightHslSaturationStateUpdate_Process();
(LightAppli_cb.Light_HslSaturation_Set_cb)(&Light_HslStatus , 0);
+ LightUpdateFlag = VALUE_UPDATE_RESET;
+ }
}
#endif
}
@@ -2211,6 +2338,7 @@ MOBLE_RESULT LightCtlStateUpdate_Process(void)
{
Light_CtlStatus.PresentCtlLightness16 =Light_TemporaryStatus.PresentParam_1;
Light_CtlStatus.PresentCtlTemperature16 = Light_TemporaryStatus.PresentParam_2;
+ Light_CtlStatus.PresentCtlDelta16 = Light_TemporaryStatus.PresentParam_3;
Light_CtlStatus.RemainingTime = Light_TemporaryStatus.RemainingTime;
return MOBLE_RESULT_SUCCESS;
}
@@ -2314,15 +2442,15 @@ void LightActual_GenericOnOffBinding(Light_LightnessParam_t* lightActual)
if(lightActual ->TargetLightnessStatus == 0x00)
{
- bGeneric_OnOffParam.Present_OnOff = 0x00;
+ bGeneric_OnOffParam.Present_OnOff_State = 0x00;
}
else
{
- bGeneric_OnOffParam.Present_OnOff = 0x01;
+ bGeneric_OnOffParam.Present_OnOff_State = 0x01;
}
TRACE_M(TF_LIGHT, "LightActual_GenericOnOffBinding Function - Present OnOff value 0x%.2x \r\n"
- , bGeneric_OnOffParam.Present_OnOff);
+ , bGeneric_OnOffParam.Present_OnOff_State);
(GenericAppli_cb.OnOff_Set_cb)(&bGeneric_OnOffParam, 0);
}
@@ -2342,9 +2470,18 @@ void LightActual_GenericLevelBinding(Light_LightnessParam_t* lightActual)
As Actual lightness changes, the generic level value will
change.
*/
+ MOBLE_ADDRESS publishAddress;
+ MOBLEUINT8 elementNumber;
+ MOBLEUINT16 opcode;
Generic_LevelStatus_t bGeneric_LevelParam ;
+
+ elementNumber = BLE_GetElementNumber();
+ publishAddress = BLEMesh_GetPublishAddress(elementNumber);
+
bGeneric_LevelParam.Present_Level16 = lightActual->TargetLightnessStatus - 32768;
(GenericAppli_cb.Level_Set_cb)(&bGeneric_LevelParam, 0);
+ opcode = GENERIC_LEVEL_SET_ACK;
+ Model_SendResponse(publishAddress, 0,opcode, NULL,0);
}
@@ -2355,18 +2492,24 @@ lightness and Linear Lightness is implicit binding with generic on off state.
* @param bindingFlag
* return void
*/
-void Light_Linear_ActualImplicitBinding(MOBLEUINT8 bindingFlag)
+void Light_Linear_ActualImplicitBinding(MOBLEUINT8 bindingFlag ,MOBLEUINT32 length)
{
/*
6.1.2.1.1 - actual lightness = 655354 * squareroot(linear lightness/ 655354).
*/
-
+ MOBLE_ADDRESS publishAddress;
+ MOBLEUINT8 elementNumber;
+ MOBLEUINT16 opcode;
Light_LightnessParam_t bLightnessActual;
+ elementNumber = BLE_GetElementNumber();
+ publishAddress = BLEMesh_GetPublishAddress(elementNumber);
+
+
if(bindingFlag == BINDING_LIGHT_LIGHTNESS_LINEAR_SET)
{
- bLightnessActual.TargetLightnessStatus = Light_Linear_ActualBinding();
+ bLightnessActual.TargetLightnessStatus = Light_Linear_ActualBinding(length);
/* Implicit binding of linear lightness with generic on off.
linear lightnes set -> actual lightness set -> generic on off set.
As linear lightness changes, it changes the value of actual lightness
@@ -2379,12 +2522,17 @@ void Light_Linear_ActualImplicitBinding(MOBLEUINT8 bindingFlag)
which in turn changes the state of generic level state.
*/
LightActual_GenericLevelBinding(&bLightnessActual);
+
+ opcode = LIGHT_LIGHTNESS_SET;
}
if(bindingFlag == BINDING_LIGHT_LIGHTNESS_ACTUAL_SET)
{
Light_Actual_LinearBinding();
+ opcode = LIGHT_LIGHTNESS_LINEAR_SET;
}
+ Model_SendResponse(publishAddress, 0,opcode, NULL,0);
+
TRACE_M(TF_LIGHT,"Light_Linear_ActualImplicitBinding - Actual Lightness value 0x%.2x , Linear Lightness value 0x%.2x \r\n " ,
Light_LightnessStatus.PresentValue16,
Light_LightnessStatus.PresentValue16 );
@@ -2425,18 +2573,28 @@ MOBLEUINT16 Light_Actual_LinearBinding(void)
* @param void
* return MOBLEUINT16
*/
-MOBLEUINT16 Light_Linear_ActualBinding(void)
+MOBLEUINT16 Light_Linear_ActualBinding(MOBLEUINT32 length)
{
/*
6.1.2.1.1 - actual lightness = 655354 * squareroot(linear lightness/ 655354).
*/
float productValue;
-
+ if(length <= 3)
+ {
productValue = sqrt((((float)Light_LightnessStatus.PresentValue16) / 65535));
Light_LightnessStatus.PresentValue16 = (MOBLEUINT16)(65535 * productValue);
(LightAppli_cb.Lightness_Set_cb)(&Light_LightnessStatus, 0);
return Light_LightnessStatus.PresentValue16;
}
+ else
+ {
+ productValue = sqrt((((float)Light_LightnessStatus.TargetValue16) / 65535));
+ Light_LightnessStatus.TargetValue16 = (MOBLEUINT16)(65535 * productValue);
+ Light_TemporaryStatus.TargetParam_1 = Light_LightnessStatus.TargetValue16;
+ (LightAppli_cb.Lightness_Set_cb)(&Light_LightnessStatus, 0);
+ return Light_LightnessStatus.TargetValue16;
+ }
+}
/*
@@ -2532,8 +2690,8 @@ void Light_CtlTemp_GenericLevelBinding(Light_CtlParam_t* bCtlTempParam)
Generic_LevelStatus_t bLevelStatus;
MOBLEUINT32 productValue;
- productValue = (bCtlTempParam->CTL_Temperature - 0x0320) * 65535;
- bLevelStatus.Present_Level16 = (productValue / (0x4E20 - 0x0320)) - 32768;
+ productValue = (bCtlTempParam->CTL_Temperature - MIN_CTL_TEMP_RANGE) * 65535;
+ bLevelStatus.Present_Level16 = (productValue / (MAX_CTL_TEMP_RANGE - MIN_CTL_TEMP_RANGE)) - 32768;
/* application callback */
(GenericAppli_cb.Level_Set_cb)(&bLevelStatus, 0);
}
@@ -2688,55 +2846,315 @@ void Light_ActualLightness_HslLightnessBinding(Light_LightnessParam_t* bActualLi
}
/*
-* @brief Save light states in nvm
+* @brief function called in Light lightness when the default transition time is enabled.
* @param void.
* return void.
*/
-MOBLE_RESULT Light_SaveStateNvm(MOBLEUINT8 flag)
+void Light_LightnessDefaultTransitionValue(Light_LightnessParam_t* pLightnessValue)
{
- return MOBLE_RESULT_SUCCESS;
+ Light_TemporaryStatus.TargetParam_1 = pLightnessValue->TargetLightnessStatus;
+ Light_TemporaryStatus.RemainingTime = Generic_DefaultTransitionParam.DefaultTransitionTime;
+ Light_GetStepValue((MOBLEUINT8)Generic_DefaultTransitionParam.DefaultTransitionTime);
+ Light_ModelFlag.LightTransitionFlag = LIGHT_LIGHTNESS_TRANSITION_START;
+ Light_ModelFlag.LightOptionalParam = 1;
}
/*
-* @brief function to call light middle layer function for restoration of
-* saved states.
+* @brief function called in Light CTL set when the default transition time is enabled.
* @param void.
* return void.
*/
-void Light_RestoreStates(MOBLEUINT8 const *pModelState_Load, MOBLEUINT8 size)
-{
- if (size > 0)
- {
- switch(pModelState_Load[0])
- {
- case LIGHT_LIGHTNESS_FLAG:
- {
- Light_Lightness_Set((pModelState_Load+LIGHT_LIGHTNESS_NVM_OFFSET), 2);
- break;
- }
-#ifdef ENABLE_LIGHT_MODEL_SERVER_CTL
- case LIGHT_CTL_FLAG:
- {
- Light_Ctl_Set((pModelState_Load+LIGHT_CTL_NVM_OFFSET), 4);
- break;
- }
-#endif
+void Light_CTLDefaultTransitionValue(Light_CtlParam_t* pCTLValue)
+{
+ Light_TemporaryStatus.TargetParam_1 = pCTLValue->CTL_Lightness;
+ Light_TemporaryStatus.TargetParam_2 = pCTLValue->CTL_Temperature;
+ Light_GetStepValue((MOBLEUINT8)Generic_DefaultTransitionParam.DefaultTransitionTime);
+ Light_ModelFlag.LightTransitionFlag = LIGHT_CTL_TRANSITION_START;
+ Light_ModelFlag.LightOptionalParam = 1;
+}
-#ifdef ENABLE_LIGHT_MODEL_SERVER_HSL
- case LIGHT_HSL_FLAG:
- {
- Light_Hsl_Set((pModelState_Load+LIGHT_HSL_NVM_OFFSET), 6);
- break;
- }
-#endif
- default:
- {
- TRACE_M(TF_GENERIC, "data is invalid %d \r\n", pModelState_Load[0]);
- break;
- }
- }
- }
+/*
+* @brief function called in Light CTL temperature set when the default transition time is enabled.
+* @param void.
+* return void.
+*/
+void Light_CTLTemperatureDefaultTransitionValue(Light_CtlParam_t* pCTLValue)
+{
+ Light_TemporaryStatus.TargetParam_1 = pCTLValue->CTL_Temperature;
+ Light_TemporaryStatus.TargetParam_2 = pCTLValue->CTL_DeltaUv;
+ Light_GetStepValue((MOBLEUINT8)Generic_DefaultTransitionParam.DefaultTransitionTime);
+ Light_ModelFlag.LightTransitionFlag = LIGHT_TEMPERATURE_TRANSITION_START;
+ Light_ModelFlag.LightOptionalParam = 1;
+}
+
+/*
+* @brief Light_Client_Lightness_Status: Function called when status of the model
+ received on the client.
+* @param pLightness_status: ointer to the parameters received for message
+* @param plength: Length of the parameters received for message
+* return MOBLE_RESULT_SUCCESS.
+*/
+MOBLE_RESULT Light_Client_Lightness_Status(MOBLEUINT8 const *pLightness_status, MOBLEUINT32 pLength)
+{
+ MOBLEUINT32 i;
+ TRACE_M(TF_LIGHT,"Light_Lightness_Status callback received \r\n");
+ for(i = 0; i < pLength; i++)
+ TRACE_M(TF_SERIAL_CTRL,"Light_Lightness_Status: %d\r\n",
+ pLightness_status[i]);
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/*
+* @brief Light_Client_Lightness_Linear_Status: Function called when status of the model
+ received on the client.
+* @param pLightnessLinear_status: ointer to the parameters received for message
+* @param pLength: Length of the parameters received for message
+* return MOBLE_RESULT_SUCCESS.
+*/
+MOBLE_RESULT Light_Client_Lightness_Linear_Status(MOBLEUINT8 const *pLightnessLinear_status, MOBLEUINT32 pLength)
+{
+ MOBLEUINT32 i;
+
+ TRACE_M(TF_LIGHT,"Light_Lightness_Linear_Status callback received \r\n");
+ for(i = 0; i < pLength; i++)
+ TRACE_M(TF_SERIAL_CTRL,"Light_Lightness_Linear_Status: %d\r\n",
+ pLightnessLinear_status[i]);
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/*
+* @brief Light_Client_Lightness_Last_Status: Function called when status of the model
+ received on the client.
+* @param pLightnessLast_status: ointer to the parameters received for message
+* @param pLength: Length of the parameters received for message
+* return MOBLE_RESULT_SUCCESS.
+*/
+MOBLE_RESULT Light_Client_Lightness_Last_Status(MOBLEUINT8 const *pLightnessLast_status, MOBLEUINT32 pLength)
+{
+ MOBLEUINT32 i;
+
+ TRACE_M(TF_LIGHT,"Light_Lightness_Last_Status callback received \r\n");
+ for(i = 0; i < pLength; i++)
+ TRACE_M(TF_SERIAL_CTRL,"Light_Lightness_Last_Status: %d\r\n",
+ pLightnessLast_status[i]);
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/*
+* @brief Light_Client_Lightness_Default_Status: Function called when status of the model
+ received on the client.
+* @param pLightnessDefault_status: ointer to the parameters received for message
+* @param pLength: Length of the parameters received for message
+* return MOBLE_RESULT_SUCCESS.
+*/
+MOBLE_RESULT Light_Client_Lightness_Default_Status(MOBLEUINT8 const *pLightnessDefault_status, MOBLEUINT32 pLength)
+{
+ MOBLEUINT32 i;
+
+ TRACE_M(TF_LIGHT,"Light_Lightness_Default_Status callback received \r\n");
+ for(i = 0; i < pLength; i++)
+ TRACE_M(TF_SERIAL_CTRL,"Light_Lightness_Default_Status: %d\r\n",
+ pLightnessDefault_status[i]);
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/*
+* @brief Light_Client_Lightness_Range_Status: Function called when status of the model
+ received on the client.
+* @param pLightnessRange_status: ointer to the parameters received for message
+* @param pLength: Length of the parameters received for message
+* return MOBLE_RESULT_SUCCESS.
+*/
+MOBLE_RESULT Light_Client_Lightness_Range_Status(MOBLEUINT8 const *pLightnessRange_status, MOBLEUINT32 pLength)
+{
+ MOBLEUINT32 i;
+
+ TRACE_M(TF_LIGHT,"Light_Client_Lightness_Range_Status callback received \r\n");
+ for(i = 0; i < pLength; i++)
+ TRACE_M(TF_SERIAL_CTRL,"Light_Client_Lightness_Range_Status: %d\r\n",
+ pLightnessRange_status[i]);
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/*
+* @brief Light_Client_Ctl_Status: Function called when status of the model
+ received on the client.
+* @param pLightCtl_status: ointer to the parameters received for message
+* @param pLength: Length of the parameters received for message
+* return MOBLE_RESULT_SUCCESS.
+*/
+MOBLE_RESULT Light_Client_Ctl_Status(MOBLEUINT8 const *pLightCtl_status, MOBLEUINT32 pLength)
+{
+ MOBLEUINT32 i;
+
+ TRACE_M(TF_LIGHT,"Light_Ctl_Status callback received \r\n");
+ for(i = 0; i < pLength; i++)
+ TRACE_M(TF_SERIAL_CTRL,"Light_Ctl_Status: %d\r\n",
+ pLightCtl_status[i]);
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/*
+* @brief Light_Client_CtlTemperature_Range_Status: Function called when status of the model
+ received on the client.
+* @param pCtlTempRange_status: ointer to the parameters received for message
+* @param pLength: Length of the parameters received for message
+* return MOBLE_RESULT_SUCCESS.
+*/
+MOBLE_RESULT Light_Client_CtlTemperature_Range_Status(MOBLEUINT8 const *pCtlTempRange_status, MOBLEUINT32 pLength)
+{
+ MOBLEUINT32 i;
+
+ TRACE_M(TF_LIGHT,"Light_CtlTemperature_Range_Status callback received \r\n");
+ for(i = 0; i < pLength; i++)
+ TRACE_M(TF_SERIAL_CTRL,"Light_CtlTemperature_Range_Status: %d\r\n",
+ pCtlTempRange_status[i]);
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/*
+* @brief Light_Client_CtlDefault_Status: Function called when status of the model
+ received on the client.
+* @param pCtlDefault_status: ointer to the parameters received for message
+* @param pLength: Length of the parameters received for message
+* return MOBLE_RESULT_SUCCESS.
+*/
+MOBLE_RESULT Light_Client_CtlDefault_Status(MOBLEUINT8 const *pCtlDefault_status, MOBLEUINT32 pLength)
+{
+ MOBLEUINT32 i;
+
+ TRACE_M(TF_LIGHT,"Light_Ctl_DefaultStatus callback received \r\n");
+ for(i = 0; i < pLength; i++)
+ TRACE_M(TF_SERIAL_CTRL,"Light_Ctl_DefaultStatus: %d\r\n",
+ pCtlDefault_status[i]);
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/*
+* @brief Light_Client_CtlTemperature_Status: Function called when status of the model
+ received on the client.
+* @param pLightCtlTemp_status: ointer to the parameters received for message
+* @param pLength: Length of the parameters received for message
+* return MOBLE_RESULT_SUCCESS.
+*/
+MOBLE_RESULT Light_Client_CtlTemperature_Status(MOBLEUINT8 const *pLightCtlTemp_status, MOBLEUINT32 pLength)
+{
+ MOBLEUINT32 i;
+
+ TRACE_M(TF_LIGHT,"Light_CtlTemperature_Status callback received \r\n");
+ for(i = 0; i < pLength; i++)
+ TRACE_M(TF_SERIAL_CTRL,"Light_CtlTemperature_Status: %d\r\n",
+ pLightCtlTemp_status[i]);
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/*
+* @brief Light_Client_Hsl_Status: Function called when status of the model
+ received on the client.
+* @param pHsl_status: ointer to the parameters received for message
+* @param pLength: Length of the parameters received for message
+* return MOBLE_RESULT_SUCCESS.
+*/
+MOBLE_RESULT Light_Client_Hsl_Status(MOBLEUINT8 const *pHsl_status, MOBLEUINT32 pLength)
+{
+ MOBLEUINT32 i;
+
+ TRACE_M(TF_LIGHT,"Light_Hsl_Status callback received \r\n");
+ for(i = 0; i < pLength; i++)
+ TRACE_M(TF_SERIAL_CTRL,"Light_Hsl_Status: %d\r\n",
+ pHsl_status[i]);
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/*
+* @brief Light_Client_HslDefault_Status: Function called when status of the model
+ received on the client.
+* @param pHslDefault_status: ointer to the parameters received for message
+* @param pLength: Length of the parameters received for message
+* return MOBLE_RESULT_SUCCESS.
+*/
+MOBLE_RESULT Light_Client_HslDefault_Status(MOBLEUINT8 const *pHslDefault_status, MOBLEUINT32 pLength)
+{
+ MOBLEUINT32 i;
+
+ TRACE_M(TF_LIGHT,"Light_HslDefault_Status callback received \r\n");
+ for(i = 0; i < pLength; i++)
+ TRACE_M(TF_SERIAL_CTRL,"Light_HslDefault_Status: %d\r\n",
+ pHslDefault_status[i]);
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/*
+* @brief Light_Client_HslRange_Status: Function called when status of the model
+ received on the client.
+* @param pHslRange_status: ointer to the parameters received for message
+* @param pLength: Length of the parameters received for message
+* return MOBLE_RESULT_SUCCESS.
+*/
+MOBLE_RESULT Light_Client_HslRange_Status(MOBLEUINT8 const *pHslRange_status, MOBLEUINT32 pLength)
+{
+ MOBLEUINT32 i;
+
+ TRACE_M(TF_LIGHT,"Light_HslRange_Status callback received \r\n");
+ for(i = 0; i < pLength; i++)
+ TRACE_M(TF_SERIAL_CTRL,"Light_HslRange_Status: %d\r\n",
+ pHslRange_status[i]);
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/*
+* @brief Light_Client_HslTarget_Status: Function called when status of the model
+ received on the client.
+* @param pHslTarget_status: ointer to the parameters received for message
+* @param pLength: Length of the parameters received for message
+* return MOBLE_RESULT_SUCCESS.
+*/
+MOBLE_RESULT Light_Client_HslTarget_Status(MOBLEUINT8 const *pHslTarget_status, MOBLEUINT32 pLength)
+{
+ MOBLEUINT32 i;
+
+ TRACE_M(TF_LIGHT,"Light_HslTarget_Status callback received \r\n");
+ for(i = 0; i < pLength; i++)
+ TRACE_M(TF_SERIAL_CTRL,"Light_HslTarget_Status: %d\r\n",
+ pHslTarget_status[i]);
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/*
+* @brief Light_Client_HslHue_Status: Function called when status of the model
+ received on the client.
+* @param pHslHue_status: ointer to the parameters received for message
+* @param pLength: Length of the parameters received for message
+* return MOBLE_RESULT_SUCCESS.
+*/
+MOBLE_RESULT Light_Client_HslHue_Status(MOBLEUINT8 const *pHslHue_status, MOBLEUINT32 pLength)
+{
+ MOBLEUINT32 i;
+
+ TRACE_M(TF_LIGHT,"Light_HslHue_Status callback received \r\n");
+ for(i = 0; i < pLength; i++)
+ TRACE_M(TF_SERIAL_CTRL,"Light_HslHue_Status: %d\r\n",
+ pHslHue_status[i]);
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/*
+* @brief Light_Client_HslSaturation_Status: Function called when status of the model
+ received on the client.
+* @param pHslSaturation_status: ointer to the parameters received for message
+* @param pLength: Length of the parameters received for message
+* return MOBLE_RESULT_SUCCESS.
+*/
+MOBLE_RESULT Light_Client_HslSaturation_Status(MOBLEUINT8 const *pHslSaturation_status, MOBLEUINT32 pLength)
+{
+ MOBLEUINT32 i;
+
+ TRACE_M(TF_LIGHT,"Light_HslSaturation_Status callback received \r\n");
+ for(i = 0; i < pLength; i++)
+ TRACE_M(TF_SERIAL_CTRL,"Light_HslSaturation_Status: %d\r\n",
+ pHslSaturation_status[i]);
+ return MOBLE_RESULT_SUCCESS;
}
/* Weak function are defined to support the original function if they are not
@@ -2746,93 +3164,81 @@ There is no use of this function for application development purpose.
WEAK_FUNCTION (MOBLE_RESULT Appli_Light_Lightness_Set(Light_LightnessStatus_t* pLight_LightnessParam,
MOBLEUINT8 OptionalValid))
{
-
return MOBLE_RESULT_SUCCESS;
}
-
WEAK_FUNCTION(MOBLE_RESULT Appli_Light_Lightness_Linear_Set(Light_LightnessStatus_t* pLight_LightnessLinearParam,
MOBLEUINT8 OptionalValid))
{
return MOBLE_RESULT_SUCCESS;
}
-
WEAK_FUNCTION(MOBLE_RESULT Appli_Light_Lightness_Default_Set(Light_LightnessDefaultParam_t* pLight_LightnessDefaultParam,
MOBLEUINT8 OptionalValid))
{
return MOBLE_RESULT_SUCCESS;
}
-
WEAK_FUNCTION(MOBLE_RESULT Appli_Light_Lightness_Range_Set(Light_LightnessRangeParam_t* pLight_LightnessRangeParam,
MOBLEUINT8 OptionalValid))
{
return MOBLE_RESULT_SUCCESS;
}
-
WEAK_FUNCTION(MOBLE_RESULT Appli_Light_Ctl_Set(Light_CtlStatus_t* pLight_CtlParam,
MOBLEUINT8 OptionalValid))
{
return MOBLE_RESULT_SUCCESS;
}
-
WEAK_FUNCTION(MOBLE_RESULT Appli_Light_CtlTemperature_Set(Light_CtlStatus_t* pLight_CtltempParam,
MOBLEUINT8 OptionalValid))
{
return MOBLE_RESULT_SUCCESS;
}
-
WEAK_FUNCTION(MOBLE_RESULT Appli_Light_CtlTemperature_Range_Set(Light_CtlTemperatureRangeParam_t* pLight_CtlTempRangeParam,
MOBLEUINT8 OptionalValid))
{
return MOBLE_RESULT_SUCCESS;
}
-
WEAK_FUNCTION(MOBLE_RESULT Appli_Light_CtlDefault_Set(Light_CtlDefaultParam_t* pLight_CtlDefaultParam,
MOBLEUINT8 OptionalValid))
{
return MOBLE_RESULT_SUCCESS;
}
-
WEAK_FUNCTION(MOBLE_RESULT Appli_Light_Hsl_Set(Light_HslStatus_t* pLight_HslParam,
MOBLEUINT8 OptionalValid))
{
return MOBLE_RESULT_SUCCESS;
}
-
WEAK_FUNCTION(MOBLE_RESULT Appli_Light_HslHue_Set(Light_HslStatus_t* pLight_HslHueParam,
MOBLEUINT8 OptionalValid))
{
return MOBLE_RESULT_SUCCESS;
}
-
WEAK_FUNCTION(MOBLE_RESULT Appli_Light_HslSaturation_Set(Light_HslStatus_t* pLight_HslSaturationParam,
MOBLEUINT8 OptionalValid))
{
return MOBLE_RESULT_SUCCESS;
}
-
WEAK_FUNCTION(MOBLE_RESULT Appli_Light_HslDefault_Set(Light_HslStatus_t* pLight_HslDefaultParam,
MOBLEUINT8 OptionalValid))
{
return MOBLE_RESULT_SUCCESS;
}
-
WEAK_FUNCTION(MOBLE_RESULT Appli_Light_HslRange_Set(Light_HslRangeParam_t* pLight_HslRangeParam,
MOBLEUINT8 OptionalValid))
{
return MOBLE_RESULT_SUCCESS;
}
+
WEAK_FUNCTION(MOBLE_RESULT Appli_Light_GetLightnessStatus(MOBLEUINT8* lLightnessState))
{ return MOBLE_RESULT_SUCCESS; }
WEAK_FUNCTION(MOBLE_RESULT Appli_Light_GetLightnessLinearStatus(MOBLEUINT8* lLightnessState))
@@ -2859,15 +3265,9 @@ WEAK_FUNCTION(MOBLE_RESULT Appli_Light_GetHslHueRange(MOBLEUINT8* lHslHueRange))
{ return MOBLE_RESULT_SUCCESS; }
WEAK_FUNCTION(MOBLE_RESULT Appli_Light_GetHslSatRange(MOBLEUINT8* lHslSatRange))
{ return MOBLE_RESULT_SUCCESS; }
-WEAK_FUNCTION(void HSL_RGB_Conversion(void))
-{
-}
-WEAK_FUNCTION(void RgbF_Create(MOBLEUINT16 value1, MOBLEUINT16 value2, MOBLEUINT16 value3))
-{
-}
-WEAK_FUNCTION(void Light_UpdatePWMValue(MOBLEUINT8 state))
-{
-}
+WEAK_FUNCTION(void HSL2RGB_Conversion(void));
+WEAK_FUNCTION(void RgbF_Create(MOBLEUINT16 value1, MOBLEUINT16 value2, MOBLEUINT16 value3));
+WEAK_FUNCTION(void Light_UpdatePWMValue(MOBLEUINT8 state));
/**
* @}
*/
@@ -2876,6 +3276,7 @@ WEAK_FUNCTION(void Light_UpdatePWMValue(MOBLEUINT8 state))
* @}
*/
+
/******************* (C) COPYRIGHT 2017 STMicroelectronics *****END OF FILE****/
diff --git a/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/light_lc.c b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/light_lc.c
new file mode 100644
index 000000000..ea620bf0a
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/light_lc.c
@@ -0,0 +1,1497 @@
+/**
+******************************************************************************
+* @file light_lc.c
+* @author BLE Mesh Team
+* @version V1.10.000
+* @date 15-Jan-2019
+* @brief Light Control model middleware file
+******************************************************************************
+* @attention
+*
+* <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
+*
+* Redistribution and use in source and binary forms, with or without modification,
+* are permitted provided that the following conditions are met:
+* 1. Redistributions of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+* 3. Neither the name of STMicroelectronics nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+* Initial BLE-Mesh is built over Motorolas Mesh over Bluetooth Low Energy
+* (MoBLE) technology. The present solution is developed and maintained for both
+* Mesh library and Applications solely by STMicroelectronics.
+*
+******************************************************************************
+*/
+/* Includes ------------------------------------------------------------------*/
+#include "hal_common.h"
+#include "mesh_cfg.h"
+#include "generic.h"
+#include "light.h"
+#include "common.h"
+#include "light_lc.h"
+#include <string.h>
+#include "compiler.h"
+
+
+/** @addtogroup MODEL_LIGHT_CONTROL
+* @{
+*/
+
+/** @addtogroup Light_Control_Model_Callbacks
+* @{
+*/
+
+/* Private define ------------------------------------------------------------*/
+
+/* Private macro -------------------------------------------------------------*/
+
+/* Private variables ---------------------------------------------------------*/
+#ifdef ENABLE_LIGHT_MODEL_SERVER_LC_SETUP
+Lc_Event_e Lc_Event = LC_NO_EVENT;
+
+Light_LC_States LightLC_States = {LC_STANDBY};
+
+Light_LC_TimeParam_t Light_LC_TimeParam;
+
+Light_LC_Param_t Light_LC_Param;
+
+Light_LC_ModelFlag_t Light_LC_ModelFlag;
+
+Light_LC_OnOffState_t Light_LC_OnOffState;
+
+MOBLEUINT8 Light_LC_UpdateFlag = 0;
+MOBLEUINT32 Timer_value;
+#endif
+
+MODEL_OpcodeTableParam_t Light_LC_Opcodes_Table[] = {
+#ifdef ENABLE_LIGHT_MODEL_SERVER_LC
+ {LIGHT_LC_MODE_GET, MOBLE_TRUE, 0, 0, LIGHT_LC_MODE_STATUS , 1, 1},
+ {LIGHT_LC_MODE_SET, MOBLE_TRUE, 1, 1, LIGHT_LC_MODE_STATUS , 1, 1},
+ {LIGHT_LC_MODE_SET_UNACK, MOBLE_FALSE, 1, 1, 0 , 1, 1},
+ {LIGHT_LC_MODE_STATUS, MOBLE_FALSE, 1, 1, 0 , 1, 1},
+ {LIGHT_LC_OM_GET, MOBLE_TRUE, 0, 0, LIGHT_LC_OM_STATUS , 1, 1},
+ {LIGHT_LC_OM_SET, MOBLE_TRUE, 1, 1, LIGHT_LC_OM_STATUS , 1, 1},
+ {LIGHT_LC_OM_SET_UNACK, MOBLE_FALSE, 1, 1, 0 , 1, 1},
+ {LIGHT_LC_OM_STATUS, MOBLE_FALSE, 1, 1, 0 , 1, 1},
+ {LIGHT_LC_ON_OFF_GET, MOBLE_TRUE, 0, 0, LIGHT_LC_ON_OFF_STATUS , 1, 3},
+ {LIGHT_LC_ON_OFF_SET, MOBLE_TRUE, 2, 4, LIGHT_LC_ON_OFF_STATUS , 1, 3},
+ {LIGHT_LC_ON_OFF_SET_UNACK, MOBLE_FALSE, 2, 4, 0 , 1, 3},
+ {LIGHT_LC_ON_OFF_STATUS, MOBLE_FALSE, 1, 3, 0 , 1, 3},
+#endif
+
+#ifdef ENABLE_LIGHT_MODEL_SERVER_LC_SETUP
+ {LIGHT_LC_PROPERTY_GET, MOBLE_TRUE, 2, 2, LIGHT_LC_PROPERTY_STATUS , 2, 10},
+ {LIGHT_LC_PROPERTY_SET, MOBLE_TRUE, 2, 10, LIGHT_LC_PROPERTY_STATUS , 2, 10},
+ {LIGHT_LC_PROPERTY_SET_UNACK, MOBLE_FALSE, 2, 10, 0 , 2, 10},
+ {LIGHT_LC_PROPERTY_STATUS, MOBLE_FALSE, 2, 10, 0 , 2, 10},
+#endif
+ {0}
+};
+
+/* This table is structure consisting structures of array, this has parameters LC
+ Property and Lc Property value.
+ Table has 4 structures depending on the data type.
+*/
+Light_Property_Table_t Light_Property_Table = {
+
+ {
+ /* regulator accxuracy id which is 8 bit value */
+ { LIGHT_CONTROL_REGULATOR_ACCURACY_ID , LIGHT_CONTROL_REGULATOR_ACCURACY_VALUE},
+ },
+ {
+ /*structure consist of Lc Property value of data type 16 bit */
+ {LIGHT_CONTROL_LIGHTNESS_ON_ID , LIGHT_CONTROL_LIGHTNESS_ON_VALUE},
+ {LIGHT_CONTROL_LIGHTNESS_PROLONG_ID , LIGHT_CONTROL_LIGHTNESS_PROLONG_VALUE},
+ {LIGHT_CONTROL_LIGHTNESS_STANDBY_ID , LIGHT_CONTROL_LIGHTNESS_STANDBY_VALUE},
+ },
+ {
+ /*structure consist of Lc Property value of Maximum range of data 24 bit */
+ {LIGHT_CONTROL_LUX_LEVEL_ON_ID ,LIGHT_CONTROL_AMBIENT_LUXLEVEL_ON},
+ {LIGHT_CONTROL_LUX_LEVEL_PROLONG_ID ,LIGHT_CONTROL_AMBIENT_LUXLEVEL_PROLONG} ,
+ {LIGHT_CONTROL_LUX_LEVEL_STANDBY_ID ,LIGHT_CONTROL_AMBIENT_LUXLEVEL_STANDBY},
+ {LIGHT_CONTROL_TIME_FADE_ID ,LIGHT_CONTROL_TIME_FADE_VALUE},
+ {LIGHT_CONTROL_TIME_FADE_ON_ID ,LIGHT_CONTROL_TIME_FADE_ON_VALUE},
+ {LIGHT_CONTROL_TIME_FADE_STANDBY_AUTO_ID ,LIGHT_CONTROL_TIME_FADE_STANDBY_AUTO_VALUE},
+ {LIGHT_CONTROL_TIME_FADE_STANDBY_MANUAL_ID ,LIGHT_CONTROL_TIME_FADE_STANDBY_MANUAL_VALUE},
+ {LIGHT_CONTROL_TIME_PROLONG_ID ,LIGHT_CONTROL_TIME_PROLONG_VALUE},
+ {LIGHT_CONTROL_TIME_RUN_ON_ID ,LIGHT_CONTROL_TIME_RUN_ON_VALUE},
+ },
+ {
+ /*structure consist of Lc Property value of data type float. */
+ {LIGHT_CONTROL_REGULATOR_KID_ID ,LIGHT_CONTROL_KID},
+ {LIGHT_CONTROL_REGULATOR_KIU_ID ,LIGHT_CONTROL_KIU} ,
+ {LIGHT_CONTROL_REGULATOR_KPD_ID ,LIGHT_CONTROL_KPD},
+ {LIGHT_CONTROL_REGULATOR_KPU_ID ,LIGHT_CONTROL_KPU},
+ },
+};
+
+#ifdef ENABLE_LIGHT_MODEL_SERVER_LC
+/**
+* @brief Light_LC_ModeSet: This function is called for both Acknowledged and
+unacknowledged message
+* @param lcMode_param: Pointer to the parameters received for message
+* @param length: Length of the parameters received for message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Light_LC_ModeSet(MOBLEUINT8 const *lcMode_param, MOBLEUINT32 length)
+{
+
+ TRACE_I(TF_LIGHT_LC, "Light_LC_ModeSet callback received \r\n");
+
+ Light_LC_Param.LC_mode = lcMode_param[0];
+
+ /* Application Callback */
+ (LightLCAppli_cb.LightLC_Mode_Set_cb)(&Light_LC_Param , 0);
+
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Light_LC_ModeStatus
+* @param lcMode_status: Pointer to the status message, which needs to be updated
+* @param plength: Pointer to the Length of the Status message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Light_LC_ModeStatus(MOBLEUINT8* lcMode_status, MOBLEUINT32 *plength)
+{
+ MOBLEUINT8 LightLC_GetBuff[2];
+ TRACE_I(TF_LIGHT_LC,"Light_LC_ModeStatus callback received \r\n");
+ Appli_LightLC_GetStatus_cb.GetLightLC_ModeState_cb(LightLC_GetBuff);
+
+ *lcMode_status = LightLC_GetBuff[0];
+ *plength = 1;
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Light_LC_OMSet: This function is called for both Acknowledged and
+unacknowledged message
+* @param lcOM_param: Pointer to the parameters received for message
+* @param length: Length of the parameters received for message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Light_LC_OMSet(MOBLEUINT8 const *lcOM_param, MOBLEUINT32 length)
+{
+
+ TRACE_I(TF_LIGHT_LC,"Light_LC_OMSet callback received \r\n");
+
+ Light_LC_Param.LC_OM = lcOM_param[0];
+
+ if(Light_LC_Param.LC_OM == 1)
+ {
+ Lc_Event = LC_OCCUPANCY_ON;
+ }
+ else
+ {
+ Lc_Event = LC_OCCUPANCY_OFF;
+ }
+
+ /* Application Callback */
+ (LightLCAppli_cb.LightLC_OM_Set_cb)(&Light_LC_Param , 0);
+
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Light_LC_OMStatus
+* @param lcOM_status: Pointer to the status message, which needs to be updated
+* @param plength: Pointer to the Length of the Status message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Light_LC_OMStatus(MOBLEUINT8* lcOM_status, MOBLEUINT32 *plength)
+{
+ MOBLEUINT8 LightLC_GetBuff[2];
+ TRACE_I(TF_LIGHT_LC,"Light_LC_OMStatus callback received \r\n");
+
+ Appli_LightLC_GetStatus_cb.GetLightLC_OMState_cb(LightLC_GetBuff);
+
+ *lcOM_status = LightLC_GetBuff[0];
+ *plength = 1;
+
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Light_LC_OnOffSet: This function is called for both Acknowledged and
+unacknowledged message
+* @param lcOnOff_param: Pointer to the parameters received for message
+* @param length: Length of the parameters received for message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Light_LC_OnOffSet(MOBLEUINT8 const *lcOnOff_param, MOBLEUINT32 length)
+{
+ TRACE_I(TF_LIGHT_LC,"Light_LC_OnOffSet callback received \r\n");
+
+ Light_LC_Param.Light_OnOff = lcOnOff_param[0];
+ Light_LC_Param.Tid = lcOnOff_param[1];
+ MOBLEUINT16 property_ID;
+ MOBLEUINT32 prop_Value;
+
+ /* Event set to descide the state to be process for LC state machine */
+ if(Light_LC_Param.Light_OnOff == 1)
+ {
+ Lc_Event = LC_LIGHT_ON;
+ }
+ else
+ {
+ Lc_Event = LC_LIGHT_OFF;
+ }
+
+ if(length > 2)
+ {
+ Light_LC_Param.Transition_Time = lcOnOff_param[2];
+ Light_LC_Param.Delay = lcOnOff_param[3];
+
+ prop_Value = Light_LC_Param.Transition_Time;
+
+ if( LightLC_States.Lc_States == LC_STANDBY)
+ {
+ property_ID = LIGHT_CONTROL_TIME_FADE_ON_ID;
+ Light_LC_SetPropertyID_value(prop_Value , property_ID);
+ }
+ else if(LightLC_States.Lc_States == LC_RUN)
+ {
+ property_ID = LIGHT_CONTROL_TIME_FADE_ID;
+ Light_LC_SetPropertyID_value(prop_Value , property_ID);
+ }
+ else if(LightLC_States.Lc_States == LC_PROLONG)
+ {
+ property_ID = LIGHT_CONTROL_TIME_FADE_STANDBY_AUTO_ID;
+ Light_LC_SetPropertyID_value(prop_Value , property_ID);
+ }
+ else
+ {
+ /* No Comment */
+ }
+
+ }
+
+ /* Application Callback */
+ (LightLCAppli_cb.LightLC_OnOff_Set_cb)(&Light_LC_OnOffState , 0);
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Light_LC_OnOffStatus
+* @param lcOnOff_status: Pointer to the status message, which needs to be updated
+* @param plength: Pointer to the Length of the Status message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Light_LC_OnOffStatus(MOBLEUINT8* lcOnOff_status, MOBLEUINT32 *plength)
+{
+ MOBLEUINT8 LightLC_GetBuff[3];
+ TRACE_I(TF_LIGHT_LC,"Light_LC_OnOffStatus callback received \r\n");
+
+ Appli_LightLC_GetStatus_cb.GetLightLC_OnOffState_cb(LightLC_GetBuff);
+ Light_LC_OnOffState.Present_OnOff_State = LightLC_GetBuff[0];
+ if((Light_LC_ModelFlag.LightLcOptionalParam == 1) || (Light_LC_TimeParam.StepValue != 0))
+ {
+ *lcOnOff_status = Light_LC_OnOffState.Present_OnOff_State ;
+ *(lcOnOff_status+1) = Light_LC_OnOffState.Target_OnOff;
+ *(lcOnOff_status+2) = Light_LC_OnOffState.RemainingTime;
+
+ *plength = 3;
+ Light_LC_ModelFlag.LightLcOptionalParam = 0;
+ }
+ else
+ { /* When no optional parameter received, target value will
+ be sent in status message.
+ */
+ *lcOnOff_status = Light_LC_OnOffState.Present_OnOff_State ;
+ *plength = 1;
+ }
+
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Light_LC_PropertySet: This function is called for both Acknowledged and
+unacknowledged message
+* @param lcProp_param: Pointer to the parameters received for message
+* @param length: Length of the parameters received for message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Light_LC_PropertySet(MOBLEUINT8 const *lcProp_param, MOBLEUINT32 length)
+{
+ TRACE_I(TF_LIGHT_LC,"Light_LC_PropertySet callback received \r\n");
+
+ MOBLEUINT16 Light_LC_PropertyID;
+ MOBLEUINT32 property_Value;
+
+ Light_LC_Value_t Light_LC_Value;
+
+ Light_LC_Value.Property_Value = 0;
+
+ Light_LC_PropertyID = lcProp_param[1] << 8;
+ Light_LC_PropertyID |= lcProp_param[0];
+
+ switch (length)
+ {
+ case 3:
+ Light_LC_Value.Property_Value = lcProp_param[2];
+ break;
+ case 4:
+ Light_LC_Value.Property_Value = lcProp_param[2] << 8;
+ Light_LC_Value.Property_Value |= lcProp_param[3];
+ break;
+
+ case 5:
+ Light_LC_Value.Property_Value = lcProp_param[2] << 16;
+ Light_LC_Value.Property_Value |= lcProp_param[3] << 8;
+ Light_LC_Value.Property_Value |= lcProp_param[4];
+ break;
+
+ case 6:
+ Light_LC_Value.Property_Value = lcProp_param[2] << 24;
+ Light_LC_Value.Property_Value |= lcProp_param[3] << 16;
+ Light_LC_Value.Property_Value |= lcProp_param[4] << 8;
+ Light_LC_Value.Property_Value |= lcProp_param[5];
+
+ break;
+
+ default:
+ break;
+ }
+ property_Value = Light_LC_Value.Property_Value;
+ Light_LC_SetPropertyID_value(property_Value,Light_LC_PropertyID);
+
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Light_LC_PropertyStatus
+* @param lcData_param: Pointer to the status message, which needs to be updated
+* @param plength: Pointer to the status message length, which needs to be updated
+* @param pData: Pointer to the message received.
+* @param length: Received message length.
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Light_LC_PropertyStatus( MOBLEUINT8* lcData_param, MOBLEUINT32* plength ,
+ MOBLEUINT8 const *pData, MOBLEUINT32 length)
+{
+ MOBLEUINT16 prop_ID = 0x00;
+ MOBLEUINT32 Property_Value;
+
+ TRACE_M(TF_LIGHT_LC,"Light_LC_PropertyStatus callback received \r\n");
+
+ if(length > 0)
+ {
+ prop_ID = pData[1] << 8;
+ prop_ID |= pData[0];
+ }
+
+ Property_Value = Light_LC_GetPropertyID_value(prop_ID);
+
+ *lcData_param = prop_ID;
+ *(lcData_param+1) = prop_ID >> 8;
+
+ switch (length)
+ {
+ case 3:
+ *(lcData_param+2) = Property_Value;
+ *plength = length;
+ break;
+ case 4:
+ *(lcData_param+2) = Property_Value >> 8;
+ *(lcData_param+3) = Property_Value ;
+ *plength = length;
+ break;
+
+ case 5:
+ *(lcData_param+2) = (Property_Value >> 16);
+ *(lcData_param+3) = Property_Value >> 8;
+ *(lcData_param+4) = Property_Value ;
+ *plength = length;
+ break;
+
+ case 6:
+ *(lcData_param+2) = (Property_Value >> 24);
+ *(lcData_param+3) = (Property_Value >> 16);
+ *(lcData_param+4) = Property_Value >> 8;
+ *(lcData_param+5) = Property_Value ;
+ *plength = length;
+
+ break;
+
+ default:
+ break;
+ }
+
+ return MOBLE_RESULT_SUCCESS;
+}
+
+
+/**
+* @brief Light_LC_GetPropertyID_value: This function is call-back
+* from the library to send Model Opcode Table info to library
+* @param Light_LC_Property_Table_t: Pointer to the property id table array
+* @param pROPERTY_ID: Property id of the parameter.
+* @retval MOBLEUINT32
+*/
+MOBLE_RESULT Light_LC_SetPropertyID_value(MOBLEUINT32 Prop_Value,
+ MOBLEUINT16 prop_ID)
+{
+ MOBLEUINT8 length = sizeof(Light_Property_Table.LC_PropertyTable8b)/sizeof(Light_Property_Table.LC_PropertyTable8b[0]);
+ MOBLEUINT8 valid_flag = 0;
+
+ for(int i=0;i <= length;i++)
+ {
+ if(prop_ID == Light_Property_Table.LC_PropertyTable8b[i].Property_ID)
+ {
+ Light_Property_Table.LC_PropertyTable8b[i].Property_Value_8b = Prop_Value;
+ valid_flag = 1;
+ return MOBLE_RESULT_SUCCESS;
+
+ }
+ }
+
+ length = sizeof(Light_Property_Table.LC_PropertyTable16b)/sizeof(Light_Property_Table.LC_PropertyTable16b[0]);
+
+ for(int i=0;i <= length;i++)
+ {
+ if(prop_ID == Light_Property_Table.LC_PropertyTable16b[i].Property_ID)
+ {
+ Light_Property_Table.LC_PropertyTable16b[i].Property_Value_16= Prop_Value;
+ valid_flag = 1;
+ return MOBLE_RESULT_SUCCESS;
+
+ }
+ }
+
+ length = sizeof(Light_Property_Table.LC_PropertyTable24b)/sizeof(Light_Property_Table.LC_PropertyTable24b[0]);
+
+ for(int i=0;i <= length;i++)
+ {
+ if(prop_ID == Light_Property_Table.LC_PropertyTable24b[i].Property_ID)
+ {
+ Light_Property_Table.LC_PropertyTable24b[i].Property_Value_24b= Prop_Value;
+ valid_flag = 1;
+ return MOBLE_RESULT_SUCCESS;
+
+ }
+ }
+
+ length = sizeof(Light_Property_Table.LC_PropertyTableFloat)/sizeof(Light_Property_Table.LC_PropertyTableFloat[0]);
+
+ for(int i=0;i <= length;i++)
+ {
+ if(prop_ID == Light_Property_Table.LC_PropertyTableFloat[i].Property_ID)
+ {
+ Light_Property_Table.LC_PropertyTableFloat[i].Property_Value_float = Prop_Value;
+ valid_flag = 1;
+ return MOBLE_RESULT_SUCCESS;
+
+ }
+ }
+
+ if(valid_flag == 0)
+ {
+ TRACE_I(TF_LIGHT_LC,"Wrong Property ID \r\n");
+ }
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Light_LC_GetPropertyID_value: This function is call-back
+* from the library to send Model Opcode Table info to library
+* @param Light_LC_Property_Table_t: Pointer to the property id table array
+* @param pROPERTY_ID: Property id of the parameter.
+* @retval MOBLEUINT32
+*/
+MOBLEUINT32 Light_LC_GetPropertyID_value(MOBLEUINT16 property_ID)
+{
+ MOBLEUINT8 length = sizeof(Light_Property_Table.LC_PropertyTable8b)/sizeof(Light_Property_Table.LC_PropertyTable8b[0]);
+
+ for(int i=0;i <= length;i++)
+ {
+ if(property_ID == Light_Property_Table.LC_PropertyTable8b[i].Property_ID)
+ {
+ return Light_Property_Table.LC_PropertyTable8b[i].Property_Value_8b;
+ }
+ }
+
+ length = sizeof(Light_Property_Table.LC_PropertyTable16b)/sizeof(Light_Property_Table.LC_PropertyTable16b[0]);
+ for(int i=0;i <= length;i++)
+ {
+ if(property_ID == Light_Property_Table.LC_PropertyTable16b[i].Property_ID)
+ {
+ return Light_Property_Table.LC_PropertyTable16b[i].Property_Value_16;
+ }
+ }
+
+ length = sizeof(Light_Property_Table.LC_PropertyTable24b)/sizeof(Light_Property_Table.LC_PropertyTable24b[0]);
+ for(int i=0;i <= length;i++)
+ {
+ if(property_ID == Light_Property_Table.LC_PropertyTable24b[i].Property_ID)
+ {
+ return Light_Property_Table.LC_PropertyTable24b[i].Property_Value_24b;
+ }
+ }
+
+ length = sizeof(Light_Property_Table.LC_PropertyTableFloat)/sizeof(Light_Property_Table.LC_PropertyTableFloat[0]);
+ for(int i=0;i <= length;i++)
+ {
+ if(property_ID == Light_Property_Table.LC_PropertyTableFloat[i].Property_ID)
+ {
+ return (MOBLEUINT32)Light_Property_Table.LC_PropertyTableFloat[i].Property_Value_float;
+ }
+ }
+
+ TRACE_I(TF_LIGHT_LC,"Wrong Property ID \r\n");
+ return 0xFFFF;
+
+}
+
+#endif
+
+/**
+* @brief Light_LC_ModelServer_GetOpcodeTableCb: This function is call-back
+* from the library to send Model Opcode Table info to library
+* @param MODEL_OpcodeTableParam_t: Pointer to the Generic Model opcode array
+* @param length: Pointer to the Length of Generic Model opcode array
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Light_LC_ModelServer_GetOpcodeTableCb(const MODEL_OpcodeTableParam_t **data,
+ MOBLEUINT16 *length)
+{
+ *data = Light_LC_Opcodes_Table;
+ *length = sizeof(Light_LC_Opcodes_Table)/sizeof(Light_LC_Opcodes_Table[0]);
+
+ return MOBLE_RESULT_SUCCESS;
+}
+
+
+/**
+* @brief Light_LC_ModelServer_GetStatusRequestCb : This function is call-back
+from the library to send response to the message from peer
+* @param peer_addr: Address of the peer
+* @param dst_peer: destination send by peer for this node. It can be a
+* unicast or group address
+* @param opcode: Received opcode of the Status message callback
+* @param pResponsedata: Pointer to the buffer to be updated with status
+* @param plength: Pointer to the Length of the data, to be updated by application
+* @param pRxData: Pointer to the data received in packet.
+* @param dataLength: length of the data in packet.
+* @param response: Value to indicate wheather message is acknowledged meassage or not.
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Light_LC_ModelServer_GetStatusRequestCb(MOBLE_ADDRESS peer_addr,
+ MOBLE_ADDRESS dst_peer,
+ MOBLEUINT16 opcode,
+ MOBLEUINT8 *pResponsedata,
+ MOBLEUINT32 *plength,
+ MOBLEUINT8 const *pRxData,
+ MOBLEUINT32 dataLength,
+ MOBLEBOOL response)
+
+{
+ TRACE_M(TF_LIGHT,"response status enable \n\r");
+ switch(opcode)
+ {
+#ifdef ENABLE_LIGHT_MODEL_SERVER_LC
+
+ case LIGHT_LC_MODE_STATUS:
+ {
+ Light_LC_ModeStatus(pResponsedata,plength);
+ break;
+ }
+ case LIGHT_LC_OM_STATUS:
+ {
+ Light_LC_OMStatus(pResponsedata,plength);
+ break;
+ }
+ case LIGHT_LC_ON_OFF_STATUS:
+ {
+ Light_LC_OnOffStatus(pResponsedata,plength);
+ break;
+ }
+#endif
+
+#ifdef ENABLE_LIGHT_MODEL_SERVER_LC_SETUP
+
+ case LIGHT_LC_PROPERTY_STATUS:
+ {
+ Light_LC_PropertyStatus(pResponsedata ,plength,pRxData,dataLength);
+ break;
+ }
+#endif
+ default:
+ {
+ break;
+ }
+ }
+ return MOBLE_RESULT_SUCCESS;
+}
+
+
+/**
+* @brief Light_LC_ModelServer_ProcessMessageCb: This is a callback function from
+the library whenever a Generic Model message is received
+* @param peer_addr: Address of the peer
+* @param dst_peer: destination send by peer for this node. It can be a
+* unicast or group address
+* @param opcode: Received opcode of the Status message callback
+* @param pData: Pointer to the buffer to be updated with status
+* @param length: Length of the parameters received
+* @param response: if TRUE, the message is an acknowledged message
+* @param pRxData: Pointer to the data received in packet.
+* @param dataLength: length of the data in packet.
+* @param response: Value to indicate wheather message is acknowledged meassage or not.
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Light_LC_ModelServer_ProcessMessageCb(MOBLE_ADDRESS peer_addr,
+ MOBLE_ADDRESS dst_peer,
+ MOBLEUINT16 opcode,
+ MOBLEUINT8 const *pRxData,
+ MOBLEUINT32 dataLength,
+ MOBLEBOOL response
+ )
+{
+
+ MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
+
+ TRACE_M(TF_LIGHT_LC,"dst_peer = %.2X , peer_add = %.2X, opcode= %.2X,response= %.2X \r\n ",dst_peer, peer_addr, opcode,response);
+ switch(opcode)
+ {
+#ifdef ENABLE_LIGHT_MODEL_SERVER_LC
+
+ case LIGHT_LC_MODE_SET:
+ case LIGHT_LC_MODE_SET_UNACK:
+ {
+ Light_LC_ModeSet(pRxData,dataLength);
+ break;
+ }
+ case LIGHT_LC_MODE_STATUS:
+ {
+ Light_LC_Client_Mode_Status(pRxData, dataLength);
+ break;
+ }
+ case LIGHT_LC_OM_SET:
+ case LIGHT_LC_OM_SET_UNACK:
+ {
+ Light_LC_OMSet(pRxData,dataLength);
+ break;
+ }
+ case LIGHT_LC_OM_STATUS:
+ {
+ Light_LC_Client_OM_Status(pRxData, dataLength);
+ break;
+ }
+ case LIGHT_LC_ON_OFF_SET:
+ case LIGHT_LC_ON_OFF_SET_UNACK:
+ {
+ Light_LC_OnOffSet(pRxData,dataLength);
+ break;
+ }
+ case LIGHT_LC_ON_OFF_STATUS:
+ {
+ Light_LC_Client_ON_OFF_Status(pRxData, dataLength);
+ break;
+ }
+#endif
+
+#ifdef ENABLE_LIGHT_MODEL_SERVER_LC_SETUP
+
+ case LIGHT_LC_PROPERTY_SET:
+ case LIGHT_LC_PROPERTY_SET_UNACK:
+ {
+ Light_LC_PropertySet(pRxData,dataLength);
+ break;
+ }
+ case LIGHT_LC_PROPERTY_STATUS:
+ {
+ Light_LC_Client_Property_Status(pRxData, dataLength);
+ break;
+ }
+#endif
+ default:
+ {
+ break;
+ }
+ } /* Switch ends */
+
+ if((result == MOBLE_RESULT_SUCCESS) && (response == MOBLE_TRUE))
+ {
+ Model_SendResponse(peer_addr,dst_peer,opcode,pRxData,dataLength);
+ }
+
+ return MOBLE_RESULT_SUCCESS;
+}
+
+#ifdef ENABLE_LIGHT_MODEL_SERVER_LC
+/**
+* @brief Light_LC_Fsm: This function is state machine for the light lc
+ controller,which works on the light on off event and sensor occupany event. it
+ will publsih the light linear set command for the nodes, values will be decided
+ according to the controller state.
+* @param void:
+* @retval void:
+**/
+void Light_LC_Fsm(void)
+{
+ MOBLEUINT32 resetTime = Clock_Time();
+ MOBLEUINT32 delta = resetTime - Timer_value;
+ MOBLEUINT8 data_Buff[6];
+ MOBLE_ADDRESS publishAddress;
+ MOBLEUINT8 elementNumber;
+ MOBLEUINT8 elementIndex = 0;
+ MOBLEUINT16 state_Value = 0;
+ MOBLEUINT16 LightnessValue;
+ MOBLEUINT16 luxLightnessvalue = 0;
+ MOBLEUINT16 opcode;
+ MOBLEUINT8 transitionTime = 0;
+ MOBLEUINT32 length = 5;
+
+ static MOBLEUINT8 Publish_flag = 0;
+ static MOBLEUINT32 wait_time;
+
+ switch(LightLC_States.Lc_States)
+ {
+ case LC_STANDBY:
+ {
+ if(Lc_Event == LC_LIGHT_ON)
+ {
+ /* when controller get the event Light on , changes state from standby to
+ fade on state. controller publish the light on value to the node,
+ transition time for the light node.
+ */
+ LightLC_States.Lc_States = LC_FADE_ON;
+
+ opcode = LIGHT_LIGHTNESS_LINEAR_SET_UNACK;
+ /* getting the Lightness on value from the table.*/
+ LightnessValue = Light_LC_GetPropertyID_value(LIGHT_CONTROL_LIGHTNESS_ON_ID);
+ /* getting the Lightness value after complete calculation from the ambient
+ Lux Level and Lux Level output from state machine.*/
+ luxLightnessvalue = Light_LC_LuxLevelOutputValue(LIGHT_CONTROL_LUX_LEVEL_ON_ID);
+ /* Select the maximum value of lightness on value between Lightness on from
+ table and Lux Level Output.
+ */
+ state_Value = Light_LC_MaxLightnessValue(LightnessValue,luxLightnessvalue);
+ transitionTime = Light_LC_GetPropertyID_value(LIGHT_CONTROL_TIME_FADE_ON_ID);
+ wait_time = Get_TimeToWait(LIGHT_CONTROL_TIME_FADE_ON_ID);
+ Timer_value = resetTime;
+ Publish_flag = 1;
+ TRACE_I(TF_LIGHT_LC,"STANDBY STATE --> FADE ON STATE , LIGHT ON EVENT \r\n\n");
+ }
+ else if(Lc_Event == LC_OCCUPANCY_ON)
+ {
+ /* when controller get the event Occupancy on , changes state from standby to
+ fade on state. controller publish the light on value to the node,
+ transition time for the light node.
+ */
+ LightLC_States.Lc_States = LC_FADE_ON;
+
+ opcode = LIGHT_LIGHTNESS_LINEAR_SET_UNACK;
+ /* getting the Lightness on value from the table.*/
+ LightnessValue = Light_LC_GetPropertyID_value(LIGHT_CONTROL_LIGHTNESS_ON_ID);
+ /* getting the Lightness value after complete calculation from the ambient
+ Lux Level and Lux Level output from state machine.*/
+ luxLightnessvalue = Light_LC_LuxLevelOutputValue(LIGHT_CONTROL_LUX_LEVEL_ON_ID);
+ /* Select the maximum value of lightness on value between Lightness on from
+ table and Lux Level Output.
+ */
+ state_Value = Light_LC_MaxLightnessValue(LightnessValue,luxLightnessvalue);
+
+ transitionTime = Light_LC_GetPropertyID_value(LIGHT_CONTROL_TIME_FADE_ON_ID);
+ wait_time = Get_TimeToWait(LIGHT_CONTROL_TIME_FADE_ON_ID);
+ Timer_value = resetTime;
+ Publish_flag = 1;
+ TRACE_I(TF_LIGHT_LC,"STANDBY STATE --> FADE ON STATE , OCCUPANCY ON EVENT \r\n\n");
+ }
+ else
+ {
+ /* No Comment */
+ }
+ break;
+ }
+ case LC_FADE_ON:
+ {
+ if(Lc_Event == LC_LIGHT_OFF)
+ {
+ /* set the light 0x00 with transition time already by the light LC on off set */
+ LightLC_States.Lc_States = LC_FADE_STANDBY_MANUAL;
+
+ opcode = LIGHT_LIGHTNESS_LINEAR_SET_UNACK;
+
+ /* getting the Lightness on value from the table.*/
+ LightnessValue = Light_LC_GetPropertyID_value(LIGHT_CONTROL_LIGHTNESS_STANDBY_ID);
+ /* getting the Lightness value after complete calculation from the ambient
+ Lux Level and Lux Level output from state machine.*/
+ luxLightnessvalue = Light_LC_LuxLevelOutputValue(LIGHT_CONTROL_LUX_LEVEL_STANDBY_ID);
+ /* Select the maximum value of lightness on value between Lightness on from
+ table and Lux Level Output.
+ */
+ state_Value = Light_LC_MaxLightnessValue(LightnessValue,luxLightnessvalue);
+
+ transitionTime = Light_LC_GetPropertyID_value(LIGHT_CONTROL_TIME_FADE_STANDBY_MANUAL_ID);
+ /* Getting the wait time for the timer on the state */
+ wait_time = Get_TimeToWait(LIGHT_CONTROL_TIME_FADE_STANDBY_MANUAL_ID);
+ Publish_flag = 1;
+ TRACE_I(TF_LIGHT_LC,"FADE ON STATE --> RUN STATE, LIGHT OFF EVENT \r\n\n");
+ }
+ else
+ {
+ /* Controller wait here till the transition of light node is not completed
+ so the wait time will be equal to the transition time sent by the controller
+ then controller will change state to run state.
+ */
+ if(delta > wait_time)
+ {
+ LightLC_States.Lc_States = LC_RUN;
+ wait_time = Light_LC_GetPropertyID_value(LIGHT_CONTROL_TIME_RUN_ON_ID);
+ Timer_value = resetTime;
+ Lc_Event = LC_TIMER_OFF;
+ TRACE_I(TF_LIGHT_LC,"FADE ON STATE --> RUN STATE , wait time = %ld \r\n\n",wait_time);
+ }
+ }
+ break;
+ }
+ case LC_RUN:
+ {
+ if(Lc_Event == LC_LIGHT_OFF)
+ {
+
+ LightLC_States.Lc_States = LC_FADE_STANDBY_MANUAL;
+
+ opcode = LIGHT_LIGHTNESS_LINEAR_SET_UNACK;
+ /* getting the Lightness on value from the table*/
+ LightnessValue = Light_LC_GetPropertyID_value(LIGHT_CONTROL_LIGHTNESS_STANDBY_ID);
+ /* getting the Lightness value after complete calculation from the ambient
+ Lux Level and Lux Level output from state machine.*/
+ luxLightnessvalue = Light_LC_LuxLevelOutputValue(LIGHT_CONTROL_LUX_LEVEL_STANDBY_ID);
+ /* Select the maximum value of lightness on value between Lightness on from
+ table and Lux Level Output.
+ */
+ state_Value = Light_LC_MaxLightnessValue(LightnessValue,luxLightnessvalue);
+
+ transitionTime = Light_LC_GetPropertyID_value(LIGHT_CONTROL_TIME_FADE_STANDBY_MANUAL_ID);
+ wait_time = Get_TimeToWait(LIGHT_CONTROL_TIME_FADE_STANDBY_MANUAL_ID);
+ Publish_flag = 1;
+ TRACE_I(TF_LIGHT_LC,"RUN STATE --> STANDBY MANUAL STATE , LIGHT OFF EVENT \r\n\n");
+ }
+ else if(Lc_Event == LC_OCCUPANCY_ON)
+ {
+ /*
+ when controller is in run state already and it gets the Occupancy on event,
+ then the next state is run state.
+ */
+ LightLC_States.Lc_States = LC_RUN;
+ Timer_value = resetTime;
+ Lc_Event = LC_TIMER_OFF;
+ TRACE_I(TF_LIGHT_LC,"RUN STATE --> RUN STATE , OCCUPANCY EVENT \r\n");
+ }
+ else if(Lc_Event == LC_LIGHT_ON)
+ {
+ /*
+ when controller is in run state already and it gets the light on event,
+ then the next state is run state.
+ */
+ LightLC_States.Lc_States = LC_RUN;
+ Timer_value = resetTime;
+ Lc_Event = LC_TIMER_OFF;
+ TRACE_I(TF_LIGHT_LC,"RUN STATE --> RUN STATE , LIGHT ON EVENT \r\n\n");
+ }
+ else if(Lc_Event == LC_TIMER_OFF)
+ {
+ /*
+ when controller is not getting any event and it has completed its wait
+ time of run state then it will change the state to the fade state by
+ send the new light node value and transtion time .
+ */
+ if(delta > wait_time)
+ {
+ LightLC_States.Lc_States = LC_FADE;
+
+ opcode = LIGHT_LIGHTNESS_LINEAR_SET_UNACK;
+ LightnessValue = Light_LC_GetPropertyID_value(LIGHT_CONTROL_LIGHTNESS_PROLONG_ID);
+ /* getting the Lightness value after complete calculation from the ambient
+ Lux Level and Lux Level output from state machine.*/
+ luxLightnessvalue = Light_LC_LuxLevelOutputValue(LIGHT_CONTROL_LUX_LEVEL_PROLONG_ID);
+ /* Select the maximum value of lightness on value between Lightness on from
+ table and Lux Level Output.
+ */
+ state_Value = Light_LC_MaxLightnessValue(LightnessValue,luxLightnessvalue);
+
+ transitionTime = Light_LC_GetPropertyID_value(LIGHT_CONTROL_TIME_FADE_ID);
+ wait_time = Get_TimeToWait(LIGHT_CONTROL_TIME_FADE_ID);
+ Publish_flag = 1;
+ Timer_value = resetTime;
+ Lc_Event = LC_TIMER_OFF;
+ TRACE_I(TF_LIGHT_LC,"RUN STATE --> FADE STATE , wait time = %ld \r\n\n",wait_time);
+ }
+ }
+ else
+ {
+ /* No Comment */
+ }
+ break;
+ }
+ case LC_FADE:
+ {
+ if(Lc_Event == LC_LIGHT_OFF)
+ {
+ /* set the light 0x00 with transition time already by the light LC on off set */
+ LightLC_States.Lc_States = LC_FADE_STANDBY_MANUAL;
+
+ opcode = LIGHT_LIGHTNESS_LINEAR_SET_UNACK;
+ LightnessValue = Light_LC_GetPropertyID_value(LIGHT_CONTROL_LIGHTNESS_STANDBY_ID);
+ /* getting the Lightness value after complete calculation from the ambient
+ Lux Level and Lux Level output from state machine.*/
+ luxLightnessvalue = Light_LC_LuxLevelOutputValue(LIGHT_CONTROL_LUX_LEVEL_STANDBY_ID);
+ /* Select the maximum value of lightness on value between Lightness on from
+ table and Lux Level Output.
+ */
+ state_Value = Light_LC_MaxLightnessValue(LightnessValue,luxLightnessvalue);
+
+ transitionTime = Light_LC_GetPropertyID_value(LIGHT_CONTROL_TIME_FADE_STANDBY_MANUAL_ID);
+ wait_time = Get_TimeToWait(LIGHT_CONTROL_TIME_FADE_STANDBY_MANUAL_ID);
+ Publish_flag = 1;
+ TRACE_I(TF_LIGHT_LC,"FADE STATE --> STANDBY MANUAL , LIGHT OFF EVENT \r\n\n");
+ }
+ else if(Lc_Event == LC_OCCUPANCY_ON)
+ {
+ /*
+ when controller is in fade state and it gets the Occupancy on event,
+ then the next state is fade on state.
+ */
+ LightLC_States.Lc_States = LC_FADE_ON;
+ opcode = LIGHT_LIGHTNESS_LINEAR_SET_UNACK;
+
+ LightnessValue = Light_LC_GetPropertyID_value(LIGHT_CONTROL_LIGHTNESS_ON_ID);
+ /* getting the Lightness value after complete calculation from the ambient
+ Lux Level and Lux Level output from state machine.*/
+ luxLightnessvalue = Light_LC_LuxLevelOutputValue(LIGHT_CONTROL_LUX_LEVEL_ON_ID);
+ /* Select the maximum value of lightness on value between Lightness on from
+ table and Lux Level Output.
+ */
+ state_Value = Light_LC_MaxLightnessValue(LightnessValue,luxLightnessvalue);
+
+ transitionTime = Light_LC_GetPropertyID_value(LIGHT_CONTROL_TIME_FADE_ON_ID);
+ wait_time = Get_TimeToWait(LIGHT_CONTROL_TIME_FADE_ON_ID);
+ Lc_Event = LC_TIMER_OFF;
+ Timer_value = resetTime;
+ Publish_flag = 1;
+ TRACE_I(TF_LIGHT_LC,"FADE STATE --> FADE ON STATE , OCCUPANCY ON EVENT \r\n\n");
+ }
+ else if(Lc_Event == LC_LIGHT_ON)
+ {
+ /*
+ when controller is in fade state and it gets the Light on event,
+ then the next state is fade on state.
+ */
+ LightLC_States.Lc_States = LC_FADE_ON;
+
+ opcode = LIGHT_LIGHTNESS_LINEAR_SET_UNACK;
+ LightnessValue = Light_LC_GetPropertyID_value(LIGHT_CONTROL_LIGHTNESS_ON_ID);
+ /* getting the Lightness value after complete calculation from the ambient
+ Lux Level and Lux Level output from state machine.*/
+ luxLightnessvalue = Light_LC_LuxLevelOutputValue(LIGHT_CONTROL_LUX_LEVEL_ON_ID);
+ /* Select the maximum value of lightness on value between Lightness on from
+ table and Lux Level Output.
+ */
+ state_Value = Light_LC_MaxLightnessValue(LightnessValue,luxLightnessvalue);
+
+ transitionTime = Light_LC_GetPropertyID_value(LIGHT_CONTROL_TIME_FADE_ON_ID);
+ wait_time = Get_TimeToWait(LIGHT_CONTROL_TIME_FADE_ON_ID);
+ Timer_value = resetTime;
+ Publish_flag = 1;
+ Lc_Event = LC_TIMER_OFF;
+ TRACE_I(TF_LIGHT_LC,"FADE STATE --> FADE ON STATE , LIGHT ON EVENT \r\n\n");
+ }
+ else if(Lc_Event == LC_TIMER_OFF)
+ {
+ /* Controller wait here till the transition of light node is not completed
+ so the wait time will be equal to the transition time sent by the controller
+ then controller will change state to prolong state.
+ */
+ if(delta > wait_time)
+ {
+ LightLC_States.Lc_States = LC_PROLONG;
+ wait_time = Light_LC_GetPropertyID_value(LIGHT_CONTROL_TIME_PROLONG_ID);
+ Timer_value = resetTime;
+ Lc_Event = LC_TIMER_OFF;
+ TRACE_I(TF_LIGHT_LC,"FADE STATE --> PROLONG STATE , wait time = %ld \r\n\n",wait_time);
+ }
+ }
+ else
+ {
+ /* no comments */
+ }
+ break;
+ }
+ case LC_PROLONG:
+ {
+ if(Lc_Event == LC_LIGHT_OFF)
+ {
+ /* set the light 0x00 with transition time already by the light LC on off set */
+ LightLC_States.Lc_States = LC_FADE_STANDBY_MANUAL;
+
+ opcode = LIGHT_LIGHTNESS_LINEAR_SET_UNACK;
+ LightnessValue = Light_LC_GetPropertyID_value(LIGHT_CONTROL_LIGHTNESS_STANDBY_ID);
+ /* getting the Lightness value after complete calculation from the ambient
+ Lux Level and Lux Level output from state machine.*/
+ luxLightnessvalue = Light_LC_LuxLevelOutputValue(LIGHT_CONTROL_LUX_LEVEL_STANDBY_ID);
+ /* Select the maximum value of lightness on value between Lightness on from
+ table and Lux Level Output.
+ */
+ state_Value = Light_LC_MaxLightnessValue(LightnessValue,luxLightnessvalue);
+
+ transitionTime = Light_LC_GetPropertyID_value(LIGHT_CONTROL_TIME_FADE_STANDBY_MANUAL_ID);
+ wait_time = Get_TimeToWait(LIGHT_CONTROL_TIME_FADE_STANDBY_MANUAL_ID);
+ Publish_flag = 1;
+ TRACE_I(TF_LIGHT_LC,"PROLONG STATE --> STANDBY MANUAL , LIGHT OFF EVENT \r\n\n");
+ }
+ else if(Lc_Event == LC_OCCUPANCY_ON)
+ {
+ /*
+ when controller is in prolong state and it gets the Occupancy on event,
+ then the next state is fade on state.
+ */
+ LightLC_States.Lc_States = LC_FADE_ON;
+
+ opcode = LIGHT_LIGHTNESS_LINEAR_SET_UNACK;
+ LightnessValue = Light_LC_GetPropertyID_value(LIGHT_CONTROL_LIGHTNESS_ON_ID);
+ /* getting the Lightness value after complete calculation from the ambient
+ Lux Level and Lux Level output from state machine.*/
+ luxLightnessvalue = Light_LC_LuxLevelOutputValue(LIGHT_CONTROL_LUX_LEVEL_ON_ID);
+ /* Select the maximum value of lightness on value between Lightness on from
+ table and Lux Level Output.
+ */
+ state_Value = Light_LC_MaxLightnessValue(LightnessValue,luxLightnessvalue);
+
+ transitionTime = Light_LC_GetPropertyID_value(LIGHT_CONTROL_TIME_FADE_ON_ID);
+ wait_time = Get_TimeToWait(LIGHT_CONTROL_TIME_FADE_ON_ID);
+ Timer_value = resetTime;
+ Publish_flag = 1;
+ TRACE_I(TF_LIGHT_LC,"STANDBY AUTO --> FADE ON STATE , OCCUPANCY ON EVENT \r\n\n");
+ }
+ else if(Lc_Event == LC_LIGHT_ON)
+ {
+ /*
+ when controller is in prolong state and it gets the Light on event,
+ then the next state is fade on state.
+ */
+ LightLC_States.Lc_States = LC_FADE_ON;
+
+ opcode = LIGHT_LIGHTNESS_LINEAR_SET_UNACK;
+ LightnessValue = Light_LC_GetPropertyID_value(LIGHT_CONTROL_LIGHTNESS_ON_ID);
+ /* getting the Lightness value after complete calculation from the ambient
+ Lux Level and Lux Level output from state machine.*/
+ luxLightnessvalue = Light_LC_LuxLevelOutputValue(LIGHT_CONTROL_LUX_LEVEL_ON_ID);
+ /* Select the maximum value of lightness on value between Lightness on from
+ table and Lux Level Output.
+ */
+ state_Value = Light_LC_MaxLightnessValue(LightnessValue,luxLightnessvalue);
+
+ transitionTime = Light_LC_GetPropertyID_value(LIGHT_CONTROL_TIME_FADE_ON_ID);
+ wait_time = Get_TimeToWait(LIGHT_CONTROL_TIME_FADE_ON_ID);
+ Timer_value = resetTime;
+ Publish_flag = 1;
+ TRACE_I(TF_LIGHT_LC,"PROLONG STATE --> FADE ON STATE , LIGHT ON EVENT \r\n\n");
+ }
+ else if(Lc_Event == LC_TIMER_OFF)
+ {
+ /*
+ when controller is not getting any event and it has completed its wait
+ time of prolong state then it will change the state to the fade standby
+ and send the new light node value and transtion time .
+ */
+ if(delta > wait_time)
+ {
+ LightLC_States.Lc_States = LC_FADE_STANDBY_AUTO;
+
+ opcode = LIGHT_LIGHTNESS_LINEAR_SET_UNACK;
+ LightnessValue = Light_LC_GetPropertyID_value(LIGHT_CONTROL_LIGHTNESS_STANDBY_ID);
+ /* getting the Lightness value after complete calculation from the ambient
+ Lux Level and Lux Level output from state machine.*/
+ luxLightnessvalue = Light_LC_LuxLevelOutputValue(LIGHT_CONTROL_LUX_LEVEL_STANDBY_ID);
+ /* Select the maximum value of lightness on value between Lightness on from
+ table and Lux Level Output.
+ */
+ state_Value = Light_LC_MaxLightnessValue(LightnessValue,luxLightnessvalue);
+
+ transitionTime = Light_LC_GetPropertyID_value(LIGHT_CONTROL_TIME_FADE_STANDBY_AUTO_ID);
+ wait_time = Get_TimeToWait(LIGHT_CONTROL_TIME_FADE_STANDBY_AUTO_ID);
+ Publish_flag = 1;
+ Timer_value = resetTime;
+ TRACE_I(TF_LIGHT_LC,"PROLONG STATE --> STANDBY AUTO STATE , wait time = %ld \r\n\n",wait_time);
+ }
+ }
+ else
+ {
+ /* no comments */
+ }
+ break;
+ }
+ case LC_FADE_STANDBY_AUTO:
+ {
+ if(Lc_Event == LC_LIGHT_OFF)
+ {
+ /* set the light 0x00 with transition time already by the light LC on off set */
+ LightLC_States.Lc_States = LC_FADE_STANDBY_MANUAL;
+
+ opcode = LIGHT_LIGHTNESS_LINEAR_SET_UNACK;
+ LightnessValue = Light_LC_GetPropertyID_value(LIGHT_CONTROL_LIGHTNESS_STANDBY_ID);
+ /* getting the Lightness value after complete calculation from the ambient
+ Lux Level and Lux Level output from state machine.*/
+ luxLightnessvalue = Light_LC_LuxLevelOutputValue(LIGHT_CONTROL_LUX_LEVEL_STANDBY_ID);
+ /* Select the maximum value of lightness on value between Lightness on from
+ table and Lux Level Output.
+ */
+ state_Value = Light_LC_MaxLightnessValue(LightnessValue,luxLightnessvalue);
+
+ transitionTime = Light_LC_GetPropertyID_value(LIGHT_CONTROL_TIME_FADE_STANDBY_MANUAL_ID);
+ wait_time = Get_TimeToWait(LIGHT_CONTROL_TIME_FADE_STANDBY_MANUAL_ID);
+ Publish_flag = 1;
+ TRACE_I(TF_LIGHT_LC,"STANDBY AUTO STATE --> STANDBY MANUAL , LIGHT OFF EVENT \r\n\n");
+ }
+ else if(Lc_Event == LC_OCCUPANCY_ON)
+ {
+ /*
+ when controller is in standby auto state and it gets the occupancy on event,
+ then the next state is fade on state.
+ */
+ LightLC_States.Lc_States = LC_FADE_ON;
+
+ opcode = LIGHT_LIGHTNESS_LINEAR_SET_UNACK;
+ LightnessValue = Light_LC_GetPropertyID_value(LIGHT_CONTROL_LIGHTNESS_ON_ID);
+ /* getting the Lightness value after complete calculation from the ambient
+ Lux Level and Lux Level output from state machine.*/
+ luxLightnessvalue = Light_LC_LuxLevelOutputValue(LIGHT_CONTROL_LUX_LEVEL_ON_ID);
+ /* Select the maximum value of lightness on value between Lightness on from
+ table and Lux Level Output.
+ */
+ state_Value = Light_LC_MaxLightnessValue(LightnessValue,luxLightnessvalue);
+
+ transitionTime = Light_LC_GetPropertyID_value(LIGHT_CONTROL_TIME_FADE_ON_ID);
+ wait_time = Get_TimeToWait(LIGHT_CONTROL_TIME_FADE_ON_ID);
+ Timer_value = resetTime;
+ Publish_flag = 1;
+ TRACE_I(TF_LIGHT_LC,"STANDBY AUTO --> FADE ON STATE , OCCUPANCY ON EVENT \r\n\n");
+ }
+ else if(Lc_Event == LC_LIGHT_ON)
+ {
+ /*
+ when controller is in standby auto state and it gets the Light on event,
+ then the next state is fade on state.
+ */
+ LightLC_States.Lc_States = LC_FADE_ON;
+
+ opcode = LIGHT_LIGHTNESS_LINEAR_SET_UNACK;
+ LightnessValue = Light_LC_GetPropertyID_value(LIGHT_CONTROL_LIGHTNESS_ON_ID);
+ /* getting the Lightness value after complete calculation from the ambient
+ Lux Level and Lux Level output from state machine.*/
+ luxLightnessvalue = Light_LC_LuxLevelOutputValue(LIGHT_CONTROL_LUX_LEVEL_ON_ID);
+ /* Select the maximum value of lightness on value between Lightness on from
+ table and Lux Level Output.
+ */
+ state_Value = Light_LC_MaxLightnessValue(LightnessValue,luxLightnessvalue);
+
+ transitionTime = Light_LC_GetPropertyID_value(LIGHT_CONTROL_TIME_FADE_ON_ID);
+ wait_time = Get_TimeToWait(LIGHT_CONTROL_TIME_FADE_ON_ID);
+ Timer_value = resetTime;
+ Publish_flag = 1;
+ TRACE_I(TF_LIGHT_LC,"STANDBY AUTO --> FADE ON STATE , LIGHT ON EVENT \r\n\n");
+ }
+ else if(Lc_Event == LC_TIMER_OFF)
+ {
+ /* Controller wait here till the transition of light node is not completed
+ so the wait time will be equal to the transition time sent by the controller
+ then controller will change state to standby state.
+ */
+ if(delta > wait_time)
+ {
+ LightLC_States.Lc_States = LC_STANDBY;
+ Lc_Event = LC_NO_EVENT;
+ Timer_value = resetTime;
+ TRACE_I(TF_LIGHT_LC,"STANDBY AUTO --> STANDBY STATE , wait time = %ld \r\n\n",wait_time);
+ }
+ }
+ else
+ {
+ /* no comments */
+ }
+ break;
+ }
+ case LC_FADE_STANDBY_MANUAL:
+ {
+ /*
+ when controller is in run state already and it gets the Light on event,
+ then the next state is fade on state.
+ */
+ if(Lc_Event == LC_LIGHT_ON)
+ {
+ LightLC_States.Lc_States = LC_FADE_ON;
+ opcode = LIGHT_LIGHTNESS_LINEAR_SET_UNACK;
+ LightnessValue = Light_LC_GetPropertyID_value(LIGHT_CONTROL_LIGHTNESS_ON_ID);
+ /* getting the Lightness value after complete calculation from the ambient
+ Lux Level and Lux Level output from state machine.*/
+ luxLightnessvalue = Light_LC_LuxLevelOutputValue(LIGHT_CONTROL_LUX_LEVEL_ON_ID);
+ /* Select the maximum value of lightness on value between Lightness on from
+ table and Lux Level Output.
+ */
+ state_Value = Light_LC_MaxLightnessValue(LightnessValue,luxLightnessvalue);
+
+ transitionTime = Light_LC_GetPropertyID_value(LIGHT_CONTROL_TIME_FADE_ON_ID);
+ wait_time = Get_TimeToWait(LIGHT_CONTROL_TIME_FADE_ON_ID);
+ Timer_value = resetTime;
+ Publish_flag = 1;
+ TRACE_I(TF_LIGHT_LC,"STANDBY MANUAL STATE --> FADE ON STATE , LIGHT ON EVENT \r\n\n");
+ }
+ else
+ {
+ /* Controller wait here till the transition of light node is not completed
+ so the wait time will be equal to the transition time sent by the controller
+ then controller will change state to standby state.
+ */
+ if(delta > wait_time)
+ {
+ LightLC_States.Lc_States = LC_STANDBY;
+ Lc_Event = LC_NO_EVENT;
+ Timer_value = resetTime;
+ TRACE_I(TF_LIGHT_LC,"STANDBY MANUAL STATE --> STANDBY STATE , wait time = %ld \r\n\n",wait_time);
+ }
+ }
+ break;
+ }
+ default:
+ {
+ break;
+ }
+ }
+ if(Publish_flag == 1)
+ {
+ if(Light_LC_Param.Transition_Time == 0x00)
+ {
+
+ }
+ elementNumber = BLE_GetElementNumber();
+
+ publishAddress = BLEMesh_GetPublishAddress(elementNumber);
+
+ data_Buff[0] = state_Value;
+ data_Buff[1] = state_Value >> 8;
+ data_Buff[2] = 0x01;
+ data_Buff[3] = transitionTime;
+
+ BLEMesh_SetRemoteData(publishAddress, elementIndex,
+ opcode ,
+ data_Buff, length,
+ MOBLE_FALSE, MOBLE_FALSE);
+ Publish_flag = 0;
+ }
+}
+
+/**
+* @brief Generic_GetStepValue: This function calculates values for transition time
+* @param stepParam: Transition time set value of particular model message.
+* retval void
+*/
+MOBLEUINT32 Light_LC_GetStepValue(MOBLEUINT8 stepParam)
+{
+ /*
+ Two MSB bit of transition time is dedicated to resolution.
+ 00 = resolution is 100 ms.
+ 01 = resolution is 1000 ms.
+ 10 = resolution is 10000 ms.
+ 11 = resolution is 600000 ms.
+ Last bits from 0 to 5th index is step number.
+ */
+ Light_LC_TimeParam.ResBitValue = stepParam >> 6 ;
+ Light_LC_TimeParam.Res_Value = Get_StepResolutionValue(Light_LC_TimeParam.ResBitValue);
+ Light_LC_TimeParam.StepValue = stepParam & 0x3F ;
+
+ if(Light_LC_TimeParam.Res_Value >= 100)
+ {
+ Light_LC_TimeParam.Res_Value = Light_LC_TimeParam.Res_Value/TRANSITION_SCALER;
+ Light_LC_TimeParam.StepValue = (Light_LC_TimeParam.StepValue * TRANSITION_SCALER);
+ }
+ Light_LC_TimeParam.TotalTime = Light_LC_TimeParam.Res_Value * Light_LC_TimeParam.StepValue;
+
+ return Light_LC_TimeParam.TotalTime;
+}
+
+/**
+* @brief Generic_GetStepValue: This function calculates values for transition time
+* @param stepParam: Transition time set value of particular model message.
+* retval void
+*/
+MOBLEUINT32 Get_TimeToWait(MOBLEUINT16 Proprety_ID)
+{
+ MOBLEUINT32 getValue32;
+ MOBLEUINT8 getValue8;
+ MOBLEUINT32 total_time;
+ getValue32 = Light_LC_GetPropertyID_value(Proprety_ID);
+
+ getValue8 = (MOBLEUINT8)(getValue32 & 0x000000FF);
+ total_time = Light_LC_GetStepValue((MOBLEUINT8)getValue8);
+
+ TRACE_I(TF_LIGHT_LC,"TOTAL WAIT TIME %ld \r\n",total_time);
+
+ return total_time;
+}
+
+/**
+* @brief Light_control_Process: Function to execute the transition state machine for
+particular Light LC model and state machine Light LC application
+* @param void
+* @retval void
+*/
+void Light_control_Process(void)
+{
+
+ if(Light_LC_Param.LC_mode == LC_MODE_ENABLE)
+ {
+ Light_LC_Fsm();
+ }
+ else
+ {
+ /* Light LC on off set to off */
+ Light_LC_Param.Light_OnOff = 0x0;
+ LightLC_States.Lc_States = LC_STANDBY;
+ }
+}
+
+/**
+* @brief Light_LC_LuxLevelOutputValue: This function will return the lightness value
+ from the lux sensors.
+* @param void:
+* @retval MOBLEUINT16:
+**/
+MOBLEUINT16 Light_LC_LuxLevelOutputValue(MOBLEUINT16 property_ID)
+{
+ MOBLEUINT16 availableLuxValue;
+ MOBLEUINT16 ambientLuxValue;
+ MOBLEUINT16 lightnessOutput;
+
+ availableLuxValue = Light_LC_GetPropertyID_value(property_ID);
+ ambientLuxValue = Appli_LightLC_GetStatus_cb.GetLightLC_AmbientLuxLevel_cb();
+
+ lightnessOutput = Appli_LightLC_GetStatus_cb.GetLightLC_PIregulatorOut_cb(availableLuxValue,ambientLuxValue);
+
+ return lightnessOutput;
+ }
+
+
+/**
+* @brief Light_LC_MaxLightnessValue: This function will return the maximum value
+ after comparision.
+* @param void:
+* @retval MOBLEUINT16:
+**/
+MOBLEUINT16 Light_LC_MaxLightnessValue(MOBLEUINT16 Param1,MOBLEUINT16 Param2)
+{
+ if(Param1 > Param2)
+ {
+ return Param1;
+ }
+ else if(Param2 > Param1)
+ {
+ return Param2;
+ }
+ else
+ {
+ return Param1;
+ }
+}
+
+#endif
+
+/*
+* @brief Light_LC_Client_Mode_Status: Function called when status of the model
+ received on the client.
+* @param pLightLc_status: pointer to the parameters received for message
+* @param pLength: Length of the parameters received for message
+* return MOBLE_RESULT_SUCCESS.
+*/
+MOBLE_RESULT Light_LC_Client_Mode_Status(MOBLEUINT8 const *pLightLc_status, MOBLEUINT32 pLength)
+{
+ MOBLEUINT32 i;
+
+ TRACE_M(TF_LIGHT,"Light_LC_Client_Mode_Status callback received \r\n");
+ for(i = 0; i < pLength; i++)
+ TRACE_M(TF_SERIAL_CTRL,"Light_LC_Client_Mode_Status: %d\r\n",
+ pLightLc_status[i]);
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/*
+* @brief Light_LC_Client_OM_Status: Function called when status of the model
+ received on the client.
+* @param pLightLc_status: pointer to the parameters received for message
+* @param pLength: Length of the parameters received for message
+* return MOBLE_RESULT_SUCCESS.
+*/
+MOBLE_RESULT Light_LC_Client_OM_Status(MOBLEUINT8 const *pLightLc_status, MOBLEUINT32 pLength)
+{
+ MOBLEUINT32 i;
+
+ TRACE_M(TF_LIGHT,"Light_LC_Client_OM_Status callback received \r\n");
+ for(i = 0; i < pLength; i++)
+ TRACE_M(TF_SERIAL_CTRL,"Light_LC_Client_OM_Status: %d\r\n",
+ pLightLc_status[i]);
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/*
+* @brief Light_LC_Client_ON_OFF_Status: Function called when status of the model
+ received on the client.
+* @param pLightLc_status: pointer to the parameters received for message
+* @param pLength: Length of the parameters received for message
+* return MOBLE_RESULT_SUCCESS.
+*/
+MOBLE_RESULT Light_LC_Client_ON_OFF_Status(MOBLEUINT8 const *pLightLc_status, MOBLEUINT32 pLength)
+{
+ MOBLEUINT32 i;
+
+ TRACE_M(TF_LIGHT,"Light_LC_Client_ON_OFF_Status callback received \r\n");
+ for(i = 0; i < pLength; i++)
+ TRACE_M(TF_SERIAL_CTRL,"Light_LC_Client_ON_OFF_Status: %d\r\n",
+ pLightLc_status[i]);
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/*
+* @brief Light_LC_Client_Property_Status: Function called when status of the model
+ received on the client.
+* @param pLightLc_status: pointer to the parameters received for message
+* @param pLength: Length of the parameters received for message
+* return MOBLE_RESULT_SUCCESS.
+*/
+MOBLE_RESULT Light_LC_Client_Property_Status(MOBLEUINT8 const *pLightLc_status, MOBLEUINT32 pLength)
+{
+ MOBLEUINT32 i;
+
+ TRACE_M(TF_LIGHT,"Light_LC_Client_Property_Status callback received \r\n");
+ for(i = 0; i < pLength; i++)
+ TRACE_M(TF_SERIAL_CTRL,"Light_LC_Client_Property_Status: %d\r\n",
+ pLightLc_status[i]);
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @}
+*/
+
+/**
+* @}
+*/
+
+/******************* (C) COPYRIGHT 2017 STMicroelectronics *****END OF FILE****/
+
diff --git a/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/meshdfu_node.c b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/meshdfu_node.c
new file mode 100644
index 000000000..23e49f837
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/meshdfu_node.c
@@ -0,0 +1,207 @@
+/**
+******************************************************************************
+* @file meshdfu_node.c
+* @author BLE Mesh Team
+* @version V1.10.000
+* @date 15-May-2019
+* @brief BLE-Mesh Device Firmware Upgrade / FOTA over the mesh implementation
+******************************************************************************
+* @attention
+*
+* <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
+*
+* Redistribution and use in source and binary forms, with or without modification,
+* are permitted provided that the following conditions are met:
+* 1. Redistributions of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+* 3. Neither the name of STMicroelectronics nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+* Initial BlueNRG-Mesh is built over Motorolas Mesh over Bluetooth Low Energy
+* (MoBLE) technology. The present solution is developed and maintained for both
+* Mesh library and Applications solely by STMicroelectronics.
+*
+******************************************************************************
+*/
+/* Includes ------------------------------------------------------------------*/
+#include "hal_common.h"
+#include "mesh_cfg.h"
+#include "common.h"
+#include <string.h>
+#include "compiler.h"
+#include "Math.h"
+#include "meshdfu_node.h"
+
+
+/** @addtogroup Model_Callbacks
+* @{
+*/
+
+/* Private define ------------------------------------------------------------*/
+/* Private macro -------------------------------------------------------------*/
+/* Private variables ---------------------------------------------------------*/
+
+const MODEL_OpcodeTableParam_t MeshDfuNode_Opcodes_Table[] = {
+ /*MOBLEUINT32 opcode, MOBLEBOOL reliable, MOBLEUINT16 min_payload_size,
+ MOBLEUINT16 max_payload_size;
+ Here in this array, Handler is not defined; */
+#ifdef ENABLE_MESHNODEUPDATE_MODEL_SERVER
+ {FIRMWARE_INFORMATION_GET, MOBLE_TRUE, 0, 0, FIRMWARE_INFORMATION_STATUS , 1, 255},
+ {FIRMWARE_UPDATE_GET, MOBLE_TRUE, 0, 0, FIRMWARE_UPDATE_STATUS , 3, 255},
+ {FIRMWARE_VALIDATION_DATA_CHECK, MOBLE_TRUE, 1, 255, FIRMWARE_VALIDATION_DATA_STATUS , 1, 255},
+ {FIRMWARE_UPDATE_CHECK, MOBLE_TRUE, 0, 0, FIRMWARE_UPDATE_STATUS , 3, 255},
+ {FIRMWARE_UPDATE_START, MOBLE_TRUE, 10, 255, FIRMWARE_UPDATE_STATUS , 3, 255},
+ {FIRMWARE_UPDATE_CANCEL, MOBLE_TRUE, 0, 0, FIRMWARE_UPDATE_STATUS , 3, 255},
+ {FIRMWARE_UPDATE_APPLY, MOBLE_TRUE, 0, 0, FIRMWARE_UPDATE_STATUS , 3, 255},
+ {FIRMWARE_INFORMATION_STATUS, MOBLE_FALSE, 0, 0, 0 , 1, 255},
+ {FIRMWARE_VALIDATION_DATA_STATUS, MOBLE_FALSE, 0, 0, 0 , 1, 255},
+ {FIRMWARE_UPDATE_STATUS, MOBLE_FALSE, 0, 0, 0 , 3, 255},
+#endif
+ {0}
+};
+/* Private function prototypes -----------------------------------------------*/
+/* Private functions ---------------------------------------------------------*/
+
+/**
+* @brief MeshDfuNode_ModelServer_GetOpcodeTableCb: This function is call-back
+ from the library to send Model Opcode Table info to library
+* @param MODEL_OpcodeTableParam_t: Pointer to the Light Model opcode array
+* @param length: Pointer to the Length of Light Model opcode array
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT MeshDfuNode_ModelServer_GetOpcodeTableCb(const MODEL_OpcodeTableParam_t **data,
+ MOBLEUINT16 *length)
+{
+ *data = MeshDfuNode_Opcodes_Table;
+ *length = sizeof(MeshDfuNode_Opcodes_Table)/sizeof(MeshDfuNode_Opcodes_Table[0]);
+
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief MeshDfuNode_ModelServer_GetStatusRequestCb : This function is call-back
+ from the library to send response to the message from peer
+* @param peer_addr: Address of the peer
+* @param dst_peer: destination send by peer for this node. It can be a
+* unicast or group address
+* @param opcode: Received opcode of the Status message callback
+* @param pResponsedata: Pointer to the buffer to be updated with status
+* @param plength: Pointer to the Length of the data, to be updated by application
+* @param pRxData: Pointer to the data received in packet.
+* @param dataLength: length of the data in packet.
+* @param response: Value to indicate wheather message is acknowledged meassage or not.
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT MeshDfuNode_ModelServer_GetStatusRequestCb(MOBLE_ADDRESS peer_addr,
+ MOBLE_ADDRESS dst_peer,
+ MOBLEUINT16 opcode,
+ MOBLEUINT8 *pResponsedata,
+ MOBLEUINT32 *plength,
+ MOBLEUINT8 const *pRxData,
+ MOBLEUINT32 dataLength,
+ MOBLEBOOL response)
+{
+ switch(opcode)
+ {
+ case FIRMWARE_INFORMATION_STATUS:
+ {
+ break;
+ }
+ case FIRMWARE_VALIDATION_DATA_STATUS:
+ {
+ break;
+ }
+ case FIRMWARE_UPDATE_STATUS:
+ {
+ break;
+ }
+
+ default:
+ {
+ break;
+ }
+ }
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief MeshDfuNode_ModelServer_ProcessMessageCb: This is a callback function from
+ the library whenever a Light Model message is received
+* @param peer_addr: Address of the peer
+* @param dst_peer: destination send by peer for this node. It can be a
+* unicast or group address
+* @param opcode: Received opcode of the Status message callback
+* @param pData: Pointer to the buffer to be updated with status
+* @param length: Length of the parameters received
+* @param response: if TRUE, the message is an acknowledged message
+* @param pRxData: Pointer to the data received in packet.
+* @param dataLength: length of the data in packet.
+* @param response: Value to indicate wheather message is acknowledged meassage or not.
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT MeshDfuNode_ModelServer_ProcessMessageCb(MOBLE_ADDRESS peer_addr,
+ MOBLE_ADDRESS dst_peer,
+ MOBLEUINT16 opcode,
+ MOBLEUINT8 const *pRxData,
+ MOBLEUINT32 dataLength,
+ MOBLEBOOL response
+ )
+{
+ switch(opcode)
+ {
+ case FIRMWARE_INFORMATION_GET:
+ {
+ break;
+ }
+ case FIRMWARE_UPDATE_GET:
+ {
+ break;
+ }
+ case FIRMWARE_VALIDATION_DATA_CHECK:
+ {
+ break;
+ }
+ case FIRMWARE_UPDATE_CHECK:
+ {
+ break;
+ }
+ case FIRMWARE_UPDATE_START:
+ {
+ break;
+ }
+ case FIRMWARE_UPDATE_CANCEL:
+ {
+ break;
+ }
+
+ case FIRMWARE_UPDATE_APPLY:
+ {
+ break;
+ }
+
+ default:
+ {
+ break;
+ }
+ } /* Switch ends */
+ return MOBLE_RESULT_SUCCESS;
+}
+
+
+/******************* (C) COPYRIGHT 2017 STMicroelectronics *****END OF FILE****/
+
diff --git a/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/sensors.c b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/sensors.c
index beec9bc28..7fb75d75d 100644
--- a/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/sensors.c
+++ b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/sensors.c
@@ -43,6 +43,7 @@
#include "mesh_cfg.h"
#include "sensors.h"
#include "common.h"
+#include "light_lc.h"
#include <string.h>
#include "compiler.h"
#include "Math.h"
@@ -73,19 +74,26 @@ const MODEL_OpcodeTableParam_t Sensor_Opcodes_Table[] = {
#ifdef ENABLE_SENSOR_MODEL_SERVER
{SENSOR_DESCRIPTOR_GET, MOBLE_TRUE, 0, 2, SENSOR_DESCRIPTOR_STATUS , 2, 16},
+ {SENSOR_DESCRIPTOR_STATUS, MOBLE_FALSE, 2, 16, SENSOR_DESCRIPTOR_STATUS , 2, 16},
{SENSOR_GET, MOBLE_TRUE, 0, 2, SENSOR_STATUS , 0,65 }, /* STATUS MESSAGE AS MARSHALLED DATA */
+ {SENSOR_STATUS, MOBLE_FALSE, 0, 65, SENSOR_STATUS , 0,65 },
{SENSOR_COLUMN_GET, MOBLE_TRUE, 3, 3, SENSOR_COLUMN_STATUS , 4, 8}, /* GET VARIABLE TAKEN AS 1 (2+VARIABLE) */
+ {SENSOR_COLUMN_STATUS, MOBLE_FALSE, 4, 8, SENSOR_COLUMN_STATUS , 4, 8},
#endif
#ifdef ENABLE_SENSOR_MODEL_SERVER_SETUP
{SENSOR_CADENCE_GET, MOBLE_TRUE, 2, 2, SENSOR_CADENCE_STATUS , 2, 8},
{SENSOR_CADENCE_SET, MOBLE_TRUE, 8, 8, SENSOR_CADENCE_STATUS , 2, 8},
{SENSOR_CADENCE_SET_UNACK, MOBLE_FALSE, 8, 8, SENSOR_CADENCE_STATUS , 2, 8},
+ {SENSOR_CADENCE_STATUS, MOBLE_FALSE, 2, 8, SENSOR_CADENCE_STATUS , 2, 8},
{SENSOR_SETTING_GET, MOBLE_TRUE, 2, 2, SENSOR_SETTING_STATUS_PID , 4 , 4},
+ {SENSOR_SETTING_STATUS_PID, MOBLE_FALSE, 4, 4, SENSOR_SETTING_STATUS_PID , 4 , 4},
{SENSOR_SETTING_GET_SETTING_ID, MOBLE_TRUE, 4, 4, SENSOR_SETTING_STATUS_SETTING_ID , 5, 5}, /* STATUS VARIABLE TAKEN AS 1 (4 + VARIABLE) */
{SENSOR_SETTING_SET, MOBLE_TRUE, 5, 5, SENSOR_SETTING_STATUS_SETTING_ID , 5, 5}, /* SET VARIABLE TAKEN AS 1 (4_VARIABLE) */
{SENSOR_SETTING_SET_UNACK, MOBLE_FALSE, 5, 5, SENSOR_SETTING_STATUS_SETTING_ID , 5, 5},
+ {SENSOR_SETTING_STATUS_SETTING_ID, MOBLE_FALSE, 5, 5, SENSOR_SETTING_STATUS_SETTING_ID , 5, 5},
{SENSOR_SERIES_GET, MOBLE_TRUE, 2, 6, SENSOR_SERIES_STATUS , 8, 8}, /* GET VARIABLE TAKEN AS 4 (2+VARAIBLE) , 2 VARIABLE PARAMTER */
+ {SENSOR_SERIES_STATUS, MOBLE_FALSE, 8, 8, SENSOR_SERIES_STATUS , 8, 8},
#endif
{0}
};
@@ -101,6 +109,8 @@ WEAK_FUNCTION (MOBLE_RESULT Appli_Sensor_Setting_Set(Sensor_SettingParam_t* pSen
MOBLEUINT8 OptionalValid));
WEAK_FUNCTION (MOBLE_RESULT Appli_Sensor_GetSettingStatus(MOBLEUINT8* pSetting_Status));
WEAK_FUNCTION (MOBLE_RESULT Appli_Sensor_GetSetting_IDStatus(MOBLEUINT8* pSetting_Status));
+MOBLE_RESULT Sensor_Cadence_Status(MOBLEUINT8* pCadencestatus_param, MOBLEUINT32 *plength,
+ MOBLEUINT8 const *pData, MOBLEUINT32 length);
/* Private functions ---------------------------------------------------------*/
@@ -184,7 +194,6 @@ MOBLE_RESULT Sensor_Cadence_Set(const MOBLEUINT8* pCadence_param, MOBLEUINT32 le
}
else if(prop_ID == (MOBLEUINT16)PRESSURE_PID)
{
-
Sensor_CadenceParam[1].Property_ID = pCadence_param[9] << 8;
Sensor_CadenceParam[1].Property_ID = pCadence_param[8];
Sensor_CadenceParam[1].FastCadenceDevisor = (pCadence_param[10] && 0xFE) ;
@@ -233,8 +242,8 @@ MOBLE_RESULT Sensor_Cadence_Status(MOBLEUINT8* pCadencestatus_param, MOBLEUINT32
*(pCadencestatus_param+4) = Sensor_CadenceParam[0].triggerDeltaDown;
*(pCadencestatus_param+5) = Sensor_CadenceParam[0].triggerDeltaUp;
- memcpy(&pCadencestatus_param[7],(void*)&Sensor_CadenceParam[0].FastCadenceLow,4);
- memcpy(&pCadencestatus_param[11],(void*)&Sensor_CadenceParam[0].FastCadenceHigh,4);
+ memcpy(&pCadencestatus_param[6],(void*)&Sensor_CadenceParam[0].FastCadenceLow,4);
+ memcpy(&pCadencestatus_param[10],(MOBLEUINT8*)&Sensor_CadenceParam[0].FastCadenceHigh,4);
}
if(propery_ID == (MOBLEUINT16)PRESSURE_PID)
{
@@ -245,11 +254,11 @@ MOBLE_RESULT Sensor_Cadence_Status(MOBLEUINT8* pCadencestatus_param, MOBLEUINT32
*(pCadencestatus_param+4) = Sensor_CadenceParam[1].triggerDeltaDown;
*(pCadencestatus_param+5) = Sensor_CadenceParam[1].triggerDeltaUp;
- memcpy(&pCadencestatus_param[7],(void*)&Sensor_CadenceParam[1].FastCadenceLow,4);
- memcpy(&pCadencestatus_param[11],(void*)&Sensor_CadenceParam[1].FastCadenceHigh,4);
+ memcpy(&pCadencestatus_param[6],(void*)&Sensor_CadenceParam[1].FastCadenceLow,4);
+ memcpy(&pCadencestatus_param[10],(void*)&Sensor_CadenceParam[1].FastCadenceHigh,4);
}
- *plength = 14;
+ *plength = 13;
return MOBLE_RESULT_SUCCESS;
}
@@ -457,46 +466,36 @@ MOBLE_RESULT SensorModelServer_ProcessMessageCb(MOBLE_ADDRESS peer_addr,
MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
/* tClockTime delay_t = Clock_Time(); */
#ifdef ENABLE_SENSOR_MODEL_SERVER
- MOBLEUINT16 property_ID = 0x00;
+ MOBLEUINT16 property_ID = 0;
+ property_ID = pRxData[1] << 8;
+ property_ID |= pRxData[0];
#endif
- TRACE_M(TF_SENSOR,"dst_peer = %.2X , peer_add = %.2X \r\n ",dst_peer, peer_addr);
+ TRACE_M(TF_SENSOR,"dst_peer = %.2X , peer_add = %.2X, opcode = %.2X, response= %.2X \r\n ",
+ dst_peer, peer_addr, opcode, response);
switch(opcode)
{
#ifdef ENABLE_SENSOR_MODEL_SERVER
-
case SENSOR_DESCRIPTOR_GET:
{
break;
}
case SENSOR_GET:
{
-
- if(dataLength > 0)
- {
- property_ID = pRxData[1] << 8;
- property_ID |= pRxData[0];
- if(property_ID == 0x00)
+ if((dataLength > 0) && (property_ID == 0x00))
{
return MOBLE_RESULT_FALSE;
}
- }
-
break;
}
case SENSOR_CADENCE_SET:
case SENSOR_CADENCE_SET_UNACK:
{
- if(dataLength > 0)
- {
- property_ID = pRxData[1] << 8;
- property_ID |= pRxData[0];
- if(property_ID == 0x00)
+ if((dataLength > 0) && (property_ID == 0x00))
{
return MOBLE_RESULT_FALSE;
}
- }
Sensor_Cadence_Set(pRxData,dataLength);
break;
}
@@ -504,19 +503,53 @@ MOBLE_RESULT SensorModelServer_ProcessMessageCb(MOBLE_ADDRESS peer_addr,
case SENSOR_SETTING_SET:
case SENSOR_SETTING_SET_UNACK:
{
- if(dataLength > 0)
+ if((dataLength > 0) && (property_ID == 0x00))
{
- property_ID = pRxData[1] << 8;
- property_ID |= pRxData[0];
- if(property_ID == 0x00)
+ return MOBLE_RESULT_FALSE;
+ }
+ Sensor_Setting_Set(pRxData,dataLength);
+ break;
+ }
+ case SENSOR_DESCRIPTOR_STATUS:
+ {
+ break;
+ }
+ case SENSOR_STATUS:
+ {
+ if((dataLength > 0) && (property_ID == 0x00))
{
return MOBLE_RESULT_FALSE;
}
+
+ if(property_ID == LIGHT_CONTROL_LIGHTNESS_ON_ID)
+ {
+#ifdef ENABLE_LIGHT_MODEL_SERVER_LC
+ Light_LC_ModeSet(&pRxData[2],1);
+ Light_LC_OMSet(&pRxData[2],1);
+#endif
+ }
+ break;
+ }
+ case SENSOR_COLUMN_STATUS:
+ {
+ break;
+ }
+ case SENSOR_SERIES_STATUS:
+ {
+ break;
+ }
+ case SENSOR_CADENCE_STATUS:
+ {
+ break;
}
- Sensor_Setting_Set(pRxData,dataLength);
+ case SENSOR_SETTING_STATUS_PID:
+ {
+ break;
+ }
+ case SENSOR_SETTING_STATUS_SETTING_ID:
+ {
break;
}
-
#endif
default:
{
@@ -573,30 +606,16 @@ WEAK_FUNCTION (MOBLE_RESULT Appli_Sensor_Data_Status(MOBLEUINT8* sensor_Data , M
return MOBLE_RESULT_SUCCESS;
}
-WEAK_FUNCTION (void SensorDataPublish(MOBLEUINT32 *pSensor_Value , MOBLEUINT16* pProp_ID))
-{
-}
+WEAK_FUNCTION (void SensorDataPublish(MOBLEUINT32 *pSensor_Value , MOBLEUINT16* pProp_ID));
WEAK_FUNCTION (void Sensor_Publication_Process(float* pSensorData, MODEL_Property_IDTableParam_t* pProp_ID))
{
}
WEAK_FUNCTION (MOBLE_RESULT Appli_Sensor_Cadence_Set(Sensor_CadenceParam_t* pCadence_param,
- MOBLEUINT16 property_ID, MOBLEUINT32 length) )
-{
- return MOBLE_RESULT_SUCCESS;
-}
+ MOBLEUINT16 property_ID, MOBLEUINT32 length) );
WEAK_FUNCTION (MOBLE_RESULT Appli_Sensor_Setting_Set(Sensor_SettingParam_t* pSensor_SettingParam,
- MOBLEUINT8 OptionalValid))
-{
- return MOBLE_RESULT_SUCCESS;
-}
-WEAK_FUNCTION (MOBLE_RESULT Appli_Sensor_GetSettingStatus(MOBLEUINT8* pSetting_Status))
-{
- return MOBLE_RESULT_SUCCESS;
-}
-WEAK_FUNCTION (MOBLE_RESULT Appli_Sensor_GetSetting_IDStatus(MOBLEUINT8* pSetting_Status))
-{
- return MOBLE_RESULT_SUCCESS;
-}
+ MOBLEUINT8 OptionalValid));
+WEAK_FUNCTION (MOBLE_RESULT Appli_Sensor_GetSettingStatus(MOBLEUINT8* pSetting_Status));
+WEAK_FUNCTION (MOBLE_RESULT Appli_Sensor_GetSetting_IDStatus(MOBLEUINT8* pSetting_Status));
/******************* (C) COPYRIGHT 2017 STMicroelectronics *****END OF FILE****/
diff --git a/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/vendor.c b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/vendor.c
index 9a866287e..e02c06fdb 100644
--- a/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/vendor.c
+++ b/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/vendor.c
@@ -44,6 +44,7 @@
#include "mesh_cfg.h"
#include "ble_mesh.h"
#include "vendor.h"
+#include "appli_test.h"
#include "models_if.h"
#include <string.h>
@@ -69,8 +70,24 @@ extern MOBLEUINT8 ResponseBuffer[8];
extern MOBLEUINT8 BuffLength;
extern MOBLEUINT8 Appli_LedState;
-/* Private function prototypes -----------------------------------------------*/
+/*
+-------------*******************-------------------------
+Vendor Model Opcode Table
+*/
+MOBLEUINT16 Vendor_Opcodes_Table[] = {
+ APPLI_TEST_CMD,
+ APPLI_DEVICE_INFO_CMD,
+ APPLI_LED_CONTROL_STATUS_CMD,
+ APPLI_ELEMENT_TYPE_CMD,
+ APPLI_SENSOR_CNTRL_CMD
+};
+/* Private function prototypes -----------------------------------------------*/
+#if ENABLE_APPLI_TEST
+ extern MOBLEUINT8 txDataArray[];
+ extern MOBLEUINT8 successCounter;
+ extern MOBLEUINT8 sendCounter;
+#endif
/* Private functions ---------------------------------------------------------*/
/**
@@ -96,8 +113,8 @@ MOBLE_RESULT Vendor_WriteLocalDataCb(MOBLE_ADDRESS peer_addr,
/* Traces for the Data */
uint16_t idx = 0;
- TRACE_M(TF_VENDOR,"Vendor_WriteLocalDataCb: peer_addr=[%02x], dst_peer=[%02x],\
- command=[%02x], \n\r", peer_addr, dst_peer, command);
+ TRACE_I(TF_VENDOR,"Vendor_WriteLocalDataCb: peer_addr=[%02x], dst_peer=[%02x],\
+ command=[%02x], Response=[%02x] \n\r", peer_addr, dst_peer, command, response);
TRACE_I(TF_VENDOR,"DATA_RECEIVED length = %d\n\r",length);
for (idx=0; idx<length; idx++)
{
@@ -115,7 +132,9 @@ MOBLE_RESULT Vendor_WriteLocalDataCb(MOBLE_ADDRESS peer_addr,
case APPLI_TEST_CMD:
{
- /*Insert Test Commands here*/
+ /*This is callback when ever command is coming for test of response
+ time,command reached count, data byte sent
+ */
VendorAppli_cb.TestCommand_cb(data, length);
break;
}
@@ -127,6 +146,7 @@ MOBLE_RESULT Vendor_WriteLocalDataCb(MOBLE_ADDRESS peer_addr,
B0 - Sub-Cmd LED
B1-B7 - Data Bytes
*/
+ TRACE_M(TF_VENDOR,"st device id %4.x \r\n",VENDORMODEL_STMICRO_ID1);
VendorAppli_cb.LEDControlCommand_Cb(data,length,elementNumber,dst_peer);
break;
}
@@ -168,7 +188,11 @@ MOBLE_RESULT Vendor_WriteLocalDataCb(MOBLE_ADDRESS peer_addr,
{
case APPLI_TEST_CMD:
- { /*Insert Test Commands here*/
+ {
+ /*This is callback when ever command is coming for test of response
+ time,command reached count, data byte sent
+ */
+ VendorAppli_cb.TestCommand_cb(data,length);
break;
}
case APPLI_LED_CONTROL_STATUS_CMD:
@@ -207,14 +231,15 @@ MOBLE_RESULT Vendor_WriteLocalDataCb(MOBLE_ADDRESS peer_addr,
{
if (ADDRESS_IS_UNICAST(dst_peer))
{
- BLEMesh_SendResponse(peer_addr, dst_peer, command, ResponseBuffer, BuffLength);
+ VendorModel_SendResponse(VENDOR_STMICRO_CID, peer_addr, dst_peer, command, ResponseBuffer, BuffLength);
+ TRACE_M(TF_VENDOR,"Sending Response for Unicast \n\r");
}
else
{
/* Randomize responses*/
BLEMesh_ModelsDelayPacket(peer_addr, dst_peer, command, ResponseBuffer, BuffLength);
+ TRACE_M(TF_VENDOR,"Sending Response for Multicast \n\r");
}
- TRACE_M(TF_VENDOR,"Sending Response \n\r");
}
if (status == STATUS_SUCCESS)
@@ -248,10 +273,11 @@ MOBLE_RESULT Vendor_ReadLocalDataCb(MOBLE_ADDRESS peer_addr,
{
MOBLE_RESULT status = MOBLE_RESULT_SUCCESS;
+ MOBLEUINT8 getBuff[5];
/* Traces for the Data */
TRACE_M(TF_VENDOR,"Vendor_ReadLocalDataCb: peer_addr=[%02x], dst_peer_addr=[%02x],\
- command=[%02x] \n\r", peer_addr, dst_peer, command);
+ command=[%02x], Response=[%02x] \n\r", peer_addr, dst_peer, command, response );
TRACE_I(TF_VENDOR,"DATA_RECEIVED length = %d\n\r",length);
for (MOBLEUINT8 idx=0; idx<length; idx++)
{
@@ -273,9 +299,16 @@ MOBLE_RESULT Vendor_ReadLocalDataCb(MOBLE_ADDRESS peer_addr,
Message Received B0 B1 B2 B3 B4 B5 B6 B7
B0 - Sub-Cmd for APPLI_TEST_CMD
B1-B7 - Data Bytes if any
-
+ this function gives back the number count of command received by
+ the receiver.
*/
- status = VendorAppli_cb.TestCommand_cb(data, length);
+ VendorAppli_cb.GetTestCount(getBuff);
+ ResponseBuffer[0] = APPLI_TEST_INC_COUNTER;
+ ResponseBuffer[1] = getBuff[0];
+ ResponseBuffer[2] = getBuff[1];
+ ResponseBuffer[3] = getBuff[2];
+ ResponseBuffer[4] = getBuff[3];
+ BuffLength = 5;
break;
}
case APPLI_DEVICE_INFO_CMD:
@@ -355,7 +388,7 @@ MOBLE_RESULT Vendor_ReadLocalDataCb(MOBLE_ADDRESS peer_addr,
*/
if (ADDRESS_IS_UNICAST(dst_peer))
{
- BLEMesh_SendResponse(peer_addr, dst_peer, command, ResponseBuffer, BuffLength);
+ VendorModel_SendResponse(VENDOR_STMICRO_CID, peer_addr, dst_peer, command, ResponseBuffer, BuffLength);
}
else
{
@@ -368,7 +401,7 @@ MOBLE_RESULT Vendor_ReadLocalDataCb(MOBLE_ADDRESS peer_addr,
{
if (ADDRESS_IS_UNICAST(dst_peer))
{
- BLEMesh_SendResponse(peer_addr, dst_peer, command, ResponseBuffer, 1);
+ VendorModel_SendResponse(VENDOR_STMICRO_CID, peer_addr, dst_peer, command, ResponseBuffer, 1);
}
else
{
@@ -398,20 +431,107 @@ MOBLE_RESULT Vendor_ReadLocalDataCb(MOBLE_ADDRESS peer_addr,
* @retval MOBLE_RESULT status of result
*/
MOBLE_RESULT Vendor_OnResponseDataCb(MOBLE_ADDRESS peer_addr,
- MOBLEUINT8 elementIndex,
- MOBLEUINT8 const * data,
- MOBLEUINT32 length)
+ MOBLE_ADDRESS dst_peer,
+ MOBLEUINT8 command,
+ MOBLEUINT8 const *pRxData,
+ MOBLEUINT32 dataLength,
+ MOBLEBOOL response)
{
+ MOBLEUINT32 timeStampRcv;
+ MOBLEUINT8 subCmd = pRxData[0];
+ MOBLEUINT16 hitcmdcount = 0;
+
/* Traces for the Data */
- TRACE_M(TF_VENDOR,"Vendor_OnResponseDataCb: peer_addr=[%02x], \
- \n\r", peer_addr);
- TRACE_I(TF_VENDOR,"DATA_RECEIVED length = %d\n\r", length);
- for (MOBLEUINT8 idx=0; idx<length; idx++)
+ TRACE_I(TF_SERIAL_CTRL,"Peer_addr=[%02x],\n\r", peer_addr);
+ TRACE_I(TF_SERIAL_CTRL,"DATA_RECEIVED length = %ld\n\r", dataLength);
+
+ switch(command)
+ {
+ case APPLI_TEST_CMD:
+ {
+ switch(subCmd)
+ {
+ case APPLI_TEST_ECHO:
+ {
+ /* this case is responsible for printing of the received back data byte from
+ receiver node.
+ */
+ #if ENABLE_APPLI_TEST
+ MOBLEUINT8 idx;
+ if(dataLength !=0)
+ {
+ MOBLEUINT8 valueCounter = 0;
+
+ for (idx=0; idx<dataLength; idx++)
{
- TRACE_I(TF_VENDOR,"data[%d]= %d",idx,data[idx]);
- TRACE_I(TF_VENDOR,"\n\r");
+ if(pRxData[idx] == txDataArray[idx])
+ {
+ valueCounter++;
+ }
+ else
+ {
+ break;
+ }
+ }
+ if(valueCounter == dataLength)
+ {
+ successCounter++;
+ TRACE_I(TF_SERIAL_CTRL,"Response data matched %d out of %d\n\r",successCounter, sendCounter);
+ TRACE_I(TF_SERIAL_CTRL,"\n\r");
+ }
+ else
+ {
+ TRACE_I(TF_SERIAL_CTRL,"Response data unmatched %d out of %d\n\r",successCounter, sendCounter);
+ TRACE_I(TF_SERIAL_CTRL,"\n\r");
+ }
+ }
+#endif
+ break;
+ }
+ case APPLI_TEST_RANDOMIZATION_RANGE:
+ {
+ /*Insert Test related Commands here*/
+ break;
+ }
+ case APPLI_TEST_COUNTER:
+ {
+ /* this case is responsible for the printing the time stamp when the responce
+ is received by the sender node.
+ */
+ timeStampRcv = Clock_Time();
+
+ Packet_ResponseTimeStamp(timeStampRcv);
+
+ /*Insert Test related Commands here*/
+ break;
+ }
+ case APPLI_TEST_INC_COUNTER:
+ {
+ /* This case is responsible for the printing of the number count of command
+ received by receiver.
+ */
+ hitcmdcount = (MOBLEUINT32)(pRxData[4] << 24);
+ hitcmdcount |=(MOBLEUINT32)( pRxData[3] << 16);
+ hitcmdcount |=(MOBLEUINT32)( pRxData[2] << 8);
+ hitcmdcount |=(MOBLEUINT32)( pRxData[1]);
+ TRACE_I(TF_SERIAL_CTRL,"NUMBER OF COMMANDS RECEIVED %d \r\n",hitcmdcount);
+ /*Insert Test related Commands here*/
+ break;
+ }
+ case APPLI_MODEL_PUBLISH_SELECT:
+ {
+
+ break;
+ }
+ default:
+ {
+ break;
+ }
}
+ }
+ }
+
return MOBLE_RESULT_SUCCESS;
}
@@ -451,10 +571,174 @@ void Vendor_Publish(MOBLE_ADDRESS publishAddress, MOBLEUINT8 elementIndex)
APPLI_LED_CONTROL_STATUS_CMD ,
AppliBuffer, sizeof(AppliBuffer), MOBLE_FALSE , MOBLE_TRUE);
+ CommandStatus = AppliBuffer[0];
+}
+
+/**
+* @brief Test Command with Vendor Model used to calculate the time of packet to
+ reach at destination.
+* @param publishAddress: Publish Address of the message
+* @param elementIndex: index of the element
+* @retval void
+*/
+void Vendor_TestRemoteData(MOBLE_ADDRESS src ,MOBLE_ADDRESS dst ,MOBLEUINT8 elementIndex)
+{
+ /* changes the LED status on other nodes in the network */
+
+ AppliBuffer[0] = APPLI_TEST_COUNTER;
+
+ BLEMesh_SetRemoteData(dst,elementIndex,
+ APPLI_TEST_CMD ,
+ AppliBuffer, sizeof(AppliBuffer), MOBLE_TRUE , MOBLE_TRUE);
CommandStatus = AppliBuffer[0];
+}
+
+/**
+* @brief Test Command with Vendor Model used to calculate the time of packet to
+ reach at destination.
+* @param publishAddress: Publish Address of the message
+* @param elementIndex: index of the element
+* @retval void
+*/
+void Vendor_TestCounterInc(MOBLE_ADDRESS src ,MOBLE_ADDRESS dst ,MOBLEUINT8 elementIndex)
+{
+
+ /* changes the LED status on other nodes in the network */
+
+ AppliBuffer[0] = APPLI_TEST_INC_COUNTER;
+
+ BLEMesh_SetRemoteData(dst,elementIndex,
+ APPLI_TEST_CMD ,
+ AppliBuffer, sizeof(AppliBuffer), MOBLE_FALSE , MOBLE_TRUE);
+}
+
+
+
+/**
+* @brief GenericModelServer_GetOpcodeTableCb: This function is call-back
+* from the library to send Model Opcode Table info to library
+* @param MODEL_OpcodeTableParam_t: Pointer to the Generic Model opcode array
+* @param length: Pointer to the Length of Generic Model opcode array
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT VendorModel_PID1_GetOpcodeTableCb(const MODEL_OpcodeTableParam_t **data,
+ MOBLEUINT16 *length)
+{
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief GenericModelServer_GetStatusRequestCb : This function is call-back
+from the library to send response to the message from peer
+* @param peer_addr: Address of the peer
+* @param dst_peer: destination send by peer for this node. It can be a
+* unicast or group address
+* @param opcode: Received opcode of the Status message callback
+* @param pResponsedata: Pointer to the buffer to be updated with status
+* @param plength: Pointer to the Length of the data, to be updated by application
+* @param pRxData: Pointer to the data received in packet.
+* @param dataLength: length of the data in packet.
+* @param response: Value to indicate wheather message is acknowledged meassage or not.
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT VendorModel_PID1_GetStatusRequestCb(MOBLE_ADDRESS peer_addr,
+ MOBLE_ADDRESS dst_peer,
+ MOBLEUINT16 opcode,
+ MOBLEUINT8 *pResponsedata,
+ MOBLEUINT32 *plength,
+ MOBLEUINT8 const *pRxData,
+ MOBLEUINT32 dataLength,
+ MOBLEBOOL response)
+
+{
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief VendorModelServer_ProcessMessageCb: This is a callback function from
+the library whenever a Generic Model message is received
+* @param peer_addr: Address of the peer
+* @param dst_peer: destination send by peer for this node. It can be a
+* unicast or group address
+* @param opcode: Received opcode of the Status message callback
+* @param pData: Pointer to the buffer to be updated with status
+* @param length: Length of the parameters received
+* @param response: if TRUE, the message is an acknowledged message
+* @param pRxData: Pointer to the data received in packet.
+* @param dataLength: length of the data in packet.
+* @param response: Value to indicate wheather message is acknowledged meassage or not.
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT VendorModel_PID1_ProcessMessageCb(MOBLE_ADDRESS peer_addr,
+ MOBLE_ADDRESS dst_peer,
+ MOBLEUINT16 opcode,
+ MOBLEUINT8 const *pRxData,
+ MOBLEUINT32 dataLength,
+ MOBLEBOOL response
+ )
+{
+
+ MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
+ MOBLEUINT8 command;
+ MOBLEBOOL cmd_response;
+
+ /*tClockTime delay_t = Clock_Time();*/
+
+ TRACE_I(TF_VENDOR,"dst_peer = [0x%02x] , peer_add = [0x%02x], opcode= [0x%02x] \r\n ",
+ dst_peer, peer_addr, opcode);
+
+ /* opcode: response : Read-Write : Command
+ R/nW : 1 = Read
+ 0 = Write
+
+ 0 1 Response of data
+ 1 1 Read Data
+ 0 0 Write with no Response
+ 1 0 Write with Response
+
+ #define VENDOR_CMD_RESPONSE 0x20
+ #define VENDOR_CMD_READ_nWRITE 0x10
+ */
+
+ command = (MOBLEUINT8) (opcode & 0x0F);
+ if (opcode & VENDOR_CMD_RESPONSE)
+ {
+ cmd_response = MOBLE_TRUE;
+ }
+ else
+ {
+ cmd_response = MOBLE_FALSE;
+ }
+
+
+
+ /* Parse the command */
+ if( (cmd_response == MOBLE_FALSE) && (opcode & VENDOR_CMD_READ_nWRITE))
+ { /* Response Packet is received */
+ TRACE_I(TF_VENDOR,"Response received from remote node \n\r");
+
+ Vendor_OnResponseDataCb(peer_addr, dst_peer, command, pRxData, dataLength, MOBLE_FALSE);
+ }
+ else if ( (cmd_response == MOBLE_TRUE) && (opcode & VENDOR_CMD_READ_nWRITE))
+ { /* Read Packet is received */
+ TRACE_M(TF_VENDOR,"Read Command received \n\r");
+ result = Vendor_ReadLocalDataCb(peer_addr, dst_peer, command, pRxData, dataLength, MOBLE_TRUE);
+ }
+ else
+ { /* Write Commands with or without response received */
+ TRACE_M(TF_VENDOR,"Command Write received, process the command \n\r");
+ result = Vendor_WriteLocalDataCb(peer_addr, dst_peer, command, pRxData, dataLength, cmd_response );
+ }
+
+return result;
+}
+
+__weak MOBLE_RESULT Packet_ResponseTimeStamp(MOBLEUINT32 rcvTimeStamp)
+{
+ return MOBLE_RESULT_SUCCESS;
}
/**
diff --git a/Middlewares/ST/STM32_WPAN/ble/mesh/PAL/STM32WB/pal_nvm.c b/Middlewares/ST/STM32_WPAN/ble/mesh/PAL/STM32WB/pal_nvm.c
index 392f1a3ea..5d4a7f95c 100644
--- a/Middlewares/ST/STM32_WPAN/ble/mesh/PAL/STM32WB/pal_nvm.c
+++ b/Middlewares/ST/STM32_WPAN/ble/mesh/PAL/STM32WB/pal_nvm.c
@@ -47,11 +47,6 @@
#include "ble.h"
-extern const void* mobleNvmBase;
-#define NVM_BASE ((unsigned int)mobleNvmBase)
-#define NVM_SIZE 0x00002000
-#define FLASH_SECTOR_SIZE 0x1000
-
/* Private functions ---------------------------------------------------------*/
/**
* @brief Gets the page of a given address
@@ -96,13 +91,18 @@ MOBLEBOOL MoblePalNvmIsWriteProtected(void)
/**
* @brief Read NVM
-* @param offset: offset wrt start address of nvm
+* @param address: read start address of nvm
+* @param offset: offset read start address of nvm
* @param buf: copy of read content
* @param size: size of memory to be read
* @param backup: If read from backup memory
* @retval Result of read operation
*/
-MOBLE_RESULT MoblePalNvmRead(MOBLEUINT32 offset, void *buf, MOBLEUINT32 size, MOBLEBOOL backup)
+MOBLE_RESULT MoblePalNvmRead(MOBLEUINT32 address,
+ MOBLEUINT32 offset,
+ void *buf,
+ MOBLEUINT32 size,
+ MOBLEBOOL backup)
{
MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
@@ -122,7 +122,7 @@ MOBLE_RESULT MoblePalNvmRead(MOBLEUINT32 offset, void *buf, MOBLEUINT32 size, MO
}
else
{
- memmove(buf, (void *)(NVM_BASE + offset), size);
+ memmove(buf, (void *)(address + offset), size);
}
// printf("MoblePalNvmRead <<<\r\n");
@@ -131,13 +131,18 @@ MOBLE_RESULT MoblePalNvmRead(MOBLEUINT32 offset, void *buf, MOBLEUINT32 size, MO
/**
* @brief Compare with NVM
-* @param offset: offset wrt start address of nvm
+* @param offset: start address of nvm to compare
+* @param offset: offset start address of nvm
* @param buf: copy of content
* @param size: size of memory to be compared
* @param comparison: outcome of comparison
* @retval Result
*/
-MOBLE_RESULT MoblePalNvmCompare(MOBLEUINT32 offset, void const *buf, MOBLEUINT32 size, MOBLE_NVM_COMPARE* comparison)
+MOBLE_RESULT MoblePalNvmCompare(MOBLEUINT32 address,
+ MOBLEUINT32 offset,
+ void const *buf,
+ MOBLEUINT32 size,
+ MOBLE_NVM_COMPARE* comparison)
{
MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
@@ -173,7 +178,7 @@ MOBLE_RESULT MoblePalNvmCompare(MOBLEUINT32 offset, void const *buf, MOBLEUINT32
size >>= 3;
uint64_t* src = (uint64_t*)buf;
- uint64_t* dst = (uint64_t*)(NVM_BASE + offset);
+ uint64_t* dst = (uint64_t*)(address + offset);
for (MOBLEUINT32 i=0; i<size; ++i)
{
@@ -199,25 +204,31 @@ MOBLE_RESULT MoblePalNvmCompare(MOBLEUINT32 offset, void const *buf, MOBLEUINT32
* @param None
* @retval Result
*/
-MOBLE_RESULT MoblePalNvmErase(MOBLEUINT32 offset)
+MOBLE_RESULT MoblePalNvmErase(MOBLEUINT32 address,
+ MOBLEUINT32 offset)
{
HAL_StatusTypeDef status = HAL_OK;
+ uint32_t pageError = 0;
// printf("MoblePalNvmErase >>>\r\n");
- while( LL_HSEM_1StepLock( HSEM, CFG_HW_FLASH_SEMID ) );
- HAL_FLASH_Unlock();
- __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_WRPERR | FLASH_FLAG_OPTVERR);
-
FLASH_EraseInitTypeDef erase;
erase.TypeErase = FLASH_TYPEERASE_PAGES;
- erase.Page = GetPage(NVM_BASE + offset); /* 126 or 127 */;
+ erase.Page = GetPage(address + offset); /* 126 or 127 */;
erase.NbPages = FLASH_SECTOR_SIZE >> 12;
- uint32_t pageError = 0;
+ while( LL_HSEM_1StepLock( HSEM, CFG_HW_FLASH_SEMID ) );
+ HAL_FLASH_Unlock();
+ __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_WRPERR | FLASH_FLAG_OPTVERR);
+
+ SHCI_C2_FLASH_EraseActivity( ERASE_ACTIVITY_ON);
+
while(LL_FLASH_IsActiveFlag_OperationSuspended());
status = HAL_FLASHEx_Erase(&erase, &pageError);
while(LL_FLASH_IsActiveFlag_OperationSuspended());
+
+ SHCI_C2_FLASH_EraseActivity( ERASE_ACTIVITY_OFF);
+
HAL_FLASH_Lock();
LL_HSEM_ReleaseLock( HSEM, CFG_HW_FLASH_SEMID, 0 );
@@ -228,12 +239,16 @@ MOBLE_RESULT MoblePalNvmErase(MOBLEUINT32 offset)
/**
* @brief Write to NVM
+* @param offset: wrt start address of nvm
* @param offset: offset wrt start address of nvm
* @param buf: copy of write content
* @param size: size of memory to be written
* @retval Result
*/
-MOBLE_RESULT MoblePalNvmWrite(MOBLEUINT32 offset, void const *buf, MOBLEUINT32 size)
+MOBLE_RESULT MoblePalNvmWrite(MOBLEUINT32 address,
+ MOBLEUINT32 offset,
+ void const *buf,
+ MOBLEUINT32 size)
{
MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
@@ -264,24 +279,24 @@ MOBLE_RESULT MoblePalNvmWrite(MOBLEUINT32 offset, void const *buf, MOBLEUINT32 s
size >>= 3;
uint64_t* src = (uint64_t*)buf;
- uint64_t* dst = (uint64_t*)(NVM_BASE + offset);
+// uint64_t* dst = (uint64_t*)(address + offset);
HAL_StatusTypeDef status = HAL_OK;
while( LL_HSEM_1StepLock( HSEM, CFG_HW_FLASH_SEMID ) );
HAL_FLASH_Unlock();
__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_WRPERR | FLASH_FLAG_OPTVERR);
- for (size_t i = 0; i < size && status == HAL_OK; i++)
- {
- if (src[i<<3] != dst[i<<3])
+ for (size_t i = 0; (i < size) && (status == HAL_OK); i++)
{
+// if (src[i<<3] != dst[i<<3])
+// {
while(LL_FLASH_IsActiveFlag_OperationSuspended());
- status = HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLEWORD, NVM_BASE + offset + (i <<3), src[i]);
+ status = HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLEWORD, address + offset + (i <<3), src[i]);
if (status != HAL_OK)
{
break;
}
- }
+// }
}
HAL_FLASH_Lock();
LL_HSEM_ReleaseLock( HSEM, CFG_HW_FLASH_SEMID, 0 );
diff --git a/Middlewares/ST/STM32_WPAN/ble/mesh/Src/appli_test.c b/Middlewares/ST/STM32_WPAN/ble/mesh/Src/appli_test.c
new file mode 100644
index 000000000..51ad45d5e
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/ble/mesh/Src/appli_test.c
@@ -0,0 +1,392 @@
+/**
+******************************************************************************
+* @file response_test.c
+* @author BLE Mesh Team
+* @version V1.10.000
+* @date 15-Jan-2019
+* @brief Serial Interface file
+******************************************************************************
+* @attention
+*
+* <h2><center>&copy; COPYRIGHT(c) 2018 STMicroelectronics</center></h2>
+*
+* Redistribution and use in source and binary forms, with or without modification,
+* are permitted provided that the following conditions are met:
+* 1. Redistributions of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+* 3. Neither the name of STMicroelectronics nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+* Initial BlueNRG-Mesh is built over Motorolas Mesh over Bluetooth Low Energy
+* (MoBLE) technology. The present solution is developed and maintained for both
+* Mesh library and Applications solely by STMicroelectronics.
+*
+******************************************************************************
+*/
+/* Includes ------------------------------------------------------------------*/
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+#include "hal_common.h"
+#include "mesh_cfg.h"
+#include "common.h"
+#include "appli_test.h"
+#include <string.h>
+#if ENABLE_SERIAL_CONTROL
+#include "serial_ctrl.h"
+#endif
+#if ENABLE_UT
+#include "serial_ut.h"
+#endif
+
+/** @addtogroup BlueNRG_Mesh
+* @{
+*/
+
+/** @addtogroup Application
+* @{
+*/
+
+/* Private typedef -----------------------------------------------------------*/
+/* Private define ------------------------------------------------------------*/
+/* Private macro -------------------------------------------------------------*/
+#define CMD_INDEX_RES_01 1
+#define CMD_INDEX_RES_02 2
+#define CMD_INDEX_RES_03 3
+#define CMD_INDEX_RES_04 4
+
+#define CMD_SET_OFFSET 7
+#define CMD_RES_OFFSET 5
+#define CMD_RES_COUNT 4
+
+/* Private variables ---------------------------------------------------------*/
+MOBLEUINT8 TestNumber = 0;
+MOBLEUINT32 TestCount = 0;
+MOBLEUINT32 RecvCount = 0;
+MOBLEUINT32 Totaltest = 0;
+/* Private function prototypes -----------------------------------------------*/
+static void SerialResponse_doubleHexToHex(MOBLEUINT8* hexArray,MOBLEUINT8* outputArray, MOBLEUINT8 length);
+static MOBLEUINT16 SerialResponse_GetFunctionIndex(char *text);
+MOBLEUINT32 timeStampSend = 0;
+MOBLE_ADDRESS srcAddress;
+MOBLE_ADDRESS destAddress;
+MOBLEUINT8 ReadFlag = 0;
+extern MOBLEUINT8 txDataArray[DATA_BYTE_SEND] = {0};
+extern MOBLEUINT8 successCounter=0;
+extern MOBLEUINT8 sendCounter=0;
+MOBLEUINT8 dataElement = 1;
+/* Private functions ---------------------------------------------------------*/
+
+/**
+* @brief SerialResponse_Process: This function extracts the command and variables from
+the recieved string and passes it to BluenrgMesh library.
+* @param rcvdStringBuff: Pointer to the recieved ascii character array from the user
+* @param rcvdStringSize: Size of the recieved array
+* @retval void
+*/
+void SerialResponse_Process(char *rcvdStringBuff, uint16_t rcvdStringSize)
+{
+ MOBLEUINT16 commandIndex = SerialResponse_GetFunctionIndex(rcvdStringBuff+5);
+ MOBLEUINT8 testFunctionParm[10]= {'\0'} ;
+ MOBLEUINT8 asciiFunctionParameter[16] = {'\0'} ;
+ successCounter = 0;
+ sendCounter = 0;
+
+ sscanf(rcvdStringBuff + CMD_RES_OFFSET + CMD_SET_OFFSET, "%8s %4s %4s ", asciiFunctionParameter, asciiFunctionParameter+8,asciiFunctionParameter+12);
+ /*SerialResponse_doubleHexToHex
+ Function will convert the asci string into orinal hex format.
+ eg- send-01 12 3456
+ return 0x12,0x34,0x56
+ */
+ SerialResponse_doubleHexToHex(asciiFunctionParameter,testFunctionParm,16);
+ TestCount = (MOBLEUINT32)(testFunctionParm[0] << 24);
+ TestCount |= (MOBLEUINT32)(testFunctionParm[1] << 16);
+ TestCount |= (MOBLEUINT32)(testFunctionParm[2] << 8);
+ TestCount |= (MOBLEUINT32)(testFunctionParm[3] << 0);
+ TestNumber = commandIndex;
+ Totaltest = TestCount;
+ srcAddress = (MOBLEUINT16)((testFunctionParm[4] << 8) | testFunctionParm[5]);
+ destAddress = (MOBLEUINT16)((testFunctionParm[6] << 8) | testFunctionParm[7]);
+}
+
+/**
+* @brief SerialResponse_GetFunctionIndex: This function returns the calculated index
+of the command recieved by the user
+* @param rcvdStringBuff: Pointer to the recieved ascii character array from the user
+* @param rcvdStringSize: Size of the recieved array
+* @retval MOBLEUINT16
+*/
+static MOBLEUINT16 SerialResponse_GetFunctionIndex(char *text)
+{
+ MOBLEINT16 index = 0;
+
+ if (!strncmp(text, "SET-",4))
+ {
+ sscanf(text, "SET-%hd", &index);
+ index = (index<=CMD_RES_COUNT)? index : 0;
+
+ }
+
+ return index;
+}
+
+/**
+* @brief SerialResponse_doubleHexToHex: This function converts two 4-bit hex integers
+to one 8-bit hex integer
+* @param hexArray: Pointer to input hex array
+* @param outputArray: Pointer to output hex array
+* @param length: length of the input hex array
+* @retval void
+*/
+static void SerialResponse_doubleHexToHex(MOBLEUINT8* hexArray,MOBLEUINT8* outputArray, MOBLEUINT8 length)
+{
+ MOBLEUINT8 counter =0,position = 0;
+ MOBLEUINT8 msb,lsb;;
+ while (counter <length)
+ {
+ msb = Serial_CharToHexConvert(hexArray[counter]);
+ lsb = Serial_CharToHexConvert(hexArray[counter + 1 ]);
+ outputArray[position] = msb<<4;
+ outputArray[position] |= lsb;
+ TRACE_I(TF_SERIAL_CTRL, "data scanned is %02hx \n\r",outputArray[position]);
+ counter+=2;
+ position++;
+ }
+}
+
+/**
+* @brief Test_ApplicationTest_Set01: This function sends the vendor test
+ command till the testCount become 0.this test is used to calculate the round trip
+ time for the packet send and received response.
+* @param testCount: Pointer to the test count value
+* @param src: source address
+* @param dst: destination address
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Test_ApplicationTest_Set01(MOBLEUINT32 testCount ,MOBLE_ADDRESS src ,MOBLE_ADDRESS dst)
+{
+ MOBLEUINT8 elementIndex = 0;
+
+/* The function will called untill the testcount will not become zero */
+ if(testCount != 0)
+ {
+ if(processDelay(TEST_1_WAIT_PERIOD) == 0x01)
+ {
+/* Taking the timestamp while sending the command for vendor model */
+ timeStampSend = Clock_Time();
+ Vendor_TestRemoteData(src,dst,elementIndex);
+
+ TestCount--;
+ }
+ }
+
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Test_ApplicationTest_Set02: This function sends the vendor test
+ command till the testCount become 0.This function is used to send the bunch of
+ command to the receiver node and then called a function Read_CommandCount to get
+ the number of command received by receiver.
+* @param testCount: Pointer to the test count value
+* @param src: source address
+* @param dst: destination address
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Test_ApplicationTest_Set02(MOBLEUINT32 testCount ,MOBLE_ADDRESS src ,MOBLE_ADDRESS dst)
+{
+ MOBLEUINT8 elementIndex = 0;
+
+ if(testCount != 0)
+ {
+ if(processDelay(TEST_2_WAIT_PERIOD) == 0x01)
+ {
+/* Sending the command one after one in defined interval of time */
+ Vendor_TestCounterInc(src,dst,elementIndex);
+
+ TestCount--;
+ TRACE_I(TF_SERIAL_CTRL, "Sending No Response command \r\n");
+
+ if(TestCount == 0)
+ {
+/* Flag to call the function Read_CommandCount after some duration of time */
+ ReadFlag = 1;
+ }
+
+ }
+ }
+
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Read_CommandCount: This function read the number of
+ command received by the reciver successfully.
+* @param src: source address of the node
+* @param dst: destination address of the node
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Read_CommandCount(MOBLE_ADDRESS src ,MOBLE_ADDRESS dst)
+{
+ MOBLEUINT8 elementIndex = 0;
+ MOBLEUINT8 readData[2];
+
+ readData[0] = APPLI_TEST_INC_COUNTER;
+
+ if(processDelay(TEST_READ_PERIOD) == 0x01)
+ {
+ TRACE_I(TF_SERIAL_CTRL, " NUMBER OF COMMANDS SEND %d \r\n",Totaltest);
+ BluenrgMesh_ReadRemoteData(dst,elementIndex,APPLI_TEST_CMD,readData,sizeof(readData));
+ ReadFlag = 0;
+ }
+
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Packet_ResponseTimeStamp: This function called in vendor_response
+ it calculates all the packet sending ,receiving, average time.this function called
+ to take the response received time stamp.
+* @param rcvTimeStamp: Pointer to the response time stamp received
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Packet_ResponseTimeStamp(MOBLEUINT32 rcvTimeStamp)
+{
+ static MOBLEUINT32 totalTimeStamp = 0;
+ MOBLEUINT32 DiffTimeStamp;
+ RecvCount ++;
+ DiffTimeStamp = rcvTimeStamp - timeStampSend;
+
+ /* Adding the differnce time stamp for calculation of average time of packet
+ sending and receiving
+ */
+ totalTimeStamp = totalTimeStamp + DiffTimeStamp;
+ TRACE_I(TF_SERIAL_CTRL, "Response Got %d out of %d\r\n", RecvCount, Totaltest);
+ TRACE_I(TF_SERIAL_CTRL, "Packet send time stamp %d \r\n",timeStampSend);
+ TRACE_I(TF_SERIAL_CTRL, "Response receive time stamp %d \r\n",rcvTimeStamp);
+ TRACE_I(TF_SERIAL_CTRL, "Round trip Time %d \r\n \r\n",DiffTimeStamp);
+
+ if(TestCount == 0)
+ {
+ totalTimeStamp = totalTimeStamp/Totaltest;
+ TRACE_I(TF_SERIAL_CTRL, "Maximum Wait Time %d ms\r\n", TEST_1_WAIT_PERIOD);
+ TRACE_I(TF_SERIAL_CTRL, "AVERAGE ROUND TRIP TIME %d \r\n",totalTimeStamp);
+ TRACE_I(TF_SERIAL_CTRL, "PACKET SINGLE TRIP TIME %d \r\n",totalTimeStamp/2);
+ totalTimeStamp = 0;
+ }
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Test_ApplicationTest_Set03: This function sends the number of byte
+ and get back the same data in response.
+* @param timeStamp: Pointer to the response received time stamp
+* @param src: source address of the node
+* @param dst: destination address of the node
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Test_ApplicationTest_Set03(MOBLE_ADDRESS src ,MOBLE_ADDRESS dst)
+{
+ txDataArray[0] = APPLI_TEST_ECHO;
+ MOBLEUINT8 elementIndex = 0;
+
+/* The function will called untill the testcount will not become zero */
+ if(dataElement < DATA_BYTE_SEND)
+ {
+ if(processDelay(TEST_3_WAIT_PERIOD) == 0x01)
+ {
+ sendCounter++;
+ txDataArray[dataElement] = dataElement;
+ for (int idx=0; idx<dataElement; idx++)
+ {
+ TRACE_I(TF_SERIAL_CTRL,"data[%d]= %d",idx,txDataArray[idx]);
+ TRACE_I(TF_SERIAL_CTRL,"\n\r");
+ }
+ BluenrgMesh_SetRemoteData(dst,elementIndex,
+ APPLI_TEST_CMD ,
+ txDataArray, dataElement, MOBLE_TRUE , MOBLE_TRUE);
+ dataElement++;
+ if(dataElement == DATA_BYTE_SEND)
+ {
+ dataElement = 1;
+ TestNumber = 0;
+ }
+ }
+ }
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Function used to calculate the delay.
+* @param MOBLEUINT16
+* @retval MOBLEUINT8
+*/
+MOBLEUINT8 processDelay(MOBLEUINT16 waitPeriod)
+{
+ static MOBLEUINT8 Clockflag = 0;
+ static MOBLEUINT32 Check_time;
+
+
+ if(Clockflag == CLOCK_FLAG_DISABLE)
+ {
+ Check_time = Clock_Time();
+ Clockflag = CLOCK_FLAG_ENABLE;
+ }
+/* The function will called untill the testcount will not become zero */
+
+ if(((Clock_Time()- Check_time) >= waitPeriod))
+ {
+ Clockflag = CLOCK_FLAG_DISABLE;
+ return 0x01;
+
+ }
+ return 0x00;
+}
+
+/**
+* @brief Function used to run the testing function for Packet response time
+* @param void
+* @retval void
+*/
+void Test_Process(void)
+{
+ if(TestNumber){
+
+ if(TestNumber == CMD_INDEX_RES_01)
+ {
+ Test_ApplicationTest_Set01(TestCount,srcAddress,destAddress);
+ }
+ else if(TestNumber == CMD_INDEX_RES_02)
+ {
+ Test_ApplicationTest_Set02(TestCount,srcAddress,destAddress);
+ if(ReadFlag == 1)
+ {
+ Read_CommandCount(srcAddress , destAddress);
+ }
+ }
+ else if(TestNumber == CMD_INDEX_RES_03)
+ {
+ Test_ApplicationTest_Set03(srcAddress,destAddress);
+ }
+ else
+ {
+ TRACE_I(TF_SERIAL_CTRL,"Invalid Command\n\r");
+ }
+ }
+}
+
diff --git a/Middlewares/ST/STM32_WPAN/ble/mesh/Src/mesh_cfg.c b/Middlewares/ST/STM32_WPAN/ble/mesh/Src/mesh_cfg.c
index b71322061..ba5294447 100644
--- a/Middlewares/ST/STM32_WPAN/ble/mesh/Src/mesh_cfg.c
+++ b/Middlewares/ST/STM32_WPAN/ble/mesh/Src/mesh_cfg.c
@@ -49,6 +49,8 @@
#include "light.h"
#include "sensors.h"
#include "vendor.h"
+#include "light_lc.h"
+#include "appli_mesh.h"
#include <string.h>
/* Note: Please use Full Library configuration in project options to use the full
@@ -64,6 +66,9 @@
#if ENABLE_UT
#include "serial_ut.c"
#endif
+ #if ENABLE_APPLI_TEST
+ #include "appli_test.c"
+ #endif
#endif
#endif
@@ -76,7 +81,9 @@ MOBLEUINT8 dyn_buffer_m[DYNAMIC_MEMORY_SIZE + \
MAX_APPLICATION_PACKET_SIZE + \
SAR_BUFFER_SIZE + \
NEIGHBOR_TABLE_DYNAMIC_MEMORY_SIZE] = {0};
-
+extern const MOBLEUINT8 StaticOobBuff[];
+extern const MOBLEUINT8 PubKeyBuff[];
+extern const MOBLEUINT8 PrivKeyBuff[];
__attribute__((aligned(4)))const DynBufferParam_t DynBufferParam =
{
dyn_buffer_m,
@@ -85,9 +92,6 @@ __attribute__((aligned(4)))const DynBufferParam_t DynBufferParam =
(MOBLEUINT16) MAX_APPLICATION_PACKET_SIZE,
(MOBLEUINT16) NEIGHBOR_TABLE_DYNAMIC_MEMORY_SIZE
};
-/* 16 octets Static OOB information to be input here. Used during provisioning by Library */
-const uint8_t StaticOobBuff[STATIC_OOB_SIZE] = {0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01};
const tr_params_t TrParams = TRANSMIT_RECEIVE_PARAMS;
#if defined(BLUENRG1_DEVICE) || defined(BLUENRG2_DEVICE) /* BLUENRG1 or BLUENRG2 */
@@ -96,7 +100,7 @@ const lpn_params_t LpnParams = LOW_POWER_NODE_PARAMS;
const lpn_params_t LpnParams;
#endif
const fn_params_t FnParams = FRIEND_NODE_PARAMS;
-const unprov_node_info_params_t UnprovNodeInfoParams = UNPROV_NODE_INFO_PARAMS;
+const prvn_params_t PrvnParams = UNPROV_NODE_INFO_PARAMS;
const neighbor_table_init_params_t NeighborTableParams = NEIGHBOR_TABLE_PARAMS;
/*ALIGN(4)*/
@@ -239,7 +243,7 @@ __attribute__((aligned(4))) const MOBLEUINT16 Appli_SIG_Models[]=
const MOBLEUINT32 Appli_Vendor_Models[]=
{
- MODEL_BLUEMESH_MID,
+ VENDORMODEL_STMICRO_ID1,
/*****************************************************************************/
/** End of the Vendor Server Model IDs ************/
@@ -350,6 +354,7 @@ MOBLEBOOL ApplicationChkVendorModelActive(MOBLEUINT32 modelID)
result = MOBLE_TRUE;
break;
}
+
}
return result;
@@ -496,6 +501,15 @@ void BLEMesh_UpdateNeighbors(void* param)
}
#endif /* #if (NEIGHBOR_TABLE_SUPPORTED == 0) */
+/* Empty functions to reduce code size in case of PB-ADV functionality not in use */
+
+#if (PB_ADV_SUPPORTED == 0)
+MOBLE_RESULT MoblePBADVInit(void* param){return MOBLE_RESULT_SUCCESS;}
+MOBLE_RESULT MoblePBADVProcessData(void* param){return MOBLE_RESULT_SUCCESS;}
+MOBLE_RESULT MoblePBADVStartProvisioning(void* param){return MOBLE_RESULT_SUCCESS;}
+MOBLE_RESULT MoblePBADVStopProvisioning(void* param){return MOBLE_RESULT_SUCCESS;}
+#endif
+
/* PLEASE REFER TO THE .h file for different settings */
/******************* (C) COPYRIGHT 2017 STMicroelectronics *****END OF FILE****/
diff --git a/Middlewares/ST/STM32_WPAN/ble/mesh/Src/serial_ctrl.c b/Middlewares/ST/STM32_WPAN/ble/mesh/Src/serial_ctrl.c
index 6b8ee0e1f..b37c7a51b 100644
--- a/Middlewares/ST/STM32_WPAN/ble/mesh/Src/serial_ctrl.c
+++ b/Middlewares/ST/STM32_WPAN/ble/mesh/Src/serial_ctrl.c
@@ -46,6 +46,8 @@
#include "serial_if.h"
#include "serial_ctrl.h"
#include "light.h"
+#include "light_lc.h"
+#include "vendor.h"
/** @addtogroup BlueNRG_Mesh
* @{
@@ -60,14 +62,19 @@
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
-const MODEL_OpcodeTableParam_t *lightOptcodeTable;
-const MODEL_OpcodeTableParam_t *genericOptcodeTable;
-MOBLEUINT16 lightOptcodeTableLength;
-MOBLEUINT16 genericOptcodeTableLength;
+const MODEL_OpcodeTableParam_t *Light_OpcodeTable;
+const MODEL_OpcodeTableParam_t *Generic_OpcodeTable;
+const MODEL_OpcodeTableParam_t *LightLC_OpcodeTable;
+const MODEL_OpcodeTableParam_t *Sensor_OpcodeTable;
+MOBLEUINT16 Light_OpcodeTableLength;
+MOBLEUINT16 Generic_OpcodeTableLength;
+MOBLEUINT16 LightLC_OpcodeTableLength;
+MOBLEUINT16 Sensor_OpcodeTableLength;
+extern MOBLEUINT16 Vendor_Opcodes_Table[] ;
/* Private function prototypes -----------------------------------------------*/
MOBLEUINT8 SerialCtrl_GetMinParamLength(MOBLEUINT32 opcode, const MODEL_OpcodeTableParam_t list[], MOBLEUINT16 length);
-
+MOBLEUINT8 SerialCtrl_GetData(char *rcvdStringBuff, uint16_t rcvdStringSize, MOBLEUINT8 dataOffset, MOBLEUINT8 *data);
/* Private functions ---------------------------------------------------------*/
/**
* @brief This funcrion is used to parse the string given by the user
@@ -78,85 +85,94 @@ MOBLEUINT8 SerialCtrl_GetMinParamLength(MOBLEUINT32 opcode, const MODEL_OpcodeTa
void SerialCtrl_Process(char *rcvdStringBuff, uint16_t rcvdStringSize)
{
- MOBLE_ADDRESS peer; /*node adderess of the destination node*/
- MOBLEUINT16 command; /*opcode command to be executed by the destination node*/
- MOBLEUINT8 minPropertyLength = 0; /*minimum number of properties required by a specific command*/
+ MOBLE_ADDRESS peer = 0; /*node adderess of the destination node*/
+ MOBLEUINT16 command = 0; /*Opcode command to be executed by the destination node*/
+ MOBLEUINT8 data_length = 0;
+ MOBLEUINT8 dataLen_flag = 0;
+ MOBLEUINT8 minParamLength = 0; /*minimum number of properties required by a specific command*/
MOBLEUINT8 elementIndex = 0; /*default element index*/
- MOBLEUINT8 counter,i,byteCounter = 0; /*variables to convert big-endian input to little endian output*/
- MOBLEUINT8 msb,lsb; /*variables to convert ascii characters to 8-bit hex*/
- MOBLEUINT8 data [5] = {0}; /*buffer to output property variables */
- MOBLEUINT8 byteBuff [10] = {0}; /*buffer to store input property variables temperarily*/
+ MOBLEUINT8 data [10] = {0}; /*buffer to output property variables */
+ MOBLEUINT8 enableVendor = MOBLE_FALSE; /*varible to enable/disable vendor model callback*/
+ MOBLE_RESULT result;
- sscanf(rcvdStringBuff+5, "%hx %hx ", &peer,&command);
+ sscanf(rcvdStringBuff+5, "%4hx %hx ", &peer,&command);
- /* Callback to store a pointer to opcode table starting sddress and length of the table*/
- LightModelServer_GetOpcodeTableCb(&lightOptcodeTable,&lightOptcodeTableLength);
- GenericModelServer_GetOpcodeTableCb(&genericOptcodeTable,&genericOptcodeTableLength);
+ /* Callback to store a pointer to Opcode table starting sddress and length of the table*/
+ GenericModelServer_GetOpcodeTableCb(&Generic_OpcodeTable,&Generic_OpcodeTableLength);
+ LightModelServer_GetOpcodeTableCb(&Light_OpcodeTable,&Light_OpcodeTableLength);
+ Light_LC_ModelServer_GetOpcodeTableCb(&LightLC_OpcodeTable,&LightLC_OpcodeTableLength);
+ SensorModelServer_GetOpcodeTableCb(&Sensor_OpcodeTable,&Sensor_OpcodeTableLength);
/* Minimum parameter length required for a valid opcade in Generic opcode table */
- minPropertyLength = SerialCtrl_GetMinParamLength(command,genericOptcodeTable,genericOptcodeTableLength);
+ minParamLength = SerialCtrl_GetMinParamLength(command,Generic_OpcodeTable,Generic_OpcodeTableLength);
- /* Opcode not found in Generic opcode table */
- if (minPropertyLength == 0xff)
+ /* Opcode not found in Generic opcode table
+ Start finding for opcode in Light Table*/
+ if (minParamLength == 0xff)
{
- minPropertyLength = SerialCtrl_GetMinParamLength(command,lightOptcodeTable,lightOptcodeTableLength);/*Start finding for opcode in Light Table*/
+ minParamLength = SerialCtrl_GetMinParamLength(command,Light_OpcodeTable,Light_OpcodeTableLength);
}
- /* Opcode not found in Light opcode table */
- if (minPropertyLength == 0xff)
+ /* Opcode not found in Light opcode table
+ Start finding for opcode in Light LC Table*/
+ if (minParamLength == 0xff)
{
- TRACE_M(TF_SERIAL_CTRL,"incorrect optcode\r\n");
+ minParamLength = SerialCtrl_GetMinParamLength(command,LightLC_OpcodeTable,LightLC_OpcodeTableLength);
+ dataLen_flag = 1;
}
- /* Found Valid opcode */
- else
+ /* Opcode not found in Light LC opcode table
+ Start finding for opcode in Sensor Table*/
+ if (minParamLength == 0xff)
+ {
+ minParamLength = SerialCtrl_GetMinParamLength(command,Sensor_OpcodeTable,Sensor_OpcodeTableLength);
+ }
+ /* Opcode not found in Sensor opcode table
+ Start finding for opcode in Vendor Table*/
+
+ if(minParamLength == 0xff)
{
- i=0;
- byteCounter=0; /*variable to count number of bytes in each space separeted word*/
- counter = 0;
- for(i=SERIAL_MODEL_DATA_OFFSET;i<=(rcvdStringSize);i++)
+ for(int i = 0; i < 5 ; i++)
{
- /* check if space or NULL found */
- if(rcvdStringBuff[i] == ' '||rcvdStringBuff[i] == '\0' )
+ if(command == Vendor_Opcodes_Table[i])
{
- /*if number of bytes is one*/
- if (byteCounter == 1 )
- {
- data[counter] = byteBuff[0];
- }
- /*if number of bytes is two*/
- if (byteCounter == 2 )
- {
- /*assigning value from byteBuff to data in swapped way to convert
- big-endian input from the user to little-endian input required by the BLEMesh Library */
- data[counter] = byteBuff[1];
- data[counter+1] = byteBuff[0];
- counter++;
- }
- counter++; /*for next word*/
- byteCounter=0; /*for next word, init index to 0*/
+ minParamLength = 0x01;
+ dataLen_flag = 1;
+ enableVendor = MOBLE_TRUE;
+// break;
+ }
+ }
+ }
+ if((minParamLength == 0xff) | (command == 0x00))
+ {
+ TRACE_I(TF_SERIAL_CTRL,"Invalid Command\r\n");
+ return;
+ }
+ /*Valid Opcode Not Found*/
+ else
+ {
+ data_length = SerialCtrl_GetData(rcvdStringBuff, rcvdStringSize, SERIAL_MODEL_DATA_OFFSET, data);
+ if(dataLen_flag ==1)
+ {
+ minParamLength = data_length;
+ dataLen_flag = 0;
+ }
+ result = BLEMesh_SetRemoteData(peer,elementIndex,command,
+ data, minParamLength,
+ MOBLE_FALSE, enableVendor);
+ if(result == MOBLE_RESULT_SUCCESS)
+ {
+ TRACE_I(TF_SERIAL_CTRL,"Command Executed Successfully\r\n");
}
else
- { /* take two consecutive ascii characters from the rcvdStringBuff and convert to hex values */
- msb = Serial_CharToHexConvert(rcvdStringBuff[i]);
- lsb = Serial_CharToHexConvert(rcvdStringBuff[i + 1 ]);
- /*join two hex values to make one hex value*/
- byteBuff[byteCounter] = msb << 4;
- byteBuff[byteCounter] |= lsb;
-
- i++; /*increament for loop counter as two values are used */
- byteCounter++; /*increament byteCounter counter*/
+ {
+ TRACE_I(TF_SERIAL_CTRL,"Invalid Opcode Parameter\r\n");
}
- }
- /*call BLEMesh Library function to send the processed variables */
- BLEMesh_SetRemoteData(peer,elementIndex,command,
- data, minPropertyLength,
- MOBLE_FALSE, MOBLE_FALSE);
}
}
/**
-* @brief Returns the minimum number of parameters required by a particular optcode
+* @brief Returns the minimum number of parameters required by a particular Opcode
* @param opcode: Opcode of the model whose minimum number of parameters are required
* @param list:
* @param length:
@@ -174,6 +190,50 @@ MOBLEUINT8 SerialCtrl_GetMinParamLength(MOBLEUINT32 opcode, const MODEL_OpcodeTa
return 0xff;
}
+/**
+* @brief This function extract the function parameter from the string
+* @param rcvdStringBuff: array of the string parsed from the serial terminal
+* @param rcvdStringSize: sizeOf rcvdStringBuff
+* @param dataOffset:
+* @param data: Output array comprising of Data
+* @param dataIndex:
+* @retval MOBLEUINT8
+*/
+MOBLEUINT8 SerialCtrl_GetData(char *rcvdStringBuff, uint16_t rcvdStringSize, MOBLEUINT8 dataOffset, MOBLEUINT8 *data)
+{
+ MOBLEUINT8 byteBuff[10] = {0};
+ MOBLEUINT8 dataIndex = 0;
+ int msb, lsb, byteCounter=0;
+
+ for(int i=dataOffset ; i<=(rcvdStringSize) ; i++)
+ {
+ /* check if space or NULL found */
+ if(rcvdStringBuff[i] == ' '||rcvdStringBuff[i] == '\0' )
+ {
+ /*if number of bytes is one*/
+ while(byteCounter > 0)
+ {
+ data[dataIndex++] = byteBuff[--byteCounter];
+
+ }
+ }
+ else
+ {
+ /* take two consecutive ascii characters from the rcvdStringBuff and convert to hex values */
+ msb = Serial_CharToHexConvert(rcvdStringBuff[i]);
+ lsb = Serial_CharToHexConvert(rcvdStringBuff[i + 1 ]);
+ /*join two hex values to make one hex value*/
+ byteBuff[byteCounter] = msb << 4;
+ byteBuff[byteCounter] |= lsb;
+
+ i++; /*increament for loop counter as two values are used */
+ byteCounter++; /*increament byteCounter counter*/
+ }
+ }
+
+ return dataIndex;
+
+}
/**
* @}
diff --git a/Middlewares/ST/STM32_WPAN/ble/mesh/Src/serial_if.c b/Middlewares/ST/STM32_WPAN/ble/mesh/Src/serial_if.c
index 3b1438308..76d6d0360 100644
--- a/Middlewares/ST/STM32_WPAN/ble/mesh/Src/serial_if.c
+++ b/Middlewares/ST/STM32_WPAN/ble/mesh/Src/serial_if.c
@@ -42,15 +42,21 @@
#include <string.h>
#include <stdio.h>
#include <errno.h>
+#include "serial_if.h"
+#include "ble_common.h"
#include "hal_common.h"
#include "mesh_cfg.h"
-#include "serial_if.h"
#if ENABLE_SERIAL_CONTROL
#include "serial_ctrl.h"
#endif
#if ENABLE_UT
#include "serial_ut.h"
#endif
+#if ENABLE_APPLI_TEST
+#include "appli_test.h"
+#endif
+#include "stm_queue.h"
+#include "stm32_seq.h"
/** @addtogroup BLE_Mesh
* @{
@@ -61,30 +67,207 @@
*/
/* Private define ------------------------------------------------------------*/
-#define RECEIVE_STRING_SIZE 48
+#define RECEIVE_STRING_SIZE 48
+#define RX_BUFFER_SIZE 48/*64*/
+#define ESC 0x1b
/* Private macro -------------------------------------------------------------*/
typedef enum
{
- STATE_IDLE,
- STATE_INPUT_ENTERED,
+ STATE_IDLE,
+ STATE_INPUT_ENTERED,
}tSerialState;
/* Private variables ---------------------------------------------------------*/
static char Rcvd_String[RECEIVE_STRING_SIZE];
tSerialState SerialCurrentState = STATE_IDLE;
+static uint8_t InputCharFromUart;
+static queue_t RxQueue;
+static uint8_t RxQueueBuffer[RX_BUFFER_SIZE];
+static int stringSize;
+static int ch;
+static int index_str;
+
/* Private function prototypes -----------------------------------------------*/
-static int Serial_GetString(MOBLEUINT8*, MOBLEUINT8);
+static int Serial_GetString(MOBLEUINT8* text, MOBLEUINT8 size);
#if (!ENABLE_UT)
__weak void SerialUt_Process(char *rcvdStringBuff, uint16_t rcvdStringSize);
#endif
#if (!ENABLE_SERIAL_CONTROL)
__weak void SerialCtrl_Process(char *rcvdStringBuff, uint16_t rcvdStringSize);
#endif
+#if (!ENABLE_APPLI_TEST)
+__weak void SerialResponse_Process(char *rcvdStringBuff, uint16_t rcvdStringSize);
+#endif
/* Private functions ---------------------------------------------------------*/
/**
+ * @brief DBG_TRACE USART Rx Transfer completed callback
+ * @retval None
+ */
+static void Serial_RxCpltCallback( void )
+{
+ CircularQueue_Add(&RxQueue, &InputCharFromUart,1,1);
+
+ Serial_InterfaceProcess();
+ UTIL_SEQ_SetTask( 1<<CFG_TASK_MESH_UART_RX_REQ_ID, CFG_SCH_PRIO_0);
+
+ return;
+ }
+
+/**
+ * @brief DBG_TRACE USART Rx Transfer completed callback
+ * @retval None
+ */
+static void Serial_Uart_Rx_Task( void )
+{
+ HW_UART_Receive_IT(CFG_DEBUG_TRACE_UART, &InputCharFromUart, 1, Serial_RxCpltCallback);
+}
+
+/**
+ * *****************************************************************************
+ * @fn char UartReadChar(uint8_t blocking)
+ * @author -
+ * @brief Wait until the receipt of a character from an Uart or JTAG,
+ * then convert it into ASCII and return the character
+ * @param blocking : blocking mode
+ * @return Return the character received from the serial link or the JTAG.
+ * *****************************************************************************
+ */
+static char UartReadChar(uint8_t blocking)
+{
+ uint16_t size;
+ uint8_t *c;
+ static uint8_t ESC_Seq = 0;
+ uint8_t leave = 0;
+ char retc = 0;
+ static uint16_t ESC_Timeout = 0;
+
+ while (!leave)
+ {
+ c = CircularQueue_Remove(&RxQueue, &size);
+ if (!c)
+ {
+ if (ESC_Seq == 1)
+ {
+ if (--ESC_Timeout == 0)
+ {
+ retc = ESC;
+ ESC_Seq = 0;
+ break; /* Assume ESC have been hit */
+ }
+ }
+ if (!blocking) leave=1;
+ }
+ else if (c) /* I got a char */
+ {
+ retc = *c;
+ if ((*c == ESC) && (ESC_Seq == 0)) /* ESC sequence */
+ {
+ ESC_Timeout = 5000; /* Maybe better to arm a timer */
+ ESC_Seq = 1; /* If ESC AND Esc_seq ==> error case, here we just restart ESC sequence */
+ retc = 0;
+ }
+ else if (ESC_Seq == 1) /* check second char in ESC sequence */
+ {
+ if (*c == '[') /* True ESC sequence */
+ {
+ /* wait for next char in ESC seq */
+ ESC_Seq++;
+ retc = 0;
+ ESC_Timeout = 0;
+ }
+ else /* Unexpected char follwing ESC, so ESC hit [no ESC sequence ] */
+ {
+ leave = 1;
+ ESC_Seq = 0;
+ retc = ESC;
+ ESC_Timeout = 0;
+ }
+ }
+ else if (ESC_Seq == 2)
+ {
+ leave = 1;
+ ESC_Seq = 0;
+ retc = *c | 0x80;
+ }
+ else
+ {
+ leave = 1;
+ }
+ }
+ }
+
+ return retc;
+}
+
+/**
+* @brief Gets the input from user from Serial port
+* @param text: String to take input
+* @param size: Size of string
+* @retval int: Running Status of the test case
+*/
+static int Serial_GetString(MOBLEUINT8* text, MOBLEUINT8 size)
+{
+// static int index_str = 0;
+ stringSize = 0;
+
+#ifndef __IAR_SYSTEMS_ICC__
+ clearerr(stdin);
+#endif
+ ch = (int)(UartReadChar(FALSE));
+ /* Note: Please use Full Library configuration in project options to use the full
+ configuration of the C/C++ runtime library for printf and scanf functionality */
+ /* Check for error in get function */
+ if (ch == EOF)
+ {
+#ifndef __IAR_SYSTEMS_ICC__
+ clearerr(stdin);
+#endif
+ }
+ /* check for backspace press */
+ else if (ch == 0x08)
+ {
+ if (index_str > 0)
+ {
+ --index_str;
+ }
+ TRACE_I(TF_SERIAL_CTRL,"\b");
+ }
+ /* Check for the enter key*/
+ else if ((ch == 0x0D) || (ch == 0xFFFFFF0D))
+ {
+ /* check for first time enter to display help message */
+ if (index_str == 0)
+ {
+ stringSize = 1;
+ }
+ else
+ {
+ stringSize = index_str;
+ }
+ index_str = 0;
+ TRACE_I(TF_SERIAL_CTRL,"\n\r");
+ // return stringSize;
+ }
+ else
+ {
+ TRACE_I(TF_SERIAL_CTRL,"%c", ch);
+ if (index_str < size)
+ {
+ /* check if lowercase and convert it to upper case */
+ if ((ch >= 'a') && (ch <= 'z'))
+ {
+ ch = ch + 'A' - 'a';
+ }
+ text[index_str++] = (char)ch;
+ }
+ }
+ return stringSize;
+}
+
+/**
* @brief This funcrion is used to parse the string given by the user(If
* implemented in application,
* linker would replace weak linking in library )
@@ -108,6 +291,13 @@ __weak void SerialUt_Process(char *rcvdStringBuff, uint16_t rcvdStringSize)
{
}
#endif
+
+#if (!ENABLE_APPLI_TEST)
+__weak void SerialResponse_Process(char *rcvdStringBuff, uint16_t rcvdStringSize)
+{
+}
+#endif
+
/**
* @brief Processes data coming from serial port
* @param void
@@ -115,90 +305,52 @@ __weak void SerialUt_Process(char *rcvdStringBuff, uint16_t rcvdStringSize)
*/
void Serial_InterfaceProcess(void)
{
- int stringSize = 0;
-
- stringSize = Serial_GetString((MOBLEUINT8*)Rcvd_String, sizeof(Rcvd_String) - 1);
- /* Check if no input has come from user */
- if (!stringSize)
- {
- return;
- }
- else
- {
- Rcvd_String[stringSize] = 0; /* Make last char NULL for string comp */
+ Serial_GetString((MOBLEUINT8*)Rcvd_String, sizeof(Rcvd_String) - 1);
+ /* Check if no input has come from user */
+ if (!stringSize)
+ {
+// TRACE_I(TF_SERIAL_CTRL,"No input come from user\r\n");
+ return;
+ }
+ else
+ {
+ Rcvd_String[stringSize] = 0; /* Make last char NULL for string comp */
- /* Check if correct string has been entered or not */
- if (!strncmp(Rcvd_String, "ctrl", 4))
- {
- SerialCtrl_Process(Rcvd_String, stringSize);
- }
- else if(!strncmp(Rcvd_String, "test", 4))
- {
- SerialUt_Process(Rcvd_String, stringSize);
- }
- else
- {
- TRACE_M(TF_SERIAL_CTRL,"Not Entered valid test parameters\r\n");
- SerialCurrentState = STATE_IDLE;
- }
+ /* Check if correct string has been entered or not */
+#ifdef ENABLE_SERIAL_CONTROL
+ if (!strncmp(Rcvd_String, "ATCL", 4))
+ {
+ SerialCtrl_Process(Rcvd_String, stringSize);
}
-}
-
-/**
-* @brief Gets the input from user from Serial port
-* @param text: String to take input
-* @param size: Size of string
-* @retval int: Running Status of the test case
-*/
-static int Serial_GetString(MOBLEUINT8* text, MOBLEUINT8 size)
-{
- static int index = 0;
- int stringSize = 0;
-
-#ifndef __IAR_SYSTEMS_ICC__
- clearerr(stdin);
-#endif
- int ch = getchar();
- /* Note: Please use Full Library configuration in project options to use the full
- configuration of the C/C++ runtime library for printf and scanf functionality */
- /* Check for error in get function */
- if (ch == EOF)
- {
-#ifndef __IAR_SYSTEMS_ICC__
- clearerr(stdin);
#endif
+#if ENABLE_UT
+ else if(!strncmp(Rcvd_String, "ATUT", 4))
+ {
+ SerialUt_Process(Rcvd_String, stringSize);
}
- /* check for backspace press */
- else if (ch == 0x7F)
+#endif
+#if ENABLE_APPLI_TEST
+ else if(!strncmp(Rcvd_String, "ATAP", 4))
{
- if (index) --index;
- TRACE_M(TF_SERIAL_CTRL,"\b");
+ SerialResponse_Process(Rcvd_String, stringSize);
}
- /* Check for the enter key*/
- else if ((ch == 0x0D) || (ch == 0xFFFFFF0D))
+#endif
+#ifdef ENABLE_AUTH_TYPE_INPUT_OOB
+ else if(!strncmp(Rcvd_String, "ATIN", 4))
{
- /* check for first time enter to display help message */
- if (!index)
- {
- stringSize = 1;
- }
- else
- {
- stringSize = index;
- }
- index = 0;
- TRACE_M(TF_SERIAL_CTRL,"\n\r");
- return stringSize;
+ Appli_BleSerialInputOOBValue(Rcvd_String, stringSize);
}
+#endif
else
{
- TRACE_M(TF_SERIAL_CTRL,"%c", ch);
- if (index < size)
- {
- text[index++] = (char)ch;
- }
+ TRACE_I(TF_SERIAL_CTRL,"Not Entered valid test parameters\r\n");
+ SerialCurrentState = STATE_IDLE;
+ }
+ while(stringSize)
+ {
+ Rcvd_String[--stringSize] = 0;
}
- return stringSize;
+ }
}
/**
@@ -207,7 +359,7 @@ static int Serial_GetString(MOBLEUINT8* text, MOBLEUINT8 size)
* @retval MOBLEUINT8
*/
- MOBLEUINT8 Serial_CharToHexConvert(char addr)
+MOBLEUINT8 Serial_CharToHexConvert(char addr)
{
MOBLEUINT8 retVal=0;
if (addr >= '0' && addr <= '9')
@@ -223,13 +375,29 @@ static int Serial_GetString(MOBLEUINT8* text, MOBLEUINT8 size)
}
/**
+ * @brief This function initialize the Rx from UART
+ * @param None
+ * @retval None
+ */
+void Serial_Init(void)
+{
+ CircularQueue_Init(&RxQueue, RxQueueBuffer, RX_BUFFER_SIZE, 1, CIRCULAR_QUEUE_NO_WRAP_FLAG);
+
+// HW_UART_Receive_IT(CFG_DEBUG_TRACE_UART, &InputCharFromUart, 1, Serial_RxCpltCallback);
+ UTIL_SEQ_RegTask( 1<< CFG_TASK_MESH_UART_RX_REQ_ID, UTIL_SEQ_RFU, Serial_Uart_Rx_Task );
+ UTIL_SEQ_SetTask( 1<<CFG_TASK_MESH_UART_RX_REQ_ID, CFG_SCH_PRIO_0);
+
+ return;
+}
+
+/**
* @brief Callback function to print data serially
* @param *message: Pointer of data string
* @retval void
*/
void BLEMesh_PrintStringCb(const char *message)
{
- TRACE_M(TF_SERIAL_CTRL,"%s", (char*)message);
+ TRACE_I(TF_SERIAL_CTRL,"%s\n\r", (char*)message);
}
/**
* @brief Callback function to print data array on screen LSB first
@@ -241,10 +409,11 @@ void BLEMesh_PrintDataCb(MOBLEUINT8* data, MOBLEUINT16 size)
{
for (int count=0; count<size; ++count)
{
- TRACE_M(TF_SERIAL_CTRL,"%02X", data[count]);
+ TRACE_I(TF_SERIAL_CTRL,"%02X", data[count]);
}
- TRACE_M(TF_SERIAL_CTRL,"\n\r");
+ TRACE_I(TF_SERIAL_CTRL,"\n\r");
}
+
/**
* @}
*/
diff --git a/Middlewares/ST/STM32_WPAN/ble/svc/Inc/bvopus_service_stm.h b/Middlewares/ST/STM32_WPAN/ble/svc/Inc/bvopus_service_stm.h
new file mode 100644
index 000000000..f323a4803
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/ble/svc/Inc/bvopus_service_stm.h
@@ -0,0 +1,201 @@
+/**
+ ******************************************************************************
+ * @file bluevoice_opus.h
+ * @author SRA-A&SP
+ * @version V1.0.0
+ * @date 08-May-2019
+ * @brief This file contains definitions for BlueVoiceOPUS service.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * 3. Neither the name of STMicroelectronics nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ ******************************************************************************
+ */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __BVOPUS_SERVICE_STM_H
+#define __BVOPUS_SERVICE_STM_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+#include "opus.h"
+#include "string.h"
+#include "opus_private.h"
+#include "ble_gatt_aci.h"
+#include "opus_interface_stm.h"
+
+/*!< Return states values. */
+typedef enum
+{
+ BV_OPUS_SUCCESS = 0x00, /*!< Success.*/
+ BV_OPUS_ERROR = 0x01, /*!< Error.*/
+ BV_OPUS_TIMEOUT = 0x02, /*!< A BLE timeout occurred.*/
+ BV_OPUS_TX_HANDLE_NOT_AVAILABLE = 0x10, /*!< TX BlueVoiceOPUS characteristics handle not set.*/
+ BV_OPUS_NOTIF_DISABLE = 0x11, /*!< The notifications are disabled.*/
+ BV_OPUS_INVALID_PARAM = 0x12, /*!< Invalid Opus parameters.*/
+ BV_OPUS_ENC_NOT_CONFIG = 0x13, /*!< BlueVoiceOPUS encoder not configured.*/
+ BV_OPUS_DEC_NOT_CONFIG = 0x14, /*!< BlueVoiceOPUS decoder not configured.*/
+ BV_OPUS_PKT_NOT_COMPLETE = 0x15, /*!< Received Opus packet not completed.*/
+} BV_OPUS_Status;
+
+/*!< BVOPUS control event type. */
+typedef enum
+{
+ BVOPUS_STM_START_STREAMING_EVT, /*!< Requested to start audio streaming.*/
+ BVOPUS_STM_STOP_STREAMING_EVT, /*!< Requested to stop audio streaming.*/
+ BVOPUS_STM_ENABLE_CTRL_EVT, /*!< Control char enabled.*/
+ BVOPUS_STM_DISABLE_CTRL_EVT, /*!< Control char disable.*/
+ BVOPUS_STM_ERROR_EVT, /*!< Error.*/
+} BVOPUS_STM_evt_code_t;
+
+/*!< BlueVoice service and characteristics uuid. */
+typedef struct
+{
+ Service_UUID_t service_uuid; /*!< Service UUID.*/
+ Char_UUID_t audio_uuid; /*!< Audio characteristic UUID.*/
+ Char_UUID_t ctrl_uuid; /*!< Control characteristic UUID.*/
+} BV_OPUS_uuid_t;
+
+/*!< BlueVoiceOPUS service and characteristics handle. */
+typedef struct
+{
+ uint16_t ServiceHandle; /*!< Service handle.*/
+ uint16_t CharAudioHandle; /*!< Audio characteristic handle.*/
+ uint16_t CharCtrlHandle; /*!< Control characteristic handle.*/
+} BV_OPUS_ProfileHandle_t;
+
+
+/* Define --------------------------------------------------------------------*/
+
+/*!< BlueNRG low-level communication timeout.*/
+#define BV_OPUS_SENDING_TIMEOUT 0xFF
+
+/*!< Control message type */
+#define BV_OPUS_CONTROL (uint8_t)0x0A
+#define BV_OPUS_ENABLE_NOTIF_REQ (uint8_t)0x10
+#define BV_OPUS_DISABLE_NOTIF_REQ (uint8_t)0x11
+
+/* External constant ---------------------------------------------------------*/
+extern const uint8_t bvopus_service_uuid[16];
+extern const uint8_t bvopus_audio_char_uuid[16];
+extern const uint8_t bvopus_ctrl_char_uuid[16];
+
+/* Function prototype --------------------------------------------------------*/
+
+/**
+* @brief Called when a Start or Stop streaming event occurs.
+* @param Evt_code: start or stop streaming event.
+* @retval None.
+*/
+void BVOPUS_STM_APP_Notification(BVOPUS_STM_evt_code_t Evt_code);
+
+/**
+ * @brief BlueVoice Opus Service initialization
+ * @param None
+ * @retval BV_OPUS_Status: Value indicating success or error code.
+ */
+void BVOPUS_STM_Init(void);
+
+/**
+ * @brief This function initializes Opus encoder.
+ * @param Opus encoder configuration.
+ * @retval BV_OPUS_Status: Value indicating success or error code.
+ */
+BV_OPUS_Status BVOPUS_CodecEncInit(OPUS_IF_ENC_ConfigTypeDef *ENC_configOpus);
+
+/**
+ * @brief This function initializes Opus decoder.
+ * @param Opus decoder configuration.
+ * @retval BV_OPUS_Status: Value indicating success or error code.
+ */
+BV_OPUS_Status BVOPUS_CodecDecInit(OPUS_IF_DEC_ConfigTypeDef *DEC_configOpus);
+
+/**
+ * @brief This function returns the audio notification status.
+ * @param None.
+ * @retval 1 if audio notification are enabled, 0 otherwise.
+ */
+uint8_t BluevoiceOPUS_isAudioNotifEnabled(void);
+
+/**
+ * @brief This function returns the control notification status.
+ * @param None.
+ * @retval 1 if the control notification are enabled, 0 otherwise.
+ */
+uint8_t BluevoiceOPUS_isCtrlNotifEnabled(void);
+
+/**
+ * @brief This function is called to decode audio data using opus.
+ * @param buf_in: pointer to the encoded buffer.
+ * @param len_in: buffer in length.
+ * @param buf_out: pointer to the decoded buffer.
+ * @param pcm_samples: number of PCM samples decoded.
+ * @param opus_err: @ref opus_errorcodes.
+ * @retval BV_OPUS_Status: Value indicating success or error code.
+ */
+BV_OPUS_Status BluevoiceOPUS_ParseData(uint8_t *buf_in, uint8_t len_in, uint8_t *buf_out, uint16_t *pcm_samples, int *opus_err);
+
+/**
+ * @brief This function is called to packetize, encode and send audio data.
+ * @param data_buffer: data to be sent
+ * @param opus_err: @ref opus_errorcodes.
+ * @retval BV_OPUS_Status: Value indicating success or error code.
+ */
+BV_OPUS_Status BluevoiceOPUS_SendAudioData(uint8_t *data_buffer, int *opus_err);
+
+/**
+ * @brief This function is called to send control command.
+ * @param data_buffer: data to be sent
+ * @param Nb_bytes: number of bytes to be sent (max 20)
+ * @retval BV_OPUS_Status: Value indicating success or error code.
+ */
+BV_OPUS_Status BluevoiceOPUS_SendCtrlData(uint8_t *data_buffer, uint8_t Nb_bytes);
+
+/**
+ * @brief This function is called to send an enable notification request.
+ * @param None
+ * @retval BV_OPUS_Status: Value indicating success or error code.
+ */
+BV_OPUS_Status BluevoiceOPUS_SendEnableNotifReq(void);
+
+/**
+ * @brief This function is called to send a disable notification request.
+ * @param None
+ * @retval BV_OPUS_Status: Value indicating success or error code.
+ */
+BV_OPUS_Status BluevoiceOPUS_SendDisableNotifReq(void);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __BVOPUS_SERVICE_STM_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Middlewares/ST/STM32_WPAN/ble/svc/Inc/motenv_stm.h b/Middlewares/ST/STM32_WPAN/ble/svc/Inc/motenv_stm.h
new file mode 100644
index 000000000..3761caaae
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/ble/svc/Inc/motenv_stm.h
@@ -0,0 +1,168 @@
+
+/**
+ ******************************************************************************
+ * @file motenv_stm.h
+ * @author SRA/AST
+ * @brief Header for motenv_stm.c module
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef MOTENV_STM_H
+#define MOTENV_STM_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+
+/* Exported types ------------------------------------------------------------*/
+/**
+ * @brief MOTENV Event Opcode definition
+ */
+typedef enum
+{
+ /* HW Service Chars related events */
+ HW_MOTION_NOTIFY_ENABLED_EVT,
+ HW_MOTION_NOTIFY_DISABLED_EVT,
+ HW_ENV_NOTIFY_ENABLED_EVT,
+ HW_ENV_NOTIFY_DISABLED_EVT,
+ HW_ENV_READ_EVT,
+ HW_ACC_EVENT_NOTIFY_ENABLED_EVT,
+ HW_ACC_EVENT_NOTIFY_DISABLED_EVT,
+ HW_ACC_EVENT_READ_EVT,
+ /* SW Service Chars related events */
+ SW_MOTIONFX_NOTIFY_ENABLED_EVT,
+ SW_MOTIONFX_NOTIFY_DISABLED_EVT,
+ SW_ECOMPASS_NOTIFY_ENABLED_EVT,
+ SW_ECOMPASS_NOTIFY_DISABLED_EVT,
+ SW_ACTIVITY_REC_NOTIFY_ENABLED_EVT,
+ SW_ACTIVITY_REC_NOTIFY_DISABLED_EVT,
+ SW_ACTIVITY_REC_READ_EVT,
+ SW_CARRY_POSITION_NOTIFY_ENABLED_EVT,
+ SW_CARRY_POSITION_NOTIFY_DISABLED_EVT,
+ SW_CARRY_POSITION_READ_EVT,
+ SW_GESTURE_REC_NOTIFY_ENABLED_EVT,
+ SW_GESTURE_REC_NOTIFY_DISABLED_EVT,
+ SW_GESTURE_REC_READ_EVT,
+ SW_PEDOMETER_NOTIFY_ENABLED_EVT,
+ SW_PEDOMETER_NOTIFY_DISABLED_EVT,
+ SW_PEDOMETER_READ_EVT,
+ SW_INTENSITY_DET_NOTIFY_ENABLED_EVT,
+ SW_INTENSITY_DET_NOTIFY_DISABLED_EVT,
+ /* Config Service Chars related events */
+ CONFIG_NOTIFY_ENABLED_EVT,
+ CONFIG_NOTIFY_DISABLED_EVT,
+ CONFIG_WRITE_EVT,
+ /* Console Service Chars related events */
+ CONSOLE_TERM_NOTIFY_ENABLED_EVT,
+ CONSOLE_TERM_NOTIFY_DISABLED_EVT,
+ CONSOLE_STDERR_NOTIFY_ENABLED_EVT,
+ CONSOLE_STDERR_NOTIFY_DISABLED_EVT,
+ CONSOLE_TERM_READ_EVT,
+ CONSOLE_STDERR_READ_EVT
+} MOTENV_STM_Opcode_evt_t;
+
+/**
+ * @brief MOTENV Event data structure definition
+ */
+typedef struct
+{
+ uint8_t *pPayload;
+ uint8_t Length;
+} MOTENV_STM_Data_t;
+
+/**
+ * @brief MOTENV Notification structure definition
+ */
+typedef struct
+{
+ MOTENV_STM_Opcode_evt_t Motenv_Evt_Opcode;
+ MOTENV_STM_Data_t DataTransfered;
+ uint16_t ConnectionHandle;
+ uint8_t ServiceInstance;
+} MOTENV_STM_App_Notification_evt_t;
+
+
+/* Exported constants --------------------------------------------------------*/
+/* External variables --------------------------------------------------------*/
+/* Exported macros -----------------------------------------------------------*/
+/**
+ * @brief Motion (Acc-Gyro-Magneto) Char shortened UUID
+ */
+#define MOTION_CHAR_UUID (0xE000)
+/**
+ * @brief Environmental (Temp-Humidity-Pressure) Char shortened UUID
+ */
+#define ENV_CHAR_UUID (0x1D00)
+/**
+ * @brief Acceleration event Char shortened UUID
+ */
+#define ACC_EVENT_CHAR_UUID (0x0004)
+/**
+ * @brief Sensor Fusion Char shortened UUID
+ */
+#define MOTION_FX_CHAR_UUID (0x0100)
+/**
+ * @brief E-Compass event Char shortened UUID
+ */
+#define ECOMPASS_CHAR_UUID (0x0040)
+/**
+ * @brief Activity Recognition Char event Char shortened UUID
+ */
+#define ACTIVITY_REC_CHAR_UUID (0x0010)
+/**
+ * @brief Carry Position event Char shortened UUID
+ */
+#define CARRY_POSITION_CHAR_UUID (0x0008)
+/**
+ * @brief Gesture Recognition event Char shortened UUID
+ */
+#define GESTURE_REC_CHAR_UUID (0x0200)
+/**
+ * @brief Pedometer Char shortened UUID
+ */
+#define PEDOMETER_CHAR_UUID (0x0001)
+/**
+ * @brief Intensity Detection Char shortened UUID
+ */
+#define INTENSITY_DET_CHAR_UUID (0x0020)
+/**
+ * @brief Config Char shortened UUID
+ */
+#define CONFIG_CHAR_UUID (0x0002)
+/**
+ * @brief Console Terminal Char shortened UUID
+ */
+#define CONSOLE_TERM_CHAR_UUID (0x010E)
+/**
+ * @brief Cosnole Stderr Char shortened UUID
+ */
+#define CONSOLE_STDERR_CHAR_UUID (0x020E)
+
+/* Exported functions ------------------------------------------------------- */
+void MOTENV_STM_Init(void);
+void MOTENV_STM_App_Notification(MOTENV_STM_App_Notification_evt_t *pNotification);
+tBleStatus MOTENV_STM_App_Update_Char(uint16_t UUID, uint8_t payloadLen, uint8_t *pPayload);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* MOTENV_STM_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Middlewares/ST/STM32_WPAN/ble/svc/Inc/opus_interface_stm.h b/Middlewares/ST/STM32_WPAN/ble/svc/Inc/opus_interface_stm.h
new file mode 100644
index 000000000..1a7ea9386
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/ble/svc/Inc/opus_interface_stm.h
@@ -0,0 +1,212 @@
+/**
+ ******************************************************************************
+ * @file opus_interface_stm.h
+ * @author SRA-A&SP
+ * @version V1.0.0
+ * @date 08-May-2019
+ * @brief This file contains definitions for the opus interface.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * 3. Neither the name of STMicroelectronics nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ ******************************************************************************
+ */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __OPUS_INTERFACE_STM_H
+#define __OPUS_INTERFACE_STM_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+#include "opus.h"
+#include "opus_private.h"
+#include "ble_gatt_aci.h"
+
+/**
+ * @brief Return states values.
+ */
+typedef enum
+{
+ OPUS_IF_SUCCESS = 0x00, /*!< Success.*/
+ OPUS_IF_ERROR = 0x01, /*!< Error.*/
+ OPUS_IF_INVALID_PARAM = 0x02, /*!< Invalid Opus parameters.*/
+ OPUS_IF_ENC_NOT_CONFIG = 0x03, /*!< BlueVoiceOPUS encoder not configured.*/
+ OPUS_IF_DEC_NOT_CONFIG = 0x04, /*!< BlueVoiceOPUS decoder not configured.*/
+} OPUS_IF_Status;
+
+
+/**
+ * @brief Opus encoder configuration parameters.
+ */
+typedef struct
+{
+ float ms_frame; /*!< audio frame size [ms] (2.5, 5, 10, 20, 40, 60).*/
+
+ uint32_t sample_freq; /*!< Audio sampling frequency [Hz] (8000, 12000, 16000, 24000, 48000).*/
+
+ uint8_t channels; /*!< Number of audio input channels. */
+
+ int application; /*!< Specifies the application type (OPUS_APPLICATION_VOIP, OPUS_APPLICATION_AUDIO, OPUS_APPLICATION_RESTRICTED_LOWDELAY) see opus_define.h. */
+
+ uint32_t bitrate; /*!< Specifies the choosen encoding bitrate [bps] (from 6000 to 510000). */
+
+ uint8_t complexity; /*!< Specifies the choosen encoding complexity (from 0 to 10). */
+
+} OPUS_IF_ENC_ConfigTypeDef;
+
+
+/**
+ * @brief Opus decoder configuration parameters.
+ */
+typedef struct
+{
+ float ms_frame; /*!< audio frame size [ms] (2.5, 5, 10, 20, 40, 60). */
+
+ uint32_t sample_freq; /*!< Audio sampling frequency [Hz] (8000, 12000, 16000, 24000, 48000). */
+
+ uint8_t channels; /*!< Number of audio input channels */
+
+ uint32_t bitrate; /*!< Specifies the choosen encoding bitrate [bps] (from 6000 to 510000). */
+
+} OPUS_IF_DEC_ConfigTypeDef;
+
+
+/**
+ * @brief Encoder initialization.
+ * @param Opus encoder configuration.
+ * @param opus_err: @ref opus_errorcodes
+ * @retval OPUS_IF_Status: Value indicating success or error (in case of error check opus_err).
+ */
+OPUS_IF_Status OPUS_IF_ENC_Init(OPUS_IF_ENC_ConfigTypeDef *ENC_configOpus, int *opus_err);
+
+/**
+ * @brief Encoder deinit function.
+ * @param None.
+ * @retval None.
+ */
+void OPUS_IF_ENC_Deinit(void);
+
+/**
+ * @brief This function returns if the the Opus Encoder is configured.
+ * @param None.
+ * @retval uint8_t: 1 if the Encoder is configured 0 otherwise.
+ */
+uint8_t OPUS_IF_ENC_IsConfigured(void);
+
+/**
+ * @brief Decoder initialization.
+ * @param Opus decoder configuration.
+ * @param opus_err: @ref opus_errorcodes
+ * @retval OPUS_IF_Status: Value indicating success or error (in case of error check opus_err).
+ */
+OPUS_IF_Status OPUS_IF_DEC_Init(OPUS_IF_DEC_ConfigTypeDef *DEC_configOpus, int *opus_err);
+
+/**
+ * @brief Decoder deinit function.
+ * @param None.
+ * @retval None.
+ */
+void OPUS_IF_DEC_Deinit(void);
+
+/**
+ * @brief This function returns if the the Opus Decoder is configured.
+ * @param None.
+ * @retval uint8_t: 1 if the Decoder is configured 0 otherwise.
+ */
+uint8_t OPUS_IF_DEC_IsConfigured(void);
+
+/**
+ * @brief Set bitrate to be used for encoding
+ * @param bitrate: Indicate the bitrate in bit per second.
+ * @param opus_err: @ref opus_errorcodes.
+ * @retval OPUS_IF_Status: Value indicating success or error (in case of error check opus_err).
+ */
+OPUS_IF_Status OPUS_IF_ENC_Set_Bitrate(OPUS_IF_ENC_ConfigTypeDef *ENC_configOpus, int bitrate, int *opus_err);
+
+/**
+ * @brief Set constant bitrate option for the encoder.
+ * @param None.
+ * @retval OPUS_IF_Status: Value indicating success or error.
+ */
+OPUS_IF_Status OPUS_IF_ENC_Set_CBR(void);
+
+/**
+ * @brief Set variable bitrate option for the encoder.
+ * @param None.
+ * @retval OPUS_IF_Status: Value indicating success or error.
+ */
+OPUS_IF_Status OPUS_IF_ENC_Set_VBR(void);
+
+/**
+ * @brief Set complexity to be used for encoding
+ * @param complexity: value from o to 10.
+ * @param opus_err: @ref opus_errorcodes.
+ * @retval OPUS_IF_Status: Value indicating success or error (in case of error check opus_err).
+ */
+OPUS_IF_Status OPUS_IF_ENC_Set_Complexity(OPUS_IF_ENC_ConfigTypeDef *ENC_configOpus, int complexity, int *opus_err);
+
+/**
+ * @brief Force the encoder to use only SILK
+ * @param None.
+ * @retval OPUS_IF_Status: Value indicating success or error.
+ */
+OPUS_IF_Status OPUS_IF_ENC_Force_SILKmode(void);
+
+/**
+ * @brief Force the encoder to use only CELT.
+ * @param None.
+ * @retval OPUS_IF_Status: Value indicating success or error.
+ */
+OPUS_IF_Status OPUS_IF_ENC_Force_CELTmode(void);
+
+/**
+ * @brief Encoding functions.
+ * @param buf_in: pointer to the PCM buffer to be encoded.
+ * @param buf_out: pointer to the Encoded buffer.
+ * @retval Number of bytes in case of success, 0 viceversa.
+ */
+int OPUS_IF_ENC_Encode(uint8_t * buf_in, uint8_t * buf_out);
+
+/**
+ * @brief Decoding functions.
+ * @param buf_in: pointer to the Encoded buffer to be decoded.
+ * @param len: length of the buffer in.
+ * @param buf_out: pointer to the Decoded buffer.
+ * @retval Number of decoded samples or @ref opus_errorcodes.
+ */
+int OPUS_IF_DEC_Decode(uint8_t * buf_in, uint32_t len, uint8_t * buf_out);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __OPUS_INTERFACE_STM_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Middlewares/ST/STM32_WPAN/ble/svc/Inc/svc_ctl.h b/Middlewares/ST/STM32_WPAN/ble/svc/Inc/svc_ctl.h
index 3f4a935f5..781fa9e4c 100644
--- a/Middlewares/ST/STM32_WPAN/ble/svc/Inc/svc_ctl.h
+++ b/Middlewares/ST/STM32_WPAN/ble/svc/Inc/svc_ctl.h
@@ -150,6 +150,19 @@ extern "C" {
*/
void SVCCTL_InitCustomSvc( void );
+ /**
+ * @brief This API may be overloaded by the application to select a limited list of ble services to initialize.
+ * It is called by SVCCTL_Init()
+ * By default, SVCCTL_SvcInit() is implemented to initialize all BLE services which are included in the
+ * application at build time
+ * If it is required to initialize only limited part of the BLE service available in the application,
+ * this API may be used to call the initialization API of the subset of needed services at run time.
+ *
+ * @param None
+ * @retval None
+ */
+ void SVCCTL_SvcInit( void );
+
#ifdef __cplusplus
}
#endif
diff --git a/Middlewares/ST/STM32_WPAN/ble/svc/Src/bvopus_service_stm.c b/Middlewares/ST/STM32_WPAN/ble/svc/Src/bvopus_service_stm.c
new file mode 100644
index 000000000..1ee8b7e23
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/ble/svc/Src/bvopus_service_stm.c
@@ -0,0 +1,818 @@
+/**
+ ******************************************************************************
+ * @file bvopus_service_stm.c
+ * @author SRA-A&SP
+ * @version V1.0.0
+ * @date 08-May-2019
+ * @brief This file contains definitions for BlueVoice opus service.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * 3. Neither the name of STMicroelectronics nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "bvopus_service_stm.h"
+#include "opus_interface_stm.h"
+#include "common_blesvc.h"
+
+
+#ifndef MIN
+#define MIN(a,b) ((a) < (b) )? (a) : (b)
+#endif
+
+/* Private typedef -----------------------------------------------------------*/
+
+/*!< Transport protocol packet type. */
+typedef enum
+{
+ BV_OPUS_TP_START_PACKET = 0x00,
+ BV_OPUS_TP_START_END_PACKET = 0x20,
+ BV_OPUS_TP_MIDDLE_PACKET = 0x40,
+ BV_OPUS_TP_END_PACKET = 0x80
+} BV_OPUS_TP_Packet_Typedef;
+
+/*!< Transport protocol status. */
+typedef enum
+{
+ BV_OPUS_TP_WAIT_START = 0,
+ BV_OPUS_TP_WAIT_END = 1
+} BV_OPUS_TP_Status_Typedef;
+
+/*!< BV_OPUS_Handle structure definition. */
+typedef struct
+{
+ uint8_t TX_configured; /*!< Specifies if the Tx service is configured. */
+
+ BV_OPUS_uuid_t BV_uuid; /*!< Specifies the uuid for the bluevoice service and characteristics. */
+
+ BV_OPUS_ProfileHandle_t BV_handle; /*!< Specifies the handle for the bluevoice service and characteristics. */
+
+ uint8_t AudioNotifEnabled; /*!< Audio characteristic enabled. */
+
+ uint8_t CtrlNotifEnabled; /*!< Control characteristic enabled. */
+
+ uint8_t *pInternalMemory_dec; /*!< Pointer to the internal memory used for the BlueVoice decoding. */
+
+ uint8_t *pInternalMemory_enc; /*!< Pointer to the internal memory used for the BlueVoice encoding. */
+
+} BV_OPUS_HandleTypeDef;
+
+static BV_OPUS_HandleTypeDef hBV_OPUS;
+
+/* Private variables ---------------------------------------------------------*/
+
+/*!< Audio service uuid.*/
+const uint8_t bvopus_service_uuid[16] =
+{
+ 0x1b,0xc5,0xd5,0xa5,0x02,0x00,0xb4,0x9a,0xe1,0x11,0x01,0x00,0x00,0x00,0x00,0x00
+};
+
+/*!< Audio characteristic uuid.*/
+const uint8_t bvopus_audio_char_uuid[16] =
+{
+ 0x1b,0xc5,0xd5,0xa5,0x02,0x00,0x36,0xac,0xe1,0x11,0x02,0x00,0x01,0x00,0x00,0x00
+};
+
+/*!< Control characteristic uuid.*/
+const uint8_t bvopus_ctrl_char_uuid[16] =
+{
+ 0x1b,0xc5,0xd5,0xa5,0x02,0x00,0x36,0xac,0xe1,0x11,0x02,0x00,0x02,0x00,0x00,0x00
+};
+
+/* Private function prototypes -----------------------------------------------*/
+
+/**
+ * @brief This function is called to add BlueVoiceOPUS Service.
+ * @param None.
+ * @retval BV_OPUS_Status: Value indicating success or error code.
+ */
+BV_OPUS_Status BluevoiceOPUS_AddService(void);
+
+/**
+ * @brief This function is called to add BlueVoice characteristics.
+ * @param service_handle: Handle of the service to which the characteristic must be added.
+ * @retval BV_OPUS_Status: Value indicating success or error code.
+ */
+BV_OPUS_Status BluevoiceOPUS_AddChar(uint16_t service_handle);
+
+/**
+ * @brief This function returns the amount of memory required for the current bluevoice decoder setup.
+ * @param Opus decoder configuration.
+ * @retval Number of byte, 0 for invalid parameters.
+ */
+uint32_t BVOPUS_DEC_getMemorySize(OPUS_IF_DEC_ConfigTypeDef *DEC_configOpus);
+
+/**
+ * @brief This functions returns the amount of memory required for the current bluevoice encoder setup.
+ * @param Opus encoder configuration.
+ * @retval Number of byte, 0 for invalid parameters.
+ */
+uint32_t BVOPUS_ENC_getMemorySize(OPUS_IF_ENC_ConfigTypeDef *ENC_configOpus);
+
+/**
+ * @brief This function must be called when there is a LE attribute modified event.
+ * @param attr_handle: Attribute handle.
+ * @param attr_len: Attribute length.
+ * @param attr_value: Attribute value.
+ * @retval BVOPUS_STM_evt_code_t: Value indicating the operatione code.
+ */
+BVOPUS_STM_evt_code_t BluevoiceOPUS_AttributeModified_CB(uint16_t attr_handle, uint16_t attr_len, uint8_t *attr_value);
+
+/**
+ * @brief Event handler
+ * @param Event: Address of the buffer holding the Event
+ * @retval Ack: Return whether the Event has been managed or not.
+ */
+static SVCCTL_EvtAckStatus_t BVOPUS_Event_Handler(void *Event);
+
+/**
+ * @brief This function is called to parse a BV_OPUS_TP packet.
+ * @param buffer_out: pointer to the output buffer.
+ * @param buffer_in: pointer to the input data.
+ * @param len: buffer in length
+ * @retval Buffer out length.
+ */
+uint32_t BluevoiceOPUS_TP_Parse(uint8_t* buffer_out, uint8_t* buffer_in, uint32_t len);
+
+/**
+ * @brief This function is called to prepare a BV_OPUS_TP packet.
+ * @param buffer_out: pointer to the buffer used to save BV_OPUS_TP packet.
+ * @param buffer_in: pointer to the input data.
+ * @param len: buffer in length
+ * @retval Buffer out length.
+ */
+uint32_t BluevoiceOPUS_TP_Encapsulate(uint8_t* buffer_out, uint8_t* buffer_in, uint16_t len);
+
+
+/* Functions Definition ------------------------------------------------------*/
+
+/**
+ * @brief BlueVoice Opus Service initialization
+ * @param None
+ * @retval BV_OPUS_Status: Value indicating success or error code.
+ */
+void BVOPUS_STM_Init(void)
+{
+ /* Register the event handler to the BLE controller */
+ SVCCTL_RegisterSvcHandler(BVOPUS_Event_Handler);
+
+ memset(&hBV_OPUS, 0, sizeof(hBV_OPUS));
+
+ BluevoiceOPUS_AddService();
+
+ BluevoiceOPUS_AddChar(hBV_OPUS.BV_handle.ServiceHandle);
+}
+
+/**
+ * @brief BlueVoiceOPUS Event handler
+ * @param Event: Address of the buffer holding the Event
+ * @retval Ack: Return whether the Event has been managed or not.
+ */
+static SVCCTL_EvtAckStatus_t BVOPUS_Event_Handler(void *Event)
+{
+ SVCCTL_EvtAckStatus_t return_value;
+ hci_event_pckt *event_pckt;
+ evt_blue_aci *blue_evt;
+
+ return_value = SVCCTL_EvtNotAck;
+ event_pckt = (hci_event_pckt *)(((hci_uart_pckt*)Event)->data);
+
+ BVOPUS_STM_evt_code_t Evt_code;
+
+ switch(event_pckt->evt)
+ {
+ case EVT_VENDOR:
+ {
+ blue_evt = (evt_blue_aci*)event_pckt->data;
+ switch(blue_evt->ecode)
+ {
+ case EVT_BLUE_GATT_ATTRIBUTE_MODIFIED:
+ {
+ aci_gatt_attribute_modified_event_rp0 *pr = (aci_gatt_attribute_modified_event_rp0*)blue_evt->data;
+ Evt_code = BluevoiceOPUS_AttributeModified_CB(pr->Attr_Handle, pr->Attr_Data_Length, pr->Attr_Data);
+ BVOPUS_STM_APP_Notification(Evt_code);
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ return(return_value);
+}
+
+/**
+ * @brief This function must be called when there is a LE attribute modified event.
+ * @param attr_handle: Attribute handle.
+ * @param attr_len: Attribute length.
+ * @param attr_value: Attribute value.
+ * @retval BVOPUS_STM_evt_code_t: Value indicating the operatione code.
+ */
+BVOPUS_STM_evt_code_t BluevoiceOPUS_AttributeModified_CB(uint16_t attr_handle, uint16_t attr_len, uint8_t *attr_value)
+{
+ if (attr_handle == (hBV_OPUS.BV_handle.CharAudioHandle + 2))
+ {
+ if (attr_value[0] == 0x01)
+ {
+ hBV_OPUS.AudioNotifEnabled = 1;
+ return BVOPUS_STM_START_STREAMING_EVT;
+ }
+ else if(attr_value[0] == 0x00)
+ {
+ hBV_OPUS.AudioNotifEnabled = 0;
+ return BVOPUS_STM_STOP_STREAMING_EVT;
+ }
+ }
+ else if(attr_handle == (hBV_OPUS.BV_handle.CharCtrlHandle + 2))
+ {
+ if (attr_value[0] == 0x01)
+ {
+ hBV_OPUS.CtrlNotifEnabled = 1;
+ return BVOPUS_STM_ENABLE_CTRL_EVT;
+ }
+ else if(attr_value[0] == 0x00)
+ {
+ hBV_OPUS.CtrlNotifEnabled = 0;
+ return BVOPUS_STM_DISABLE_CTRL_EVT;
+ }
+ }
+ return BVOPUS_STM_ERROR_EVT;
+}
+
+/**
+ * @brief This functions returns the amount of memory required for the current bluevoice encoder setup.
+ * @param Opus encoder configuration.
+ * @retval Number of byte, 0 for invalid parameters.
+ */
+uint32_t BVOPUS_ENC_getMemorySize(OPUS_IF_ENC_ConfigTypeDef *ENC_configOpus)
+{
+ if((ENC_configOpus->bitrate<6000) || (ENC_configOpus->bitrate>510000))
+ {
+ return 0;
+ }
+ if((ENC_configOpus->ms_frame!=2.5f) &&
+ (ENC_configOpus->ms_frame!=5.0f) &&
+ (ENC_configOpus->ms_frame!=10.0f) &&
+ (ENC_configOpus->ms_frame!=20.0f) &&
+ (ENC_configOpus->ms_frame!=40.0f) &&
+ (ENC_configOpus->ms_frame!=60.0f))
+ {
+ return 0;
+ }
+
+ uint32_t tot_enc_size, max_enc_frame_size;
+
+ /* size x2 (worst case encode VBR) x2 (temp buffer used for BVTP) */
+ max_enc_frame_size = (ENC_configOpus->bitrate/8/((uint16_t)(1000.0f/ENC_configOpus->ms_frame)))*4;
+ tot_enc_size = max_enc_frame_size + (max_enc_frame_size/19)+1;
+
+ return tot_enc_size;
+}
+
+/**
+ * @brief This function returns the amount of memory required for the current bluevoice decoder setup.
+ * @param Opus decoder configuration.
+ * @retval Number of byte, 0 for invalid parameters.
+ */
+uint32_t BVOPUS_DEC_getMemorySize(OPUS_IF_DEC_ConfigTypeDef *DEC_configOpus)
+{
+ if((DEC_configOpus->bitrate<6000) || (DEC_configOpus->bitrate>510000))
+ {
+ return 0;
+ }
+ if((DEC_configOpus->ms_frame!=2.5f) &&
+ (DEC_configOpus->ms_frame!=5.0f) &&
+ (DEC_configOpus->ms_frame!=10.0f) &&
+ (DEC_configOpus->ms_frame!=20.0f) &&
+ (DEC_configOpus->ms_frame!=40.0f) &&
+ (DEC_configOpus->ms_frame!=60.0f))
+ {
+ return 0;
+ }
+
+ uint32_t tot_dec_size = (DEC_configOpus->bitrate/8/((uint16_t)(1000.0f/DEC_configOpus->ms_frame)))*2;
+
+ return tot_dec_size;
+}
+
+/**
+ * @brief This function is called to add BlueVoiceOPUS Service.
+ * @param None.
+ * @retval BV_OPUS_Status: Value indicating success or error code.
+ */
+BV_OPUS_Status BluevoiceOPUS_AddService(void)
+{
+ tBleStatus ret;
+
+ memcpy(hBV_OPUS.BV_uuid.service_uuid.Service_UUID_128, bvopus_service_uuid, sizeof(bvopus_service_uuid));
+
+ ret = aci_gatt_add_service(UUID_TYPE_128, &hBV_OPUS.BV_uuid.service_uuid, PRIMARY_SERVICE, 9, &hBV_OPUS.BV_handle.ServiceHandle);
+
+ if (ret != BLE_STATUS_SUCCESS)
+ {
+ return BV_OPUS_ERROR;
+ }
+
+ return BV_OPUS_SUCCESS;
+}
+
+/**
+ * @brief This function is called to add BlueVoice characteristics.
+ * @param service_handle: Handle of the service to which the characteristic must be added.
+ * @retval BV_OPUS_Status: Value indicating success or error code.
+ */
+BV_OPUS_Status BluevoiceOPUS_AddChar(uint16_t service_handle)
+{
+ tBleStatus ret;
+
+ memcpy(hBV_OPUS.BV_uuid.audio_uuid.Char_UUID_128, bvopus_audio_char_uuid, sizeof(bvopus_audio_char_uuid));
+
+ ret = aci_gatt_add_char(hBV_OPUS.BV_handle.ServiceHandle, UUID_TYPE_128, &hBV_OPUS.BV_uuid.audio_uuid,
+ 20, CHAR_PROP_NOTIFY, ATTR_PERMISSION_NONE, GATT_DONT_NOTIFY_EVENTS, 16, 1,
+ &hBV_OPUS.BV_handle.CharAudioHandle);
+
+ if (ret != BLE_STATUS_SUCCESS)
+ {
+ return BV_OPUS_ERROR;
+ }
+ memcpy(hBV_OPUS.BV_uuid.ctrl_uuid.Char_UUID_128, bvopus_ctrl_char_uuid, sizeof(bvopus_ctrl_char_uuid));
+
+ ret = aci_gatt_add_char(hBV_OPUS.BV_handle.ServiceHandle, UUID_TYPE_128, &hBV_OPUS.BV_uuid.ctrl_uuid,
+ 20, CHAR_PROP_NOTIFY, ATTR_PERMISSION_NONE, GATT_DONT_NOTIFY_EVENTS, 16, 1,
+ &hBV_OPUS.BV_handle.CharCtrlHandle);
+
+ if (ret != BLE_STATUS_SUCCESS)
+ {
+ return BV_OPUS_ERROR;
+ }
+
+ hBV_OPUS.TX_configured = 1;
+
+ return BV_OPUS_SUCCESS;
+}
+
+/**
+ * @brief This function initializes Opus encoder.
+ * @param Opus encoder configuration.
+ * @retval BV_OPUS_Status: Value indicating success or error code.
+ */
+BV_OPUS_Status BVOPUS_CodecEncInit(OPUS_IF_ENC_ConfigTypeDef *ENC_configOpus)
+{
+ uint32_t enc_size = BVOPUS_ENC_getMemorySize(ENC_configOpus);
+ if(enc_size == 0)
+ {
+ return BV_OPUS_INVALID_PARAM;
+ }
+ hBV_OPUS.pInternalMemory_enc = (uint8_t *)malloc(enc_size);
+
+ if(!OPUS_IF_ENC_IsConfigured())
+ {
+ int opus_err;
+ OPUS_IF_Status status = OPUS_IF_ENC_Init(ENC_configOpus, &opus_err);
+ if(status == OPUS_IF_INVALID_PARAM)
+ {
+ return BV_OPUS_INVALID_PARAM;
+ }
+ else if(status == OPUS_IF_ERROR)
+ {
+ return BV_OPUS_ERROR;
+ }
+ }
+
+ return BV_OPUS_SUCCESS;
+}
+
+/**
+ * @brief This function initializes Opus decoder.
+ * @param Opus decoder configuration.
+ * @retval BV_OPUS_Status: Value indicating success or error code.
+ */
+BV_OPUS_Status BVOPUS_CodecDecInit(OPUS_IF_DEC_ConfigTypeDef *DEC_configOpus)
+{
+ uint32_t dec_size = BVOPUS_DEC_getMemorySize(DEC_configOpus);
+ if(dec_size == 0)
+ {
+ return BV_OPUS_INVALID_PARAM;
+ }
+ hBV_OPUS.pInternalMemory_dec = (uint8_t *)malloc(dec_size);
+
+ if(!OPUS_IF_DEC_IsConfigured())
+ {
+ int opus_err;
+ OPUS_IF_Status status = OPUS_IF_DEC_Init(DEC_configOpus, &opus_err);
+ if(status == OPUS_IF_INVALID_PARAM)
+ {
+ return BV_OPUS_INVALID_PARAM;
+ }
+ else if(status == OPUS_IF_ERROR)
+ {
+ return BV_OPUS_ERROR;
+ }
+ }
+
+ return BV_OPUS_SUCCESS;
+}
+
+/**
+ * @brief This function returns the audio notification status.
+ * @param None.
+ * @retval 1 if audio notification are enabled, 0 otherwise.
+ */
+uint8_t BluevoiceOPUS_isAudioNotifEnabled(void)
+{
+ return hBV_OPUS.AudioNotifEnabled;
+}
+
+/**
+ * @brief This function returns the control notification status.
+ * @param None.
+ * @retval 1 if the control notification are enabled, 0 otherwise.
+ */
+uint8_t BluevoiceOPUS_isCtrlNotifEnabled(void)
+{
+ return hBV_OPUS.CtrlNotifEnabled;
+}
+
+/**
+ * @brief This function is called to decode audio data using opus.
+ * @param buf_in: pointer to the encoded buffer.
+ * @param len_in: buffer in length.
+ * @param buf_out: pointer to the decoded buffer.
+ * @param pcm_samples: number of PCM samples decoded.
+ * @param opus_err: @ref opus_errorcodes.
+ * @retval BV_OPUS_Status: Value indicating success or error code.
+ */
+BV_OPUS_Status BluevoiceOPUS_ParseData(uint8_t *buf_in, uint8_t len_in, uint8_t *buf_out, uint16_t *pcm_samples, int *opus_err)
+{
+ if(!OPUS_IF_DEC_IsConfigured())
+ {
+ return BV_OPUS_DEC_NOT_CONFIG;
+ }
+
+ uint32_t OpusDecBufLen = BluevoiceOPUS_TP_Parse(hBV_OPUS.pInternalMemory_dec, buf_in, len_in);
+
+ if (OpusDecBufLen > 0)
+ {
+ *opus_err = OPUS_IF_DEC_Decode(hBV_OPUS.pInternalMemory_dec, OpusDecBufLen, buf_out);
+
+ if(*opus_err<=0)
+ {
+ *pcm_samples = 0;
+ return BV_OPUS_ERROR;
+ }
+ else
+ {
+ *pcm_samples = *opus_err;
+ return BV_OPUS_SUCCESS;
+ }
+ }
+ else
+ {
+ return BV_OPUS_PKT_NOT_COMPLETE;
+ }
+}
+
+/**
+ * @brief This function is called to packetize, encode and send audio data.
+ * @param data_buffer: data to be sent
+ * @param opus_err: @ref opus_errorcodes.
+ * @retval BV_OPUS_Status: Value indicating success or error code.
+ */
+BV_OPUS_Status BluevoiceOPUS_SendAudioData(uint8_t *data_buffer, int *opus_err)
+{
+ if(!hBV_OPUS.TX_configured)
+ {
+ return BV_OPUS_TX_HANDLE_NOT_AVAILABLE;
+ }
+
+ if(!hBV_OPUS.AudioNotifEnabled)
+ {
+ return BV_OPUS_NOTIF_DISABLE;
+ }
+
+ if(!OPUS_IF_ENC_IsConfigured())
+ {
+ return BV_OPUS_ENC_NOT_CONFIG;
+ }
+
+ uint32_t j = 0, len = 0, tot_len = 0;
+ uint32_t timeout_cnt = 0;
+ int32_t OpusEncBufLen = 0;
+ uint8_t *OpusEncBuf_BV_OPUS_TP;
+ *opus_err = 0;
+
+ OpusEncBufLen = OPUS_IF_ENC_Encode((uint8_t *) data_buffer, hBV_OPUS.pInternalMemory_enc);
+
+ if(OpusEncBufLen<=0)
+ {
+ *opus_err = OpusEncBufLen;
+ return BV_OPUS_ERROR;
+ }
+
+ OpusEncBuf_BV_OPUS_TP = &hBV_OPUS.pInternalMemory_enc[OpusEncBufLen];
+
+
+ tot_len = BluevoiceOPUS_TP_Encapsulate(OpusEncBuf_BV_OPUS_TP, hBV_OPUS.pInternalMemory_enc, OpusEncBufLen);
+
+ /* Data are sent as notifications*/
+ while (j < tot_len)
+ {
+ len = MIN(20, tot_len - j);
+
+ while(aci_gatt_update_char_value(hBV_OPUS.BV_handle.ServiceHandle, hBV_OPUS.BV_handle.CharAudioHandle, 0,
+ len,(uint8_t*) &OpusEncBuf_BV_OPUS_TP[j]) == BLE_STATUS_NOT_ALLOWED)
+ {
+ /* Radio is busy */
+ /*-------------------------------------------------------*/
+ timeout_cnt++;
+ if (timeout_cnt >= BV_OPUS_SENDING_TIMEOUT)
+ {
+ return BV_OPUS_TIMEOUT;
+ }
+ }
+ j += len;
+ }
+
+ return BV_OPUS_SUCCESS;
+}
+
+/**
+ * @brief This function is called to send control command.
+ * @param data_buffer: data to be sent
+ * @param Nb_bytes: number of bytes to be sent (max 20)
+ * @retval BV_OPUS_Status: Value indicating success or error code.
+ */
+BV_OPUS_Status BluevoiceOPUS_SendCtrlData(uint8_t* data_buffer, uint8_t Nb_bytes)
+{
+ if(!hBV_OPUS.TX_configured)
+ {
+ return BV_OPUS_TX_HANDLE_NOT_AVAILABLE;
+ }
+
+ if(!hBV_OPUS.CtrlNotifEnabled)
+ {
+ return BV_OPUS_NOTIF_DISABLE;
+ }
+
+ uint32_t timeout_cnt = 0;
+ if(Nb_bytes > 20)
+ {
+ /*length too long for a single packet*/
+ return BV_OPUS_ERROR;
+ }
+
+ /* Data are sent as notifications*/
+ while (aci_gatt_update_char_value(hBV_OPUS.BV_handle.ServiceHandle, hBV_OPUS.BV_handle.CharCtrlHandle, 0,
+ Nb_bytes, (uint8_t *)data_buffer) == BLE_STATUS_NOT_ALLOWED)
+ {
+ /* Radio is busy */
+ /*-------------------------------------------------------*/
+ timeout_cnt++;
+ if (timeout_cnt >= BV_OPUS_SENDING_TIMEOUT)
+ {
+ return BV_OPUS_TIMEOUT;
+ }
+ }
+ return BV_OPUS_SUCCESS;
+}
+
+/**
+ * @brief This function is called to send an enable notification request.
+ * @param None
+ * @retval BV_OPUS_Status: Value indicating success or error code.
+ */
+BV_OPUS_Status BluevoiceOPUS_SendEnableNotifReq(void)
+{
+ uint8_t data[] = {BV_OPUS_CONTROL, BV_OPUS_ENABLE_NOTIF_REQ};
+
+ return BluevoiceOPUS_SendCtrlData(data, 2);
+}
+
+/**
+ * @brief This function is called to send a disable notification request.
+ * @param None
+ * @retval BV_OPUS_Status: Value indicating success or error code.
+ */
+BV_OPUS_Status BluevoiceOPUS_SendDisableNotifReq(void)
+{
+ uint8_t data[] = {BV_OPUS_CONTROL, BV_OPUS_DISABLE_NOTIF_REQ};
+
+ return BluevoiceOPUS_SendCtrlData(data, 2);
+}
+
+
+/**********************************/
+/******* Transfer Protocol *******/
+/**********************************/
+
+/**
+ * @brief This function is called to parse a BV_OPUS_TP packet.
+ * @param buffer_out: pointer to the output buffer.
+ * @param buffer_in: pointer to the input data.
+ * @param len: buffer in length
+ * @retval Buffer out length.
+ */
+uint32_t BluevoiceOPUS_TP_Parse(uint8_t* buffer_out, uint8_t* buffer_in, uint32_t len)
+{
+ static uint32_t tot_len = 0;
+ uint32_t buff_out_len;
+ static BV_OPUS_TP_Status_Typedef status = BV_OPUS_TP_WAIT_START;
+ BV_OPUS_TP_Packet_Typedef packet_type;
+
+ packet_type = (BV_OPUS_TP_Packet_Typedef) buffer_in[0];
+
+ switch (status)
+ {
+ case BV_OPUS_TP_WAIT_START:
+ {
+ if (packet_type == BV_OPUS_TP_START_PACKET)
+ {
+ /*First part of an Opus packet*/
+ /*packet is enqueued*/
+ memcpy((uint8_t*) &buffer_out[tot_len], (uint8_t*) &buffer_in[1], (len - 1));
+ tot_len += len - 1;
+ status = BV_OPUS_TP_WAIT_END;
+ return 0;
+ }
+ else if (packet_type == BV_OPUS_TP_START_END_PACKET)
+ {
+ /*Final part of an Opus packet*/
+ /*packet is enqueued*/
+ memcpy((uint8_t*) &buffer_out[tot_len], (uint8_t*) &buffer_in[1], (len - 1));
+
+ tot_len += len - 1;
+
+ /*number of bytes of the output packet*/
+ buff_out_len = tot_len;
+
+ /*total length set to zero*/
+ tot_len = 0;
+
+ /*reset status*/
+ status = BV_OPUS_TP_WAIT_START;
+
+ /*return decoded output dimension*/
+ return buff_out_len;
+ }
+ else
+ {
+ /* Error */
+ return 0;
+ }
+ }
+ case BV_OPUS_TP_WAIT_END:
+ {
+ if (packet_type == BV_OPUS_TP_MIDDLE_PACKET)
+ {
+ /*Central part of an Opus packet*/
+ /*packet is enqueued*/
+ memcpy((uint8_t*) &buffer_out[tot_len], (uint8_t*) &buffer_in[1], (len - 1));
+
+ tot_len += len - 1;
+ return 0;
+ }
+ else if (packet_type == BV_OPUS_TP_END_PACKET)
+ {
+ /*Final part of an Opus packet*/
+ /*packet is enqueued*/
+ memcpy((uint8_t*) &buffer_out[tot_len], (uint8_t*) &buffer_in[1], (len - 1));
+
+ tot_len += len - 1;
+
+ /*number of bytes of the output packet*/
+ buff_out_len = tot_len;
+
+ /*total length set to zero*/
+ tot_len = 0;
+
+ /*reset status*/
+ status = BV_OPUS_TP_WAIT_START;
+
+ /*return decoded output dimension*/
+ return buff_out_len;
+ }
+ else
+ {
+ /*reset status*/
+ status = BV_OPUS_TP_WAIT_START;
+
+ /*total length set to zero*/
+ tot_len = 0;
+
+ return 0; /* error */
+ }
+ }
+ }
+ return 0;
+}
+
+/**
+ * @brief This function is called to prepare a BV_OPUS_TP packet.
+ * @param buffer_out: pointer to the buffer used to save BV_OPUS_TP packet.
+ * @param buffer_in: pointer to the input data.
+ * @param len: buffer in length
+ * @retval Buffer out length.
+ */
+uint32_t BluevoiceOPUS_TP_Encapsulate(uint8_t* buffer_out, uint8_t* buffer_in, uint16_t len)
+{
+ uint32_t size = 0, tot_size = 0;
+ uint32_t counter = 0;
+ BV_OPUS_TP_Packet_Typedef packet_type = BV_OPUS_TP_START_PACKET;
+
+ /* One byte header is added to each BLE packet */
+
+ while (counter < len)
+ {
+ size = MIN(19, len - counter);
+
+ if (len - counter <= 19)
+ {
+ if (counter == 0)
+ {
+ packet_type = BV_OPUS_TP_START_END_PACKET;
+ }
+ else
+ {
+ packet_type = BV_OPUS_TP_END_PACKET;
+ }
+ }
+
+ switch (packet_type)
+ {
+ case BV_OPUS_TP_START_PACKET:
+ {
+ /*First part of an Opus packet*/
+ buffer_out[tot_size] = ((uint8_t) (BV_OPUS_TP_START_PACKET));
+ tot_size++;
+ packet_type = BV_OPUS_TP_MIDDLE_PACKET;
+ }
+ break;
+ case BV_OPUS_TP_START_END_PACKET:
+ {
+ /*First and last part of an Opus packet*/
+ buffer_out[tot_size] = ((uint8_t) (BV_OPUS_TP_START_END_PACKET));
+ tot_size++;
+ packet_type = BV_OPUS_TP_START_PACKET;
+ }
+ break;
+ case BV_OPUS_TP_MIDDLE_PACKET:
+ {
+ /*Central part of an Opus packet*/
+ buffer_out[tot_size] = ((uint8_t) (BV_OPUS_TP_MIDDLE_PACKET));
+ tot_size++;
+ }
+ break;
+ case BV_OPUS_TP_END_PACKET:
+ {
+ /*Last part of an Opus packet*/
+ buffer_out[tot_size] = ((uint8_t) (BV_OPUS_TP_END_PACKET));
+ tot_size++;
+ packet_type = BV_OPUS_TP_START_PACKET;
+ }
+ break;
+ }
+
+ /*Input data is incapsulated*/
+ memcpy((uint8_t*) &buffer_out[tot_size], (uint8_t *) &buffer_in[counter], size);
+
+ /*length variables update*/
+ counter += size;
+ tot_size += size;
+ }
+ return tot_size;
+}
+
+
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Middlewares/ST/STM32_WPAN/ble/svc/Src/mesh.c b/Middlewares/ST/STM32_WPAN/ble/svc/Src/mesh.c
index d42a9784b..cf3a5a2d3 100644
--- a/Middlewares/ST/STM32_WPAN/ble/svc/Src/mesh.c
+++ b/Middlewares/ST/STM32_WPAN/ble/svc/Src/mesh.c
@@ -76,6 +76,7 @@ const Mesh_Initialization_t BLEMeshlib_Init_params =
&NeighborTableParams,
BLUENRG_MESH_FEATURES,
BLUENRG_MESH_PRVN_BEARER_INFO,
+ &PrvnParams,
&DynBufferParam
};
@@ -124,10 +125,14 @@ void MESH_Init(void)
/* Checks if the node is already provisioned or not */
if (BLEMesh_IsUnprovisioned() == MOBLE_TRUE)
{
- BLEMesh_UnprovisionedNodeInfo(&UnprovNodeInfoParams);
+// BluenrgMesh_UnprovisionedNodeInfo(&UnprovNodeInfoParams);
BLEMesh_InitUnprovisionedNode(); /* Initalizes Unprovisioned node */
TRACE_I(TF_PROVISION,"Unprovisioned device \r\n");
+
+#if PB_ADV_SUPPORTED
+ BLEMesh_SetUnprovisionedDevBeaconInterval(100);
+#endif
}
else
{
@@ -135,6 +140,9 @@ void MESH_Init(void)
TRACE_I(TF_PROVISION,"Provisioned node \r\n");
}
+ /* Initializes the Application */
+ Appli_Init();
+
/* Check to manually unprovision the board */
Appli_CheckForUnprovision();
/* Set attention timer callback */
@@ -148,6 +156,16 @@ void MESH_Init(void)
/* Models intialization */
BLEMesh_ModelsInit();
+ /* Turn on Yellow LED */
+#if 0
+#if (LOW_POWER_FEATURE == 1)
+ SdkEvalLedOn(LED1);
+#endif
+
+#ifdef CUSTOM_BOARD_PWM_SELECTION
+ Light_UpdatePWMValue((MOBLEUINT8)DEFAULT_STATE);
+#endif
+#endif
}
/************************ (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Middlewares/ST/STM32_WPAN/ble/svc/Src/motenv_stm.c b/Middlewares/ST/STM32_WPAN/ble/svc/Src/motenv_stm.c
new file mode 100644
index 000000000..8864284a6
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/ble/svc/Src/motenv_stm.c
@@ -0,0 +1,950 @@
+/**
+ ******************************************************************************
+ * @file motenv_stm.c
+ * @author SRA/AST
+ * @brief MOTENV Service (Custom STM)
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+
+/* Includes ------------------------------------------------------------------*/
+#include "common_blesvc.h"
+
+/* Private typedef -----------------------------------------------------------*/
+/**
+ * @brief MOTENV Context structure definition
+ */
+typedef struct
+{
+ /* Handles for HW Service and Chars */
+ uint16_t HWSvcHdle; /**< Service handle */
+ uint16_t HWMotionCharHdle; /**< Characteristic handle */
+ uint16_t HWEnvCharHdle; /**< Characteristic handle */
+ uint16_t HWAccEventCharHdle; /**< Characteristic handle */
+
+ /* Handles for SW Service and Chars */
+ uint16_t SWSvcHdle; /**< Service handle */
+ uint16_t SWQuaternionsCharHdle; /**< Characteristic handle */
+ uint16_t SWECompassCharHdle; /**< Characteristic handle */
+ uint16_t SWActivityRecCharHdle; /**< Characteristic handle */
+ uint16_t SWCarryPositionCharHdle; /**< Characteristic handle */
+ uint16_t SWGestureRecCharHdle; /**< Characteristic handle */
+ uint16_t SWPedometerCharHdle; /**< Characteristic handle */
+ uint16_t SWIntensityDetCharHdle; /**< Characteristic handle */
+
+ /* Handles for Config Service and Chars */
+ uint16_t ConfigSvcHdle; /**< Service handle */
+ uint16_t ConfigCharHdle; /**< Characteristic handle */
+
+ /* Handles for Console Service and Chars */
+ uint16_t ConsoleSvcHdle; /**< Service handle */
+ uint16_t ConsoleTermCharHdle; /**< Characteristic handle */
+ uint16_t ConsoleStderrCharHdle; /**< Characteristic handle */
+} MotenvContext_t;
+
+/* Private defines -----------------------------------------------------------*/
+
+/* Private macros ------------------------------------------------------------*/
+
+/* Private variables ---------------------------------------------------------*/
+
+PLACE_IN_SECTION("BLE_DRIVER_CONTEXT") static MotenvContext_t aMotenvContext;
+
+/* Private function prototypes -----------------------------------------------*/
+static SVCCTL_EvtAckStatus_t Motenv_Event_Handler(void *pckt);
+
+
+/* Functions Definition ------------------------------------------------------*/
+/* Private functions ----------------------------------------------------------*/
+
+#define COPY_UUID_128(uuid_struct, uuid_15, uuid_14, uuid_13, uuid_12, uuid_11, uuid_10, uuid_9, uuid_8, uuid_7, uuid_6, uuid_5, uuid_4, uuid_3, uuid_2, uuid_1, uuid_0) \
+do {\
+ uuid_struct[0] = uuid_0; uuid_struct[1] = uuid_1; uuid_struct[2] = uuid_2; uuid_struct[3] = uuid_3; \
+ uuid_struct[4] = uuid_4; uuid_struct[5] = uuid_5; uuid_struct[6] = uuid_6; uuid_struct[7] = uuid_7; \
+ uuid_struct[8] = uuid_8; uuid_struct[9] = uuid_9; uuid_struct[10] = uuid_10; uuid_struct[11] = uuid_11; \
+ uuid_struct[12] = uuid_12; uuid_struct[13] = uuid_13; uuid_struct[14] = uuid_14; uuid_struct[15] = uuid_15; \
+}while(0)
+
+/* Hardware Service and Characteristics */
+#define COPY_HW_SERVICE_UUID(uuid_struct) COPY_UUID_128(uuid_struct,0x00,0x00,0x00,0x00,0x00,0x01,0x11,0xE1,0x9A,0xB4,0x00,0x02,0xA5,0xD5,0xC5,0x1B)
+#define COPY_HW_MOTION_CHAR_UUID(uuid_struct) COPY_UUID_128(uuid_struct,0x00,0xE0,0x00,0x00,0x00,0x01,0x11,0xE1,0xAC,0x36,0x00,0x02,0xA5,0xD5,0xC5,0x1B)
+#define COPY_HW_ENV_CHAR_UUID(uuid_struct) COPY_UUID_128(uuid_struct,0x00,0x1D,0x00,0x00,0x00,0x01,0x11,0xE1,0xAC,0x36,0x00,0x02,0xA5,0xD5,0xC5,0x1B)
+#define COPY_HW_ACC_EVENT_CHAR_UUID(uuid_struct) COPY_UUID_128(uuid_struct,0x00,0x00,0x04,0x00,0x00,0x01,0x11,0xE1,0xAC,0x36,0x00,0x02,0xA5,0xD5,0xC5,0x1B)
+
+#define HW_CHAR_NUMBER (3)
+
+/* Software Service and Characteristics */
+#define COPY_SW_SERVICE_UUID(uuid_struct) COPY_UUID_128(uuid_struct,0x00,0x00,0x00,0x00,0x00,0x02,0x11,0xE1,0x9A,0xB4,0x00,0x02,0xA5,0xD5,0xC5,0x1B)
+#define COPY_SW_QUATERNIONS_CHAR_UUID(uuid_struct) COPY_UUID_128(uuid_struct,0x00,0x00,0x01,0x00,0x00,0x01,0x11,0xE1,0xAC,0x36,0x00,0x02,0xA5,0xD5,0xC5,0x1B)
+#define COPY_SW_ECOMPASS_CHAR_UUID(uuid_struct) COPY_UUID_128(uuid_struct,0x00,0x00,0x00,0x40,0x00,0x01,0x11,0xE1,0xAC,0x36,0x00,0x02,0xA5,0xD5,0xC5,0x1B)
+
+#define COPY_SW_ACTIVITY_REC_CHAR_UUID(uuid_struct) COPY_UUID_128(uuid_struct,0x00,0x00,0x00,0x10,0x00,0x01,0x11,0xE1,0xAC,0x36,0x00,0x02,0xA5,0xD5,0xC5,0x1B)
+#define COPY_SW_CARRY_POSITION_CHAR_UUID(uuid_struct) COPY_UUID_128(uuid_struct,0x00,0x00,0x00,0x08,0x00,0x01,0x11,0xE1,0xAC,0x36,0x00,0x02,0xA5,0xD5,0xC5,0x1B)
+#define COPY_SW_GESTURE_REC_CHAR_UUID(uuid_struct) COPY_UUID_128(uuid_struct,0x00,0x00,0x00,0x02,0x00,0x01,0x11,0xE1,0xAC,0x36,0x00,0x02,0xA5,0xD5,0xC5,0x1B)
+#define COPY_SW_PEDOMETER_CHAR_UUID(uuid_struct) COPY_UUID_128(uuid_struct,0x00,0x00,0x00,0x01,0x00,0x01,0x11,0xE1,0xAC,0x36,0x00,0x02,0xA5,0xD5,0xC5,0x1B)
+#define COPY_SW_INTENSITY_DET_CHAR_UUID(uuid_struct) COPY_UUID_128(uuid_struct,0x00,0x00,0x00,0x20,0x00,0x01,0x11,0xE1,0xAC,0x36,0x00,0x02,0xA5,0xD5,0xC5,0x1B)
+
+#define SW_CHAR_NUMBER (7)
+
+/* Configuration Service and Characteristics */
+#define COPY_CONFIG_SERVICE_UUID(uuid_struct) COPY_UUID_128(uuid_struct,0x00,0x00,0x00,0x00,0x00,0x0F,0x11,0xE1,0x9A,0xB4,0x00,0x02,0xA5,0xD5,0xC5,0x1B)
+#define COPY_CONFIG_CHAR_UUID(uuid_struct) COPY_UUID_128(uuid_struct,0x00,0x00,0x00,0x02,0x00,0x0F,0x11,0xE1,0xAC,0x36,0x00,0x02,0xA5,0xD5,0xC5,0x1B)
+
+#define CONFIG_CHAR_NUMBER (1)
+
+/* Console Service and Characteristics */
+#define COPY_CONSOLE_SERVICE_UUID(uuid_struct) COPY_UUID_128(uuid_struct,0x00,0x00,0x00,0x00,0x00,0x0E,0x11,0xE1,0x9A,0xB4,0x00,0x02,0xA5,0xD5,0xC5,0x1B)
+#define COPY_TERM_CHAR_UUID(uuid_struct) COPY_UUID_128(uuid_struct,0x00,0x00,0x00,0x01,0x00,0x0E,0x11,0xE1,0xAC,0x36,0x00,0x02,0xA5,0xD5,0xC5,0x1B)
+#define COPY_STDERR_CHAR_UUID(uuid_struct) COPY_UUID_128(uuid_struct,0x00,0x00,0x00,0x02,0x00,0x0E,0x11,0xE1,0xAC,0x36,0x00,0x02,0xA5,0xD5,0xC5,0x1B)
+
+#define CONSOLE_CHAR_NUMBER (2)
+
+/* Characteristic Length */
+#define TIMESTAMP_LEN (2)
+
+/* Hardware Characteristic Length */
+#define MOTION_CHAR_LEN (TIMESTAMP_LEN+(3*3*2)) //(ACC+GYRO+MAG)*(X+Y+Z)*2BYTES
+#define ENV_CHAR_LEN (TIMESTAMP_LEN+(2*2)+2+4) //(2BYTES*2TEMP)+(2BYTES*HUM)+(4BYTES*PRESS)
+#define ACC_EVENT_CHAR_LEN (TIMESTAMP_LEN+3)
+
+/* Software Characteristic Length */
+#define QUATERNION_NUM (3)
+#define QUATERNION_CHAR_LEN (TIMESTAMP_LEN+(6*QUATERNION_NUM))
+#define ECOMPASS_CHAR_LEN (TIMESTAMP_LEN+2)
+#define ACTIVITY_REC_CHAR_LEN (TIMESTAMP_LEN+1)
+#define CARRY_POSITION_CHAR_LEN (TIMESTAMP_LEN+1)
+#define GESTURE_REC_CHAR_LEN (TIMESTAMP_LEN+1)
+#define PEDOMETER_CHAR_LEN (TIMESTAMP_LEN+4+2)
+#define INTENSITY_DET_CHAR_LEN (TIMESTAMP_LEN+1)
+
+/* Configuration Characteristic Length */
+#define CONFIG_CHAR_LEN (TIMESTAMP_LEN+18)
+
+/* Console Characteristic Length */
+#define CONSOLE_CHAR_LEN (TIMESTAMP_LEN+18)
+
+/**
+ * @brief Event handler
+ * @param Event: Address of the buffer holding the Event
+ * @retval Ack: Return whether the Event has been managed or not
+ */
+static SVCCTL_EvtAckStatus_t Motenv_Event_Handler(void *Event)
+{
+ SVCCTL_EvtAckStatus_t return_value;
+ hci_event_pckt *event_pckt;
+ evt_blue_aci *blue_evt;
+ aci_gatt_attribute_modified_event_rp0 * attribute_modified;
+ aci_gatt_read_permit_req_event_rp0 *read_permit_req;
+ MOTENV_STM_App_Notification_evt_t Notification;
+
+ return_value = SVCCTL_EvtNotAck;
+ event_pckt = (hci_event_pckt *)(((hci_uart_pckt*)Event)->data);
+
+ switch(event_pckt->evt)
+ {
+ case EVT_VENDOR:
+ {
+ blue_evt = (evt_blue_aci*)event_pckt->data;
+ switch(blue_evt->ecode)
+ {
+ /* Handle Read request from GATT Client */
+ case EVT_BLUE_GATT_READ_PERMIT_REQ:
+ {
+ read_permit_req = (aci_gatt_read_permit_req_event_rp0*)blue_evt->data;
+ /* Env char */
+ if(read_permit_req->Attribute_Handle == (aMotenvContext.HWEnvCharHdle + 1U))
+ {
+ /**
+ * Notify to application
+ */
+ BLE_DBG_TEMPLATE_STM_MSG("-- GATT : READ ENV CHAR INFO RECEIVED\n");
+ Notification.Motenv_Evt_Opcode = HW_ENV_READ_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ /* Acc Event char */
+ if(read_permit_req->Attribute_Handle == (aMotenvContext.HWAccEventCharHdle + 1U))
+ {
+ /**
+ * Notify to application
+ */
+ BLE_DBG_TEMPLATE_STM_MSG("-- GATT : READ ACC EVENT CHAR INFO RECEIVED\n");
+ Notification.Motenv_Evt_Opcode = HW_ACC_EVENT_READ_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ /* Activity Rec char */
+ else if(read_permit_req->Attribute_Handle == (aMotenvContext.SWActivityRecCharHdle + 1U))
+ {
+ /**
+ * Notify to application
+ */
+ BLE_DBG_TEMPLATE_STM_MSG("-- GATT : READ ACTIVITY REC CHAR INFO RECEIVED\n");
+ Notification.Motenv_Evt_Opcode = SW_ACTIVITY_REC_READ_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ /* CarryPosition char */
+ else if(read_permit_req->Attribute_Handle == (aMotenvContext.SWCarryPositionCharHdle + 1U))
+ {
+ /**
+ * Notify to application
+ */
+ BLE_DBG_TEMPLATE_STM_MSG("-- GATT : READ CARRY POSITION CHAR INFO RECEIVED\n");
+ Notification.Motenv_Evt_Opcode = SW_CARRY_POSITION_READ_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ /* GestureRec char */
+ else if(read_permit_req->Attribute_Handle == (aMotenvContext.SWGestureRecCharHdle + 1U))
+ {
+ /**
+ * Notify to application
+ */
+ BLE_DBG_TEMPLATE_STM_MSG("-- GATT : READ GESTURE REC CHAR INFO RECEIVED\n");
+ Notification.Motenv_Evt_Opcode = SW_GESTURE_REC_READ_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ /* Pedometer char */
+ else if(read_permit_req->Attribute_Handle == (aMotenvContext.SWPedometerCharHdle + 1U))
+ {
+ /**
+ * Notify to application
+ */
+ BLE_DBG_TEMPLATE_STM_MSG("-- GATT : READ PEDOMETER CHAR INFO RECEIVED\n");
+ Notification.Motenv_Evt_Opcode = SW_PEDOMETER_READ_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ else
+ {
+ /* do nothing */
+ }
+ /* Console Term char */
+ if(read_permit_req->Attribute_Handle == (aMotenvContext.ConsoleTermCharHdle + 1U))
+ {
+ /**
+ * Notify to application
+ */
+ BLE_DBG_TEMPLATE_STM_MSG("-- GATT : READ CONSOLE TERM CHAR INFO RECEIVED\n");
+ Notification.Motenv_Evt_Opcode = CONSOLE_TERM_READ_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ /* Console Stderr char */
+ if(read_permit_req->Attribute_Handle == (aMotenvContext.ConsoleStderrCharHdle + 1U))
+ {
+ /**
+ * Notify to application
+ */
+ BLE_DBG_TEMPLATE_STM_MSG("-- GATT : READ CONSOLE STDERR CHAR INFO RECEIVED\n");
+ Notification.Motenv_Evt_Opcode = CONSOLE_STDERR_READ_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ (void)aci_gatt_allow_read(read_permit_req->Connection_Handle);
+ break;
+ }
+
+ /* Handle Write request or Notification enabling from GATT Client */
+ case EVT_BLUE_GATT_ATTRIBUTE_MODIFIED:
+ {
+ attribute_modified = (aci_gatt_attribute_modified_event_rp0*)blue_evt->data;
+ /* Env char */
+ if(attribute_modified->Attr_Handle == (aMotenvContext.HWEnvCharHdle + 2U))
+ {
+ /**
+ * Descriptor handle
+ */
+ return_value = SVCCTL_EvtAckFlowEnable;
+ /**
+ * Notify to application
+ */
+ if(attribute_modified->Attr_Data[0] & COMSVC_Notification)
+ {
+ Notification.Motenv_Evt_Opcode = HW_ENV_NOTIFY_ENABLED_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ else
+ {
+ Notification.Motenv_Evt_Opcode = HW_ENV_NOTIFY_DISABLED_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ }
+
+ /* Acc Event char */
+ if(attribute_modified->Attr_Handle == (aMotenvContext.HWAccEventCharHdle + 2U))
+ {
+ /**
+ * Descriptor handle
+ */
+ return_value = SVCCTL_EvtAckFlowEnable;
+ /**
+ * Notify to application
+ */
+ if(attribute_modified->Attr_Data[0] & COMSVC_Notification)
+ {
+ Notification.Motenv_Evt_Opcode = HW_ACC_EVENT_NOTIFY_ENABLED_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ else
+ {
+ Notification.Motenv_Evt_Opcode = HW_ACC_EVENT_NOTIFY_DISABLED_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ }
+
+ /* Motion char */
+ else if(attribute_modified->Attr_Handle == (aMotenvContext.HWMotionCharHdle + 2U))
+ {
+ /**
+ * Descriptor handle
+ */
+ return_value = SVCCTL_EvtAckFlowEnable;
+ /**
+ * Notify to application
+ */
+ if(attribute_modified->Attr_Data[0] & COMSVC_Notification)
+ {
+ Notification.Motenv_Evt_Opcode = HW_MOTION_NOTIFY_ENABLED_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ else
+ {
+ Notification.Motenv_Evt_Opcode = HW_MOTION_NOTIFY_DISABLED_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ }
+
+ /* MotionFX (Quat) char */
+ else if(attribute_modified->Attr_Handle == (aMotenvContext.SWQuaternionsCharHdle + 2U))
+ {
+ /**
+ * Descriptor handle
+ */
+ return_value = SVCCTL_EvtAckFlowEnable;
+ /**
+ * Notify to application
+ */
+ if(attribute_modified->Attr_Data[0] & COMSVC_Notification)
+ {
+ Notification.Motenv_Evt_Opcode = SW_MOTIONFX_NOTIFY_ENABLED_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ else
+ {
+ Notification.Motenv_Evt_Opcode = SW_MOTIONFX_NOTIFY_DISABLED_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ }
+
+ /* MotionFX (ECompass) char */
+ else if(attribute_modified->Attr_Handle == (aMotenvContext.SWECompassCharHdle + 2U))
+ {
+ /**
+ * Descriptor handle
+ */
+ return_value = SVCCTL_EvtAckFlowEnable;
+ /**
+ * Notify to application
+ */
+ if(attribute_modified->Attr_Data[0] & COMSVC_Notification)
+ {
+ Notification.Motenv_Evt_Opcode = SW_ECOMPASS_NOTIFY_ENABLED_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ else
+ {
+ Notification.Motenv_Evt_Opcode = SW_ECOMPASS_NOTIFY_DISABLED_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ }
+
+ /* Activity Rec char */
+ else if(attribute_modified->Attr_Handle == (aMotenvContext.SWActivityRecCharHdle + 2U))
+ {
+ /**
+ * Descriptor handle
+ */
+ return_value = SVCCTL_EvtAckFlowEnable;
+ /**
+ * Notify to application
+ */
+ if(attribute_modified->Attr_Data[0] & COMSVC_Notification)
+ {
+ Notification.Motenv_Evt_Opcode = SW_ACTIVITY_REC_NOTIFY_ENABLED_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ else
+ {
+ Notification.Motenv_Evt_Opcode = SW_ACTIVITY_REC_NOTIFY_DISABLED_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ }
+
+ /* Carry Position char */
+ else if(attribute_modified->Attr_Handle == (aMotenvContext.SWCarryPositionCharHdle + 2U))
+ {
+ /**
+ * Descriptor handle
+ */
+ return_value = SVCCTL_EvtAckFlowEnable;
+ /**
+ * Notify to application
+ */
+ if(attribute_modified->Attr_Data[0] & COMSVC_Notification)
+ {
+ Notification.Motenv_Evt_Opcode = SW_CARRY_POSITION_NOTIFY_ENABLED_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ else
+ {
+ Notification.Motenv_Evt_Opcode = SW_CARRY_POSITION_NOTIFY_DISABLED_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ }
+
+ /* GestureRec char */
+ else if(attribute_modified->Attr_Handle == (aMotenvContext.SWGestureRecCharHdle + 2U))
+ {
+ /**
+ * Descriptor handle
+ */
+ return_value = SVCCTL_EvtAckFlowEnable;
+ /**
+ * Notify to application
+ */
+ if(attribute_modified->Attr_Data[0] & COMSVC_Notification)
+ {
+ Notification.Motenv_Evt_Opcode = SW_GESTURE_REC_NOTIFY_ENABLED_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ else
+ {
+ Notification.Motenv_Evt_Opcode = SW_GESTURE_REC_NOTIFY_DISABLED_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ }
+
+ /* Pedometer char */
+ else if(attribute_modified->Attr_Handle == (aMotenvContext.SWPedometerCharHdle + 2U))
+ {
+ /**
+ * Descriptor handle
+ */
+ return_value = SVCCTL_EvtAckFlowEnable;
+ /**
+ * Notify to application
+ */
+ if(attribute_modified->Attr_Data[0] & COMSVC_Notification)
+ {
+ Notification.Motenv_Evt_Opcode = SW_PEDOMETER_NOTIFY_ENABLED_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ else
+ {
+ Notification.Motenv_Evt_Opcode = SW_PEDOMETER_NOTIFY_DISABLED_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ }
+
+ /* IntensityDet char */
+ else if(attribute_modified->Attr_Handle == (aMotenvContext.SWIntensityDetCharHdle + 2U))
+ {
+ /**
+ * Descriptor handle
+ */
+ return_value = SVCCTL_EvtAckFlowEnable;
+ /**
+ * Notify to application
+ */
+ if(attribute_modified->Attr_Data[0] & COMSVC_Notification)
+ {
+ Notification.Motenv_Evt_Opcode = SW_INTENSITY_DET_NOTIFY_ENABLED_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ else
+ {
+ Notification.Motenv_Evt_Opcode = SW_INTENSITY_DET_NOTIFY_DISABLED_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ }
+
+ /* Configuration char */
+ else if(attribute_modified->Attr_Handle == (aMotenvContext.ConfigCharHdle + 2U))
+ {
+ /**
+ * Descriptor handle
+ */
+ return_value = SVCCTL_EvtAckFlowEnable;
+ /**
+ * Notify to application
+ */
+ if(attribute_modified->Attr_Data[0] & COMSVC_Notification)
+ {
+ Notification.Motenv_Evt_Opcode = CONFIG_NOTIFY_ENABLED_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ else
+ {
+ Notification.Motenv_Evt_Opcode = CONFIG_NOTIFY_DISABLED_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ }
+
+ /* Configuration char */
+ else if(attribute_modified->Attr_Handle == (aMotenvContext.ConfigCharHdle + 1U))
+ {
+ BLE_DBG_TEMPLATE_STM_MSG("-- GATT : WRITE CONFIG CHAR INFO RECEIVED\n");
+ Notification.Motenv_Evt_Opcode = CONFIG_WRITE_EVT;
+ Notification.DataTransfered.Length=attribute_modified->Attr_Data_Length;
+ Notification.DataTransfered.pPayload=attribute_modified->Attr_Data;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+
+ /* Console Term char */
+ else if(attribute_modified->Attr_Handle == (aMotenvContext.ConsoleTermCharHdle + 2U))
+ {
+ /**
+ * Descriptor handle
+ */
+ return_value = SVCCTL_EvtAckFlowEnable;
+ /**
+ * Notify to application
+ */
+ if(attribute_modified->Attr_Data[0] & COMSVC_Notification)
+ {
+ Notification.Motenv_Evt_Opcode = CONSOLE_TERM_NOTIFY_ENABLED_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ else
+ {
+ Notification.Motenv_Evt_Opcode = CONSOLE_TERM_NOTIFY_DISABLED_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ }
+
+ /* Console Stderr char */
+ else if(attribute_modified->Attr_Handle == (aMotenvContext.ConsoleStderrCharHdle + 2U))
+ {
+ /**
+ * Descriptor handle
+ */
+ return_value = SVCCTL_EvtAckFlowEnable;
+ /**
+ * Notify to application
+ */
+ if(attribute_modified->Attr_Data[0] & COMSVC_Notification)
+ {
+ Notification.Motenv_Evt_Opcode = CONSOLE_STDERR_NOTIFY_ENABLED_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ else
+ {
+ Notification.Motenv_Evt_Opcode = CONSOLE_STDERR_NOTIFY_DISABLED_EVT;
+ MOTENV_STM_App_Notification(&Notification);
+ }
+ }
+ else
+ {
+ /* do nothing */
+ }
+ break;
+ }
+
+ default:
+ break;
+ }
+ break; /* HCI_EVT_VENDOR_SPECIFIC */
+ }
+
+ default:
+ break;
+ }
+
+ return(return_value);
+}/* end Motenv_Event_Handler */
+
+
+/* Public functions ----------------------------------------------------------*/
+
+/**
+ * @brief Service initialization
+ * @param None
+ * @retval None
+ */
+void MOTENV_STM_Init(void)
+{
+ Char_UUID_t uuid16;
+
+ /**
+ * Register the event handler to the BLE controller
+ */
+ SVCCTL_RegisterSvcHandler(Motenv_Event_Handler);
+
+ /**
+ * Add HW Service
+ */
+ COPY_HW_SERVICE_UUID(uuid16.Char_UUID_128);
+ (void)aci_gatt_add_service(UUID_TYPE_128,
+ (Service_UUID_t *) &uuid16,
+ PRIMARY_SERVICE,
+ 1+(3*HW_CHAR_NUMBER), /*Max_Attribute_Records*/
+ &(aMotenvContext.HWSvcHdle));
+ /**
+ * Add Motion Characteristic for HW Service
+ */
+ COPY_HW_MOTION_CHAR_UUID(uuid16.Char_UUID_128);
+ (void)aci_gatt_add_char(aMotenvContext.HWSvcHdle,
+ UUID_TYPE_128, &uuid16,
+ MOTION_CHAR_LEN,
+ CHAR_PROP_NOTIFY,
+ ATTR_PERMISSION_NONE,
+ GATT_NOTIFY_READ_REQ_AND_WAIT_FOR_APPL_RESP, /* gattEvtMask */
+ 16, /* encryKeySize */
+ 0, /* isVariable: 1 */
+ &(aMotenvContext.HWMotionCharHdle));
+
+ /**
+ * Add Env Characteristic for HW Service
+ */
+ COPY_HW_ENV_CHAR_UUID(uuid16.Char_UUID_128);
+ (void)aci_gatt_add_char(aMotenvContext.HWSvcHdle,
+ UUID_TYPE_128, &uuid16,
+ ENV_CHAR_LEN,
+ CHAR_PROP_NOTIFY|CHAR_PROP_READ,
+ ATTR_PERMISSION_NONE,
+ GATT_NOTIFY_READ_REQ_AND_WAIT_FOR_APPL_RESP, /* gattEvtMask */
+ 16, /* encryKeySize */
+ 0, /* isVariable: 1 */
+ &(aMotenvContext.HWEnvCharHdle));
+
+ /**
+ * Add Acc Event Characteristic for HW Service
+ */
+ COPY_HW_ACC_EVENT_CHAR_UUID(uuid16.Char_UUID_128);
+ (void)aci_gatt_add_char(aMotenvContext.HWSvcHdle,
+ UUID_TYPE_128, &uuid16,
+ ACC_EVENT_CHAR_LEN,
+ CHAR_PROP_NOTIFY|CHAR_PROP_READ,
+ ATTR_PERMISSION_NONE,
+ GATT_NOTIFY_READ_REQ_AND_WAIT_FOR_APPL_RESP, /* gattEvtMask */
+ 16, /* encryKeySize */
+ 1, /* isVariable: 1 */
+ &(aMotenvContext.HWAccEventCharHdle));
+
+ /**
+ * Add SW Service
+ */
+ COPY_SW_SERVICE_UUID(uuid16.Char_UUID_128);
+ (void)aci_gatt_add_service(UUID_TYPE_128,
+ (Service_UUID_t *) &uuid16,
+ PRIMARY_SERVICE,
+ 1+(3*SW_CHAR_NUMBER), /*Max_Attribute_Records*/
+ &(aMotenvContext.SWSvcHdle));
+
+ /**
+ * Add Quaternions Characteristic for SW Service
+ */
+ COPY_SW_QUATERNIONS_CHAR_UUID(uuid16.Char_UUID_128);
+ (void)aci_gatt_add_char(aMotenvContext.SWSvcHdle,
+ UUID_TYPE_128, &uuid16,
+ QUATERNION_CHAR_LEN,
+ CHAR_PROP_NOTIFY,
+ ATTR_PERMISSION_NONE,
+ GATT_NOTIFY_READ_REQ_AND_WAIT_FOR_APPL_RESP, /* gattEvtMask */
+ 16, /* encryKeySize */
+ 0, /* isVariable: 1 */
+ &(aMotenvContext.SWQuaternionsCharHdle));
+
+ /**
+ * Add ECompass Characteristic for SW Service
+ */
+ COPY_SW_ECOMPASS_CHAR_UUID(uuid16.Char_UUID_128);
+ (void)aci_gatt_add_char(aMotenvContext.SWSvcHdle,
+ UUID_TYPE_128, &uuid16,
+ ECOMPASS_CHAR_LEN,
+ CHAR_PROP_NOTIFY,
+ ATTR_PERMISSION_NONE,
+ GATT_NOTIFY_READ_REQ_AND_WAIT_FOR_APPL_RESP, /* gattEvtMask */
+ 16, /* encryKeySize */
+ 0, /* isVariable: 1 */
+ &(aMotenvContext.SWECompassCharHdle));
+
+ /**
+ * Add Activity Rec Characteristic for SW Service
+ */
+ COPY_SW_ACTIVITY_REC_CHAR_UUID(uuid16.Char_UUID_128);
+ (void)aci_gatt_add_char(aMotenvContext.SWSvcHdle,
+ UUID_TYPE_128, &uuid16,
+ ACTIVITY_REC_CHAR_LEN,
+ CHAR_PROP_NOTIFY | CHAR_PROP_READ,
+ ATTR_PERMISSION_NONE,
+ GATT_NOTIFY_READ_REQ_AND_WAIT_FOR_APPL_RESP, /* gattEvtMask */
+ 16, /* encryKeySize */
+ 0, /* isVariable: 1 */
+ &(aMotenvContext.SWActivityRecCharHdle));
+
+ /**
+ * Add Carry Position Characteristic for SW Service
+ */
+ COPY_SW_CARRY_POSITION_CHAR_UUID(uuid16.Char_UUID_128);
+ (void)aci_gatt_add_char(aMotenvContext.SWSvcHdle,
+ UUID_TYPE_128, &uuid16,
+ CARRY_POSITION_CHAR_LEN,
+ CHAR_PROP_NOTIFY | CHAR_PROP_READ,
+ ATTR_PERMISSION_NONE,
+ GATT_NOTIFY_READ_REQ_AND_WAIT_FOR_APPL_RESP, /* gattEvtMask */
+ 16, /* encryKeySize */
+ 0, /* isVariable: 1 */
+ &(aMotenvContext.SWCarryPositionCharHdle));
+
+ /**
+ * Add Gesture Rec Characteristic for SW Service
+ */
+ COPY_SW_GESTURE_REC_CHAR_UUID(uuid16.Char_UUID_128);
+ (void)aci_gatt_add_char(aMotenvContext.SWSvcHdle,
+ UUID_TYPE_128, &uuid16,
+ GESTURE_REC_CHAR_LEN,
+ CHAR_PROP_NOTIFY | CHAR_PROP_READ,
+ ATTR_PERMISSION_NONE,
+ GATT_NOTIFY_READ_REQ_AND_WAIT_FOR_APPL_RESP, /* gattEvtMask */
+ 16, /* encryKeySize */
+ 0, /* isVariable: 1 */
+ &(aMotenvContext.SWGestureRecCharHdle));
+
+ /**
+ * Add Pedometer Characteristic for SW Service
+ */
+ COPY_SW_PEDOMETER_CHAR_UUID(uuid16.Char_UUID_128);
+ (void)aci_gatt_add_char(aMotenvContext.SWSvcHdle,
+ UUID_TYPE_128, &uuid16,
+ PEDOMETER_CHAR_LEN,
+ CHAR_PROP_NOTIFY | CHAR_PROP_READ,
+ ATTR_PERMISSION_NONE,
+ GATT_NOTIFY_READ_REQ_AND_WAIT_FOR_APPL_RESP, /* gattEvtMask */
+ 16, /* encryKeySize */
+ 0, /* isVariable: 1 */
+ &(aMotenvContext.SWPedometerCharHdle));
+
+ /**
+ * Add IntensityDet Characteristic for SW Service
+ */
+ COPY_SW_INTENSITY_DET_CHAR_UUID(uuid16.Char_UUID_128);
+ (void)aci_gatt_add_char(aMotenvContext.SWSvcHdle,
+ UUID_TYPE_128, &uuid16,
+ INTENSITY_DET_CHAR_LEN,
+ CHAR_PROP_NOTIFY,
+ ATTR_PERMISSION_NONE,
+ GATT_NOTIFY_READ_REQ_AND_WAIT_FOR_APPL_RESP, /* gattEvtMask */
+ 16, /* encryKeySize */
+ 0, /* isVariable: 1 */
+ &(aMotenvContext.SWIntensityDetCharHdle));
+
+ /**
+ * Add Config Service
+ */
+ COPY_CONFIG_SERVICE_UUID(uuid16.Char_UUID_128);
+ (void)aci_gatt_add_service(UUID_TYPE_128,
+ (Service_UUID_t *) &uuid16,
+ PRIMARY_SERVICE,
+ 1+(3*CONFIG_CHAR_NUMBER), /*Max_Attribute_Records*/
+ &(aMotenvContext.ConfigSvcHdle));
+
+ /**
+ * Add Config Characteristic for Config Service
+ */
+ COPY_CONFIG_CHAR_UUID(uuid16.Char_UUID_128);
+ (void)aci_gatt_add_char(aMotenvContext.ConfigSvcHdle,
+ UUID_TYPE_128, &uuid16,
+ CONFIG_CHAR_LEN,
+ CHAR_PROP_NOTIFY | CHAR_PROP_WRITE_WITHOUT_RESP,
+ ATTR_PERMISSION_NONE,
+ GATT_NOTIFY_ATTRIBUTE_WRITE | GATT_NOTIFY_READ_REQ_AND_WAIT_FOR_APPL_RESP, /* gattEvtMask */
+ 16, /* encryKeySize */
+ 0, /* isVariable: 1 */
+ &(aMotenvContext.ConfigCharHdle));
+
+ /**
+ * Add Console Service
+ */
+ COPY_CONSOLE_SERVICE_UUID(uuid16.Char_UUID_128);
+ (void)aci_gatt_add_service(UUID_TYPE_128,
+ (Service_UUID_t *) &uuid16,
+ PRIMARY_SERVICE,
+ 1+(3*CONSOLE_CHAR_NUMBER), /*Max_Attribute_Records*/
+ &(aMotenvContext.ConsoleSvcHdle));
+ /**
+ * Add Cosole Term Characteristic for Config Service
+ */
+ COPY_TERM_CHAR_UUID(uuid16.Char_UUID_128);
+ (void)aci_gatt_add_char(aMotenvContext.ConsoleSvcHdle,
+ UUID_TYPE_128, &uuid16,
+ CONSOLE_CHAR_LEN,
+ CHAR_PROP_NOTIFY | CHAR_PROP_WRITE_WITHOUT_RESP | CHAR_PROP_WRITE | CHAR_PROP_READ,
+ ATTR_PERMISSION_NONE,
+ GATT_NOTIFY_ATTRIBUTE_WRITE | GATT_NOTIFY_READ_REQ_AND_WAIT_FOR_APPL_RESP, /* gattEvtMask */
+ 16, /* encryKeySize */
+ 1, /* isVariable: 1 */
+ &(aMotenvContext.ConsoleTermCharHdle));
+ /**
+ * Add Console Stderr Characteristic for Config Service
+ */
+ COPY_STDERR_CHAR_UUID(uuid16.Char_UUID_128);
+ (void)aci_gatt_add_char(aMotenvContext.ConsoleSvcHdle,
+ UUID_TYPE_128, &uuid16,
+ CONSOLE_CHAR_LEN,
+ CHAR_PROP_NOTIFY | CHAR_PROP_READ,
+ ATTR_PERMISSION_NONE,
+ GATT_NOTIFY_READ_REQ_AND_WAIT_FOR_APPL_RESP, /* gattEvtMask */
+ 16, /* encryKeySize */
+ 1, /* isVariable: 1 */
+ &(aMotenvContext.ConsoleStderrCharHdle));
+
+ return;
+} /* end MOTENV_STM_Init */
+
+/**
+ * @brief Characteristic update
+ * @param UUID: UUID of the characteristic
+ * @param payloadLen: Length of the char value to be notified
+ * @param pPayload: Char value to be notified
+ * @retval BLE status
+ */
+tBleStatus MOTENV_STM_App_Update_Char(uint16_t UUID, uint8_t payloadLen, uint8_t *pPayload)
+{
+ tBleStatus result = BLE_STATUS_INVALID_PARAMS;
+ switch(UUID)
+ {
+ case ENV_CHAR_UUID:
+
+ result = aci_gatt_update_char_value(aMotenvContext.HWSvcHdle,
+ aMotenvContext.HWEnvCharHdle,
+ 0, /* charValOffset */
+ payloadLen, /* charValueLen */
+ pPayload);
+
+ break;
+
+ case MOTION_CHAR_UUID:
+
+ result = aci_gatt_update_char_value(aMotenvContext.HWSvcHdle,
+ aMotenvContext.HWMotionCharHdle,
+ 0, /* charValOffset */
+ payloadLen, /* charValueLen */
+ pPayload);
+
+ break;
+
+ case ACC_EVENT_CHAR_UUID:
+
+ result = aci_gatt_update_char_value(aMotenvContext.HWSvcHdle,
+ aMotenvContext.HWAccEventCharHdle,
+ 0, /* charValOffset */
+ payloadLen, /* charValueLen */
+ pPayload);
+
+ break;
+
+ case MOTION_FX_CHAR_UUID:
+
+ result = aci_gatt_update_char_value(aMotenvContext.SWSvcHdle,
+ aMotenvContext.SWQuaternionsCharHdle,
+ 0, /* charValOffset */
+ payloadLen, /* charValueLen */
+ pPayload);
+ break;
+
+ case ECOMPASS_CHAR_UUID:
+
+ result = aci_gatt_update_char_value(aMotenvContext.SWSvcHdle,
+ aMotenvContext.SWECompassCharHdle,
+ 0, /* charValOffset */
+ payloadLen, /* charValueLen */
+ pPayload);
+ break;
+
+ case ACTIVITY_REC_CHAR_UUID:
+
+ result = aci_gatt_update_char_value(aMotenvContext.SWSvcHdle,
+ aMotenvContext.SWActivityRecCharHdle,
+ 0, /* charValOffset */
+ payloadLen, /* charValueLen */
+ pPayload);
+ break;
+
+ case CARRY_POSITION_CHAR_UUID:
+
+ result = aci_gatt_update_char_value(aMotenvContext.SWSvcHdle,
+ aMotenvContext.SWCarryPositionCharHdle,
+ 0, /* charValOffset */
+ payloadLen, /* charValueLen */
+ pPayload);
+ break;
+
+ case GESTURE_REC_CHAR_UUID:
+
+ result = aci_gatt_update_char_value(aMotenvContext.SWSvcHdle,
+ aMotenvContext.SWGestureRecCharHdle,
+ 0, /* charValOffset */
+ payloadLen, /* charValueLen */
+ pPayload);
+ break;
+
+ case PEDOMETER_CHAR_UUID:
+
+ result = aci_gatt_update_char_value(aMotenvContext.SWSvcHdle,
+ aMotenvContext.SWPedometerCharHdle,
+ 0, /* charValOffset */
+ payloadLen, /* charValueLen */
+ pPayload);
+ break;
+
+ case INTENSITY_DET_CHAR_UUID:
+
+ result = aci_gatt_update_char_value(aMotenvContext.SWSvcHdle,
+ aMotenvContext.SWIntensityDetCharHdle,
+ 0, /* charValOffset */
+ payloadLen, /* charValueLen */
+ pPayload);
+ break;
+
+ case CONFIG_CHAR_UUID:
+
+ result = aci_gatt_update_char_value(aMotenvContext.ConfigSvcHdle,
+ aMotenvContext.ConfigCharHdle,
+ 0, /* charValOffset */
+ payloadLen, /* charValueLen */
+ pPayload);
+ break;
+
+ case CONSOLE_TERM_CHAR_UUID:
+
+ result = aci_gatt_update_char_value(aMotenvContext.ConsoleSvcHdle,
+ aMotenvContext.ConsoleTermCharHdle,
+ 0, /* charValOffset */
+ payloadLen, /* charValueLen */
+ pPayload);
+ break;
+
+ case CONSOLE_STDERR_CHAR_UUID:
+
+ result = aci_gatt_update_char_value(aMotenvContext.ConsoleSvcHdle,
+ aMotenvContext.ConsoleStderrCharHdle,
+ 0, /* charValOffset */
+ payloadLen, /* charValueLen */
+ pPayload);
+ break;
+
+ default:
+ break;
+ }
+
+ return result;
+}
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Middlewares/ST/STM32_WPAN/ble/svc/Src/opus_interface_stm.c b/Middlewares/ST/STM32_WPAN/ble/svc/Src/opus_interface_stm.c
new file mode 100644
index 000000000..4427b0658
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/ble/svc/Src/opus_interface_stm.c
@@ -0,0 +1,374 @@
+/**
+ ******************************************************************************
+ * @file opus_interface_stm.c
+ * @author SRA-A&SP
+ * @version V1.0.0
+ * @date 08-May-2019
+ * @brief This file contains definitions for the opus interface.
+ ******************************************************************************
+* @attention
+ *
+ * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * 3. Neither the name of STMicroelectronics nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "opus_interface_stm.h"
+
+/**
+ * @brief Opus_HandleTypeDef structure definition
+ */
+typedef struct
+{
+ uint16_t ENC_frame_size; /*!< Specifies the encoder frame size. */
+
+ uint16_t DEC_frame_size; /*!< Specifies the decoder frame size. */
+
+ uint16_t max_enc_frame_size; /*!< Specifies the maximum size of the encoder frame. */
+
+ OpusEncoder *Encoder; /*!< Opus encoder. */
+
+ uint8_t ENC_configured; /*!< Specifies if the Encoder is configured. */
+
+ OpusDecoder *Decoder; /*!< Opus decoder. */
+
+ uint8_t DEC_configured; /*!< Specifies if the Decoder is configured. */
+
+} OPUS_IF_Codec_HandleTypeDef;
+
+
+static OPUS_IF_Codec_HandleTypeDef hOpus;
+
+
+/**
+ * @brief Encoder initialization.
+ * @param ENC_configOpus: Opus encoder configuration.
+ * @param opus_err: @ref opus_errorcodes
+ * @retval OPUS_IF_Status: Value indicating success or error (in case of error check opus_err).
+ */
+OPUS_IF_Status OPUS_IF_ENC_Init(OPUS_IF_ENC_ConfigTypeDef *ENC_configOpus, int *opus_err)
+{
+ if((ENC_configOpus->application!=OPUS_APPLICATION_VOIP) &&
+ (ENC_configOpus->application!=OPUS_APPLICATION_AUDIO) &&
+ (ENC_configOpus->application!=OPUS_APPLICATION_RESTRICTED_LOWDELAY))
+ {
+ return OPUS_IF_INVALID_PARAM;
+ }
+ if((ENC_configOpus->bitrate<6000) || (ENC_configOpus->bitrate>510000))
+ {
+ return OPUS_IF_INVALID_PARAM;
+ }
+ if(ENC_configOpus->complexity>10)
+ {
+ return OPUS_IF_INVALID_PARAM;
+ }
+ if(ENC_configOpus->channels==0)
+ {
+ return OPUS_IF_INVALID_PARAM;
+ }
+ if((ENC_configOpus->ms_frame!=2.5f) &&
+ (ENC_configOpus->ms_frame!=5.0f) &&
+ (ENC_configOpus->ms_frame!=10.0f) &&
+ (ENC_configOpus->ms_frame!=20.0f) &&
+ (ENC_configOpus->ms_frame!=40.0f) &&
+ (ENC_configOpus->ms_frame!=60.0f))
+ {
+ return OPUS_IF_INVALID_PARAM;
+ }
+ if((ENC_configOpus->sample_freq!=8000) &&
+ (ENC_configOpus->sample_freq!=12000) &&
+ (ENC_configOpus->sample_freq!=16000) &&
+ (ENC_configOpus->sample_freq!=24000) &&
+ (ENC_configOpus->sample_freq!=48000))
+ {
+ return OPUS_IF_INVALID_PARAM;
+ }
+
+ hOpus.ENC_frame_size = (uint16_t)(((float)(ENC_configOpus->sample_freq/1000))*ENC_configOpus->ms_frame);
+
+ hOpus.max_enc_frame_size = (ENC_configOpus->bitrate/8/((uint16_t)(1000.0f/ENC_configOpus->ms_frame)))*4;
+
+ *opus_err = 0;
+ OPUS_IF_Status status;
+
+ hOpus.Encoder = opus_encoder_create(ENC_configOpus->sample_freq, ENC_configOpus->channels, ENC_configOpus->application, opus_err);
+
+ if (*opus_err != OPUS_OK)
+ {
+ return OPUS_IF_ERROR;
+ }
+
+ status = OPUS_IF_ENC_Set_Bitrate(ENC_configOpus, ENC_configOpus->bitrate, opus_err);
+ if (status != OPUS_IF_SUCCESS)
+ {
+ return OPUS_IF_ERROR;
+ }
+
+ status = OPUS_IF_ENC_Set_Complexity(ENC_configOpus, ENC_configOpus->complexity, opus_err);
+ if (status != OPUS_IF_SUCCESS)
+ {
+ return OPUS_IF_ERROR;
+ }
+
+ hOpus.ENC_configured = 1;
+
+ return OPUS_IF_SUCCESS;
+}
+
+/**
+ * @brief Encoder deinit function.
+ * @param None.
+ * @retval None.
+ */
+void OPUS_IF_ENC_Deinit(void)
+{
+ opus_encoder_destroy(hOpus.Encoder);
+ hOpus.ENC_configured = 0;
+ hOpus.ENC_frame_size = 0;
+ hOpus.max_enc_frame_size = 0;
+}
+
+/**
+ * @brief This function returns if the the Opus Encoder is configured.
+ * @param None.
+ * @retval uint8_t: 1 if the Encoder is configured 0 otherwise.
+ */
+uint8_t OPUS_IF_ENC_IsConfigured(void)
+{
+ return hOpus.ENC_configured;
+}
+
+/**
+ * @brief Decoder initialization.
+ * @param DEC_configOpus: Opus decoder configuration.
+ * @param opus_err: @ref opus_errorcodes
+ * @retval OPUS_IF_Status: Value indicating success or error (in case of error check opus_err).
+ */
+OPUS_IF_Status OPUS_IF_DEC_Init(OPUS_IF_DEC_ConfigTypeDef *DEC_configOpus, int *opus_err)
+{
+ if((DEC_configOpus->bitrate<6000) || (DEC_configOpus->bitrate>510000))
+ {
+ return OPUS_IF_INVALID_PARAM;
+ }
+ if(DEC_configOpus->channels==0)
+ {
+ return OPUS_IF_INVALID_PARAM;
+ }
+ if((DEC_configOpus->ms_frame!=2.5f) &&
+ (DEC_configOpus->ms_frame!=5.0f) &&
+ (DEC_configOpus->ms_frame!=10.0f) &&
+ (DEC_configOpus->ms_frame!=20.0f) &&
+ (DEC_configOpus->ms_frame!=40.0f) &&
+ (DEC_configOpus->ms_frame!=60.0f))
+ {
+ return OPUS_IF_INVALID_PARAM;
+ }
+ if((DEC_configOpus->sample_freq!=8000) &&
+ (DEC_configOpus->sample_freq!=12000) &&
+ (DEC_configOpus->sample_freq!=16000) &&
+ (DEC_configOpus->sample_freq!=24000) &&
+ (DEC_configOpus->sample_freq!=48000))
+ {
+ return OPUS_IF_INVALID_PARAM;
+ }
+
+ hOpus.DEC_frame_size = (uint16_t)(((float)(DEC_configOpus->sample_freq/1000))*DEC_configOpus->ms_frame);
+
+ hOpus.Decoder = opus_decoder_create(DEC_configOpus->sample_freq, DEC_configOpus->channels, opus_err);
+
+ if (*opus_err != OPUS_OK)
+ {
+ return OPUS_IF_ERROR;
+ }
+
+ hOpus.DEC_configured = 1;
+
+ return OPUS_IF_SUCCESS;
+}
+
+/**
+ * @brief Decoder deinit function.
+ * @param None.
+ * @retval None.
+ */
+void OPUS_IF_DEC_Deinit(void)
+{
+ opus_decoder_destroy(hOpus.Decoder);
+ hOpus.DEC_configured = 0;
+ hOpus.DEC_frame_size = 0;
+}
+
+/**
+ * @brief This function returns if the the Opus Decoder is configured.
+ * @param None.
+ * @retval uint8_t: 1 if the Decoder is configured 0 otherwise.
+ */
+uint8_t OPUS_IF_DEC_IsConfigured(void)
+{
+ return hOpus.DEC_configured;
+}
+
+/**
+ * @brief Set bitrate to be used for encoding
+ * @param ENC_configOpus: Opus encoder configuration.
+ * @param bitrate: Indicate the bitrate in bit per second.
+ * @param opus_err: @ref opus_errorcodes.
+ * @retval OPUS_IF_Status: Value indicating success or error (in case of error check opus_err).
+ */
+OPUS_IF_Status OPUS_IF_ENC_Set_Bitrate(OPUS_IF_ENC_ConfigTypeDef *ENC_configOpus, int bitrate, int *opus_err)
+{
+ if((bitrate<6000) || (bitrate>510000))
+ {
+ return OPUS_IF_INVALID_PARAM;
+ }
+
+ *opus_err = opus_encoder_ctl(hOpus.Encoder, OPUS_SET_BITRATE(bitrate));
+ if (*opus_err != OPUS_OK)
+ {
+ return OPUS_IF_ERROR;
+ }
+
+ ENC_configOpus->bitrate = bitrate;
+
+ return OPUS_IF_SUCCESS;
+}
+
+/**
+ * @brief Set constant bitrate option for the encoder.
+ * @param None.
+ * @retval OPUS_IF_Status: Value indicating success or error.
+ */
+OPUS_IF_Status OPUS_IF_ENC_Set_CBR(void)
+{
+ int err = opus_encoder_ctl(hOpus.Encoder, OPUS_SET_VBR(0));
+ if (err != OPUS_OK)
+ {
+ return OPUS_IF_ERROR;
+ }
+
+ return OPUS_IF_SUCCESS;
+}
+
+/**
+ * @brief Set variable bitrate option for the encoder.
+ * @param None.
+ * @retval OPUS_IF_Status: Value indicating success or error.
+ */
+OPUS_IF_Status OPUS_IF_ENC_Set_VBR(void)
+{
+ int err = opus_encoder_ctl(hOpus.Encoder, OPUS_SET_VBR(1));
+ if (err != OPUS_OK)
+ {
+ return OPUS_IF_ERROR;
+ }
+
+ return OPUS_IF_SUCCESS;
+}
+
+/**
+ * @brief Set complexity to be used for encoding
+ * @param ENC_configOpus: Opus encoder configuration.
+ * @param complexity: value from o to 10.
+ * @param opus_err: @ref opus_errorcodes.
+ * @retval OPUS_IF_Status: Value indicating success or error (in case of error check opus_err).
+ */
+OPUS_IF_Status OPUS_IF_ENC_Set_Complexity(OPUS_IF_ENC_ConfigTypeDef *ENC_configOpus, int complexity, int *opus_err)
+{
+ if(complexity>10)
+ {
+ return OPUS_IF_INVALID_PARAM;
+ }
+
+ *opus_err = opus_encoder_ctl(hOpus.Encoder, OPUS_SET_COMPLEXITY(complexity));
+
+ if (*opus_err != OPUS_OK)
+ {
+ return OPUS_IF_ERROR;
+ }
+
+ ENC_configOpus->complexity = complexity;
+
+ return OPUS_IF_SUCCESS;
+}
+
+/**
+ * @brief Force the encoder to use only SILK
+ * @param None.
+ * @retval OPUS_IF_Status: Value indicating success or error.
+ */
+OPUS_IF_Status OPUS_IF_ENC_Force_SILKmode(void)
+{
+ int err = opus_encoder_ctl(hOpus.Encoder, OPUS_SET_FORCE_MODE(MODE_SILK_ONLY));
+
+ if (err != OPUS_OK)
+ {
+ return OPUS_IF_ERROR;
+ }
+
+ return OPUS_IF_SUCCESS;
+}
+
+/**
+ * @brief Force the encoder to use only CELT.
+ * @param None.
+ * @retval OPUS_IF_Status: Value indicating success or error.
+ */
+OPUS_IF_Status OPUS_IF_ENC_Force_CELTmode(void)
+{
+ int err = opus_encoder_ctl(hOpus.Encoder, OPUS_SET_FORCE_MODE(MODE_CELT_ONLY));
+
+ if (err != OPUS_OK)
+ {
+ return OPUS_IF_ERROR;
+ }
+
+ return OPUS_IF_SUCCESS;
+}
+
+/**
+ * @brief Encoding functions.
+ * @param buf_in: pointer to the PCM buffer to be encoded.
+ * @param buf_out: pointer to the Encoded buffer.
+ * @retval Number of bytes in case of success, 0 viceversa.
+ */
+int OPUS_IF_ENC_Encode(uint8_t * buf_in, uint8_t * buf_out)
+{
+ return opus_encode(hOpus.Encoder, (opus_int16 *) buf_in, hOpus.ENC_frame_size, (unsigned char *) buf_out, (opus_int32) hOpus.max_enc_frame_size);
+}
+
+/**
+ * @brief Decoding functions.
+ * @param buf_in: pointer to the Encoded buffer to be decoded.
+ * @param len: length of the buffer in.
+ * @param buf_out: pointer to the Decoded buffer.
+ * @retval Number of decoded samples or @ref opus_errorcodes.
+ */
+int OPUS_IF_DEC_Decode(uint8_t * buf_in, uint32_t len, uint8_t * buf_out)
+{
+ return opus_decode(hOpus.Decoder, (unsigned char *) buf_in, (opus_int32) len, (opus_int16 *) buf_out, hOpus.DEC_frame_size, 0);
+}
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Middlewares/ST/STM32_WPAN/ble/svc/Src/svc_ctl.c b/Middlewares/ST/STM32_WPAN/ble/svc/Src/svc_ctl.c
index c1ef453e6..1b9aeaeb0 100644
--- a/Middlewares/ST/STM32_WPAN/ble/svc/Src/svc_ctl.c
+++ b/Middlewares/ST/STM32_WPAN/ble/svc/Src/svc_ctl.c
@@ -58,6 +58,8 @@ PLACE_IN_SECTION("BLE_DRIVER_CONTEXT") SVCCTL_CltHandler_t SVCCTL_CltHandler;
/* Private functions ----------------------------------------------------------*/
/* Weak functions ----------------------------------------------------------*/
+void BVOPUS_STM_Init(void);
+
__weak void BLS_Init( void )
{
return;
@@ -98,6 +100,10 @@ __weak void TPS_Init( void )
{
return;
}
+__weak void MOTENV_STM_Init( void )
+{
+ return;
+}
__weak void P2PS_STM_Init( void )
{
return;
@@ -110,6 +116,10 @@ __weak void MESH_Init( void )
{
return;
}
+__weak void BVOPUS_STM_Init( void )
+{
+ return;
+}
__weak void SVCCTL_InitCustomSvc( void )
{
return;
@@ -129,7 +139,13 @@ void SVCCTL_Init( void )
/**
* Add and Initialize requested services
*/
+ SVCCTL_SvcInit();
+ return;
+}
+
+__weak void SVCCTL_SvcInit(void)
+{
BLS_Init();
CRS_STM_Init();
@@ -150,14 +166,18 @@ void SVCCTL_Init( void )
TPS_Init();
+ MOTENV_STM_Init();
+
P2PS_STM_Init();
OTAS_STM_Init();
-
- SVCCTL_InitCustomSvc();
+ BVOPUS_STM_Init();
+
MESH_Init();
+ SVCCTL_InitCustomSvc();
+
return;
}
diff --git a/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/hw.h b/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/hw.h
index 718f523fd..efcfd5010 100644
--- a/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/hw.h
+++ b/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/hw.h
@@ -6,11 +6,11 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
- * the "License"; You may not use this file except in compliance with the
+ * the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
@@ -27,241 +27,6 @@ extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
-#include "stm32wbxx.h"
-#include "stm32wbxx_ll_exti.h"
-#include "stm32wbxx_ll_system.h"
-#include "stm32wbxx_ll_rcc.h"
-#include "stm32wbxx_ll_ipcc.h"
-#include "stm32wbxx_ll_bus.h"
-#include "stm32wbxx_ll_pwr.h"
-#include "stm32wbxx_ll_cortex.h"
-#include "stm32wbxx_ll_utils.h"
-#include "stm32wbxx_ll_hsem.h"
-#include "stm32wbxx_ll_gpio.h"
-
-
-#ifdef USE_STM32WBXX_USB_DONGLE
-#include "stm32wbxx_usb_dongle.h"
-#endif
-#ifdef USE_STM32WBXX_NUCLEO
-#include "stm32wbxx_nucleo.h"
-#endif
-#ifdef USE_X_NUCLEO_EPD
-#include "x_nucleo_epd.h"
-#endif
-
- /******************************************************************************
- * HW LOW POWER
- ******************************************************************************/
- /**
- * Stop Mode configuration
- * The values of enum shall be kept unchanged
- */
- typedef enum
- {
- hw_lpm_stopmode0,
- hw_lpm_stopmode1,
- hw_lpm_stopmode2,
- } HW_LPM_StopModeConf_t;
-
- /**
- * Off Mode configuration
- * The values of enum shall be kept unchanged
- */
- typedef enum
- {
- hw_lpm_standby,
- hw_lpm_shutdown,
- } HW_LPM_OffModeConf_t;
-
- void HW_LPM_SleepMode(void);
- void HW_LPM_StopMode(HW_LPM_StopModeConf_t configuration);
- void HW_LPM_OffMode(HW_LPM_OffModeConf_t configuration);
-
- /******************************************************************************
- * HW UART
- ******************************************************************************/
- typedef enum
- {
- hw_uart1,
- hw_uart2,
- hw_lpuart1,
- } hw_uart_id_t;
-
- typedef enum
- {
- hw_uart_ok,
- hw_uart_error,
- hw_uart_busy,
- hw_uart_to,
- } hw_status_t;
-
- void HW_UART_Init(hw_uart_id_t hw_uart_id);
- void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
- void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
- hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
- hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
- void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
- void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
-
- /******************************************************************************
- * HW TimerServer
- ******************************************************************************/
- /* Exported types ------------------------------------------------------------*/
- /**
- * This setting is used when standby mode is supported.
- * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
- * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
- * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
- */
- typedef enum
- {
- hw_ts_InitMode_Full,
- hw_ts_InitMode_Limited,
- } HW_TS_InitMode_t;
-
- /**
- * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
- * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
- *
- * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
- */
- typedef enum
- {
- hw_ts_SingleShot,
- hw_ts_Repeated
- } HW_TS_Mode_t;
-
- /**
- * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
- * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
- * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
- */
- typedef enum
- {
- hw_ts_Successful,
- hw_ts_Failed,
- }HW_TS_ReturnStatus_t;
-
- typedef void (*HW_TS_pTimerCb_t)(void);
-
- /**
- * @brief Initialize the timer server
- * This API shall be called by the application before any timer is requested to the timer server. It
- * configures the RTC module to be connected to the LSI input clock.
- *
- * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
- * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
- * @param hrtc: RTC Handle
- * @retval None
- */
- void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
-
- /**
- * @brief Interface to create a virtual timer
- * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
- * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
- * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
- * which module is concerned. In return, the user gets a timer ID to handle it.
- *
- * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
- * identification of the requester
- * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
- * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
- * @param pTimerCallBack: Callback when the virtual timer expires
- * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
- */
- HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
-
- /**
- * @brief Stop a virtual timer
- * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
- * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
- * Nothing is done when it is called to stop a timer which has been already stopped
- *
- * @param TimerID: Id of the timer to stop
- * @retval None
- */
- void HW_TS_Stop(uint8_t TimerID);
-
- /**
- * @brief Start a virtual timer
- * This API shall be used to start a timer. The timeout value is specified and may be different each time.
- * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
- * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
- * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
- * This API shall not be called on a running timer.
- *
- * @param TimerID: The ID Id of the timer to start
- * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
- * @retval None
- */
- void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
-
- /**
- * @brief Delete a virtual timer from the list
- * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
- * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
- * creation of a new timer if required and may get a different timer id
- *
- * @param TimerID: The ID of the timer to remove from the list
- * @retval None
- */
- void HW_TS_Delete(uint8_t TimerID);
-
- /**
- * @brief Schedule the timer list on the timer interrupt handler
- * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
- * care of clearing all status flag required in the RTC and EXTI peripherals
- *
- * @param None
- * @retval None
- */
- void HW_TS_RTC_Wakeup_Handler(void);
-
- /**
- * @brief Return the number of ticks to count before the interrupt
- * This API returns the number of ticks left to be counted before an interrupt is generated by the
- * Timer Server. This API may be used by the application for power management optimization. When the system
- * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
- * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
- * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
- * versus time in low power mode is implementation specific
- * When the timer is disabled (No timer in the list), it returns 0xFFFF
- *
- * @param None
- * @retval The number of ticks left to count
- */
- uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
-
- /**
- * @brief Notify the application that a registered timer has expired
- * This API shall be implemented by the user application.
- * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
- * context. The application may implement an Operating System to change the context priority where the timer
- * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
- * sending the information to the correct task
- *
- * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
- * @param TimerID: The TimerID of the expired timer
- * @param pTimerCallBack: The Callback associated with the timer when it has been created
- * @retval None
- */
- void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
-
- /**
- * @brief Notify the application that the wakeupcounter has been updated
- * This API should be implemented by the user application
- * This API notifies the application that the counter has been updated. This is expected to be used along
- * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
- * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
- * provides a way to the application to solve that race condition to reevaluate the counter value before
- * entering low power mode
- *
- * @param None
- * @retval None
- */
- void HW_TS_RTC_CountUpdated_AppNot(void);
/******************************************************************************
* HW IPCC
@@ -293,6 +58,12 @@ extern "C" {
void HW_IPCC_THREAD_CliSendAck( void );
void HW_IPCC_THREAD_CliEvtNot( void );
+ void HW_IPCC_LLDTESTS_Init( void );
+ void HW_IPCC_LLDTESTS_CliSendCmd( void );
+ void HW_IPCC_LLDTESTS_EvtNot( void );
+ void HW_IPCC_LLDTESTS_CliSendAck( void );
+ void HW_IPCC_LLDTESTS_CliEvtNot( void );
+
void HW_IPCC_TRACES_Init( void );
void HW_IPCC_TRACES_EvtNot( void );
@@ -309,6 +80,8 @@ extern "C" {
void HW_IPCC_ZIGBEE_AppliAsyncEvtNotification(void);
void HW_IPCC_ZIGBEE_SendAppliCmdAck(void);
+ void HW_IPCC_ZIGBEE_AppliAsyncLoggingNotification( void );
+ void HW_IPCC_ZIGBEE_SendLoggingAck(void);
#ifdef __cplusplus
diff --git a/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci/shci.c b/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci/shci.c
index 2d9fc42fc..0247fe8a7 100644
--- a/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci/shci.c
+++ b/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci/shci.c
@@ -23,8 +23,6 @@
#include "shci_tl.h"
#include "shci.h"
-#include "mbox_def.h"
-#include "stm32wb55xx.h"
#include "stm32wbxx.h"
/* Private typedef -----------------------------------------------------------*/
@@ -282,6 +280,24 @@ SHCI_CmdStatus_t SHCI_C2_THREAD_Init( void )
return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
}
+SHCI_CmdStatus_t SHCI_C2_LLDTESTS_Init( uint8_t param_size, uint8_t * p_param )
+{
+ /**
+ * Buffer is large enough to hold command complete without payload
+ */
+ uint8_t local_buffer[TL_BLEEVT_CS_BUFFER_SIZE];
+ TL_EvtPacket_t * p_rsp;
+
+ p_rsp = (TL_EvtPacket_t *)local_buffer;
+
+ shci_send( SHCI_OPCODE_C2_LLD_TESTS_INIT,
+ param_size,
+ p_param,
+ p_rsp );
+
+ return (SHCI_CmdStatus_t)(((TL_CcEvt_t*)(p_rsp->evtserial.evt.payload))->payload[0]);
+}
+
SHCI_CmdStatus_t SHCI_C2_ZIGBEE_Init( void )
{
/**
diff --git a/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci/shci.h b/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci/shci.h
index e9d50b516..65f48cc62 100644
--- a/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci/shci.h
+++ b/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci/shci.h
@@ -134,7 +134,8 @@ extern "C" {
SHCI_OCF_C2_RADIO_ALLOW_LOW_POWER,
SHCI_OCF_C2_MAC_802_15_4_INIT,
SHCI_OCF_C2_REINIT,
- SHCI_OCF_C2_ZIGBEE_INIT
+ SHCI_OCF_C2_ZIGBEE_INIT,
+ SHCI_OCF_C2_LLD_TESTS_INIT
} SHCI_OCF_t;
#define SHCI_OPCODE_C2_FUS_GET_STATE (( SHCI_OGF << 10) + SHCI_OCF_C2_FUS_GET_STATE)
@@ -195,7 +196,7 @@ extern "C" {
typedef PACKED_STRUCT{
uint8_t KeyType;
uint8_t KeySize;
- uint8_t KeyData[32];
+ uint8_t KeyData[32 + 12];
} SHCI_C2_FUS_StoreUsrKey_Cmd_Param_t;
/** Response parameters*/
@@ -345,6 +346,8 @@ extern "C" {
#define SHCI_OPCODE_C2_ZIGBEE_INIT (( SHCI_OGF << 10) + SHCI_OCF_C2_ZIGBEE_INIT)
+#define SHCI_OPCODE_C2_LLD_TESTS_INIT (( SHCI_OGF << 10) + SHCI_OCF_C2_LLD_TESTS_INIT)
+
/* Exported type --------------------------------------------------------*/
typedef MB_WirelessFwInfoTable_t SHCI_WirelessFwInfoTable_t;
@@ -404,6 +407,7 @@ typedef MB_WirelessFwInfoTable_t SHCI_WirelessFwInfoTable_t;
#define INFO_STACK_TYPE_ZIGBEE 0x30
#define INFO_STACK_TYPE_MAC 0x40
#define INFO_STACK_TYPE_BLE_THREAD_FTD_STATIC 0x50
+#define INFO_STACK_TYPE_802154_LLD_TESTS 0x60
typedef struct {
/**
@@ -543,6 +547,16 @@ typedef struct {
*/
SHCI_CmdStatus_t SHCI_C2_THREAD_Init( void );
+ /**
+ * SHCI_C2_LLDTESTS_Init
+ * @brief Starts the LLD tests CLI
+ *
+ * @param param_size : Nb of bytes
+ * @param p_param : pointeur with data to give from M4 to M0
+ * @retval Status
+ */
+ SHCI_CmdStatus_t SHCI_C2_LLDTESTS_Init( uint8_t param_size, uint8_t * p_param );
+
/**
* SHCI_C2_ZIGBEE_Init
* @brief Starts the Zigbee Stack
diff --git a/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/hci_tl.c b/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/hci_tl.c
index 7a6b2c625..7aebe4deb 100644
--- a/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/hci_tl.c
+++ b/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/hci_tl.c
@@ -78,11 +78,21 @@ void hci_user_evt_proc(void)
tHCI_UserEvtRxParam UserEvtRxParam;
/**
+ * Up to release version v1.2.0, a while loop was implemented to read out events from the queue as long as
+ * it is not empty. However, in a bare metal implementation, this leads to calling in a "blocking" mode
+ * hci_user_evt_proc() as long as events are received without giving the opportunity to run other tasks
+ * in the background.
+ * From now, the events are reported one by one. When it is checked there is still an event pending in the queue,
+ * a request to the user is made to call again hci_user_evt_proc().
+ * This gives the opportunity to the application to run other background tasks between each event.
+ */
+
+ /**
* It is more secure to use LST_remove_head()/LST_insert_head() compare to LST_get_next_node()/LST_remove_node()
* in case the user overwrite the header where the next/prev pointers are located
*/
- while((LST_is_empty(&HciAsynchEventQueue) == FALSE) && (UserEventFlow != HCI_TL_UserEventFlow_Disable))
+ if((LST_is_empty(&HciAsynchEventQueue) == FALSE) && (UserEventFlow != HCI_TL_UserEventFlow_Disable))
{
LST_remove_head ( &HciAsynchEventQueue, (tListNode **)&phcievtbuffer );
@@ -108,6 +118,12 @@ void hci_user_evt_proc(void)
}
}
+ if((LST_is_empty(&HciAsynchEventQueue) == FALSE) && (UserEventFlow != HCI_TL_UserEventFlow_Disable))
+ {
+ hci_notify_asynch_evt((void*) &HciAsynchEventQueue);
+ }
+
+
return;
}
diff --git a/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/hci_tl.h b/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/hci_tl.h
index 053330eca..0783eeea9 100644
--- a/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/hci_tl.h
+++ b/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/hci_tl.h
@@ -87,9 +87,9 @@ typedef struct
void hci_register_io_bus(tHciIO* fops);
/**
- * @brief Interrupt service routine that must be called when the BlueNRG
+ * @brief Interrupt service routine that must be called when the BLE core
* reports a packet received or an event to the host through the
- * BlueNRG-MS interrupt line.
+ * related IPCC RX interrupt line.
*
* @param pdata Packet or event pointer
* @retval None
diff --git a/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/mbox_def.h b/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/mbox_def.h
index 7c4d7afa8..290017f1f 100644
--- a/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/mbox_def.h
+++ b/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/mbox_def.h
@@ -6,11 +6,11 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
- * the "License"; You may not use this file except in compliance with the
+ * the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
@@ -96,8 +96,15 @@ extern "C" {
typedef struct
{
+ uint8_t *notack_buffer;
+ uint8_t *clicmdrsp_buffer;
+ } MB_LldTestsTable_t;
+
+ typedef struct
+ {
uint8_t *notifM0toM4_buffer;
uint8_t *appliCmdM4toM0_buffer;
+ uint8_t *loggingM0toM4_buffer;
} MB_ZigbeeTable_t;
/**
* msg
@@ -143,6 +150,7 @@ extern "C" {
MB_TracesTable_t *p_traces_table;
MB_Mac_802_15_4_t *p_mac_802_15_4_table;
MB_ZigbeeTable_t *p_zigbee_table;
+ MB_LldTestsTable_t *p_lld_tests_table;
} MB_RefTable_t;
#ifdef __cplusplus
@@ -222,6 +230,7 @@ extern "C" {
#define HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL LL_IPCC_CHANNEL_3
#define HW_IPCC_TRACES_CHANNEL LL_IPCC_CHANNEL_4
#define HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL LL_IPCC_CHANNEL_5
+#define HW_IPCC_ZIGBEE_APPLI_LOGGING_CHANNEL LL_IPCC_CHANNEL_5
#endif /*__MBOX_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/shci_tl.c b/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/shci_tl.c
index 51245af90..7ab1e068f 100644
--- a/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/shci_tl.c
+++ b/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/shci_tl.c
@@ -73,7 +73,21 @@ void shci_user_evt_proc(void)
TL_EvtPacket_t *phcievtbuffer;
tSHCI_UserEvtRxParam UserEvtRxParam;
- while((LST_is_empty(&SHciAsynchEventQueue) == FALSE) && (SHCI_TL_UserEventFlow != SHCI_TL_UserEventFlow_Disable))
+ /**
+ * Up to release version v1.2.0, a while loop was implemented to read out events from the queue as long as
+ * it is not empty. However, in a bare metal implementation, this leads to calling in a "blocking" mode
+ * shci_user_evt_proc() as long as events are received without giving the opportunity to run other tasks
+ * in the background.
+ * From now, the events are reported one by one. When it is checked there is still an event pending in the queue,
+ * a request to the user is made to call again shci_user_evt_proc().
+ * This gives the opportunity to the application to run other background tasks between each event.
+ */
+
+ /**
+ * It is more secure to use LST_remove_head()/LST_insert_head() compare to LST_get_next_node()/LST_remove_node()
+ * in case the user overwrite the header where the next/prev pointers are located
+ */
+ if((LST_is_empty(&SHciAsynchEventQueue) == FALSE) && (SHCI_TL_UserEventFlow != SHCI_TL_UserEventFlow_Disable))
{
LST_remove_head ( &SHciAsynchEventQueue, (tListNode **)&phcievtbuffer );
@@ -99,6 +113,12 @@ void shci_user_evt_proc(void)
}
}
+ if((LST_is_empty(&SHciAsynchEventQueue) == FALSE) && (SHCI_TL_UserEventFlow != SHCI_TL_UserEventFlow_Disable))
+ {
+ shci_notify_asynch_evt((void*) &SHciAsynchEventQueue);
+ }
+
+
return;
}
diff --git a/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl.h b/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl.h
index 72f76188a..e7b006e4b 100644
--- a/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl.h
+++ b/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl.h
@@ -6,11 +6,11 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
- * the "License"; You may not use this file except in compliance with the
+ * the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
@@ -186,6 +186,12 @@ typedef struct
typedef struct
{
+ uint8_t *p_LldTestsCliRspBuffer;
+ uint8_t *p_LldTestsNotAckBuffer;
+} TL_LLD_tests_Config_t;
+
+typedef struct
+{
uint8_t *p_Mac_802_15_4_CmdRspBuffer;
uint8_t *p_Mac_802_15_4_NotAckBuffer;
} TL_MAC_802_15_4_Config_t;
@@ -194,6 +200,7 @@ typedef struct
{
uint8_t *p_ZigbeeOtCmdRspBuffer;
uint8_t *p_ZigbeeNotAckBuffer;
+ uint8_t *p_ZigbeeLoggingBuffer;
} TL_ZIGBEE_Config_t;
/**
@@ -256,6 +263,15 @@ void TL_THREAD_CliSendAck ( void );
void TL_THREAD_CliNotReceived( TL_EvtPacket_t * Notbuffer );
/******************************************************************************
+ * LLD tests
+ ******************************************************************************/
+void TL_LLDTESTS_Init( TL_LLD_tests_Config_t *p_Config );
+void TL_LLDTESTS_CliSendCmd( void );
+void TL_LLDTESTS_NotReceived( TL_EvtPacket_t * Notbuffer );
+void TL_LLDTESTS_CliSendAck ( void );
+void TL_LLDTESTS_CliNotReceived( TL_EvtPacket_t * Notbuffer );
+
+/******************************************************************************
* MEMORY MANAGER
******************************************************************************/
void TL_MM_Init( TL_MM_Config_t *p_Config );
@@ -276,7 +292,6 @@ void TL_MAC_802_15_4_CmdEvtReceived( TL_EvtPacket_t * Otbuffer );
void TL_MAC_802_15_4_NotReceived( TL_EvtPacket_t * Notbuffer );
void TL_MAC_802_15_4_SendAck ( void );
-
/******************************************************************************
* ZIGBEE
******************************************************************************/
@@ -285,6 +300,8 @@ void TL_ZIGBEE_SendAppliCmdToM0( void );
void TL_ZIGBEE_SendAckAfterAppliNotifFromM0 ( void );
void TL_ZIGBEE_NotReceived( TL_EvtPacket_t * Notbuffer );
void TL_ZIGBEE_CmdEvtReceived( TL_EvtPacket_t * Otbuffer );
+void TL_ZIGBEE_LoggingReceived(TL_EvtPacket_t * Otbuffer );
+void TL_ZIGBEE_SendAckAfterAppliLoggingFromM0 ( void );
#ifdef __cplusplus
} /* extern "C" */
diff --git a/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_mbox.c b/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_mbox.c
index debfcc6b4..340b5ac92 100644
--- a/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_mbox.c
+++ b/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_mbox.c
@@ -6,11 +6,11 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
- * the "License"; You may not use this file except in compliance with the
+ * the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
@@ -36,6 +36,7 @@ PLACE_IN_SECTION("MAPPING_TABLE") static volatile MB_RefTable_t TL_RefTable;
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_DeviceInfoTable_t TL_DeviceInfoTable;
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_BleTable_t TL_BleTable;
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_ThreadTable_t TL_ThreadTable;
+PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_LldTestsTable_t TL_LldTestsTable;
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_SysTable_t TL_SysTable;
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_MemManagerTable_t TL_MemManagerTable;
PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static MB_TracesTable_t TL_TracesTable;
@@ -79,6 +80,7 @@ void TL_Init( void )
TL_RefTable.p_device_info_table = &TL_DeviceInfoTable;
TL_RefTable.p_ble_table = &TL_BleTable;
TL_RefTable.p_thread_table = &TL_ThreadTable;
+ TL_RefTable.p_lld_tests_table = &TL_LldTestsTable;
TL_RefTable.p_sys_table = &TL_SysTable;
TL_RefTable.p_mem_manager_table = &TL_MemManagerTable;
TL_RefTable.p_traces_table = &TL_TracesTable;
@@ -282,12 +284,66 @@ void HW_IPCC_THREAD_CliEvtNot( void )
return;
}
-__weak void TL_OT_CmdEvtReceived( TL_EvtPacket_t * Otbuffer ){};
-__weak void TL_THREAD_NotReceived( TL_EvtPacket_t * Notbuffer ){};
-__weak void TL_THREAD_CliNotReceived( TL_EvtPacket_t * Notbuffer ){};
+__WEAK void TL_OT_CmdEvtReceived( TL_EvtPacket_t * Otbuffer ){};
+__WEAK void TL_THREAD_NotReceived( TL_EvtPacket_t * Notbuffer ){};
+__WEAK void TL_THREAD_CliNotReceived( TL_EvtPacket_t * Notbuffer ){};
#endif /* THREAD_WB */
+/******************************************************************************
+ * LLD 802.15.4
+ ******************************************************************************/
+#ifdef LLD_802_15_4_WB
+void TL_LLDTESTS_Init( TL_LLD_tests_Config_t *p_Config )
+{
+ MB_LldTestsTable_t * p_lld_tests_table;
+
+ p_lld_tests_table = TL_RefTable.p_lld_tests_table;
+
+ p_lld_tests_table->clicmdrsp_buffer = p_Config->p_LldTestsCliRspBuffer;
+ p_lld_tests_table->notack_buffer = p_Config->p_LldTestsNotAckBuffer;
+
+ HW_IPCC_LLDTESTS_Init();
+
+ return;
+}
+
+void TL_LLDTESTS_CliSendCmd( void )
+{
+ ((TL_CmdPacket_t *)(TL_RefTable.p_lld_tests_table->clicmdrsp_buffer))->cmdserial.type = TL_CLICMD_PKT_TYPE;
+
+ HW_IPCC_LLDTESTS_CliSendCmd();
+
+ return;
+}
+
+void TL_LLDTESTS_CliSendAck ( void )
+{
+ ((TL_CmdPacket_t *)(TL_RefTable.p_lld_tests_table->notack_buffer))->cmdserial.type = TL_OTACK_PKT_TYPE;
+
+ HW_IPCC_LLDTESTS_CliSendAck();
+
+ return;
+}
+
+void HW_IPCC_LLDTESTS_EvtNot( void )
+{
+ TL_LLDTESTS_NotReceived( (TL_EvtPacket_t*)(TL_RefTable.p_lld_tests_table->notack_buffer) );
+
+ return;
+}
+
+void HW_IPCC_LLDTESTS_CliEvtNot( void )
+{
+ TL_LLDTESTS_CliNotReceived( (TL_EvtPacket_t*)(TL_RefTable.p_lld_tests_table->clicmdrsp_buffer) );
+
+ return;
+}
+
+__WEAK void TL_LLDTESTS_NotReceived( TL_EvtPacket_t * Notbuffer ){};
+__WEAK void TL_LLDTESTS_CliNotReceived( TL_EvtPacket_t * Notbuffer ){};
+#endif /* LLD_802_15_4_WB */
+
#ifdef MAC_802_15_4_WB
/******************************************************************************
* MAC 802.15.4
@@ -338,8 +394,8 @@ void HW_IPCC_MAC_802_15_4_EvtNot( void )
return;
}
-__weak void TL_MAC_802_15_4_CmdEvtReceived( TL_EvtPacket_t * Otbuffer ){};
-__weak void TL_MAC_802_15_4_NotReceived( TL_EvtPacket_t * Notbuffer ){};
+__WEAK void TL_MAC_802_15_4_CmdEvtReceived( TL_EvtPacket_t * Otbuffer ){};
+__WEAK void TL_MAC_802_15_4_NotReceived( TL_EvtPacket_t * Notbuffer ){};
#endif
#ifdef ZIGBEE_WB
@@ -354,6 +410,7 @@ void TL_ZIGBEE_Init( TL_ZIGBEE_Config_t *p_Config )
p_zigbee_table = TL_RefTable.p_zigbee_table;
p_zigbee_table->appliCmdM4toM0_buffer = p_Config->p_ZigbeeOtCmdRspBuffer;
p_zigbee_table->notifM0toM4_buffer = p_Config->p_ZigbeeNotAckBuffer;
+ p_zigbee_table->loggingM0toM4_buffer = p_Config->p_ZigbeeLoggingBuffer;
HW_IPCC_ZIGBEE_Init();
@@ -395,8 +452,27 @@ void HW_IPCC_ZIGBEE_AppliAsyncEvtNotification( void )
return;
}
-__weak void TL_ZIGBEE_CmdEvtReceived( TL_EvtPacket_t * Otbuffer ){};
-__weak void TL_ZIGBEE_NotReceived( TL_EvtPacket_t * Notbuffer ){};
+/* Zigbee logging */
+void HW_IPCC_ZIGBEE_AppliAsyncLoggingNotification( void )
+{
+ TL_ZIGBEE_LoggingReceived( (TL_EvtPacket_t*)(TL_RefTable.p_zigbee_table->loggingM0toM4_buffer) );
+
+ return;
+}
+
+/* Send a Logging ACK to the M0 */
+void TL_ZIGBEE_SendAckAfterAppliLoggingFromM0 ( void )
+{
+ ((TL_CmdPacket_t *)(TL_RefTable.p_zigbee_table->loggingM0toM4_buffer))->cmdserial.type = TL_OTACK_PKT_TYPE;
+
+ HW_IPCC_ZIGBEE_SendLoggingAck();
+
+ return;
+}
+
+
+__WEAK void TL_ZIGBEE_CmdEvtReceived( TL_EvtPacket_t * Otbuffer ){};
+__WEAK void TL_ZIGBEE_NotReceived( TL_EvtPacket_t * Notbuffer ){};
#endif
@@ -474,6 +550,6 @@ void HW_IPCC_TRACES_EvtNot(void)
return;
}
-__weak void TL_TRACES_EvtReceived( TL_EvtPacket_t * hcievt ){};
+__WEAK void TL_TRACES_EvtReceived( TL_EvtPacket_t * hcievt ){};
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_thread_hci.c b/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_thread_hci.c
index ef024c3b6..9a6a61ff2 100644
--- a/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_thread_hci.c
+++ b/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_thread_hci.c
@@ -20,14 +20,10 @@
/* Includes ------------------------------------------------------------------*/
#include "stm32_wpan_common.h"
-#include "hw.h"
-
#include "stm_list.h"
-
#include "tl.h"
#include "tl_thread_hci.h"
-
/* Private typedef -----------------------------------------------------------*/
/* Private defines -----------------------------------------------------------*/
@@ -46,10 +42,10 @@
/* Private functions ----------------------------------------------------------*/
-__weak void Pre_OtCmdProcessing(void){return;}
-__weak void Ot_Cmd_Transfer(void){return;}
-__weak Thread_OT_Cmd_Request_t* THREAD_Get_OTCmdPayloadBuffer(void){return 0;}
-__weak Thread_OT_Cmd_Request_t* THREAD_Get_OTCmdRspPayloadBuffer(void){return 0;}
-__weak Thread_OT_Cmd_Request_t* THREAD_Get_NotificationPayloadBuffer(void){return 0;}
+__WEAK void Pre_OtCmdProcessing(void){return;}
+__WEAK void Ot_Cmd_Transfer(void){return;}
+__WEAK Thread_OT_Cmd_Request_t* THREAD_Get_OTCmdPayloadBuffer(void){return 0;}
+__WEAK Thread_OT_Cmd_Request_t* THREAD_Get_OTCmdRspPayloadBuffer(void){return 0;}
+__WEAK Thread_OT_Cmd_Request_t* THREAD_Get_NotificationPayloadBuffer(void){return 0;}
diff --git a/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_thread_hci.h b/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_thread_hci.h
index a109e0531..54f064a99 100644
--- a/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_thread_hci.h
+++ b/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_thread_hci.h
@@ -22,10 +22,7 @@
#define __TL_THREAD_HCI_H_
/* Includes ------------------------------------------------------------------*/
-#include "stm32wbxx_hal_def.h"
#include "stm32wbxx_core_interface_def.h"
-#include <string.h>
-
/* Exported functions ------------------------------------------------------------*/
void Pre_OtCmdProcessing(void);
diff --git a/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_zigbee_hci.c b/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_zigbee_hci.c
index 60b16e008..c5b6572e5 100644
--- a/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_zigbee_hci.c
+++ b/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_zigbee_hci.c
@@ -51,5 +51,4 @@ __weak void ZIGBEE_CmdTransfer(void){return;}
__weak Zigbee_Cmd_Request_t* ZIGBEE_Get_OTCmdPayloadBuffer(void){return 0;}
__weak Zigbee_Cmd_Request_t* ZIGBEE_Get_OTCmdRspPayloadBuffer(void){return 0;}
__weak Zigbee_Cmd_Request_t* ZIGBEE_Get_NotificationPayloadBuffer(void){return 0;}
-
-
+__weak Zigbee_Cmd_Request_t* ZIGBEE_Get_LoggingPayloadBuffer(void){return 0;}
diff --git a/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_zigbee_hci.h b/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_zigbee_hci.h
index ddd572053..9938e5598 100644
--- a/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_zigbee_hci.h
+++ b/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_zigbee_hci.h
@@ -22,7 +22,6 @@
#define __TL_ZIGBEE_HCI_H_
/* Includes ------------------------------------------------------------------*/
-#include "stm32wbxx_hal_def.h"
#include "zigbee_core.h"
#include "stm32wbxx_core_interface_def.h"
#include "tl.h"
@@ -35,6 +34,7 @@ void ZIGBEE_CmdTransfer(void);
Zigbee_Cmd_Request_t* ZIGBEE_Get_OTCmdPayloadBuffer(void);
Zigbee_Cmd_Request_t* ZIGBEE_Get_OTCmdRspPayloadBuffer(void);
Zigbee_Cmd_Request_t* ZIGBEE_Get_NotificationPayloadBuffer(void);
+Zigbee_Cmd_Request_t * ZIGBEE_Get_LoggingPayloadBuffer(void);
/* Exported defines -----------------------------------------------------------*/
diff --git a/Middlewares/ST/STM32_WPAN/mac_802_15_4/core/inc/802_15_4_mac_types.h b/Middlewares/ST/STM32_WPAN/mac_802_15_4/core/inc/802_15_4_mac_types.h
index 0328eac12..9d75583a8 100644
--- a/Middlewares/ST/STM32_WPAN/mac_802_15_4/core/inc/802_15_4_mac_types.h
+++ b/Middlewares/ST/STM32_WPAN/mac_802_15_4/core/inc/802_15_4_mac_types.h
@@ -1058,6 +1058,8 @@ typedef struct {
uint32_t ranging_offset;
/*! The FoM characterizing the ranging measurement*/
uint8_t ranging_FOM;
+ /*! The Received Signal Strength Indicator measured*/
+ int8_t rssi;
} MAC_dataInd_t;
/******************************************************************************/
diff --git a/Middlewares/ST/STM32_WPAN/stm32_wpan_common.h b/Middlewares/ST/STM32_WPAN/stm32_wpan_common.h
index 06f4280a9..32f314465 100644
--- a/Middlewares/ST/STM32_WPAN/stm32_wpan_common.h
+++ b/Middlewares/ST/STM32_WPAN/stm32_wpan_common.h
@@ -45,6 +45,7 @@ extern "C" {
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
+#include "cmsis_compiler.h"
/* -------------------------------- *
* Basic definitions *
diff --git a/Middlewares/ST/STM32_WPAN/utilities/dbg_trace.h b/Middlewares/ST/STM32_WPAN/utilities/dbg_trace.h
index c68d3f236..f83327643 100644
--- a/Middlewares/ST/STM32_WPAN/utilities/dbg_trace.h
+++ b/Middlewares/ST/STM32_WPAN/utilities/dbg_trace.h
@@ -27,8 +27,6 @@ extern "C"
{
#endif
-#include "utilities_conf.h"
-
/* Exported types ------------------------------------------------------------*/
/* External variables --------------------------------------------------------*/
/* Exported macros -----------------------------------------------------------*/
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/core/inc/stm32wbxx_core_interface_def.h b/Middlewares/ST/STM32_WPAN/zigbee/core/inc/stm32wbxx_core_interface_def.h
new file mode 100644
index 000000000..37231eebd
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/core/inc/stm32wbxx_core_interface_def.h
@@ -0,0 +1,350 @@
+/**
+ ******************************************************************************
+ * @file stm32wbxx_core_interface_def.h
+ * @author MCD Application Team
+ * @brief This file contains all the defines and structures used for the
+ * communication between the two core M0 and M4.
+ * This file is shared between the code running on M4 and the code
+ * running on M0.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef STM32WBxx_CORE_INTERFACE_DEF_H
+#define STM32WBxx_CORE_INTERFACE_DEF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "zigbee_types.h"
+#include "stm32wbxx_hal.h"
+
+/* Structure of the messages exchanged between M0 and M4 */
+#define OT_CMD_BUFFER_SIZE 20U
+
+typedef struct {
+ uint32_t ID;
+ uint32_t Size;
+ uint32_t Data[OT_CMD_BUFFER_SIZE];
+} Zigbee_Cmd_Request_t;
+
+/* List of messages between M4 and M0 */
+typedef enum {
+ MSG_M4TOM0_UNKNOWN = 0x0000,
+ MSG_M0TOM4_UNKNOWN = 0x0000,
+
+ /* WPAN Interface */
+ MSG_M4TOM0_WPAN_GET_UINT32, /* wpan_get_uint32 */
+ MSG_M4TOM0_WPAN_GET_UINT64, /* wpan_get_uint64 */
+
+ /* ZbMalloc / ZbFree */
+ MSG_M0TOM4_ZB_MALLOC,
+ MSG_M0TOM4_ZB_FREE,
+
+ /* Stack Init / Destroy */
+ MSG_M4TOM0_ZB_INIT, /* ZbInit */
+ MSG_M4TOM0_ZB_DESTROY, /* ZbDestroy */
+
+ /* Stack Misc */
+ MSG_M4TOM0_EXTADDR_GET, /* ZbExtendedAddress */
+ MSG_M4TOM0_EXTADDR_CHANGE, /* ZbChangeExtAddr */
+ MSG_M4TOM0_UPTIME, /* ZbUptime */
+ MSG_M4TOM0_FILTER_ADD, /* ZbMsgFilterRegister - Create filter in stack */
+ MSG_M4TOM0_FILTER_DEL, /* ZbMsgFilterRemove - Delete filter in stack */
+ MSG_M0TOM4_FILTER_MSG_CB, /* Callback for filter messages from stack */
+ MSG_M4TOM0_LOG_CONFIG, /* ZbSetLogging */
+
+ /* ZbTimer API */
+ MSG_M4TOM0_TIMER_ALLOC, /* ZbTimerAlloc */
+ MSG_M4TOM0_TIMER_FREE, /* ZbTimerFree */
+ MSG_M4TOM0_TIMER_STOP, /* ZbTimerStop */
+ MSG_M4TOM0_TIMER_RESET, /* ZbTimerReset */
+ MSG_M4TOM0_TIMER_RUNNING, /* ZbTimerRunning */
+ MSG_M4TOM0_TIMER_REMAINING, /* ZbTimerRemaining */
+ MSG_M0TOM4_TIMER_CB = MSG_M4TOM0_TIMER_REMAINING, /* callback from ZbTimerAlloc() */
+ /* Reserved to 0x001f for Future Use */
+
+ /* Stack Config and Startup */
+ MSG_M4TOM0_STARTUP_GET_CFG = 0x0020, /* ZbStartupConfigGetProDefaults */
+ MSG_M4TOM0_STARTUP_REQ, /* ZbStartup - Form or Join zigbee network */
+ MSG_M0TOM4_STARTUP_CB = MSG_M4TOM0_STARTUP_REQ, /* Callback for ZbStartup */
+ MSG_M4TOM0_STARTUP_REJOIN, /* ZbStartupRejoin */
+ MSG_M0TOM4_STARTUP_REJOIN_CB = MSG_M4TOM0_STARTUP_REJOIN, /* Callback for ZbStartupRejoin */
+
+ MSG_M4TOM0_STARTUP_PERSIST, /* ZbStartupPersist */
+ MSG_M4TOM0_STARTUP_FINDBIND, /* ZbStartupFindBindStart */
+ MSG_M0TOM4_STARTUP_FINDBIND_CB = MSG_M4TOM0_STARTUP_FINDBIND,
+ MSG_M4TOM0_STARTUP_TOUCHLINK_TARGET_STOP, /* ZbStartupTouchlinkTargetStop */
+ MSG_M4TOM0_STARTUP_TCSO_START, /* ZbStartupTcsoStart */
+ MSG_M0TOM4_STARTUP_TCSO_CB = MSG_M4TOM0_STARTUP_TCSO_START,
+ MSG_M4TOM0_STARTUP_TCSO_ABORT, /* ZbStartupTcsoAbort */
+ MSG_M4TOM0_STARTUP_TC_REJOIN, /* ZbTrustCenterRejoin */
+ MSG_M0TOM4_STARTUP_TC_REJOIN_CB = MSG_M4TOM0_STARTUP_TC_REJOIN,
+ MSG_M4TOM0_PERSIST_ENABLE, /* ZbPersistNotifyRegister */
+ MSG_M0TOM4_PERSIST_CB, /* Persistent data update notification callback */
+ MSG_M4TOM0_PERSIST_GET, /* ZbPersistGet */
+
+ MSG_M4TOM0_ZB_LEAVE_REQ, /* ZbLeaveReq */
+ MSG_M0TOM4_ZB_LEAVE_CB = MSG_M4TOM0_ZB_LEAVE_REQ, /* Callback for ZbLeaveReq */
+ MSG_M4TOM0_ZB_RESET_REQ, /* ZbReset */
+
+ /* AES Hashing Functions */
+ MSG_M4TOM0_ZB_HASH_ADD, /* ZbHashAdd */
+ MSG_M4TOM0_ZB_HASH_BYTE, /* ZbHashByte */
+ MSG_M4TOM0_ZB_HASH_DIGEST, /* ZbHashDigest */
+
+ /* ECDSA Signature Validation */
+ MSG_M4TOM0_ZB_SEC_ECDSA_VALIDATE, /* ZbSecEcdsaValidate */
+ /* Reserved to 0x003f for Future Use */
+
+ /* BDB */
+ MSG_M4TOM0_BDB_GET_REQ = 0x0040, /* ZbBdbGetReq */
+ MSG_M4TOM0_BDB_SET_REQ, /* ZbBdbSetReq */
+ MSG_M4TOM0_BDB_SET_EP_STATUS, /* ZbBdbSetEndpointStatus */
+ /* Reserved to 0x004f for Future Use */
+
+ /* ZDO Commands */
+ MSG_M4TOM0_ZDO_NWK_ADDR = 0x0050, /* ZbZdoNwkAddrReq */
+ MSG_M0TOM4_ZDO_NWK_ADDR_CB = MSG_M4TOM0_ZDO_NWK_ADDR,
+ MSG_M4TOM0_ZDO_IEEE_ADDR = 0x0051, /* ZbZdoIeeeAddrReq */
+ MSG_M0TOM4_ZDO_IEEE_ADDR_CB = MSG_M4TOM0_ZDO_IEEE_ADDR,
+ MSG_M4TOM0_ZDO_NODE_DESC = 0x0052, /* ZbZdoNodeDescReq */
+ MSG_M0TOM4_ZDO_NODE_DESC_CB = MSG_M4TOM0_ZDO_NODE_DESC,
+ MSG_M4TOM0_ZDO_POWER_DESC = 0x0053, /* ZbZdoPowerDescReq */
+ MSG_M0TOM4_ZDO_POWER_DESC_CB = MSG_M4TOM0_ZDO_POWER_DESC,
+ MSG_M4TOM0_ZDO_SIMPLE_DESC = 0x0054, /* ZbZdoSimpleDescReq */
+ MSG_M0TOM4_ZDO_SIMPLE_DESC_CB = MSG_M4TOM0_ZDO_SIMPLE_DESC,
+ MSG_M4TOM0_ZDO_ACTIVE_EP = 0x0055, /* ZbZdoActiveEpReq */
+ MSG_M0TOM4_ZDO_ACTIVE_EP_CB = MSG_M4TOM0_ZDO_ACTIVE_EP,
+ MSG_M4TOM0_ZDO_MATCH_DESC = 0x0056, /* ZbZdoMatchDescReq */
+ MSG_M0TOM4_ZDO_MATCH_DESC_CB = MSG_M4TOM0_ZDO_MATCH_DESC,
+ MSG_M4TOM0_ZDO_MATCH_DESC_MULTI = 0x0057, /* ZbZdoMatchDescMulti (reusing a reserved ZDO cluster ID) */
+ MSG_M0TOM4_ZDO_MATCH_DESC_MULTI_CB = MSG_M4TOM0_ZDO_MATCH_DESC_MULTI,
+ /* Reserved */
+ MSG_M4TOM0_ZDO_DEVICE_ANNCE = 0x0063, /* ZbZdoDeviceAnnce */
+ MSG_M4TOM0_ZDO_DEVICE_ANNCE_ALIAS = 0x0064, /* ZbZdoDeviceAnnceAlias (reusing a reserved ZDO cluster ID) */
+ /* Reserved */
+ MSG_M4TOM0_ZDO_BIND = 0x0071, /* ZbZdoBindReq */
+ MSG_M0TOM4_ZDO_BIND_CB = MSG_M4TOM0_ZDO_BIND,
+ MSG_M4TOM0_ZDO_UNBIND = 0x0072, /* ZbZdoUnbindReq */
+ MSG_M0TOM4_ZDO_UNBIND_CB = MSG_M4TOM0_ZDO_UNBIND,
+ /* Reserved */
+ MSG_M4TOM0_ZDO_MGMT_LQI = 0x0081, /* ZbZdoLqiReq */
+ MSG_M0TOM4_ZDO_MGMT_LQI_CB = MSG_M4TOM0_ZDO_MGMT_LQI,
+ /* Reserved */
+ MSG_M4TOM0_ZDO_MGMT_BIND = 0x0083, /* ZbZdoMgmtBindReq */
+ MSG_M0TOM4_ZDO_MGMT_BIND_CB = MSG_M4TOM0_ZDO_MGMT_BIND,
+ MSG_M4TOM0_ZDO_MGMT_LEAVE = 0x0084, /* ZbZdoLeaveReq */
+ MSG_M0TOM4_ZDO_MGMT_LEAVE_CB = MSG_M4TOM0_ZDO_MGMT_LEAVE,
+ /* Reserved */
+ MSG_M4TOM0_ZDO_MGMT_PERMIT_JOIN = 0x0086, /* ZbZdoPermitJoinReq */
+ MSG_M0TOM4_ZDO_MGMT_PERMIT_JOIN_CB = MSG_M4TOM0_ZDO_MGMT_PERMIT_JOIN,
+ /* Reserved */
+ MSG_M4TOM0_ZDO_MGMT_NWK_UPDATE = 0x0088, /* ZbZdoNwkUpdateReq */
+ MSG_M0TOM4_ZDO_MGMT_NWK_UPDATE_CB = MSG_M4TOM0_ZDO_MGMT_NWK_UPDATE,
+#if 0 /* Not required for 2.4 GHz DUT */
+ MSG_M4TOM0_ZDO_MGMT_NWK_ENH_UPDATE_REQ = 0x0089, /* ZbZdoNwkEnhUpdateReq */
+ MSG_M4TOM0_ZDO_MGMT_NWK_IEEE_JOIN_REQ = 0x008a, /* ZbZdoNwkIeeeJoinListReq */
+ MSG_M4TOM0_ZDO_MGMT_NWK_ENH_UPDATE_NOTIFY = 0x008b, /* ZbZdoUnsolicitedEnhUpdateNotify */
+ /* Reserved (0x008c to 0x00df) Future Use */
+ MSG_M4TOM0_ZDO_MGMT_NWK_IEEE_JOIN_BCAST = 0x00e0, /* ZbZdoNwkIeeeJoinListBcastAll */
+#endif
+ /* Reserved (0x00e1 to 0x00ff) Future Use */
+
+ /* ZDO Utility */
+ MSG_M4TOM0_ZDO_DEVICE_ANNCE_FILTER_REG = 0x0100, /* ZbZdoDeviceAnnceFilterRegister */
+ MSG_M4TOM0_ZDO_DEVICE_ANNCE_FILTER_DEL, /* ZbZdoDeviceAnnceFilterRemove */
+ MSG_M0TOM4_ZDO_DEVICE_ANNCE_FILTER_CB,
+ /* Reserved to 0x01ff for Future Use */
+
+ /* APSDE */
+ MSG_M4TOM0_APSDE_DATA_REQ = 0x0200, /* ZbApsdeDataReqCallback */
+ MSG_M0TOM4_APSDE_DATA_REQ_CB = MSG_M4TOM0_APSDE_DATA_REQ,
+
+ /* APS (Misc) */
+ MSG_M4TOM0_APS_FILTER_ENDPOINT_ADD, /* ZbApsFilterEndpointAdd */
+ MSG_M0TOM4_APS_FILTER_ENDPOINT_CB,
+ MSG_M4TOM0_APS_FILTER_ENDPOINT_NOMATCH_ADD, /* ZbApsmeEndpointConfigNoMatchCallback */
+ /* Can re-use MSG_M0TOM4_APS_FILTER_ENDPOINT_CB, since parameters are the same. */
+ MSG_M4TOM0_APS_FILTER_CLUSTER_ADD, /* ZbApsFilterClusterAdd */
+ MSG_M0TOM4_APS_FILTER_CLUSTER_CB,
+ MSG_M4TOM0_APS_EP_CLUSTER_ID_ADD, /* ZbApsmeEndpointClusterListAppend */
+ MSG_M4TOM0_APS_EP_EXISTS, /* ZbApsEndpointExists */
+ MSG_M4TOM0_APS_EP_GET_PROFILE, /* ZbApsEndpointProfile */
+
+ /* APSME */
+ MSG_M4TOM0_APS_ENDPOINT_ADD, /* ZbApsmeAddEndpoint */
+ MSG_M4TOM0_APS_ENDPOINT_DEL, /* ZbApsmeRemoveEndpoint */
+ MSG_M4TOM0_APS_GET_REQ, /* ZbApsmeGetReq */
+ MSG_M4TOM0_APS_SET_REQ, /* ZbApsmeSetReq */
+
+ MSG_M4TOM0_APSME_ADD_GROUP, /* ZbApsmeAddGroupReq */
+ MSG_M4TOM0_APSME_REMOVE_GROUP, /* ZbApsmeRemoveGroupReq */
+ MSG_M4TOM0_APSME_REMOVE_ALL_GROUPS, /* ZbApsmeRemoveAllGroupsReq */
+
+ MSG_M4TOM0_APSME_BIND, /* ZbApsmeBindReq */
+ MSG_M4TOM0_APSME_UNBIND, /* ZbApsmeUnbindReq */
+ MSG_M4TOM0_APS_UNBIND_ALL, /* ZbApsUnbindAllReq */
+
+ MSG_M4TOM0_APSME_TRANSPORT_KEY, /* ZbApsmeTransportKeyReq */
+ MSG_M4TOM0_APSME_REMOVE_DEVICE, /* ZbApsmeRemoveDeviceReq */
+ MSG_M4TOM0_APSME_REQUEST_KEY, /* ZbApsmeRequestKeyReq */
+ MSG_M4TOM0_APSME_SWITCH_KEY, /* ZbApsmeSwitchKeyReq */
+ MSG_M4TOM0_APSME_ADD_KEY, /* ZbApsmeAddKeyReq */
+ MSG_M4TOM0_APSME_GET_KEY, /* ZbApsmeGetKeyReq */
+ MSG_M4TOM0_APSME_REMOVE_KEY, /* ZbApsmeRemoveKeyReq */
+
+ /* Reserved to 0x02ff for Future Use */
+
+ /* NLME */
+ MSG_M4TOM0_NWK_GET_INDEX = 0x0300, /* ZbNwkGetIndex */
+ MSG_M4TOM0_NWK_SET_INDEX, /* ZbNwkSetIndex */
+ MSG_M4TOM0_NLME_DIRECT_JOIN, /* ZbNlmeDirectJoinReq */
+ MSG_M4TOM0_NLME_SET_INTERFACE, /* ZbNlmeSetInterface */
+ MSG_M4TOM0_NLME_GET_INTERFACE, /* ZbNlmeGetInterface */
+ MSG_M4TOM0_NLME_NET_DISC, /* ZbNlmeNetDiscReq */
+ MSG_M0TOM4_NLME_NET_DISC_CB = MSG_M4TOM0_NLME_NET_DISC,
+ MSG_M4TOM0_NLME_LEAVE, /* ZbNlmeLeaveReq */
+ MSG_M0TOM4_NLME_LEAVE_CB = MSG_M4TOM0_NLME_LEAVE,
+ MSG_M4TOM0_NLME_PERMIT_JOIN, /* ZbNlmePermitJoinReq */
+ MSG_M4TOM0_NLME_RESET, /* ZbNlmeResetReq */
+ MSG_M4TOM0_NLME_SYNC, /* ZbNlmeSyncReq */
+ MSG_M0TOM4_NLME_SYNC_CB = MSG_M4TOM0_NLME_SYNC,
+ MSG_M4TOM0_NLME_ROUTE_DISC, /* ZbNlmeRouteDiscReq */
+ MSG_M0TOM4_NLME_ROUTE_DISC_CB = MSG_M4TOM0_NLME_ROUTE_DISC,
+ /* NWK Misc and Helper API */
+ MSG_M4TOM0_NWK_GET_PARENT_EXT, /* ZbNwkGetParentExtAddr */
+ MSG_M4TOM0_NWK_GET_PARENT_NWK, /* ZbNwkGetParentShortAddr */
+ MSG_M4TOM0_NWK_GET_SEC_MATERIAL, /* ZbNwkGetSecMaterial */
+ MSG_M4TOM0_NWK_NNT_CLEAR_ALL, /* ZbNwkNeighborClearAll */
+ MSG_M4TOM0_NWK_SET_FRAME_COUNTER, /* ZbNwkSetFrameCounter */
+ MSG_M4TOM0_NWK_ADDR_LOOKUP_EXT, /* ZbNwkAddrLookupExt */
+ MSG_M4TOM0_NWK_ADDR_LOOKUP_NWK, /* ZbNwkAddrLookupNwk */
+ MSG_M4TOM0_NWK_ADDR_IS_CHILD_EXT, /* ZbNwkAddrIsChildExt */
+ MSG_M4TOM0_NWK_ADDR_IS_CHILD_NWK, /* ZbNwkAddrIsChildNwk */
+ MSG_M4TOM0_NWK_FAST_POLL_REQUEST, /* ZbNwkFastPollRequest */
+ MSG_M4TOM0_NWK_FAST_POLL_RELEASE, /* ZbNwkFastPollRelease */
+ MSG_M4TOM0_NWK_FAST_POLL_RESOURCE, /* ZbNwkFastPollResourceCount */
+ MSG_M4TOM0_NWK_IFC_SET_TX_POWER, /* ZbNwkIfSetTxPower */
+ MSG_M4TOM0_NWK_IFC_GET_TX_POWER, /* ZbNwkIfGetTxPower */
+ MSG_M4TOM0_NWK_IFC_SET_DSN, /* ZbNwkIfSetDsn */
+ MSG_M4TOM0_NWK_SET_NEXT_CHILD_ADDR, /* ZbNwkAddrSetNextChildAddr */
+ /* Reserved to 0x03ff for Future Use */
+
+ /* ZCL Endpoint */
+ MSG_M4TOM0_ZCL_ENDPOINT_ADD = 0x0400, /* ZbZclAddEndpoint */
+ MSG_M4TOM0_ZCL_ENDPOINT_DEL, /* ZbZclRemoveEndpoint */
+ MSG_M4TOM0_ZCL_CLUSTER_ATTACH, /* ZbZclClusterAttach */
+ MSG_M4TOM0_ZCL_CLUSTER_DETACH, /* ZbZclClusterDetach */
+ MSG_M4TOM0_ZCL_CLUSTER_EP_REGISTER, /* ZbZclClusterEndpointRegister */
+ MSG_M4TOM0_ZCL_CLUSTER_EP_REMOVE, /* ZbZclClusterEndpointRemove */
+ MSG_M4TOM0_ZCL_CLUSTER_BIND, /* zcl_cluster_bind */
+
+ /* ZCL Cluster Alarms */
+ MSG_M4TOM0_ZCL_CLUSTER_ALARM_ADD_FILTER, /* ZbZclClusterRegisterAlarmResetHandler */
+ MSG_M0TOM4_ZCL_CLUSTER_ALARM_CB = MSG_M4TOM0_ZCL_CLUSTER_ALARM_ADD_FILTER,
+ MSG_M4TOM0_ZCL_CLUSTER_ALARM_SEND, /* ZbZclClusterSendAlarm */
+
+ /* ZCL Cluster Unsolicited Callbacks */
+ MSG_M0TOM4_ZCL_CLUSTER_COMMAND_CB, /* ZbZclClusterT.command() */
+ MSG_M0TOM4_ZCL_CLUSTER_CONFIG_CB, /* ZbZclClusterT.config() */
+ MSG_M0TOM4_ZCL_CLUSTER_REPORT_CB, /* ZbZclClusterT.report() */
+ MSG_M0TOM4_ZCL_CLUSTER_GET_SCENE_CB, /* ZbZclClusterT.get_scene_data() */
+ MSG_M0TOM4_ZCL_CLUSTER_SET_SCENE_CB, /* ZbZclClusterT.set_scene_data() */
+ MSG_M0TOM4_ZCL_CLUSTER_CLEANUP_CB, /* ZbZclClusterT.cleanup() */
+
+ /* ZCL Cluster Command and Response */
+ MSG_M4TOM0_ZCL_CLUSTER_CMD_REQ, /* ZbZclClusterCommandReq */
+ MSG_M0TOM4_ZCL_CLUSTER_CMD_REQ_CB = MSG_M4TOM0_ZCL_CLUSTER_CMD_REQ,
+ MSG_M4TOM0_ZCL_CLUSTER_CMD_RSP, /* ZbZclClusterCommandRsp */
+ MSG_M4TOM0_ZCL_CLUSTER_CMD_RSP_WITH_CB, /* ZbZclClusterCommandRspWithCb */
+ MSG_M0TOM4_ZCL_CLUSTER_CMD_RSP_CONF_CB = MSG_M4TOM0_ZCL_CLUSTER_CMD_RSP_WITH_CB,
+ MSG_M4TOM0_ZCL_CLUSTER_CMD_RSP_WITH_STATUS, /* ZbZclSendClusterStatusResponse */
+
+ /* ZCL Attributes */
+ MSG_M4TOM0_ZCL_ATTR_REGISTER, /* Used by ZbZclAttrAppendList */
+ MSG_M0TOM4_ZCL_ATTR_CB,
+
+ /* ZCL Profile-Wide Commands */
+ MSG_M4TOM0_ZCL_GET_SEQNUM, /* ZbZclGetNextSeqnum */
+ MSG_M4TOM0_ZCL_COMMAND_REQ, /* ZbZclCommandReq */
+ MSG_M0TOM4_ZCL_COMMAND_REQ_CB = MSG_M4TOM0_ZCL_COMMAND_REQ,
+ MSG_M4TOM0_ZCL_COMMAND_NO_RSP, /* ZbZclCommandNoResp */
+ MSG_M0TOM4_ZCL_COMMAND_NO_RSP_CB = MSG_M4TOM0_ZCL_COMMAND_NO_RSP,
+ MSG_M4TOM0_ZCL_SEND_DEFAULT_RSP, /* ZbZclSendDefaultResponse */
+ MSG_M4TOM0_ZCL_READ_REQ, /* ZbZclReadReq */
+ MSG_M0TOM4_ZCL_READ_CB = MSG_M4TOM0_ZCL_READ_REQ,
+ MSG_M4TOM0_ZCL_WRITE_REQ, /* ZbZclWriteReq */
+ MSG_M0TOM4_ZCL_WRITE_CB = MSG_M4TOM0_ZCL_WRITE_REQ,
+ MSG_M4TOM0_ZCL_DISCOVER_ATTR_REQ, /* ZbZclDiscoverAttrReq */
+ MSG_M0TOM4_ZCL_DISCOVER_ATTR_CB = MSG_M4TOM0_ZCL_DISCOVER_ATTR_REQ,
+
+ /* Reserved to 0x043f for Future Use */
+
+ /* ZCL Cluster Specific APIs */
+
+ /* ZCL Key Exchange (i.e. CBKE) */
+ MSG_M4TOM0_ZCL_KE_WITH_DEVICE = 0x0440, /* ZbZclKeWithDevice */
+ MSG_M0TOM4_ZCL_KE_WITH_DEVICE_CB = MSG_M4TOM0_ZCL_KE_WITH_DEVICE,
+
+#if 0 /* needed? */
+ /* ZCL Device Log */
+ MSG_M4TOM0_ZCL_DEVICE_LOG_ADD, /* ZbZclDeviceLogAdd */
+ MSG_M4TOM0_ZCL_DEVICE_LOG_CLEAR, /* ZbZclDeviceLogClear */
+ MSG_M4TOM0_ZCL_DEVICE_LOG_ENABLE, /* ZbZclDeviceLogEnable */
+ MSG_M4TOM0_ZCL_DEVICE_LOG_REMOVE, /* ZbZclDeviceLogRemove */
+#endif
+
+ /* ZCL Basic Server */
+ MSG_M4TOM0_ZCL_BASIC_SERVER_ALARM_POST, /* ZbZclBasicPostAlarm */
+ MSG_M4TOM0_ZCL_BASIC_SERVER_CONFIG_RESET, /* ZbZclBasicServerResetCmdConfig */
+ MSG_M4TOM0_ZCL_BASIC_SERVER_LOCAL_WRITE, /* ZbZclBasicWriteDirect */
+
+ /* ZCL Diagnostics Server */
+ MSG_M4TOM0_ZCL_DIAG_SERVER_ALLOC, /* ZbZclDiagnosticsServerAlloc */
+
+ /* Reserved to 0x0fff for Future Use */
+
+ /* Test Hooks */
+ MSG_M4TOM0_TEST_CASE_CLEAR = 0x1000, /* ZbTestCaseClear */
+ MSG_M4TOM0_TEST_CASE_CURRENT, /* ZbTestCaseCurrent */
+ MSG_M4TOM0_TEST_CASE_DISABLE, /* ZbTestCaseDisable */
+ MSG_M4TOM0_TEST_CASE_ENABLE, /* ZbTestCaseEnable */
+ MSG_M4TOM0_APS_FRAG_DROP_ADD, /* ZbApsFragDropTxAdd */
+ MSG_M4TOM0_APS_FRAG_DROP_CLEAR, /* ZbApsFragDropTxClear */
+
+ /* Raw MCP Messages */
+ MSG_M4TOM0_WPAN_MCP_MSG,
+ MSG_M0TOM4_WPAN_MCP_MSG
+} MsgId_Zigbee_Enum_t;
+
+/* List of errors returned by the interface */
+typedef enum {
+ ERR_INTERFACE_IPCC_INIT_FAIL = 100U,
+ ERR_INTERFACE_IPCC_REMOTE_FAIL = 101U,
+ ERR_INTERFACE_IPCC_SEND_ACK_TO_M0 = 102U,
+} Error_Interface_Id_Enum_t;
+
+HAL_StatusTypeDef Zigbee_CallBackProcessing(void);
+HAL_StatusTypeDef Zigbee_LoggingProcessing(void);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* STM32WBxx_CORE_INTERFACE_DEF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/core/inc/zigbee_config.h b/Middlewares/ST/STM32_WPAN/zigbee/core/inc/zigbee_config.h
new file mode 100644
index 000000000..461248184
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/core/inc/zigbee_config.h
@@ -0,0 +1,24 @@
+/******************************************************************************
+ * @file 802_15_4_mac_config.h
+ * @author MDG-RF Team
+ * @brief Header for mac interface types
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+#ifndef _ZIGBEE_CONFIG_H
+#define _ZIGBEE_CONFIG_H
+
+#include <stdint.h>
+
+#endif /* _ZIGBEE_CONFIG_H */
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/core/inc/zigbee_core.h b/Middlewares/ST/STM32_WPAN/zigbee/core/inc/zigbee_core.h
new file mode 100644
index 000000000..14b099fc2
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/core/inc/zigbee_core.h
@@ -0,0 +1,48 @@
+/**
+ ******************************************************************************
+ * @file 802_15_4_mac_core.h
+ * @author MCD Application Team
+ * @brief This file contains all the defines and structures used for the
+ * communication between the two core M0 and M4.
+ * This file is shared between the code running on M4 and the code
+ * running on M0.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+#ifndef _ZIGBEE_CORE_H_
+#define _ZIGBEE_CORE_H_
+
+#include <stdint.h>
+
+#include "stm32wbxx_hal.h"
+#include "stm32wbxx_hal_def.h"
+#include "stm32wbxx_hal_cortex.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Gravity error level */
+typedef enum {
+ ERR_INTERFACE_FATAL = 1U,
+ ERR_INTERFACE_WARNING = 2U
+} Error_Interface_Level_Enum_t;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* _ZIGBEE_CORE_H_ */
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/core/inc/zigbee_errors.h b/Middlewares/ST/STM32_WPAN/zigbee/core/inc/zigbee_errors.h
new file mode 100644
index 000000000..2f954c21a
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/core/inc/zigbee_errors.h
@@ -0,0 +1,23 @@
+/**
+ ******************************************************************************
+ * @file zigbee_errors.h
+ * @author faarnal
+ * @brief
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+#ifndef STM32WB_M4_FIRMWARE_FIRMWARE_MIDDLEWARES_ST_STM32_WPAN_MAC_802_15_4_CORE_INC_802_15_4_MAC_ERRORS_H_
+#define STM32WB_M4_FIRMWARE_FIRMWARE_MIDDLEWARES_ST_STM32_WPAN_MAC_802_15_4_CORE_INC_802_15_4_MAC_ERRORS_H_
+
+#endif /* STM32WB_M4_FIRMWARE_FIRMWARE_MIDDLEWARES_ST_STM32_WPAN_MAC_802_15_4_CORE_INC_802_15_4_MAC_ERRORS_H_ */
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/core/inc/zigbee_interface.h b/Middlewares/ST/STM32_WPAN/zigbee/core/inc/zigbee_interface.h
new file mode 100644
index 000000000..f2c499887
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/core/inc/zigbee_interface.h
@@ -0,0 +1,43 @@
+/**
+ ******************************************************************************
+ * @file Zigbee_interface.h
+ * @author
+ * @brief Header for zigbee interface API (M4 side)
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+#ifndef _ZIGBEE_INTERFACE
+#define _ZIGBEE_INTERFACE
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+#include <stdbool.h>
+#include "zigbee_types.h"
+#include "stm32wbxx_core_interface_def.h"
+#include "zigbee.h"
+
+/* Exported defines ----------------------------------------------------------*/
+/* Exported types ------------------------------------------------------------*/
+/* Exported constants --------------------------------------------------------*/
+/* External variables --------------------------------------------------------*/
+/* Exported macros -----------------------------------------------------------*/
+/* Exported functions ------------------------------------------------------- */
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* _ZIGBEE_INTERFACE */
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/core/inc/zigbee_types.h b/Middlewares/ST/STM32_WPAN/zigbee/core/inc/zigbee_types.h
new file mode 100644
index 000000000..dba127805
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/core/inc/zigbee_types.h
@@ -0,0 +1,27 @@
+/**
+ ******************************************************************************
+ * @file 802_15_4_mac_types.h
+ * @author MDG-RF Team
+ * @brief Header for mac interface types
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+#ifndef _ZIGBEE_TYPES_H_
+#define _ZIGBEE_TYPES_H_
+
+#include <stdint.h>
+
+#include "zigbee_config.h"
+
+#endif /* _ZIGBEE_TYPES_H_ */
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/core/src/zigbee_core_wb.c b/Middlewares/ST/STM32_WPAN/zigbee/core/src/zigbee_core_wb.c
new file mode 100644
index 000000000..4b9c6b296
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/core/src/zigbee_core_wb.c
@@ -0,0 +1,4284 @@
+/**
+ ******************************************************************************
+ * @file zigbee_core_wb.c
+ * @author MCD Application Team
+ * @brief Contains STM32WB specificities requested to control the Zigbee stack
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include <stdlib.h>
+#include <assert.h>
+
+#include "zigbee_errors.h"
+#include "zigbee_config.h"
+#include "zigbee_types.h"
+
+#include "zigbee_interface.h" /* zigbee.h, etc */
+#include "zcl/zcl.h"
+#include "local.zigbee.h" /* ZbHeap */
+#include "zcl/local_zcl.h"
+#include "zcl/key/zcl.key.h" /* ZbZclKeWithDevice */
+
+#include "zigbee_core.h"
+#include "tl_zigbee_hci.h"
+
+#include "dbg_trace.h"
+#include "stm_logging.h"
+#include "stm32wbxx_core_interface_def.h"
+
+#ifndef ZB_HEAP_MAX_ALLOC
+#define ZB_HEAP_MAX_ALLOC 2000U
+#endif
+
+/* Null (all zeroes)
+ * 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 */
+const uint8_t sec_key_null[ZB_SEC_KEYSIZE] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+/* "ZigBeeAlliance09"
+ * 5a:69:67:42:65:65:41:6c:6c:69:61:6e:63:65:30:39 */
+const uint8_t sec_key_ha[ZB_SEC_KEYSIZE] = {
+ 0x5a, 0x69, 0x67, 0x42, 0x65, 0x65, 0x41, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x63, 0x65, 0x30, 0x39
+};
+
+/* Uncertified Device's Distributed Link Key
+ * d0:d1:d2:d3:d4:d5:d6:d7:d8:d9:da:db:dc:dd:de:df */
+const uint8_t sec_key_distrib_uncert[ZB_SEC_KEYSIZE] = {
+ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf
+};
+
+/* TOUCHLINK_KEY_INDEX_CERTIFICATION key
+ * c0:c1:c2:c3:c4:c5:c6:c7:c8:c9:ca:cb:cc:cd:ce:cf */
+const uint8_t sec_key_touchlink_cert[ZB_SEC_KEYSIZE] = {
+ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf
+};
+
+struct aps_filter_cb {
+ void (*callback)(ZbApsdeDataIndT *data_ind, void *cb_arg);
+ void *cb_arg;
+};
+
+/* Helper struct to send to APS Binding */
+static const struct ZbApsAddrT sendToBinding = {
+ ZB_APSDE_ADDRMODE_NOTPRESENT,
+ 0xff,
+ 0xffff,
+ 0xffff,
+ 0,
+};
+const struct ZbApsAddrT *ZbApsAddrBinding = &sendToBinding;
+
+struct zb_ipc_m4_cb_info {
+ void *callback;
+ void *arg;
+};
+
+/* Single static callback for persistent data notifications */
+static void (*zb_persist_cb)(struct ZigBeeT *zb, void *cbarg) = NULL;
+static void *zb_persist_arg = NULL;
+
+/* Callback for ZbZdoMatchDescMulti. It is static and never freed. It can be overwritten
+ * by another call to ZbZdoMatchDescMulti. */
+static void (*zdo_match_multi_cb)(ZbZdoMatchDescRspT *ind, void *cb_arg) = NULL;
+
+static void ZbZclAttrFreeAttr(struct ZbZclClusterT *clusterPtr, struct ZbZclAttrListEntryT *attrPtr);
+
+/* Some globals */
+struct zb_ipc_globals {
+ struct ZigBeeT *zb;
+ /* Stack logging callback */
+ uint32_t log_mask;
+ bool log_enable;
+};
+static struct zb_ipc_globals zb_ipc_globals;
+
+struct cli_app;
+extern void cli_port_print_msg(struct cli_app *cli_p, const char *msg);
+
+void
+zb_ipc_m4_stack_logging_config(bool enable)
+{
+ uint32_t mask = 0U;
+
+ zb_ipc_globals.log_enable = enable;
+
+ /* Now reconfigure the logging on the M0. If log_func == NULL, then we disable the M0
+ * sending log messages over the IPCC. Otherwise, it's enabled. We first need to get
+ * the current log mask in-use, before re-asserting it back to the M0. */
+ ZbGetLogging(zb_ipc_globals.zb, &mask, NULL);
+ ZbSetLogging(zb_ipc_globals.zb, mask, NULL);
+} /* zb_ipc_m4_stack_logging_config */
+
+static struct zb_ipc_m4_cb_info *
+zb_ipc_m4_cb_info_alloc(void *callback, void *arg)
+{
+ struct zb_ipc_m4_cb_info *info;
+
+ info = malloc(sizeof(struct zb_ipc_m4_cb_info));
+ if (info != NULL) {
+ memset(info, 0, sizeof(struct zb_ipc_m4_cb_info));
+ info->callback = callback;
+ info->arg = arg;
+ }
+ return info;
+} /* zb_ipc_m4_cb_info_alloc */
+
+static void
+zb_ipc_m4_cb_info_free(struct zb_ipc_m4_cb_info *info)
+{
+ free(info);
+} /* zb_ipc_m4_cb_info_free */
+
+static uint32_t
+zb_ipc_m4_get_retval(void)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ uint32_t retval;
+
+ ipcc_req = ZIGBEE_Get_OTCmdRspPayloadBuffer();
+ assert(ipcc_req->Size == 1);
+ (void)ZbMemCpy(&retval, &ipcc_req->Data[0], 4);
+ return retval;
+} /* zb_ipc_m4_get_retval */
+
+bool
+wpan_get_uint32(struct WpanPublicT *publicPtr, enum mcp_attr_id attrId, uint32_t *value, uint16_t index)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ (void)publicPtr;
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_WPAN_GET_UINT32;
+ ipcc_req->Size = 3;
+ ipcc_req->Data[0] = (uint32_t)attrId;
+ ipcc_req->Data[1] = (uint32_t)value;
+ ipcc_req->Data[2] = (uint32_t)index;
+ ZIGBEE_CmdTransfer();
+ return zb_ipc_m4_get_retval() != 0U ? true : false;
+} /* wpan_get_uint32 */
+
+bool
+wpan_get_uint64(struct WpanPublicT *publicPtr, enum mcp_attr_id attrId, uint64_t *value, uint16_t index)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ (void)publicPtr;
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_WPAN_GET_UINT64;
+ ipcc_req->Size = 3;
+ ipcc_req->Data[0] = (uint32_t)attrId;
+ ipcc_req->Data[1] = (uint32_t)value;
+ ipcc_req->Data[2] = (uint32_t)index;
+ ZIGBEE_CmdTransfer();
+ return zb_ipc_m4_get_retval() != 0U ? true : false;
+} /* wpan_get_uint64 */
+
+unsigned int
+ZbHeapMaxAlloc(void)
+{
+ return ZB_HEAP_MAX_ALLOC;
+} /* ZbHeapMaxAlloc */
+
+struct ZigBeeT *
+ZbInit(uint64_t extAddr, ZbInitTblSizesT *tblSizes, ZbInitSetLoggingT *setLogging)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ if (zb_ipc_globals.zb != NULL) {
+ return NULL;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZB_INIT;
+ ipcc_req->Size = 4;
+ (void)ZbMemCpy(&ipcc_req->Data[0], &extAddr, 8);
+ ipcc_req->Data[2] = (uint32_t)tblSizes;
+ ipcc_req->Data[3] = (uint32_t)setLogging;
+ ZIGBEE_CmdTransfer();
+ zb_ipc_globals.zb = (struct ZigBeeT *)zb_ipc_m4_get_retval();
+ if (setLogging != NULL) {
+ /* Save the log mask */
+ zb_ipc_globals.log_mask = setLogging->mask;
+ }
+ return zb_ipc_globals.zb;
+} /* ZbInit */
+
+void
+ZbDestroy(struct ZigBeeT *zb)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ if (zb_ipc_globals.zb == NULL) {
+ return;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZB_DESTROY;
+ ipcc_req->Size = 0;
+ ZIGBEE_CmdTransfer();
+ zb_ipc_globals.zb = NULL;
+} /* ZbDestroy */
+
+void
+ZbSetLogging(struct ZigBeeT *zb, uint32_t mask,
+ void (*func)(struct ZigBeeT *zb, uint32_t mask, const char *hdr, const char *fmt, va_list argptr))
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_LOG_CONFIG;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = mask;
+ /* Ignore the 'func' argument. Only use zb_ipc_globals.log_enable to determine if we want
+ * log messages from the M4. If zb_ipc_globals.log_func != NULL, M0 sends log messages
+ * over IPCC. */
+ ipcc_req->Data[1] = zb_ipc_globals.log_enable ? 1U : 0U;
+ ZIGBEE_CmdTransfer();
+ /* Save the log mask */
+ zb_ipc_globals.log_mask = mask;
+} /* ZbSetLogging */
+
+void
+ZbGetLogging(struct ZigBeeT *zb, uint32_t *mask,
+ void(**func)(struct ZigBeeT *zb, uint32_t mask, const char *hdr, const char *fmt, va_list argptr))
+{
+ if (mask != NULL) {
+ *mask = zb_ipc_globals.log_mask;
+ }
+ if (func != NULL) {
+ *func = NULL;
+ }
+} /* ZbGetLogging */
+
+uint64_t
+ZbExtendedAddress(struct ZigBeeT *zb)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ uint64_t ext_addr;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_EXTADDR_GET;
+ ipcc_req->Size = 0;
+ ZIGBEE_CmdTransfer();
+ ipcc_req = ZIGBEE_Get_OTCmdRspPayloadBuffer();
+ assert(ipcc_req->Size == 2);
+ (void)ZbMemCpy(&ext_addr, &ipcc_req->Data, 8);
+ return ext_addr;
+} /* ZbExtendedAddress */
+
+uint16_t
+ZbShortAddress(struct ZigBeeT *zb)
+{
+ uint16_t nwkAddr;
+
+ (void)ZbNwkGet(zb, ZB_NWK_NIB_ID_NetworkAddress, &nwkAddr, sizeof(nwkAddr));
+ return nwkAddr;
+} /* ZbShortAddress */
+
+void
+ZbChangeExtAddr(struct ZigBeeT *zb, uint64_t extAddr)
+{
+
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_EXTADDR_CHANGE;
+ ipcc_req->Size = 2;
+ (void)ZbMemCpy(&ipcc_req->Data[0], &extAddr, 8);
+ ZIGBEE_CmdTransfer();
+} /* ZbChangeExtAddr */
+
+uint8_t
+WpanGetNumChannelsFromMask(uint32_t mask, uint8_t *first_channel)
+{
+ uint8_t i, num_channels = 0;
+
+ if (first_channel) {
+ *first_channel = 0xff;
+ }
+ for (i = 0; i < WPAN_PAGE_CHANNELS_MAX; i++) {
+ if (((1 << i) & mask)) {
+ num_channels++;
+ if (first_channel && (*first_channel == 0xff)) {
+ *first_channel = i;
+ }
+ }
+ } /* for */
+ return num_channels;
+} /* WpanGetNumChannelsFromMask */
+
+void
+ZbStartupConfigGetProDefaults(struct ZbStartupT *configPtr)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_STARTUP_GET_CFG;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)configPtr;
+ ZIGBEE_CmdTransfer();
+} /* ZbStartupConfigGetProDefaults */
+
+void
+ZbStartupConfigGetProSeDefaults(struct ZbStartupT *configPtr)
+{
+ ZbStartupConfigGetProDefaults(configPtr);
+ /* Remove the default preconfigured link key by clearing it. */
+ (void)ZbMemSet(configPtr->security.preconfiguredLinkKey, 0, ZB_SEC_KEYSIZE);
+ /* Remove the distributed link key by clearing it. */
+ (void)ZbMemSet(configPtr->security.distributedGlobalKey, 0, ZB_SEC_KEYSIZE);
+} /* ZbStartupConfigGetProSeDefaults */
+
+enum ZbStatusCodeT
+ZbStartupCbkeConfig(struct ZigBeeT *zb, struct ZbStartupCbkeT *cbke_config)
+{
+ /* TODO - may be required for SE certification */
+ return ZB_APS_STATUS_NOT_SUPPORTED;
+} /* ZbStartupCbkeConfig */
+
+enum ZbStatusCodeT
+ZbStartup(struct ZigBeeT *zb, struct ZbStartupT *configPtr, void (*callback)(enum ZbStatusCodeT status, void *cb_arg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info;
+
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, arg);
+ if (info == NULL) {
+ return ZB_STATUS_ALLOC_FAIL;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_STARTUP_REQ;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)configPtr;
+ ipcc_req->Data[1] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ return (enum ZbStatusCodeT)zb_ipc_m4_get_retval();
+ /* Followed up in MSG_M0TOM4_STARTUP_CB handler */
+} /* ZbStartup */
+
+enum ZbStatusCodeT
+ZbStartupRejoin(struct ZigBeeT *zb, void (*callback)(ZbNlmeJoinConfT *conf, void *arg), void *cbarg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info;
+
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, cbarg);
+ if (info == NULL) {
+ return ZB_STATUS_ALLOC_FAIL;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_STARTUP_REJOIN;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ return (enum ZbStatusCodeT)zb_ipc_m4_get_retval();
+ /* Followed up in MSG_M0TOM4_STARTUP_REJOIN_CB handler */
+} /* ZbStartupRejoin */
+
+enum ZbStatusCodeT
+ZbStartupPersist(struct ZigBeeT *zb, const void *pdata, unsigned int plen, struct ZbStartupCbkeT *cbke_config)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_STARTUP_PERSIST;
+ ipcc_req->Size = 3;
+ ipcc_req->Data[0] = (uint32_t)pdata;
+ ipcc_req->Data[1] = (uint32_t)plen;
+ ipcc_req->Data[2] = (uint32_t)cbke_config;
+ ZIGBEE_CmdTransfer();
+ return (enum ZbStatusCodeT)zb_ipc_m4_get_retval();
+} /* ZbStartupPersist */
+
+enum ZbStatusCodeT
+ZbStartupFindBindStart(struct ZigBeeT *zb, void (*callback)(enum ZbStatusCodeT status, void *arg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info;
+ enum ZbStatusCodeT status;
+
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, arg);
+ if (info == NULL) {
+ return ZB_STATUS_ALLOC_FAIL;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_STARTUP_FINDBIND;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ status = (enum ZbStatusCodeT)zb_ipc_m4_get_retval();
+ if (status != ZB_STATUS_SUCCESS) {
+ zb_ipc_m4_cb_info_free(info);
+ }
+ return status;
+ /* Followed up in MSG_M0TOM4_STARTUP_FINDBIND_CB handler */
+} /* ZbStartupFindBindStart */
+
+enum ZbStatusCodeT
+ZbStartupTouchlinkTargetStop(struct ZigBeeT *zb)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_STARTUP_TOUCHLINK_TARGET_STOP;
+ ipcc_req->Size = 0;
+ ZIGBEE_CmdTransfer();
+ return (enum ZbStatusCodeT)zb_ipc_m4_get_retval();
+} /* ZbStartupTouchlinkTargetStop */
+
+bool
+ZbStartupTcsoStart(struct ZigBeeT *zb, void (*callback)(enum ZbTcsoStatusT status, void *arg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info;
+ bool retval;
+
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, arg);
+ if (info == NULL) {
+ return false;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_STARTUP_TCSO_START;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ retval = zb_ipc_m4_get_retval() != 0U ? true : false;
+ if (!retval) {
+ zb_ipc_m4_cb_info_free(info);
+ }
+ return retval;
+ /* Followed up in MSG_M0TOM4_STARTUP_TCSO_CB */
+} /* ZbStartupTcsoStart */
+
+void
+ZbStartupTcsoAbort(struct ZigBeeT *zb)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_STARTUP_TCSO_ABORT;
+ ipcc_req->Size = 0;
+ ZIGBEE_CmdTransfer();
+} /* ZbStartupTcsoAbort */
+
+enum ZbStatusCodeT
+ZbTrustCenterRejoin(struct ZigBeeT *zb, void (*callback)(enum ZbStatusCodeT status, void *arg), void *cbarg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info;
+
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, cbarg);
+ if (info == NULL) {
+ return ZB_STATUS_ALLOC_FAIL;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_STARTUP_TC_REJOIN;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ return zb_ipc_m4_get_retval();
+ /* Followed up in MSG_M0TOM4_STARTUP_TC_REJOIN_CB handler */
+} /* ZbTrustCenterRejoin */
+
+bool
+ZbPersistNotifyRegister(struct ZigBeeT *zb, void (*callback)(struct ZigBeeT *zb, void *cbarg), void *cbarg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ bool result;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_PERSIST_ENABLE;
+ ipcc_req->Size = 0;
+ ZIGBEE_CmdTransfer();
+ result = zb_ipc_m4_get_retval() != 0U ? true : false;
+ if (result) {
+ zb_persist_arg = cbarg;
+ zb_persist_cb = callback;
+ }
+ else {
+ zb_persist_arg = NULL;
+ zb_persist_cb = NULL;
+ }
+ return result;
+ /* Followed up by M0 calls to MSG_M0TOM4_PERSIST_CB */
+} /* ZbPersistNotifyRegister */
+
+unsigned int
+ZbPersistGet(struct ZigBeeT *zb, uint8_t *buf, unsigned int maxlen)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_PERSIST_GET;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)buf;
+ ipcc_req->Data[1] = (uint32_t)maxlen;
+ ZIGBEE_CmdTransfer();
+ return zb_ipc_m4_get_retval();
+} /* ZbPersistGet */
+
+enum ZbStatusCodeT
+ZbLeaveReq(struct ZigBeeT *zb, void (*callback)(ZbNlmeLeaveConfT *conf, void *arg), void *cbarg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info;
+
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, cbarg);
+ if (info == NULL) {
+ return ZB_STATUS_ALLOC_FAIL;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZB_LEAVE_REQ;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ return (enum ZbStatusCodeT)zb_ipc_m4_get_retval();
+ /* Followed up in MSG_M0TOM4_ZB_LEAVE_CB handler */
+} /* ZbLeaveReq */
+
+void
+ZbReset(struct ZigBeeT *zb)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZB_RESET_REQ;
+ ipcc_req->Size = 0;
+ ZIGBEE_CmdTransfer();
+} /* ZbReset */
+
+/******************************************************************************
+ * ECDSA Signature
+ ******************************************************************************
+ */
+enum ZbStatusCodeT
+ZbSecEcdsaValidate(struct ZigBeeT *zb, enum ZbSecEcdsaSigType sig_type,
+ const uint8_t *ca_pub_key_array, unsigned int ca_pub_key_len,
+ const uint8_t *certificate, const uint8_t *signature, uint8_t *image_digest, uint8_t *cert_digest)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZB_SEC_ECDSA_VALIDATE;
+ ipcc_req->Size = 7;
+ ipcc_req->Data[0] = (uint32_t)sig_type;
+ ipcc_req->Data[1] = (uint32_t)ca_pub_key_array;
+ ipcc_req->Data[2] = (uint32_t)ca_pub_key_len;
+ ipcc_req->Data[3] = (uint32_t)certificate;
+ ipcc_req->Data[4] = (uint32_t)signature;
+ ipcc_req->Data[5] = (uint32_t)image_digest;
+ ipcc_req->Data[6] = (uint32_t)cert_digest;
+ ZIGBEE_CmdTransfer();
+ return (enum ZbStatusCodeT)zb_ipc_m4_get_retval();
+} /* ZbSecEcdsaValidate */
+
+/******************************************************************************
+ * BDB
+ ******************************************************************************
+ */
+enum ZbStatusCodeT
+ZbBdbGetIndex(struct ZigBeeT *zb, enum ZbBdbAttrIdT attrId, void *attrPtr,
+ unsigned int attrSz, unsigned int attrIndex)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ ZbBdbGetReqT bdbGetReq;
+ ZbBdbGetConfT bdbGetConf;
+
+ /* Do the BDB-GET.request */
+ bdbGetReq.attrId = attrId;
+ bdbGetReq.attr = attrPtr;
+ bdbGetReq.attrLength = attrSz;
+ bdbGetReq.attrIndex = attrIndex;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_BDB_GET_REQ;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)&bdbGetReq;
+ ipcc_req->Data[1] = (uint32_t)&bdbGetConf;
+ ZIGBEE_CmdTransfer();
+ return bdbGetConf.status;
+} /* ZbBdbGetIndex */
+
+enum ZbStatusCodeT
+ZbBdbSetIndex(struct ZigBeeT *zb, enum ZbBdbAttrIdT attrId, const void *attrPtr,
+ unsigned int attrSz, unsigned int attrIndex)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ ZbBdbSetReqT bdbSetReq;
+ ZbBdbSetConfT bdbSetConf;
+
+ /* Do the BDB-SET.request */
+ bdbSetReq.attrId = attrId;
+ bdbSetReq.attr = attrPtr;
+ bdbSetReq.attrLength = attrSz;
+ bdbSetReq.attrIndex = attrIndex;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_BDB_SET_REQ;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)&bdbSetReq;
+ ipcc_req->Data[1] = (uint32_t)&bdbSetConf;
+ ZIGBEE_CmdTransfer();
+ return bdbSetConf.status;
+} /* ZbBdbSetIndex */
+
+/* ZbBdbSetEndpointStatus is required for the Identify Server Cluster */
+void
+ZbBdbSetEndpointStatus(struct ZigBeeT *zb, enum ZbBdbCommissioningStatusT status, uint8_t endpoint)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_BDB_SET_EP_STATUS;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)status;
+ ipcc_req->Data[1] = (uint32_t)endpoint;
+ ZIGBEE_CmdTransfer();
+} /* ZbBdbSetEndpointStatus */
+
+/******************************************************************************
+ * APS
+ ******************************************************************************
+ */
+enum ZbStatusCodeT
+ZbApsdeDataReqCallback(struct ZigBeeT *zb, ZbApsdeDataReqT *req, void (*callback)(ZbApsdeDataConfT *conf, void *arg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ uint32_t retval;
+ struct zb_ipc_m4_cb_info *info;
+
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, arg);
+ if (info == NULL) {
+ return ZB_STATUS_ALLOC_FAIL;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_APSDE_DATA_REQ;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ipcc_req->Data[1] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ /* Get the status code */
+ retval = zb_ipc_m4_get_retval();
+ if (retval != 0x00) {
+ zb_ipc_m4_cb_info_free(info);
+ }
+ return (enum ZbStatusCodeT)retval;
+ /* If success, followed up in MSG_M0TOM4_APSDE_DATA_REQ_CB handler */
+} /* ZbApsdeDataReqCallback */
+
+void
+ZbApsmeAddEndpoint(struct ZigBeeT *zb, ZbApsmeAddEndpointReqT *r, ZbApsmeAddEndpointConfT *c)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_APS_ENDPOINT_ADD;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)r;
+ ipcc_req->Data[1] = (uint32_t)c;
+ ZIGBEE_CmdTransfer();
+} /* ZbApsmeAddEndpoint */
+
+void
+ZbApsmeRemoveEndpoint(struct ZigBeeT *zb, ZbApsmeRemoveEndpointReqT *r, ZbApsmeRemoveEndpointConfT *c)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_APS_ENDPOINT_DEL;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)r;
+ ipcc_req->Data[1] = (uint32_t)c;
+ ZIGBEE_CmdTransfer();
+} /* ZbApsmeRemoveEndpoint */
+
+struct ZbApsFilterT *
+ZbApsFilterEndpointAdd(struct ZigBeeT *zb, uint8_t endpoint, uint16_t profileId,
+ void (*callback)(ZbApsdeDataIndT *dataInd, void *cb_arg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct aps_filter_cb *aps_filter_cb;
+ struct ZbApsFilterT *filter;
+
+ /* FIXME - track these allocations so they can be freed later? */
+ aps_filter_cb = malloc(sizeof(struct aps_filter_cb));
+ if (aps_filter_cb == NULL) {
+ return NULL;
+ }
+ aps_filter_cb->callback = callback;
+ aps_filter_cb->cb_arg = arg;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_APS_FILTER_ENDPOINT_ADD;
+ ipcc_req->Size = 3;
+ ipcc_req->Data[0] = (uint32_t)endpoint;
+ ipcc_req->Data[1] = (uint32_t)profileId;
+ ipcc_req->Data[2] = (uint32_t)aps_filter_cb;
+ ZIGBEE_CmdTransfer();
+ filter = (struct ZbApsFilterT *)zb_ipc_m4_get_retval();
+ if (filter == NULL) {
+ free(aps_filter_cb);
+ }
+ /* Callbacks go to MSG_M0TOM4_APS_FILTER_ENDPOINT_CB handler */
+ return filter;
+} /* ZbApsFilterEndpointAdd */
+
+bool
+ZbApsmeEndpointConfigNoMatchCallback(struct ZigBeeT *zb, uint8_t endpoint, void (*callback)(ZbApsdeDataIndT *ind, void *arg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct aps_filter_cb *aps_filter_cb;
+ bool retval;
+
+ /* FIXME - track these allocations so they can be freed later? */
+ aps_filter_cb = malloc(sizeof(struct aps_filter_cb));
+ if (aps_filter_cb == NULL) {
+ return false;
+ }
+ aps_filter_cb->callback = callback;
+ aps_filter_cb->cb_arg = arg;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_APS_FILTER_ENDPOINT_NOMATCH_ADD;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)endpoint;
+ ipcc_req->Data[1] = (uint32_t)aps_filter_cb;
+ ZIGBEE_CmdTransfer();
+ retval = zb_ipc_m4_get_retval() != 0U ? true : false;
+ if (!retval) {
+ free(aps_filter_cb);
+ }
+ /* Callbacks go to MSG_M0TOM4_APS_FILTER_ENDPOINT_CB handler */
+ return retval;
+} /* ZbApsmeEndpointConfigNoMatchCallback */
+
+struct ZbApsFilterT *
+ZbApsFilterClusterAdd(struct ZigBeeT *zb, uint8_t endpoint, uint16_t clusterId, uint16_t profileId,
+ void (*callback)(ZbApsdeDataIndT *dataInd, void *cb_arg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct aps_filter_cb *aps_filter_cb;
+ struct ZbApsFilterT *filter;
+
+ /* FIXME - track these allocations so they can be freed later. */
+ aps_filter_cb = malloc(sizeof(struct aps_filter_cb));
+ if (aps_filter_cb == NULL) {
+ return NULL;
+ }
+ aps_filter_cb->callback = callback;
+ aps_filter_cb->cb_arg = arg;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_APS_FILTER_CLUSTER_ADD;
+ ipcc_req->Size = 4;
+ ipcc_req->Data[0] = (uint32_t)endpoint;
+ ipcc_req->Data[1] = (uint32_t)clusterId;
+ ipcc_req->Data[2] = (uint32_t)profileId;
+ ipcc_req->Data[3] = (uint32_t)aps_filter_cb;
+ ZIGBEE_CmdTransfer();
+ filter = (struct ZbApsFilterT *)zb_ipc_m4_get_retval();
+ if (filter == NULL) {
+ free(aps_filter_cb);
+ }
+ /* Callbacks go to MSG_M0TOM4_APS_FILTER_CLUSTER_CB handler */
+ return filter;
+} /* ZbApsFilterClusterAdd */
+
+bool
+ZbApsmeEndpointClusterListAppend(struct ZigBeeT *zb, uint8_t endpoint, uint16_t cluster_id, bool is_input)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_APS_EP_CLUSTER_ID_ADD;
+ ipcc_req->Size = 3;
+ ipcc_req->Data[0] = (uint32_t)endpoint;
+ ipcc_req->Data[1] = (uint32_t)cluster_id;
+ ipcc_req->Data[2] = (uint32_t)is_input;
+ ZIGBEE_CmdTransfer();
+ return zb_ipc_m4_get_retval() != 0U ? true : false;
+} /* ZbApsmeEndpointClusterListAppend */
+
+void
+ZbApsFilterRemove(struct ZigBeeT *zb, struct ZbApsFilterT *filter)
+{
+ ZbEnterCritical(zb);
+ LINK_LIST_UNLINK(&filter->link);
+ ZbExitCritical(zb);
+} /* ZbApsFilterRemove */
+
+bool
+ZbApsEndpointExists(struct ZigBeeT *zb, uint8_t endpoint)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_APS_EP_EXISTS;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)endpoint;
+ ZIGBEE_CmdTransfer();
+ return zb_ipc_m4_get_retval() != 0U ? true : false;
+} /* ZbApsEndpointExists */
+
+uint16_t
+ZbApsEndpointProfile(struct ZigBeeT *zb, uint8_t endpoint)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_APS_EP_GET_PROFILE;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)endpoint;
+ ZIGBEE_CmdTransfer();
+ return (uint16_t)zb_ipc_m4_get_retval();
+} /* ZbApsEndpointProfile */
+
+bool
+ZbApsAddrIsBcast(struct ZbApsAddrT *addr)
+{
+ /* Check the destination of the original request */
+ if (addr->mode == ZB_APSDE_ADDRMODE_GROUP) {
+ return true;
+ }
+ if ((addr->mode == ZB_APSDE_ADDRMODE_SHORT) && (ZbNwkAddrIsBcast(addr->nwkAddr))) {
+ return true;
+ }
+ return false;
+} /* ZbApsAddrIsBcast */
+
+bool
+ZbApsAddrIsLocal(struct ZigBeeT *zb, struct ZbApsAddrT *addr)
+{
+ if (addr->mode == ZB_APSDE_ADDRMODE_EXT) {
+ if (addr->extAddr == ZbExtendedAddress(zb)) {
+ return true;
+ }
+ }
+ if (addr->mode == ZB_APSDE_ADDRMODE_SHORT) {
+ if (addr->nwkAddr == ZbShortAddress(zb)) {
+ /* Note, if our address is ZB_NWK_ADDR_UNDEFINED, then this message could only
+ * have been generated locally. */
+ return true;
+ }
+ }
+ return false;
+} /* ZbApsAddrIsLocal */
+
+enum ZbStatusCodeT
+ZbApsGetIndex(struct ZigBeeT *zb, enum ZbApsmeIbAttrIdT attrId, void *attrPtr, unsigned int attrSz, unsigned int attrIndex)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ ZbApsmeGetReqT apsmeGetReq;
+ ZbApsmeGetConfT apsmeGetConf;
+
+ /* Do the APSME-GET.request */
+ apsmeGetReq.attrId = attrId;
+ apsmeGetReq.attr = attrPtr;
+ apsmeGetReq.attrLength = attrSz;
+ apsmeGetReq.attrIndex = attrIndex;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_APS_GET_REQ;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)&apsmeGetReq;
+ ipcc_req->Data[1] = (uint32_t)&apsmeGetConf;
+ ZIGBEE_CmdTransfer();
+ return apsmeGetConf.status;
+} /* ZbApsGetIndex */
+
+enum ZbStatusCodeT
+ZbApsSetIndex(struct ZigBeeT *zb, enum ZbApsmeIbAttrIdT attrId, const void *attrPtr, unsigned int attrSz, unsigned int attrIndex)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ ZbApsmeSetReqT apsmeSetReq;
+ ZbApsmeSetConfT apsmeSetConf;
+
+ /* Do the APSME-SET.request */
+ apsmeSetReq.attrId = attrId;
+ apsmeSetReq.attr = attrPtr;
+ apsmeSetReq.attrLength = attrSz;
+ apsmeSetReq.attrIndex = attrIndex;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_APS_SET_REQ;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)&apsmeSetReq;
+ ipcc_req->Data[1] = (uint32_t)&apsmeSetConf;
+ ZIGBEE_CmdTransfer();
+ return apsmeSetConf.status;
+} /* ZbApsSetIndex */
+
+void
+ZbApsmeAddGroupReq(struct ZigBeeT *zb, ZbApsmeAddGroupReqT *r, ZbApsmeAddGroupConfT *c)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_APSME_ADD_GROUP;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)r;
+ ipcc_req->Data[1] = (uint32_t)c;
+ ZIGBEE_CmdTransfer();
+} /* ZbApsmeAddGroupReq */
+
+void
+ZbApsmeRemoveGroupReq(struct ZigBeeT *zb, ZbApsmeRemoveGroupReqT *r, ZbApsmeRemoveGroupConfT *c)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_APSME_REMOVE_GROUP;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)r;
+ ipcc_req->Data[1] = (uint32_t)c;
+ ZIGBEE_CmdTransfer();
+} /* ZbApsmeRemoveGroupReq */
+
+void
+ZbApsmeRemoveAllGroupsReq(struct ZigBeeT *zb, ZbApsmeRemoveAllGroupsReqT *r, ZbApsmeRemoveAllGroupsConfT *c)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_APSME_REMOVE_ALL_GROUPS;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)r;
+ ipcc_req->Data[1] = (uint32_t)c;
+ ZIGBEE_CmdTransfer();
+} /* ZbApsmeRemoveAllGroupsReq */
+
+bool
+ZbApsGroupIsMember(struct ZigBeeT *zb, uint16_t groupAddr, uint8_t endpoint)
+{
+ ZbApsmeGroupT group;
+ unsigned int i;
+ enum ZbStatusCodeT status;
+
+ ZbEnterCritical(zb);
+ for (i = 0;; i++) {
+ status = ZbApsGetIndex(zb, ZB_APS_IB_ID_GROUP_TABLE, &group, sizeof(group), i);
+ if (status != ZB_APS_STATUS_SUCCESS) {
+ break;
+ }
+ /* Check for valid entries. */
+ if (group.endpoint == ZB_ENDPOINT_BCAST) {
+ continue;
+ }
+ /* Check if we're a member of this group. */
+ if (group.groupAddr != groupAddr) {
+ continue;
+ }
+ if ((endpoint != ZB_ENDPOINT_BCAST) && (group.endpoint != endpoint)) {
+ continue;
+ }
+ /* We are a member. */
+ ZbExitCritical(zb);
+ return true;
+ } /* for */
+ ZbExitCritical(zb);
+ return false;
+} /* ZbApsGroupIsMember */
+
+/* Helper to iterate through the Groups table using the APSME-GET interface */
+uint8_t
+ZbApsGroupsGetCapacity(struct ZigBeeT *zb)
+{
+ ZbApsmeGroupT group;
+ unsigned int i, num_found = 0;
+ enum ZbStatusCodeT status;
+
+ ZbEnterCritical(zb);
+ for (i = 0;; i++) {
+ status = ZbApsGetIndex(zb, ZB_APS_IB_ID_GROUP_TABLE, &group, sizeof(group), i);
+ if (status != ZB_APS_STATUS_SUCCESS) {
+ break;
+ }
+ if (group.endpoint == ZB_ENDPOINT_BCAST) {
+ continue;
+ }
+ num_found++;
+ } /* for */
+ ZbExitCritical(zb);
+ return (uint8_t)(i - num_found);
+} /* ZbApsGroupsGetCapacity */
+
+/* Helper to iterate through the Groups table using the APSME-GET interface */
+uint8_t
+ZbApsGroupsGetMembership(struct ZigBeeT *zb, uint8_t endpoint, uint16_t *group_list, uint8_t max_len)
+{
+ ZbApsmeGroupT group;
+ unsigned int i, len = 0;
+ enum ZbStatusCodeT status;
+
+ ZbEnterCritical(zb);
+ for (i = 0;; i++) {
+ status = ZbApsGetIndex(zb, ZB_APS_IB_ID_GROUP_TABLE, &group, sizeof(group), i);
+ if (status != ZB_APS_STATUS_SUCCESS) {
+ break;
+ }
+ if (group.endpoint == ZB_ENDPOINT_BCAST) {
+ continue;
+ }
+ if (group.endpoint != endpoint) {
+ continue;
+ }
+ if (len >= max_len) {
+ /* ZCL Groups: "If the total number of groups will cause
+ * the maximum payload length of a ZigBee frame to be
+ * exceeded, then the Group list field shall contain only
+ * as many groups as will fit." */
+ break;
+ }
+ group_list[len++] = group.groupAddr;
+ } /* for */
+ ZbExitCritical(zb);
+ return len;
+} /* ZbApsGroupsGetMembership */
+
+void
+ZbApsmeBindReq(struct ZigBeeT *zb, ZbApsmeBindReqT *bindReqPtr, ZbApsmeBindConfT *bindConfPtr)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_APSME_BIND;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)bindReqPtr;
+ ipcc_req->Data[1] = (uint32_t)bindConfPtr;
+ ZIGBEE_CmdTransfer();
+} /* ZbApsmeBindReq */
+
+void
+ZbApsmeUnbindReq(struct ZigBeeT *zb, ZbApsmeUnbindReqT *unbindReqPtr, ZbApsmeUnbindConfT *unbindConfPtr)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_APSME_UNBIND;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)unbindReqPtr;
+ ipcc_req->Data[1] = (uint32_t)unbindConfPtr;
+ ZIGBEE_CmdTransfer();
+} /* ZbApsmeUnbindReq */
+
+void
+ZbApsUnbindAllReq(struct ZigBeeT *zb)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_APS_UNBIND_ALL;
+ ipcc_req->Size = 0;
+ ZIGBEE_CmdTransfer();
+} /* ZbApsUnbindAllReq */
+
+void
+ZbApsmeTransportKeyReq(struct ZigBeeT *zb, ZbApsmeTransportKeyReqT *req)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_APSME_TRANSPORT_KEY;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ZIGBEE_CmdTransfer();
+} /* ZbApsmeTransportKeyReq */
+
+void
+ZbApsmeRemoveDeviceReq(struct ZigBeeT *zb, ZbApsmeRemoveDeviceReqT *req)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_APSME_REMOVE_DEVICE;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ZIGBEE_CmdTransfer();
+} /* ZbApsmeRemoveDeviceReq */
+
+enum ZbStatusCodeT
+ZbApsmeRequestKeyReq(struct ZigBeeT *zb, ZbApsmeRequestKeyReqT *req)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_APSME_REQUEST_KEY;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ZIGBEE_CmdTransfer();
+ return (enum ZbStatusCodeT)zb_ipc_m4_get_retval();
+} /* ZbApsmeRequestKeyReq */
+
+void
+ZbApsmeSwitchKeyReq(struct ZigBeeT *zb, ZbApsmeSwitchKeyReqT *req)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_APSME_SWITCH_KEY;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ZIGBEE_CmdTransfer();
+} /* ZbApsmeSwitchKeyReq */
+
+void
+ZbApsmeAddKeyReq(struct ZigBeeT *zb, ZbApsmeAddKeyReqT *req, ZbApsmeAddKeyConfT *conf)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_APSME_ADD_KEY;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ipcc_req->Data[1] = (uint32_t)conf;
+ ZIGBEE_CmdTransfer();
+} /* ZbApsmeAddKeyReq */
+
+void
+ZbApsmeGetKeyReq(struct ZigBeeT *zb, ZbApsmeGetKeyReqT *req, ZbApsmeGetKeyConfT *conf)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_APSME_GET_KEY;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ipcc_req->Data[1] = (uint32_t)conf;
+ ZIGBEE_CmdTransfer();
+} /* ZbApsmeGetKeyReq */
+
+void
+ZbApsmeRemoveKeyReq(struct ZigBeeT *zb, ZbApsmeRemoveKeyReqT *req, ZbApsmeRemoveKeyConfT *conf)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_APSME_REMOVE_KEY;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ipcc_req->Data[1] = (uint32_t)conf;
+ ZIGBEE_CmdTransfer();
+} /* ZbApsmeRemoveKeyReq */
+
+/******************************************************************************
+ * Zigbee Uptime
+ ******************************************************************************
+ */
+ZbUptimeT
+ZbUptime(void)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_UPTIME;
+ ipcc_req->Size = 0;
+ ZIGBEE_CmdTransfer();
+ return (ZbUptimeT)zb_ipc_m4_get_retval();
+} /* ZbUptime */
+
+/* If a value is greater than the high mark, and a second value is lower
+ * than the low mark, then the second value is deemed to have rolled-over
+ * when comparing the two values. */
+#define TIMER_ROLL_OVER_HIGH ((ZB_UPTIME_MAX / 2UL) + (ZB_UPTIME_MAX / 4UL))
+#define TIMER_ROLL_OVER_LOW ((ZB_UPTIME_MAX / 2UL) - (ZB_UPTIME_MAX / 4UL))
+
+unsigned int
+ZbTimeoutRemaining(ZbUptimeT now, ZbUptimeT expire_time)
+{
+ ZbUptimeT u_delta;
+
+ /* Check for 'timeout' rollover condition */
+ if ((now >= TIMER_ROLL_OVER_HIGH) && (expire_time <= TIMER_ROLL_OVER_LOW)) {
+ /* Timeout has rolled over, we haven't expired.
+ * Compute timeout remaining */
+ u_delta = (ZB_UPTIME_MAX - now) + expire_time + 1U;
+
+ return (unsigned int)u_delta;
+ }
+
+ /* Check for 'now' rollover condition */
+ if ((expire_time >= TIMER_ROLL_OVER_HIGH) && (now <= TIMER_ROLL_OVER_LOW)) {
+ /* 'now' has rolled over, so now is > timeout, meaning we expired. */
+ return 0;
+ }
+
+ /* No rollover, check if timer has expired */
+ if (now >= expire_time) {
+ /* Timer has expired */
+ return 0;
+ }
+
+ /* Compute time remaining */
+ u_delta = expire_time - now;
+
+ return (unsigned int)u_delta;
+} /* ZbTimeoutRemaining */
+
+/******************************************************************************
+* Zigbee Message Filters
+******************************************************************************
+*/
+struct zb_msg_filter_cb_info {
+ struct ZbMsgFilterT *filter;
+ int (*callback)(struct ZigBeeT *zb, uint32_t id, void *msg, void *cbarg);
+ void *arg;
+};
+
+#define ZB_IPC_MSG_FILTER_CB_LIST_MAX 4
+static struct zb_msg_filter_cb_info zb_msg_filter_cb_list[ZB_IPC_MSG_FILTER_CB_LIST_MAX];
+
+struct ZbMsgFilterT *
+ZbMsgFilterRegister(struct ZigBeeT *zb, uint32_t mask, uint8_t prio,
+ int (*callback)(struct ZigBeeT *zb, uint32_t id, void *msg, void *cbarg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct ZbMsgFilterT *filter;
+ struct zb_msg_filter_cb_info *cb_info;
+ unsigned int i;
+
+ for (i = 0; i < ZB_IPC_MSG_FILTER_CB_LIST_MAX; i++) {
+ cb_info = &zb_msg_filter_cb_list[i];
+ if (cb_info->filter == NULL) {
+ break;
+ }
+ }
+ if (i == ZB_IPC_MSG_FILTER_CB_LIST_MAX) {
+ return NULL;
+ }
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_FILTER_ADD;
+ ipcc_req->Size = 3;
+ ipcc_req->Data[0] = (uint32_t)mask;
+ ipcc_req->Data[1] = (uint32_t)prio;
+ ipcc_req->Data[2] = (uint32_t)cb_info;
+ ZIGBEE_CmdTransfer();
+ filter = (struct ZbMsgFilterT *)zb_ipc_m4_get_retval();
+ if (filter != NULL) {
+ cb_info->filter = filter;
+ cb_info->callback = callback;
+ cb_info->arg = arg;
+ }
+ return filter;
+ /* Followed up by MSG_M0TOM4_FILTER_MSG_CB */
+} /* ZbMsgFilterRegister */
+
+void
+ZbMsgFilterRemove(struct ZigBeeT *zb, struct ZbMsgFilterT *filter)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_msg_filter_cb_info *cb_info;
+ unsigned int i;
+
+ if (filter == NULL) {
+ return;
+ }
+ for (i = 0; i < ZB_IPC_MSG_FILTER_CB_LIST_MAX; i++) {
+ cb_info = &zb_msg_filter_cb_list[i];
+ if (cb_info->filter == filter) {
+ break;
+ }
+ }
+ if (i == ZB_IPC_MSG_FILTER_CB_LIST_MAX) {
+ return;
+ }
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_FILTER_DEL;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)filter;
+ ZIGBEE_CmdTransfer();
+ cb_info->filter = NULL;
+} /* ZbMsgFilterRemove */
+
+/******************************************************************************
+ * Zigbee Timer API
+ ******************************************************************************
+ */
+
+/* M4 version of 'struct ZbTimerT'. It allows us to wrap up callback and arg into
+ * a single arg pointer when communicating with the M0. */
+struct ZbTimerT {
+ void (*callback)(struct ZigBeeT *zb, void *data);
+ void *arg;
+ void *m0_timer; /* Handle */
+};
+
+struct ZbTimerT *
+ZbTimerAlloc(struct ZigBeeT *zb, void (*callback)(struct ZigBeeT *zb, void *cn_arg), void *arg)
+{
+ struct ZbTimerT *timer;
+
+ timer = ZbHeapAlloc(NULL, sizeof(struct ZbTimerT));
+ if (timer != NULL) {
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ /* Configure the callback struct */
+ timer->callback = callback;
+ timer->arg = arg;
+
+ /* Pass this to the M0 (stack) */
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_TIMER_ALLOC;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)timer;
+ ZIGBEE_CmdTransfer();
+ timer->m0_timer = (void *)zb_ipc_m4_get_retval();
+ if (timer->m0_timer == NULL) {
+ ZbHeapFree(NULL, timer);
+ timer = NULL;
+ }
+ }
+ return timer;
+} /* ZbTimerAlloc */
+
+void
+ZbTimerChangeCallback(struct ZbTimerT *timer, void (*callback)(struct ZigBeeT *zb, void *cb_arg), void *arg)
+{
+ ZbTimerStop(timer);
+ timer->callback = callback;
+ timer->arg = arg;
+} /* ZbTimerChangeCallback */
+
+void
+ZbTimerFree(struct ZbTimerT *timer)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ /* Stop and free the timer on the M0 */
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_TIMER_FREE;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)timer->m0_timer;
+ ZIGBEE_CmdTransfer();
+
+ /* Free the timer struct on the M4 */
+ ZbHeapFree(NULL, timer);
+} /* ZbTimerFree */
+
+bool
+ZbTimerRunning(struct ZbTimerT *timer)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ uint32_t retval;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_TIMER_RUNNING;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)timer->m0_timer;
+ ZIGBEE_CmdTransfer();
+ retval = zb_ipc_m4_get_retval();
+ return retval != 0 ? true : false;
+} /* ZbTimerRunning */
+
+unsigned int
+ZbTimerRemaining(struct ZbTimerT *timer)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_TIMER_REMAINING;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)timer->m0_timer;
+ ZIGBEE_CmdTransfer();
+ return (unsigned int)zb_ipc_m4_get_retval();
+} /* ZbTimerRemaining */
+
+void
+ZbTimerStop(struct ZbTimerT *timer)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_TIMER_STOP;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)timer->m0_timer;
+ ZIGBEE_CmdTransfer();
+} /* ZbTimerStop */
+
+void
+ZbTimerReset(struct ZbTimerT *timer, unsigned int timeout)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_TIMER_RESET;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)timer->m0_timer;
+ ipcc_req->Data[1] = (uint32_t)timeout;
+ ZIGBEE_CmdTransfer();
+} /* ZbTimerReset */
+
+/******************************************************************************
+ * NWK
+ ******************************************************************************
+ */
+enum ZbStatusCodeT
+ZbNwkGetIndex(struct ZigBeeT *zb, enum ZbNwkNibAttrIdT attrId, void *attrPtr,
+ unsigned int attrSz, unsigned int attrIndex)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ ZbNlmeGetReqT nlmeGetReq;
+ ZbNlmeGetConfT nlmeGetConf;
+
+ /* Form the NLME-GET.request */
+ nlmeGetReq.attrId = attrId;
+ nlmeGetReq.attr = attrPtr;
+ nlmeGetReq.attrLength = attrSz;
+ nlmeGetReq.attrIndex = attrIndex;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_NWK_GET_INDEX;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)&nlmeGetReq;
+ ipcc_req->Data[1] = (uint32_t)&nlmeGetConf;
+ ZIGBEE_CmdTransfer();
+ return nlmeGetConf.status;
+} /* ZbNwkGetIndex */
+
+enum ZbStatusCodeT
+ZbNwkSetIndex(struct ZigBeeT *zb, enum ZbNwkNibAttrIdT attrId, void *attrPtr,
+ unsigned int attrSz, unsigned int attrIndex)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ ZbNlmeSetReqT nlmeSetReq;
+ ZbNlmeSetConfT nlmeSetConf;
+
+ /* Form the NLME-SET.request */
+ nlmeSetReq.attrId = attrId;
+ nlmeSetReq.attr = attrPtr;
+ nlmeSetReq.attrLength = attrSz;
+ nlmeSetReq.attrIndex = attrIndex;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_NWK_SET_INDEX;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)&nlmeSetReq;
+ ipcc_req->Data[1] = (uint32_t)&nlmeSetConf;
+ ZIGBEE_CmdTransfer();
+ return nlmeSetConf.status;
+} /* ZbNwkSetIndex */
+
+enum ZbStatusCodeT
+ZbNwkGet(struct ZigBeeT *zb, enum ZbNwkNibAttrIdT attrId, void *attrPtr, unsigned int attrSz)
+{
+ return ZbNwkGetIndex(zb, attrId, attrPtr, attrSz, 0);
+} /* ZbNwkGet */
+
+enum ZbStatusCodeT
+ZbNwkSet(struct ZigBeeT *zb, enum ZbNwkNibAttrIdT attrId, void *attrPtr, unsigned int attrSz)
+{
+ return ZbNwkSetIndex(zb, attrId, attrPtr, attrSz, 0);
+} /* ZbNwkSet */
+
+uint64_t
+ZbNwkGetParentExtAddr(struct ZigBeeT *zb)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ uint64_t ext_addr;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_NWK_GET_PARENT_EXT;
+ ipcc_req->Size = 0;
+ ZIGBEE_CmdTransfer();
+ /* Parse return value */
+ ipcc_req = ZIGBEE_Get_OTCmdRspPayloadBuffer();
+ assert(ipcc_req->Size == 2);
+ (void)ZbMemCpy(&ext_addr, &ipcc_req->Data[0], 8);
+ return ext_addr;
+} /* ZbNwkGetParentExtAddr */
+
+uint16_t
+ZbNwkGetParentShortAddr(struct ZigBeeT *zb)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_NWK_GET_PARENT_NWK;
+ ipcc_req->Size = 0;
+ ZIGBEE_CmdTransfer();
+ return (uint16_t)zb_ipc_m4_get_retval();
+} /* ZbNwkGetParentShortAddr */
+
+uint64_t
+ZbNwkAddrLookupExt(struct ZigBeeT *zb, uint16_t nwkAddr)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ uint64_t ext_addr;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_NWK_ADDR_LOOKUP_EXT;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)nwkAddr;
+ ZIGBEE_CmdTransfer();
+ /* Parse return value */
+ ipcc_req = ZIGBEE_Get_OTCmdRspPayloadBuffer();
+ assert(ipcc_req->Size == 2);
+ (void)ZbMemCpy(&ext_addr, &ipcc_req->Data[0], 8);
+ return ext_addr;
+} /* ZbNwkAddrLookupExt */
+
+uint16_t
+ZbNwkAddrLookupNwk(struct ZigBeeT *zb, uint64_t extAddr)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_NWK_ADDR_LOOKUP_NWK;
+ /* Extended address is split across two args */
+ ipcc_req->Size = 2;
+ memcpy(ipcc_req->Data, &extAddr, 8);
+ ZIGBEE_CmdTransfer();
+ return (uint16_t)zb_ipc_m4_get_retval();
+} /* ZbNwkAddrLookupNwk */
+
+bool
+ZbNwkAddrIsChildExt(struct ZigBeeT *zb, uint64_t extAddr, uint16_t *nwkAddrPtr)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_NWK_ADDR_IS_CHILD_EXT;
+ /* Extended address is split across two args */
+ ipcc_req->Size = 3;
+ memcpy(ipcc_req->Data, &extAddr, 8);
+ ipcc_req->Data[2] = (uint32_t)nwkAddrPtr;
+ ZIGBEE_CmdTransfer();
+ return zb_ipc_m4_get_retval() != 0U ? true : false;
+} /* ZbNwkAddrIsChildExt */
+
+bool
+ZbNwkAddrIsChildNwk(struct ZigBeeT *zb, uint16_t nwkAddr, uint64_t *extAddrPtr)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_NWK_ADDR_IS_CHILD_NWK;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)nwkAddr;
+ ipcc_req->Data[1] = (uint32_t)extAddrPtr;
+ ZIGBEE_CmdTransfer();
+ return zb_ipc_m4_get_retval() != 0U ? true : false;
+} /* ZbNwkAddrIsChildNwk */
+
+bool
+ZbNwkGetSecMaterial(struct ZigBeeT *zb, uint8_t keySeqno, ZbNwkSecMaterialT *material)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_NWK_GET_SEC_MATERIAL;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)keySeqno;
+ ipcc_req->Data[1] = (uint32_t)material;
+ ZIGBEE_CmdTransfer();
+ return zb_ipc_m4_get_retval() != 0U ? true : false;
+} /* ZbNwkGetSecMaterial */
+
+enum ZbStatusCodeT
+ZbNlmeNetDiscReq(struct ZigBeeT *zb, ZbNlmeNetDiscReqT *req,
+ void (*callback)(ZbNlmeNetDiscConfT *conf, void *cbarg), void *cbarg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info;
+
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, cbarg);
+ if (info == NULL) {
+ return ZB_STATUS_ALLOC_FAIL;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_NLME_NET_DISC;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ipcc_req->Data[1] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ return (enum ZbStatusCodeT)zb_ipc_m4_get_retval();
+ /* Followed up in MSG_M0TOM4_NLME_NET_DISC_CB handler */
+} /* ZbNlmeNetDiscReq */
+
+enum ZbStatusCodeT
+ZbNlmeLeaveReq(struct ZigBeeT *zb, ZbNlmeLeaveReqT *req,
+ void (*callback)(ZbNlmeLeaveConfT *leaveConfPtr, void *arg), void *cbarg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info;
+
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, cbarg);
+ if (info == NULL) {
+ return ZB_STATUS_ALLOC_FAIL;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_NLME_LEAVE;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ipcc_req->Data[1] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ return (enum ZbStatusCodeT)zb_ipc_m4_get_retval();
+ /* Followed up in MSG_M0TOM4_NLME_LEAVE_CB handler */
+} /* ZbNlmeLeaveReq */
+
+void
+ZbNlmePermitJoinReq(struct ZigBeeT *zb, ZbNlmePermitJoinReqT *req, ZbNlmePermitJoinConfT *conf)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_NLME_PERMIT_JOIN;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ipcc_req->Data[1] = (uint32_t)conf;
+ ZIGBEE_CmdTransfer();
+} /* ZbNlmePermitJoinReq */
+
+void
+ZbNlmeResetReq(struct ZigBeeT *zb, ZbNlmeResetReqT *req, ZbNlmeResetConfT *conf)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_NLME_RESET;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ipcc_req->Data[1] = (uint32_t)conf;
+ ZIGBEE_CmdTransfer();
+} /* ZbNlmeResetReq */
+
+enum ZbStatusCodeT
+ZbNlmeSyncReq(struct ZigBeeT *zb, ZbNlmeSyncReqT *req,
+ void (*callback)(ZbNlmeSyncConfT *syncConfPtr, void *arg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info;
+
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, arg);
+ if (info == NULL) {
+ return ZB_STATUS_ALLOC_FAIL;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_NLME_SYNC;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ipcc_req->Data[1] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ return (enum ZbStatusCodeT)zb_ipc_m4_get_retval();
+ /* Followed up in MSG_M0TOM4_NLME_SYNC_CB handler */
+} /* ZbNlmeSyncReq */
+
+enum ZbStatusCodeT
+ZbNlmeRouteDiscReq(struct ZigBeeT *zb, ZbNlmeRouteDiscReqT *req,
+ void (*callback)(ZbNlmeRouteDiscConfT *discConf, void *cbarg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info;
+
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, arg);
+ if (info == NULL) {
+ return ZB_STATUS_ALLOC_FAIL;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_NLME_ROUTE_DISC;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ipcc_req->Data[1] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ return (enum ZbStatusCodeT)zb_ipc_m4_get_retval();
+ /* Followed up in MSG_M0TOM4_NLME_ROUTE_DISC_CB handler */
+} /* ZbNlmeRouteDiscReq */
+
+enum WpanJoinPolicyT
+ZbNlmeJoiningPolicyGet(struct ZigBeeT *zb)
+{
+ /* This is only for zbcli. We don't need this for 2.4 GHz operation. */
+ return WPAN_JOIN_POLICY_ALL;
+} /* ZbNlmeJoiningPolicyGet */
+
+void
+ZbNwkNeighborClearAll(struct ZigBeeT *zb, bool keep_parent, bool keep_children)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_NWK_NNT_CLEAR_ALL;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)keep_parent;
+ ipcc_req->Data[1] = (uint32_t)keep_children;
+ ZIGBEE_CmdTransfer();
+} /* ZbNwkNeighborClearAll */
+
+void
+ZbNlmeDirectJoinReq(struct ZigBeeT *zb, ZbNlmeDirectJoinReqT *req, ZbNlmeDirectJoinConfT *conf)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_NLME_DIRECT_JOIN;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ipcc_req->Data[1] = (uint32_t)conf;
+ ZIGBEE_CmdTransfer();
+} /* ZbNlmeDirectJoinReq */
+
+void
+ZbNlmeSetInterface(struct ZigBeeT *zb, ZbNlmeSetInterfaceReqT *req, ZbNlmeSetInterfaceConfT *conf)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_NLME_SET_INTERFACE;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ipcc_req->Data[1] = (uint32_t)conf;
+ ZIGBEE_CmdTransfer();
+} /* ZbNlmeSetInterface */
+
+void
+ZbNlmeGetInterface(struct ZigBeeT *zb, ZbNlmeGetInterfaceReqT *req, ZbNlmeGetInterfaceConfT *conf)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_NLME_GET_INTERFACE;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ipcc_req->Data[1] = (uint32_t)conf;
+ ZIGBEE_CmdTransfer();
+} /* ZbNlmeGetInterface */
+
+bool
+ZbNwkIfSetTxPower(struct ZigBeeT *zb, const char *name, int8_t tx_power)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_NWK_IFC_SET_TX_POWER;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)name;
+ ipcc_req->Data[1] = (uint32_t)tx_power;
+ ZIGBEE_CmdTransfer();
+ return zb_ipc_m4_get_retval() != 0U ? true : false;
+} /* ZbNwkIfSetTxPower */
+
+bool
+ZbNwkIfGetTxPower(struct ZigBeeT *zb, const char *name, int8_t *tx_power)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_NWK_IFC_GET_TX_POWER;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)name;
+ ipcc_req->Data[1] = (uint32_t)tx_power;
+ ZIGBEE_CmdTransfer();
+ return zb_ipc_m4_get_retval() != 0U ? true : false;
+} /* ZbNwkIfGetTxPower */
+
+bool
+ZbNwkIfSetDsn(struct ZigBeeT *zb, const char *name, uint8_t macDsn)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_NWK_IFC_SET_DSN;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)name;
+ ipcc_req->Data[1] = (uint32_t)macDsn;
+ ZIGBEE_CmdTransfer();
+ return zb_ipc_m4_get_retval() != 0U ? true : false;
+}
+
+bool
+ZbNwkSetFrameCounter(struct ZigBeeT *zb, uint8_t keySeqno, uint64_t srcAddr, uint32_t newFrameCount)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_NWK_SET_FRAME_COUNTER;
+ ipcc_req->Size = 4;
+ ipcc_req->Data[0] = (uint32_t)keySeqno;
+ (void)ZbMemCpy(&ipcc_req->Data[1], &srcAddr, 8);
+ ipcc_req->Data[3] = (uint32_t)newFrameCount;
+ ZIGBEE_CmdTransfer();
+ return zb_ipc_m4_get_retval() != 0U ? true : false;
+} /* ZbNwkSetFrameCounter */
+
+bool
+ZbNwkFastPollRequest(struct ZigBeeT *zb)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_NWK_FAST_POLL_REQUEST;
+ ipcc_req->Size = 0;
+ ZIGBEE_CmdTransfer();
+ return zb_ipc_m4_get_retval() != 0U ? true : false;
+} /* ZbNwkFastPollRequest */
+
+bool
+ZbNwkFastPollRelease(struct ZigBeeT *zb)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_NWK_FAST_POLL_RELEASE;
+ ipcc_req->Size = 0;
+ ZIGBEE_CmdTransfer();
+ return zb_ipc_m4_get_retval() != 0U ? true : false;
+} /* ZbNwkFastPollRelease */
+
+unsigned int
+ZbNwkFastPollResourceCount(struct ZigBeeT *zb)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_NWK_FAST_POLL_RESOURCE;
+ ipcc_req->Size = 0;
+ ZIGBEE_CmdTransfer();
+ return zb_ipc_m4_get_retval();
+} /* ZbNwkFastPollResourceCount */
+
+/* Only required by zbcli. And only helps with automated verification of test cases.
+ * Do not use for certification. */
+void
+ZbNwkAddrSetNextChildAddr(struct ZigBeeT *zb, uint16_t nextChildAddr)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_NWK_SET_NEXT_CHILD_ADDR;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)nextChildAddr;
+ ZIGBEE_CmdTransfer();
+} /* ZbNwkAddrSetNextChildAddr */
+
+/* Required for zigbee certification only. May not be required for a DUT though. */
+bool
+nwk_status_send(struct ZigBeeT *zb, uint16_t dstAddr, enum ZbNwkAddrModeT dstAddrMode,
+ uint16_t statusAddr, enum ZbNwkNetworkStatusCodeT statusCode)
+{
+ /* TODO? */
+ return false;
+} /* nwk_status_send */
+
+/* Required for zigbee certification only. May not be required for a DUT though. */
+bool
+nwk_rreq_by_route_is_active(struct ZigBeeT *zb, ZbNwkRouteEntryT *route)
+{
+ /* TODO? */
+ return false;
+} /* nwk_rreq_by_route_is_active */
+
+bool
+ZbNwkSendEdkaReq(struct ZigBeeT *zb)
+{
+ /* TODO - may be required for a true sleepy device, where application wants
+ * full control of when device polls for data. */
+ return false;
+}
+
+/******************************************************************************
+ * ZDO Utility
+ ******************************************************************************
+ */
+struct zdo_device_annce_cb_info {
+ struct ZbZdoDeviceAnnceFilterT *handle;
+ void (*callback)(struct ZigBeeT *zb, ZbZdoDeviceAnnceT *annce, uint8_t seqno);
+};
+
+#define ZB_IPC_ZDO_DEVICE_ANNCE_CB_LIST_MAX 4
+static struct zdo_device_annce_cb_info zdo_device_annce_cb_list[ZB_IPC_ZDO_DEVICE_ANNCE_CB_LIST_MAX];
+
+struct ZbZdoDeviceAnnceFilterT *
+ZbZdoDeviceAnnceFilterRegister(struct ZigBeeT *zb,
+ void (*callback)(struct ZigBeeT *zb, ZbZdoDeviceAnnceT *annce, uint8_t seqno))
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct ZbZdoDeviceAnnceFilterT *handle;
+ struct zdo_device_annce_cb_info *cb_info;
+ unsigned int i;
+
+ if (callback == NULL) {
+ return NULL;
+ }
+ for (i = 0; i < ZB_IPC_ZDO_DEVICE_ANNCE_CB_LIST_MAX; i++) {
+ cb_info = &zdo_device_annce_cb_list[i];
+ if (cb_info->handle == NULL) {
+ break;
+ }
+ }
+ if (i == ZB_IPC_ZDO_DEVICE_ANNCE_CB_LIST_MAX) {
+ return NULL;
+ }
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZDO_DEVICE_ANNCE_FILTER_REG;
+ ipcc_req->Size = 0;
+ ZIGBEE_CmdTransfer();
+ handle = (struct ZbZdoDeviceAnnceFilterT *)zb_ipc_m4_get_retval();
+ if (handle != NULL) {
+ cb_info->handle = handle;
+ cb_info->callback = callback;
+ }
+ return handle;
+ /* Followed up in MSG_M0TOM4_ZDO_DEVICE_ANNCE_FILTER_CB handler */
+} /* ZbZdoDeviceAnnceFilterRegister */
+
+void
+ZbZdoDeviceAnnceFilterRemove(struct ZigBeeT *zb, struct ZbZdoDeviceAnnceFilterT *handle)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zdo_device_annce_cb_info *cb_info;
+ unsigned int i;
+
+ if (handle == NULL) {
+ return;
+ }
+ for (i = 0; i < ZB_IPC_ZDO_DEVICE_ANNCE_CB_LIST_MAX; i++) {
+ cb_info = &zdo_device_annce_cb_list[i];
+ if (cb_info->handle == handle) {
+ break;
+ }
+ }
+ if (i == ZB_IPC_ZDO_DEVICE_ANNCE_CB_LIST_MAX) {
+ return;
+ }
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZDO_DEVICE_ANNCE_FILTER_DEL;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)handle;
+ ZIGBEE_CmdTransfer();
+ cb_info->handle = NULL;
+} /* ZbZdoDeviceAnnceFilterRemove */
+
+/******************************************************************************
+ * ZDO
+ ******************************************************************************
+ */
+enum ZbStatusCodeT
+ZbZdoNwkAddrReq(struct ZigBeeT *zb, ZbZdoNwkAddrReqT *req,
+ void (*callback)(ZbZdoNwkAddrRspT *rsp, void *cb_arg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info;
+
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, arg);
+ if (info == NULL) {
+ return ZB_STATUS_ALLOC_FAIL;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZDO_NWK_ADDR;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ipcc_req->Data[1] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ return (enum ZbStatusCodeT)zb_ipc_m4_get_retval();
+ /* Followed up in MSG_M0TOM4_ZDO_NWK_ADDR_CB handler */
+} /* ZbZdoNwkAddrReq */
+
+enum ZbStatusCodeT
+ZbZdoIeeeAddrReq(struct ZigBeeT *zb, ZbZdoIeeeAddrReqT *req,
+ void (*callback)(ZbZdoIeeeAddrRspT *rsp, void *cb_arg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info;
+
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, arg);
+ if (info == NULL) {
+ return ZB_STATUS_ALLOC_FAIL;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZDO_IEEE_ADDR;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ipcc_req->Data[1] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ return (enum ZbStatusCodeT)zb_ipc_m4_get_retval();
+ /* Followed up in MSG_M0TOM4_ZDO_IEEE_ADDR_CB handler */
+} /* ZbZdoIeeeAddrReq */
+
+enum ZbStatusCodeT
+ZbZdoNodeDescReq(struct ZigBeeT *zb, ZbZdoNodeDescReqT *req,
+ void (*callback)(ZbZdoNodeDescRspT *rsp, void *cb_arg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info;
+
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, arg);
+ if (info == NULL) {
+ return ZB_STATUS_ALLOC_FAIL;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZDO_NODE_DESC;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ipcc_req->Data[1] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ return (enum ZbStatusCodeT)zb_ipc_m4_get_retval();
+ /* Followed up in MSG_M0TOM4_ZDO_NODE_DESC_CB handler */
+} /* ZbZdoNodeDescReq */
+
+enum ZbStatusCodeT
+ZbZdoPowerDescReq(struct ZigBeeT *zb, ZbZdoPowerDescReqT *req,
+ void (*callback)(ZbZdoPowerDescRspT *rsp, void *cb_arg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info;
+
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, arg);
+ if (info == NULL) {
+ return ZB_STATUS_ALLOC_FAIL;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZDO_POWER_DESC;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ipcc_req->Data[1] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ return (enum ZbStatusCodeT)zb_ipc_m4_get_retval();
+ /* Followed up in MSG_M0TOM4_ZDO_POWER_DESC_CB handler */
+} /* ZbZdoPowerDescReq */
+
+enum ZbStatusCodeT
+ZbZdoSimpleDescReq(struct ZigBeeT *zb, ZbZdoSimpleDescReqT *req,
+ void (*callback)(ZbZdoSimpleDescRspT *rsp, void *cb_arg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info;
+
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, arg);
+ if (info == NULL) {
+ return ZB_STATUS_ALLOC_FAIL;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZDO_SIMPLE_DESC;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ipcc_req->Data[1] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ return (enum ZbStatusCodeT)zb_ipc_m4_get_retval();
+ /* Followed up in MSG_M0TOM4_ZDO_SIMPLE_DESC_CB handler */
+} /* ZbZdoSimpleDescReq */
+
+enum ZbStatusCodeT
+ZbZdoActiveEpReq(struct ZigBeeT *zb, ZbZdoActiveEpReqT *req,
+ void (*callback)(ZbZdoActiveEpRspT *rsp, void *arg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info;
+
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, arg);
+ if (info == NULL) {
+ return ZB_STATUS_ALLOC_FAIL;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZDO_ACTIVE_EP;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ipcc_req->Data[1] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ return (enum ZbStatusCodeT)zb_ipc_m4_get_retval();
+ /* Followed up in MSG_M0TOM4_ZDO_ACTIVE_EP_CB handler */
+} /* ZbZdoActiveEpReq */
+
+enum ZbStatusCodeT
+ZbZdoMatchDescReq(struct ZigBeeT *zb, ZbZdoMatchDescReqT *req,
+ void (*callback)(ZbZdoMatchDescRspT *ind, void *cb_arg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info;
+
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, arg);
+ if (info == NULL) {
+ return ZB_STATUS_ALLOC_FAIL;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZDO_MATCH_DESC;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ipcc_req->Data[1] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ return (enum ZbStatusCodeT)zb_ipc_m4_get_retval();
+ /* Followed up in MSG_M0TOM4_ZDO_MATCH_DESC_CB handler */
+} /* ZbZdoMatchDescReq */
+
+enum ZbStatusCodeT
+ZbZdoMatchDescMulti(struct ZigBeeT *zb, ZbZdoMatchDescReqT *req,
+ void (*callback)(ZbZdoMatchDescRspT *ind, void *cb_arg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ /* The callback must be static so we can receive multiple responses. We don't check here if
+ * we're overwriting an existing callback, so application cannot effecticely perform more
+ * than one of these at a time. There should be no practical need for this though.
+ * There may even be no practical need for this API. */
+ zdo_match_multi_cb = callback;
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZDO_MATCH_DESC_MULTI;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ZIGBEE_CmdTransfer();
+ return (enum ZbStatusCodeT)zb_ipc_m4_get_retval();
+ /* Followed up in MSG_M0TOM4_ZDO_MATCH_DESC_MULTI_CB handler */
+} /* ZbZdoMatchDescMulti */
+
+void
+ZbZdoDeviceAnnce(struct ZigBeeT *zb, ZbZdoDeviceAnnceT *deviceAnncePtr)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZDO_DEVICE_ANNCE;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)deviceAnncePtr;
+ ZIGBEE_CmdTransfer();
+} /* ZbZdoDeviceAnnce */
+
+void
+ZbZdoDeviceAnnceAlias(struct ZigBeeT *zb, ZbZdoDeviceAnnceT *deviceAnncePtr)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZDO_DEVICE_ANNCE_ALIAS;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)deviceAnncePtr;
+ ZIGBEE_CmdTransfer();
+} /* ZbZdoDeviceAnnceAlias */
+
+enum ZbStatusCodeT
+ZbZdoBindReq(struct ZigBeeT *zb, ZbZdoBindReqT *req,
+ void (*callback)(ZbZdoBindRspT *rsp, void *cb_arg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info;
+
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, arg);
+ if (info == NULL) {
+ return ZB_STATUS_ALLOC_FAIL;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZDO_BIND;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ipcc_req->Data[1] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ return (enum ZbStatusCodeT)zb_ipc_m4_get_retval();
+ /* Followed up in MSG_M0TOM4_ZDO_BIND_CB handler */
+} /* ZbZdoBindReq */
+
+enum ZbStatusCodeT
+ZbZdoUnbindReq(struct ZigBeeT *zb, ZbZdoBindReqT *req,
+ void (*callback)(ZbZdoBindRspT *rsp, void *cb_arg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info;
+
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, arg);
+ if (info == NULL) {
+ return ZB_STATUS_ALLOC_FAIL;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZDO_UNBIND;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ipcc_req->Data[1] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ return (enum ZbStatusCodeT)zb_ipc_m4_get_retval();
+ /* Followed up in MSG_M0TOM4_ZDO_UNBIND_CB handler */
+} /* ZbZdoUnbindReq */
+
+enum ZbStatusCodeT
+ZbZdoLqiReq(struct ZigBeeT *zb, ZbZdoLqiReqT *req, void (*callback)(ZbZdoLqiRspT *rsp, void *cb_arg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info;
+
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, arg);
+ if (info == NULL) {
+ return ZB_STATUS_ALLOC_FAIL;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZDO_MGMT_LQI;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ipcc_req->Data[1] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ return (enum ZbStatusCodeT)zb_ipc_m4_get_retval();
+ /* Followed up in MSG_M0TOM4_ZDO_MGMT_LQI_CB handler */
+} /* ZbZdoLqiReq */
+
+enum ZbStatusCodeT
+ZbZdoMgmtBindReq(struct ZigBeeT *zb, ZbZdoMgmtBindReqT *req,
+ void (*callback)(ZbZdoMgmtBindRspT *rsp, void *cb_arg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info;
+
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, arg);
+ if (info == NULL) {
+ return ZB_STATUS_ALLOC_FAIL;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZDO_MGMT_BIND;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ipcc_req->Data[1] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ return (enum ZbStatusCodeT)zb_ipc_m4_get_retval();
+ /* Followed up in MSG_M0TOM4_ZDO_MGMT_BIND_CB handler */
+} /* ZbZdoMgmtBindReq */
+
+enum ZbStatusCodeT
+ZbZdoLeaveReq(struct ZigBeeT *zb, ZbZdoLeaveReqT *req,
+ void (*callback)(ZbZdoLeaveRspT *rsp, void *cb_arg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info;
+
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, arg);
+ if (info == NULL) {
+ return ZB_STATUS_ALLOC_FAIL;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZDO_MGMT_LEAVE;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ipcc_req->Data[1] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ return (enum ZbStatusCodeT)zb_ipc_m4_get_retval();
+ /* Followed up in MSG_M0TOM4_ZDO_MGMT_LEAVE_CB handler */
+} /* ZbZdoLeaveReq */
+
+enum ZbStatusCodeT
+ZbZdoPermitJoinReq(struct ZigBeeT *zb, ZbZdoPermitJoinReqT *req,
+ void (*callback)(ZbZdoPermitJoinRspT *rsp, void *cb_arg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info;
+
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, arg);
+ if (info == NULL) {
+ return ZB_STATUS_ALLOC_FAIL;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZDO_MGMT_PERMIT_JOIN;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ipcc_req->Data[1] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ return (enum ZbStatusCodeT)zb_ipc_m4_get_retval();
+ /* Followed up in MSG_M0TOM4_ZDO_MGMT_PERMIT_JOIN_CB handler */
+} /* ZbZdoPermitJoinReq */
+
+enum ZbStatusCodeT
+ZbZdoNwkUpdateReq(struct ZigBeeT *zb, ZbZdoNwkUpdateReqT *req,
+ void (*callback)(ZbZdoNwkUpdateNotifyT *ind, void *cb_arg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info;
+
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, arg);
+ if (info == NULL) {
+ return ZB_STATUS_ALLOC_FAIL;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZDO_MGMT_NWK_UPDATE;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ipcc_req->Data[1] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ return (enum ZbStatusCodeT)zb_ipc_m4_get_retval();
+ /* Followed up in MSG_M0TOM4_ZDO_MGMT_NWK_UPDATE_CB handler */
+} /* ZbZdoNwkUpdateReq */
+
+/******************************************************************************
+ * ZCL
+ ******************************************************************************
+ */
+static const struct ZbZclAttrT zcl_attr_cluster_mandatory_revision = {
+ ZCL_GLOBAL_ATTR_CLUSTER_REV, ZCL_DATATYPE_UNSIGNED_16BIT,
+ ZCL_ATTR_FLAG_NONE, 0, NULL, {0, 0}, {0, 0}
+};
+
+bool
+ZbZclBasicPostAlarm(struct ZigBeeT *zb, uint8_t endpoint, uint8_t alarm_code)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZCL_BASIC_SERVER_ALARM_POST;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)endpoint;
+ ipcc_req->Data[1] = (uint32_t)alarm_code;
+ ZIGBEE_CmdTransfer();
+ return zb_ipc_m4_get_retval() != 0U ? true : false;
+} /* ZbZclBasicPostAlarm */
+
+void
+ZbZclBasicServerResetCmdConfig(struct ZigBeeT *zb, bool allow_reset)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZCL_BASIC_SERVER_CONFIG_RESET;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)allow_reset;
+ ZIGBEE_CmdTransfer();
+} /* ZbZclBasicServerResetCmdConfig */
+
+enum ZclStatusCodeT
+ZbZclBasicWriteDirect(struct ZigBeeT *zb, uint8_t endpoint, uint16_t attributeId, const void *ptr, unsigned int len)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZCL_BASIC_SERVER_LOCAL_WRITE;
+ ipcc_req->Size = 4;
+ ipcc_req->Data[0] = (uint32_t)endpoint;
+ ipcc_req->Data[1] = (uint32_t)attributeId;
+ ipcc_req->Data[2] = (uint32_t)ptr;
+ ipcc_req->Data[3] = (uint32_t)len;
+ ZIGBEE_CmdTransfer();
+ return (enum ZclStatusCodeT)zb_ipc_m4_get_retval();
+} /* ZbZclBasicWriteDirect */
+
+bool
+ZbZclDiagnosticsServerAlloc(struct ZigBeeT *zb, uint8_t endpoint, uint16_t profileId, enum ZbStatusCodeT minSecurity)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZCL_DIAG_SERVER_ALLOC;
+ ipcc_req->Size = 3;
+ ipcc_req->Data[0] = (uint32_t)endpoint;
+ ipcc_req->Data[1] = (uint32_t)profileId;
+ ipcc_req->Data[2] = (uint32_t)minSecurity;
+ ZIGBEE_CmdTransfer();
+ return (bool)zb_ipc_m4_get_retval();
+}
+
+void *
+ZbZclClusterAlloc(struct ZigBeeT *zb, unsigned int alloc_sz, enum ZbZclClusterIdT cluster_id,
+ uint8_t endpoint, enum ZbZclDirectionT direction)
+{
+ struct ZbZclClusterT *clusterPtr;
+
+ if (alloc_sz < sizeof(struct ZbZclClusterT)) {
+ return NULL;
+ }
+ clusterPtr = (struct ZbZclClusterT *)ZbHeapAlloc(zb, alloc_sz);
+ if (clusterPtr == NULL) {
+ return NULL;
+ }
+ (void)ZbMemSet(clusterPtr, 0, alloc_sz);
+ LINK_LIST_INIT(&clusterPtr->link);
+
+ clusterPtr->zb = zb;
+ clusterPtr->clusterId = cluster_id;
+ clusterPtr->endpoint = endpoint;
+ clusterPtr->mfrCode = 0x0000U;
+ clusterPtr->profileId = ZCL_PROFILE_HOME_AUTOMATION;
+ clusterPtr->txOptions = (uint16_t)ZCL_CLUSTER_TXOPTIONS_DEFAULT;
+ clusterPtr->discoverRoute = true;
+ clusterPtr->radius = 0U;
+ clusterPtr->maxAsduLength = (uint16_t)ZB_APS_CONST_SAFE_APSSEC_PAYLOAD_SIZE;
+ clusterPtr->direction = direction;
+ LINK_LIST_INIT(&clusterPtr->attributeList);
+ LINK_LIST_INIT(&clusterPtr->reports);
+#ifdef CONFIG_ZB_ZCL_PERSIST
+ clusterPtr->persist_timer = ZbTimerAlloc(zb, zcl_persist_cluster_timer, clusterPtr);
+# if 0 /* FIXME - don't free cluster here, return false instead. */
+ if (clusterPtr->persist_timer == NULL) {
+ ZbHeapFree(zb, clusterPtr);
+ return NULL;
+ }
+# endif
+#endif
+
+ (void)ZbZclClusterSetMinSecurity(clusterPtr, ZB_APS_STATUS_SECURED_NWK_KEY);
+
+ /* Allocate the mandatory attributes */
+ if (ZbZclAttrAppendList(clusterPtr, &zcl_attr_cluster_mandatory_revision, 1U) != ZCL_STATUS_SUCCESS) {
+ ZbHeapFree(zb, clusterPtr);
+ return NULL;
+ }
+ (void)ZbZclAttrIntegerWrite(clusterPtr, (uint16_t)ZCL_GLOBAL_ATTR_CLUSTER_REV, ZCL_CLUSTER_REVISION_LEGACY);
+
+ return clusterPtr;
+} /* ZbZclClusterAlloc */
+
+void
+ZbZclClusterAttach(struct ZbZclClusterT *clusterPtr)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ /* Call to the M0 to initialize the cluster and attach any filters with the stack. */
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZCL_CLUSTER_ATTACH;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)clusterPtr;
+ ZIGBEE_CmdTransfer();
+ /* IPC has no return value */
+} /* ZbZclClusterAttach */
+
+void
+ZbZclClusterFree(struct ZbZclClusterT *clusterPtr)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ if (clusterPtr->zb == NULL) {
+ return;
+ }
+
+ /* Call into the M0 to do any further cleanup (filters, etc) */
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZCL_CLUSTER_DETACH;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)clusterPtr;
+ ZIGBEE_CmdTransfer();
+ /* IPC has no return value */
+
+ if (clusterPtr->cleanup != NULL) {
+ clusterPtr->cleanup(clusterPtr);
+ }
+ ZbHeapFree(clusterPtr->zb, clusterPtr);
+} /* ZbZclClusterFree */
+
+void
+ZbZclAddEndpoint(struct ZigBeeT *zb, ZbApsmeAddEndpointReqT *addReqPtr, ZbApsmeAddEndpointConfT *addConfPtr)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZCL_ENDPOINT_ADD;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)addReqPtr;
+ ipcc_req->Data[1] = (uint32_t)addConfPtr;
+ ZIGBEE_CmdTransfer();
+} /* ZbZclAddEndpoint */
+
+void
+ZbZclRemoveEndpoint(struct ZigBeeT *zb, ZbApsmeRemoveEndpointReqT *req, ZbApsmeRemoveEndpointConfT *conf)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZCL_ENDPOINT_DEL;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ipcc_req->Data[1] = (uint32_t)conf;
+ ZIGBEE_CmdTransfer();
+} /* ZbZclRemoveEndpoint */
+
+void
+ZbZclReadReq(struct ZbZclClusterT *clusterPtr, ZbZclReadReqT *req,
+ void (*callback)(const ZbZclReadRspT *readRsp, void *cb_arg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info;
+
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, arg);
+ if (info == NULL) {
+ ZbZclReadRspT rsp;
+
+ memset(&rsp, 0, sizeof(rsp));
+ rsp.status = ZB_STATUS_ALLOC_FAIL;
+ callback(&rsp, arg);
+ return;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZCL_READ_REQ;
+ ipcc_req->Size = 3;
+ ipcc_req->Data[0] = (uint32_t)clusterPtr;
+ ipcc_req->Data[1] = (uint32_t)req;
+ ipcc_req->Data[2] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ /* Followed up in MSG_M0TOM4_ZCL_READ_CB handler */
+} /* ZbZclReadReq */
+
+void
+ZbZclWriteReq(struct ZbZclClusterT *clusterPtr, ZbZclWriteReqT *req,
+ void (*callback)(const ZbZclWriteRspT *writeResp, void *cb_arg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info;
+
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, arg);
+ if (info == NULL) {
+ ZbZclWriteRspT rsp;
+
+ memset(&rsp, 0, sizeof(rsp));
+ rsp.status = ZB_STATUS_ALLOC_FAIL;
+ callback(&rsp, arg);
+ return;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZCL_WRITE_REQ;
+ ipcc_req->Size = 3;
+ ipcc_req->Data[0] = (uint32_t)clusterPtr;
+ ipcc_req->Data[1] = (uint32_t)req;
+ ipcc_req->Data[2] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ /* Followed up in MSG_M0TOM4_ZCL_WRITE_CB handler */
+} /* ZbZclWriteReq */
+
+void
+ZbZclDiscoverAttrReq(struct ZbZclClusterT *clusterPtr, ZbZclDiscoverAttrReqT *req,
+ void (*callback)(const ZbZclDiscoverAttrRspT *discRsp, void *cb_arg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info;
+
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, arg);
+ if (info == NULL) {
+ ZbZclDiscoverAttrRspT rsp;
+
+ memset(&rsp, 0, sizeof(rsp));
+ rsp.status = ZB_STATUS_ALLOC_FAIL;
+ callback(&rsp, arg);
+ return;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZCL_DISCOVER_ATTR_REQ;
+ ipcc_req->Size = 3;
+ ipcc_req->Data[0] = (uint32_t)clusterPtr;
+ ipcc_req->Data[1] = (uint32_t)req;
+ ipcc_req->Data[2] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ /* Followed up in MSG_M0TOM4_ZCL_DISCOVER_ATTR_CB handler */
+} /* ZbZclDiscoverAttrReq */
+
+uint8_t
+ZbZclGetNextSeqnum(void)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZCL_GET_SEQNUM;
+ ipcc_req->Size = 0;
+ ZIGBEE_CmdTransfer();
+ return (uint8_t)zb_ipc_m4_get_retval();
+} /* ZbZclGetNextSeqnum */
+
+void
+ZbZclCommandReq(struct ZigBeeT *zb, ZbZclCommandReqT *zclReq,
+ void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info;
+
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, arg);
+ if (info == NULL) {
+ struct ZbZclCommandRspT rsp;
+
+ memset(&rsp, 0, sizeof(rsp));
+ rsp.status = ZB_STATUS_ALLOC_FAIL;
+ callback(&rsp, arg);
+ return;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZCL_COMMAND_REQ;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)zclReq;
+ ipcc_req->Data[1] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ /* Followed up in MSG_M0TOM4_ZCL_COMMAND_REQ_CB handler */
+} /* ZbZclCommandReq */
+
+void
+ZbZclCommandNoResp(struct ZigBeeT *zb, ZbZclCommandReqT *req,
+ void (*callback)(ZbApsdeDataConfT *confPtr, void *arg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info;
+
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, arg);
+ if (info == NULL) {
+ ZbApsdeDataConfT conf;
+
+ memset(&conf, 0, sizeof(conf));
+ conf.status = ZB_STATUS_ALLOC_FAIL;
+ callback(&conf, arg);
+ return;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZCL_COMMAND_NO_RSP;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)req;
+ ipcc_req->Data[1] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ /* Followed up in MSG_M0TOM4_ZCL_COMMAND_NO_RSP_CB handler */
+} /* ZbZclCommandNoResp */
+
+void
+ZbZclSendDefaultResponse(struct ZbZclClusterT *clusterPtr, ZbApsdeDataIndT *dataIndPtr,
+ struct ZbZclHeaderT *zclHdrPtr, enum ZclStatusCodeT status)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZCL_SEND_DEFAULT_RSP;
+ ipcc_req->Size = 4;
+ ipcc_req->Data[0] = (uint32_t)clusterPtr;
+ ipcc_req->Data[1] = (uint32_t)dataIndPtr;
+ ipcc_req->Data[2] = (uint32_t)zclHdrPtr;
+ ipcc_req->Data[3] = (uint32_t)status;
+ ZIGBEE_CmdTransfer();
+} /* ZbZclSendDefaultResponse */
+
+void
+ZbZclClusterCommandReq(struct ZbZclClusterT *clusterPtr, struct ZbZclClusterCommandReqT *req,
+ void (*callback)(struct ZbZclCommandRspT *zcl_rsp, void *arg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info;
+
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, arg);
+ if (info == NULL) {
+ struct ZbZclCommandRspT rsp;
+
+ memset(&rsp, 0, sizeof(rsp));
+ rsp.status = ZB_STATUS_ALLOC_FAIL;
+ callback(&rsp, arg);
+ return;
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZCL_CLUSTER_CMD_REQ;
+ ipcc_req->Size = 3;
+ ipcc_req->Data[0] = (uint32_t)clusterPtr;
+ ipcc_req->Data[1] = (uint32_t)req;
+ ipcc_req->Data[2] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ /* Followed up in MSG_M0TOM4_ZCL_CLUSTER_CMD_REQ_CB handler */
+} /* ZbZclClusterCommandReq */
+
+enum ZclStatusCodeT
+ZbZclClusterCommandRsp(struct ZbZclClusterT *clusterPtr, struct ZbZclAddrInfoT *dstInfo,
+ uint8_t cmdId, ZbApsBufT *payloads, uint8_t numPayloads)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZCL_CLUSTER_CMD_RSP;
+ ipcc_req->Size = 5;
+ ipcc_req->Data[0] = (uint32_t)clusterPtr;
+ ipcc_req->Data[1] = (uint32_t)dstInfo;
+ ipcc_req->Data[2] = (uint32_t)cmdId;
+ ipcc_req->Data[3] = (uint32_t)payloads;
+ ipcc_req->Data[4] = (uint32_t)numPayloads;
+ ZIGBEE_CmdTransfer();
+ return (enum ZclStatusCodeT)zb_ipc_m4_get_retval();
+} /* ZbZclClusterCommandRsp */
+
+enum ZclStatusCodeT
+ZbZclClusterCommandRspWithCb(struct ZbZclClusterT *clusterPtr, struct ZbZclAddrInfoT *dstInfo, uint8_t cmdId,
+ ZbApsBufT *payloads, uint8_t numPayloads, void (*callback)(ZbApsdeDataConfT *conf, void *arg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info = NULL;
+ enum ZclStatusCodeT status;
+
+ if (callback != NULL) {
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, arg);
+ if (info == NULL) {
+ return ZCL_STATUS_ALLOC_FAIL;
+ }
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZCL_CLUSTER_CMD_RSP_WITH_CB;
+ ipcc_req->Size = 6;
+ ipcc_req->Data[0] = (uint32_t)clusterPtr;
+ ipcc_req->Data[1] = (uint32_t)dstInfo;
+ ipcc_req->Data[2] = (uint32_t)cmdId;
+ ipcc_req->Data[3] = (uint32_t)payloads;
+ ipcc_req->Data[4] = (uint32_t)numPayloads;
+ ipcc_req->Data[5] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ status = (enum ZclStatusCodeT)zb_ipc_m4_get_retval();
+ if (status != ZCL_STATUS_SUCCESS) {
+ zb_ipc_m4_cb_info_free(info);
+ }
+ return status;
+ /* Followed up in MSG_M0TOM4_ZCL_CLUSTER_CMD_RSP_CONF_CB handler */
+} /* ZbZclClusterCommandRspWithCb */
+
+enum ZclStatusCodeT
+ZbZclSendClusterStatusResponse(struct ZbZclClusterT *clusterPtr, ZbApsdeDataIndT *dataIndPtr,
+ struct ZbZclHeaderT *zclHdrPtr, uint8_t cmdId, uint8_t *zclPayload, uint8_t zclPaylen)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZCL_CLUSTER_CMD_RSP_WITH_STATUS;
+ ipcc_req->Size = 6;
+ ipcc_req->Data[0] = (uint32_t)clusterPtr;
+ ipcc_req->Data[1] = (uint32_t)dataIndPtr;
+ ipcc_req->Data[2] = (uint32_t)zclHdrPtr;
+ ipcc_req->Data[3] = (uint32_t)cmdId;
+ ipcc_req->Data[4] = (uint32_t)zclPayload;
+ ipcc_req->Data[5] = (uint32_t)zclPaylen;
+ ZIGBEE_CmdTransfer();
+ return (enum ZclStatusCodeT)zb_ipc_m4_get_retval();
+} /* ZbZclSendClusterStatusResponse */
+
+bool
+ZbZclClusterEndpointRegister(struct ZbZclClusterT *clusterPtr)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ uint32_t retval;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZCL_CLUSTER_EP_REGISTER;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)clusterPtr;
+ ZIGBEE_CmdTransfer();
+ retval = zb_ipc_m4_get_retval();
+ return retval != 0 ? true : false;
+} /* ZbZclClusterEndpointRegister */
+
+bool
+ZbZclClusterEndpointRemove(struct ZbZclClusterT *clusterPtr)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ uint32_t retval;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZCL_CLUSTER_EP_REMOVE;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)clusterPtr;
+ ZIGBEE_CmdTransfer();
+ retval = zb_ipc_m4_get_retval();
+ return retval != 0 ? true : false;
+} /* ZbZclClusterEndpointRemove */
+
+enum ZclStatusCodeT
+zcl_cluster_bind(struct ZbZclClusterT *clusterPtr, struct ZbApsFilterT *filter,
+ uint8_t endpoint, uint16_t profileId, enum ZbZclDirectionT direction)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZCL_CLUSTER_BIND;
+ ipcc_req->Size = 5;
+ ipcc_req->Data[0] = (uint32_t)clusterPtr;
+ ipcc_req->Data[1] = (uint32_t)filter;
+ ipcc_req->Data[2] = (uint32_t)endpoint;
+ ipcc_req->Data[3] = (uint32_t)profileId;
+ ipcc_req->Data[4] = (uint32_t)direction;
+ ZIGBEE_CmdTransfer();
+ return (enum ZclStatusCodeT)zb_ipc_m4_get_retval();
+} /* zcl_cluster_bind */
+
+enum ZclStatusCodeT
+ZbZclClusterBind(struct ZbZclClusterT *clusterPtr, uint8_t endpoint, uint16_t profileId, enum ZbZclDirectionT direction)
+{
+ return zcl_cluster_bind(clusterPtr, &clusterPtr->filter, endpoint, profileId, direction);
+} /* ZbZclClusterBind */
+
+void
+ZbZclClusterUnbind(struct ZbZclClusterT *clusterPtr)
+{
+ if (clusterPtr->filter.callback != NULL) {
+ ZCL_LOG_PRINTF(clusterPtr->zb, __func__, "Removing filter for cluster 0x%04x on endpoint %d.", clusterPtr->clusterId, clusterPtr->endpoint);
+ ZbApsFilterRemove(clusterPtr->zb, &clusterPtr->filter);
+ clusterPtr->filter.callback = NULL;
+ }
+} /* ZbZclClusterUnbind */
+
+enum ZclStatusCodeT
+ZbZclClusterRegisterAlarmResetHandler(struct ZbZclClusterT *clusterPtr, ZbZclAlarmResetFuncT callback)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ enum ZclStatusCodeT status;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZCL_CLUSTER_ALARM_ADD_FILTER;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)clusterPtr;
+ ZIGBEE_CmdTransfer();
+ status = (enum ZclStatusCodeT)zb_ipc_m4_get_retval();
+ if (status == ZCL_STATUS_SUCCESS) {
+ clusterPtr->alarm_reset_callback = callback;
+ }
+ else {
+ clusterPtr->alarm_reset_callback = NULL;
+ }
+ return status;
+ /* Callbacks followed up in MSG_M0TOM4_ZCL_CLUSTER_ALARM_CB handler. */
+} /* ZbZclClusterRegisterAlarmResetHandler */
+
+void
+ZbZclClusterSendAlarm(struct ZbZclClusterT *clusterPtr, uint8_t src_endpoint, uint8_t alarm_code)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZCL_CLUSTER_ALARM_SEND;
+ ipcc_req->Size = 3;
+ ipcc_req->Data[0] = (uint32_t)clusterPtr;
+ ipcc_req->Data[1] = (uint32_t)src_endpoint;
+ ipcc_req->Data[2] = (uint32_t)alarm_code;
+ ZIGBEE_CmdTransfer();
+} /* ZbZclClusterSendAlarm */
+
+enum ZclStatusCodeT
+zcl_reporting_config_default(struct ZbZclClusterT *clusterPtr)
+{
+ /* FIXME 0 - TODO - local shared code? */
+ return ZCL_STATUS_FAILURE;
+} /* zcl_reporting_config_default */
+
+bool
+zcl_reporting_remove(struct ZbZclClusterT *clusterPtr, uint16_t attributeId, enum ZbZclReportDirectionT direction)
+{
+ /* FIXME 0 - TODO - local shared code? */
+ return false;
+} /* zcl_reporting_remove */
+
+enum ZclStatusCodeT
+ZbZclAttrAppendList(struct ZbZclClusterT *clusterPtr, const struct ZbZclAttrT *attrList, unsigned int num_attrs)
+{
+ unsigned int i;
+ struct ZbZclAttrListEntryT *attrPtr;
+ unsigned int val_buf_sz;
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ ZclAssert(clusterPtr != NULL);
+ /* The caller shouldn't be calling with a NULL attribute list, but
+ * allow it anyway. */
+ if ((attrList == NULL) || (num_attrs == 0U)) {
+ return ZCL_STATUS_SUCCESS;
+ }
+
+ for (i = 0; i < num_attrs; i++) {
+ attrPtr = ZbZclAttrFind(clusterPtr, attrList[i].attributeId);
+ if (attrPtr != NULL) {
+ /* Replace any duplicate attributes we find. The cluster might
+ * have some default attribute definitions that the application
+ * wants to override with its own. */
+ ZbZclAttrFreeAttr(clusterPtr, attrPtr);
+ }
+
+ /* FIXME - use a single ZbHeapAlloc? Need to make sure structs are starting on aligned memory. */
+ attrPtr = ZbHeapAlloc(clusterPtr->zb, sizeof(struct ZbZclAttrListEntryT));
+ if (attrPtr == NULL) {
+ ZCL_LOG_PRINTF(clusterPtr->zb, __func__, "Error, memory exhausted (len = %d)", sizeof(struct ZbZclAttrListEntryT) + val_buf_sz);
+ return ZCL_STATUS_INSUFFICIENT_SPACE;
+ }
+ (void)ZbMemSet(attrPtr, 0, sizeof(struct ZbZclAttrListEntryT));
+ LINK_LIST_INIT(&attrPtr->link);
+ attrPtr->info = &attrList[i];
+
+ if ((attrPtr->info->flags & ZCL_ATTR_FLAG_REPORTABLE) != 0U) {
+ attrPtr->reporting.interval_secs_max = attrPtr->info->reporting.interval_max;
+ attrPtr->reporting.interval_secs_min = attrPtr->info->reporting.interval_min;
+ }
+
+ if (attrPtr->info->customValSz > 0U) {
+ attrPtr->valSz = attrPtr->info->customValSz;
+
+ /* Allow for leading string length header, to keep these details from user. */
+ if ((attrPtr->info->dataType == ZCL_DATATYPE_STRING_OCTET)
+ || (attrPtr->info->dataType == ZCL_DATATYPE_STRING_CHARACTER)) {
+ attrPtr->valSz += 1U;
+ }
+ else if ((attrPtr->info->dataType == ZCL_DATATYPE_STRING_LONG_OCTET)
+ || (attrPtr->info->dataType == ZCL_DATATYPE_STRING_LONG_CHARACTER)) {
+ attrPtr->valSz += 2U;
+ }
+ else {
+ /* no change to valSz */
+ }
+
+ if (((attrPtr->info->flags & ZCL_ATTR_FLAG_CB_READ) != 0U)
+ && ((attrPtr->info->flags & ZCL_ATTR_FLAG_CB_WRITE) != 0U)) {
+ /* If defining a custom value size and also both custom
+ * read and write functions, then don't allocate the
+ * attribute data buffer. The cluster will maintain
+ * this information separately.
+ *
+ * attrPtr->valSz in this case represents the maximum
+ * potential size of the attribute data, for persistence. */
+ val_buf_sz = 0U;
+ }
+ else {
+ val_buf_sz = attrPtr->valSz;
+ }
+ }
+ else {
+ attrPtr->valSz = ZbZclAttrTypeLength(attrPtr->info->dataType);
+ if (attrPtr->valSz == 0U) {
+ ZCL_LOG_PRINTF(clusterPtr->zb, __func__, "Error, attr = 0x%04x, type = %d, len = 0", attrPtr->info->attributeId, attrPtr->info->dataType);
+ ZbHeapFree(clusterPtr->zb, attrPtr);
+ return ZCL_STATUS_INVALID_DATA_TYPE;
+ }
+ val_buf_sz = attrPtr->valSz;
+ }
+
+ if (val_buf_sz > 0U) {
+ /* Set the valBuf memory pointer */
+ attrPtr->valBuf = ZbHeapAlloc(clusterPtr->zb, val_buf_sz);
+ if (attrPtr->valBuf == NULL) {
+ ZbHeapFree(clusterPtr->zb, attrPtr);
+ ZCL_LOG_PRINTF(clusterPtr->zb, __func__, "Error, memory exhausted (len = %d)", sizeof(struct ZbZclAttrListEntryT) + val_buf_sz);
+ return ZCL_STATUS_INSUFFICIENT_SPACE;
+ }
+ (void)ZbMemSet(attrPtr->valBuf, 0, val_buf_sz);
+ }
+
+#if 0 /* enable for debugging */
+ ZCL_LOG_PRINTF(clusterPtr->zb, __func__, "Allocating attribute (cl = 0x%04x, attr = 0x%04x, size = %d)",
+ clusterPtr->clusterId, attrPtr->info->attributeId, sizeof(struct ZbZclAttrListEntryT) + val_buf_sz);
+#endif
+
+ /* Append it to the list */
+ ZbZclAttrAddSorted(clusterPtr, attrPtr);
+
+ /* Give the attribute a default value */
+ if (((attrPtr->info->flags & ZCL_ATTR_FLAG_CB_DEFAULT) != 0U)) {
+ struct ZbZclAttrCbInfoT cb;
+
+ (void)ZbMemSet(&cb, 0, sizeof(struct ZbZclAttrCbInfoT));
+ cb.info = attrPtr->info;
+ cb.type = ZCL_ATTR_CB_TYPE_DEFAULT;
+ cb.app_cb_arg = clusterPtr->app_cb_arg;
+ (void)attrPtr->info->callback(clusterPtr, &cb);
+ }
+ else if (attrPtr->valBuf != NULL) {
+ (void)ZbZclAttrDefaultValue(attrPtr->info->dataType, attrPtr->valBuf, attrPtr->valSz);
+ }
+ else {
+ /* managed by app */
+ }
+
+ /* Let the application know about this attribute (for callbacks and attribute discovery) */
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZCL_ATTR_REGISTER;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)clusterPtr;
+ ipcc_req->Data[1] = (uint32_t)attrPtr;
+ ZIGBEE_CmdTransfer();
+ /* Note, attribute callbacks from M0 go to MSG_M0TOM4_ZCL_ATTR_CB */
+ } /* for */
+
+ (void)zcl_reporting_config_default(clusterPtr);
+ return ZCL_STATUS_SUCCESS;
+} /* ZbZclAttrAppendList */
+
+enum ZclStatusCodeT
+zcl_attr_callback_exec(struct ZbZclClusterT *clusterPtr, struct ZbZclAttrListEntryT *attrPtr, struct ZbZclAttrCbInfoT *cbInfo)
+{
+#if 0 /* running on the application side, so don't use the stack's internal_callback */
+ if (attrPtr->internal_callback != NULL) {
+ return attrPtr->internal_callback(clusterPtr, cbInfo);
+ }
+#endif
+ if (attrPtr->info->callback != NULL) {
+ return attrPtr->info->callback(clusterPtr, cbInfo);
+ }
+ return ZCL_STATUS_FAILURE;
+} /* zcl_attr_callback_exec */
+
+static void
+ZbZclAttrFreeAttr(struct ZbZclClusterT *clusterPtr, struct ZbZclAttrListEntryT *attrPtr)
+{
+ ZclAssert(clusterPtr != NULL);
+
+ if ((attrPtr->info->flags & ZCL_ATTR_FLAG_REPORTABLE) != 0U) {
+ (void)zcl_reporting_remove(clusterPtr, attrPtr->info->attributeId, ZCL_REPORT_DIRECTION_NORMAL);
+ (void)zcl_reporting_remove(clusterPtr, attrPtr->info->attributeId, ZCL_REPORT_DIRECTION_REVERSE);
+ }
+
+ LINK_LIST_UNLINK(&attrPtr->link);
+
+ if (attrPtr->valBuf != NULL) {
+ ZbHeapFree(clusterPtr->zb, attrPtr->valBuf);
+ }
+ ZbHeapFree(clusterPtr->zb, attrPtr);
+} /* ZbZclAttrFreeAttr */
+
+void
+ZbZclAttrFreeList(struct ZbZclClusterT *clusterPtr)
+{
+ struct LinkListT *p;
+ struct ZbZclAttrListEntryT *attrPtr;
+
+ ZclAssert(clusterPtr != NULL);
+ while (true) {
+ p = LINK_LIST_HEAD(&clusterPtr->attributeList);
+ if (p == NULL) {
+ break;
+ }
+ attrPtr = LINK_LIST_ITEM(p, struct ZbZclAttrListEntryT, link);
+ ZbZclAttrFreeAttr(clusterPtr, attrPtr);
+ } /* while */
+} /* ZbZclAttrFreeList */
+
+/******************************************************************************
+ * SE Key Exchange
+ ******************************************************************************
+ */
+enum ZclStatusCodeT
+ZbZclKeWithDevice(struct ZigBeeT *zb, uint64_t partnerAddr, bool aps_req_key,
+ void (*callback)(uint64_t partnerAddr, uint16_t keSuite, enum ZbZclKeyStatusT key_status, void *arg), void *arg)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ struct zb_ipc_m4_cb_info *info = NULL;
+ enum ZclStatusCodeT status;
+
+ if (callback != NULL) {
+ info = zb_ipc_m4_cb_info_alloc((void *)callback, arg);
+ if (info == NULL) {
+ return ZCL_STATUS_ALLOC_FAIL;
+ }
+ }
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZCL_KE_WITH_DEVICE;
+ ipcc_req->Size = 4;
+ memcpy(&ipcc_req->Data[0], &partnerAddr, 8);
+ ipcc_req->Data[2] = (uint32_t)aps_req_key;
+ ipcc_req->Data[3] = (uint32_t)info;
+ ZIGBEE_CmdTransfer();
+ status = (enum ZclStatusCodeT)zb_ipc_m4_get_retval();
+ if (status != ZCL_STATUS_SUCCESS) {
+ zb_ipc_m4_cb_info_free(info);
+ }
+ return status;
+ /* Followed up in MSG_M0TOM4_ZCL_KE_WITH_DEVICE_CB handler */
+} /* ZbZclKeWithDevice */
+
+/******************************************************************************
+ * Certification Test Hooks
+ ******************************************************************************
+ */
+void
+ZbTestCaseClear(struct ZigBeeT *zb)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_TEST_CASE_CLEAR;
+ ipcc_req->Size = 0;
+ ZIGBEE_CmdTransfer();
+} /* ZbTestCaseClear */
+
+uint32_t
+ZbTestCaseCurrent(struct ZigBeeT *zb)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_TEST_CASE_CURRENT;
+ ipcc_req->Size = 0;
+ ZIGBEE_CmdTransfer();
+ return zb_ipc_m4_get_retval();
+} /* ZbTestCaseCurrent */
+
+void
+ZbTestCaseDisable(struct ZigBeeT *zb, enum ZbTestcaseT testcase)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_TEST_CASE_DISABLE;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)testcase;
+ ZIGBEE_CmdTransfer();
+} /* ZbTestCaseDisable */
+
+void
+ZbTestCaseEnable(struct ZigBeeT *zb, enum ZbTestcaseT testcase)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_TEST_CASE_ENABLE;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)testcase;
+ ZIGBEE_CmdTransfer();
+} /* ZbTestCaseEnable */
+
+bool
+ZbApsFragDropTxAdd(struct ZigBeeT *zb, uint8_t blockNum)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+ uint32_t retval;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_APS_FRAG_DROP_ADD;
+ ipcc_req->Size = 1;
+ ipcc_req->Data[0] = (uint32_t)blockNum;
+ ZIGBEE_CmdTransfer();
+ retval = zb_ipc_m4_get_retval();
+ return retval != 0 ? true : false;
+} /* ZbApsFragDropTxAdd */
+
+void
+ZbApsFragDropTxClear(struct ZigBeeT *zb)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_APS_FRAG_DROP_CLEAR;
+ ipcc_req->Size = 0;
+ ZIGBEE_CmdTransfer();
+} /* ZbApsFragDropTxClear */
+
+/******************************************************************************
+ * AES & Hashing
+ ******************************************************************************
+ */
+void
+ZbAesMmoHash(uint8_t const *data, const unsigned int length, uint8_t *hash)
+{
+ ZbHashT newHash;
+
+ ZbHashInit(&newHash);
+ ZbHashAdd(&newHash, data, length);
+ ZbHashDigest(&newHash, hash);
+} /* ZbAesMmoHash */
+
+void
+ZbHashInit(ZbHashT *h)
+{
+ (void)ZbMemSet(h->m, 0, sizeof(h->m));
+ (void)ZbMemSet(h->hash, 0, sizeof(h->hash));
+ h->length = 0;
+} /* ZbHashInit */
+
+void
+ZbHashAdd(ZbHashT *h, const void *data, uint32_t len)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZB_HASH_ADD;
+ ipcc_req->Size = 3;
+ ipcc_req->Data[0] = (uint32_t)h;
+ ipcc_req->Data[1] = (uint32_t)data;
+ ipcc_req->Data[2] = (uint32_t)len;
+ ZIGBEE_CmdTransfer();
+} /* ZbHashAdd */
+
+void
+ZbHashByte(ZbHashT *h, uint8_t byte)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZB_HASH_BYTE;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)h;
+ ipcc_req->Data[1] = (uint32_t)byte;
+ ZIGBEE_CmdTransfer();
+} /* ZbHashByte */
+
+void
+ZbHashDigest(ZbHashT *h, void *digest)
+{
+ Zigbee_Cmd_Request_t *ipcc_req;
+
+ Pre_ZigbeeCmdProcessing();
+ ipcc_req = ZIGBEE_Get_OTCmdPayloadBuffer();
+ ipcc_req->ID = MSG_M4TOM0_ZB_HASH_DIGEST;
+ ipcc_req->Size = 2;
+ ipcc_req->Data[0] = (uint32_t)h;
+ ipcc_req->Data[1] = (uint32_t)digest;
+ ZIGBEE_CmdTransfer();
+} /* ZbHashDigest */
+
+/******************************************************************************
+ * Memory Helpers
+ ******************************************************************************
+ */
+void *
+zb_heap_alloc(struct ZigBeeT *zb, size_t sz, const char *filename, unsigned int line)
+{
+ /* The M4 has access to malloc */
+ return malloc(sz);
+} /* zb_heap_alloc */
+
+void
+zb_heap_free(struct ZigBeeT *zb, void *ptr, const char *filename, unsigned int line)
+{
+ free(ptr);
+} /* ZbHeapFree */
+
+void *
+ZbMemSet(void *s, int c, size_t n)
+{
+ return memset(s, c, n);
+} /* ZbMemSet */
+
+void *
+ZbMemCpy(void *dest, const void *src, size_t n)
+{
+ return memcpy(dest, src, n);
+} /* ZbMemCpy */
+
+void *
+ZbMemMove(void *dest, const void *src, size_t n)
+{
+ return memmove(dest, src, n);
+} /* ZbMemMove */
+
+char *
+ZbStrCpy(char *dest, const char *src)
+{
+ return strcpy(dest, src);
+} /* ZbStrCpy */
+
+/******************************************************************************
+ * CRC (required for ZCL reporting (hash)
+ ******************************************************************************
+ */
+/*
+ * Precomputed CRC table for IEEE 802.15.4 FCS fields. Intended to be
+ * used in the reflected CRC algorithm. Generated using the Rocksoft
+ * CRC table generator with the following parameters:
+ *
+ * Width = 2 bytes
+ * Polynomial = x^16 + x^12 + x^5 + 1 (0x1021)
+ * Reflected = true
+ */
+const uint16_t wpanCrcTable[256] = {
+ 0x0000, 0x1189, 0x2312, 0x329B, 0x4624, 0x57AD, 0x6536, 0x74BF,
+ 0x8C48, 0x9DC1, 0xAF5A, 0xBED3, 0xCA6C, 0xDBE5, 0xE97E, 0xF8F7,
+ 0x1081, 0x0108, 0x3393, 0x221A, 0x56A5, 0x472C, 0x75B7, 0x643E,
+ 0x9CC9, 0x8D40, 0xBFDB, 0xAE52, 0xDAED, 0xCB64, 0xF9FF, 0xE876,
+ 0x2102, 0x308B, 0x0210, 0x1399, 0x6726, 0x76AF, 0x4434, 0x55BD,
+ 0xAD4A, 0xBCC3, 0x8E58, 0x9FD1, 0xEB6E, 0xFAE7, 0xC87C, 0xD9F5,
+ 0x3183, 0x200A, 0x1291, 0x0318, 0x77A7, 0x662E, 0x54B5, 0x453C,
+ 0xBDCB, 0xAC42, 0x9ED9, 0x8F50, 0xFBEF, 0xEA66, 0xD8FD, 0xC974,
+ 0x4204, 0x538D, 0x6116, 0x709F, 0x0420, 0x15A9, 0x2732, 0x36BB,
+ 0xCE4C, 0xDFC5, 0xED5E, 0xFCD7, 0x8868, 0x99E1, 0xAB7A, 0xBAF3,
+ 0x5285, 0x430C, 0x7197, 0x601E, 0x14A1, 0x0528, 0x37B3, 0x263A,
+ 0xDECD, 0xCF44, 0xFDDF, 0xEC56, 0x98E9, 0x8960, 0xBBFB, 0xAA72,
+ 0x6306, 0x728F, 0x4014, 0x519D, 0x2522, 0x34AB, 0x0630, 0x17B9,
+ 0xEF4E, 0xFEC7, 0xCC5C, 0xDDD5, 0xA96A, 0xB8E3, 0x8A78, 0x9BF1,
+ 0x7387, 0x620E, 0x5095, 0x411C, 0x35A3, 0x242A, 0x16B1, 0x0738,
+ 0xFFCF, 0xEE46, 0xDCDD, 0xCD54, 0xB9EB, 0xA862, 0x9AF9, 0x8B70,
+ 0x8408, 0x9581, 0xA71A, 0xB693, 0xC22C, 0xD3A5, 0xE13E, 0xF0B7,
+ 0x0840, 0x19C9, 0x2B52, 0x3ADB, 0x4E64, 0x5FED, 0x6D76, 0x7CFF,
+ 0x9489, 0x8500, 0xB79B, 0xA612, 0xD2AD, 0xC324, 0xF1BF, 0xE036,
+ 0x18C1, 0x0948, 0x3BD3, 0x2A5A, 0x5EE5, 0x4F6C, 0x7DF7, 0x6C7E,
+ 0xA50A, 0xB483, 0x8618, 0x9791, 0xE32E, 0xF2A7, 0xC03C, 0xD1B5,
+ 0x2942, 0x38CB, 0x0A50, 0x1BD9, 0x6F66, 0x7EEF, 0x4C74, 0x5DFD,
+ 0xB58B, 0xA402, 0x9699, 0x8710, 0xF3AF, 0xE226, 0xD0BD, 0xC134,
+ 0x39C3, 0x284A, 0x1AD1, 0x0B58, 0x7FE7, 0x6E6E, 0x5CF5, 0x4D7C,
+ 0xC60C, 0xD785, 0xE51E, 0xF497, 0x8028, 0x91A1, 0xA33A, 0xB2B3,
+ 0x4A44, 0x5BCD, 0x6956, 0x78DF, 0x0C60, 0x1DE9, 0x2F72, 0x3EFB,
+ 0xD68D, 0xC704, 0xF59F, 0xE416, 0x90A9, 0x8120, 0xB3BB, 0xA232,
+ 0x5AC5, 0x4B4C, 0x79D7, 0x685E, 0x1CE1, 0x0D68, 0x3FF3, 0x2E7A,
+ 0xE70E, 0xF687, 0xC41C, 0xD595, 0xA12A, 0xB0A3, 0x8238, 0x93B1,
+ 0x6B46, 0x7ACF, 0x4854, 0x59DD, 0x2D62, 0x3CEB, 0x0E70, 0x1FF9,
+ 0xF78F, 0xE606, 0xD49D, 0xC514, 0xB1AB, 0xA022, 0x92B9, 0x8330,
+ 0x7BC7, 0x6A4E, 0x58D5, 0x495C, 0x3DE3, 0x2C6A, 0x1EF1, 0x0F78
+};
+
+uint16_t
+WpanCrc(uint16_t crc, const void *dataPtr, unsigned int dataLen)
+{
+ const uint8_t *p = dataPtr;
+ /*
+ * Reflected CRC for dummies:
+ *
+ * Step 1: Right-Shift the crc register by one byte, save the byte that
+ * pops off as an index to the CRC table.
+ * Step 2: XOR the index with the next byte of data.
+ * Step 3: XOR the crc register with the table entry given by the index.
+ * Step 4: Repeat until out of data.
+ *
+ * Non-Reflected CRCs use the same algorithm, except that the crc register
+ * is shifted left, and the table needs to be regenerated.
+ */
+ while (dataLen--) {
+ crc = (crc >> 8) ^ wpanCrcTable[(crc & 0xff) ^ *p++];
+ } /* while */
+ return crc;
+} /* WpanCrc */
+
+/**
+ * @brief This function is used to manage all the callbacks used by the
+ * OpenThread interface. These callbacks are used for example to
+ * notify the application as soon as the state of a device has been
+ * modified.
+ *
+ * Important Note: This function must be called each time a message
+ * is sent from the M0 to the M4.
+ *
+ * @param None
+ * @retval None
+ */
+HAL_StatusTypeDef
+Zigbee_CallBackProcessing(void)
+{
+ HAL_StatusTypeDef status = HAL_OK;
+ struct zb_ipc_m4_cb_info *info = NULL;
+ Zigbee_Cmd_Request_t *p_notification;
+
+ /* Get pointer on received event buffer from M0 */
+ p_notification = ZIGBEE_Get_NotificationPayloadBuffer();
+
+ switch (p_notification->ID) {
+ case MSG_M0TOM4_ZB_MALLOC:
+ {
+ void *ptr;
+
+ assert(p_notification->Size == 1);
+ ptr = malloc((uint32_t)p_notification->Data[0]);
+
+ /* Return ptr in second argument */
+ p_notification->Data[1] = (uint32_t) ptr;
+
+ break;
+ }
+
+ case MSG_M0TOM4_ZB_FREE:
+ assert(p_notification->Size == 1);
+ free((void *)p_notification->Data[0]);
+ break;
+
+ case MSG_M0TOM4_FILTER_MSG_CB:
+ {
+ struct zb_msg_filter_cb_info *cb_info;
+ int retval;
+#ifdef PATCH_MEM1
+#else
+ int *retptr;
+#endif /* PATCH_MEM1 */
+
+ assert(p_notification->Size == 4);
+ cb_info = (struct zb_msg_filter_cb_info *)p_notification->Data[2];
+#ifdef PATCH_MEM1
+#else
+ retptr = (int *)p_notification->Data[3];
+#endif /* PATCH_MEM1 */
+ retval = cb_info->callback(zb_ipc_globals.zb, (uint32_t)p_notification->Data[0],
+ (void *)p_notification->Data[1], cb_info->arg);
+
+#ifdef PATCH_MEM1
+ /******************************************************************************************/
+ /* M4 M0 */
+ /* | | Fill data[0],data[x], etc.. */
+ /* | | */
+ /* | | Call to zigbee_m0_send_notify */
+ /* |<-------------Notif (data[x])------------- | */
+ /* | | */
+ /* |Fill the data[0] | */
+ /* |(contain the status of the notification | */
+ /* | handler) | zigbee_m0_retrieve_notif_data0() */
+ /* | | */
+ /******************************************************************************************/
+
+ p_notification->Data[0] = retval; /* This parameter is filled by the M4 but is read back
+ by the M0 once the M0 has send the notification to
+ the M4*/
+#else
+ if (retptr != NULL) {
+ *retptr = retval;
+ }
+#endif /* PATCH_MEM1 */
+ break;
+ }
+
+ case MSG_M0TOM4_TIMER_CB:
+ {
+ struct ZbTimerT *timer;
+
+ assert(p_notification->Size == 1);
+ timer = (struct ZbTimerT *)p_notification->Data[0];
+ if (timer->callback != NULL) {
+ timer->callback(NULL, timer->arg);
+ }
+ break;
+ }
+
+ case MSG_M0TOM4_STARTUP_CB:
+ assert(p_notification->Size == 2);
+ info = (struct zb_ipc_m4_cb_info *)p_notification->Data[1];
+ if (info->callback != NULL) {
+ void (*callback)(enum ZbStatusCodeT status, void *arg);
+
+ callback = (void (*)(enum ZbStatusCodeT status, void *arg))info->callback;
+ callback((enum ZbStatusCodeT)p_notification->Data[0], info->arg);
+ }
+ break;
+
+ case MSG_M0TOM4_STARTUP_REJOIN_CB:
+ assert(p_notification->Size == 2);
+ info = (struct zb_ipc_m4_cb_info *)p_notification->Data[1];
+ if (info->callback != NULL) {
+ void (*callback)(ZbNlmeJoinConfT *conf, void *arg);
+
+ callback = (void (*)(ZbNlmeJoinConfT *conf, void *arg))info->callback;
+ callback((ZbNlmeJoinConfT *)p_notification->Data[0], info->arg);
+ }
+ break;
+
+ case MSG_M0TOM4_STARTUP_FINDBIND_CB:
+ assert(p_notification->Size == 2);
+ info = (struct zb_ipc_m4_cb_info *)p_notification->Data[1];
+ if (info->callback != NULL) {
+ void (*callback)(enum ZbStatusCodeT status, void *arg);
+
+ callback = (void (*)(enum ZbStatusCodeT status, void *arg))info->callback;
+ callback((enum ZbStatusCodeT)p_notification->Data[0], info->arg);
+ }
+ break;
+
+ case MSG_M0TOM4_STARTUP_TCSO_CB:
+ assert(p_notification->Size == 2);
+ info = (struct zb_ipc_m4_cb_info *)p_notification->Data[1];
+ if (info->callback != NULL) {
+ void (*callback)(enum ZbTcsoStatusT status, void *arg);
+
+ callback = (void (*)(enum ZbTcsoStatusT status, void *arg))info->callback;
+ callback((enum ZbTcsoStatusT)p_notification->Data[0], info->arg);
+ }
+ break;
+
+ case MSG_M0TOM4_STARTUP_TC_REJOIN_CB:
+ assert(p_notification->Size == 2);
+ info = (struct zb_ipc_m4_cb_info *)p_notification->Data[1];
+ if (info->callback != NULL) {
+ void (*callback)(enum ZbStatusCodeT status, void *arg);
+
+ callback = (void (*)(enum ZbStatusCodeT status, void *arg))info->callback;
+ callback((enum ZbStatusCodeT)p_notification->Data[0], info->arg);
+ }
+ break;
+
+ case MSG_M0TOM4_PERSIST_CB:
+ if (zb_persist_cb != NULL) {
+ zb_persist_cb(zb_ipc_globals.zb, zb_persist_arg);
+ }
+ break;
+
+ case MSG_M0TOM4_ZB_LEAVE_CB:
+ assert(p_notification->Size == 2);
+ info = (struct zb_ipc_m4_cb_info *)p_notification->Data[1];
+ if (info->callback != NULL) {
+ void (*callback)(enum ZbStatusCodeT status, void *arg);
+
+ callback = (void (*)(enum ZbStatusCodeT status, void *arg))info->callback;
+ callback((enum ZbStatusCodeT)p_notification->Data[0], info->arg);
+ }
+ break;
+
+ case MSG_M0TOM4_APSDE_DATA_REQ_CB:
+ assert(p_notification->Size == 2);
+ info = (struct zb_ipc_m4_cb_info *)p_notification->Data[1];
+ if (info->callback != NULL) {
+ void (*callback)(ZbApsdeDataConfT *conf, void *arg);
+
+ callback = (void (*)(ZbApsdeDataConfT *conf, void *arg))info->callback;
+ callback((ZbApsdeDataConfT *)p_notification->Data[0], info->arg);
+ }
+ break;
+
+ case MSG_M0TOM4_APS_FILTER_ENDPOINT_CB:
+ {
+ ZbApsdeDataIndT *data_ind;
+ struct aps_filter_cb *aps_filter_cb;
+
+ assert(p_notification->Size == 2);
+ data_ind = (ZbApsdeDataIndT *)p_notification->Data[0];
+ aps_filter_cb = (struct aps_filter_cb *)p_notification->Data[1];
+ if (aps_filter_cb->callback != NULL) {
+ aps_filter_cb->callback(data_ind, aps_filter_cb->cb_arg);
+ }
+ break;
+ }
+
+ case MSG_M0TOM4_NLME_NET_DISC_CB:
+ assert(p_notification->Size == 2);
+ info = (struct zb_ipc_m4_cb_info *)p_notification->Data[1];
+ if (info->callback != NULL) {
+ void (*callback)(ZbNlmeNetDiscConfT *conf, void *arg);
+
+ callback = (void (*)(ZbNlmeNetDiscConfT *conf, void *arg))info->callback;
+ callback((ZbNlmeNetDiscConfT *)p_notification->Data[0], info->arg);
+ }
+ break;
+
+ case MSG_M0TOM4_NLME_LEAVE_CB:
+ assert(p_notification->Size == 2);
+ info = (struct zb_ipc_m4_cb_info *)p_notification->Data[1];
+ if (info->callback != NULL) {
+ void (*callback)(ZbNlmeLeaveConfT *conf, void *arg);
+
+ callback = (void (*)(ZbNlmeLeaveConfT *conf, void *arg))info->callback;
+ callback((ZbNlmeLeaveConfT *)p_notification->Data[0], info->arg);
+ }
+ break;
+
+ case MSG_M0TOM4_NLME_SYNC_CB:
+ assert(p_notification->Size == 2);
+ info = (struct zb_ipc_m4_cb_info *)p_notification->Data[1];
+ if (info->callback != NULL) {
+ void (*callback)(ZbNlmeSyncConfT *conf, void *arg);
+
+ callback = (void (*)(ZbNlmeSyncConfT *discConf, void *arg))info->callback;
+ callback((ZbNlmeSyncConfT *)p_notification->Data[0], info->arg);
+ }
+ break;
+
+ case MSG_M0TOM4_NLME_ROUTE_DISC_CB:
+ assert(p_notification->Size == 2);
+ info = (struct zb_ipc_m4_cb_info *)p_notification->Data[1];
+ if (info->callback != NULL) {
+ void (*callback)(ZbNlmeRouteDiscConfT *discConf, void *cbarg);
+
+ callback = (void (*)(ZbNlmeRouteDiscConfT *discConf, void *cbarg))info->callback;
+ callback((ZbNlmeRouteDiscConfT *)p_notification->Data[0], info->arg);
+ }
+ break;
+
+ case MSG_M0TOM4_ZDO_DEVICE_ANNCE_FILTER_CB:
+ {
+ struct zdo_device_annce_cb_info *cb_info;
+ unsigned int i;
+
+ assert(p_notification->Size == 2);
+ for (i = 0; i < ZB_IPC_ZDO_DEVICE_ANNCE_CB_LIST_MAX; i++) {
+ cb_info = &zdo_device_annce_cb_list[i];
+ if (cb_info->handle != NULL) {
+ cb_info->callback(zb_ipc_globals.zb, (ZbZdoDeviceAnnceT *)p_notification->Data[0], (uint8_t)p_notification->Data[1]);
+ break;
+ }
+ }
+ break;
+ }
+
+ case MSG_M0TOM4_ZDO_NWK_ADDR_CB:
+ assert(p_notification->Size == 2);
+ info = (struct zb_ipc_m4_cb_info *)p_notification->Data[1];
+ if (info->callback != NULL) {
+ void (*callback)(ZbZdoNwkAddrRspT *rsp, void *cbarg);
+
+ callback = (void (*)(ZbZdoNwkAddrRspT *rsp, void *cbarg))info->callback;
+ callback((ZbZdoNwkAddrRspT *)p_notification->Data[0], info->arg);
+ }
+ break;
+
+ case MSG_M0TOM4_ZDO_IEEE_ADDR_CB:
+ assert(p_notification->Size == 2);
+ info = (struct zb_ipc_m4_cb_info *)p_notification->Data[1];
+ if (info->callback != NULL) {
+ void (*callback)(ZbZdoIeeeAddrRspT *rsp, void *cbarg);
+
+ callback = (void (*)(ZbZdoIeeeAddrRspT *rsp, void *cbarg))info->callback;
+ callback((ZbZdoIeeeAddrRspT *)p_notification->Data[0], info->arg);
+ }
+ break;
+
+ case MSG_M0TOM4_ZDO_NODE_DESC_CB:
+ assert(p_notification->Size == 2);
+ info = (struct zb_ipc_m4_cb_info *)p_notification->Data[1];
+ if (info->callback != NULL) {
+ void (*callback)(ZbZdoNodeDescRspT *rsp, void *cbarg);
+
+ callback = (void (*)(ZbZdoNodeDescRspT *rsp, void *cbarg))info->callback;
+ callback((ZbZdoNodeDescRspT *)p_notification->Data[0], info->arg);
+ }
+ break;
+
+ case MSG_M0TOM4_ZDO_POWER_DESC_CB:
+ assert(p_notification->Size == 2);
+ info = (struct zb_ipc_m4_cb_info *)p_notification->Data[1];
+ if (info->callback != NULL) {
+ void (*callback)(ZbZdoPowerDescRspT *rsp, void *cbarg);
+
+ callback = (void (*)(ZbZdoPowerDescRspT *rsp, void *cbarg))info->callback;
+ callback((ZbZdoPowerDescRspT *)p_notification->Data[0], info->arg);
+ }
+ break;
+
+ case MSG_M0TOM4_ZDO_SIMPLE_DESC_CB:
+ assert(p_notification->Size == 2);
+ info = (struct zb_ipc_m4_cb_info *)p_notification->Data[1];
+ if (info->callback != NULL) {
+ void (*callback)(ZbZdoSimpleDescRspT *rsp, void *cbarg);
+
+ callback = (void (*)(ZbZdoSimpleDescRspT *rsp, void *cbarg))info->callback;
+ callback((ZbZdoSimpleDescRspT *)p_notification->Data[0], info->arg);
+ }
+ break;
+
+ case MSG_M0TOM4_ZDO_ACTIVE_EP_CB:
+ assert(p_notification->Size == 2);
+ info = (struct zb_ipc_m4_cb_info *)p_notification->Data[1];
+ if (info->callback != NULL) {
+ void (*callback)(ZbZdoActiveEpRspT *rsp, void *cbarg);
+
+ callback = (void (*)(ZbZdoActiveEpRspT *rsp, void *cbarg))info->callback;
+ callback((ZbZdoActiveEpRspT *)p_notification->Data[0], info->arg);
+ }
+ break;
+
+ case MSG_M0TOM4_ZDO_MATCH_DESC_CB:
+ assert(p_notification->Size == 2);
+ info = (struct zb_ipc_m4_cb_info *)p_notification->Data[1];
+ if (info->callback != NULL) {
+ void (*callback)(ZbZdoMatchDescRspT *rsp, void *cbarg);
+
+ callback = (void (*)(ZbZdoMatchDescRspT *rsp, void *cbarg))info->callback;
+ callback((ZbZdoMatchDescRspT *)p_notification->Data[0], info->arg);
+ }
+ break;
+
+ case MSG_M0TOM4_ZDO_MATCH_DESC_MULTI_CB:
+ if (zdo_match_multi_cb != NULL) {
+ assert(p_notification->Size == 2);
+ zdo_match_multi_cb((ZbZdoMatchDescRspT *)p_notification->Data[0], (void *)p_notification->Data[1]);
+ /* Don't release zdo_match_multi_cb */
+ }
+ break;
+
+ case MSG_M0TOM4_ZDO_BIND_CB:
+ assert(p_notification->Size == 2);
+ info = (struct zb_ipc_m4_cb_info *)p_notification->Data[1];
+ if (info->callback != NULL) {
+ void (*callback)(ZbZdoBindRspT *rsp, void *cbarg);
+
+ callback = (void (*)(ZbZdoBindRspT *rsp, void *cbarg))info->callback;
+ callback((ZbZdoBindRspT *)p_notification->Data[0], info->arg);
+ }
+ break;
+
+ case MSG_M0TOM4_ZDO_UNBIND_CB:
+ assert(p_notification->Size == 2);
+ info = (struct zb_ipc_m4_cb_info *)p_notification->Data[1];
+ if (info->callback != NULL) {
+ void (*callback)(ZbZdoBindRspT *rsp, void *cbarg);
+
+ callback = (void (*)(ZbZdoBindRspT *rsp, void *cbarg))info->callback;
+ callback((ZbZdoBindRspT *)p_notification->Data[0], info->arg);
+ }
+ break;
+
+ case MSG_M0TOM4_ZDO_MGMT_LQI_CB:
+ assert(p_notification->Size == 2);
+ info = (struct zb_ipc_m4_cb_info *)p_notification->Data[1];
+ if (info->callback != NULL) {
+ void (*callback)(ZbZdoLqiRspT *rsp, void *cbarg);
+
+ callback = (void (*)(ZbZdoLqiRspT *rsp, void *cbarg))info->callback;
+ callback((ZbZdoLqiRspT *)p_notification->Data[0], info->arg);
+ }
+ break;
+
+ case MSG_M0TOM4_ZDO_MGMT_BIND_CB:
+ assert(p_notification->Size == 2);
+ info = (struct zb_ipc_m4_cb_info *)p_notification->Data[1];
+ if (info->callback != NULL) {
+ void (*callback)(ZbZdoMgmtBindRspT *rsp, void *cbarg);
+
+ callback = (void (*)(ZbZdoMgmtBindRspT *rsp, void *cbarg))info->callback;
+ callback((ZbZdoMgmtBindRspT *)p_notification->Data[0], info->arg);
+ }
+ break;
+
+ case MSG_M0TOM4_ZDO_MGMT_LEAVE_CB:
+ assert(p_notification->Size == 2);
+ info = (struct zb_ipc_m4_cb_info *)p_notification->Data[1];
+ if (info->callback != NULL) {
+ void (*callback)(ZbZdoLeaveRspT *rsp, void *cbarg);
+
+ callback = (void (*)(ZbZdoLeaveRspT *rsp, void *cbarg))info->callback;
+ callback((ZbZdoLeaveRspT *)p_notification->Data[0], info->arg);
+ }
+ break;
+
+ case MSG_M0TOM4_ZDO_MGMT_PERMIT_JOIN_CB:
+ assert(p_notification->Size == 2);
+ info = (struct zb_ipc_m4_cb_info *)p_notification->Data[1];
+ if (info->callback != NULL) {
+ void (*callback)(ZbZdoPermitJoinRspT *rsp, void *cbarg);
+
+ callback = (void (*)(ZbZdoPermitJoinRspT *rsp, void *cbarg))info->callback;
+ callback((ZbZdoPermitJoinRspT *)p_notification->Data[0], info->arg);
+ }
+ break;
+
+ case MSG_M0TOM4_ZDO_MGMT_NWK_UPDATE_CB:
+ assert(p_notification->Size == 2);
+ info = (struct zb_ipc_m4_cb_info *)p_notification->Data[1];
+ if (info->callback != NULL) {
+ void (*callback)(ZbZdoNwkUpdateNotifyT *rsp, void *cbarg);
+
+ callback = (void (*)(ZbZdoNwkUpdateNotifyT *rsp, void *cbarg))info->callback;
+ callback((ZbZdoNwkUpdateNotifyT *)p_notification->Data[0], info->arg);
+ }
+ break;
+
+ case MSG_M0TOM4_ZCL_CLUSTER_ALARM_CB:
+ {
+ struct ZbZclClusterT *clusterPtr;
+
+ assert(p_notification->Size == 5);
+ clusterPtr = (struct ZbZclClusterT *)p_notification->Data[0];
+ if (clusterPtr->alarm_reset_callback != NULL) {
+ clusterPtr->alarm_reset_callback(clusterPtr, (uint8_t)p_notification->Data[1],
+ (uint16_t)p_notification->Data[2], (ZbApsdeDataIndT *)p_notification->Data[3],
+ (struct ZbZclHeaderT *)p_notification->Data[4]);
+ }
+ break;
+ }
+
+ case MSG_M0TOM4_ZCL_CLUSTER_COMMAND_CB:
+ {
+ struct ZbZclClusterT *clusterPtr;
+ enum ZclStatusCodeT status = ZCL_STATUS_SUCCESS;
+#ifdef PATCH_MEM1
+#else
+ enum ZclStatusCodeT *retptr;
+#endif /* PATCH_MEM1 */
+
+ assert(p_notification->Size == 4);
+ clusterPtr = (struct ZbZclClusterT *)p_notification->Data[0];
+#ifdef PATCH_MEM1
+#else
+ retptr = (enum ZclStatusCodeT *)p_notification->Data[3];
+#endif /* PATCH_MEM1 */
+ if (clusterPtr->command != NULL) {
+ status = clusterPtr->command(clusterPtr, (struct ZbZclHeaderT *)p_notification->Data[1],
+ (ZbApsdeDataIndT *)p_notification->Data[2]);
+ }
+#ifdef PATCH_MEM1
+ /******************************************************************************************/
+ /* M4 M0 */
+ /* | | Fill data[0],data[x], etc.. */
+ /* | | */
+ /* | | Call to zigbee_m0_send_notify */
+ /* |<-------------Notif (data[x])------------- | */
+ /* | | */
+ /* |Fill the data[0] | */
+ /* |(contain the status of the notification | */
+ /* | handler) | zigbee_m0_retrieve_notif_data0() */
+ /* | | */
+ /******************************************************************************************/
+
+ p_notification->Data[0] = status; /* This parameter is filled by the M4 but is read back
+ by the M0 once the M0 has send the notification to
+ the M4*/
+#else
+ if (retptr != NULL) {
+ *retptr = status;
+ }
+#endif /* PATCH_MEM1 */
+
+ break;
+ }
+
+ case MSG_M0TOM4_ZCL_CLUSTER_CONFIG_CB:
+ {
+ struct ZbZclClusterT *clusterPtr;
+
+ assert(p_notification->Size == 5);
+ clusterPtr = (struct ZbZclClusterT *)p_notification->Data[0];
+ if (clusterPtr->config != NULL) {
+ clusterPtr->config(clusterPtr, (ZbApsdeDataIndT *)p_notification->Data[1],
+ (uint16_t)p_notification->Data[2], (enum ZclStatusCodeT)p_notification->Data[3],
+ (uint8_t)p_notification->Data[4]);
+ }
+ break;
+ }
+
+ case MSG_M0TOM4_ZCL_CLUSTER_REPORT_CB:
+ {
+ struct ZbZclClusterT *clusterPtr;
+
+ assert(p_notification->Size == 6);
+ clusterPtr = (struct ZbZclClusterT *)p_notification->Data[0];
+ if (clusterPtr->report != NULL) {
+ clusterPtr->report(clusterPtr, (ZbApsdeDataIndT *)p_notification->Data[1],
+ (uint16_t)p_notification->Data[2], (enum ZclDataTypeT)p_notification->Data[3],
+ (const uint8_t *)p_notification->Data[4], (uint16_t)p_notification->Data[5]);
+ }
+ break;
+ }
+
+ case MSG_M0TOM4_ZCL_CLUSTER_GET_SCENE_CB:
+ {
+ struct ZbZclClusterT *clusterPtr;
+#ifdef PATCH_MEM1
+ uint8_t retval = 0U;
+#else
+ uint8_t *retptr, retval = 0U;
+#endif /*PATCH_MEM1 */
+
+ assert(p_notification->Size == 4);
+ clusterPtr = (struct ZbZclClusterT *)p_notification->Data[0];
+#ifdef PATCH_MEM1
+#else
+ retptr = (uint8_t *)p_notification->Data[3];
+#endif /*PATCH_MEM1 */
+ if (clusterPtr->get_scene_data != NULL) {
+ retval = clusterPtr->get_scene_data(clusterPtr, (uint8_t *)p_notification->Data[1],
+ (uint8_t)p_notification->Data[2]);
+ }
+#ifdef PATCH_MEM1
+ /******************************************************************************************/
+ /* M4 M0 */
+ /* | | Fill data[0],data[x], etc.. */
+ /* | | */
+ /* | | Call to zigbee_m0_send_notify */
+ /* |<-------------Notif (data[x])------------- | */
+ /* | | */
+ /* |Fill the data[0] | */
+ /* |(contain the status of the notification | */
+ /* | handler) | zigbee_m0_retrieve_notif_data0() */
+ /* | | */
+ /******************************************************************************************/
+
+ p_notification->Data[0] = retval; /* This parameter is filled by the M4 but is read back
+ by the M0 once the M0 has send the notification to
+ the M4*/
+#else
+ if (retptr != NULL) {
+ *retptr = retval;
+ }
+#endif /* PATCH_MEM1 */
+ break;
+
+ }
+
+ case MSG_M0TOM4_ZCL_CLUSTER_SET_SCENE_CB:
+ {
+ struct ZbZclClusterT *clusterPtr;
+#ifdef PATCH_MEM1
+#else
+ enum ZclStatusCodeT *retptr;
+#endif /* PATCH_MEM1 */
+ enum ZclStatusCodeT retval = ZCL_STATUS_SUCCESS;
+
+ assert(p_notification->Size == 5);
+ clusterPtr = (struct ZbZclClusterT *)p_notification->Data[0];
+#ifdef PATCH_MEM1
+#else
+ retptr = (enum ZclStatusCodeT *)p_notification->Data[4];
+#endif /* PATCH_MEM1 */
+ if (clusterPtr->set_scene_data != NULL) {
+ retval = clusterPtr->set_scene_data(clusterPtr, (uint8_t *)p_notification->Data[1],
+ (uint8_t)p_notification->Data[2], (uint16_t)p_notification->Data[3]);
+ }
+#ifdef PATCH_MEM1
+ /******************************************************************************************/
+ /* M4 M0 */
+ /* | | Fill data[0],data[x], etc.. */
+ /* | | */
+ /* | | Call to zigbee_m0_send_notify */
+ /* |<-------------Notif (data[x])------------- | */
+ /* | | */
+ /* |Fill the data[0] | */
+ /* |(contain the status of the notification | */
+ /* | handler) | zigbee_m0_retrieve_notif_data0() */
+ /* | | */
+ /******************************************************************************************/
+
+ p_notification->Data[0] = retval; /* This parameter is filled by the M4 but is read back
+ by the M0 once the M0 has send the notification to
+ the M4*/
+#else
+ if (retptr != NULL) {
+ *retptr = retval;
+ }
+ break;
+#endif /* PATCH_MEM1 */
+ }
+
+ case MSG_M0TOM4_ZCL_CLUSTER_CLEANUP_CB:
+ {
+ struct ZbZclClusterT *clusterPtr;
+
+ assert(p_notification->Size == 1);
+ clusterPtr = (struct ZbZclClusterT *)p_notification->Data[0];
+ if (clusterPtr->cleanup != NULL) {
+ clusterPtr->cleanup(clusterPtr);
+ }
+ break;
+ }
+
+ case MSG_M0TOM4_ZCL_CLUSTER_CMD_REQ_CB:
+ assert(p_notification->Size == 2);
+ info = (struct zb_ipc_m4_cb_info *)p_notification->Data[1];
+ if (info->callback != NULL) {
+ void (*callback)(struct ZbZclCommandRspT *rsp, void *cbarg);
+
+ callback = (void (*)(struct ZbZclCommandRspT *rsp, void *cbarg))info->callback;
+ callback((struct ZbZclCommandRspT *)p_notification->Data[0], info->arg);
+ }
+ break;
+
+ case MSG_M0TOM4_ZCL_CLUSTER_CMD_RSP_CONF_CB:
+ assert(p_notification->Size == 2);
+ info = (struct zb_ipc_m4_cb_info *)p_notification->Data[1];
+ if (info->callback != NULL) {
+ void (*callback)(ZbApsdeDataConfT *conf, void *arg);
+
+ callback = (void (*)(ZbApsdeDataConfT *conf, void *arg))info->callback;
+ callback((ZbApsdeDataConfT *)p_notification->Data[0], info->arg);
+ }
+ break;
+
+ case MSG_M0TOM4_ZCL_READ_CB:
+ assert(p_notification->Size == 2);
+ info = (struct zb_ipc_m4_cb_info *)p_notification->Data[1];
+ if (info->callback != NULL) {
+ void (*callback)(ZbZclReadRspT *rsp, void *cbarg);
+
+ callback = (void (*)(ZbZclReadRspT *rsp, void *cbarg))info->callback;
+ callback((ZbZclReadRspT *)p_notification->Data[0], info->arg);
+ }
+ break;
+
+ case MSG_M0TOM4_ZCL_WRITE_CB:
+ assert(p_notification->Size == 2);
+ info = (struct zb_ipc_m4_cb_info *)p_notification->Data[1];
+ if (info->callback != NULL) {
+ void (*callback)(ZbZclWriteRspT *rsp, void *cbarg);
+
+ callback = (void (*)(ZbZclWriteRspT *rsp, void *cbarg))info->callback;
+ callback((ZbZclWriteRspT *)p_notification->Data[0], info->arg);
+ }
+ break;
+
+ case MSG_M0TOM4_ZCL_DISCOVER_ATTR_CB:
+ assert(p_notification->Size == 2);
+ info = (struct zb_ipc_m4_cb_info *)p_notification->Data[1];
+ if (info->callback != NULL) {
+ void (*callback)(ZbZclDiscoverAttrRspT *rsp, void *cbarg);
+
+ callback = (void (*)(ZbZclDiscoverAttrRspT *rsp, void *cbarg))info->callback;
+ callback((ZbZclDiscoverAttrRspT *)p_notification->Data[0], info->arg);
+ }
+ break;
+
+ case MSG_M0TOM4_ZCL_ATTR_CB:
+ {
+ struct ZbZclClusterT *clusterPtr;
+ struct ZbZclAttrCbInfoT *cb;
+ struct ZbZclAttrListEntryT *attr;
+ enum ZclStatusCodeT zcl_status;
+#ifdef PATCH_MEM1
+#else
+ enum ZclStatusCodeT *retptr;
+#endif /*PATCH_MEM1 */
+
+ assert(p_notification->Size == 3);
+ clusterPtr = (struct ZbZclClusterT *)p_notification->Data[0];
+ cb = (struct ZbZclAttrCbInfoT *)p_notification->Data[1];
+#ifdef PATCH_MEM1
+#else
+ retptr = (enum ZclStatusCodeT *)p_notification->Data[2];
+#endif /*PATCH_MEM1 */
+ attr = ZbZclAttrFind(clusterPtr, cb->info->attributeId);
+ if (attr == NULL) {
+#ifdef PATCH_MEM1
+ /******************************************************************************************/
+ /* M4 M0 */
+ /* | | Fill data[0],data[x], etc.. */
+ /* | | */
+ /* | | Call to zigbee_m0_send_notify */
+ /* |<-------------Notif (data[x])------------- | */
+ /* | | */
+ /* |Fill the data[0] | */
+ /* |(contain the status of the notification | */
+ /* | handler) | zigbee_m0_retrieve_notif_data0() */
+ /* | | */
+ /******************************************************************************************/
+
+ p_notification->Data[0] = ZCL_STATUS_SUCCESS; /* This parameter is filled by the M4 but is read back
+ by the M0 once the M0 has send the notification to
+ the M4*/
+#else
+ if (retptr != NULL) {
+ *retptr = ZCL_STATUS_SUCCESS;
+ }
+#endif /* PATCH_MEM1 */
+ break;
+ }
+
+ zcl_status = ZCL_STATUS_SUCCESS;
+ switch (cb->type) {
+ case ZCL_ATTR_CB_TYPE_READ:
+ if ((attr->info->flags & ZCL_ATTR_FLAG_CB_READ) != 0U) {
+ zcl_status = zcl_attr_callback_exec(clusterPtr, attr, cb);
+ }
+ else {
+ zcl_status = ZbZclAttrDefaultRead(clusterPtr, attr, cb->zcl_data, cb->zcl_len);
+ }
+ break;
+
+ case ZCL_ATTR_CB_TYPE_WRITE:
+ if ((attr->info->flags & ZCL_ATTR_FLAG_CB_WRITE) != 0U) {
+ zcl_status = zcl_attr_callback_exec(clusterPtr, attr, cb);
+ }
+ else {
+ zcl_status = ZbZclAttrDefaultWrite(clusterPtr, attr, cb->zcl_data, cb->write_mode);
+ if ((zcl_status == ZCL_STATUS_SUCCESS) && ((attr->info->flags & ZCL_ATTR_FLAG_CB_NOTIFY) != 0U)) {
+ struct ZbZclAttrCbInfoT notify;
+
+ /* Notify the application that this attribute has been modified
+ * internally by the stack. */
+ (void)ZbMemSet(&notify, 0, sizeof(struct ZbZclAttrCbInfoT));
+ notify.info = attr->info;
+ notify.type = ZCL_ATTR_CB_TYPE_NOTIFY;
+ notify.app_cb_arg = clusterPtr->app_cb_arg;
+ (void)zcl_attr_callback_exec(clusterPtr, attr, &notify);
+ }
+ }
+ break;
+
+ case ZCL_ATTR_CB_TYPE_DEFAULT:
+ if ((attr->info->flags & ZCL_ATTR_FLAG_CB_DEFAULT) != 0U) {
+ zcl_status = zcl_attr_callback_exec(clusterPtr, attr, cb);
+ }
+ else {
+ if (attr->valBuf != NULL) {
+ int len;
+
+ len = ZbZclAttrDefaultValue(attr->info->dataType, attr->valBuf, attr->valSz);
+ if ((len > 0) && ((attr->info->flags & ZCL_ATTR_FLAG_CB_NOTIFY) != 0U)) {
+ struct ZbZclAttrCbInfoT notify;
+
+ /* Notify the application that this attribute has been modified
+ * internally by the stack. */
+ (void)ZbMemSet(&notify, 0, sizeof(struct ZbZclAttrCbInfoT));
+ notify.info = attr->info;
+ notify.type = ZCL_ATTR_CB_TYPE_NOTIFY;
+ notify.app_cb_arg = clusterPtr->app_cb_arg;
+ (void)zcl_attr_callback_exec(clusterPtr, attr, &notify);
+ zcl_status = ZCL_STATUS_SUCCESS;
+ }
+ }
+ }
+ break;
+
+ case ZCL_ATTR_CB_TYPE_NOTIFY:
+ if ((attr->info->flags & ZCL_ATTR_FLAG_CB_NOTIFY) != 0U) {
+ (void)zcl_attr_callback_exec(clusterPtr, attr, cb);
+ zcl_status = ZCL_STATUS_SUCCESS;
+ }
+ break;
+
+ default:
+ zcl_status = ZCL_STATUS_SUCCESS;
+ break;
+ }
+#ifdef PATCH_MEM1
+ /******************************************************************************************/
+ /* M4 M0 */
+ /* | | Fill data[0],data[x], etc.. */
+ /* | | */
+ /* | | Call to zigbee_m0_send_notify */
+ /* |<-------------Notif (data[x])------------- | */
+ /* | | */
+ /* |Fill the data[0] | */
+ /* |(contain the status of the notification | */
+ /* | handler) | zigbee_m0_retrieve_notif_data0() */
+ /* | | */
+ /******************************************************************************************/
+
+ p_notification->Data[0] = zcl_status; /* This parameter is filled by the M4 but is read back
+ by the M0 once the M0 has send the notification to
+ the M4*/
+#else
+ if (retptr != NULL) {
+ *retptr = zcl_status;
+ }
+#endif /* PATCH_MEM1 */
+ break;
+ }
+
+ case MSG_M0TOM4_ZCL_KE_WITH_DEVICE_CB:
+ assert(p_notification->Size == 5);
+ info = (struct zb_ipc_m4_cb_info *)p_notification->Data[4];
+ if (info->callback != NULL) {
+ void (*callback)(uint64_t partnerAddr, uint16_t keSuite, enum ZbZclKeyStatusT key_status, void *arg);
+ uint64_t partnerAddr;
+
+ memcpy(&partnerAddr, &p_notification->Data[0], 8);
+ callback = (void (*)(uint64_t partnerAddr, uint16_t keSuite, enum ZbZclKeyStatusT key_status, void *arg))info->callback;
+ callback(partnerAddr, (uint16_t)p_notification->Data[2], (enum ZbZclKeyStatusT)p_notification->Data[3], info->arg);
+ }
+ break;
+
+ default:
+ status = HAL_ERROR;
+ break;
+ }
+
+ if (info != NULL) {
+ zb_ipc_m4_cb_info_free(info);
+ }
+
+ TL_ZIGBEE_SendAckAfterAppliNotifFromM0();
+ return status;
+} /* Zigbee_CallBackProcessing */
+
+HAL_StatusTypeDef
+Zigbee_LoggingProcessing(void)
+{
+ const char *log_str;
+ Zigbee_Cmd_Request_t *p_logging = ZIGBEE_Get_LoggingPayloadBuffer();
+
+ assert(p_logging->Size == 1);
+ log_str = (const char *)p_logging->Data[0];
+ cli_port_print_msg(NULL, log_str);
+
+ TL_ZIGBEE_SendAckAfterAppliLoggingFromM0();
+ return HAL_OK;
+} /* Zigbee_LoggingProcessing */
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/lib/stm32wb_zigbee_wb_lib.a b/Middlewares/ST/STM32_WPAN/zigbee/lib/stm32wb_zigbee_wb_lib.a
new file mode 100644
index 000000000..ad363388e
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/lib/stm32wb_zigbee_wb_lib.a
Binary files differ
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/platform/flash_emulation.c b/Middlewares/ST/STM32_WPAN/zigbee/platform/flash_emulation.c
new file mode 100644
index 000000000..89fa295a9
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/platform/flash_emulation.c
@@ -0,0 +1,78 @@
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+#include "stm32wbxx.h"
+#include "stm32wbxx_hal_conf.h"
+#include "stm32_wpan_common.h"
+#include "flash_emulation.h"
+
+static inline uint32_t
+mapAddress(uint32_t aAddress)
+{
+ return (aAddress + TMP_STORAGE_BUF_ADDR);
+} /* mapAddress */
+
+uint32_t
+utilsFlashGetSize(void)
+{
+ return TMP_STORAGE_BUF_SIZE;
+} /* utilsFlashGetSize */
+
+/**
+ * Write flash. The write operation only clears bits, but never set bits.
+ *
+ * The flash address starts from 0, and this function maps the input address to the physical address of flash for writing.
+ * 0 is always mapped to the beginning of one flash page.
+ * The input address should never be mapped to the firmware space or any other protected flash space.
+ *
+ * @param[in] aAddress The start address of the flash to write.
+ * @param[in] aData The pointer of the data to write.
+ * @param[in] aSize The size of the data to write.
+ *
+ * @returns The actual size of octets write to flash.
+ * It is expected the same as aSize, and may be less than aSize.
+ * 0 indicates that something wrong happens when writing.
+ */
+uint32_t
+utilsFlashWrite(uint32_t aAddress, uint8_t *aData, uint32_t aSize)
+{
+ uint32_t nbOfBytesToWrite = MIN(aSize, TMP_STORAGE_BUF_SIZE);
+
+ memcpy((uint8_t *)mapAddress(aAddress), aData, nbOfBytesToWrite);
+
+ return nbOfBytesToWrite;
+} /* utilsFlashWrite */
+
+/**
+ * Read flash.
+ *
+ * The flash address starts from 0, and this function maps the input address to the physical address of flash for reading.
+ * 0 is always mapped to the beginning of one flash page.
+ * The input address should never be mapped to the firmware space or any other protected flash space.
+ *
+ * @param[in] aAddress The start address of the flash to read.
+ * @param[Out] aData The pointer of buffer for reading.
+ * @param[in] aSize The size of the data to read.
+ *
+ * @returns The actual size of octets read to buffer.
+ * It is expected the same as aSize, and may be less than aSize.
+ * 0 indicates that something wrong happens when reading.
+ */
+uint32_t
+utilsFlashRead(uint32_t aAddress, uint8_t *aData, uint32_t aSize)
+{
+ uint32_t nbOfBytesToRead = 0;
+
+ /* Check the number of bytes to read */
+ if ((aAddress + aSize) > TMP_STORAGE_BUF_SIZE) {
+ nbOfBytesToRead = TMP_STORAGE_BUF_SIZE - aAddress;
+ }
+ else {
+ nbOfBytesToRead = aSize;
+ }
+
+ /* Perform the copy */
+ memcpy(aData, (uint8_t *)mapAddress(aAddress), nbOfBytesToRead);
+
+ return nbOfBytesToRead;
+} /* utilsFlashRead */
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/platform/flash_emulation.h b/Middlewares/ST/STM32_WPAN/zigbee/platform/flash_emulation.h
new file mode 100644
index 000000000..2829b6114
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/platform/flash_emulation.h
@@ -0,0 +1,48 @@
+/**
+ ******************************************************************************
+ * @file flash_emulation.h
+ * @author MCD Application Team
+ * @brief This file contains the flash emulation.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * 3. Neither the name of STMicroelectronics nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ ******************************************************************************
+ */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __FLASH_EMULATION_H
+#define __FLASH_EMULATION_H
+
+#define TMP_STORAGE_BUF_ADDR 0x2002F000 /* Should be __ICFEDIT_region_RAM_end__ inside the scatter file*/
+#define TMP_STORAGE_BUF_SIZE (0x2002FFFF - TMP_STORAGE_BUF_ADDR)
+
+uint32_t utilsFlashGetSize(void);
+uint32_t utilsFlashWrite(uint32_t aAddress, uint8_t *aData, uint32_t aSize);
+uint32_t utilsFlashRead(uint32_t aAddress, uint8_t *aData, uint32_t aSize);
+
+#endif //__FLASH_EMULATION_H
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/stack/include/M4/local.zigbee.h b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/M4/local.zigbee.h
new file mode 100644
index 000000000..adc016a71
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/M4/local.zigbee.h
@@ -0,0 +1,84 @@
+/* Copyright [2009 - 2019] Exegin Technologies Limited. All rights reserved. */
+
+#ifndef M4_LOCAL_ZIGBEE_H
+# define M4_LOCAL_ZIGBEE_H
+
+/* This file is for the M4 side only, and is mainly for the cluster code that
+ * can be compiled with the zigbee stack, or separate like in this case. */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stddef.h> /* size_t */
+#include <stdlib.h> /* rand */
+#include <stdint.h>
+
+#ifndef AES_BLOCK_SIZE
+# define AES_BLOCK_SIZE 16U
+#endif
+
+struct ZigBeeT;
+
+/*---------------------------------------------------------------
+ * critical lock (Should not be needed on this platform)
+ *---------------------------------------------------------------
+ */
+#define ZbEnterCritical(_zb_)
+#define ZbExitCritical(_zb_)
+
+/*---------------------------------------------------------------
+ * memory allocation
+ *---------------------------------------------------------------
+ */
+void * zb_heap_alloc(struct ZigBeeT *zb, size_t sz, const char *funcname, unsigned int linenum);
+void zb_heap_free(struct ZigBeeT *zb, void *ptr, const char *funcname, unsigned int linenum);
+#define ZbHeapAlloc(_zb_, _sz_) zb_heap_alloc(_zb_, _sz_, "", 0)
+#define ZbHeapFree(_zb_, _ptr_) zb_heap_free(_zb_, _ptr_, "", 0)
+
+/*---------------------------------------------------------------
+ * memset, memcpy, memmove, strcpy replacements
+ *---------------------------------------------------------------
+ */
+void * ZbMemSet(void *s, int c, size_t n);
+void * ZbMemCpy(void *dest, const void *src, size_t n);
+void * ZbMemMove(void *dest, const void *src, size_t n);
+char * ZbStrCpy(char *dest, const char *src);
+
+/*---------------------------------------------------------------
+ * String conversion
+ *---------------------------------------------------------------
+ */
+int zb_hex_str_to_bin(const char *string, void *out, unsigned int maxlen);
+unsigned int zb_hex_bin_to_str(const uint8_t *in_data, unsigned int in_len, char *out_str, unsigned int max_len,
+ const char delimiter, unsigned int interval);
+
+/*---------------------------------------------------------------
+ * random value
+ *---------------------------------------------------------------
+ */
+/* On M4, this doesn't need to be very random. Not used with security. */
+#define ZbPortGetRand(zb) rand()
+
+/*---------------------------------------------------------------
+ * AES Hashing
+ *---------------------------------------------------------------
+ */
+typedef struct {
+ uint8_t m[AES_BLOCK_SIZE];
+ uint8_t hash[AES_BLOCK_SIZE];
+ uint8_t key[AES_BLOCK_SIZE];
+ uint8_t length;
+} ZbHashT;
+
+/* Matyas-Meyer-Oseas hash function. */
+void ZbHashInit(ZbHashT *h);
+void ZbHashAdd(ZbHashT *h, const void *data, uint32_t len);
+void ZbHashByte(ZbHashT *h, uint8_t byte);
+void ZbHashDigest(ZbHashT *h, void *digest);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* M4_LOCAL_ZIGBEE_H */
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/endian.h b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/endian.h
new file mode 100644
index 000000000..5092ef20d
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/endian.h
@@ -0,0 +1,15 @@
+/* Copyright [2019] Exegin Technologies Limited. All rights reserved. */
+
+#ifndef ZIGBEE_ENDIAN_H
+#define ZIGBEE_ENDIAN_H
+
+#ifndef BIG_ENDIAN
+# define BIG_ENDIAN 4321
+#endif
+#ifndef LITTLE_ENDIAN
+# define LITTLE_ENDIAN 1234
+#endif
+
+#define BYTE_ORDER LITTLE_ENDIAN
+
+#endif /* ZIGBEE_ENDIAN_H */
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/ieee802154.api.h b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/ieee802154.api.h
new file mode 100644
index 000000000..0a49155c4
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/ieee802154.api.h
@@ -0,0 +1,1046 @@
+/* Copyright [2009 - 2019] Exegin Technologies Limited. All rights reserved. */
+
+/* API between MAC and NHLE */
+
+/* Warning 656: Arithmetic operation uses (compatible) enum's */
+/* Note 9027: Unpermitted operand to operator '+' [MISRA 2012 Rule 10.1, required] */
+/* Note 9029: Mismatched essential type categories for binary operator [MISRA 2012 Rule 10.4, required] */
+/*lint -save -e656 -e9027 -e9029 */
+
+#ifndef IEEE802154_API_H
+#define IEEE802154_API_H
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <limits.h>
+
+#include "ieee802154.h"
+#include "mcp.h"
+#include "mcp_enums.h"
+#include "llist.h"
+#include "pletoh.h"
+#if 0
+#include "phy.h" /* FIXME - move phy.h out of radio.git and into it's own repo like we do with MCP? */
+#endif
+
+#ifndef PHY_RSSI_INVALID
+#define PHY_RSSI_INVALID (-128)
+#endif
+
+#ifndef PHY_TX_POWER_MAX
+/* The maximum (default) transmit power currently supported.
+ * A value of 14 dBm aligns with the current GB-868 maximum. */
+#define PHY_TX_POWER_MAX 14 /* dBm */
+#define PHY_TX_POWER_MIN (-20) /* dBm */
+#endif
+
+#if defined(__GNUC__)
+# define WPAN_WARN_UNUSED __attribute__((warn_unused_result))
+#else
+# define WPAN_WARN_UNUSED
+#endif
+
+#ifndef MIN
+# define MIN(a, b) (((a) < (b)) ? (a) : (b))
+#endif
+
+struct WpanPublicT;
+
+/* FIXME 2 - Make IEEE802154_MODE_ defines an enum. */
+typedef uint8_t WpanAddrModeT; /* e.g. IEEE802154_MODE_SHORT */
+
+/*----------------------------------------------------------------------------
+ * Channels and Channel Masks
+ *----------------------------------------------------------------------------
+ */
+/* Maximum number of channels for a given 32-bit channel mask. */
+#define WPAN_CHANNELS_PER_MASK 32U
+/* Maximum channel value. logicalChannel is a 16-bit value. Keep it within
+ * that type's range. 0xffff is otherwise arbitrary. */
+#define WPAN_CHANNELS_MAX 0xffffU
+
+/* Maximum channels per page and channel mask, assuming 32-bit channel mask
+ * and top 5-bits are reserved for page.
+ *
+ * Note that page bits are not an 802.15.4 concept, so the page is never
+ * encoded in the channel mask for the MAC API. There is always a separate
+ * channel page parameter (channelPage) from the channel or channel mask. */
+#define WPAN_PAGE_CHANNELS_MAX 27U
+#define WPAN_PAGE_CHANNELMASK_ALL 0x07FFFFFFU /* Channels 0 to 26 */
+
+/* Specific channel masks */
+#define WPAN_CHANNELMASK_868MHZ 0x00000001U /* Channel 0 */
+#define WPAN_CHANNELMASK_915MHZ 0x000007FEU /* Channels 1-10 */
+#define WPAN_CHANNELMASK_2400MHZ 0x07FFF800U /* Channels 11-26 */
+
+/* GB-868 channel masks (863 to 876 MHz) */
+#define WPAN_CHANNELMASK_PAGE28 0x07FFFFFFU /* Channels 0 to 26 */
+#define WPAN_CHANNELMASK_PAGE29 0x000000FFU /* Channels 27 to 34 (0 to 7) */
+#define WPAN_CHANNELMASK_PAGE30 0x00003FFFU /* Channels 35 to 48 (0 to 13) */
+/* GB-868 channel masks (915 to 921 MHz) */
+#define WPAN_CHANNELMASK_PAGE31 0x00001FFFU /* Channels 0 to 12 */
+
+/* Virtual channel page (BDL/SCoP). Arbitrarily chosen. */
+#define WPAN_CHANNELPAGE_VIRTUAL_MIN 16U
+#define WPAN_CHANNELPAGE_VIRTUAL_MAX 17U
+#define WPAN_CHANNELMASK_VIRTUAL WPAN_PAGE_CHANNELMASK_ALL /* Channels 0 to 26 */
+
+#define WPAN_CHANNELPAGE_SUN 9U
+
+/*----------------------------------------------------------------------------
+ * Packet Sizes
+ *----------------------------------------------------------------------------
+ */
+#define WPAN_CONST_MAX_PHY_PACKET_SIZE 127U
+
+/* Minimum v0 and v1 Beacon overhead, assuming:
+ * - extended addressing (typically short, but be on the safe side)
+ * - no security
+ * - GTS count = 0
+ * - no pending addresses */
+#define WPAN_CONST_MIN_BEACON_OVERHEAD (17U + 2U /* FCS */) /* 19 */
+
+/* Maximum v0 and v1 Beacon overhead, assuming:
+ * - extended addressing
+ * - no security
+ * - GTS count = 0
+ * - 7 extended pending addresses (56 bytes) */
+#define WPAN_CONST_MAX_BEACON_OVERHEAD (17U + 56U + 2U) /* 75*/
+
+/* For the maximum beacon payload length, assume minimum overhead */
+#define WPAN_CONST_MAX_BEACON_PAYLOAD_LENGTH (WPAN_CONST_MAX_PHY_PACKET_SIZE - WPAN_CONST_MIN_BEACON_OVERHEAD) /* 108 */
+
+/* For ZigBee PRO, ZB_NWK_CONST_MAC_FRAME_OVERHEAD is 11. */
+#define WPAN_CONST_MPDU_OVERHEAD 11U /* minimum overhead is 9 */
+
+#define WPAN_CONST_MAX_MAC_PAYLOAD_SIZE (WPAN_CONST_MAX_PHY_PACKET_SIZE - WPAN_CONST_MPDU_OVERHEAD)
+#define WPAN_IE_MAX_SIZE WPAN_CONST_MAX_MAC_PAYLOAD_SIZE
+
+/*----------------------------------------------------------------------------
+ * Packet Durations (symbols)
+ *----------------------------------------------------------------------------
+ */
+#define WPAN_CONST_BASE_SLOT_DURATION 60U
+#define WPAN_CONST_NUM_SUPERFRAME_SLOTS 16U
+#define WPAN_CONST_UNIT_BACKOFF_PERIOD 20U
+#define WPAN_CONST_TURNAROUND_TIME 12U
+#define WPAN_CONST_BASE_SUPERFRAME_DURATION (WPAN_CONST_BASE_SLOT_DURATION * WPAN_CONST_NUM_SUPERFRAME_SLOTS)
+
+/* macResponseWaitTime - multiples of aBaseSuperframeDuration (960) symbols. */
+#define WPAN_CONST_RESPONSE_WAIT_DEFAULT 32U /* 30,720 symbols (@ 62,500 sym/sec = 492 mS) */
+
+/*----------------------------------------------------------------------------
+ * Superframe Specification field bits
+ *----------------------------------------------------------------------------
+ */
+#define WPAN_SUPERFRAME_MASK_BEACON 0x000fU
+#define WPAN_SUPERFRAME_MASK_SUPERFRAME 0x00f0U
+#define WPAN_SUPERFRAME_MASK_FINAL_CAP 0x0f00U
+#define WPAN_SUPERFRAME_MASK_BATTERY_EXT 0x1000U
+#define WPAN_SUPERFRAME_MASK_RESERVED 0x2000U
+#define WPAN_SUPERFRAME_MASK_PAN_COORD 0x4000U
+#define WPAN_SUPERFRAME_MASK_PERMIT_JOIN 0x8000U
+
+#define WPAN_SUPERFRAME_OFFSET_BEACON 0U
+#define WPAN_SUPERFRAME_OFFSET_SUPERFRAME 4U
+#define WPAN_SUPERFRAME_OFFSET_FINAL_CAP 8U
+#define WPAN_SUPERFRAME_OFFSET_BATTERY_EXT 12U
+#define WPAN_SUPERFRAME_OFFSET_PAN_COORD 14U
+#define WPAN_SUPERFRAME_OFFSET_PERMIT_JOIN 15U
+
+/*----------------------------------------------------------------------------
+ * GTS Specification field bits
+ *----------------------------------------------------------------------------
+ */
+#define WPAN_GTS_MASK_COUNT 0x07U
+#define WPAN_GTS_MASK_PERMIT 0x80U
+#define WPAN_GTS_OFFSET_COUNT 0U
+#define WPAN_GTS_OFFSET_PERMIT 7U
+
+/*----------------------------------------------------------------------------
+ * Pending Address field bits
+ *----------------------------------------------------------------------------
+ */
+#define WPAN_PENDADDR_MASK_SHORT 0x07U
+#define WPAN_PENDADDR_MASK_LONG 0x70U
+#define WPAN_PENDADDR_MASK_RESERVED 0x88U
+
+#define WPAN_PENDADDR_OFFSET_SHORT 0U
+#define WPAN_PENDADDR_OFFSET_LONG 4U
+
+/*----------------------------------------------------------------------------
+ * Transmit Power
+ *----------------------------------------------------------------------------
+ */
+/* Transmit power format. */
+#define WPAN_TXPOWER_POWER_MASK 0x3fU
+#define WPAN_TXPOWER_POWER_MAX 31
+#define WPAN_TXPOWER_POWER_MIN -32
+#define WPAN_TXPOWER_TOLERANCE_MASK 0xc0U
+#define WPAN_TXPOWER_TOLERANCE_1DB 0x00U
+#define WPAN_TXPOWER_TOLERANCE_3DB 0x40U
+#define WPAN_TXPOWER_TOLERANCE_6DB 0x80U
+
+/* Sign-extend the 6bit transmit power value to a signed integer. */
+#define WPAN_TXPOWER_AS_INT(_v_) ((int)(((_v_) & 0x3f) ^ ~0x1f) - ~0x1f)
+
+/*----------------------------------------------------------------------------
+ * Join Policy
+ *----------------------------------------------------------------------------
+ */
+/* Warning, the MAC does not define these values. ZigBee R22 defines these
+ * values as shown below. */
+enum WpanJoinPolicyT {
+ WPAN_JOIN_POLICY_ALL = 0, /* 0x00 = ALL_JOIN */
+ WPAN_JOIN_POLICY_IEEELIST, /* 0x01 = IEEELIST_JOIN */
+ WPAN_JOIN_POLICY_NONE /* 0x02 = NO_JOIN */
+};
+
+/*---------------------------------------------------------
+ * Diagnostics Information structure
+ *---------------------------------------------------------
+ */
+/* mcp_macDiagClusterInfo */
+/* Make sure this struct is self-packing and aligned to 8-byte boundaries for transfering via MCP. */
+struct mac_diag_info {
+ uint32_t mac_rx_bcast; /* ZCL_DIAG_ATTR_MAC_RX_BCAST */
+ uint32_t mac_tx_bcast; /* ZCL_DIAG_ATTR_MAC_TX_BCAST */
+ uint32_t mac_rx_ucast; /* ZCL_DIAG_ATTR_MAC_RX_UCAST */
+ uint32_t mac_tx_ucast; /* ZCL_DIAG_ATTR_MAC_TX_UCAST */
+ uint16_t mac_tx_ucast_retry; /* ZCL_DIAG_ATTR_MAC_TX_UCAST_RETRY */
+ uint16_t mac_tx_ucast_fail; /* ZCL_DIAG_ATTR_MAC_TX_UCAST_FAIL */
+ uint16_t phy_to_mac_queue_lim_reached; /* ZCL_DIAG_ATTR_PHY_MAC_QUEUE_LIM */
+ uint16_t packet_validate_drop_count; /* ZCL_DIAG_ATTR_PACKET_VAL_DROP_COUNT (Note, also in zb_diag_info) */
+ uint16_t avg_mac_retry_per_aps_msg_sent; /* ZCL_DIAG_ATTR_AVG_MAC_RETRY_PER_APS_MSG */
+ uint8_t last_message_lqi; /* ZCL_DIAG_ATTR_LAST_MSG_LQI */
+ int8_t last_message_rssi; /* ZCL_DIAG_ATTR_LAST_MSG_RSSI */
+};
+
+/*---------------------------------------------------------------
+ * MCP Error
+ *---------------------------------------------------------------
+ */
+void wpan_mcp_error_init(struct mcp_error *error, uint8_t seqno);
+
+/*---------------------------------------------------------------
+ * Attribute Payload Types
+ *---------------------------------------------------------------
+ */
+/* Scalar */
+/* struct mcp_scalar */
+
+/* Payload */
+struct wpan_attr_payload {
+ struct mcp_attr attr; /* len = MCP_TLV_LEN(sizeof(struct mcp_attr)) */
+ struct mcp_payload payload;
+ uint8_t buf[WPAN_CONST_MAX_PHY_PACKET_SIZE];
+};
+
+/*---------------------------------------------------------------
+ * MLME-GET
+ *---------------------------------------------------------------
+ */
+/* MLME-GET.request */
+struct wpan_get_req {
+ struct mcp_getreq req;
+ struct mcp_attr attr;
+};
+
+/* MLME-GET.confirm */
+/*
+{
+ struct mcp_getconf conf;
+ struct wpan_attr_payload payload;
+};
+or
+{
+ struct mcp_getconf conf;
+ struct mcp_scalar payload;
+};
+*/
+
+void wpan_get_req_init(struct wpan_get_req *req);
+void wpan_get_conf_scalar_init(struct mcp_getconf *conf, uint16_t id, uint8_t seqno);
+void wpan_get_conf_payload_init(struct mcp_getconf *conf, uint16_t id, uint8_t seqno);
+
+bool WPAN_WARN_UNUSED wpan_get_uint64(struct WpanPublicT *publicPtr, enum mcp_attr_id attrId, uint64_t *value, uint16_t index);
+bool WPAN_WARN_UNUSED wpan_get_uint32(struct WpanPublicT *publicPtr, enum mcp_attr_id attrId, uint32_t *value, uint16_t index);
+bool WPAN_WARN_UNUSED wpan_get_uint16(struct WpanPublicT *publicPtr, enum mcp_attr_id attrId, uint16_t *value, uint16_t index);
+bool WPAN_WARN_UNUSED wpan_get_uint8(struct WpanPublicT *publicPtr, enum mcp_attr_id attrId, uint8_t *value, uint16_t index);
+#if 0 /* not required for this port */
+#define WPAN_HAVE_LICENSE
+bool WPAN_WARN_UNUSED wpan_get_license(struct WpanPublicT *publicPtr, struct wpan_license *license);
+#endif
+
+/*---------------------------------------------------------------
+ * MLME-SET
+ *---------------------------------------------------------------
+ */
+
+/* MLME-SET.request */
+/* {
+ * struct mcp_setreq req;
+ * struct mcp_scalar scalar;
+ * }
+ * or
+ * {
+ * struct mcp_setreq req;
+ * struct wpan_attr_payload payload;
+ * }
+ */
+
+/* MLME-SET.confirm */
+struct wpan_set_conf {
+ struct mcp_setconf conf;
+ struct mcp_attr attr;
+};
+
+void wpan_set_req_scalar_init(struct mcp_setreq *req, uint16_t id);
+void wpan_set_req_payload_init(struct mcp_setreq *req, uint16_t id);
+void wpan_set_conf_init(struct wpan_set_conf *conf, uint16_t id, uint8_t seqno);
+
+bool WPAN_WARN_UNUSED wpan_set_uint64(struct WpanPublicT *publicPtr, enum mcp_attr_id attrId, uint64_t value64, uint16_t index);
+bool WPAN_WARN_UNUSED wpan_set_uint32(struct WpanPublicT *publicPtr, enum mcp_attr_id attrId, uint32_t value, uint16_t index);
+bool WPAN_WARN_UNUSED wpan_set_uint16(struct WpanPublicT *publicPtr, enum mcp_attr_id attrId, uint16_t value, uint16_t index);
+bool WPAN_WARN_UNUSED wpan_set_uint8(struct WpanPublicT *publicPtr, enum mcp_attr_id attrId, uint8_t value, uint16_t index);
+bool WPAN_WARN_UNUSED wpan_set_bcnpayload(struct WpanPublicT *publicPtr, uint8_t *buf, uint16_t len);
+
+/*---------------------------------------------------------------
+ * MLME-GET/SET TX Power
+ *---------------------------------------------------------------
+ */
+bool WpanGetTxPower(struct WpanPublicT *publicPtr, int *powerPtr, uint8_t *tolerancePtr);
+bool WpanSetTxPower(struct WpanPublicT *publicPtr, int power, uint8_t tolerance);
+
+/*---------------------------------------------------------
+ * MCPS-PURGE
+ *---------------------------------------------------------
+ */
+/*
+ * The MCPS-PURGE service is used to cancel a pending MCPS-DATA.request that
+ * has not yet been transmitted. The pending transation should be identified
+ * by the MSDU handle provided in the MCPS-DATA.request. If the MSDU handle
+ * not unique, then the behavior is unspecified.
+ *
+ * This function is optional, and does not need to be implemented on all
+ * devices. Although, it is recommended for all devices that make use of the
+ * indirect transmission service.
+ */
+
+/* MCPS-PURGE.request */
+/* struct mcp_purgereq */
+
+/* MCPS-PURGE.confirm */
+/* struct mcp_purgeconf */
+
+void wpan_purge_req_init(struct mcp_purgereq *req);
+void wpan_purge_conf_init(struct mcp_purgeconf *conf, uint8_t seqno);
+bool wpan_purge_req(struct WpanPublicT *publicPtr, struct mcp_purgereq *req, struct mcp_purgeconf *conf);
+
+/*---------------------------------------------------------------
+ * MLME-DATA
+ *---------------------------------------------------------------
+ */
+/*
+ * The MCPS-DATA.indication service is used to pass received packets to the
+ * NHLE. And will be called for any received data packet that passes
+ * address recognition.
+ *
+ * The MCPS-DATA.request service is used to begin the transmission of a data
+ * packet. The payload buffer only needs to be valid for the duration of the
+ * function call, and is not required to be allocated from the heap. The
+ * MCPS-DATA.confirm service returns the results of the transmission attempt
+ * and is returned asynchronously via a callback function.
+ *
+ * These functions are mandatory, and are the "meat and potatoes" of the
+ * IEEE 802.15.4 device. For most applications, the acknowledgment and
+ * indirect services must be supported (ZigBee). GTS transmissions are only
+ * required for beacon-enabled PAN's.
+ *
+ * The MSDU handle is an 8-bit parameter specified by the upper layers to
+ * associate a request with the asynchronous response. Earlier version. Due to
+ * the 8-bit size, pointers may not be used here, but table indices are fine.
+ *
+ * For indirect and GTS transmissions, the packet will not be transmitted
+ * immediately and may need to wait for a long duration. If necessary, the NHLE
+ * can cancel the pending packet using the MCPS-PURGE service below. Likewise,
+ * it is recommended that the MSDU handle should be unique within a single
+ * device.
+ */
+
+/* MCPS-DATA.request */
+struct wpan_data_req {
+ struct mcp_datareq req;
+ /* FIXME - make security optional */
+ struct mcp_security security;
+ struct mcp_payload payload;
+ uint8_t buf[WPAN_CONST_MAX_PHY_PACKET_SIZE];
+};
+
+/* MCPS-DATA.confirm */
+/* struct mcp_dataconf */
+
+/* MCPS-DATA.indication */
+struct wpan_data_ind {
+ struct mcp_dataind ind;
+ struct mcp_linkquality lqi;
+ /* FIXME - make security optional */
+ struct mcp_security security;
+ struct mcp_payload payload;
+ uint8_t buf[WPAN_CONST_MAX_PHY_PACKET_SIZE];
+};
+
+void wpan_data_req_init(struct wpan_data_req *req);
+void wpan_data_conf_init(struct mcp_dataconf *conf, uint8_t seqno);
+void wpan_data_ind_init(struct wpan_data_ind *ind);
+
+bool wpan_data_req(struct WpanPublicT *publicPtr, struct wpan_data_req *req);
+
+/*---------------------------------------------------------------
+ * MLME-RESET
+ *---------------------------------------------------------------
+ */
+/* MLME-RESET.request */
+/* struct mcp_resetreq */
+
+/* MLME-RESET.confirm */
+/* struct mcp_resetconf */
+
+void wpan_reset_req_init(struct mcp_resetreq *req);
+void wpan_reset_conf_init(struct mcp_resetconf *conf, uint8_t seqno);
+bool wpan_reset_req(struct WpanPublicT *publicPtr, struct mcp_resetreq *req, struct mcp_resetconf *conf);
+
+/*---------------------------------------------------------------
+ * MLME-POLL
+ *---------------------------------------------------------------
+ */
+/*
+ * The MLME-POLL service is used to retrieve pending packets from a device's
+ * parent.Issuing this request will transmit a data request command to the
+ * specified device, and wait for an acknowledgement. If the frame-pending
+ * bit in the acknowledgement is not set, then this will return a status of
+ * NO_DATA.
+ *
+ * Strictly according to the specification, this should also wait for the
+ * parent to dequeue and transmit the pending frames before returning SUCCESS
+ * but in reality most devices just return after receiving the ACK.
+ *
+ * This function is mandatory for all deivce types, but is used most requently
+ * deivces with macRxOnWhenidle set to FALSE.
+ */
+/* MLME-POLL.request */
+struct wpan_poll_req {
+ struct mcp_pollreq req;
+ struct mcp_security security;
+};
+
+/* MLME-POLL.confirm */
+/* struct mcp_pollconf */
+
+/* MLME-POLL.indication */
+/* struct mcp_pollind */
+
+void wpan_poll_req_init(struct wpan_poll_req *req);
+void wpan_poll_conf_init(struct mcp_pollconf *conf, uint8_t seqno);
+void wpan_poll_ind_init(struct mcp_pollind *ind);
+bool wpan_poll_req(struct WpanPublicT *publicPtr, struct wpan_poll_req *req);
+
+/*---------------------------------------------------------------
+ * MLME-START
+ *---------------------------------------------------------------
+ */
+/*
+ * The MLME-START service is used to begin operating as a full-function device, prior
+ * to receiving an MLME-START.request, the device should not respond transmit beacon
+ * frames, nor should it respond to beacon request commands.
+ *
+ * On full-function devices, this service may also be used to change the active channel
+ * and beacon-timing parameters. (Note that for RFD's there is no service to change
+ * channels, and the device should directly set the phyCurrentChannel PIB attribute (if
+ * unsupported, orphan scanning is likely the only method left to rejoin a moved PAN).
+ *
+ * If the coordRealignment parameter is set to true, then device will also broadcast a
+ * coordinator realignment command prior to changing its parameters.
+ *
+ * This service is mandatory for full-function devices, and is never used for end
+ * devices.
+ */
+/* MLME-START.request */
+/* struct mcp_startreq */
+
+/* MLME-START.confirm */
+/* struct mcp_startconf */
+
+void wpan_start_req_init(struct mcp_startreq *req);
+void wpan_start_conf_init(struct mcp_startconf *conf, uint8_t seqno);
+bool wpan_start_req(struct WpanPublicT *publicPtr, struct mcp_startreq *req, struct mcp_startconf *conf);
+
+/*---------------------------------------------------------------
+ * MLME-RX-ENABLE
+ *---------------------------------------------------------------
+ */
+/*
+ * The MLME-RX-ENABLE service is used to enable (or disable) the receiver for a
+ * period of time. This function should return immediately without waiting for
+ * the receiver to be turned on.
+ *
+ * This function has no effect when macRxOnWhenIdle is true. Otherwise, the
+ * receipt of this function should supersede all previous requests. Likewise,
+ * setting rxOnDuration to 0 will disable the receiver if currently enabled.
+ *
+ * The deferPermit and rxOnTime parameters are ignored unless operating on a
+ * beacon enabled network, in which case they specify which superframe this
+ * command applies to, and when in the superframe to enable the receiver.
+ *
+ * On non-beacon enabled networks, the enable time takes effect immediately.
+ */
+
+/* MLME-RX-ENABLE.request */
+/* struct mcp_rxenreq; */
+
+/* MLME-RX-ENABLE.confirm */
+/* struct mcp_rxenconf; */
+
+void wpan_rx_enable_req_init(struct mcp_rxenreq *req);
+void wpan_rx_enable_conf_init(struct mcp_rxenconf *conf, uint8_t seqno);
+bool wpan_rx_enable_req(struct WpanPublicT *publicPtr, struct mcp_rxenreq *req, struct mcp_rxenconf *conf);
+
+/*---------------------------------------------------------------
+ * MLME-ASSOCIATE
+ *---------------------------------------------------------------
+ */
+/*
+ * The MLME-ASSOCIATE service is used to facilitate the MAC-layer
+ * association procedure, and consists of four primitives:
+ * MLME-ASSOCIATE.request - Requests the device to associate to a parent.
+ * MLME-ASSOCIATE.confirm - Returns the result of an association attempt.
+ * MLME-ASSOCIATE.indication - Notifies the NHLE that a device requested assoication.
+ * MLME-ASSOCIATE.response - Requests that the device respond to an association request.
+ *
+ * MLME-ASSOCIATE.request and MLME-ASSOCIATE.confirm are implemented
+ * with a blocking function, and are mandatory for all IEEE 802.15.4
+ * devices.
+ *
+ * MLME-ASSOCIATE.indication is passed from the driver to the NHLE using
+ * a callback function. The NHLE should not expect the
+ * MLME-ASSOCIATE.indication callback to be executed from a thread-safe
+ * context, the exact context is device dependent. After receiving this
+ * indication, the NHLE must respond with an MLME-ASSOCIATE.response
+ * within macResponseWaitTime.
+ *
+ * MLME-ASSOCIATE.response is implemented as a blocking function, returning
+ * an MLME-COMM-STATUS.indication after the device successfully polls for the
+ * association response command, or the indirect transmission expires.
+ *
+ * MLME-ASSOCIATE.indication and MLME-ASSOCIATE.response are mandatory for
+ * full function devices (ZigBee coordinators and routers), and is optional
+ * for reduced function devices (ZigBee end devices).
+ *
+ */
+
+/* MLME-ASSOCIATE.request */
+struct wpan_assoc_req {
+ struct mcp_assocreq req;
+ struct mcp_security security;
+};
+
+/* MLME-ASSOCIATE.confirm */
+struct wpan_assoc_conf {
+ struct mcp_assocconf conf;
+ struct mcp_security security;
+};
+
+/* MLME-ASSOCIATE.indication */
+struct wpan_assoc_ind {
+ struct mcp_assocind ind;
+ struct mcp_security security;
+};
+
+/* MLME-ASSOCIATE.response */
+struct wpan_assoc_rsp {
+ struct mcp_assocrsp rsp;
+ struct mcp_security security;
+};
+
+void wpan_assoc_req_init(struct wpan_assoc_req *req);
+void wpan_assoc_conf_init(struct wpan_assoc_conf *conf, uint8_t seqno);
+void wpan_assoc_ind_init(struct wpan_assoc_ind *ind);
+void wpan_assoc_rsp_init(struct wpan_assoc_rsp *rsp);
+bool wpan_assoc_req(struct WpanPublicT *publicPtr, struct wpan_assoc_req *req);
+bool wpan_assoc_rsp(struct WpanPublicT *publicPtr, struct wpan_assoc_rsp *rsp);
+
+#if 0 /* disassociate is not used and is now deprecated */
+/*---------------------------------------------------------------
+ * MLME-DISASSOCIATE
+ *---------------------------------------------------------------
+ */
+/*
+ * The MLME-DISASSOCIATE service is used to remove a device from a PAN to
+ * which it is currently associated.
+ *
+ * Because the MLME-DISASSOCIATE.confirm is returned after an indirect
+ * transmission, the status is instead returned using the MLME-COMM-STATUS
+ * service.
+ *
+ * This function is optional, and is not currently used by anything.
+ */
+/* MLME-DISASSOCIATE.request */
+typedef struct {
+ WpanAddrModeT deviceMode;
+ uint16_t devicePanId;
+ uint64_t deviceAddr;
+ uint8_t disassociateReason;
+ uint8_t txIndirect;
+ struct mcp_security security;
+} WpanDisassociateReqT;
+
+/* MLME-DISASSOCIATE.confirm */
+typedef struct {
+ struct WpanPublicT *publicPtr;
+ uint8_t status;
+ WpanAddrModeT deviceMode;
+ uint16_t devicePanId;
+ uint64_t deviceAddr;
+} WpanDisassociateConfT;
+
+/* MLME-DISASSOCIATE.indication */
+typedef struct {
+ struct WpanPublicT *publicPtr;
+ uint64_t deviceAddress;
+ uint8_t disassociateReason;
+ struct mcp_security security;
+} WpanDisassociateIndT;
+
+bool WpanDisassociateReq(struct WpanPublicT *publicPtr, WpanDisassociateReqT *req);
+#endif
+
+/*---------------------------------------------------------------
+ * MLME-ORPHAN
+ *---------------------------------------------------------------
+ */
+/* MLME-ORPHAN.indication */
+struct wpan_orphan_ind {
+ struct mcp_orphanind ind;
+ struct mcp_security security;
+};
+
+/* MLME-ORPHAN.response */
+struct wpan_orphan_rsp {
+ struct mcp_orphanrsp rsp;
+ struct mcp_security security;
+};
+
+void wpan_orphan_ind_init(struct wpan_orphan_ind *ind);
+void wpan_orphan_rsp_init(struct wpan_orphan_rsp *rsp);
+bool wpan_orphan_rsp(struct WpanPublicT *publicPtr, struct wpan_orphan_rsp *rsp);
+
+/*---------------------------------------------------------
+ * MLME-COMM-STATUS
+ *---------------------------------------------------------
+ */
+/* MLME-COMM-STATUS.indication */
+struct wpan_comm_status_ind {
+ struct mcp_commind ind;
+ struct mcp_security security;
+};
+
+void wpan_comm_status_ind_init(struct wpan_comm_status_ind *ind);
+
+/*---------------------------------------------------------------
+ * MLME-SCAN
+ *---------------------------------------------------------------
+ */
+/*
+ * The MLME-SCAN service is used to facilitate the scanning of channels for a
+ * variety of purposes, and is implemented as a blocking function call (note
+ * that this can potentially block for up to 250 seconds per channel!).
+ *
+ * Every scan type can specify a range of channels to scna using the scanChannels
+ * bitmask, and a duration to scan the channel for. The actual time spent on each
+ * channel (in symbols) is given by the forumla:
+ * aBaseSuperframeDuration * ((1ul << scanDuration) - 1)
+ *
+ * If for whatever reason, the device is unable to scan any channel, then it should
+ * set the corresponding bits in the unscannedChannels bitmask found in the
+ * MCPS-SCAN.confirm.
+ *
+ * Energy scans are performed by periodically sampling the channel energy level and
+ * returning a list of the maximum energy level sampled on each channel.
+ *
+ * Active and passive scans are used to detect IEEE 802.15.4 networks operating on
+ * the local chnanels by searching for beacon frames. The scan is performed by
+ * listening on each channel for beacons, and returning them to the NHLE using the
+ * PAN descriptor list in the MLME-SCAN.confirm (if macAutoRequest is true), or via
+ * the MLME-BEACON-NOTIFY.indication service (if macAutoReqyest is FALSE, or if the
+ * beacon has a non-zero payload length). The only difference between an active and
+ * passive scan is that the active scan will first transmit a beacon request command
+ * before listening for beacon frames. Active scans should be used to lcoate non-
+ * beaconing networks, and passive scans for beacon-enabled networks.
+ *
+ * Orphan scans are used to implement the orphan rejoin procedure. An orphaned
+ * device will attempt to locate its parent by iterating through the scan channel mask
+ * and issuing orphan notification commands on each channel. If the devices's parent
+ * detects this command is should respond with a coordinator realignment command and
+ * the orphanded device should consider itself associated to the PAN again.
+ */
+
+/* Maximum valid scan duration */
+#define WPAN_SCAN_DURATION_MAX 14U
+
+/* Filter fields of the Enhanced beacon request command. */
+#define WPAN_SCAN_FILTER_PERMIT_JOIN 0x01U
+#define WPAN_SCAN_FILTER_LINK_QUALITY 0x02U
+#define WPAN_SCAN_FILTER_PERCENT 0x04U
+#define WPAN_SCAN_FILTER_PAYLOAD 0x80U
+
+/* MLME-SCAN.request (legacy 802.15.4-2003) */
+struct wpan_scan_req {
+ struct mcp_scanreq req;
+ struct mcp_security security;
+ struct mcp_payload pie; /* FIXME - convert to mcp_ie? */
+ uint8_t buf[WPAN_CONST_MAX_PHY_PACKET_SIZE];
+};
+
+/* MLME-SCAN.confirm */
+struct wpan_scan_conf {
+ struct mcp_scanconf conf;
+ /* zigbee doesn't use pan descriptor */
+ struct mcp_energylist energy;
+ uint8_t buf[WPAN_CHANNELS_PER_MASK];
+};
+
+void wpan_scan_req_init(struct wpan_scan_req *req);
+void wpan_scan_conf_init(struct wpan_scan_conf *conf, uint8_t seqno);
+bool wpan_scan_req(struct WpanPublicT *publicPtr, struct wpan_scan_req *req);
+
+/*---------------------------------------------------------------
+ * MLME-BEACON
+ *---------------------------------------------------------------
+ */
+struct wpan_pan_desc {
+ struct mcp_pandesc pandesc;
+ /* FIXME - make the following optional and arbitrary order */
+ struct mcp_linkquality lqi;
+ struct mcp_security security;
+};
+
+/* MLME-BEACON-REQUST.indication */
+struct wpan_beacon_request_ind {
+ struct mcp_bcnreqind ind;
+ /* use IE TLVs? For zigbee, this is easier for now. */
+ struct mcp_payload ie_payload;
+ uint8_t buf[WPAN_CONST_MAX_PHY_PACKET_SIZE];
+};
+
+/* MLME-BEACON.request */
+/* struct mcp_beaconreq */
+
+/* MLME-BEACON.confirm */
+/* struct mcp_beaconconf */
+
+/*
+ * The MLME-BEACON-NOTIFY.indication service is used to report information about
+ * received beacons. This is implemented by a callback function, and may be called
+ * during active scans, or on receipt of any beacon with a non-zero payload length.
+ *
+ * If macAutoRequest is set to FALSE, then the driver will NOT automatically
+ * respond to beacons that advertise pending frames for the device. And the device
+ * will issue the MLME-BEACON-NOTIFY.indication so the NHLE can manually query
+ * its parent for pending packets.
+ */
+
+/* MLME-BEACON-NOTIFY.indication */
+struct wpan_beacon_notify_ind {
+ struct mcp_beaconind ind;
+ /* FIXME - make the following optional and arbitrary order */
+ struct wpan_pan_desc pandesc;
+#if 0 /* pending addresses are not used by zigbee */
+ struct mcp_pendaddr pendaddr;
+#endif
+ struct mcp_payload payload;
+ uint8_t buf[WPAN_CONST_MAX_PHY_PACKET_SIZE];
+};
+
+void wpan_pan_desc_init(struct wpan_pan_desc *pandesc);
+void wpan_pan_desc_set_sframe(struct mcp_pandesc *pandesc, uint16_t sframe);
+uint16_t wpan_pan_desc_get_sframe(struct mcp_pandesc *pandesc);
+
+void wpan_beacon_request_ind_init(struct wpan_beacon_request_ind *ind);
+void wpan_beacon_req_init(struct mcp_beaconreq *req);
+void wpan_beacon_conf_init(struct mcp_beaconconf *conf, uint8_t seqno);
+void wpan_beacon_notify_ind_init(struct wpan_beacon_notify_ind *ind);
+bool wpan_beacon_req(struct WpanPublicT *publicPtr, struct mcp_beaconreq *req, struct mcp_beaconconf *conf);
+
+/*----------------------------------------------------------------------------
+ * TX Power Table Configuration
+ *----------------------------------------------------------------------------
+ */
+#define TX_POWER_CTRL_MAX PHY_TX_POWER_MAX
+#define TX_POWER_CTRL_MIN PHY_TX_POWER_MIN
+#define TX_POWER_CTRL_DELTA_MAX 6
+#define TX_POWER_CTRL_DELTA_MIN (-6)
+
+void wpan_getpowertblreq_init(struct mcp_getpowertblreq *req);
+void wpan_getpowertblconf_init(struct mcp_getpowertblconf *conf, uint8_t seqno);
+
+/* Note: to clear the Power Information Table, do a MLME-SET-POWER-INFORMATION-TABLE.request
+ * with dst_addr16 = IEEE802154_ADDR_SHORT_NONE, and dst_addr64 = 0. */
+void wpan_setpowertblreq_init(struct mcp_setpowertblreq *req);
+void wpan_setpowertblconf_init(struct mcp_setpowertblconf *conf, uint8_t seqno);
+
+/*---------------------------------------------------------------
+ * Duty Cycle Mode Indication
+ *---------------------------------------------------------------
+ */
+void wpan_dutycycle_ind_init(struct mcp_dutycycleind *ind);
+
+/*--------------------------------------------------------------------------
+ * MAC Instance
+ *--------------------------------------------------------------------------
+ */
+#define WPAN_DEVICE_NAME_MAXSZ 16
+#define WPAN_DEVICE_DESC_MAXSZ 64
+
+struct WpanPublicT {
+ /* Link list linking (only for NHLE to use) */
+ struct WpanPublicT *next;
+ struct WpanPublicT *prev;
+
+ /* Interface Description */
+ char ifcName[WPAN_DEVICE_NAME_MAXSZ]; /* e.g. "wpan0", etc... */
+ char ifcDesc[WPAN_DEVICE_DESC_MAXSZ]; /* e.g. "ChipCon CC2420 2.4GHz Transceiver" */
+ bool isIpBridge;
+
+ /*---------------------------------------------------------------
+ * Serial-IO Device Management API
+ *---------------------------------------------------------------
+ */
+ const struct WpanSioVersionT *sio_version_info;
+ void (*sio_close)(struct WpanPublicT *publicPtr, bool doReset);
+ /* Wait-Event and Kick MAC functions */
+ int (*sio_get_fd)(struct WpanPublicT *publicPtr);
+ /* process returns false if the communication link has been broken (e.g. dongle unplugged).
+ * The application should call dev->close() on the device and detach it from any NHLE. */
+ bool WPAN_WARN_UNUSED (*sio_process)(struct WpanPublicT *publicPtr);
+
+ /*---------------------------------------------------------------
+ * MAC Request API
+ *---------------------------------------------------------------
+ */
+ void (*mcpsPurgeReq)(struct WpanPublicT *publicPtr, struct mcp_purgereq *req, struct mcp_purgeconf *conf);
+ void (*mcpsDataReq)(struct WpanPublicT *publicPtr, struct wpan_data_req *req);
+
+ /*
+ * The MLME-RESET service is used to return the device to its initial state
+ * and is implemented as a blocking function call. When called, this function
+ * should perform a hardware reset, clear all pending frames, and cease the
+ * the transmission of beacons.
+ *
+ * When handling an MLME-RESET, the following attributes require special
+ * handling:
+ * - macBsn and macDsn should be set to randomized values.
+ * - macExtendedAddress (if implemented) should not be modified, regardless of
+ * the value of setDefaultPib. The device should only change its
+ * extended address when explicitly instructed to do so by the NHLE.
+ */
+ void (*mlmeResetReq)(struct WpanPublicT *publicPtr, struct mcp_resetreq *req, struct mcp_resetconf *conf);
+
+ /*
+ * The MLME-SET service is provided to write status and configuration
+ * data to an IEEE 802.15.4 device.
+ *
+ * All attributes are written in the host byte order. If the attribute
+ * length does not match the size exactly then an error status will be
+ * returned. In the event of an error, no change will be made to the
+ * device configuration. The index parameter is ignored for scalar
+ * attributes.
+ *
+ * A default implementation of this function is also provided, it does nothing
+ * more than write the attribute into a cache of the PIB table located in the
+ * device handle structure.
+ *
+ * MLME-SET is mandatory for all IEEE 802.15.4 devices.
+ */
+ void (*mlmeSetReq)(struct WpanPublicT *publicPtr, struct mcp_setreq *req, struct wpan_set_conf *conf);
+
+ /*
+ * The MLME-GET service is provided to read status and configuration
+ * data from an IEEE 802.15.4 device, and has been modified slightly
+ * to avoid requiring heap memory when returning an attribute to the
+ * caller.
+ *
+ * The MLME-GET.request primitive specifies the attribute and an optional
+ * index if the attribute is a table. The index is ignored for all scalar
+ * attributes. The MLME-GET.request also specifies a buffer (and buffer
+ * length) to write the attribute value into.
+ *
+ * All attributes are written in the host byte order starting at the
+ * beginning of the buffer. If the attribute is longer than the buffer
+ * then an error status will be returned. Refer to the definition of
+ * WpanMacPibT for the size of each attribute.
+ *
+ * In addition, a helper function is provided to allow the NHLE to perform
+ * a scalar MLME-GET without having to put the WpanGetReqT and WpanGetConfT
+ * structures on the stack.
+ *
+ * A default implementation of this function is also provided, it does nothing
+ * more than read the attribute frame a cache of the PIB table located in the
+ * device handle structure.
+ *
+ * MLME-GET is mandatory for all IEEE 802.15.4 devices.
+ */
+ void (*mlmeGetReq)(struct WpanPublicT *publicPtr, struct wpan_get_req *req, struct mcp_getconf *conf);
+
+ void (*mlmePollReq)(struct WpanPublicT *publicPtr, struct wpan_poll_req *req);
+#if 0 /* for beacon-enabled networks only */
+ void (*mlmeSyncReq)(struct WpanPublicT *, WpanSyncReqT *);
+#endif
+ void (*mlmeStartReq)(struct WpanPublicT *publicPtr, struct mcp_startreq *req, struct mcp_startconf *conf);
+ /* MLME-RX-ENABLE.request
+ * req->deferPermit is ignored.
+ * req->rxOntime is ignored
+ * req->rxOnDuration is treated as a boolean value.
+ * 0 = disable receiver, and go to sleep if supported
+ * >0 = wake up and/or enable receiver */
+ void (*mlmeRxEnableReq)(struct WpanPublicT *publicPtr, struct mcp_rxenreq *req, struct mcp_rxenconf *conf);
+ void (*mlmeAssociateReq)(struct WpanPublicT *publicPtr, struct wpan_assoc_req *req);
+ void (*mlmeAssociateResp)(struct WpanPublicT *publicPtr, struct wpan_assoc_rsp *req);
+#if 0 /* disassociate is not used and is now deprecated */
+ void (*mlmeDisassociateReq)(struct WpanPublicT *publicPtr, WpanDisassociateReqT *req);
+#endif
+ void (*mlmeOrphanResp)(struct WpanPublicT *publicPtr, struct wpan_orphan_rsp *rsp);
+ void (*mlmeScanReq)(struct WpanPublicT *publicPtr, struct wpan_scan_req *req);
+ void (*mlmeBeaconReq)(struct WpanPublicT *publicPtr, struct mcp_beaconreq *req, struct mcp_beaconconf *conf);
+ void (*mlmeGetPowerTblReq)(struct WpanPublicT *publicPtr, struct mcp_getpowertblreq *req, struct mcp_getpowertblconf *conf);
+ void (*mlmeSetPowerTblReq)(struct WpanPublicT *publicPtr, struct mcp_setpowertblreq *req, struct mcp_setpowertblconf *conf);
+
+ /*---------------------------------------------------------------
+ * NHLE Callbacks: minimal API required
+ *---------------------------------------------------------------
+ */
+ void (*mcpsDataConf)(void *nhleInstance, struct WpanPublicT *publicPtr, struct mcp_dataconf *conf);
+ void (*mcpsDataInd)(void *nhleInstance, struct WpanPublicT *publicPtr, struct wpan_data_ind *ind);
+ void (*mlmeAssociateConf)(void *nhleInstance, struct WpanPublicT *publicPtr, struct wpan_assoc_conf *conf);
+ void (*mlmeAssociateInd)(void *nhleInstance, struct WpanPublicT *publicPtr, struct wpan_assoc_ind *ind);
+#if 0 /* disassociate is not used and is now deprecated */
+ void (*mlmeDisassociateConf)(void *nhleInstance, struct WpanPublicT *publicPtr, WpanDisassociateConfT *conf);
+ void (*mlmeDisassociateInd)(void *nhleInstance, struct WpanPublicT *publicPtr, WpanDisassociateIndT *ind);
+#endif
+ void (*mlmeBeaconNotifyInd)(void *nhleInstance, struct WpanPublicT *publicPtr, struct wpan_beacon_notify_ind *ind);
+
+ /* The MLME-ORPHAN service is used to respond to devices performing orphan
+ * scans. The MLME-ORPAH.indication is implemented as a callback function
+ * set by the NHLE and is called on recieipt of any orphan notification
+ * commands.
+ *
+ * If the device is a parent of the orphaned child, then it should respond
+ * to the MLME-ORPAN.indication by calling the MLME-ORPAN.response function
+ * to reassociate the child to this PAN. If the orphaned device is not a
+ * a child, then no action should be taken by the NHLE.
+ *
+ * This service is optional, but recommended for full function devices.
+ */
+ void (*mlmeOrphanInd)(void *nhleInstance, struct WpanPublicT *publicPtr, struct wpan_orphan_ind *ind);
+
+ void (*mlmeCommStatusInd)(void *nhleInstance, struct WpanPublicT *publicPtr, struct wpan_comm_status_ind *ind);
+ void (*mlmeScanConf)(void *nhleInstance, struct WpanPublicT *publicPtr, struct wpan_scan_conf *conf);
+#if 0 /* for beacon-enabled networks only */
+ void (*mlmeSyncLossInd)(void *nhleInstance, struct WpanPublicT *publicPtr, WpanSyncLossIndT *);
+#endif
+ void (*mlmePollConf)(void *nhleInstance, struct WpanPublicT *publicPtr, struct mcp_pollconf *conf);
+ void (*mlmePollInd)(void *nhleInstance, struct WpanPublicT *publicPtr, struct mcp_pollind *ind);
+
+ /*---------------------------------------------------------------
+ * NHLE Callbacks: required for R22 GB-868 (Sub-GHz, Enhanced Beacons, Duty Cycle)
+ *---------------------------------------------------------------
+ */
+ void (*mlmeBeaconRequestInd)(void *nhleInstance, struct WpanPublicT *publicPtr, struct wpan_beacon_request_ind *ind);
+ void (*mlmeEnhBeaconNotifyInd)(void *nhleInstance, struct WpanPublicT *publicPtr, struct wpan_beacon_notify_ind *ind);
+ /* LBT/DC: MLME-DUTYCYCLE-MODE.indication */
+ void (*mlmeDutyCycleModeInd)(void *nhleInstance, struct WpanPublicT *publicPtr, struct mcp_dutycycleind *ind);
+
+ /*---------------------------------------------------------------
+ * Private Data
+ *---------------------------------------------------------------
+ */
+ void *nhleInstance; /* NHLE's private data */
+ void *priv; /* MAC's private data */
+};
+
+/*---------------------------------------------------------------
+ * Serial-IO Device Management Wrappers
+ *---------------------------------------------------------------
+ */
+bool WpanSerialProcess(struct WpanPublicT *publicPtr);
+int WpanSerialFd(struct WpanPublicT *publicPtr);
+void WpanSerialClose(struct WpanPublicT *publicPtr, bool doReset);
+
+/*---------------------------------------------------------------
+ * IEEE 802.15.4 CRC
+ *---------------------------------------------------------------
+ */
+#define WPAN_CRC_POLYNOMIAL 0x1021
+#define WPAN_CRC_INITIAL 0x0000
+#define WPAN_CRC_XOROUT 0x0000
+
+uint16_t WpanCrc(uint16_t crc, const void *dataPtr, unsigned int dataLen);
+
+/*--------------------------------------------------------------------------
+ * Enhanced Beacon Request and Enhanced Beacon IE Parser
+ *--------------------------------------------------------------------------
+ */
+struct WpanIe {
+ uint16_t len;
+ const uint8_t *data;
+};
+
+/* FIXME 2 - rename to something specific to EBR/EB for ZigBee PRO? */
+struct WpanIeOpts {
+ struct WpanIe ebf; /* MLME sub-IE: Enhanced beacon request filtering */
+ struct WpanIe rejoin; /* ZigBee IE: Rejoin */
+ struct WpanIe txPower; /* ZigBee IE: TX Power */
+ struct WpanIe beaconPayload; /* ZigBee IE: beacon payload + superframe */
+};
+
+int WpanIeParseOpts(struct WpanIeOpts *opts, const void *ie, size_t len);
+
+/*--------------------------------------------------------------------------
+ * GB-868 - FIXME 1 - move to separate header file?
+ *--------------------------------------------------------------------------
+ */
+/* Helper to convert IE TX Power value to integer */
+int8_t WpanEnhBeaconIeToTxPower(int8_t ieTxPower, int rssi);
+
+/* Helper function to convert an RSSI measurement to an LQI value. */
+uint8_t WpanRssiToLqi(int8_t rssi);
+int8_t WpanLqiToRssi(uint8_t lqi);
+
+/* The ideal measured RSSI value we want to be operating at is
+ * 20 dB above the -99 dBm floor. */
+#ifndef WPAN_GB868_IDEAL_RX_RSSI
+# define WPAN_GB868_IDEAL_RX_RSSI (-79)
+#endif
+
+#ifndef WPAN_GB868_CCA_THRESHOLD
+/* aLBTThresholdLevelLp */
+# define WPAN_GB868_CCA_THRESHOLD (-87)
+#endif
+
+/*---------------------------------------------------------------
+ * ieee802154_misc.
+ *---------------------------------------------------------------
+ */
+bool WpanIsBdl(struct WpanPublicT *publicPtr);
+bool WpanIsVirtual(struct WpanPublicT *publicPtr);
+bool WpanIsIpBridge(struct WpanPublicT *publicPtr);
+
+uint32_t WpanGetChannelMaskByPage(uint8_t page);
+uint8_t WpanGetNumChannelsFromMask(uint32_t mask, uint8_t *first_channel);
+uint8_t WpanTxPowerGetToleranceInt(uint8_t txpower);
+const char * WpanStatusToStr(enum mcp_status status);
+const char * WpanDutyCycleStatusToStr(uint8_t status);
+
+#endif /* IEEE802154_API_H */
+
+/*lint -restore */
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/ieee802154.h b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/ieee802154.h
new file mode 100644
index 000000000..53575567a
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/ieee802154.h
@@ -0,0 +1,335 @@
+/* Copyright [2009 - 2019] Exegin Technologies Limited. All rights reserved. */
+
+#ifndef IEEE802154_H
+#define IEEE802154_H
+
+#include <stdint.h>
+#include <string.h> /* size_t */
+
+#define IEEE802154_PANID_BCAST 0xffffU
+#define IEEE802154_ADDR_SHORT_BCAST 0xffffU
+#define IEEE802154_ADDR_SHORT_NONE 0xfffeU /* use extended addressing */
+#define IEEE802154_ADDR_SIMPLE_NONE 0xfeU
+#define IEEE802154_ADDR_SIMPLE_BCAST 0xffU
+
+/* IEEE 802.15.4 Frame Types */
+#define IEEE802154_TYPE_BEACON 0x0U
+#define IEEE802154_TYPE_DATA 0x1U
+#define IEEE802154_TYPE_ACK 0x2U
+#define IEEE802154_TYPE_COMMAND 0x3U
+#define IEEE802154_TYPE_LLDN 0x4U
+#define IEEE802154_TYPE_MULTI 0x5U
+
+/* IEEE 802.15.4 Address Modes */
+#define IEEE802154_MODE_NONE 0x0U
+#define IEEE802154_MODE_SIMPLE 0x1U
+#define IEEE802154_MODE_SHORT 0x2U
+#define IEEE802154_MODE_EXTENDED 0x3U
+
+/* IEEE 802.15.4 Frame Versions */
+#define IEEE802154_VERSION_2003 0x0U
+#define IEEE802154_VERSION_2006 0x1U
+#define IEEE802154_VERSION_2015 0x2U
+
+#define IEEE802154_FCTRL_TYPE 0x0007U
+#define IEEE802154_FCTRL_TYPE_POS 0
+#define IEEE802154_FCTRL_SECURITY 0x0008U
+#define IEEE802154_FCTRL_SECURITY_POS 3
+#define IEEE802154_FCTRL_PENDING 0x0010U
+#define IEEE802154_FCTRL_PENDING_POS 4
+#define IEEE802154_FCTRL_ACK_REQ 0x0020U
+#define IEEE802154_FCTRL_ACK_REQ_POS 5
+#define IEEE802154_FCTRL_PANID_COMP 0x0040U /* was Intra-PAN */
+#define IEEE802154_FCTRL_PANID_COMP_POS 6
+#define IEEE802154_FCTRL_RESERVED 0x0080U
+#define IEEE802154_FCTRL_RESERVED_POS 7
+#define IEEE802154_FCTRL_SEQNUM_COMP 0x0100U
+#define IEEE802154_FCTRL_SEQNUM_COMP_POS 8
+#define IEEE802154_FCTRL_IE_LIST 0x0200U
+#define IEEE802154_FCTRL_IE_LIST_POS 9
+#define IEEE802154_FCTRL_DST_MODE 0x0c00U
+#define IEEE802154_FCTRL_DST_POS 10
+#define IEEE802154_FCTRL_DST_NONE ((uint16_t)IEEE802154_MODE_NONE << IEEE802154_FCTRL_DST_POS)
+#define IEEE802154_FCTRL_DST_SIMPLE ((uint16_t)IEEE802154_MODE_SIMPLE << IEEE802154_FCTRL_DST_POS)
+#define IEEE802154_FCTRL_DST_SHORT ((uint16_t)IEEE802154_MODE_SHORT << IEEE802154_FCTRL_DST_POS)
+#define IEEE802154_FCTRL_DST_EXTENDED ((uint16_t)IEEE802154_MODE_EXTENDED << IEEE802154_FCTRL_DST_POS)
+#define IEEE802154_FCTRL_DST_MODE_GET(_fctrl_) ((_fctrl_ & IEEE802154_FCTRL_DST_MODE) >> IEEE802154_FCTRL_DST_POS)
+#define IEEE802154_FCTRL_VERSION 0x3000U
+#define IEEE802154_FCTRL_VERSION_POS 12
+#define IEEE802154_FCTRL_VERSION_2003 ((uint16_t)IEEE802154_VERSION_2003 << IEEE802154_FCTRL_VERSION_POS)
+#define IEEE802154_FCTRL_VERSION_2006 ((uint16_t)IEEE802154_VERSION_2006 << IEEE802154_FCTRL_VERSION_POS)
+#define IEEE802154_FCTRL_VERSION_2015 ((uint16_t)IEEE802154_VERSION_2015 << IEEE802154_FCTRL_VERSION_POS)
+#define IEEE802154_FCTRL_SRC_MODE 0xc000U
+#define IEEE802154_FCTRL_SRC_POS 14
+#define IEEE802154_FCTRL_SRC_NONE ((uint16_t)IEEE802154_MODE_NONE << IEEE802154_FCTRL_SRC_POS)
+#define IEEE802154_FCTRL_SRC_SIMPLE ((uint16_t)IEEE802154_MODE_SIMPLE << IEEE802154_FCTRL_SRC_POS)
+#define IEEE802154_FCTRL_SRC_SHORT ((uint16_t)IEEE802154_MODE_SHORT << IEEE802154_FCTRL_SRC_POS)
+#define IEEE802154_FCTRL_SRC_EXTENDED ((uint16_t)IEEE802154_MODE_EXTENDED << IEEE802154_FCTRL_SRC_POS)
+#define IEEE802154_FCTRL_SRC_MODE_GET(_fctrl_) ((_fctrl_ & IEEE802154_FCTRL_SRC_MODE) >> IEEE802154_FCTRL_SRC_POS)
+
+/* Key Modes */
+#define IEEE802154_KEYID_IMPLICIT 0x0U
+#define IEEE802154_KEYID_DEFAULT 0x1U
+#define IEEE802154_KEYID_SHORT 0x2U
+#define IEEE802154_KEYID_EXTENDED 0x3U
+
+/* Security control field. */
+#define IEEE802154_SCTRL_LEVEL 0x07U
+#define IEEE802154_SCTRL_ENCRYPT 0x04U /* Security level >=4 enabled encryption */
+#define IEEE802154_SCTRL_KEYID_POS 3
+#define IEEE802154_SCTRL_KEYID_MODE 0x18U
+#define IEEE802154_SCTRL_KEYID_IMPLICIT (IEEE802154_KEYID_IMPLICIT << IEEE802154_SCTRL_KEYID_POS)
+#define IEEE802154_SCTRL_KEYID_DEFAULT (IEEE802154_KEYID_DEFAULT << IEEE802154_SCTRL_KEYID_POS)
+#define IEEE802154_SCTRL_KEYID_SHORT (IEEE802154_KEYID_SHORT << IEEE802154_SCTRL_KEYID_POS)
+#define IEEE802154_SCTRL_KEYID_EXTENDED (IEEE802154_KEYID_EXTENDED << IEEE802154_SCTRL_KEYID_POS)
+#define IEEE802154_SCTRL_KEYID_GET(_sctrl_) ((_sctrl_ & IEEE802154_SCTRL_KEYID_MODE) >> IEEE802154_SCTRL_KEYID_POS)
+#define IEEE802154_SCTRL_FC_COMP 0x20U
+#define IEEE802154_SCTRL_FC_SIZE 0x40U /* FIXME 1 - In 2015 spec, this is now IEEE802154_SCTRL_ASN_IN_NONCE */
+
+/* Compute the MIC length from the security level. */
+#define IEEE802154_MIC_LENGTH(_level_) ((2U << ((_level_) & 0x3U)) & ~0x3U)
+
+struct ieee802154_hdr {
+ /* Frame header and addressing. */
+ uint16_t fctrl;
+ uint8_t seqnum;
+ uint16_t dst_panid;
+ uint64_t dst_addr;
+ uint16_t src_panid;
+ uint64_t src_addr;
+ /* Security header fields. */
+ uint8_t sctrl;
+ uint64_t frame_counter;
+ uint64_t key_source;
+ uint8_t key_index;
+ /* TODO: Header IE list? */
+ /* Lengths used by security processing (not actually in the frame). */
+ uint16_t auth_length;
+ uint8_t mic_length;
+};
+
+/* Header parsing function. */
+struct ieee802154_hdr * ieee802154_parse_header(struct ieee802154_hdr *hdr, const uint8_t *p, uint16_t len, const uint8_t **end);
+
+uint16_t ieee802154_write_header(const struct ieee802154_hdr *hdr, uint8_t *q, uint16_t maxlen);
+
+int ieee802154_addr_match(const struct ieee802154_hdr *hdr, uint16_t panid, uint64_t ext_addr, uint16_t short_addr, uint8_t simple_addr, uint8_t coordinator);
+
+/* IE's are identified by a 16-bit header. */
+#define IEEE802154_HIE_LENGTH 0x007fU
+#define IEEE802154_HIE_ID 0x7f80U
+#define IEEE802154_HIE_ID_OFFSET 7U
+#define IEEE802154_PIE_LENGTH 0x07ffU
+#define IEEE802154_PIE_ID 0x7800U
+#define IEEE802154_PIE_ID_OFFSET 11U
+#define IEEE802154_IE_TYPE 0x8000U
+#define IEEE802154_IE_HEADER 0U
+#define IEEE802154_IE_PAYLOAD IEEE802154_IE_TYPE
+#define IEEE802154_IE_MIN_SPACE 2U
+
+/* Read a 16-bit IE header from memory. */
+#define IEEE802154_IE_PARSE(_p_) \
+ (((const uint8_t *)(_p_))[0] | (((uint16_t)((const uint8_t *)(_p_))[1]) << 8))
+
+/* Read the IE type and ID from memory. */
+#define IEEE802154_IE_ISTYPE(_p_) \
+ (((uint16_t)((const uint8_t *)(_p_))[1] << 8) & IEEE802154_IE_TYPE)
+#define IEEE802154_IE_VALUE(_p_) \
+ (IEEE802154_IE_PARSE(_p_) & ((uint16_t)(IEEE802154_IE_TYPE | \
+ ((IEEE802154_IE_ISTYPE(_p_) != 0U) ? IEEE802154_PIE_ID : IEEE802154_HIE_ID))))
+
+/* Read the IE length from memory. */
+#define IEEE802154_IE_LENGTH(_p_) \
+ (((((uint16_t)((const uint8_t *)(_p_))[1] << 8) & IEEE802154_IE_TYPE) != 0U) ? \
+ (IEEE802154_IE_PARSE(_p_) & IEEE802154_PIE_LENGTH) : \
+ ((size_t)((const uint8_t *)(_p_))[0] & IEEE802154_HIE_LENGTH))
+#define IEEE802154_IE_SPACE(_p_) (IEEE802154_IE_LENGTH(_p_) + IEEE802154_IE_MIN_SPACE)
+#define IEEE802154_IE_DATA(_p_) \
+ /*lint -save -e9087 [ cast obj A <-> obj B - 11.3 REQUIRED. */ \
+ ((const void *)((const uint8_t *)(&_p_[IEEE802154_IE_MIN_SPACE])))
+
+/* Set an IE header into memory. */
+#define IEEE802154_IE_SET(_p_, _id_, _len_) \
+ do { \
+ ((uint8_t *)(_p_))[0] = (((_id_) | (_len_)) >> 0) & 0xff; \
+ ((uint8_t *)(_p_))[1] = (((_id_) | (_len_)) >> 8) & 0xff; \
+ } while (0)
+
+/* Encode ID's into a type/value pair */
+#define IEEE802154_HIE_VALUE(_id_) (((uint16_t)(_id_) << IEEE802154_HIE_ID_OFFSET) | IEEE802154_IE_HEADER)
+#define IEEE802154_PIE_VALUE(_id_) (((uint16_t)(_id_) << IEEE802154_PIE_ID_OFFSET) | IEEE802154_IE_PAYLOAD)
+
+/* Header IE types. */
+#define IEEE802154_HIE_UNMANAGED_MIN IEEE802154_HIE_VALUE(0x00U)
+#define IEEE802154_HIE_UNMANAGED_MAX IEEE802154_HIE_VALUE(0x19U)
+#define IEEE802154_HIE_LE_CSL IEEE802154_HIE_VALUE(0x1aU)
+#define IEEE802154_HIE_LE_RIT IEEE802154_HIE_VALUE(0x1bU)
+#define IEEE802154_HIE_DSME_PAN_DESC IEEE802154_HIE_VALUE(0x1cU)
+#define IEEE802154_HIE_RZ_TIME IEEE802154_HIE_VALUE(0x1dU)
+#define IEEE802154_HIE_ACK_TIME_CORR IEEE802154_HIE_VALUE(0x1eU)
+#define IEEE802154_HIE_GROUP_ACK IEEE802154_HIE_VALUE(0x1fU)
+#define IEEE802154_HIE_LLDN_INFO IEEE802154_HIE_VALUE(0x20U)
+#define IEEE802154_HIE_SIMPLIFIED_SUPERFRAME IEEE802154_HIE_VALUE(0x23U)
+#define IEEE802154_HIE_TERM_PAYLOAD IEEE802154_HIE_VALUE(0x7eU) /* Payload IE list to follow */
+#define IEEE802154_HIE_TERM_UNFORMATTED IEEE802154_HIE_VALUE(0x7fU) /* Unformatted payload to follow. */
+
+/* Payload IE group values. */
+#define IEEE802154_PIE_ESDU IEEE802154_PIE_VALUE(0x0U)
+#define IEEE802154_PIE_MLME IEEE802154_PIE_VALUE(0x1U)
+#define IEEE802154_PIE_VENDOR_SPECIFIC IEEE802154_PIE_VALUE(0x2U)
+#define IEEE802154_PIE_RESERVED_MIN IEEE802154_PIE_VALUE(0x3U)
+#define IEEE802154_PIE_RESERVED_MAX IEEE802154_PIE_VALUE(0xeU)
+#define IEEE802154_PIE_TERM IEEE802154_PIE_VALUE(0xfU)
+
+/* IE parser helper functions */
+const void * ieee802154_ie_start(const void *ie, size_t len);
+const void * ieee802154_ie_next(const void *ie, size_t len);
+unsigned int ieee802154_ie_list_length(const void *ie, size_t len);
+
+/*---------------------------------------------------------------
+ * Nested MLME IE
+ *---------------------------------------------------------------
+ */
+/* Nested MLME IE header */
+#define IEEE802154_MIE_SHORT_LENGTH 0x00ffU
+#define IEEE802154_MIE_SHORT_ID 0x7f00U
+#define IEEE802154_MIE_SHORT_OFFSET 8U
+#define IEEE802154_MIE_LONG_LENGTH 0x07ffU
+#define IEEE802154_MIE_LONG_ID 0x7800U
+#define IEEE802154_MIE_LONG_OFFSET 11U
+#define IEEE802154_MIE_TYPE 0x8000U
+#define IEEE802154_MIE_TYPE_SHORT 0U
+#define IEEE802154_MIE_TYPE_LONG IEEE802154_MIE_TYPE
+
+#define IEEE802154_MIE_SET(_p_, _id_, _len_) IEEE802154_IE_SET(_p_, _id_, _len_)
+
+#define IEEE802154_MIE_ISTYPE(_p_) \
+ (((uint16_t)((const uint8_t *)(_p_))[1] << 8) & IEEE802154_MIE_TYPE)
+#define IEEE802154_MIE_VALUE(_p_) \
+ (IEEE802154_IE_PARSE(_p_) & (IEEE802154_MIE_TYPE | \
+ ((IEEE802154_MIE_ISTYPE(_p_) != 0U) ? IEEE802154_MIE_LONG_ID : IEEE802154_MIE_SHORT_ID)))
+
+/* Read the IE length from memory. */
+#define IEEE802154_MIE_LENGTH(_p_) \
+ (uint16_t)(((((uint16_t)((const uint8_t *)(_p_))[1] << 8) & IEEE802154_MIE_TYPE) != 0U) ? \
+ (IEEE802154_IE_PARSE(_p_) & IEEE802154_MIE_LONG_LENGTH) : ((const uint8_t *)(_p_))[0])
+
+#define IEEE802154_MIE_SPACE(_p_) (IEEE802154_MIE_LENGTH(_p_) + 2U)
+#define IEEE802154_MIE_DATA(_p_) IEEE802154_IE_DATA(_p_)
+
+/* Nested MLME IE types. */
+#define IEEE802154_MIE_SHORT_VALUE(_id_) (((uint16_t)(_id_) << IEEE802154_MIE_SHORT_OFFSET) | IEEE802154_MIE_TYPE_SHORT)
+#define IEEE802154_MIE_LONG_VALUE(_id_) (((uint16_t)(_id_) << IEEE802154_MIE_LONG_OFFSET) | IEEE802154_MIE_TYPE_LONG)
+#define IEEE802154_MIE_TSCH_SYNC IEEE802154_MIE_SHORT_VALUE(0x1aU)
+#define IEEE802154_MIE_TSCH_LINK IEEE802154_MIE_SHORT_VALUE(0x1bU)
+#define IEEE802154_MIE_TSCH_TIMESLOT IEEE802154_MIE_SHORT_VALUE(0x1cU)
+#define IEEE802154_MIE_HOP_TIMING IEEE802154_MIE_SHORT_VALUE(0x1dU)
+#define IEEE802154_MIE_EB_FILTER IEEE802154_MIE_SHORT_VALUE(0x1eU)
+#define IEEE802154_MIE_METRICS_SINGLE IEEE802154_MIE_SHORT_VALUE(0x1fU)
+#define IEEE802154_MIE_METRICS_ALL IEEE802154_MIE_SHORT_VALUE(0x20U)
+#define IEEE802154_MIE_UNMANAGED_MIN IEEE802154_MIE_SHORT_VALUE(0x40U)
+#define IEEE802154_MIE_UNMANAGED_MAX IEEE802154_MIE_SHORT_VALUE(0x7fU)
+#define IEEE802154_MIE_HOP_SEQUENCE IEEE802154_MIE_LONG_VALUE(0x9U)
+
+#define IEEE802154_METRIC_OCTETS 0x01
+#define IEEE802154_METRIC_RETRY 0x02
+#define IEEE802154_METRIC_MULTIPLE_RETRY 0x03
+#define IEEE802154_METRIC_TX_FAIL 0x04
+#define IEEE802154_METRIC_TX_SUCCESS 0x05
+#define IEEE802154_METRIC_FCS_ERROR 0x06
+#define IEEE802154_METRIC_SECURITY_FAILURE 0x07
+#define IEEE802154_METRIC_DUPLICATE_FRAME 0x08
+#define IEEE802154_METRIC_RX_SUCCESS 0x09
+#define IEEE802154_METRIC_NACK 0x0a
+#define IEEE802154_METRIC_MAX 0x0a
+
+/* Nested MLME IE parser helper functions. */
+const void * ieee802154_mie_start(const void *ie, size_t len);
+const void * ieee802154_mie_next(const void *ie, size_t len);
+
+/*----------------------------------------------------------------------------
+ * Enhanced Beacon Filter Header (IEEE802154_MIE_EB_FILTER)
+ *----------------------------------------------------------------------------
+ */
+#define IEEE802154_EBF_HDR_PERMITJOIN (uint8_t)0x01U
+#define IEEE802154_EBF_HDR_LQI (uint8_t)0x02U
+#define IEEE802154_EBF_HDR_PERCENT (uint8_t)0x04U
+#define IEEE802154_EBF_HDR_PIB_MASK (uint8_t)0x18U
+#define IEEE802154_EBF_HDR_RESERVED_MASK (uint8_t)0xE0U
+#define IEEE802154_EBF_HDR_PIB_ENTRIES(_hdr_) (((_hdr_) & IEEE802154_EBF_HDR_PIB_MASK) >> 3)
+
+/*---------------------------------------------------------------
+ * Vendor Specific OUIs that we support
+ *---------------------------------------------------------------
+ */
+#define IEEE802154_VENDOR_OUI_ZIGBEE 0x4A191BU /* ZigBee Alliance CID */
+
+/*---------------------------------------------------------------
+ * Vendor Specific OUI: ZigBee (IEEE802154_VENDOR_OUI_ZIGBEE)
+ *---------------------------------------------------------------
+ */
+/* Nested ZigBee IE header */
+#define IEEE802154_ZIE_LENGTH_MASK 0x003fU
+#define IEEE802154_ZIE_ID_MASK 0xffc0U
+#define IEEE802154_ZIE_ID_OFFSET 6U
+#define IEEE802154_ZIE_PUT_ID(_id_) (((_id_) << IEEE802154_ZIE_ID_OFFSET))
+#define IEEE802154_ZIE_GET_ID_MASK(_p_) (IEEE802154_IE_PARSE(_p_) & IEEE802154_ZIE_ID_MASK)
+
+/* Nested ZigBee IE types */
+#define IEEE802154_ZIE_MASK_REJOIN IEEE802154_ZIE_PUT_ID((uint16_t)0x00U)
+#define IEEE802154_ZIE_MASK_TXPOWER IEEE802154_ZIE_PUT_ID((uint16_t)0x01U)
+#define IEEE802154_ZIE_MASK_BEACONPAYLOAD IEEE802154_ZIE_PUT_ID((uint16_t)0x02U)
+
+/* Read the IE length from memory. */
+#define IEEE802154_ZIE_LENGTH(_p_) \
+ ((uint16_t)(((const uint8_t *)(_p_))[0]) & IEEE802154_ZIE_LENGTH_MASK)
+
+#define IEEE802154_ZIE_SPACE(_p_) (IEEE802154_ZIE_LENGTH(_p_) + 2U)
+#define IEEE802154_ZIE_DATA(_p_) IEEE802154_IE_DATA(_p_)
+
+/* Nested ZigBee IE parser helper functions. */
+const void * ieee802154_zie_start(const void *ie, size_t len);
+const void * ieee802154_zie_next(const void *ie, size_t len);
+
+/*---------------------------------------------------------------
+ * IEEE 802154 command types
+ *---------------------------------------------------------------
+ */
+#define IEEE802154_CMD_ASSOCIATE_REQ 0x01
+#define IEEE802154_CMD_ASSOCIATE_RESP 0x02
+#define IEEE802154_CMD_DISASSOCIATE 0x03
+#define IEEE802154_CMD_DATA_REQ 0x04
+#define IEEE802154_CMD_PANID_CONFLICT 0x05
+#define IEEE802154_CMD_ORPHAN_NOTIFY 0x06
+#define IEEE802154_CMD_BEACON_REQ 0x07
+#define IEEE802154_CMD_REALIGNMENT 0x08
+#define IEEE802154_CMD_GTS_REQ 0x09
+#define IEEE802154_CMD_LL_DISCOVER 0x0d
+#define IEEE802154_CMD_LL_CONFIG_STATUS 0x0e
+#define IEEE802154_CMD_LL_CONFIG_REQ 0x0f
+#define IEEE802154_CMD_LL_CTS_GROUP 0x10
+#define IEEE802154_CMD_LL_RTS 0x11
+#define IEEE802154_CMD_LL_CTS 0x12
+#define IEEE802154_CMD_DSME_ASSOC_REQ 0x13
+#define IEEE802154_CMD_DSME_ASSOC_RESP 0x14
+#define IEEE802154_CMD_DSME_GTS_REQ 0x15
+#define IEEE802154_CMD_DSME_GTS_REPLY 0x16
+#define IEEE802154_CMD_DSME_GTS_NOTIFY 0x17
+#define IEEE802154_CMD_DSME_INFO_REQ 0x18
+#define IEEE802154_CMD_DSME_INFO_REPLY 0x19
+#define IEEE802154_CMD_DSME_BEACON_ALLOC 0x1a
+#define IEEE802154_CMD_DSME_BEACON_COLLISION 0x1b
+#define IEEE802154_CMD_DSME_LINK_STATUS 0x1c
+#define IEEE802154_CMD_AMCA_BEACON_REQ 0x1d
+#define IEEE802154_CMD_AMCA_HELLO 0x1e
+#define IEEE802154_CMD_AMCA_CHANNEL_PROBE 0x1f
+#define IEEE802154_CMD_LE_RIT_DATA_REQ 0x20
+
+#define IEEE802154_CCM_BLOCK_SIZE 16U
+#define IEEE802154_CCM_NONCE_SIZE 13U
+
+/* IEEE 802.15.4 packet decryption function. */
+int ieee802154_decrypt(const struct ieee802154_hdr *hdr, uint8_t *p, size_t len,
+ const void *nonce, void (*cipher)(void *out, const void *in, void *ctx), void *ctx);
+
+#endif /* _IEEE802154_H */
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/llist.h b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/llist.h
new file mode 100644
index 000000000..8c986267b
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/llist.h
@@ -0,0 +1,104 @@
+/* Copyright [2009 - 2018] Exegin Technologies Limited. All rights reserved. */
+/* Description: Double Linked List Helpers */
+
+#ifndef LLIST_H
+#define LLIST_H
+
+/* Static initializers */
+#define LINK_LIST_STATIC(_p_) {(_p_), (_p_)}
+
+/* Initialize a list to an empty state, or an item to an unlinked state. */
+#define LINK_LIST_INIT(_p_) \
+ do { \
+ (_p_)->next = (_p_); \
+ (_p_)->prev = (_p_); \
+ } while (false)
+
+/* Cast a list item to its parent type. */
+/*lint --emacro((413),LINK_LIST_ITEM) */
+/*lint --emacro((511),LINK_LIST_ITEM) */
+/*lint --emacro((613),LINK_LIST_ITEM) */
+/*lint --emacro((923),LINK_LIST_ITEM) */
+/*lint --emacro((9033),LINK_LIST_ITEM) */
+/* Warning 413: Likely use of null pointer 'unknown-name' in left argument to operator '->' [MISRA 2012 Rule 1.3, required] */
+/* Warning 511: Size incompatibility in cast from 'unsigned long' (8 bytes) to 'struct ZbMsgT *' (4 bytes) */
+/* Warning 613: Possible use of null pointer 'zb' in left argument to operator '->' */
+/* Note 923: cast from pointer to unsigned long [MISRA 2012 Rule 11.6, required] */
+/* Note 9033: Impermissible cast of composite expression (different essential type categories) [MISRA 2012 Rule 10.8, required] */
+#define LINK_LIST_ITEM(_p_, _type_, _member_) ((_type_ *)((unsigned long)(_p_) - (unsigned long)(&((_type_ *)0)->_member_)))
+
+/* Returns the next/previous list item or NULL if at the end of the list. */
+#define LINK_LIST_NEXT(_p_, _list_) (((_p_)->next != (_list_)) ? (_p_)->next : NULL)
+#define LINK_LIST_PREV(_p_, _list_) (((_p_)->prev != (_list_)) ? (_p_)->prev : NULL)
+
+/* Checks if an item is linked into the list. */
+#define LINK_LIST_ISLINKED(_p_) (((_p_)->next != (_p_)) && ((_p_)->prev != (_p_)))
+
+/* Unlinks an item from a list, has no effect if already unlinked. */
+#define LINK_LIST_UNLINK(_p_) \
+ do { \
+ (_p_)->next->prev = (_p_)->prev; \
+ (_p_)->prev->next = (_p_)->next; \
+ (_p_)->next = (_p_); \
+ (_p_)->prev = (_p_); \
+ } while (false)
+
+/* Returns the head/tail of a list, or NULL if empty. */
+#define LINK_LIST_HEAD(_list_) LINK_LIST_NEXT(_list_, _list_)
+#define LINK_LIST_TAIL(_list_) LINK_LIST_PREV(_list_, _list_)
+
+#define LINK_LIST_INSERT_BEFORE(_p_, _add_) \
+ do { \
+ (_add_)->next = (_p_); \
+ (_add_)->prev = (_p_)->prev; \
+ (_add_)->next->prev = (_add_); \
+ (_add_)->prev->next = (_add_); \
+ } while (false)
+
+#define LINK_LIST_INSERT_AFTER(_p_, _add_) \
+ do { \
+ (_add_)->prev = (_p_); \
+ (_add_)->next = (_p_)->next; \
+ (_add_)->prev->next = (_add_); \
+ (_add_)->next->prev = (_add_); \
+ } while (false)
+
+#define LINK_LIST_INSERT_HEAD(_list_, _add_) LINK_LIST_INSERT_AFTER(_list_, _add_)
+#define LINK_LIST_INSERT_TAIL(_list_, _add_) LINK_LIST_INSERT_BEFORE(_list_, _add_)
+
+/* FIXME 1 - replace these with their INSERT relatives, but careful with parameters */
+#define LINK_LIST_ADD_BEFORE(_p_, _at_) LINK_LIST_INSERT_BEFORE(_at_, _p_)
+#define LINK_LIST_ADD_AFTER(_p_, _at_) LINK_LIST_INSERT_AFTER(_at_, _p_)
+#define LINK_LIST_ADD_HEAD(_p_, _list_) LINK_LIST_INSERT_AFTER(_list_, _p_)
+#define LINK_LIST_ADD_TAIL(_p_, _list_) LINK_LIST_INSERT_BEFORE(_list_, _p_)
+
+/* Adds an item to a list while keeping the list sorted. */
+#define LINK_LIST_ADD_SORT(_add_, _list_, _cmp_) \
+ do { \
+ struct LinkListT *_i_ = (_list_)->next; \
+ while (true) { \
+ if (_i_ == (_list_)) { \
+ break; \
+ } \
+ if (_cmp_(_add_, _i_) < 0) { \
+ break; \
+ } \
+ _i_ = _i_->next; \
+ } \
+ LINK_LIST_INSERT_BEFORE(_i_, _add_); \
+ } while (false)
+
+/* Checks if a list is empty. */
+#define LINK_LIST_ISEMPTY(_list_) (!LINK_LIST_ISLINKED(_list_))
+
+/* List iteration macro. */
+#define LINK_LIST_FOREACH(_p_, _list_) \
+ for ((_p_) = LINK_LIST_HEAD(_list_); (_p_) != NULL; (_p_) = LINK_LIST_NEXT(_p_, _list_))
+
+/* Linked list type */
+struct LinkListT {
+ struct LinkListT *next;
+ struct LinkListT *prev;
+};
+
+#endif /* LLIST_H */
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/mcp.h b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/mcp.h
new file mode 100644
index 000000000..9f729582e
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/mcp.h
@@ -0,0 +1,1653 @@
+/* Copyright [2015 - 2018] Exegin Technologies Limited. All rights reserved. */
+/*
+ * This header file defines the MAC Control Protocol for communication with
+ * IEEE 802.15.4 MAC devices. The MAC Control protocol is defined in
+ * exegin-802.15.4-mac-control-protocol.pdf and assumes that the protocol messages
+ * will be transmitted over a reliable channel that preserves message boundaries.
+ *
+ * Each message is composed of a common header, fixed message data, and may be
+ * followed by TLVs.
+ */
+#ifndef MCP_H
+#define MCP_H
+
+#include <stdint.h>
+
+/*lint -save -e9071 [ __mcp_bswap64() is reserved - 21.1 REQUIRED] */
+#define __mcp__bswap64(x) ( \
+ (((uint64_t)(x) << 56) & 0xff00000000000000ULL) | \
+ (((uint64_t)(x) << 40) & 0x00ff000000000000ULL) | \
+ (((uint64_t)(x) << 24) & 0x0000ff0000000000ULL) | \
+ (((uint64_t)(x) << 8) & 0x000000ff00000000ULL) | \
+ (((uint64_t)(x) >> 8) & 0x00000000ff000000ULL) | \
+ (((uint64_t)(x) >> 24) & 0x0000000000ff0000ULL) | \
+ (((uint64_t)(x) >> 40) & 0x000000000000ff00ULL) | \
+ (((uint64_t)(x) >> 56) & 0x00000000000000ffULL) \
+ )
+/*lint -restore */
+
+/*lint -save -e9071 [ __mcp_bswap32() is reserved - 21.1 REQUIRED] */
+#define __mcp__bswap32(x) ( \
+ (((uint32_t)(x) << 24) & 0xff000000U) | \
+ (((uint32_t)(x) << 8) & 0x00ff0000) | \
+ (((uint32_t)(x) >> 8) & 0x0000ff00) | \
+ (((uint32_t)(x) >> 24) & 0x000000ff) \
+ )
+/*lint -restore */
+
+/*lint -save -e9071 [ __mcp_bswap16() is reserved - 21.1 REQUIRED] */
+#define __mcp__bswap16(x) ( \
+ (((uint16_t)(x) << 8) & 0xff00U) | \
+ (((uint16_t)(x) >> 8) & 0x00ff) \
+ )
+/*lint -restore */
+
+/*lint -save -e9021 [ use of 'undef' is discouraged - 20.5 advisory] */
+#ifdef __BYTE_ORDER__
+# undef BYTE_ORDER
+# if (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
+# define BYTE_ORDER BIG_ENDIAN
+# elif (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
+# define BYTE_ORDER LITTLE_ENDIAN
+# else
+# error "Byte order unknown"
+# endif
+#elif !defined(BYTE_ORDER)
+# include <endian.h>
+# if !defined(BYTE_ORDER)
+# error "Don't know the byte-order. Please ensure BYTE_ORDER is defined or the appropriate header is included."
+#endif
+#endif
+/*lint -restore */
+
+#ifndef BIG_ENDIAN
+# define BIG_ENDIAN 4321
+#endif
+#ifndef LITTLE_ENDIAN
+# define LITTLE_ENDIAN 1234
+#endif
+
+#ifndef htole16
+# if (BYTE_ORDER == BIG_ENDIAN)
+# define htole16(w) __mcp__bswap16(w)
+# define le16toh(w) __mcp__bswap16(w)
+# define htole32(w) __mcp__bswap32(w)
+# define le32toh(w) __mcp__bswap32(w)
+# define htole64(w) __mcp__bswap64(w)
+# define le64toh(w) __mcp__bswap64(w)
+# else
+# define htole16(w) (w)
+# define le16toh(w) (w)
+# define htole32(w) (w)
+# define le32toh(w) (w)
+# define htole64(w) (w)
+# define le64toh(w) (w)
+# endif
+#endif
+
+/* Deal with systems that don't define 64bit endian conversion macros. */
+#ifndef htole64
+# if (BYTE_ORDER == BIG_ENDIAN)
+# define htole64(w) __mcp__bswap64(w)
+# define le64toh(w) __mcp__bswap64(w)
+# else
+# define htole64(w) (w)
+# define le64toh(w) (w)
+# endif
+#endif
+
+/*
+Provide macros for setting static/global data.
+These are need, because some compilers map htole*() to actual functions.
+*/
+#ifndef const_htole16
+# if (BYTE_ORDER == BIG_ENDIAN)
+# define const_htole16(w) __mcp__bswap16(w)
+# define const_le16toh(w) __mcp__bswap16(w)
+# define const_htole32(w) __mcp__bswap32(w)
+# define const_le32toh(w) __mcp__bswap32(w)
+# define const_htole64(w) __mcp__bswap64(w)
+# define const_le64toh(w) __mcp__bswap64(w)
+# else
+# define const_htole16(w) (w)
+# define const_le16toh(w) (w)
+# define const_htole32(w) (w)
+# define const_le32toh(w) (w)
+# define const_htole64(w) (w)
+# define const_le64toh(w) (w)
+# endif
+#endif
+
+/*
+ * The size of a structure up to and including the specified field.
+ * Used to specify the size of different versions of the structure.
+ * The first term is the same as offsetof from stddef.h, but that header
+ * cannot be included here because it disrupts the alignment checking.
+ */
+#define MCP_END_OF(_type_, _member_) ((size_t)(&((_type_ *)0)->_member_) + sizeof(((_type_ *)0)->_member_))
+
+/*---------------------------------------------------------
+ * Common Header Definitions
+ *---------------------------------------------------------
+ */
+/* The common MCP header fields. */
+struct mcp_hdr {
+ uint8_t cmd;
+ uint8_t reserved;
+ uint8_t seqno;
+ uint8_t flags;
+};
+
+struct mcp_time {
+ uint32_t sec;
+ uint32_t nsec;
+};
+
+/* All messages and TLVs in MCP must be padded to a multiple of 8 bytes. */
+#define MCP_ALIGN(_sz_) (((_sz_) + 7U) & ~0x7U)
+
+/* MCP protocol version */
+#define MCP_VERSION_MAJOR 3U
+#define MCP_VERSION_MINOR 8U
+
+/* MCP flag bits. */
+#define MCP_FLAG_REQUEST 0x00U /* Direction to MAC. */
+#define MCP_FLAG_CONFIRM 0x01U /* Reply to MCP_FLAG_REQUEST. */
+#define MCP_FLAG_INDICATION 0x02U /* Asynchronous from MAC. */
+#define MCP_FLAG_RESPONSE 0x03U /* Reply to MCP_FLAG_INDICATION. */
+#define MCP_FLAG_DIRECTION(_x_) ((_x_) & 0x03U)
+#define MCP_FLAG_BULK_END 0x40U /* Bulk Data: transfer is complete. */
+#define MCP_FLAG_BULK_START 0x80U /* Bulk Data: start new transfer. */
+
+#define MCP_CMD_NOP 0x00U
+/* MCPS Primitives */
+#define MCP_MCPS_DATA 0x01U
+#define MCP_MCPS_PURGE 0x02U
+/* MLME Primitives */
+#define MCP_MLME_RESET 0x03U
+#define MCP_MLME_GET 0x04U
+#define MCP_MLME_SET 0x05U
+#define MCP_MLME_START 0x06U
+#define MCP_MLME_ASSOCIATE 0x07U
+#define MCP_MLME_DISASSOCIATE 0x08U
+#define MCP_MLME_SCAN 0x09U
+#define MCP_MLME_BEACON 0x0aU
+#define MCP_MLME_COMM 0x0bU
+#define MCP_MLME_POLL 0x0cU
+#define MCP_MLME_RX_ENABLE 0x0dU
+#define MCP_MLME_SYNC 0x0eU
+#define MCP_MLME_ORPHAN 0x0fU
+/* IEEE 802.15.4e Primitives */
+#define MCP_MLME_SET_SLOTFRAME 0x20U
+#define MCP_MLME_SET_LINK 0x21U
+#define MCP_MLME_TSCH_MODE 0x22U
+#define MCP_MLME_BCNREQ 0x23U
+#define MCP_MLME_GETPWRTBL 0x24U
+#define MCP_MLME_SETPWRTBL 0x25U
+#define MCP_MLME_DUTYCYCLE 0x26U
+/* Wi-SUN Specific Primitives */
+#define MCP_WISUN_START 0xE0U
+/* Vendor Specific Primitives */
+#define MCP_MLME_EVENT 0xDDU
+#define MCP_VENDOR_COMMAND 0xDEU
+/* IEEE 802.15.4 PHY Primitives */
+#define MCP_PD_DATA 0xDFU
+/* Device-control Primitives */
+#define MCP_DEVICE_REGISTER 0xfaU
+#define MCP_DEVICE_RESET 0xfbU
+#define MCP_DEVICE_START 0xfcU
+#define MCP_DEVICE_IDENT 0xfdU
+#define MCP_DEVICE_DATA 0xfeU
+#define MCP_DEVICE_ERROR 0xffU
+
+/*---------------------------------------------------------
+ * Common MCP Constants
+ *---------------------------------------------------------
+ */
+
+/* Addressing Modes */
+#define MCP_ADDRMODE_NONE 0U
+#define MCP_ADDRMODE_SHORT 2U
+#define MCP_ADDRMODE_LONG 3U
+
+/* Special addresses */
+#define MCP_SHORTADDR_NONE 0xfffeU
+#define MCP_SHORTADDR_BCAST 0xffffU
+#define MCP_PANID_BCAST 0xffffU
+
+/* Bit-mapped Options */
+#define MCP_TXOPT_ACKREQ 0x0001U
+#define MCP_TXOPT_USEGTS 0x0002U
+#define MCP_TXOPT_INDIRECT 0x0004U
+#define MCP_TXOPT_NO_SEQNO 0x0008U
+#define MCP_TXOPT_NO_PANID 0x0010U
+#define MCP_TXOPT_MULTIPURPOSE 0x0020U
+#define MCP_OPT_LQI_SCAN 0x0040U
+
+#define MCP_RXOPT_MODE_SWITCH 0x0001U
+#define MCP_RXOPT_NO_SEQNO 0x0008U
+#define MCP_RXOPT_NO_PANID 0x0010U
+
+/*---------------------------------------------------------
+ * MCP Message Primitive Definitions
+ *---------------------------------------------------------
+ */
+/* MCPS-DATA.request */
+struct mcp_datareq {
+ uint8_t cmd; /* MCP_MCPS_DATA */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_REQUEST */
+ uint16_t dst_panid;
+ uint8_t dst_mode; /* e.g. MCP_ADDRMODE_SHORT */
+ uint8_t src_mode; /* e.g. MCP_ADDRMODE_SHORT */
+ uint64_t dst_addr;
+ uint16_t handle;
+ uint16_t txopt; /* e.g. MCP_TXOPT_ACKREQ */
+ uint16_t data_rate;
+ uint16_t tag;
+ /* Payload TLV may follow as the last TLV. */
+};
+
+/* MCPS-DATA.confirm */
+struct mcp_dataconf {
+ uint8_t cmd; /* MCP_MCPS_DATA */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_CONFIRM */
+ uint16_t panid;
+ uint8_t src_mode; /* e.g. MCP_ADDRMODE_SHORT */
+ uint8_t status;
+ uint64_t src_addr;
+ struct mcp_time timestamp;
+ uint16_t handle;
+ uint8_t retries;
+ uint8_t backoffs;
+ uint8_t tx_flags;
+ uint8_t rsv;
+ uint16_t tag;
+};
+
+#define MCP_TX_FLAGS_Q_DEFAULT 0x00U
+#define MCP_TX_FLAGS_Q_PEER 0x01U
+
+/* MCPS-DATA.indication */
+struct mcp_dataind {
+ uint8_t cmd; /* MCP_MCPS_DATA */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_INDICATION */
+ uint16_t src_panid;
+ uint8_t src_mode; /* e.g. MCP_ADDRMODE_SHORT */
+ uint8_t dst_mode; /* e.g. MCP_ADDRMODE_SHORT */
+ uint64_t src_addr;
+ uint64_t dst_addr;
+ uint16_t dst_panid;
+ uint16_t rxopt; /* MCP_RXOPT_... */
+ struct mcp_time timestamp;
+ uint16_t data_rate;
+ uint8_t dsn;
+ int8_t rssi;
+ /* Payload TLV may follow as the last TLV. */
+};
+
+/* MCPS-PURGE.request */
+struct mcp_purgereq {
+ uint8_t cmd; /* MCP_MCPS_PURGE */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_REQUEST */
+ uint16_t handle;
+ uint8_t rsv[2];
+};
+
+/* MCPS-PURGE.confirm */
+struct mcp_purgeconf {
+ uint8_t cmd; /* MCP_MCPS_PURGE */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_CONFIRM */
+ uint16_t handle;
+ uint8_t status;
+ uint8_t rsv[1];
+};
+
+/*---------------------------------------------------------
+ * MLME Message Primitive Definitions
+ *---------------------------------------------------------
+ */
+/* MLME-RESET.request */
+struct mcp_resetreq {
+ uint8_t cmd; /* MCP_MLME_RESET */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_REQUEST */
+ uint8_t default_pib;
+ uint8_t rsv[3];
+};
+
+/* MLME-RESET.confirm */
+struct mcp_resetconf {
+ uint8_t cmd; /* MCP_MLME_RESET */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_CONFIRM */
+ uint8_t status;
+ uint8_t rsv[3];
+};
+
+/* MLME-GET.request */
+struct mcp_getreq {
+ uint8_t cmd; /* MCP_MLME_GET */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_REQUEST */
+ uint8_t rsv[4];
+ /* Attribute TLV is mandatory. */
+};
+
+/* MLME-GET.confirm */
+struct mcp_getconf {
+ uint8_t cmd; /* MCP_MLME_GET */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_CONFIRM */
+ uint8_t rsv[4];
+ /* Attribute TLV is mandatory. */
+};
+
+/* MLME-SET.request */
+struct mcp_setreq {
+ uint8_t cmd; /* MCP_MLME_SET */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_REQUEST */
+ uint8_t rsv[4];
+ /* Attribute TLV is mandatory. */
+};
+
+/* MLME-SET.confirm */
+struct mcp_setconf {
+ uint8_t cmd; /* MCP_MLME_SET */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_CONFIRM */
+ uint8_t rsv[4];
+ /* Attribute TLVs are mandatory ONLY for attributes that failed (sizeof(value)==0 for those TLVs) */
+};
+
+/* MLME-START.request */
+struct mcp_startreq {
+ uint8_t cmd; /* MCP_MLME_START */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_REQUEST */
+ uint32_t time;
+ uint16_t options; /* e.g. MCP_START_PAN_COORD */
+ uint16_t panid;
+ uint16_t channel;
+ uint8_t page;
+ uint8_t bo; /* Beacon Order */
+ uint8_t sfo; /* Superframe Order */
+ uint8_t rsv[7];
+};
+
+/* MLME-START.request options */
+#define MCP_START_PAN_COORD 0x0001U
+#define MCP_START_BATT_EXT 0x0002U
+#define MCP_START_COORD_REALIGN 0x0004U
+
+/* MLME-START.confirm */
+struct mcp_startconf {
+ uint8_t cmd; /* MCP_MLME_START */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_CONFIRM */
+ uint8_t status;
+ uint8_t rsv[3];
+};
+
+/* MLME-ASSOCIATE.request */
+struct mcp_assocreq {
+ uint8_t cmd; /* MCP_MLME_ASSOCIATE */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_REQUEST */
+ uint16_t panid;
+ uint8_t mode; /* e.g. MCP_ADDRMODE_SHORT */
+ uint8_t rsv0;
+ uint64_t addr;
+ uint16_t channel;
+ uint8_t page;
+ uint8_t capability; /* MCP_ASSOC_CAP_... */
+ uint32_t rsv1;
+};
+
+/* MLME-ASSOCIATE.request capabilities */
+#define MCP_ASSOC_CAP_ALT_COORD 0x01U /* Deprecated by IEEE 802.15.4-2015 */
+#define MCP_ASSOC_CAP_DEV_TYPE 0x02U /* 0 = RFD, 1 = FFD */
+#define MCP_ASSOC_CAP_PWR_SRC 0x04U /* 0 = battery, 1 = mains */
+#define MCP_ASSOC_CAP_RXONIDLE 0x08U
+#define MCP_ASSOC_CAP_ASSOC_TYPE 0x10U /* 0 = normal, 1 = fast association */
+/* Reserved bit: 0x20 */
+#define MCP_ASSOC_CAP_SECURITY 0x40U
+#define MCP_ASSOC_CAP_ALLOC_ADDR 0x80U /* 1 = coordinator (i.e. parent) allocates short address, 0 = otherwise */
+
+/* MLME-ASSOCIATE.confirm */
+struct mcp_assocconf {
+ uint8_t cmd; /* MCP_MLME_ASSOCIATE */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_CONFIRM */
+ uint16_t addr;
+ uint8_t status;
+ uint8_t rsv;
+};
+
+/* MLME-ASSOCIATE.indication */
+struct mcp_assocind {
+ uint8_t cmd; /* MCP_MLME_ASSOCIATE */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_INDICATION */
+ uint8_t capability;
+ uint8_t rsv[3];
+ uint64_t addr;
+};
+
+/* MLME-ASSOCIATE.response */
+struct mcp_assocrsp {
+ uint8_t cmd; /* MCP_MLME_ASSOCIATE */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_RESPONSE */
+ uint16_t addr16;
+ uint8_t status; /* MCP_ASSOC_RSP_STATUS */
+ uint8_t rsv;
+ uint64_t addr64;
+};
+
+/* MLME-ASSOCIATE.response status */
+#define MCP_ASSOC_RSP_STATUS_SUCCESS 0x00U
+#define MCP_ASSOC_RSP_STATUS_AT_CAPACITY 0x01U
+#define MCP_ASSOC_RSP_STATUS_DENIED 0x02U
+
+/* MLME-DISASSOCIATE.request */
+struct mcp_disassocreq {
+ uint8_t cmd; /* MCP_MLME_DISASSOCIATE */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_REQUEST */
+ uint16_t panid;
+ uint8_t mode; /* e.g. MCP_ADDRMODE_SHORT */
+ uint8_t reason;
+ uint64_t addr;
+ uint16_t txopt; /* e.g. MCP_TXOPT_ACKREQ */
+ uint8_t rsv[6];
+};
+
+/* MLME-DISASSOCIATE.confirm */
+struct mcp_disassocconf {
+ uint8_t cmd; /* MCP_MLME_DISASSOCIATE */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_CONFIRM */
+ uint16_t panid;
+ uint8_t mode; /* e.g. MCP_ADDRMODE_SHORT */
+ uint8_t status;
+ uint64_t addr;
+};
+
+/* MLME-DISASSOCIATE.indication */
+struct mcp_disassocind {
+ uint8_t cmd; /* MCP_MLME_DISASSOCIATE */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_INDICATION */
+ uint8_t rsv[3];
+ uint8_t reason;
+ uint64_t addr;
+};
+
+/* MLME-SCAN.request */
+struct mcp_scanreq {
+ uint8_t cmd; /* MCP_MLME_SCAN */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_REQUEST */
+ uint8_t type; /* e.g. MCP_SCAN_ENERGY */
+ uint8_t page;
+ uint16_t ch_offset;
+ uint32_t ch_mask;
+ uint16_t options; /* MCP_TXOPT_..., MCP_OPT_LQI_SCAN */
+ uint8_t duration;
+ uint8_t rsv;
+};
+#define MCP_SCAN_ENERGY 0U
+#define MCP_SCAN_ACTIVE 1U
+#define MCP_SCAN_PASSIVE 2U
+#define MCP_SCAN_ORPHAN 3U
+#define MCP_SCAN_ENHANCED 4U
+#define MCP_SCAN_RIT_PASSIVE 5U
+
+/* MLME-SCAN.confirm */
+struct mcp_scanconf {
+ uint8_t cmd; /* MCP_MLME_SCAN */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_CONFIRM */
+ uint8_t status;
+ uint8_t type; /* e.g. MCP_SCAN_ENERGY */
+ uint16_t ch_offset;
+ uint32_t unscanned;
+ uint8_t page;
+ uint8_t rsv[3];
+ /* Scan results will be returned as TLVs. */
+};
+
+/* MLME-BEACON-NOTIFY.indication */
+struct mcp_beaconind {
+ uint8_t cmd; /* MCP_MLME_BEACON */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_INDICATION */
+ uint8_t type; /* e.g. MCP_BEACON_DEFAULT */
+ uint8_t bsn;
+ uint8_t rsv[2];
+ /* PAN Descriptor TLV is mandatory. (struct mcp_pandesc) */
+ /* Beacon payload may be present as payload TLV. (struct mcp_payload) */
+};
+#define MCP_BEACON_DEFAULT 0U
+#define MCP_BEACON_ENHANCED 1U /* IEEE 802.15.4e amendment */
+
+/* MLME-BEACON.request (IEEE 802.15.4e amendment) */
+struct mcp_beaconreq {
+ uint8_t cmd; /* MCP_MLME_BEACON */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_REQUEST */
+ uint8_t type;
+ uint8_t page;
+ uint16_t channel;
+ uint8_t sfo;
+ uint8_t mode; /* e.g. MCP_ADDRMODE_SHORT */
+ uint16_t panid;
+ uint16_t txopt; /* e.g. MCP_TXOPT_ACKREQ */
+ int8_t txpower; /* dBm */
+ uint8_t rsv[1];
+ uint64_t addr;
+};
+
+/* MLME-BEACON.confirm (IEEE 802.15.4e amendment) */
+struct mcp_beaconconf {
+ uint8_t cmd; /* MCP_MLME_BEACON */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_CONFIRM */
+ uint8_t status;
+ uint8_t rsv[3];
+};
+
+/* MLME-BEACON-REQUEST.indication */
+struct mcp_bcnreqind {
+ uint8_t cmd; /* MCP_MLME_BCNREQ */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_INDICATION */
+ uint8_t type;
+ uint8_t mode; /* e.g. MCP_ADDRMODE_SHORT */
+ uint16_t panid;
+ uint64_t addr;
+ int8_t rssi;
+ uint8_t rsv[7];
+};
+
+#define MCP_BCNREQIND_SIZE_V1_0 (MCP_END_OF(struct mcp_bcnreqind, addr))
+#define MCP_BCNREQIND_SIZE_V3_8 (MCP_END_OF(struct mcp_bcnreqind, rsv)) /* Added rssi (and trailing rsv) */
+
+/* MLME-BEACON-REQUEST.request */
+struct mcp_bcnreqreq {
+ uint8_t cmd; /* MCP_MLME_BCNREQ */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_REQUEST */
+ uint16_t options;
+ uint8_t rsv[2];
+};
+
+/* MLME-BEACON-REQUEST.confirm */
+struct mcp_bcnreqconf {
+ uint8_t cmd; /* MCP_MLME_BCNREQ */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_CONFIRM */
+ uint8_t status;
+ uint8_t rsv[3];
+};
+
+/* MLME-COMM-STATUS.indication */
+struct mcp_commind {
+ uint8_t cmd; /* MCP_MLME_COMM */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_INDICATION */
+ uint16_t panid;
+ uint8_t src_mode; /* e.g. MCP_ADDRMODE_SHORT */
+ uint8_t dst_mode; /* e.g. MCP_ADDRMODE_SHORT */
+ uint64_t src_addr;
+ uint64_t dst_addr;
+ uint8_t status;
+ uint8_t rsv[7];
+};
+
+/* MLME-POLL.request */
+struct mcp_pollreq {
+ uint8_t cmd; /* MCP_MLME_POLL */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_REQUEST */
+ uint16_t panid;
+ uint8_t mode; /* e.g. MCP_ADDRMODE_SHORT */
+ uint8_t rsv;
+ uint64_t addr;
+};
+
+/* MLME-POLL.confirm */
+struct mcp_pollconf {
+ uint8_t cmd; /* MCP_MLME_POLL */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_CONFIRM */
+ uint8_t status;
+ uint8_t rsv[3];
+};
+
+/* MLME-POLL.indication (ZigBee PRO R21 extension) */
+struct mcp_pollind {
+ uint8_t cmd; /* MCP_MLME_POLL */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_INDICATION */
+ uint8_t mode; /* e.g. MCP_ADDRMODE_SHORT */
+ uint8_t rsv;
+ uint16_t panid;
+ uint64_t addr;
+};
+
+/* MLME-RX-ENABLE.request */
+struct mcp_rxenreq {
+ uint8_t cmd; /* MCP_MLME_RX_ENABLE */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_REQUEST */
+ uint32_t on_time;
+ uint32_t on_duration;
+ uint8_t defer;
+ uint8_t rsv[3];
+};
+
+/* MLME-RX-ENABLE.confirm */
+struct mcp_rxenconf {
+ uint8_t cmd; /* MCP_MLME_RX_ENABLE */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_CONFIRM */
+ uint8_t status;
+ uint8_t rsv[3];
+};
+
+/* MLME-SYNC-LOSS.indication */
+struct mcp_syncind {
+ uint8_t cmd; /* MCP_MLME_SYNC */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_INDICATION */
+ uint16_t panid;
+ uint16_t channel;
+ uint8_t page;
+ uint8_t reason;
+ uint8_t rsv[6];
+};
+
+/* MLME-SYNC.request */
+struct mcp_syncreq {
+ uint8_t cmd; /* MCP_MLME_SYNC */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_REQUEST */
+ uint16_t channel;
+ uint8_t page;
+ uint8_t track;
+};
+
+/* MLME-ORPHAN.indication */
+struct mcp_orphanind {
+ uint8_t cmd; /* MCP_MLME_ORPHAN */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_INDICATION */
+ uint8_t rsv[4];
+ uint64_t addr;
+};
+
+/* MLME-ORPHAN.response */
+struct mcp_orphanrsp {
+ uint8_t cmd; /* MCP_MLME_ORPHAN */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_INDICATION */
+ uint16_t addr16;
+ uint8_t member;
+ uint8_t rsv;
+ uint64_t addr64;
+};
+
+/* MLME-GET-POWER-INFORMATION-TABLE.request */
+struct mcp_getpowertblreq {
+ uint8_t cmd; /* MCP_MLME_GETPWRTBL */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_REQUEST */
+ uint16_t dst_addr16; /* 0xfffe (IEEE802154_ADDR_SHORT_NONE) = empty/invalid */
+ uint8_t rsv[2];
+ uint64_t dst_addr64; /* 0 = empty/invalid */
+};
+
+/* MLME-GET-POWER-INFORMATION-TABLE.confirm */
+struct mcp_getpowertblconf {
+ uint8_t cmd; /* MCP_MLME_GETPWRTBL */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_CONFIRM */
+ uint8_t status;
+ int8_t tx_power; /* TX Power Level for this destination */
+ uint16_t dst_addr16; /* 0xfffe (IEEE802154_ADDR_SHORT_NONE) = empty/invalid */
+ uint64_t dst_addr64; /* 0 = empty/invalid */
+ int8_t last_rssi; /* For debugging only. Last known RSSI measurement from this device */
+ uint8_t is_nhle_negot; /* Has txPower been modified by the NHLE */
+ uint8_t rsv[6];
+};
+
+/* MLME-SET-POWER-INFORMATION-TABLE.request */
+struct mcp_setpowertblreq {
+ uint8_t cmd; /* MCP_MLME_SETPWRTBL */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_REQUEST */
+ uint16_t dst_addr16; /* 0xfffe (IEEE802154_ADDR_SHORT_NONE) = empty/invalid */
+ int8_t tx_power; /* TX Power Level for this destination */
+ int8_t last_rssi; /* For debugging only. Last known RSSI measurement from this device */
+ uint64_t dst_addr64; /* 0 = empty/invalid */
+ uint8_t is_nhle_negot; /* Has txPower been modified by the NHLE */
+ uint8_t rsv[7];
+};
+
+/* MLME-SET-POWER-INFORMATION-TABLE.confirm */
+struct mcp_setpowertblconf {
+ uint8_t cmd; /* MCP_MLME_SETPWRTBL */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_CONFIRM */
+ uint8_t status;
+ uint8_t rsv[3];
+};
+
+#define MCP_DUTYCYCLE_STATUS_NORMAL 0U
+#define MCP_DUTYCYCLE_STATUS_LIMITED 1U
+#define MCP_DUTYCYCLE_STATUS_CRITICAL 2U
+#define MCP_DUTYCYCLE_STATUS_SUSPENDED 3U
+
+/* MLME-DUTY-CYCLE-MODE.indication */
+struct mcp_dutycycleind {
+ uint8_t cmd; /* MCP_MLME_DUTYCYCLE */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_INDICATION */
+ uint8_t mode; /* e.g. MCP_DUTYCYCLE_STATUS_NORMAL */
+ uint8_t rsv[3];
+};
+
+#define MCP_TSCH_OPERATION_ADD 0x00
+#define MCP_TSCH_OPERATION_DELETE 0x01
+#define MCP_TSCH_OPERATION_MODIFY 0x02
+#define MCP_TSCH_OPERATION_PUBLIC 0x80
+
+#define MCP_TSCH_LINK_TX 0x0001
+#define MCP_TSCH_LINK_RX 0x0002
+#define MCP_TSCH_LINK_SHARED 0x0004
+#define MCP_TSCH_LINK_TIMEKEEP 0x0008
+#define MCP_TSCH_LINK_PRIORITY 0x0010
+#define MCP_TSCH_LINK_ADVERTISE 0x0020
+
+/* MLME-SET-SLOTFRAME.request */
+struct mcp_sframereq {
+ uint8_t cmd; /* MCP_MLME_SET_SLOTFRAME */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_REQUEST */
+ uint8_t handle;
+ uint8_t operation; /* MCP_TSCH_OPERATION_... */
+ uint16_t size;
+};
+
+/* MLME-SET-SLOTFRAME.confirm */
+struct mcp_sframeconf {
+ uint8_t cmd; /* MCP_MLME_SET_SLOTFRAME */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_CONFIRM */
+ uint8_t handle;
+ uint8_t status;
+ uint8_t rsv[2];
+};
+
+/* MLME-SET-LINK.request */
+struct mcp_linkreq {
+ uint8_t cmd; /* MCP_MLME_SET_LINK */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_REQUEST */
+ uint16_t handle;
+ uint8_t operation; /* MCP_TSCH_OPERATION_... */
+ uint8_t slotframe;
+ uint16_t timeslot;
+ uint16_t offset;
+ uint16_t type; /* MCP_TSCH_LINK_... */
+ uint8_t mode; /* e.g. MCP_ADDRMODE_SHORT */
+ uint8_t rsv[1];
+ uint64_t addr;
+ uint64_t lifetime; /* Number of timeslots until the link expires */
+};
+
+#define MCP_LINKREQ_SIZE_V1_0 (MCP_END_OF(struct mcp_linkreq, addr))
+#define MCP_LINKREQ_SIZE_V3_2 (MCP_END_OF(struct mcp_linkreq, lifetime)) /* Added lifetime */
+
+/* MLME-SET-LINK.confirm */
+struct mcp_linkconf {
+ uint8_t cmd; /* MCP_MLME_SET_LINK */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_CONFIRM */
+ uint16_t handle;
+ uint8_t slotframe;
+ uint8_t status;
+};
+
+#define MCP_TSCH_MODE_ENABLE 0x01
+#define MCP_TSCH_MODE_CCA 0x02
+
+/* MLME-TSCH-MODE.request */
+struct mcp_tschreq {
+ uint8_t cmd; /* MCP_MLME_TSCH_MODE */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_REQUEST */
+ struct mcp_time timestamp;
+ uint32_t asn; /* Low 32-bits of ASN. */
+ uint8_t asnhi; /* High 8 bits of ASN */
+ uint8_t mode; /* MCP_TSCH_MODE_... */
+ uint8_t rsv[6];
+};
+
+/* MLME-TSCH-MODE.confirm */
+struct mcp_tschconf {
+ uint8_t cmd; /* MCP_MLME_TSCH_MODE */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_CONFIRM */
+ uint8_t mode; /* MCP_TSCH_MODE_... */
+ uint8_t status;
+ uint8_t rsv[2];
+};
+
+/* WS-START.request */
+struct mcp_wsstartreq {
+ uint8_t cmd; /* MCP_WISUN_START */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_REQUEST */
+ uint8_t ch_function;
+ uint8_t reg_domain;
+ uint8_t op_class;
+ uint8_t rsv[1];
+ uint8_t netname[32];
+ /* TLVs may follow to define excluded channel ranges. */
+};
+
+/* WS-START.confirm */
+struct mcp_wsstartconf {
+ uint8_t cmd; /* MCP_WISUN_START */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_CONFIRM */
+ uint8_t status;
+ uint8_t rsv[3];
+};
+
+/* MLME-EVENT.indication */
+struct mcp_eventind {
+ uint8_t cmd; /* MCP_MLME_EVENT */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_INDICATION */
+ uint16_t event; /* mcp_EVENT_* code */
+ uint8_t rsv[2];
+};
+
+/* MLME-EVENT.indication for mcp_EVENT_LINK_EXPIRED */
+struct mcp_eventind_link {
+ struct mcp_eventind event;
+ uint16_t link_handle;
+ uint8_t slotframe;
+ uint8_t rsv[5];
+};
+
+/*---------------------------------------------------------
+ * IEEE 802.15.4-2015 Primitives
+ *---------------------------------------------------------
+ */
+/* VENDOR_COMMAND.request */
+struct mcp_vendorreq {
+ uint8_t cmd; /* MCP_VENDOR_COMMAND */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_REQUEST */
+ uint16_t dst_panid;
+ uint8_t dst_mode; /* e.g. MCP_ADDRMODE_SHORT */
+ uint8_t src_mode; /* e.g. MCP_ADDRMODE_SHORT */
+ uint64_t dst_addr;
+ uint8_t oui[3];
+ uint8_t rsv[5];
+ /* Payload TLV may follow as the last TLV. */
+};
+
+/* VENDOR_COMMAND.confirm */
+struct mcp_vendorconf {
+ uint8_t cmd; /* MCP_VENDOR_COMMAND */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_CONFIRM */
+ uint8_t status;
+ uint8_t src_mode; /* e.g. MCP_ADDRMODE_SHORT */
+ uint16_t panid;
+ uint64_t src_addr;
+ struct mcp_time timestamp;
+};
+
+/* VENDOR_COMMAND.indication */
+struct mcp_vendorind {
+ uint8_t cmd; /* MCP_VENDOR_COMMAND */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_INDICATION */
+ uint16_t src_panid;
+ uint8_t src_mode; /* e.g. MCP_ADDRMODE_SHORT */
+ uint8_t dst_mode; /* e.g. MCP_ADDRMODE_SHORT */
+ uint64_t src_addr;
+ uint64_t dst_addr;
+ uint16_t dst_panid;
+ uint8_t dsn;
+ int8_t rssi;
+ struct mcp_time timestamp;
+ uint8_t oui[3];
+ uint8_t rsv[1];
+ /* Payload TLV may follow as the last TLV. */
+};
+
+/*---------------------------------------------------------
+ * IEEE 802.15.4 PHY Primitives
+ *---------------------------------------------------------
+ */
+/* PD-DATA.request */
+struct mcp_phydatareq {
+ uint8_t cmd; /* MCP_PD_DATA */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_REQUEST */
+ uint8_t rsv[4];
+ /* Payload TLV is mandatory. */
+};
+
+/* PD-DATA.confirm */
+struct mcp_phydataconf {
+ uint8_t cmd; /* MCP_PD_DATA */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_CONFIRM */
+ uint8_t status;
+ uint8_t rsv[3];
+ /* Payload TLV is mandatory. */
+};
+
+/* PD-DATA.indication */
+struct mcp_phydataind {
+ uint8_t cmd; /* MCP_PD_DATA */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_INDICATION */
+ struct mcp_time sof_ts;
+ int8_t rssi;
+ uint8_t fcslen;
+ uint16_t data_rate;
+ struct mcp_time eof_ts;
+ /* Payload TLV may follow as the last TLV. */
+};
+
+/*---------------------------------------------------------
+ * Device Control Primitive Definitions
+ *---------------------------------------------------------
+ */
+/* DEVICE-IDENTIFIER.request */
+struct mcp_identreq {
+ uint8_t cmd; /* MCP_DEVICE_IDENT */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_REQUEST */
+ uint8_t rsv[4];
+};
+
+/* DEVICE-IDENTIFIER.confirm */
+struct mcp_identconf {
+ uint8_t cmd; /* MCP_DEVICE_IDENT */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_CONFIRM */
+ uint8_t if_major;
+ uint8_t if_minor;
+ uint8_t fw_major;
+ uint8_t fw_minor;
+ uint8_t fw_rev;
+ uint8_t rsv;
+ uint16_t mac_rev;
+ uint32_t phy_amend; /* MCP_AMEND_...*/
+ uint32_t hw_id;
+ uint32_t hw_rev;
+ char pname[8]; /* Equivalent to license product string */
+};
+#define MCP_AMEND_802154e 0x0001
+#define MCP_AMEND_802154g 0x0002
+
+/* DEVICE-START.request */
+struct mcp_devstartreq {
+ uint8_t cmd; /* MCP_DEVICE_START */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_REQUEST */
+ uint8_t rsv[4];
+};
+
+/* DEVICE-START.confirm */
+struct mcp_devstartconf {
+ uint8_t cmd; /* MCP_DEVICE_START */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_CONFIRM */
+ uint8_t status;
+ uint8_t rsv[3];
+};
+
+/* DEVICE-RESET.request */
+struct mcp_devresetreq {
+ uint8_t cmd; /* MCP_DEVICE_RESET */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_REQUEST */
+ uint8_t rsv[4];
+};
+
+/* DEVICE-RESET.confirm */
+struct mcp_devresetconf {
+ uint8_t cmd; /* MCP_DEVICE_RESET */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_CONFIRM */
+ uint8_t reason; /* MCP_RESET_... */
+ uint8_t rsv[3];
+};
+#define MCP_RESET_UNKNOWN 0
+#define MCP_RESET_POWERON 1
+#define MCP_RESET_SOFT 2
+
+/* DEVICE-REGISTERS.request */
+struct mcp_regreq {
+ uint8_t cmd; /* MCP_DEVICE_REGISTER */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_REQUEST */
+ uint16_t offset;
+ uint16_t count;
+};
+
+/* DEVICE-REGISTERS.confirm */
+struct mcp_regconf {
+ uint8_t cmd; /* MCP_DEVICE_REGISTER */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_CONFIRM */
+ uint16_t next;
+ uint8_t rsv[2];
+ /* Read registers returned as TLVs. */
+};
+
+/* DEVICE-DATA.request */
+struct mcp_devdatareq {
+ uint8_t cmd; /* MCP_DEVICE_DATA */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_REQUEST */
+ uint8_t rsv[4];
+ /* Raw payload */
+};
+
+/* DEVICE-DATA.confirm */
+struct mcp_devdataconf {
+ uint8_t cmd; /* MCP_DEVICE_DATA */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_CONFIRM */
+ uint16_t window; /* number of bytes able to receive */
+ uint8_t rsv[2];
+};
+
+/* ERROR.indication */
+struct mcp_error {
+ uint8_t cmd; /* MCP_DEVICE_ERROR */
+ uint8_t hdr_rsv;
+ uint8_t seqno;
+ uint8_t flags; /* MCP_FLAG_INDICATION */
+ uint8_t err_cmd; /* The input command that generated the error */
+ uint8_t rsv;
+ uint8_t err_code; /* MCP_ERROR_... */
+ uint8_t err_flags; /* The input command's flags */
+};
+#define MCP_ERROR_NONE 0
+#define MCP_ERROR_GENERAL 1
+#define MCP_ERROR_UNSUPPORTED 2
+#define MCP_ERROR_MALFORMED 3
+#define MCP_ERROR_OVERFLOW 4
+
+/*---------------------------------------------------------
+ * TLV Definitions
+ *---------------------------------------------------------
+ */
+/* Internal TLV header structure, just used to keep the macros concise. */
+struct mcp_tlv_hdr {
+ uint8_t type;
+ uint8_t len;
+ uint16_t datalen; /* When type == MCP_TLV_PAYLOAD, length of data following this TLV header. */
+ uint8_t rsv[4];
+};
+
+#define MCP_TLV_LEN(_sz_) \
+ /*lint -save -e778 [!MISRA - constant exp. evals to 0 in'/'] */ \
+ ((uint8_t)(((_sz_) - 1U) / 8U)) \
+ /*lint -restore */
+
+#define MCP_TLV_TYPE(_p_) (((struct mcp_tlv_hdr *)(_p_))->type)
+#define MCP_TLV_SIZE(_p_) __mcp_tlv_size(_p_)
+#define MCP_TLV_SPACE(_len_) (((_len_) + 7) & ~7u)
+#define MCP_TLV_NEXT(_p_) ((void *)((uint8_t *)(_p_) + MCP_TLV_SIZE(_p_)))
+
+/*
+ * TLV Iteration Macro:
+ * _p_ is a pointer variable, it will be set to the current TLV in the loop body.
+ * _start_ is a pointer to the start of the TLVs to iterate over, it should remain constant while iterating.
+ * _len_ is the length of the TLV data to iterate over, it should remain constant while iterating.
+ */
+#define MCP_TLV_FOREACH(_p_, _start_, _len_) \
+ for ((_p_) = (void *)(_start_); \
+ ((uint8_t *)(_p_) + 8) <= ((uint8_t *)(_start_) + (_len_)) \
+ && (uint8_t *)MCP_TLV_NEXT(_p_) <= ((uint8_t *)(_start_) + (_len_)); \
+ (_p_) = MCP_TLV_NEXT(_p_))
+
+/* MCP TLV type codes. */
+#define MCP_TLV_PAD 0 /* 0x00 */
+#define MCP_TLV_PAYLOAD 1 /* 0x01 - When present, always the final TLV. */
+#define MCP_TLV_ENERGYLIST 2 /* 0x02 */
+#define MCP_TLV_PANDESC 3 /* 0x03 */
+#define MCP_TLV_SECURITY 4 /* 0x04 */
+#define MCP_TLV_RANGING 5 /* 0x05 */
+#define MCP_TLV_UWB 6 /* 0x06 */
+#define MCP_TLV_HIE 7 /* 0x07 */
+#define MCP_TLV_PIE 8 /* 0x08 */
+#define MCP_TLV_BCN_BITMAP 9 /* 0x09 */
+#define MCP_TLV_HOPPING 10 /* 0x0a */
+#define MCP_TLV_MPM_SCAN 11 /* 0x0b */
+#define MCP_TLV_EBEACON 12 /* 0x0c */
+#define MCP_TLV_MODE_SWITCH 13 /* 0x0d */
+#define MCP_TLV_ATTRIBUTE 14 /* 0x0e */
+#define MCP_TLV_REGISTER 15 /* 0x0f */
+#define MCP_TLV_PENDADDR 16 /* 0x10 */
+#define MCP_TLV_LINKQUALITY 17 /* 0x11 */
+#define MCP_TLV_MIE 18 /* 0x12 */
+#define MCP_TLV_TSCH_DIAG 19 /* 0x13 */
+#define MCP_TLV_PHY_DIAG 20 /* 0x14 */
+
+#define MCP_TLV_IS_IE(_p_) ( \
+ MCP_TLV_TYPE(_p_) == MCP_TLV_HIE \
+ || MCP_TLV_TYPE(_p_) == MCP_TLV_PIE \
+ || MCP_TLV_TYPE(_p_) == MCP_TLV_MIE \
+ )
+
+#define MCP_TLV_IS_VENDOR_IE(_p_) ( \
+ (MCP_TLV_TYPE(_p_) == MCP_TLV_HIE && ((struct mcp_ie *)(_p_))->id == mcp_IEEE802154_HIE_VENDOR_SPECIFIC) \
+ || (MCP_TLV_TYPE(_p_) == MCP_TLV_PIE && ((struct mcp_ie *)(_p_))->id == mcp_IEEE802154_PIE_VENDOR_SPECIFIC) \
+ || (MCP_TLV_TYPE(_p_) == MCP_TLV_MIE && ((struct mcp_ie *)(_p_))->id == mcp_IEEE802154_MIE_VENDOR_SPECIFIC) \
+ )
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+static inline unsigned int
+__mcp_tlv_size(const void *tlv)
+{
+ const struct mcp_tlv_hdr *t = tlv;
+ unsigned int sz;
+
+ switch (t->type) {
+ case MCP_TLV_PAD:
+ sz = 1U;
+ break;
+
+ case MCP_TLV_PAYLOAD:
+ sz = (unsigned int)le16toh(t->datalen) + 8U;
+ break;
+
+ default:
+ sz = ((unsigned int)t->len + 1U) * 8U;
+ break;
+ }
+ return sz;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+/*
+ * Payload TLV object
+ *
+ * When present, the Payload TLV MUST be the final TLV and MUST set the length
+ * to zero. The payload data follows immediately after the payload TLV and until
+ * the end of the encapsulating message.
+ */
+struct mcp_payload {
+ uint8_t type; /* MCP_TLV_PAYLOAD */
+ uint8_t len; /* MUST be zero. */
+ uint16_t datalen;
+ uint8_t rsv[4];
+ /*lint -save -e9038 [flexible array member declared 18.7 REQUIRED] */
+ uint8_t data[];
+ /*lint -restore */
+};
+
+/* EnergyList TLV Object */
+struct mcp_energylist {
+ uint8_t type; /* MCP_TLV_ENERGYLIST */
+ uint8_t len; /* MCP_TLV_LEN(sizeof(struct mcp_energylist) + num_channels) */
+ uint16_t ch_offset; /* Channel Number (N) = index_into_energy[] + ch_offset */
+ uint8_t rsv[4];
+ /*lint -save -e9038 [flexible array member declared 18.7 REQUIRED] */
+ uint8_t energy[]; /* In dB above IEEE specified radio sensitivity. */
+ /*lint -restore */
+};
+
+/* PAN Descriptor TLV Object */
+struct mcp_pandesc {
+ uint8_t type; /* MCP_TLV_PANDESC */
+ uint8_t len; /* MCP_TLV_LEN(sizeof(struct mcp_pandesc)) + ... */
+ uint16_t channel;
+ uint16_t panid;
+ uint8_t mode; /* e.g. MCP_ADDRMODE_SHORT */
+ uint8_t options; /* e.g. MCP_PANDESC_OPT_GTS_PERMIT */
+ uint64_t addr;
+ uint16_t sframe; /* e.g. MCP_PANDESC_SFRAME_ASSOC_PERMIT */
+ uint8_t page;
+ int8_t rssi;
+ struct mcp_time timestamp;
+ uint8_t rsv[4];
+ /* Security and UWB TLV may follow as sub-tlvs. */
+};
+
+/* PAN Descriptor Superframe Specification */
+#define MCP_PANDESC_SFRAME_BCN_ORD 0xF000U
+#define MCP_PANDESC_SFRAME_SF_ORD 0x0F00U
+#define MCP_PANDESC_SFRAME_CAP_SLOT 0x00F0U
+#define MCP_PANDESC_SFRAME_BATT_EXT 0x0008U
+#define MCP_PANDESC_SFRAME_PAN_COORD 0x0002U
+#define MCP_PANDESC_SFRAME_ASSOC_PERMIT 0x0001U
+
+/* PAN Descriptor Options field */
+#define MCP_PANDESC_OPT_GTS_PERMIT 0x01
+
+/* Security Info TLV Object. */
+struct mcp_security {
+ uint8_t type; /* MCP_TLV_SECURITY */
+ uint8_t len; /* MCP_TLV_LEN(sizeof(struct mcp_security)) */
+ uint8_t status;
+ uint8_t level;
+ uint8_t keymode; /* MCP_KEYMODE... */
+ uint8_t keyindex;
+ uint8_t rsv[2];
+ uint64_t keysrc;
+};
+#define MCP_KEYMODE_NONE 0
+#define MCP_KEYMODE_DEFAULT 1
+#define MCP_KEYMODE_SHORT 2
+#define MCP_KEYMODE_LONG 3
+
+/* Ranging TLV Object */
+struct mcp_ranging {
+ uint8_t type; /* MCP_TLV_RANGING */
+ uint8_t len; /* MCP_TLV_LEN(sizeof(struct mcp_ranging)) */
+ uint8_t status;
+ uint8_t fom;
+ uint32_t start;
+ uint32_t stop;
+ uint32_t interval;
+ uint32_t offset;
+ uint8_t rsv[4];
+};
+
+/* UWB TLV Object */
+struct mcp_uwb {
+ uint8_t type; /* MCP_TLV_UWB */
+ uint8_t len; /* MCP_TLV_LEN(sizeof(struct mcp_uwb)) */
+ uint8_t category;
+ uint8_t prf;
+ uint32_t repetition;
+ uint32_t codelist;
+ uint8_t rsv[4];
+};
+
+/* Header IE, Payload IE and Nested IE Objects */
+/*
+ * Note that the Payload IE with a Group ID of 1 (the MLME IE) is a special
+ * case. The IE contains nested TLVs, which are parsed into their own TLVs of
+ * type MCP_TLV_MIE.
+ */
+struct mcp_ie {
+ uint8_t type; /* MCP_TLV_HIE, MCP_TLV_PIE or MCP_TLV_MIE */
+ uint8_t len; /* MCP_TLV_LEN(sizeof(struct mcp_ie) + ielen) */
+ uint16_t ielen;
+ uint8_t id;
+ uint8_t oui[3]; /* Only for Vendor-specific IEs; else reserved. */
+ /*lint -save -e9038 [flexible array member declared 18.7 REQUIRED] */
+ uint8_t data[]; /* The IE content follows. */
+ /*lint -restore */
+};
+
+/* Beacon Bitmap TLV Object */
+struct mcp_bbits {
+ uint8_t type; /* MCP_TLV_BCN_BITMAP */
+ uint8_t len; /* MCP_TLV_LEN(sizeof(struct mcp_bbits) + sizeof(bits)) */
+ uint8_t rsv[2];
+ uint16_t index;
+ uint16_t bitslen; /* number of 8bit groups (bytes) */
+ /*lint -save -e9038 [flexible array member declared 18.7 REQUIRED] */
+ uint8_t bits[];
+ /*lint -restore */
+};
+
+/* Channel Hopping TLV Object */
+/* TODO: Still to be defined. */
+
+/* MPM Scan TLV Object */
+struct mcp_mpmscan {
+ uint8_t type; /* MCP_TLV_MPM_SCAN */
+ uint8_t len; /* MCP_TLV_LEN(sizeof(struct mcp_mpmscan)) */
+ uint8_t rsv;
+ uint8_t scan; /* TODO: Enumerations. */
+ uint32_t duration;
+};
+
+/* Enhanced Beacon TLV Object */
+struct mcp_ebeacon {
+ uint8_t type; /* MCP_TLV_EBEACON */
+ uint8_t len; /* MCP_TLV_LEN(sizeof(struct mcp_ebeacon)) */
+ uint8_t rsv;
+ uint8_t offset;
+ uint32_t order;
+};
+
+/* Mode Switch TLV Object */
+struct mcp_modesw {
+ uint8_t type; /* MCP_TLV_MODE_SWITCH */
+ uint8_t len; /* MCP_TLV_LEN(sizeof(struct mcp_modesw)) */
+ uint16_t phytype;
+ uint16_t phymode;
+ uint8_t rsv;
+ uint8_t param;
+};
+
+/* Attribute TLV Object */
+struct mcp_attr {
+ uint8_t type; /* MCP_TLV_ATTRIBUTE */
+ uint8_t len; /* MCP_TLV_LEN(sizeof(struct mcp_attr) + sizeof(value)) */
+ uint16_t id; /* PIBAttributeID */
+ uint16_t index; /* PIBAttributeIndex */
+ uint8_t status; /* Only applicable in *.confirm for attributes that failed. */
+ uint8_t padlen; /* Length of padding for unstructured blob attributes. */
+ /*lint -save -e9038 [flexible array member declared 18.7 REQUIRED] */
+ uint8_t value[];
+ /*lint -restore */
+};
+
+/* Register TLV Object */
+struct mcp_register {
+ uint8_t type; /* MCP_TLV_REGISTER */
+ uint8_t len; /* MCP_TLV_LEN(sizeof(struct mcp_register) + strlen(name) + 1) */
+ uint16_t offset;
+ uint32_t value;
+ /*lint -save -e9038 [flexible array member declared 18.7 REQUIRED] */
+ char name[]; /* Null terminated string. */
+ /*lint -restore */
+};
+
+/* Pending Address TLV object. */
+struct mcp_pendaddr {
+ uint8_t type; /* MCP_TLV_PENDADDR */
+ uint8_t len; /* MCP_TLV_LEN(sizeof(struct mcp_pendaddr) + sizeof(addrlist)) */
+ uint8_t mode;
+ uint8_t rsv[5];
+ /*lint -save -e9038 [flexible array member declared 18.7 REQUIRED] */
+ uint64_t addrlist[];
+ /*lint -restore */
+};
+
+/* Link Quality TLV Object. */
+struct mcp_linkquality {
+ uint8_t type; /* MCP_TLV_LINKQUALITY */
+ uint8_t len; /* MCP_TLV_LEN(sizeof(struct mcp_linkquality)) */
+ uint8_t lqi; /* link quality indication */
+ uint8_t rsv[5];
+};
+
+/* TSCH Diagnostics TLV Object. */
+struct mcp_tschdiag {
+ uint8_t type; /* MCP_TLV_TSCH_DIAG */
+ uint8_t len; /* MCP_TLV_LEN(sizeof(struct mcp_tschdiag)) */
+ uint8_t rsv[6];
+ uint64_t asn; /* Current ASN */
+ struct mcp_time slotstart; /* Time at start of timeslot */
+};
+
+/* PHY Diagnostics TLV Object. */
+struct mcp_phydiag {
+ uint8_t type; /* MCP_TLV_PHY_DIAG */
+ uint8_t len; /* MCP_TLV_LEN(sizeof(struct mcp_phydiag)) */
+ uint8_t page;
+ uint8_t rsv0;
+ uint16_t channel;
+ uint16_t phyband;
+ uint16_t phytype;
+ uint8_t rsv1[6];
+};
+
+/*---------------------------------------------------------
+ * Structured Attribute Definitions
+ *---------------------------------------------------------
+ */
+
+/* All scalar attributes use a 32-bit word or 64-bit double word. */
+/* Other attribute structures are defined below. */
+struct mcp_scalar {
+ struct mcp_attr attr;
+ /*lint -save -e658 [!MISRA - anonymous union assumed ] */
+ union {
+ uint32_t value;
+ uint64_t value64;
+ };
+ /*lint -restore */
+};
+
+/* Statistics (ID==0x68). */
+struct mcp_statistics {
+ struct mcp_attr attr;
+ uint32_t tx_success; /* Total packets transmitted successfully */
+ uint32_t tx_fail; /* Total packets attempted to transmit but failed */
+ uint32_t tx_cca_fail; /* TX failures because of CCA failures */
+ uint32_t tx_no_ack_fail; /* TX failures because no ack received (macTxFailCount) */
+ uint32_t tx_ftype[4]; /* TX Frame types */
+ uint32_t rx_success; /* Total packets received correctly (macRxSuccessCount) */
+ uint32_t rx_fail; /* Total packets received but failed to parse */
+ uint32_t rx_malformed; /* Packets which could not be parsed correctly */
+ uint32_t rx_security; /* Security related errors (macSecurityFailure) */
+ uint32_t rx_duplicate; /* Duplicate packets dropped (macDuplicateFrameCount) */
+ uint32_t tx_no_retries; /* Packets transmitted and acked with no retries (macTxSuccessCount) */
+ uint32_t rx_ftype[4]; /* RX Frame types */
+ uint32_t tx_one_retry; /* TX acked after one retry (macRetryCount) */
+ uint32_t tx_multi_retries; /* TX acked after more than one retry (macMultipleRetryCount) */
+ uint32_t sync_beacon; /* Resync triggered by mismatch with beacn ASN */
+ uint32_t sync_latency; /* Resync triggered by timeslot latency */
+ uint32_t sync_timeslots; /* Number of timeslots missed during timer latency */
+ uint32_t rsv;
+};
+
+#define MCP_STATISTICS_SIZE_V1_0 (MCP_END_OF(struct mcp_statistics, rx_ftype))
+#define MCP_STATISTICS_SIZE_V3_4 (MCP_END_OF(struct mcp_statistics, tx_multi_retries)) /* Removed rsv, added tx_no_retries, tx_one_retry, tx_multi_retries */
+#define MCP_STATISTICS_SIZE_V3_5 (MCP_END_OF(struct mcp_statistics, rsv)) /* Added sync_beacon, sync_latency, sync_timeslot */
+
+/* Counters as id/count pair. */
+struct mcp_id_counter {
+ uint32_t id;
+ uint32_t count;
+};
+/* PHY Statistics (ID==0x6c). */
+struct mcp_counters {
+ struct mcp_attr attr;
+ /*lint -save -e9038 [flexible array member declared 18.7 REQUIRED] */
+ struct mcp_id_counter entry[];
+ /*lint -restore */
+};
+
+/* Security Level Descriptor Attribute (ID==0x75) */
+struct mcp_seclevel {
+ struct mcp_attr attr;
+ uint64_t usage;
+ uint64_t override;
+ uint8_t minimum;
+ uint8_t rsv[7];
+};
+
+/* Security KeyDescriptor Attribute (ID==0x71) */
+struct mcp_keydesc {
+ struct mcp_attr attr;
+ uint64_t usage;
+ uint8_t keymode; /* MCP_KEYMODE_... */
+ uint8_t keyindex;
+ uint16_t panid; /* PANID for implicit lookups using MCP_KEYMODE_NONE */
+ uint8_t rsv[4];
+ uint64_t keysrc; /* Key source for explicit lookups, and address for implicit lookups. */
+ uint8_t key[16];
+ /*lint -save -e9038 [flexible array member declared 18.7 REQUIRED] */
+ uint8_t devices[]; /* Variable sized bit mask */
+ /*lint -restore */
+};
+
+/* Security Device Descriptor (ID==0x73)*/
+struct mcp_keydevice {
+ struct mcp_attr attr;
+ uint64_t addr64;
+ uint16_t panid;
+ uint16_t addr16;
+ uint32_t counter;
+ uint32_t exempt;
+ uint8_t rsv[4];
+};
+
+/* SunPageDescriptor Attribute (ID==0x206) */
+struct mcp_sunpage_desc {
+ struct mcp_attr attr;
+ uint32_t bands; /* Bit-map of supported frequency bands. */
+ uint32_t modes; /* Bit-map of supported rate-modes. */
+};
+
+/* SunPageEntry Attribute (ID==0x207) */
+struct mcp_sunpage_entry {
+ struct mcp_attr attr;
+ uint16_t band;
+ uint16_t phytype;
+ uint16_t phymode;
+ uint16_t rsv;
+};
+
+/* TSCH Slotframe Table Entry Attribute (ID=0x404) */
+struct mcp_tsch_slotframe {
+ struct mcp_attr attr;
+ uint16_t size;
+ uint8_t handle;
+ uint8_t visibility; /* MCP_SLOTFRAME_VISIB_... */
+ uint8_t rsv[4];
+};
+
+#define MCP_SLOTFRAME_VISIB_UNKNOWN 0x00 /* Default indicating older version. */
+#define MCP_SLOTFRAME_VISIB_PRIVATE 0x01
+#define MCP_SLOTFRAME_VISIB_PUBLIC 0x02
+
+/* TSCH Link Table Entry Attribute (ID==0x406) */
+struct mcp_tsch_link {
+ struct mcp_attr attr;
+ uint16_t handle;
+ uint16_t type;
+ uint16_t timeslot;
+ uint16_t offset;
+ uint32_t rsv;
+ uint16_t size; /* From matching macSlotframeTable entry. */
+ uint8_t slotframe;
+ uint8_t mode; /* e.g. MCP_ADDRMODE_SHORT */
+ uint64_t addr;
+ uint64_t lifetime; /* Number of timeslots until the link expires */
+};
+
+/* License Challenge Attribute (ID==0x6C) */
+struct mcp_license_challenge {
+ struct mcp_attr attr;
+ /*lint -save -e9038 [flexible array member declared 18.7 REQUIRED] */
+ uint8_t challenge[];
+ /*lint -restore */
+};
+
+/* License Certificate Attribute (ID==0x6D) */
+/*
+ * TODO: Check if the license fields are big-endian or little-endian. We may
+ * need to document this for backwards compatibility. Changing endianness would
+ * require re-signing all the existing licenses.
+ */
+struct mcp_license {
+ struct mcp_attr attr;
+ uint64_t addr; /* First address covered by this license. */
+ uint16_t cflags; /* Certificate flags. */
+ uint8_t range; /* Number of addresses covered by this license. */
+ uint8_t rsv;
+ uint32_t pen; /* Manufacturer IANA PEN */
+ uint8_t pname[8]; /* Product name. */
+ uint32_t pflags; /* Product flags. */
+ uint32_t xflags; /* Extra flags (reserved). */
+ uint8_t pubx[32]; /* Device public key (X-coordinate). */
+ uint8_t r[32]; /* ECDSA (P256) Signature component 'r' */
+ uint8_t s[32]; /* ECDSA (P256) Signature component 's' */
+};
+
+#endif /* MCP_H */
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/mcp_enums.h b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/mcp_enums.h
new file mode 100644
index 000000000..2410c0d5f
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/mcp_enums.h
@@ -0,0 +1,437 @@
+/* Copyright [2015 - 2018] Exegin Technologies Limited. All rights reserved. */
+
+#ifndef MCP_ENUMS_H
+# define MCP_ENUMS_H
+
+/*lint -save -e726 [!MISRA - extra comma ignored (end of enum)] */
+/* IEEE 802.15.4 Status Values */
+enum mcp_status {
+ mcp_STATUS_SUCCESS = 0x00,
+ mcp_STATUS_BEACON_LOSS = 0xe0,
+ mcp_STATUS_CHANNEL_ACCESS_FAILURE = 0xe1,
+ mcp_STATUS_COUNTER_ERROR = 0xdb,
+ mcp_STATUS_DENIED = 0xe2,
+ mcp_STATUS_DISABLE_TRX_FAILURE = 0xe3,
+ mcp_STATUS_FRAME_TOO_LONG = 0xe5,
+ mcp_STATUS_IMPROPER_KEY_TYPE = 0xdc,
+ mcp_STATUS_IMPROPER_SECURITY_LEVEL = 0xdd,
+ mcp_STATUS_INVALID_ADDRESS = 0xf5,
+ mcp_STATUS_INVALID_GTS = 0xe6,
+ mcp_STATUS_INVALID_HANDLE = 0xe7,
+ mcp_STATUS_INVALID_INDEX = 0xf9,
+ mcp_STATUS_INVALID_PARAMETER = 0xe8,
+ mcp_STATUS_LIMIT_REACHED = 0xfa,
+ mcp_STATUS_NO_ACK = 0xe9,
+ mcp_STATUS_NO_BEACON = 0xea,
+ mcp_STATUS_NO_DATA = 0xeb,
+ mcp_STATUS_NO_SHORT_ADDRESS = 0xec,
+ mcp_STATUS_ON_TIME_TOO_LONG = 0xf6,
+ mcp_STATUS_OUT_OF_CAP = 0xed,
+ mcp_STATUS_PAN_ID_CONFLICT = 0xee,
+ mcp_STATUS_PAST_TIME = 0xf7,
+ mcp_STATUS_READ_ONLY = 0xfb,
+ mcp_STATUS_REALIGNMENT = 0xef,
+ mcp_STATUS_SCAN_IN_PROGRESS = 0xfc,
+ mcp_STATUS_SECURITY_ERROR = 0xe4,
+ mcp_STATUS_SUPERFRAME_OVERLAP = 0xfd,
+ mcp_STATUS_TRACKING_OFF = 0xf8,
+ mcp_STATUS_TRANSACTION_EXPIRED = 0xf0,
+ mcp_STATUS_TRANSACTION_OVERFLOW = 0xf1,
+ mcp_STATUS_TX_ACTIVE = 0xf2,
+ mcp_STATUS_UNAVAILABLE_KEY = 0xf3,
+ mcp_STATUS_UNSUPPORTED_ATTRIBUTE = 0xf4,
+ mcp_STATUS_UNSUPPORTED_LEGACY = 0xde,
+ mcp_STATUS_UNSUPPORTED_SECURITY = 0xdf,
+ mcp_STATUS_DRIVER_ERROR = 0xfe,
+ mcp_STATUS_DEVICE_ERROR = 0xff,
+};
+
+enum {
+ mcp_EVENT_NONE = 0x00,
+ mcp_EVENT_ASN_NOTIFY_TIME = 0x01,
+ mcp_EVENT_LINK_EXPIRED = 0x02,
+ mcp_EVENT_UNDEFINED = 0xff,
+};
+
+enum mcp_attr_id {
+ /* PHY PIB Attributes. */
+ mcp_phyCurrentChannel = 0x00,
+ mcp_phyChannelsSupported = 0x01,
+ mcp_phyTransmitPower = 0x02,
+ mcp_phyCcaMode = 0x03,
+ mcp_phyCurrentPage = 0x04,
+ mcp_phyMaxFrameDuration = 0x05,
+ mcp_phyShrDuration = 0x06,
+ mcp_phySymbolsPerOctet = 0x07,
+ mcp_aMaxPhyPacketSize = 0x08,
+ mcp_phyCcaThreshold = 0x09,
+ mcp_phyCcaThresholdAbs = 0x0a,
+ mcp_phyRadioSensitivity = 0x0b,
+
+ /* MAC PIB Attributes. */
+ mcp_macAckWaitDuration = 0x40,
+ mcp_macAssociatedPanCoord = 0x56,
+ mcp_macAssociationPermit = 0x41,
+ mcp_macAutoRequest = 0x42,
+ mcp_macBattLifeExt = 0x43,
+ mcp_macBattLifeExtPeriods = 0x44,
+ mcp_macBeaconPayload = 0x45,
+ mcp_macBeaconPayloadLength = 0x46,
+ mcp_macBeaconOrder = 0x47,
+ mcp_macBeaconTxTime = 0x48,
+ mcp_macBsn = 0x49,
+ mcp_macCoordExtendedAddress = 0x4a,
+ mcp_macCoordShortAddress = 0x4b,
+ mcp_macDsn = 0x4c,
+ mcp_macGtsPermit = 0x4d,
+ mcp_macMaxBE = 0x57,
+ mcp_macMaxCsmaBackoffs = 0x4e,
+ mcp_macMaxFrameTotalWaitTime = 0x58,
+ mcp_macMaxFrameRetries = 0x59,
+ mcp_macMinBE = 0x4f,
+
+ mcp_macPanId = 0x50,
+ mcp_macPromiscuousMode = 0x51,
+ mcp_macResponseWaitTime = 0x5a,
+ mcp_macRxOnWhenIdle = 0x52,
+ mcp_macSecurityEnabled = 0x5d,
+ mcp_macShortAddress = 0x53,
+ mcp_macExtendedAddress = 0x63, /* Read/Write - used to get/set the EUI-64 address of the device. */
+ mcp_macSuperframeOrder = 0x54,
+ mcp_macSyncSymbolOffset = 0x5b,
+ mcp_macTimestampSupported = 0x5c,
+ mcp_macTransactionPersistenceTime = 0x55,
+
+ _mcp_Spare_1 = 0x5e,
+ _mcp_Spare_2 = 0x5f,
+
+ /* Exegin Add-ons. */
+ mcp_phySymbolRate = 0x60, /* Read only - rate in symbols/seconds of current phy. */
+ mcp_phyClearChannel = 0x61, /* Read only - reading will trigger a CCA measurement (ZigBee testing). */
+ mcp_phyEnergyDetect = 0x62, /* Read only - reading will trigger a phy ED measurement (ZigBee testing). */
+ mcp_macPromiscuousAutoFcs = 0x64, /* Optional - specifies if the FCS is checked when in promiscuous mode. */
+ mcp_phyTestModulated = 0x65, /* Optional - Transmits a modulated carrier (FCC testing). */
+ mcp_phyTestUnmodulated = 0x66, /* Optional - Transmits an unmodulated carrier (FCC testing). */
+ mcp_phyTestClockOut = 0x67, /* Optional - Enables clock output to GPIO (Oscillator tuning). */
+ mcp_macStatistics = 0x68, /* Read only - returns the mcp_statistics structure (if supported). */
+ mcp_macKeySwitchIndex = 0x69, /* Read/Write - used by ZigBee-IP to trigger a key switch (i.e. receive a packet with a matching key ID). */
+ mcp_phySendRaw = 0x6a, /* Write only - transmits a raw PSDU on attribute write. */
+ mcp_macHardwareInd = 0x6b, /* Read/Write - boolean to toggle a hardware indication. */
+ mcp_phyStatistics = 0x6c, /* Read only - returns an mcp_counters structure (if supported). */
+ mcp_macLicenseCert = 0x6d, /* Read only - The license certificate. */
+ mcp_phyHardwareRand = 0x6e, /* Read only - Retrieve a randomly generated byte from hardware (eg: RSSI noise). */
+ mcp_phyPagesSupported = 0x6f, /* Read only - a 32bit mask of channel-pages supported. */
+ mcp_macASNNotifyTime = 0x70, /* Read/Write - ASN Time for MLME-EVENT.indication */
+
+ /* Security PIB Attributes */
+ mcp_macKeyTable = 0x71,
+ mcp_macKeyTableEntries = 0x72,
+ mcp_macDeviceTable = 0x73,
+ mcp_macDeviceTableEntries = 0x74,
+ mcp_macSecurityLevelTable = 0x75,
+ mcp_macSecurityLevelTableEntries = 0x76,
+ mcp_macFrameCounter = 0x77,
+ mcp_macAutoRequestSecurityLevel = 0x78,
+ mcp_macAutoRequestKeyIdMode = 0x79,
+ mcp_macAutoRequestKeySource = 0x7a,
+ mcp_macAutoRequestKeyIndex = 0x7b,
+ mcp_macDefaultKeySource = 0x7c,
+
+ mcp_macPanCoordExtendedAddress = 0x7d, /* ??? This seems to duplicate macCoordExtendedAddress */
+ mcp_macPanCoordShortAddress = 0x7e, /* ??? This seems to duplicate macCoordShortAddress */
+
+ /* TX duty-cycle attributes */
+ mcp_macTxTotalDuration = 0x7f, /* Total number of transmitted symbols */
+ mcp_macTxControlActiveDuration = 0x80, /* Active phase of TX duty cycle in milliseconds */
+ mcp_macTxControlPauseDuration = 0x81, /* Paused phase of TX duty cycle in milliseconds */
+
+ mcp_macPacketDiagInfoEnable = 0x82, /* Controls if Diagnostic TLVs are added to packet indication messages */
+
+ mcp_enhancedBeaconIEs = 0x0101, /* HIEs, MIEs, and PIEs to include in enhanced beacon */
+
+ mcp_macImplicitBroadcast = 0x0102,
+ mcp_macGlobalTime = 0x0103, /* For Global Time IE, in seconds */
+ mcp_macBeaconsScheduled = 0x0104, /* Count of beacons scheduled, not necessarily sent; zeroed on read. */
+
+ mcp_macEnhancedBeaconSecurityLevel = 0x0105, /* Security setting for transmitting enhanced beacons */
+ mcp_macEnhancedBeaconKeyIdMode = 0x0106,
+ mcp_macEnhancedBeaconKeySource = 0x0107,
+ mcp_macEnhancedBeaconKeyIndex = 0x0108,
+
+ /* SUN PHY PIB Attributes. */
+ mcp_phyFSKFEC = 0x0200,
+ mcp_phyFSKFECInterleavingRSC = 0x0201,
+ mcp_phyFSKFECScheme = 0x0202,
+ mcp_phySunChannelsSupported = 0x0203,
+ mcp_phyMaxSunChannelSupported = 0x0204,
+ mcp_phyNumSunPageEntriesSupported = 0x0205,
+ mcp_phySunPageEntriesSupported = 0x0206,
+ mcp_phyCurrentSunPageEntry = 0x0207, /* struct mcp_sunpage entry */
+ mcp_phySunNumGenericPHYDescriptors = 0x0208,
+ mcp_phySunGenericPHYDescriptors = 0x0209,
+ mcp_phyNumModeSwitchParameterEntries = 0x020a,
+ mcp_phyModeSwitchParameterEntries = 0x020b,
+ mcp_phyFSKPreambleLength = 0x020c,
+ mcp_phyMRFSKSFD = 0x020d,
+ mcp_phyFSKScramblePSDU = 0x020e, /* Data whitening enable/disable */
+ mcp_phyOFDMInterleaving = 0x020f,
+ mcp_phyOFDMScrambleSeed = 0x0210, /* Absent in 802.15.4g spec, but still needed. */
+ mcp_phyPHRDuration = 0x0211,
+
+ /* Exegin PHY Add-ons. */
+ mcp_phyFSKDW = 0x0280, /* Deprecated */
+ mcp_phyFreqBandSupported = 0x0281, /* uint16_t "enum mcp_freq_band" */
+ mcp_phyTxPowerReg = 0x0282, /* uint32_t - For TX power profiling, write to the radio's register directly. */
+
+ /* SUN MAC PIB Attributes. */
+ mcp_macEnhancedBeaconOrder = 0x0300,
+ mcp_macMPMIE = 0x0301,
+ mcp_macNBPANEnhancedBeaconOrder = 0x0302,
+ mcp_macOffsetTimeSlot = 0x0303,
+ mcp_macFCSType = 0x0304,
+
+ /* TSCH MAC PIB Attributes */
+ mcp_macTschEnabled = 0x0400,
+ mcp_macDisconnectTime = 0x0401,
+ mcp_macJoinMetric = 0x0402,
+ mcp_macASN = 0x0403,
+ mcp_macSlotframeTable = 0x0404,
+ mcp_macSlotframeEntries = 0x0405,
+ mcp_macLinkTable = 0x0406,
+ mcp_macLinkEntries = 0x0407,
+
+ /* WiSUN MAC PIB Attributes */
+ mcp_macWisunEnabled = 0x0440,
+ mcp_macWisunPanVersion = 0x0441,
+ mcp_macWisunPanSize = 0x0442,
+ mcp_macWisunRoutingCost = 0x0443,
+
+ /* Hopping Sequence PIB Attributes */
+ mcp_macHoppingSequenceID = 0x0480,
+ mcp_macHoppingChannelPage = 0x0481, /* Called macChannelPage in IEEE 802.15.4-2015, confusing name. */
+ mcp_macHoppingChannelList = 0x0482,
+ mcp_macHoppingChannelCount = 0x0483,
+ mcp_macHoppingSequenceLength = 0x0484,
+ mcp_macHoppingSequenceList = 0x0485,
+ mcp_macHopDwellTime = 0x0486,
+ mcp_macTimeslotTemplateId = 0x0487,
+ mcp_macTsCcaOffset = 0x0488,
+ mcp_macTsCca = 0x0489,
+ mcp_macTsTxOffset = 0x048A,
+ mcp_macTsRxOffset = 0x048B,
+ mcp_macTsRxAckDelay = 0x048C,
+ mcp_macTsTxAckDelay = 0x048D,
+ mcp_macTsRxWait = 0x048E,
+ mcp_macTsRxTx = 0x048F,
+ mcp_macTsMaxAck = 0x0490,
+ mcp_macTsMaxTx = 0x0491,
+ mcp_macTsTimeslotLength = 0x0492,
+ mcp_macTsAckWait = 0x0493,
+ mcp_macExtendedBitmap = 0x0494,
+ mcp_macNumberOfChannels = 0x0495,
+
+ /* Zigbee R22 add-ons for GB-868 */
+ mcp_macDCCurrentMeas = 0x0500, /* Current Duty Cycle over the last hour (hundredths of %) */
+ mcp_macDCCurrentBytes = 0x0501, /* Current Duty Cycle over the last hour (bytes) */
+ mcp_macJoinList = 0x0502, /* IEEE Joining List (used if mibJoiningPolicy == IEEELIST_JOIN) */
+ mcp_macJoinPolicy = 0x0503, /* IEEE Joining Policy (mibJoiningPolicy) */
+ mcp_macLBTTxRetries = 0x0504,
+ mcp_macTxPowerMgmtSupported = 0x0505,
+ mcp_macDutyCycleSupported = 0x0506,
+ /* ZCL 7 Diagnostics Cluster Info */
+ mcp_macDiagClusterInfo = 0x0507,
+
+ /* Note, large gap of IDs until 0x40a0. */
+
+ /* Enhanced Beacon Request command PIB Attributes. */
+ mcp_macEbrPermitJoining = 0x40A0,
+ mcp_macEbrFilters = 0x40A1,
+ mcp_macEbrLinkQuality = 0x40A2,
+ mcp_macEbrPercentFilter = 0x40A3,
+ mcp_macEbrAttributeList = 0x40A4,
+ mcp_macBeaconAutoRespond = 0x40A5
+};
+
+/* Frequency Bands */
+enum mcp_freq_band {
+ mcp_169MHz_band = 0, /* Europe */
+ mcp_450MHz_band = 1, /* US FCC Part 22/90 */
+ mcp_470MHz_band = 2, /* China */
+ mcp_780MHz_band = 3, /* China */
+ mcp_863MHz_band = 4, /* Europe */
+ mcp_896MHz_band = 5, /* US FCC Part 90 */
+ mcp_901MHz_band = 6, /* US FCC Part 24 */
+ mcp_915MHz_band = 7, /* US */
+ mcp_917MHz_band = 8, /* Korea */
+ mcp_920MHz_band = 9, /* Japan */
+ mcp_928MHz_band = 10, /* US, non-contiguous */
+ mcp_950MHz_band = 11, /* Was in IEEE 802.15.4g; removed in 802.15.4-2015. Overlaps the 928MHz band. */
+ mcp_1427MHz_band = 12, /* US and Canada, non-contiguous */
+ mcp_2450MHz_band = 13, /* US and Canada */
+ /* Band added by IEEE 802.15.4u-2016 */
+ mcp_866MHz_band = 14, /* India 865-867 */
+ /* Bands added by IEEE 802.15.4v-2017 */
+ mcp_870MHz_band = 15, /* Europe 870-876*/
+ /* 16 to 23 are 915MHz sub-bands using 902-928MHz channel numbering */
+ mcp_915MHz_a_band = 16, /* North America and Mexico 902-928 (alternate) */
+ mcp_915MHz_b_band = 17, /* Brazil. Non-contiguous 902-907.5 & 915-928 MHz */
+ mcp_915MHz_c_band = 18, /* Australia and New Zealand 915-928 */
+ mcp_915MHz_d_band = 19, /* Europe 915-921*/
+ mcp_915MHz_e_band = 20, /* Philippines 915-918 */
+ mcp_919MHz_band = 21, /* Malaysia 919-923 */
+ mcp_920MHz_a_band = 22, /* China 920.5-924.5 */
+ mcp_920MHz_b_band = 23, /* HK, Singapore, Thailand, and Vietnam 920-925 */
+ /* 863MHz sub-band using 863-870MHz channel numbering */
+ mcp_867MHz_band = 24, /* 866-869 */
+ /* Bands listed in IEEE 802-15.4-2015+revisions Table 10-1 Frequency band designations,
+ * but not assigned a bit in Table 7-19 Frequency band identifier values */
+ mcp_433MHz_band = 32,
+ mcp_868MHz_band = 32 + 1,
+ mcp_2380MHz_band = 32 + 2,
+};
+
+/* Defined Channel Pages */
+enum {
+ mcp_PAGE_DEFAULT = 0, /* Default Channel Page (i.e. legacy 802.15.4 mode) */
+ mcp_PAGE_ASK = 1, /* 868/915MHz ASK. */
+ mcp_PAGE_OQPSK = 2, /* 868/915MHz O-QPSK. */
+ mcp_PAGE_SUN = 9, /* SUN PHYs */
+};
+
+/* SUN PHY Types */
+enum {
+ mcp_FFSK_A = 0, /* Filtered FSK-A */
+ mcp_FFSK_B = 1, /* Filtered FSK-B */
+ mcp_OQPSK_A = 2, /* O-QPSK-A */
+ mcp_OQPSK_B = 3, /* O-QPSK-B */
+ mcp_OQPSK_C = 4, /* O-QPSK-C */
+ mcp_OFDM_OPT1 = 5, /* OFDM Option 1 */
+ mcp_OFDM_OPT2 = 6, /* OFDM Option 2 */
+ mcp_OFDM_OPT3 = 7, /* OFDM Option 3 */
+ mcp_OFDM_OPT4 = 8, /* OFDM Option 4 */
+
+ /* Legacy (802.15.4-2011) PHY types mapped to . */
+ mcp_OQPSK_L = 256, /* Legacy O-QPSK */
+ mcp_BPSK_L = 257, /* Legacy BPSK */
+};
+
+/* FCS Type (mcp_macFCSType). */
+enum {
+ mcp_FCS_TYPE_LONG = 0, /* 4 byte FCS is automatically generated by the PHY. */
+ mcp_FCS_TYPE_SHORT = 1, /* 2 byte FCS is automatically generated by the PHY. */
+ mcp_FCS_TYPE_LONG_RAW = 0x80, /* 4 byte FCS is not generated by the PHY, but the PHR is modified appropriately. */
+ mcp_FCS_TYPE_SHORT_RAW = 0x81, /* 2 byte FCS is not generated by the PHY, but the PHR is modified appropriately. */
+};
+
+/* TSCH specific definitions. */
+
+/* Header IE types. */
+enum {
+ mcp_IEEE802154_HIE_VENDOR_SPECIFIC = 0x00,
+ mcp_IEEE802154_HIE_UNMANAGED_MIN = 0x01,
+ mcp_IEEE802154_HIE_UNMANAGED_MAX = 0x19,
+ mcp_IEEE802154_HIE_LE_CSL = 0x1a,
+ mcp_IEEE802154_HIE_LE_RIT = 0x1b,
+ mcp_IEEE802154_HIE_DSME_PAN_DESC = 0x1c,
+ mcp_IEEE802154_HIE_RZ_TIME = 0x1d,
+ mcp_IEEE802154_HIE_ACK_TIME_CORR = 0x1e,
+ mcp_IEEE802154_HIE_GROUP_ACK = 0x1f,
+ mcp_IEEE802154_HIE_LLDN_INFO = 0x20,
+ mcp_IEEE802154_HIE_SIMPLIFIED_SUPERFRAME = 0x23,
+ mcp_IEEE802154_HIE_GLOBAL_TIME = 0x29,
+ mcp_IEEE802154_HIE_WISUN = 0x2A,
+};
+
+/* Payload IE group values. */
+enum {
+ mcp_IEEE802154_PIE_ESDU = 0x0,
+ mcp_IEEE802154_PIE_MLME = 0x1,
+ mcp_IEEE802154_PIE_VENDOR_SPECIFIC = 0x2,
+ mcp_IEEE802154_PIE_MPX = 0x3, /* IEEE 802.15.9 Support */
+ mcp_IEEE802154_PIE_WISUN = 0x4, /* Wi-SUN Payload embedded IEs */
+ mcp_IEEE802154_PIE_RESERVED_MIN = 0x5,
+ mcp_IEEE802154_PIE_RESERVED_MAX = 0xe,
+ mcp_IEEE802154_PIE_TERM = 0xf,
+};
+
+/* Nested TSCH MLME IE types. */
+enum {
+ mcp_IEEE802154_MIE_TSCH_SYNC = 0x1a,
+ mcp_IEEE802154_MIE_TSCH_LINK = 0x1b,
+ mcp_IEEE802154_MIE_TSCH_TIMESLOT = 0x1c,
+ mcp_IEEE802154_MIE_HOP_TIMING = 0x1d,
+ mcp_IEEE802154_MIE_EB_FILTER = 0x1e,
+ mcp_IEEE802154_MIE_METRICS_SINGLE = 0x1f,
+ mcp_IEEE802154_MIE_METRICS_ALL = 0x20,
+ mcp_IEEE802154_MIE_UNMANAGED_MIN = 0x40,
+ mcp_IEEE802154_MIE_UNMANAGED_MAX = 0x7f,
+ mcp_IEEE802154_MIE_HOP_SEQUENCE = 0x9,
+ mcp_IEEE802154_MIE_VENDOR_SPECIFIC = 0x8,
+};
+
+enum {
+ mcp_802154_FRAME_TYPE_BEACON = 0X00,
+ mcp_802154_FRAME_TYPE_DATA = 0X01,
+ mcp_802154_FRAME_TYPE_ACK = 0X02,
+ mcp_802154_FRAME_TYPE_CMD = 0X03,
+};
+
+/*lint -save -e621 [!MISRA - identifier clash ASSOCIATIONRESP/REQ] */
+enum {
+ mcp_802154_CMD_TYPE_ASSOCIATIONREQ = 0X01,
+ mcp_802154_CMD_TYPE_ASSOCIATIONRESP = 0X02,
+ mcp_802154_CMD_TYPE_DISASSOCIATION = 0X03,
+ mcp_802154_CMD_TYPE_DATAREQ = 0X04,
+ mcp_802154_CMD_TYPE_PANIDCONFLICT = 0X05,
+ mcp_802154_CMD_TYPE_ORPHAN = 0X06,
+ mcp_802154_CMD_TYPE_BEACONREQ = 0X07,
+ mcp_802154_CMD_TYPE_REALIGNMENT = 0X08,
+ mcp_802154_CMD_TYPE_GTSREQ = 0X09,
+ mcp_802154_CMD_TYPE_VENDOR = 0X24,
+};
+/*lint -restore */
+
+/* Wi-SUN Channel Functions */
+enum {
+ mcp_WS_CHANNEL_FIXED = 0, /* Fixed Channel Operation. */
+ mcp_WS_CHANNEL_TR51CF = 1, /* Channel Function defined by ASNITIA-4957.200 */
+ mcp_WS_CHANNEL_DH1CF = 2, /* Direct Hash channel function defined by WiSUN. */
+ mcp_WS_CHANNEL_VENDOR = 3, /* Use Vendor Defined channel function in macHoppingSequence */
+};
+
+/* Wi-SUN Regulatory Domains
+ * Defined by Wi-SUN-PHY-Specification-1V00.pdf section 5.7
+ * Frequency Bands and Channel Parameters
+ */
+enum {
+ mcp_WS_DOMAIN_ISM2400 = 0x00,
+ mcp_WS_DOMAIN_USA_CAN = 0x01,
+ mcp_WS_DOMAIN_JAPAN = 0x02,
+ mcp_WS_DOMAIN_EUROPE = 0x03,
+ mcp_WS_DOMAIN_CHINA = 0x04,
+ mcp_WS_DOMAIN_INDIA = 0x05,
+ mcp_WS_DOMAIN_MEXICO = 0x06,
+ mcp_WS_DOMAIN_BRAZIL = 0x07,
+ mcp_WS_DOMAIN_AUSTRALIA = 0x08,
+ mcp_WS_DOMAIN_KOREA = 0x09,
+ mcp_WS_DOMAIN_PHILIPPINES = 0x0a,
+ mcp_WS_DOMAIN_MALAYSIA = 0x0b,
+ mcp_WS_DOMAIN_HONG_KONG = 0x0c,
+ mcp_WS_DOMAIN_SINGAPORE = 0x0d,
+ mcp_WS_DOMAIN_THAILAND = 0x0e,
+ mcp_WS_DOMAIN_VIETNAM = 0x0f,
+};
+
+/* Macro to compute the usage bit for security keys and levels. */
+#define MCP_KEY_USAGE(_type_, _cmd_) (1ULL << (((_type_) == mcp_802154_FRAME_TYPE_CMD) ? ((_cmd_) + mcp_802154_FRAME_TYPE_CMD) : (_type_)))
+#define MCP_KEY_USAGE_ALL ((1ULL << (mcp_802154_FRAME_TYPE_CMD + mcp_802154_CMD_TYPE_VENDOR + 1)) - 1)
+
+/* Vendor-specific IE has different ID for HIE, PIE, MIE types. */
+#define MCP_TLV_IE_IS_VENDOR(type, id) \
+ ((((type) == MCP_TLV_HIE) && ((id) == mcp_IEEE802154_HIE_VENDOR_SPECIFIC)) \
+ || (((type) == MCP_TLV_PIE) && ((id) == mcp_IEEE802154_PIE_VENDOR_SPECIFIC)) \
+ || (((type) == MCP_TLV_MIE) && ((id) == mcp_IEEE802154_MIE_VENDOR_SPECIFIC)))
+
+/*lint -restore */
+
+#endif /* MCP_ENUMS_H */
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/pletoh.h b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/pletoh.h
new file mode 100644
index 000000000..bb66fbd2a
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/pletoh.h
@@ -0,0 +1,61 @@
+/* Copyright [2009 - 2018] Exegin Technologies Limited. All rights reserved. */
+
+#ifndef PLETOH_H_
+#define PLETOH_H_
+
+#include <stdint.h>
+#include <stdbool.h>
+
+bool is_little_endian(void);
+
+/*----------------------------------------------------------------------------
+ * Read Little Endian
+ *----------------------------------------------------------------------------
+ */
+/* 2-byte */
+uint16_t pletoh16(const uint8_t *p);
+
+/* 3-byte */
+uint32_t pletoh24(const uint8_t *p);
+
+/* 4-byte */
+uint32_t pletoh32(const uint8_t *p);
+
+/* 5-byte */
+uint64_t pletoh40(const uint8_t *p);
+
+/* 6-byte */
+uint64_t pletoh48(const uint8_t *p);
+
+/* 7-byte */
+uint64_t pletoh56(const uint8_t *p);
+
+/* 8-byte */
+uint64_t pletoh64(const uint8_t *p);
+
+/*----------------------------------------------------------------------------
+ * Write Little Endian
+ *----------------------------------------------------------------------------
+ */
+/* 2-byte */
+void putle16(uint8_t *p, uint16_t value);
+
+/* 3-byte */
+void putle24(uint8_t *p, uint32_t value);
+
+/* 4-byte */
+void putle32(uint8_t *p, uint32_t value);
+
+/* 5-byte */
+void putle40(uint8_t *p, uint64_t value);
+
+/* 6-byte */
+void putle48(uint8_t *p, uint64_t value);
+
+/* 7-byte */
+void putle56(uint8_t *p, uint64_t value);
+
+/* 8-byte */
+void putle64(uint8_t *p, uint64_t value);
+
+#endif /* _PLETOH_H_ */
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/readme.txt b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/readme.txt
new file mode 100644
index 000000000..b111c552c
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac/readme.txt
@@ -0,0 +1,9 @@
+These include files are pulled from various git sources:
+
+* ieee802154/include/llist.h
+
+* ieee802154/include/pletoh.h
+
+* mcp/include/mcp.h
+
+* mcp/include/mcp_enums.h
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zcl/key/zcl.cbke.h b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zcl/key/zcl.cbke.h
new file mode 100644
index 000000000..84dccc6df
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zcl/key/zcl.cbke.h
@@ -0,0 +1,103 @@
+/* Copyright [2009 - 2019] Exegin Technologies Limited. All rights reserved. */
+
+/*--------------------------------------------------------------------------
+ * Copyright (c) 2013-2014, Exegin Technologies Limited
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Exegin Technologies Limited nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ *--------------------------------------------------------------------------
+ */
+
+/*--------------------------------------------------------------------------
+ * DESCRIPTION
+ * Interface definition for the Certificate
+ * Based Key Exchange suite to the ZigBee
+ * Key Establishment cluster.
+ *--------------------------------------------------------------------------
+ */
+
+#ifndef ZCL_CBKE_H
+# define ZCL_CBKE_H
+
+#include "zcl/zcl.h"
+#include "zcl/key/zcl.cbke.h"
+#include "zcl/key/zcl.key.h"
+
+/*---------------------------------------------------------------
+ * Constants
+ *---------------------------------------------------------------
+ */
+#define CURVE_IDENTIFIER_SECT163K1 0x00U /* HACK: Not actually defined in the spec, but used for legacy certs. */
+#define CURVE_IDENTIFIER_SECT283K1 0x0DU
+#define HASH_IDENTIFIER_AES_MMO 0x08U
+#define CERT_VALID_INFINITY 0xffffffffU
+#define CBKE2_KEY_USAGE_AGREEMENT 0x08U
+#define CBKE2_DIGITAL_SIGNATURE 0x80U
+
+#define CBKE_EPHEMERAL_MAX_TIME 0xfeU
+#define CBKE_CONFIRM_MAX_TIME 0xfeU
+
+#define CBKE_V1_EPHEMERAL_DEFAULT_TIME 11U
+#define CBKE_V1_CONFIRM_DEFAULT_TIME 16U
+
+#define CBKE_V2_EPHEMERAL_DEFAULT_TIME 22U
+#define CBKE_V2_CONFIRM_DEFAULT_TIME 32U
+
+/*---------------------------------------------------------------
+ * Structures
+ *---------------------------------------------------------------
+ */
+typedef struct {
+ uint8_t type;
+ uint64_t serial;
+ uint8_t curve;
+ uint8_t hash;
+ uint64_t issuer;
+ uint64_t validFrom;
+ uint32_t validTo;
+ uint64_t subject;
+ uint8_t keyUsage;
+ size_t publicLen;
+ uint8_t publicKey[CBKE2_CERT_PUBLIC_KEY_SIZE];
+} ZbZclCertificateT;
+
+struct ZbZclKeClusterT;
+
+/*---------------------------------------------------------------
+ * Function Declarations
+ *---------------------------------------------------------------
+ */
+enum ZclStatusCodeT ZbZclKeAddCbke(struct ZbZclClusterT *clusterPtr, const struct ZbZclCbkeInfoT *info);
+enum ZclStatusCodeT ZbZclKeAddCbke2(struct ZbZclClusterT *clusterPtr, const struct ZbZclCbke2InfoT *info);
+ZbZclCertificateT * ZbZclParseCertificate(ZbZclCertificateT *dst, const void *src, size_t len);
+enum ZbZclKeyStatusT ZbZclCbke2ReconstPrivateKey(struct ZigBeeT *zb, const uint8_t *icu, const uint8_t *se, const uint8_t *du, uint8_t *wu);
+
+/* Helper function to reconstruct a private key. */
+uint8_t ZbZclCbkeReconstPrivateKey(const unsigned char *icu, const unsigned char *se, const unsigned char *du, unsigned char *wu);
+
+struct ZbZclKeSuiteT * ZbZclKeMatchSuite(struct ZbZclKeClusterT *kePtr, uint16_t suite_mask);
+bool ZbZclSuiteIsSupported(struct ZbZclClusterT *cluster, uint16_t suite);
+
+#endif /* _ZCL_CBKE_H */
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zcl/key/zcl.key.h b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zcl/key/zcl.key.h
new file mode 100644
index 000000000..8aff2a38b
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zcl/key/zcl.key.h
@@ -0,0 +1,72 @@
+/* Copyright [2009 - 2019] Exegin Technologies Limited. All rights reserved. */
+
+/*--------------------------------------------------------------------------
+ * DESCRIPTION
+ * The public header file for the Key Establishment
+ * cluster of the ZCL.
+ *--------------------------------------------------------------------------
+ */
+#ifndef ZCL_KEY_H
+# define ZCL_KEY_H
+
+#include "zcl/zcl.h"
+
+/* The slack time is added to the remote side's advertised timeout values.
+ * It accounts for network latency, etc. */
+#define ZCL_KEY_TIMEOUT_SLACK_SEC 10U
+
+/* Attirbute identifiers. */
+#define ZCL_KEY_ATTR_SUITE 0x0000U
+
+/* Command identifiers. */
+enum {
+ ZCL_KEY_COMMAND_INITIATE_KE = 0x00,
+ ZCL_KEY_COMMAND_EPHEMERAL_DATA = 0x01,
+ ZCL_KEY_COMMAND_CONFIRM_KEY = 0x02,
+ ZCL_KEY_COMMAND_TERMINATE_KE = 0x03
+};
+
+/* Key Establishment suite bits */
+#define ZCL_KEY_SUITE_CBKE_NONE 0x0000U
+#define ZCL_KEY_SUITE_CBKE_ECMQV 0x0001U
+#define ZCL_KEY_SUITE_CBKE2_ECMQV 0x0002U
+/* Exegin Custom for testing - SKKE over ZCL */
+#define ZCL_KEY_SUITE_SKKE 0x8000U
+
+/* Key Establishment status codes. */
+enum ZbZclKeyStatusT {
+ ZCL_KEY_STATUS_SUCCESS = 0x00,
+ ZCL_KEY_STATUS_UNKNOWN_ISSUER = 0x01,
+ ZCL_KEY_STATUS_BAD_KEY_CONFIRM = 0x02,
+ ZCL_KEY_STATUS_BAD_MESSAGE = 0x03,
+ ZCL_KEY_STATUS_NO_RESOURCES = 0x04,
+ ZCL_KEY_STATUS_UNSUPPORTED_SUITE = 0x05,
+ ZCL_KEY_STATUS_INVALID_CERTIFICATE = 0x06, /* SE 1.2 */
+ ZCL_KEY_STATUS_TIMEOUT = 0x07, /* Exegin extension */
+ ZCL_KEY_STATUS_MATCH_DESC_FAILED = 0x08 /* Exegin extension */
+};
+
+/* Callback functions types */
+typedef void (*ZbZclKeConfirmFuncT)(uint64_t partnerAddr, uint16_t keSuite, enum ZbZclKeyStatusT status, void *arg);
+
+struct ZbZclKeSuiteT;
+
+/* Functions */
+struct ZbZclClusterT * ZbZclKeAlloc(struct ZigBeeT *zb, uint8_t endpoint, ZbZclKeConfirmFuncT responderConfirmCb, void *responderConfirmArg);
+enum ZclStatusCodeT ZbZclKeAddSuite(struct ZbZclClusterT *clusterPtr, struct ZbZclKeSuiteT *newSuitePtr);
+void ZbZclKeDeleteAllSuites(struct ZbZclClusterT *clusterPtr);
+uint16_t ZbZclKeSuiteGetSupported(struct ZbZclClusterT *clusterPtr);
+enum ZclStatusCodeT ZbZclKeNegotiate(struct ZigBeeT *zb, uint64_t partner, uint8_t endpoint, uint16_t suite, ZbZclKeConfirmFuncT confirmFunc, void *confirmArg);
+const char * ZbZclKeStatusToStr(uint8_t statusCode);
+
+/* ZbZclKeWithDevice peforms all the steps required for CBKE between devices, including a Trust Center.
+ * Note, CBKE with a Trust Center is already handled by the ZbStartup code, including Trust Cetner Swap Out (TCSO)
+ *
+ * If aps_req_key is true, and partnerAddr is not the TC, then an APS Request Key is sent to the TC with the partner
+ * address set to the partnerAddr paramter.
+ *
+ * The callback is called once KE is done, or there was an error, only if ZbZclKeWithDevice returns ZCL_STATUS_SUCCESS. */
+enum ZclStatusCodeT ZbZclKeWithDevice(struct ZigBeeT *zb, uint64_t partnerAddr, bool aps_req_key,
+ void (*callback)(uint64_t partnerAddr, uint16_t keSuite, enum ZbZclKeyStatusT key_status, void *arg), void *arg);
+
+#endif /* ZCL_KEY_H */
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zcl/zcl.h b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zcl/zcl.h
new file mode 100644
index 000000000..8c803e1ae
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zcl/zcl.h
@@ -0,0 +1,1292 @@
+/* Copyright [2009 - 2019] Exegin Technologies Limited. All rights reserved. */
+
+#ifndef ZCL_H
+# define ZCL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Needs to come before zigbee.h. Should remove zigbee.h include from this file. */
+struct ZbZclClusterT;
+
+#include "zigbee.h"
+#include "pletoh.h"
+
+/* ZCL Frame Control Field Bits and macros.. */
+#define ZCL_FRAMECTRL_TYPE 0x03U
+#define ZCL_FRAMECTRL_MANUFACTURER 0x04U
+#define ZCL_FRAMECTRL_DIRECTION 0x08U /* set for client, clear for server */
+#define ZCL_FRAMECTRL_DISABLE_DEFAULT_RESP 0x10U
+#define ZCL_FRAMECTRL_RESERVED 0xe0U
+
+/* ZCL Frame Type Values */
+#define ZCL_FRAMETYPE_PROFILE 0x00U /* Global */
+#define ZCL_FRAMETYPE_CLUSTER 0x01U /* Cluster Specific */
+
+/* ZCL Direction Values */
+enum ZbZclDirectionT {
+ ZCL_DIRECTION_TO_SERVER = 0,
+ ZCL_DIRECTION_TO_CLIENT = 1,
+ ZCL_DIRECTION_ANY = 2 /* Only used internally with ZbZclClusterBind */
+};
+
+enum ZbZclNoDefaultResponseT {
+ ZCL_NO_DEFAULT_RESPONSE_FALSE = 0,
+ ZCL_NO_DEFAULT_RESPONSE_TRUE = 1
+};
+
+/* Lengths of the ZCL header. */
+#define ZCL_HEADER_MIN_SIZE 3U
+#define ZCL_HEADER_MAX_SIZE 5U /* with 2-byte manufacturer code */
+
+/* Max safe ZCL payload size (with APS security and no fragmentation)
+ * This value will be less with application security.
+ * Assumes not manufacturer specific command. */
+#define ZCL_PAYLOAD_UNFRAG_SAFE_SIZE (ZB_APS_CONST_SAFE_APSSEC_PAYLOAD_SIZE - ZCL_HEADER_MIN_SIZE) /* 54 */
+
+/* Maximum ZSE Message size (after fragmentation). */
+#define ZCL_ASDU_LENGTH_SMART_ENERGY 128U
+
+/* ZCL Indicator Values */
+#define ZCL_INDICATOR_DEPTH 0x0fU
+#define ZCL_INDICATOR_OPERATION 0xf0U
+#define ZCL_INDICATOR_REPLACE 0x00U
+#define ZCL_INDICATOR_INSERT 0x10U
+#define ZCL_INDICATOR_REMOVE 0x20U
+#define ZCL_INDICATOR_DEPTH_DECR(x) (x = (x & ZCL_INDICATOR_OPERATION_MASK) | ((x - 1) & ZCL_INDICATOR_DEPTH))
+
+/* ZCL Semi-Precision Floating Point Fields. */
+#define ZCL_FLOAT_SEMI_MANTISSA 0x03ffU
+#define ZCL_FLOAT_SEMI_EXPONENT 0x7c00U
+#define ZCL_FLOAT_SEMI_SIGN 0x8000U
+#define ZCL_FLOAT_SEMI_HIDDEN_BIT 10U
+/* ZCL Single-Precision Floating Point Fields. */
+#define ZCL_FLOAT_SINGLE_MANTISSA 0x007fffffU
+#define ZCL_FLOAT_SINGLE_EXPONENT 0x7f800000U
+#define ZCL_FLOAT_SINGLE_SIGN 0x80000000U
+#define ZCL_FLOAT_SINGLE_HIDDEN_BIT 23U
+/* ZCL Double-Precision Floating point Fields. */
+#define ZCL_FLOAT_DOUBLE_MANTISSA 0x000fffffffffffffULL
+#define ZCL_FLOAT_DOUBLE_EXPONENT 0x7ff0000000000000ULL
+#define ZCL_FLOAT_DOUBLE_SIGN 0x8000000000000000ULL
+#define ZCL_FLOAT_DOUBLE_HIDDEN_BIT 52U
+
+/* Floating Point Helper Macros */
+#ifdef _MSC_VER
+#include <float.h>
+#define ZCL_FLOAT_INFINITY (DBL_MAX + DBL_MAX)
+#define ZCL_FLOAT_NAN (ZCL_FLOAT_INFINITY - ZCL_FLOAT_INFINITY)
+#else
+#define ZCL_FLOAT_INFINITY (1.0 / 0.0)
+#define ZCL_FLOAT_NAN (0.0 / 0.0)
+#endif
+#define ZCL_FLOAT_ISNAN(x) ((x) != (x))
+#define ZCL_FLOAT_ISINF(x) (((x) == ZCL_FLOAT_INFINITY) || ((x) == -ZCL_FLOAT_INFINITY))
+
+/* Smart Energy Preferred channels: 11, 14, 15, 19, 20, 24, 25 */
+#define ZCL_CHANNELMASK_SMART_ENERGY 0x318c800UL
+
+/* Profile IDs and Ranges */
+enum {
+ ZCL_PROFILE_ZB_STANDARD_MIN = 0x0000,
+ /* Note: Legacy profile range does not include HA (0x0104) */
+ ZCL_PROFILE_LEGACY_MIN = 0x0101,
+ ZCL_PROFILE_HOME_AUTOMATION = 0x0104,
+ ZCL_PROFILE_LEGACY_MAX = 0x0108,
+ ZCL_PROFILE_SMART_ENERGY = 0x0109,
+ ZCL_PROFILE_RETAIL_SERVICES = 0x010A,
+ ZCL_PROFILE_TP2 = 0x7f01, /* ZigBee Test Profile #2 Profile Id */
+ ZCL_PROFILE_ZB_STANDARD_MAX = 0x7fff,
+
+ ZCL_PROFILE_MFR_SPECIFIC_MIN = 0xc000,
+ ZCL_PROFILE_ZLL = 0xc05e,
+ ZCL_PROFILE_C4 = 0xc25d,
+ ZCL_PROFILE_WILDCARD = 0xffff /* Wildcard Profile ID */
+};
+
+/* Device ID Ranges */
+enum {
+ ZCL_DEVICE_ZB_STANDARD_MIN = 0x0000,
+ ZCL_DEVICE_ZB_STANDARD_MAX = 0xbfff
+};
+
+/* Attribute ID Ranges */
+enum {
+ ZCL_ATTRIBUTE_ZB_STANDARD_MIN = 0x0000,
+ ZCL_ATTRIBUTE_ZB_STANDARD_MAX = 0x3fff
+};
+
+/* Command ID Ranges */
+enum {
+ ZCL_COMMAND_ZB_STANDARD_MIN = 0x00,
+ ZCL_COMMAND_ZB_STANDARD_MAX = 0x7f
+};
+
+/* Global Attributes */
+enum {
+ /* CLUSTER_REV attribute is automatically allocated and initialized by
+ * a cluster's alloc function when it calls ZbZclClusterAlloc.
+ * It does not need to be included in the cluster's attribute list
+ * during initialization. The value may be modified by the cluster or
+ * application after initialization (ZbZclAttrIntegerWrite). */
+ ZCL_GLOBAL_ATTR_CLUSTER_REV = 0xfffd, /* Mandatory */
+ ZCL_GLOBAL_ATTR_REPORTING_STATUS = 0xfffe /* Optional */
+};
+
+/* ZCL_GLOBAL_ATTR_CLUSTER_REV */
+enum {
+ ZCL_CLUSTER_REVISION_LEGACY = 0,
+ ZCL_CLUSTER_REVISION_ZCL6 = 1,
+ ZCL_CLUSTER_REVISION_ZCL7 = 2
+};
+
+/* ZCL Attribute Flags
+ * These define characteristics for a particular attribute
+ * (e.g. write permissions, is persisted, etc). */
+typedef uint16_t ZclAttrFlagT;
+/* i.e. read-only, non-reportable, etc */
+#define ZCL_ATTR_FLAG_NONE (ZclAttrFlagT)0x0000U
+/* read-write */
+#define ZCL_ATTR_FLAG_WRITABLE (ZclAttrFlagT)0x0001U
+/* attribute may be reported */
+#define ZCL_ATTR_FLAG_REPORTABLE (ZclAttrFlagT)0x0002U
+/* attribute is persisted */
+#define ZCL_ATTR_FLAG_PERSISTABLE (ZclAttrFlagT)0x0004U
+/* attribute is allowed to be reset to a default value */
+#define ZCL_ATTR_FLAG_DEFAULTABLE (ZclAttrFlagT)0x0008U
+/* Which callbacks does the application support */
+#define ZCL_ATTR_FLAG_CB_MASK 0x00f0U
+#define ZCL_ATTR_FLAG_CB_READ (ZclAttrFlagT)0x0010U /* ZCL_ATTR_CB_TYPE_READ */
+#define ZCL_ATTR_FLAG_CB_WRITE (ZclAttrFlagT)0x0020U /* ZCL_ATTR_CB_TYPE_WRITE */
+#define ZCL_ATTR_FLAG_CB_DEFAULT (ZclAttrFlagT)0x0040U /* ZCL_ATTR_CB_TYPE_DEFAULT */
+#define ZCL_ATTR_FLAG_CB_NOTIFY (ZclAttrFlagT)0x0080U /* ZCL_ATTR_CB_TYPE_NOTIFY */
+/* This flag means the attribute is for internal use only. Not discoverable. */
+#define ZCL_ATTR_FLAG_INTERNAL (ZclAttrFlagT)0x8000U
+
+/* ZCL Attribute Write-Mode Flags */
+typedef uint16_t ZclWriteModeT;
+/* Perform all sanity checks, and write if allowed. */
+#define ZCL_ATTR_WRITE_FLAG_NORMAL (ZclWriteModeT)0x0000U
+/* Sanity-check only, don't modify attribute data. */
+#define ZCL_ATTR_WRITE_FLAG_TEST (ZclWriteModeT)0x0001U
+/* If the attribute is read only, write anyways. */
+#define ZCL_ATTR_WRITE_FLAG_FORCE (ZclWriteModeT)0x0002U
+/* Data is from persistence (sometimes the application needs to
+ * know where the data is coming from). */
+#define ZCL_ATTR_WRITE_FLAG_PERSIST (ZclWriteModeT)0x0004U
+
+/* ZCL Data Types */
+enum ZclDataTypeT {
+ ZCL_DATATYPE_NULL = 0x00,
+ ZCL_DATATYPE_GENERIC_8BIT = 0x08,
+ ZCL_DATATYPE_GENERIC_16BIT = 0x09,
+ ZCL_DATATYPE_GENERIC_24BIT = 0x0a,
+ ZCL_DATATYPE_GENERIC_32BIT = 0x0b,
+ ZCL_DATATYPE_GENERIC_40BIT = 0x0c,
+ ZCL_DATATYPE_GENERIC_48BIT = 0x0d,
+ ZCL_DATATYPE_GENERIC_56BIT = 0x0e,
+ ZCL_DATATYPE_GENERIC_64BIT = 0x0f,
+ ZCL_DATATYPE_BOOLEAN = 0x10,
+ ZCL_DATATYPE_BITMAP_8BIT = 0x18,
+ ZCL_DATATYPE_BITMAP_16BIT = 0x19,
+ ZCL_DATATYPE_BITMAP_24BIT = 0x1a,
+ ZCL_DATATYPE_BITMAP_32BIT = 0x1b,
+ ZCL_DATATYPE_BITMAP_40BIT = 0x1c,
+ ZCL_DATATYPE_BITMAP_48BIT = 0x1d,
+ ZCL_DATATYPE_BITMAP_56BIT = 0x1e,
+ ZCL_DATATYPE_BITMAP_64BIT = 0x1f,
+ ZCL_DATATYPE_UNSIGNED_8BIT = 0x20,
+ ZCL_DATATYPE_UNSIGNED_16BIT = 0x21,
+ ZCL_DATATYPE_UNSIGNED_24BIT = 0x22,
+ ZCL_DATATYPE_UNSIGNED_32BIT = 0x23,
+ ZCL_DATATYPE_UNSIGNED_40BIT = 0x24,
+ ZCL_DATATYPE_UNSIGNED_48BIT = 0x25,
+ ZCL_DATATYPE_UNSIGNED_56BIT = 0x26,
+ ZCL_DATATYPE_UNSIGNED_64BIT = 0x27,
+ ZCL_DATATYPE_SIGNED_8BIT = 0x28,
+ ZCL_DATATYPE_SIGNED_16BIT = 0x29,
+ ZCL_DATATYPE_SIGNED_24BIT = 0x2a,
+ ZCL_DATATYPE_SIGNED_32BIT = 0x2b,
+ ZCL_DATATYPE_SIGNED_40BIT = 0x2c,
+ ZCL_DATATYPE_SIGNED_48BIT = 0x2d,
+ ZCL_DATATYPE_SIGNED_56BIT = 0x2e,
+ ZCL_DATATYPE_SIGNED_64BIT = 0x2f,
+ ZCL_DATATYPE_ENUMERATION_8BIT = 0x30,
+ ZCL_DATATYPE_ENUMERATION_16BIT = 0x31,
+ ZCL_DATATYPE_FLOATING_SEMI = 0x38,
+ ZCL_DATATYPE_FLOATING_SINGLE = 0x39,
+ ZCL_DATATYPE_FLOATING_DOUBLE = 0x3a,
+ ZCL_DATATYPE_STRING_OCTET = 0x41,
+ ZCL_DATATYPE_STRING_CHARACTER = 0x42,
+ ZCL_DATATYPE_STRING_LONG_OCTET = 0x43,
+ ZCL_DATATYPE_STRING_LONG_CHARACTER = 0x44,
+ ZCL_DATATYPE_ARRAY = 0x48,
+ ZCL_DATATYPE_STRUCT = 0x4c,
+ ZCL_DATATYPE_SET = 0x50,
+ ZCL_DATATYPE_BAG = 0x51,
+ ZCL_DATATYPE_TIME_OF_DAY = 0xe0,
+ ZCL_DATATYPE_DATE = 0xe1,
+ ZCL_DATATYPE_TIME_UTC = 0xe2,
+ ZCL_DATATYPE_CLUSTER_ID = 0xe8,
+ ZCL_DATATYPE_ATTRIBUTE_ID = 0xe9,
+ ZCL_DATATYPE_BACNET_OID = 0xea,
+ ZCL_DATATYPE_EUI64 = 0xf0,
+ ZCL_DATATYPE_SECURITY_KEY128 = 0xf1,
+ ZCL_DATATYPE_UNKNOWN = 0xff
+};
+
+/* ZCL Invalid Data Values */
+#define ZCL_INVALID_BOOLEAN 0xffU
+#define ZCL_INVALID_UNSIGNED_8BIT 0xffU
+#define ZCL_INVALID_UNSIGNED_16BIT 0xffffU
+#define ZCL_INVALID_UNSIGNED_24BIT 0xffffffU
+#define ZCL_INVALID_UNSIGNED_32BIT 0xffffffffU
+#define ZCL_INVALID_UNSIGNED_40BIT 0xffffffffffULL
+#define ZCL_INVALID_UNSIGNED_48BIT 0xffffffffffffULL
+#define ZCL_INVALID_UNSIGNED_56BIT 0xffffffffffffffULL
+#define ZCL_INVALID_UNSIGNED_64BIT 0xffffffffffffffffULL
+
+#define ZCL_INVALID_SIGNED_8BIT 0x80
+#define ZCL_INVALID_SIGNED_16BIT 0x8000
+#define ZCL_INVALID_SIGNED_24BIT 0x800000
+#define ZCL_INVALID_SIGNED_32BIT 0x80000000U
+#define ZCL_INVALID_SIGNED_40BIT 0x8000000000LL
+#define ZCL_INVALID_SIGNED_48BIT 0x800000000000LL
+#define ZCL_INVALID_SIGNED_56BIT 0x80000000000000LL
+#define ZCL_INVALID_SIGNED_64BIT 0x8000000000000000UL
+
+#define ZCL_INVALID_ENUMERATION_8BIT 0xffU
+#define ZCL_INVALID_ENUMERATION_16BIT 0xffffU
+
+#define ZCL_INVALID_FLOATING (0.0 / 0.0)
+/* Note, can't bit-or signed values (MISRA rule 10.1) */
+#define ZCL_INVALID_FLOATING_SEMI (ZCL_FLOAT_SEMI_MANTISSA + ZCL_FLOAT_SEMI_EXPONENT)
+#define ZCL_INVALID_FLOATING_SINGLE (ZCL_FLOAT_SINGLE_MANTISSA + ZCL_FLOAT_SINGLE_MANTISSA)
+#define ZCL_INVALID_FLOATING_DOUBLE (ZCL_FLOAT_DOUBLE_MANTISSA + ZCL_FLOAT_DOUBLE_MANTISSA)
+
+#define ZCL_INVALID_STRING_OCTET 0xffU
+#define ZCL_INVALID_STRING_CHARACTER 0xffU
+#define ZCL_INVALID_STRING_LONG_OCTET 0xffffU
+#define ZCL_INVALID_STRING_LONG_CHARACTER 0xffffU
+
+#define ZCL_INVALID_ARRAY 0xffffU
+#define ZCL_INVALID_STRUCT 0xffffU
+#define ZCL_INVALID_SET 0xffffU
+#define ZCL_INVALID_BAG 0xffffU
+#define ZCL_INVALID_TIME_OF_DAY 0xffffffffU
+#define ZCL_INVALID_DATE 0xffffffffU
+#define ZCL_INVALID_TIME_UTC 0xffffffffU
+#define ZCL_INVALID_CLUSTER_ID 0xffffU
+#define ZCL_INVALID_ATTRIBUTE_ID 0xffffU
+#define ZCL_INVALID_BACNET_OID 0xffffffffU
+#define ZCL_INVALID_EUI64 0xffffffffffffffffULL
+
+/* ZCL Valid Ranges */
+#define ZCL_MIN_SIGNED_8BIT (-(ZCL_INVALID_SIGNED_8BIT - 1))
+#define ZCL_MIN_SIGNED_16BIT (-(ZCL_INVALID_SIGNED_16BIT - 1))
+#define ZCL_MIN_SIGNED_24BIT (-(ZCL_INVALID_SIGNED_24BIT - 1))
+#define ZCL_MIN_SIGNED_32BIT (-(ZCL_INVALID_SIGNED_32BIT - 1))
+#define ZCL_MIN_SIGNED_40BIT (-(ZCL_INVALID_SIGNED_40BIT - 1))
+#define ZCL_MIN_SIGNED_48BIT (-(ZCL_INVALID_SIGNED_48BIT - 1))
+#define ZCL_MIN_SIGNED_56BIT (-(ZCL_INVALID_SIGNED_56BIT - 1))
+#define ZCL_MIN_SIGNED_64BIT (-(ZCL_INVALID_SIGNED_64BIT - 1))
+
+#define ZCL_MAX_SIGNED_8BIT 0x7f
+#define ZCL_MAX_SIGNED_16BIT 0x7fff
+#define ZCL_MAX_SIGNED_24BIT 0x7fffff
+#define ZCL_MAX_SIGNED_32BIT 0x7fffffff
+#define ZCL_MAX_SIGNED_40BIT 0x7fffffffffULL
+#define ZCL_MAX_SIGNED_48BIT 0x7fffffffffffULL
+#define ZCL_MAX_SIGNED_56BIT 0x7fffffffffffffULL
+#define ZCL_MAX_SIGNED_64BIT 0x7fffffffffffffffULL
+
+#define ZCL_MAX_UNSIGNED_8BIT (ZCL_INVALID_UNSIGNED_8BIT - 1U)
+#define ZCL_MAX_UNSIGNED_16BIT (ZCL_INVALID_UNSIGNED_16BIT - 1U)
+#define ZCL_MAX_UNSIGNED_24BIT (ZCL_INVALID_UNSIGNED_24BIT - 1U)
+#define ZCL_MAX_UNSIGNED_32BIT (ZCL_INVALID_UNSIGNED_32BIT - 1U)
+#define ZCL_MAX_UNSIGNED_40BIT (ZCL_INVALID_UNSIGNED_40BIT - 1U)
+#define ZCL_MAX_UNSIGNED_48BIT (ZCL_INVALID_UNSIGNED_48BIT - 1U)
+#define ZCL_MAX_UNSIGNED_56BIT (ZCL_INVALID_UNSIGNED_56BIT - 1U)
+#define ZCL_MAX_UNSIGNED_64BIT (ZCL_INVALID_UNSIGNED_64BIT - 1U)
+
+/* Type sizes */
+#define ZCL_SIZEOF_8BIT 1U
+#define ZCL_SIZEOF_16BIT 2U
+#define ZCL_SIZEOF_24BIT 3U
+#define ZCL_SIZEOF_32BIT 4U
+#define ZCL_SIZEOF_40BIT 5U
+#define ZCL_SIZEOF_48BIT 6U
+#define ZCL_SIZEOF_56BIT 7U
+#define ZCL_SIZEOF_64BIT 8U
+#define ZCL_SIZEOF_128BIT 16U
+
+/* ZCL Status Codes */
+enum ZclStatusCodeT {
+ ZCL_STATUS_SUCCESS = 0x00,
+ ZCL_STATUS_FAILURE = 0x01,
+ ZCL_STATUS_ALLOC_FAIL = 0x70,
+ ZCL_STATUS_NOT_AUTHORIZED = 0x7e,
+ ZCL_STATUS_MALFORMED_COMMAND = 0x80,
+ ZCL_STATUS_UNSUPP_CLUSTER_COMMAND = 0x81,
+ ZCL_STATUS_UNSUPP_GENERAL_COMMAND = 0x82,
+ ZCL_STATUS_UNSUPP_MFR_CLUSTER_COMMAND = 0x83,
+ ZCL_STATUS_UNSUPP_MFR_GENERAL_COMMAND = 0x84,
+ ZCL_STATUS_INVALID_FIELD = 0x85,
+ ZCL_STATUS_UNSUPP_ATTRIBUTE = 0x86,
+ ZCL_STATUS_INVALID_VALUE = 0x87,
+ ZCL_STATUS_READ_ONLY = 0x88,
+ ZCL_STATUS_INSUFFICIENT_SPACE = 0x89,
+ ZCL_STATUS_DUPLICATE_EXISTS = 0x8a,
+ ZCL_STATUS_NOT_FOUND = 0x8b,
+ ZCL_STATUS_UNREPORTABLE_ATTRIBUTE = 0x8c,
+ ZCL_STATUS_INVALID_DATA_TYPE = 0x8d,
+ ZCL_STATUS_INVALID_SELECTOR = 0x8e,
+ ZCL_STATUS_WRITE_ONLY = 0x8f,
+ ZCL_STATUS_INCONSISTENT_STARTUP_STATE = 0x90,
+ ZCL_STATUS_DEFINED_OUT_OF_BAND = 0x91,
+ ZCL_STATUS_INCONSISTENT = 0x92,
+ ZCL_STATUS_ACTION_DENIED = 0x93,
+ ZCL_STATUS_TIMEOUT = 0x94,
+ ZCL_STATUS_ABORT = 0x95,
+ ZCL_STATUS_INVALID_IMAGE = 0x96,
+ ZCL_STATUS_WAIT_FOR_DATA = 0x97,
+ ZCL_STATUS_NO_IMAGE_AVAILABLE = 0x98,
+ ZCL_STATUS_REQUIRE_MORE_IMAGE = 0x99,
+ ZCL_STATUS_NOTIFICATION_PENDING = 0x9A,
+ ZCL_STATUS_HARDWARE_FAILURE = 0xc0,
+ ZCL_STATUS_SOFTWARE_FAILURE = 0xc1,
+ ZCL_STATUS_CALIBRATION_ERROR = 0xc2,
+ ZCL_STATUS_UNSUPP_CLUSTER = 0xc3,
+ ZCL_STATUS_LIMIT_REACHED = 0xc4,
+
+ /* Exegin add-on: Used with cluster command callback to indicate
+ * command was handled successfully, but don't send a Default Response
+ * for success. I.e. a response has already been sent. */
+ ZCL_STATUS_SUCCESS_NO_DEFAULT_RESPONSE = 0xff
+ /* zcl_attr_integer.c relies on these enum constants to be =< 0xff since they're cast as uint8_t */
+};
+
+/* For SE 1.2a Attribute Reporting Status for Sleepy Devices */
+#define ZCL_ATTR_REPORTING_STATUS 0xfffeU
+#define ZCL_ATTR_REPORTING_STATUS_PENDING 0x00U
+#define ZCL_ATTR_REPORTING_STATUS_COMPLETE 0x01U
+
+/* Device IDs */
+enum ZbZclDeviceIdT {
+ ZCL_DEVICE_ONOFF_SWITCH = 0x0000,
+ ZCL_DEVICE_LEVEL_SWITCH = 0x0001,
+ ZCL_DEVICE_ONOFF_OUTPUT = 0x0002,
+ ZCL_DEVICE_LEVEL_OUTPUT = 0x0003,
+ ZCL_DEVICE_SCENE_SELECTOR = 0x0004,
+ ZCL_DEVICE_CONFIG_TOOL = 0x0005,
+ ZCL_DEVICE_REMOTE_CONTROL = 0x0006,
+ ZCL_DEVICE_COMBINED_INTERFACE = 0x0007,
+ ZCL_DEVICE_RANGE_EXTENDER = 0x0008,
+ ZCL_DEVICE_MAINS_POWER_OUTLET = 0x0009,
+ ZCL_DEVICE_DOOR_LOCK = 0x000a,
+ ZCL_DEVICE_DOOR_LOCK_CONTROLLER = 0x000b,
+ ZCL_DEVICE_SIMPLE_SENSOR = 0x000c,
+ ZCL_DEVICE_DATA_COLLECTION_UNIT = 0x0010,
+ ZCL_DEVICE_ZIGBEE_SIM_CARD = 0x0020,
+ ZCL_DEVICE_ZIGBEE_MOBILE_TERMINAL = 0x0021,
+ ZCL_DEVICE_ZIGBEE_GLOBAL_PLATFORM_CARD = 0x0026, /* same as */
+ ZCL_DEVICE_CUSTOMER_HANDHELD_DEVICE = 0x0030,
+ ZCL_DEVICE_RETAIL_ASSOCIATE_HANDHELD_DEVICE = 0x0031,
+ ZCL_DEVICE_INTELLIGENT_SHOPPING_CART = 0x0032,
+ ZCL_DEVICE_ELECTRONIC_SHELF_LABEL = 0x0033,
+ ZCL_DEVICE_CUSTOMER_INFORMATION_POINT = 0x0034,
+ ZCL_DEVICE_CUSTOMER_CARD = 0x0035,
+ ZCL_DEVICE_CONSTRUCTED_BACNET_DEVICE = 0x004a,
+ ZCL_DEVICE_BACNET_TUNNELED_DEVICE = 0x004b,
+ ZCL_DEVICE_HOME_GATEWAY = 0x0050,
+ ZCL_DEVICE_SMART_PLUG = 0x0051,
+ ZCL_DEVICE_WHITE_GOODS = 0x0052,
+ ZCL_DEVICE_METER_INTERFACE = 0x0053,
+ ZCL_DEVICE_ZGP_PROXY = 0x0060,
+ ZCL_DEVICE_ZGP_PROXY_BASIC = 0x0061,
+ ZCL_DEVICE_ZGP_TARGET_PLUS = 0x0062,
+ ZCL_DEVICE_ZGP_TARGET = 0x0063,
+ ZCL_DEVICE_ZGP_COMMISSIONING_TOOL = 0x0064,
+ ZCL_DEVICE_ZGP_COMBO = 0x0065,
+ ZCL_DEVICE_ZGP_COMBO_BASIC = 0x0066,
+ ZCL_DEVICE_ENVIRONMENTAL_SENSOR = 0x0067,
+
+ /* Lighting and Occupancy (0x0100) */
+ ZCL_DEVICE_ONOFF_LIGHT = 0x0100,
+ ZCL_DEVICE_DIMMABLE_LIGHT = 0x0101,
+ ZCL_DEVICE_COLOR_DIMMABLE_LIGHT = 0x0102,
+ ZCL_DEVICE_ONOFF_LIGHT_SWITCH = 0x0103,
+ ZCL_DEVICE_ONOFF_DIMMER_SWITCH = 0x0104,
+ ZCL_DEVICE_ONOFF_COLOR_DIMMER_SWITCH = 0x0105,
+ ZCL_DEVICE_ONOFF_LIGHT_SENSOR = 0x0106,
+ ZCL_DEVICE_ONOFF_OCCUPANCY_SENSOR = 0x0107,
+ /* TODO - add more from Lighting and Occupancy Device Spec */
+
+ /* IAS (0x0400) */
+ ZCL_DEVICE_IAS_CONTROL_AND_INDICATING_EQUIPMENT = 0x0400,
+ ZCL_DEVICE_IAS_ANCILLARY_CONTROL_EQUIPMENT = 0x0401,
+ ZCL_DEVICE_IAS_ZONE = 0x0402,
+ ZCL_DEVICE_IAS_WARNING_DEVICE = 0x0403,
+
+ /* Smart Energy device identifiers. (0x0500) */
+ ZCL_DEVICE_ESP = 0x0500,
+ ZCL_DEVICE_METER = 0x0501,
+ ZCL_DEVICE_IN_HOME_DISPLAY = 0x0502,
+ ZCL_DEVICE_PCT = 0x0503,
+ ZCL_DEVICE_LOAD_CONTROL = 0x0504,
+ ZCL_DEVICE_SMART_APPLIANCE = 0x0505,
+ ZCL_DEVICE_PREPAYMENT_TERMINAL = 0x0506,
+ ZCL_DEVICE_PHYSICAL_DEVICE = 0x0507,
+ ZCL_DEVICE_REMOTE_COMMUNICATIONS_DEVICE = 0x0508,
+ ZCL_DEVICE_ERL_INTERFACE = 0x0509,
+
+ /* Lighting and Occupancy Continued (0x0800) */
+ ZCL_DEVICE_COLOR_CONTROLLER = 0x0800,
+ ZCL_DEVICE_COLOR_SCENE_CONTROLLER = 0x0810,
+ ZCL_DEVICE_NON_COLOR_CONTROLLER = 0x0820,
+ ZCL_DEVICE_NON_COLOR_SCENE_CONTROLLER = 0x0830,
+ ZCL_DEVICE_CONTROL_BRIDGE = 0x0840,
+ ZCL_DEVICE_ONOFF_SENSOR = 0x0850 /* aka Door Sensor? */
+};
+
+/* Cluster ID Ranges */
+enum {
+ ZCL_CLUSTER_ZB_STANDARD_MIN = 0x0000U,
+ ZCL_CLUSTER_ZB_STANDARD_MAX = 0x7fffU,
+ ZCL_CLUSTER_MFR_SPECIFIC_MIN = 0xfc00U,
+ ZCL_CLUSTER_MFR_SPECIFIC_MAX = 0xffffU
+};
+
+/* Known Cluster IDs */
+enum ZbZclClusterIdT {
+ /* General cluster identifiers. */
+ ZCL_CLUSTER_BASIC = 0x0000,
+ ZCL_CLUSTER_POWER_CONFIG = 0x0001,
+ ZCL_CLUSTER_DEVICE_TEMPERATURE = 0x0002,
+ ZCL_CLUSTER_IDENTIFY = 0x0003,
+ ZCL_CLUSTER_GROUPS = 0x0004,
+ ZCL_CLUSTER_SCENES = 0x0005,
+ ZCL_CLUSTER_ONOFF = 0x0006,
+ ZCL_CLUSTER_ONOFF_CONFIG = 0x0007,
+ ZCL_CLUSTER_LEVEL_CONTROL = 0x0008,
+ ZCL_CLUSTER_ALARMS = 0x0009,
+ ZCL_CLUSTER_TIME = 0x000a,
+ ZCL_CLUSTER_RSSI_LOCATION = 0x000b,
+ ZCL_CLUSTER_ANALOG_INPUT_BASIC = 0x000c,
+ ZCL_CLUSTER_ANALOG_OUTPUT_BASIC = 0x000d,
+ ZCL_CLUSTER_ANALOG_VALUE_BASIC = 0x000e,
+ ZCL_CLUSTER_BINARY_INPUT_BASIC = 0x000f,
+ ZCL_CLUSTER_BINARY_OUTPUT_BASIC = 0x0010,
+ ZCL_CLUSTER_BINARY_VALUE_BASIC = 0x0011,
+ ZCL_CLUSTER_MULTISTATE_INPUT_BASIC = 0x0012,
+ ZCL_CLUSTER_MULTISTATE_OUTPUT_BASIC = 0x0013,
+ ZCL_CLUSTER_MULTISTATE_VALUE_BASIC = 0x0014,
+ ZCL_CLUSTER_COMMISSIONING = 0x0015,
+ ZCL_CLUSTER_OTA_UPGRADE = 0x0019,
+ ZCL_CLUSTER_POLL_CONTROL = 0x0020,
+ ZCL_CLUSTER_GREEN_POWER = 0x0021,
+ ZCL_CLUSTER_KEEP_ALIVE = 0x0025,
+ ZCL_CLUSTER_METER_ID = 0x0b01,
+ ZCL_CLUSTER_DIAGNOSTICS = 0x0b05,
+
+ /* Closures Cluster IDs */
+ ZCL_CLUSTER_CLOSURE_SHADE_CONFIG = 0x0100,
+ ZCL_CLUSTER_DOOR_LOCK = 0x0101,
+ ZCL_CLUSTER_WINDOW_COVERING = 0x0102,
+
+ /* HVAC Cluster IDs */
+ ZCL_CLUSTER_HVAC_PUMP = 0x0200,
+ ZCL_CLUSTER_HVAC_THERMOSTAT = 0x0201,
+ ZCL_CLUSTER_HVAC_FAN = 0x0202,
+ ZCL_CLUSTER_HVAC_DEHUMIDIFIER = 0x0203,
+ ZCL_CLUSTER_HVAC_THERMOSTAT_UI = 0x0204,
+
+ /* Lighting Cluster IDs */
+ ZCL_CLUSTER_COLOR_CONTROL = 0x0300,
+ ZCL_CLUSTER_BALLAST_CONTROL = 0x0301,
+
+ /* Measurement Cluster IDs */
+ ZCL_CLUSTER_MEAS_ILLUMINANCE = 0x0400,
+ ZCL_CLUSTER_MEAS_ILLUMINANCE_LEVEL = 0x0401,
+ ZCL_CLUSTER_MEAS_TEMPERATURE = 0x0402,
+ ZCL_CLUSTER_MEAS_PRESSURE = 0x0403,
+ ZCL_CLUSTER_MEAS_FLOW = 0x0404,
+ ZCL_CLUSTER_MEAS_HUMIDITY = 0x0405,
+ ZCL_CLUSTER_MEAS_OCCUPANCY = 0x0406,
+ ZCL_CLUSTER_MEAS_LEAF_WETNESS = 0x0407,
+ ZCL_CLUSTER_MEAS_SOIL_MOISTURE = 0x0408,
+
+ /* Security Cluster IDs */
+ ZCL_CLUSTER_SECURITY_IAS_ZONE = 0x0500,
+ ZCL_CLUSTER_SECURITY_IAS_ANCILLARY = 0x0501,
+ ZCL_CLUSTER_SECURITY_IAS_WARNING = 0x0502,
+
+ /* Protocol Cluster IDs */
+ ZCL_CLUSTER_PROTOCOL_TUNNEL = 0x0600,
+ ZCL_CLUSTER_BACNET_TUNNEL = 0x0601,
+ ZCL_CLUSTER_BACNET_ANALOG_IN_REG = 0x0602,
+ ZCL_CLUSTER_BACNET_ANALOG_IN_EXT = 0x0603,
+ ZCL_CLUSTER_BACNET_ANALOG_OUT_REG = 0x0604,
+ ZCL_CLUSTER_BACNET_ANALOG_OUT_EXT = 0x0605,
+ ZCL_CLUSTER_BACNET_ANALOG_VAL_REG = 0x0606,
+ ZCL_CLUSTER_BACNET_ANALOG_VAL_EXT = 0x0607,
+ ZCL_CLUSTER_BACNET_BINARY_IN_REG = 0x0608,
+ ZCL_CLUSTER_BACNET_BINARY_IN_EXT = 0x0609,
+ ZCL_CLUSTER_BACNET_BINARY_OUT_REG = 0x060a,
+ ZCL_CLUSTER_BACNET_BINARY_OUT_EXT = 0x060b,
+ ZCL_CLUSTER_BACNET_BINARY_VAL_REG = 0x060c,
+ ZCL_CLUSTER_BACNET_BINARY_VAL_EXT = 0x060d,
+ ZCL_CLUSTER_BACNET_MULTI_IN_REG = 0x060e,
+ ZCL_CLUSTER_BACNET_MULTI_IN_EXT = 0x060f,
+ ZCL_CLUSTER_BACNET_MULTI_OUT_REG = 0x0610,
+ ZCL_CLUSTER_BACNET_MULTI_OUT_EXT = 0x0611,
+ ZCL_CLUSTER_BACNET_MULTI_VAL_REG = 0x0612,
+ ZCL_CLUSTER_BACNET_MULTI_VAL_EXT = 0x0613,
+
+ /* Smart Energy */
+ ZCL_CLUSTER_PRICE = 0x0700,
+ ZCL_CLUSTER_DRLC = 0x0701,
+ ZCL_CLUSTER_SIMPLE_METERING = 0x0702,
+ ZCL_CLUSTER_MESSAGING = 0x0703,
+ ZCL_CLUSTER_TUNNELING = 0x0704,
+ ZCL_CLUSTER_PREPAYMENT = 0x0705,
+ ZCL_CLUSTER_ENERGY_MANAGEMENT = 0x0706, /* SE 1.2 */
+ ZCL_CLUSTER_CALENDAR = 0x0707,
+ ZCL_CLUSTER_DEVICE_MANAGEMENT = 0x0708, /* SE 1.2 */
+ ZCL_CLUSTER_EVENTS = 0x0709, /* SE 1.2 */
+ ZCL_CLUSTER_MDU_PAIRING = 0x070A, /* SE 1.2 */
+
+ /* CBKE */
+ ZCL_CLUSTER_KEY_ESTABLISHMENT = 0x0800,
+
+ /* TOUCHLINK */
+ ZCL_CLUSTER_TOUCHLINK = 0x1000,
+
+ /* Custom, internal use only, for handling cluster persistence.
+ * Used with ZCL_MANUF_CODE_INTERNAL. */
+ ZCL_CLUSTER_PERSIST = 0xfffe,
+
+ /* Custom, internal use only, for local loop-back commands we want to
+ * send to all clusters. Used with ZCL_MANUF_CODE_INTERNAL. */
+ ZCL_CLUSTER_WILDCARD = 0xffff
+};
+
+/* General ZCL Commands (ZCL_FRAMETYPE_PROFILE) */
+enum {
+ ZCL_COMMAND_READ = 0x00,
+ ZCL_COMMAND_READ_RESPONSE = 0x01,
+ ZCL_COMMAND_WRITE = 0x02,
+ ZCL_COMMAND_WRITE_UNDIVIDED = 0x03,
+ ZCL_COMMAND_WRITE_RESPONSE = 0x04,
+ ZCL_COMMAND_WRITE_NO_RESPONSE = 0x05,
+ ZCL_COMMAND_CONFIG_REPORTING = 0x06,
+ ZCL_COMMAND_CONFIG_REPORTING_RESPONSE = 0x07,
+ ZCL_COMMAND_READ_REPORTING = 0x08,
+ ZCL_COMMAND_READ_REPORTING_RESPONSE = 0x09,
+ ZCL_COMMAND_REPORT = 0x0a,
+ ZCL_COMMAND_DEFAULT_RESPONSE = 0x0b,
+ ZCL_COMMAND_DISCOVER_ATTR = 0x0c,
+ ZCL_COMMAND_DISCOVER_ATTR_RSP = 0x0d,
+ ZCL_COMMAND_READ_STRUCTURED = 0x0e,
+ ZCL_COMMAND_WRITE_STRUCTURED = 0x0f,
+ ZCL_COMMAND_WRITE_STRUCTURED_RESPONSE = 0x10
+};
+
+/*---------------------------------------------------------------
+ * Structures
+ *---------------------------------------------------------------
+ */
+struct ZbZclAddrInfoT {
+ struct ZbApsAddrT addr;
+ uint8_t seqnum;
+ uint16_t tx_options;
+};
+
+/* ZCL Frame Control field. */
+struct ZbZclFrameControlT {
+ uint8_t frameType; /* ZCL_FRAMECTRL_TYPE */
+ uint8_t manufacturer; /* TRUE or FALSE */
+ enum ZbZclDirectionT direction;
+ enum ZbZclNoDefaultResponseT noDefaultResp;
+};
+
+/* General ZCL Frame Structure */
+struct ZbZclHeaderT {
+ struct ZbZclFrameControlT frameCtrl;
+ uint16_t manufacturerCode;
+ uint8_t seqNum;
+ uint8_t cmdId;
+};
+
+enum ZbZclReportDirectionT {
+ /* For Configure Reporting: receiver configures attribute to send
+ * reports via binding table.
+ *
+ * For Read Reporting: specifies whether values of the attribute are reported */
+ ZCL_REPORT_DIRECTION_NORMAL = 0x00,
+
+ /* For Configure Reporting: sender is sending reports to the receiver,
+ * based on the state of the sender's bindings. Tells receiver how / when
+ * it should expect reports.
+ *
+ * For Read Reporting: specifies whether reports of the attribute are received. */
+ ZCL_REPORT_DIRECTION_REVERSE = 0x01
+};
+
+/* ZCL Reporting Configuration Record Structure. */
+struct ZbZclReportConfigT {
+ enum ZbZclReportDirectionT direction;
+ uint16_t attributeId;
+ enum ZclDataTypeT dataType;
+ uint16_t minInterval;
+ uint16_t maxInterval;
+ union {
+ long long integer;
+ double floating;
+ } minChange;
+ uint16_t reportTimeout;
+};
+
+/*---------------------------------------------------------------
+ * Cluster Attribute Initialization
+ *---------------------------------------------------------------
+ */
+
+struct ZbZclAttrCbInfoT;
+
+/* The structure used to initialize a ZCL attribute when calling ZbZclAttrAppendList.
+ *
+ * PARAMETERS:
+ * attributeId ; The attribute's ID
+ *
+ * dataType ; The attribute's data type, or ZCL_DATATYPE_UNKNOWN
+ * if this is the last entry in a list.
+ *
+ * flags ; Flags that determine whether this attribute is writable,
+ * reportable, persisted, etc
+ *
+ * customValSz ; A custom size is required if both customRead and
+ * customWrite callbacks are provided (for maximum
+ * persistence size), or for the following attribute data
+ * types:
+ *
+ * ZCL_DATATYPE_STRING_OCTET,
+ * ZCL_DATATYPE_STRING_CHARACTER,
+ * ZCL_DATATYPE_STRING_LONG_OCTET,
+ * ZCL_DATATYPE_STRING_LONG_CHARACTER,
+ * ZCL_DATATYPE_ARRAY,
+ * ZCL_DATATYPE_STRUCT,
+ * ZCL_DATATYPE_SET,
+ * ZCL_DATATYPE_BAG
+ *
+ * Maximum size is the length returned by ZbZclClusterGetMaxAsduLength() or
+ * the cluster's maxAsduLength parameter. It should not exceed
+ * ZB_APS_CONST_MAX_FRAG_SIZE.
+ *
+ * customRead ; Callback to let application handle an attribute read
+ * request. If NULL, the default stack attribute read
+ * handler is used.
+ *
+ * customWrite ; Callback to let application handle an attribute write
+ * request. If NULL, the default stack attribute write
+ * handler is used.
+ *
+ * NOTE: If customRead and customWrite are both provided,
+ * ZbZclAttrAppendList will not allocate memory for the
+ * attribute's data. The application must maintain this
+ * information separately from the attribute.
+ *
+ * customDefault ; Called to reset attribute to default value. If NULL,
+ * the attribute will be reset to the default value for the
+ * given data type.
+ *
+ * writeNotify ; If customWrite is NULL and the stack is handling attribute
+ * writes for this attribute, then this callback notifies
+ * the application whenever a successful write takes place.
+ * This callback is also called when the attributes is reset
+ * to defaults and customDefault is NULL.
+ *
+ * report_interval_secs_min ; Default minimum attribute reporting interval
+ * in seconds.
+ *
+ * report_interval_secs_max ; Default maximum attribute reporting interval
+ * in seconds.
+ */
+struct ZbZclAttrT {
+ uint16_t attributeId;
+ enum ZclDataTypeT dataType;
+ ZclAttrFlagT flags;
+ unsigned int customValSz;
+ enum ZclStatusCodeT (*callback)(struct ZbZclClusterT *clusterPtr, struct ZbZclAttrCbInfoT *info);
+ struct {
+ /* If min and max both equal zero, range checking is disabled. */
+ long long min;
+ long long max;
+ } integer_range;
+ struct {
+ uint16_t interval_min; /* seconds */
+ uint16_t interval_max; /* seconds */
+ } reporting;
+};
+
+#define ZCL_ATTR_LIST_LEN(_list_) (sizeof(_list_) / sizeof(struct ZbZclAttrT))
+
+/* Appends attributes to the cluster.
+ * Important note: attrList memory is attached to the cluster, so
+ * it cannot be freed until the cluster is freed. */
+enum ZclStatusCodeT ZbZclAttrAppendList(struct ZbZclClusterT *clusterPtr, const struct ZbZclAttrT *attrList, unsigned int num_attrs);
+
+/* Attribute Callback Types */
+enum ZbZclAttrCbTypeT {
+ ZCL_ATTR_CB_TYPE_READ, /* Read Attribute */
+ ZCL_ATTR_CB_TYPE_WRITE, /* Write Attribute */
+ ZCL_ATTR_CB_TYPE_DEFAULT, /* Write Default Value */
+ ZCL_ATTR_CB_TYPE_NOTIFY /* Write Notification */
+};
+
+/* Attribute Callback Information */
+struct ZbZclAttrCbInfoT {
+ const struct ZbZclAttrT *info; /* The original info used to create the attribute */
+ enum ZbZclAttrCbTypeT type;
+ uint8_t *zcl_data; /* Source of attribute data if ZCL_ATTR_CB_TYPE_WRITE. Destination of attribute data if ZCL_ATTR_CB_TYPE_READ. */
+ unsigned int zcl_len; /* Maximum length of 'zcl_data' */
+
+ /* The following are only used if type == ZCL_ATTR_CB_TYPE_WRITE */
+ ZclWriteModeT write_mode;
+ void *attr_data; /* Location to write the new attribute value. */
+ struct ZbApsAddrT *src; /* Source of the command, if not locally generated. May be NULL. */
+
+ /* Application's defined callback argument */
+ void *app_cb_arg;
+};
+
+/*---------------------------------------------------------------
+ * Alarm Reset Handler
+ *---------------------------------------------------------------
+ */
+typedef void (*ZbZclAlarmResetFuncT)(struct ZbZclClusterT *clusterPtr, uint8_t alarm_code,
+ uint16_t cluster_id, ZbApsdeDataIndT *data_ind, struct ZbZclHeaderT *hdr);
+
+enum ZclStatusCodeT ZbZclClusterRegisterAlarmResetHandler(struct ZbZclClusterT *clusterPtr, ZbZclAlarmResetFuncT callback);
+
+/*---------------------------------------------------------------
+ * Cluster Base Type
+ *---------------------------------------------------------------
+ */
+/* This structure describes a ZCL cluster */
+struct ZbZclClusterT {
+ struct LinkListT link; /* Optional linking for application use. */
+ struct ZigBeeT *zb; /* ZigBee stack reference. */
+
+ /*-------------------------------------------
+ * Cluster Basics
+ *-------------------------------------------
+ */
+ enum ZbZclClusterIdT clusterId;
+ uint8_t endpoint;
+ uint16_t mfrCode;
+ /* minSecurity is one of: ZB_APS_STATUS_UNSECURED, ZB_APS_STATUS_SECURED_NWK_KEY or ZB_APS_STATUS_SECURED_LINK_KEY */
+ enum ZbStatusCodeT minSecurity;
+ uint16_t profileId;
+ uint16_t txOptions; /* e.g. ZB_APSDE_DATAREQ_TXOPTIONS_ACK */
+ bool discoverRoute;
+ uint8_t radius;
+ uint16_t maxAsduLength; /* with fragmentation, if enabled in txOptions. */
+ /* Direction of incoming commands. I.e. the type of cluster this is
+ * (client or server). */
+ enum ZbZclDirectionT direction;
+
+ /*-------------------------------------------
+ * Filters, Lists, Timers
+ *-------------------------------------------
+ */
+ struct ZbApsFilterT filter;
+ struct ZbApsFilterT alarm_reset_filter;
+ ZbZclAlarmResetFuncT alarm_reset_callback;
+ struct LinkListT attributeList;
+ struct LinkListT reports;
+ struct ZbTimerT *persist_timer;
+
+ /*-------------------------------------------
+ * Callbacks
+ *-------------------------------------------
+ */
+ /* The application argument passed through the various callbacks
+ * to the application (e.g. custom attribute read/write). */
+ void *app_cb_arg;
+
+ /* Return value is a ZCL_STATUS_ code. If not ZCL_STATUS_SUCCESS, a default
+ * response with the status code is sent to the originator of the command. */
+ enum ZclStatusCodeT (*command)(struct ZbZclClusterT *clusterPtr, struct ZbZclHeaderT *zclHdrPtr,
+ ZbApsdeDataIndT *dataIndPtr);
+
+ /* Configure reporting */
+ void (*config)(struct ZbZclClusterT *clusterPtr, ZbApsdeDataIndT *dataIndPtr, uint16_t attributeId,
+ enum ZclStatusCodeT status, uint8_t direction);
+
+ void (*report)(struct ZbZclClusterT *clusterPtr, ZbApsdeDataIndT *dataIndPtr, uint16_t attributeId,
+ enum ZclDataTypeT dataType, const uint8_t *in_payload, uint16_t in_len);
+
+ /* ZCL Internal Callback for the Scenes Cluster to Get a cluster's attribute
+ * extension set.
+ * extBuf has the format: [cluster (2 octets) | length (1 octet) | attribute data (N octets)]
+ *
+ * Returns length written to extBuf. */
+ uint8_t (*get_scene_data)(struct ZbZclClusterT *clusterPtr, uint8_t *extBuf, uint8_t extMaxLen);
+
+ /* ZCL Internal Callback for the Scenes Cluster to Set a cluster's attribute
+ * extension set.#define ZCL_BUILD_ADD_UINT8(_payload_, _max_len_, _index_, _arg_) \
+ do { \
+ if (((_index_) + sizeof(uint8_t)) > (_max_len_)) { \
+ return -1; \
+ } \
+ if (_payload_) { \
+ (_payload_)[_index_] = _arg_; \
+ } \
+ _index_ += sizeof(uint8_t); \
+ * extData has the format: [attribute data (N octets)]
+ * extLen is the length of extData
+ * transition_tenths ; transition time in tenths of a second.
+ *
+ * Returns ZCL status code (enum ZclStatusCodeT) */
+ enum ZclStatusCodeT (*set_scene_data)(struct ZbZclClusterT *clusterPtr, uint8_t *extData, uint8_t extLen, uint16_t transition_tenths);
+
+ /* cleanup() is called to free any cluster-specific data.
+ * ZbZclClusterFree will already free any attributes and APS filter. */
+ void (*cleanup)(struct ZbZclClusterT *clusterPtr);
+};
+
+/*---------------------------------------------------------------
+ * Cluster Initialization
+ *---------------------------------------------------------------
+ */
+/* Helper to create a ZCL endpoint. Calls ZbApsmeAddEndpoint to create the endpoint. Sets up a
+ * filter to catch any ZCL commands for a cluster that doesn't exist on the endpoint, and
+ * returns ZCL_STATUS_UNSUPPORTED_CLUSTER. Sets up filter bindings for the Basic Server
+ * cluster (global stack clusters) and register's their cluster IDs with the endpoint
+ * (e.g. for ZDO Match_Desc_req) */
+void ZbZclAddEndpoint(struct ZigBeeT *zb, ZbApsmeAddEndpointReqT *addReqPtr, ZbApsmeAddEndpointConfT *addConfPtr);
+/* ZbZclAddEndpointNoBasic is the same as ZbZclAddEndpoint, except it does not allocate
+ * a Basic Server cluster for the endpoint. */
+void ZbZclAddEndpointNoBasic(struct ZigBeeT *zb, ZbApsmeAddEndpointReqT *addReqPtr, ZbApsmeAddEndpointConfT *addConfPtr);
+
+/* Helper to remove a ZCL endpoint created by ZbZclAddEndpoint.
+ * Calls ZbApsmeRemoveEndpoint and removes the ZCL filters created by ZbZclAddEndpoint. */
+void ZbZclRemoveEndpoint(struct ZigBeeT *zb, ZbApsmeRemoveEndpointReqT *req, ZbApsmeRemoveEndpointConfT *conf);
+
+/* Allocate and initialize a new cluster */
+void * ZbZclClusterAlloc(struct ZigBeeT *zb, unsigned int alloc_sz, enum ZbZclClusterIdT cluster_id,
+ uint8_t endpoint, enum ZbZclDirectionT direction);
+/* Attach the cluster to the stack (after callbacks have been configured) */
+void ZbZclClusterAttach(struct ZbZclClusterT *clusterPtr);
+/* Free and detach the cluster */
+void ZbZclClusterFree(struct ZbZclClusterT *clusterPtr);
+
+/* Register this cluster's ID on the endpoint if not already listed. */
+bool ZbZclClusterEndpointRegister(struct ZbZclClusterT *clusterPtr);
+bool ZbZclClusterEndpointRemove(struct ZbZclClusterT *clusterPtr);
+
+/*---------------------------------------------------------------
+ * Building and Parsing Frames
+ *---------------------------------------------------------------
+ */
+/* Parses a ZCL Header from a received frame.
+ * Returns Length of the ZCL header, or negative value (-1) on error. */
+int ZbZclParseHeader(struct ZbZclHeaderT *zclHdrPtr, const uint8_t *buf, unsigned int len);
+
+/* Builds and appends a ZCL Header to the start of a buffer.
+ * Returns length of data written, or negative value (-1) on error. */
+int ZbZclPrependHeader(struct ZbZclHeaderT *zclHdrPtr, uint8_t *data, unsigned int len);
+
+/* Builds and appends a ZCL Header to the end of a buffer.
+ * Returns Length of data written, or negative value (-1) on error. */
+int ZbZclAppendHeader(struct ZbZclHeaderT *zclHdrPtr, uint8_t *data, unsigned int max_len);
+
+/* Appends a Reporting configuration record to the end of the provided buffer.
+ * Returns Length of data written, or negative value (-1) on error. */
+int ZbZclAppendReportConfig(struct ZbZclReportConfigT *configPtr, uint8_t *payload, unsigned int max_len);
+
+/*---------------------------------------------------------------
+ * Generic Attribute Functions
+ *---------------------------------------------------------------
+ */
+int ZbZclAttrParseLength(enum ZclDataTypeT type, const uint8_t *ptr, unsigned int max_len, uint8_t recurs_depth);
+
+bool ZbZclAttrIsAnalog(enum ZclDataTypeT dataType);
+bool ZbZclAttrIsInteger(enum ZclDataTypeT dataType);
+
+int ZbZclAppendInteger(unsigned long long value, enum ZclDataTypeT dataType, uint8_t *data, unsigned int len);
+long long ZbZclParseInteger(enum ZclDataTypeT dataType, const uint8_t *data, enum ZclStatusCodeT *statusPtr);
+
+int ZbZclAppendFloat(double value, enum ZclDataTypeT dataType, uint8_t *data, unsigned int len);
+double ZbZclParseFloat(enum ZclDataTypeT dataType, const uint8_t *data);
+
+/*---------------------------------------------------------------
+ * Local Reading and Writing of Attributes
+ *---------------------------------------------------------------
+ */
+
+/*FUNCTION
+ * ZbZclAttrRead
+ *PARAMETERS
+ * clusterPtr ; IN: Cluster Structure Pointer
+ * attrId ; IN: Cluster's Attribute ID
+ * attrType ; OUT (optional): Attribute Data Type
+ * outputBuf ; OUT: Attribute data in ZCL format (i.e. same as what is sent over-the-air)
+ * max_len ; IN: Maximum length that can be written to outputBuf.
+ * isReporting ; IN: This read is from ZCL reporting. If the attribute does not support reporting, the read request will fail.
+ */
+enum ZclStatusCodeT ZbZclAttrRead(struct ZbZclClusterT *clusterPtr, uint16_t attrId, enum ZclDataTypeT *attrType,
+ void *outputBuf, unsigned int max_len, bool isReporting);
+
+/*FUNCTION
+ * ZbZclAttrWrite
+ *PARAMETERS
+ * clusterPtr ; IN: Cluster Structure Pointer
+ * src ; IN: Source address of this command. May be NULL if generated locally.
+ * attr_id ; IN: Cluster's Attribute ID
+ * attr_data ; IN: Attribute data in ZCL format (i.e. same as what is sent over-the-air)
+ * max_len ; IN: Length of attribute data
+ * mode ; IN: Write mode
+ */
+enum ZclStatusCodeT ZbZclAttrWrite(struct ZbZclClusterT *clusterPtr, struct ZbApsAddrT *src, uint16_t attr_id,
+ const uint8_t *attr_data, unsigned int max_len, ZclWriteModeT mode);
+
+/* Integer Attribute Helpers */
+long long ZbZclAttrIntegerRead(struct ZbZclClusterT *clusterPtr, uint16_t attributeId, enum ZclDataTypeT *typePtr, enum ZclStatusCodeT *statusPtr);
+enum ZclStatusCodeT ZbZclAttrIntegerWrite(struct ZbZclClusterT *clusterPtr, uint16_t attributeId, long long value);
+enum ZclStatusCodeT ZbZclAttrIntegerIncrement(struct ZbZclClusterT *clusterPtr, uint16_t attributeId, long long value);
+
+uint64_t ZbZclAttrEuiRead(struct ZbZclClusterT *clusterPtr, uint16_t attributeId, enum ZclStatusCodeT *statusPtr);
+enum ZclStatusCodeT ZbZclAttrEuiWrite(struct ZbZclClusterT *clusterPtr, uint16_t attributeId, uint64_t eui);
+
+/* String Attribute Helpers */
+enum ZclStatusCodeT ZbZclAttrStringWrite(struct ZbZclClusterT *clusterPtr, uint16_t attributeId, const char *strPtr);
+
+/*---------------------------------------------------------------
+ * Request Remote reporting of attribute changes.
+ *---------------------------------------------------------------
+ */
+typedef struct {
+ struct ZbApsAddrT dst;
+ uint16_t min;
+ uint16_t max;
+ uint16_t attribute;
+ uint8_t attr_type;
+} ZbZclAttrReportT;
+
+/*---------------------------------------------------------------
+ * Remote Reading and Writing of Attributes
+ *---------------------------------------------------------------
+ */
+/* The maximum number of attributes we support reading/writing through the API at once.
+ * This is not the maximum that we support from requests arriving from the network.
+ * Those depend on maximum ASDU limits and other resources. */
+#define ZCL_ATTRIBUTE_LIST_MAX_SZ 8U
+
+typedef struct {
+ struct ZbApsAddrT dst;
+ unsigned int count;
+ uint16_t attr[ZCL_ATTRIBUTE_LIST_MAX_SZ];
+} ZbZclReadReqT;
+
+typedef struct {
+ enum ZclStatusCodeT status;
+ uint16_t attrId;
+ enum ZclDataTypeT type;
+ const uint8_t *value; /* Value as-is over-the-air (strings include the length octet(s)) */
+ unsigned int length;
+} ZbZclReadRspDataT;
+
+typedef struct {
+ enum ZclStatusCodeT status;
+ struct ZbApsAddrT src;
+ uint16_t profileId;
+ uint8_t linkQuality;
+ unsigned int count;
+ ZbZclReadRspDataT attr[ZCL_ATTRIBUTE_LIST_MAX_SZ];
+} ZbZclReadRspT;
+
+/* ZbZclReadWait
+ * zb ;
+ * req ; request struct
+ * rsp ; response struct
+ * buf ; buffer to hold the response attribute data. Allocated by caller.
+ * sz ; maximum length of 'buf' */
+void ZbZclReadWait(struct ZbZclClusterT *clusterPtr, ZbZclReadReqT *req, ZbZclReadRspT *rsp, void *buf, unsigned int sz);
+
+void ZbZclReadReq(struct ZbZclClusterT *clusterPtr, ZbZclReadReqT *req, void (*callback)(const ZbZclReadRspT *readRsp, void *cb_arg), void *arg);
+
+typedef struct {
+ /* TODO: implement a selector for structured version. */
+ uint16_t attrId;
+ enum ZclDataTypeT type;
+ const uint8_t *value; /* in zigbee format (integers are little endian) */
+ unsigned int length;
+} ZbZclWriteReqDataT;
+
+typedef struct {
+ enum ZclStatusCodeT status;
+ uint16_t attrId;
+} ZbZclWriteRspDataT;
+
+typedef struct {
+ struct ZbApsAddrT dst;
+ unsigned int count;
+ ZbZclWriteReqDataT attr[ZCL_ATTRIBUTE_LIST_MAX_SZ];
+} ZbZclWriteReqT;
+
+typedef struct {
+ enum ZclStatusCodeT status;
+ struct ZbApsAddrT src;
+ uint16_t profileId;
+ uint8_t linkQuality;
+ unsigned int count;
+ ZbZclWriteRspDataT attr[ZCL_ATTRIBUTE_LIST_MAX_SZ];
+} ZbZclWriteRspT;
+
+void ZbZclWriteWait(struct ZbZclClusterT *clusterPtr, ZbZclWriteReqT *req, ZbZclWriteRspT *rsp);
+
+void ZbZclWriteReq(struct ZbZclClusterT *clusterPtr, ZbZclWriteReqT *req, void (*callback)(const ZbZclWriteRspT *writeResp, void *cb_arg), void *arg);
+
+/*---------------------------------------------------------------
+ * Attribute Discovery
+ *---------------------------------------------------------------
+ */
+typedef struct {
+ struct ZbApsAddrT dst;
+ uint16_t startAttr;
+ uint8_t max;
+} ZbZclDiscoverAttrReqT;
+
+typedef struct {
+ uint16_t attrId;
+ enum ZclDataTypeT type;
+} ZbZclDiscoverAttrRspDataT;
+
+typedef struct {
+ enum ZclStatusCodeT status;
+ struct ZbApsAddrT src;
+ uint8_t discComplete;
+ ZbZclDiscoverAttrRspDataT attrInfo[ZCL_ATTRIBUTE_LIST_MAX_SZ];
+ uint8_t numAttr;
+} ZbZclDiscoverAttrRspT;
+
+void ZbZclDiscoverAttrReq(struct ZbZclClusterT *clusterPtr, ZbZclDiscoverAttrReqT *req,
+ void (*callback)(const ZbZclDiscoverAttrRspT *discRsp, void *cb_arg), void *arg);
+
+void ZbZclDiscoverAttrWait(struct ZbZclClusterT *clusterPtr, ZbZclDiscoverAttrReqT *req, ZbZclDiscoverAttrRspT *rsp);
+
+/*---------------------------------------------------------------
+ * Attribute Persistence
+ *---------------------------------------------------------------
+ */
+/* If an attribute is modified outside of the normal ZCL Write
+ * mechanism, the application must call this function to inform
+ * the stack to persist the new attribute data. */
+bool ZbZclAttrPersist(struct ZbZclClusterT *clusterPtr, uint16_t attr_id);
+
+/*---------------------------------------------------------------
+ * Cluster Commands
+ *---------------------------------------------------------------
+ */
+typedef struct {
+ /* From APSDE-DATA.request */
+ struct ZbApsAddrT dst;
+ uint16_t profileId;
+ enum ZbZclClusterIdT clusterId;
+ uint16_t srcEndpt;
+ uint16_t txOptions; /* e.g. ZB_APSDE_DATAREQ_TXOPTIONS_ACK */
+ bool discoverRoute;
+ uint8_t radius;
+ /* ZCL command */
+ struct ZbZclHeaderT hdr;
+ /* if (txOptions & ZB_APSDE_DATAREQ_TXOPTIONS_VECTOR), then payload is
+ * a pointer to list of ZbApsBufT, and length is the number of ZbApsBufT
+ * items in the list. */
+ const void *payload;
+ unsigned int length;
+} ZbZclCommandReqT;
+
+/* ZCL Command Response
+ *
+ * Special case if src.mode == ZB_APSDE_ADDRMODE_NOTPRESENT (0), then
+ * - response generated internally.
+ * - src.endpoint = local endpoint that generated request
+ * - hdr.seqNum = request sequence number
+ * - hdr.cmdId = request command id
+ */
+struct ZbZclCommandRspT {
+ enum ZclStatusCodeT status;
+ struct ZbApsAddrT src;
+ uint16_t profileId;
+ enum ZbZclClusterIdT clusterId;
+ uint8_t linkQuality;
+ struct ZbZclHeaderT hdr;
+ const uint8_t *payload;
+ uint16_t length;
+};
+
+/*---------------------------------------------------------------
+ * Attribute Reporting
+ *---------------------------------------------------------------
+ */
+void ZbZclAttrReportConfigReq(struct ZbZclClusterT *clusterPtr, ZbZclAttrReportT *rp,
+ void (*callback)(struct ZbZclCommandRspT *cmd_rsp, void *arg), void *arg);
+
+/* Send a ZCL command. The callback function is called when the
+ * associated ZCL response is received, or there's an error. */
+void ZbZclCommandReq(struct ZigBeeT *zb, ZbZclCommandReqT *zclReq,
+ void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);
+
+/* Blocking version of ZbZclCommandReq */
+/* Response Info (rsp) may be NULL. If not NULL, make sure to provide a valid buffer pointer
+ * to rsp->payload and specify the maximum length to rsp->length. */
+void ZbZclCommandWait(struct ZigBeeT *zb, ZbZclCommandReqT *req, struct ZbZclCommandRspT *rsp);
+
+/* A version of ZbZclCommandReq that expects to receive multiple
+ * responses to a single request.
+ *
+ * timeout is in milliseconds to wait for all responses.
+ * If 0, a default timeout is used. */
+void ZbZclCommandMulti(struct ZigBeeT *zb, ZbZclCommandReqT *zclReq, unsigned int timeout,
+ void (*callback)(struct ZbZclCommandRspT *rspPtr, void *arg), void *arg);
+
+/* A version of ZbZclCommandReq that doesn't wait for a response. */
+void ZbZclCommandNoResp(struct ZigBeeT *zb, ZbZclCommandReqT *req,
+ void (*callback)(ZbApsdeDataConfT *confPtr, void *arg), void *arg);
+
+/*---------------------------------------------------------------
+ * Cluster Request helpers
+ *---------------------------------------------------------------
+ */
+struct ZbZclClusterCommandReqT {
+ /* Destination for command */
+ struct ZbApsAddrT dst;
+ /* Command ID */
+ uint8_t cmdId;
+ /* If noDefaultResp is TRUE, disables a Default Response on status = SUCCESS. */
+ enum ZbZclNoDefaultResponseT noDefaultResp;
+ /* ZCL Request Command Payload */
+ uint8_t *payload;
+ unsigned int length;
+};
+
+/* ZbZclClusterCommandReq and ZbZclClusterCommandWait are wrappers to ZbZclCommandReq. */
+/* clusterPtr = The cluster that is originating this message. Information from the cluster is used when
+ * sending the command (source addressing, APS TX Options).
+ * "callback" may be NULL */
+void ZbZclClusterCommandReq(struct ZbZclClusterT *clusterPtr, struct ZbZclClusterCommandReqT *req,
+ void (*callback)(struct ZbZclCommandRspT *zcl_rsp, void *arg), void *arg);
+
+/* Blocking version of ZbZclClusterCommandReq */
+/* Response Info (rsp) may be NULL. If not NULL, make sure to provide a valid buffer pointer
+ * to rsp->payload and specify the maximum length to rsp->length. */
+enum ZclStatusCodeT ZbZclClusterCommandWait(struct ZbZclClusterT *clusterPtr, struct ZbZclClusterCommandReqT *req,
+ struct ZbZclCommandRspT *zcl_rsp);
+
+/*---------------------------------------------------------------
+ * Cluster Response helpers
+ *---------------------------------------------------------------
+ */
+/* ZbZclClusterCommandRsp sends a cluster-specific response to the destination provided.
+ * There is no checking if the originating request was sent to broadcast, etc. That
+ * checking must be done by the caller before this function is called.
+ *
+ * Returns ZCL_STATUS_SUCCESS if the message was queued to the stack, or an error status
+ * otherwise. */
+enum ZclStatusCodeT ZbZclClusterCommandRsp(struct ZbZclClusterT *clusterPtr, struct ZbZclAddrInfoT *dstInfo,
+ uint8_t cmdId, ZbApsBufT *payloads, uint8_t numPayloads);
+
+enum ZclStatusCodeT ZbZclClusterCommandRspWithCb(struct ZbZclClusterT *clusterPtr, struct ZbZclAddrInfoT *dstInfo,
+ uint8_t cmdId, ZbApsBufT *payloads, uint8_t numPayloads, void (*callback)(ZbApsdeDataConfT *conf, void *arg), void *arg);
+
+/* ZbZclSendClusterStatusResponse is a wrapper to ZbZclClusterCommandRsp. The parameters zclPayload and zclPaylen must
+ * be populated and the first byte must represent a status code of some sort with success == 0x00. If the request was
+ * broadcast (address or endpoint) and status != 0x00, then the response will not be sent. */
+enum ZclStatusCodeT ZbZclSendClusterStatusResponse(struct ZbZclClusterT *clusterPtr,
+ ZbApsdeDataIndT *dataIndPtr, struct ZbZclHeaderT *zclHdrPtr, uint8_t cmdId,
+ uint8_t *zclPayload, uint8_t zclPaylen);
+
+/* Send a Default Response. */
+void ZbZclSendDefaultResponse(struct ZbZclClusterT *clusterPtr, ZbApsdeDataIndT *dataIndPtr,
+ struct ZbZclHeaderT *zclHdrPtr, enum ZclStatusCodeT status);
+
+/*---------------------------------------------------------------
+ * Bind a cluster so it can receive messages directly from the APS layer
+ *---------------------------------------------------------------
+ */
+/* Binds the cluster structure to a particular endpoint and optional remote
+ * address, and sets up a packet filter to handle the command reception. */
+enum ZclStatusCodeT ZbZclClusterBind(struct ZbZclClusterT *clusterPtr, uint8_t endpoint,
+ uint16_t profileId, enum ZbZclDirectionT direction);
+void ZbZclClusterUnbind(struct ZbZclClusterT *clusterPtr);
+
+/*---------------------------------------------------------------
+ * Device Log (whitelist)
+ *---------------------------------------------------------------
+ */
+/* Since the Trust Center address is not known ahead of time, joiners using CBKE will automatically
+ * add the Trust Center to the Device Log, so they can perform CBKE if Device Log is enabled.
+ * The TC is removed if CBKE fails. */
+void ZbZclDeviceLogEnable(struct ZigBeeT *zb, bool enable);
+bool ZbZclDeviceLogAdd(struct ZigBeeT *zb, uint64_t ext_addr);
+bool ZbZclDeviceLogRemove(struct ZigBeeT *zb, uint64_t ext_addr);
+void ZbZclDeviceLogClear(struct ZigBeeT *zb);
+
+/*---------------------------------------------------------------
+ * Helper Functions
+ *---------------------------------------------------------------
+ */
+/* Get the next ZCL sequence number to use in a request/notify message. */
+uint8_t ZbZclGetNextSeqnum(void);
+
+/* Tell all of this cluster's attributes to revert to default values */
+void ZbZclClusterAttrWriteDefaults(struct ZbZclClusterT *clusterPtr, bool force);
+
+/* Helper functions to SET cluster parameters */
+void ZbZclClusterSetCallbackArg(struct ZbZclClusterT *clusterPtr, void *app_cb_arg);
+void ZbZclClusterSetMfrCode(struct ZbZclClusterT *clusterPtr, uint16_t mfrCode);
+void ZbZclClusterSetProfileId(struct ZbZclClusterT *clusterPtr, uint16_t profileId);
+/* Sets the minimum security level for incoming frames, and also adjusts
+ * the tx options to match (assuming symmetrical security).
+ * minSecurity can be one of: ZB_APS_STATUS_UNSECURED, ZB_APS_STATUS_SECURED_NWK_KEY or ZB_APS_STATUS_SECURED_LINK_KEY */
+bool ZbZclClusterSetMinSecurity(struct ZbZclClusterT *clusterPtr, enum ZbStatusCodeT minSecurity);
+void ZbZclClusterSetTxOptions(struct ZbZclClusterT *clusterPtr, uint16_t txOptions);
+void ZbZclClusterSetDiscoverRoute(struct ZbZclClusterT *clusterPtr, bool discoverRoute);
+void ZbZclClusterSetRadius(struct ZbZclClusterT *clusterPtr, uint8_t radius);
+/* Set the maximum ASDU length for the cluster. The ASDU length includes
+ * fragmentation, if enabled in the cluster's tx options. */
+bool ZbZclClusterSetMaxAsduLength(struct ZbZclClusterT *clusterPtr, uint16_t maxAsduLength);
+
+/* Helper functions to initialize requests based on cluster parameters */
+void ZbZclClusterInitCommandReq(struct ZbZclClusterT *clusterPtr, ZbZclCommandReqT *cmdReq);
+void ZbZclClusterInitApsdeReq(struct ZbZclClusterT *clusterPtr, ZbApsdeDataReqT *apsReq, ZbApsdeDataIndT *dataIndPtr);
+
+/* Helper functions to GET cluster parameters */
+uint8_t ZbZclClusterGetEndpoint(struct ZbZclClusterT *clusterPtr);
+enum ZbZclClusterIdT ZbZclClusterGetClusterId(struct ZbZclClusterT *clusterPtr);
+uint16_t ZbZclClusterGetProfileId(struct ZbZclClusterT *clusterPtr);
+uint16_t ZbZclClusterGetTxOptions(struct ZbZclClusterT *clusterPtr);
+enum ZbZclDirectionT ZbZclClusterGetDirection(struct ZbZclClusterT *clusterPtr);
+const char * ZbZclClusterGetDirectionStr(struct ZbZclClusterT *clusterPtr);
+uint8_t ZbZclClusterGetRadius(struct ZbZclClusterT *clusterPtr);
+unsigned int ZbZclClusterGetMaxAsduLength(struct ZbZclClusterT *clusterPtr);
+
+void ZbZclClusterReportCallbackAttach(struct ZbZclClusterT *clusterPtr,
+ void (*callback)(struct ZbZclClusterT *clusterPtr, ZbApsdeDataIndT *dataIndPtr,
+ uint16_t attr_id, enum ZclDataTypeT data_type, const uint8_t *in_payload, uint16_t in_len));
+
+/* Send an alarm from a cluster as if it originated from the alarms cluster
+ * on the same endpoint. Typically, src_endpoint = ZbZclClusterGetEndpoint(clusterPtr).
+ * If the cluster appears on multiple endpoints (e.g. Basic Cluster), the src_endpoint
+ * is required to know which one to actually send the Alarm Command from.
+ * The alarm message is sent via APS binding(s). */
+void ZbZclClusterSendAlarm(struct ZbZclClusterT *clusterPtr, uint8_t src_endpoint, uint8_t alarm_code);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* ZCL_H */
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zcl/zcl.identify.h b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zcl/zcl.identify.h
new file mode 100644
index 000000000..3f6af4a51
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zcl/zcl.identify.h
@@ -0,0 +1,93 @@
+/* Copyright [2009 - 2019] Exegin Technologies Limited. All rights reserved. */
+
+#ifndef ZCL_CORE_IDENTIFY_H
+# define ZCL_CORE_IDENTIFY_H
+
+/*--------------------------------------------------------------------------
+ * DESCRIPTION
+ * Interface definition for the ZCL Identify cluster.
+ *--------------------------------------------------------------------------
+ */
+
+/* PICS.ZCL.Identify Cluster (0x0003)
+ *
+ * Server PICS
+ * I.S | True
+ * I.C | True
+ *
+ * Server Attributes
+ * I.S.A0000 | True
+ * I.S.Afffd | True
+ *
+ * Commands Received
+ * I.S.C00.Rsp | True
+ * I.S.C01.Rsp | True
+ * I.S.C40.Rsp | False
+ *
+ * Commands Generated
+ * I.S.C00.Tx | True
+ *
+ * Client Attributes
+ * I.C.Afffd | True
+ *
+ * Commands Received
+ * I.C.C00.Rsp | True
+ *
+ * Commands Generated
+ * I.C.C00.Tx | True
+ * I.C.C01.Tx | True
+ * I.C.C40.Tx | False
+ */
+
+#include "zcl/zcl.h"
+
+/* Identify Cluster Attribute Identifiers */
+enum ZbZclIdentifyServerAttrT {
+ ZCL_IDENTIFY_ATTR_TIME = 0x0000 /* ZCL_DATATYPE_UNSIGNED_16BIT */
+};
+
+/* Identify Cluster Command Identifiers */
+enum ZbZclIdentifyClientCommandT {
+ ZCL_IDENTIFY_COMMAND_IDENTIFY = 0x00,
+ ZCL_IDENTIFY_COMMAND_QUERY = 0x01
+};
+
+enum ZbZclIdentifyServerCommandT {
+ ZCL_IDENTIFY_COMMAND_QUERY_RESP = 0x00
+};
+
+/* Parameters to the identify callback. */
+enum ZbZclIdentifyServerStateT {
+ ZCL_IDENTIFY_START = 0,
+ ZCL_IDENTIFY_STOP
+};
+
+/* Create the Identify Server Cluster.
+ * 'arg' gets assigned to ZbZclClusterSetCallbackArg. */
+struct ZbZclClusterT * ZbZclIdentifyServerAlloc(struct ZigBeeT *zb, uint8_t endpoint, void *arg);
+struct ZbZclClusterT * ZbZclIdentifyClientAlloc(struct ZigBeeT *zb, uint8_t endpoint, void *arg);
+
+/* Configure a callback to receive events to "start" or "stop" identifying. */
+typedef void (*ZbZclIdentifyCallbackT)(struct ZbZclClusterT *clusterPtr,
+ enum ZbZclIdentifyServerStateT state, void *arg);
+
+void ZbZclIdentifyServerSetCallback(struct ZbZclClusterT *clusterPtr,
+ ZbZclIdentifyCallbackT callback);
+
+/* Set the local identify server time. Same as writing to the
+ * ZCL_IDENTIFY_ATTR_TIME attribute.
+ *
+ * If BDB_COMMISSION_MODE_FIND_BIND is enabled and seconds > 0, seconds
+ * is adjusted to be >= ZB_BDBC_MinCommissioningTime. */
+void ZbZclIdentifyServerSetTime(struct ZbZclClusterT *clusterPtr, uint16_t seconds);
+
+/* Get the local identify server time. */
+uint16_t ZbZclIdentifyServerGetTime(struct ZbZclClusterT *clusterPtr);
+
+/* Client commands */
+uint8_t zcl_identify_identify_request(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
+ uint16_t identify_time, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);
+uint8_t zcl_identify_query_request(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
+ void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);
+
+#endif /* __ZCL_IDENTIFY_H */
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zcl/zcl.onoff.h b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zcl/zcl.onoff.h
new file mode 100644
index 000000000..13ffcbfb6
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zcl/zcl.onoff.h
@@ -0,0 +1,108 @@
+/* Copyright [2009 - 2019] Exegin Technologies Limited. All rights reserved. */
+
+#ifndef ZCL_ONOFF_H
+# define ZCL_ONOFF_H
+
+/*--------------------------------------------------------------------------
+ * DESCRIPTION
+ * Interface definition for the ZCL OnOff cluster.
+ *--------------------------------------------------------------------------
+ */
+
+/* PICS.ZCL.OnOff
+ *
+ * OO.S | True
+ * OO.C | True
+ *
+ * OO.S.A0000 | True
+ * OO.S.A0000.Scene | True
+ * OO.S.A0000.Report.Tx | True
+ *
+ * OO.S.A4000 | False
+ * OO.S.A4001 | False
+ * OO.S.A4002 | False
+ * OO.S.A4003 | False
+ *
+ * OO.S.Afffd | True
+ *
+ * OO.S.C00.Rsp | True
+ * OO.S.C01.Rsp | True
+ * OO.S.C02.Rsp | True
+ *
+ * OO.S.C40.Rsp | False
+ * OO.S.C41.Rsp | False
+ * OO.S.C42.Rsp | False
+ *
+ *
+ * OO.C.A0000.Report.Rsp | False (https://exegin.atlassian.net/browse/ZSDK-2624)
+ *
+ * OO.C.Afffd | True
+ *
+ * OO.C.C00.Tx | True
+ * OO.C.C01.Tx | True
+ * OO.C.C02.Tx | True
+ *
+ * OO.C.C40.Tx | False
+ * OO.C.C41.Tx | False
+ * OO.C.C42.Tx | False
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "zcl/zcl.h"
+
+/* Attribute Identifiers */
+enum {
+ ZCL_ONOFF_ATTR_ONOFF = 0x0000,
+ ZCL_ONOFF_ATTR_GLOBAL_SCENE_CONTROL = 0x4000,
+ ZCL_ONOFF_ATTR_ON_TIME, /* 0x4001 */
+ ZCL_ONOFF_OFF_WAIT_TIME, /* 0x4002 */
+};
+
+/* Commands */
+enum {
+ ZCL_ONOFF_COMMAND_OFF = 0x00,
+ ZCL_ONOFF_COMMAND_ON = 0x01,
+ ZCL_ONOFF_COMMAND_TOGGLE = 0x02,
+};
+
+/*---------------------------------------------------------------
+ * OnOff Server Cluster
+ *---------------------------------------------------------------
+ */
+struct ZbZclClusterT * ZbZclOnOffServerAlloc(struct ZigBeeT *zb, uint8_t endpoint, void *arg);
+
+/* Allow the Level Control Cluster to be notified of OnOff commands */
+typedef void (*ZbZclLevelControlCallbackT)(struct ZbZclClusterT *level_cluster, uint8_t on_off_command);
+void ZbZclOnOffServerSetLevelControlCallback(struct ZbZclClusterT *on_off_cluster,
+ struct ZbZclClusterT *level_cluster, ZbZclLevelControlCallbackT levelControlCallback);
+
+/*---------------------------------------------------------------
+ * OnOff Client Cluster
+ *---------------------------------------------------------------
+ */
+struct ZbZclClusterT * ZbZclOnOffClientAlloc(struct ZigBeeT *zb, uint8_t endpoint);
+
+/* Client Cluster Commands */
+uint8_t ZbZclOnOffClientOnReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
+ void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);
+/* Blocking version. Not supported on all platforms. */
+uint8_t ZbZclOnOffClientOnWait(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst);
+
+uint8_t ZbZclOnOffClientOffReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
+ void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);
+/* Blocking version. Not supported on all platforms. */
+uint8_t ZbZclOnOffClientOffWait(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst);
+
+uint8_t ZbZclOnOffClientToggleReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
+ void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);
+/* Blocking version. Not supported on all platforms. */
+uint8_t ZbZclOnOffClientToggleWait(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* __ZCL_ONOFF_H */
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zcl/zcl.touchlink.h b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zcl/zcl.touchlink.h
new file mode 100644
index 000000000..6d97b057f
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zcl/zcl.touchlink.h
@@ -0,0 +1,125 @@
+/* Copyright [2009 - 2019] Exegin Technologies Limited. All rights reserved. */
+
+/*--------------------------------------------------------------------------
+ * DESCRIPTION
+ * Interface definition for the ZCL Touchlink cluster.
+ *--------------------------------------------------------------------------
+ */
+/* PICS.ZCL.Touchlink
+ * TC.S | True
+ * TC.C | True
+ *
+ * Server Attributes
+ * TC.S.Afffd | True
+ *
+ * Commands Received
+ * TC.S.C00.Rsp | True
+ * TC.S.C02.Rsp | True
+ * TC.S.C06.Rsp | True
+ * TC.S.C07.Rsp | True
+ * TC.S.C10.Rsp | True
+ * TC.S.C12.Rsp | True
+ * TC.S.C14.Rsp | True
+ * TC.S.C16.Rsp | True
+ * TC.S.C41.Rsp | False
+ * TC.S.C42.Rsp | False
+ *
+ * Commands Generated
+ * TC.S.C01.Tx | True
+ * TC.S.C03.Tx | True
+ * TC.S.C11.Tx | True
+ * TC.S.C13.Tx | True
+ * TC.S.C15.Tx | True
+ * TC.S.C40.Tx | False
+ * TC.S.C41.Tx | False
+ * TC.S.C42.Tx | False
+ *
+ *
+ * Client Attributes
+ * TC.C.Afffd | True
+ *
+ * Commands Received
+ * TC.C.C01.Rsp | True
+ * TC.C.C03.Rsp | True
+ * TC.C.C11.Rsp | True
+ * TC.C.C13.Rsp | True
+ * TC.C.C15.Rsp | True
+ * TC.C.C40.Rsp | False
+ * TC.C.C41.Rsp | False
+ * TC.C.C42.Rsp | False
+ *
+ * Commands Generated
+ * TC.C.C00.Tx | True
+ * TC.C.C02.Tx | True
+ * TC.C.C06.Tx | True
+ * TC.C.C07.Tx | True
+ * TC.C.C10.Tx | True
+ * TC.C.C12.Tx | True
+ * TC.C.C14.Tx | True
+ * TC.C.C16.Tx | True
+ * TC.C.C41.Tx | False
+ * TC.C.C42.Tx | False
+ */
+
+#ifndef ZCL_TOUCHLINK_H
+# define ZCL_TOUCHLINK_H
+
+#include "zcl/zcl.h"
+
+/* include TL utility cluster support functions. */
+/* FIXME - disabled while adding Touchlink into stack */
+/* #define TL_UTILITY */
+
+/* Zigbee Information Field
+ * See Figure 13-10. Format of the ZigBee Information Field */
+/* Logical Type */
+#define ZCL_TL_ZBINFO_TYPE_MASK 0x03
+#define ZCL_TL_ZBINFO_TYPE_COORD 0x00
+#define ZCL_TL_ZBINFO_TYPE_ROUTER 0x01
+#define ZCL_TL_ZBINFO_TYPE_END_DEVICE 0x02
+/* Rx on when idle */
+#define ZCL_TL_ZBINFO_RX_ON_IDLE 0x04
+/* Reserved */
+#define ZCL_TL_ZBINFO_RESERVED 0xf8
+
+/* Internal use flags (don't get sent over-the-air)
+ * FIXME - These used to be mixed with the ZCL_TL_ZBINFO_ flags, so for backward
+ * compatibility make sure they don't conflict. */
+#define ZCL_TL_FLAGS_IS_TARGET (uint8_t)0x10
+#define ZCL_TL_FLAGS_USE_PERSIST (uint8_t)0x20
+#define ZCL_TL_FLAGS_FACTORY_RESET (uint8_t)0x40
+
+/*--------------------------------------------------------------------------
+ * Warning! Deprecated API. Use ZbStartup with BDB_COMMISSION_MODE_TOUCHLINK instead.
+ *--------------------------------------------------------------------------
+ */
+/* Deprecated! Touchlink should be started by setting the BDB_COMMISSION_MODE_TOUCHLINK
+ * commissioning mode bit in the ZbStartupT configuration struct, filling in the
+ * touchlink configuration in ZbStartupT, and calling ZbStartup. */
+uint8_t ZbZclTouchlinkStart(struct ZbZclClusterT *clusterPtr,
+ struct WpanPublicT *wpan, uint8_t flags,
+ const void *persist_buf, unsigned int persist_len) ZB_F_DEPRECATED;
+
+/* Deprecated! Use ZbStartup instead. */
+uint8_t ZbZclTouchlinkScan(struct ZbZclClusterT *clusterPtr,
+ void (*callback)(enum ZbBdbCommissioningStatusT status, void *arg), void *arg) ZB_F_DEPRECATED;
+
+/* Deprecated! Use ZbStartup instead, with touchlink ZCL_TL_FLAGS_FACTORY_RESET flag bit set. */
+uint8_t ZbZclTouchlinkFactoryReset(struct ZbZclClusterT *clusterPtr,
+ void (*callback)(enum ZbBdbCommissioningStatusT status, void *arg), void *arg) ZB_F_DEPRECATED;
+
+/* Deprecated! Use ZbStartupTouchlinkTargetStop instead. */
+uint8_t ZbZclTouchlinkStop(struct ZbZclClusterT *clusterPtr) ZB_F_DEPRECATED;
+
+/* Deprecated! ZbStartup will allocate the Touchlink Server cluster if necessary. */
+struct ZbZclClusterT * ZbZclTouchlinkServerAlloc(struct ZigBeeT *zb, uint8_t endpoint) ZB_F_DEPRECATED;
+
+/* Deprecated! ZbStartup will allocate the Identify Server cluster if not already
+ * allocated on the endpoint chosen for Touchlink. */
+void ZbZclTouchlinkServerConfigIdentify(struct ZbZclClusterT *clusterPtr,
+ struct ZbZclClusterT *identifyCluster) ZB_F_DEPRECATED;
+
+/* Deprecated! ZbStartup will allocate the Touchlink Client cluster if necessary. */
+struct ZbZclClusterT * ZbZclTouchlinkClientAlloc(struct ZigBeeT *zb, uint8_t endpoint) ZB_F_DEPRECATED;
+
+#endif /* __ZCL_ONOFF_H */
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.aps.h b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.aps.h
new file mode 100644
index 000000000..946d5da8a
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.aps.h
@@ -0,0 +1,892 @@
+/* Copyright [2009 - 2019] Exegin Technologies Limited. All rights reserved. */
+
+#ifndef ZIGBEE_APS_H
+# define ZIGBEE_APS_H
+
+/*---------------------------------------------------------------
+ * Definitions
+ *---------------------------------------------------------------
+ */
+/* APS Constants */
+/* Make sure apscMaxDescriptorSize never exceeds 0xff (length field is 1 byte) */
+#define ZB_APS_CONST_MAX_DESCRIPTOR_SIZE 64U
+#define ZB_APS_CONST_MIN_DUPLICATE_TABLE_SIZE 1U
+
+/* I count 8 bytes as the minimum APS overhead, not 12 (0x0c) */
+#define ZB_APS_CONST_MIN_HEADER_OVERHEAD 8U
+
+#define ZB_APS_CONST_SECURITY_OVERHEAD (5U + ZB_SEC_MIC_LENGTH_5)
+
+/* For embedded application using the zigbee mempool, the maximum size
+ * we can allocate is slightly larger than 2000 bytes. */
+#define ZB_APS_CONST_MAX_FRAG_SIZE 2000U
+
+/* Maximum APS payload size if no security at all. */
+#define ZB_APS_CONST_MAX_UNSECURED_PAYLOAD_SIZE (ZB_NWK_CONST_MAX_PAYLOAD_SIZE /* 108 */ - \
+ ZB_APS_CONST_MIN_HEADER_OVERHEAD /* 8 */) /* = 100 */
+
+/* Maximum (unfragmented) APS payload, assuming a NWK secured packet and no many-to-one source routing.
+ * Note, if fragmentation is allowed, subtract 2 for the APS extended header, which gives a value of 80. */
+#define ZB_APS_CONST_MAX_PAYLOAD_SIZE (ZB_NWK_CONST_MAX_PAYLOAD_SIZE /* 108 */ - \
+ ZB_NWK_CONST_SECURITY_OVERHEAD /* 18 */ - \
+ ZB_APS_CONST_MIN_HEADER_OVERHEAD /* 8 */) /* = 82 */
+
+/* Maximum (unfragmented) APS payload, assuming a NWK secured packet
+ * with many-to-one source routing (source routing level = 6). */
+#define ZB_APS_CONST_SAFE_NWKSEC_PAYLOAD_SIZE (ZB_NWK_CONST_MAX_PAYLOAD_SIZE /* 108 */ - \
+ ZB_NWK_CONST_SECURITY_OVERHEAD /* 18 */ - \
+ 4U /* source router header */ - \
+ /* was using ZB_NWK_CONST_MAX_SOURCE_ROUTE */ \
+ (2U * ZB_NWK_CONST_DEFAULT_SOURCE_ROUTE) /* 12 */ - \
+ ZB_APS_CONST_MIN_HEADER_OVERHEAD /* 8 */) /* = 66 */
+
+/* Maximum (unfragmented) APS payload, assuming an APS secured packet
+ * with many-to-one source routing (source routing level = 6). */
+#define ZB_APS_CONST_SAFE_APSSEC_PAYLOAD_SIZE (ZB_NWK_CONST_MAX_PAYLOAD_SIZE /* 108 */ - \
+ ZB_NWK_CONST_SECURITY_OVERHEAD /* 18 */ - \
+ 4U /* source router header */ - \
+ /* was using ZB_NWK_CONST_MAX_SOURCE_ROUTE */ \
+ (2U * ZB_NWK_CONST_DEFAULT_SOURCE_ROUTE) /* 12 */ - \
+ ZB_APS_CONST_MIN_HEADER_OVERHEAD /* 8 */ - \
+ ZB_APS_CONST_SECURITY_OVERHEAD /* 9 */) /* = 57 */
+
+/* "Assuming fragmentation is used there can be 256 such blocks
+ * comprising a single maximum sized ASDU."
+ * ZB_APS_CONST_MAX_PAYLOAD_SIZE: 20,992 bytes
+ * ZB_APS_CONST_SAFE_NWKSEC_PAYLOAD_SIZE: 16,896 bytes
+ * ZB_APS_CONST_SAFE_APSSEC_PAYLOAD_SIZE: 14,592 bytes */
+#define ZB_APS_CONST_MAX_ASDU_LENGTH (256U * ZB_APS_CONST_MAX_PAYLOAD_SIZE)
+
+/* apscMaxFrameRetries */
+#define ZB_APS_CONST_MAX_FRAME_RETRIES 3U
+
+#define ZB_APS_CONST_MAX_WINDOW_SIZE 8U
+
+/* Endpoint Definitions */
+#define ZB_ENDPOINT_MIN 0x00U /* 0 */
+#define ZB_ENDPOINT_ZDO 0x00U /* 0 */
+#define ZB_ENDPOINT_FINDBIND_MIN 0x01U /* 1 */
+#define ZB_ENDPOINT_FINDBIND_MAX 0xefU /* 239 */
+#define ZB_ENDPOINT_CBKE_DEFAULT 0xf0U /* 240 */
+#define ZB_ENDPOINT_GREENPOWER 0xf2U /* 242 */
+#define ZB_ENDPOINT_MAX 0xfeU /* 254 */
+#define ZB_ENDPOINT_BCAST 0xffU /* 255 */
+
+/* Internal endpoints used for special stack functions */
+#define ZB_ENDPOINT_INTERNAL 0x0100U
+#define ZB_ENDPOINT_INTERPAN (ZB_ENDPOINT_INTERNAL + 0U)
+#define ZB_ENDPOINT_GROUP (ZB_ENDPOINT_INTERNAL + 1U)
+
+/* APS Command Frame Ids */
+enum ZbApsCmdIdT {
+#if 0 /* deprecated as of R21 */
+ ZB_APS_CMD_SKKE_1 = 0x01,
+ ZB_APS_CMD_SKKE_2 = 0x02,
+ ZB_APS_CMD_SKKE_3 = 0x03,
+ ZB_APS_CMD_SKKE_4 = 0x04,
+#endif
+ ZB_APS_CMD_TRANSPORT_KEY = 0x05,
+ ZB_APS_CMD_UPDATE_DEVICE = 0x06,
+ ZB_APS_CMD_REMOVE_DEVICE = 0x07,
+ ZB_APS_CMD_REQUEST_KEY = 0x08,
+ ZB_APS_CMD_SWITCH_KEY = 0x09,
+#if 0 /* deprecated as of R21 */
+ ZB_APS_CMD_EA_INIT_CHLNG = 0x0a,
+ ZB_APS_CMD_EA_RESP_CHLNG = 0x0b,
+ ZB_APS_CMD_EA_INIT_DATA = 0x0c,
+ ZB_APS_CMD_EA_RESP_DATA = 0x0d,
+#endif
+ ZB_APS_CMD_TUNNEL = 0x0e,
+ ZB_APS_CMD_VERIFY_KEY = 0x0f,
+ ZB_APS_CMD_CONFIRM_KEY = 0x10
+};
+
+/*---------------------------------------------------------------
+ * APSDE
+ *---------------------------------------------------------------
+ */
+/* APSDE and Interpan Addressing Modes */
+enum ZbApsAddrModeT {
+ ZB_APSDE_ADDRMODE_NOTPRESENT = 0,
+ ZB_APSDE_ADDRMODE_GROUP,
+ ZB_APSDE_ADDRMODE_SHORT,
+ ZB_APSDE_ADDRMODE_EXT,
+ ZB_APSDE_ADDRMODE_IPGROUP /* InterPAN */
+};
+
+struct ZbApsAddrT {
+ enum ZbApsAddrModeT mode;
+ uint16_t endpoint;
+ uint16_t panId; /* Not used by ZbApsdeDataReqCallback. Mainly for InterPan packets. */
+ uint16_t nwkAddr;
+ uint64_t extAddr;
+};
+
+/* Helper struct to send using binding */
+extern const struct ZbApsAddrT *ZbApsAddrBinding;
+
+/* APSDE Transmit Options */
+#define ZB_APSDE_DATAREQ_TXOPTIONS_SECURITY 0x0001U
+#define ZB_APSDE_DATAREQ_TXOPTIONS_NWKKEY 0x0002U
+#define ZB_APSDE_DATAREQ_TXOPTIONS_ACK 0x0004U
+#define ZB_APSDE_DATAREQ_TXOPTIONS_FRAG 0x0008U
+#define ZB_APSDE_DATAREQ_TXOPTIONS_NONCE 0x0010U /* TODO: CCB 1184 */
+/* Exegin addons */
+/*
+ * When the VECTOR option is set, the ASDU points instead to an array of
+ * ZbApsBufT structures that point to fragments of the message to assemble into
+ * one ASDU, and the ASDU length is the number of buffer structures. This is
+ * used for scatter-gather mode API calls to reduce heap activity.
+ */
+#define ZB_APSDE_DATAREQ_TXOPTIONS_VECTOR 0x0100U
+/* Used in place of the R21 useAlias parameter. */
+#define ZB_APSDE_DATAREQ_TXOPTIONS_ALIAS 0x0200U
+
+/* APSDE-DATA.request */
+typedef struct {
+ struct ZbApsAddrT dst;
+ uint16_t profileId;
+ uint16_t clusterId;
+ uint16_t srcEndpt;
+ const void *asdu;
+ uint16_t asduLength;
+ uint32_t asduHandle;
+ /*
+ * You should not set ZB_APSDE_DATAREQ_TXOPTIONS_ACK if you are trying to
+ * send to a sleepy device. The default timeout to wait for an APS ACK
+ * is 1.5 seconds, which can be much shorter than the time a sleepy device
+ * can be asleep for. APS transmission may still work, but you will get
+ * a lot of APS retries and error messages.
+ */
+ uint16_t txOptions;
+ /*
+ * If you perform route discovery separately using ZbNlmeRouteDiscWait(),
+ * then you can set discoverRoute to zero, decreasing the length of time
+ * an APS data request may take if there is a problem sending the packet
+ * to the target.
+ */
+ bool discoverRoute;
+ uint8_t radius;
+ uint16_t aliasAddr;
+ uint8_t aliasSeqnum;
+} ZbApsdeDataReqT;
+
+/* Buffer descriptor for vectored/scatter-gather API */
+typedef struct {
+ const uint8_t *data;
+ unsigned int len;
+} ZbApsBufT;
+
+/* APSDE-DATA.confirm */
+typedef struct {
+ struct ZbApsAddrT dst;
+ uint8_t srcEndpt;
+ uint32_t asduHandle;
+ enum ZbStatusCodeT status;
+} ZbApsdeDataConfT;
+
+/* APSDE-DATA.indication */
+typedef struct {
+ struct ZbApsAddrT dst;
+ struct ZbApsAddrT src;
+ uint16_t profileId;
+ uint16_t clusterId;
+ uint8_t *asdu;
+ uint16_t asduLength;
+ /* securityStatus, one of:
+ * ZB_APS_STATUS_UNSECURED (no decryption necessary)
+ * ZB_APS_STATUS_SECURED_NWK_KEY (decrypted with the Network Key)
+ * ZB_APS_STATUS_SECURED_LINK_KEY (decrypted with a Link Key) */
+ enum ZbStatusCodeT securityStatus;
+ uint8_t linkQuality;
+ int8_t rssi;
+ /* Exegin Addon for Intra-PAN portability. */
+ uint16_t linkAddr;
+ /* TO BE DONE :missing aps data- not implemented yet, needed for gateway */
+ int rxTime;
+} ZbApsdeDataIndT;
+
+/* APSDE-DATA.request */
+void ZbApsdeDataReqWait(struct ZigBeeT *zb, ZbApsdeDataReqT *dataReqPtr, ZbApsdeDataConfT *dataConfPtr);
+
+/* ZbApsdeDataReq is deprecated, use ZbApsdeDataReqWait instead. */
+#define ZbApsdeDataReq(_zb_, _req_, _conf_) ZbApsdeDataReqWait(_zb_, _req_, _conf_)
+
+/* Non-blocking version of APSDE-DATA.request.
+ * If the packet was queued, ZB_STATUS_SUCCESS is returned. Otherwise, an error status is returned. */
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbApsdeDataReqCallback(struct ZigBeeT *zb, ZbApsdeDataReqT *req,
+ void (*callback)(ZbApsdeDataConfT *conf, void *arg), void *arg);
+
+/*---------------------------------------------------------------
+ * APSME
+ *---------------------------------------------------------------
+ */
+/* APS IB Attributes */
+enum ZbApsmeIbAttrIdT {
+ ZB_APS_IB_ID_ADDRESS_MAP = 0xc0, /* 0xc0 Removed in ZigBee 2007 */
+ ZB_APS_IB_ID_BINDING_TABLE, /* 0xc1 (ZbApsmeBindT) */
+ ZB_APS_IB_ID_DESIGNATED_COORD, /* 0xc2 (uint8_t) */
+ ZB_APS_IB_ID_CHANNEL_MASK, /* 0xc3 (struct ZbChannelListT) Converted to a list in R22. */
+ ZB_APS_IB_ID_USE_EPID, /* 0xc4 (uint64_t) */
+ ZB_APS_IB_ID_GROUP_TABLE, /* 0xc5 (ZbApsmeGroupT) */
+ ZB_APS_IB_ID_NONMEMBER_RADIUS, /* 0xc6 (uint8_t) */
+#if 0 /* REMOVED */
+ ZB_APS_IB_ID_PERMISSIONS_CONFIG, /* 0xc7 */
+#endif
+ ZB_APS_IB_ID_USE_INSECURE_JOIN = 0xc8, /* 0xc8 (uint8_t) */
+ ZB_APS_IB_ID_INTERFRAME_DELAY, /* 0xc9 (uint8_t) */
+ ZB_APS_IB_ID_LAST_CHANNEL_ENERGY, /* 0xca (uint8_t) */
+ ZB_APS_IB_ID_LAST_CHANNEL_FAILRATE, /* 0xcb (uint8_t) */
+ ZB_APS_IB_ID_CHANNEL_TIMER, /* 0xcc (ZbUptimeT) */
+ ZB_APS_IB_ID_MAX_WINDOW_SIZE, /* 0xcd (uint8_t) */
+#if 0 /* REMOVED */
+ ZB_APS_IB_ID_PARENT_ANNOUNCE_TIMER, /* 0xce */
+#endif
+
+ /*** Security attributes ***/
+ ZB_APS_IB_ID_DEVICE_KEY_PAIR_SET = 0xaa, /* 0xaa (ZbApsmeKeyPairT) */
+ ZB_APS_IB_ID_TRUST_CENTER_ADDRESS, /* 0xab (uint64_t) */
+ ZB_APS_IB_ID_SECURITY_TIMEOUT_PERIOD, /* 0xac (uint16_t) */
+
+ /* Trust center policy table bitmask (type = uint32_t, enum ZbApsmePolicyT).
+ * Represents the following AIBs:
+ * allowJoins = 0xad
+ * useWhiteList = 0xae
+ * allowInstallCodes = 0xaf
+ * updateTrustCenterLinkKeysRequired = 0xb3
+ * allowRejoins = 0xb6
+ * allowTrustCenterLinkKeyRequests = 0xb7
+ * networkKeyUpdateMethod = 0xba
+ * allowApplicationKeyRequests = 0xbb
+ * allowRemoteTcPolicyChange = 0xbd */
+ ZB_APS_IB_ID_TRUST_CENTER_POLICY, /* 0xad (uint32_t) */
+
+ ZB_APS_IB_ID_FRAGMENTATION_THRESH, /* 0xaf (uint8_t) */
+
+ /*** Exegin extensions (0x500 to 0x5ff reserved for custom AIBs) ***/
+ ZB_APS_IB_ID_SCAN_COUNT = 0x0500, /* (uint8_t) ZDO join parameter. Is not modified by ZbApsReset. */
+ ZB_APS_IB_ID_LEAVE_REMOVE_CHILDREN, /* (uint8_t) ZDO leave parameter */
+ /* apsPreconfiguredLinkKey -- Preconfigured Trust Center Link Key */
+ ZB_APS_IB_ID_PRECONFIGURED_LINK_KEY, /* (uint8_t[ZB_SEC_KEYSIZE]) */
+ /* apsDistributedGlobalKey */
+ ZB_APS_IB_ID_DISTRIBUTED_GLOBAL_KEY, /* (uint8_t[ZB_SEC_KEYSIZE]) */
+ /* KeyUpdatePeriod from the trust center policy table. */
+ ZB_APS_IB_ID_KEY_UPDATE_PERIOD, /* (uint32_t) */
+ ZB_APS_IB_ID_MANUFACTURER_ID, /* (uint16_t) Manufacturer ID */
+ ZB_APS_IB_ID_SEND_PKT_COOLDOWN, /* (uint16_t) milliseconds */
+ ZB_APS_IB_ID_BIND_ADDR_RESOLVE_PERIOD /* (uint16_t) seconds, 0 = disabled */
+};
+
+/* APSME-GET.request */
+typedef struct {
+ enum ZbApsmeIbAttrIdT attrId;
+ void *attr;
+ unsigned int attrLength;
+ unsigned int attrIndex;
+} ZbApsmeGetReqT;
+
+/* APSME-GET.confirm */
+typedef struct {
+ enum ZbStatusCodeT status;
+ enum ZbApsmeIbAttrIdT attrId;
+} ZbApsmeGetConfT;
+
+/* APSME-SET.request */
+typedef struct {
+ enum ZbApsmeIbAttrIdT attrId;
+ const void *attr;
+ unsigned int attrLength;
+ unsigned int attrIndex;
+} ZbApsmeSetReqT;
+
+/* APSME-SET.confirm */
+typedef struct {
+ enum ZbStatusCodeT status;
+ enum ZbApsmeIbAttrIdT attrId;
+} ZbApsmeSetConfT;
+
+/* APSME-BIND.request */
+typedef struct {
+ uint64_t srcExtAddr;
+ uint8_t srcEndpt;
+ uint16_t clusterId;
+ /* dst.panId not used, dst.nwkAddr is only for the group address,
+ * and dst.endpoint only used if mode == ZB_APSDE_ADDRMODE_EXT */
+ struct ZbApsAddrT dst;
+} ZbApsmeBindReqT;
+
+/* APSME-BIND.confirm */
+typedef struct {
+ enum ZbStatusCodeT status;
+ uint64_t srcExtAddr;
+ uint8_t srcEndpt;
+ uint16_t clusterId;
+ /* dst.panId not used, dst.nwkAddr is only for the group address,
+ * and dst.endpoint only used if mode == ZB_APSDE_ADDRMODE_EXT */
+ struct ZbApsAddrT dst;
+} ZbApsmeBindConfT;
+
+/* APSME-UNBIND.request */
+typedef struct {
+ uint64_t srcExtAddr;
+ uint8_t srcEndpt;
+ uint16_t clusterId;
+ /* dst.panId not used, dst.nwkAddr is only for the group address,
+ * and dst.endpoint only used if mode == ZB_APSDE_ADDRMODE_EXT */
+ struct ZbApsAddrT dst;
+} ZbApsmeUnbindReqT;
+
+/* APSME-UNBIND.confirm */
+typedef struct {
+ enum ZbStatusCodeT status;
+ uint64_t srcExtAddr;
+ uint8_t srcEndpt;
+ uint16_t clusterId;
+ /* dst.panId not used, dst.nwkAddr is only for the group address,
+ * and dst.endpoint only used if mode == ZB_APSDE_ADDRMODE_EXT */
+ struct ZbApsAddrT dst;
+} ZbApsmeUnbindConfT;
+
+/* APSME-ADD-GROUP.request */
+typedef struct {
+ uint16_t groupAddr;
+ uint8_t endpt;
+} ZbApsmeAddGroupReqT;
+
+/* APSME-ADD-GROUP.confirm */
+typedef struct {
+ enum ZbStatusCodeT status;
+ uint16_t groupAddr;
+ uint8_t endpt;
+} ZbApsmeAddGroupConfT;
+
+/* APSME-REMOVE-GROUP.request */
+typedef struct {
+ uint16_t groupAddr;
+ uint8_t endpt;
+} ZbApsmeRemoveGroupReqT;
+
+/* APSME-REMOVE-GROUP.confirm */
+typedef struct {
+ enum ZbStatusCodeT status;
+ uint16_t groupAddr;
+ uint8_t endpt;
+} ZbApsmeRemoveGroupConfT;
+
+/* APSME-REMOVE-ALL-GROUPS.request */
+typedef struct {
+ uint8_t endpt;
+} ZbApsmeRemoveAllGroupsReqT;
+
+/* APSME-REMOVE-ALL-GROUPS.confirm */
+typedef struct {
+ enum ZbStatusCodeT status;
+ uint8_t endpt;
+} ZbApsmeRemoveAllGroupsConfT;
+
+/* APSME-ADD-ENDPOINT.request - Exegin Custom */
+typedef struct {
+ /* Application Information */
+ uint8_t endpoint;
+ uint16_t profileId;
+ uint16_t deviceId;
+ uint8_t version;
+ uint8_t inputClusterCount; /* Supported Server Clusters */
+ const uint16_t *inputClusterList;
+ uint8_t outputClusterCount; /* Supported Client Clusters */
+ const uint16_t *outputClusterList;
+ uint16_t bdbCommissioningGroupID;
+} ZbApsmeAddEndpointReqT;
+
+/* APSME-ADD-ENDPOINT.confirm - Exegin Custom */
+typedef struct {
+ enum ZbStatusCodeT status;
+} ZbApsmeAddEndpointConfT;
+
+/* APSME-REMOVE-ENDPOINT.request - Exegin Custom */
+typedef struct {
+ uint8_t endpoint;
+} ZbApsmeRemoveEndpointReqT;
+
+/* APSME-REMOVE-ENDPOINT.confirm - Exegin Custom */
+typedef struct {
+ enum ZbStatusCodeT status;
+} ZbApsmeRemoveEndpointConfT;
+
+/* APS Binding Table entry. */
+typedef struct {
+ /* Source */
+ uint64_t srcExtAddr; /* if zero, entry is invalid */
+ uint8_t srcEndpt;
+ /* Cluster */
+ uint16_t clusterId;
+ /* Destination */
+ /* dst.panId not used, dst.nwkAddr is only for the group address,
+ * and dst.endpoint only used if mode == ZB_APSDE_ADDRMODE_EXT */
+ struct ZbApsAddrT dst;
+} ZbApsmeBindT;
+
+/* APS Group ID Table entry. */
+typedef struct {
+ uint16_t groupAddr;
+ uint8_t endpoint;
+} ZbApsmeGroupT;
+
+void ZbApsmeGetReq(struct ZigBeeT *zb, ZbApsmeGetReqT *getReqPtr, ZbApsmeGetConfT *getConfPtr);
+void ZbApsmeSetReq(struct ZigBeeT *zb, ZbApsmeSetReqT *setReqPtr, ZbApsmeSetConfT *setConfPtr);
+void ZbApsmeBindReq(struct ZigBeeT *zb, ZbApsmeBindReqT *bindReqPtr, ZbApsmeBindConfT *bindConfPtr);
+void ZbApsmeUnbindReq(struct ZigBeeT *zb, ZbApsmeUnbindReqT *unbindReqPtr, ZbApsmeUnbindConfT *unbindConfPtr);
+void ZbApsUnbindAllReq(struct ZigBeeT *zb);
+void ZbApsmeAddGroupReq(struct ZigBeeT *zb, ZbApsmeAddGroupReqT *r, ZbApsmeAddGroupConfT *c);
+void ZbApsmeRemoveGroupReq(struct ZigBeeT *zb, ZbApsmeRemoveGroupReqT *r, ZbApsmeRemoveGroupConfT *c);
+void ZbApsmeRemoveAllGroupsReq(struct ZigBeeT *zb, ZbApsmeRemoveAllGroupsReqT *r, ZbApsmeRemoveAllGroupsConfT *c);
+
+uint8_t ZbApsGroupsGetCapacity(struct ZigBeeT *zb);
+uint8_t ZbApsGroupsGetMembership(struct ZigBeeT *zb, uint8_t endpoint, uint16_t *group_list,
+ uint8_t max_len);
+
+void ZbApsmeAddEndpoint(struct ZigBeeT *zb, ZbApsmeAddEndpointReqT *r, ZbApsmeAddEndpointConfT *c);
+void ZbApsmeRemoveEndpoint(struct ZigBeeT *zb, ZbApsmeRemoveEndpointReqT *r, ZbApsmeRemoveEndpointConfT *c);
+
+/* Attach a callback to receive all APS messages for this endpoint that have
+ * not matched any other filter rules. */
+bool ZbApsmeEndpointConfigNoMatchCallback(struct ZigBeeT *zb, uint8_t endpoint,
+ void (*callback)(ZbApsdeDataIndT *ind, void *cbarg), void *arg);
+
+/* Add a cluster ID to the input cluster list of an existing endpoint */
+bool ZbApsmeEndpointClusterListAppend(struct ZigBeeT *zb, uint8_t endpoint,
+ uint16_t cluster_id, bool is_input);
+bool ZbApsmeEndpointClusterListRemove(struct ZigBeeT *zb, uint8_t endpoint,
+ uint16_t cluster_id, bool is_input);
+bool ZbApsmeEndpointClusterPresent(struct ZigBeeT *zb, uint8_t endpoint,
+ uint16_t cluster_id, bool is_input);
+
+uint8_t ZbApsmeEndpointClusterListInputNum(struct ZigBeeT *zb, uint8_t endpoint);
+uint8_t ZbApsmeEndpointClusterListOutputNum(struct ZigBeeT *zb, uint8_t endpoint);
+
+/* Check if an endpoint already exists */
+bool ZbApsEndpointExists(struct ZigBeeT *zb, uint8_t endpoint);
+/* Get the Profile ID for this endpoint */
+uint16_t ZbApsEndpointProfile(struct ZigBeeT *zb, uint8_t endpoint);
+
+/*---------------------------------------------------------------
+ * APSME - Security
+ *---------------------------------------------------------------
+ */
+/* Device status values for APSME-UPDATE-DEVICE.request and indication. */
+enum ZbApsmeDeviceStatusT {
+ ZB_APSME_DEV_STD_SECURE_REJOIN = 0x00, /* 0x00 */
+ ZB_APSME_DEV_STD_INSECURE_JOIN, /* 0x01 */
+ ZB_APSME_DEV_LEFT, /* 0x02 */
+ ZB_APSME_DEV_STD_INSECURE_REJOIN, /* 0x03 */
+ ZB_APSME_DEV_HIGH_SECURE_REJOIN, /* HIGHSEC SECURE REJOIN 0x04 */
+ ZB_APSME_DEV_HIGH_INSECURE_JOIN, /* HIGHSEC JOIN 0x05 */
+ /* Discontinuity, 0x06 */
+ ZB_APSME_DEV_HIGH_INSECURE_REJOIN = 0x07 /* HIGHSEC INSECURE REJOIN 0x07 */
+};
+
+/* FIXME 1 - change the these values so the low nibble represents an
+ * enumeration, and the high nibble is a mask representing the key type
+ * (e.g. global, unique, unverified, derived, etc)
+ *
+ * Key attributes set in the device key pair set (bitmask)
+ *
+ * Verified keys are the default.
+ *
+ * Warning, the bitmask here does not match the ZigBee Spec
+ * (R21: Table 4.29)*/
+
+/* Unique Link Key (e.g. Install Code Generated Key) */
+#define ZB_APSME_KEY_ATTR_VERIFIED 0x00U
+
+/* Shared key (value stored in apsPreconfiguredLinkKey). */
+/* Global Link Key */
+#define ZB_APSME_KEY_ATTR_SHARED 0x01U
+
+#if 0 /* provisional key is not used by stack. */
+#define ZB_APSME_KEY_ATTR_PROVISIONAL ZB_APSME_KEY_ATTR_SHARED
+#endif
+
+/* An unverified TCLK derived key. We should continue to use
+ * apsPreconfiguredLinkKey until it gets verified by a
+ * APSME-VERIFY-KEY.indication */
+#define ZB_APSME_KEY_ATTR_UNVERIFIED 0x02U
+
+/* ZCL KE/CBKE derived key. */
+/* Unique Link Key */
+#define ZB_APSME_KEY_ATTR_CBKE 0x04U
+
+/* TCLK update derived key. Set when we receive a APSME-REQUEST-KEY.indication
+ * with key-type set to TCLK. ZB_APSME_KEY_ATTR_UNVERIFIED is set at the
+ * same time. */
+#define ZB_APSME_KEY_ATTR_TCLK_DERIVED 0x08U
+
+/* Distributed Security Global Key (value stored in apsDistributedGlobalKey) */
+/* Global Link Key */
+#define ZB_APSME_KEY_ATTR_DISTRIBUTED 0x10U
+
+/* Trust Center Policy Flags (ZB_APS_IB_ID_TRUST_CENTER_POLICY)
+ * See R22 section 4.7.3 Trust Center Policy Values */
+enum ZbApsmePolicyT {
+ /* allowJoins */
+ ZB_APSME_POLICY_ALLOW_JOIN = 0x00000001,
+ /* useWhiteList */
+ ZB_APSME_POLICY_WHITELIST = 0x00000002,
+
+ /* allowInstallCodes */
+ ZB_APSME_POLICY_IC_MASK = 0x0000000C,
+ /* 0x00 (do not support Install Codes) */
+ ZB_APSME_POLICY_IC_NOT_SUPPORTED = 0x00000000,
+ /* 0x01 (support but do not require Install Codes) */
+ ZB_APSME_POLICY_IC_SUPPORTED = 0x00000004,
+ /* 0x02 (require the use of Install Codes) */
+ ZB_APSME_POLICY_IC_REQUIRED = 0x00000008,
+
+ /* updateTrustCenterLinkKeysRequired */
+ ZB_APSME_POLICY_TCLK_UPDATE_REQUIRED = 0x00000010,
+
+ /* allowRejoins - "This value indicates if the trust center allows rejoins using well known
+ * or default keys. A setting of FALSE means rejoins are only allowed with trust center
+ * link keys where the KeyAttributes of the apsDeviceKeyPairSet entry indicates VERIFIED_KEY." */
+ ZB_APSME_POLICY_ALLOW_REJOIN = 0x00000020,
+
+ /* allowTrustCenterLinkKeyRequests */
+ ZB_APSME_POLICY_TC_KEY_REQ_MASK = 0x000000C0,
+ /* 0x01 (any) */
+ ZB_APSME_POLICY_TC_KEY_REQ_ANY = 0x00000040,
+ /* 0x02 (provisional) */
+ ZB_APSME_POLICY_TC_KEY_REQ_PROV = 0x00000080,
+
+#if 0 /* not used and has no effect in stack */
+ /* networkKeyUpdateMethod */
+ ZB_APSME_POLICY_NWK_KEY_UNICAST = 0x00000100,
+#endif
+
+ /* allowApplicationKeyRequests */
+ ZB_APSME_POLICY_APP_KEY_REQ_MASK = 0x00000C00,
+ /* 0x00 (never) */
+ ZB_APSME_POLICY_APP_KEY_REQ_NEVER = ZB_APSME_POLICY_IC_NOT_SUPPORTED,
+ /* 0x01 (any) */
+ ZB_APSME_POLICY_APP_KEY_REQ_ANY = 0x00000400,
+ /* 0x02 (provisional) */
+ /* Provisional requires "applicationKeyRequestList" to be implemented. */
+ ZB_APSME_POLICY_APP_KEY_REQ_PROV = 0x00000800,
+
+ /* allowRemoteTcPolicyChange */
+ ZB_APSME_POLICY_TC_POLICY_CHANGE = 0x00001000,
+
+ /* For certification testing only */
+ /* Authenticate using dummy keys only (preconfigured NWK key in use). */
+ ZB_APSME_POLICY_DUMMY_KEY = 0x10000000
+};
+
+/* APSME-TRANSPORT-KEY.request */
+typedef struct {
+ /*
+ * Under normal stack operation, destination address mode must be
+ * ZB_APSDE_ADDRMODE_EXT. If dstAddrMode == ZB_APSDE_ADDRMODE_EXT
+ * and dstExtAddr == 0, the transport key command will be sent to the
+ * 0xffff broadcast address.
+ *
+ * For ZigBee Pro testing, we need to have finer control over the
+ * broadcast address. For test 14.24, we need to be able to
+ * specify 0xffff as well as 0xfffd (rx-on only).
+ */
+ enum ZbApsAddrModeT dstAddrMode;
+ /*lint -e658 [ !MISRA - Anonymous union assumed. ] */
+ union {
+ uint16_t dstNwkAddr;
+ uint64_t dstExtAddr;
+ };
+ enum ZbSecKeyTypeT keyType;
+ union {
+ struct {
+ uint64_t parentAddr;
+ uint8_t key[ZB_SEC_KEYSIZE];
+ } trustKey;
+ struct {
+ uint8_t keySeqNumber;
+ uint8_t key[ZB_SEC_KEYSIZE];
+ bool useParent;
+ uint64_t parentAddr;
+ } nwkKey;
+ struct {
+ uint64_t partnerAddr;
+ bool initiator;
+ uint8_t key[ZB_SEC_KEYSIZE];
+ } linkKey;
+ };
+ /* Anonymous Union (keyData) */
+} ZbApsmeTransportKeyReqT;
+
+/* APSME-TRANSPORT-KEY.indication */
+typedef struct {
+ uint64_t srcExtAddr;
+ enum ZbSecKeyTypeT keyType;
+ union {
+ struct {
+ uint8_t key[ZB_SEC_KEYSIZE];
+ } trustKey;
+ struct {
+ uint8_t keySeqNumber;
+ uint8_t key[ZB_SEC_KEYSIZE];
+ } nwkKey;
+ struct {
+ uint64_t partnerAddr;
+ bool initiator; /* initiator field is missing from spec. */
+ uint8_t key[ZB_SEC_KEYSIZE];
+ } linkKey;
+ };
+ /*lint -restore */
+ enum ZbSecEncryptT encryptKeyType; /* key used to encrypt the incoming command. */
+} ZbApsmeTransKeyIndT;
+
+/* APSME-UPDATE-DEVICE.request */
+typedef struct {
+ uint64_t dstExtAddr;
+ uint64_t devExtAddr;
+ enum ZbApsmeDeviceStatusT status;
+ uint16_t devShortAddr;
+} ZbApsmeUpdateDeviceReqT;
+
+/* APSME-UPDATE-DEVICE.indication */
+typedef struct {
+ uint64_t srcExtAddr;
+ uint64_t devExtAddr;
+ uint16_t devShortAddr;
+ enum ZbApsmeDeviceStatusT status;
+ enum ZbSecEncryptT encryptKeyType; /* key used to encrypt the incoming command. */
+} ZbApsmeUpdateDeviceIndT;
+
+/* APSME-REMOVE-DEVICE.request */
+typedef struct {
+ uint64_t dstExtAddr;
+ uint64_t targetAddr;
+} ZbApsmeRemoveDeviceReqT;
+
+/* APSME-REMOVE-DEVICE.indication */
+typedef struct {
+ uint64_t srcExtAddr;
+ uint64_t targetAddr;
+ enum ZbSecEncryptT encryptKeyType; /* key used to encrypt the incoming command. */
+} ZbApsmeRemoveDeviceIndT;
+
+/* R22 Table 4-19 RequestKeyType Values */
+/* This table is slightly different than the values from enum ZbSecKeyTypeT, which all the other commands use. */
+enum ZbApsRequestKeyTypeT {
+ ZB_APS_REQKEY_KEYTYPE_APP_LINK = 0x02,
+ ZB_APS_REQKEY_KEYTYPE_TC_LINK = 0x04
+};
+
+/* APSME-REQUEST-KEY.request */
+typedef struct {
+ uint64_t dstExtAddr;
+ enum ZbApsRequestKeyTypeT keyType;
+ uint64_t partnerAddr; /* only used with application keys. */
+} ZbApsmeRequestKeyReqT;
+
+/* APSME-REQUEST-KEY.indication */
+typedef struct {
+ uint64_t srcExtAddr;
+ enum ZbApsRequestKeyTypeT keyType;
+ uint64_t partnerAddr;
+ enum ZbSecEncryptT encryptKeyType; /* key used to encrypt the incoming command. */
+} ZbApsmeRequestKeyIndT;
+
+/* APSME-SWITCH-KEY.request */
+typedef struct {
+ /*
+ * Under normal stack operation, destination address mode must be
+ * ZB_APSDE_ADDRMODE_EXT. If dstAddrMode == ZB_APSDE_ADDRMODE_EXT
+ * and dstExtAddr == 0, the switch key command will be sent to the
+ * 0xffff broadcast address.
+ *
+ * For ZigBee Pro testing, we need to have finer control over the
+ * broadcast address. For test 14.24, we need to be able to
+ * specify 0xffff as well as 0xfffd (rx-on only).
+ */
+ enum ZbApsAddrModeT dstAddrMode;
+ /*lint -e658 [ !MISRA - Anonymous union assumed. ] */
+ union {
+ uint16_t dstNwkAddr;
+ uint64_t dstExtAddr;
+ };
+ /*lint -restore */
+ uint8_t keySeqNum;
+} ZbApsmeSwitchKeyReqT;
+
+/* APSME-SWITCH-KEY.indication */
+typedef struct {
+ uint64_t srcExtAddr;
+ uint8_t keySeqNum;
+ enum ZbSecEncryptT encryptKeyType; /* key used to encrypt the incoming command. */
+} ZbApsmeSwitchKeyIndT;
+
+/* APSME-VERIFY-KEY.request */
+typedef struct {
+ uint64_t dstExtAddr;
+ enum ZbSecKeyTypeT keyType;
+} ZbApsmeVerifyKeyReqT;
+
+/* APSME-VERIFY-KEY.indication */
+typedef struct {
+ uint64_t srcExtAddr;
+ enum ZbSecKeyTypeT keyType;
+ uint8_t hash[ZB_SEC_KEYSIZE];
+ enum ZbSecEncryptT encryptKeyType; /* key used to encrypt the incoming command. */
+} ZbApsmeVerifyKeyIndT;
+
+/* APSME-CONFIRM-KEY.request */
+typedef struct {
+ enum ZbStatusCodeT status;
+ uint64_t dstExtAddr;
+ enum ZbSecKeyTypeT keyType;
+} ZbApsmeConfirmKeyReqT;
+
+/* APSME-CONFIRM-KEY.indication */
+typedef struct {
+ enum ZbStatusCodeT status;
+ uint64_t srcExtAddr;
+ enum ZbSecKeyTypeT keyType;
+ enum ZbSecEncryptT encryptKeyType; /* key used to encrypt the incoming command. */
+} ZbApsmeConfirmKeyIndT;
+
+/* APSME-ADD-KEY.request - Exegin Custom */
+typedef struct {
+ enum ZbSecKeyTypeT keyType;
+ uint8_t key[ZB_SEC_KEYSIZE];
+ uint8_t keyAttribute;
+ uint8_t keySeqNumber;
+ uint64_t partnerAddr;
+ uint32_t outgoingCounter; /* For link keys only. */
+ uint32_t incomingCounter; /* For link keys only. */
+} ZbApsmeAddKeyReqT;
+
+/* APSME-ADD-KEY.confirm - Exegin Custom */
+typedef struct {
+ enum ZbStatusCodeT status;
+} ZbApsmeAddKeyConfT;
+
+/*STRUCTURE:-----------------------------------------------------
+ * NAME ZbApsmeGetKeyReqT
+ * DESC Exegin Custom
+ * PARAMS
+ * keyType ;
+ * keySeqNumber ; Only used with ZB_SEC_KEYTYPE_STANDARD_NWK
+ * The active network key's sequence number can be retrieved from
+ * the NIB attribute ZB_NWK_NIB_ID_ActiveKeySeqNumber.
+ * partnerAddr ;
+ *---------------------------------------------------------------
+ */
+typedef struct {
+ enum ZbSecKeyTypeT keyType;
+ uint8_t keySeqNumber;
+ uint64_t partnerAddr;
+} ZbApsmeGetKeyReqT;
+
+/* APSME-GET-KEY.confirm - Exegin Custom */
+typedef struct {
+ enum ZbStatusCodeT status;
+ uint8_t key[ZB_SEC_KEYSIZE];
+ uint32_t outgoingCounter;
+ uint32_t incomingCounter;
+ uint8_t apsKeyAttribute; /* Only valid if req.keyType != ZB_SEC_KEYTYPE_STANDARD_NWK */
+} ZbApsmeGetKeyConfT;
+
+/* APSME-REMOVE-KEY.request - Exegin Custom */
+typedef struct {
+ enum ZbSecKeyTypeT keyType;
+ uint64_t partnerAddr;
+} ZbApsmeRemoveKeyReqT;
+
+/* APSME-REMOVE-KEY.confirm - Exegin Custom */
+typedef struct {
+ enum ZbStatusCodeT status;
+} ZbApsmeRemoveKeyConfT;
+
+/* APS Key/Pair Descriptor - used with ZB_APS_IB_ID_DEVICE_KEY_PAIR_SET */
+typedef struct {
+ uint64_t deviceAddress;
+ uint8_t linkKey[ZB_SEC_KEYSIZE];
+ uint32_t outgoingFrameCounter;
+ uint32_t incomingFrameCounter;
+ uint32_t persistOutFrameCounter;
+ uint32_t persistInFrameCounter;
+ uint8_t keyAttribute;
+ ZbUptimeT cooldown;
+} ZbApsmeKeyPairT;
+
+void ZbApsmeTransportKeyReq(struct ZigBeeT *zb, ZbApsmeTransportKeyReqT *req);
+enum ZbSecHdrKeyIdT ZbApsmeUpdateDeviceReq(struct ZigBeeT *zb, ZbApsmeUpdateDeviceReqT *req);
+void ZbApsmeRemoveDeviceReq(struct ZigBeeT *zb, ZbApsmeRemoveDeviceReqT *req);
+enum ZbStatusCodeT ZbApsmeRequestKeyReq(struct ZigBeeT *zb, ZbApsmeRequestKeyReqT *req);
+void ZbApsmeSwitchKeyReq(struct ZigBeeT *zb, ZbApsmeSwitchKeyReqT *req);
+void ZbApsmeVerifyKeyReq(struct ZigBeeT *zb, ZbApsmeVerifyKeyReqT *req);
+void ZbApsmeConfirmKeyReq(struct ZigBeeT *zb, ZbApsmeConfirmKeyReqT *req);
+void ZbApsmeAddKeyReq(struct ZigBeeT *zb, ZbApsmeAddKeyReqT *req, ZbApsmeAddKeyConfT *conf);
+/* For ZbApsmeGetKeyReq, key types ZB_SEC_KEYTYPE_TC_LINK and ZB_SEC_KEYTYPE_APP_LINK are treated
+ * the same when searching, so you can use either to get the link key for the requested EUI. */
+void ZbApsmeGetKeyReq(struct ZigBeeT *zb, ZbApsmeGetKeyReqT *req, ZbApsmeGetKeyConfT *conf);
+void ZbApsmeRemoveKeyReq(struct ZigBeeT *zb, ZbApsmeRemoveKeyReqT *req, ZbApsmeRemoveKeyConfT *conf);
+
+/*---------------------------------------------------------------
+ * Filter API
+ *---------------------------------------------------------------
+ */
+#define ZB_APS_FILTER_RULES_MAX 16U
+
+enum ZbApsFilterTypeT {
+ ZB_APS_FILTER_TYPE_NORMAL = 0, /* handle normally, call callback on match. */
+ ZB_APS_FILTER_TYPE_DROP, /* drop packet and don't process further. */
+ ZB_APS_FILTER_TYPE_NO_MATCH /* call if there were no other matches for this packet */
+};
+
+/* APS packet filter entry. */
+struct ZbApsFilterT {
+ struct LinkListT link;
+ /* Packet handler actions */
+ enum ZbApsFilterTypeT type;
+ void (*callback)(ZbApsdeDataIndT *dataInd, void *cb_arg);
+ void *arg;
+ /* Packet filter rules */
+ uint32_t r[ZB_APS_FILTER_RULES_MAX];
+};
+
+/* Create an APS indication filter and callback for an endpoint, with no specific cluster being filtered. */
+struct ZbApsFilterT * ZbApsFilterEndpointAdd(struct ZigBeeT *zb, uint8_t endpoint, uint16_t profileId,
+ void (*callback)(ZbApsdeDataIndT *dataInd, void *cb_arg), void *arg);
+/* Create an APS indication filter and callback for an endpoint and a specific cluster ID. */
+struct ZbApsFilterT * ZbApsFilterClusterAdd(struct ZigBeeT *zb, uint8_t endpoint, uint16_t clusterId, uint16_t profileId,
+ void (*callback)(ZbApsdeDataIndT *dataInd, void *cb_arg), void *arg);
+void ZbApsFilterClusterFree(struct ZigBeeT *zb, struct ZbApsFilterT *filter);
+
+/*---------------------------------------------------------------
+ * Helper Functions
+ *---------------------------------------------------------------
+ */
+/* ZbApsGet and ZbApsSet return the confirm status byte (SUCCESS == 0x00) */
+#define ZbApsGet(_zb_, _id_, _ptr_, _sz_) ZbApsGetIndex(_zb_, _id_, _ptr_, _sz_, 0)
+#define ZbApsSet(_zb_, _id_, _ptr_, _sz_) ZbApsSetIndex(_zb_, _id_, _ptr_, _sz_, 0)
+enum ZbStatusCodeT ZbApsGetIndex(struct ZigBeeT *zb, enum ZbApsmeIbAttrIdT attrId, void *attrPtr, unsigned int attrSz, unsigned int attrIndex);
+enum ZbStatusCodeT ZbApsSetIndex(struct ZigBeeT *zb, enum ZbApsmeIbAttrIdT attrId, const void *attrPtr, unsigned int attrSz, unsigned int attrIndex);
+
+bool ZbApsGroupIsMember(struct ZigBeeT *zb, uint16_t groupAddr, uint8_t endpoint);
+
+bool ZbApsLinkKeyExists(struct ZigBeeT *zb, uint64_t partner);
+ZbApsmeKeyPairT * ZbApsLookupKey(struct ZigBeeT *zb, ZbApsmeKeyPairT *key,
+ uint64_t addr, unsigned int *idx);
+
+/* Required for ZDP Mgmt_Bind_rsp */
+uint8_t ZbApsBindTblNumEntries(struct ZigBeeT *zb);
+unsigned int ZbApsAckWaitDuration(struct ZigBeeT *zb);
+
+bool ZbApsAddrIsBcast(struct ZbApsAddrT *addr);
+bool ZbApsAddrIsLocal(struct ZigBeeT *zb, struct ZbApsAddrT *addr);
+
+bool ZbApsCommandSecurityCheck(struct ZigBeeT *zb, enum ZbApsCmdIdT cmdId, uint64_t srcExtAddr, enum ZbSecEncryptT encryptKeyType);
+
+/* Helpers for certification testing (TP/PRO/BV-43 and TP/PRO/BV-44) */
+bool ZbApsFragDropTxAdd(struct ZigBeeT *zb, uint8_t blockNum);
+void ZbApsFragDropTxClear(struct ZigBeeT *zb);
+
+#endif /* ZIGBEE_APS_H */
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.bdb.h b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.bdb.h
new file mode 100644
index 000000000..ba93f95b9
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.bdb.h
@@ -0,0 +1,185 @@
+/* Copyright [2009 - 2019] Exegin Technologies Limited. All rights reserved. */
+
+#ifndef ZIGBEE_BDB_H
+#define ZIGBEE_BDB_H
+
+/* Table 5 – Values of the bdbCommissioningStatus attribute.
+ * These are not interchangeable with Zigbee Status Codes. */
+enum ZbBdbCommissioningStatusT {
+ ZB_BDB_COMMISS_STATUS_SUCCESS = 0x00, /* The commissioning sub-procedure was successful. */
+ ZB_BDB_COMMISS_STATUS_IN_PROGRESS, /* One of the commissioning sub-procedures has started but is not yet complete. */
+ ZB_BDB_COMMISS_STATUS_NOT_AA_CAPABLE, /* The initiator is not address assignment capable during touchlink. */
+ ZB_BDB_COMMISS_STATUS_NO_NETWORK, /* A network has not been found during network steering or touchlink. */
+ ZB_BDB_COMMISS_STATUS_TARGET_FAILURE, /* A node has not joined a network when requested during touchlink. */
+ ZB_BDB_COMMISS_STATUS_FORMATION_FAILURE, /* A network could not be formed during network formation. */
+ ZB_BDB_COMMISS_STATUS_NO_IDENTIFY_QUERY_RESPONSE, /* No response to an identify query command has been received during finding & binding. */
+ ZB_BDB_COMMISS_STATUS_BINDING_TABLE_FULL, /* A binding table entry could not be created due to insufficient space in the binding table during finding & binding. */
+ ZB_BDB_COMMISS_STATUS_NO_SCAN_RESPONSE, /* No response to a scan request inter-PAN command has been received during touchlink. */
+ ZB_BDB_COMMISS_STATUS_NOT_PERMITTED, /* A touchlink (steal) attempt was made when a node is already connected to a centralized security network. */
+ ZB_BDB_COMMISS_STATUS_TCLK_EX_FAILURE /* The Trust Center link key exchange procedure has failed attempting to join a centralized security network. */
+};
+
+#define BDB_DEFAULT_TC_NODE_JOIN_TIMEOUT 15 /* seconds */
+
+#define DEFAULT_EP_BDB_COMMISSION_GRP_ID 0xffffU
+
+/* Bits for ZB_BDB_CommissioningMode */
+#define BDB_COMMISSION_MODE_MASK 0x0FU
+#define BDB_COMMISSION_MODE_TOUCHLINK 0x01U
+#define BDB_COMMISSION_MODE_NET_STEER 0x02U /* currently not used */
+#define BDB_COMMISSION_MODE_NET_FORM 0x04U /* Whether to form a network. Configured by ZbStartup (e.g. ZbStartTypeForm) */
+#define BDB_COMMISSION_MODE_FIND_BIND 0x08U
+
+/* Bits for bdbCommissioningCapability. */
+#define BDB_COMMISSION_CAP_MASK 0x0FU
+#define BDB_COMMISSION_CAP_STEER 0x01U
+#define BDB_COMMISSION_CAP_NETWORK 0x02U
+#define BDB_COMMISSION_CAP_FIND_BIND 0x04U
+#define BDB_COMMISSION_CAP_TL 0x08U
+
+/* Bits for bdbNodeJoinLinkKeyType */
+#define BDB_JOINLINK_KEYTYPE_FLAG 0x0F
+#define BDB_JOINLINK_KEYTYPE_GTC 0x01 /* global trust center*/
+#define BDB_JOINLINK_KEYTYPE_DS 0x02 /* distributed security global */
+#define BDB_JOINLINK_KEYTYPE_IC 0x04 /* install code preconfigured. */
+#define BDB_JOINLINK_KEYTYPE_TC 0x08 /* touchlink preconfigured. */
+
+/* values for ZB_BDB_TCLinkKeyExchangeMethod / bdbTCLinkKeyExchangeMethod */
+enum ZbBdbLinkKeyExchMethodT {
+ BDB_LINKKEY_EXCHANGE_METHOD_APS = 0x00,
+ BDB_LINKKEY_EXCHANGE_METHOD_CBKE = 0x01 /* cert. based key exchange.*/
+};
+
+/* Touchlink Default Primary Channel Set (2.4 GHz, Page 0, based on WPAN_CHANNELMASK_2400MHZ)
+ * Channels: 11, 15, 20, 25 */
+#define BDBC_TL_PRIMARY_CHANNEL_SET 0x02108800U
+#define BDBC_TL_SECONDARY_CHANNEL_SET (WPAN_CHANNELMASK_2400MHZ ^ BDBC_TL_PRIMARY_CHANNEL_SET)
+
+/* value for bdbRssiMin - used by touchLink ONLY */
+#define BDB_TL_RSSI_MIN (-40)
+
+/* Table 13-23 Key Encryption Algorithm
+ * NOTE: This is what keyMask<->keyIndex translates to:
+ * KeyMask Key Description Algorithm Supported
+ * 0 development key 13.3.4.10.4 NO - use 4 or 15 instead
+ * 4 production key 13.3.4.10.5 YES (same as certification)
+ * 15 certification key 13.3.4.10.5 YES
+ */
+enum ZbBdbTouchlinkKeyIndexT {
+ TOUCHLINK_KEY_INDEX_DEVELOPMENT = 0,
+ TOUCHLINK_KEY_INDEX_PRODUCTION = 4,
+ TOUCHLINK_KEY_INDEX_CERTIFICATION = 15
+};
+
+/* BDB IB attributes */
+enum ZbBdbAttrIdT {
+ /* FIXME ? ZB_BDB_CommissioningGroupID ? = 0x1000 */
+ ZB_BDB_CommissioningMode = 0x1001, /* bdbCommissioningMode - e.g. BDB_COMMISSION_MODE_MASK */
+ ZB_BDB_JoiningNodeEui64 = 0x1002, /* for internal use only */
+ ZB_BDB_JoiningNodeNewTCLinkKey = 0x1003, /* for internal use only */
+ ZB_BDB_JoinUsesInstallCodeKey = 0x1004,
+ ZB_BDB_NodeCommissioningCapability = 0x1005, /* bdbNodeCommissioningCapability - e.g. BDB_COMMISSION_CAP_MASK */
+ ZB_BDB_NodeIsOnANetwork = 0x1006, /* Just checks nwkExtendedPanId if non-zero */
+ ZB_BDB_NodeJoinLinkKeyType = 0x1007, /* e.g. BDB_JOINLINK_KEYTYPE_FLAG - Link key with which the node was able to decrypt the network key */
+ ZB_BDB_PrimaryChannelSet = 0x1008,
+ ZB_BDB_ScanDuration = 0x1009,
+ ZB_BDB_SecondaryChannelSet = 0x100a,
+ ZB_BDB_TCLK_ExchangeAttempts = 0x100b, /* TC link key */
+ ZB_BDB_TCLK_ExchangeAttemptsMax = 0x100c,
+ ZB_BDB_TCLinkKeyExchangeMethod = 0x100d, /* enum ZbBdbLinkKeyExchMethodT */
+ ZB_BDB_TrustCenterNodeJoinTimeout = 0x100e,
+ ZB_BDB_TrustCenterRequiresKeyExchange = 0x100f, /* Modifies ZB_APSME_POLICY_TCLK_UPDATE_REQUIRED bit in ZB_APS_IB_ID_TRUST_CENTER_POLICY */
+ ZB_BDB_AcceptNewUnsolicitedTCLinkKey = 0x1010, /* uint8_t */
+ ZB_BDB_AcceptNewUnsolicitedApplicationLinkKey = 0x1011, /* uint8_t */
+
+ /* Extra stuff not explicitly covered by the BDB spec. */
+ ZB_BDB_JoiningNodeParent = 0x1100, /* EUI of parent of joining device (where to send APS Remove Request if necessary) */
+ ZB_BDB_vDoPrimaryScan, /* 0x1101 - internal use only - boolean whether to use ZB_BDB_PrimaryChannelSet or ZB_BDB_SecondaryChannelSet */
+ /* Address assignment */
+ ZB_BDB_FreeNetAddrBegin, /* 0x1102 */
+ ZB_BDB_FreeNetAddrCurrent, /* 0x1103 */
+ ZB_BDB_FreeNetAddrEnd, /* 0x1104 */
+ /* Group addresses - currently not being used by stack */
+ ZB_BDB_FreeGroupIDBegin, /* 0x1105 */
+ ZB_BDB_FreeGroupIDEnd, /* 0x1106 */
+ ZB_BDB_TLRssiMin, /* 0x1107 - RSSI threshold, int8_t value */
+ ZB_BDB_TLTestFlags, /* 0x1108 - Touchlink test flags (enum ZbTlTestFlagsT) */
+ ZB_BDB_UpdateDeviceKeyId, /* 0x1109 - enum ZbSecHdrKeyIdT (e.g. ZB_SEC_KEYID_NETWORK (default) or ZB_SEC_KEYID_LINK) */
+ ZB_BDB_JoinScanType, /* 0x110a - MCP_SCAN_ACTIVE (default) or MCP_SCAN_ENHANCED */
+ ZB_BDB_JoinIgnoreLqi, /* 0x110b - bool - Ignore LQI (link cost <= 3) of potential parent's beacon */
+ ZB_BDB_NlmeSyncFailNumBeforeError, /* 0x110c - uint8_t - Number of consecutive NLME-SYNC failures before reporting ZB_NWK_STATUS_CODE_PARENT_LINK_FAILURE */
+ ZB_BDB_ZdoTimeout, /* 0x110d - ZDO response-wait timeout - default is 6 seconds */
+ ZB_BDB_TLStealFlags, /* 0x110e */
+ ZB_BDB_JoinTclkNodeDescReqDelay, /* 0x110f */
+ ZB_BDB_JoinTclkRequestKeyDelay, /* 0x1110 */
+ ZB_BDB_TLDenyFactoryNew, /* 0x1111 */
+ ZB_BDB_TLKey, /* 0x1112 */
+ ZB_BDB_TLKeyIndex, /* 0x1113 - enum ZbBdbTouchlinkKeyIndexT */
+ ZB_BDB_ZdoPermitJoinAfterJoin, /* 0x1114 - Default is enabled. */
+ ZB_BDB_ZdoZigbeeProtocolRevision, /* 0x1115 - Default 22 (R22) - was ZB_PROTOCOL_REVISION. */
+ ZB_BDB_NwkAllowRouterLeaveRejoin, /* 0x1116 - Default is disabled. */
+ ZB_BDB_PersistTimeoutMs, /* 0x1117 */
+ ZB_BDB_JoinAttemptsMax, /* 0x1118 - uint8_t - maximum number attempts to join a network. If an attempt fails, the EPID is added to a blacklist before the next attempt. */
+ ZB_BDB_MaxConcurrentJoiners, /* 0x1119 - uint8_t - maximum number of concurrent joiners the coordinator supports */
+
+ /* Constants which are accessible through a BDB GET IB request. */
+ ZB_BDBC_MaxSameNetworkRetryAttempts = 0x1200,
+ ZB_BDBC_MinCommissioningTime, /* seconds */
+ ZB_BDBC_RecSameNetworkRetryAttempts,
+ ZB_BDBC_TCLinkKeyExchangeTimeout, /* seconds */
+ ZB_BDBC_TLInterPANTransIdLifetime, /* seconds */
+ ZB_BDBC_TLMinStartupDelayTime, /* seconds */
+ ZB_BDBC_TLRxWindowDuration, /* seconds */
+ ZB_BDBC_TLScanTimeBaseDuration /* mS */
+};
+
+/* BDB-GET.request */
+typedef struct {
+ enum ZbBdbAttrIdT attrId;
+ void *attr;
+ unsigned int attrLength;
+ unsigned int attrIndex;
+} ZbBdbGetReqT;
+
+/* BDB-GET.confirm */
+typedef struct {
+ enum ZbStatusCodeT status;
+ enum ZbBdbAttrIdT attrId;
+} ZbBdbGetConfT;
+
+/* BDB-SET.request */
+typedef struct {
+ enum ZbBdbAttrIdT attrId;
+ const void *attr;
+ unsigned int attrLength;
+ unsigned int attrIndex;
+} ZbBdbSetReqT;
+
+/* BDB-SET.confirm */
+typedef struct {
+ enum ZbStatusCodeT status;
+ enum ZbBdbAttrIdT attrId;
+} ZbBdbSetConfT;
+
+#define ZbBdbGet(_zb_, _id_, _ptr_, _sz_) ZbBdbGetIndex(_zb_, _id_, _ptr_, _sz_, 0)
+#define ZbBdbSet(_zb_, _id_, _ptr_, _sz_) ZbBdbSetIndex(_zb_, _id_, _ptr_, _sz_, 0)
+enum ZbStatusCodeT ZbBdbGetIndex(struct ZigBeeT *zb, enum ZbBdbAttrIdT attrId, void *attrPtr, unsigned int attrSz, unsigned int attrIndex);
+enum ZbStatusCodeT ZbBdbSetIndex(struct ZigBeeT *zb, enum ZbBdbAttrIdT attrId, const void *attrPtr, unsigned int attrSz, unsigned int attrIndex);
+void ZbBdbGetReq(struct ZigBeeT *zb, ZbBdbGetReqT *getReqPtr, ZbBdbGetConfT *getConfPtr);
+void ZbBdbSetReq(struct ZigBeeT *zb, ZbBdbSetReqT *setReqPtr, ZbBdbSetConfT *setConfPtr);
+
+/* Helpers for bdbCommissioningMode bits */
+/* ZbBdbCommissionModeBitSupported - Check if a BDB_COMMISSION_MODE_ bit or mask is
+ * supported by bdbNodeCommissioningCapability. */
+bool ZbBdbCommissionModeBitSupported(struct ZigBeeT *zb, uint8_t new_mode_bit);
+enum ZbStatusCodeT ZbBdbCommissionModeBitSet(struct ZigBeeT *zb, uint8_t new_mode_bit);
+enum ZbStatusCodeT ZbBdbCommissionModeBitClear(struct ZigBeeT *zb, uint8_t new_mode_bit);
+
+int ZbBdbGetEndpointStatus(struct ZigBeeT *zb, uint8_t endpoint);
+
+enum ZbBdbCommissioningStatusT ZbBdbNwkStatusToBdbStatus(enum ZbStatusCodeT status);
+enum ZbStatusCodeT ZbBdbStatusToNwkStatus(enum ZbBdbCommissioningStatusT status);
+
+void ZbBdbSetEndpointStatus(struct ZigBeeT *zb, enum ZbBdbCommissioningStatusT status, uint8_t endpoint);
+
+#endif /* ZIGBEE_BDB_H */
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.h b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.h
new file mode 100644
index 000000000..305069eaf
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.h
@@ -0,0 +1,621 @@
+/* Copyright [2009 - 2019] Exegin Technologies Limited. All rights reserved. */
+
+#ifndef ZIGBEE_H
+# define ZIGBEE_H
+
+#if defined(__GNUC__)
+# define ZB_WARN_UNUSED __attribute__((warn_unused_result))
+# define ZB_F_DEPRECATED __attribute__((deprecated))
+#elif defined(_MSC_VER) && (_MSC_VER >= 1800)
+# define ZB_WARN_UNUSED
+# define ZB_F_DEPRECATED __declspec(deprecated)
+#else
+# define ZB_WARN_UNUSED
+# define ZB_F_DEPRECATED
+#endif
+
+#ifdef __CDT_PARSER__
+/* Eclipse indexer only code */
+#include "zb_make_config.h"
+#endif
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <inttypes.h>
+/*lint -save -e829 [ 'stdarg.h' usage should be deprecated - 17.1 REQUIRED] */
+/*lint -save -e451 [ header file included withoutstandard guard - 4.10 REQUIRED] */
+#include <stdarg.h>
+/*lint -restore */
+/*lint -restore */
+
+#include "ieee802154.api.h"
+#include "llist.h"
+
+/* ZigBee Protocol Versions as related to the spec version. */
+#if 0 /* deprecated */
+#define ZB_PROTOCOL_VERSION_2004 0x0001U
+#endif
+#define ZB_PROTOCOL_VERSION_2007 0x0002U
+
+/* Channel Mask / Page Helpers */
+#define ZB_CHANNELMASK_GETPAGE(x) (uint8_t)(((x) >> WPAN_PAGE_CHANNELS_MAX) & 0x1FU)
+#define ZB_CHANNELMASK(mask, page) ((page != 0U) ? \
+ ((mask) | ((((uint32_t)page) & 0x1FU) << WPAN_PAGE_CHANNELS_MAX)) : (mask))
+
+/* A value of 0xffff means the device is not associated. */
+#define ZB_PANID_MAX 0xfffeU
+
+#define ZB_EPID_MIN 0x0000000000000001ULL
+#define ZB_EPID_MAX 0xfffffffffffffffeULL
+
+/* The ZigBee distributed trust center address. */
+#define ZB_DISTRIBUTED_TC_ADDR 0xffffffffffffffffULL
+
+/* A subset of WPAN_CHANNELMASK_2400MHZ (HA and SE preferred channels) */
+#define ZB_CHANNELMASK_2400MHZ_HA 0x0318C800U /* Channels 11, 14, 15, 19, 20, 24, 25 */
+
+/* ZigBee Status Codes */
+enum ZbStatusCodeT {
+ /* General Status Codes */
+ ZB_STATUS_SUCCESS = 0x00,
+ ZB_STATUS_ALLOC_FAIL = 0x70, /* Memory allocation failure. */
+ ZB_STATUS_TIMEOUT = 0x71, /* Message timeout. */
+
+ /* ZDP Status Codes */
+ ZB_ZDP_STATUS_SUCCESS = ZB_STATUS_SUCCESS,
+ ZB_ZDP_STATUS_INV_REQTYPE = 0x80,
+ ZB_ZDP_STATUS_DEVNOTFOUND = 0x81,
+ ZB_ZDP_STATUS_INVALID_EP = 0x82,
+ ZB_ZDP_STATUS_NOT_ACTIVE = 0x83,
+ ZB_ZDP_STATUS_NOT_SUPPORTED = 0x84,
+ ZB_ZDP_STATUS_TIMEOUT = 0x85,
+ ZB_ZDP_STATUS_NO_MATCH = 0x86,
+ ZB_ZDP_STATUS_NO_ENTRY = 0x88,
+ ZB_ZDP_STATUS_NO_DESCRIPTOR = 0x89,
+ ZB_ZDP_STATUS_INSUFFICIENT_SPACE = 0x8a,
+ ZB_ZDP_STATUS_NOT_PERMITTED = 0x8b,
+ ZB_ZDP_STATUS_TABLE_FULL = 0x8c,
+ ZB_ZDP_STATUS_NOT_AUTHORIZED = 0x8d,
+ ZB_ZDP_STATUS_DEVICE_BINDING_TABLE_FULL = 0x8e,
+ ZB_ZDP_STATUS_INVALID_INDEX = 0x8f,
+
+ /* APS Status Codes. */
+ ZB_APS_STATUS_SUCCESS = ZB_STATUS_SUCCESS,
+ ZB_APS_STATUS_ASDU_TOO_LONG = 0xa0,
+ ZB_APS_STATUS_DEFRAG_DEFERRED = 0xa1,
+ ZB_APS_STATUS_DEFRAG_UNSUPPORTED = 0xa2,
+ ZB_APS_STATUS_ILLEGAL_REQUEST = 0xa3,
+ ZB_APS_STATUS_INVALID_BINDING = 0xa4,
+ ZB_APS_STATUS_INVALID_GROUP = 0xa5,
+ ZB_APS_STATUS_INVALID_PARAMETER = 0xa6,
+ ZB_APS_STATUS_NO_ACK = 0xa7,
+ ZB_APS_STATUS_NO_BOUND_DEVICE = 0xa8,
+ ZB_APS_STATUS_NO_SHORT_ADDRESS = 0xa9,
+ ZB_APS_STATUS_NOT_SUPPORTED = 0xaa,
+ ZB_APS_STATUS_SECURED_LINK_KEY = 0xab,
+ ZB_APS_STATUS_SECURED_NWK_KEY = 0xac,
+ ZB_APS_STATUS_SECURITY_FAIL = 0xad,
+ ZB_APS_STATUS_TABLE_FULL = 0xae,
+ ZB_APS_STATUS_UNSECURED = 0xaf,
+ ZB_APS_STATUS_UNSUPPORTED_ATTRIBUTE = 0xb0,
+ /* These values used in case of internal errors. */
+ ZB_APS_STATUS_INVALID_INDEX = 0xbd,
+
+ /* NWK Status Codes. */
+ ZB_NWK_STATUS_SUCCESS = ZB_STATUS_SUCCESS,
+ ZB_NWK_STATUS_INVALID_PARAMETER = 0xc1,
+ ZB_NWK_STATUS_INVALID_REQUEST = 0xc2,
+ ZB_NWK_STATUS_NOT_PERMITTED = 0xc3,
+ ZB_NWK_STATUS_STARTUP_FAILURE = 0xc4,
+ ZB_NWK_STATUS_ALREADY_PRESENT = 0xc5,
+ ZB_NWK_STATUS_SYNC_FAILURE = 0xc6,
+ ZB_NWK_STATUS_TABLE_FULL = 0xc7,
+ ZB_NWK_STATUS_UNKNOWN_DEVICE = 0xc8,
+ ZB_NWK_STATUS_UNSUPPORTED_ATTRIBUTE = 0xc9,
+ ZB_NWK_STATUS_NO_NETWORKS = 0xca,
+ ZB_NWK_STATUS_LEAVE_UNCONFIRMED = 0xcb,
+ ZB_NWK_STATUS_MAX_FRM_CNTR = 0xcc,
+ ZB_NWK_STATUS_NO_KEY = 0xcd,
+ ZB_NWK_STATUS_BAD_CCM_OUTPUT = 0xce,
+ ZB_NWK_STATUS_NO_ROUTING_CAPACITY = 0xcf,
+ ZB_NWK_STATUS_ROUTE_DISCOVERY_FAILED = 0xd0,
+ ZB_NWK_STATUS_ROUTE_ERROR = 0xd1,
+ ZB_NWK_STATUS_BT_TABLE_FULL = 0xd2,
+ ZB_NWK_STATUS_FRAME_NOT_BUFFERED = 0xd3,
+ /* Exegin Custom Status Values. */
+ ZB_NWK_STATUS_INVALID_INDEX = 0xd4,
+ ZB_NWK_STATUS_INTERNAL_ERR = 0xd6,
+
+ /* WPAN Status Codes (copied from ieee802154.api.h to here for MISRA) */
+ ZB_WPAN_STATUS_SUCCESS = ZB_STATUS_SUCCESS,
+ ZB_WPAN_STATUS_COUNTER_ERROR = mcp_STATUS_COUNTER_ERROR,
+ ZB_WPAN_STATUS_IMPROPER_KEY_TYPE = mcp_STATUS_IMPROPER_KEY_TYPE,
+ ZB_WPAN_STATUS_IMPROPER_SECURITY_LEVEL = mcp_STATUS_IMPROPER_SECURITY_LEVEL,
+ ZB_WPAN_STATUS_UNSUPPORTED_LEGACY = mcp_STATUS_UNSUPPORTED_LEGACY,
+ ZB_WPAN_STATUS_UNSUPPORTED_SECURITY = mcp_STATUS_UNSUPPORTED_SECURITY,
+ ZB_WPAN_STATUS_BEACON_LOSS = mcp_STATUS_BEACON_LOSS,
+ ZB_WPAN_STATUS_CHANNEL_ACCESS_FAILURE = mcp_STATUS_CHANNEL_ACCESS_FAILURE,
+ ZB_WPAN_STATUS_DENIED = mcp_STATUS_DENIED,
+ ZB_WPAN_STATUS_DISABLE_TRX_FAILURE = mcp_STATUS_DISABLE_TRX_FAILURE,
+ ZB_WPAN_STATUS_SECURITY_ERROR = mcp_STATUS_SECURITY_ERROR,
+ ZB_WPAN_STATUS_FRAME_TOO_LONG = mcp_STATUS_FRAME_TOO_LONG,
+ ZB_WPAN_STATUS_INVALID_GTS = mcp_STATUS_INVALID_GTS,
+ ZB_WPAN_STATUS_INVALID_HANDLE = mcp_STATUS_INVALID_HANDLE,
+ ZB_WPAN_STATUS_INVALID_PARAMETER = mcp_STATUS_INVALID_PARAMETER,
+ ZB_WPAN_STATUS_NO_ACK = mcp_STATUS_NO_ACK,
+ ZB_WPAN_STATUS_NO_BEACON = mcp_STATUS_NO_BEACON,
+ ZB_WPAN_STATUS_NO_DATA = mcp_STATUS_NO_DATA,
+ ZB_WPAN_STATUS_NO_SHORT_ADDRESS = mcp_STATUS_NO_SHORT_ADDRESS,
+ ZB_WPAN_STATUS_OUT_OF_CAP = mcp_STATUS_OUT_OF_CAP,
+ ZB_WPAN_STATUS_PAN_ID_CONFLICT = mcp_STATUS_PAN_ID_CONFLICT,
+ ZB_WPAN_STATUS_REALIGNMENT = mcp_STATUS_REALIGNMENT,
+ ZB_WPAN_STATUS_TRANSACTION_EXPIRED = mcp_STATUS_TRANSACTION_EXPIRED,
+ ZB_WPAN_STATUS_TRANSACTION_OVERFLOW = mcp_STATUS_TRANSACTION_OVERFLOW,
+ ZB_WPAN_STATUS_TX_ACTIVE = mcp_STATUS_TX_ACTIVE,
+ ZB_WPAN_STATUS_UNAVAILABLE_KEY = mcp_STATUS_UNAVAILABLE_KEY,
+ ZB_WPAN_STATUS_UNSUPPORTED_ATTRIBUTE = mcp_STATUS_UNSUPPORTED_ATTRIBUTE,
+ ZB_WPAN_STATUS_INVALID_ADDRESS = mcp_STATUS_INVALID_ADDRESS,
+ ZB_WPAN_STATUS_ON_TIME_TOO_LONG = mcp_STATUS_ON_TIME_TOO_LONG,
+ ZB_WPAN_STATUS_PAST_TIME = mcp_STATUS_PAST_TIME,
+ ZB_WPAN_STATUS_TRACKING_OFF = mcp_STATUS_TRACKING_OFF,
+ ZB_WPAN_STATUS_INVALID_INDEX = mcp_STATUS_INVALID_INDEX,
+ ZB_WPAN_STATUS_LIMIT_REACHED = mcp_STATUS_LIMIT_REACHED,
+ ZB_WPAN_STATUS_READ_ONLY = mcp_STATUS_READ_ONLY,
+ ZB_WPAN_STATUS_SCAN_IN_PROGRESS = mcp_STATUS_SCAN_IN_PROGRESS,
+ ZB_WPAN_STATUS_SUPERFRAME_OVERLAP = mcp_STATUS_SUPERFRAME_OVERLAP,
+ ZB_WPAN_STATUS_DRIVER_ERROR = mcp_STATUS_DRIVER_ERROR,
+ ZB_WPAN_STATUS_DEVICE_ERROR = mcp_STATUS_DEVICE_ERROR
+};
+
+/* Trust Center Swap Out status codes */
+enum ZbTcsoStatusT {
+ ZB_TCSO_STATUS_SUCCESS = 0x00, /* Successfully performed TCSO with new TC */
+ ZB_TCSO_STATUS_DISCOVERY_UNDERWAY, /* ZCL Keepalive has initiated TCSO, because of three consecutive failures. */
+ ZB_TCSO_STATUS_REJOIN_PREV, /* Found previous TC and rejoined to it. */
+ ZB_TCSO_STATUS_NOT_FOUND, /* Didn't find new or old TC, or process was aborted, resumed previous operation. */
+ ZB_TCSO_STATUS_FATAL /* TCSO failed and unable to restore previous operation. */
+};
+
+/* Debugging log mask. */
+#define ZB_LOG_MASK_FATAL 0x00000001U /* Unrecoverable errors. */
+#define ZB_LOG_MASK_ERROR 0x00000002U /* Recoverable internal errors. */
+#define ZB_LOG_MASK_WARNING 0x00000004U /* Misused API calls, network problems, etc... */
+#define ZB_LOG_MASK_INFO 0x00000008U /* Basic debugging info. Less verbose than ZB_LOG_MASK_DEBUG. */
+#define ZB_LOG_MASK_DEBUG 0x00000010U /* General debug info */
+#define ZB_LOG_MASK_PERSIST 0x00000020U /* Persistence */
+/* NWK */
+#define ZB_LOG_MASK_NWK_ROUTING 0x00000040U /* Network routing details. */
+#define ZB_LOG_MASK_NWK_LQI 0x00000080U /* Network link status and lqi updates. */
+#define ZB_LOG_MASK_NWK_SECURITY 0x00000100U /* Network security. */
+#define ZB_LOG_MASK_NWK_ADDR_MAP 0x00000200U /* Network address map changes */
+/* APS */
+#define ZB_LOG_MASK_APS_SEND 0x00000400U /* APS packet transmission */
+#define ZB_LOG_MASK_APS_FRAG 0x00000800U /* APS fragmentation debugging */
+/* ZDO */
+#define ZB_LOG_MASK_ZDO_ANNCE 0x00001000U /* Print on reception of ZDO Device_Annce */
+/* ZCL */
+#define ZB_LOG_MASK_ZCL 0x00002000U
+/* Green Power */
+#define ZB_LOG_MASK_GREENPOWER 0x00004000U
+/* Reserved 0x0fffc000U */
+/* MAC */
+#define ZB_LOG_MASK_MAC_RSSI 0x10000000U /* Print debug message per MCPS-DATA.indication showing RSSI */
+
+/* Log mask helpers */
+#define ZB_LOG_MASK_LEVEL_0 0x00000000U
+#define ZB_LOG_MASK_LEVEL_1 (ZB_LOG_MASK_FATAL)
+#define ZB_LOG_MASK_LEVEL_2 (ZB_LOG_MASK_LEVEL_1 | ZB_LOG_MASK_ERROR)
+#define ZB_LOG_MASK_LEVEL_3 (ZB_LOG_MASK_LEVEL_2 | ZB_LOG_MASK_WARNING)
+#define ZB_LOG_MASK_LEVEL_4 (ZB_LOG_MASK_LEVEL_3 | ZB_LOG_MASK_INFO)
+#define ZB_LOG_MASK_LEVEL_5 (ZB_LOG_MASK_LEVEL_4 | ZB_LOG_MASK_DEBUG)
+#define ZB_LOG_MASK_LEVEL_6 (ZB_LOG_MASK_LEVEL_5 | ZB_LOG_MASK_ZCL)
+#define ZB_LOG_MASK_LEVEL_ALL 0xFFFFFFFFU
+
+/* The Exegin manufacturer ID. */
+#define ZB_MFG_CODE_EXEGIN 0x10D7U
+#define ZB_MFG_CODE_WILDCARD 0xFFFFU
+
+/*---------------------------------------------------------------
+ * Channel List Structure
+ *---------------------------------------------------------------
+ */
+/* arbitrary maximum value - the most should ever 5 =>
+ * one 2.4 GHz mask + four GB-868 masks */
+#define MAX_CHANNEL_LIST_ENTRIES 8U
+
+struct ZbChannelListT {
+ /* Number of channel masks in 'list' */
+ uint8_t count;
+ struct {
+ /* 802.15.4 Channel Page */
+ uint8_t page;
+ /* e.g. WPAN_CHANNELMASK_2400MHZ or ZB_CHANNELMASK_2400MHZ_HA for Page 0. */
+ uint32_t channelMask;
+ } list[MAX_CHANNEL_LIST_ENTRIES];
+};
+
+/*---------------------------------------------------------------
+ * Stack Initialization
+ *---------------------------------------------------------------
+ */
+/* Opaque stack structures. */
+struct ZigBeeT;
+struct ZbMsgFilterT;
+
+/* A pointer to this struct type is passed to ZbInit to define the various
+ * ZigBee tables used in the stack. If the pointer to ZbInit is NULL, the
+ * default sizes are used. */
+typedef struct {
+ /* NWK Table Sizes */
+ unsigned int nwkNeighborTblSz; /* Default: 64 */
+ unsigned int nwkRouteTblSz; /* Default: 32 */
+ unsigned int nwkAddrMapTblSz; /* Default: 32 */
+ unsigned int nwkBttSz; /* Default is 32 */
+ unsigned int nwkRReqSz; /* default 16 */
+#if 0 /* TODO? */
+ unsigned int nwkRRecBits; /* default 10 */
+#endif
+
+ /* APS Table Sizes */
+ unsigned int apsPeerLinkKeyTblSz; /* Default: 32 */
+#if 0 /* TODO? */
+ unsigned int aps_binding_table_size; /* Default: 64 */
+ unsigned int aps_group_table_size; /* Default: 16 */
+#endif
+} ZbInitTblSizesT;
+
+/* Same parameters as ZbSetLogging takes. Allows debug log output
+ * as stack is being initialized. */
+typedef struct {
+ uint32_t mask;
+ void (*func)(struct ZigBeeT *zb, uint32_t mask, const char *hdr,
+ const char *fmt, va_list argptr);
+} ZbInitSetLoggingT;
+
+/*FUNCTION:------------------------------------------------------
+ * NAME
+ * ZbInit
+ *
+ * DESC
+ * Allocates a new Zigbee stack instance.
+ *
+ * PARAMS
+ * extAddr ; The extended address for this stack instance.
+ * tblSizes ; defines various table sizes with the stack.
+ * If NULL, default values are used.
+ * setLogging ; calls ZbSetLogging with info provided.
+ * Allows debug output during ZbInit process.
+ * If NULL, ZbSetLogging is not called.
+ *
+ * RETURNS
+ * Pointer to allocated ZigBee stack instance. Used to reference the stack instance in
+ * many of the function calls to and from the stack.
+ */
+struct ZigBeeT * ZbInit(uint64_t extAddr, ZbInitTblSizesT *tblSizes, ZbInitSetLoggingT *setLogging);
+
+/*FUNCTION:------------------------------------------------------
+ * NAME
+ * ZbDestroy
+ * DESC
+ * Deallocates a Zigbee stack instance.
+ * PARAMS
+ * none
+ * RETURNS
+ * none
+ *----------------------------------------------------------------
+ */
+void ZbDestroy(struct ZigBeeT *zb);
+
+/*FUNCTION:------------------------------------------------------
+ * NAME
+ * ZbSeedRand
+ * DESC
+ * Help seed the stack's PRNG. If the data has real entropy, set the has_entropy flag
+ * to true.
+ * PARAMS
+ * none
+ * RETURNS
+ * none
+ *----------------------------------------------------------------
+ */
+void ZbSeedRand(struct ZigBeeT *zb, uint8_t *randBuf, unsigned int len, bool has_entropy);
+
+/*FUNCTION:------------------------------------------------------
+ * NAME
+ * ZbTimerWork
+ * DESC
+ * Non-blocking, must be called periodically to run the stack. Returns the length of
+ * time (in milliseconds) until the next scheduled timer will elapse, or zero if there
+ * are no scheduled timers.
+ * PARAMS
+ * none
+ * RETURNS
+ * none
+ *----------------------------------------------------------------
+ */
+void ZbTimerWork(struct ZigBeeT *zb);
+unsigned int ZbCheckTime(struct ZigBeeT *zb);
+
+/*FUNCTION:------------------------------------------------------
+ * NAME
+ * ZbWakeupCallbackConfig
+ * DESC
+ * Configure a callback to wakeup the application if there's a new stack event to
+ * process. Not all stack ports require this.
+ * PARAMS
+ * none
+ * RETURNS
+ * none
+ *----------------------------------------------------------------
+ */
+void ZbWakeupCallbackConfig(struct ZigBeeT *zb, void (*wakeup_cb)(void));
+
+/*FUNCTION:------------------------------------------------------
+ * NAME
+ * ZbPortStackEventFd
+ * DESC
+ * Called to get the file descriptor to be used to wake-up the stack thread that is
+ * calling ZbTimerWork if something in the stack needs attention. This is only required
+ * in multi-threaded environments. Without this event, it is possible for a user thread
+ * to initiate a stack function which* doesn't tickle the MAC layer, which in turn would
+ * wake up the stack thread.
+ * PARAMS
+ * none
+ * RETURNS
+ * none
+ *----------------------------------------------------------------
+ */
+int ZbPortStackEventFd(struct ZigBeeT *zb);
+
+void ZbChangeExtAddr(struct ZigBeeT *zb, uint64_t extAddr);
+
+struct ZbNlmeLeaveConfT;
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbLeaveReq(struct ZigBeeT *zb, void (*callback)(struct ZbNlmeLeaveConfT *conf, void *arg), void *cbarg);
+void ZbLeaveWait(struct ZigBeeT *zb);
+
+/* Helper function to perform an APS and NWK reset */
+void ZbReset(struct ZigBeeT *zb);
+
+/*FUNCTION:------------------------------------------------------
+ * NAME
+ * ZbIfAttach
+ * DESC
+ * Attaches an IEEE 802.15.4 device driver to the ZigBee stack. Uses the link pointers
+ * within the device structure for linking.
+ * PARAMS
+ * zb ; ZigBee stack instance pointer
+ * dev ; pointer to driver instance to attach.
+ * RETURNS
+ * true (1) or false (0)
+ */
+bool ZbIfAttach(struct ZigBeeT *zb, struct WpanPublicT *dev);
+
+/*FUNCTION:------------------------------------------------------
+ * NAME
+ * ZbIfDetach
+ * DESC
+ * Detaches an IEEE 802.15.4 device driver from the ZigBee stack.
+ * PARAMS
+ * zb ; ZigBee stack instance pointer
+ * dev ; pointer to driver instance to detach.
+ * RETURNS
+ * none
+ */
+void ZbIfDetach(struct ZigBeeT *zb, struct WpanPublicT *dev);
+
+/*FUNCTION:------------------------------------------------------
+ * NAME
+ * ZbSetLogging
+ * DESC
+ * Specifies the level of logging to use, and a callback that outputs the log information.
+ * PARAMS
+ * zb ; ZigBee stack instance pointer
+ * mask ; Log mask of the debug messages you wish to receive.
+ * RETURNS
+ * none
+ *---------------------------------------------------------------
+ */
+void ZbSetLogging(struct ZigBeeT *zb, uint32_t mask,
+ void (*func)(struct ZigBeeT *zb, uint32_t mask, const char *hdr, const char *fmt, va_list argptr));
+
+void ZbGetLogging(struct ZigBeeT *zb, uint32_t *mask,
+ void(**func)(struct ZigBeeT *zb, uint32_t mask, const char *hdr, const char *fmt, va_list argptr));
+
+/*---------------------------------------------------------------
+ * ZCL Basic Server API
+ *---------------------------------------------------------------
+ */
+/* Controls whether the Basic Server is allowed to process the ZCL_BASIC_RESET_FACTORY command. */
+void ZbZclBasicServerResetCmdConfig(struct ZigBeeT *zb, bool allow_reset);
+/* Write to the local attributes (e.g. ZCL_BASIC_ATTR_MFR_NAME) */
+enum ZclStatusCodeT ZbZclBasicWriteDirect(struct ZigBeeT *zb, uint8_t endpoint, uint16_t attributeId, const void *ptr, unsigned int len);
+/* Post an alarm code to the Basic Cluster */
+bool ZbZclBasicPostAlarm(struct ZigBeeT *zb, uint8_t endpoint, uint8_t alarm_code);
+
+/*---------------------------------------------------------------
+ * Uptime
+ *---------------------------------------------------------------
+ */
+typedef unsigned long ZbUptimeT;
+
+#define ZB_UPTIME_MAX (ULONG_MAX)
+
+/* Max timeout = 12 days
+ * FIXME - should probably limit this to on the order of an hour.
+ *
+ * For long timeouts, keep resetting a timer to a timeout of an hour
+ * or the difference between the desired timeout and the current time,
+ * whichever is less. And use a real-time clock to get accurate uptime. */
+#define ZB_TIMEOUT_MAX ((UINT_MAX) / 4U)
+
+/* Returns current uptime in milliseconds.
+ * Special behaviour is that it never returns 0. Values are from 1 to ZB_UPTIME_MAX. */
+ZbUptimeT ZbUptime(void);
+
+unsigned int ZbTimeoutRemaining(ZbUptimeT now, ZbUptimeT expire_time);
+
+/*---------------------------------------------------------------
+ * ZigBee Timer
+ *---------------------------------------------------------------
+ */
+/* Opaque timer structure. */
+struct ZbTimerT;
+
+/* Creates a ZigBee timer structure. */
+struct ZbTimerT * ZbTimerAlloc(struct ZigBeeT *zb, void (*callback)(struct ZigBeeT *zb, void *cb_arg), void *arg);
+void ZbTimerChangeCallback(struct ZbTimerT *timer, void (*callback)(struct ZigBeeT *zb, void *cb_arg), void *arg);
+void ZbTimerStop(struct ZbTimerT *timer);
+void ZbTimerFree(struct ZbTimerT *timer);
+/* Resets and schedules a ZigBee timer. */
+void ZbTimerReset(struct ZbTimerT *timer, unsigned int timeout);
+bool ZbTimerRunning(struct ZbTimerT *timer);
+/* ZbTimerRemaining returns time remaining in mS for given timer, or UINT_MAX if timer is not running. */
+unsigned int ZbTimerRemaining(struct ZbTimerT *timer);
+
+/*---------------------------------------------------------------
+ * Asynchronous messaging filter API
+ *---------------------------------------------------------------
+ */
+/* Asynchronous message filter mask. */
+/* NWK Indications */
+#define ZB_MSG_FILTER_JOIN_IND 0x00000001U /* NLME-JOIN.indication (ZbNlmeJoinIndT) */
+#define ZB_MSG_FILTER_LEAVE_IND 0x00000002U /* NLME-LEAVE.indication (ZbNlmeLeaveIndT) */
+#define ZB_MSG_FILTER_STATUS_IND 0x00000004U /* NLME-NETWORK-STATUS.indication (ZbNlmeNetworkStatusIndT) */
+/* APS Indications */
+#define ZB_MSG_FILTER_TRANSPORT_KEY_IND 0x00000008U /* APSME-TRANSPORT-KEY.indication (ZbApsmeTransKeyIndT) */
+#define ZB_MSG_FILTER_UPDATE_DEVICE_IND 0x00000010U /* APSME-UPDATE-DEVICE.indication (ZbApsmeUpdateDeviceIndT) */
+#define ZB_MSG_FILTER_REMOVE_DEVICE_IND 0x00000020U /* APSME-REMOVE-DEVICE.indication (ZbApsmeRemoveDeviceIndT) */
+#define ZB_MSG_FILTER_REQUEST_KEY_IND 0x00000040U /* APSME-REQUEST-KEY.indication (ZbApsmeRequestKeyIndT) */
+#define ZB_MSG_FILTER_SWITCH_KEY_IND 0x00000080U /* APSME-SWITCH-KEY.indication (ZbApsmeSwitchKeyIndT) */
+#define ZB_MSG_FILTER_VERIFY_KEY_IND 0x00000100U /* APSME-VERIFY-KEY.indication (ZbApsmeVerifyKeyIndT) */
+#define ZB_MSG_FILTER_CONFIRM_KEY_IND 0x00000200U /* APSME-CONFIRM-KEY.indication (ZbApsmeConfirmKeyIndT) */
+/* Data Indications */
+#define ZB_MSG_FILTER_MCPS_DATA_IND 0x00000400U /* MCPS-DATA.indication (struct wpan_data_ind) */
+#define ZB_MSG_FILTER_NLDE_DATA_IND 0x00000800U /* NLDE-DATA.indication (ZbNldeDataIndT) */
+#define ZB_MSG_FILTER_APSDE_DATA_IND 0x00001000U /* APSDE-DATA.indication (ZbApsdeDataIndT) */
+/* Startup Indications */
+#define ZB_MSG_FILTER_STARTUP_IND 0x00002000U /* (struct ZbMsgStartupInd) */
+/* Note, max filter bit we can specify here is 0x00008000U */
+
+/* Groups of messages that are filterable. */
+#define ZB_MSG_FILTER_NLME \
+ (ZB_MSG_FILTER_JOIN_IND | ZB_MSG_FILTER_LEAVE_IND | ZB_MSG_FILTER_STATUS_IND)
+
+#define ZB_MSG_FILTER_APSME \
+ (ZB_MSG_FILTER_TRANSPORT_KEY_IND | ZB_MSG_FILTER_UPDATE_DEVICE_IND | ZB_MSG_FILTER_REMOVE_DEVICE_IND | \
+ ZB_MSG_FILTER_REQUEST_KEY_IND | ZB_MSG_FILTER_SWITCH_KEY_IND | ZB_MSG_FILTER_VERIFY_KEY_IND | \
+ ZB_MSG_FILTER_CONFIRM_KEY_IND)
+
+/* Message filter priorities (255 = highest, 0 = lowest) */
+#define ZB_MSG_INTERNAL_PRIO 128 /* default stack priority */
+#define ZB_MSG_DEFAULT_PRIO 64 /* default application priority */
+
+/* Message filter return values. */
+#define ZB_MSG_CONTINUE 0 /* Continue processing any further filter callbacks. */
+#define ZB_MSG_DISCARD 1 /* Stop processing further filter callbacks. */
+
+struct ZbApsFilterT;
+struct ZbMsgFilterT * ZbMsgFilterRegister(struct ZigBeeT *zb, uint32_t mask, uint8_t prio,
+ int (*callback)(struct ZigBeeT *zb, uint32_t id, void *msg, void *cbarg), void *arg);
+void ZbMsgFilterRemove(struct ZigBeeT *zb, struct ZbMsgFilterT *filter);
+
+struct ZbMsgStartupInd {
+ enum ZbStatusCodeT status;
+};
+
+/*---------------------------------------------------------
+ * Persistence
+ *---------------------------------------------------------
+ */
+unsigned int ZbPersistGet(struct ZigBeeT *zb, uint8_t *buf, unsigned int maxlen);
+bool ZbPersistNotifyRegister(struct ZigBeeT *zb, void (*callback)(struct ZigBeeT *zb, void *cbarg), void *cbarg);
+
+/*---------------------------------------------------------
+ * ZED Shutdown
+ *---------------------------------------------------------
+ */
+/*FUNCTION:------------------------------------------------------
+ * NAME
+ * ZbShutdown
+ * DESC
+ * This API moves the stack to shutdown mode, used in case of
+ * a sleepy end device to conserve power.
+ * PARAMS
+ * zb ; ZigBee stack instance pointer
+ * mask ; Log mask of the debug messages you wish to receive.
+ * RETURNS
+ * none
+ *---------------------------------------------------------------
+ */
+void ZbShutdown(struct ZigBeeT *zb);
+
+/*---------------------------------------------------------------
+ * Test Case Hooks
+ *---------------------------------------------------------------
+ */
+/* These represent bits in a 32-bit bitmask. */
+enum ZbTestcaseT {
+ ZB_TESTCASE_NONE = 0,
+ ZB_TESTCASE_SE1X_15_47, /* Server sends a truncated INITIATE_KEY response */
+ ZB_TESTCASE_SE1X_15_48, /* Client sends a truncated EPHEMERAL_DATA request */
+ ZB_TESTCASE_CBKE_DELAY_EPH_DATA, /* e.g. SE 1.4 test case 15.25 */
+ ZB_TESTCASE_CBKE_DELAY_RESPONSE, /* e.g. SE 1.4 test case 15.26 */
+ ZB_TESTCASE_GB868_EBR_06, /* Bogus EBR */
+ /* Override tx power management in the MAC and always set a minimum
+ * power level. Useful for co-ax testing to prevent cross-talk. */
+ ZB_TESTCASE_GB868_MIN_TX_POWER,
+ ZB_TESTCASE_LINKPOWER_DROP_NOTIFY,
+ ZB_TESTCASE_LINKPOWER_DROP_REQUEST,
+ ZB_TESTCASE_REJOIN_DROP_RSP,
+ ZB_TESTCASE_REJOIN_RETURN_FULL,
+ ZB_TESTCASE_EDKA_DROP_REQUEST,
+ ZB_TESTCASE_ASSOC_RSP_FULL,
+ ZB_TESTCASE_TOUCHLINK_DEBUG_KEY,
+ ZB_TESTCASE_ZED_STACK_SHUTDOWN
+};
+
+/* External API */
+void ZbTestCaseEnable(struct ZigBeeT *zb, enum ZbTestcaseT testcase);
+void ZbTestCaseDisable(struct ZigBeeT *zb, enum ZbTestcaseT testcase);
+void ZbTestCaseClear(struct ZigBeeT *zb);
+uint32_t ZbTestCaseCurrent(struct ZigBeeT *zb);
+
+/* Should only be required for the stack */
+bool ZbTestCaseIsEnabled(struct ZigBeeT *zb, enum ZbTestcaseT testcase);
+
+/*---------------------------------------------------------------
+ * Misc. Helper Functions
+ *---------------------------------------------------------------
+ */
+uint64_t ZbExtendedAddress(struct ZigBeeT *zb);
+uint16_t ZbShortAddress(struct ZigBeeT *zb);
+
+/* Total memory allocated from the heap. */
+unsigned int ZbMallocTotalSz(void);
+
+/* Memory allocated from the internal ZigBee heap. */
+unsigned long ZbHeapUsed(struct ZigBeeT *zb);
+
+unsigned long ZbHeapHighWaterMark(struct ZigBeeT *zb);
+
+/*
+ * Dumps outstanding memory allocation information.
+ * If printfCb is NULL, output is sent to log output provided by
+ * ZbSetLogging.
+ */
+typedef void (*ZbHeapDumpCallbackT)(void *cbarg, const char *fmt, ...);
+void ZbHeapDumpMemAllocTbl(struct ZigBeeT *zb, ZbHeapDumpCallbackT callback, void *cbarg);
+
+/*---------------------------------------------------------------
+ * Additional Layer Includes
+ *---------------------------------------------------------------
+ */
+#include "zigbee.security.h"
+#include "zigbee.bdb.h"
+#include "zigbee.aps.h"
+#include "zigbee.nwk.h"
+#include "zigbee.startup.h"
+#include "zigbee.zdo.h"
+
+#endif /* ZIGBEE_H */
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.nwk.h b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.nwk.h
new file mode 100644
index 000000000..b3ef5034a
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.nwk.h
@@ -0,0 +1,818 @@
+/* Copyright [2009 - 2019] Exegin Technologies Limited. All rights reserved. */
+
+#ifndef ZIGBEE_NWK_H
+# define ZIGBEE_NWK_H
+
+/*---------------------------------------------------------------
+ * Misc. Definitions and Structures
+ *---------------------------------------------------------------
+ */
+#define ZbNwkAddrIsBcast(_addr_) (((_addr_) >= (uint16_t)ZB_NWK_ADDR_BCAST_MIN) && ((_addr_) != (uint16_t)ZB_NWK_ADDR_USE_EXT))
+
+/* Special NWK addresses. */
+#define ZB_NWK_ADDR_COORDINATOR (uint16_t)0x0000U
+#define ZB_NWK_ADDR_BCAST_MIN (uint16_t)0xfff8U
+#define ZB_NWK_ADDR_BCAST_LOW_POWER_ROUTERS (uint16_t)0xfffbU
+#define ZB_NWK_ADDR_BCAST_ROUTERS (uint16_t)0xfffcU
+#define ZB_NWK_ADDR_BCAST_RXON (uint16_t)0xfffdU
+#define ZB_NWK_ADDR_USE_EXT (uint16_t)0xfffeU /* IEEE802154_ADDR_SHORT_NONE */
+#define ZB_NWK_ADDR_BCAST_ALL (uint16_t)0xffffU /* IEEE802154_ADDR_SHORT_BCAST */
+#define ZB_NWK_ADDR_UNDEFINED (uint16_t)0xffffU /* IEEE802154_ADDR_SHORT_BCAST */
+
+/* ZigBee Stack Profiles (StackProfile or nwkStackProfile) */
+enum {
+ ZB_NWK_STACK_PROFILE_NWKSPFC = 0x00,
+ ZB_NWK_STACK_PROFILE_HOME = 0x01,
+ ZB_NWK_STACK_PROFILE_PRO = 0x02,
+ ZB_NWK_STACK_PROFILE_PLANTCTRL = 0x03
+};
+
+/* Address allocation methods (nwkAddrAlloc) */
+enum nwkAddrAllocMethod {
+ ZB_NWK_ADDR_ALLOC_DISTRIB = 0x00,
+ ZB_NWK_ADDR_ALLOC_RESERVED = 0x01,
+ ZB_NWK_ADDR_ALLOC_STOCHASTIC = 0x02
+};
+
+/* Status codes for network status indications. */
+enum ZbNwkNetworkStatusCodeT {
+ ZB_NWK_STATUS_CODE_NO_ROUTE_AVAILABLE = 0x00,
+ ZB_NWK_STATUS_CODE_TREE_LINK_FAILURE = 0x01,
+ ZB_NWK_STATUS_CODE_NON_TREE_LINK_FAILURE = 0x02,
+ ZB_NWK_STATUS_CODE_LOW_BATTERY = 0x03,
+ ZB_NWK_STATUS_CODE_NO_ROUTING_CAPACITY = 0x04,
+ ZB_NWK_STATUS_CODE_NO_INDIRECT_CAPACITY = 0x05,
+ ZB_NWK_STATUS_CODE_INDIRECT_EXPIRY = 0x06,
+ ZB_NWK_STATUS_CODE_TARGET_UNAVAILABLE = 0x07,
+ ZB_NWK_STATUS_CODE_TARGET_UNALLOCATED = 0x08,
+ ZB_NWK_STATUS_CODE_PARENT_LINK_FAILURE = 0x09,
+ ZB_NWK_STATUS_CODE_VALIDATE_ROUTE = 0x0a,
+ ZB_NWK_STATUS_CODE_SOURCE_ROUTE_FAILURE = 0x0b,
+ ZB_NWK_STATUS_CODE_MANY_TO_ONE_FAILURE = 0x0c,
+ ZB_NWK_STATUS_CODE_ADDRESS_CONFLICT = 0x0d,
+ ZB_NWK_STATUS_CODE_VERIFY_ADDRESS = 0x0e,
+ ZB_NWK_STATUS_CODE_PANID_UPDATE = 0x0f,
+ ZB_NWK_STATUS_CODE_ADDRESS_UPDATE = 0x10,
+ ZB_NWK_STATUS_CODE_BAD_FRAME_COUNTER = 0x11,
+ ZB_NWK_STATUS_CODE_BAD_KEY_SEQNUM = 0x12,
+ ZB_NWK_STATUS_CODE_UNKNOWN_COMMAND = 0x13
+};
+
+/* NWK DstAddrMode values */
+enum ZbNwkAddrModeT {
+ ZB_NWK_ADDRMODE_NONE = 0,
+ ZB_NWK_ADDRMODE_MCAST, /* 1 - deprecated by R23 */
+ ZB_NWK_ADDRMODE_SHORT, /* 2 */
+ ZB_NWK_ADDRMODE_EXT /* 3 - for InterPAN */
+};
+
+/* NWK IB Attributes */
+enum ZbNwkNibAttrIdT {
+ ZB_NWK_NIB_ID_PanId = 0x80, /* 0x80 ZigBee 2007+ */
+ ZB_NWK_NIB_ID_SequenceNumber = 0x81,
+ ZB_NWK_NIB_ID_PassiveAckTimeout = 0x82,
+ ZB_NWK_NIB_ID_MaxBroadcastRetries = 0x83,
+ ZB_NWK_NIB_ID_MaxChildren = 0x84,
+ ZB_NWK_NIB_ID_MaxDepth = 0x85,
+ ZB_NWK_NIB_ID_MaxRouters = 0x86,
+ /* Warning, the stack implements the NNT as a sorted list by NWK Address.
+ * If an entry is set through the NIB, it is inserted into the list sorted.
+ * It is generally a bad idea for an application to modify the NNT directly.
+ * Use ZbNwkNeighborClearAll to clear all entries (or all except parent, e.g.
+ * before end-device rejoin).
+ * FIXME 1 - This NIB should be made read-only. */
+ ZB_NWK_NIB_ID_NeighborTable = 0x87,
+ /* Time duration in seconds (Note, the Spec defines this as OctetDurations) */
+ ZB_NWK_NIB_ID_NetworkBroadcastDeliveryTime = 0x88,
+ ZB_NWK_NIB_ID_ReportConstantCost = 0x89,
+ ZB_NWK_NIB_ID_RouteDiscoveryRetriesPermitted = 0x8a,
+ ZB_NWK_NIB_ID_RouteTable = 0x8b,
+ ZB_NWK_NIB_ID_TimeStamp = 0x8c,
+ ZB_NWK_NIB_ID_TxTotal = 0x8d, /* FIXME - make TxTotal a per interface thing */
+ ZB_NWK_NIB_ID_SymLink = 0x8e,
+ ZB_NWK_NIB_ID_CapabilityInformation = 0x8f,
+ ZB_NWK_NIB_ID_AddrAlloc = 0x90,
+ ZB_NWK_NIB_ID_UseTreeRouting = 0x91,
+ ZB_NWK_NIB_ID_ManagerAddr = 0x92,
+ ZB_NWK_NIB_ID_MaxSourceRoute = 0x93,
+ ZB_NWK_NIB_ID_UpdateId = 0x94,
+ ZB_NWK_NIB_ID_TransactionPersistenceTime = 0x95,
+ /* ZigBee 2006+ Attributes */
+ ZB_NWK_NIB_ID_NetworkAddress = 0x96,
+ ZB_NWK_NIB_ID_StackProfile = 0x97,
+ ZB_NWK_NIB_ID_BroadcastTransactionTable = 0x98,
+ ZB_NWK_NIB_ID_GroupIdTable = 0x99,
+ ZB_NWK_NIB_ID_ExtendedPanId = 0x9a,
+ /* ZigBee 2007+ Attributes */
+ ZB_NWK_NIB_ID_UseMulticast = 0x9b,
+ ZB_NWK_NIB_ID_RouteRecordTable = 0x9c,
+ ZB_NWK_NIB_ID_IsConcentrator = 0x9d,
+ ZB_NWK_NIB_ID_ConcentratorRadius = 0x9e,
+ ZB_NWK_NIB_ID_ConcentratorDiscoveryTime = 0x9f, /* units: seconds */
+ /* ZigBee Security Attributes */
+ ZB_NWK_NIB_ID_SecurityLevel = 0xa0,
+ ZB_NWK_NIB_ID_SecurityMaterialSet = 0xa1,
+ ZB_NWK_NIB_ID_ActiveKeySeqNumber = 0xa2,
+ /* nwkAllFresh has been deprecated (0xa3) */
+ /* ...discontinuity... */
+ ZB_NWK_NIB_ID_SecureAllFrames = 0xa5,
+ /* ZigBee 2007+ Attributes (cont'd). */
+ ZB_NWK_NIB_ID_LinkStatusPeriod = 0xa6,
+ ZB_NWK_NIB_ID_RouterAgeLimit = 0xa7,
+ ZB_NWK_NIB_ID_UniqueAddr = 0xa8,
+ ZB_NWK_NIB_ID_AddressMap = 0xa9,
+ /* ...continued in zigbee.aps.h with ZB_APS_IB_ID_DEVICE_KEY_PAIR_SET... */
+
+ /* 0x400 to 0x4ff reserved for custom NIBs. */
+ ZB_NWK_NIB_ID_Depth = 0x0400,
+ ZB_NWK_NIB_ID_FrameCounterSet,
+ /* Adds a delay in milliseconds between receiving the first RREP
+ * and sending any pending packets awaiting the completion of route
+ * discovery. Default is 0, meaning packets are sent after the
+ * first RREP is received. If a better route is discovered later on,
+ * subsequent packets will use the better route. */
+ ZB_NWK_NIB_ID_RouteDiscoverySendDelay,
+ ZB_NWK_NIB_ID_FastPollPeriod, /* Only used as sleepy end devices to set the fast polling inverval. */
+ ZB_NWK_NIB_ID_SlowPollPeriod,
+ ZB_NWK_NIB_ID_FrameCounterCooldown, /* Cooldown timer (in seconds) to apply to frame counter resets. */
+ ZB_NWK_NIB_ID_OutgoingCounter, /* Global outgoing frame counter. */
+ ZB_NWK_NIB_ID_PersistCounter, /* Persisted outgoing frame counter. */
+
+ /* R21+ attributes */
+ /* FIXME 2 - The following NIBs should have IDs from 0xaa to 0xad, but
+ * these are already being used by APS security. I think the only place
+ * this would be a problem is the Gateway API which has a single generic
+ * GET/SET API, which means attribute IDs must be unique and not overlap. */
+ ZB_NWK_NIB_ID_LeaveRequestAllowed,
+ ZB_NWK_NIB_ID_ParentInformation,
+ ZB_NWK_NIB_ID_EndDeviceTimeoutDefault,
+ ZB_NWK_NIB_ID_EdkaFailThreshold, /* Number of consecutive EDKA request failures before triggering a PARENT_LINK_FAILURE. Valid range is 1 to 4. Default is 1. */
+ ZB_NWK_NIB_ID_LeaveRequestWithoutRejoinAllowed,
+ ZB_NWK_NIB_ID_DisablePeriodicTimers, /* If set, NWK layer disables edka & link power timers. Default is 0 (enabled). */
+
+ /* R22+ attributes */
+ /* FIXME 2 - nwkIeeeAddress (should be 0xae, but already being used by APS security) */
+ /* FIXME 2 - nwkMacInterfaceTable (should be 0xaf, but already being used by APS security) */
+ ZB_NWK_NIB_ID_TxPowerMgmtSupported, /* not affected by nwk_reset_nib, keeps value. */
+ ZB_NWK_NIB_ID_LinkPowerDeltaPeriod,
+
+ /* R22 MAC PIB Attributes that are maintained by our NWK layer, since we support multiple interfaces. */
+ ZB_NWK_NIB_ID_JoiningListUpdateId, /* IeeeJoiningListUpdateID [uint8_t] */
+ ZB_NWK_NIB_ID_JoiningPolicy, /* mibJoiningPolicy [uint8_t] */
+ ZB_NWK_NIB_ID_JoiningListTotal, /* IeeeJoiningListTotal [uint8_t] */
+ ZB_NWK_NIB_ID_JoiningListExpiryInterval, /* mibIeeeExpiryInterval minutes [uint16_t] */
+ /* mibIeeeExpiryIntervalCountdown is not externally accessible */
+
+ ZB_NWK_NIB_ID_ActiveChannelList, /* struct ZbChannelListT - Get only. */
+ ZB_NWK_NIB_ID_PermitJoinCounter, /* uint8_t - Get only. Set through ZbNlmePermitJoinReq */
+ ZB_NWK_NIB_ID_DiscoveryTable, /* struct ZbNwkDiscoveryInfoT - Get only. */
+
+ ZB_NWK_NIB_ID_PassiveAckEnabled /* uint8_t - Enable/Disable Broadcast Passive ACK */
+};
+
+/* Possible values for ZbNlmeJoinReqT.rejoinNetwork */
+enum ZbNwkRejoinTypeT {
+ ZB_NWK_REJOIN_TYPE_ASSOC = 0x00,
+ ZB_NWK_REJOIN_TYPE_ORPHAN,
+ ZB_NWK_REJOIN_TYPE_NWKREJOIN
+};
+
+/* Maximum link cost. */
+#define ZB_NWK_LINK_COST_MAX 7U
+
+/* NWK Constants */
+#if 0 /* not used */
+#define ZB_NWK_CONST_COORDINATOR_CAPABLE true
+#endif
+#define ZB_NWK_CONST_SECURITY_LEVEL 0x05U
+#define ZB_NWK_CONST_DISCOVERY_RETRY_LIMIT 0x03U
+#define ZB_NWK_CONST_MAX_DEPTH 0x0fU
+#define ZB_NWK_CONST_MIN_HEADER_OVERHEAD 0x08U
+#define ZB_NWK_CONST_PROTOCOL_VERSION ZB_PROTOCOL_VERSION_2007
+#define ZB_NWK_CONST_WAIT_BEFORE_VALIDATION 0x500U /* In ms. */
+#define ZB_NWK_CONST_REPAIR_THRESHOLD 0x03U
+#define ZB_NWK_CONST_ROUTE_DISCOVERY_TIME 0x2710U /* In ms. (10 seconds) */
+#define ZB_NWK_CONST_MAX_BROADCAST_JITTER 0x40U /* In ms. */
+#define ZB_NWK_CONST_INITIAL_RREQ_RETRIES 0x03U
+#define ZB_NWK_CONST_RREQ_RETRIES 0x02U
+#define ZB_NWK_CONST_RREQ_RETRY_INTERVAL 0xfeU /* In ms. */
+#define ZB_NWK_CONST_MIN_RREQ_JITTER 0x01U /* In 2 ms slots. */
+#define ZB_NWK_CONST_MAX_RREQ_JITTER 0x40U /* In 2 ms slots. */
+#define ZB_NWK_CONST_MAC_FRAME_OVERHEAD 0x0bU /* See D.4 of 053474r17. */
+/* The following are added by Exegin */
+#define ZB_NWK_CONST_SECURITY_OVERHEAD (14U + ZB_SEC_MIC_LENGTH_5)
+#define ZB_NWK_CONST_MAX_PAYLOAD_SIZE (WPAN_CONST_MAX_PHY_PACKET_SIZE - ZB_NWK_CONST_MIN_HEADER_OVERHEAD - ZB_NWK_CONST_MAC_FRAME_OVERHEAD)
+
+#define ZB_NWK_BCNPAYLOAD_MIN_SIZE 15U
+#define ZB_NWK_ENH_BCNPAYLOAD_SIZE 19U
+
+/* Upper bound on nwkMaxSourceRoute */
+#define ZB_NWK_CONST_MAX_SOURCE_ROUTE 12U /* 0x0c */
+/* The smaller the potential hop count, the larger packets we can send. */
+#define ZB_NWK_CONST_DEFAULT_SOURCE_ROUTE 6U
+
+#define ZB_NWK_CONST_ENDDEV_TIMEOUT_MAX 14U
+#define ZB_NWK_CONST_ENDDEV_TIMEOUT_DEFAULT 8U
+#define ZB_NWK_CONST_ENDDEV_TIMEOUT_DISABLED 0xffU
+
+/* NWK Security Material Set (ZB_NWK_NIB_ID_SecurityMaterialSet) */
+typedef struct {
+ bool valid;
+ uint8_t keySeqNumber;
+ uint8_t key[ZB_SEC_KEYSIZE];
+ enum ZbSecKeyTypeT keyType;
+} ZbNwkSecMaterialT;
+
+/* Frame Counter Attribute Set (ZB_NWK_NIB_ID_FrameCounterSet) */
+typedef struct {
+ uint8_t keySeqNumber;
+ uint64_t senderAddr;
+ uint32_t counter;
+ ZbUptimeT cooldown; /* Cooldown timer for counter resets. */
+ ZbUptimeT lastUsed; /* Timer for LRU evictions. */
+ uint32_t persistCounter; /* Last saved counter value */
+} ZbNwkFrameCounterT;
+
+typedef struct {
+ unsigned int recordsSent;
+ bool doSendNext; /* Send Route Record before next tx */
+ bool doRenew; /* Whether to renew sending a Route Record after renewTime. */
+ ZbUptimeT renewTime;
+} ZbNwkRouteRecordInfoT;
+
+/* NNT Discovery Parameters (ZB_NWK_NIB_ID_DiscoveryTable) */
+struct ZbNwkDiscoveryInfoT {
+ uint16_t panId;
+ uint64_t epid;
+ uint8_t channelPage;
+ uint16_t logicalChannel;
+ uint8_t protocolVersion;
+ uint8_t stackProfile;
+ uint8_t nwkDepth;
+ bool useSecurity;
+ bool permitJoin;
+ bool routerCapacity;
+ bool endDevCapacity;
+ bool potentialParent;
+ uint8_t updateId;
+ uint8_t lqi; /* mirror of ZbNwkNeighborT.lqi value */
+
+ /* Exegin add-ons */
+ uint8_t beaconOrder;
+ uint8_t superframeOrder;
+ /* Duplicates of ZbNwkNeighborT. Only used by ZB_NWK_NIB_ID_DiscoveryTable */
+ uint16_t nwkAddr; /* Entry is empty if == ZB_NWK_ADDR_UNDEFINED */
+};
+
+/*
+ * Neighbor Table Entry
+ *
+ * Contains all the mandatory fields that are used during normal
+ * network operation. This is maintained in the NIB, all entries
+ * are assumed to be on the same network as the local device.
+ */
+
+/* Device Type definitions. */
+enum ZbNwkNeighborTypeT {
+ ZB_NWK_NEIGHBOR_TYPE_COORD = 0x00,
+ ZB_NWK_NEIGHBOR_TYPE_ROUTER = 0x01,
+ ZB_NWK_NEIGHBOR_TYPE_END_DEV = 0x02,
+ ZB_NWK_NEIGHBOR_TYPE_UNKNOWN = 0x03
+};
+
+/* Device Relationship definitions. */
+enum ZbNwkNeighborRelT {
+ ZB_NWK_NEIGHBOR_REL_PARENT = 0x00,
+ ZB_NWK_NEIGHBOR_REL_CHILD = 0x01,
+ ZB_NWK_NEIGHBOR_REL_SIBLING = 0x02,
+ ZB_NWK_NEIGHBOR_REL_NONE = 0x03,
+ ZB_NWK_NEIGHBOR_REL_PREV_CHILD = 0x04,
+ ZB_NWK_NEIGHBOR_REL_UNAUTH_CHILD = 0x05,
+ /* Temporary values to use during association. */
+ ZB_NWK_NEIGHBOR_REL_PEND_ASSOCIATE = 0x06,
+ ZB_NWK_NEIGHBOR_REL_PEND_ORPHAN = 0x07
+};
+
+/* Parent Information is one byte. We extend it to two bytes for internal state. */
+#define ZB_NWK_PARENT_INFO_MASK 0x0007U
+#define ZB_NWK_PARENT_INFO_DATA_POLL 0x0001U /* MAC Data Poll Keepalive Supported */
+#define ZB_NWK_PARENT_INFO_KEEP_ALIVE 0x0002U /* End Device Timeout Request Keepalive Supported */
+#define ZB_NWK_PARENT_INFO_POWER_NEGOT 0x0004U /* Power Negotiation Supported (R22: Link Power Delta) */
+/* Exegin add-on to track the status of parent info */
+#define ZB_NWK_PARENT_INFO_START 0x0100U
+
+#define ZB_NWK_NEIGHBOR_TIMEOUT_SECONDS(_x_) ((_x_ != 0U) ? ((ZbUptimeT)60U << (_x_)) : (ZbUptimeT)10U)
+#define ZB_NWK_NEIGHBOR_TIMEOUT_MAX 14U
+
+#define ZB_NWK_NEIGHBOR_IFINDEX_UNKNOWN 0xffU
+
+typedef struct {
+ /*** Mandatory Neighbor Table Entries */
+ uint64_t extAddr;
+ uint16_t nwkAddr; /* Set to ZB_NWK_ADDR_UNDEFINED to invalidate entry */
+ uint8_t capability;
+ enum ZbNwkNeighborTypeT deviceType;
+ bool rxOnWhenIdle; /* FIXME 1 - why not just use capability? */
+ enum ZbNwkNeighborRelT relationship;
+ uint8_t txFailure;
+ uint8_t lqi; /* Average LQI. */
+ int8_t unicastRssi; /* Average RSSI when sent as unicast. For power control. */
+ uint8_t outgoingCost; /* ZigBee 2007. */
+ uint8_t age; /* ZigBee 2007. */
+ uint8_t interval; /* R21 draft. */
+ ZbUptimeT timeout; /* R21 draft. Disabled if zero. */
+ uint8_t ifc_index; /* R22 - set to ZB_NWK_NEIGHBOR_IFINDEX_UNKNOWN if not known (e.g. after persistence) */
+} ZbNwkNeighborT;
+
+/*
+ * Routing Table Entry
+ */
+
+/* Route status values (2.7.3.2) */
+enum ZbNwkRouteStatusT {
+ ZB_NWK_ROUTE_STATUS_ACTIVE = 0x00,
+ ZB_NWK_ROUTE_STATUS_DISCOVERY_UNDERWAY = 0x01,
+ ZB_NWK_ROUTE_STATUS_DISCOVERY_FAILED = 0x02,
+ ZB_NWK_ROUTE_STATUS_INACTIVE = 0x03,
+ ZB_NWK_ROUTE_STATUS_VALIDATION_UNDERWAY = 0x04
+};
+
+#define ZB_NWK_ROUTE_RECORD_RENEWAL_TIMEOUT (60U * 1000U) /* ms */
+#define ZB_NWK_ROUTE_RECORD_POST_SLEEP (20U) /* ms */
+
+typedef struct {
+ enum ZbNwkRouteStatusT status;
+ bool noCache; /* flag indicating destination doesn't store source routes. */
+ bool isManyToOne; /* flag indicating if destination is a concentrator */
+ bool isMcast; /* flag indicating if destination is a group ID. */
+ ZbNwkRouteRecordInfoT routeRecord;
+ uint16_t destAddr;
+ uint16_t nextAddr;
+ ZbUptimeT lastUsed; /* Used to measure route table ageing. */
+ uint8_t cost; /* Currently not being used. */
+} ZbNwkRouteEntryT;
+
+/*---------------------------------------------------------------
+ * NLDE
+ *---------------------------------------------------------------
+ */
+/* NLDE-DATA.request */
+typedef struct {
+ enum ZbNwkAddrModeT dstAddrMode;
+ uint8_t nonMemberRadius;
+ uint16_t dstAddr;
+ const void *nsdu;
+ uint8_t nsduLength;
+ uint32_t handle;
+ uint8_t radius;
+ uint8_t discoverRoute;
+ bool security;
+ /* Alias */
+ bool useAlias;
+ uint16_t aliasAddr;
+ uint8_t aliasSeqnum;
+} ZbNldeDataReqT;
+
+/* NLDE-DATA.confirm */
+typedef struct {
+ uint32_t handle;
+ enum ZbStatusCodeT status;
+} ZbNldeDataConfT;
+
+/* NLDE-DATA.indication */
+typedef struct {
+ enum ZbNwkAddrModeT dstAddrMode;
+ uint16_t dstAddr;
+ uint16_t srcAddr;
+ uint16_t linkAddr; /* Exegin add-on for Intra-PAN portability. */
+ uint8_t nsdu[ZB_NWK_CONST_MAX_PAYLOAD_SIZE];
+ uint8_t nsduLength;
+ uint8_t linkQuality;
+ int8_t rssi;
+ bool useSecurity;
+} ZbNldeDataIndT;
+
+void ZbNldeDataReqWait(struct ZigBeeT *zb, ZbNldeDataReqT *req, ZbNldeDataConfT *conf);
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbNldeDataReqCallback(struct ZigBeeT *zb, ZbNldeDataReqT *req,
+ void (*callback)(ZbNldeDataConfT *dataConf, void *cb_arg), void *arg);
+
+/* NLDE-FRAME.request */
+/* Exegin addon for RAW MAC frame transmission. */
+typedef struct {
+ enum ZbNwkAddrModeT dstAddrMode;
+ enum ZbNwkAddrModeT srcAddrMode;
+ uint16_t dstAddr16;
+ uint64_t dstAddr64;
+ uint16_t dstPanId;
+ uint8_t txOptions;
+ const void *msdu;
+ uint8_t msduLength;
+ uint32_t handle;
+} ZbNldeFrameReqT;
+
+typedef ZbNldeDataConfT ZbNldeFrameConfT;
+
+void ZbNldeFrameReqWait(struct ZigBeeT *zb, ZbNldeFrameReqT *req, ZbNldeFrameConfT *conf);
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbNldeFrameReqCallback(struct ZigBeeT *zb, ZbNldeFrameReqT *req,
+ void (*callback)(ZbNldeFrameConfT *FrameConf, void *cb_arg), void *arg);
+
+/*---------------------------------------------------------------
+ * NLME
+ *---------------------------------------------------------------
+ */
+/* NLME-GET.request */
+typedef struct {
+ enum ZbNwkNibAttrIdT attrId;
+ void *attr; /* Buffer for attribute data */
+ unsigned int attrLength; /* Max length of input, actual length returned */
+ unsigned int attrIndex;
+} ZbNlmeGetReqT;
+
+/* NLME-GET.confirm */
+typedef struct {
+ enum ZbStatusCodeT status;
+ enum ZbNwkNibAttrIdT attrId;
+} ZbNlmeGetConfT;
+
+/* NLME-SET.request */
+typedef struct {
+ enum ZbNwkNibAttrIdT attrId;
+ const void *attr;
+ unsigned int attrLength;
+ unsigned int attrIndex;
+} ZbNlmeSetReqT;
+
+/* NLME-SET.confirm */
+typedef struct {
+ enum ZbStatusCodeT status;
+ enum ZbNwkNibAttrIdT attrId;
+} ZbNlmeSetConfT;
+
+/* NLME-RESET.request */
+typedef struct {
+ bool warmStart;
+} ZbNlmeResetReqT;
+
+/* NLME-RESET.confirm */
+typedef struct {
+ enum ZbStatusCodeT status;
+} ZbNlmeResetConfT;
+
+/* NLME-SYNC.request */
+typedef struct {
+ bool track;
+} ZbNlmeSyncReqT;
+
+/* NLME-SYNC.confirm */
+typedef struct {
+ enum ZbStatusCodeT status;
+} ZbNlmeSyncConfT;
+
+/* NLME-SYNC.indication */
+typedef struct {
+ void *voidPtr; /* empty */
+} ZbNlmeSyncIndT;
+
+/* NLME-NETWORK-FORMATION.request */
+typedef struct {
+ struct ZbChannelListT scanChannels;
+ uint8_t scanDuration;
+ uint8_t beaconOrder;
+ uint8_t superframeOrder;
+ uint8_t batteryLifeExtension;
+ bool distributed;
+} ZbNlmeNetFormReqT;
+
+/* NLME-NETWORK-FORMATION.confirm */
+typedef struct {
+ enum ZbStatusCodeT status;
+} ZbNlmeNetFormConfT;
+
+/* NLME-NETWORK-DISCOVERY.request */
+typedef struct {
+ struct ZbChannelListT scanChannels;
+ uint8_t scanDuration;
+} ZbNlmeNetDiscReqT;
+
+/* NLME-NETWORK-DISCOVERY.confirm */
+typedef struct {
+ enum ZbStatusCodeT status;
+ /* Use ZB_NWK_NIB_ID_DiscoveryTable to retrieve the discovery table entries. */
+} ZbNlmeNetDiscConfT;
+
+/* NLME-PERMIT-JOIN.request */
+typedef struct {
+ uint8_t permitDuration;
+} ZbNlmePermitJoinReqT;
+
+/* NLME-PERMIT-JOIN.confirm */
+typedef struct {
+ enum ZbStatusCodeT status;
+} ZbNlmePermitJoinConfT;
+
+/* NLME-JOIN.request */
+typedef struct {
+ uint64_t epid;
+ enum ZbNwkRejoinTypeT rejoinNetwork;
+ struct ZbChannelListT scanChannels;
+ uint8_t scanDuration;
+ uint8_t capabilityInformation; /* e.g. MCP_ASSOC_CAP_DEV_TYPE */
+ bool securityEnable;
+} ZbNlmeJoinReqT;
+
+/* NLME-JOIN.confirm */
+typedef struct {
+ enum ZbStatusCodeT status;
+ uint16_t nwkAddr;
+} ZbNlmeJoinConfT;
+
+/* NLME-JOIN.indication */
+typedef struct {
+ uint16_t nwkAddr;
+ uint64_t extAddr;
+ uint8_t capabilityInfo;
+ enum ZbNwkRejoinTypeT rejoinNetwork;
+ bool secureRejoin;
+} ZbNlmeJoinIndT;
+
+/* NLME-DIRECT-JOIN.request */
+typedef struct {
+ uint64_t deviceAddr;
+ uint16_t nwkAddr; /* Exegin addon - set to ZB_NWK_ADDR_UNDEFINED if not used. */
+ uint8_t capabilityInfo;
+ uint8_t interval;
+} ZbNlmeDirectJoinReqT;
+
+/* NLME-DIRECT-JOIN.confirm */
+typedef struct {
+ uint64_t deviceAddr;
+ enum ZbStatusCodeT status;
+} ZbNlmeDirectJoinConfT;
+
+/* NLME-LEAVE.request */
+typedef struct {
+ uint64_t deviceAddr;
+ bool removeChildren;
+ bool rejoin;
+} ZbNlmeLeaveReqT;
+
+/* NLME-LEAVE.confirm */
+typedef struct ZbNlmeLeaveConfT {
+ uint64_t deviceAddr;
+ enum ZbStatusCodeT status;
+} ZbNlmeLeaveConfT;
+
+/* NLME-LEAVE.indication */
+typedef struct {
+ uint64_t deviceAddr;
+ bool rejoin;
+ /* Exegin extension */
+ uint16_t shortAddr;
+ /* Is one of our children leaving? By the time the NHLE has received this, the device
+ * has likely been removed as one of our children from the NNT. */
+ enum ZbNwkNeighborRelT relationship;
+} ZbNlmeLeaveIndT;
+
+/* NLME-START-ROUTER.request */
+typedef struct {
+ uint8_t beaconOrder;
+ uint8_t superframeOrder;
+ uint8_t battLifeExtension;
+ struct ZbChannelListT scanChannels;
+} ZbNlmeStartRouterReqT;
+
+/* NLME-START-ROUTER.confirm */
+typedef struct {
+ enum ZbStatusCodeT status;
+} ZbNlmeStartRouterConfT;
+
+/* NLME-ED-SCAN.request */
+typedef struct {
+ uint32_t channelMask; /* Channel Page Structure [PAGE|MASK] */
+ uint8_t scanDuration;
+} ZbNlmeEdScanReqT;
+
+/* NLME-ED-SCAN.confirm */
+typedef struct {
+ uint32_t unscannedChannels;
+ uint8_t energyDetectList[WPAN_PAGE_CHANNELS_MAX];
+ enum ZbStatusCodeT status;
+} ZbNlmeEdScanConfT;
+
+/* NLME-ROUTE-DISCOVERY.request */
+typedef struct {
+ enum ZbNwkAddrModeT dstAddrMode;
+ uint16_t dstAddr;
+ uint8_t radius;
+ uint8_t noRouteCache;
+} ZbNlmeRouteDiscReqT;
+
+/* NLME-ROUTE-DISCOVERY.confirm */
+typedef struct {
+ enum ZbStatusCodeT status;
+} ZbNlmeRouteDiscConfT;
+
+/* NLME-NETWORK-STATUS.indication */
+typedef struct {
+ uint16_t shortAddr;
+ enum ZbNwkNetworkStatusCodeT status;
+} ZbNlmeNetworkStatusIndT;
+
+/* NLME-SET-INTERFACE.request */
+typedef struct {
+ uint8_t ifcIndex;
+ uint8_t state;
+ uint32_t channelInUse;
+ struct ZbChannelListT supportedChannels;
+ bool routersAllowed;
+} ZbNlmeSetInterfaceReqT;
+
+typedef struct {
+ enum ZbStatusCodeT status;
+} ZbNlmeSetInterfaceConfT;
+
+/* NLME-GET-INTERFACE.request */
+typedef struct {
+ uint8_t ifcIndex;
+} ZbNlmeGetInterfaceReqT;
+
+typedef struct {
+ enum ZbStatusCodeT status;
+ uint8_t ifcIndex;
+ uint8_t state;
+ uint32_t channelInUse;
+ struct ZbChannelListT supportedChannels;
+ bool routersAllowed;
+ bool powerNegotSupported;
+} ZbNlmeGetInterfaceConfT;
+
+/* Broadcast transaction table entry */
+typedef struct {
+ uint16_t srcAddr;
+ uint8_t seqnum;
+ /* FIXME 1 - replace pAckCount with a list of router neighbors */
+ uint8_t pAckCount; /* passive ack count for flood limiting. */
+ ZbUptimeT expireTime; /* expiration time relative to ZbUptime. */
+} ZbNwkBttEntryT;
+
+/* NLME-GET.request */
+void ZbNlmeGetReq(struct ZigBeeT *zb, ZbNlmeGetReqT *getReqPtr, ZbNlmeGetConfT *getConfPtr);
+
+/* NLME-SET.request */
+void ZbNlmeSetReq(struct ZigBeeT *zb, ZbNlmeSetReqT *setReqPtr, ZbNlmeSetConfT *setConfPtr);
+
+/* NLME-RESET.request */
+void ZbNlmeResetReq(struct ZigBeeT *zb, ZbNlmeResetReqT *resetReqPtr, ZbNlmeResetConfT *resetConfPtr);
+
+/* NLME-SYNC.request */
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbNlmeSyncReq(struct ZigBeeT *zb, ZbNlmeSyncReqT *syncReqPtr,
+ void (*callback)(ZbNlmeSyncConfT *syncConfPtr, void *arg), void *arg);
+
+/* NLME-NETWORK-DISCOVERY.request */
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbNlmeNetDiscReq(struct ZigBeeT *zb, ZbNlmeNetDiscReqT *req,
+ void (*callback)(ZbNlmeNetDiscConfT *conf, void *cbarg), void *cbarg);
+void ZbNlmeNetDiscWait(struct ZigBeeT *zb, ZbNlmeNetDiscReqT *req, ZbNlmeNetDiscConfT *conf);
+
+/* NLME-NETWORK-FORMATION.request */
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbNlmeNetFormReq(struct ZigBeeT *zb, ZbNlmeNetFormReqT *req,
+ void (*callback)(ZbNlmeNetFormConfT *formConf, void *arg), void *cbarg);
+void ZbNlmeNetFormWait(struct ZigBeeT *zb, ZbNlmeNetFormReqT *req, ZbNlmeNetFormConfT *conf);
+
+/* NLME-PERMIT-JOIN.request */
+void ZbNlmePermitJoinReq(struct ZigBeeT *zb, ZbNlmePermitJoinReqT *permitReq, ZbNlmePermitJoinConfT *permitConf);
+
+/* Exegin Custom API to manage the IEEE Joining List in the NWK layer.
+ * Let the NWK layer manage configuring the individual MACs. */
+enum WpanJoinPolicyT ZbNlmeJoiningPolicyGet(struct ZigBeeT *zb);
+bool ZbNlmeJoiningPolicyConfigure(struct ZigBeeT *zb, enum WpanJoinPolicyT policy, uint64_t *extAddrList,
+ unsigned int numExtAddr, uint8_t *updateIdOverride);
+void ZbNlmeJoinPolicyTimeoutRefresh(struct ZigBeeT *zb);
+void ZbNlmeIeeeJoiningListClear(struct ZigBeeT *zb);
+bool ZbNlmeIeeeJoiningListRemove(struct ZigBeeT *zb, uint64_t extAddr);
+bool ZbNwkIeeeJoiningListEnabled(struct ZigBeeT *zb);
+
+/* NLME-JOIN.request */
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbNlmeJoinReq(struct ZigBeeT *zb, ZbNlmeJoinReqT *joinReqPtr,
+ void (*callback)(ZbNlmeJoinConfT *joinConf, void *arg), void *cbarg);
+void ZbNlmeJoinWait(struct ZigBeeT *zb, ZbNlmeJoinReqT *req, ZbNlmeJoinConfT *conf);
+
+/* NLME-DIRECT-JOIN.request */
+void ZbNlmeDirectJoinReq(struct ZigBeeT *zb, ZbNlmeDirectJoinReqT *directJoinReqPtr, ZbNlmeDirectJoinConfT
+ *directJoinConfPtr);
+
+/* NLME-START-ROUTER.request */
+void ZbNlmeStartRouterReq(struct ZigBeeT *zb, ZbNlmeStartRouterReqT *req, ZbNlmeStartRouterConfT *conf);
+
+/* NLME-ED-SCAN.request */
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbNlmeEdScanReq(struct ZigBeeT *zb, ZbNlmeEdScanReqT *req,
+ void (*callback)(ZbNlmeEdScanConfT *scanConf, void *arg), void *cbarg);
+
+/* NLME-LEAVE.request.
+ * If the local device is being requested to leave, it may take some time
+ * (hundreds of mS) to send the appropriate commands and reset the stack
+ * before the callback is eventually called, or ZbNlmeLeaveWait returns. */
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbNlmeLeaveReq(struct ZigBeeT *zb, ZbNlmeLeaveReqT *leaveReqPtr,
+ void (*callback)(ZbNlmeLeaveConfT *leaveConfPtr, void *arg), void *cbarg);
+void ZbNlmeLeaveWait(struct ZigBeeT *zb, ZbNlmeLeaveReqT *leaveReqPtr, ZbNlmeLeaveConfT *leaveConfPtr);
+
+/* NLME-ROUTE-DISCOVERY.request */
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbNlmeRouteDiscReq(struct ZigBeeT *zb, ZbNlmeRouteDiscReqT *routeDiscReqPtr,
+ void (*callback)(ZbNlmeRouteDiscConfT *discConf, void *cbarg), void *arg);
+void ZbNlmeRouteDiscWait(struct ZigBeeT *zb, ZbNlmeRouteDiscReqT *req, ZbNlmeRouteDiscConfT *conf);
+
+/* NLME-SET-INTERFACE.request */
+void ZbNlmeSetInterface(struct ZigBeeT *zb, ZbNlmeSetInterfaceReqT *req, ZbNlmeSetInterfaceConfT *conf);
+/* NLME-GET-INTERFACE.request */
+void ZbNlmeGetInterface(struct ZigBeeT *zb, ZbNlmeGetInterfaceReqT *req, ZbNlmeGetInterfaceConfT *conf);
+
+/* Helper to enable/disable interface */
+bool ZbNwkIfToggleByName(struct ZigBeeT *zb, const char *name, bool enable);
+
+bool ZbNwkIfSetTxPower(struct ZigBeeT *zb, const char *name, int8_t tx_power);
+bool ZbNwkIfGetTxPower(struct ZigBeeT *zb, const char *name, int8_t *tx_power);
+
+bool ZbNwkIfSetDsn(struct ZigBeeT *zb, const char *name, uint8_t macDsn);
+
+/* ZbNwkToggleDutyCycle - Enable or disable Duty Cycle management in the MAC.
+ * Disabling duty cycle will also clear the duty cycle history and set the status to
+ * MCP_DUTYCYCLE_STATUS_NORMAL.
+ * This function would typically be used in conjunction with ZB_NWK_NIB_ID_TxPowerMgmtSupported,
+ * which configures TX Power Control in the NWK and MAC. */
+bool ZbNwkToggleDutyCycle(struct ZigBeeT *zb, bool enable);
+
+/* Network end device keep alive request command. */
+bool ZbNwkSendEdkaReq(struct ZigBeeT *zb);
+
+/* Network Link power delta request & notify commands. */
+bool ZbNwkSendLinkPowerDeltaReq(struct ZigBeeT *zb);
+bool ZbNwkSendLinkPowerDeltaNotify(struct ZigBeeT *zb);
+
+/*---------------------------------------------------------------
+ * NLME-GET and NLME-SET Helper Functions
+ *---------------------------------------------------------------
+ */
+/* ZbNwkGet and ZbNwkSet return the confirm status byte (SUCCESS == 0x00) */
+enum ZbStatusCodeT ZbNwkGet(struct ZigBeeT *zb, enum ZbNwkNibAttrIdT attrId, void *attrPtr, unsigned int attrSz);
+enum ZbStatusCodeT ZbNwkSet(struct ZigBeeT *zb, enum ZbNwkNibAttrIdT attrId, void *attrPtr, unsigned int attrSz);
+
+enum ZbStatusCodeT ZbNwkGetIndex(struct ZigBeeT *zb, enum ZbNwkNibAttrIdT attrId, void *attrPtr, unsigned int attrSz, unsigned int attrIndex);
+enum ZbStatusCodeT ZbNwkSetIndex(struct ZigBeeT *zb, enum ZbNwkNibAttrIdT attrId, void *attrPtr, unsigned int attrSz, unsigned int attrIndex);
+
+/*---------------------------------------------------------------
+ * NIB Attribute Helper Functions
+ *---------------------------------------------------------------
+ */
+bool ZbNwkAddrIsChildNwk(struct ZigBeeT *zb, uint16_t nwkAddr, uint64_t *extAddrPtr);
+bool ZbNwkAddrIsChildExt(struct ZigBeeT *zb, uint64_t extAddr, uint16_t *nwkAddrPtr);
+unsigned int ZbNwkAddrMapFreeSpace(struct ZigBeeT *zb);
+bool ZbNwkAddrStoreMap(struct ZigBeeT *zb, uint16_t nwkAddr, uint64_t extAddr, bool resolve_conflict);
+void ZbNwkAddrClearMap(struct ZigBeeT *zb, bool isShortAddr, uint64_t addr);
+
+/* Returns the network address that corresponds to the extended address
+ * if known, otherwise returns ZB_NWK_ADDR_UNDEFINED. */
+uint16_t ZbNwkAddrLookupNwk(struct ZigBeeT *zb, uint64_t extAddr);
+/* Returns the extended address that corresponds to the network address
+ * if known, otherwise returns 0. */
+uint64_t ZbNwkAddrLookupExt(struct ZigBeeT *zb, uint16_t nwkAddr);
+
+bool ZbNwkGetSecMaterial(struct ZigBeeT *zb, uint8_t keySeqno, ZbNwkSecMaterialT *material);
+bool ZbNwkSetFrameCounter(struct ZigBeeT *zb, uint8_t keySeqno, uint64_t srcAddr, uint32_t newFrameCount);
+bool ZbNwkGetActiveKey(struct ZigBeeT *zb, ZbNwkSecMaterialT *active_key);
+bool ZbNwkClearActiveKey(struct ZigBeeT *zb);
+
+/*---------------------------------------------------------------
+ * NNT Helper Functions
+ *---------------------------------------------------------------
+ */
+const char * ZbNwkNeighborRelationshipToStr(enum ZbNwkNeighborRelT relationship);
+const char * ZbNwkNeighborDeviceTypeToStr(enum ZbNwkNeighborTypeT deviceType);
+
+/* Parent Functions */
+uint64_t ZbNwkGetParentExtAddr(struct ZigBeeT *zb);
+uint16_t ZbNwkGetParentShortAddr(struct ZigBeeT *zb);
+
+/* Clear the NNT. For example, as a zigbee end-device performing a
+ * network discovery scan before rejoin, it needs to first clear the
+ * NNT except for it's parent entry (keep_parent = true). This way,
+ * only potential parents that responded to the network discovery
+ * scan will be attempted to rejoin the network to. */
+void ZbNwkNeighborClearAll(struct ZigBeeT *zb, bool keep_parent, bool keep_children);
+
+/*---------------------------------------------------------------
+ * Fast Polling
+ *---------------------------------------------------------------
+ */
+/* NLME-SYNC.request parent polling */
+bool ZB_WARN_UNUSED ZbNwkFastPollRequest(struct ZigBeeT *zb);
+bool ZbNwkFastPollRelease(struct ZigBeeT *zb);
+unsigned int ZbNwkFastPollResourceCount(struct ZigBeeT *zb);
+
+/*---------------------------------------------------------------
+ * Status Code to String
+ *---------------------------------------------------------------
+ */
+const char * ZbNwkStatusCodeStr(enum ZbNwkNetworkStatusCodeT status);
+const char * ZbNwkStackProfileIdToStr(uint8_t stackProfile);
+const char * ZbNwkRouteStatusToStr(enum ZbNwkRouteStatusT status);
+
+#endif /* ZIGBEE_NWK_H */
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.security.h b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.security.h
new file mode 100644
index 000000000..766663d8d
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.security.h
@@ -0,0 +1,334 @@
+/* Copyright [2009 - 2019] Exegin Technologies Limited. All rights reserved. */
+
+#ifndef ZIGBEE_SECURITY_H
+#define ZIGBEE_SECURITY_H
+
+#include <stdint.h>
+#include <stdbool.h>
+
+struct ZigBeeT;
+
+/*---------------------------------------------------------------
+ * Misc. Definitions and Structures
+ *---------------------------------------------------------------
+ */
+/* Security Install Code Max Length (including CRC) */
+#define ZB_SEC_INSTALL_CODE_MAX_LENGTH 18U
+
+/* Key and Cipher strengths used by ZigBee. */
+#define ZB_SEC_BLOCKSIZE 16U
+#define ZB_SEC_KEYSIZE ZB_SEC_BLOCKSIZE
+
+/* ZB_SEC_KEYSTR_SIZE is a helper to know how much to allocate
+ * for ascii string buffer. */
+#define ZB_SEC_KEYSTR_SIZE ((ZB_SEC_KEYSIZE * 2U) + ZB_SEC_KEYSIZE /* separators */ + 1U /* NULL */)
+
+/*---------------------------------------------------------------
+ * Security Keys
+ *---------------------------------------------------------------
+ */
+/* Null (all zeroes)
+ * 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 */
+extern const uint8_t sec_key_null[ZB_SEC_KEYSIZE];
+
+/* "ZigBeeAlliance09"
+ * 5a:69:67:42:65:65:41:6c:6c:69:61:6e:63:65:30:39 */
+extern const uint8_t sec_key_ha[ZB_SEC_KEYSIZE];
+
+/* Uncertified Device's Distributed Link Key
+ * d0:d1:d2:d3:d4:d5:d6:d7:d8:d9:da:db:dc:dd:dedf */
+extern const uint8_t sec_key_distrib_uncert[ZB_SEC_KEYSIZE];
+
+/* TOUCHLINK_KEY_INDEX_CERTIFICATION key
+ * c0:c1:c2:c3:c4:c5:c6:c7 0xc8:c9:ca:cb:cc:cd:ce:cf */
+extern const uint8_t sec_key_touchlink_cert[ZB_SEC_KEYSIZE];
+
+/*---------------------------------------------------------------
+ * Security Level
+ *---------------------------------------------------------------
+ */
+/*
+ * +-----------------------------------------------------------------------------+
+ * | Security Security Security Data Frame Integrity |
+ * | level Level Sub- Attributes Encryption (length M of MIC, |
+ * | identifier Field in number of |
+ * | (Figure 18) octets) |
+ * +-----------------------------------------------------------------------------+
+ * | 0x00 000 None OFF NO (M = 0) |
+ * | 0x01 001 MIC-32 OFF YES (M=4) |
+ * | 0x02 010 MIC-64 OFF YES (M=8) |
+ * | 0x03 011 MIC-128 OFF YES (M=16) |
+ * | 0x04 100 ENC ON NO (M = 0) |
+ * | 0x05 101 ENC-MIC-32 ON YES (M=4) |
+ * | 0x06 110 ENC-MIC-64 ON YES (M=8) |
+ * | 0x07 111 ENC-MIC-128 ON YES (M=16) |
+ * +-----------------------------------------------------------------------------+
+ */
+#define ZB_SEC_LEVEL_NONE 0x00U
+#define ZB_SEC_LEVEL_MIC32 0x01U
+#define ZB_SEC_LEVEL_MIC64 0x02U
+#define ZB_SEC_LEVEL_MIC128 0x03U
+#define ZB_SEC_LEVEL_ENC 0x04U
+#define ZB_SEC_LEVEL_ENC_MIC32 (uint8_t)(ZB_SEC_LEVEL_ENC | ZB_SEC_LEVEL_MIC32)
+#define ZB_SEC_LEVEL_ENC_MIC64 (uint8_t)(ZB_SEC_LEVEL_ENC | ZB_SEC_LEVEL_MIC64)
+#define ZB_SEC_LEVEL_ENC_MIC128 (uint8_t)(ZB_SEC_LEVEL_ENC | ZB_SEC_LEVEL_MIC128)
+
+/* Macro checks security level if encryption is enabled */
+#define ZB_SEC_ENCRYPTED(level) (level & ZB_SEC_LEVEL_ENC)
+
+/* Macro returns the length of the MIC, can be computed
+ * as 4bytes * Floor((2 ^ (level - 1))), or:
+ * 4 * 2 ^ (level - 1) rounded down to the nearest 4 bytes.
+ *
+ * See right-most column in table above.
+ */
+#define ZB_SEC_MIC_LENGTH(level) ((2U << ((level) & 0x3U)) & ~0x3U)
+#define ZB_SEC_MIC_LENGTH_5 4U
+
+/* The maximum possible MIC length. */
+#define ZB_SEC_MAX_MIC_LENGTH 16U
+
+/* The length of the CCM* nonce. */
+#define ZB_SEC_NONCE_LENGTH 13U
+
+/* The maximum size of the auxilliary header. */
+#define ZB_SEC_MAX_HEADER_SIZE 14U
+
+/* Masks for the Security control header fields. (section 4.5.1)*/
+#define ZB_SEC_SECCTRL_MASK_LEVEL (uint8_t)0x07U /* Bits 0-2 */
+#define ZB_SEC_SECCTRL_MASK_KEYID (uint8_t)0x18U /* Bits 3-4 */
+#define ZB_SEC_SECCTRL_MASK_EXTNONCE (uint8_t)0x20U /* Bits 5 */
+#define ZB_SEC_SECCTRL_MASK_RESERVED (uint8_t)0x60U /* Bits 6-7 */
+
+/* Offsets of the Security control header fields. */
+#define ZB_SEC_SECCTRL_OFFSET_LEVEL 0U
+#define ZB_SEC_SECCTRL_OFFSET_KEYID 3U
+#define ZB_SEC_SECCTRL_OFFSET_EXTNONCE 5U
+
+/* Key Ids (Frame Control Field). */
+enum ZbSecHdrKeyIdT {
+ ZB_SEC_KEYID_LINK = 0x00,
+ ZB_SEC_KEYID_NETWORK = 0x01,
+ ZB_SEC_KEYID_TRANSPORT = 0x02,
+ ZB_SEC_KEYID_KEYLOAD = 0x03,
+ /* Exegin add-on - not for over-the-air */
+ ZB_SEC_KEYID_BOTH_LINK_NETWORK = 0xfe, /* For Update Device (send two) */
+ ZB_SEC_KEYID_DEFAULT = 0xff
+};
+
+/* Maximum value for a frame counter. */
+#define ZB_SEC_MAX_FRAME_COUNTER 0xffffffffUL
+
+/* Frame Counter Resets are controlled much like a lollipop counter, and require
+ * the 'new' value to be near zero to guard against replay attacks. */
+#define ZB_FRAME_COUNTER_RESET_MAX 256U
+
+/* Key Type Enumerations (Primitives and over-the-air). */
+enum ZbSecKeyTypeT {
+ /* Reserved -- was Trust-Center master key */
+ ZB_SEC_KEYTYPE_STANDARD_NWK = 0x01, /* Standard network key */
+ /* 0x02 -- Reserved -- was Application master key */
+ ZB_SEC_KEYTYPE_APP_LINK = 0x03, /* Application link key */
+ ZB_SEC_KEYTYPE_TC_LINK = 0x04 /* Trust-Center link key */
+ /* 0x05 -- Reserved -- was High security network key */
+};
+
+/*---------------------------------------------------------------
+ * Flags to indicate encryption used. Loosely based on enum ZbSecKeyTypeT.
+ *---------------------------------------------------------------
+ */
+enum ZbSecEncryptT {
+ /* No encryption used */
+ ZB_SEC_ENCRYPT_TYPE_NONE = 0x00,
+ /* Encrypted with standard network key */
+ ZB_SEC_ENCRYPT_TYPE_STANDARD_NWK = 0x01,
+ /* Link keys */
+ ZB_SEC_ENCRYPT_TYPE_LINK_FLAG = 0x80,
+ /* Application link key */
+ ZB_SEC_ENCRYPT_TYPE_APP_LINK = 0x83, /* ZB_SEC_ENCRYPT_TYPE_LINK_FLAG | 0x03U */
+ /* Trust-Center link key */
+ ZB_SEC_ENCRYPT_TYPE_TC_LINK = 0x84, /* ZB_SEC_ENCRYPT_TYPE_LINK_FLAG | 0x04U */
+ /* Preconfigured Global Trust-Center link key */
+ ZB_SEC_ENCRYPT_TYPE_GLOBAL_TC_LINK = 0x90, /* ZB_SEC_ENCRYPT_TYPE_LINK_FLAG | 0x10U */
+ /* Distributed Global Trust-Center link key */
+ ZB_SEC_ENCRYPT_TYPE_DISTRIB_TC_LINK = 0xa0 /* ZB_SEC_ENCRYPT_TYPE_LINK_FLAG | 0x20U */
+};
+
+/*---------------------------------------------------------------
+ * CBKE Certificate Formats
+ *---------------------------------------------------------------
+ */
+/* Field sizes for the elliptic curve (NIST-K163, aka SECT-163K1) */
+#define CBKE_PRIVATE_KEY_SIZE 21U /* sizeof(2^163) */
+#define CBKE_COMPRESSED_PUBLIC_KEY_SIZE (CBKE_PRIVATE_KEY_SIZE + 1U)
+#define CBKE_UNCOMPRESSED_PUBLIC_KEY_SIZE (2 * CBKE_PRIVATE_KEY_SIZE + 1U)
+#define CBKE_SHARED_SECRET_SIZE CBKE_PRIVATE_KEY_SIZE
+
+/* Field sizes for the elliptic curve (NIST-K283, aka SECT-283K1) */
+#define CBKE2_PRIVATE_KEY_SIZE 36U /* sizeof(2^283) */
+#define CBKE2_COMPRESSED_PUBLIC_KEY_SIZE (CBKE2_PRIVATE_KEY_SIZE + 1U)
+#define CBKE2_UNCOMPRESSED_PUBLIC_KEY_SIZE (2U * CBKE2_PRIVATE_KEY_SIZE + 1U)
+#define CBKE2_SHARED_SECRET_SIZE CBKE2_PRIVATE_KEY_SIZE
+
+/* Size and layout of the CBKE certificate. */
+#define CBKE_CERT_SUBJECT_OFFSET CBKE_COMPRESSED_PUBLIC_KEY_SIZE
+#define CBKE_CERT_SUBJECT_SIZE 8U
+#define CBKE_CERT_ISSUER_OFFSET (CBKE_CERT_SUBJECT_OFFSET + CBKE_CERT_SUBJECT_SIZE)
+#define CBKE_CERT_ISSUER_SIZE 8U
+#define CBKE_CERT_DATA_OFFSET (CBKE_CERT_ISSUER_OFFSET + CBKE_CERT_ISSUER_SIZE)
+#define CBKE_CERT_DATA_SIZE 10U
+#define CBKE_CERTIFICATE_SIZE (CBKE_CERT_DATA_OFFSET + CBKE_CERT_DATA_SIZE)
+
+/* Size and layout of the CBKE2 certificate. */
+#define CBKE2_CERT_TYPE_OFFSET 0U
+#define CBKE2_CERT_TYPE_SIZE 1U
+#define CBKE2_CERT_TYPE 0x00U
+#define CBKE2_CERT_SERIAL_OFFSET (CBKE2_CERT_TYPE_SIZE)
+#define CBKE2_CERT_SERIAL_SIZE 8U
+#define CBKE2_CERT_CURVE_OFFSET (CBKE2_CERT_SERIAL_OFFSET + CBKE2_CERT_SERIAL_SIZE)
+#define CBKE2_CERT_CURVE_SIZE 1U
+#define CBKE2_CERT_CURVE CURVE_IDENTIFIER_SECT283K1
+#define CBKE2_CERT_HASH_OFFSET (CBKE2_CERT_CURVE_OFFSET + CBKE2_CERT_CURVE_SIZE)
+#define CBKE2_CERT_HASH_SIZE 1U
+#define CBKE2_CERT_HASH HASH_IDENTIFIER_AES_MMO
+#define CBKE2_CERT_ISSUER_OFFSET (CBKE2_CERT_HASH_OFFSET + CBKE2_CERT_HASH_SIZE)
+#define CBKE2_CERT_ISSUER_SIZE 8U
+#define CBKE2_CERT_VALID_FROM_OFFSET (CBKE2_CERT_ISSUER_OFFSET + CBKE2_CERT_ISSUER_SIZE)
+#define CBKE2_CERT_VALID_FROM_SIZE 5U
+#define CBKE2_CERT_VALID_TO_OFFSET (CBKE2_CERT_VALID_FROM_OFFSET + CBKE2_CERT_VALID_FROM_SIZE)
+#define CBKE2_CERT_VALID_TO_SIZE 4U
+#define CBKE2_CERT_SUBJECT_OFFSET (CBKE2_CERT_VALID_TO_OFFSET + CBKE2_CERT_VALID_TO_SIZE)
+#define CBKE2_CERT_SUBJECT_SIZE 8U
+#define CBKE2_CERT_KEY_USAGE_OFFSET (CBKE2_CERT_SUBJECT_OFFSET + CBKE2_CERT_SUBJECT_SIZE)
+#define CBKE2_CERT_KEY_USAGE_SIZE 1U
+#define CBKE2_CERT_KEY_USAGE KEY_USAGE_AGREEMENT
+#define CBKE2_CERT_PUBLIC_KEY_OFFSET (CBKE2_CERT_KEY_USAGE_OFFSET + CBKE2_CERT_KEY_USAGE_SIZE)
+#define CBKE2_CERT_PUBLIC_KEY_SIZE 37U
+#define CBKE2_CERTIFICATE_SIZE (CBKE2_CERT_PUBLIC_KEY_OFFSET + CBKE2_CERT_PUBLIC_KEY_SIZE)
+
+struct ZbZclCbkePrivateT {
+ unsigned char privateKey[CBKE_PRIVATE_KEY_SIZE];
+ unsigned char publicCaKey[CBKE_COMPRESSED_PUBLIC_KEY_SIZE];
+};
+
+struct ZbZclCbkeInfoT {
+ struct ZbZclCbkePrivateT keys;
+ unsigned char cert[CBKE_CERTIFICATE_SIZE];
+ uint8_t ephemeralTime; /* In seconds. If 0, CBKE_V1_EPHEMERAL_DEFAULT_TIME is used */
+ uint8_t confirmTime; /* In seconds. If 0, CBKE_V1_CONFIRM_DEFAULT_TIME is used */
+};
+
+struct ZbZclCbke2PrivateT {
+ unsigned char privateKey[CBKE2_PRIVATE_KEY_SIZE];
+ unsigned char publicCaKey[CBKE2_COMPRESSED_PUBLIC_KEY_SIZE];
+};
+
+struct ZbZclCbke2InfoT {
+ struct ZbZclCbke2PrivateT keys;
+ unsigned char cert[CBKE2_CERTIFICATE_SIZE];
+ uint8_t ephemeralTime; /* In seconds. If 0, CBKE_V2_EPHEMERAL_DEFAULT_TIME is used */
+ uint8_t confirmTime; /* In seconds. If 0, CBKE_V2_CONFIRM_DEFAULT_TIME is used */
+};
+
+/*---------------------------------------------------------------
+ * Auxiliary Frame Functions
+ *---------------------------------------------------------------
+ */
+/* Security Control Field of the Auxilliary Header */
+struct ZbSecAuxHdrCtrlT {
+ uint8_t secLevel;
+ enum ZbSecHdrKeyIdT keyId;
+ bool extNonce;
+};
+
+/* Structure containing the fields stored in the Aux Header */
+struct ZbSecAuxHdrT {
+ struct ZbSecAuxHdrCtrlT securityCtrl;
+ uint32_t frameCounter;
+ uint64_t srcExtAddr; /* Present if securityCtrl.extNonce */
+ uint8_t keySeqno; /* Present if securityCtrl.keyId = 1 (Network Key) */
+};
+
+int ZbSecParseAuxHdr(const uint8_t *data, unsigned int dataLen, struct ZbSecAuxHdrT *auxHdrPtr);
+int ZbSecAppendAuxHdr(uint8_t *data, unsigned int dataLen, struct ZbSecAuxHdrT *auxHdrPtr);
+void ZbSecMakeNonce(uint8_t *nonce, uint64_t extAddr, uint32_t frameCounter, uint8_t secCtrl);
+
+/*---------------------------------------------------------------
+ * Security Transformations
+ *---------------------------------------------------------------
+ */
+void ZbAesMmoHash(uint8_t const *data, const unsigned int length, uint8_t *hash);
+void ZbSecKeyTransform(uint8_t *key, uint8_t input, uint8_t *keyOut);
+
+/*FUNCTION:-------------------------------------------------------------------
+ * NAME
+ * ZbSecInstallCodeCreate
+ * DESCRIPTION
+ * Produces an install code with CRC.
+ * PARAMETERS
+ * zb ; ZigBee stack structure.
+ * inputCode ; Pointer to original code without a CRC, or NULL
+ * to generate a random code.
+ * outputCode ; Pointer to buffer to contain install code and CRC
+ * codeLen ; Length of the output code in bytes, including CRC.
+ * If an inputCode is provided, codeLen is the length
+ * of inputCode plus 2 for the CRC.
+ * Valid lengths:
+ * 8 (48-bit)
+ * 10 (64-bit)
+ * 14 (96-bit)
+ * 18 (128-bit)
+ * RETURNS
+ * true on success, false otherwise.
+ *----------------------------------------------------------------------------
+ */
+bool ZbSecInstallCodeCreate(struct ZigBeeT *zb, const void *inputCode, void *outputCode, unsigned int codeLen);
+
+/*FUNCTION:-------------------------------------------------------------------
+ * NAME
+ * ZbSecInstallCodeCheck
+ * DESCRIPTION
+ * Performs redundancy checks on a ZSE installation code and
+ * optionally converts the code into an application link key.
+ * PARAMETERS
+ * installCode ; Pointer to installation code (includes CRC)
+ * codeLen ; Length of the installation code (in bytes).
+ * keyOut ; Output link key (if NULL will not compute)
+ * RETURNS
+ * TRUE if the IC is consistent, FALSE otherwise.
+ *----------------------------------------------------------------------------
+ */
+bool ZbSecInstallCodeCheck(const void *installCode, unsigned int codeLen, void *keyOut);
+
+/* Computes the 2-byte CRC of the input Install Code */
+void ZbSecInstallCodeCrc(const uint8_t *ic_in, uint8_t ic_len, uint8_t *crc_out);
+
+/* Add a device-key-pair */
+uint8_t ZbSecAddDeviceLinkKeyByKey(struct ZigBeeT *zb, uint64_t extAddr, uint8_t *key);
+uint8_t ZbSecAddDeviceLinkKeyByKeyStr(struct ZigBeeT *zb, uint64_t extAddr, char *str);
+
+/* Add a device-key-pair using an Install Code (includes trailing 2-octet CRC). */
+uint8_t ZbSecAddDeviceLinkKeyByInstallCode(struct ZigBeeT *zb, uint64_t extAddr, uint8_t *ic, unsigned int len);
+
+/*---------------------------------------------------------------
+ * ECDSA Signature Validation
+ *---------------------------------------------------------------
+ */
+enum ZbSecEcdsaSigType {
+ ZB_SEC_ECDSA_SIG_SUITE_1,
+ ZB_SEC_ECDSA_SIG_SUITE_2
+};
+
+enum ZbStatusCodeT ZbSecEcdsaValidate(struct ZigBeeT *zb, enum ZbSecEcdsaSigType sig_type,
+ const uint8_t *ca_pub_key_array, unsigned int ca_pub_key_len,
+ const uint8_t *certificate, const uint8_t *signature, uint8_t *image_digest, uint8_t *cert_digest);
+
+/*---------------------------------------------------------------
+ * Misc. Helper Functions
+ *---------------------------------------------------------------
+ */
+bool ZbSecValidKey(uint8_t *key);
+void ZbSecResetCounters(struct ZigBeeT *zb, uint64_t addr);
+bool ZbSecHaveActiveKey(struct ZigBeeT *zb);
+
+#endif /* ZIGBEE_SECURITY_H */
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.startup.h b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.startup.h
new file mode 100644
index 000000000..331e7ba43
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.startup.h
@@ -0,0 +1,196 @@
+/* Copyright [2009 - 2019] Exegin Technologies Limited. All rights reserved. */
+
+#ifndef ZIGBEE_STARTUP_H
+# define ZIGBEE_STARTUP_H
+
+#include "zcl/zcl.touchlink.h"
+
+/* Startup control-codes as per the ZCL. */
+enum ZbStartType {
+ ZbStartTypePreconfigured = 0x00,
+ ZbStartTypeForm = 0x01,
+ ZbStartTypeRejoin = 0x02,
+ ZbStartTypeJoin = 0x03,
+ /* Exegin add-on */
+ ZbStartTypeNone = 0xff
+};
+
+struct ZbStartupCbkeT {
+ uint8_t endpoint; /* e.g. ZB_ENDPOINT_MAX */
+ uint16_t deviceId; /* e.g. ZCL_DEVICE_METER */
+ uint16_t suite_mask; /* e.g. ZCL_KEY_SUITE_CBKE_ECMQV */
+ struct ZbZclCbkeInfoT cbke_v1; /* if (suite & ZCL_KEY_SUITE_CBKE_ECMQV) */
+ struct ZbZclCbke2InfoT cbke_v2; /* if (suite & ZCL_KEY_SUITE_CBKE2_ECMQV) */
+
+ /* Keep Alive Server or Client */
+ bool tc_keepalive_server_enable; /* true for server, false for client */
+ /* Keep Alive Server attributes */
+ uint8_t tc_keepalive_base; /* minutes. If zero, use stack defaults for BASE and JITTER. */
+ uint16_t tc_keepalive_jitter; /* seconds */
+
+ /* Trust Center Swap Out status callback, so application is informed of any TCSO process
+ * initiated by the Keep Alive Client cluster. */
+ void (*tcso_callback)(enum ZbTcsoStatusT status, void *arg);
+ void *tcso_arg;
+};
+
+/* The set of parameters to form or join a ZigBee Network Stack.
+ * Should be initialized using ZbStartupConfigGetProDefaults or ZbStartupConfigGetProSeDefaults. */
+struct ZbStartupT {
+ /* shortAddress is only used if:
+ * startupControl = ZbStartTypePreconfigured or ZbStartTypeRejoin */
+ uint16_t shortAddress;
+ /* panId and networkManagerAddress are only used if:
+ * startupControl = ZbStartTypePreconfigured */
+ uint16_t panId;
+ uint16_t networkManagerAddress;
+ /* Extended PAN ID. See note1 below. */
+ uint64_t extendedPanId;
+
+ /* Specify the channel masks to use. If no channel masks are specified,
+ * ZB_BDB_PrimaryChannelSet and ZB_BDB_SecondaryChannelSet are used instead. */
+ struct ZbChannelListT channelList;
+
+ /* Stack Profile.
+ * If not ZB_NWK_STACK_PROFILE_PRO, application must configure the following
+ * NIB parameters before calling ZbStartup:
+ * nwkMaxDepth, nwkMaxChildren, nwkReportConstantCost, nwkLinkStatusPeriod,
+ * nwkTransactionPersistenceTime, nwkPassiveAckTimeout, nwkMaxBroadcastRetries,
+ * nwkSecureAllFrames, nwkSecurityLevel */
+ uint8_t stackProfile;
+
+ /* BDB Commissioning Mode - see BDB_COMMISSION_MODE_MASK */
+ uint8_t bdbCommissioningMode;
+
+ /* Startup Type (used if not BDB_COMMISSION_MODE_TOUCHLINK)
+ * Notes:
+ * ZbStartTypePreconfigured - extendedPanId must be provided.
+ * ZbStartTypeForm - if extendedPanId = 0 then the stack will use the EUI as the Extended PAN ID.
+ * ZbStartTypeRejoin - extendedPanId must be provided.
+ * ZbStartTypeJoin - if extendedPanId = 0 then the stack will try join any available network.
+ */
+ enum ZbStartType startupControl;
+
+ /* Security Parameters (security level, preconfigured keys, etc) */
+ struct {
+ uint8_t level;
+ unsigned int useInsecureRejoin : 1;
+ uint64_t trustCenterAddress;
+ uint8_t preconfiguredLinkKey[ZB_SEC_KEYSIZE]; /* 16 bytes */
+ uint8_t distributedGlobalKey[ZB_SEC_KEYSIZE]; /* 16 bytes */
+ uint8_t networkKey[ZB_SEC_KEYSIZE]; /* 16 bytes */
+ uint8_t networkKeySeqNum;
+ enum ZbSecKeyTypeT networkKeyType;
+
+ struct ZbStartupCbkeT cbke;
+ } security;
+
+ /* The set of parameters related to joining a network. */
+ struct {
+ /* scanAttempts removed, use ZB_APS_IB_ID_SCAN_COUNT instead */
+ uint16_t timeBetweenScans; /* in milliseconds */
+ uint16_t rejoinInterval; /* in seconds */
+ uint16_t maxRejoinInterval; /* in seconds */
+ } join;
+
+ /* Device Capability (FFD vs RFD, RX-ON) */
+ uint8_t capability; /* e.g. MCP_ASSOC_CAP_RXONIDLE */
+
+ /* End-device timeout is only used by end-devices. It configures the
+ * time used to periodically update the Parent device so this
+ * device is not removed from the Parent's NWK Neighbor Table.
+ * Configures ZB_NWK_NIB_ID_EndDeviceTimeoutDefault.
+ *
+ * Timeout = (60 * 2^n) seconds for n > 0. If n = 0, timeout = 10 seconds.
+ * Setting to ZB_NWK_CONST_ENDDEV_TIMEOUT_DISABLED (0xff) disables end-device timeout.*/
+ uint8_t endDeviceTimeout;
+ uint16_t fastPollPeriod;
+
+ /* Touchlink (requires BDB_COMMISSION_MODE_TOUCHLINK) */
+ struct {
+ uint8_t tl_endpoint; /* Endpoint for the Touchlink Cluster (e.g. ) */
+ uint8_t bind_endpoint; /* Endpoint to use when binding clusters from Initiator to Target. */
+ uint16_t deviceId; /* e.g. ZCL_DEVICE_ONOFF_SWITCH */
+ uint8_t zb_info; /* e.g. ZCL_TL_ZBINFO_TYPE_ROUTER */
+ uint8_t flags; /* e.g. ZCL_TL_FLAGS_IS_TARGET */
+ const void *persist_buf; /* if ZCL_TL_ZBINFO_USE_PERSIST */
+ unsigned int persist_len;
+ } touchlink;
+};
+
+/*FUNCTION:------------------------------------------------------
+ * NAME ZbStartup
+ * DESC
+ * PARAMS zb ; ZigBee stack instance.
+ * config ; If not NULL, the configuration to set to the stack
+ * before forming or joining the network.
+ * Warning: if not NULL, any configuration to the stack
+ * prior to calling this function will be lost. Once this
+ * function is finished, you may continue configuring the
+ * stack (e.g. adding application link keys).
+ * func ; The callback function when startup is finished.
+ * arg ; Argument to pass to func.
+ * RETURNS none
+ *
+ *FUNCTION:------------------------------------------------------
+ * NAME ZbStartupWait
+ * DESC Blocking version of ZbStartup. Calls ZbStartup.
+ * PARAMS See ZbStartup.
+ * RETURNS ZigBee status byte.
+ *
+ *FUNCTION:------------------------------------------------------
+ * NAME ZbStartupPersist
+ * DESC Start the stack using persistent settings.
+ * PARAMS zb ;
+ * pdata ; Persistent data as returned by ZbPersistGet().
+ * This function calls ZbPersistSet() and performs
+ * NWK-RESET.request with warm-start set.
+ * plen ; Length of persistent data.
+ * RETURNS ZigBee status byte.
+ *
+ *---------------------------------------------------------------
+ */
+
+/* Non-blocking startup function */
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbStartup(struct ZigBeeT *zb, struct ZbStartupT *configPtr, void (*callback)(enum ZbStatusCodeT status, void *cb_arg), void *arg);
+
+/* Blocking version of ZbStartup. Not supported on all platforms. */
+enum ZbStatusCodeT ZbStartupWait(struct ZigBeeT *zb, struct ZbStartupT *config);
+
+/* If Touchlink Target was started with ZbStartup, this API can be used to stop it. */
+enum ZbStatusCodeT ZbStartupTouchlinkTargetStop(struct ZigBeeT *zb);
+
+/* Manually start Finding & Binding. F&B is also started automatically after
+ * joining the network. */
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbStartupFindBindStart(struct ZigBeeT *zb, void (*callback)(enum ZbStatusCodeT status, void *arg), void *arg);
+
+/* ZbStartupRejoin is a wrapper for ZbNlmeJoinReq(ZB_NWK_REJOIN_TYPE_NWKREJOIN).
+ * Use ZbStartupRejoin instead, because the internal startup handler will restart
+ * any timers we need to maintain our parent.
+ *
+ * Must already be connected to a network. If not on a network and want to
+ * rejoin as way to connect, use ZbStartup with ZbStartTypeRejoin.*/
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbStartupRejoin(struct ZigBeeT *zb, void (*callback)(ZbNlmeJoinConfT *conf, void *arg), void *cbarg);
+
+/* Blocking version. Not supported on all platforms. */
+enum ZbStatusCodeT ZbStartupRejoinWait(struct ZigBeeT *zb);
+
+/* Trust Center Rejoin - unsecured rejoin (already joined to network, but
+ * missed a NWK key update). */
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbTrustCenterRejoin(struct ZigBeeT *zb, void (*callback)(enum ZbStatusCodeT status, void *arg), void *cbarg);
+
+/* Try starting stack using persistence data provided. */
+enum ZbStatusCodeT ZbStartupPersist(struct ZigBeeT *zb, const void *pdata, unsigned int plen, struct ZbStartupCbkeT *cbke_config);
+
+/* Get the default configuration for a PRO network. */
+void ZbStartupConfigGetProDefaults(struct ZbStartupT *configPtr);
+/* Same as ZbStartupConfigGetProDefaults, but clears the preconfigured global link keys. */
+void ZbStartupConfigGetProSeDefaults(struct ZbStartupT *configPtr);
+
+/* The application can call ZbStartupTcsoStart if it thinks it as lost communication with the
+ * Trust Center. The Trust Center Swap Out process will be performed.
+ * The callback status is set to ZB_STATUS_SUCCESS if the stack is operational. */
+bool ZB_WARN_UNUSED ZbStartupTcsoStart(struct ZigBeeT *zb, void (*callback)(enum ZbTcsoStatusT status, void *arg), void *arg);
+void ZbStartupTcsoAbort(struct ZigBeeT *zb);
+
+#endif /* ZIGBEE_STARTUP_H */
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.zdo.h b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.zdo.h
new file mode 100644
index 000000000..4eb0c5648
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.zdo.h
@@ -0,0 +1,836 @@
+/* Copyright [2009 - 2019] Exegin Technologies Limited. All rights reserved. */
+
+#ifndef ZIGBEE_ZDO_H
+# define ZIGBEE_ZDO_H
+
+/*---------------------------------------------------------------
+ * Misc. Definitions and Structures
+ *---------------------------------------------------------------
+ */
+/* Profile, and Device Identifiers for the ZDO. */
+#define ZB_ZDO_PROFILE_ID 0x0000U
+#define ZB_ZDO_DEVICE_ID 0x0000U
+#define ZB_ZDO_DEVICE_VER 0x00U
+
+#define ZB_ZDO_ADDRRSP_DEVLIST_MAX 32U
+
+/* NWK_addr_req / IEEE_addr_req definitions */
+enum ZbZdoAddrReqTypeT {
+ ZB_ZDO_ADDR_REQ_TYPE_SINGLE = 0x00,
+ ZB_ZDO_ADDR_REQ_TYPE_EXTENDED = 0x01
+};
+
+/* NWK_Update_Req special duration values. */
+#define ZB_ZDP_NWK_UPDATE_MAX_DURATION 0x05U
+#define ZB_ZDP_NWK_UPDATE_CHANNEL_SWITCH 0xfeU
+#define ZB_ZDP_NWK_UPDATE_MANAGER_PARAMETERS 0xffU
+
+/* Maximum Response Sizes */
+/* FIXME 1 (sal) was 64, but end up allocating too much on the stack */
+#define ZB_ZDO_CLUSTER_LIST_MAX_SZ 16U
+#define ZB_ZDO_NETWORK_LIST_MAX_SZ 8U
+#define ZB_ZDO_NEIGHBOR_LIST_MAX_SZ 4U
+#define ZB_ZDO_ROUTE_LIST_MAX_SZ 16U
+/* Each entry in the ZDO message is either 14 or 21 bytes long.
+ * It's only possible to return up to 4 entries at a time. */
+#define ZB_ZDO_BIND_LIST_MAX_SZ 4U
+#define ZB_ZDO_ENDPOINT_LIST_MAXSZ 32U
+#define ZB_ZDO_CHANNEL_LIST_MAXSZ (8U * sizeof(uint32_t))
+#define ZB_ZDO_CHILD_LIST_MAXSZ 8U
+
+/* Node Descriptor Definitions. */
+#define ZB_ZDP_NODE_TYPE_COORDINATOR (uint8_t)0x00U
+#define ZB_ZDP_NODE_TYPE_ROUTER (uint8_t)0x01U
+#define ZB_ZDP_NODE_TYPE_END_DEVICE (uint8_t)0x02U
+#define ZB_ZDP_NODE_FREQ_868MHz (uint8_t)0x01U
+#define ZB_ZDP_NODE_FREQ_900MHz (uint8_t)0x04U
+#define ZB_ZDP_NODE_FREQ_2400MHz (uint8_t)0x08U
+#define ZB_ZDP_NODE_CAPABILITY_EXT_EPLIST (uint8_t)0x01U
+#define ZB_ZDP_NODE_CAPABILITY_EXT_SIMPLE (uint8_t)0x02U
+
+/* Server Mask Bits. */
+#define ZB_ZDP_SERVER_PRIMARY_TRUST (uint16_t)0x0001U
+#define ZB_ZDP_SERVER_BACKUP_TRUST (uint16_t)0x0002U
+#define ZB_ZDP_SERVER_PRIMARY_BIND_CACHE (uint16_t)0x0004U
+#define ZB_ZDP_SERVER_BACKUP_BIND_CACHE (uint16_t)0x0008U
+#define ZB_ZDP_SERVER_PRIMARY_DISC_CACHE (uint16_t)0x0010U
+#define ZB_ZDP_SERVER_BACKUP_DISC_CACHE (uint16_t)0x0020U
+#define ZB_ZDP_SERVER_NETWORK_MGR (uint16_t)0x0040U
+#define ZB_ZDP_SERVER_RESERVED_MASK (uint16_t)0x0180U /* Reserved bits */
+#define ZB_ZDP_SERVER_REVISION_SHIFT 9U
+#define ZB_ZDP_SERVER_REVISION_MASK (uint16_t)0xFE00U /* (0x007f << ZB_ZDP_SERVER_REVISION_SHIFT) */
+
+/* Power Descriptor Definitions. */
+#define ZB_ZDP_POWER_MODE_ON (uint8_t)0x00U
+#define ZB_ZDP_POWER_MODE_PERIODIC (uint8_t)0x01U
+#define ZB_ZDP_POWER_MODE_REQUEST (uint8_t)0x02U
+#define ZB_ZDP_POWER_SOURCE_CONSTANT (uint8_t)0x01U
+#define ZB_ZDP_POWER_SOURCE_RECHARGEABLE (uint8_t)0x02U
+#define ZB_ZDP_POWER_SOURCE_DISPOSEABLE (uint8_t)0x04U
+#define ZB_ZDP_POWER_LEVEL_CRITICAL (uint8_t)0x00U
+#define ZB_ZDP_POWER_LEVEL_33 (uint8_t)0x04U
+#define ZB_ZDP_POWER_LEVEL_66 (uint8_t)0x08U
+#define ZB_ZDP_POWER_LEVEL_100 (uint8_t)0x0cU
+
+/* ZbNodeDescriptorT Mask Flag - Section 2.3.2.3 */
+#define ZB_ZDP_NODE_OPT_MASK_TYPE (uint16_t)0x0007U
+#define ZB_ZDP_NODE_OPT_MASK_COMPLEX (uint16_t)0x0008U
+#define ZB_ZDP_NODE_OPT_MASK_USER (uint16_t)0x0010U
+#define ZB_ZDP_NODE_OPT_MASK_APSFLAG (uint16_t)0x0700U
+#define ZB_ZDP_NODE_OPT_MASK_FREQBAND (uint16_t)0xf800U
+#define ZB_ZDP_NODE_OPT_MASK_RESERVED (uint16_t)0x00e0U
+
+#define ZB_ZDP_NODE_OPT_OFFSET_TYPE 0U
+#define ZB_ZDP_NODE_OPT_OFFSET_COMPLEX 3U
+#define ZB_ZDP_NODE_OPT_OFFSET_USER 4U
+#define ZB_ZDP_NODE_OPT_OFFSET_APSFLAG 8U
+#define ZB_ZDP_NODE_OPT_OFFSET_FREQBAND 11U
+
+/* Node Descriptor Definitions */
+#define ZB_ZDP_NODE_OPT_TYPE_COORDINATOR 0x00U
+#define ZB_ZDP_NODE_OPT_TYPE_ROUTER 0x01U
+#define ZB_ZDP_NODE_OPT_TYPE_END_DEVICE 0x02U
+#define ZB_ZDP_NODE_OPT_TYPE(_nodetype_) (_nodetype_)
+
+#define ZB_ZDP_NODE_OPT_FREQBAND_868MHZ_BPSK 0x01U
+#define ZB_ZDP_NODE_OPT_FREQBAND_915MHZ_BPSK 0x04U
+#define ZB_ZDP_NODE_OPT_FREQBAND_2400MHZ 0x08U
+#define ZB_ZDP_NODE_OPT_FREQBAND_EU_FSK_SUBGHZ 0x10U /* 868 MHz and 915 MHz */
+#define ZB_ZDP_NODE_OPT_BAND(_freqband_) (((uint16_t)_freqband_) << ZB_ZDP_NODE_OPT_OFFSET_FREQBAND)
+
+/* ZbPowerDescriptorT Mask Flag - Section 2.3.2.4 */
+#define ZB_ZDP_POWER_MASK_MODE 0x000fU
+#define ZB_ZDP_POWER_MASK_AVAILABLE 0x00f0U
+#define ZB_ZDP_POWER_MASK_SOURCE 0x0f00U
+#define ZB_ZDP_POWER_MASK_LEVEL 0xf000U
+
+#define ZB_ZDP_POWER_OFFSET_MODE 0U
+#define ZB_ZDP_POWER_OFFSET_AVAILABLE 4U
+#define ZB_ZDP_POWER_OFFSET_SOURCE 8U
+#define ZB_ZDP_POWER_OFFSET_LEVEL 12U
+
+/* Complex descriptor tag values. */
+#define ZB_ZDP_COMPLEX_TAG_LANGUAGE 0x01U
+#define ZB_ZDP_COMPLEX_TAG_MANUFACTURFER 0x02U
+#define ZB_ZDP_COMPLEX_TAG_MODEL 0x03U
+#define ZB_ZDP_COMPLEX_TAG_SERIAL 0x04U
+#define ZB_ZDP_COMPLEX_TAG_DEVICE_URL 0x05U
+#define ZB_ZDP_COMPLEX_TAG_ICON 0x06U
+#define ZB_ZDP_COMPLEX_TAG_ICON_URL 0x07U
+
+/* Network Descriptor Flags. */
+#define ZB_ZDP_NETWORK_MASK_PROFILE 0x0fU
+#define ZB_ZDP_NETWORK_MASK_VERSION 0xf0U
+#define ZB_ZDP_NETWORK_MASK_BEACON 0x0fU
+#define ZB_ZDP_NETWORK_MASK_SUPERFRAME 0xf0U
+#define ZB_ZDP_NETWORK_MASK_PERMIT_JOIN 0x01U
+
+#define ZB_ZDP_NETWORK_OFFSET_PROFILE 0U
+#define ZB_ZDP_NETWORK_OFFSET_VERSION 4U
+#define ZB_ZDP_NETWORK_OFFSET_BEACON 0U
+#define ZB_ZDP_NETWORK_OFFSET_SUPERFRAME 4U
+#define ZB_ZDP_NETWORK_OFFSET_PERMIT_JOIN 0U
+
+/* Neighbor Descriptor Flags */
+#define ZB_ZDP_NEIGHBOR_MASK_TYPE 0x03U
+#define ZB_ZDP_NEIGHBOR_MASK_RX_ON_IDLE 0x0cU
+#define ZB_ZDP_NEIGHBOR_MASK_RELATIONSHIP 0x70U
+#define ZB_ZDP_NEIGHBOR_MASK_PERMIT_JOIN 0x03U
+
+#define ZB_ZDP_NEIGHBOR_OFFSET_TYPE 0U
+#define ZB_ZDP_NEIGHBOR_OFFSET_RX_ON_IDLE 2U
+#define ZB_ZDP_NEIGHBOR_OFFSET_RELATIONSHIP 4U
+#define ZB_ZDP_NEIGHBOR_OFFSET_PERMIT_JOIN 0U
+
+/* Neighbor Descriptor Definitions */
+#define ZB_ZDP_NEIGHBOR_TYPE_COORDINATOR 0x00U
+#define ZB_ZDP_NEIGHBOR_TYPE_ROUTER 0x01U
+#define ZB_ZDP_NEIGHBOR_TYPE_END_DEVICE 0x02U
+#define ZB_ZDP_NEIGHBOR_RELATIONSHIP_PARENT 0x00U /* ZB_NWK_NEIGHBOR_REL_PARENT */
+#define ZB_ZDP_NEIGHBOR_RELATIONSHIP_CHILD 0x01U /* ZB_NWK_NEIGHBOR_REL_CHILD */
+#define ZB_ZDP_NEIGHBOR_RELATIONSHIP_SIBLING 0x02U /* ZB_NWK_NEIGHBOR_REL_SIBLING */
+#define ZB_ZDP_NEIGHBOR_RELATIONSHIP_NONE 0x03U /* ZB_NWK_NEIGHBOR_REL_NONE */
+#define ZD_ZDP_NEIGHBOR_RELATIONSHIP_PREVIOUS 0x04U /* ZB_NWK_NEIGHBOR_REL_PREV_CHILD */
+#define ZB_ZDP_NEIGHBOR_PERMIT_JOIN_DISABLED 0x00U
+#define ZB_ZDP_NEIGHBOR_PERMIT_JOIN_ENABLED 0x01U
+#define ZB_ZDP_NEIGHBOR_PERMIT_JOIN_UNKNOWN 0x02U
+
+/* Routing Descriptor Flags */
+#define ZB_ZDP_ROUTE_MASK_STATUS 0x07U
+#define ZB_ZDP_ROUTE_MASK_CONSTRAINED 0x08U
+#define ZB_ZDP_ROUTE_MASK_MANY_TO_ONE 0x10U
+#define ZB_ZDP_ROUTE_MASK_RECORD_REQUIRED 0x20U
+
+#define ZB_ZDP_ROUTE_OFFSET_STATUS 0U
+#define ZB_ZDP_ROUTE_OFFSET_CONSTRAINED 3U
+#define ZB_ZDP_ROUTE_OFFSET_MANY_TO_ONE 4U
+#define ZB_ZDP_ROUTE_OFFSET_RECORD_REQUIRED 5U
+
+/* Complex Descriptor */
+#define ZB_ZDP_COMPLEX_DESC_MAX_DESC_LEN 256U
+
+/* User Descriptor */
+#define ZB_ZDP_USER_DESC_MAX_DESC_LEN 0x10U
+
+/*
+ * ZigBee Device Object cluster definitions.
+ */
+/* This bit in the cluster ID denotes a response or request. */
+#define ZB_ZDO_CLUSTER_RESPONSE_BIT 0x8000U
+
+/* ZDP Request IDs (Responses are the same, but with ZB_ZDO_CLUSTER_RESPONSE_BIT set) */
+#define ZB_ZDO_NWK_ADDR_REQ 0x0000U
+#define ZB_ZDO_IEEE_ADDR_REQ 0x0001U
+#define ZB_ZDO_NODE_DESC_REQ 0x0002U
+#define ZB_ZDO_POWER_DESC_REQ 0x0003U
+#define ZB_ZDO_SIMPLE_DESC_REQ 0x0004U
+#define ZB_ZDO_ACTIVE_EP_REQ 0x0005U
+#define ZB_ZDO_MATCH_DESC_REQ 0x0006U
+#define ZB_ZDO_COMPLEX_DESC_REQ 0x0010U
+#define ZB_ZDO_USER_DESC_REQ 0x0011U
+#define ZB_ZDO_DISCOVERY_CACHE_REQ 0x0012U
+#define ZB_ZDO_DEVICE_ANNCE 0x0013U
+#define ZB_ZDO_USER_DESC_SET 0x0014U
+#define ZB_ZDO_SYSTEM_SERVER_DISC_REQ 0x0015U
+#define ZB_ZDO_DISCOVERY_STORE_REQ 0x0016U
+#define ZB_ZDO_NODE_DESC_STORE_REQ 0x0017U
+#define ZB_ZDO_POWER_DESC_STORE_REQ 0x0018U
+#define ZB_ZDO_ACTIVE_EP_STORE_REQ 0x0019U
+#define ZB_ZDO_SIMPLE_DESC_STORE_REQ 0x001aU
+#define ZB_ZDO_REMOVE_NODE_CACHE_REQ 0x001bU
+#define ZB_ZDO_FIND_NODE_CACHE_REQ 0x001cU
+#define ZB_ZDO_EXT_SIMPLE_DESC_REQ 0x001dU
+#define ZB_ZDO_EXT_ACTIVE_EP_REQ 0x001eU
+#define ZB_ZDO_PARENT_ANNCE 0x001fU
+#define ZB_ZDO_END_DEVICE_BIND_REQ 0x0020U
+#define ZB_ZDO_BIND_REQ 0x0021U
+#define ZB_ZDO_UNBIND_REQ 0x0022U
+/* ZB_ZDO_MGMT_NWK_DISC_REQ depreciated 0x0030U */
+#define ZB_ZDO_MGMT_LQI_REQ 0x0031U
+#define ZB_ZDO_MGMT_RTG_REQ 0x0032U
+#define ZB_ZDO_MGMT_BIND_REQ 0x0033U
+#define ZB_ZDO_MGMT_LEAVE_REQ 0x0034U
+#define ZB_ZDO_MGMT_DIRECT_JOIN_REQ 0x0035U
+#define ZB_ZDO_MGMT_PERMIT_JOINING_REQ 0x0036U
+#define ZB_ZDO_MGMT_CACHE_REQ 0x0037U
+#define ZB_ZDO_MGMT_NWK_UPDATE_REQ 0x0038U
+#define ZB_ZDO_MGMT_NWK_ENHANCED_UPDATE_REQ 0x0039U
+#define ZB_ZDO_MGMT_IEEE_JOINING_LIST_REQ 0x003aU
+#define ZB_ZDO_MGMT_UNSOLICITED_UPDATE_NOTIFY 0x003bU
+
+/* ZigBee Node Descriptor - Section 2.3.2.3 */
+typedef struct {
+ uint8_t logicalType;
+ uint8_t complexDesc;
+ uint8_t userDesc;
+ uint8_t apsFlags;
+ uint8_t freqBands;
+ uint8_t macCapability;
+ uint16_t mfrCode;
+ uint8_t maxBuffer;
+ uint16_t maxIncomingTransfer;
+ uint16_t serverMask;
+ uint16_t maxOutgoingTransfer;
+ uint8_t descCapability;
+} ZbNodeDescriptorT;
+
+/* ZigBee Power Descriptor - Section 2.3.2.4. */
+typedef struct {
+ uint8_t currentMode;
+ uint8_t availableSources;
+ uint8_t currentSource;
+ uint8_t currentLevel;
+} ZbPowerDescriptorT;
+
+/* ZigBee Simple (Application) Descriptor. */
+typedef struct {
+ uint8_t endpoint;
+ uint16_t profileId;
+ uint16_t deviceId;
+ uint8_t version;
+ uint8_t inputClusterCount;
+ uint16_t inputClusterList[ZB_ZDO_CLUSTER_LIST_MAX_SZ];
+ uint8_t outputClusterCount;
+ uint16_t outputClusterList[ZB_ZDO_CLUSTER_LIST_MAX_SZ];
+} ZbSimpleDescriptorT;
+
+/* Network Descriptor */
+typedef struct {
+ uint64_t epid;
+ uint8_t logicalChannel;
+ uint8_t version;
+ uint8_t stackProfile;
+ uint8_t superframeOrder;
+ uint8_t beaconOrder;
+ uint8_t permitJoin;
+} ZbZdoNetworkDescT;
+
+/* Neighbor Descriptor */
+typedef struct {
+ uint64_t epid;
+ uint64_t extAddr;
+ uint16_t nwkAddr;
+ uint8_t deviceType;
+ uint8_t rxOnWhenIdle;
+ uint8_t relationship;
+ uint8_t permitJoin;
+ uint8_t depth;
+ uint8_t lqi;
+} ZbZdoNeighborDescT;
+
+/* Routing Descriptor */
+typedef struct {
+ uint16_t destAddr;
+ uint8_t status; /* FIXME - convert to an enum type? */
+ uint8_t constrained;
+ uint8_t manyToOne;
+ uint8_t recordRequired;
+ uint16_t nextHopAddr;
+} ZbZdoRoutingDescT;
+
+/* Binding Descriptor */
+typedef struct {
+ uint64_t srcAddr;
+ uint8_t srcEndpt;
+ uint16_t clusterId;
+ /* dst.panId not used, dst.nwkAddr is only for the group address,
+ * and dst.endpoint only used if mode == ZB_APSDE_ADDRMODE_EXT */
+ struct ZbApsAddrT dst;
+} ZbZdoBindingDescT;
+
+/* Child Descriptor */
+typedef struct {
+ uint64_t extAddr;
+ uint32_t age;
+} ZbZdoChildDescT;
+
+/*---------------------------------------------------------------
+ * ZDP Discovery Requests
+ *---------------------------------------------------------------
+ */
+/* NWK_addr_req */
+typedef struct {
+ uint16_t dstNwkAddr; /* typically set to ZB_NWK_ADDR_BCAST_RXON (0xfffd) */
+ uint64_t extAddr;
+ enum ZbZdoAddrReqTypeT reqType;
+ uint8_t startIndex;
+} ZbZdoNwkAddrReqT;
+
+/* NWK_addr_rsp */
+typedef struct {
+ enum ZbStatusCodeT status;
+ uint64_t extAddr;
+ uint16_t nwkAddr;
+ uint8_t deviceCount;
+ uint8_t startIndex;
+ uint16_t deviceList[ZB_ZDO_ADDRRSP_DEVLIST_MAX];
+} ZbZdoNwkAddrRspT;
+
+/* IEEE_addr_req */
+typedef struct {
+ uint16_t dstNwkAddr;
+ uint16_t nwkAddrOfInterest;
+ enum ZbZdoAddrReqTypeT reqType;
+ uint8_t startIndex;
+} ZbZdoIeeeAddrReqT;
+
+/*
+ * IEEE_addr_rsp - just so happens to have the exact same format as
+ * the network address response.
+ */
+typedef ZbZdoNwkAddrRspT ZbZdoIeeeAddrRspT;
+
+/* Node_Desc_req */
+typedef struct {
+ uint16_t dstNwkAddr;
+ uint16_t nwkAddrOfInterest;
+} ZbZdoNodeDescReqT;
+
+/* Node_Desc_rsp */
+typedef struct {
+ enum ZbStatusCodeT status;
+ uint16_t nwkAddr;
+ ZbNodeDescriptorT nodeDesc;
+} ZbZdoNodeDescRspT;
+
+/* Power_Desc_req */
+typedef struct {
+ uint16_t dstNwkAddr;
+ uint16_t nwkAddrOfInterest;
+} ZbZdoPowerDescReqT;
+
+/* Power_Desc_rsp */
+typedef struct {
+ enum ZbStatusCodeT status;
+ uint16_t nwkAddr;
+ ZbPowerDescriptorT powerDesc;
+} ZbZdoPowerDescRspT;
+
+/* Simple_Desc_req */
+typedef struct {
+ uint16_t dstNwkAddr;
+ uint16_t nwkAddrOfInterest;
+ uint8_t endpt;
+} ZbZdoSimpleDescReqT;
+
+/* Simple_Desc_rsp */
+typedef struct {
+ enum ZbStatusCodeT status;
+ uint16_t nwkAddr;
+ ZbSimpleDescriptorT simpleDesc;
+} ZbZdoSimpleDescRspT;
+
+/* Discovery_Cache_rsp */
+typedef struct {
+ enum ZbStatusCodeT status;
+ /* Added by Exegin */
+ uint16_t nwkAddr;
+} ZbZdoDiscCacheRspT;
+
+/* Active_EP_req */
+typedef struct {
+ uint16_t dstNwkAddr;
+ uint16_t nwkAddrOfInterest;
+} ZbZdoActiveEpReqT;
+
+/* Active_EP_rsp */
+typedef struct {
+ enum ZbStatusCodeT status;
+ uint16_t nwkAddr;
+ uint8_t activeEpCount;
+ uint8_t activeEpList[ZB_ZDO_ENDPOINT_LIST_MAXSZ];
+} ZbZdoActiveEpRspT;
+
+/* Match_Desc_req */
+typedef struct {
+ uint16_t dstNwkAddr;
+ uint16_t nwkAddrOfInterest;
+ uint16_t profileId;
+ uint8_t numInClusters;
+ uint16_t inClusterList[ZB_ZDO_CLUSTER_LIST_MAX_SZ];
+ uint8_t numOutClusters;
+ uint16_t outClusterList[ZB_ZDO_CLUSTER_LIST_MAX_SZ];
+} ZbZdoMatchDescReqT;
+
+/* Match_Desc_rsp */
+typedef struct {
+ enum ZbStatusCodeT status;
+ uint16_t nwkAddr;
+ uint8_t matchLength;
+ uint8_t matchList[ZB_ZDO_ENDPOINT_LIST_MAXSZ];
+} ZbZdoMatchDescRspT;
+
+/* Device_annce (ZB_ZDO_DEVICE_ANNCE) */
+typedef struct {
+ uint16_t nwkAddr;
+ uint64_t extAddr;
+ uint8_t capability;
+} ZbZdoDeviceAnnceT;
+
+/* Bind_req */
+typedef struct {
+ /* Destination for the ZDO Bind Request message */
+ uint16_t target;
+ /* Binding Source */
+ uint64_t srcExtAddr;
+ uint8_t srcEndpt;
+ /* Binding Cluster ID */
+ uint16_t clusterId;
+ /* Binding Destination (not the destination of the message)
+ * dst.panId not used, dst.nwkAddr is only for the group address,
+ * and dst.endpoint only used if mode == ZB_APSDE_ADDRMODE_EXT */
+ struct ZbApsAddrT dst;
+} ZbZdoBindReqT;
+
+/* Bind_rsp */
+typedef struct {
+ enum ZbStatusCodeT status;
+} ZbZdoBindRspT;
+
+/* Mgmt_Lqi_req */
+typedef struct {
+ uint16_t destAddr;
+ uint8_t startIndex;
+} ZbZdoLqiReqT;
+
+/* Mgmt_Lqi_rsp */
+typedef struct {
+ enum ZbStatusCodeT status;
+ uint16_t respAddr;
+ uint8_t neighborTblSz;
+ uint8_t startIndex;
+ uint8_t neighborListSz;
+ ZbZdoNeighborDescT neighborList[ZB_ZDO_NEIGHBOR_LIST_MAX_SZ];
+} ZbZdoLqiRspT;
+
+/* Mgmt_Rtg_req */
+typedef struct {
+ uint16_t destAddr;
+ uint8_t startIndex;
+} ZbZdoRtgReqT;
+
+/* Mgmt_Rtg_rsp */
+typedef struct {
+ enum ZbStatusCodeT status;
+ uint16_t respAddr;
+ uint8_t routeTblSz;
+ uint8_t startIndex;
+ uint8_t routeListSz;
+ ZbZdoRoutingDescT routeList[ZB_ZDO_ROUTE_LIST_MAX_SZ];
+} ZbZdoRtgRspT;
+
+/* Mgmt_Bind_req */
+typedef struct {
+ uint16_t destAddr;
+ uint8_t startIndex;
+} ZbZdoMgmtBindReqT;
+
+/* Mgmt_Bind_rsp */
+typedef struct {
+ enum ZbStatusCodeT status;
+ uint8_t bindTblSz; /* Total number */
+ uint8_t startIndex; /* Starting index being reported here */
+ uint8_t bindListSz; /* Number reported here */
+ ZbZdoBindingDescT bindList[ZB_ZDO_BIND_LIST_MAX_SZ];
+} ZbZdoMgmtBindRspT;
+
+/* Mgmt_Permit_Join_req */
+typedef struct {
+ uint16_t destAddr;
+ uint8_t duration;
+ uint8_t tcSignificance;
+} ZbZdoPermitJoinReqT;
+
+/* Mgmt_Permit_Join_rsp */
+typedef struct {
+ enum ZbStatusCodeT status;
+} ZbZdoPermitJoinRspT;
+
+/* Mgmt_Nwk_Update_req */
+typedef struct {
+ uint16_t destAddr;
+ uint32_t channelMask;
+ uint8_t scanDuration; /* or ZB_ZDP_NWK_UPDATE_CHANNEL_SWITCH, or ZB_ZDP_NWK_UPDATE_MANAGER_PARAMETERS */
+ uint8_t scanCount;
+ uint8_t updateId; /* only for ZB_ZDP_NWK_UPDATE_CHANNEL_SWITCH or ZB_ZDP_NWK_UPDATE_MANAGER_PARAMETERS */
+ uint16_t managerAddr; /* only for ZB_ZDP_NWK_UPDATE_MANAGER_PARAMETERS */
+} ZbZdoNwkUpdateReqT;
+
+/* Mgmt_Nwk_Enhanced_Update_req */
+struct ZbZdoNwkEnhUpdateReqT {
+ uint16_t destAddr;
+ struct ZbChannelListT channelList;
+ uint8_t scanDuration;
+ uint8_t scanCount;
+ uint8_t updateId;
+ uint16_t managerAddr;
+};
+
+/* Mgmt_Nwk_Update_notify */
+typedef struct {
+ enum ZbStatusCodeT status;
+ uint32_t scannedChannels;
+ uint16_t txTotal;
+ uint16_t txFails;
+ uint8_t channelListSz;
+ uint8_t channelList[ZB_ZDO_CHANNEL_LIST_MAXSZ]; /* Channel energy list */
+} ZbZdoNwkUpdateNotifyT;
+
+#define ZB_ZDO_MGMT_NWK_LEAVE_FLAG_REJOIN 0x80U
+#define ZB_ZDO_MGMT_NWK_LEAVE_FLAG_REMOVE_CHILDREN 0x40U
+
+/* Mgmt_Nwk_Leave_req */
+typedef struct {
+ uint16_t destAddr;
+ uint64_t deviceAddr;
+ uint8_t flags;
+} ZbZdoLeaveReqT;
+
+/* Mgmt_Nwk_Leave_rsp */
+typedef struct {
+ enum ZbStatusCodeT status;
+} ZbZdoLeaveRspT;
+
+#define ZDP_JOINING_LIST_MAX_LEN 9U
+
+/* Mgmt_Nwk_Ieee_Joining_List_req */
+struct ZbZdoNwkIeeeJoinListReqT {
+ uint16_t destAddr;
+ uint8_t startIndex;
+};
+
+/* Mgmt_Nwk_Ieee_Joining_List_rsp */
+struct ZbZdoNwkIeeeJoinListRspT {
+ enum ZbStatusCodeT status;
+ uint16_t respAddr; /* not part of ZDP payload */
+ uint8_t updateId;
+ enum WpanJoinPolicyT joiningPolicy;
+ uint8_t ieeeJoiningListTotal;
+ uint8_t startIndex;
+ uint8_t ieeeJoiningListCount;
+ uint64_t ieeeJoiningList[ZDP_JOINING_LIST_MAX_LEN];
+};
+
+/*---------------------------------------------------------------
+ * ZDO
+ *---------------------------------------------------------------
+ */
+
+/*FUNCTION:------------------------------------------------------
+ * NAME ZbZdoNwkAddrWait
+ * DESC NWK_addr_req
+ * PARAMS
+ * RETURNS none
+ */
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbZdoNwkAddrReq(struct ZigBeeT *zb, ZbZdoNwkAddrReqT *req, void (*callback)(ZbZdoNwkAddrRspT *rsp, void *cb_arg), void *arg);
+void ZbZdoNwkAddrWait(struct ZigBeeT *zb, ZbZdoNwkAddrReqT *req, ZbZdoNwkAddrRspT *rsp);
+
+/*FUNCTION:------------------------------------------------------
+ * NAME ZbZdoIeeeAddrWait
+ * DESC IEEE_addr_req
+ * PARAMS
+ * RETURNS none
+ */
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbZdoIeeeAddrReq(struct ZigBeeT *zb, ZbZdoIeeeAddrReqT *req, void (*callback)(ZbZdoIeeeAddrRspT *rsp, void *cb_arg), void *arg);
+void ZbZdoIeeeAddrWait(struct ZigBeeT *zb, ZbZdoIeeeAddrReqT *req, ZbZdoIeeeAddrRspT *rsp);
+
+/*FUNCTION:------------------------------------------------------
+ * NAME ZbZdoNodeDescWait
+ * DESC Node_Desc_req
+ * PARAMS
+ * RETURNS none
+ */
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbZdoNodeDescReq(struct ZigBeeT *zb, ZbZdoNodeDescReqT *req, void (*callback)(ZbZdoNodeDescRspT *rsp, void *cb_arg), void *arg);
+void ZbZdoNodeDescWait(struct ZigBeeT *zb, ZbZdoNodeDescReqT *req, ZbZdoNodeDescRspT *rsp);
+
+/*FUNCTION:------------------------------------------------------
+ * NAME ZbZdoPowerDescWait
+ * DESC Power_Desc_req
+ * PARAMS
+ * RETURNS none
+ */
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbZdoPowerDescReq(struct ZigBeeT *zb, ZbZdoPowerDescReqT *req, void (*callback)(ZbZdoPowerDescRspT *rsp, void *cb_arg), void *arg);
+void ZbZdoPowerDescWait(struct ZigBeeT *zb, ZbZdoPowerDescReqT *req, ZbZdoPowerDescRspT *rsp);
+
+/*FUNCTION:------------------------------------------------------
+ * NAME ZbZdoSimpleDescWait
+ * DESC Simple_Desc_req
+ * PARAMS
+ * RETURNS none
+ */
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbZdoSimpleDescReq(struct ZigBeeT *zb, ZbZdoSimpleDescReqT *req, void (*callback)(ZbZdoSimpleDescRspT *rsp, void *cb_arg), void *arg);
+void ZbZdoSimpleDescWait(struct ZigBeeT *zb, ZbZdoSimpleDescReqT *req, ZbZdoSimpleDescRspT *rsp);
+
+/*FUNCTION:------------------------------------------------------
+ * NAME ZbZdoActiveEpWait
+ * DESC Active_EP_req
+ * PARAMS
+ * RETURNS none
+ */
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbZdoActiveEpReq(struct ZigBeeT *zb, ZbZdoActiveEpReqT *req, void (*callback)(ZbZdoActiveEpRspT *rsp, void *cb_arg), void *arg);
+void ZbZdoActiveEpWait(struct ZigBeeT *zb, ZbZdoActiveEpReqT *req, ZbZdoActiveEpRspT *rsp);
+
+/*FUNCTION:------------------------------------------------------
+ * NAME ZbZdoMatchDescReq
+ * DESC Active_EP_req
+ * PARAMS
+ * RETURNS none
+ */
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbZdoMatchDescReq(struct ZigBeeT *zb, ZbZdoMatchDescReqT *req, void (*callback)(ZbZdoMatchDescRspT *rsp, void *cb_arg), void *arg);
+void ZbZdoMatchDescWait(struct ZigBeeT *zb, ZbZdoMatchDescReqT *req, ZbZdoMatchDescRspT *rsp);
+
+/**
+ * ZbZdoMatchDescMulti:
+ * Returns ZB_ZDP_STATUS_SUCCESS for received responses.
+ * Returns ZB_ZDP_STATUS_TABLE_FULL if there's a problem starting the request.
+ * Returns ZB_ZDP_STATUS_TIMEOUT when the stack decides to stop receiving responses.
+ **/
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbZdoMatchDescMulti(struct ZigBeeT *zb, ZbZdoMatchDescReqT *req, void (*callback)(ZbZdoMatchDescRspT *rsp, void *cb_arg), void *arg);
+
+/*FUNCTION:------------------------------------------------------
+ * NAME ZbZdoDeviceAnnce
+ * DESC Device_annce
+ * PARAMS
+ * RETURNS none
+ */
+void ZbZdoDeviceAnnce(struct ZigBeeT *zb, ZbZdoDeviceAnnceT *deviceAnncePtr);
+void ZbZdoDeviceAnnceAlias(struct ZigBeeT *zb, ZbZdoDeviceAnnceT *deviceAnncePtr);
+
+/* API to register a filter in the ZDO for the application to
+ * receive Device_Annce messages. */
+struct ZbZdoDeviceAnnceFilterT;
+struct ZbZdoDeviceAnnceFilterT * ZbZdoDeviceAnnceFilterRegister(struct ZigBeeT *zb,
+ void (*callback)(struct ZigBeeT *zb, ZbZdoDeviceAnnceT *annce, uint8_t seqno));
+void ZbZdoDeviceAnnceFilterRemove(struct ZigBeeT *zb, struct ZbZdoDeviceAnnceFilterT *handler);
+
+/*---------------------------------------------------------------
+ * ZDP Binding Requests
+ *---------------------------------------------------------------
+ */
+
+/*FUNCTION:------------------------------------------------------
+ * NAME ZbZdoBindWait
+ * DESC Bind_req
+ * PARAMS
+ * RETURNS none
+ */
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbZdoBindReq(struct ZigBeeT *zb, ZbZdoBindReqT *req, void (*callback)(ZbZdoBindRspT *rsp, void *cb_arg), void *arg);
+void ZbZdoBindWait(struct ZigBeeT *zb, ZbZdoBindReqT *req, ZbZdoBindRspT *rsp);
+
+/*FUNCTION:------------------------------------------------------
+ * NAME ZbZdoUnbindWait
+ * DESC Unbind_req
+ * PARAMS
+ * RETURNS none
+ */
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbZdoUnbindReq(struct ZigBeeT *zb, ZbZdoBindReqT *req, void (*callback)(ZbZdoBindRspT *rsp, void *cb_arg), void *arg);
+void ZbZdoUnbindWait(struct ZigBeeT *zb, ZbZdoBindReqT *req, ZbZdoBindRspT *rsp);
+
+/*---------------------------------------------------------------
+ * ZDP Management Requests
+ *---------------------------------------------------------------
+ */
+/*FUNCTION:------------------------------------------------------
+ * NAME ZbZdoLqiWait
+ * DESC Mgmt_Lqi_req
+ * PARAMS
+ * RETURNS none
+ */
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbZdoLqiReq(struct ZigBeeT *zb, ZbZdoLqiReqT *req, void (*callback)(ZbZdoLqiRspT *rsp, void *cb_arg), void *arg);
+void ZbZdoLqiWait(struct ZigBeeT *zb, ZbZdoLqiReqT *req, ZbZdoLqiRspT *rsp);
+
+/*FUNCTION:------------------------------------------------------
+ * NAME ZbZdoRtgWait
+ * DESC Mgmt_Rtg_req
+ * PARAMS
+ * RETURNS none
+ */
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbZdoRtgReq(struct ZigBeeT *zb, ZbZdoRtgReqT *req, void (*callback)(ZbZdoRtgRspT *rsp, void *cb_arg), void *arg);
+void ZbZdoRtgWait(struct ZigBeeT *zb, ZbZdoRtgReqT *req, ZbZdoRtgRspT *rsp);
+
+/*FUNCTION:------------------------------------------------------
+ * NAME ZbZdoMgmtBindWait
+ * DESC Mgmt_Bind_req
+ * PARAMS
+ * RETURNS none
+ */
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbZdoMgmtBindReq(struct ZigBeeT *zb, ZbZdoMgmtBindReqT *req, void (*callback)(ZbZdoMgmtBindRspT *rsp, void *cb_arg), void *arg);
+void ZbZdoMgmtBindWait(struct ZigBeeT *zb, ZbZdoMgmtBindReqT *req, ZbZdoMgmtBindRspT *rsp);
+
+/*FUNCTION:------------------------------------------------------
+ * NAME ZbZdoPermitJoinWait
+ * DESC Mgmt_Permit_Join_req
+ * If sent to broadcast, then doesn't wait for responses, and
+ * will return the status from the APSDE-DATA.confirm.
+ * PARAMS
+ * RETURNS none
+ */
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbZdoPermitJoinReq(struct ZigBeeT *zb, ZbZdoPermitJoinReqT *req,
+ void (*callback)(ZbZdoPermitJoinRspT *rsp, void *cb_arg), void *arg);
+void ZbZdoPermitJoinWait(struct ZigBeeT *zb, ZbZdoPermitJoinReqT *req, ZbZdoPermitJoinRspT *rsp);
+
+/*FUNCTION:------------------------------------------------------
+ * NAME ZbZdoNwkUpdateWait
+ * DESC Mgmt_Nwk_Update_req
+ * PARAMS
+ * RETURNS none
+ */
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbZdoNwkUpdateReq(struct ZigBeeT *zb, ZbZdoNwkUpdateReqT *req,
+ void (*callback)(ZbZdoNwkUpdateNotifyT *reqPtr, void *cb_arg), void *arg);
+void ZbZdoNwkUpdateWait(struct ZigBeeT *zb, ZbZdoNwkUpdateReqT *req, ZbZdoNwkUpdateNotifyT *rsp);
+
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbZdoNwkEnhUpdateReq(struct ZigBeeT *zb, struct ZbZdoNwkEnhUpdateReqT *req,
+ void (*callback)(ZbZdoNwkUpdateNotifyT *reqPtr, void *cb_arg), void *arg);
+
+/*FUNCTION:------------------------------------------------------
+ * NAME ZbZdoNwkUpdateNotify
+ * DESC Mgmt_Nwk_Update_notify
+ * PARAMS
+ * RETURNS none
+ */
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbZdoNwkUpdateNotify(struct ZigBeeT *zb, ZbZdoNwkUpdateNotifyT *reqPtr);
+
+/*FUNCTION:------------------------------------------------------
+ * NAME ZbZdoMgmtLeaveWait
+ * DESC Mgmt_Nwk_Leave_req
+ * PARAMS
+ * RETURNS none
+ */
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbZdoLeaveReq(struct ZigBeeT *zb, ZbZdoLeaveReqT *req,
+ void (*callback)(ZbZdoLeaveRspT *rsp, void *cb_arg), void *arg);
+void ZbZdoLeaveWait(struct ZigBeeT *zb, ZbZdoLeaveReqT *req, ZbZdoLeaveRspT *rsp);
+
+/*---------------------------------------------------------------
+ * Receive incoming ZDO messages
+ *---------------------------------------------------------------
+ */
+
+/*FUNCTION:------------------------------------------------------
+ * NAME ZbZdoSetPreHandler
+ * DESC Configures the callback to receive incoming ZDO messages
+ * in your application.
+ * PARAMS zb ; ZigBee stack instance.
+ * func ; The callback function.
+ * RETURNS none
+ *
+ *FUNCTION:------------------------------------------------------
+ * NAME ZbZdoPreHandlerFuncT func
+ * DESC The callback that's called for an incoming ZDO message.
+ * PARAMS zb ; ZigBee stack instance.
+ * dataIndPtr ; APS-DATA.indication
+ * seqnum ; ZDO message sequence number
+ * RETURNS true (1) if the application has handled it and the stack
+ * should not process the message further.
+ * FALSE (0) if the application has not handled the message or
+ * wants to let the stack finish whatever processing it needs
+ * to do.
+ * Typically, the callback should return 0 to let the stack
+ * perform its own processing on the message.
+ *---------------------------------------------------------------
+ */
+typedef int (*ZbZdoPreHandlerFuncT)(struct ZigBeeT *zb, ZbApsdeDataIndT *dataIndPtr, uint8_t seqnum);
+void ZbZdoSetPreHandler(struct ZigBeeT *zb, ZbZdoPreHandlerFuncT func);
+
+/*---------------------------------------------------------------
+ * Misc. Helper Functions
+ *---------------------------------------------------------------
+ */
+uint8_t ZbZdoGetNextSeqNum(struct ZigBeeT *zb);
+
+/*FUNCTION:------------------------------------------------------
+ * NAME ZbZdoParseDeviceAnnce
+ * DESC Parses a Device_annce message.
+ * PARAMS structPtr ; Pointer to structure to fill in.
+ * buf ; e.g. dataIndPtr->asdu
+ * len ; e.g. dataIndPtr->asduLength
+ * RETURNS # of bytes parsed, or <0 on error.
+ *---------------------------------------------------------------
+ */
+int ZbZdoParseDeviceAnnce(ZbZdoDeviceAnnceT *structPtr, const uint8_t *buf, unsigned int len);
+
+/* Internal complex descriptor format */
+typedef struct {
+ char manufacturerName[16];
+ char modelName[16];
+ char serialNumber[16];
+} ZbZdoComplexDescT;
+
+/*FUNCTION:------------------------------------------------------
+ * NAME ZbZdoSetComplexDesc
+ * DESC Configures the local complex descriptor. The information from
+ * the structPtr parameter is copied to the stack instance.
+ * PARAMS zb ; ZigBee stack instance.
+ * structPtr ; Pointer to complex descriptor structure to copy.
+ * RETURNS ZDP Status Code (success == 0x00)
+ *---------------------------------------------------------------
+ */
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbZdoSetComplexDesc(struct ZigBeeT *zb, ZbZdoComplexDescT *structPtr);
+
+enum ZbStatusCodeT ZB_WARN_UNUSED ZbZdoNwkIeeeJoinListReq(struct ZigBeeT *zb, struct ZbZdoNwkIeeeJoinListReqT *req,
+ void (*callback)(struct ZbZdoNwkIeeeJoinListRspT *rsp, void *cb_arg), void *arg);
+unsigned int ZbZdoNwkIeeeJoinListRsp(struct ZigBeeT *zb, uint16_t dstNwkAddr,
+ uint8_t startIndex, uint8_t seqnum, bool fromRequest);
+/* Helper to broadcast the entire list to the network */
+unsigned int ZbZdoNwkIeeeJoinListBcastAll(struct ZigBeeT *zb);
+
+#endif /* ZIGBEE_ZDO_H */
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.zgp.h b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.zgp.h
new file mode 100644
index 000000000..05c6675de
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zigbee.zgp.h
@@ -0,0 +1,243 @@
+/* Copyright [2009 - 2019] Exegin Technologies Limited. All rights reserved. */
+
+#ifndef ZIGBEE_ZGP_H
+# define ZIGBEE_ZGP_H
+
+/*lint -save -e621 [ identifier clash within 31 chars - 5.1 REQUIRED ] */
+/*lint -save -e955 [ param name missing from 'callback' prototype - 8.2 REQUIRED] */
+
+/* Identifier clash ('ZB_ZGP_COMMAND_MOVE_SATURATION_UP' <->'ZB_ZGP_COMMAND_MOVE_SATURATION_STOP' */
+
+/* Known Profiles */
+enum {
+ ZB_ZGP_PROFILE_ID = 0xA1E0
+};
+
+/*---------------------------------------------------------------
+ * Device IDs
+ *---------------------------------------------------------------
+ */
+#define ZB_ZGP_DEVICE_PROXY (uint16_t)0x0060U
+#define ZB_ZGP_DEVICE_PROXY_BASIC (uint16_t)0x0061U
+#define ZB_ZGP_DEVICE_TARGET_PLUS (uint16_t)0x0062U
+#define ZB_ZGP_DEVICE_TARGET (uint16_t)0x0063U
+#define ZB_ZGP_DEVICE_COMMISSIONING_TOOL (uint16_t)0x0064U
+#define ZB_ZGP_DEVICE_COMBO (uint16_t)0x0065U
+#define ZB_ZGP_DEVICE_COMBO_BASIC (uint16_t)0x0066U
+
+/*---------------------------------------------------------------
+ * Device Version
+ *---------------------------------------------------------------
+ */
+#define ZB_ZGP_DEVICE_VER (uint8_t)0x00U
+
+/*---------------------------------------------------------------
+ * Cluster IDs
+ *---------------------------------------------------------------
+ */
+#define ZB_ZGP_TYPE_DATA (uint8_t)0x00U
+#define ZB_ZGP_TYPE_MAINTENANCE (uint8_t)0x01U
+
+#define ZB_ZGP_APPID_SRCID (uint8_t)0x00U
+#define ZB_ZGP_APPID_LPED (uint8_t)0x01U
+#define ZB_ZGP_APPID_ENDPOINT (uint8_t)0x02U
+/* Used to indicate invalid or unused entries. */
+#define ZB_ZGP_APPID_INVALID (uint8_t)0xffU
+
+#define ZB_ZGP_SRCID_UNSPECIFIED (uint32_t)0UL
+#define ZB_ZGP_SRCID_BROADCAST (uint32_t)0xffffffffUL
+#define ZB_ZGP_SRCID_MAX (uint32_t)0xfffffff8UL
+
+#define ZB_ZGP_KEYTYPE_NONE (uint8_t)0x00U
+#define ZB_ZGP_KEYTYPE_NWKKEY (uint8_t)0x01U /* ZigBee Network Key */
+#define ZB_ZGP_KEYTYPE_GPD_GROUP (uint8_t)0x02U /* GPD Group Key */
+#define ZB_ZGP_KEYTYPE_NWK_DERIVED (uint8_t)0x03U /* NWK-Key derived GPD Group Key: Kgp = HMAC(Knwk, "ZGP") */
+#define ZB_ZGP_KEYTYPE_PRECONFIG (uint8_t)0x04U /* Pre-configured GPD security key. */
+#define ZB_ZGP_KEYTYPE_INDIVIDUAL (uint8_t)0x07U /* Derived individual GPD key: Kgp = HMAC(K, ID) */
+
+/* ZGP SecurityLevels */
+#define ZB_ZGP_SECURITY_NONE (uint8_t)0x00U
+#define ZB_ZGP_SECURITY_AUTH (uint8_t)0x02U
+#define ZB_ZGP_SECURITY_ENCRYPT (uint8_t)0x03U
+
+/* ZGP Security Status codes */
+enum ZgpStatusCodeT {
+ ZB_ZGP_STATUS_SUCCESS = 0x00,
+ ZB_ZGP_STATUS_NO_SECURITY = 0x01,
+ ZB_ZGP_STATUS_COUNTER_FAILURE = 0x02,
+ ZB_ZGP_STATUS_AUTH_FAILURE = 0x03,
+ ZB_ZGP_STATUS_UNPROCESSED = 0x04,
+ /* Internal security status codes. */
+ ZB_ZGP_STATUS_TX_THEN_DROP = 0x05,
+ ZB_ZGP_STATUS_DROP_FRAME = 0x06,
+ /* ZGP packet queue status codes. */
+ ZB_ZGP_STATUS_TX_QUEUE_FULL = 0x07,
+ ZB_ZGP_STATUS_ENTRY_REPLACED = 0x08,
+ ZB_ZGP_STATUS_ENTRY_ADDED = 0x09,
+ ZB_ZGP_STATUS_ENTRY_EXPIRED = 0x0a,
+ ZB_ZGP_STATUS_ENTRY_REMOVED = 0x0b,
+ ZB_ZGP_STATUS_INVALID_PARAMETER = 0x0c
+};
+
+/* GPDF Command Identifiers */
+#define ZB_ZGP_COMMAND_IDENTIFY (uint8_t)0x00U
+#define ZB_ZGP_COMMAND_RECALL_SCENE(_x_) (uint8_t)(0x10U + (_x_))
+#define ZB_ZGP_COMMAND_STORE_SCENE(_x_) (uint8_t)(0x18U + (_x_))
+#define ZB_ZGP_COMMAND_OFF (uint8_t)0x20U
+#define ZB_ZGP_COMMAND_ON (uint8_t)0x21U
+#define ZB_ZGP_COMMAND_TOGGLE (uint8_t)0x22U
+#define ZB_ZGP_COMMAND_RELEASE (uint8_t)0x23U
+#define ZB_ZGP_COMMAND_MOVE_UP (uint8_t)0x30U
+#define ZB_ZGP_COMMAND_MOVE_DOWN (uint8_t)0x31U
+#define ZB_ZGP_COMMAND_STEP_UP (uint8_t)0x32U
+#define ZB_ZGP_COMMAND_STEP_DOWN (uint8_t)0x33U
+#define ZB_ZGP_COMMAND_LEVEL_STOP (uint8_t)0x34U
+#define ZB_ZGP_COMMAND_MOVE_UP_ONOFF (uint8_t)0x35U
+#define ZB_ZGP_COMMAND_MOVE_DOWN_ONOFF (uint8_t)0x36U
+#define ZB_ZGP_COMMAND_STEP_UP_ONOFF (uint8_t)0x37U
+#define ZB_ZGP_COMMAND_STEP_DOWN_ONOFF (uint8_t)0x38U
+#define ZB_ZGP_COMMAND_MOVE_HUE_STOP (uint8_t)0x40U
+#define ZB_ZGP_COMMAND_MOVE_HUE_UP (uint8_t)0x41U
+#define ZB_ZGP_COMMAND_MOVE_HUE_DOWN (uint8_t)0x42U
+#define ZB_ZGP_COMMAND_STEP_HUE_UP (uint8_t)0x43U
+#define ZB_ZGP_COMMAND_STEP_HUE_DOWN (uint8_t)0x44U
+#define ZB_ZGP_COMMAND_MOVE_SATURATION_STOP (uint8_t)0x45U
+#define ZB_ZGP_COMMAND_MOVE_SATURATION_UP (uint8_t)0x46U
+#define ZB_ZGP_COMMAND_MOVE_SATURATION_DOWN (uint8_t)0x47U
+#define ZB_ZGP_COMMAND_STEP_SATURATION_UP (uint8_t)0x48U
+#define ZB_ZGP_COMMAND_STEP_SATURATION_DOWN (uint8_t)0x49U
+#define ZB_ZGP_COMMAND_MOVE_COLOR (uint8_t)0x4aU
+#define ZB_ZGP_COMMAND_STEP_COLOR (uint8_t)0x4bU
+#define ZB_ZGP_COMMAND_LOCK_DOOR (uint8_t)0x50U
+#define ZB_ZGP_COMMAND_UNLOCK_DOOR (uint8_t)0x51U
+#define ZB_ZGP_COMMAND_PRESS_1_OF_1 (uint8_t)0x60U
+#define ZB_ZGP_COMMAND_RELEASE_1_OF_1 (uint8_t)0x61U
+#define ZB_ZGP_COMMAND_PRESS_1_OF_2 (uint8_t)0x62U
+#define ZB_ZGP_COMMAND_RELEASE_1_OF_2 (uint8_t)0x63U
+#define ZB_ZGP_COMMAND_PRESS_2_OF_2 (uint8_t)0x64U
+#define ZB_ZGP_COMMAND_RELEASE_2_OF_2 (uint8_t)0x65U
+#define ZB_ZGP_COMMAND_SHORT_PRESS_1_OF_1 (uint8_t)0x66U
+#define ZB_ZGP_COMMAND_SHORT_PRESS_1_OF_2 (uint8_t)0x67U
+#define ZB_ZGP_COMMAND_SHORT_PRESS_2_OF_2 (uint8_t)0x68U
+#define ZB_ZGP_COMMAND_ATTRIBUTE_REPORTING (uint8_t)0xa0U
+#define ZB_ZGP_COMMAND_MFR_REPORTING (uint8_t)0xa1U
+#define ZB_ZGP_COMMAND_MULTI_REPORTING (uint8_t)0xa2U
+#define ZB_ZGP_COMMAND_MFR_MULTI_REPORTING (uint8_t)0xa3U
+#define ZB_ZGP_COMMAND_REQUEST_ATTRIBUTES (uint8_t)0xa4U
+#define ZB_ZGP_COMMAND_READ_ATTRIBUTES_RESP (uint8_t)0xa5U
+#define ZB_ZGP_COMMAND_ZCL_TUNNELING (uint8_t)0xa6U
+#define ZB_ZGP_COMMAND_GPD_SENSOR (uint8_t)0xafU
+#define ZB_ZGP_COMMAND_MFR_MIN (uint8_t)0xb0U
+#define ZB_ZGP_COMMAND_MFR_MAX (uint8_t)0xbfU
+#define ZB_ZGP_COMMAND_COMMISSIONING (uint8_t)0xe0U
+#define ZB_ZGP_COMMAND_DECOMMISSIONING (uint8_t)0xe1U
+#define ZB_ZGP_COMMAND_SUCCESS (uint8_t)0xe2U
+#define ZB_ZGP_COMMAND_CHANNEL_REQUEST (uint8_t)0xe3U
+#define ZB_ZGP_COMMAND_e4 (uint8_t)0xe4U
+#define ZB_ZGP_COMMAND_e5 (uint8_t)0xe5U
+#define ZB_ZGP_COMMAND_e6 (uint8_t)0xe6U
+#define ZB_ZGP_COMMAND_e7 (uint8_t)0xe7U
+#define ZB_ZGP_COMMAND_e8 (uint8_t)0xe8U
+#define ZB_ZGP_COMMAND_e9 (uint8_t)0xe9U
+#define ZB_ZGP_COMMAND_ea (uint8_t)0xeaU
+#define ZB_ZGP_COMMAND_eb (uint8_t)0xebU
+#define ZB_ZGP_COMMAND_ec (uint8_t)0xecU
+#define ZB_ZGP_COMMAND_ed (uint8_t)0xedU
+#define ZB_ZGP_COMMAND_ee (uint8_t)0xeeU
+#define ZB_ZGP_COMMAND_ef (uint8_t)0xefU
+#define ZB_ZGP_COMMAND_RESERVED_MIN (uint8_t)0xf0U
+
+#define ZB_ZGP_COMMAND_MASK_b0 (uint8_t)0xb0U
+#define ZB_ZGP_COMMAND_MASK_e0 (uint8_t)0xe0U
+
+#define ZB_ZGP_COMMAND_COMMISSIONING_REPLY (uint8_t)0xf0U
+#define ZB_ZGP_COMMAND_WRITE_ATTRIBUTES (uint8_t)0xf1U
+#define ZB_ZGP_COMMAND_READ_ATTRIBUTES (uint8_t)0xf2U
+#define ZB_ZGP_COMMAND_CHANNEL_CONFIGURATION (uint8_t)0xf3U
+#define ZB_ZGP_COMMAND_ZCL_TUNNELING2 (uint8_t)0xf6U
+
+/*---------------------------------------------------------------
+ * GP-DATA.request and GP-DATA.confirm
+ *---------------------------------------------------------------
+ */
+#define ZB_ZGP_TXOPTIONS_QUEUE (uint8_t)0x01U
+#define ZB_ZGP_TXOPTIONS_CSMA (uint8_t)0x02U
+#define ZB_ZGP_TXOPTIONS_ACK (uint8_t)0x04U
+#define ZB_ZGP_TXOPTIONS_TYPE (uint8_t)0x18U
+#define ZB_ZGP_TXOPTIONS_DATA (uint8_t)(ZB_ZGP_TYPE_DATA << 3U)
+#define ZB_ZGP_TXOPTIONS_MAINTENANCE (uint8_t)(ZB_ZGP_TYPE_MAINTENANCE << 3U)
+#define ZB_ZGP_TXOPTIONS_ENDPOINT (uint8_t)0x20U
+
+typedef struct ZbZgpDataReqT {
+ uint8_t txOptions;
+ uint8_t applicationId;
+ uint32_t srcId;
+ uint64_t dstAddr;
+ uint8_t endpoint;
+ uint8_t commandId;
+ const void *asdu;
+ uint8_t asduLength;
+ uint32_t handle;
+ uint16_t lifetime;
+} ZbZgpDataReqT;
+
+/* Same format as ZbNldeDataConfT */
+typedef struct ZbZgpDataConfT {
+ uint32_t handle;
+ enum ZgpStatusCodeT status;
+} ZbZgpDataConfT;
+
+/* Add items to the gpTxQueue */
+void ZbZgpDataReqWait(struct ZigBeeT *zb, ZbZgpDataReqT *req, ZbZgpDataConfT *conf);
+void ZbZgpDataReqCallback(struct ZigBeeT *, ZbZgpDataReqT *, void (*callback)(ZbZgpDataConfT *, void *), void *arg);
+
+/* Remove items from the gpTxQueue */
+void ZbZgpDataPurge(struct ZigBeeT *zb, uint8_t appId, uint64_t gpdId, uint8_t endpoint);
+
+/*---------------------------------------------------------------
+ * GP-DATA.indication
+ *---------------------------------------------------------------
+ */
+typedef struct ZbZgpDataIndT {
+ enum ZgpStatusCodeT status;
+ int8_t rssi;
+ uint8_t linkQuality;
+ uint8_t seqNumber;
+ uint8_t applicationId;
+ uint8_t securityLevel;
+ uint8_t keyType;
+ uint32_t frameCounter;
+ uint8_t rxAfterTx;
+ uint8_t commissioning;
+ uint32_t srcId;
+ uint64_t srcAddr;
+ uint8_t endpoint;
+ uint8_t commandId;
+ const void *asdu;
+ uint8_t asduLength;
+ uint8_t mic[4];
+ uint8_t frameType;
+} ZbZgpDataIndT;
+
+/*---------------------------------------------------------------
+ * Proxy table hacks
+ *---------------------------------------------------------------
+ */
+int ZbZgpDecryptKey(struct ZigBeeT *zb, uint8_t appId, uint64_t gpdId, void *key, const void *mic);
+
+uint8_t ZbZgpAddKey(struct ZigBeeT *zb, uint8_t applicationId, uint64_t gpdId, uint8_t endpoint,
+ uint8_t level, uint8_t keytype, const void *key);
+
+#if 0 /* FIXME - NOT_INCLUDED */
+void ZbZgpRecvDataInd(ZbApsdeDataIndT *dataIndPtr, void *arg);
+bool ZbZgpHandleUnsolicited(struct ZbZgpT *zgp, ZbApsdeDataIndT *dataIndPtr, uint8_t seqnum);
+void ZbZgpHandleUnsupported(struct ZigBeeT *zb, ZbApsdeDataIndT *ind, uint8_t seqnum);
+#endif
+
+/* NOTE! This is only an empty server used for testing */
+struct ZbZclClusterT * ZbZgpDeviceServerAlloc(struct ZigBeeT *zb, uint8_t endpoint);
+
+/*lint -restore */
+/*lint -restore */
+
+#endif /* ZIGBEE_ZGP_H */
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/stack/zcl/local_zcl.h b/Middlewares/ST/STM32_WPAN/zigbee/stack/zcl/local_zcl.h
new file mode 100644
index 000000000..f086acb09
--- /dev/null
+++ b/Middlewares/ST/STM32_WPAN/zigbee/stack/zcl/local_zcl.h
@@ -0,0 +1,209 @@
+/* Copyright [2009 - 2019] Exegin Technologies Limited. All rights reserved. */
+
+/*-------------------------------------------------
+ * DESCRIPTION
+ * Internal header file for the ZigBee Cluster
+ * Library.
+ *-------------------------------------------------
+ */
+#ifndef LOCAL_ZCL_H
+#define LOCAL_ZCL_H
+
+#include "zigbee.h"
+#include "zcl/zcl.h"
+
+struct ZbTimerT;
+
+#ifndef ZclAssert
+# include <assert.h>
+# define ZclAssert assert
+#endif
+
+/*---------------------------------------------------------------
+ * Debug Logging
+ *---------------------------------------------------------------
+ */
+/*lint -save -e762 [ Redundantly declared symbol ] */
+/*lint -save -e9004 [ previously declared - MISRA 2012 Rule 8.5, required ] */
+extern void ZbLogPrintf(struct ZigBeeT *zb, uint32_t mask, const char *hdr, const char *fmt, ...);
+/*lint -restore */
+/*lint -restore */
+
+#ifndef CONFIG_ZB_LOG_ALLOWED_MASK
+/* If not defined, then disable debugging (minimal Flash size) */
+# define CONFIG_ZB_LOG_ALLOWED_MASK ZB_LOG_MASK_LEVEL_0
+#endif
+
+/*lint -emacro(506,ZCL_LOG_PRINTF) */
+/* Info 774: Boolean within 'if' always evaluates to False */
+/*lint -emacro(774,ZCL_LOG_PRINTF) */
+/*lint -emacro(831,ZCL_LOG_PRINTF) */
+
+#if ((ZB_LOG_MASK_ZCL & CONFIG_ZB_LOG_ALLOWED_MASK) != 0U)
+#define ZCL_LOG_PRINTF(zb, hdr, ...) \
+ do { \
+ if ((zb) == NULL) { \
+ break; \
+ } \
+ ZbLogPrintf(zb, ZB_LOG_MASK_ZCL, hdr, __VA_ARGS__); \
+ } while (false)
+#else
+#define ZCL_LOG_PRINTF(zb, hdr, ...) (void)zb
+#endif
+
+/* Default cluster TX Options (NWK layer security, APS ACK, fragmentation allowed) */
+#define ZCL_CLUSTER_TXOPTIONS_DEFAULT \
+ (ZB_APSDE_DATAREQ_TXOPTIONS_SECURITY | \
+ ZB_APSDE_DATAREQ_TXOPTIONS_NWKKEY | \
+ ZB_APSDE_DATAREQ_TXOPTIONS_ACK | \
+ ZB_APSDE_DATAREQ_TXOPTIONS_FRAG)
+
+/* Default SE cluster TX Options (same as default above, but APS security is enabled) */
+#define ZCL_CLUSTER_TXOPTIONS_SE \
+ (ZB_APSDE_DATAREQ_TXOPTIONS_SECURITY | \
+ ZB_APSDE_DATAREQ_TXOPTIONS_ACK | \
+ ZB_APSDE_DATAREQ_TXOPTIONS_FRAG)
+
+uint16_t zcl_rsp_txoptions(enum ZbStatusCodeT security_status);
+
+#define ZCL_ATTRIBUTE_BUFFER_SIZE 256U
+
+/* Our internal Manufacturer Code (ZCL_FRAMECTRL_MANUFACTURER).
+ * This code is never sent over the air. */
+enum {
+ ZCL_MANUF_CODE_INTERNAL = 0xfffe /* FIXME - arbitrary */
+};
+
+/* Exegin's Manufacturer Specific Global Commands
+ * ZCL_FRAMECTRL_MANUFACTURER && ZCL_FRAMETYPE_PROFILE && (Manufacturer Code == ZCL_MANUF_CODE_INTERNAL) */
+enum {
+ ZCL_CMD_MANUF_INTERNAL_ATTR_RESET_DEFAULT, /* attr_reset() */
+
+ /* For Scene Store Command (ZCL_SCENES_COMMAND_STORE_SCENE)
+ * Payload for Request (to Server): None
+ * Payload for Response: [CLUSTER(2) | EXT_LEN(1) | EXT_ATTR_DATA(N)] */
+ ZCL_CMD_MANUF_INTERNAL_GET_SCENE_EXTDATA, /* get_scene_data() */
+
+ /* For Scene Recall Command (ZCL_SCENES_COMMAND_RECALL_SCENE)
+ * Payload for Request (to Server): [EXT_LEN(1) | EXT_ATTR_DATA(N)]
+ * Payload for Response: [STATUS(1)] */
+ ZCL_CMD_MANUF_INTERNAL_SET_SCENE_EXTDATA, /* set_scene_data() */
+
+ /* ZCL Cluster Persistence: Profile-Wide Manufacturer-Specific command
+ * sent to a cluster to restore persistence. */
+ ZCL_CMD_MANUF_INTERNAL_ATTR_PERSIST_SET
+};
+
+/* Offsets into ZCL_CMD_MANUF_INTERNAL_SET_SCENE_EXTDATA message */
+#define SET_SCENE_EXTDATA_OFFSET_EXT_LEN 4U
+#define SET_SCENE_EXTDATA_OFFSET_EXT_FIELD 5U
+#define SET_SCENE_EXTDATA_HEADER_LEN (4U + 1U)
+
+/*---------------------------------------------------------------------------
+ * ZCL Attributes
+ *---------------------------------------------------------------------------
+ */
+
+/* The internal allocated attribute struct */
+struct ZbZclAttrListEntryT {
+ struct LinkListT link;
+ const struct ZbZclAttrT *info; /* Attribute info */
+ /* Internal Callback - used by the stack only for IPC, if applicable.
+ * Can't override info->callback because it's a const and may be stored in Flash. */
+ enum ZclStatusCodeT (*internal_callback)(struct ZbZclClusterT *clusterPtr, struct ZbZclAttrCbInfoT *info);
+ uint8_t *valBuf; /* ZCL format (i.e. same as what is sent over-the-air) */
+ unsigned int valSz; /* Allocation size of valBuf. */
+#ifndef CONFIG_ZB_ZCL_MINIMAL
+ struct {
+ uint16_t interval_secs_min; /* seconds */
+ uint16_t interval_secs_max; /* seconds */
+ } reporting;
+#endif
+};
+
+enum ZclStatusCodeT zcl_attr_callback_exec(struct ZbZclClusterT *clusterPtr, struct ZbZclAttrListEntryT *attrPtr, struct ZbZclAttrCbInfoT *cb);
+
+void ZbZclAttrFreeList(struct ZbZclClusterT *clusterPtr);
+enum ZclStatusCodeT ZbZclAttrDefaultRead(struct ZbZclClusterT *clusterPtr, struct ZbZclAttrListEntryT *attrPtr, uint8_t *data, unsigned int data_len);
+enum ZclStatusCodeT ZbZclAttrDefaultWrite(struct ZbZclClusterT *clusterPtr, struct ZbZclAttrListEntryT *attrPtr, const uint8_t *data, ZclWriteModeT mode);
+void ZbZclAttrPostWrite(struct ZbZclClusterT *clusterPtr, struct ZbZclAttrListEntryT *attrPtr);
+bool ZbZclAttrIntegerRangeCheck(struct ZbZclAttrListEntryT *attrPtr, const uint8_t *attr_data, unsigned int attr_len);
+
+/* Handlers for response commands. */
+void ZbZclCallbackTick(struct ZbZclClusterT *clusterPtr);
+void ZbZclCallbackCleanup(struct ZbZclClusterT *clusterPtr);
+
+/* Handlers for the global commands. */
+void ZbZclHandleReadAttr(struct ZbZclClusterT *clusterPtr, struct ZbZclHeaderT *zclHdrPtr, ZbApsdeDataIndT *ind);
+void ZbZclHandleWriteAttr(struct ZbZclClusterT *clusterPtr, struct ZbZclHeaderT *zclHdrPtr, ZbApsdeDataIndT *ind);
+void ZbZclAttrHandleDiscover(struct ZbZclClusterT *clusterPtr, struct ZbZclHeaderT *zclHdrPtr, ZbApsdeDataIndT *ind);
+
+/* Functions for attribute reporting. */
+void ZbZclReportTick(struct ZbZclClusterT *clusterPtr);
+void ZbZclReportCleanup(struct ZbZclClusterT *clusterPtr);
+enum ZclStatusCodeT zcl_reporting_config_default(struct ZbZclClusterT *clusterPtr);
+void ZbZclHandleConfigReport(struct ZbZclClusterT *clusterPtr, struct ZbZclHeaderT *zclHdrPtr, ZbApsdeDataIndT *ind);
+void ZbZclHandleConfigResponse(struct ZbZclClusterT *clusterPtr, struct ZbZclHeaderT *zclHdrPtr, ZbApsdeDataIndT *dataIndPtr);
+void ZbZclHandleReadReport(struct ZbZclClusterT *clusterPtr, struct ZbZclHeaderT *zclHdrPtr, ZbApsdeDataIndT *ind);
+void ZbZclHandleReportAttr(struct ZbZclClusterT *clusterPtr, struct ZbZclHeaderT *zclHdrPtr, ZbApsdeDataIndT *ind);
+
+/* Functions for structured reading/writing. */
+void ZbZclHandleReadStruct(struct ZbZclClusterT *clusterPtr, struct ZbZclHeaderT *zclHdrPtr, ZbApsdeDataIndT *ind);
+void ZbZclHandleWriteStruct(struct ZbZclClusterT *clusterPtr, struct ZbZclHeaderT *zclHdrPtr, ZbApsdeDataIndT *dataIndPtr);
+
+/* ZCL command state stuff. */
+#define ZCL_STATE_CONTINUE 0 /* Return zero to continue waiting for responses. */
+#define ZCL_STATE_CLEANUP 1 /* Return one to cleanup the state. */
+typedef int (*ZbZclHandlerFuncT)(struct ZbZclCommandRspT *cmdRsp, void (*callback)(void *msg, void *arg), void *arg);
+
+void ZbZclStateBegin(struct ZigBeeT *zb, ZbApsdeDataReqT *apsReq, struct ZbZclHeaderT *zclHdr,
+ unsigned int timeout, ZbZclHandlerFuncT handler,
+ void (*callback)(void *msg, void *arg), void *arg);
+
+/* A callback to use when waiting for a ZCL response.
+ * "struct ZbZclCommandWakeInfoT" is allocated by caller and pointer
+ * passed as callback "arg". Semaphore is posted upon response reception. */
+struct ZbZclCommandWakeInfoT {
+ struct ZbSemT *sem;
+ struct ZbZclCommandRspT *rsp;
+};
+void zcl_command_rsp_wakeup(struct ZbZclCommandRspT *rsp, void *arg);
+
+/* ZCL Attributes */
+enum ZclDataTypeT ZbZclAttrType(struct ZbZclClusterT *clusterPtr, uint16_t attrId);
+unsigned int ZbZclAttrTypeLength(enum ZclDataTypeT type);
+void ZbZclAttrAddSorted(struct ZbZclClusterT *clusterPtr, struct ZbZclAttrListEntryT *new_entry);
+struct ZbZclAttrListEntryT * ZbZclAttrFind(struct ZbZclClusterT *clusterPtr, uint16_t attrId);
+unsigned int ZbZclAttrDiscoverGetList(struct ZbZclClusterT *clusterPtr, uint16_t start_attr, uint8_t *max_num_attr, uint8_t *buf, unsigned int max_len);
+
+int ZbZclAttrDefaultValue(enum ZclDataTypeT type, uint8_t *buf, unsigned int max_len);
+
+void ZbZclAttrResetAllClusters(struct ZigBeeT *zb);
+
+/* ZCL Basic Server */
+struct ZbZclClusterT * zcl_basic_server_alloc(struct ZigBeeT *zb, uint8_t endpoint, bool is_first);
+uint8_t zcl_basic_server_alarm_mask(struct ZbZclClusterT *clusterPtr);
+
+/* ZCL Scene Callbacks */
+void ZbZclHandleGetSceneData(struct ZbZclClusterT *clusterPtr, struct ZbZclHeaderT *zclHdrPtr, ZbApsdeDataIndT *ind);
+void ZbZclHandleSetSceneData(struct ZbZclClusterT *clusterPtr, struct ZbZclHeaderT *zclHdrPtr, ZbApsdeDataIndT *ind);
+
+/* ZCL Persistence */
+struct ZbZclClusterT * zcl_persist_server_alloc(struct ZigBeeT *zb);
+unsigned int zcl_persist_server_get(struct ZbZclClusterT *clusterPtr, uint8_t *buf, unsigned int max_len);
+enum ZclStatusCodeT zcl_persist_restore(struct ZigBeeT *zb, const uint8_t *buf, uint16_t len);
+enum ZclStatusCodeT zcl_persist_handle_set(struct ZbZclClusterT *clusterPtr, uint8_t *buf, uint16_t len);
+
+void zcl_persist_cluster_timer(struct ZigBeeT *zb, void *arg);
+
+enum ZclStatusCodeT zcl_cluster_bind(struct ZbZclClusterT *clusterPtr, struct ZbApsFilterT *filter, uint8_t endpoint, uint16_t profileId, enum ZbZclDirectionT direction);
+
+bool zcl_reporting_remove(struct ZbZclClusterT *clusterPtr, uint16_t attributeId, enum ZbZclReportDirectionT direction);
+
+/* Helper function to check incoming packet security against the
+ * cluster's minimum security level allowed. */
+bool ZbZclClusterCheckMinSecurity(struct ZbZclClusterT *clusterPtr, ZbApsdeDataIndT *dataIndPtr, struct ZbZclHeaderT *zclHdrPtr);
+
+bool ZbZclDeviceLogCheckAllow(struct ZbZclClusterT *clusterPtr, ZbApsdeDataIndT *dataIndPtr, struct ZbZclHeaderT *zclHdrPtr);
+
+#endif /* LOCAL_ZCL_H */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/BLE_Beacon.ioc b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/BLE_Beacon.ioc
index 5fb13ad43..f15443ff9 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/BLE_Beacon.ioc
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/BLE_Beacon.ioc
@@ -73,27 +73,29 @@ Mcu.IP9=SYS
Mcu.IPNb=12
Mcu.Name=STM32WB55RGVx
Mcu.Package=VFQFPN68
-Mcu.Pin0=PA2
-Mcu.Pin1=PA3
-Mcu.Pin10=VP_RTC_VS_RTC_Activate
-Mcu.Pin11=VP_SEQUENCER_VS_SEQUENCER
-Mcu.Pin12=VP_STM32_WPAN_VS_BLE_HOST
-Mcu.Pin13=VP_SYS_VS_Systick
-Mcu.Pin14=VP_TINY_LPM_VS_TINY_LPM
-Mcu.Pin2=PA6
-Mcu.Pin3=RF1
-Mcu.Pin4=OSC_OUT
-Mcu.Pin5=OSC_IN
-Mcu.Pin6=PA11
-Mcu.Pin7=PB6
-Mcu.Pin8=PB7
-Mcu.Pin9=VP_HSEM_VS_HSEM
-Mcu.PinsNb=15
+Mcu.Pin0=PC14-OSC32_IN
+Mcu.Pin1=PC15-OSC32_OUT
+Mcu.Pin10=PB7
+Mcu.Pin11=VP_HSEM_VS_HSEM
+Mcu.Pin12=VP_RTC_VS_RTC_Activate
+Mcu.Pin13=VP_SEQUENCER_VS_SEQUENCER
+Mcu.Pin14=VP_STM32_WPAN_VS_BLE_HOST
+Mcu.Pin15=VP_SYS_VS_Systick
+Mcu.Pin16=VP_TINY_LPM_VS_TINY_LPM
+Mcu.Pin2=PA2
+Mcu.Pin3=PA3
+Mcu.Pin4=PA6
+Mcu.Pin5=RF1
+Mcu.Pin6=OSC_OUT
+Mcu.Pin7=OSC_IN
+Mcu.Pin8=PA11
+Mcu.Pin9=PB6
+Mcu.PinsNb=17
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32WB55RGVx
-MxCube.Version=5.3.0
-MxDb.Version=DB.5.0.30
+MxCube.Version=5.4.0
+MxDb.Version=DB.5.0.40
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false
NVIC.DMA1_Channel4_IRQn=true\:15\:0\:true\:false\:true\:false\:true
NVIC.DMA2_Channel4_IRQn=true\:15\:0\:true\:false\:true\:false\:true
@@ -146,6 +148,10 @@ PB7.GPIO_Speed=GPIO_SPEED_FREQ_VERY_HIGH
PB7.Locked=true
PB7.Mode=Asynchronous
PB7.Signal=USART1_RX
+PC14-OSC32_IN.Mode=LSE-External-Oscillator
+PC14-OSC32_IN.Signal=RCC_OSC32_IN
+PC15-OSC32_OUT.Mode=LSE-External-Oscillator
+PC15-OSC32_OUT.Signal=RCC_OSC32_OUT
PCC.Ble.ConnectionInterval=1000.0
PCC.Ble.DataLength=6
PCC.Ble.Mode=Advertising
@@ -168,7 +174,7 @@ ProjectManager.DeletePrevious=true
ProjectManager.DeviceId=STM32WB55RGVx
ProjectManager.FreePins=false
ProjectManager.HalAssertFull=false
-ProjectManager.HeapSize=0x200
+ProjectManager.HeapSize=0x400
ProjectManager.KeepUserCode=true
ProjectManager.LastFirmware=true
ProjectManager.LibraryCopy=2
@@ -178,11 +184,11 @@ ProjectManager.PreviousToolchain=
ProjectManager.ProjectBuild=false
ProjectManager.ProjectFileName=BLE_Beacon.ioc
ProjectManager.ProjectName=BLE_Beacon
-ProjectManager.StackSize=0x400
+ProjectManager.StackSize=0x1000
ProjectManager.TargetToolchain=EWARM V8
ProjectManager.ToolChainLocation=
ProjectManager.UnderRoot=false
-ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-SystemClock_Config-RCC-false-HAL-false,4-MX_LPUART1_UART_Init-LPUART1-true-HAL-false,5-MX_USART1_UART_Init-USART1-true-HAL-false,6-MX_RF_Init-RF-false-HAL-true,7-MX_RTC_Init-RTC-false-HAL-true,8-MX_STM32_WPAN_Init-STM32_WPAN-false-HAL-true
+ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-SystemClock_Config-RCC-false-HAL-false,4-MX_LPUART1_UART_Init-LPUART1-true-HAL-false,5-MX_USART1_UART_Init-USART1-true-HAL-false,6-MX_RF_Init-RF-false-HAL-true,7-MX_RTC_Init-RTC-false-HAL-true,8-APPE_Init-STM32_WPAN-false-HAL-false
RCC.ADCFreq_Value=64000000
RCC.AHBFreq_Value=32000000
RCC.APB1Freq_Value=32000000
@@ -204,12 +210,12 @@ RCC.HSI48_VALUE=48000000
RCC.HSI_VALUE=16000000
RCC.I2C1Freq_Value=32000000
RCC.I2C3Freq_Value=32000000
-RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSE_VALUE,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PLLSourceVirtual,PWRFreq_Value,RNGFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LCDFreq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PLLSourceVirtual,PWRFreq_Value,RFWKPClockSelection,RFWKPFreq_Value,RNGFreq_Value,RTCClockSelection,RTCFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.LCDFreq_Value=32768
RCC.LPTIM1Freq_Value=32000000
RCC.LPTIM2Freq_Value=32000000
RCC.LPUART1Freq_Value=32000000
RCC.LSCOPinFreq_Value=32000
-RCC.LSE_VALUE=32768
RCC.LSI_VALUE=32000
RCC.MCO1PinFreq_Value=32000000
RCC.PLLPoutputFreq_Value=64000000
@@ -220,7 +226,11 @@ RCC.PLLSAI1QoutputFreq_Value=64000000
RCC.PLLSAI1RoutputFreq_Value=64000000
RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSI
RCC.PWRFreq_Value=32000000
+RCC.RFWKPClockSelection=RCC_RFWKPCLKSOURCE_LSE
+RCC.RFWKPFreq_Value=32768
RCC.RNGFreq_Value=32000
+RCC.RTCClockSelection=RCC_RTCCLKSOURCE_LSE
+RCC.RTCFreq_Value=32768
RCC.SAI1Freq_Value=64000000
RCC.SMPS1Freq_Value=16000000
RCC.SYSCLKFreq_VALUE=32000000
@@ -232,11 +242,6 @@ RCC.VCOOutputFreq_Value=128000000
RCC.VCOSAI1OutputFreq_Value=128000000
RF1.Mode=RF1_Activate
RF1.Signal=RF_RF1
-RTC.AsynchPrediv=CFG_RTC_ASYNCH_PRESCALER
-RTC.HourFormat=RTC_HOURFORMAT_24
-RTC.IPParameters=HourFormat,AsynchPrediv,SynchPrediv
-RTC.IPParametersWithoutCheck=AsynchPrediv,SynchPrediv
-RTC.SynchPrediv=CFG_RTC_SYNCH_PRESCALER
STM32_WPAN.BLE_APPLICATION_TYPE=BLE_SERVER_PROFILE
STM32_WPAN.BLE_CFG_DIS_MODEL_NUMBER_STRING=1
STM32_WPAN.BLE_CFG_DIS_SYSTEM_ID=1
@@ -249,8 +254,10 @@ STM32_WPAN.BT_SIG_HEALTH_THERMOMETER_SENSOR=Disabled
STM32_WPAN.BT_SIG_HEART_RATE_SENSOR=Disabled
STM32_WPAN.CFG_ADV_BD_ADDRESS=0x7257acd87a6c
STM32_WPAN.CFG_DEBUGGER_SUPPORTED=1
-STM32_WPAN.CFG_DEBUG_APP_TRACE=0
-STM32_WPAN.CFG_DEBUG_BLE_TRACE=0
+STM32_WPAN.CFG_DEBUG_APP_TRACE=1
+STM32_WPAN.CFG_DEBUG_BLE_TRACE=1
+STM32_WPAN.CFG_DEBUG_TRACE_LIGHT=1
+STM32_WPAN.CFG_DEBUG_TRACE_UART=hw_uart1
STM32_WPAN.CFG_FAST_CONN_ADV_INTERVAL_MAX=100
STM32_WPAN.CFG_FAST_CONN_ADV_INTERVAL_MAX_HEXA=0xa0
STM32_WPAN.CFG_FAST_CONN_ADV_INTERVAL_MIN=80
@@ -272,7 +279,7 @@ STM32_WPAN.CFG_RTCCLK_DIVIDER_CONF=0
STM32_WPAN.CUSTOM_P2P_SERVER=Disabled
STM32_WPAN.CUSTOM_TEMPLATE=Disabled
STM32_WPAN.DBG_TRACE_UART_CFG=hw_uart1
-STM32_WPAN.IPParameters=CFG_FAST_CONN_ADV_INTERVAL_MAX_HEXA,CFG_LP_CONN_ADV_INTERVAL_MAX_HEXA,LOCAL_NAME_FORMATTED,CFG_HW_LPUART1_ENABLED,CFG_DEBUG_BLE_TRACE,CFG_DEBUG_APP_TRACE,DBG_TRACE_UART_CFG,CFG_ADV_BD_ADDRESS,CFG_LP_CONN_ADV_INTERVAL_MAX,CFG_LP_CONN_ADV_INTERVAL_MIN,CFG_HW_LPUART1_DMA_TX_SUPPORTED,LOCAL_NAME,CFG_HW_USART1_ENABLED,CFG_LPM_SUPPORTED,CUSTOM_P2P_SERVER,BLE_DBG_SVCCTL_EN,BT_SIG_HEALTH_THERMOMETER_SENSOR,BLE_CFG_DIS_MODEL_NUMBER_STRING,BLE_CFG_DIS_SYSTEM_ID,BLE_CFG_HTS_MEASUREMENT_INTERVAL,BLE_CFG_HTS_TEMPERATURE_INTERVAL_MAX_VALUE,BT_SIG_BEACON,BLE_APPLICATION_TYPE,BT_SIG_BLOOD_PRESSURE_SENSOR,BT_SIG_HEART_RATE_SENSOR,CUSTOM_TEMPLATE,CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO,CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION,CFG_HW_RESET_BY_FW,CFG_DEBUGGER_SUPPORTED,CFG_FAST_CONN_ADV_INTERVAL_MIN,CFG_FAST_CONN_ADV_INTERVAL_MAX,CFG_IO_CAPABILITY,CFG_MITM_PROTECTION,CFG_RTCCLK_DIVIDER_CONF
+STM32_WPAN.IPParameters=CFG_FAST_CONN_ADV_INTERVAL_MAX_HEXA,CFG_LP_CONN_ADV_INTERVAL_MAX_HEXA,LOCAL_NAME_FORMATTED,CFG_HW_LPUART1_ENABLED,CFG_DEBUG_BLE_TRACE,CFG_DEBUG_APP_TRACE,DBG_TRACE_UART_CFG,CFG_ADV_BD_ADDRESS,CFG_LP_CONN_ADV_INTERVAL_MAX,CFG_LP_CONN_ADV_INTERVAL_MIN,CFG_HW_LPUART1_DMA_TX_SUPPORTED,LOCAL_NAME,CFG_HW_USART1_ENABLED,CFG_LPM_SUPPORTED,CUSTOM_P2P_SERVER,BLE_DBG_SVCCTL_EN,BT_SIG_HEALTH_THERMOMETER_SENSOR,BLE_CFG_DIS_MODEL_NUMBER_STRING,BLE_CFG_DIS_SYSTEM_ID,BLE_CFG_HTS_MEASUREMENT_INTERVAL,BLE_CFG_HTS_TEMPERATURE_INTERVAL_MAX_VALUE,BT_SIG_BEACON,BLE_APPLICATION_TYPE,BT_SIG_BLOOD_PRESSURE_SENSOR,BT_SIG_HEART_RATE_SENSOR,CUSTOM_TEMPLATE,CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO,CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION,CFG_HW_RESET_BY_FW,CFG_DEBUGGER_SUPPORTED,CFG_FAST_CONN_ADV_INTERVAL_MIN,CFG_FAST_CONN_ADV_INTERVAL_MAX,CFG_IO_CAPABILITY,CFG_MITM_PROTECTION,CFG_RTCCLK_DIVIDER_CONF,CFG_DEBUG_TRACE_UART,CFG_DEBUG_TRACE_LIGHT
STM32_WPAN.IPParametersWithoutCheck=CFG_LP_CONN_ADV_INTERVAL_MAX,CFG_LP_CONN_ADV_INTERVAL_MIN,BLE_CFG_HTS_TEMPERATURE_INTERVAL_MAX_VALUE
STM32_WPAN.LOCAL_NAME=HTSTM
STM32_WPAN.LOCAL_NAME_FORMATTED=,'H','T','S','T','M'
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Inc/app_common.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Inc/app_common.h
index 2a1d61089..4defc5d7a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Inc/app_common.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Inc/app_common.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : app_common.h
- * Description : App Common application configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : App Common application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Inc/app_conf.h
index da4d0502c..975378333 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Inc/app_conf.h
@@ -1,8 +1,9 @@
/**
******************************************************************************
* File Name : app_conf.h
- * Description : Application configuration file for BLE middleWare.
- ******************************************************************************
+ * Description : Application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
@@ -17,17 +18,18 @@
*/
/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef APP_CONFIG_H
-#define APP_CONFIG_H
+#ifndef APP_CONF_H
+#define APP_CONF_H
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Application Config
******************************************************************************/
-/**< generic parameters ********************************************************/
+/**< generic parameters ******************************************************/
/**
* Define Tx Power
@@ -81,11 +83,17 @@
*/
#define CFG_BLE_ERK {0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21,0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21}
+/* USER CODE BEGIN Generic_Parameters */
+/**
+ * SMPS supply
+ * SMPS not used when Set to 0
+ * SMPS used when Set to 1
+ */
+#define CFG_USE_SMPS 1
+/* USER CODE END Generic_Parameters */
+
/**< specific parameters */
/*****************************************************/
-#define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI4_IRQHandler
-#define PUSH_BUTTON_SW2_EXTI_IRQHandler EXTI0_IRQHandler
-#define PUSH_BUTTON_SW3_EXTI_IRQHandler EXTI1_IRQHandler
/**
* Beacon selection
* Beacons are all exclusive
@@ -180,7 +188,7 @@
* 1 : internal RO
* 0 : external crystal ( no calibration )
*/
-#define CFG_BLE_LSE_SOURCE 1
+#define CFG_BLE_LSE_SOURCE 0
/**
* Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
@@ -386,12 +394,6 @@ typedef enum
#define CFG_LPM_SUPPORTED 0
#define CFG_DEBUGGER_SUPPORTED 1
#endif
-
-/* USER CODE BEGIN Defines */
-#define CFG_LED_SUPPORTED 1
-#define CFG_BUTTON_SUPPORTED 1
-/* USER CODE END Defines */
-
/**
* When CFG_DEBUG_TRACE_FULL is set to 1, the trace are output with the API name, the file name and the line number
* When CFG_DEBUG_TRACE_LIGHT is set to 1, only the debug message is output
@@ -428,6 +430,15 @@ typedef enum
#define DBG_TRACE_MSG_QUEUE_SIZE 4096
#define MAX_DBG_TRACE_MSG_SIZE 1024
+/* USER CODE BEGIN Defines */
+#define CFG_LED_SUPPORTED 1
+#define CFG_BUTTON_SUPPORTED 1
+
+#define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI4_IRQHandler
+#define PUSH_BUTTON_SW2_EXTI_IRQHandler EXTI0_IRQHandler
+#define PUSH_BUTTON_SW3_EXTI_IRQHandler EXTI1_IRQHandler
+/* USER CODE END Defines */
+
/******************************************************************************
* Scheduler
******************************************************************************/
@@ -491,7 +502,10 @@ typedef enum
typedef enum
{
CFG_LPM_APP,
- CFG_LPM_APP_BLE
+ CFG_LPM_APP_BLE,
+ /* USER CODE BEGIN CFG_LPM_Id_t */
+
+ /* USER CODE END CFG_LPM_Id_t */
} CFG_LPM_Id_t;
/******************************************************************************
@@ -501,6 +515,6 @@ typedef enum
#define CFG_OTP_END_ADRESS OTP_AREA_END_ADDR
-#endif /*APP_CONFIG_H */
+#endif /*APP_CONF_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Inc/stm32_lpm_if.h
index 38e326512..d8e67947f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Inc/stm32_lpm_if.h
@@ -1,46 +1,22 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file stm32_lpm_if.h
-* @brief Header for stm32_lpm_f.c module (device specific LP management)
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
******************************************************************************
* @attention
*
-* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics International N.V.
+* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted, provided that the following conditions are met:
-*
-* 1. Redistribution of source code must retain the above copyright notice,
-* this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following disclaimer in the documentation
-* and/or other materials provided with the distribution.
-* 3. Neither the name of STMicroelectronics nor the names of other
-* contributors to this software may be used to endorse or promote products
-* derived from this software without specific written permission.
-* 4. This software, including modifications and/or derivative works of this
-* software, must execute solely and exclusively on microcontroller or
-* microprocessor devices manufactured by or for STMicroelectronics.
-* 5. Redistribution and use of this software other than as permitted under
-* this license is void and will automatically terminate your rights under
-* this license.
-*
-* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
-* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
-* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+* This software component is licensed by ST under BSD 3-Clause license,
+* the "License"; You may not use this file except in compliance with the
+* License. You may obtain a copy of the License at:
+* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32_LPM_IF_H
@@ -89,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Inc/stm32wbxx_hal_conf.h
index 5c703f75d..31d63e37a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Inc/stm32wbxx_hal_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Inc/stm32wbxx_hal_conf.h
@@ -58,6 +58,7 @@
#define HAL_UART_MODULE_ENABLED
/*#define HAL_USART_MODULE_ENABLED */
/*#define HAL_WWDG_MODULE_ENABLED */
+#define HAL_EXTI_MODULE_ENABLED
#define HAL_CORTEX_MODULE_ENABLED
#define HAL_DMA_MODULE_ENABLED
#define HAL_FLASH_MODULE_ENABLED
@@ -221,6 +222,10 @@
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32wbxx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32wbxx_hal_flash.h"
@@ -333,9 +338,9 @@
* If expr is true, it returns no value.
* @retval None
*/
-#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
+ #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
/* Exported functions ------------------------------------------------------- */
-void assert_failed(uint8_t* file, uint32_t line);
+ void assert_failed(uint8_t* file, uint32_t line);
#else
#define assert_param(expr) ((void)0U)
#endif /* USE_FULL_ASSERT */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Inc/utilities_conf.h
index c98d97ba1..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Inc/utilities_conf.h
@@ -1,3 +1,4 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* File Name : utilities_conf.h
@@ -9,13 +10,14 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef UTILITIES_CONF_H
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/app_entry.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/app_entry.c
index 0db2ae413..97a6a8b82 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/app_entry.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/app_entry.c
@@ -69,8 +69,8 @@ static void SystemPower_Config( void );
static void Init_Debug( void );
static void appe_Tl_Init( void );
static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status );
-
static void APPE_SysUserEvtRx( void * pPayload );
+
#if (CFG_HW_LPUART1_ENABLED == 1)
extern void MX_LPUART1_UART_Init(void);
#endif
@@ -107,7 +107,7 @@ void APPE_Init( void )
/**
* From now, the application is waiting for the ready event ( VS_HCI_C2_Ready )
- * received on the system channel before starting the BLE Stack
+ * received on the system channel before starting the Stack
* This system event is received with APPE_SysUserEvtRx()
*/
/* USER CODE BEGIN APPE_Init_2 */
@@ -132,7 +132,6 @@ static void Init_Debug( void )
*/
HAL_DBGMCU_EnableDBGSleepMode();
-
/***************** ENABLE DEBUGGER *************************************/
LL_EXTI_EnableIT_32_63(LL_EXTI_LINE_48);
LL_C2_EXTI_EnableIT_32_63(LL_EXTI_LINE_48);
@@ -221,8 +220,6 @@ static void appe_Tl_Init( void )
return;
}
-
-
static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status )
{
UNUSED(status);
@@ -236,7 +233,7 @@ static void APPE_SysUserEvtRx( void * pPayload )
TL_TRACES_Init( );
APP_BLE_Init( );
- UTIL_LPM_SetOffMode(1 << CFG_LPM_APP, UTIL_LPM_ENABLE);
+ UTIL_LPM_SetOffMode(1U << CFG_LPM_APP, UTIL_LPM_ENABLE);
return;
}
@@ -286,7 +283,6 @@ void UTIL_SEQ_Idle( void )
return;
}
-
/**
* @brief This function is called by the scheduler each time an event
* is pending.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/hw_timerserver.c
index 52a1bfa0d..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/hw_timerserver.c
@@ -1,22 +1,21 @@
/**
******************************************************************************
- * File Name : hw_timerserver.c
- * Description : Hardware timerserver source file for BLE
- * middleWare.
+ * File Name : hw_timerserver.c
+ * Description : Hardware timerserver source file for STM32WPAN Middleware.
+ *
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/hw_uart.c
index f76b11d2a..9a553610d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/hw_uart.c
@@ -1,7 +1,7 @@
/**
******************************************************************************
* File Name : Src/hw_uart.c
- * Description : HW UART source file for BLE middleWare.
+ * Description : HW UART source file for STM32WPAN Middleware.
*
******************************************************************************
* @attention
@@ -48,7 +48,7 @@ extern UART_HandleTypeDef huart1;
hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
} while(0)
- /* Variables ------------------------------------------------------------------*/
+/* Variables -----------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
@@ -58,7 +58,6 @@ extern UART_HandleTypeDef huart1;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
-
#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_hlpuart1_tx ={0};
#endif
@@ -66,73 +65,73 @@ extern UART_HandleTypeDef huart1;
void (*HW_hlpuart1TxCb)(void);
#endif
- void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_RX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_RX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_RX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_RX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ return;
+}
+
+void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
{
- HAL_StatusTypeDef hal_status = HAL_OK;
- hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
+ default:
+ break;
}
switch (hal_status)
@@ -162,8 +161,8 @@ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t
hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
{
-HAL_StatusTypeDef hal_status = HAL_OK;
-hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
@@ -251,33 +250,33 @@ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
switch ((uint32_t)huart->Instance)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1RxCb)
- {
- HW_huart1RxCb();
- }
- break;
+ if(HW_huart1RxCb)
+ {
+ HW_huart1RxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1RxCb)
- {
- HW_hlpuart1RxCb();
- }
- break;
+ if(HW_hlpuart1RxCb)
+ {
+ HW_hlpuart1RxCb();
+ }
+ break;
#endif
default:
@@ -293,20 +292,20 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1TxCb)
- {
- HW_huart1TxCb();
- }
- break;
+ if(HW_huart1TxCb)
+ {
+ HW_huart1TxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1TxCb)
- {
- HW_hlpuart1TxCb();
- }
- break;
+ if(HW_hlpuart1TxCb)
+ {
+ HW_hlpuart1TxCb();
+ }
+ break;
#endif
default:
@@ -316,4 +315,4 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
return;
}
- /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/main.c
index 3e30e0b1e..4741fe7f1 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/main.c
@@ -41,10 +41,10 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "app_entry.h"
+#include "app_common.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
-#include "app_common.h"
#include "stm32_lpm.h"
#include "stm32_seq.h"
#include "dbg_trace.h"
@@ -110,6 +110,7 @@ int main(void)
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
+
/* MCU Configuration--------------------------------------------------------*/
@@ -137,6 +138,8 @@ int main(void)
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
+
+ /* Init code for STM32_WPAN */
APPE_Init();
/* Infinite loop */
@@ -161,17 +164,20 @@ void SystemClock_Config(void)
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
+ /** Configure LSE Drive Capability
+ */
+ __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
/** Configure the main internal regulator output voltage
*/
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
/** Initializes the CPU, AHB and APB busses clocks
*/
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSI1
- |RCC_OSCILLATORTYPE_HSE;
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE
+ |RCC_OSCILLATORTYPE_LSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ RCC_OscInitStruct.LSEState = RCC_LSE_ON;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
- RCC_OscInitStruct.LSIState = RCC_LSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
@@ -200,8 +206,8 @@ void SystemClock_Config(void)
|RCC_PERIPHCLK_LPUART1;
PeriphClkInitStruct.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2;
PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1;
- PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI;
- PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSI;
+ PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
+ PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSE;
PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSE;
PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE0;
@@ -357,7 +363,13 @@ static void MX_RTC_Init(void)
Error_Handler();
}
/* USER CODE BEGIN RTC_Init 2 */
- MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* Disable RTC registers write protection */
+ LL_RTC_DisableWriteProtection(RTC);
+
+ LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER);
+
+ /* Enable RTC registers write protection */
+ LL_RTC_EnableWriteProtection(RTC);
/* USER CODE END RTC_Init 2 */
}
@@ -367,6 +379,7 @@ static void MX_RTC_Init(void)
*/
static void MX_DMA_Init(void)
{
+
/* DMA controller clock enable */
__HAL_RCC_DMAMUX1_CLK_ENABLE();
__HAL_RCC_DMA1_CLK_ENABLE();
@@ -404,7 +417,13 @@ void PeriphClock_Config(void)
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
- LL_RCC_HSI48_Enable();
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
+ LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -437,30 +456,6 @@ void PeriphClock_Config(void)
HAL_RCCEx_CRSConfig(&RCC_CRSInitStruct);
#endif
- /**
- * Select LSE clock
- */
- LL_RCC_LSE_Enable();
- while(!LL_RCC_LSE_IsReady());
-
- /**
- * Select wakeup source of BLE RF
- */
- LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
-
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
/*************************************************************
@@ -567,21 +562,33 @@ static void Init_Exti( void )
* WRAP FUNCTIONS
*
*************************************************************/
-
-/**
- * This function is empty to avoid starting the SysTick Timer
- */
-HAL_StatusTypeDef HAL_InitTick( uint32_t TickPriority )
+void HAL_Delay(uint32_t Delay)
{
- return (HAL_OK);
-}
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
-/**
- * This function is empty as the SysTick Timer is not used
- */
-void HAL_Delay(__IO uint32_t Delay)
-{
- return;
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
}
/* USER CODE END 4 */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/stm32wbxx_hal_msp.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/stm32wbxx_hal_msp.c
index c6a106fa7..87614ca60 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/stm32wbxx_hal_msp.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/stm32wbxx_hal_msp.c
@@ -5,45 +5,15 @@
* Description : This file provides code for the MSP Initialization
* and de-Initialization codes.
******************************************************************************
- * This notice applies to any and all portions of this file
- * that are not between comment pairs USER CODE BEGIN and
- * USER CODE END. Other portions of this file, whether
- * inserted by the user or by software development tools
- * are owned by their respective copyright owners.
+ * @attention
*
- * Copyright (c) 2019 STMicroelectronics International N.V.
- * All rights reserved.
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted, provided that the following conditions are met:
- *
- * 1. Redistribution of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of other
- * contributors to this software may be used to endorse or promote products
- * derived from this software without specific written permission.
- * 4. This software, including modifications and/or derivative works of this
- * software, must execute solely and exclusively on microcontroller or
- * microprocessor devices manufactured by or for STMicroelectronics.
- * 5. Redistribution and use of this software other than as permitted under
- * this license is void and will automatically terminate your rights under
- * this license.
- *
- * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
- * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
- * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
*
******************************************************************************
*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/stm32wbxx_it.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/stm32wbxx_it.c
index e80b2598c..a13bff23c 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/stm32wbxx_it.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/Core/Src/stm32wbxx_it.c
@@ -60,21 +60,10 @@
/* USER CODE END 0 */
/* External variables --------------------------------------------------------*/
-
-
-
extern DMA_HandleTypeDef hdma_lpuart1_tx;
-
-
extern DMA_HandleTypeDef hdma_usart1_tx;
-
-
extern UART_HandleTypeDef hlpuart1;
-
-
extern UART_HandleTypeDef huart1;
-
-
/* USER CODE BEGIN EV */
/* USER CODE END EV */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/app_ble.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/app_ble.c
index a85cf02ab..23a71638e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/app_ble.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/app_ble.c
@@ -192,30 +192,22 @@ void APP_BLE_Init( void )
*/
if (CFG_BEACON_TYPE & CFG_EDDYSTONE_UID_BEACON_TYPE)
{
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("Eddystone UID beacon advertize\n");
-#endif
EddystoneUID_Process();
}
else if (CFG_BEACON_TYPE & CFG_EDDYSTONE_URL_BEACON_TYPE)
{
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("Eddystone URL beacon advertize\n");
-#endif
EddystoneURL_Process();
}
else if (CFG_BEACON_TYPE & CFG_EDDYSTONE_TLM_BEACON_TYPE)
{
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("Eddystone TLM beacon advertize\n");
-#endif
EddystoneTLM_Process();
}
else if (CFG_BEACON_TYPE & CFG_IBEACON)
{
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("Ibeacon advertize\n");
-#endif
IBeacon_Process();
}
/* USER CODE BEGIN APP_BLE_Init_2 */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/ble_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/ble_conf.h
index fc9c10d82..f93ff7755 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/ble_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/ble_conf.h
@@ -1,9 +1,9 @@
/**
- ******************************************************************************
+ ******************************************************************************
* File Name : App/ble_conf.h
- * Description : Configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : Configuration file for BLE Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
@@ -49,7 +49,7 @@
* This shall take into account all registered handlers
* (from either the provided services or the custom services)
*/
-#define BLE_CFG_SVC_MAX_NBR_CB 5
+#define BLE_CFG_SVC_MAX_NBR_CB 7
#define BLE_CFG_CLT_MAX_NBR_CB 0
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/ble_dbg_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/ble_dbg_conf.h
index ceef47f82..960afbb00 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/ble_dbg_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/ble_dbg_conf.h
@@ -1,9 +1,9 @@
/**
- ******************************************************************************
+ ******************************************************************************
* File Name : App/ble_dbg_conf.h
- * Description : Debug configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : Debug configuration file for BLE Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/eddystone_tlm_service.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/eddystone_tlm_service.c
index 0fc595725..7b9a5ccee 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/eddystone_tlm_service.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/eddystone_tlm_service.c
@@ -1,8 +1,8 @@
/**
- ******************************************************************************
- * File Name : App/eddystone_tlm_service.c
- * Description :
- ******************************************************************************
+ ******************************************************************************
+ * File Name : App/eddystone_tlm_service.c
+ * Description :
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
@@ -13,8 +13,8 @@
* the License. You may obtain a copy of the License at:
* www.st.com/SLA0044
*
- ******************************************************************************
- */
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/eddystone_tlm_service.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/eddystone_tlm_service.h
index eea5013d5..a4edb5986 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/eddystone_tlm_service.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/eddystone_tlm_service.h
@@ -1,8 +1,8 @@
/**
- ******************************************************************************
+ ******************************************************************************
* File Name : App/eddystone_tlm_service.h
* Description :
- ******************************************************************************
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
@@ -13,8 +13,8 @@
* the License. You may obtain a copy of the License at:
* www.st.com/SLA0044
*
- ******************************************************************************
- */
+ ******************************************************************************
+ */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef EDDYSTONE_TLM_SERVICE_H
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/eddystone_uid_service.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/eddystone_uid_service.c
index b06c857fb..41a385513 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/eddystone_uid_service.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/eddystone_uid_service.c
@@ -1,8 +1,8 @@
/**
- ******************************************************************************
- * File Name : App/eddystone_uid_service.c
- * Description :
- ******************************************************************************
+ ******************************************************************************
+ * File Name : App/eddystone_uid_service.c
+ * Description :
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
@@ -13,8 +13,8 @@
* the License. You may obtain a copy of the License at:
* www.st.com/SLA0044
*
- ******************************************************************************
- */
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/eddystone_uid_service.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/eddystone_uid_service.h
index 4c12482d9..e799cfd0d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/eddystone_uid_service.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/eddystone_uid_service.h
@@ -1,8 +1,8 @@
/**
- ******************************************************************************
- * File Name : App/eddystone_uid_service.h
- * Description :
- ******************************************************************************
+ ******************************************************************************
+ * File Name : App/eddystone_uid_service.h
+ * Description :
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
@@ -13,8 +13,8 @@
* the License. You may obtain a copy of the License at:
* www.st.com/SLA0044
*
- ******************************************************************************
- */
+ ******************************************************************************
+ */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef EDDYSTONE_UID_SERVICE_H
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/eddystone_url_service.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/eddystone_url_service.c
index e3079454b..d4116ff93 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/eddystone_url_service.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/eddystone_url_service.c
@@ -1,8 +1,8 @@
/**
- ******************************************************************************
- * File Name : App/eddystone_url_service.c
- * Description :
- ******************************************************************************
+ ******************************************************************************
+ * File Name : App/eddystone_url_service.c
+ * Description :
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
@@ -13,8 +13,8 @@
* the License. You may obtain a copy of the License at:
* www.st.com/SLA0044
*
- ******************************************************************************
- */
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/eddystone_url_service.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/eddystone_url_service.h
index fdddb30a8..626a08be3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/eddystone_url_service.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/eddystone_url_service.h
@@ -1,8 +1,8 @@
/**
- ******************************************************************************
+ ******************************************************************************
* File Name : App/eddystone_url_service.h
* Description :
- ******************************************************************************
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
@@ -13,8 +13,8 @@
* the License. You may obtain a copy of the License at:
* www.st.com/SLA0044
*
- ******************************************************************************
- */
+ ******************************************************************************
+ */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef EDDYSTONE_URL_SERVICE_H
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/ibeacon.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/ibeacon.h
index 8dbd285a1..c92366471 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/ibeacon.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Beacon/STM32_WPAN/App/ibeacon.h
@@ -1,8 +1,8 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
- * @file ibeacon.h
- * @author MCD Application Team
- * @brief
+ * File Name : App/ibeacon.h
+ * Description : Header for ibeacon_application.c module
******************************************************************************
* @attention
*
@@ -16,6 +16,7 @@
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef IBEACON_H
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/BLE_BloodPressure.ioc b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/BLE_BloodPressure.ioc
index 195401d32..ab030ad3f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/BLE_BloodPressure.ioc
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/BLE_BloodPressure.ioc
@@ -73,27 +73,29 @@ Mcu.IP9=SYS
Mcu.IPNb=12
Mcu.Name=STM32WB55RGVx
Mcu.Package=VFQFPN68
-Mcu.Pin0=PA2
-Mcu.Pin1=PA3
-Mcu.Pin10=VP_RTC_VS_RTC_Activate
-Mcu.Pin11=VP_SEQUENCER_VS_SEQUENCER
-Mcu.Pin12=VP_STM32_WPAN_VS_BLE_HOST
-Mcu.Pin13=VP_SYS_VS_Systick
-Mcu.Pin14=VP_TINY_LPM_VS_TINY_LPM
-Mcu.Pin2=PA6
-Mcu.Pin3=RF1
-Mcu.Pin4=OSC_OUT
-Mcu.Pin5=OSC_IN
-Mcu.Pin6=PA11
-Mcu.Pin7=PB6
-Mcu.Pin8=PB7
-Mcu.Pin9=VP_HSEM_VS_HSEM
-Mcu.PinsNb=15
+Mcu.Pin0=PC14-OSC32_IN
+Mcu.Pin1=PC15-OSC32_OUT
+Mcu.Pin10=PB7
+Mcu.Pin11=VP_HSEM_VS_HSEM
+Mcu.Pin12=VP_RTC_VS_RTC_Activate
+Mcu.Pin13=VP_SEQUENCER_VS_SEQUENCER
+Mcu.Pin14=VP_STM32_WPAN_VS_BLE_HOST
+Mcu.Pin15=VP_SYS_VS_Systick
+Mcu.Pin16=VP_TINY_LPM_VS_TINY_LPM
+Mcu.Pin2=PA2
+Mcu.Pin3=PA3
+Mcu.Pin4=PA6
+Mcu.Pin5=RF1
+Mcu.Pin6=OSC_OUT
+Mcu.Pin7=OSC_IN
+Mcu.Pin8=PA11
+Mcu.Pin9=PB6
+Mcu.PinsNb=17
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32WB55RGVx
-MxCube.Version=5.3.0
-MxDb.Version=DB.5.0.30
+MxCube.Version=5.4.0
+MxDb.Version=DB.5.0.40
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false
NVIC.DMA1_Channel4_IRQn=true\:15\:0\:true\:false\:true\:false\:true
NVIC.DMA2_Channel4_IRQn=true\:15\:0\:true\:false\:true\:false\:true
@@ -146,6 +148,10 @@ PB7.GPIO_Speed=GPIO_SPEED_FREQ_VERY_HIGH
PB7.Locked=true
PB7.Mode=Asynchronous
PB7.Signal=USART1_RX
+PC14-OSC32_IN.Mode=LSE-External-Oscillator
+PC14-OSC32_IN.Signal=RCC_OSC32_IN
+PC15-OSC32_OUT.Mode=LSE-External-Oscillator
+PC15-OSC32_OUT.Signal=RCC_OSC32_OUT
PCC.Ble.ConnectionInterval=1000.0
PCC.Ble.DataLength=6
PCC.Ble.Mode=Advertising
@@ -168,7 +174,7 @@ ProjectManager.DeletePrevious=true
ProjectManager.DeviceId=STM32WB55RGVx
ProjectManager.FreePins=false
ProjectManager.HalAssertFull=false
-ProjectManager.HeapSize=0x200
+ProjectManager.HeapSize=0x400
ProjectManager.KeepUserCode=true
ProjectManager.LastFirmware=true
ProjectManager.LibraryCopy=2
@@ -178,11 +184,11 @@ ProjectManager.PreviousToolchain=
ProjectManager.ProjectBuild=false
ProjectManager.ProjectFileName=BLE_BloodPressure.ioc
ProjectManager.ProjectName=BLE_BloodPressure
-ProjectManager.StackSize=0x400
+ProjectManager.StackSize=0x1000
ProjectManager.TargetToolchain=EWARM V8
ProjectManager.ToolChainLocation=
ProjectManager.UnderRoot=false
-ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-SystemClock_Config-RCC-false-HAL-false,4-MX_LPUART1_UART_Init-LPUART1-true-HAL-false,5-MX_USART1_UART_Init-USART1-true-HAL-false,6-MX_RF_Init-RF-false-HAL-true,7-MX_RTC_Init-RTC-false-HAL-true,8-MX_STM32_WPAN_Init-STM32_WPAN-false-HAL-true
+ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-SystemClock_Config-RCC-false-HAL-false,4-MX_LPUART1_UART_Init-LPUART1-true-HAL-false,5-MX_USART1_UART_Init-USART1-true-HAL-false,6-MX_RF_Init-RF-false-HAL-true,7-MX_RTC_Init-RTC-false-HAL-true,8-APPE_Init-STM32_WPAN-false-HAL-false
RCC.ADCFreq_Value=64000000
RCC.AHBFreq_Value=32000000
RCC.APB1Freq_Value=32000000
@@ -204,12 +210,12 @@ RCC.HSI48_VALUE=48000000
RCC.HSI_VALUE=16000000
RCC.I2C1Freq_Value=32000000
RCC.I2C3Freq_Value=32000000
-RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSE_VALUE,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PLLSourceVirtual,PWRFreq_Value,RNGFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LCDFreq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PLLSourceVirtual,PWRFreq_Value,RFWKPClockSelection,RFWKPFreq_Value,RNGFreq_Value,RTCClockSelection,RTCFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.LCDFreq_Value=32768
RCC.LPTIM1Freq_Value=32000000
RCC.LPTIM2Freq_Value=32000000
RCC.LPUART1Freq_Value=32000000
RCC.LSCOPinFreq_Value=32000
-RCC.LSE_VALUE=32768
RCC.LSI_VALUE=32000
RCC.MCO1PinFreq_Value=32000000
RCC.PLLPoutputFreq_Value=64000000
@@ -220,7 +226,11 @@ RCC.PLLSAI1QoutputFreq_Value=64000000
RCC.PLLSAI1RoutputFreq_Value=64000000
RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSI
RCC.PWRFreq_Value=32000000
+RCC.RFWKPClockSelection=RCC_RFWKPCLKSOURCE_LSE
+RCC.RFWKPFreq_Value=32768
RCC.RNGFreq_Value=32000
+RCC.RTCClockSelection=RCC_RTCCLKSOURCE_LSE
+RCC.RTCFreq_Value=32768
RCC.SAI1Freq_Value=64000000
RCC.SMPS1Freq_Value=16000000
RCC.SYSCLKFreq_VALUE=32000000
@@ -232,11 +242,6 @@ RCC.VCOOutputFreq_Value=128000000
RCC.VCOSAI1OutputFreq_Value=128000000
RF1.Mode=RF1_Activate
RF1.Signal=RF_RF1
-RTC.AsynchPrediv=CFG_RTC_ASYNCH_PRESCALER
-RTC.HourFormat=RTC_HOURFORMAT_24
-RTC.IPParameters=HourFormat,AsynchPrediv,SynchPrediv
-RTC.IPParametersWithoutCheck=AsynchPrediv,SynchPrediv
-RTC.SynchPrediv=CFG_RTC_SYNCH_PRESCALER
STM32_WPAN.BLE_APPLICATION_TYPE=BLE_SERVER_PROFILE
STM32_WPAN.BLE_CFG_BLS_INTERMEDIATE_CUFF_PRESSURE=1
STM32_WPAN.BLE_CFG_BLS_MEASUREMENT_STATUS_FLAG=1
@@ -255,8 +260,10 @@ STM32_WPAN.BT_SIG_HEART_RATE_SENSOR=Disabled
STM32_WPAN.CFG_ADV_BD_ADDRESS=0x7257acd87a6c
STM32_WPAN.CFG_CONSOLE_MENU=hw_lpuart1
STM32_WPAN.CFG_DEBUGGER_SUPPORTED=1
-STM32_WPAN.CFG_DEBUG_APP_TRACE=0
-STM32_WPAN.CFG_DEBUG_BLE_TRACE=0
+STM32_WPAN.CFG_DEBUG_APP_TRACE=1
+STM32_WPAN.CFG_DEBUG_BLE_TRACE=1
+STM32_WPAN.CFG_DEBUG_TRACE_LIGHT=1
+STM32_WPAN.CFG_DEBUG_TRACE_UART=hw_uart1
STM32_WPAN.CFG_FAST_CONN_ADV_INTERVAL_MAX=100
STM32_WPAN.CFG_FAST_CONN_ADV_INTERVAL_MAX_HEXA=0xa0
STM32_WPAN.CFG_FAST_CONN_ADV_INTERVAL_MIN=80
@@ -278,7 +285,7 @@ STM32_WPAN.CFG_RTCCLK_DIVIDER_CONF=0
STM32_WPAN.CUSTOM_P2P_SERVER=Disabled
STM32_WPAN.CUSTOM_TEMPLATE=Disabled
STM32_WPAN.DBG_TRACE_UART_CFG=hw_uart1
-STM32_WPAN.IPParameters=P2P_SERVER_NUMBER,CFG_FAST_CONN_ADV_INTERVAL_MAX_HEXA,CFG_LP_CONN_ADV_INTERVAL_MAX_HEXA,LOCAL_NAME_FORMATTED,CFG_HW_LPUART1_ENABLED,CFG_DEBUG_BLE_TRACE,CFG_DEBUG_APP_TRACE,DBG_TRACE_UART_CFG,CFG_CONSOLE_MENU,CFG_ADV_BD_ADDRESS,CFG_LP_CONN_ADV_INTERVAL_MAX,CFG_LP_CONN_ADV_INTERVAL_MIN,CFG_HW_USART1_DMA_TX_SUPPORTED,LOCAL_NAME,CFG_HW_USART1_ENABLED,CFG_LPM_SUPPORTED,L2CAP_REQUEST_NEW_CONN_PARAM,CUSTOM_P2P_SERVER,BT_SIG_HEART_RATE_SENSOR,CFG_DEBUGGER_SUPPORTED,BLE_DBG_DIS_EN,BLE_DBG_SVCCTL_EN,BT_SIG_BLOOD_PRESSURE_SENSOR,BLE_DBG_APP_EN,BLE_DBG_BLS_EN,BLE_APPLICATION_TYPE,BT_SIG_BEACON,BT_SIG_HEALTH_THERMOMETER_SENSOR,CUSTOM_TEMPLATE,BLE_CFG_BLS_MEASUREMENT_STATUS_FLAG,BLE_CFG_BLS_PULSE_RATE_FLAG,BLE_CFG_BLS_USER_ID_FLAG,BLE_CFG_BLS_TIME_STAMP_FLAG,BLE_CFG_BLS_INTERMEDIATE_CUFF_PRESSURE,BLE_CFG_BLS_SUPPORTED_FEATURES,CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO,CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION,CFG_HW_RESET_BY_FW,CFG_FAST_CONN_ADV_INTERVAL_MIN,CFG_FAST_CONN_ADV_INTERVAL_MAX,CFG_IO_CAPABILITY,CFG_MITM_PROTECTION,CFG_RTCCLK_DIVIDER_CONF
+STM32_WPAN.IPParameters=P2P_SERVER_NUMBER,CFG_FAST_CONN_ADV_INTERVAL_MAX_HEXA,CFG_LP_CONN_ADV_INTERVAL_MAX_HEXA,LOCAL_NAME_FORMATTED,CFG_HW_LPUART1_ENABLED,CFG_DEBUG_BLE_TRACE,CFG_DEBUG_APP_TRACE,DBG_TRACE_UART_CFG,CFG_CONSOLE_MENU,CFG_ADV_BD_ADDRESS,CFG_LP_CONN_ADV_INTERVAL_MAX,CFG_LP_CONN_ADV_INTERVAL_MIN,CFG_HW_USART1_DMA_TX_SUPPORTED,LOCAL_NAME,CFG_HW_USART1_ENABLED,CFG_LPM_SUPPORTED,L2CAP_REQUEST_NEW_CONN_PARAM,CUSTOM_P2P_SERVER,BT_SIG_HEART_RATE_SENSOR,CFG_DEBUGGER_SUPPORTED,BLE_DBG_DIS_EN,BLE_DBG_SVCCTL_EN,BT_SIG_BLOOD_PRESSURE_SENSOR,BLE_DBG_APP_EN,BLE_DBG_BLS_EN,BLE_APPLICATION_TYPE,BT_SIG_BEACON,BT_SIG_HEALTH_THERMOMETER_SENSOR,CUSTOM_TEMPLATE,BLE_CFG_BLS_MEASUREMENT_STATUS_FLAG,BLE_CFG_BLS_PULSE_RATE_FLAG,BLE_CFG_BLS_USER_ID_FLAG,BLE_CFG_BLS_TIME_STAMP_FLAG,BLE_CFG_BLS_INTERMEDIATE_CUFF_PRESSURE,BLE_CFG_BLS_SUPPORTED_FEATURES,CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO,CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION,CFG_HW_RESET_BY_FW,CFG_FAST_CONN_ADV_INTERVAL_MIN,CFG_FAST_CONN_ADV_INTERVAL_MAX,CFG_IO_CAPABILITY,CFG_MITM_PROTECTION,CFG_RTCCLK_DIVIDER_CONF,CFG_DEBUG_TRACE_UART,CFG_DEBUG_TRACE_LIGHT
STM32_WPAN.IPParametersWithoutCheck=CFG_LP_CONN_ADV_INTERVAL_MAX,CFG_LP_CONN_ADV_INTERVAL_MIN
STM32_WPAN.L2CAP_REQUEST_NEW_CONN_PARAM=1
STM32_WPAN.LOCAL_NAME=BPSTM
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Inc/app_common.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Inc/app_common.h
index 2a1d61089..4defc5d7a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Inc/app_common.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Inc/app_common.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : app_common.h
- * Description : App Common application configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : App Common application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Inc/app_conf.h
index 59a4bec12..96e19ba10 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Inc/app_conf.h
@@ -1,8 +1,9 @@
/**
******************************************************************************
* File Name : app_conf.h
- * Description : Application configuration file for BLE middleWare.
- ******************************************************************************
+ * Description : Application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
@@ -17,17 +18,18 @@
*/
/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef APP_CONFIG_H
-#define APP_CONFIG_H
+#ifndef APP_CONF_H
+#define APP_CONF_H
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Application Config
******************************************************************************/
-/**< generic parameters ********************************************************/
+/**< generic parameters ******************************************************/
/**
* Define Tx Power
@@ -92,10 +94,17 @@
*/
#define CFG_BLE_ERK {0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21,0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21}
+/* USER CODE BEGIN Generic_Parameters */
+/**
+ * SMPS supply
+ * SMPS not used when Set to 0
+ * SMPS used when Set to 1
+ */
+#define CFG_USE_SMPS 1
+/* USER CODE END Generic_Parameters */
+
/**< specific parameters */
/*****************************************************/
-#define PUSH_BUTTON_SW2_EXTI_IRQHandler EXTI0_IRQHandler
-#define PUSH_BUTTON_SW3_EXTI_IRQHandler EXTI1_IRQHandler
/******************************************************************************
* BLE Stack
@@ -176,7 +185,7 @@
* 1 : internal RO
* 0 : external crystal ( no calibration )
*/
-#define CFG_BLE_LSE_SOURCE 1
+#define CFG_BLE_LSE_SOURCE 0
/**
* Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
@@ -383,11 +392,6 @@ typedef enum
#define CFG_DEBUGGER_SUPPORTED 1
#endif
-/* USER CODE BEGIN Defines */
-#define CFG_LED_SUPPORTED 1
-#define CFG_BUTTON_SUPPORTED 1
-/* USER CODE END Defines */
-
/**
* When CFG_DEBUG_TRACE_FULL is set to 1, the trace are output with the API name, the file name and the line number
* When CFG_DEBUG_TRACE_LIGHT is set to 1, only the debug message is output
@@ -424,6 +428,15 @@ typedef enum
#define DBG_TRACE_MSG_QUEUE_SIZE 4096
#define MAX_DBG_TRACE_MSG_SIZE 1024
+/* USER CODE BEGIN Defines */
+#define CFG_LED_SUPPORTED 1
+#define CFG_BUTTON_SUPPORTED 1
+
+#define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI4_IRQHandler
+#define PUSH_BUTTON_SW2_EXTI_IRQHandler EXTI0_IRQHandler
+#define PUSH_BUTTON_SW3_EXTI_IRQHandler EXTI1_IRQHandler
+/* USER CODE END Defines */
+
/******************************************************************************
* Scheduler
******************************************************************************/
@@ -489,7 +502,10 @@ typedef enum
typedef enum
{
CFG_LPM_APP,
- CFG_LPM_APP_BLE
+ CFG_LPM_APP_BLE,
+ /* USER CODE BEGIN CFG_LPM_Id_t */
+
+ /* USER CODE END CFG_LPM_Id_t */
} CFG_LPM_Id_t;
/******************************************************************************
@@ -499,6 +515,6 @@ typedef enum
#define CFG_OTP_END_ADRESS OTP_AREA_END_ADDR
-#endif /*APP_CONFIG_H */
+#endif /*APP_CONF_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Inc/stm32_lpm_if.h
index 38e326512..d8e67947f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Inc/stm32_lpm_if.h
@@ -1,46 +1,22 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file stm32_lpm_if.h
-* @brief Header for stm32_lpm_f.c module (device specific LP management)
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
******************************************************************************
* @attention
*
-* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics International N.V.
+* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted, provided that the following conditions are met:
-*
-* 1. Redistribution of source code must retain the above copyright notice,
-* this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following disclaimer in the documentation
-* and/or other materials provided with the distribution.
-* 3. Neither the name of STMicroelectronics nor the names of other
-* contributors to this software may be used to endorse or promote products
-* derived from this software without specific written permission.
-* 4. This software, including modifications and/or derivative works of this
-* software, must execute solely and exclusively on microcontroller or
-* microprocessor devices manufactured by or for STMicroelectronics.
-* 5. Redistribution and use of this software other than as permitted under
-* this license is void and will automatically terminate your rights under
-* this license.
-*
-* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
-* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
-* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+* This software component is licensed by ST under BSD 3-Clause license,
+* the "License"; You may not use this file except in compliance with the
+* License. You may obtain a copy of the License at:
+* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32_LPM_IF_H
@@ -89,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Inc/stm32wbxx_hal_conf.h
index 5c703f75d..31d63e37a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Inc/stm32wbxx_hal_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Inc/stm32wbxx_hal_conf.h
@@ -58,6 +58,7 @@
#define HAL_UART_MODULE_ENABLED
/*#define HAL_USART_MODULE_ENABLED */
/*#define HAL_WWDG_MODULE_ENABLED */
+#define HAL_EXTI_MODULE_ENABLED
#define HAL_CORTEX_MODULE_ENABLED
#define HAL_DMA_MODULE_ENABLED
#define HAL_FLASH_MODULE_ENABLED
@@ -221,6 +222,10 @@
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32wbxx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32wbxx_hal_flash.h"
@@ -333,9 +338,9 @@
* If expr is true, it returns no value.
* @retval None
*/
-#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
+ #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
/* Exported functions ------------------------------------------------------- */
-void assert_failed(uint8_t* file, uint32_t line);
+ void assert_failed(uint8_t* file, uint32_t line);
#else
#define assert_param(expr) ((void)0U)
#endif /* USE_FULL_ASSERT */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Inc/utilities_conf.h
index c98d97ba1..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Inc/utilities_conf.h
@@ -1,3 +1,4 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* File Name : utilities_conf.h
@@ -9,13 +10,14 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef UTILITIES_CONF_H
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/app_entry.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/app_entry.c
index d1bdfdfbb..97a6a8b82 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/app_entry.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/app_entry.c
@@ -69,8 +69,8 @@ static void SystemPower_Config( void );
static void Init_Debug( void );
static void appe_Tl_Init( void );
static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status );
-
static void APPE_SysUserEvtRx( void * pPayload );
+
#if (CFG_HW_LPUART1_ENABLED == 1)
extern void MX_LPUART1_UART_Init(void);
#endif
@@ -107,7 +107,7 @@ void APPE_Init( void )
/**
* From now, the application is waiting for the ready event ( VS_HCI_C2_Ready )
- * received on the system channel before starting the BLE Stack
+ * received on the system channel before starting the Stack
* This system event is received with APPE_SysUserEvtRx()
*/
/* USER CODE BEGIN APPE_Init_2 */
@@ -220,8 +220,6 @@ static void appe_Tl_Init( void )
return;
}
-
-
static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status )
{
UNUSED(status);
@@ -235,7 +233,7 @@ static void APPE_SysUserEvtRx( void * pPayload )
TL_TRACES_Init( );
APP_BLE_Init( );
- UTIL_LPM_SetOffMode(1 << CFG_LPM_APP, UTIL_LPM_ENABLE);
+ UTIL_LPM_SetOffMode(1U << CFG_LPM_APP, UTIL_LPM_ENABLE);
return;
}
@@ -285,7 +283,6 @@ void UTIL_SEQ_Idle( void )
return;
}
-
/**
* @brief This function is called by the scheduler each time an event
* is pending.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/hw_timerserver.c
index 52a1bfa0d..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/hw_timerserver.c
@@ -1,22 +1,21 @@
/**
******************************************************************************
- * File Name : hw_timerserver.c
- * Description : Hardware timerserver source file for BLE
- * middleWare.
+ * File Name : hw_timerserver.c
+ * Description : Hardware timerserver source file for STM32WPAN Middleware.
+ *
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/hw_uart.c
index 52e9e2b3a..9a553610d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/hw_uart.c
@@ -1,7 +1,7 @@
/**
******************************************************************************
* File Name : Src/hw_uart.c
- * Description : HW UART source file for BLE middleWare.
+ * Description : HW UART source file for STM32WPAN Middleware.
*
******************************************************************************
* @attention
@@ -48,7 +48,7 @@ extern UART_HandleTypeDef huart1;
hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
} while(0)
- /* Variables ------------------------------------------------------------------*/
+/* Variables -----------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
@@ -65,73 +65,73 @@ extern UART_HandleTypeDef huart1;
void (*HW_hlpuart1TxCb)(void);
#endif
- void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_RX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_RX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_RX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_RX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ return;
+}
+
+void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
{
- HAL_StatusTypeDef hal_status = HAL_OK;
- hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
+ default:
+ break;
}
switch (hal_status)
@@ -161,8 +161,8 @@ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t
hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
{
-HAL_StatusTypeDef hal_status = HAL_OK;
-hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
@@ -250,33 +250,33 @@ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
switch ((uint32_t)huart->Instance)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1RxCb)
- {
- HW_huart1RxCb();
- }
- break;
+ if(HW_huart1RxCb)
+ {
+ HW_huart1RxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1RxCb)
- {
- HW_hlpuart1RxCb();
- }
- break;
+ if(HW_hlpuart1RxCb)
+ {
+ HW_hlpuart1RxCb();
+ }
+ break;
#endif
default:
@@ -292,20 +292,20 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1TxCb)
- {
- HW_huart1TxCb();
- }
- break;
+ if(HW_huart1TxCb)
+ {
+ HW_huart1TxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1TxCb)
- {
- HW_hlpuart1TxCb();
- }
- break;
+ if(HW_hlpuart1TxCb)
+ {
+ HW_hlpuart1TxCb();
+ }
+ break;
#endif
default:
@@ -315,4 +315,4 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
return;
}
- /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/main.c
index 3e30e0b1e..4741fe7f1 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/main.c
@@ -41,10 +41,10 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "app_entry.h"
+#include "app_common.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
-#include "app_common.h"
#include "stm32_lpm.h"
#include "stm32_seq.h"
#include "dbg_trace.h"
@@ -110,6 +110,7 @@ int main(void)
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
+
/* MCU Configuration--------------------------------------------------------*/
@@ -137,6 +138,8 @@ int main(void)
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
+
+ /* Init code for STM32_WPAN */
APPE_Init();
/* Infinite loop */
@@ -161,17 +164,20 @@ void SystemClock_Config(void)
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
+ /** Configure LSE Drive Capability
+ */
+ __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
/** Configure the main internal regulator output voltage
*/
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
/** Initializes the CPU, AHB and APB busses clocks
*/
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSI1
- |RCC_OSCILLATORTYPE_HSE;
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE
+ |RCC_OSCILLATORTYPE_LSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ RCC_OscInitStruct.LSEState = RCC_LSE_ON;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
- RCC_OscInitStruct.LSIState = RCC_LSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
@@ -200,8 +206,8 @@ void SystemClock_Config(void)
|RCC_PERIPHCLK_LPUART1;
PeriphClkInitStruct.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2;
PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1;
- PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI;
- PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSI;
+ PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
+ PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSE;
PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSE;
PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE0;
@@ -357,7 +363,13 @@ static void MX_RTC_Init(void)
Error_Handler();
}
/* USER CODE BEGIN RTC_Init 2 */
- MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* Disable RTC registers write protection */
+ LL_RTC_DisableWriteProtection(RTC);
+
+ LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER);
+
+ /* Enable RTC registers write protection */
+ LL_RTC_EnableWriteProtection(RTC);
/* USER CODE END RTC_Init 2 */
}
@@ -367,6 +379,7 @@ static void MX_RTC_Init(void)
*/
static void MX_DMA_Init(void)
{
+
/* DMA controller clock enable */
__HAL_RCC_DMAMUX1_CLK_ENABLE();
__HAL_RCC_DMA1_CLK_ENABLE();
@@ -404,7 +417,13 @@ void PeriphClock_Config(void)
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
- LL_RCC_HSI48_Enable();
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
+ LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -437,30 +456,6 @@ void PeriphClock_Config(void)
HAL_RCCEx_CRSConfig(&RCC_CRSInitStruct);
#endif
- /**
- * Select LSE clock
- */
- LL_RCC_LSE_Enable();
- while(!LL_RCC_LSE_IsReady());
-
- /**
- * Select wakeup source of BLE RF
- */
- LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
-
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
/*************************************************************
@@ -567,21 +562,33 @@ static void Init_Exti( void )
* WRAP FUNCTIONS
*
*************************************************************/
-
-/**
- * This function is empty to avoid starting the SysTick Timer
- */
-HAL_StatusTypeDef HAL_InitTick( uint32_t TickPriority )
+void HAL_Delay(uint32_t Delay)
{
- return (HAL_OK);
-}
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
-/**
- * This function is empty as the SysTick Timer is not used
- */
-void HAL_Delay(__IO uint32_t Delay)
-{
- return;
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
}
/* USER CODE END 4 */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/stm32wbxx_hal_msp.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/stm32wbxx_hal_msp.c
index c6a106fa7..87614ca60 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/stm32wbxx_hal_msp.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/stm32wbxx_hal_msp.c
@@ -5,45 +5,15 @@
* Description : This file provides code for the MSP Initialization
* and de-Initialization codes.
******************************************************************************
- * This notice applies to any and all portions of this file
- * that are not between comment pairs USER CODE BEGIN and
- * USER CODE END. Other portions of this file, whether
- * inserted by the user or by software development tools
- * are owned by their respective copyright owners.
+ * @attention
*
- * Copyright (c) 2019 STMicroelectronics International N.V.
- * All rights reserved.
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted, provided that the following conditions are met:
- *
- * 1. Redistribution of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of other
- * contributors to this software may be used to endorse or promote products
- * derived from this software without specific written permission.
- * 4. This software, including modifications and/or derivative works of this
- * software, must execute solely and exclusively on microcontroller or
- * microprocessor devices manufactured by or for STMicroelectronics.
- * 5. Redistribution and use of this software other than as permitted under
- * this license is void and will automatically terminate your rights under
- * this license.
- *
- * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
- * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
- * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
*
******************************************************************************
*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/stm32wbxx_it.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/stm32wbxx_it.c
index e80b2598c..a13bff23c 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/stm32wbxx_it.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/Core/Src/stm32wbxx_it.c
@@ -60,21 +60,10 @@
/* USER CODE END 0 */
/* External variables --------------------------------------------------------*/
-
-
-
extern DMA_HandleTypeDef hdma_lpuart1_tx;
-
-
extern DMA_HandleTypeDef hdma_usart1_tx;
-
-
extern UART_HandleTypeDef hlpuart1;
-
-
extern UART_HandleTypeDef huart1;
-
-
/* USER CODE BEGIN EV */
/* USER CODE END EV */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/STM32_WPAN/App/app_ble.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/STM32_WPAN/App/app_ble.c
index 1d00afdcd..196438108 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/STM32_WPAN/App/app_ble.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/STM32_WPAN/App/app_ble.c
@@ -218,6 +218,7 @@ PLACE_IN_SECTION("BLE_APP_CONTEXT") static BleApplicationContext_t BleApplicatio
PLACE_IN_SECTION("BLE_APP_CONTEXT") static uint16_t AdvIntervalMin, AdvIntervalMax;
static const char local_name[] = {AD_TYPE_COMPLETE_LOCAL_NAME ,'B','P','S','T','M'};
+
/* USER CODE BEGIN PV */
/* USER CODE END PV */
@@ -362,7 +363,10 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
/* restart advertising */
Adv_Request(APP_BLE_FAST_ADV);
-}
+ /* USER CODE BEGIN EVT_DISCONN_COMPLETE */
+
+ /* USER CODE END EVT_DISCONN_COMPLETE */
+ }
break; /* EVT_DISCONN_COMPLETE */
@@ -392,24 +396,27 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
{
APP_DBG_MSG("EVT_UPDATE_PHY_COMPLETE, status nok \n");
}
- ret = hci_le_read_phy(BleApplicationContext.BleApplicationContext_legacy.connectionHandle,&TX_PHY,&RX_PHY);
- if (ret == BLE_STATUS_SUCCESS)
- {
- APP_DBG_MSG("Read_PHY success \n");
- if ((TX_PHY == TX_2M) && (RX_PHY == RX_2M))
- {
- APP_DBG_MSG("PHY Param TX= %d, RX= %d \n", TX_PHY, RX_PHY);
- }
- else
- {
- APP_DBG_MSG("PHY Param TX= %d, RX= %d \n", TX_PHY, RX_PHY);
- }
- }
- else
- {
- APP_DBG_MSG("Read conf not succeess \n");
- }
- break;
+ ret = hci_le_read_phy(BleApplicationContext.BleApplicationContext_legacy.connectionHandle,&TX_PHY,&RX_PHY);
+ if (ret == BLE_STATUS_SUCCESS)
+ {
+ APP_DBG_MSG("Read_PHY success \n");
+ if ((TX_PHY == TX_2M) && (RX_PHY == RX_2M))
+ {
+ APP_DBG_MSG("PHY Param TX= %d, RX= %d \n", TX_PHY, RX_PHY);
+ }
+ else
+ {
+ APP_DBG_MSG("PHY Param TX= %d, RX= %d \n", TX_PHY, RX_PHY);
+ }
+ }
+ else
+ {
+ APP_DBG_MSG("Read conf not succeess \n");
+ }
+ /* USER CODE BEGIN EVT_LE_PHY_UPDATE_COMPLETE */
+
+ /* USER CODE END EVT_LE_PHY_UPDATE_COMPLETE */
+ break;
case EVT_LE_CONN_COMPLETE:
{
hci_le_connection_complete_event_rp0 *connection_complete_event;
@@ -421,8 +428,7 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
HW_TS_Stop(BleApplicationContext.Advertising_mgr_timer_Id);
- APP_DBG_MSG("EVT_LE_CONN_COMPLETE for connection handle 0x%x\n",
- connection_complete_event->Connection_Handle);
+ APP_DBG_MSG("EVT_LE_CONN_COMPLETE for connection handle 0x%x\n", connection_complete_event->Connection_Handle);
if (BleApplicationContext.Device_Connection_Status == APP_BLE_LP_CONNECTING)
{
/* Connection as client */
@@ -715,10 +721,7 @@ static void Adv_Request(APP_BLE_ConnStatus_t New_Status)
*/
HW_TS_Stop(BleApplicationContext.Advertising_mgr_timer_Id);
-#if(CFG_DEBUG_APP_TRACE != 0)
- APP_DBG_MSG("First index in %d state \n",
- BleApplicationContext.Device_Connection_Status);
-#endif
+ APP_DBG_MSG("First index in %d state \n", BleApplicationContext.Device_Connection_Status);
if ((New_Status == APP_BLE_LP_ADV)
&& ((BleApplicationContext.Device_Connection_Status == APP_BLE_FAST_ADV)
|| (BleApplicationContext.Device_Connection_Status == APP_BLE_LP_ADV)))
@@ -727,16 +730,12 @@ static void Adv_Request(APP_BLE_ConnStatus_t New_Status)
ret = aci_gap_set_non_discoverable();
if (ret == BLE_STATUS_SUCCESS)
{
-#if(CFG_DEBUG_APP_TRACE != 0)
- APP_DBG_MSG("Successfully Stopped Advertising\n");
-#endif
- }
+ APP_DBG_MSG("Successfully Stopped Advertising \n");
+ }
else
{
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("Stop Advertising Failed , result: %d \n", ret);
-#endif
- }
+ }
}
BleApplicationContext.Device_Connection_Status = New_Status;
@@ -757,30 +756,24 @@ static void Adv_Request(APP_BLE_ConnStatus_t New_Status)
{
if (New_Status == APP_BLE_FAST_ADV)
{
- APP_DBG_MSG("Successfully Start Fast Advertising\n" );
+ APP_DBG_MSG("Successfully Start Fast Advertising \n" );
/* Start Timer to STOP ADV - TIMEOUT */
HW_TS_Start(BleApplicationContext.Advertising_mgr_timer_Id, INITIAL_ADV_TIMEOUT);
}
else
{
-#if(CFG_DEBUG_APP_TRACE != 0)
- APP_DBG_MSG("Successfully Start Low Power Advertising\n");
-#endif
+ APP_DBG_MSG("Successfully Start Low Power Advertising \n");
}
}
else
{
if (New_Status == APP_BLE_FAST_ADV)
{
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("Start Fast Advertising Failed , result: %d \n", ret);
-#endif
}
else
{
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("Start Low Power Advertising Failed , result: %d \n", ret);
-#endif
}
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/STM32_WPAN/App/ble_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/STM32_WPAN/App/ble_conf.h
index 9298a4857..14b543793 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/STM32_WPAN/App/ble_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/STM32_WPAN/App/ble_conf.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : App/ble_conf.h
- * Description : Configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : Configuration file for BLE Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
@@ -49,7 +49,7 @@
* This shall take into account all registered handlers
* (from either the provided services or the custom services)
*/
-#define BLE_CFG_SVC_MAX_NBR_CB 5
+#define BLE_CFG_SVC_MAX_NBR_CB 7
#define BLE_CFG_CLT_MAX_NBR_CB 0
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/STM32_WPAN/App/ble_dbg_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/STM32_WPAN/App/ble_dbg_conf.h
index aa57dfc0b..db335dc11 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/STM32_WPAN/App/ble_dbg_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_BloodPressure/STM32_WPAN/App/ble_dbg_conf.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : App/ble_dbg_conf.h
- * Description : Debug configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : Debug configuration file for BLE Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Inc/app_conf.h
index 9059073ab..d1a973c3c 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Inc/app_conf.h
@@ -24,12 +24,13 @@
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Cable Replacement Application Config
******************************************************************************/
-/**< generic parameters ********************************************************/
+/**< generic parameters ******************************************************/
/**
* Define Tx Power
@@ -89,6 +90,15 @@
*/
#define CFG_BLE_ERK {0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21,0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21}
+/* USER CODE BEGIN Generic_Parameters */
+/**
+ * SMPS supply
+ * SMPS not used when Set to 0
+ * SMPS used when Set to 1
+ */
+#define CFG_USE_SMPS 1
+/* USER CODE END Generic_Parameters */
+
/**< specific parameters ********************************************************/
/**
@@ -195,7 +205,7 @@
* 1 : internal RO
* 0 : external crystal ( no calibration )
*/
-#define CFG_BLE_LSE_SOURCE 1
+#define CFG_BLE_LSE_SOURCE 0
/**
* Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Inc/stm32_lpm_if.h
index 38e326512..d8e67947f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Inc/stm32_lpm_if.h
@@ -1,46 +1,22 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file stm32_lpm_if.h
-* @brief Header for stm32_lpm_f.c module (device specific LP management)
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
******************************************************************************
* @attention
*
-* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics International N.V.
+* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted, provided that the following conditions are met:
-*
-* 1. Redistribution of source code must retain the above copyright notice,
-* this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following disclaimer in the documentation
-* and/or other materials provided with the distribution.
-* 3. Neither the name of STMicroelectronics nor the names of other
-* contributors to this software may be used to endorse or promote products
-* derived from this software without specific written permission.
-* 4. This software, including modifications and/or derivative works of this
-* software, must execute solely and exclusively on microcontroller or
-* microprocessor devices manufactured by or for STMicroelectronics.
-* 5. Redistribution and use of this software other than as permitted under
-* this license is void and will automatically terminate your rights under
-* this license.
-*
-* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
-* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
-* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+* This software component is licensed by ST under BSD 3-Clause license,
+* the "License"; You may not use this file except in compliance with the
+* License. You may obtain a copy of the License at:
+* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32_LPM_IF_H
@@ -89,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Inc/stm32wbxx_hal_conf.h
index 8cce280aa..4ab9edb7d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Inc/stm32wbxx_hal_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Inc/stm32wbxx_hal_conf.h
@@ -219,6 +219,10 @@
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32wbxx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32wbxx_hal_flash.h"
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Inc/utilities_conf.h
index c98d97ba1..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Inc/utilities_conf.h
@@ -1,3 +1,4 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* File Name : utilities_conf.h
@@ -9,13 +10,14 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef UTILITIES_CONF_H
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Src/app_entry.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Src/app_entry.c
index 19e8ecf3e..105b411ca 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Src/app_entry.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Src/app_entry.c
@@ -55,7 +55,6 @@ static void appe_Tl_Init( void );
static void Led_Init( void );
static void Button_Init( void );
static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status );
-
static void APPE_SysUserEvtRx( void * pPayload );
/* Functions Definition ------------------------------------------------------*/
@@ -81,7 +80,7 @@ void APPE_Init( void )
/**
* From now, the application is waiting for the ready event ( VS_HCI_C2_Ready )
- * received on the system channel before starting the BLE Stack
+ * received on the system channel before starting the Stack
* This system event is received with APPE_SysUserEvtRx()
*/
@@ -252,7 +251,6 @@ void UTIL_SEQ_Idle( void )
return;
}
-
void UTIL_SEQ_EvtIdle( UTIL_SEQ_bm_t task_id_bm, UTIL_SEQ_bm_t evt_waited_bm )
{
UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Src/hw_timerserver.c
index 52a1bfa0d..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Src/hw_timerserver.c
@@ -1,22 +1,21 @@
/**
******************************************************************************
- * File Name : hw_timerserver.c
- * Description : Hardware timerserver source file for BLE
- * middleWare.
+ * File Name : hw_timerserver.c
+ * Description : Hardware timerserver source file for STM32WPAN Middleware.
+ *
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Src/hw_uart.c
index c0fc22d58..775aa241d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Src/hw_uart.c
@@ -130,7 +130,7 @@
HAL_NVIC_EnableIRQ(CFG_HW_##__USART_BASE__##_TX_DMA_IRQn); \
} while(0)
- /* Variables ------------------------------------------------------------------*/
+/* Variables ------------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
UART_HandleTypeDef huart1 = {0};
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Src/main.c
index 34d973675..25a8c45e0 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Src/main.c
@@ -195,7 +195,13 @@ static void Init_RTC( void )
hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
HAL_RTC_Init(&hrtc);
- MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* Disable RTC registers write protection */
+ LL_RTC_DisableWriteProtection(RTC);
+
+ LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER);
+
+ /* Enable RTC registers write protection */
+ LL_RTC_EnableWriteProtection(RTC);
return;
}
@@ -218,6 +224,12 @@ void SystemClock_Config( void )
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -268,19 +280,6 @@ void SystemClock_Config( void )
*/
LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
@@ -289,21 +288,33 @@ void SystemClock_Config( void )
* WRAP FUNCTIONS
*
*************************************************************/
-
-/**
- * This function is empty to avoid starting the SysTick Timer
- */
-HAL_StatusTypeDef HAL_InitTick( uint32_t TickPriority )
+void HAL_Delay(uint32_t Delay)
{
- return (HAL_OK);
-}
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
-/**
- * This function is empty as the SysTick Timer is not used
- */
-void HAL_Delay(__IO uint32_t Delay)
-{
- return;
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
}
/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/STM32_WPAN/App/app_ble.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/STM32_WPAN/App/app_ble.c
index 2598dbe8e..75b843999 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/STM32_WPAN/App/app_ble.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/STM32_WPAN/App/app_ble.c
@@ -496,6 +496,12 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
event_type = le_advertising_event->Advertising_Report[0].Event_Type;
event_data_size = le_advertising_event->Advertising_Report[0].Length_Data;
+
+ /* WARNING: be careful when decoding advertising report as its raw format cannot be mapped on a C structure.
+ The data and RSSI values could not be directly decoded from the RAM using the data and RSSI field from hci_le_advertising_report_event_rp0 structure.
+ Instead they must be read by using offsets (please refer to BLE specification).
+ RSSI = *(uint8_t*) (adv_report_data + le_advertising_event->Advertising_Report[0].Length_Data);
+ */
adv_report_data = (uint8_t*)(&le_advertising_event->Advertising_Report[0].Length_Data) + 1;
k = 0;
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/STM32_WPAN/App/ble_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/STM32_WPAN/App/ble_conf.h
index 83a39f4a1..376a9faaa 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/STM32_WPAN/App/ble_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/STM32_WPAN/App/ble_conf.h
@@ -60,7 +60,7 @@
* This shall take into account all registered handlers
* (from either the provided services or the custom services)
*/
-#define BLE_CFG_SVC_MAX_NBR_CB 5
+#define BLE_CFG_SVC_MAX_NBR_CB 7
#define BLE_CFG_CLT_MAX_NBR_CB 1
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/SW4STM32/Production/.cproject b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/SW4STM32/Production/.cproject
index cf6c56b36..3fa61ba28 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/SW4STM32/Production/.cproject
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_CableReplacement/SW4STM32/Production/.cproject
@@ -63,7 +63,7 @@
<listOptionValue builtIn="false" value="CORE_CM4"/>
</option>
<option id="fr.ac6.managedbuild.gnu.c.compiler.option.misc.other.1014443615" superClass="fr.ac6.managedbuild.gnu.c.compiler.option.misc.other" useByScannerDiscovery="false" value="-fmessage-length=0" valueType="string"/>
- <option id="gnu.c.compiler.option.dialect.std.2021449760" name="Language standard" superClass="gnu.c.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.c.compiler.dialect.default" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.dialect.std.2021449760" superClass="gnu.c.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.c.compiler.dialect.default" valueType="enumerated"/>
<inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c.1355542295" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c"/>
<inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.s.2093521244" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.s"/>
</tool>
@@ -89,7 +89,7 @@
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble"/>
<listOptionValue builtIn="false" value="../../../Core/Inc"/>
- <listOptionValue builtIn="false" value="../../../STM32_WPAN/app"/>
+ <listOptionValue builtIn="false" value="../../../STM32_WPAN/App"/>
</option>
<option id="gnu.cpp.compiler.option.preprocessor.def.1038060833" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="USE_STM32WBXX_NUCLEO"/>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/app_conf.h
index 69a9c73e6..e547baca3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/app_conf.h
@@ -19,17 +19,18 @@
/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __APP_CONFIG_H
-#define __APP_CONFIG_H
+#ifndef __APP_CONF_H
+#define __APP_CONF_H
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
- * OTA Application Config
+ * Data Throughput Application Config
******************************************************************************/
-/**< generic parameters ********************************************************/
+/**< generic parameters ******************************************************/
/**
* Define Tx Power
@@ -63,12 +64,7 @@
#define CFG_IO_CAPABILITY_NO_INPUT_NO_OUTPUT (0x03)
#define CFG_IO_CAPABILITY_KEYBOARD_DISPLAY (0x04)
-#define CFG_IO_CAPABILITY CFG_IO_CAPABILITY_KEYBOARD_DISPLAY
-
-/* LE secure connections support values */
-#define SC_PAIRING_NOT_SUPPORTED (0x00)
-#define SC_PAIRING_SUPPORTED_OPTIONAL (0x01)
-#define SC_PAIRING_ONLY (0x02)
+#define CFG_IO_CAPABILITY CFG_IO_CAPABILITY_DISPLAY_ONLY
/**
* Define MITM modes
@@ -94,22 +90,40 @@
*/
#define CFG_BLE_ERK {0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21,0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21}
+/* USER CODE BEGIN Generic_Parameters */
+/**
+ * SMPS supply
+ * SMPS not used when Set to 0
+ * SMPS used when Set to 1
+ */
+#define CFG_USE_SMPS 1
+/* USER CODE END Generic_Parameters */
+
/**< specific parameters ********************************************************/
-#define BLE_PERIPHERAL 1
-/*#define BLE_CENTRAL 1*/
-
-/*#define ENCRYPTION_ON 1*/
+/**
+ * Encryption enable when set to 1
+ * Encryption disabe when set to 0
+ */
+#define CFG_ENCRYPTION_ENABLE 0
+/**
+ * Define the different role supported
+ * In this application
+ * When set to 1, the device is central
+ * When set to 0, the device is peripheral
+ */
+#define CFG_BLE_CENTRAL 0
+/**
+ * in this specific application, the device is either central
+ * or peripheral but cannot be both
+ */
#undef CFG_ADV_BD_ADDRESS
-#ifdef BLE_PERIPHERAL
-#define CFG_ADV_BD_ADDRESS 0x222222333333
-#define CFG_PERIPHERAL 1
-#define CFG_CENTRAL 0
-#endif
-#ifdef BLE_CENTRAL
+#if (CFG_BLE_CENTRAL != 0 )
+#define CFG_BLE_PERIPHERAL 0
#define CFG_ADV_BD_ADDRESS 0xFFEEDDCCBBAA
-#define CFG_PERIPHERAL 0
-#define CFG_CENTRAL 1
+#else
+#define CFG_ADV_BD_ADDRESS 0x222222333333
+#define CFG_BLE_PERIPHERAL 1
#endif
#define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI4_IRQHandler
@@ -122,24 +136,40 @@
#define CFG_DEV_ID_PERIPH_SERVER (0x88)
#define CFG_FEATURE_DT (0x70)
-/* notification enabled at initialization */
-#define BUTTON_SERVER 1
-
#define UUID_128BIT_FORMAT 1
#define MAX_HCI_CMD_EVENT_PAYLOAD_SIZE 255
#define DATA_NOTIFICATION_MAX_PACKET_SIZE 240
-#define MAX_CONNECTION 1
+#define CFG_MAX_CONNECTION 1
+
+/**
+ * TX PHY configuration
+ * It shall be set to
+ * 0 if ignored
+ * 1 if 1M
+ * 2 if 2M
+ * 4 if LE_CODED
+ * or any combination of 1M | 2M | LE_CODED
+ */
+#define CFG_TX_PHY 2
+
+/**
+ * RX PHY configuration
+ * It shall be set to
+ * 0 if ignored
+ * 1 if 1M
+ * 2 if 2M
+ * 4 if LE_CODED
+ * or any combination of 1M | 2M | LE_CODED
+ */
+#define CFG_RX_PHY 2
+
+/**
+ * ALL PHYS configuration
+ */
+#define CFG_ALL_PHYS ((!CFG_TX_PHY) + ((!CFG_RX_PHY)*2))
-/* Read PHY, Set PHY */
-#define ALL_PHYS_PREFERENCE 0x00
-#define RX_2M_PREFERRED 0x02
-#define TX_2M_PREFERRED 0x02
-#define TX_1M 0x01
-#define TX_2M 0x02
-#define RX_1M 0x01
-#define RX_2M 0x02
/******************************************************************************
* BLE Stack
******************************************************************************/
@@ -219,7 +249,7 @@
* 1 : internal RO
* 0 : external crystal ( no calibration )
*/
-#define CFG_BLE_LSE_SOURCE 1
+#define CFG_BLE_LSE_SOURCE 0
/**
* Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
@@ -434,7 +464,6 @@ typedef enum
#define CFG_LPM_SUPPORTED 0
#define CFG_DEBUGGER_SUPPORTED 1
#endif
-
/**
* When CFG_DEBUG_TRACE_FULL is set to 1, the trace are output with the API name, the file name and the line number
* When CFG_DEBUG_TRACE_LIGHT is set to 1, only the debug message is output
@@ -486,11 +515,11 @@ typedef enum
typedef enum
{
CFG_TASK_DATA_TRANSFER_UPDATE_ID,
- CFG_IdleTask_DataTransfer_ClientDiscovery,
CFG_TASK_CONN_DEV_1_ID,
CFG_TASK_BUTTON_ID,
CFG_TASK_START_ADV_ID,
CFG_TASK_START_SCAN_ID,
+ CFG_TASK_LINK_CONFIG_ID,
CFG_TASK_APP_DATA_THROUGHPUT_ID,
CFG_TASK_HCI_ASYNCH_EVT_ID,
@@ -525,6 +554,8 @@ typedef enum
{
CFG_IDLEEVT_HCI_CMD_EVT_RSP_ID,
CFG_IDLEEVT_SYSTEM_HCI_CMD_EVT_RSP_ID,
+ CFG_IDLEEVT_GAP_PROC_COMPLETE,
+ CFG_IDLEEVT_GATT_PROC_COMPLETE,
} CFG_IdleEvt_Id_t;
/******************************************************************************
@@ -538,6 +569,9 @@ typedef enum
{
CFG_LPM_APP,
CFG_LPM_APP_BLE,
+ /* USER CODE BEGIN CFG_LPM_Id_t */
+
+ /* USER CODE END CFG_LPM_Id_t */
} CFG_LPM_Id_t;
/******************************************************************************
@@ -547,6 +581,6 @@ typedef enum
#define CFG_OTP_END_ADRESS OTP_AREA_END_ADDR
-#endif /*__APP_CONFIG_H */
+#endif /*__APP_CONF_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/hw_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/hw_conf.h
index 5e611c1f2..130af82bc 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/hw_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/hw_conf.h
@@ -49,7 +49,7 @@
* The user may define the maximum number of virtual timers supported.
* It shall not exceed 255
*/
-#define CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER 15
+#define CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER 6
/**
* The user may define the priority in the NVIC of the RTC_WKUP interrupt handler that is used to manage the
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/stm32_lpm_if.h
index 38e326512..d8e67947f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/stm32_lpm_if.h
@@ -1,46 +1,22 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file stm32_lpm_if.h
-* @brief Header for stm32_lpm_f.c module (device specific LP management)
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
******************************************************************************
* @attention
*
-* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics International N.V.
+* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted, provided that the following conditions are met:
-*
-* 1. Redistribution of source code must retain the above copyright notice,
-* this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following disclaimer in the documentation
-* and/or other materials provided with the distribution.
-* 3. Neither the name of STMicroelectronics nor the names of other
-* contributors to this software may be used to endorse or promote products
-* derived from this software without specific written permission.
-* 4. This software, including modifications and/or derivative works of this
-* software, must execute solely and exclusively on microcontroller or
-* microprocessor devices manufactured by or for STMicroelectronics.
-* 5. Redistribution and use of this software other than as permitted under
-* this license is void and will automatically terminate your rights under
-* this license.
-*
-* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
-* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
-* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+* This software component is licensed by ST under BSD 3-Clause license,
+* the "License"; You may not use this file except in compliance with the
+* License. You may obtain a copy of the License at:
+* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32_LPM_IF_H
@@ -89,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/stm32wbxx_hal_conf.h
index 8cce280aa..4ab9edb7d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/stm32wbxx_hal_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/stm32wbxx_hal_conf.h
@@ -219,6 +219,10 @@
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32wbxx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32wbxx_hal_flash.h"
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/stm32wbxx_it.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/stm32wbxx_it.h
index cc36646c5..877423276 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/stm32wbxx_it.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/stm32wbxx_it.h
@@ -1,10 +1,10 @@
/**
- ******************************************************************************
- * @file stm32wbxx_it.h
- * @author MCD Application Team
- * @brief This file contains the headers of the interrupt handlers.
- ******************************************************************************
- * @attention
+ ******************************************************************************
+ * @file stm32wbxx_it.h
+ * @author MCD Application Team
+ * @brief This file contains the headers of the interrupt handlers.
+ ******************************************************************************
+ * @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
@@ -52,6 +52,7 @@ void CFG_HW_LPUART1_DMA_TX_IRQHandler( void );
void RTC_WKUP_IRQHandler(void);
void IPCC_C1_TX_IRQHandler(void);
void IPCC_C1_RX_IRQHandler(void);
+
#ifdef __cplusplus
}
#endif
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/utilities_conf.h
index c98d97ba1..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Inc/utilities_conf.h
@@ -1,3 +1,4 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* File Name : utilities_conf.h
@@ -9,13 +10,14 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef UTILITIES_CONF_H
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Src/app_entry.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Src/app_entry.c
index a0730315f..105b411ca 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Src/app_entry.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Src/app_entry.c
@@ -55,7 +55,6 @@ static void appe_Tl_Init( void );
static void Led_Init( void );
static void Button_Init( void );
static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status );
-
static void APPE_SysUserEvtRx( void * pPayload );
/* Functions Definition ------------------------------------------------------*/
@@ -81,7 +80,7 @@ void APPE_Init( void )
/**
* From now, the application is waiting for the ready event ( VS_HCI_C2_Ready )
- * received on the system channel before starting the BLE Stack
+ * received on the system channel before starting the Stack
* This system event is received with APPE_SysUserEvtRx()
*/
@@ -192,14 +191,6 @@ static void appe_Tl_Init( void )
static void Led_Init( void )
{
-#if (CFG_BUTTON_SUPPORTED == 1)
- /**
- * Button Initialization
- */
-
- BSP_PB_Init(BUTTON_SW1, BUTTON_MODE_EXTI);
-#endif
-
#if (CFG_LED_SUPPORTED == 1)
/**
* Leds Initialization
@@ -221,7 +212,6 @@ static void Button_Init( void )
/**
* Button Initialization
*/
-
BSP_PB_Init(BUTTON_SW1, BUTTON_MODE_EXTI);
#endif
@@ -261,7 +251,6 @@ void UTIL_SEQ_Idle( void )
return;
}
-
void UTIL_SEQ_EvtIdle( UTIL_SEQ_bm_t task_id_bm, UTIL_SEQ_bm_t evt_waited_bm )
{
UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
@@ -287,7 +276,6 @@ void shci_cmd_resp_wait(uint32_t timeout)
return;
}
-
void HAL_GPIO_EXTI_Callback( uint16_t GPIO_Pin )
{
switch (GPIO_Pin)
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Src/hw_timerserver.c
index 52a1bfa0d..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Src/hw_timerserver.c
@@ -1,22 +1,21 @@
/**
******************************************************************************
- * File Name : hw_timerserver.c
- * Description : Hardware timerserver source file for BLE
- * middleWare.
+ * File Name : hw_timerserver.c
+ * Description : Hardware timerserver source file for STM32WPAN Middleware.
+ *
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Src/hw_uart.c
index c0fc22d58..775aa241d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Src/hw_uart.c
@@ -130,7 +130,7 @@
HAL_NVIC_EnableIRQ(CFG_HW_##__USART_BASE__##_TX_DMA_IRQn); \
} while(0)
- /* Variables ------------------------------------------------------------------*/
+/* Variables ------------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
UART_HandleTypeDef huart1 = {0};
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Src/main.c
index 57550b10f..53f38a463 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Src/main.c
@@ -195,7 +195,13 @@ static void Init_RTC( void )
hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
HAL_RTC_Init(&hrtc);
- MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* Disable RTC registers write protection */
+ LL_RTC_DisableWriteProtection(RTC);
+
+ LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER);
+
+ /* Enable RTC registers write protection */
+ LL_RTC_EnableWriteProtection(RTC);
return;
}
@@ -218,6 +224,12 @@ void SystemClock_Config( void )
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -268,19 +280,6 @@ void SystemClock_Config( void )
*/
LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
@@ -289,21 +288,33 @@ void SystemClock_Config( void )
* WRAP FUNCTIONS
*
*************************************************************/
-
-/**
- * This function is empty to avoid starting the SysTick Timer
- */
-HAL_StatusTypeDef HAL_InitTick( uint32_t TickPriority )
+void HAL_Delay(uint32_t Delay)
{
- return (HAL_OK);
-}
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
-/**
- * This function is empty as the SysTick Timer is not used
- */
-void HAL_Delay(__IO uint32_t Delay)
-{
- return;
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
}
/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/EWARM/BLE_DataThroughput.ewp b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/EWARM/BLE_DataThroughput.ewp
index f6c0eba7a..43e7f24b8 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/EWARM/BLE_DataThroughput.ewp
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/EWARM/BLE_DataThroughput.ewp
@@ -219,7 +219,6 @@
<state>STM32WB55xx</state>
<state>USE_HAL_DRIVER</state>
<state>CORE_CM4</state>
- <state>PHY_2M</state>
</option>
<option>
<name>CCPreprocFile</name>
@@ -1048,9 +1047,6 @@
<name>$PROJ_DIR$\..\Core\Src\app_entry.c</name>
</file>
<file>
- <name>$PROJ_DIR$\..\Core\Src\stm32_lpm_if.c</name>
- </file>
- <file>
<name>$PROJ_DIR$\..\Core\Src\hw_timerserver.c</name>
</file>
<file>
@@ -1060,6 +1056,9 @@
<name>$PROJ_DIR$\..\Core\Src\main.c</name>
</file>
<file>
+ <name>$PROJ_DIR$\..\Core\Src\stm32_lpm_if.c</name>
+ </file>
+ <file>
<name>$PROJ_DIR$\..\Core\Src\stm32wbxx_it.c</name>
</file>
</group>
@@ -1074,16 +1073,16 @@
<group>
<name>app</name>
<file>
- <name>$PROJ_DIR$\..\STM32_WPAN\app\app_ble.c</name>
+ <name>$PROJ_DIR$\..\STM32_WPAN\App\app_ble.c</name>
</file>
<file>
- <name>$PROJ_DIR$\..\STM32_WPAN\app\dt_client_app.c</name>
+ <name>$PROJ_DIR$\..\STM32_WPAN\App\dt_client_app.c</name>
</file>
<file>
- <name>$PROJ_DIR$\..\STM32_WPAN\app\dt_server_app.c</name>
+ <name>$PROJ_DIR$\..\STM32_WPAN\App\dt_server_app.c</name>
</file>
<file>
- <name>$PROJ_DIR$\..\STM32_WPAN\app\dts.c</name>
+ <name>$PROJ_DIR$\..\STM32_WPAN\App\dts.c</name>
</file>
</group>
<group>
@@ -1144,12 +1143,6 @@
<name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_pwr_ex.c</name>
</file>
<file>
- <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_spi.c</name>
- </file>
- <file>
- <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_spi_ex.c</name>
- </file>
- <file>
<name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rcc.c</name>
</file>
<file>
@@ -1162,6 +1155,12 @@
<name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rtc_ex.c</name>
</file>
<file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_spi.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_spi_ex.c</name>
+ </file>
+ <file>
<name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_uart.c</name>
</file>
<file>
@@ -1221,10 +1220,10 @@
<name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\hci_tl.c</name>
</file>
<file>
- <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\shci_tl.c</name>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\hci_tl_if.c</name>
</file>
<file>
- <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\hci_tl_if.c</name>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\shci_tl.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\shci_tl_if.c</name>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/app_ble.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/app_ble.c
index 4e0bd83c0..169e70a72 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/app_ble.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/app_ble.c
@@ -38,10 +38,6 @@
/* Private defines -----------------------------------------------------------*/
#define APPBLE_GAP_DEVICE_NAME_LENGTH 7
-#define DEFAULT_TS_MEASUREMENT_INTERVAL (1000000/CFG_TS_TICK_VAL) /**< 1s */
-#define DELAY_FOR_PAIRING (2*DEFAULT_TS_MEASUREMENT_INTERVAL)
-#define DATA_START_STOP (1*DEFAULT_TS_MEASUREMENT_INTERVAL)
-#define DATA_STOP (1*DEFAULT_TS_MEASUREMENT_INTERVAL)
#define LP_CONN_ADV_INTERVAL_MIN (0x640) /**< 1s */
#define LP_CONN_ADV_INTERVAL_MAX (0xFA0) /**< 2.5s */
#define FAST_CONN_ADV_INTERVAL_MIN (0x20) /**< 20ms */
@@ -57,18 +53,6 @@
#define BD_ADDR_SIZE_LOCAL 6
/* Private typedef -----------------------------------------------------------*/
-typedef enum
-{
- BLE_APP_DCS_IDLE,
- BLE_APP_DCS_FAST_ADV,
- BLE_APP_DCS_LP_ADV,
- BLE_APP_DCS_LP_CONNECTING,
- BLE_APP_DCS_CONNECTED,
- BLE_APP_DCS_CONNECTED_SERVER,
- BLE_APP_DCS_CONNECTED_CLIENT
-
-} BLE_APP_Device_Connection_Status_t;
-
/**
* security parameters structure
*/
@@ -172,7 +156,7 @@ typedef struct _tBLEProfileGlobalContext
* connection handle of the current active connection
* When not in connection, the handle is set to 0xFFFF
*/
- uint16_t connectionHandle[MAX_CONNECTION];
+ uint16_t connectionHandle;
/**
* length of the UUID list to be used while advertising
@@ -184,26 +168,24 @@ typedef struct _tBLEProfileGlobalContext
*/
uint8_t advtServUUID[100];
-} tBLEProfileGlobalContext;
+} BleGlobalContext_t;
-typedef struct
+enum
{
- tBLEProfileGlobalContext DTContext_legacy;
- DT_Gap_Gatt_State Connection_Status;
- uint16_t connection_handle;
- uint8_t Connection_mgr_timer_Id;
- uint8_t DeviceServerFound;
- uint8_t PairingReq_Id;
- uint8_t StartData_Id;
- uint8_t StopData_Id;
-} DTContext_t;
+ NO_DEVICE_FOUND,
+ AT_LEAST_ONE_DEVICE_FOUND
+};
+
+typedef enum
+{
+ GAP_PROC_PAIRING,
+ GAP_PROC_SET_PHY,
+} GapProcId_t;
typedef struct
{
- tBLEProfileGlobalContext BleApplicationContext_legacy;
- BLE_APP_Device_Connection_Status_t Device_Connection_Status[MAX_CONNECTION];
- BLE_APP_Device_Connection_Status_t Device1_Connection_Status;
- uint8_t Connection_mgr_timer_Id;
+ BleGlobalContext_t BleApplicationContext_legacy;
+ uint8_t DeviceServerFound;
} BleApplicationContext_t;
/* Private macros ------------------------------------------------------------*/
@@ -223,17 +205,19 @@ static const uint8_t M_bd_addr[BD_ADDR_SIZE_LOCAL] =
static uint8_t bd_addr_udn[BD_ADDR_SIZE_LOCAL];
/**
-* Identity root key used to derive LTK and CSRK
-*/
+ * Identity root key used to derive LTK and CSRK
+ */
static const uint8_t BLE_CFG_IR_VALUE[16] = CFG_BLE_IRK;
/**
-* Encryption root key used to derive LTK and CSRK
-*/
+ * Encryption root key used to derive LTK and CSRK
+ */
static const uint8_t BLE_CFG_ER_VALUE[16] = CFG_BLE_ERK;
-
+#if (CFG_BLE_PERIPHERAL != 0)
static const char local_name[] = { AD_TYPE_COMPLETE_LOCAL_NAME, 'D', 'T', '_', 'S', 'E', 'R', 'V', 'E', 'R' };
+#endif
+
uint8_t const manuf_data[22] = { 2, AD_TYPE_TX_POWER_LEVEL, 0x00 /* 0 dBm */, /* Trasmission Power */
10, AD_TYPE_COMPLETE_LOCAL_NAME, 'D', 'T', '_', 'S', 'E', 'R', 'V', 'E', 'R', /* Complete Name */
7, AD_TYPE_MANUFACTURER_SPECIFIC_DATA, 0x01/*SKD version */,
@@ -243,46 +227,54 @@ uint8_t const manuf_data[22] = { 2, AD_TYPE_TX_POWER_LEVEL, 0x00 /* 0 dBm */, /*
};
/* Global variables ----------------------------------------------------------*/
-BleApplicationContext_t BleApplicationContext;
+static BleApplicationContext_t BleApplicationContext;
tBDAddr SERVER_REMOTE_BDADDR;
-DTContext_t DTContext;
/* Private function prototypes -----------------------------------------------*/
-static void BLE_UserEvtRx( void * pPayload );
-static void BLE_StatusNot( HCI_TL_CmdStatus_t status );
-static void Ble_Tl_Init( void );
+static void BLE_UserEvtRx(void * pPayload);
+static void BLE_StatusNot(HCI_TL_CmdStatus_t status);
+static void Ble_Tl_Init(void);
static void Ble_Hci_Gap_Gatt_Init(void);
-static const uint8_t* BleGetBdAddress( void );
-static void Connect_Request( void );
-static void Scan_Request( void );
-static void Adv_Request( void );
-void Delay_PairingReq( void );
+static const uint8_t* BleGetBdAddress(void);
+static void LinkConfiguration(void);
+
+#if (CFG_BLE_CENTRAL != 0)
+static void GapProcReq(GapProcId_t GapProcId);
+static void Connect_Request(void);
+static void Scan_Request(void);
+static void Connection_Update(void);
+#endif
+
+#if (CFG_BLE_PERIPHERAL != 0)
+static void Adv_Request(void);
+#endif
+
/* Functions Definition ------------------------------------------------------*/
void APP_BLE_Init( void )
{
- SHCI_C2_Ble_Init_Cmd_Packet_t ble_init_cmd_packet =
- {
- {{0,0,0}}, /**< Header unused */
- {0, /** pBleBufferAddress not used */
- 0, /** BleBufferSize not used */
- CFG_BLE_NUM_GATT_ATTRIBUTES,
- CFG_BLE_NUM_GATT_SERVICES,
- CFG_BLE_ATT_VALUE_ARRAY_SIZE,
- CFG_BLE_NUM_LINK,
- CFG_BLE_DATA_LENGTH_EXTENSION,
- CFG_BLE_PREPARE_WRITE_LIST_SIZE,
- CFG_BLE_MBLOCK_COUNT,
- CFG_BLE_MAX_ATT_MTU,
- CFG_BLE_SLAVE_SCA,
- CFG_BLE_MASTER_SCA,
- CFG_BLE_LSE_SOURCE,
- CFG_BLE_MAX_CONN_EVENT_LENGTH,
- CFG_BLE_HSE_STARTUP_TIME,
- CFG_BLE_VITERBI_MODE,
- CFG_BLE_LL_ONLY,
- 0},
- };
+ SHCI_C2_Ble_Init_Cmd_Packet_t ble_init_cmd_packet =
+ {
+ {{0,0,0}}, /**< Header unused */
+ {0, /** pBleBufferAddress not used */
+ 0, /** BleBufferSize not used */
+ CFG_BLE_NUM_GATT_ATTRIBUTES,
+ CFG_BLE_NUM_GATT_SERVICES,
+ CFG_BLE_ATT_VALUE_ARRAY_SIZE,
+ CFG_BLE_NUM_LINK,
+ CFG_BLE_DATA_LENGTH_EXTENSION,
+ CFG_BLE_PREPARE_WRITE_LIST_SIZE,
+ CFG_BLE_MBLOCK_COUNT,
+ CFG_BLE_MAX_ATT_MTU,
+ CFG_BLE_SLAVE_SCA,
+ CFG_BLE_MASTER_SCA,
+ CFG_BLE_LSE_SOURCE,
+ CFG_BLE_MAX_CONN_EVENT_LENGTH,
+ CFG_BLE_HSE_STARTUP_TIME,
+ CFG_BLE_VITERBI_MODE,
+ CFG_BLE_LL_ONLY,
+ 0},
+ };
/**
@@ -318,33 +310,35 @@ void APP_BLE_Init( void )
/**
* From here, all initialization are BLE application specific
*/
+#if(CFG_BLE_PERIPHERAL != 0)
UTIL_SEQ_RegTask( 1<<CFG_TASK_START_ADV_ID, UTIL_SEQ_RFU, Adv_Request);
+#endif
+
+#if(CFG_BLE_CENTRAL != 0)
UTIL_SEQ_RegTask( 1<<CFG_TASK_START_SCAN_ID, UTIL_SEQ_RFU, Scan_Request);
UTIL_SEQ_RegTask( 1<<CFG_TASK_CONN_DEV_1_ID, UTIL_SEQ_RFU, Connect_Request);
+ UTIL_SEQ_RegTask( 1<<CFG_TASK_CONN_UPDATE_ID, UTIL_SEQ_RFU, Connection_Update);
+#endif
- /**
- * Initialization of the BLE App Context
- */
+ UTIL_SEQ_RegTask( 1<<CFG_TASK_LINK_CONFIG_ID, UTIL_SEQ_RFU, LinkConfiguration);
- DTContext.Connection_Status = DT_IDLE;
+ BleApplicationContext.DeviceServerFound = NO_DEVICE_FOUND;
/**
* Clear DataBase
*/
aci_gap_clear_security_db();
- DT_Client_App_Init();
-
- DT_Server_App_Init();
+ DTC_App_Init();
-#ifdef BLE_PERIPHERAL
+ DTS_App_Init();
+#if(CFG_BLE_PERIPHERAL != 0)
/* Start Advertise to be connected by P2P Client */
UTIL_SEQ_SetTask(1 << CFG_TASK_START_ADV_ID, CFG_SCH_PRIO_0);
-
#endif
-#ifdef BLE_CENTRAL
+#if(CFG_BLE_CENTRAL != 0)
/* Start Scan to connect to DT server */
UTIL_SEQ_SetTask(1<<CFG_TASK_START_SCAN_ID, CFG_SCH_PRIO_0);
#endif
@@ -378,7 +372,7 @@ uint8_t APP_BLE_ComputeCRC8( uint8_t *DataPtr , uint8_t Datalen )
void APP_BLE_Key_Button1_Action(void)
{
- DT_Server_App_Key_Button_Action();
+ DTS_App_KeyButtonAction();
}
void APP_BLE_Key_Button2_Action(void)
@@ -412,7 +406,7 @@ static void Ble_Hci_Gap_Gatt_Init(void){
uint16_t gap_service_handle, gap_dev_name_char_handle, gap_appearance_char_handle;
const uint8_t *bd_addr;
uint32_t srd_bd_addr[2];
- uint16_t appearance[1] = { CFG_GAP_APPEARANCE }; /* Generic Heart Rate Sensor */
+ uint16_t appearance[1] = { CFG_GAP_APPEARANCE };
/**
* Initialize HCI layer
@@ -442,13 +436,13 @@ static void Ble_Hci_Gap_Gatt_Init(void){
/**
* Write Identity root key used to derive LTK and CSRK
*/
- aci_hal_write_config_data( CONFIG_DATA_IR_OFFSET, CONFIG_DATA_IR_LEN, (uint8_t*)BLE_CFG_IR_VALUE );
-
- /**
+ aci_hal_write_config_data( CONFIG_DATA_IR_OFFSET, CONFIG_DATA_IR_LEN, (uint8_t*)BLE_CFG_IR_VALUE );
+
+ /**
* Write Encryption root key used to derive LTK and CSRK
*/
- aci_hal_write_config_data( CONFIG_DATA_ER_OFFSET, CONFIG_DATA_ER_LEN, (uint8_t*)BLE_CFG_ER_VALUE );
-
+ aci_hal_write_config_data( CONFIG_DATA_ER_OFFSET, CONFIG_DATA_ER_LEN, (uint8_t*)BLE_CFG_ER_VALUE );
+
/**
* Set TX Power to 0dBm.
*/
@@ -464,11 +458,11 @@ static void Ble_Hci_Gap_Gatt_Init(void){
*/
role = 0;
-#if (BLE_CFG_PERIPHERAL == 1)
+#if (CFG_BLE_PERIPHERAL != 0)
role |= GAP_PERIPHERAL_ROLE;
#endif
-#if (BLE_CFG_CENTRAL == 1)
+#if (CFG_BLE_CENTRAL != 0)
role |= GAP_CENTRAL_ROLE;
#endif
@@ -532,13 +526,62 @@ static void Ble_Hci_Gap_Gatt_Init(void){
/**
* Initialize whitelist
*/
- if (BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.bonding_mode)
- {
- aci_gap_configure_whitelist();
- }
+ if (BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.bonding_mode)
+ {
+ aci_gap_configure_whitelist();
+ }
+
+}
+
+static void LinkConfiguration(void)
+{
+ tBleStatus status;
+#if(CFG_BLE_CENTRAL != 0)
+ uint8_t tx_phy;
+ uint8_t rx_phy;
+#endif
+
+ /**
+ * The client will start ATT configuration after the link is fully configured
+ * Setup PHY
+ * Setup Data Length
+ * Setup Pairing
+ */
+#if(((CFG_TX_PHY == 2) | (CFG_RX_PHY == 2)) && (CFG_BLE_CENTRAL != 0))
+ GapProcReq(GAP_PROC_SET_PHY);
+#endif
+#if(CFG_BLE_CENTRAL != 0)
+ APP_DBG_MSG("Reading_PHY\n");
+ status = hci_le_read_phy(BleApplicationContext.BleApplicationContext_legacy.connectionHandle,&tx_phy,&rx_phy);
+ if (status != BLE_STATUS_SUCCESS)
+ {
+ APP_DBG_MSG("Read phy cmd failure: 0x%x \n", status);
+ }
+ else
+ {
+ APP_DBG_MSG("TX PHY = %d\n", tx_phy);
+ APP_DBG_MSG("RX PHY = %d\n", rx_phy);
+ }
+#endif
+
+ APP_DBG_MSG("set data length \n");
+ status = hci_le_set_data_length(BleApplicationContext.BleApplicationContext_legacy.connectionHandle,250,2112);
+ if (status != BLE_STATUS_SUCCESS)
+ {
+ APP_DBG_MSG("set data length command error \n");
+ }
+
+#if ((CFG_ENCRYPTION_ENABLE != 0) && (CFG_BLE_CENTRAL != 0))
+ GapProcReq(GAP_PROC_PAIRING);
+#endif
+
+ DTC_App_LinkReadyNotification(BleApplicationContext.BleApplicationContext_legacy.connectionHandle);
+
+ return;
}
+
SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
{
evt_le_meta_event * meta_evt;
@@ -547,27 +590,17 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
hci_le_phy_update_complete_event_rp0 *evt_le_phy_update_complete;
evt_blue_aci * blue_evt;
hci_event_pckt * event_pckt;
- Connection_Context_t Notification;
- uint16_t connection_handle;
uint8_t event_type, event_data_size;
int k = 0;
uint8_t adtype, adlength;
uint8_t *adv_report_data;
event_pckt = (hci_event_pckt*) ((hci_uart_pckt *) pckt)->data;
- hci_disconnection_complete_event_rp0 *cc = (void *) event_pckt->data;
switch (event_pckt->evt)
{
case EVT_DISCONN_COMPLETE:
-
- if (cc->Connection_Handle == DTContext.connection_handle)
- {
- DTContext.Connection_Status = DT_IDLE;
- APP_DBG_MSG("BLE_CTRL_App_Notification: EVT_DISCONN_COMPLETE disconnection\n");
- Notification.Evt_Opcode = DT_DISCONN_COMPLETE;
- DT_App_Notification(&Notification);
- }
+ APP_DBG_MSG("BLE_CTRL_App_Notification: EVT_DISCONN_COMPLETE disconnection\n");
break; /* EVT_DISCONN_COMPLETE */
case EVT_LE_META_EVENT:
@@ -577,42 +610,37 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
switch (meta_evt->subevent)
{
case EVT_LE_PHY_UPDATE_COMPLETE:
-
- APP_DBG_MSG("EVT_UPDATE_PHY_COMPLETE \n");
evt_le_phy_update_complete = (hci_le_phy_update_complete_event_rp0*)meta_evt->data;
if (evt_le_phy_update_complete->Status == 0)
{
- APP_DBG_MSG("EVT_UPDATE_PHY_COMPLETE, status ok \n");
- Notification.Evt_Opcode = DT_SET_PHY;
- DT_App_Notification(&Notification);
+ APP_DBG_MSG("EVT_UPDATE_PHY_COMPLETE, success \n");
}
else
{
- APP_DBG_MSG("EVT_UPDATE_PHY_COMPLETE, status nok \n");
+ APP_DBG_MSG("EVT_UPDATE_PHY_COMPLETE, failure %d \n", evt_le_phy_update_complete->Status);
}
+
+ UTIL_SEQ_SetEvt(1 << CFG_IDLEEVT_GAP_PROC_COMPLETE);
break;
+
case EVT_LE_CONN_COMPLETE:
- /**
- * The connection is done, there is no need anymore to schedule the LP ADV
- */
connection_complete_event = (hci_le_connection_complete_event_rp0 *) meta_evt->data;
- connection_handle = connection_complete_event->Connection_Handle;
-
- DTContext.connection_handle = connection_handle;
- Notification.Evt_Opcode = DT_CONNECTION_ESTABLISHED;
- Notification.connection_handle = connection_complete_event->Connection_Handle;
-#ifdef BLE_PERIPHERAL
+ BleApplicationContext.BleApplicationContext_legacy.connectionHandle = connection_complete_event->Connection_Handle;
+#if(CFG_BLE_PERIPHERAL != 0)
APP_DBG_MSG("BLE_CTRL_App_Notification: EVT_LE_CONN_COMPLETE connection as slave\n");
#endif
-#ifdef BLE_CENTRAL
+#if(CFG_BLE_CENTRAL != 0)
APP_DBG_MSG("BLE_CTRL_App_Notification: EVT_LE_CONN_COMPLETE connection as master\n");
- HW_TS_Stop(BleApplicationContext.Connection_mgr_timer_Id);
#endif
- DT_App_Notification(&Notification);
+ UTIL_SEQ_SetTask(1 << CFG_TASK_LINK_CONFIG_ID, CFG_SCH_PRIO_0);
break; /* HCI_EVT_LE_CONN_COMPLETE */
+ case EVT_LE_CONN_UPDATE_COMPLETE:
+ APP_DBG_MSG("BLE_CTRL_App_Notification: EVT_LE_CONN_UPDATE_COMPLETE \n");
+ break;
+
case EVT_LE_ADVERTISING_REPORT:
le_advertising_event = (hci_le_advertising_report_event_rp0 *) meta_evt->data;
@@ -620,29 +648,28 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
event_type = le_advertising_event->Advertising_Report[0].Event_Type;
event_data_size = le_advertising_event->Advertising_Report[0].Length_Data;
-
+
adv_report_data = (uint8_t*)(&le_advertising_event->Advertising_Report[0].Length_Data) + 1;
k = 0;
- /* search AD TYPE 0x09 (Complete Local Name) */
- /* search AD Type 0x02 (16 bits UUIDS) */
+ /* search AD TYPE AD_TYPE_COMPLETE_LOCAL_NAME (Complete Local Name) */
+ /* search AD Type AD_TYPE_16_BIT_SERV_UUID (16 bits UUIDS) */
if (event_type == ADV_IND)
{
-
/*ISOLATION OF BD ADDRESS AND LOCAL NAME*/
-
while(k < event_data_size)
{
adlength = adv_report_data[k];
adtype = adv_report_data[k + 1];
switch (adtype)
{
- case 0x01: /* now get flags */
+ case AD_TYPE_FLAGS: /* now get flags */
break;
- case 0x0A: /* Tx power level */
+ case AD_TYPE_TX_POWER_LEVEL: /* Tx power level */
break;
- case 0xFF: /* Manufacturer Specific */
+
+ case AD_TYPE_MANUFACTURER_SPECIFIC_DATA: /* Manufacturer Specific */
if (adlength >= 7 && adv_report_data[k + 2] == 0x01)
{ /* ST VERSION ID 01 */
APP_DBG_MSG("--- ST MANUFACTURER ID --- \n");
@@ -650,13 +677,16 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
{ /* Demo ID */
case CFG_DEV_ID_PERIPH_SERVER: /* (Periph Server DT) */
APP_DBG_MSG("-- SERVER DETECTED -- VIA MAN ID\n");
- DTContext.DeviceServerFound = 0x01;
+ BleApplicationContext.DeviceServerFound = AT_LEAST_ONE_DEVICE_FOUND;
SERVER_REMOTE_BDADDR[0] = le_advertising_event->Advertising_Report[0].Address[0];
SERVER_REMOTE_BDADDR[1] = le_advertising_event->Advertising_Report[0].Address[1];
SERVER_REMOTE_BDADDR[2] = le_advertising_event->Advertising_Report[0].Address[2];
SERVER_REMOTE_BDADDR[3] = le_advertising_event->Advertising_Report[0].Address[3];
SERVER_REMOTE_BDADDR[4] = le_advertising_event->Advertising_Report[0].Address[4];
SERVER_REMOTE_BDADDR[5] = le_advertising_event->Advertising_Report[0].Address[5];
+
+ /* The device has been found - scan may be stopped */
+ aci_gap_terminate_gap_proc(GAP_GENERAL_DISCOVERY_PROC);
break;
default:
@@ -664,11 +694,13 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
}
}
break;
- case 0x16: /* service data 16 bits */
+
+ case AD_TYPE_SERVICE_DATA: /* service data 16 bits */
break;
+
default:
break;
- } /* end switch data_RSSI[k+adlength] */
+ } /* end switch adtype */
k += adlength + 1;
} /* end while */
@@ -690,34 +722,45 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
{
aci_gap_proc_complete_event_rp0 *gap_evt_proc_complete = (void*) blue_evt->data;
/* CHECK GAP GENERAL DISCOVERY PROCEDURE COMPLETED & SUCCEED */
- if (gap_evt_proc_complete->Procedure_Code == GAP_GENERAL_DISCOVERY_PROC
- && gap_evt_proc_complete->Status == 0x00)
+ if (gap_evt_proc_complete->Procedure_Code == GAP_GENERAL_DISCOVERY_PROC)
{
- BSP_LED_Off(LED_BLUE);
- APP_DBG_MSG("-- GAP GENERAL DISCOVERY PROCEDURE_COMPLETED\n");
-
- /*if a device found, connect to it, device 1 being chosen first if both found*/
- if (DTContext.DeviceServerFound == 0x01 && DTContext.Connection_Status != DT_CONNECTED)
+ if( gap_evt_proc_complete->Status != BLE_STATUS_SUCCESS )
{
- UTIL_SEQ_SetTask(1 << CFG_TASK_CONN_DEV_1_ID, CFG_SCH_PRIO_0);
+ APP_DBG_MSG("-- GAP GENERAL DISCOVERY PROCEDURE FAILED\n");
+ }
+ else
+ {
+ BSP_LED_Off(LED_BLUE);
+
+ /*if a device found, connect to it, device 1 being chosen first if both found*/
+ if (BleApplicationContext.DeviceServerFound != NO_DEVICE_FOUND)
+ {
+ APP_DBG_MSG("-- GAP GENERAL DISCOVERY PROCEDURE COMPLETED\n");
+ UTIL_SEQ_SetTask(1 << CFG_TASK_CONN_DEV_1_ID, CFG_SCH_PRIO_0);
+ }
+ else
+ {
+ APP_DBG_MSG("-- GAP GENERAL DISCOVERY PROCEDURE COMPLETED WITH NO DEVICE FOUND\n");
+ }
}
}
}
break; /* EVT_BLUE_GAP_PROCEDURE_COMPLETE */
+
case EVT_BLUE_GAP_PAIRING_CMPLT:
- {
APP_DBG_MSG("Pairing complete \n");
- Notification.Evt_Opcode = DT_PAIRING_COMPLETE;
- DT_App_Notification(&Notification);
- }
- break;
+ UTIL_SEQ_SetEvt(1 << CFG_IDLEEVT_GAP_PROC_COMPLETE);
+ break;
+
case EVT_BLUE_GAP_PASS_KEY_REQUEST:
- {
- APP_DBG_MSG("passkey request\n");
- Notification.Evt_Opcode = DT_PASSKEY_REQ_EVT;
- DT_App_Notification(&Notification);
- }
+ APP_DBG_MSG("respond to the passkey request\n");
+ aci_gap_pass_key_resp(BleApplicationContext.BleApplicationContext_legacy.connectionHandle, 0x00001234);
break;
+
+ case EVT_BLUE_GATT_TX_POOL_AVAILABLE:
+ DTS_App_TxPoolAvailableNotification();
+ break;
+
default:
break;
}
@@ -769,6 +812,139 @@ const uint8_t* BleGetBdAddress( void )
return bd_addr;
}
+#if (CFG_BLE_CENTRAL != 0)
+static void GapProcReq(GapProcId_t GapProcId)
+{
+ tBleStatus status;
+
+ switch(GapProcId)
+ {
+ case GAP_PROC_PAIRING:
+ APP_DBG_MSG("sending pairing req \n");
+
+ status = aci_gap_send_pairing_req(BleApplicationContext.BleApplicationContext_legacy.connectionHandle, FORCE_REBOND);
+ if (status != BLE_STATUS_SUCCESS)
+ {
+ APP_DBG_MSG("pairing cmd failure: 0x%x\n", status);
+ }
+ UTIL_SEQ_WaitEvt(1 << CFG_IDLEEVT_GAP_PROC_COMPLETE);
+
+ APP_DBG_MSG("GAP_PROC_PAIRING complete event received\n");
+ break;
+
+ case GAP_PROC_SET_PHY:
+ APP_DBG_MSG("sending Set Phy req \n");
+
+ status = hci_le_set_phy(BleApplicationContext.BleApplicationContext_legacy.connectionHandle,CFG_ALL_PHYS,CFG_TX_PHY,CFG_RX_PHY,0);
+ if (status != BLE_STATUS_SUCCESS)
+ {
+ APP_DBG_MSG("Set Phy cmd failure: 0x%x\n", status);
+ }
+ UTIL_SEQ_WaitEvt(1 << CFG_IDLEEVT_GAP_PROC_COMPLETE);
+
+ APP_DBG_MSG("GAP_PROC_SET_PHY complete event received\n");
+ break;
+
+ default:
+ break;
+ }
+ return;
+}
+
+static void Scan_Request( void )
+{
+ tBleStatus result;
+
+ BSP_LED_On(LED_BLUE);
+ result = aci_gap_start_general_discovery_proc(SCAN_P, SCAN_L, PUBLIC_ADDR, 1);
+ if (result == BLE_STATUS_SUCCESS)
+ {
+ APP_DBG_MSG(" \r\n\r** START GENERAL DISCOVERY (SCAN) ** \r\n\r");
+ }
+ else
+ {
+ APP_DBG_MSG("-- BLE_App_Start_Limited_Disc_Req, Failed \r\n\r");
+ BSP_LED_On(LED_RED);
+ }
+
+ return;
+}
+
+static void Connect_Request( void )
+{
+ tBleStatus result;
+ APP_DBG_MSG("\r\n\r** CREATE CONNECTION TO SERVER ** \r\n\r");
+
+ result = aci_gap_create_connection(SCAN_P,
+ SCAN_L,
+ PUBLIC_ADDR, SERVER_REMOTE_BDADDR,
+ PUBLIC_ADDR,
+ CONN_P1_7_5, //CONN_P1_400,
+ CONN_P2_7_5, //CONN_P2_400,
+ 0, 0x3e8, 0x0000, 0x3E8);
+
+ if (result != BLE_STATUS_SUCCESS)
+ {
+ BSP_LED_On(LED_RED);
+ }
+
+ return;
+}
+
+static void Connection_Update( void )
+{
+ tBleStatus result;
+ APP_DBG_MSG("\r\n\r** CONNECTION UPDATE ** \r\n\r");
+
+ result = aci_gap_start_connection_update(BleApplicationContext.BleApplicationContext_legacy.connectionHandle,
+ CONN_P1_400,
+ CONN_P2_400,
+ 0, 0x3e8, 0x0000, 0x3E8);
+
+ if (result != BLE_STATUS_SUCCESS)
+ {
+ BSP_LED_On(LED_RED);
+ }
+}
+#endif
+
+#if (CFG_BLE_PERIPHERAL != 0)
+void Adv_Request( void )
+{
+ tBleStatus result;
+
+ result = aci_gap_set_discoverable(ADV_IND,
+ FAST_CONN_ADV_INTERVAL_MIN,
+ FAST_CONN_ADV_INTERVAL_MAX,
+ PUBLIC_ADDR,
+ NO_WHITE_LIST_USE, /* use white list */
+ sizeof(local_name), (uint8_t*) local_name, 0,
+ NULL,
+ 6, 8);
+ if (result == BLE_STATUS_SUCCESS)
+ {
+ APP_DBG_MSG(" \r\n\r");APP_DBG_MSG("** START ADVERTISING ** \r\n\r");
+ }
+ else
+ {
+ APP_DBG_MSG("** START ADVERTISING ** Failed \r\n\r");
+ }
+
+ /* Send Advertising data */
+ result = aci_gap_update_adv_data(22, (uint8_t*) manuf_data);
+
+ if (result == BLE_STATUS_SUCCESS)
+ {
+ APP_DBG_MSG(" \r\n\r");APP_DBG_MSG("** add ADV data ** \r\n\r");
+ }
+ else
+ {
+ APP_DBG_MSG("** add ADV data ** Failed \r\n\r");
+ }
+ return;
+}
+#endif
+
/*************************************************************
*
* WRAP FUNCTIONS
@@ -797,7 +973,7 @@ static void BLE_UserEvtRx( void * pPayload )
SVCCTL_UserEvtFlowStatus_t svctl_return_status;
tHCI_UserEvtRxParam *pParam;
- pParam = (tHCI_UserEvtRxParam *)pPayload;
+ pParam = (tHCI_UserEvtRxParam *)pPayload;
svctl_return_status = SVCCTL_UserEvtRx((void *)&(pParam->pckt->evtserial));
if (svctl_return_status != SVCCTL_UserEvtFlowDisable)
@@ -847,217 +1023,9 @@ void SVCCTL_ResumeUserEventFlow( void )
return;
}
-void DT_App_Notification( Connection_Context_t *pNotification )
-{
- uint8_t TX_PHY;
- uint8_t RX_PHY;
-#if defined(PHY_2M)
- Connection_Context_t Notification;
-#endif
- uint8_t status;
-
- switch (pNotification->Evt_Opcode)
- {
- case DT_CONNECTION_ESTABLISHED:
- DTContext.connection_handle = pNotification->connection_handle;
-
-#if (defined (ENCRYPTION_ON) && defined (BLE_CENTRAL))
- aci_gap_send_pairing_req(DTContext.connection_handle, FORCE_REBOND);
- APP_DBG_MSG("send pairing req \n");
-#elif BLE_CENTRAL
- aci_gatt_exchange_config(DTContext.connection_handle);
-#endif
- break;
-
- case DT_PAIRING_COMPLETE:
-#ifdef BLE_CENTRAL
- aci_gatt_exchange_config(DTContext.connection_handle);
-#endif
- break;
-
- case DT_MTU_EXCHANGED:
-#if defined(PHY_2M)
- Notification.Evt_Opcode = DT_READ_PHY;
- DT_App_Notification(&Notification);
-#else
-
- status = hci_le_set_data_length(DTContext.connection_handle,250,2112);
- if (status == 0)
- {
- APP_DBG_MSG("set data length ok \n");
- /* discover primary service */
- aci_gatt_disc_all_primary_services(DTContext.connection_handle);
- }
-
-#endif
- break;
-
- case DT_READ_PHY:
- status = hci_le_read_phy(DTContext.connection_handle,&TX_PHY,&RX_PHY);
- if (status == 0)
- {
- APP_DBG_MSG("Read_PHY success \n");
- if ((TX_PHY == TX_1M) && (RX_PHY == RX_1M))
- {
- APP_DBG_MSG("Original config is 1M, correct \n");
- }
- else
- {
- APP_DBG_MSG("Original config not correct TX= %x, RX= %x \n", TX_PHY, RX_PHY);
- }
-#ifdef BLE_CENTRAL
- status = hci_le_set_phy(DTContext.connection_handle,ALL_PHYS_PREFERENCE,TX_2M_PREFERRED,RX_2M_PREFERRED,0);
- if (status == 0)
- {
- APP_DBG_MSG("set PHY cmd ok\n");
- }
- else
- {
- APP_DBG_MSG("set PHY cmd NOK\n");
- }
-#endif
- }
- else
- {
- APP_DBG_MSG("Read config error \n");
- }
- break;
-
- case DT_SET_PHY:
- APP_DBG_MSG("Set_PHY success \n");
- status = hci_le_read_phy(DTContext.connection_handle,&TX_PHY,&RX_PHY);
- if (status == 0)
- {
- APP_DBG_MSG("Read_PHY success \n");
- if ((TX_PHY == TX_2M) && (RX_PHY == RX_2M))
- {
- APP_DBG_MSG("Reconf param is 2M, correct \n");
- status = hci_le_set_data_length(DTContext.connection_handle,250,2112);
- if (status == 0)
- {
- APP_DBG_MSG("set data length ok \n");
- aci_gatt_disc_all_primary_services(DTContext.connection_handle);
- }
- }
- else
- {
- APP_DBG_MSG("Reconf param not correct TX= %d, RX= %d \n", TX_PHY, RX_PHY);
- }
- }
- else
- {
- APP_DBG_MSG("Read conf not succeess \n");
- }
- break;
-
- case DT_PASSKEY_REQ_EVT:
- APP_DBG_MSG("Passkey response \n");
- aci_gap_pass_key_resp(DTContext.connection_handle, 0x00001234);
- break;
-
- case DT_DISCONN_COMPLETE:
- APP_DBG_MSG("Disconnection \n");
- break;
-
- default:
- break;
-
- }
- return;
-}/* end BLE_SVC_TimeServer_App_Notification() */
-
-void Delay_PairingReq( void )
-{
- aci_gap_send_pairing_req(DTContext.connection_handle, FORCE_REBOND);
- APP_DBG_MSG("send pairing req \n");
-}
-
-void Scan_Request( void )
-{
- tBleStatus result;
- if (DTContext.Connection_Status != DT_CONNECTED)
- {
- BSP_LED_On(LED_BLUE);
- result = aci_gap_start_general_discovery_proc(SCAN_P, SCAN_L, PUBLIC_ADDR, 1);
- if (result == BLE_STATUS_SUCCESS)
- {
- APP_DBG_MSG(" \r\n\r** START GENERAL DISCOVERY (SCAN) ** \r\n\r");
- }
- else
- {
- APP_DBG_MSG("-- BLE_App_Start_Limited_Disc_Req, Failed \r\n\r");
- BSP_LED_On(LED_RED);
- }
- }
- return;
-}
-
-void Connect_Request( void )
+void SVCCTL_InitCustomSvc( void )
{
- tBleStatus result;
- APP_DBG_MSG("\r\n\r** CREATE CONNECTION TO SERVER ** \r\n\r");
-
- if (DTContext.Connection_Status != DT_CONNECTED)
- {
- result = aci_gap_create_connection(SCAN_P,
- SCAN_L,
- PUBLIC_ADDR, SERVER_REMOTE_BDADDR,
- PUBLIC_ADDR,
- CONN_P1_400,
- CONN_P2_400,
- 0, 0x3e8, 0x0000, 0x3E8);
-
- if (result == BLE_STATUS_SUCCESS)
- {
- DTContext.Connection_Status = DT_CONNECTING;
-
- }
- else
- {
- BSP_LED_On(LED_RED);
- DTContext.Connection_Status = DT_IDLE;
-
- }
- }
-
- return;
+ DTS_STM_Init();
}
-void Adv_Request( void )
-{
- if (DTContext.Connection_Status != DT_CONNECTED)
- {
- tBleStatus result = 0x00;
-
- result = aci_gap_set_discoverable(ADV_IND,
- FAST_CONN_ADV_INTERVAL_MIN,
- FAST_CONN_ADV_INTERVAL_MAX,
- PUBLIC_ADDR,
- NO_WHITE_LIST_USE, /* use white list */
- sizeof(local_name), (uint8_t*) local_name, 0,
- NULL,
- 6, 8);
- if (result == BLE_STATUS_SUCCESS)
- {
- APP_DBG_MSG(" \r\n\r");APP_DBG_MSG("** START ADVERTISING ** \r\n\r");
- }
- else
- {
- APP_DBG_MSG("** START ADVERTISING ** Failed \r\n\r");
- }
-
- /* Send Advertising data */
- result = aci_gap_update_adv_data(22, (uint8_t*) manuf_data);
- DTContext.Connection_Status = DT_ADV;
- if (result == BLE_STATUS_SUCCESS)
- {
- APP_DBG_MSG(" \r\n\r");APP_DBG_MSG("** add ADV data ** \r\n\r");
- }
- else
- {
- APP_DBG_MSG("** add ADV data ** Failed \r\n\r");
- }
- }
- return;
-}
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/app_ble.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/app_ble.h
index 487596573..042d7860b 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/app_ble.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/app_ble.h
@@ -30,17 +30,6 @@ extern "C" {
#include "hci_tl.h"
/* Exported types ------------------------------------------------------------*/
-typedef enum
-{
- APP_BLE_Limited,
- APP_BLE_Full,
-} APP_BLE_InitMode_t;
-
-typedef struct
-{
-uint8_t StopData_Id;
-} DTTimer_t;
-
/* Exported constants --------------------------------------------------------*/
/* External variables --------------------------------------------------------*/
/* Exported macros -----------------------------------------------------------*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/ble_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/ble_conf.h
index 1666affdb..058f570cf 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/ble_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/ble_conf.h
@@ -30,23 +30,6 @@
* blesvc
*
******************************************************************************/
-
-/**
- * This setting shall be set to '1' if the device needs to support the Peripheral Role
- * In the MS configuration, both BLE_CFG_PERIPHERAL and BLE_CFG_CENTRAL shall be set to '1'
- */
-#ifdef BLE_PERIPHERAL
-#define BLE_CFG_PERIPHERAL 1
-#define BLE_CFG_CENTRAL 0
-#endif
-/**
- * This setting shall be set to '1' if the device needs to support the Central Role
- * In the MS configuration, both BLE_CFG_PERIPHERAL and BLE_CFG_CENTRAL shall be set to '1'
- */
-#ifdef BLE_CENTRAL
-#define BLE_CFG_CENTRAL 1
-#define BLE_CFG_PERIPHERAL 0
-#endif
/**
* There is one handler per service enabled
* Note: There is no handler for the Device Information Service
@@ -54,7 +37,7 @@
* This shall take into account all registered handlers
* (from either the provided services or the custom services)
*/
-#define BLE_CFG_SVC_MAX_NBR_CB 5
+#define BLE_CFG_SVC_MAX_NBR_CB 7
#define BLE_CFG_CLT_MAX_NBR_CB 3
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/ble_dbg_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/ble_dbg_conf.h
index 6d72ba832..35659ec4d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/ble_dbg_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/ble_dbg_conf.h
@@ -50,6 +50,7 @@
#define BLE_DBG_LNS_EN 0
#define BLE_DBG_SCPS_EN 0
#define BLE_DBG_P2P_STM_EN 0
+#define BLE_DBG_CRS_STM_EN 0
/**
@@ -201,6 +202,12 @@
#define BLE_DBG_DTS_BUF PRINT_NO_MESG
#endif
+#if ( BLE_DBG_CRS_STM_EN != 0 )
+#define BLE_DBG_CRS_STM_MSG PRINT_MESG_DBG
+#else
+#define BLE_DBG_CRS_STM_MSG PRINT_NO_MESG
+#endif
+
#endif /*__BLE_DBG_CONF_H */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/dt_client_app.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/dt_client_app.c
index 8e01653c2..7fd2c12b1 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/dt_client_app.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/dt_client_app.c
@@ -33,66 +33,86 @@
/* Private defines -----------------------------------------------------------*/
#define UNPACK_2_BYTE_PARAMETER(ptr) \
- (uint16_t)((uint16_t)(*((uint8_t *)ptr))) | \
- (uint16_t)((((uint16_t)(*((uint8_t *)ptr + 1))) << 8))
+ (uint16_t)((uint16_t)(*((uint8_t *)ptr))) | \
+ (uint16_t)((((uint16_t)(*((uint8_t *)ptr + 1))) << 8))
#define DEFAULT_TS_MEASUREMENT_INTERVAL (1000000/CFG_TS_TICK_VAL) /**< 1s */
#define TIMEUNIT 1
#define DATA_THROUGHPUT_MEASUREMENT (TIMEUNIT*DEFAULT_TS_MEASUREMENT_INTERVAL)
/* Private typedef -----------------------------------------------------------*/
-extern DT_ClientContext_t aDTClientContext[BLE_CFG_CLT_MAX_NBR_CB];
+typedef enum
+{
+ GATT_PROC_MTU_UPDATE,
+ GATT_PROC_DISC_ALL_PRIMARY_SERVICES,
+ GATT_PROC_DISC_ALL_CHAR_OF_DT_SERVICE,
+ GATT_PROC_DISC_TX_CHAR_DESC,
+} GattProcId_t;
+
+typedef struct
+{
+ /**
+ * connection handle
+ */
+ uint16_t connHandle;
+
+ /**
+ * handle of the Data Transfer service
+ */
+ uint16_t DataTransferServiceHandle;
+
+ /**
+ * end handle of the Data Transfer service
+ */
+ uint16_t DataTransferServiceEndHandle;
+
+ /**
+ * handle of the Tx characteristic
+ *
+ */
+ uint16_t DataTransferTxCharHdle;
+
+ /**
+ * handle of the client configuration
+ * descriptor of Tx characteristic
+ */
+ uint16_t DataTransferTxDescHandle;
+
+} DataTransferContext_t;
+
/* Private macros ------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
-DataTransferContext_t aDataTransferClientContext[MAX_CONNECTION];
+DataTransferContext_t DataTransferClientContext;
static uint16_t packet_lost;
static uint32_t DataThroughputValue;
+static uint32_t packet_lost_local;
static uint32_t TotalDataReceived = 0;
static uint32_t Nbr_packet = 0;
static DTS_STM_App_Notification_evt_t NotificationData;
static uint8_t TimerDataThroughput_Id;
uint32_t N=0;
+uint32_t DataTransfered = 0;
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
-static void DTC_App_Update_Service( void );
-static void DTC_App_Notification( DTS_STM_App_Notification_evt_t *pNotification );
-static SVCCTL_EvtAckStatus_t DataTransfer_Client_Event_Handler( void *Event );
+static SVCCTL_EvtAckStatus_t DTC_Event_Handler( void *Event );
static void DataThroughputTimer( void );
static void DataThroughput_Calculation(void);
+static void GattProcReq(GattProcId_t GattProcId);
/* Functions Definition ------------------------------------------------------*/
-/* Private functions ----------------------------------------------------------*/
-void BLE_APP_Disconnection( uint16_t conn_handle , uint8_t reason );
-void disable_notification(void);
-
-/* Public functions ----------------------------------------------------------*/
-
-/****************************************************************/
-/* */
-/* GATT CLIENT PART */
-/****************************************************************/
-/**
- * @brief Event handler
- * @param Event: Address of the buffer holding the Event
- * @retval Ack: Return whether the Event has been managed or not
- */
-void DT_Client_App_Init( void )
+/*************************************************************
+ *
+ * PUBLIC FUNCTIONS
+ *
+ *************************************************************/
+void DTC_App_Init( void )
{
- if (BUTTON_SERVER == 0)
- {
- uint8_t index = 0;
- for (index = 0; index < BLE_CFG_CLT_MAX_NBR_CB; index++)
- aDTClientContext[index].state = DT_IDLE;
- }
-
- SVCCTL_RegisterCltHandler(DataTransfer_Client_Event_Handler);
+ SVCCTL_RegisterCltHandler(DTC_Event_Handler);
- UTIL_SEQ_RegTask( 1<<CFG_IdleTask_DataTransfer_ClientDiscovery, UTIL_SEQ_RFU, DTC_App_Update_Service);
UTIL_SEQ_RegTask( 1<< CFG_TASK_APP_DATA_THROUGHPUT_ID, UTIL_SEQ_RFU, DataThroughput_Calculation);
- aDataTransferClientContext[0].state = DTC_IDLE;
- aDataTransferClientContext[0].connHandle = 0xFFFF;
+ DataTransferClientContext.connHandle = 0xFFFF;
/* Create timer for Data Throughput */
HW_TS_Create(CFG_TIM_PROC_ID_ISR, &(TimerDataThroughput_Id), hw_ts_SingleShot, DataThroughputTimer);
@@ -101,15 +121,51 @@ void DT_Client_App_Init( void )
return;
}
-static SVCCTL_EvtAckStatus_t DataTransfer_Client_Event_Handler( void *Event )
+void DTC_App_LinkReadyNotification(uint16_t ConnectionHandle)
+{
+ tBleStatus status;
+ uint16_t enable_notification = 0x0001;
+
+ DataTransferClientContext.connHandle = ConnectionHandle;
+
+#if(CFG_BLE_CENTRAL != 0)
+ GattProcReq(GATT_PROC_MTU_UPDATE);
+#endif
+ GattProcReq(GATT_PROC_DISC_ALL_PRIMARY_SERVICES);
+ GattProcReq(GATT_PROC_DISC_ALL_CHAR_OF_DT_SERVICE);
+ GattProcReq(GATT_PROC_DISC_TX_CHAR_DESC);
+
+ /**
+ * Enable notification on the remote server
+ */
+ APP_DBG_MSG("Enable notification on the remote server\n");
+
+ status = aci_gatt_write_char_desc(
+ DataTransferClientContext.connHandle,
+ DataTransferClientContext.DataTransferTxDescHandle,
+ 2,
+ (uint8_t *) &enable_notification);
+ if (status != BLE_STATUS_SUCCESS)
+ {
+ APP_DBG_MSG("Enable notification cmd failure: 0x%x\n", status);
+ }
+#if(CFG_BLE_CENTRAL != 0)
+ UTIL_SEQ_SetTask(1<<CFG_TASK_CONN_UPDATE_ID, CFG_SCH_PRIO_0);
+#endif
+ return;
+}
+
+/*************************************************************
+ *
+ * CALLBACK FUNCTIONS
+ *
+ *************************************************************/
+static SVCCTL_EvtAckStatus_t DTC_Event_Handler( void *Event )
{
SVCCTL_EvtAckStatus_t return_value;
hci_event_pckt * event_pckt;
evt_blue_aci * blue_evt;
-#if ( CFG_DEBUG_APP_TRACE != 0)
aci_att_exchange_mtu_resp_event_rp0 * exchange_mtu_resp;
-#endif
- Connection_Context_t Notification;
uint8_t CRC_Result;
uint8_t CRC_Received;
@@ -125,47 +181,36 @@ static SVCCTL_EvtAckStatus_t DataTransfer_Client_Event_Handler( void *Event )
{
case EVT_BLUE_ATT_EXCHANGE_MTU_RESP:
APP_DBG_MSG("EVT_BLUE_ATT_EXCHANGE_MTU_RESP \n");
-#if ( CFG_DEBUG_APP_TRACE != 0)
exchange_mtu_resp = (aci_att_exchange_mtu_resp_event_rp0 *)blue_evt->data;
-#endif
APP_DBG_MSG("MTU_size = %d \n",exchange_mtu_resp->Server_RX_MTU );
- Notification.Evt_Opcode = DT_MTU_EXCHANGED;
- DT_App_Notification(&Notification);
+ APP_DBG_MSG("MTU_handle = 0x%x \n",exchange_mtu_resp->Connection_Handle );
break;
-
+
case EVT_BLUE_ATT_READ_BY_GROUP_TYPE_RESP:
{
aci_att_read_by_group_type_resp_event_rp0 *pr = (void*) blue_evt->data;
uint8_t numServ, i, idx;
uint16_t uuid, handle;
- uint8_t index;
handle = pr->Connection_Handle;
- index = 0;
- while((index < MAX_CONNECTION) && (aDataTransferClientContext[index].state != DTC_IDLE))
- {
- index++;
- }
- if (index < MAX_CONNECTION)
- {
- APP_DBG_MSG("DataTransfer_Client_Event_Handler: EVT_BLUE_ATT_READ_BY_GROUP_TYPE_RESP\n");
+ APP_DBG_MSG("DTC_Event_Handler: EVT_BLUE_ATT_READ_BY_GROUP_TYPE_RESP\n");
- aDataTransferClientContext[index].connHandle = handle;
+ DataTransferClientContext.connHandle = handle;
- numServ = (pr->Data_Length) / pr->Attribute_Data_Length;
+ numServ = (pr->Data_Length) / pr->Attribute_Data_Length;
- /* the event data will be
- * 2bytes start handle
- * 2bytes end handle
- * 2 or 16 bytes data
- * we are intersted only if the UUID is 16 bit.
- * So check if the data length is 6
- */
+ /* the event data will be
+ * 2bytes start handle
+ * 2bytes end handle
+ * 2 or 16 bytes data
+ * we are interested only if the UUID is 16 bit.
+ * So check if the data length is 6
+ */
#if (UUID_128BIT_FORMAT==1)
- if (pr->Attribute_Data_Length == 20)
- {
- idx = 16;
+ if (pr->Attribute_Data_Length == 20)
+ {
+ idx = 16;
#else
if (pr->Attribute_Data_Length == 6)
{
@@ -177,514 +222,259 @@ static SVCCTL_EvtAckStatus_t DataTransfer_Client_Event_Handler( void *Event )
if (uuid == DATA_TRANSFER_SERVICE_UUID)
{
#if (UUID_128BIT_FORMAT==1)
- aDataTransferClientContext[index].DataTransferServiceHandle = UNPACK_2_BYTE_PARAMETER(&pr->Attribute_Data_List[idx-16]);
- aDataTransferClientContext[index].DataTransferServiceEndHandle = UNPACK_2_BYTE_PARAMETER (&pr->Attribute_Data_List[idx-14]);
+ DataTransferClientContext.DataTransferServiceHandle = UNPACK_2_BYTE_PARAMETER(&pr->Attribute_Data_List[idx-16]);
+ DataTransferClientContext.DataTransferServiceEndHandle = UNPACK_2_BYTE_PARAMETER (&pr->Attribute_Data_List[idx-14]);
#else
- aDataTransferClientContext[index].DataTransferServiceHandle =
+ DataTransferClientContext.DataTransferServiceHandle =
UNPACK_2_BYTE_PARAMETER(&pr->Attribute_Data_List[idx - 4]);
- aDataTransferClientContext[index].DataTransferServiceEndHandle =
+ DataTransferClientContext.DataTransferServiceEndHandle =
UNPACK_2_BYTE_PARAMETER(&pr->Attribute_Data_List[idx - 2]);
#endif
- aDataTransferClientContext[index].state = DTC_DISCOVER_CHARACS;
- APP_DBG_MSG("DataTransfer_Client_Event_Handler: DATA_TRANSFER_SERVICE_UUID found !\n");
+ APP_DBG_MSG("DTC_Event_Handler: DATA_TRANSFER_SERVICE_UUID found !\n");
}
idx += 6;
}
}
}
- else
- {
- APP_DBG_MSG("DataTransfer_Client_Event_Handler: EVT_BLUE_ATT_READ_BY_GROUP_TYPE_RESP, failed no free index in connection table !\n");
- }
- }
break;
+
case EVT_BLUE_ATT_READ_BY_TYPE_RESP:
{
aci_att_read_by_type_resp_event_rp0 *pr = (void*) blue_evt->data;
uint8_t idx;
uint16_t uuid, handle;
- uint8_t index;
- index = 0;
- while((index < MAX_CONNECTION) && (aDataTransferClientContext[index].connHandle != pr->Connection_Handle))
- index++;
+ APP_DBG_MSG("DTC_Event_Handler: EVT_BLUE_ATT_READ_BY_TYPE_RESP\n");
- if (index < MAX_CONNECTION)
- {
- APP_DBG_MSG("DataTransfer_Client_Event_Handler: EVT_BLUE_ATT_READ_BY_TYPE_RESP\n");
-
- /* the event data will be
- * 2 bytes start handle
- * 1 byte char properties
- * 2 bytes handle
- * 2 or 16 bytes data
- */
+ /* the event data will be
+ * 2 bytes start handle
+ * 1 byte char properties
+ * 2 bytes handle
+ * 2 or 16 bytes data
+ */
#if (UUID_128BIT_FORMAT==1)
- idx = 17;
- if (pr->Handle_Value_Pair_Length == 21)
+ idx = 17;
+ if (pr->Handle_Value_Pair_Length == 21)
#else
idx = 5;
- /* we are interested in only 16 bit UUIDs */
- if (pr->Handle_Value_Pair_Length == 7)
+ /* we are interested in only 16 bit UUIDs */
+ if (pr->Handle_Value_Pair_Length == 7)
#endif
+ {
+ pr->Data_Length -= 1;
+ while(pr->Data_Length > 0)
{
- pr->Data_Length -= 1;
- while(pr->Data_Length > 0)
- {
- uuid = UNPACK_2_BYTE_PARAMETER(&pr->Handle_Value_Pair_Data[idx]);
- /* store the characteristic handle not the attribute handle */
+ uuid = UNPACK_2_BYTE_PARAMETER(&pr->Handle_Value_Pair_Data[idx]);
+ /* store the characteristic handle not the attribute handle */
#if (UUID_128BIT_FORMAT==1)
- handle = UNPACK_2_BYTE_PARAMETER(&pr->Handle_Value_Pair_Data[idx-14]);
+ handle = UNPACK_2_BYTE_PARAMETER(&pr->Handle_Value_Pair_Data[idx-14]);
#else
- handle = UNPACK_2_BYTE_PARAMETER(&pr->Handle_Value_Pair_Data[idx - 2]);
+ handle = UNPACK_2_BYTE_PARAMETER(&pr->Handle_Value_Pair_Data[idx - 2]);
#endif
- if (uuid == DATA_TRANSFER_TX_CHAR_UUID)
- {
- aDataTransferClientContext[index].state = DTC_DISCOVER_TX_CHAR_DESC;
- aDataTransferClientContext[index].DataTransferTxCharHdle = handle;
- }
+ if (uuid == DATA_TRANSFER_TX_CHAR_UUID)
+ {
+ DataTransferClientContext.DataTransferTxCharHdle = handle;
+ }
#if (UUID_128BIT_FORMAT==1)
- pr->Data_Length -= 21;
- idx += 21;
+ pr->Data_Length -= 21;
+ idx += 21;
#else
- pr->Data_Length -= 7;
- idx += 7;
+ pr->Data_Length -= 7;
+ idx += 7;
#endif
- }
}
}
- else
- APP_DBG_MSG("DataTransfer_Client_Event_Handler: EVT_BLUE_ATT_READ_BY_TYPE_RESP, failed handle not found in connection table !\n");
}
- break;
+ break;
case EVT_BLUE_ATT_FIND_INFORMATION_RESP:
{
aci_att_find_info_resp_event_rp0 *pr = (void*) blue_evt->data;
uint8_t numDesc, idx, i;
uint16_t uuid, handle;
- uint8_t index;
- index = 0;
- while((index < MAX_CONNECTION) && (aDataTransferClientContext[index].connHandle != pr->Connection_Handle))
- index++;
-
- if (index < MAX_CONNECTION)
+ /*
+ * event data will be of the format
+ * 2 bytes handle
+ * 2 bytes UUID
+ */
+ numDesc = (pr->Event_Data_Length) / 4;
+ /* we are interested only in 16 bit UUIDs */
+ idx = 0;
+ if (pr->Format == UUID_TYPE_16)
{
- /*
- * event data will be of the format
- * 2 bytes handle
- * 2 bytes UUID
- */
- numDesc = (pr->Event_Data_Length) / 4;
- /* we are interested only in 16 bit UUIDs */
- idx = 0;
- if (pr->Format == UUID_TYPE_16)
+ for (i = 0; i < numDesc; i++)
{
- for (i = 0; i < numDesc; i++)
- {
- handle = UNPACK_2_BYTE_PARAMETER(&pr->Handle_UUID_Pair[idx]);
- uuid = UNPACK_2_BYTE_PARAMETER(&pr->Handle_UUID_Pair[idx + 2]);
+ handle = UNPACK_2_BYTE_PARAMETER(&pr->Handle_UUID_Pair[idx]);
+ uuid = UNPACK_2_BYTE_PARAMETER(&pr->Handle_UUID_Pair[idx + 2]);
- if (uuid == CLIENT_CHAR_CONFIG_DESCRIPTOR_UUID)
- {
- if (aDataTransferClientContext[index].state == DTC_DISCOVER_TX_CHAR_DESC)
- {
- APP_DBG_MSG("DataTransfer_Client_Event_Handler: DTC_DISCOVER_TX_CHAR_DESC ready to enable notification\n");
- aDataTransferClientContext[index].DataTransferTxDescHandle = handle;
- if (BUTTON_SERVER)
- {
- aDataTransferClientContext[index].state = DTC_ENABLE_NOTIFICATION_TX_DESC;
- }
- else
- {
- aDataTransferClientContext[index].state = DTC_CONNECTED;
- }
- }
- }
- idx += 4;
+ if (uuid == CLIENT_CHAR_CONFIG_DESCRIPTOR_UUID)
+ {
+ APP_DBG_MSG("DTC_Event_Handler: DTC_DISCOVER_TX_CHAR_DESC ready to enable notification\n");
+ DataTransferClientContext.DataTransferTxDescHandle = handle;
}
+ idx += 4;
}
}
- else
- APP_DBG_MSG("DataTransfer_Client_Event_Handler: EVT_BLUE_ATT_FIND_INFORMATION_RESP, failed handle not found in connection table !\n");
}
- break; /*EVT_BLUE_ATT_FIND_INFORMATION_RESP*/
+ break; /*EVT_BLUE_ATT_FIND_INFORMATION_RESP*/
case EVT_BLUE_GATT_NOTIFICATION:
{
aci_gatt_notification_event_rp0 *pr = (void*) blue_evt->data;
- uint8_t index;
-
- index = 0;
- while((index < MAX_CONNECTION) && (aDataTransferClientContext[index].connHandle != pr->Connection_Handle))
- index++;
-
- if (index < MAX_CONNECTION)
+ if ((pr->Attribute_Handle == DataTransferClientContext.DataTransferTxCharHdle)
+ && (pr->Attribute_Value_Length > (2)))
{
- if ((pr->Attribute_Handle == aDataTransferClientContext[index].DataTransferTxCharHdle)
- && (pr->Attribute_Value_Length > (2)))
+ NotificationData.DataTransfered.Length = pr->Attribute_Value_Length;
+ NotificationData.DataTransfered.pPayload = pr->Attribute_Value;
+ NotificationData.DataTransfered.pPayload_n = *((uint32_t*) &(pr->Attribute_Value[0]));
+ __disable_irq();
+ if (NotificationData.DataTransfered.pPayload_n >= (NotificationData.DataTransfered.pPayload_n_1 + 2))
{
- NotificationData.Evt_Opcode = DTS_STM_DATA_RECEIVED;
- NotificationData.DataTransfered.Length = pr->Attribute_Value_Length;
- NotificationData.DataTransfered.pPayload = (uint32_t*) (&(pr->Attribute_Value[0]));
- NotificationData.DataTransfered.pPayload_n = *((uint32_t*) &(pr->Attribute_Value[0]));
- __disable_irq();
- if (NotificationData.DataTransfered.pPayload_n >= (NotificationData.DataTransfered.pPayload_n_1 + 2))
- {
packet_lost +=
((NotificationData.DataTransfered.pPayload_n - NotificationData.DataTransfered.pPayload_n_1) - 1);
- }
- __enable_irq();
- /* CRC computation */
- CRC_Result = APP_BLE_ComputeCRC8((uint8_t*) (pr->Attribute_Value), (pr->Attribute_Value_Length) - 4);
- /* get low weight byte */
- CRC_Received = (uint8_t) (pr->Attribute_Value[236]);
-
- if (CRC_Received != CRC_Result)
- {
- N+=1;
- APP_DBG_MSG("** data error ** N= %d \r\n",(int)N);
- }
- NotificationData.DataTransfered.pPayload_n_1 = NotificationData.DataTransfered.pPayload_n;
- DTC_App_Notification(&NotificationData);
}
- }
- else
- APP_DBG_MSG("DataTransfer_Client_Event_Handler: EVT_BLUE_GATT_NOTIFICATION, failed handle not found in connection table !\n");
- }
- break;/* end EVT_BLUE_GATT_NOTIFICATION */
- case EVT_BLUE_GATT_PROCEDURE_COMPLETE:
- {
- uint8_t index;
- aci_att_read_by_group_type_resp_event_rp0 *pr = (void*) blue_evt->data;
+ __enable_irq();
+ /* CRC computation */
+ CRC_Result = APP_BLE_ComputeCRC8((uint8_t*) (pr->Attribute_Value), (pr->Attribute_Value_Length) - 1);
+ /* get low weight byte */
+ CRC_Received = (uint8_t) (pr->Attribute_Value[DATA_NOTIFICATION_MAX_PACKET_SIZE-1]);
- index = 0;
- while((index < MAX_CONNECTION) && (aDataTransferClientContext[index].connHandle != pr->Connection_Handle))
- index++;
-
- if (index < MAX_CONNECTION)
- {
- switch (aDataTransferClientContext[index].state)
+ if (CRC_Received != CRC_Result)
{
- case DTC_DISCOVER_CHARACS:
- {
-
- /* we have found the Data Transfer service and now
- * we need to find the characteristics of Data Transfer
- * service
- */
- UTIL_SEQ_SetTask(1 << CFG_IdleTask_DataTransfer_ClientDiscovery, CFG_SCH_PRIO_0);
- }
- break;
- case DTC_DISCOVER_NOTIFICATION_CHAR_DESC:
- {
- UTIL_SEQ_SetTask(1 << CFG_IdleTask_DataTransfer_ClientDiscovery, CFG_SCH_PRIO_0);
- }
- break;
- case DTC_DISCOVER_TX_CHAR_DESC:
- {
- UTIL_SEQ_SetTask(1 << CFG_IdleTask_DataTransfer_ClientDiscovery, CFG_SCH_PRIO_0);
- }
- break;
- case DTC_DISCOVER_RX_CHAR_DESC:
- {
- UTIL_SEQ_SetTask(1 << CFG_IdleTask_DataTransfer_ClientDiscovery, CFG_SCH_PRIO_0);
- }
- break;
- case DTC_ENABLE_NOTIFICATION_TX_DESC:
- {
- if (BUTTON_SERVER == 0)
- {
- APP_DBG_MSG("enable notification \n");
- }
- else
- {
- APP_DBG_MSG("enable notification \n");
- UTIL_SEQ_SetTask(1 << CFG_IdleTask_DataTransfer_ClientDiscovery, CFG_SCH_PRIO_0);
- }
- }
- break;
- case DTC_DISABLE_NOTIFICATION_TX_DESC:
- {
- if (BUTTON_SERVER == 0)
- {
- APP_DBG_MSG("disable notification \n");
- }
- else
- {
- APP_DBG_MSG("disable notification \n");
- UTIL_SEQ_SetTask(1 << CFG_IdleTask_DataTransfer_ClientDiscovery, CFG_SCH_PRIO_0);
- }
- }
- break;
- default:
- break;
+ N+=1;
+ APP_DBG_MSG("** data error ** N= %d \r\n",(int)N);
}
+ NotificationData.DataTransfered.pPayload_n_1 = NotificationData.DataTransfered.pPayload_n;
+ if (DataTransfered == 0)
+ {
+ HW_TS_Start(TimerDataThroughput_Id, DATA_THROUGHPUT_MEASUREMENT);
+ }
+ DataTransfered += NotificationData.DataTransfered.Length;
}
- else
- APP_DBG_MSG("DataTransfer_Client_Event_Handler: EVT_BLUE_GATT_PROCEDURE_COMPLETE, failed handle not found in connection table !\n");
}
+ break;/* end EVT_BLUE_GATT_NOTIFICATION */
+
+ case EVT_BLUE_GATT_PROCEDURE_COMPLETE:
+ UTIL_SEQ_SetEvt(1 << CFG_IDLEEVT_GATT_PROC_COMPLETE);
break; /*EVT_BLUE_GATT_PROCEDURE_COMPLETE*/
- case EVT_BLUE_GATT_TX_POOL_AVAILABLE:
- Resume_Notification();
+
+ default:
+ break;
+ }
+ default:
break;
}
- default:
- break;
}
- }
-
- return (return_value);
-}/* end BLE_CTRL_Event_Acknowledged_Status_t */
-
-uint32_t DataTransfered = 0;
-uint8_t scenario_name;
-uint8_t Result;
-
-void BLE_APP_Disconnection( uint16_t conn_handle , uint8_t reason )
-{
- aci_gap_terminate(conn_handle, reason);
-}
-void DataThroughput_Calculation( void )
-{
-#if ( CFG_DEBUG_APP_TRACE != 0)
- uint32_t packet_lost_local;
- uint32_t MoyData;
-#endif
-
- DataThroughputValue = (uint32_t)(DataTransfered / TIMEUNIT);
-#if ( CFG_DEBUG_APP_TRACE != 0)
- packet_lost_local = (uint32_t)(packet_lost / TIMEUNIT);
-#endif
- DataTransfered = 0;
-
- if (Nbr_packet < 600)
- {
- Nbr_packet++;
- TotalDataReceived += DataThroughputValue;
+ return (return_value);
}
- if (Nbr_packet == 600)
+
+ /*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+ static void DataThroughput_Calculation( void )
{
-#if ( CFG_DEBUG_APP_TRACE != 0)
- MoyData = TotalDataReceived / 600;
-#endif
- APP_DBG_MSG("Moy = %ld bytes/s \n",MoyData);
- TotalDataReceived = 0;
- Nbr_packet = 0;
- }
+ uint32_t MoyData;
+ if (Nbr_packet < 600)
+ {
+ Nbr_packet++;
+ TotalDataReceived += DataThroughputValue;
+ }
+ if (Nbr_packet == 600)
+ {
+ MoyData = TotalDataReceived / 600;
+ APP_DBG_MSG("Moy = %ld bytes/s \n",MoyData);
+ TotalDataReceived = 0;
+ Nbr_packet = 0;
+ }
- APP_DBG_MSG("DT = %ld bytes/s lost = %ld \n",DataThroughputValue, packet_lost_local);
-#if ( CFG_DEBUG_APP_TRACE != 0)
- __disable_irq();
- packet_lost = 0;
- __enable_irq();
-#endif
-}
+ APP_DBG_MSG("DT = %ld bytes/s lost = %ld \n",DataThroughputValue, packet_lost_local);
+ }
-void DTC_App_Notification( DTS_STM_App_Notification_evt_t *pNotification )
-{
- switch (pNotification->Evt_Opcode)
+ static void DataThroughputTimer( void )
{
- case DTS_STM_DATA_RECEIVED:
- if (DataTransfered == 0)
- {
- HW_TS_Start(TimerDataThroughput_Id, DATA_THROUGHPUT_MEASUREMENT);
- }
- DataTransfered += pNotification->DataTransfered.Length;
- break;
+ DataThroughputValue = (uint32_t)(DataTransfered / TIMEUNIT);
+ packet_lost_local = (uint32_t)(packet_lost / TIMEUNIT);
+ DataTransfered = 0;
+ packet_lost = 0;
- default:
- break;
+ UTIL_SEQ_SetTask(1 << CFG_TASK_APP_DATA_THROUGHPUT_ID, CFG_SCH_PRIO_0);
+ return;
}
- return;
-}
-void DTC_App_Update_Service( )
-{
- uint16_t enable = 0x0001;
- uint16_t disable = 0x0000;
- tBleStatus result;
- uint8_t index;
-
- index = 0;
- while((index < MAX_CONNECTION) && (aDataTransferClientContext[index].state != DTC_IDLE))
+ static void GattProcReq(GattProcId_t GattProcId)
{
- switch (aDataTransferClientContext[index].state)
+ tBleStatus status;
+
+ switch(GattProcId)
{
- case DTC_CONNECTED:
- APP_DBG_MSG("DTC_App_Update_Service: DTC_CONNECTED\n");
- aDataTransferClientContext[index].state = DTC_CONNECTED_ADVERTISING;
- break;
- case DTC_DISCOVER_SERVICES:
- break;
- case DTC_DISCOVER_CHARACS:
- APP_DBG_MSG("DTC_App_Update_Service: DTC_DISCOVER_CHARACS\n");
-
- result = aci_gatt_disc_all_char_of_service(
- aDataTransferClientContext[index].connHandle,
- aDataTransferClientContext[index].DataTransferServiceHandle,
- aDataTransferClientContext[index].DataTransferServiceEndHandle);
- if (result == BLE_STATUS_SUCCESS)
- {
- APP_DBG_MSG("DTC_App_Update_Service(), All characteristics discovered Successfully \n");
- }
- else
- {
- APP_DBG_MSG("DTC_App_Update_Service(), All characteristics discovery Failed \n");
- }
- break;
- case DTC_DISCOVER_TX_CHAR_DESC:
- APP_DBG_MSG("DTC_App_Update_Service: DTC_DISCOVER_TX_CHAR_DESC\n");
-
- result = aci_gatt_disc_all_char_desc(
- aDataTransferClientContext[index].connHandle,
- aDataTransferClientContext[index].DataTransferTxCharHdle,
- aDataTransferClientContext[index].DataTransferTxCharHdle + 2);
- if (result == BLE_STATUS_SUCCESS)
- {
- APP_DBG_MSG("DTC_App_Update_Service(), All TX characteristics discovered Successfully \n");
- }
- else
- {
- APP_DBG_MSG("DTC_App_Update_Service(), All TX characteristics discovery Failed \n");
- }
- break;
- case DTC_DISCOVER_NOTIFICATION_CHAR_DESC:
- APP_DBG_MSG("DTC_App_Update_Service: DTC_DISCOVER_NOTIFICATION_CHAR_DESC\n");
- result = aci_gatt_disc_all_char_desc(
- aDataTransferClientContext[index].connHandle,
- aDataTransferClientContext[index].DTNotificationCharHdle,
- aDataTransferClientContext[index].DTNotificationCharHdle + 2);
- if (result == BLE_STATUS_SUCCESS)
- {
- APP_DBG_MSG("DTC_App_Update_Service(), All P2P characteristics discovered Successfully \n");
- }
- else
+ case GATT_PROC_MTU_UPDATE:
+ APP_DBG_MSG("change ATT MTU size \n");
+
+ status = aci_gatt_exchange_config(DataTransferClientContext.connHandle);
+ if (status != BLE_STATUS_SUCCESS)
{
- APP_DBG_MSG("DTC_App_Update_Service(), All P2P characteristics discovery Failed \n");
+ APP_DBG_MSG("change MTU cmd failure: 0x%x\n", status);
}
+ UTIL_SEQ_WaitEvt(1 << CFG_IDLEEVT_GATT_PROC_COMPLETE);
+
+ APP_DBG_MSG("GATT_PROC_MTU_UPDATE complete event received \n");
break;
- case DTC_DISCOVER_RX_CHAR_DESC:
- APP_DBG_MSG("DTC_App_Update_Service: DTC_DISCOVER_RX_CHAR_DESC\n");
-
- result = aci_gatt_disc_all_char_desc(
- aDataTransferClientContext[index].connHandle,
- aDataTransferClientContext[index].DataTransferRxCharHdle,
- aDataTransferClientContext[index].DataTransferRxCharHdle + 2);
- if (result == BLE_STATUS_SUCCESS)
- {
- APP_DBG_MSG("DTC_App_Update_Service(), All RX characteristics discovered Successfully \n");
- }
- else
+
+ case GATT_PROC_DISC_ALL_PRIMARY_SERVICES:
+ APP_DBG_MSG("Discover all primary services \n");
+
+ status = aci_gatt_disc_all_primary_services(DataTransferClientContext.connHandle);
+ if (status != BLE_STATUS_SUCCESS)
{
- APP_DBG_MSG("DTC_App_Update_Service(), All RX characteristics discovery Failed \n");
+ APP_DBG_MSG("Discover all primary services cmd failure: 0x%x\n", status);
}
+ UTIL_SEQ_WaitEvt(1 << CFG_IDLEEVT_GATT_PROC_COMPLETE);
+
+ APP_DBG_MSG("GATT_PROC_DISC_ALL_PRIMARY_SERVICES complete event received \n");
break;
- case DTC_ENABLE_NOTIFICATION_TX_DESC:
- APP_DBG_MSG("DTC_App_Update_Service: DTC_ENABLE_NOTIFICATION_TX_DESC\n");
-
- result = aci_gatt_write_char_desc(
- aDataTransferClientContext[index].connHandle,
- aDataTransferClientContext[index].DataTransferTxDescHandle,
- 2,
- (uint8_t *) &enable);
- if (result == BLE_STATUS_SUCCESS)
- {
- APP_DBG_MSG("DTC_App_Update_Service(), TX notification enabled Successfully \n");
- }
- else
- {
- APP_DBG_MSG("DTC_App_Update_Service(), TX notification enabled Failed \n");
- }
- if (BUTTON_SERVER)
+
+ case GATT_PROC_DISC_ALL_CHAR_OF_DT_SERVICE:
+ APP_DBG_MSG("Discover all char of service \n");
+
+ status = aci_gatt_disc_all_char_of_service(
+ DataTransferClientContext.connHandle,
+ DataTransferClientContext.DataTransferServiceHandle,
+ DataTransferClientContext.DataTransferServiceEndHandle);
+ if (status != BLE_STATUS_SUCCESS)
{
- aDataTransferClientContext[index].state = DTC_CONNECTED;
+ APP_DBG_MSG("Discover all char of service cmd failure: 0x%x\n", status);
}
+ UTIL_SEQ_WaitEvt(1 << CFG_IDLEEVT_GATT_PROC_COMPLETE);
+
+ APP_DBG_MSG("GATT_PROC_DISC_ALL_CHAR_OF_DT_SERVICE complete event received \n");
break;
- case DTC_DISABLE_NOTIFICATION_TX_DESC:
- APP_DBG_MSG("DTC_App_Update_Service: DTC_DISABLE_NOTIFICATION_TX_DESC\n");
- result = aci_gatt_write_char_desc(
- aDataTransferClientContext[index].connHandle,
- aDataTransferClientContext[index].DataTransferTxDescHandle,
- 2,
- (uint8_t *) &disable);
+ case GATT_PROC_DISC_TX_CHAR_DESC:
+ APP_DBG_MSG("Discover Tx char descriptors \n");
- if (result == BLE_STATUS_SUCCESS)
- {
- APP_DBG_MSG("DTC_App_Update_Service(), TX notfication disabled Successfully \n");
- }
- else
- {
- APP_DBG_MSG("DTC_App_Update_Service(), TX notfication disabled Failed \n");
- }
- if (BUTTON_SERVER)
+ status = aci_gatt_disc_all_char_desc(
+ DataTransferClientContext.connHandle,
+ DataTransferClientContext.DataTransferTxCharHdle,
+ DataTransferClientContext.DataTransferTxCharHdle + 2);
+ if (status != BLE_STATUS_SUCCESS)
{
- aDataTransferClientContext[index].state = DTC_CONNECTED;
+ APP_DBG_MSG("Discover Tx char descriptors cmd failure: 0x%x\n", status);
}
+ UTIL_SEQ_WaitEvt(1 << CFG_IDLEEVT_GATT_PROC_COMPLETE);
+
+ APP_DBG_MSG("GATT_PROC_DISC_TX_CHAR_DESC complete event received \n");
break;
default:
break;
}
- index++;
+ return;
}
- return;
-}
-static void DataThroughputTimer( void )
-{
- UTIL_SEQ_SetTask(1 << CFG_TASK_APP_DATA_THROUGHPUT_ID, CFG_SCH_PRIO_0);
- return;
-}
-void enable_notification(void)
-{
- uint16_t enable = 0x0001;
- tBleStatus result;
- APP_DBG_MSG("DTC_App_Update_Service: DTC_ENABLE_NOTIFICATION_TX_DESC\n");
-
- result = aci_gatt_write_char_desc(
- aDataTransferClientContext[0].connHandle,
- aDataTransferClientContext[0].DataTransferTxDescHandle,
- 2,
- (uint8_t *) &enable);
- if (result == BLE_STATUS_SUCCESS)
- {
- APP_DBG_MSG("DTC_App_Update_Service(), TX notification enabled Successfully \n");
- }
- else
- {
- APP_DBG_MSG("DTC_App_Update_Service(), TX notification enabled Failed \n");
- }
- aDataTransferClientContext[0].state = DTC_CONNECTED;
- return;
-}
-
-void disable_notification(void)
-{
- uint16_t disable = 0x0000;
- tBleStatus result;;
- APP_DBG_MSG("DTC_App_Update_Service: DTC_DISABLE_NOTIFICATION_TX_DESC\n");
-
- result = aci_gatt_write_char_desc(
- aDataTransferClientContext[0].connHandle,
- aDataTransferClientContext[0].DataTransferTxDescHandle,
- 2,
- (uint8_t *) &disable);
-
- if (result == BLE_STATUS_SUCCESS)
- {
- APP_DBG_MSG("DTC_App_Update_Service(), TX notfication disabled Successfully \n");
- }
- else
- {
- APP_DBG_MSG("DTC_App_Update_Service(), TX notfication disabled Failed \n");
- }
- aDataTransferClientContext[0].state = DTC_CONNECTED;
- return;
-}
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/dt_client_app.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/dt_client_app.h
index 3ee8fe150..372a3246a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/dt_client_app.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/dt_client_app.h
@@ -21,176 +21,20 @@
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __DTC_APPLICATION_H
-#define __DTC_APPLICATION_H
+#define __DT_CLIENT_APP_H
#ifdef __cplusplus
extern "C" {
#endif
- typedef enum
-{
- DTC_UNINITIALIZED = 0,
- DTC_INITIALIZED = 1,
- DTC_IDLE = 2,
- DTC_DISCOVER_SERVICES = 3,
- DTC_DISCOVER_CHARACS = 4,
- DTC_DISCOVER_TX_CHAR_DESC = 5,
- DTC_DISCOVER_RX_CHAR_DESC = 6,
- DTC_ENABLE_NOTIFICATION_TX_DESC = 7,
- DTC_DISABLE_NOTIFICATION_TX_DESC = 8,
- DTC_CONNECTED = 9,
- DTC_CONNECTED_ADVERTISING = 10,
- DTC_DISCOVER_NOTIFICATION_CHAR_DESC = 11,
-} DTC_ProfileState;
-
- typedef struct
-{
- /**
- * state of the Data Transfer
- * state machine
- */
- DTC_ProfileState state;
-
- /**
- * connection handle
- */
- uint16_t connHandle;
-
- /**
- * bitmask of the attributes
- * discovered
- */
- uint8_t featuresFound;
-
- /**
- * flag which maintains
- * the connection status
- */
- uint8_t disconnected;
-
- /**
- * handle of the Data Transfer service
- */
- uint16_t DataTransferServiceHandle;
-
- /**
- * end handle of the Data Transfer service
- */
- uint16_t DataTransferServiceEndHandle;
-
- /**
- * handle of the Tx characteristic
- *
- */
- uint16_t DataTransferTxCharHdle;
-
- /**
- * handle of the client configuration
- * descriptor of Tx characteristic
- */
- uint16_t DataTransferTxDescHandle;
-
- /**
- * handle of the client configuration
- * descriptor of new alert characteristic
- */
- uint16_t DataTransferRxCharHdle; /**< Characteristic handle */
- uint16_t DataTransferRxDescHandle; /**< Characteristic handle */
- uint16_t DTNotificationCharHdle;
- uint16_t ButtonDescHandle;
-} DataTransferContext_t;
-
-typedef enum
-{
- DT_IDLE = 0,
- DT_DISCOVER_SERVICES = 1,
- DT_DISCOVER_CHARACS = 2,
- DT_DISCOVER_LED_CHAR_DESC = 3,
- DT_DISCOVER_BUTTON_CHAR_DESC = 4,
- DT_ENABLE_NOTIFICATION_BUTTON_DESC = 5,
- DT_DISABLE_NOTIFICATION_TX_DESC = 6,
- DT_ADV =7,
- DT_SCAN =8,
- DT_CONNECTING =9,
- DT_CONNECTED = 10,
-} DT_Gap_Gatt_State;
-typedef struct{
- /**
- * state of the Data Transfer
- * state machine
- */
- DT_Gap_Gatt_State state;
-
- /**
- * connection handle
- */
- uint16_t connHandle;
-
- /**
- * handle of the P2P service
- */
- uint16_t P2PServiceHandle;
-
- /**
- * end handle of the P2P service
- */
- uint16_t P2PServiceEndHandle;
-
- /**
- * handle of the Tx characteristic - Write To Server
- *
- */
- uint16_t P2PWriteToServerCharHdle;
-
- /**
- * handle of the client configuration
- * descriptor of Tx characteristic
- */
- uint16_t P2PWriteToServerDescHandle;
-
- /**
- * handle of the Rx characteristic - Notification From Server
- *
- */
- uint16_t P2PNotificationCharHdle;
-
- /**
- * handle of the client configuration
- * descriptor of Rx characteristic
- */
- uint16_t P2PNotificationDescHandle;
- uint8_t NotificationStatus;
- uint8_t WriteStatus;
-
-}DT_ClientContext_t;
-
-typedef enum
-{
- DT_CONNECTION_ESTABLISHED,
- DT_PASSKEY_REQ_EVT,
- DT_PAIRING_COMPLETE,
- DT_READ_PHY,
- DT_SET_PHY,
- DT_MTU_EXCHANGED,
- DT_DISCONN_COMPLETE,
-} Connection_Evt_t;
-
-typedef struct
-{
-Connection_Evt_t Evt_Opcode;
-uint16_t connection_handle;
-
-} Connection_Context_t;
- /* Includes ------------------------------------------------------------------*/
- /* Exported types ------------------------------------------------------------*/
- /* Exported constants --------------------------------------------------------*/
- /* External variables --------------------------------------------------------*/
- /* Exported macros -----------------------------------------------------------*/
- /* Exported functions ------------------------------------------------------- */
-
-void DT_Client_App_Init(void);
-void enable_notification(void);
-void DT_App_Notification( Connection_Context_t *pNotification );
+/* Includes ------------------------------------------------------------------*/
+/* Exported types ------------------------------------------------------------*/
+/* Exported constants --------------------------------------------------------*/
+/* External variables --------------------------------------------------------*/
+/* Exported macros -----------------------------------------------------------*/
+/* Exported functions ------------------------------------------------------- */
+void DTC_App_Init(void);
+void DTC_App_LinkReadyNotification(uint16_t ConnectionHandle);
#ifdef __cplusplus
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/dt_server_app.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/dt_server_app.c
index 4c4ec3e7f..47afafcee 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/dt_server_app.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/dt_server_app.c
@@ -36,60 +36,95 @@
typedef enum
{
- DT_FLOW_OFF,
- DT_FLOW_ON
-} DT_Flow_Status_t;
+ DTS_APP_FLOW_OFF,
+ DTS_APP_FLOW_ON
+} DTS_App_Flow_Status_t;
+
+typedef enum
+{
+ DTS_APP_TRANSFER_REQ_OFF,
+ DTS_APP_TRANSFER_REQ_ON
+} DTS_App_Transfer_Req_Status_t;
typedef struct
{
-DTS_STM_Payload_t TxData;
-DTS_STM_Payload_t RxData;
-uint8_t TimerDataTransfer_Id;
-uint8_t NotificationTransferFlag;
-uint8_t StartTransferFlag;
-DT_Flow_Status_t DtFlowStatus;
-} DT_Server_App_Context_t;
-
-DT_ClientContext_t aDTClientContext[BLE_CFG_CLT_MAX_NBR_CB];
+ DTS_STM_Payload_t TxData;
+ DTS_App_Transfer_Req_Status_t NotificationTransferReq;
+ DTS_App_Transfer_Req_Status_t ButtonTransferReq;
+ DTS_App_Flow_Status_t DtFlowStatus;
+} DTS_App_Context_t;
+
/* Private defines -----------------------------------------------------------*/
/* Private macros ------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
-DT_Server_App_Context_t DataTransferServerContext;
-uint32_t Notification_Data_Buffer[62];
-
-#define DEFAULT_TS_MEASUREMENT_INTERVAL (1000000/CFG_TS_TICK_VAL) /**< 1s */
-#define DATA_STOP (4*DEFAULT_TS_MEASUREMENT_INTERVAL)
+static DTS_App_Context_t DataTransferServerContext;
+static uint8_t Notification_Data_Buffer[DATA_NOTIFICATION_MAX_PACKET_SIZE]; /* DATA_NOTIFICATION_MAX_PACKET_SIZE data + CRC */
/* Global variables ----------------------------------------------------------*/
/* Functions Definition ------------------------------------------------------*/
/* Private functions ----------------------------------------------------------*/
-static void DT_App_Button_Trigger_Received( void );
-static void BLE_App_dts_Send_Data( void );
+static void ButtonTriggerReceived(void);
+static void SendData(void);
+
+/*************************************************************
+ *
+ * PUBLIC FUNCTIONS
+ *
+ *************************************************************/
+void DTS_App_Init(void)
+{
+ uint8_t i;
+
+ UTIL_SEQ_RegTask( 1<<CFG_TASK_BUTTON_ID, UTIL_SEQ_RFU, ButtonTriggerReceived);
+ UTIL_SEQ_RegTask( 1<<CFG_TASK_DATA_TRANSFER_UPDATE_ID, UTIL_SEQ_RFU, SendData);
-extern DataTransferContext_t aDataTransferClientContext[MAX_CONNECTION];
-/* Private function prototypes -----------------------------------------------*/
+ /**
+ * Initialize data buffer
+ */
+ for (i=0 ; i<(DATA_NOTIFICATION_MAX_PACKET_SIZE-1) ; i++)
+ {
+ Notification_Data_Buffer[i] = i;
+ }
+
+ DataTransferServerContext.NotificationTransferReq = DTS_APP_TRANSFER_REQ_OFF;
+ DataTransferServerContext.ButtonTransferReq = DTS_APP_TRANSFER_REQ_OFF;
+ DataTransferServerContext.DtFlowStatus = DTS_APP_FLOW_ON;
+}
+void DTS_App_KeyButtonAction( void )
+{
+ UTIL_SEQ_SetTask(1 << CFG_TASK_BUTTON_ID, CFG_SCH_PRIO_0);
+}
+
+void DTS_App_TxPoolAvailableNotification(void)
+{
+ DataTransferServerContext.DtFlowStatus = DTS_APP_FLOW_ON;
+ UTIL_SEQ_SetTask(1 << CFG_TASK_DATA_TRANSFER_UPDATE_ID, CFG_SCH_PRIO_0);
+
+ return;
+}
+
+/*************************************************************
+ *
+ * CALLBACK FUNCTIONS
+ *
+ *************************************************************/
void DTS_Notification( DTS_STM_App_Notification_evt_t *pNotification )
{
switch (pNotification->Evt_Opcode)
{
case DTS_STM__NOTIFICATION_ENABLED:
- DataTransferServerContext.NotificationTransferFlag = 0x01;
- if (BUTTON_SERVER == 0)
- {
- APP_DBG_MSG("enable notification appli\n");
- DataTransferServerContext.StartTransferFlag = 1;
- UTIL_SEQ_SetTask(1 << CFG_TASK_DATA_TRANSFER_UPDATE_ID, CFG_SCH_PRIO_0);
- }
+ DataTransferServerContext.NotificationTransferReq = DTS_APP_TRANSFER_REQ_ON;
+ UTIL_SEQ_SetTask(1 << CFG_TASK_DATA_TRANSFER_UPDATE_ID, CFG_SCH_PRIO_0);
break;
case DTS_STM_NOTIFICATION_DISABLED:
- if (BUTTON_SERVER == 0)
- {
- APP_DBG_MSG("disable notification appli\n");
- DataTransferServerContext.StartTransferFlag = 0;
- }
- DataTransferServerContext.NotificationTransferFlag = 0x00;
+ DataTransferServerContext.NotificationTransferReq = DTS_APP_TRANSFER_REQ_OFF;
+ break;
+
+ case DTS_STM_GATT_TX_POOL_AVAILABLE:
+ DataTransferServerContext.DtFlowStatus = DTS_APP_FLOW_ON;
+ UTIL_SEQ_SetTask(1 << CFG_TASK_DATA_TRANSFER_UPDATE_ID, CFG_SCH_PRIO_0);
break;
default:
@@ -99,122 +134,58 @@ void DTS_Notification( DTS_STM_App_Notification_evt_t *pNotification )
return;
}
-void BLE_App_dts_Send_Data( void )
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+static void SendData( void )
{
tBleStatus status = BLE_STATUS_INVALID_PARAMS;
- uint8_t CRC_Result;
- uint32_t mask_byte_low = 0xFFFFFF00;
+ uint8_t crc_result;
-
- if (DataTransferServerContext.StartTransferFlag)
+ if( (DataTransferServerContext.ButtonTransferReq != DTS_APP_TRANSFER_REQ_OFF)
+ && (DataTransferServerContext.NotificationTransferReq != DTS_APP_TRANSFER_REQ_OFF)
+ && (DataTransferServerContext.DtFlowStatus != DTS_APP_FLOW_OFF) )
{
/*Data Packet to send to remote*/
- Notification_Data_Buffer[0] += 1;
- /* compute CRC */
- CRC_Result = APP_BLE_ComputeCRC8((uint8_t*) Notification_Data_Buffer, (DATA_NOTIFICATION_MAX_PACKET_SIZE - 4));
- Notification_Data_Buffer[59] &= mask_byte_low;
- Notification_Data_Buffer[59] |= (uint32_t) CRC_Result;
-
- DataTransferServerContext.TxData.pPayload = Notification_Data_Buffer;
- DataTransferServerContext.TxData.Length = DATA_NOTIFICATION_MAX_PACKET_SIZE; /* DATA_NOTIFICATION_MAX_PACKET_SIZE */
-
- if(DataTransferServerContext.DtFlowStatus == DT_FLOW_ON)
- {
- status = DTS_STM_UpdateChar(DATA_TRANSFER_TX_CHAR_UUID, (uint8_t *) &DataTransferServerContext.TxData);
- if (status == BLE_STATUS_INSUFFICIENT_RESOURCES)
- {
- DataTransferServerContext.DtFlowStatus = DT_FLOW_OFF;
- (Notification_Data_Buffer[0])-=1;
- }
- }
- else
+ Notification_Data_Buffer[0] += 1;
+ /* compute CRC */
+ crc_result = APP_BLE_ComputeCRC8((uint8_t*) Notification_Data_Buffer, (DATA_NOTIFICATION_MAX_PACKET_SIZE - 1));
+ Notification_Data_Buffer[DATA_NOTIFICATION_MAX_PACKET_SIZE - 1] = crc_result;
+
+ DataTransferServerContext.TxData.pPayload = Notification_Data_Buffer;
+ DataTransferServerContext.TxData.Length = DATA_NOTIFICATION_MAX_PACKET_SIZE; /* DATA_NOTIFICATION_MAX_PACKET_SIZE */
+
+ status = DTS_STM_UpdateChar(DATA_TRANSFER_TX_CHAR_UUID, (uint8_t *) &DataTransferServerContext.TxData);
+ if (status == BLE_STATUS_INSUFFICIENT_RESOURCES)
{
+ DataTransferServerContext.DtFlowStatus = DTS_APP_FLOW_OFF;
(Notification_Data_Buffer[0])-=1;
}
-
- UTIL_SEQ_SetTask(1 << CFG_TASK_DATA_TRANSFER_UPDATE_ID, CFG_SCH_PRIO_0);
+ else
+ {
+ UTIL_SEQ_SetTask(1 << CFG_TASK_DATA_TRANSFER_UPDATE_ID, CFG_SCH_PRIO_0);
+ }
}
return;
}
-void Resume_Notification(void)
-{
- DataTransferServerContext.DtFlowStatus = DT_FLOW_ON;
-}
-
-void DT_App_Button_Trigger_Received( void )
+static void ButtonTriggerReceived( void )
{
-
- if (BUTTON_SERVER == 0)
+ if(DataTransferServerContext.ButtonTransferReq != DTS_APP_TRANSFER_REQ_OFF)
{
- if (aDTClientContext[0].NotificationStatus == 0)
- {
- aDataTransferClientContext[0].state = DTC_ENABLE_NOTIFICATION_TX_DESC;
- UTIL_SEQ_SetTask(1 << CFG_IdleTask_DataTransfer_ClientDiscovery, CFG_SCH_PRIO_0);
- aDTClientContext[0].NotificationStatus = 1;
- }
- else
- {
- aDataTransferClientContext[0].state = DTC_DISABLE_NOTIFICATION_TX_DESC;
- UTIL_SEQ_SetTask(1 << CFG_IdleTask_DataTransfer_ClientDiscovery, CFG_SCH_PRIO_0);
- aDTClientContext[0].NotificationStatus = 0;
- }
+ BSP_LED_Off(LED_BLUE);
+ DataTransferServerContext.ButtonTransferReq = DTS_APP_TRANSFER_REQ_OFF;
}
else
{
- if(DataTransferServerContext.StartTransferFlag == 0)
- {
- if (DataTransferServerContext.NotificationTransferFlag == 1)
- {
- BSP_LED_On(LED_BLUE);
- Delay_StartDataReq();
- }
- }
- else
- {
- BSP_LED_Off(LED_BLUE);
- DataTransferServerContext.StartTransferFlag = 0;
- }
+ BSP_LED_On(LED_BLUE);
+ DataTransferServerContext.ButtonTransferReq = DTS_APP_TRANSFER_REQ_ON;
+ UTIL_SEQ_SetTask(1 << CFG_TASK_DATA_TRANSFER_UPDATE_ID, CFG_SCH_PRIO_0);
}
-
- return;
-}
-void Delay_StartDataReq( void)
-{
- DataTransferServerContext.StartTransferFlag = 1;
- UTIL_SEQ_SetTask(1 << CFG_TASK_DATA_TRANSFER_UPDATE_ID, CFG_SCH_PRIO_0);
-
return;
}
-void DT_Server_App_Key_Button_Action( void )
-{
- UTIL_SEQ_SetTask(1 << CFG_TASK_BUTTON_ID, CFG_SCH_PRIO_0);
-}
-
-void DT_Server_App_Init( void )
-{
- uint8_t i;
-
- UTIL_SEQ_RegTask( 1<<CFG_TASK_BUTTON_ID, UTIL_SEQ_RFU, DT_App_Button_Trigger_Received);
- UTIL_SEQ_RegTask( 1<<CFG_TASK_DATA_TRANSFER_UPDATE_ID, UTIL_SEQ_RFU, BLE_App_dts_Send_Data);
-
- /**
- * Initialize data buffer
- */
- for (i=0;i<62;i++)
- {
- Notification_Data_Buffer[i] = (uint32_t)i;
- }
-}
-
-void SVCCTL_InitCustomSvc( void )
-{
- DTS_STM_Init();
- DataTransferServerContext.NotificationTransferFlag = 0x00;
- DataTransferServerContext.StartTransferFlag = 0x00;
- DataTransferServerContext.DtFlowStatus = DT_FLOW_ON;
-
-}
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/dt_server_app.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/dt_server_app.h
index a96ced336..a7da93a02 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/dt_server_app.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/dt_server_app.h
@@ -33,9 +33,9 @@ extern "C" {
/* External variables --------------------------------------------------------*/
/* Exported macros -----------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
- void DT_Server_App_Init( void );
- void DT_Server_App_Key_Button_Action( void );
- void Delay_StartDataReq( void);
+ void DTS_App_Init(void);
+ void DTS_App_KeyButtonAction(void);
+ void DTS_App_TxPoolAvailableNotification(void);
#ifdef __cplusplus
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/dts.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/dts.c
index 165b34892..09861152d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/dts.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/dts.c
@@ -63,12 +63,10 @@ typedef struct
{
uint16_t DataTransferSvcHdle; /**< Service handle */
uint16_t DataTransferTxCharHdle; /**< Characteristic handle */
-uint16_t DataTransferRxCharHdle; /**< Characteristic handle */
} DataTransferSvcContext_t;
/* Private defines -----------------------------------------------------------*/
-#define DATA_TRANSFER_NOTIFICATION_LEN_MAX (20)
-#define DATA_TRANSFER_RX_LEN_MAX (255)
+#define DATA_TRANSFER_NOTIFICATION_LEN_MAX (255)
/* Private macros ------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
@@ -105,8 +103,6 @@ static SVCCTL_EvtAckStatus_t DTS_Event_Handler( void *Event )
switch (blue_evt->ecode)
{
- case EVT_BLUE_ATT_EXCHANGE_MTU_RESP:
- break;
/* server */
case EVT_BLUE_GATT_ATTRIBUTE_MODIFIED:
{
@@ -131,11 +127,7 @@ static SVCCTL_EvtAckStatus_t DTS_Event_Handler( void *Event )
}
}
break;
- case EVT_BLUE_GATT_TX_POOL_AVAILABLE:
- Resume_Notification();
- break;
- /* end server */
- /* end GATT event */
+
default:
break;
}
@@ -194,7 +186,7 @@ void DTS_STM_Init( void )
10, &(aDataTransferContext.DataTransferSvcHdle));
if (hciCmdResult != 0)
{
- APP_DBG_MSG("error add service\n");
+ APP_DBG_MSG("error add service 0x%x\n", hciCmdResult);
}
/**
@@ -203,7 +195,7 @@ void DTS_STM_Init( void )
aci_gatt_add_char(aDataTransferContext.DataTransferSvcHdle,
DT_UUID_LENGTH,
(Char_UUID_t *) DT_REQ_CHAR_UUID,
- 255, /* DATA_TRANSFER_NOTIFICATION_LEN_MAX, */
+ DATA_TRANSFER_NOTIFICATION_LEN_MAX,
CHAR_PROP_NOTIFY,
ATTR_PERMISSION_NONE,
GATT_DONT_NOTIFY_EVENTS, /* gattEvtMask */
@@ -212,7 +204,7 @@ void DTS_STM_Init( void )
&(aDataTransferContext.DataTransferTxCharHdle));
if (hciCmdResult != 0)
{
- APP_DBG_MSG("error add char Tx\n");
+ APP_DBG_MSG("error add char Tx 0x%x\n", hciCmdResult);
}
return;
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/dts.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/dts.h
index 970ab7318..bd6ec4fbe 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/dts.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/STM32_WPAN/App/dts.h
@@ -35,24 +35,17 @@ extern "C"
/* Exported types LBR Client Implementation-----------------------------------*/
typedef struct
{
- uint32_t *pPayload;
+ uint8_t *pPayload;
uint32_t pPayload_n_1;
uint32_t pPayload_n;
uint32_t Length;
} DTS_STM_Payload_t;
-/*typedef struct
-{
- uint8_t *pPayload;
- uint8_t pPayload_n_1;
- uint8_t pPayload_n;
- uint32_t Length;
-} DTS_STM_Payload_t;*/
typedef enum
{
DTS_STM__NOTIFICATION_ENABLED,
DTS_STM_NOTIFICATION_DISABLED,
- DTS_STM_DATA_RECEIVED,
+ DTS_STM_GATT_TX_POOL_AVAILABLE,
} DTS_STM_NotCode_t;
typedef struct
@@ -68,9 +61,7 @@ typedef struct
/* Exported functions ------------------------------------------------------- */
void DTS_STM_Init( void );
tBleStatus DTS_STM_UpdateChar( uint16_t UUID , uint8_t *pPayload );
-void Resume_Notification(void);
-
-extern void DTS_Notification( DTS_STM_App_Notification_evt_t *pNotification );
+void DTS_Notification( DTS_STM_App_Notification_evt_t *pNotification );
#ifdef __cplusplus
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/SW4STM32/Production/.cproject b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/SW4STM32/Production/.cproject
index 97dd119ab..f97e70c88 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/SW4STM32/Production/.cproject
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/SW4STM32/Production/.cproject
@@ -87,7 +87,7 @@
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble"/>
<listOptionValue builtIn="false" value="../../../Core/Inc"/>
- <listOptionValue builtIn="false" value="../../../STM32_WPAN/app"/>
+ <listOptionValue builtIn="false" value="../../../STM32_WPAN/App"/>
</option>
<option id="gnu.cpp.compiler.option.preprocessor.def.1985758192" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="USE_STM32WBXX_NUCLEO"/>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/SW4STM32/Production/.project b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/SW4STM32/Production/.project
index fc3af3fca..f425ad314 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/SW4STM32/Production/.project
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/SW4STM32/Production/.project
@@ -65,24 +65,24 @@
<location>PARENT-2-PROJECT_LOC/Core/Src/stm32wbxx_it.c</location>
</link>
<link>
- <name>Application/STM32_WPAN/app/app_ble.c</name>
+ <name>Application/STM32_WPAN/App/app_ble.c</name>
<type>1</type>
- <location>PARENT-2-PROJECT_LOC/STM32_WPAN/app/app_ble.c</location>
+ <location>PARENT-2-PROJECT_LOC/STM32_WPAN/App/app_ble.c</location>
</link>
<link>
- <name>Application/STM32_WPAN/app/dt_client_app.c</name>
+ <name>Application/STM32_WPAN/App/dt_client_app.c</name>
<type>1</type>
- <location>PARENT-2-PROJECT_LOC/STM32_WPAN/app/dt_client_app.c</location>
+ <location>PARENT-2-PROJECT_LOC/STM32_WPAN/App/dt_client_app.c</location>
</link>
<link>
- <name>Application/STM32_WPAN/app/dt_server_app.c</name>
+ <name>Application/STM32_WPAN/App/dt_server_app.c</name>
<type>1</type>
- <location>PARENT-2-PROJECT_LOC/STM32_WPAN/app/dt_server_app.c</location>
+ <location>PARENT-2-PROJECT_LOC/STM32_WPAN/App/dt_server_app.c</location>
</link>
<link>
- <name>Application/STM32_WPAN/app/dts.c</name>
+ <name>Application/STM32_WPAN/App/dts.c</name>
<type>1</type>
- <location>PARENT-2-PROJECT_LOC/STM32_WPAN/app/dts.c</location>
+ <location>PARENT-2-PROJECT_LOC/STM32_WPAN/App/dts.c</location>
</link>
<link>
<name>Application/STM32_WPAN/target/hw_ipcc.c</name>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/readme.txt b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/readme.txt
index d64b0ead7..114f66042 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/readme.txt
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_DataThroughput/readme.txt
@@ -91,7 +91,7 @@ Two STM32WB55xx boards are used, one central and one peripheral.
They are both configured as GATT client and GATT server.
They both support a Data transfer service with a transmission characteristic that supports notification.
Both boards need to be compiled by changing the definition in app_conf.h
-Use #define BLE_PERIPHERAL 1 or #define BLE_CENTRAL 1, comment one of the #define.
+Use #define CFG_BLE_CENTRAL 0 or 1
One board is defined as GAP peripheral, the other board is defined as GAP central.
Open a VT100 terminal on Central and Peripheral side (ST Link Com Port, @115200 bauds).
At startup the connection is established and encryption started(if #define ENCRYPTION_ON 1 uncomment in app_conf.h).
@@ -105,8 +105,9 @@ it stops when SW1 is pushed again (blue led is OFF).
The notification can be started and stopped from both sides.
On the client terminal receiving the current notification, the number of bytes per second is displayed.
-If PHY_2M is defined as compilation variable, the link is set to 2M
-If PHY_2M is not defined, the link stays at 1M
+In app_conf.h
+if #define CFG_TX_PHY 2 and #define CFG_RX_PHY 2, link is set to 2M
+if #define CFG_TX_PHY 1 and #define CFG_RX_PHY 1, link stays at 1M
* <h3><center>&copy; COPYRIGHT STMicroelectronics</center></h3>
*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/BLE_HealthThermometer.ioc b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/BLE_HealthThermometer.ioc
index 4e20005e6..bd3f7e12c 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/BLE_HealthThermometer.ioc
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/BLE_HealthThermometer.ioc
@@ -73,27 +73,29 @@ Mcu.IP9=SYS
Mcu.IPNb=12
Mcu.Name=STM32WB55RGVx
Mcu.Package=VFQFPN68
-Mcu.Pin0=PA2
-Mcu.Pin1=PA3
-Mcu.Pin10=VP_RTC_VS_RTC_Activate
-Mcu.Pin11=VP_SEQUENCER_VS_SEQUENCER
-Mcu.Pin12=VP_STM32_WPAN_VS_BLE_HOST
-Mcu.Pin13=VP_SYS_VS_Systick
-Mcu.Pin14=VP_TINY_LPM_VS_TINY_LPM
-Mcu.Pin2=PA6
-Mcu.Pin3=RF1
-Mcu.Pin4=OSC_OUT
-Mcu.Pin5=OSC_IN
-Mcu.Pin6=PA11
-Mcu.Pin7=PB6
-Mcu.Pin8=PB7
-Mcu.Pin9=VP_HSEM_VS_HSEM
-Mcu.PinsNb=15
+Mcu.Pin0=PC14-OSC32_IN
+Mcu.Pin1=PC15-OSC32_OUT
+Mcu.Pin10=PB7
+Mcu.Pin11=VP_HSEM_VS_HSEM
+Mcu.Pin12=VP_RTC_VS_RTC_Activate
+Mcu.Pin13=VP_SEQUENCER_VS_SEQUENCER
+Mcu.Pin14=VP_STM32_WPAN_VS_BLE_HOST
+Mcu.Pin15=VP_SYS_VS_Systick
+Mcu.Pin16=VP_TINY_LPM_VS_TINY_LPM
+Mcu.Pin2=PA2
+Mcu.Pin3=PA3
+Mcu.Pin4=PA6
+Mcu.Pin5=RF1
+Mcu.Pin6=OSC_OUT
+Mcu.Pin7=OSC_IN
+Mcu.Pin8=PA11
+Mcu.Pin9=PB6
+Mcu.PinsNb=17
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32WB55RGVx
-MxCube.Version=5.3.0
-MxDb.Version=DB.5.0.30
+MxCube.Version=5.4.0
+MxDb.Version=DB.5.0.40
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false
NVIC.DMA1_Channel4_IRQn=true\:15\:0\:true\:false\:true\:false\:true
NVIC.DMA2_Channel4_IRQn=true\:15\:0\:true\:false\:true\:false\:true
@@ -146,6 +148,10 @@ PB7.GPIO_Speed=GPIO_SPEED_FREQ_VERY_HIGH
PB7.Locked=true
PB7.Mode=Asynchronous
PB7.Signal=USART1_RX
+PC14-OSC32_IN.Mode=LSE-External-Oscillator
+PC14-OSC32_IN.Signal=RCC_OSC32_IN
+PC15-OSC32_OUT.Mode=LSE-External-Oscillator
+PC15-OSC32_OUT.Signal=RCC_OSC32_OUT
PCC.Ble.ConnectionInterval=1000.0
PCC.Ble.DataLength=6
PCC.Ble.Mode=Advertising
@@ -168,7 +174,7 @@ ProjectManager.DeletePrevious=true
ProjectManager.DeviceId=STM32WB55RGVx
ProjectManager.FreePins=false
ProjectManager.HalAssertFull=false
-ProjectManager.HeapSize=0x200
+ProjectManager.HeapSize=0x400
ProjectManager.KeepUserCode=true
ProjectManager.LastFirmware=true
ProjectManager.LibraryCopy=2
@@ -178,11 +184,11 @@ ProjectManager.PreviousToolchain=
ProjectManager.ProjectBuild=false
ProjectManager.ProjectFileName=BLE_HealthThermometer.ioc
ProjectManager.ProjectName=BLE_HealthThermometer
-ProjectManager.StackSize=0x400
+ProjectManager.StackSize=0x1000
ProjectManager.TargetToolchain=EWARM V8
ProjectManager.ToolChainLocation=
ProjectManager.UnderRoot=false
-ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-SystemClock_Config-RCC-false-HAL-false,4-MX_LPUART1_UART_Init-LPUART1-true-HAL-false,5-MX_USART1_UART_Init-USART1-true-HAL-false,6-MX_RF_Init-RF-false-HAL-true,7-MX_RTC_Init-RTC-false-HAL-true,8-MX_STM32_WPAN_Init-STM32_WPAN-false-HAL-true
+ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-SystemClock_Config-RCC-false-HAL-false,4-MX_LPUART1_UART_Init-LPUART1-true-HAL-false,5-MX_USART1_UART_Init-USART1-true-HAL-false,6-MX_RF_Init-RF-false-HAL-true,7-MX_RTC_Init-RTC-false-HAL-true,8-APPE_Init-STM32_WPAN-false-HAL-false
RCC.ADCFreq_Value=64000000
RCC.AHBFreq_Value=32000000
RCC.APB1Freq_Value=32000000
@@ -204,12 +210,12 @@ RCC.HSI48_VALUE=48000000
RCC.HSI_VALUE=16000000
RCC.I2C1Freq_Value=32000000
RCC.I2C3Freq_Value=32000000
-RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSE_VALUE,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PLLSourceVirtual,PWRFreq_Value,RNGFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LCDFreq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PLLSourceVirtual,PWRFreq_Value,RFWKPClockSelection,RFWKPFreq_Value,RNGFreq_Value,RTCClockSelection,RTCFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.LCDFreq_Value=32768
RCC.LPTIM1Freq_Value=32000000
RCC.LPTIM2Freq_Value=32000000
RCC.LPUART1Freq_Value=32000000
RCC.LSCOPinFreq_Value=32000
-RCC.LSE_VALUE=32768
RCC.LSI_VALUE=32000
RCC.MCO1PinFreq_Value=32000000
RCC.PLLPoutputFreq_Value=64000000
@@ -220,7 +226,11 @@ RCC.PLLSAI1QoutputFreq_Value=64000000
RCC.PLLSAI1RoutputFreq_Value=64000000
RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSI
RCC.PWRFreq_Value=32000000
+RCC.RFWKPClockSelection=RCC_RFWKPCLKSOURCE_LSE
+RCC.RFWKPFreq_Value=32768
RCC.RNGFreq_Value=32000
+RCC.RTCClockSelection=RCC_RTCCLKSOURCE_LSE
+RCC.RTCFreq_Value=32768
RCC.SAI1Freq_Value=64000000
RCC.SMPS1Freq_Value=16000000
RCC.SYSCLKFreq_VALUE=32000000
@@ -232,11 +242,6 @@ RCC.VCOOutputFreq_Value=128000000
RCC.VCOSAI1OutputFreq_Value=128000000
RF1.Mode=RF1_Activate
RF1.Signal=RF_RF1
-RTC.AsynchPrediv=CFG_RTC_ASYNCH_PRESCALER
-RTC.HourFormat=RTC_HOURFORMAT_24
-RTC.IPParameters=HourFormat,AsynchPrediv,SynchPrediv
-RTC.IPParametersWithoutCheck=AsynchPrediv,SynchPrediv
-RTC.SynchPrediv=CFG_RTC_SYNCH_PRESCALER
STM32_WPAN.BLE_APPLICATION_TYPE=BLE_SERVER_PROFILE
STM32_WPAN.BLE_CFG_DIS_FIRMWARE_REVISION_STRING=0
STM32_WPAN.BLE_CFG_DIS_HARDWARE_REVISION_STRING=0
@@ -264,8 +269,10 @@ STM32_WPAN.BT_SIG_HEALTH_THERMOMETER_SENSOR=Enabled
STM32_WPAN.BT_SIG_HEART_RATE_SENSOR=Disabled
STM32_WPAN.CFG_ADV_BD_ADDRESS=0x7257acd87a6c
STM32_WPAN.CFG_DEBUGGER_SUPPORTED=1
-STM32_WPAN.CFG_DEBUG_APP_TRACE=0
-STM32_WPAN.CFG_DEBUG_BLE_TRACE=0
+STM32_WPAN.CFG_DEBUG_APP_TRACE=1
+STM32_WPAN.CFG_DEBUG_BLE_TRACE=1
+STM32_WPAN.CFG_DEBUG_TRACE_LIGHT=1
+STM32_WPAN.CFG_DEBUG_TRACE_UART=hw_uart1
STM32_WPAN.CFG_FAST_CONN_ADV_INTERVAL_MAX=100
STM32_WPAN.CFG_FAST_CONN_ADV_INTERVAL_MAX_HEXA=0xa0
STM32_WPAN.CFG_FAST_CONN_ADV_INTERVAL_MIN=80
@@ -287,7 +294,7 @@ STM32_WPAN.CFG_RTCCLK_DIVIDER_CONF=0
STM32_WPAN.CUSTOM_P2P_SERVER=Disabled
STM32_WPAN.CUSTOM_TEMPLATE=Disabled
STM32_WPAN.DBG_TRACE_UART_CFG=hw_uart1
-STM32_WPAN.IPParameters=CFG_FAST_CONN_ADV_INTERVAL_MAX_HEXA,CFG_LP_CONN_ADV_INTERVAL_MAX_HEXA,LOCAL_NAME_FORMATTED,CFG_HW_LPUART1_ENABLED,CFG_DEBUG_BLE_TRACE,CFG_DEBUG_APP_TRACE,DBG_TRACE_UART_CFG,CFG_ADV_BD_ADDRESS,CFG_LP_CONN_ADV_INTERVAL_MAX,CFG_LP_CONN_ADV_INTERVAL_MIN,CFG_HW_LPUART1_DMA_TX_SUPPORTED,LOCAL_NAME,CFG_HW_USART1_ENABLED,CFG_LPM_SUPPORTED,CUSTOM_P2P_SERVER,BLE_DBG_DIS_EN,BLE_DBG_SVCCTL_EN,BT_SIG_HEALTH_THERMOMETER_SENSOR,BLE_CFG_DIS_MODEL_NUMBER_STRING,BLE_CFG_DIS_SYSTEM_ID,BLE_CFG_HTS_MEASUREMENT_INTERVAL,BLE_CFG_HTS_TEMPERATURE_INTERVAL_MAX_VALUE,BLE_DBG_HTS_EN,BLE_APPLICATION_TYPE,BT_SIG_BEACON,BT_SIG_BLOOD_PRESSURE_SENSOR,BT_SIG_HEART_RATE_SENSOR,CUSTOM_TEMPLATE,BLE_CFG_DIS_MANUFACTURER_NAME_STRING,BLE_CFG_DIS_SERIAL_NUMBER_STRING,BLE_CFG_DIS_HARDWARE_REVISION_STRING,BLE_CFG_DIS_FIRMWARE_REVISION_STRING,BLE_CFG_DIS_SOFTWARE_REVISION_STRING,BLE_CFG_DIS_IEEE_CERTIFICATION,BLE_CFG_DIS_PNP_ID,BLE_CFG_HTS_TEMPERATURE_TYPE_VALUE_STATIC,BLE_CFG_HTS_INTERMEDIATE_TEMPERATURE,BLE_CFG_HTS_MEASUREMENT_INTERVAL_IND_PROP,BLE_CFG_HTS_MEASUREMENT_INTERVAL_WR_PROP,BLE_CFG_HTS_TIME_STAMP_FLAG,BLE_CFG_HTS_TEMPERATURE_INTERVAL_MIN_VALUE,CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO,CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION,CFG_HW_RESET_BY_FW,CFG_DEBUGGER_SUPPORTED,CFG_FAST_CONN_ADV_INTERVAL_MIN,CFG_FAST_CONN_ADV_INTERVAL_MAX,CFG_IO_CAPABILITY,CFG_MITM_PROTECTION,CFG_RTCCLK_DIVIDER_CONF
+STM32_WPAN.IPParameters=CFG_FAST_CONN_ADV_INTERVAL_MAX_HEXA,CFG_LP_CONN_ADV_INTERVAL_MAX_HEXA,LOCAL_NAME_FORMATTED,CFG_HW_LPUART1_ENABLED,CFG_DEBUG_BLE_TRACE,CFG_DEBUG_APP_TRACE,DBG_TRACE_UART_CFG,CFG_ADV_BD_ADDRESS,CFG_LP_CONN_ADV_INTERVAL_MAX,CFG_LP_CONN_ADV_INTERVAL_MIN,CFG_HW_LPUART1_DMA_TX_SUPPORTED,LOCAL_NAME,CFG_HW_USART1_ENABLED,CFG_LPM_SUPPORTED,CUSTOM_P2P_SERVER,BLE_DBG_DIS_EN,BLE_DBG_SVCCTL_EN,BT_SIG_HEALTH_THERMOMETER_SENSOR,BLE_CFG_DIS_MODEL_NUMBER_STRING,BLE_CFG_DIS_SYSTEM_ID,BLE_CFG_HTS_MEASUREMENT_INTERVAL,BLE_CFG_HTS_TEMPERATURE_INTERVAL_MAX_VALUE,BLE_DBG_HTS_EN,BLE_APPLICATION_TYPE,BT_SIG_BEACON,BT_SIG_BLOOD_PRESSURE_SENSOR,BT_SIG_HEART_RATE_SENSOR,CUSTOM_TEMPLATE,BLE_CFG_DIS_MANUFACTURER_NAME_STRING,BLE_CFG_DIS_SERIAL_NUMBER_STRING,BLE_CFG_DIS_HARDWARE_REVISION_STRING,BLE_CFG_DIS_FIRMWARE_REVISION_STRING,BLE_CFG_DIS_SOFTWARE_REVISION_STRING,BLE_CFG_DIS_IEEE_CERTIFICATION,BLE_CFG_DIS_PNP_ID,BLE_CFG_HTS_TEMPERATURE_TYPE_VALUE_STATIC,BLE_CFG_HTS_INTERMEDIATE_TEMPERATURE,BLE_CFG_HTS_MEASUREMENT_INTERVAL_IND_PROP,BLE_CFG_HTS_MEASUREMENT_INTERVAL_WR_PROP,BLE_CFG_HTS_TIME_STAMP_FLAG,BLE_CFG_HTS_TEMPERATURE_INTERVAL_MIN_VALUE,CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO,CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION,CFG_HW_RESET_BY_FW,CFG_DEBUGGER_SUPPORTED,CFG_FAST_CONN_ADV_INTERVAL_MIN,CFG_FAST_CONN_ADV_INTERVAL_MAX,CFG_IO_CAPABILITY,CFG_MITM_PROTECTION,CFG_RTCCLK_DIVIDER_CONF,CFG_DEBUG_TRACE_UART,CFG_DEBUG_TRACE_LIGHT
STM32_WPAN.IPParametersWithoutCheck=CFG_LP_CONN_ADV_INTERVAL_MAX,CFG_LP_CONN_ADV_INTERVAL_MIN,BLE_CFG_HTS_TEMPERATURE_INTERVAL_MAX_VALUE
STM32_WPAN.LOCAL_NAME=HTSTM
STM32_WPAN.LOCAL_NAME_FORMATTED=,'H','T','S','T','M'
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Inc/app_common.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Inc/app_common.h
index 2a1d61089..4defc5d7a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Inc/app_common.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Inc/app_common.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : app_common.h
- * Description : App Common application configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : App Common application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Inc/app_conf.h
index 496b184de..d4e6428f3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Inc/app_conf.h
@@ -1,8 +1,9 @@
/**
******************************************************************************
* File Name : app_conf.h
- * Description : Application configuration file for BLE middleWare.
- ******************************************************************************
+ * Description : Application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
@@ -17,17 +18,18 @@
*/
/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef APP_CONFIG_H
-#define APP_CONFIG_H
+#ifndef APP_CONF_H
+#define APP_CONF_H
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Application Config
******************************************************************************/
-/**< generic parameters ********************************************************/
+/**< generic parameters ******************************************************/
/**
* Define Tx Power
@@ -92,6 +94,15 @@
*/
#define CFG_BLE_ERK {0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21,0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21}
+/* USER CODE BEGIN Generic_Parameters */
+/**
+ * SMPS supply
+ * SMPS not used when Set to 0
+ * SMPS used when Set to 1
+ */
+#define CFG_USE_SMPS 1
+/* USER CODE END Generic_Parameters */
+
/**< specific parameters */
/*****************************************************/
@@ -174,7 +185,7 @@
* 1 : internal RO
* 0 : external crystal ( no calibration )
*/
-#define CFG_BLE_LSE_SOURCE 1
+#define CFG_BLE_LSE_SOURCE 0
/**
* Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
@@ -380,12 +391,6 @@ typedef enum
#define CFG_LPM_SUPPORTED 0
#define CFG_DEBUGGER_SUPPORTED 1
#endif
-
-/* USER CODE BEGIN Defines */
-#define CFG_LED_SUPPORTED 1
-#define CFG_BUTTON_SUPPORTED 1
-/* USER CODE END Defines */
-
/**
* When CFG_DEBUG_TRACE_FULL is set to 1, the trace are output with the API name, the file name and the line number
* When CFG_DEBUG_TRACE_LIGHT is set to 1, only the debug message is output
@@ -422,6 +427,11 @@ typedef enum
#define DBG_TRACE_MSG_QUEUE_SIZE 4096
#define MAX_DBG_TRACE_MSG_SIZE 1024
+/* USER CODE BEGIN Defines */
+#define CFG_LED_SUPPORTED 1
+#define CFG_BUTTON_SUPPORTED 1
+/* USER CODE END Defines */
+
/******************************************************************************
* Scheduler
******************************************************************************/
@@ -489,7 +499,10 @@ typedef enum
typedef enum
{
CFG_LPM_APP,
- CFG_LPM_APP_BLE
+ CFG_LPM_APP_BLE,
+ /* USER CODE BEGIN CFG_LPM_Id_t */
+
+ /* USER CODE END CFG_LPM_Id_t */
} CFG_LPM_Id_t;
/******************************************************************************
@@ -499,6 +512,6 @@ typedef enum
#define CFG_OTP_END_ADRESS OTP_AREA_END_ADDR
-#endif /*APP_CONFIG_H */
+#endif /*APP_CONF_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Inc/stm32_lpm_if.h
index 38e326512..d8e67947f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Inc/stm32_lpm_if.h
@@ -1,46 +1,22 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file stm32_lpm_if.h
-* @brief Header for stm32_lpm_f.c module (device specific LP management)
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
******************************************************************************
* @attention
*
-* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics International N.V.
+* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted, provided that the following conditions are met:
-*
-* 1. Redistribution of source code must retain the above copyright notice,
-* this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following disclaimer in the documentation
-* and/or other materials provided with the distribution.
-* 3. Neither the name of STMicroelectronics nor the names of other
-* contributors to this software may be used to endorse or promote products
-* derived from this software without specific written permission.
-* 4. This software, including modifications and/or derivative works of this
-* software, must execute solely and exclusively on microcontroller or
-* microprocessor devices manufactured by or for STMicroelectronics.
-* 5. Redistribution and use of this software other than as permitted under
-* this license is void and will automatically terminate your rights under
-* this license.
-*
-* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
-* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
-* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+* This software component is licensed by ST under BSD 3-Clause license,
+* the "License"; You may not use this file except in compliance with the
+* License. You may obtain a copy of the License at:
+* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32_LPM_IF_H
@@ -89,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Inc/stm32wbxx_hal_conf.h
index 5c703f75d..31d63e37a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Inc/stm32wbxx_hal_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Inc/stm32wbxx_hal_conf.h
@@ -58,6 +58,7 @@
#define HAL_UART_MODULE_ENABLED
/*#define HAL_USART_MODULE_ENABLED */
/*#define HAL_WWDG_MODULE_ENABLED */
+#define HAL_EXTI_MODULE_ENABLED
#define HAL_CORTEX_MODULE_ENABLED
#define HAL_DMA_MODULE_ENABLED
#define HAL_FLASH_MODULE_ENABLED
@@ -221,6 +222,10 @@
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32wbxx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32wbxx_hal_flash.h"
@@ -333,9 +338,9 @@
* If expr is true, it returns no value.
* @retval None
*/
-#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
+ #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
/* Exported functions ------------------------------------------------------- */
-void assert_failed(uint8_t* file, uint32_t line);
+ void assert_failed(uint8_t* file, uint32_t line);
#else
#define assert_param(expr) ((void)0U)
#endif /* USE_FULL_ASSERT */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Inc/utilities_conf.h
index c98d97ba1..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Inc/utilities_conf.h
@@ -1,3 +1,4 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* File Name : utilities_conf.h
@@ -9,13 +10,14 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef UTILITIES_CONF_H
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/app_entry.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/app_entry.c
index d1bdfdfbb..97a6a8b82 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/app_entry.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/app_entry.c
@@ -69,8 +69,8 @@ static void SystemPower_Config( void );
static void Init_Debug( void );
static void appe_Tl_Init( void );
static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status );
-
static void APPE_SysUserEvtRx( void * pPayload );
+
#if (CFG_HW_LPUART1_ENABLED == 1)
extern void MX_LPUART1_UART_Init(void);
#endif
@@ -107,7 +107,7 @@ void APPE_Init( void )
/**
* From now, the application is waiting for the ready event ( VS_HCI_C2_Ready )
- * received on the system channel before starting the BLE Stack
+ * received on the system channel before starting the Stack
* This system event is received with APPE_SysUserEvtRx()
*/
/* USER CODE BEGIN APPE_Init_2 */
@@ -220,8 +220,6 @@ static void appe_Tl_Init( void )
return;
}
-
-
static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status )
{
UNUSED(status);
@@ -235,7 +233,7 @@ static void APPE_SysUserEvtRx( void * pPayload )
TL_TRACES_Init( );
APP_BLE_Init( );
- UTIL_LPM_SetOffMode(1 << CFG_LPM_APP, UTIL_LPM_ENABLE);
+ UTIL_LPM_SetOffMode(1U << CFG_LPM_APP, UTIL_LPM_ENABLE);
return;
}
@@ -285,7 +283,6 @@ void UTIL_SEQ_Idle( void )
return;
}
-
/**
* @brief This function is called by the scheduler each time an event
* is pending.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/hw_timerserver.c
index 52a1bfa0d..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/hw_timerserver.c
@@ -1,22 +1,21 @@
/**
******************************************************************************
- * File Name : hw_timerserver.c
- * Description : Hardware timerserver source file for BLE
- * middleWare.
+ * File Name : hw_timerserver.c
+ * Description : Hardware timerserver source file for STM32WPAN Middleware.
+ *
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/hw_uart.c
index 52e9e2b3a..9a553610d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/hw_uart.c
@@ -1,7 +1,7 @@
/**
******************************************************************************
* File Name : Src/hw_uart.c
- * Description : HW UART source file for BLE middleWare.
+ * Description : HW UART source file for STM32WPAN Middleware.
*
******************************************************************************
* @attention
@@ -48,7 +48,7 @@ extern UART_HandleTypeDef huart1;
hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
} while(0)
- /* Variables ------------------------------------------------------------------*/
+/* Variables -----------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
@@ -65,73 +65,73 @@ extern UART_HandleTypeDef huart1;
void (*HW_hlpuart1TxCb)(void);
#endif
- void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_RX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_RX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_RX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_RX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ return;
+}
+
+void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
{
- HAL_StatusTypeDef hal_status = HAL_OK;
- hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
+ default:
+ break;
}
switch (hal_status)
@@ -161,8 +161,8 @@ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t
hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
{
-HAL_StatusTypeDef hal_status = HAL_OK;
-hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
@@ -250,33 +250,33 @@ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
switch ((uint32_t)huart->Instance)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1RxCb)
- {
- HW_huart1RxCb();
- }
- break;
+ if(HW_huart1RxCb)
+ {
+ HW_huart1RxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1RxCb)
- {
- HW_hlpuart1RxCb();
- }
- break;
+ if(HW_hlpuart1RxCb)
+ {
+ HW_hlpuart1RxCb();
+ }
+ break;
#endif
default:
@@ -292,20 +292,20 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1TxCb)
- {
- HW_huart1TxCb();
- }
- break;
+ if(HW_huart1TxCb)
+ {
+ HW_huart1TxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1TxCb)
- {
- HW_hlpuart1TxCb();
- }
- break;
+ if(HW_hlpuart1TxCb)
+ {
+ HW_hlpuart1TxCb();
+ }
+ break;
#endif
default:
@@ -315,4 +315,4 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
return;
}
- /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/main.c
index 89612d53b..72d282bcf 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/main.c
@@ -41,10 +41,10 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "app_entry.h"
+#include "app_common.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
-#include "app_common.h"
#include "stm32_lpm.h"
#include "stm32_seq.h"
#include "dbg_trace.h"
@@ -110,6 +110,7 @@ int main(void)
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
+
/* MCU Configuration--------------------------------------------------------*/
@@ -137,6 +138,8 @@ int main(void)
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
+
+ /* Init code for STM32_WPAN */
APPE_Init();
/* Infinite loop */
@@ -161,17 +164,20 @@ void SystemClock_Config(void)
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
+ /** Configure LSE Drive Capability
+ */
+ __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
/** Configure the main internal regulator output voltage
*/
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
/** Initializes the CPU, AHB and APB busses clocks
*/
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSI1
- |RCC_OSCILLATORTYPE_HSE;
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE
+ |RCC_OSCILLATORTYPE_LSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ RCC_OscInitStruct.LSEState = RCC_LSE_ON;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
- RCC_OscInitStruct.LSIState = RCC_LSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
@@ -200,8 +206,8 @@ void SystemClock_Config(void)
|RCC_PERIPHCLK_LPUART1;
PeriphClkInitStruct.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2;
PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1;
- PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI;
- PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSI;
+ PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
+ PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSE;
PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSE;
PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE0;
@@ -357,7 +363,13 @@ static void MX_RTC_Init(void)
Error_Handler();
}
/* USER CODE BEGIN RTC_Init 2 */
- MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* Disable RTC registers write protection */
+ LL_RTC_DisableWriteProtection(RTC);
+
+ LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER);
+
+ /* Enable RTC registers write protection */
+ LL_RTC_EnableWriteProtection(RTC);
/* USER CODE END RTC_Init 2 */
}
@@ -367,6 +379,7 @@ static void MX_RTC_Init(void)
*/
static void MX_DMA_Init(void)
{
+
/* DMA controller clock enable */
__HAL_RCC_DMAMUX1_CLK_ENABLE();
__HAL_RCC_DMA2_CLK_ENABLE();
@@ -404,7 +417,13 @@ void PeriphClock_Config(void)
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
- LL_RCC_HSI48_Enable();
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
+ LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -437,30 +456,6 @@ void PeriphClock_Config(void)
HAL_RCCEx_CRSConfig(&RCC_CRSInitStruct);
#endif
- /**
- * Select LSE clock
- */
- LL_RCC_LSE_Enable();
- while(!LL_RCC_LSE_IsReady());
-
- /**
- * Select wakeup source of BLE RF
- */
- LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
-
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
/*************************************************************
@@ -567,21 +562,33 @@ static void Init_Exti( void )
* WRAP FUNCTIONS
*
*************************************************************/
-
-/**
- * This function is empty to avoid starting the SysTick Timer
- */
-HAL_StatusTypeDef HAL_InitTick( uint32_t TickPriority )
+void HAL_Delay(uint32_t Delay)
{
- return (HAL_OK);
-}
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
-/**
- * This function is empty as the SysTick Timer is not used
- */
-void HAL_Delay(__IO uint32_t Delay)
-{
- return;
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
}
/* USER CODE END 4 */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/stm32wbxx_hal_msp.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/stm32wbxx_hal_msp.c
index c6a106fa7..87614ca60 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/stm32wbxx_hal_msp.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/stm32wbxx_hal_msp.c
@@ -5,45 +5,15 @@
* Description : This file provides code for the MSP Initialization
* and de-Initialization codes.
******************************************************************************
- * This notice applies to any and all portions of this file
- * that are not between comment pairs USER CODE BEGIN and
- * USER CODE END. Other portions of this file, whether
- * inserted by the user or by software development tools
- * are owned by their respective copyright owners.
+ * @attention
*
- * Copyright (c) 2019 STMicroelectronics International N.V.
- * All rights reserved.
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted, provided that the following conditions are met:
- *
- * 1. Redistribution of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of other
- * contributors to this software may be used to endorse or promote products
- * derived from this software without specific written permission.
- * 4. This software, including modifications and/or derivative works of this
- * software, must execute solely and exclusively on microcontroller or
- * microprocessor devices manufactured by or for STMicroelectronics.
- * 5. Redistribution and use of this software other than as permitted under
- * this license is void and will automatically terminate your rights under
- * this license.
- *
- * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
- * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
- * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
*
******************************************************************************
*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/stm32wbxx_it.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/stm32wbxx_it.c
index e80b2598c..a13bff23c 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/stm32wbxx_it.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/Core/Src/stm32wbxx_it.c
@@ -60,21 +60,10 @@
/* USER CODE END 0 */
/* External variables --------------------------------------------------------*/
-
-
-
extern DMA_HandleTypeDef hdma_lpuart1_tx;
-
-
extern DMA_HandleTypeDef hdma_usart1_tx;
-
-
extern UART_HandleTypeDef hlpuart1;
-
-
extern UART_HandleTypeDef huart1;
-
-
/* USER CODE BEGIN EV */
/* USER CODE END EV */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/STM32_WPAN/App/app_ble.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/STM32_WPAN/App/app_ble.c
index 21e0d0110..a684101d7 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/STM32_WPAN/App/app_ble.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/STM32_WPAN/App/app_ble.c
@@ -219,6 +219,7 @@ PLACE_IN_SECTION("BLE_APP_CONTEXT") static BleApplicationContext_t BleApplicatio
PLACE_IN_SECTION("BLE_APP_CONTEXT") static uint16_t AdvIntervalMin, AdvIntervalMax;
static const char local_name[] = {AD_TYPE_COMPLETE_LOCAL_NAME ,'H','T','S','T','M'};
+
/* USER CODE BEGIN PV */
/* USER CODE END PV */
@@ -371,7 +372,10 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
/* restart advertising */
Adv_Request(APP_BLE_FAST_ADV);
-}
+ /* USER CODE BEGIN EVT_DISCONN_COMPLETE */
+
+ /* USER CODE END EVT_DISCONN_COMPLETE */
+ }
break; /* EVT_DISCONN_COMPLETE */
@@ -732,10 +736,7 @@ static void Adv_Request(APP_BLE_ConnStatus_t New_Status)
*/
HW_TS_Stop(BleApplicationContext.Advertising_mgr_timer_Id);
-#if(CFG_DEBUG_APP_TRACE != 0)
- APP_DBG_MSG("First index in %d state \n",
- BleApplicationContext.Device_Connection_Status);
-#endif
+ APP_DBG_MSG("First index in %d state \n", BleApplicationContext.Device_Connection_Status);
if ((New_Status == APP_BLE_LP_ADV)
&& ((BleApplicationContext.Device_Connection_Status == APP_BLE_FAST_ADV)
|| (BleApplicationContext.Device_Connection_Status == APP_BLE_LP_ADV)))
@@ -744,16 +745,12 @@ static void Adv_Request(APP_BLE_ConnStatus_t New_Status)
ret = aci_gap_set_non_discoverable();
if (ret == BLE_STATUS_SUCCESS)
{
-#if(CFG_DEBUG_APP_TRACE != 0)
- APP_DBG_MSG("Successfully Stopped Advertising\n");
-#endif
- }
+ APP_DBG_MSG("Successfully Stopped Advertising \n");
+ }
else
{
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("Stop Advertising Failed , result: %d \n", ret);
-#endif
- }
+ }
}
BleApplicationContext.Device_Connection_Status = New_Status;
@@ -770,34 +767,28 @@ static void Adv_Request(APP_BLE_ConnStatus_t New_Status)
BleApplicationContext.BleApplicationContext_legacy.advtServUUID,
0,
0);
- if (ret == BLE_STATUS_SUCCESS)
+ if (ret == BLE_STATUS_SUCCESS)
{
if (New_Status == APP_BLE_FAST_ADV)
{
- APP_DBG_MSG("Successfully Start Fast Advertising\n" );
+ APP_DBG_MSG("Successfully Start Fast Advertising \n" );
/* Start Timer to STOP ADV - TIMEOUT */
HW_TS_Start(BleApplicationContext.Advertising_mgr_timer_Id, INITIAL_ADV_TIMEOUT);
}
else
{
-#if(CFG_DEBUG_APP_TRACE != 0)
- APP_DBG_MSG("Successfully Start Low Power Advertising\n");
-#endif
- }
+ APP_DBG_MSG("Successfully Start Low Power Advertising \n");
+ }
}
else
{
if (New_Status == APP_BLE_FAST_ADV)
{
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("Start Fast Advertising Failed , result: %d \n", ret);
-#endif
}
else
{
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("Start Low Power Advertising Failed , result: %d \n", ret);
-#endif
}
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/STM32_WPAN/App/ble_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/STM32_WPAN/App/ble_conf.h
index 1650d89ae..d36d2104d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/STM32_WPAN/App/ble_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/STM32_WPAN/App/ble_conf.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : App/ble_conf.h
- * Description : Configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : Configuration file for BLE Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
@@ -49,7 +49,7 @@
* This shall take into account all registered handlers
* (from either the provided services or the custom services)
*/
-#define BLE_CFG_SVC_MAX_NBR_CB 5
+#define BLE_CFG_SVC_MAX_NBR_CB 7
#define BLE_CFG_CLT_MAX_NBR_CB 0
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/STM32_WPAN/App/ble_dbg_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/STM32_WPAN/App/ble_dbg_conf.h
index 689fe6962..6a6aa1ae9 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/STM32_WPAN/App/ble_dbg_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HealthThermometer/STM32_WPAN/App/ble_dbg_conf.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : App/ble_dbg_conf.h
- * Description : Debug configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : Debug configuration file for BLE Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/BLE_HeartRate.ioc b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/BLE_HeartRate.ioc
index 0d91c2850..4be91b01c 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/BLE_HeartRate.ioc
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/BLE_HeartRate.ioc
@@ -60,36 +60,42 @@ LPUART1.WordLength=UART_WORDLENGTH_8B
Mcu.Family=STM32WB
Mcu.IP0=DMA
Mcu.IP1=HSEM
+Mcu.IP10=TINY_LPM
+Mcu.IP11=USART1
Mcu.IP2=LPUART1
Mcu.IP3=NVIC
Mcu.IP4=RCC
Mcu.IP5=RF
Mcu.IP6=RTC
-Mcu.IP7=STM32_WPAN
-Mcu.IP8=SYS
-Mcu.IP9=USART1
-Mcu.IPNb=10
+Mcu.IP7=SEQUENCER
+Mcu.IP8=STM32_WPAN
+Mcu.IP9=SYS
+Mcu.IPNb=12
Mcu.Name=STM32WB55RGVx
Mcu.Package=VFQFPN68
-Mcu.Pin0=PA2
-Mcu.Pin1=PA3
-Mcu.Pin10=VP_RTC_VS_RTC_Activate
-Mcu.Pin11=VP_STM32_WPAN_VS_BLE_HOST
-Mcu.Pin12=VP_SYS_VS_Systick
-Mcu.Pin2=PA6
-Mcu.Pin3=RF1
-Mcu.Pin4=OSC_OUT
-Mcu.Pin5=OSC_IN
-Mcu.Pin6=PA11
-Mcu.Pin7=PB6
-Mcu.Pin8=PB7
-Mcu.Pin9=VP_HSEM_VS_HSEM
-Mcu.PinsNb=13
+Mcu.Pin0=PC14-OSC32_IN
+Mcu.Pin1=PC15-OSC32_OUT
+Mcu.Pin10=PB7
+Mcu.Pin11=VP_HSEM_VS_HSEM
+Mcu.Pin12=VP_RTC_VS_RTC_Activate
+Mcu.Pin13=VP_SEQUENCER_VS_SEQUENCER
+Mcu.Pin14=VP_STM32_WPAN_VS_BLE_HOST
+Mcu.Pin15=VP_SYS_VS_Systick
+Mcu.Pin16=VP_TINY_LPM_VS_TINY_LPM
+Mcu.Pin2=PA2
+Mcu.Pin3=PA3
+Mcu.Pin4=PA6
+Mcu.Pin5=RF1
+Mcu.Pin6=OSC_OUT
+Mcu.Pin7=OSC_IN
+Mcu.Pin8=PA11
+Mcu.Pin9=PB6
+Mcu.PinsNb=17
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32WB55RGVx
-MxCube.Version=5.2.1
-MxDb.Version=DB.5.0.21
+MxCube.Version=5.4.0
+MxDb.Version=DB.5.0.40
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false
NVIC.DMA1_Channel4_IRQn=true\:15\:0\:true\:false\:true\:false\:true
NVIC.DMA2_Channel4_IRQn=true\:15\:0\:true\:false\:true\:false\:true
@@ -142,6 +148,10 @@ PB7.GPIO_Speed=GPIO_SPEED_FREQ_VERY_HIGH
PB7.Locked=true
PB7.Mode=Asynchronous
PB7.Signal=USART1_RX
+PC14-OSC32_IN.Mode=LSE-External-Oscillator
+PC14-OSC32_IN.Signal=RCC_OSC32_IN
+PC15-OSC32_OUT.Mode=LSE-External-Oscillator
+PC15-OSC32_OUT.Signal=RCC_OSC32_OUT
PCC.Ble.ConnectionInterval=1000.0
PCC.Ble.DataLength=6
PCC.Ble.Mode=Advertising
@@ -164,7 +174,7 @@ ProjectManager.DeletePrevious=true
ProjectManager.DeviceId=STM32WB55RGVx
ProjectManager.FreePins=false
ProjectManager.HalAssertFull=false
-ProjectManager.HeapSize=0x200
+ProjectManager.HeapSize=0x400
ProjectManager.KeepUserCode=true
ProjectManager.LastFirmware=true
ProjectManager.LibraryCopy=2
@@ -174,11 +184,11 @@ ProjectManager.PreviousToolchain=
ProjectManager.ProjectBuild=false
ProjectManager.ProjectFileName=BLE_HeartRate.ioc
ProjectManager.ProjectName=BLE_HeartRate
-ProjectManager.StackSize=0x400
+ProjectManager.StackSize=0x1000
ProjectManager.TargetToolchain=EWARM V8
ProjectManager.ToolChainLocation=
ProjectManager.UnderRoot=false
-ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-SystemClock_Config-RCC-false-HAL-false,4-MX_LPUART1_UART_Init-LPUART1-true-HAL-false,5-MX_USART1_UART_Init-USART1-true-HAL-false,6-MX_RF_Init-RF-false-HAL-true,7-MX_RTC_Init-RTC-false-HAL-true,8-MX_STM32_WPAN_Init-STM32_WPAN-false-HAL-true
+ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-SystemClock_Config-RCC-false-HAL-false,4-MX_LPUART1_UART_Init-LPUART1-true-HAL-false,5-MX_USART1_UART_Init-USART1-true-HAL-false,6-MX_RF_Init-RF-false-HAL-true,7-MX_RTC_Init-RTC-false-HAL-true,8-APPE_Init-STM32_WPAN-false-HAL-false
RCC.ADCFreq_Value=64000000
RCC.AHBFreq_Value=32000000
RCC.APB1Freq_Value=32000000
@@ -186,6 +196,7 @@ RCC.APB1TimFreq_Value=32000000
RCC.APB2Freq_Value=32000000
RCC.APB2TimFreq_Value=32000000
RCC.APB3Freq_Value=16000000
+RCC.CK48CLockSelection=RCC_USBCLKSOURCE_HSI48
RCC.Cortex2Freq_Value=32000000
RCC.CortexFreq_Value=32000000
RCC.FCLK2Freq_Value=32000000
@@ -200,12 +211,12 @@ RCC.HSI48_VALUE=48000000
RCC.HSI_VALUE=16000000
RCC.I2C1Freq_Value=32000000
RCC.I2C3Freq_Value=32000000
-RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSE_VALUE,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PLLSourceVirtual,PWRFreq_Value,RNGFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,CK48CLockSelection,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LCDFreq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PLLSourceVirtual,PWRFreq_Value,RFWKPClockSelection,RFWKPFreq_Value,RNGCLockSelection,RNGFreq_Value,RTCClockSelection,RTCFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.LCDFreq_Value=32768
RCC.LPTIM1Freq_Value=32000000
RCC.LPTIM2Freq_Value=32000000
RCC.LPUART1Freq_Value=32000000
RCC.LSCOPinFreq_Value=32000
-RCC.LSE_VALUE=32768
RCC.LSI_VALUE=32000
RCC.MCO1PinFreq_Value=32000000
RCC.PLLPoutputFreq_Value=64000000
@@ -216,23 +227,23 @@ RCC.PLLSAI1QoutputFreq_Value=64000000
RCC.PLLSAI1RoutputFreq_Value=64000000
RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSI
RCC.PWRFreq_Value=32000000
-RCC.RNGFreq_Value=32000
+RCC.RFWKPClockSelection=RCC_RFWKPCLKSOURCE_LSE
+RCC.RFWKPFreq_Value=32768
+RCC.RNGCLockSelection=RCC_RNGCLKSOURCE_CLK48
+RCC.RNGFreq_Value=16000000
+RCC.RTCClockSelection=RCC_RTCCLKSOURCE_LSE
+RCC.RTCFreq_Value=32768
RCC.SAI1Freq_Value=64000000
RCC.SMPS1Freq_Value=16000000
RCC.SYSCLKFreq_VALUE=32000000
RCC.SYSCLKSource=RCC_SYSCLKSOURCE_HSE
RCC.USART1Freq_Value=32000000
-RCC.USBFreq_Value=64000000
+RCC.USBFreq_Value=48000000
RCC.VCOInputFreq_Value=16000000
RCC.VCOOutputFreq_Value=128000000
RCC.VCOSAI1OutputFreq_Value=128000000
RF1.Mode=RF1_Activate
RF1.Signal=RF_RF1
-RTC.AsynchPrediv=CFG_RTC_ASYNCH_PRESCALER
-RTC.HourFormat=RTC_HOURFORMAT_24
-RTC.IPParameters=HourFormat,AsynchPrediv,SynchPrediv
-RTC.IPParametersWithoutCheck=AsynchPrediv,SynchPrediv
-RTC.SynchPrediv=CFG_RTC_SYNCH_PRESCALER
STM32_WPAN.BLE_APPLICATION_TYPE=BLE_SERVER_PROFILE
STM32_WPAN.BLE_CFG_DIS_FIRMWARE_REVISION_STRING=0
STM32_WPAN.BLE_CFG_DIS_HARDWARE_REVISION_STRING=0
@@ -246,6 +257,7 @@ STM32_WPAN.BLE_CFG_DIS_SYSTEM_ID=0
STM32_WPAN.BLE_CFG_HRS_BODY_SENSOR_LOCATION_CHAR=1
STM32_WPAN.BLE_CFG_HRS_ENERGY_EXPENDED_INFO_FLAG=1
STM32_WPAN.BLE_CFG_HRS_ENERGY_RR_INTERVAL_FLAG=1
+STM32_WPAN.BLE_DBG_APP_EN=0
STM32_WPAN.BLE_DBG_DIS_EN=1
STM32_WPAN.BLE_DBG_HRS_EN=1
STM32_WPAN.BLE_DBG_SVCCTL_EN=1
@@ -257,6 +269,8 @@ STM32_WPAN.CFG_ADV_BD_ADDRESS=0x7257acd87a6c
STM32_WPAN.CFG_DEBUGGER_SUPPORTED=0
STM32_WPAN.CFG_DEBUG_APP_TRACE=0
STM32_WPAN.CFG_DEBUG_BLE_TRACE=0
+STM32_WPAN.CFG_DEBUG_TRACE_LIGHT=1
+STM32_WPAN.CFG_DEBUG_TRACE_UART=hw_uart1
STM32_WPAN.CFG_FAST_CONN_ADV_INTERVAL_MAX=100
STM32_WPAN.CFG_FAST_CONN_ADV_INTERVAL_MAX_HEXA=0xa0
STM32_WPAN.CFG_FAST_CONN_ADV_INTERVAL_MIN=80
@@ -268,7 +282,7 @@ STM32_WPAN.CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO=3
STM32_WPAN.CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO=0
STM32_WPAN.CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION=1
STM32_WPAN.CFG_HW_USART1_ENABLED=1
-STM32_WPAN.CFG_IO_CAPABILITY=CFG_IO_CAPABILITY_DISPLAY_ONLY
+STM32_WPAN.CFG_IO_CAPABILITY=CFG_IO_CAPABILITY_DISPLAY_YES_NO
STM32_WPAN.CFG_LPM_SUPPORTED=1
STM32_WPAN.CFG_LP_CONN_ADV_INTERVAL_MAX=0xFA0
STM32_WPAN.CFG_LP_CONN_ADV_INTERVAL_MAX_HEXA=0xfa0
@@ -278,7 +292,7 @@ STM32_WPAN.CFG_RTCCLK_DIVIDER_CONF=0
STM32_WPAN.CUSTOM_P2P_SERVER=Disabled
STM32_WPAN.CUSTOM_TEMPLATE=Disabled
STM32_WPAN.DBG_TRACE_UART_CFG=hw_uart1
-STM32_WPAN.IPParameters=P2P_SERVER_NUMBER,CFG_FAST_CONN_ADV_INTERVAL_MAX_HEXA,CFG_LP_CONN_ADV_INTERVAL_MAX_HEXA,LOCAL_NAME_FORMATTED,CFG_HW_LPUART1_ENABLED,CFG_DEBUG_BLE_TRACE,CFG_DEBUG_APP_TRACE,DBG_TRACE_UART_CFG,CFG_ADV_BD_ADDRESS,CFG_LP_CONN_ADV_INTERVAL_MAX,CFG_LP_CONN_ADV_INTERVAL_MIN,CFG_HW_LPUART1_DMA_TX_SUPPORTED,LOCAL_NAME,CFG_HW_USART1_ENABLED,CFG_LPM_SUPPORTED,L2CAP_REQUEST_NEW_CONN_PARAM,CUSTOM_P2P_SERVER,BT_SIG_HEART_RATE_SENSOR,CFG_DEBUGGER_SUPPORTED,BLE_DBG_DIS_EN,BLE_DBG_HRS_EN,BLE_DBG_SVCCTL_EN,BLE_APPLICATION_TYPE,BT_SIG_BEACON,BT_SIG_BLOOD_PRESSURE_SENSOR,BT_SIG_HEALTH_THERMOMETER_SENSOR,CUSTOM_TEMPLATE,BLE_CFG_DIS_MANUFACTURER_NAME_STRING,BLE_CFG_DIS_MODEL_NUMBER_STRING,BLE_CFG_DIS_SERIAL_NUMBER_STRING,BLE_CFG_DIS_HARDWARE_REVISION_STRING,BLE_CFG_DIS_FIRMWARE_REVISION_STRING,BLE_CFG_DIS_SOFTWARE_REVISION_STRING,BLE_CFG_DIS_SYSTEM_ID,BLE_CFG_DIS_IEEE_CERTIFICATION,BLE_CFG_DIS_PNP_ID,BLE_CFG_HRS_BODY_SENSOR_LOCATION_CHAR,BLE_CFG_HRS_ENERGY_EXPENDED_INFO_FLAG,BLE_CFG_HRS_ENERGY_RR_INTERVAL_FLAG,CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO,CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION,CFG_HW_RESET_BY_FW,CFG_FAST_CONN_ADV_INTERVAL_MIN,CFG_FAST_CONN_ADV_INTERVAL_MAX,CFG_IO_CAPABILITY,CFG_MITM_PROTECTION,CFG_RTCCLK_DIVIDER_CONF
+STM32_WPAN.IPParameters=P2P_SERVER_NUMBER,CFG_FAST_CONN_ADV_INTERVAL_MAX_HEXA,CFG_LP_CONN_ADV_INTERVAL_MAX_HEXA,LOCAL_NAME_FORMATTED,CFG_HW_LPUART1_ENABLED,CFG_DEBUG_BLE_TRACE,CFG_DEBUG_APP_TRACE,DBG_TRACE_UART_CFG,CFG_ADV_BD_ADDRESS,CFG_LP_CONN_ADV_INTERVAL_MAX,CFG_LP_CONN_ADV_INTERVAL_MIN,CFG_HW_LPUART1_DMA_TX_SUPPORTED,LOCAL_NAME,CFG_HW_USART1_ENABLED,CFG_LPM_SUPPORTED,L2CAP_REQUEST_NEW_CONN_PARAM,CUSTOM_P2P_SERVER,BT_SIG_HEART_RATE_SENSOR,CFG_DEBUGGER_SUPPORTED,BLE_DBG_DIS_EN,BLE_DBG_HRS_EN,BLE_DBG_SVCCTL_EN,BLE_APPLICATION_TYPE,BT_SIG_BEACON,BT_SIG_BLOOD_PRESSURE_SENSOR,BT_SIG_HEALTH_THERMOMETER_SENSOR,CUSTOM_TEMPLATE,BLE_CFG_DIS_MANUFACTURER_NAME_STRING,BLE_CFG_DIS_MODEL_NUMBER_STRING,BLE_CFG_DIS_SERIAL_NUMBER_STRING,BLE_CFG_DIS_HARDWARE_REVISION_STRING,BLE_CFG_DIS_FIRMWARE_REVISION_STRING,BLE_CFG_DIS_SOFTWARE_REVISION_STRING,BLE_CFG_DIS_SYSTEM_ID,BLE_CFG_DIS_IEEE_CERTIFICATION,BLE_CFG_DIS_PNP_ID,BLE_CFG_HRS_BODY_SENSOR_LOCATION_CHAR,BLE_CFG_HRS_ENERGY_EXPENDED_INFO_FLAG,BLE_CFG_HRS_ENERGY_RR_INTERVAL_FLAG,CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO,CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION,CFG_HW_RESET_BY_FW,CFG_FAST_CONN_ADV_INTERVAL_MIN,CFG_FAST_CONN_ADV_INTERVAL_MAX,CFG_IO_CAPABILITY,CFG_MITM_PROTECTION,CFG_RTCCLK_DIVIDER_CONF,CFG_DEBUG_TRACE_UART,BLE_DBG_APP_EN,CFG_DEBUG_TRACE_LIGHT
STM32_WPAN.IPParametersWithoutCheck=CFG_LP_CONN_ADV_INTERVAL_MAX,CFG_LP_CONN_ADV_INTERVAL_MIN
STM32_WPAN.L2CAP_REQUEST_NEW_CONN_PARAM=1
STM32_WPAN.LOCAL_NAME=HRSTM
@@ -310,8 +324,12 @@ VP_HSEM_VS_HSEM.Mode=HSEM_Activate
VP_HSEM_VS_HSEM.Signal=HSEM_VS_HSEM
VP_RTC_VS_RTC_Activate.Mode=RTC_Enabled
VP_RTC_VS_RTC_Activate.Signal=RTC_VS_RTC_Activate
+VP_SEQUENCER_VS_SEQUENCER.Mode=SEQUENCER_Enabled
+VP_SEQUENCER_VS_SEQUENCER.Signal=SEQUENCER_VS_SEQUENCER
VP_STM32_WPAN_VS_BLE_HOST.Mode=STM32_WPAN_Enabled
VP_STM32_WPAN_VS_BLE_HOST.Signal=STM32_WPAN_VS_BLE_HOST
VP_SYS_VS_Systick.Mode=SysTick
VP_SYS_VS_Systick.Signal=SYS_VS_Systick
+VP_TINY_LPM_VS_TINY_LPM.Mode=TINY_LPM_Enabled
+VP_TINY_LPM_VS_TINY_LPM.Signal=TINY_LPM_VS_TINY_LPM
board=custom
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Binary/BLE_HeartRate_reference.hex b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Binary/BLE_HeartRate_reference.hex
index 75fd89d8e..dd85505d2 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Binary/BLE_HeartRate_reference.hex
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Binary/BLE_HeartRate_reference.hex
@@ -1,1011 +1,1044 @@
:020000040800F2
-:10000000F0140020ED3D0008FD3B0008FF3B000818
-:10001000013C0008033C0008053C0008000000000B
-:10002000000000000000000000000000073C000885
-:10003000093C0008000000000B3C00080D3C0008D3
-:10004000093E00080D3E0008113E00084B3C000828
-:10005000153E0008193E00083F3C0008453C0008DA
-:100060001D3E0008213E0008393C0008253E0008DE
-:10007000293E00082D3E0008113C0008313E0008D2
-:10008000353E0008393E00083D3E0008413E00086C
-:10009000453E0008493E00084D3E0008513E00081C
-:1000A000553E0008593E00085D3E0008613E0008CC
-:1000B000653E0008693E00086D3E0008713E00087C
-:1000C000753E0008793E00087D3E0008813E00082C
-:1000D000173C00081D3C0008853E0008893E0008CA
-:1000E0008D3E0008913E0008953E0008993E0008AC
-:1000F000533C00084F3C00089D3E0008A13E00080C
-:10010000A53E0008A93E0008AD3E0008B13E00082B
-:10011000B53E0008B93E0008BD3E0008C13E0008DB
-:10012000C53E0008C93E0008233C0008CD3E00083B
-:10013000D13E0008D53E0008D93E00084FF0B0403F
+:10000000F8140020FD3F0008193E00081B3E0008C0
+:100010001D3E00081F3E0008213E000800000000B1
+:10002000000000000000000000000000233E000867
+:10003000253E000800000000273E0008293E000879
+:10004000194000081D40000821400008673E0008D4
+:1000500025400008294000085B3E0008613E00087A
+:100060002D40000831400008553E0008354000088A
+:10007000394000083D4000082D3E0008414000087E
+:1000800045400008494000084D4000085140000824
+:1000900055400008594000085D40000861400008D4
+:1000A00065400008694000086D4000087140000884
+:1000B00075400008794000087D4000088140000834
+:1000C00085400008894000088D40000891400008E4
+:1000D000333E0008393E000895400008994000086A
+:1000E0009D400008A1400008A5400008A940000864
+:1000F0006F3E00086B3E0008AD400008B1400008AC
+:10010000B5400008B9400008BD400008C1400008E3
+:10011000C5400008C9400008CD400008D140000893
+:10012000D5400008D94000083F3E0008DD400008E7
+:10013000E1400008E5400008E94000084FF0B04009
:10014000006800F0F000B02888BFB02070472DE9AB
-:10015000F041040066D0207881064FF0B04537D5D5
+:10015000F041040062D0207881064FF0B04533D5DD
:10016000A868E96810F00C0001F0030104D00C2825
-:1001700008BF012940F081802868800702D5E06926
-:1001800000284FD0FFF7DAFF616A884207D208469D
-:1001900000F056FB002819D100F056FA10E028684C
-:1001A00020F0F000014329606968206A21F47F4152
-:1001B00041EA00216960606A00F042FB002805D135
-:1001C00000F0D8FB002000F07FFD002840F0868181
-:1001D0002078C10711D5A868E96800F00C0008284C
-:1001E00001F0030103D00C2808BF032967D1286858
-:1001F000800302D56068002814D0217888071AD5BA
-:10020000A868E96800F00C00042801F0030104D09C
-:100210000C2808BF022940F087802868400503D5D4
-:10022000E068002800F05A816968206921F0FE41E9
-:1002300041EA006169602168DFF89C6611F0180FDF
-:1002400000F076816069002800F0A880C906706817
-:1002500040F19580800707D4706840F0010000F0FD
-:100260000CFA07467068800700F13A8100F030FD13
-:10027000C01B0328F6D30320DFE1E06978B12968C9
-:1002800041F0010100F0D2FA06462868800700F12B
-:10029000368100F01DFD801B0328F6D3EBE72868AC
-:1002A0004008400000F0E3F90646286800F0C8F96D
-:1002B0008ED000F00DFD801B0328F6D3DBE76068CD
-:1002C000B0F5803F06D0B0F5A02F296807D141F4E2
-:1002D00080212960286840F48030286006E021F4FD
-:1002E000803129602A6822F480222A60606860B127
-:1002F00000F0EEFC0646286880033FF57EAF00F074
-:10030000E7FC801B6528F6D3B5E700F0E1FC064664
-:100310002868400C10F001003FF46FAF00F0D8FCEB
-:10032000801B6528F4D3A6E7E06878B1296841F41A
-:10033000807100F07BFA06462868400500F1E280F3
-:1003400000F0C6FC801B0328F6D394E7286820F44D
-:10035000807000F08CF906462868800A10F00100D1
-:100360003FF469AF00F0B4FC801B0328F4D382E7AC
-:1003700000F0AEFCC01B0328C0F0D6807BE740F045
-:10038000010000F07AF907467068800700F1E78005
-:1003900000F09EFCC01B0328F6D36CE7706820F0C9
-:1003A000040000F06AF907467068C00810F0010008
-:1003B00000F0E48000F08CFCC01B0428F4D35AE762
-:1003C0000528306806D140F004003060316841F003
-:1003D000010105E0400840003060316821F004016F
-:1003E0003160A06841F2893768B100F071FC804645
-:1003F0003068800700F1D78000F06AFCA0EB0800AD
-:10040000B842F5D337E700F063FC8046306800F06F
-:1004100017F900F0C88000F05BFCA0EB0800B842C0
-:10042000F4D328E700F054FCC01B0328C0F0C980B7
-:1004300021E7B06840084000B06000F049FC074682
-:10044000B06800F0FDF800F0C08000F041FCC01B77
-:100450000328F5D30FE700F03BFC801B0328C0F016
-:10046000C68008E700F034FC001B0328C0F0E080E1
-:1004700001E7E968DFF8640489088900E960E96850
-:100480000140E96000F024FC044600F0EBF823D0C2
-:1004900000F01EFC001B0328F7D3ECE6E868226B93
-:1004A00000F00301914202BF00F07001626B9142C3
-:1004B00014D1A26BC0F30621914202BF00F478115F
-:1004C000E26B91420AD1226C00F06061914202BF5E
-:1004D00000F06040616C884200F0AE800120ACE02A
-:1004E000706840F0040000F0C8F807467068000724
-:1004F00010D400F0EDFBC01B0428F7D3BBE600F0DE
-:10050000A3F865E66868216920F0FE4040EA0160D2
-:10051000686090E67068A16920F4706040EA01208C
-:10052000706000F0A7F8074600F089F87FF420AF6C
-:100530002078410737D5DFF8A8733868C10529D47A
-:1005400000F0CCFB00F0C4FB80463868C10521D424
-:1005500000F0BEFBA0EB08000328F6D38BE6706822
-:1005600020F0040070607068C00810F00100DFD057
-:1005700000F0AEFBC01B0428F5D37CE600F07AF84F
-:10058000074600F05CF8D3D000F0A2FBC01B0328A4
-:10059000F7D370E6A06801287FF412AF306840F00E
-:1005A000010030601DE7217848060ED5A06A0028BA
-:1005B0003FF43FAFB16841F00101B16000F088FB4A
-:1005C0000746B06880077FF52DAFE06AA0B3A96841
-:1005D00001F00C010C293FF461AF0228286820F0DB
-:1005E000807028607FF445AF00F072FB064600F093
-:1005F00039F87FF430AFE968DFF8E802A26B014018
-:10060000206B0143606B0143E06B41EA022101432F
-:10061000206C0143606C0143E960286840F0807001
-:100620002860E96841F08051E96000F051FB044620
-:10063000286880017FF516AF0020BDE8F081706862
-:10064000400810F0010070472968606A21F0F0014D
-:10065000014329606868216A20F47F4040EA012054
-:10066000686070472868400E10F0010070472860ED
-:1006700000F02EBB706840084000706000F028BB9E
-:100680002DE9F8430400884644D0DFF85C6200F0AE
-:10069000C8F847D200F0CDF8074600F0C2F841D0C4
-:1006A00000F016FBC01B0228F7D90320B7E000F0CA
-:1006B0000FFB401B022843D9F7E700F009FBA0EB32
-:1006C000090002284CD9F0E700F002FBA0EB09007A
-:1006D000022854D9E9E700F0FBFA401B02285DD953
-:1006E000E3E700F0F5FA401B022867D9DDE700F0E8
-:1006F000EFFA401B484577D3D7E7032802D1396882
-:10070000890103E00028396802D1890762D401E039
-:1007100049055FD4012082E000F0DAFAC01B02280C
-:1007200072D9C2E7207881074FF0B0470BD5B9687E
-:10073000A06821F0F0010143B96000F0C9FA054654
-:10074000B868C003B3D52078DFF8885181060AD590
-:100750002968606921F0F001014300F067F88146E3
-:1007600028688003A9D5207841060BD52968A0699F
-:100770000909090141EA101100F058F8814628687A
-:10078000C003A1D5207841070BD5B968E06821F4F2
-:10079000E0610143B96000F09BFA0546B868800348
-:1007A00099D5207801070CD5B868216920F46050EC
-:1007B00040EAC100B86000F08BFA0546B868400313
-:1007C0008FD52078C10717D56068022895D1396880
-:1007D00089039FD5B968890840EA8100B86041F271
-:1007E000893900F075FA0546B868616800F00C00B8
-:1007F000B0EB810F7FF47BAF306800F007008045DD
-:1008000005D200F016F8074600F00BF884D100F08E
-:10081000B1F800F07FFABDE8F24300F055BABDE848
-:10082000F283306800F0070040457047296000F00F
-:100830004FBA3168C90848EAC101316000F048BACE
-:1008400070B52A49B1282EBFCC6AC0F3031051F805
-:1008500020402048056800F079FA2549254A05F02E
-:100860000F0551F82510B4FBF1F10024B1FBF2F1B2
-:10087000B0F5007F0FF29C02204609D10FF27803F9
-:1008800053F820508D4214D2401C0328F8D912E0AE
-:100890000FF2740353F820508D420AD2401C0328F3
-:1008A000F8D308E000F014FA801B03280BD30320D0
-:1008B00070BD52F820400C4D2868C00844EAC000C2
-:1008C000FFF7D5FE0646296801F00701A142E9D1EC
-:1008D000002070BD0801005890000058FFFFFEEE98
-:1008E000000400588C80C11100400058500A0008D4
-:1008F000100A000840420F0012000000240000000F
-:100900003600000040000000060000000C0000005F
-:1009100010000000000000000100000002000000C4
-:10092000040000003249002008604FF4E022314802
-:10093000016841F4700101604FF0B041086840F077
-:10094000010008608A602C480A6802402B480A604F
-:10095000036823F0050303604268520852004260B6
-:1009600000222748C8600861086820F480200860D9
-:100970008A6170474FF0B0410FF2D4000A68C2F3A9
-:10098000031250F822008A6802F00C02042A04D0F4
-:10099000082A04D00C2A04D01CE01A481AE01A488D
-:1009A00018E0CA68CB68C3F3021302F003025B1CB1
-:1009B000022A08BF134802D0032A08BF1248B0FB1E
-:1009C000F3F2C868CB68C0F306205B0F42435B1CA0
-:1009D000B2FBF3F00D4A0FF238031060886811681B
-:1009E000C0F3031053F82000B1FBF0F01060704723
-:1009F00008ED00E088ED00E0FBFEF6FA94000058F8
-:100A0000001004220024F4000048E8015C000020EB
-:100A100001000000030000000500000001000000CC
-:100A200001000000060000000A0000002000000095
-:100A30000200000004000000080000001000000098
-:100A400040000000800000000001000000020000E3
-:100A5000A0860100400D0300801A060000350C003E
-:100A600040420F0080841E0000093D0000127A0001
-:100A70000024F40000366E010048E801006CDC023E
-:100A80000000000000000000000000000000000066
-:100A9000824900E0824981B00A6802430A6009681D
-:100AA00008400090009801B0704710B500F01EF9A2
-:100AB0007C4C606840010ED56068C0000BD400F02B
-:100AC0000DF900F00BF9206840F4803020602168B7
-:100AD00021F48031216000F0BFF8002000F03EF9E1
-:100AE00040B180797049E160E16821F47C5141EACC
-:100AF0000021E16000F044F800F090F86B486C4C85
-:100B0000016800220260026902F0500202610120C5
-:100B1000FFF7C0FF0220FFF7BDFF0420FFF7B8FF7B
-:100B20000120FFF7B5FF0220FFF7B2FF00220F21DF
-:100B30000E2000F041F90E2000F05BF900220F2199
-:100B40003A2000F039F93A2000F053F900215948D1
-:100B500041600F218160046047F6FF71C160002190
-:100B600001618161C16100F085F9A068C008C00021
-:100B7000A06000F02EFA4FF0FF3000F0CBFAFAE759
-:100B800080B5AEB01CA8482100F098FB01A81C213C
-:100B900000F094FB08A8502100F090FB4648016843
-:100BA00021F4C06141F4007101600B21006800F480
-:100BB000C06000904FF4803200981C914FF4807018
-:100BC0001F90402120910520219000211D92279106
-:100BD0001CA8FFF7BCFA6F200190022100200291AF
-:100BE00003900490059006900790012101A8FFF75B
-:100BF00047FD43F60300089000210E910F914FF43A
-:100C000000404FF4007119901891002002211B90B0
-:100C10001A9108A800F06CFB2FB000BD274881682E
-:100C200041F00101816081688907FCD5C16821F428
-:100C3000404141F48041C160C16849084900C16038
-:100C4000016941F00101016101698907FCD5016871
-:100C500021F0406101607047194881B0016841F49A
-:100C6000801101603F21006800F48010009000981E
-:100C7000144841604161016841F47C1101600269DE
-:100C800042F47C120261016841F03F010160026997
-:100C900042F03F02026101B0704700004800005876
-:100CA0004C00005890000058FECAFECA8008005848
-:100CB000002800401004002000040058880000585C
-:100CC00050000058040C0058002070477047000086
-:100CD00001480068704700BF4400002002480168D6
-:100CE00041F480710160704700040058144810B549
-:100CF000016841F480710160032000F050F8002089
-:100D0000FFF7E2FF0024002814BF012400F054FC88
-:100D1000204610BD0B48406870470B480BE00A485E
-:100D2000016821F00201016070470748016821F065
-:100D3000040101607047016849084900016070477B
-:100D40000040005844000020042004E0DFF80800C0
-:100D5000006800F4C060704700040058014606486F
-:100D6000064AC3798B4218BF904218BF0838F8D1A1
-:100D70008B4218BF00207047F873FF1F0070FF1FE1
-:100D80000901020081B002D43248815405E03248A2
-:100D900002F00F02104400F8041C01B070472F4A03
-:100DA00013684FF6FF0100020B4000F4E0601843A7
-:100DB0002B4908431060704738B5284B1C68C4F3B2
-:100DC0000223C3F10704052C28BF04241D1D072D91
-:100DD00034BF0023DB1E012505FA04F4641E214004
-:100DE000994005FA03F35B1E1A401143BDE83440F5
-:100DF000C6E7010007D4012200F01F01194B8A4009
-:100E0000400943F82020704701000BD4012200F074
-:100E10001F01154B8A40400943F82020BFF34F8F34
-:100E2000BFF36F8F7047010007D4012200F01F014C
-:100E30000E4B8A40400943F820207047010007D438
-:100E4000012200F01F010A4B8A40400943F820208C
-:100E50007047000000E400E018ED00E00CED00E059
-:100E60000000FA0500E100E080E100E000E200E0BF
-:100E700080E200E038B5040044D094F8210028B99D
-:100E8000002184F82010204600F0A3FB00F049F870
-:100E9000FF2510B100F03FF834E02168DFF8B00022
-:100EA0008A6802408A6021688A686368206903430F
-:100EB000A06903431A438A602168E06808612068DA
-:100EC0000169A26841EA024101612068C16821F01C
-:100ED0008001C1602068C16C89088900C1642168F3
-:100EE000CA6CE369606903431A43CA642068816875
-:100EF000880609D400F020F830B12068456204214A
-:100F000000F01FF8012032BD20684562012184F8FD
-:100F10002110002032BD20684562042184F8211090
-:100F20007047022084F82100CA20216848625320BB
-:100F300022685062204626E020460BE02068C0F878
-:100F4000248084F82110002084F8200070470000DD
-:100F5000BFFF8FFF70B5044640F2E9362068C168D4
-:100F600021F0A001C160FFF7B3FE05462068C1680B
-:100F7000880606D4FFF7ACFE401BB042F6D3032030
-:100F800070BD002070BD70B504462068C1684A0677
-:100F900012D44FF0FF32C26040F2E936FFF798FEFC
-:100FA00005462068C168480606D4FFF791FE401B3D
-:100FB000B042F6D3032070BD002070BD3A4981B025
-:100FC0000A6802430A60096808400090009801B06E
-:100FD000704710B5354C88B0206840F40040206060
-:100FE00000F018FB3249002000F0C1FC68461421D3
-:100FF00000F064F90020029003214FF4604000905B
-:1010000001910120FFF7DAFF69464FF0904000F0B0
-:10101000EDFD606C400840006064182100910220E2
-:10102000FFF7CCFF6946234800F0E0FD606C20F03C
-:1010300002006064FFF771FEFFF771FEFFF775FEB7
-:101040000121012000F0EBFA0121002000F0B7FEA1
-:101050000121012000F0B3FE0121022000F0AFFECB
-:1010600000F0FEFE144A0021082000F0B6F8134CF0
-:101070000FF24D01019104F23C50009069460FF2CD
-:10108000450000F0D9FF04F25470029004F5C961E4
-:1010900040F23C5005900391049402A800F063FFD5
-:1010A00000F0DCFE08B010BD4C00005808000058ED
-:1010B00010040020000400487B20000820000320CA
-:1010C0007047000080B500F086FF01F04FF8BDE8E2
-:1010D00004400021012000F0A2BA00F0B4BA4FF0A1
-:1010E000FF3000F017B80021082000F083B802207C
-:1010F00000F0A2B8022000F0A7B8012805D002280D
-:1011000005D0102805D101F0D0B801F0D0B801F019
-:10111000D2B870472DE9FC47554CDFF85891A569C6
-:101120002840A0614FF0010A4FF0FF3830E0491C21
-:1011300054F831000642FAD004EBC1071840796830
-:101140001040014208BFC7F804807E68304000F0BC
-:1011500093F860620AFA00F086437E60EFF3108134
-:1011600072B6626A20690AFA02F2D2431040206124
-:10117000022004EBC00353F8086C1640401E43F8ED
-:10118000086CF6D181F31088606A59F820108847FE
-:1011900063692069A2691840104207D0E069216A9A
-:1011A000084203D1002103EA0206C1E701F008FA70
-:1011B000EFF3108972B6216960690140A0690142AC
-:1011C00001BFE169206A0142FFF787FF89F31088B8
-:1011D00001F0F7F9A561BDE8F38738B51446EFF3E0
-:1011E000108572B600F048F8224941F8204085F396
-:1011F000108831BD10B5EFF3108272B61C4B1C691C
-:1012000004431C6153F83140204343F8310082F31A
-:10121000108810BDEFF3108172B6154A536923EAA6
-:10122000000005E0EFF3108172B6114A53691843CC
-:10123000506181F310887047EFF3108172B60C4A49
-:10124000D3691843D061F4E770B5094C656A266A22
-:101250002062012101FA05F502E02846FFF73FFF71
-:10126000216AE0690842F8D088432662E06170BDD7
-:101270001C000020A402002002460020110C0904DA
-:1012800004BF1020120412F07F4F04BF0830120276
-:101290000FF2180112F0704F04BF001D1201120F5F
-:1012A000C0F11F00895C401A70470000040302026D
-:1012B000010101010000000000000000002201F017
-:1012C00081B90000DFF8EC120A68030903F47F23F8
-:1012D00000019A4300F47F2000F068B9DFF8D422BF
-:1012E0001368010C23EA014343EA0043136070478B
-:1012F0002DE9F843054600262878DFF8B872410644
-:10130000B0464FF0B0442DD5286B70B1B0F5800FCA
-:1013100006D0B0F5000F18BFB0F5400F17D01FE092
-:10132000E06840F48030E060C5E0206820F0806034
-:101330002060FFF7CDFC81462068000140F1A880C5
-:10134000FFF7C6FCA0EB09000228F5D90326AFE0A1
-:10135000FFF7BEFCA0EB0900022840F2A180F5E7F0
-:101360000126B0462868010531D5B86800F44078F8
-:10137000286C80452AD0FFF7B1FCB8F1000FB9689E
-:1013800005D1286C21F440710143B9601EE0B868B2
-:1013900040F48030B86021F44071B86820F48030A7
-:1013A000B860286C0143B960B868C0070ED5FFF774
-:1013B0008FFC804641F28939B868800706D4FFF770
-:1013C00087FCA0EB08004845F6D30326B0462878F2
-:1013D000C10705D53968A869890840EA81013960E3
-:1013E0002878810705D53968E86921F4406101430F
-:1013F00039602878C10644BFA86AFFF76FFF2878D4
-:10140000810644BFE86AFFF769FF2878410744BFB7
-:10141000286AFFF757FF2878010744BF686AFFF77B
-:1014200051FF2868C1055CD53968686B21F04061BF
-:1014300001433960686BB0F1006F03D1E16841F09E
-:101440008071E160686BB0F1806F4AD100F0A0F864
-:1014500006462068000135D5FFF73AFC801B0228BC
-:10146000F7D94FF003083CE0FFF732FC801B02285D
-:1014700030D9F6E7FFF72CFC801B022852D94FF039
-:10148000030861E0FFF724FC801B022855D9F6E72A
-:1014900000F075F8A86821F4781100F07FF8814613
-:1014A000206800017FF554AF21696869014321611B
-:1014B00030007FF456AF3968286B21F440010143B6
-:1014C00039604FE700F05BF8E86821F0606100F0F8
-:1014D00065F8064620680001C6D5216968690143A0
-:1014E00021612868810505D53968A86B21F0404144
-:1014F000014339602868410526D53968E86B21F039
-:10150000405101433960E86BB0F1005F03D1E168FD
-:1015100041F48031E160E86BB0F1805F14D100F0FC
-:1015200037F8064620680001A4D400F028F828699E
-:1015300021F0604100F032F8064620680001A1D594
-:1015400021696869014321612868C10405D5F968EA
-:10155000686C21F440410143F960286881040BD58F
-:10156000616AE86C21F0300101436162616AA86C34
-:10157000890840EA810161624046BDE8F283206942
-:10158000696820F4FE4040EA01202061216970472B
-:10159000216821F080612160FFF79ABB014321613E
-:1015A000206840F080602060FFF792BB1043086025
-:1015B0007047000088000058134881B0016841F46A
-:1015C00000210160006800F400200090009801B044
-:1015D000704710B504460D492068884213D1FFF7C3
-:1015E0007DFBFFF77BFB0A48016821F4407141F461
-:1015F00080710160026842F4004202602046BDE84A
-:10160000104001F005B810BD5000005800280040FF
-:10161000900000581948002101604160704710B5E2
-:1016200000F00CF85C6819B1012904D1204301E0F5
-:1016300024EA0000586082F3108810BDEFF3108296
-:1016400072B60E4B704738B5EFF3108472B60B4983
-:101650000B4D086820B129688847686880470AE010
-:10166000486820B1A9688847E868804703E028698E
-:1016700080476869804784F3108831BDB00400203A
-:10168000D43D0008DFF83C150A6892B200E002463B
-:10169000086880B28242FAD170472DE9FC410446C5
-:1016A0001825DFF82485DFF82465684308EB000778
-:1016B0003078062808D131787170347078754FF021
-:1016C000FF307060002039E000F077F8B968091841
-:1016D000B96008F10803B96832786A439A589142B0
-:1016E000327813D308F1150315FB02FC13F80C3004
-:1016F000062B25D008F108066B43F358994222BF08
-:1017000008F115036A439A5CEED219E0114633786A
-:1017100069439A420BD008F1140308F1150C5B5C85
-:1017200015FB03F50CF805407A753B7500E07A75FA
-:1017300008F114025454317871703470BDE8F681A8
-:101740001146694308F115035B5C062B04D008F1D0
-:10175000140615FB03F574557B753A7508F11502EF
-:101760005454EBE7F8B5DFF86434DFF85C541E78C6
-:10177000182402466243B0422A4404D118785870B3
-:10178000507D18700FE0167D507D92F815C005F160
-:1017900015076643062807F806C004D0167D1435E1
-:1017A00014FB00F42E55012010731878062802BF90
-:1017B00000294FF0FF315960F1BD10B5DFF80C443E
-:1017C000606810F1010F0FD0FFF75CFF6168DFF870
-:1017D0000024814261683CBF5388C918081A5178B7
-:1017E00048431178C84000E0002080B210BD2DE9C8
-:1017F000F84FDFF8DC53DFF8DCB3D5F80880D8F811
-:101800000000DBF800104A0500F090F9DFF8BC6337
-:10181000DFF8B4A321F4806181604FF018093478B7
-:101820000AF1080019FB04F14758FFF7C6FF874289
-:1018300017D200270121B170062C3DD019FB04F40A
-:101840000AF108010AF108020959814223BF0AF18D
-:1018500008010959091A002111510AEB04014C7DB4
-:10186000EAE7A9884118B94202D2AF880021E2E72D
-:101870003F1ADFE7022802DA2878012800D07F1E0D
-:10188000D8F80000C1684A07FAD500F055F9DBF82E
-:101890000C00000CBFB247EA0047CBF80C70FFF712
-:1018A000F1FE7060A8680068816841F48061816021
-:1018B000AFF30080BDE8F18FB8B20028DAD1FFF7AE
-:1018C000E1FE70600320BDE8F24FFFF7ACBA2DE9EE
-:1018D000F843EFF3108872B6BD4DBB4BA8680168A2
-:1018E000CA224A6253204862B84A886820F480605D
-:1018F000886018201678374647431F44387B0228F3
-:1019000026D13C68D7F810909078F0B17A7B012A04
-:101910000AD101213046FFF725FF88F31088796846
-:10192000304600F016F904E088F31088304600F0E5
-:10193000C1F8A8680068CA21416222465321416269
-:101940004846314600F050F90BE0FFF750FF06E043
-:10195000C8684207FCD500F07EF89F49086088F30C
-:101960001088FF21A86802685162BDE8F183F8B5CC
-:10197000974CA160CA2209684A6253224A62954A7A
-:10198000136843F020031360136803F00703C3F1E7
-:101990000403237095682D0C05F07F056D1C6570A0
-:1019A000EDB29268C2F30E02521C628092B2521ED5
-:1019B0006A43A2F5A072DA404FF6FF739A422CBF39
-:1019C000A380A280854A136843F400231360844BEC
-:1019D0001D6845F400251D6048BB7C487A4E0123F4
-:1019E000837018254FF0FF33436000235FFA83FCB8
-:1019F00006F10C0715FB0CFC4FF0000E07F80CE08D
-:101A00005B1CDFB2062FF1DB06230370886820F42D
-:101A10008060886000F01FF8D0600320FFF70EFAA6
-:101A2000A1680868826842F48042826005E0C86864
-:101A3000410544BF0320FFF7F6F9A1680A68FF20BB
-:101A40005062002203210320FFF7B6F9BDE8F240FF
-:101A50000320FFF7CEB9C86800F0800060F4906002
-:101A6000C8604FF400207047F0B504460025EFF33E
-:101A7000108672B61827DFF850C10CF10C0007FB76
-:101A800005FE10F80E0010B16D1C062DF5DB062DBD
-:101A90000CD06F430CEB07000127077386F3108807
-:101AA0000461427303600D700020F0BD86F310885E
-:101AB0000120F0BDF8B50746EFF3108472B603209D
-:101AC000FFF7A2F9424DAE683068CA2141623A463A
-:101AD00053214162182043494243895C02291BD1AA
-:101AE00000213846FFF73EFE3848017806290ED11E
-:101AF000306838490A68530500F018F821F480610D
-:101B00008160C1684A07FCD500F016F804E040780F
-:101B1000884218BFFFF76BFEA9680A68FF20506271
-:101B20000320FFF766F984F31088F1BD02D5C16880
-:101B30004A07FCD481687047C16801F0800161F4F4
-:101B40009061C1604FF40020234908600320FFF733
-:101B500075B92DE9F04180460F46424618201A49D2
-:101B600042438C18207B022804BF4046FFF7A2FFA7
-:101B7000EFF3108572B60320FFF746F9144EB068F4
-:101B80000068CA2141625321416202202073A7608C
-:101B900067604046FFF781FD0C490A784978914219
-:101BA00002D0FFF724FE02E0A168081AA060FF201F
-:101BB000B1680A6850620320FFF71BF985F31088AB
-:101BC000BDE8F08128280040FC000020D804002057
-:101BD000A4040020082800400C0800580008005801
-:101BE0008008005808010020104700002DE9F84F38
-:101BF0004FF0000C644A654BDFF894814FF00F09F9
-:101C000082460F4633E0634DAA4514BF07250425DD
-:101C10008D40254348F82E50C1431C6801EA040E4C
-:101C20007C68E50348BF40EA0E0EC3F800E05C683C
-:101C300001EA040E7C68A50348BF40EA0E0EC3F813
-:101C400004E0146801EA040E7C68E50248BF40EA3B
-:101C50000E0EC2F800E0546801EA040E79688C02A6
-:101C600048BF40EA0E0EC2F804E00CF1010C3968DE
-:101C700031FA0CF000F07C80012000FA0CFE1EEA24
-:101C80000100F2D07C68022C18BF122C4FEA8C01A4
-:101C900010D14FEADC040AEB840401F01C05266A2B
-:101CA00009FA05FB26EA0B06D7F810B00BFA05F582
-:101CB000354325624FEA4C040325DAF8006097F8B3
-:101CC00004B0A540ED430BF0030B2E400BFA04FBD0
-:101CD0004BEA0606CAF800607E68012E18BF022E85
-:101CE00003D0112E18BF122E17D1DAF80860D7F8DA
-:101CF0000CB02E400BFA04FB4BEA0606CAF808604B
-:101D0000DAF8046026EA0E0E7E68C6F3001606FABC
-:101D10000CF646EA0E06CAF80460DAF80C603540A4
-:101D2000BE6806FA04F42C43CAF80C407C68E40050
-:101D30009BD54FEA9C0E58F82E5001F00C0109FA81
-:101D400001F425EA0404BAF1904F08BF00250ED033
-:101D5000114DAA4508BF012509D0104DAA4508BF5D
-:101D6000022504D00E4DAA457FF44DAF03254FE761
-:101D7000BDE8F18F0B4A136803421CBF1060FFF7E8
-:101D8000BCB97047000000000008005880080058E7
-:101D90000800014000100048000400480008004806
-:101DA000000C00480C080058264981B00A6802431C
-:101DB0000A60096808400090009801B07047F0B5CB
-:101DC00085B005460C4668461421FFF777FA0DB931
-:101DD000042004E0012D18BF022D02D10820FFF7D6
-:101DE000E3FF2000184E0FF268070DD137F81500F9
-:101DF000009000210191012002900221039100F046
-:101E00001BF80120FEF762FF012C13D137F81500F3
-:101E1000009001210D480190029100F00DF80FF2A1
-:101E20003800445D00220F2160B2FEF7C5FF60B2AA
-:101E3000FEF7DFFF05B0F0BD694656F82500FFF755
-:101E4000D5BE00004C0000585000002000002110BA
-:101E500010000100020000000A06070000F064BC48
-:101E60006B486C49016001F12002426001F13002CF
-:101E7000826001F13C02C26001F14402026101F1A1
-:101E80006002426101F1640282617031C16100F05F
-:101E900053BC38B50446604D05F1100000F0B0FCAD
-:101EA0005B494868A1680160E168C160456005F16F
-:101EB0001001816000F05CFC58482DE080B5544969
-:101EC0004A6813680120187200F058FC002002BD17
-:101ED00038B5524C504D07E0694605F1100000F04E
-:101EE000BBFC00982168884705F1100000F08BFCCE
-:101EF0000028F1D031BD49484168084738B504464B
-:101F0000474D284600F07CFC4148C068A16801604C
-:101F1000456000F038FC4348216801606168416019
-:101F2000002032BD80B53A49CA6813681020187283
-:101F300000F02FFC002002BD3549CA6839491068FD
-:101F40000B68184738B5374C354D06E069462846CA
-:101F500000F082FC009861688847284600F053FC36
-:101F60000028F3D031BD38B504462F4D284600F087
-:101F700047FC2E4800F044FC25480069A1688160B8
-:101F8000E168C160056121680160616841602169A3
-:101F900041616169816131BD80B50146234800F02E
-:101FA00045FCBDE802400FF2090000F002BC000051
-:101FB00038B5174C1D4D08E06946284600F04CFC2A
-:101FC00000992069006900F031FC284600F01BFCF4
-:101FD0000028F1D031BD10B5154C204600F010FCA2
-:101FE0000B4841690C60BDE8104000F0F6BB1CB521
-:101FF0000F4C06E06946204600F02EFC009800F0E9
-:1020000019F8204600F0FFFB0028F3D013BD0000B4
-:1020100000000320AC09032080080320C004002036
-:1020200098080320C8040020240A0320B8040020D4
-:102030002C0A0320704700007FB50C46484D6168AC
-:10204000484EE8612962284600F018FC2468746054
-:1020500006F1080000F0D4FB012000F05DF801203B
-:102060003070296841B10FF2D5000FF2D90200900B
-:1020700001920294684688477FBD3EB5384C394D81
-:1020800002E00098FFF788FF05F1080000F0BBFBB5
-:10209000D8B92878002818D0694605F1080000F062
-:1020A000DBFB01202870E1690029EAD0009802904A
-:1020B00001A888479DF8040028700028E1D1009904
-:1020C00005F1080000F0A8FBDEE737BD2DE9F0417F
-:1020D00005460E4690461C46002000F01DF8214F94
-:1020E0007868A0F80950C672324641460C3000F0BC
-:1020F000CFFB1B4A136900210020984748F2E800F3
-:10210000FEF7F8FF79688A78D21C04F1080000F025
-:10211000BFFBBDE8F04101201CB51149124C096A12
-:1021200020B901B188470020207013BD0120207024
-:1021300011B1BDE81C40084713BD00000020FEF7A8
-:10214000D6BF000010B50146064C04F1080000F0AF
-:102150006DFB04F10800BDE81040FEF7C4BF0000AD
-:1021600034040020940400207104002038B58EB09F
-:1021700002A80FF21C41DFF86C43DFF86C533022E9
-:1021800000F096FB0FF2B9300190009469460FF20F
-:10219000993000F0D1FB01210220FFF740FAD34A29
-:1021A00000210420FFF719F802A800F0A5FC00F0B8
-:1021B000A0F800F0A9FC002085F8900005F12604A5
-:1021C0004FF6FF70208000210FF245320120FFF70B
-:1021D00004F800F0EFFC00F016FD0FF22D330022A2
-:1021E00005F191010020FFF73FFC0220E070802103
-:1021F0000120A0700D2020710220A07018206071B5
-:102200000320A070BA480180A0214180012000F085
-:1022100024F90FB030BD7CB50646B34D7078052863
-:1022200005F1900404D03E280DD0FF2824D03AE0D8
-:10223000B088E98C884202D10020E8842070012017
-:1022400000F00BF92FE0F178012908D00C292AD1F0
-:10225000E88C6A460DF1010100F051FD23E0607841
-:10226000FFF728FC207804280CBF062005202070EA
-:10227000B6F80500E88416E0B6F8030040F2024123
-:10228000401A08D0C01E0BD0001F02BF0121E88CED
-:1022900000F06FFF07E0E88C964900F05AFE02E07C
-:1022A000E88C00F00EFF012076BD00F0F8BE8E48ED
-:1022B000C08C00F09BBE1CB58B4CE08C01AA0DF1CC
-:1022C000050100F01CFD98B99DF80500022804BF27
-:1022D0009DF80410022903D100200090012302E0A0
-:1022E000002000900223E08C1A46002100F062FDDD
-:1022F00013BD78B50FF25C207F4D00887F4E89B00A
-:10230000ADF81A0000F0C6FC286810F1010F0ED0DD
-:1023100069683074090A020A000CB074727406F11C
-:10232000100468683175F074090A717506E00020C0
-:10233000FEF714FD040008BF0FF2242422460621F4
-:10234000002000F030FF6079307210212079707227
-:10235000E078B072A078F0726078307320780FF275
-:10236000082470732246182000F01DFF0FF2082683
-:1023700000F06EF84EF66E50089007AA2868079095
-:1023800006212E2000F00FFF22461021182000F019
-:102390000AFF00F05DF81821012000F02BFF00F08B
-:1023A00054FF0DF1160006A90190009105AB07221C
-:1023B0000021012000F0EAFD0FF29C10BDF818107A
-:1023C000494C00900723BDF81400002200F0FDFFE7
-:1023D0000DF11A0000900223BDF81610BDF814008C
-:1023E000002200F0F2FF02220221002000F0BAFCDD
-:1023F0000120207000F061FD012060700020E0707D
-:10240000082060751020A075012020753C48A0614F
-:102410000120A0700020C1B221440871401CC1B24B
-:102420001029F8DB002004900023A0696178039054
-:102430000122207D0290A07D0190607D0090A07817
-:1024400000F054FDA07808B100F00EFE0AB070BD97
-:1024500032461021082000F0A6BE2DE9F8420746BA
-:10246000012F87B003D122480588468803E04FF446
-:10247000C8654FF47A66DFF8709009F190046078CF
-:10248000FFF718FB022F05D12078012814BF02287E
-:1024900000F0B8FC277000200690059009F1290192
-:1024A0000491062299F828000FF2DC0103900291B2
-:1024B00001920023009332462946002000F0B4FC2C
-:1024C0000E490E2000F0A8FD002808BF012F06D1FC
-:1024D00060780C4908B0BDE8F042FFF73ABB08B09D
-:1024E000BDE8F082A00803206800002077290008DA
-:1024F000E804002040E201008075FF1F0400002076
-:1025000007B2010046E0010000210120FEF772BE83
-:102510000220A2E700210420FEF76CBE0120FEF796
-:102520008BBE0120FEF790BE10B50446616801F134
-:10253000080000F014FB00B10120207010BD000065
-:1025400010B1012803D070470720FEF763BE0720B3
-:10255000FEF768BE4003000053544D33325742002B
-:102560006C7AD8AC57720000123456789ABCDEF000
-:10257000123456789ABCDEF0FEDCBA098765432136
-:10258000FEDCBA098765432109485253544D0000C7
-:10259000000000000000000000000000000000003B
-:1025A0000000000044000800400508013A799C0042
-:1025B000F4010000FFFFFFFF4801010000000000E0
-:1025C0007047704700B500BF130096469446103917
-:1025D00028BFA0E80C50FAD85FEA417C28BF0CC0A5
-:1025E00048BF40F8042BC90728BF20F8022B48BF7A
-:1025F00000F8012B00BD00008A60FF2102685162D3
-:10260000012180F82110002180F82010002070475F
-:1026100090F82010012901D102207047012280F892
-:102620002020022180F82110CA2102685162532122
-:102630000368596201688A6842F02002FFF7DCBF34
-:10264000C0680840884201D10120704700207047CF
-:10265000C0690840884201D10120704700207047BE
-:1026600010B5614C02212046FFF7F2FF38B16068D7
-:10267000C043810703D5FFF765FC022018E0012164
-:102680002046FFF7E5FF38B16068C043C10703D5B6
-:10269000FFF71EFC01200BE008212046FFF7D8FFC2
-:1026A00038B16068C043010703D5FFF7A0FC0820DC
-:1026B000A06010BD10B54C4C00F033F818B960683C
-:1026C000C043810306D400F02CF830B96068C043E1
-:1026D000810302D5BDE8104064E0082100F022F833
-:1026E00070B96068C04301030AD560683F4940F48F
-:1026F00000206060086880474FF40020A06010BD93
-:10270000202100F00FF858B96068C043810207D556
-:10271000606840F400106060BDE81040FFF7EBBB5C
-:1027200010BD022120468BE740BF20BF3048016822
-:1027300041F400410160704780B52E48016841F4C2
-:1027400080110160006800F4801000900098264815
-:10275000016841F001010160026842F480320260C8
-:102760002C20FEF746FBBDE802402D20FEF741BBC2
-:102770002148016849084900016070471F494FF42A
-:102780008030086070471C48016821F00201016038
-:10279000704719484FF400314160016821F400315D
-:1027A000016070471448016841F400310160FFF78F
-:1027B000C3BB38B504460C4D08212846FFF740FF3F
-:1027C00030B10A480460686820F40020686031BDB8
-:1027D000A0474FF40021A96031BD0748016821F0EE
-:1027E0000801016070470000000C0058E004002060
-:1027F0000C04005850000058040C0058080C0058F5
-:10280000006040607047EFF3108172B60268824248
-:102810000CBF012000201CE0EFF3108272B60368A9
-:102820000B60486001600868416023E0EFF31082AC
-:1028300072B6086043684B6041604868016019E007
-:10284000EFF3108172B6436802681A60426800684C
-:10285000426081F31088704710B5EFF3108472B6B0
-:1028600002680A600068FFE7FFF7EAFF84F3108858
-:1028700010BD086082F310887047000002490160B3
-:1028800002490161704700BFFD1E0008251F0008B6
-:1028900062B38B0708D0521E11F8013B00F8013BD0
-:1028A00000F024808B07F6D1830740F0208000BF22
-:1028B000103A07D330B4B1E83810103AA0E8381015
-:1028C000F9D230BC530724BFB1E80810A0E80810C3
-:1028D00044BF51F8043B40F8043BD20724BF31F811
-:1028E000022B20F8022B44BF0B7803707047121F95
-:1028F00017D35B0009D151F8043B20F8023B1B0CB5
-:10290000121F20F8023BF6D20BE051F8043B00F80E
-:10291000013B1B0A20F8023B1B0C121F00F8013B75
-:10292000F3D238BF121D521E24BF11F8013B00F82C
-:10293000013BF8D8704700007FB50C46684D6168D0
-:10294000684EE8612962284600F0AAFD246805F176
-:102950002400FFF755FF746006F10800FFF750FFF1
-:1029600001203070296829B10FF2411000900294C3
-:10297000684688477FBD3EB5594C5A4D02E00098E5
-:10298000FFF70AFB05F10800FFF73DFFD8B92878EB
-:10299000002818D0694605F10800FFF75DFF012007
-:1029A0002870E1690029EAD00098029001A88847C0
-:1029B0009DF8040028700028E1D1009905F1080075
-:1029C000FFF72AFFDEE737BD2DE9F8430646002072
-:1029D00000F05FF874883088B268DFF80481C4F3CF
-:1029E000090444EA8024F068A4B2C1B2204600F091
-:1029F0003CF8002748F2E8094846FFF792FD08E056
-:102A00006888A04202D1316928780870687800B1DE
-:102A1000012708F12400FFF7F6FEF0B9694608F136
-:102A20002400FFF719FF009800F10B05407A0F28EA
-:102A3000E6D0B5F80110A1420DD10098817AC81EE8
-:102A40007169C0B28842C8BF0846706102463069E9
-:102A5000E91CFFF71DFF2878D9E73800CCD001200A
-:102A600000F017F80020BDE8F28310B513461D4AA8
-:102A70005468A4F80900E1720A46194604F10C00F2
-:102A8000FFF706FF164A1369BDE810400021002039
-:102A900018471349096A82B008B921B101E011B1A0
-:102AA000012002B0084702B07047000010B501468F
-:102AB000487A0F2818BF0E2807D10B48FFF7B6FE3B
-:102AC000BDE810400020FFF729BD064C04F10800C6
-:102AD000FFF7ACFE04F10800BDE81040FFF71ABD97
-:102AE000E40300208404002008040020FFF7EEFA2D
-:102AF0009DF80E0005B000BDF8B500F10C026B4664
-:102B000021214FF66640F1E780B529480021017583
-:102B1000017600F0CFFC00F0CEFC00F0CDFC00F020
-:102B200005FD00F004FD00F081FD00F0E5FD00F082
-:102B3000E4FD00F0E3FD00F0E2FD00F0E1FD00F057
-:102B4000E0FD00F0DFFDBDE8014000F0DCBD18490C
-:102B50000A7D41F82200087D401C0875704770B559
-:102B600004466078FF2802BFB4F8031001F47F41E7
-:102B7000B1F5406F12D100260D4D00E0761C297D85
-:102B8000F0B288420AD2F1B255F8211020468847A7
-:102B90000100F3D002D0022805D006E02046BDE8AF
-:102BA0007040FFF738BB002070BD012070BD0000F1
-:102BB00058040020E0B505A0042100908DF8041011
-:102BC00042F62920694600F09EFC07BD53544D0093
-:102BD00010B500782B4C18B102280FD004D310BDCB
-:102BE000A0800120207310BD607BFEF763FF607B37
-:102BF000BDE8104040F60101FEF7ABBF607BBDE8C9
-:102C00001040FEF757BF10B50FF245020021022019
-:102C1000FEF7E3FA1B4C00210420217320702146AB
-:102C200042F6382000F04DFD1F20E07204F10D0146
-:102C30000A20A0800120A0724FF48060E080012271
-:102C4000BDE810400FF245030020FEF70DBF000065
-:102C50000D480C490068CA7A00F0070041304880EE
-:102C60001307087B04D518B98888401D888003E0C5
-:102C7000012804BF00200873891C42F6372000F0A9
-:102C800020BD0000740400202828004000210220FC
-:102C9000FEF7B0BA00B587B000F010F801200322AB
-:102CA0000690ADF80420ADF8062000F0A5F8002845
-:102CB0004CBFFF209DF8000007B000BD00208DF83C
-:102CC00000001822002101A800F024BDADF8060084
-:102CD000049107A80121082203900691ADF8042071
-:102CE000704709220021684600F014BD1822002117
-:102CF00002A800F00FBD182201A800F00BBD70B5AE
-:102D0000C8B006460C4615460522FFF7EBFFADF8A6
-:102D10002060FFF7EBFF302100F014F8052104904C
-:102D200000F019F8002848BFFF2009D49DF80000E2
-:102D300030B99DF8030020709DF804002870002031
-:102D400048B070BDADF80A1008200221ADF80800A7
-:102D5000059108A870470791CDF818D0002102A866
-:102D6000FFF732BE00B5C7B000F00EF8FFF7C3FFA3
-:102D7000312000F013F800F03FF800284CBFFF208E
-:102D80009DF8000047B000BD00238DF81C008DF8B1
-:102D9000003007A84170827000217047ADF806002E
-:102DA00007A9032004900822012003910690ADF8A2
-:102DB0000420704730B5C7B00025ADF81C008DF871
-:102DC0001F2007A84A9C817003718DF80050ADF850
-:102DD0002140FFF776FF0F21029132200721FFF7F4
-:102DE00075FF00F009F800284CBFFF209DF8000097
-:102DF00047B030BD03900691CDF814D0002101A852
-:102E0000FFF7E2BD00B587B000F045F900F073F9B7
-:102E1000812000F03BF900F085F900284CBFFF202D
-:102E20009DF8000007B000BD2DE9F84DC7B09446ED
-:102E3000DDF840E1519A559D569EDDF84CA1ADF864
-:102E40001D108DF81C004FF0000BADF81FC08DF861
-:102E500021308DF822E000F024F800F017F824F873
-:102E6000095F668000F047F93F20832100F075F983
-:102E7000574406910D37049700F057F900284CBFCE
-:102E8000FF209DF8000048B0BDE8F08D88F800A054
-:102E900007AC5499E419524608F10100544400F07B
-:102EA00033BC8DF82320174652998DF800B00DF1F0
-:102EB000240809A8B84400F027BC00B5C7B000F04A
-:102EC0000CF8852000F0C3F800F02CF900284CBF66
-:102ED000FF209DF8000047B000BD00218DF81C00C8
-:102EE0008DF80010182201A800F014BC2DE9F8415B
-:102EF000C7B04FF0000800F026F80DF12300DDF810
-:102F000044E14E9F4F9E509D529C8DF81F30C0F85B
-:102F100000E08DF800808DF820708DF821608DF82C
-:102F200022508DF8274000F0E6F88620ADF8060024
-:102F300007A90C2000F0F2F800284CBFFF209DF8F4
-:102F4000000000F024B98DF81C0007A841708270C1
-:102F5000704700B5C7B00022ADF81C008DF8002006
-:102F60000DF11E001822016001A8002100F0D2FB23
-:102F70008820ADF8060007A9062000F0CFF8002849
-:102F80004CBFFF209DF8000047B000BDF8B5C8B0A9
-:102F900005460E4617461C4600F023F808A8467062
-:102FA00087708DF8205000F0D3F88A21ADF80A1010
-:102FB0003F20032100F0BFF8002848BFFF200ED4B7
-:102FC0009DF8000058B94F994E98BDF80120228015
-:102FD000BDF803200280BDF805000880002049B03C
-:102FE000F0BD07220021684600F094BB00B5C7B0D1
-:102FF0000021ADF81C00FFF773FF0F2102918D2017
-:10300000022100F07EF800F08EF800284CBFFF206F
-:103010009DF8000047B000BD18B5C7B0044600F0E9
-:103020003AF88DF81C40224600F09FF800F063F853
-:103030003F208E2100F0AEF8641C049400F075F877
-:1030400000284CBFFF209DF8000048B010BDADF82F
-:10305000060007A901203F22039104907047ADF8B4
-:10306000060007A90220704700B587B000F013F8EA
-:1030700000F041F8922000F009F800F053F8002821
-:103080004CBFFF209DF8000007B000BDADF8060062
-:103090003F220120704700208DF80000704700B5E6
-:1030A00087B0FFF7F8FF00F026F89420FFF7EEFF57
-:1030B00000F038F800284CBFFF209DF8000007B052
-:1030C00000BD00B5C7B00021ADF81C00FFF708FF38
-:1030D0009520FFF7C4FF00F021F800284CBFFF2027
-:1030E0009DF8000047B000BD00228DF80020ADF82B
-:1030F0001C008DF81E101822002101A800F00ABB48
-:103100000321ADF80600049107A801213F22039096
-:1031100006917047ADF8060007A9032004903F22EE
-:10312000012003910690ADF80420CDF814D00021C1
-:1031300001A8FFF749BCADF80800059108A80721D0
-:1031400004900791CDF818D0002102A8FFF73CBCED
-:103150001822002102A800F0DDBAADF80400ADF895
-:10316000061007A80121039070470DF11D0000F023
-:10317000CBBA00B5C7B0FFF7B7FFA520FFF7CAFF6E
-:1031800000284CBFFF209DF8000047B000BD48B0AC
-:10319000BDE8F081ADF80400ADF8061007A80121E4
-:1031A00003900691704718B50C46C7B0114600222F
-:1031B0008DF800208DF81C008DF81D4022460DF181
-:1031C0001E0000F0A1FA00F02AF83F200C21ADF813
-:1031D0000400ADF8061007A8012103900691A41C75
-:1031E000049400F02CF800284CBFFF209DF800004C
-:1031F00048B010BD00B5C7B000F00AF80F2000F0CD
-:1032000013F800284CBFFF209DF8000047B000BD18
-:1032100000228DF800208DF81C008DF81D1018225A
-:10322000002101A800F076BAADF8060007A9022037
-:1032300004903F22012003910690ADF80420CDF8C0
-:1032400014D0002101A8FFF7BFBB00B587B0002054
-:103250008DF8000000F0E0F840F20110ADF8060033
-:103260003F220120069000F013F900284CBFFF20F8
-:103270009DF8000007B000BD2DE9F8410746012880
-:10328000C7B0884615461E4608BF022003D0022854
-:103290000CBF102000200DF11D010C1800F036F8B5
-:1032A000012F8DF81C7002D0022F18D019E00227D0
-:1032B0003A4641460DF11D0000F026FA2570667071
-:1032C00000F0AAF83F204FF4817100F016F8FF1CBF
-:1032D000049700F0DFF8002805D5FF2009E010274B
-:1032E000E6E7472005E09DF8000010B94E9800F091
-:1032F00067F8FFE748B0BDE8F081ADF80400ADF82D
-:10330000061007A8032103900691704703220021AD
-:10331000684600F0FFB92DE9F64F0C460546012C32
-:10332000C7B09B4608BF022003D0022C0CBF102060
-:1033300000200DF11F010E18FFF7E8FF012CADF87A
-:103340001C508DF81E4002D0022C2CD02DE00227FC
-:10335000569C559DDDF85091DDF84CA1DDF8488173
-:1033600048993A4600F054F8A6F800B086F8028072
-:1033700086F803A086F804907571B47100F04CF8DB
-:103380003F20ADF804004FF4827107A8ADF8061095
-:10339000039003210A370497069100F07BF8002878
-:1033A00005D5FF2009E01027D2E7472005E09DF86A
-:1033B000000010B9579800F003F849B0BDE8F08F4D
-:1033C000BDF8011001800020704730B5C7B01C4621
-:1033D0004A9B00F049F800258DF800508DF82140F7
-:1033E000224619460DF1220000F08EF900F014F883
-:1033F0003F204FF4837100F042F8A41D049400F0C4
-:1034000049F800284CBFFF209DF8000047B030BDB0
-:103410000DF11F0000F078B91822002101A800F07A
-:1034200079B978B5C7B04C9C4D9D00F01DF80026C9
-:103430008DF821308DF800608DF822402246294613
-:1034400000F019F8FFF7E8FF3F204FF4937100F008
-:1034500016F8E41D049400F01DF800284CBFFF206E
-:103460009DF8000048B070BDADF81C00ADF81E100E
-:103470008DF8202070470DF1230000F045B9ADF81C
-:103480000400ADF8061007A80121039006917047CB
-:10349000ADF80420CDF814D0002101A8FFF794BAAC
-:1034A0000249016002490161704700BF931E000894
-:1034B000BD1E00087047704718B51B4C00202060E7
-:1034C00087B041F60A00ADF81800009403230122EA
-:1034D00006A90120FFF7D0FE42F629220121ADF80E
-:1034E00018200491A01C05900A22002302210392B7
-:1034F0000293019300912023208806AA0121FFF75F
-:103500000AFF08B010BD80B542F62922904209D1C9
-:103510000A680548009200220B7941880088FFF76D
-:1035200054FF02BD002002BDEC040020704770472C
-:1035300038B5024686B050780024FF2839D1B2F859
-:1035400003106B4840F60143C91A1FD0123901BF5E
-:10355000B2F80710C088401C81422AD1957AB2F88F
-:103560000500537A0124012D08D10A3201920093FB
-:1035700000220023FFF755FF002015E00A320192D8
-:10358000009301228023FFF74CFF12E04088B2F83D
-:103590000710801C81420CD1507B0124C10748BF19
-:1035A0008DF8084002D402208DF8080002A8FFF729
-:1035B0000FFB204607B030BDFEB5014601AA487A90
-:1035C0008DF804004B7A08885070DC0704D5088811
-:1035D000000A9070032300E00223487A040707D50D
-:1035E0004888D0545B1C4888DCB2000A10555B1C2C
-:1035F0004C7AE00610D50D7A00200BE001EB400478
-:10360000DFB2A688D6555B1CA488DEB2240A945586
-:103610005B1C401CA842F1DB01A935480091DBB2DC
-:10362000418800880022FFF7D0FEFEBD18B587B0A4
-:1036300030482F4CFFF78BFA41F60D01ADF818100A
-:1036400000940823012206A90120FFF715FE42F687
-:103650003720ADF81800012204920A20A11C039023
-:10366000002310220591029301930092072300F09A
-:1036700023F842F63820ADF8180000220492029296
-:1036800001920A20211D03900222059100F012F8F8
-:1036900042F63920ADF818000022049201920A2067
-:1036A000A11D0390022308220591029300F002F865
-:1036B00008B010BD00920123208806AA0121FFF75F
-:1036C0002ABE80B5002242F63723C01A09D0401E18
-:1036D0000BD107480091012381880088FFF775FE10
-:1036E00002E00846FFF768FF0246104602BD0000F0
-:1036F000D00400203135000870477047704770478C
-:10370000704770477047704710B50446FFF7C0F820
-:10371000204610BD10B5044610460A460146204614
-:1037200000F002F8204610BD62F30F2262F31F4240
-:10373000401810F0030308D0C91A1FD3DB0748BF95
-:1037400000F8012D28BF20F8022D130030B41446D4
-:103750001546103928BF20E93C00FAD8490728BF90
-:1037600020E90C0048BF40F8042D890028BF20F84C
-:10377000022D48BF00F8012D30BC7047C91818BF92
-:1037800000F8012DCB0728BF00F8012D704700007D
-:10379000206881684A06704770B504462568E96963
-:1037A0002A68AB6811F00F000CD1880602D590068C
-:1037B00001D4D80079D5E16E002975D02046BDE846
-:1037C000704008475848034208BF12F4907F6CD0FD
-:1037D000CE0709D5D60507D501262E62D4F8885024
-:1037E00045F00105C4F888508D070AD5DD0708D5D6
-:1037F000266802253562D4F8885045F00405C4F8DF
-:1038000088504D070AD5DD0708D52668042535629E
-:10381000D4F8885045F00205C4F888500D070CD53F
-:10382000950601D4034208D0256808202862D4F800
-:10383000880040F00800C4F88800D4F88800002808
-:103840006FD0890607D5900601D4D80003D5E16E64
-:1038500009B120468847D4F8880021688A68510653
-:1038600001D400071AD5204600F068F8FFF790FF52
-:103870000FD500F05BF860B1DFF8BC108163A06F7A
-:1038800000F078F800284CD0A06F816BBDE8704044
-:1038900008472046BDE8704000F003B9204600F01C
-:1038A00000F90020C4F8880070BDC80209D558028C
-:1038B00007D54FF4801028622046BDE8704000F024
-:1038C000F1B8080609D5100601D4180205D5216FF4
-:1038D00039B32046BDE87040084748060FD550066A
-:1038E0000DD5286820F0400028602021C4F8801001
-:1038F000002020672046BDE8704000F0D5B80802DF
-:1039000006D5500004D52046BDE8704000F0DAB876
-:10391000C80148BF002A04D52046BDE8704000F029
-:10392000D2B870BD0000000001000010816821F0D5
-:1039300040018160A06F70476139000801680A6822
-:1039400022F490720A60DFF82810026893680B4036
-:1039500093602021C0F884100021C16670470000E8
-:10396000806A00F1560100220A810A8000F099B8AD
-:10397000FEFFFFEF38B500F1240200245178022940
-:1039800003D004209061012428E001680B6823F033
-:103990000E030B6001680D686D086D000D60516AC3
-:1039A0000B6823F480730B60012192F82030D569F5
-:1039B00003F01C0399406960936AD16A5960116BE6
-:1039C00031B10B6823F480730B60536B916B5960BA
-:1039D000012151701470516901B18847204632BDF0
-:1039E000F8B500F124010423CA6914680268156857
-:1039F00091F8206006F01C0603FA06F73C4210D04E
-:103A00006F070ED51468A50603D4156825F00405C4
-:103A1000156000F03DF8C968002938D0BDE8F440D1
-:103A20000847022303FA06F73C4213D0AF0711D52B
-:103A30001468A50605D4156825F00A05156001224D
-:103A40004A7000F025F800220A708968F9B1BDE8D3
-:103A5000F4400847082303FA06F6344217D02B0730
-:103A600015D5136823F00E031360012291F820305E
-:103A7000CC6903F01C039A40626001228A614A709B
-:103A800000220A70096911B1BDE8F4400847F1BD90
-:103A900091F82020CC6902F01C02934063607047CB
-:103AA000000070477047000000680449884204D154
-:103AB00003490868002818BF0047704700380140D4
-:103AC000E40400207047704700EB81003B4AD0F8C7
-:103AD0008010914201D0012070470020704742F4CD
-:103AE000806240F82120704735481F2181610168BC
-:103AF000C908C90041F0030101603248016841F082
-:103B0000040157E0704710B52F4C00F048F800282A
-:103B1000FBD1042100F044F828B92C4800680104C6
-:103B200003D500F03FF800F054F8002203212046AE
-:103B3000FFF7D5FF22480168C908C90041F002011A
-:103B400001602048016841F00401016030BF10BDF0
-:103B500010B51D4C00F026F800F021F80028FBD12C
-:103B60004FF0B040816801F00C01042911D10168C7
-:103B700041F48031016001688903FCD581688908BE
-:103B8000890041F002018160816801F00C0108297F
-:103B9000FAD12046BDE81040002203219FE703210F
-:103BA000204691E700220421204698E70548016855
-:103BB00021F00401016030BF704700000004008064
-:103BC0000004005810ED00E000140058880400586C
-:103BD00070474FF0B040016841F4807101600168A6
-:103BE0004905FCD581688908890041F0010181609F
-:103BF000816801F00C010429FAD170477047FEE793
-:103C0000FEE7FEE7FEE770477047704700F024B814
-:103C10000548FFF7E5BE0548FFF7BEBD0448FFF7BE
-:103C2000BBBD0448FFF7DCBE2403002018020020BF
-:103C30008C010020840300201020FEF79BB8012097
-:103C4000FEF798B80220FEF795B8FDF740BEFEF7E4
-:103C500031BDFEF705BD000002490A688868821878
-:103C60000A6070474400002019E050F8042BD30785
-:103C700044BFA9F101039A18091F0023042942F83F
-:103C8000043BF9D25FEA817C134604D54FF0000C67
-:103C9000A2F800C09B1CC90744BF0021197050F84E
-:103CA000041B0029E1D1704730B5016884684218CF
-:103CB000416802EB5103C9070BD54C4409E012F9E6
-:103CC000011B12F8015B002904F8015B05D5491CB2
-:103CD000F9D19A42F3D10C3030BD491EF1D5F8E745
-:103CE00010B500F013F802000023DB430024106835
-:103CF000984203D011000220ABBE14605068984275
-:103D000003D0111D0220ABBE546010BD01487047A6
-:103D1000000000006000002010B507497944183108
-:103D2000064C7C44163404E00A68081D1144884798
-:103D30000146A142F8D110BD2C0000005000000047
-:103D40004EF68851CEF20001086840F47000086019
-:103D5000BFF34F8FBFF36F8F4FF00070E1EE100A8B
-:103D60007047000005FFFFFF880400006800002086
-:103D70008008000020000320000000002DFFFFFF4E
-:103D80005C010000480000000400002000F00DF875
-:103D9000002801D0FFF7C0FFAFF300800020AFF391
-:103DA0000080FCF782FE00F002F80120704700F06E
-:103DB00001B800000746384600F002F8FBE70000B3
-:103DC00080B5FFF78DFF024A11001820ABBEFBE75C
-:103DD00026000200AD3B0008D13B0008073B00086D
-:103DE000513B0008E93A0008053B000801488047BC
-:103DF0000148004725090008FD3D0008AFF3008099
-:103E0000FFF79EFFFFF7C2FFFFF7FEBFFFF7FEBF02
-:103E1000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFD6
-:103E2000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFC6
-:103E3000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFB6
-:103E4000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFA6
-:103E5000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF96
-:103E6000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF86
-:103E7000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF76
-:103E8000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF66
-:103E9000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF56
-:103EA000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF46
-:103EB000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF36
-:103EC000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF26
-:103ED000FFF7FEBFFFF7FEBFFFF7FEBF020DFF01BA
-:103EE000D700F8FFF0000010FD000001FC000E08F4
-:103EF0000048000C0048000C004800093D00F8FF95
-:0400000508003DFDB5
+:1001700008BF012940F07E802868810702D5E06928
+:1001800000284BD0FFF7DAFF616A884207D20846A1
+:1001900000F09AFB002815D100F052FA0AE0286816
+:1001A00020F0F000014300F050FA606A00F08CFB90
+:1001B000002807D100F02AFCDFF8A407006800F04F
+:1001C00075FC002840F08E812078C10711D5A86801
+:1001D000E96800F00C00082801F0030103D00C28A6
+:1001E00008BF032969D12868810302D56068002807
+:1001F00014D0217888071AD5A868E96800F00C00A7
+:10020000042801F0030104D00C2808BF022940F0A3
+:100210008D802868410503D5E068002800F06281E0
+:100220006868216920F0FE4040EA0160686021684A
+:10023000DFF8306711F0180F00F076816069002850
+:1002400000F0AF80C806706840F19C80800708D439
+:10025000716841F00101716000F04AFC0746706866
+:10026000800700F1418100F043FCC01B0328F6D356
+:100270000320DEE1E06978B1296841F0010100F076
+:10028000CEFA06462868800700F13D8100F030FC78
+:10029000801B0328F6D3EBE728684008400028605D
+:1002A00000F026FC0646286800F0C6F98CD000F065
+:1002B0001FFC801B0328F6D3DAE76068B0F5803FA7
+:1002C00004D1286840F48030286011E0B0F5A02FF8
+:1002D000286806D140F480202860296841F48031E4
+:1002E00005E020F480302860296821F4802129600D
+:1002F000606860B100F0FCFB0646286880033FF5AB
+:1003000078AF00F0F5FB801B6528F6D3B0E700F06E
+:10031000EFFB06462868400C10F001003FF469AF7F
+:1003200000F0E6FB801B6528F4D3A1E7E06878B114
+:10033000296841F4807100F072FA06462868400589
+:100340003FF56EAF00F0D4FB801B0328F6D38FE798
+:10035000286820F48070286000F0CAFB06462868F0
+:10036000800A10F001003FF462AF00F0C1FB801B77
+:100370000328F4D37CE700F0BBFBC01B0328C0F0CC
+:10038000CF8075E740F0010000F070F90746706813
+:10039000800700F1E08000F0ABFBC01B0328F6D320
+:1003A00066E7706820F0040000F060F907467068A6
+:1003B000C00810F0010000F0DD8000F099FBC01BC8
+:1003C0000428F4D354E70528306806D140F004002F
+:1003D0003060316841F0010105E0400840003060C4
+:1003E000316821F004013160A06841F2893768B1B9
+:1003F00000F07EFB80463068800700F1D08000F07E
+:1004000077FBA0EB0800B842F5D331E700F070FBB2
+:100410008046306800F010F900F0C18000F068FB01
+:10042000A0EB0800B842F4D322E700F061FBC01B48
+:100430000328C0F0C2801BE740084000B06000F015
+:1004400057FB0746B06800F0F7F800F0BA8000F0FC
+:100450004FFBC01B0328F5D30AE700F049FB801BC4
+:100460000328C0F0C08003E700F042FB001B032814
+:10047000C0F0DA80FCE6E968DFF8EC04890889005E
+:10048000E960E9680140E96000F032FB044600F0F1
+:10049000E5F825D000F02CFB001B0328F7D3E7E696
+:1004A00001281FD0E868226B00F00301914202BFCF
+:1004B00000F07001626B914214D1A26BC0F306216F
+:1004C000914202BF00F47811E26B91420AD1226C92
+:1004D00000F06061914202BF00F06040616C8842B0
+:1004E00000F0A6800120A4E0706840F0040000F055
+:1004F000BDF807467068000708D400F0F9FAC01B81
+:100500000428F7D3B4E600F09BF85DE67068A169B3
+:1005100020F4706040EA0120706000F0A4F8074603
+:1005200000F089F87FF427AF2078410737D5DFF84E
+:100530003C743868C10529D400F0E0FA00F0D8FA1C
+:1005400080463868C10521D400F0D2FAA0EB08003B
+:100550000328F6D38CE6706820F0040070607068A1
+:10056000C00810F00100DFD000F0C2FAC01B042860
+:10057000F5D37DE600F077F8074600F05CF8D3D0BD
+:1005800000F0B6FAC01B0328F7D371E6A068012873
+:100590007FF419AF306840F00100306024E7217823
+:1005A0004A060ED5A06A0028B0683FF445AF40F077
+:1005B0000100B06000F09CFA0746B06880077FF544
+:1005C00034AFE06AA0B3A96801F00C010C293FF434
+:1005D00067AF0228286820F0807028607FF44BAF56
+:1005E00000F086FA064600F039F87FF436AFEA6884
+:1005F000DFF87C03216BA36B0240606B0A4302436C
+:10060000E16B206C42EA03220A43616C02430A4315
+:10061000EA60286840F080702860E96841F0805105
+:10062000E96000F065FA0446286880017FF51CAF98
+:100630000020BDE8F0817068400810F001007047AC
+:100640002968606A21F0F001014329606968206A25
+:1006500021F47F4141EA0021696070472868400E1B
+:1006600010F001007047706840084000706000F0B2
+:100670003FBA2DE9F8430400884646D0DFF8F4621B
+:1006800000F0C8F849D200F0CDF8074600F0C2F8F3
+:1006900043D000F02DFAC01B0228F7D90320B7E0A1
+:1006A00000F026FA401B022845D9F7E700F020FAAF
+:1006B000A0EB090002284ED9F0E700F019FAA0EBF0
+:1006C0000900022856D9E9E700F012FA401B022877
+:1006D0005FD9E3E700F00CFA401B022869D9DDE797
+:1006E00000F006FA401B41F28931884275D3D5E704
+:1006F000032802D13968890103E00028396802D152
+:10070000890762D401E049055FD4012080E000F050
+:10071000EFF9C01B022870D9C0E7207881074FF09D
+:10072000B0470BD5BA68A06822F0F0020243BA6065
+:1007300000F0DEF90546B868C003B1D52178DFF8CE
+:100740001C5288060AD52968606921F0F00101432E
+:1007500000F065F8814628688003A7D5217848060F
+:100760000BD52968A0690909090141EA101100F0B7
+:1007700056F881462868C0039FD5217848070BD5D5
+:10078000B968E06821F4E0610143B96000F0B0F9B4
+:100790000546B868800397D5217808070CD5B96855
+:1007A000206921F4605141EAC001B96000F0A0F96C
+:1007B0000546B86840038DD52178C80715D560680F
+:1007C000022895D1396889039FD5BA68920840EA12
+:1007D0008200B86000F08CF90546B868616800F0E6
+:1007E0000C00B0EB810F7FF47BAF306800F00700A6
+:1007F000804505D200F016F8074600F00BF886D1C8
+:1008000000F004F900F096F9BDE8F24300F04EB9AB
+:10081000BDE8F283306800F007004045704729606A
+:1008200000F066B93168C90848EAC101316000F0DA
+:100830005FB938B54FF0B044504DA16811F00C01CC
+:1008400006D1FFF77BFCC0F3031055F8200032BD42
+:1008500004294B4A05D008294A4804D12168C90215
+:1008600022D5104632BDE16801F00301022904D00F
+:10087000032904D12168C90207D5104605E0FFF716
+:100880005DFCC0F3031055F82000E168E268E368FE
+:10089000C1F306214843C2F30211491C5B0FB0FBB0
+:1008A000F1F05B1CB0FBF3F032BD80B5FFF7C1FF88
+:1008B0003149FFE7344A0968C1F3031152F82110A6
+:1008C000B0FBF1F002BD000070B52C49B1282EBF7D
+:1008D000CC6AC0F3031051F820402048056800F0AE
+:1008E00049F9294905F00F0551F825202749B4FB9E
+:1008F000F2F20024B2FBF1F1B0F5007F2BA220460A
+:1009000009D100BF22A353F820508D4214D2401CBD
+:100910000328F8D912E000BF21A353F820508D42DC
+:100920000AD2401C0328F8D308E000F0E1F8801B4D
+:1009300003280CD3032070BD52F820400D4D2868C9
+:10094000C00844EAC000286000F0D2F806462868D3
+:1009500000F00700A042E8D1002070BD0801005857
+:100960004800002090000058FFFFFEEE00040058F1
+:100970008C80C1110040005808000058D83D000884
+:100980000024F4000048E801983D000840420F00B0
+:1009900012000000240000003600000040000000AB
+:1009A000060000000C000000100000000000000025
+:1009B0000100000002000000040000003249002095
+:1009C00008604FF0B0413148026842F470020260A2
+:1009D0004FF4E022086840F0010008608A600B686C
+:1009E0002B4803402B480B60026822F0050202608E
+:1009F000002243685B085B0043602748C8600861C9
+:100A0000086820F4802008608A61704710B54FF0B4
+:100A1000B04222491068C0F3031001EB8003186C48
+:100A2000936803F00C03042B04D0082B04D00C2B88
+:100A300004D01CE01A481AE01A4818E0D368D468B9
+:100A4000C4F3021403F00303641C022B08BF144810
+:100A500002D0032B08BF1348B0FBF4F3D068D4686E
+:100A6000C0F30620640F4343641CB3FBF4F00E4B49
+:100A7000186090681A68C0F3031051F82000B2FBA8
+:100A8000F0F0186010BD000008ED00E088ED00E017
+:100A9000FBFEF6FA9400005800100422983D00086E
+:100AA0000024F4000048E8015C00002070B50F4EFF
+:100AB0000446B0680025A8B1FFF7F7FEB2684FF40E
+:100AC0007A71B1FBF2F2B0FBF2F000F0ACF848B989
+:100AD000102C07D2002221464FF0FF3000F06CF8B6
+:100AE000746000E00125284670BD00BF440000206E
+:100AF00001480068704700BF4400002002480168B8
+:100B000041F480710160704700040058164810B528
+:100B1000016841F480710160032000F040F800207A
+:100B2000FFF7C4FF0024002814BF012400F0B8F828
+:100B3000204610BD0D48406870470C4880687047DB
+:100B40000B480BE00A48016821F002010160704780
+:100B50000748016821F004010160704701684908F5
+:100B60004900016070470000004000584400002028
+:100B7000042004E0DFF80800006800F4C06070475B
+:100B8000000400580901020002D43C488154704717
+:100B90003B4B02F00F021A4402F8041C7047394B19
+:100BA00019684FF6FF020002114000F4E0600843AC
+:100BB000354908431860704738B5324B1C68C4F398
+:100BC0000223C3F10704052C28BF04241D1D072D93
+:100BD00034BF0023DB1E012505FA04F4641E214006
+:100BE000994005FA03F35B1E1A401143BDE83440F7
+:100BF000C8E7010007D4012200F01F01234B8A40FF
+:100C0000400943F82020704701000BD4012200F076
+:100C10001F011F4B8A40400943F82020BFF34F8F2C
+:100C2000BFF36F8F704710B5401EB0F1807F01D3C6
+:100C3000012010BD174C60600F214FF0FF30FFF70F
+:100C4000A1FF0021A16007202060002010BD01004D
+:100C500007D4012200F01F010F4B8A40400943F8DE
+:100C600020207047010007D4012200F01F010B4B28
+:100C70008A40400943F820207047000000E400E06B
+:100C800018ED00E00CED00E00000FA0500E100E0E6
+:100C900080E100E010E000E000E200E080E200E03F
+:100CA000134881B0016841F400210160006800F43C
+:100CB00000200090009801B0704710B504460D491F
+:100CC0002068884213D1FFF719FFFFF717FF0A4882
+:100CD000016821F4407141F480710160026842F4BE
+:100CE000004202602046BDE8104000F012B810BD7E
+:100CF0005000005800280040900000588A60FF21F2
+:100D00000268516280F82130002180F82010002014
+:100D1000704790F82010012901D10220704701216D
+:100D200080F82010022280F82120CA21036859622D
+:100D3000532201684A62012301688A6842F0200256
+:100D4000FFF7DCBFDFF84C150A6892B200E00246FC
+:100D5000086880B28242FAD170472DE9F041DFF88D
+:100D60003865DFF838853178044618256843062948
+:100D700008EB000708D130787070347079754FF047
+:100D8000FF30706000203DE000F07BF8B968091882
+:100D9000B96008F10803B96832786A439A589142F9
+:100DA000327813D308F1150315FB02FC13F80C304D
+:100DB000062B29D008F108066B43F358994222BF4D
+:100DC00008F115036A439A5CECD21DE011463378B2
+:100DD00069439A420FD008F1140C08F1150E1CF863
+:100DE000013015FB03F50EF805407A753B7508F1E7
+:100DF0001402545403E008F114037A755C543178FA
+:100E000071703470BDE8F0811146694308F1150333
+:100E10005B5C062B04D008F1140615FB03F5745532
+:100E20007B753A7508F115025454EBE7F0B5DFF81D
+:100E30006834DFF868541E78182402466243B042D2
+:100E40002A4404D118785870547D1C700FE0167D28
+:100E5000507D92F815C005F115076643062807F87E
+:100E600006C004D0167D143514FB00F42E55012065
+:100E700010731A78062A02BF00294FF0FF3058601D
+:100E8000F0BD10B5DFF81044606810F1010F10D00C
+:100E9000FFF758FF6168DFF8082481422FBF6368BD
+:100EA00061685388CB1851781278181A4843D0409B
+:100EB00000E0002080B210BD2DE9F84FDFF8E053CC
+:100EC000DFF8E0B3D5F80880D8F80000DBF80010B0
+:100ED0004A0500F0A2F9DFF8C063DFF8C0A321F4EF
+:100EE000806181604FF0180934780AF1080019FB1D
+:100EF00004F14758FFF7C5FF874211D200270121AF
+:100F0000B170062C3FD019FB04F40AF108010A590C
+:100F1000824210D200230B510AEB04014C7DF0E712
+:100F2000A9884118B94202D2AF880021E8E701221E
+:100F30003F1AB270E5E70A590AF10803121A1A516A
+:100F4000EAE7022802DA2878012800D07F1ED8F8C4
+:100F50000000C1684A07FAD500F052F9DBF80C002E
+:100F6000000CBFB247EA0047CBF80C70FFF7EAFE6F
+:100F70007060A8680068816841F480618160AFF3A7
+:100F80000080BDE8F18FB8B20028DAD1FFF7DAFEB1
+:100F900070600320BDE8F24FFFF759BE2DE9F8431A
+:100FA000EFF3108872B6BE4DBC4BA8680168CA2228
+:100FB0004A625320486218208A6822F480628A605C
+:100FC000B54A1678374647431F44387B022823D159
+:100FD0003C68D7F810909078D8B17A7B012A0AD172
+:100FE00001213046FFF722FF88F3108879683046E8
+:100FF00000F019F904E088F31088304600F0C6F8D4
+:10100000A86800F01AF831462246484600F054F924
+:101010000DE0FFF751FF08E0C8684207FCD500F07B
+:1010200086F84FF40020A049086088F31088FF225A
+:10103000A86801684A62BDE8F1830068CA2141627C
+:10104000532242627047F8B5954CA160CA220968E4
+:101050004A625323934A4B62156845F02005156098
+:10106000136803F00703C3F10403237095682D0C84
+:1010700005F07F056D1C6570EDB29268C2F30E023B
+:10108000521C628092B2521E6A43A2F5A072DA40EC
+:101090004FF6FF739A422CBFA380A280834A136845
+:1010A00043F400231360824B1D6845F400251D6046
+:1010B00048BB7948012383704FF0FF35456000231A
+:1010C000764D00260C355FFA83FC182717FB0CFCC5
+:1010D0005B1CDFB205F80C60062FF4DB06230370FF
+:1010E000886820F48060886000F021F84FF40021C7
+:1010F000D1600320FFF7B6FDA0680068816841F465
+:101100008041816005E0C868410544BF0320FFF7C6
+:101110009EFDA1680A68FF2050620022032103207F
+:10112000FFF74AFDBDE8F2400320FFF762BDC86843
+:1011300000F0800060F49060C86070472DE9F041D5
+:1011400004460025EFF3108672B61827DFF84CC16D
+:101150000CF10C0E07FB05F81EF8080010B16D1C11
+:10116000062DF5DB062D0CD06F430CEB0700012795
+:10117000077386F310880461427303600D700020CA
+:1011800002E086F310880120BDE8F081F8B507463B
+:10119000EFF3108472B60320FFF736FD404DAE68C2
+:1011A0003068FFF74BFF3B46182042494343CA5C77
+:1011B000022A1BD100213846FFF738FE3648017855
+:1011C00006290ED1306837490A68530500F025F822
+:1011D00021F480618160C1684A07FCD500F010F8F5
+:1011E00004E04078884218BFFFF766FEA9680A68E5
+:1011F000FF2050620320FFF7FCFC84F31088F1BD50
+:10120000C16801F0800161F49061C1604FF4002079
+:10121000254908600320FFF725BD02D5C1684A07AC
+:10122000FCD4816870472DE9F04180460F46424664
+:1012300018201A4942438C18237B022B04BF4046D6
+:10124000FFF7A4FFEFF3108572B60320FFF7DCFC75
+:10125000134EB068FFF7F1FE02202073A7606760AD
+:101260004046FFF77AFD0C490A784978914202D04E
+:10127000FFF722FE02E0A168081AA060FF20B16813
+:101280000A6850620320FFF7B4FC85F31088BDE8BC
+:10129000F081000028280040DC040020FC00002031
+:1012A000A8040020082800400C0800580008005836
+:1012B0008008005808010020104730B4002513E0D2
+:1012C00050F8042BD30744BFA9F101039A18091F52
+:1012D000042942F8045BFAD213468C0744BF1580F8
+:1012E0009B1CC90748BF1D7050F8041B0029E7D19B
+:1012F00030BC704738B58EB002A8DFF87013DFF845
+:1013000070430FF2C935302200F008FA00940195BD
+:1013100069460FF2A130D74D00F00CFA01210220EE
+:1013200000F0EBFAD44A0021042000F079FB02A877
+:1013300000F0ECFB00F0A2F800F0F0FB05F1260451
+:1013400000204FF6FF7185F89000218001200FF2F8
+:101350004D32002100F064FB00F042FC00F06CFC18
+:101360000FF23133002205F191010020FFF7E6FE74
+:101370000220E07001210D20A170207102211820AF
+:10138000A17060710321BD48A1708022A02102805C
+:101390004180012000F024F90FB030BD7CB5064635
+:1013A000B44D7078052805F1900404D03E280DD086
+:1013B000FF2824D03AE0B188E88C814202D1002194
+:1013C000E9842170012000F00BF92FE0F07801286A
+:1013D00008D00C282AD1E88C6A460DF1010100F0F2
+:1013E000B6FC23E06078FFF7D1FE207804280CBF1C
+:1013F000062005202070B6F80500E88416E0B6F84F
+:10140000030040F20241401A08D0C01E0BD0001F5A
+:1014100002BF0121E88C00F0DAFE07E0E88C984971
+:1014200000F0B4FD02E0E88C00F07EFE012076BD05
+:1014300000F067BE8F48C08C00F0F9BD1CB58D4C24
+:10144000E08C01AA0DF1050100F081FCA0B99DF826
+:101450000500022804BF9DF80400022804D10021E1
+:1014600000910123012204E00020009002230222C7
+:101470000021E08C00F0BBFC13BD000078B500BF7C
+:1014800097A0804D0088804E89B0ADF81A0000F01A
+:1014900019FC286810F1010F0ED069683074090A30
+:1014A000020A000CB074727406F110046868317599
+:1014B000F074090A717506E0002000F09DFE04003A
+:1014C00008BF0FF2282422460621002000F0A8FEC3
+:1014D0006079307221797172E078B072A178F1721E
+:1014E000607830731820217882A47173224610210D
+:1014F00000F096FE83A600F06DF84EF66E5108914E
+:1015000007AA2868079006212E2000F089FE2246AF
+:101510001021182000F084FE00F05CF81821012052
+:1015200000F09FFE00F0D4FE0DF1160006A9019018
+:10153000009105AB07220021012000F042FD00BF11
+:1015400068A0BDF818104B4C00900723BDF814009C
+:10155000002200F07AFF0DF11A0000900223BDF87E
+:101560001610BDF81400002200F06FFF02220221C5
+:10157000002000F01FFC0120207000F0C4FC0120BE
+:1015800060700021E170082060751021A1750120B4
+:101590002075A07000203D49A161C1B221440871AD
+:1015A000401CC1B21029F8DB002004900023A1697F
+:1015B000207D039102900122A17D607D0191009028
+:1015C0006178A07800F0B3FCA07808B100F080FD4D
+:1015D0000AB070BD32461021082000F021BE000084
+:1015E0002DE9F841012887B0044603D12348058836
+:1015F000468803E04FF4C8654FF47A66DFF87480DC
+:1016000008F190077878FFF7C1FD022C05D13878F2
+:10161000012814BF022800F012FC3C700020069044
+:10162000059008F1290204925FF0060298F828005C
+:1016300038A103900291019200230093324629467B
+:10164000002000F00FFC10490E2000F009FD0028DA
+:1016500008BF012C06D178780D4908B0BDE8F041EB
+:10166000FFF7E1BD08B0BDE8F0810000BC3E000816
+:10167000A40803206800002073170008EC04002071
+:1016800040E201008075FF1F0400002007B2010046
+:1016900046E001000021012000F0CFB902209FE7C1
+:1016A0000021042000F0C9B9012000F0E8B90120B0
+:1016B00000F0EDB910B50446616801F1080000F0D2
+:1016C0003DFA00B10120207010BD000010B10128CA
+:1016D00003D07047072000F0C0B9072000F0C5B95B
+:1016E0004003000053544D33325742006C7AD8AC5B
+:1016F00057720000123456789ABCDEF012345678D5
+:101700009ABCDEF0FEDCBA0987654321FEDCBA092B
+:101710008765432109485253544D00004AB10000E7
+:1017200011F8013B521E00F8013B1CBF11F8013BB0
+:10173000F8E770477FB50C466A4D61686A4EE8610C
+:101740002962284600F0F8FE246805F1240000F024
+:10175000FDFE746006F1080000F0F8FE0120307014
+:10176000296829B10FF2491200920294684688470D
+:101770007FBD1FB55C4C04F1080000F0EAFEE8B93B
+:101780002078D8B1694604F1080000F00BFF012071
+:1017900054492070C96941B10098029001A8884756
+:1017A0009DF804102170080003D0009800F0ADFFF0
+:1017B00004E0009904F1080000F0D4FE04F10800F0
+:1017C00000F0C7FE28B9207818B104F10800FFF72F
+:1017D00067FF1FBD2DE9FC410446002000F05EF8C4
+:1017E00066882088A268DFF8FC80C6F3090646EA0E
+:1017F0008026E068B6B2C1B2304600F03BF8002562
+:1018000048F2E800FFF753FF08E07888B04202D1C1
+:10181000226939781170787800B1012508F1240027
+:1018200000F097FEF0B9694608F1240000F0BAFE16
+:101830000098014600F10B07487A0F28E5D0B7F869
+:101840000100B0420CD1887A6169C01EC0B28842E2
+:10185000C8BF0846606102462069F91CFFF75EFFB9
+:101860003878D9E72800CBD0012000F017F8002005
+:10187000BDE8F68110B513461B4A5468A4F8090068
+:10188000E1720A46194604F10C00FFF747FF154ABA
+:101890001369BDE810400021002018471149096A6A
+:1018A00008B921B1084700291CBF0120084770472B
+:1018B00010B50146487A0F2818BF0E2807D10B48EB
+:1018C00000F05AFEBDE810400020FFF7EDBE064CC8
+:1018D00004F1080000F050FE04F10800BDE81040DB
+:1018E000FFF7DEBEE4030020880400200804002087
+:1018F0001948002101604160704710B500F00CF8F4
+:101900005C6819B1012904D1204301E024EA0000F8
+:10191000586082F3108810BDEFF3108272B60E4B40
+:10192000704738B5EFF3108472B60B490B4D086859
+:1019300020B1296888476A6890470AE0486820B162
+:10194000A8688047E968884703E028698047696993
+:10195000884784F3108831BDB4040020E43F0008B8
+:101960002DE9F041544CDFF85481A5692840A0616D
+:1019700031E0491C54F831000742FAD004EBC107AA
+:10198000184079681040014204BF4FF0FF327A607E
+:101990007E68304000F094F86062012101FA00F0A6
+:1019A00086437E60EFF3108272B6606A23698140DD
+:1019B000C9430B402361022004EBC00353F8087CA9
+:1019C0000F40401E43F8087CF6D182F31088606A0D
+:1019D00058F82010884763692069A26918401042AE
+:1019E00007D0E069216A084203D1002103EA020717
+:1019F000C0E700F0D8FEEFF3108872B62169606985
+:101A0000A2690140114201BFE069216A084200F069
+:101A10005AFF88F3108800F073FFA561BDE8F081DC
+:101A200038B51446EFF3108572B600F049F8234933
+:101A300041F8204085F3108831BD30B5EFF31082B6
+:101A400072B61D4B1C6904431C6153F83150284386
+:101A500043F8310082F3108830BDEFF3108172B685
+:101A6000154A536923EA000005E0EFF3108172B6CE
+:101A7000114A53691843506181F310887047EFF39E
+:101A8000108172B60C4AD3691843D061F4E770B57F
+:101A9000094C656A266A2062012101FA05F502E017
+:101AA000284600F012FF216AE0690842F8D0884316
+:101AB0002662E06170BD00001C000020A40200202E
+:101AC00002460020110C090404BF1020120412F079
+:101AD0007F4F04BF0830120205A312F0704F04BFFD
+:101AE000001D1201120FC0F11F00995C401A7047CF
+:101AF00004030202010101010000000000000000D7
+:101B000000F052FF9DF80E0005B000BDF8B500F1E1
+:101B10000C026B4621214FF66640F1E71C4900207C
+:101B2000087700221B48027000F036B818490A7F77
+:101B300041F82200087F401C0877704770B50446C2
+:101B40006078FF2802BFB4F8030000F47F40B0F5CE
+:101B5000406F12D100260E4D00E0761C297FF0B2B6
+:101B600088420AD2F1B255F8212020469047010060
+:101B7000F3D002D0022805D006E02046BDE8704030
+:101B8000FFF70CBC002070BD012070BD00000000FC
+:101B900058040020F404002080B500F055FF00F048
+:101BA00054FF00F053FF00F08BFF00F08AFF01F0BC
+:101BB00009F801F06DF801F06CF801F06BF801F034
+:101BC0006AF801F069F801F068F801F067F801F0CF
+:101BD00066F801F065F8BDE8014001F062B8000068
+:101BE000E0B500BF05A1009104228DF804206946EC
+:101BF00042F6292000F051FF07BD000053544D006C
+:101C000010B500782B4C18B1022810D005D310BDA8
+:101C100000210120A180207310BD607BFFF7B6FA80
+:101C2000607BBDE8104040F60101FFF7FCBA607B25
+:101C3000BDE81040FFF7AABA10B50FF24502002127
+:101C40000220FFF7EDFE1B4C0020042120732170C1
+:101C500042F63820214601F000F80A21A1801F2019
+:101C60004FF48061E072E180012004F10D01A07267
+:101C70000122BDE810400FF245030020FFF75EBAD5
+:101C80000D480C490068CA7A00F0070041304880CE
+:101C90001307087B04D518B98888401D888003E0A5
+:101CA000012804BF00200873891C42F6372000F089
+:101CB000D4BF000078040020282800400021022022
+:101CC000FFF7BBBE00B587B000F013F800F020F8B6
+:101CD000032100F009F800F013F800284CBFFF20A2
+:101CE0009DF8000007B000BDADF80410ADF8061077
+:101CF000704700208DF800007047049207A90391F7
+:101D000001220692CDF814D0002101A8FFF762BD90
+:101D10001822002101A800F0CBBF0F210291ADF8DD
+:101D200006207047ADF806200821ADF80410032204
+:101D3000704709220021684600F0BABF0821ADF8BB
+:101D4000041070471822002102A800F0B1BF70B53E
+:101D5000C8B006460C4615460522FFF7EBFFADF866
+:101D60002060FFF7EFFF302200F013F8052200F0AB
+:101D70001AF8002848BFFF2009D49DF8000030B9A8
+:101D80009DF80300207000209DF80410297048B0D1
+:101D900070BDADF80A200821ADF8081002220592A6
+:101DA00008A9049170470792CDF818D0002102A825
+:101DB000FFF710BD18B5C7B000F00CF83122FFF7DF
+:101DC000B1FFFFF79AFF00284CBFFF209DF80000ED
+:101DD00048B010BD00248DF81C008DF8004007A805
+:101DE000417082700021182201A800F061BF5CB52B
+:101DF000C7B00026ADF81C008DF81F2007A84C9C2A
+:101E0000817003718DF80060ADF82140FFF780FF0D
+:101E1000FFF794FF3222FFF780FF072100F009F857
+:101E2000FFF770FF00284CBFFF209DF8000049B06D
+:101E300050BD049107AA012106910392704700B595
+:101E400087B000208DF8000000F08BF9812200F0AF
+:101E500052F900F094F900284CBFFF209DF80000D3
+:101E600007B000BD2DE9F84DC7B09446DDF840E15C
+:101E7000519A559D569EDDF84CA1ADF81D108DF878
+:101E80001C004FF0000BADF81FC08DF821308DF80D
+:101E900022E000F02CF800F01FF824F8095F6680BB
+:101EA00000F05FF93F20ADF8040083210120ADF878
+:101EB000061000F00AF800F064F900284CBFFF207B
+:101EC0009DF8000048B0BDE8F08D07AA5744069081
+:101ED00003920D370497704788F800A007AC549917
+:101EE000E419524608F10100544400F0DBBE8DF8BD
+:101EF0002320174652998DF800B00DF1240809A847
+:101F0000B84400F0CFBE00B5C7B000F0C7F800F08D
+:101F100028F900F01BF9852200F0C6F800F030F92E
+:101F200000284CBFFF209DF8000047B000BD2DE900
+:101F3000F043C7B0DDF838814F9E509D519F529CB1
+:101F40008DF81C004FF0000907A88DF80090417033
+:101F500082700DF123018DF81F308DF820808DF8EF
+:101F600021608DF822500F608DF8274000F0F9F8BD
+:101F7000862200F0C0F80C2200F0FEF800284CBFCA
+:101F8000FF209DF8000047B0BDE8F08300B5C7B062
+:101F90000023ADF81C008DF800300DF11E00182252
+:101FA000016001A8002100F083FE882200F038F8CB
+:101FB00000F0E2F800284CBFFF209DF8000047B079
+:101FC00000BDF8B5C8B005460E4617461C4600F0E1
+:101FD00022F808A8467087708DF8205000F0EEF8BF
+:101FE0008A2200F0DAF8032200F0DDF8002848BF6A
+:101FF000FF200ED49DF8000058B94F994E98BDF8B7
+:1020000001202280BDF803300380BDF80500088060
+:10201000002049B0F0BD07220021684600F048BE0C
+:10202000ADF806203F21ADF804100622704700B538
+:10203000C7B000F040F800F094F800F087F88D2267
+:102040000F210291ADF80620022100F0A0F800F067
+:1020500098F800284CBFFF209DF8000047B000BD55
+:1020600018B5C7B0002304468DF800308DF81C4029
+:10207000224600F0A8F800F074F800F067F88E220D
+:1020800000F0B3F8641C0692049400F07AF800287B
+:102090004CBFFF209DF8000048B010BD00228DF815
+:1020A00000208DF81C007047ADF8062007A90391A9
+:1020B00001220492704700228DF80020ADF81C0028
+:1020C0007047ADF806203F21ADF80410022270479A
+:1020D00000B587B000208DF8000000F042F8922291
+:1020E00000F009F800F04BF800284CBFFF209DF8E5
+:1020F000000007B000BDADF806203F21ADF8041088
+:10210000704700B587B000208DF8000000F029F876
+:102110009422FFF7F0FF00F032F800284CBFFF20B8
+:102120009DF8000007B000BD00B5C7B0FFF7C3FFC2
+:1021300000F017F89522FFF7C4FF00F01DF8002803
+:102140004CBFFF209DF8000047B000BD3F21ADF817
+:10215000041070470023ADF81C008DF81E108DF898
+:1021600000301822002101A800F0A2BDADF8062021
+:102170003F21ADF804100322049207A90391012224
+:102180000692CDF814D0002101A8FFF723BB0491DB
+:1021900007AA0121069103927047ADF80A203F215A
+:1021A000ADF808107047059208A90491072207921C
+:1021B000CDF818D0002102A8FFF70CBB182200218F
+:1021C00002A800F075BD0DF11D0000F06BBD00B55B
+:1021D000C7B0FFF7BFFFA522FFF7C8FF00284CBF1D
+:1021E000FF209DF8000047B000BDADF8062007A90C
+:1021F000039101227047000020B501460648074DB3
+:10220000C2798A4218BFA84218BF0838F8D18A425A
+:1022100018BF002020BD00BFF873FF1F0070FF1F14
+:1022200018B50C46C7B0114600F03BF88DF81D40BC
+:1022300022460DF11E0000F035FD00F027F83F2189
+:10224000ADF804100C2200F026F8A41C06920494A9
+:1022500000F038F800284CBFFF209DF8000048B07F
+:1022600010BD00B5C7B000F00AF80F2200F01FF84B
+:1022700000284CBFFF209DF8000047B000BD0023A0
+:102280008DF81C008DF81D108DF8003018220021EB
+:1022900001A800F00DBDADF8062007A903910122A9
+:1022A000704700228DF800208DF81C007047ADF8B3
+:1022B00006203F21ADF804100222049207A90391E1
+:1022C00001220692CDF814D0002101A8FFF782BAAE
+:1022D00000B587B000208DF8000000F0E3F840F270
+:1022E000011200F022F90122069200F0E2F8002823
+:1022F0004CBFFF209DF8000007B000BD2DE9F8415C
+:1023000004460128C7B0884616461F4608BF02206B
+:1023100003D002280CBF102000200DF11D031D1852
+:1023200000F035F8012C8DF81C4002D0022C1AD098
+:102330001BE00224224641460DF11D0000F0B2FCD4
+:102340002E706F7000F0AEF800F0A6F84FF48172B6
+:1023500000F017F8E41C0692049400F0AAF8002894
+:1023600005D5FF2009E01024E4E7472005E09DF8AB
+:10237000000010B94E9800F063F8FFE748B0BDE8E0
+:10238000F081ADF8062007A90391032270470322CC
+:102390000021684600F08CBC2DE9F64F0C4605463E
+:1023A000012CC7B09B4608BF022003D0022C0CBFF3
+:1023B000102000200DF11F031E18FFF7E8FF012C6D
+:1023C000ADF81C508DF81E4002D0022C2BD02CE012
+:1023D0000227569C559DDDF85091DDF84CA1DDF8A3
+:1023E000488148993A4600F053F8A6F800B086F8BC
+:1023F000028086F803A086F804907571B47100F02D
+:1024000051F800F049F84FF4827207A9ADF80620A0
+:1024100003910A3703220497069200F04AF8002835
+:1024200005D5FF2009E01027D3E7472005E09DF8F8
+:10243000000010B9579800F003F849B0BDE8F08FDC
+:10244000BDF8011001800020704778B5C7B01D4667
+:102450004C9B00F059F800268DF800608DF8215053
+:102460002A4619460DF1220000F01CFC00F01AF873
+:1024700000F012F84FF4837200F051F8AD1D00F037
+:1024800016F800284CBFFF209DF8000049B060BD41
+:102490000DF11F0000F006BC3F21ADF8041070479D
+:1024A0008DF800301822002101A800F001BC06922E
+:1024B0000495CDF814D0002101A8FFF78BB9B8B569
+:1024C000C7B04C9C4D9D00F01FF800278DF82130BF
+:1024D0008DF800708DF822402246294600F01BF846
+:1024E000FFF7E0FFFFF7D8FF4FF4937200F017F803
+:1024F000E41D06920494FFF7DCFF00284CBFFF2088
+:102500009DF8000048B0B0BDADF81C00ADF81E103D
+:102510008DF8202070470DF1230000F0C3BBADF80B
+:10252000062007A9039101227047ADF806203F213C
+:10253000ADF80410704700000249034A01600261CF
+:10254000704700BF052600082F2600080060406085
+:102550007047EFF3108172B6026882420CBF01200F
+:1025600000201CE0EFF3108272B603680B60486035
+:1025700001600868416023E0EFF3108272B60860E2
+:1025800043684B6041604868016019E0EFF31081D7
+:1025900072B6436802681A6042680068426081F35C
+:1025A0001088704710B5EFF3108472B602680A60A5
+:1025B0000068FFE7FFF7EAFF84F3108810BD0860AA
+:1025C00082F310887047000000F0F0BB6C486D4942
+:1025D000016001F12002426001F13003836001F1EA
+:1025E0003C02026201F14403C36001F14C0202614A
+:1025F00001F16803436101F16C0282617831C161CC
+:1026000000F0DCBB38B504465F4D05F11000FFF764
+:102610009DFF5B494868A168016005F11001E2680F
+:10262000C2608160456000F0E5FB58482DE080B550
+:1026300053494A6813680120187200F0E1FB00203A
+:1026400002BD38B5514C504D07E0694605F1100008
+:10265000FFF7A8FF00982168884705F11000FFF7F1
+:1026600078FF0028F1D031BD48484168084738B5A7
+:102670000446474D2846FFF769FF4149C868A168ED
+:102680000160456000F0C1FB42482168016062685A
+:102690004260002032BD80B53949CA6813681020F5
+:1026A000187200F0B8FB002002BD3549CA683949EC
+:1026B00010680B68184738B5364C354D06E069464A
+:1026C0002846FFF76FFF0098616888472846FFF7A4
+:1026D00040FF0028F3D031BD38B504462E4D2846C2
+:1026E000FFF734FF2D48FFF731FF25480069A16847
+:1026F0008160E268C26005612168016062684260D1
+:10270000216941616269826131BD80B5014623481A
+:10271000FFF732FFBDE802400FF2050000F08BBB6F
+:1027200038B5174C1D4D08E069462846FFF73AFFBB
+:10273000009920690069FFF71FFF2846FFF709FF8E
+:102740000028F1D031BD10B5154C2046FFF7FEFE34
+:102750000B4948690460BDE8104000F080BB1CB51F
+:102760000F4C06E069462046FFF71CFF009800F07A
+:1027700019F82046FFF7EDFE0028F3D013BD000046
+:1027800000000320B009032084080320C4040020B3
+:102790009C080320CC040020340A0320BC04002041
+:1027A0003C0A0320704770473A4981B00A680243E7
+:1027B0000A60096808400090009801B0704710B5A1
+:1027C000354C88B0206840F400402060FFF790F856
+:1027D00032490020FEF737FC6846142100F052FB16
+:1027E0000020029003214FF46042019100920120E9
+:1027F000FFF7DAFF69464FF0904000F047FB606C4E
+:10280000400840006064182100910220FFF7CCFFCF
+:102810006946234800F03AFB606C20F002006064D7
+:10282000FEF78EF9FEF78EF9FEF792F901210120ED
+:10283000FFF763F80121002000F0FCFB01210120DB
+:1028400000F0F8FB0121022000F0F4FBFFF7BEFED0
+:10285000144A00210820FFF7E3F8134C0FF24D0251
+:102860000FF24D00019204F23C510091694600F0D4
+:1028700049F804F25471029104F5C96240F23C51E6
+:1028800003920591049402A8FFF726FFFFF79CFE30
+:1028900008B010BD4C00005808000058100400207B
+:1028A0000004004847290008240003207047000066
+:1028B00080B5FFF748FFFEF71DFDBDE8044000218D
+:1028C0000120FFF71AB8FFF72CB84FF0FF30FFF7E1
+:1028D00047B800210820FFF7B0B80220FFF7CFB8B3
+:1028E0000220FFF7D4B8012805D0022805D010280F
+:1028F00005D1FEF79DBDFEF79DBDFEF79FBD70475C
+:10290000704700007FB50C464C4D61684C4EE86145
+:102910002962284600F0DEFB2468746006F1080096
+:10292000FFF714FE012000F065F8012030702968DF
+:1029300041B10FF2E5020FF2E90300920193029414
+:10294000684688477FBD1FB53D4C04F10800FFF77E
+:1029500000FEE8B92078D8B1694604F10800FFF715
+:1029600021FE012035492070C96941B100980290CB
+:1029700001A888479DF804102170080003D0009832
+:10298000FFF7C3FE04E0009904F10800FFF7EAFD39
+:1029900004F10800FFF7DDFD28B9207818B104F133
+:1029A0000800FFF796FF1FBD2DE9F04105460E46D2
+:1029B00090461C46002000F01DF8214F7868A0F8D2
+:1029C0000950C672324641460C30FEF7A7FE1B4A3C
+:1029D000136900210020984748F2E800FFF780FFC4
+:1029E00079688A78D21C04F10800FEF797FEBDE8EA
+:1029F000F041012010B51149124C096A20B901B10A
+:102A000088470021217010BD0120207011B1BDE860
+:102A10001040084710BD00000020FFF75EBF000017
+:102A200010B50146064C04F10800FFF7A5FD04F1BE
+:102A30000800BDE81040FFF74CBF00003404002040
+:102A400098040020F50400207047704718B51B4C0F
+:102A50000020206087B041F60A00ADF8180000940D
+:102A60000323012206A90120FFF748FC42F6292191
+:102A70000122ADF818100492A01C05900A21002331
+:102A8000022203910293019300922023208806AA38
+:102A90000121FFF781FC08B010BD1CB542F62922C8
+:102AA000904209D10C680548009400220B794188B6
+:102AB0000088FFF7CAFC16BD002016BDF0040020F8
+:102AC0007047704770B5024686B050780024FF28E2
+:102AD0003BD1B2F803106C4840F60143C91A22D02A
+:102AE000123901BFB2F80710C088401C81422CD1B6
+:102AF000957AB2F80500537A0124012D0BD1009389
+:102B000002F10A06019600230022FFF7D8FC0023F9
+:102B10008DF8083016E00A320192009301228023DA
+:102B2000FFF7CDFC11E04088B2F80710801C81420D
+:102B30000BD1507B0124C1074EBF8DF80840022005
+:102B40008DF8080002A8FFF75BF8204606B070BDBC
+:102B5000FEB5014601AA487A8DF804004B7A088830
+:102B60005070DC0704D50888000A9070032300E049
+:102B70000223487A040707D54888D0545B1C4C8848
+:102B8000D8B2240A14545B1C4C7AE00610D50D7A96
+:102B900000200BE001EB4004DFB2A688D6555B1C99
+:102BA000A488DEB2240A94555B1C401CA842F1DBC9
+:102BB00035484188008801AC0094DBB20022FFF761
+:102BC00044FCFEBD18B587B030482F4CFEF7AEFF71
+:102BD00041F60D01ADF8181000940823012206A952
+:102BE0000120FFF78BFB42F63720ADF818000122D9
+:102BF00004920A20A11C0390002310220591029345
+:102C000001930092072300F023F842F63820ADF834
+:102C1000180000220492029201920A20211D0390C2
+:102C20000222059100F012F842F63920ADF81800A2
+:102C30000022049201920A20A11D0390022308227F
+:102C40000591029300F002F808B010BD0092012334
+:102C5000208806AA0121FFF79FBB1CB5002242F67F
+:102C60003724001B09D0401E0BD1074800910123D7
+:102C700081880088FFF7E9FB02E00846FFF768FF5C
+:102C80000246104616BD0000D4040020C52A0008E4
+:102C9000704770477047704770477047704770477C
+:102CA0007047704710B50446FEF738FD204610BD4A
+:102CB00010B5044610460A460146204600F014FAB4
+:102CC000204610BDC0680840884201D101207047ED
+:102CD00000207047C0690840884201D10120704738
+:102CE0000020704710B5614C02212046FFF7F2FF2B
+:102CF00038B16068C043810703D5FFF7DCFC0220D0
+:102D000018E001212046FFF7E5FF38B16068C043B5
+:102D1000C10703D5FFF795FC01200BE008212046F1
+:102D2000FFF7D8FF38B16068C043010703D5FFF74C
+:102D300016FD0820A06010BD10B54C4C00F033F813
+:102D400018B96068C043810306D400F02CF830B98C
+:102D50006068C043810302D5BDE8104064E00821EB
+:102D600000F022F870B96068C04301030AD56068BA
+:102D70003F4940F400206060086880474FF400221B
+:102D8000A26010BD202100F00FF858B96068C04360
+:102D9000810207D5606840F400106060BDE8104013
+:102DA000FFF762BC10BD022120468BE740BF20BF69
+:102DB0003048016841F400410160704780B52E48F9
+:102DC000016841F480110160006800F480100090F7
+:102DD00000982648016841F001010160026842F450
+:102DE000803202602C20FDF704FFBDE802402D2058
+:102DF000FDF7FFBE2148016849084900016070479E
+:102E00001F494FF48030086070471C48016821F06A
+:102E100002010160704719484FF4003141600268B7
+:102E200022F40032026070471448016841F4003116
+:102E30000160FFF73ABC38B504460C4D082128461E
+:102E4000FFF740FF30B10A480460696821F40021AF
+:102E5000696031BDA0474FF40020A86031BD07482C
+:102E6000016821F00801016070470000000C005863
+:102E7000E40400200C04005850000058040C0058D2
+:102E8000080C0058002200F039B900002DE9F0418B
+:102E900006460A464FF0000C4FF00F082CE0574F43
+:102EA000BE4214BF4FF0070E4FF0040E0EFA01F1B0
+:102EB000294344F82310C143514C236855680B4003
+:102EC000ED0348BF03432360636855680B40AD03BF
+:102ED00048BF034363604B4C236855680B40ED02C9
+:102EE00048BF0343236063680B4051688D0248BFAD
+:102EF000034363600CF1010C106830FA0CF172D0DE
+:102F0000012303FA0CF31840F4D05468022C18BFC4
+:102F1000122C4FEA8C010ED14FEADC0406EB84043C
+:102F200001F01C0E256A08FA0EF7BD43176907FA6F
+:102F30000EF73D4325624FEA4C0403253768A54050
+:102F4000ED4305EA070E177907F00307A74047EAA4
+:102F50000E0737605768012F18BF022F03D0112FBB
+:102F600018BF122F11D1B76805EA070ED768A7401E
+:102F700047EA0E07B760776827EA03035768C7F385
+:102F8000001707FA0CF73B437360F3681D40936822
+:102F900003FA04F42C43F4605468E300AAD51A4CF5
+:102FA0004FEA9C0354F8237001F00C0108FA01F574
+:102FB000B6F1904F27EA050508BF4FF0000E11D07B
+:102FC000124FBE4208BF4FF0010E0BD0104FBE4251
+:102FD00008BF4FF0020E05D00E4FBE427FF45FAF28
+:102FE0004FF0030E62E7BDE8F0810B4A136803421D
+:102FF0001CBF1060FFF777BC70470000001000484E
+:1030000080080058000800580800014000040048EB
+:1030100000080048000C00480C080058274981B0FF
+:103020000A6802430A60096808400090009801B0ED
+:103030007047000030B585B004460D46684614213F
+:10304000FFF720FF210008BF042004D0012C18BF87
+:10305000022C02D10820FFF7E1FF2900DFF86020F1
+:1030600019A00ED130F81410009100230193012112
+:1030700002230291039300F01BF8012000F068F98D
+:1030800014E0012D12D130F814000E4B009002957F
+:10309000019300F00DF800BF0DA0045D00220F2188
+:1030A00060B2FDF789FD60B2FDF7A3FD05B030BD4C
+:1030B000694652F82400FFF7E9BE00004C000058B2
+:1030C000500000200000211010000100020000004C
+:1030D0000A0607000249034A01600261704700BF07
+:1030E0006F260008972600084018491C1CBFB1F144
+:1030F000010100F8012DF9D17047000000B500BFB3
+:10310000130096469446103928BFA0E80C50FAD810
+:103110005FEA417C28BF0CC048BF40F8042BC907B8
+:1031200028BF20F8022B48BF00F8012B00BD00008B
+:10313000944900E0944981B00A6802430A60096832
+:1031400008400090009801B0704710B5FDF7DEFC14
+:103150008E4C606840010ED56068C0000BD4FDF74E
+:10316000CDFCFDF7CBFC206840F480302060216866
+:1031700021F48031216000F0CAF80020FFF73CF80C
+:1031800040B180798249E160E26822F47C5242EAEF
+:103190000022E26000F048F87E487F4C016800227F
+:1031A0000260036903F0500303610120FFF7C2FFCF
+:1031B0000220FFF7BFFF0420FFF7BAFF0120FFF74F
+:1031C000B7FF0220FFF7B4FF00220F210E20FDF70A
+:1031D000F3FC0E20FDF70DFD00220F213A20FDF734
+:1031E000EBFC3A20FDF705FD00210F226B48416002
+:1031F000826047F6FF710022C16002618261C26194
+:10320000046000F0D9F8CA20606253216162FF2196
+:10321000A068C008C000A0606162FFF7D0FA4FF05C
+:10322000FF30FEF79DFBFAE738B5AEB05C4C1CA84A
+:1032300021464822FEF772FA01A81C21FFF722FE60
+:1032400008A804F148015022FEF768FA4F48554C8F
+:10325000016821F0180101600722206820F4C06095
+:1032600040F4007020604FF48033216801F4C061A5
+:1032700000914FF4807500991C9201211E9100224B
+:1032800040211D93209127921F951CA8FCF75FFFFA
+:103290006F20022101900291002203920492059274
+:1032A00006920792012101A8FDF7E3F943F6030115
+:1032B000002208910E9200214FF4804202230F91C8
+:1032C00019921A931B91189508A800F031F9E0693A
+:1032D00020F07000E06134480168C1F303200090E1
+:1032E000009828B9E0690009000140F0040007E0F7
+:1032F0000098E169801E80F30400090940EA01108A
+:10330000E061E06940F40040E0612FB030BD274843
+:1033100081B0016841F4801101603F21006800F430
+:10332000801000900098224841604161016841F49A
+:103330007C110160026942F47C120261016841F073
+:103340003F010160026942F03F02026101B0704733
+:1033500038B50446FDF7CCFB14F1010F054609D042
+:10336000FDF7EBFB041905E01248016821F00401A8
+:10337000016030BFFDF7BCFB401BA042F4D331BD60
+:1033800000000000480000584C0000589000005811
+:10339000FECAFECA80080058002800401004002021
+:1033A000003D0008000400585875FF1F50000058E9
+:1033B000040C005810ED00E070B5040049D094F8FA
+:1033C000210028B9002184F820102046FDF775FC63
+:1033D00000F04EF853202168486200F052F8FF25B3
+:1033E00010B100F03FF834E02168DFF8AC008A68E3
+:1033F00002408A602268936866682169A0690E436A
+:103400000643334393602068E168016120680169E5
+:10341000A26841EA024101612068C16821F080018F
+:10342000C1602068C16C89088900C1642168CA6CC8
+:10343000E369606903431A43CA64216888688106A6
+:1034400009D400F01CF830B120684562042100F076
+:103450001DF8012070BD20684562012184F821100B
+:10346000002070BD20684562042184F82110704757
+:10347000022084F82100CA21226851627047204648
+:103480000CE0204623E02068C0F8248084F8211056
+:10349000002084F820007047BFFF8FFF38B5044636
+:1034A0002068C16821F0A001C160FDF721FB05463D
+:1034B0002068C168880608D4FDF71AFB401B40F25B
+:1034C000E9318842F4D3032032BD002032BD38B543
+:1034D00004462068C1684A0612D44FF0FF31C1602B
+:1034E000FDF706FB05462068C168480608D4FDF7CD
+:1034F000FFFA401B40F2E9318842F4D3032032BD89
+:10350000002032BDDFF82C130A68030903F47F237F
+:1035100000019A4300F47F2000F088B9DFF81423FB
+:103520001368010C23EA014343EA00431360704728
+:103530002DE9F843054600242878DFF8F8624106B3
+:10354000A0464FF0B0472DD5286B70B1B0F5800F75
+:1035500006D0B0F5000F18BFB0F5400F17D01FE030
+:10356000F96841F48031F960F3E0386820F0806058
+:103570003860FDF7BDFA81463868000140F1D68019
+:10358000FDF7B6FAA0EB09000228F5D90324DDE027
+:10359000FDF7AEFAA0EB0900022840F2CF80F5E774
+:1035A0000124A0462868010531D5B06800F44078B0
+:1035B000286C80452AD0FDF7A1FAB8F1000FB16858
+:1035C00005D1286C21F440710143B1601EE0B06860
+:1035D00040F48030B06021F44071B06820F4803055
+:1035E000B060286C0143B160B068C0070ED5FDF72C
+:1035F0007FFA8046B068800708D4FDF779FAA0EB1F
+:10360000080041F289318842F4D30324A046287887
+:10361000C10705D53268A869920840EA8202326083
+:103620002978880705D53168E86921F440610143AC
+:1036300031602978C80644BFA86AFFF76FFF287871
+:10364000810644BFE86AFFF769FF2878410744BF55
+:10365000286AFFF757FF2878010744BF686AFFF719
+:1036600051FF2868C1051ED53268686B22F04062A0
+:1036700002433260696BB1F1006F00F0C9F8686B0A
+:10368000B0F1806F0FD1396821F0806100F0CBF884
+:1036900004463868000163D5FDF72AFA001B0228AA
+:1036A000F7D94FF0030870E0FDF722FA001B02285B
+:1036B00064D9F6E7316821F04041316020F0805054
+:1036C000326822F0406210433060A86BB0F1C05FF6
+:1036D00000F09EF82868410576D53268E86B22F044
+:1036E000405202433260E96BB1F1005F03D1F868E8
+:1036F00040F48030F860E86BB0F1805F64D13968E5
+:1037000021F0806100F08FF80446386800014CD544
+:10371000FDF7EEF9001B0228F7D94FF0030853E03C
+:10372000FDF7E6F9001B022847D9F6E700F067F835
+:10373000A86821F4781100F071F88146386800011A
+:103740007FF526AF3969686901433961002C7FF440
+:1037500028AF3168286B21F440010143316021E733
+:103760003969686821F4FE4141EA0021396139690B
+:10377000E86821F0606100F051F804463868000103
+:1037800092D5396968690143396129688805A1D5ED
+:10379000A86BB0F1804F1CBFB0F1004F002889D159
+:1037A000316821F0404108438EE700F028F828698D
+:1037B00021F0604100F032F8044638680001AFD5CE
+:1037C00039696869014339612968C80405D5F16818
+:1037D000686C21F440410143F160296888040BD5ED
+:1037E000796AE86C21F0300101437962796AA86C4A
+:1037F000890840EA810179624046BDE8F283386970
+:10380000696820F4FE4040EA012038613969704758
+:1038100003D1F86840F08070F86070470143396167
+:10382000396841F080613960FDF762B91043086082
+:103830007047000088000058206881684A06704779
+:10384000F8B5044640F60F002568E9692A68AB68B8
+:1038500008400DD1880602D5960602D4D80040F162
+:103860008980E16E00294FD02046BDE8F44008472A
+:103870006248034204BF624E32427BD0CE0709D574
+:10388000D70507D501262E62D4F8885045F00105EA
+:10389000C4F888508D070AD5DE0708D527680225A9
+:1038A0003D62D4F8885045F00405C4F888504D07AF
+:1038B0000AD5DE0708D5276804253D62D4F888506C
+:1038C00045F00205C4F888500D070CD5960601D4C2
+:1038D000034208D0256808202862D4F8880040F008
+:1038E0000800C4F8880008050BD5550109D52668DD
+:1038F0004FF400603062D4F8880040F02000C4F833
+:103900008800D4F88800002870D0880607D5910672
+:1039100001D4D80003D5E16E09B120468847D4F818
+:10392000880021688A68510602D410F0280F1AD046
+:10393000204600F069F8FFF77FFF0FD500F057F839
+:1039400060B1DFF8C0108163A06F00F079F8002843
+:103950004CD0A06F816BBDE8F44008472046BDE81D
+:10396000F24000F004B9204600F001F90020C4F84C
+:103970008800F1BDC80209D55E0207D54FF480105A
+:1039800028622046BDE8F24000F0F2B8080609D5EA
+:10399000160601D4180205D5216F39B32046BDE8BB
+:1039A000F440084748060FD553060DD5286820F087
+:1039B000400028602021C4F88010002020672046A5
+:1039C000BDE8F24000F0D6B8080206D5530004D591
+:1039D0002046BDE8F24000F0DDB8C80148BF002A2B
+:1039E00004D52046BDE8F24000F0D5B8F1BD8168AD
+:1039F00021F040018160A06F7047000001000010BD
+:103A0000200100042B3A000801680A6822F4907231
+:103A10000A60DFF82810026893680B409360202248
+:103A2000C0F884200021C1667047806A00F1560109
+:103A300000220A810A8000F09AB80000FEFFFFEF22
+:103A400038B500F1240200245178022903D0042063
+:103A50009061012428E001680B6823F00E030B60DD
+:103A600001680D686D086D000D60516A0B6823F4E4
+:103A700080730B60012192F82030D56903F01C039C
+:103A800099406960936AD16A5960116B31B10B68D2
+:103A900023F480730B60536B916B5960012151705B
+:103AA0001470516901B18847204632BDF8B500F164
+:103AB00024010423CA6914680268156891F820601B
+:103AC00006F01C0603FA06F73C4210D06F070ED52D
+:103AD0001468A50603D4146824F00404146000F0EC
+:103AE0003DF8C968002938D0BDE8F44008470223F2
+:103AF00003FA06F73C4213D0AF0711D51468A506A8
+:103B000005D4146824F00A04146001224A7000F0FD
+:103B100025F800220A708968F9B1BDE8F440084729
+:103B2000082303FA06F6344217D02B0715D514687C
+:103B300024F00E041460012291F82030CC6903F0C7
+:103B40001C039A40626001228A614A7000220A7056
+:103B5000096911B1BDE8F4400847F1BD91F8202092
+:103B6000CC6902F01C02934063607047000070470C
+:103B70007047000000680649884204D1034A106873
+:103B8000002818BF0047704700000000E80400202C
+:103B9000003801407047704700EB81003D4AD0F883
+:103BA0008010914201D0012070470020704742F4FC
+:103BB000806240F82120704737481F2181610268E8
+:103BC000D208D20042F0030202603448016841F09A
+:103BD0000401016030BF7047704710B5304C00F0F1
+:103BE00048F80028FBD1042100F044F828B92D48FA
+:103BF0000068010403D500F03FF800F057F80022F8
+:103C000003212046FFF7D3FF23480168C908C900F4
+:103C100041F0020101602148016841F004010160A6
+:103C200030BF10BD10B51E4C00F026F800F021F892
+:103C30000028FBD14FF0B040816801F00C0104294D
+:103C400011D1016841F48031016001688903FCD51C
+:103C500082689208920042F002028260816801F05C
+:103C60000C010829FAD12046BDE8104000220321AA
+:103C70009DE7032120468FE700220421204696E796
+:103C800080B500F02DF80548016821F004010160BD
+:103C900030BF01BD000400800004005810ED00E0BA
+:103CA000001400588804005800F022B84FF0B040CB
+:103CB000016841F48071016001684905FCD58268A2
+:103CC0009208920042F001028260416A89088900EC
+:103CD0004162816801F00C010429FAD170470000AB
+:103CE0000248016821F002010160704710E000E025
+:103CF0000248016841F002010160704710E000E0F5
+:103D000000000000000000000000000000000000B3
+:103D100000000000000000000000000000000000A3
+:103D20000000000000000000000000000000000093
+:103D30000000000000000000000000000000000083
+:103D40000000000000000000000000000000000073
+:103D50000000000000000000000000000000000063
+:103D60000000000000000000000000000000000053
+:103D70000000000000000000000000000000000043
+:103D80000000000000000000000000000000000033
+:103D9000000000000000000001000000030000001F
+:103DA0000500000001000000010000000600000006
+:103DB0000A000000200000000200000004000000D3
+:103DC000080000001000000040000000800000001B
+:103DD0000001000000020000A0860100400D030069
+:103DE000801A060000350C0040420F0080841E003F
+:103DF00000093D0000127A000024F40000366E0134
+:103E00000048E801006CDC02000000000000000037
+:103E100000000000000000007047FEE7FEE7FEE73C
+:103E2000FEE770477047704700F024B80548FFF779
+:103E30003DBE0548FFF704BD0448FFF701BD044837
+:103E4000FFF734BE24030020180200208C0100205C
+:103E5000840300201020FFF7C8B80120FFF7C5B881
+:103E60000220FFF7C2B8FDF799B8FEF765BFFEF76D
+:103E700039BF000002490A68886882180A607047E2
+:103E80004400002030B5016884684218416802EBA4
+:103E90005103C9070BD54C4409E012F9011B12F874
+:103EA000015B002904F8015B05D5491CF9D19A4250
+:103EB000F3D10C3030BD491EF1D5F8E70000000009
+:103EC00000000000000000000000000000000000F2
+:103ED00044000800400508013A799C00F401000004
+:103EE000FFFFFFFF480101000000000080B500F067
+:103EF00015F802000023DB431068984204D011003B
+:103F00000220ABBE002010605068984204D0111D02
+:103F10000220ABBE0020506001BD00000148704788
+:103F2000000000006000002010B5074979441831F6
+:103F3000064C7C44163404E00A68081D1144884786
+:103F40000146A142F8D110BD2C0000005000000035
+:103F50004EF68851CEF20001086840F47000086007
+:103F6000BFF34F8FBFF36F8F4FF00070E1EE100A79
+:103F70007047000047D3FFFF900400006800002056
+:103F8000800800002400032000000000F9FEFFFF6D
+:103F90005C010000480000000400002000F00DF863
+:103FA000002801D0FFF7C0FFAFF300800020AFF37F
+:103FB0000080FFF7CAF800F002F80120704700F017
+:103FC00001B800000746384600F002F8FBE70000A1
+:103FD00080B5FFF78BFF024A11001820ABBEFBE74C
+:103FE00026000200813C0008A93C0008DB3B0008D9
+:103FF000253C0008B93B0008D93B00080148804730
+:1040000001480047BD0900080D400008AFF30080DB
+:10401000FFF79EFFFFF7C2FFFFF7FEBFFFF7FEBFF0
+:10402000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFC4
+:10403000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFB4
+:10404000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFA4
+:10405000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF94
+:10406000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF84
+:10407000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF74
+:10408000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF64
+:10409000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF54
+:1040A000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF44
+:1040B000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF34
+:1040C000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF24
+:1040D000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF14
+:1040E000FFF7FEBFFFF7FEBFFFF7FEBF020DFF01A8
+:1040F000D700F8FFF0000010FD000001FC000E08E2
+:104100000048000C0048000C004800093D00F8FF82
+:040000050800400DA2
:00000001FF
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Inc/app_common.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Inc/app_common.h
index 2a1d61089..4defc5d7a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Inc/app_common.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Inc/app_common.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : app_common.h
- * Description : App Common application configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : App Common application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Inc/app_conf.h
index 3ba87d026..45d7cd910 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Inc/app_conf.h
@@ -1,8 +1,9 @@
/**
******************************************************************************
* File Name : app_conf.h
- * Description : Application configuration file for BLE middleWare.
- ******************************************************************************
+ * Description : Application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
@@ -17,17 +18,18 @@
*/
/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef APP_CONFIG_H
-#define APP_CONFIG_H
+#ifndef APP_CONF_H
+#define APP_CONF_H
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Application Config
******************************************************************************/
-/**< generic parameters ********************************************************/
+/**< generic parameters ******************************************************/
/**
* Define Tx Power
@@ -92,16 +94,21 @@
*/
#define CFG_BLE_ERK {0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21,0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21}
+/* USER CODE BEGIN Generic_Parameters */
+/**
+ * SMPS supply
+ * SMPS not used when Set to 0
+ * SMPS used when Set to 1
+ */
+#define CFG_USE_SMPS 1
+/* USER CODE END Generic_Parameters */
+
/**< specific parameters */
/*****************************************************/
-#define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI4_IRQHandler
-#define PUSH_BUTTON_SW2_EXTI_IRQHandler EXTI0_IRQHandler
-#define PUSH_BUTTON_SW3_EXTI_IRQHandler EXTI1_IRQHandler
-
/**
* AD Element - Group B Feature
*/
-/* LSB - Second Byte */
+/* LSB - Second Byte */
#define CFG_FEATURE_OTA_REBOOT (0x20)
/******************************************************************************
@@ -373,7 +380,6 @@ typedef enum
*/
#define CFG_DEBUG_APP_TRACE 0
-
#if (CFG_DEBUG_APP_TRACE != 0)
#define APP_DBG_MSG PRINT_MESG_DBG
#else
@@ -391,11 +397,6 @@ typedef enum
#define CFG_DEBUGGER_SUPPORTED 1
#endif
-/* USER CODE BEGIN Defines */
-#define CFG_LED_SUPPORTED 0
-#define CFG_BUTTON_SUPPORTED 1
-/* USER CODE END Defines */
-
/**
* When CFG_DEBUG_TRACE_FULL is set to 1, the trace are output with the API name, the file name and the line number
* When CFG_DEBUG_TRACE_LIGHT is set to 1, only the debug message is output
@@ -432,6 +433,15 @@ typedef enum
#define DBG_TRACE_MSG_QUEUE_SIZE 4096
#define MAX_DBG_TRACE_MSG_SIZE 1024
+/* USER CODE BEGIN Defines */
+#define CFG_LED_SUPPORTED 0
+#define CFG_BUTTON_SUPPORTED 1
+
+#define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI4_IRQHandler
+#define PUSH_BUTTON_SW2_EXTI_IRQHandler EXTI0_IRQHandler
+#define PUSH_BUTTON_SW3_EXTI_IRQHandler EXTI1_IRQHandler
+/* USER CODE END Defines */
+
/******************************************************************************
* Scheduler
******************************************************************************/
@@ -496,7 +506,10 @@ typedef enum
typedef enum
{
CFG_LPM_APP,
- CFG_LPM_APP_BLE
+ CFG_LPM_APP_BLE,
+ /* USER CODE BEGIN CFG_LPM_Id_t */
+
+ /* USER CODE END CFG_LPM_Id_t */
} CFG_LPM_Id_t;
/******************************************************************************
@@ -506,6 +519,6 @@ typedef enum
#define CFG_OTP_END_ADRESS OTP_AREA_END_ADDR
-#endif /*APP_CONFIG_H */
+#endif /*APP_CONF_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Inc/stm32_lpm_if.h
index 38e326512..d8e67947f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Inc/stm32_lpm_if.h
@@ -1,46 +1,22 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file stm32_lpm_if.h
-* @brief Header for stm32_lpm_f.c module (device specific LP management)
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
******************************************************************************
* @attention
*
-* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics International N.V.
+* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted, provided that the following conditions are met:
-*
-* 1. Redistribution of source code must retain the above copyright notice,
-* this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following disclaimer in the documentation
-* and/or other materials provided with the distribution.
-* 3. Neither the name of STMicroelectronics nor the names of other
-* contributors to this software may be used to endorse or promote products
-* derived from this software without specific written permission.
-* 4. This software, including modifications and/or derivative works of this
-* software, must execute solely and exclusively on microcontroller or
-* microprocessor devices manufactured by or for STMicroelectronics.
-* 5. Redistribution and use of this software other than as permitted under
-* this license is void and will automatically terminate your rights under
-* this license.
-*
-* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
-* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
-* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+* This software component is licensed by ST under BSD 3-Clause license,
+* the "License"; You may not use this file except in compliance with the
+* License. You may obtain a copy of the License at:
+* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32_LPM_IF_H
@@ -89,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Inc/stm32wbxx_hal_conf.h
index 5c703f75d..31d63e37a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Inc/stm32wbxx_hal_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Inc/stm32wbxx_hal_conf.h
@@ -58,6 +58,7 @@
#define HAL_UART_MODULE_ENABLED
/*#define HAL_USART_MODULE_ENABLED */
/*#define HAL_WWDG_MODULE_ENABLED */
+#define HAL_EXTI_MODULE_ENABLED
#define HAL_CORTEX_MODULE_ENABLED
#define HAL_DMA_MODULE_ENABLED
#define HAL_FLASH_MODULE_ENABLED
@@ -221,6 +222,10 @@
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32wbxx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32wbxx_hal_flash.h"
@@ -333,9 +338,9 @@
* If expr is true, it returns no value.
* @retval None
*/
-#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
+ #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
/* Exported functions ------------------------------------------------------- */
-void assert_failed(uint8_t* file, uint32_t line);
+ void assert_failed(uint8_t* file, uint32_t line);
#else
#define assert_param(expr) ((void)0U)
#endif /* USE_FULL_ASSERT */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Inc/utilities_conf.h
index c98d97ba1..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Inc/utilities_conf.h
@@ -1,3 +1,4 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* File Name : utilities_conf.h
@@ -9,13 +10,14 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef UTILITIES_CONF_H
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/app_entry.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/app_entry.c
index cac322877..90395003a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/app_entry.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/app_entry.c
@@ -69,8 +69,8 @@ static void SystemPower_Config( void );
static void Init_Debug( void );
static void appe_Tl_Init( void );
static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status );
-
static void APPE_SysUserEvtRx( void * pPayload );
+
#if (CFG_HW_LPUART1_ENABLED == 1)
extern void MX_LPUART1_UART_Init(void);
#endif
@@ -107,7 +107,7 @@ void APPE_Init( void )
/**
* From now, the application is waiting for the ready event ( VS_HCI_C2_Ready )
- * received on the system channel before starting the BLE Stack
+ * received on the system channel before starting the Stack
* This system event is received with APPE_SysUserEvtRx()
*/
/* USER CODE BEGIN APPE_Init_2 */
@@ -220,8 +220,6 @@ static void appe_Tl_Init( void )
return;
}
-
-
static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status )
{
UNUSED(status);
@@ -235,7 +233,7 @@ static void APPE_SysUserEvtRx( void * pPayload )
TL_TRACES_Init( );
APP_BLE_Init( );
- UTIL_LPM_SetOffMode(1 << CFG_LPM_APP, UTIL_LPM_ENABLE);
+ UTIL_LPM_SetOffMode(1U << CFG_LPM_APP, UTIL_LPM_ENABLE);
return;
}
@@ -287,7 +285,6 @@ void UTIL_SEQ_Idle( void )
return;
}
-
/**
* @brief This function is called by the scheduler each time an event
* is pending.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/hw_timerserver.c
index 52a1bfa0d..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/hw_timerserver.c
@@ -1,22 +1,21 @@
/**
******************************************************************************
- * File Name : hw_timerserver.c
- * Description : Hardware timerserver source file for BLE
- * middleWare.
+ * File Name : hw_timerserver.c
+ * Description : Hardware timerserver source file for STM32WPAN Middleware.
+ *
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/hw_uart.c
index 52e9e2b3a..9a553610d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/hw_uart.c
@@ -1,7 +1,7 @@
/**
******************************************************************************
* File Name : Src/hw_uart.c
- * Description : HW UART source file for BLE middleWare.
+ * Description : HW UART source file for STM32WPAN Middleware.
*
******************************************************************************
* @attention
@@ -48,7 +48,7 @@ extern UART_HandleTypeDef huart1;
hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
} while(0)
- /* Variables ------------------------------------------------------------------*/
+/* Variables -----------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
@@ -65,73 +65,73 @@ extern UART_HandleTypeDef huart1;
void (*HW_hlpuart1TxCb)(void);
#endif
- void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_RX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_RX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_RX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_RX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ return;
+}
+
+void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
{
- HAL_StatusTypeDef hal_status = HAL_OK;
- hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
+ default:
+ break;
}
switch (hal_status)
@@ -161,8 +161,8 @@ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t
hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
{
-HAL_StatusTypeDef hal_status = HAL_OK;
-hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
@@ -250,33 +250,33 @@ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
switch ((uint32_t)huart->Instance)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1RxCb)
- {
- HW_huart1RxCb();
- }
- break;
+ if(HW_huart1RxCb)
+ {
+ HW_huart1RxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1RxCb)
- {
- HW_hlpuart1RxCb();
- }
- break;
+ if(HW_hlpuart1RxCb)
+ {
+ HW_hlpuart1RxCb();
+ }
+ break;
#endif
default:
@@ -292,20 +292,20 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1TxCb)
- {
- HW_huart1TxCb();
- }
- break;
+ if(HW_huart1TxCb)
+ {
+ HW_huart1TxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1TxCb)
- {
- HW_hlpuart1TxCb();
- }
- break;
+ if(HW_hlpuart1TxCb)
+ {
+ HW_hlpuart1TxCb();
+ }
+ break;
#endif
default:
@@ -315,4 +315,4 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
return;
}
- /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/main.c
index 3e30e0b1e..f65ab4945 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/main.c
@@ -41,10 +41,10 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "app_entry.h"
+#include "app_common.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
-#include "app_common.h"
#include "stm32_lpm.h"
#include "stm32_seq.h"
#include "dbg_trace.h"
@@ -110,6 +110,7 @@ int main(void)
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
+
/* MCU Configuration--------------------------------------------------------*/
@@ -137,6 +138,8 @@ int main(void)
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
+
+ /* Init code for STM32_WPAN */
APPE_Init();
/* Infinite loop */
@@ -161,17 +164,20 @@ void SystemClock_Config(void)
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
+ /** Configure LSE Drive Capability
+ */
+ __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
/** Configure the main internal regulator output voltage
*/
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
/** Initializes the CPU, AHB and APB busses clocks
*/
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSI1
- |RCC_OSCILLATORTYPE_HSE;
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE
+ |RCC_OSCILLATORTYPE_LSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ RCC_OscInitStruct.LSEState = RCC_LSE_ON;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
- RCC_OscInitStruct.LSIState = RCC_LSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
@@ -200,8 +206,8 @@ void SystemClock_Config(void)
|RCC_PERIPHCLK_LPUART1;
PeriphClkInitStruct.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2;
PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1;
- PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI;
- PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSI;
+ PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
+ PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSE;
PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSE;
PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE0;
@@ -209,6 +215,23 @@ void SystemClock_Config(void)
{
Error_Handler();
}
+
+ /* USER CODE BEGIN Smps */
+
+#if (CFG_USE_SMPS != 0)
+ /**
+ * Configure and enable SMPS
+ *
+ * The SMPS configuration is not yet supported by CubeMx
+ */
+ LL_PWR_SMPS_SetStartupCurrent(LL_PWR_SMPS_STARTUP_CURRENT_80MA);
+ LL_PWR_SMPS_SetOutputVoltageLevel(LL_PWR_SMPS_OUTPUT_VOLTAGE_1V40);
+ LL_PWR_SMPS_Enable();
+#endif
+
+ /* USER CODE END Smps */
+
+
}
/**
@@ -357,7 +380,13 @@ static void MX_RTC_Init(void)
Error_Handler();
}
/* USER CODE BEGIN RTC_Init 2 */
- MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* Disable RTC registers write protection */
+ LL_RTC_DisableWriteProtection(RTC);
+
+ LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER);
+
+ /* Enable RTC registers write protection */
+ LL_RTC_EnableWriteProtection(RTC);
/* USER CODE END RTC_Init 2 */
}
@@ -367,6 +396,7 @@ static void MX_RTC_Init(void)
*/
static void MX_DMA_Init(void)
{
+
/* DMA controller clock enable */
__HAL_RCC_DMAMUX1_CLK_ENABLE();
__HAL_RCC_DMA1_CLK_ENABLE();
@@ -404,7 +434,13 @@ void PeriphClock_Config(void)
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
- LL_RCC_HSI48_Enable();
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
+ LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -437,30 +473,6 @@ void PeriphClock_Config(void)
HAL_RCCEx_CRSConfig(&RCC_CRSInitStruct);
#endif
- /**
- * Select LSE clock
- */
- LL_RCC_LSE_Enable();
- while(!LL_RCC_LSE_IsReady());
-
- /**
- * Select wakeup source of BLE RF
- */
- LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
-
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
/*************************************************************
@@ -567,21 +579,33 @@ static void Init_Exti( void )
* WRAP FUNCTIONS
*
*************************************************************/
-
-/**
- * This function is empty to avoid starting the SysTick Timer
- */
-HAL_StatusTypeDef HAL_InitTick( uint32_t TickPriority )
+void HAL_Delay(uint32_t Delay)
{
- return (HAL_OK);
-}
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
-/**
- * This function is empty as the SysTick Timer is not used
- */
-void HAL_Delay(__IO uint32_t Delay)
-{
- return;
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
}
/* USER CODE END 4 */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/stm32wbxx_hal_msp.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/stm32wbxx_hal_msp.c
index c6a106fa7..87614ca60 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/stm32wbxx_hal_msp.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/stm32wbxx_hal_msp.c
@@ -5,45 +5,15 @@
* Description : This file provides code for the MSP Initialization
* and de-Initialization codes.
******************************************************************************
- * This notice applies to any and all portions of this file
- * that are not between comment pairs USER CODE BEGIN and
- * USER CODE END. Other portions of this file, whether
- * inserted by the user or by software development tools
- * are owned by their respective copyright owners.
+ * @attention
*
- * Copyright (c) 2019 STMicroelectronics International N.V.
- * All rights reserved.
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted, provided that the following conditions are met:
- *
- * 1. Redistribution of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of other
- * contributors to this software may be used to endorse or promote products
- * derived from this software without specific written permission.
- * 4. This software, including modifications and/or derivative works of this
- * software, must execute solely and exclusively on microcontroller or
- * microprocessor devices manufactured by or for STMicroelectronics.
- * 5. Redistribution and use of this software other than as permitted under
- * this license is void and will automatically terminate your rights under
- * this license.
- *
- * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
- * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
- * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
*
******************************************************************************
*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/stm32wbxx_it.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/stm32wbxx_it.c
index 49dff1991..d469f29ab 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/stm32wbxx_it.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/Core/Src/stm32wbxx_it.c
@@ -60,21 +60,10 @@
/* USER CODE END 0 */
/* External variables --------------------------------------------------------*/
-
-
-
extern DMA_HandleTypeDef hdma_lpuart1_tx;
-
-
extern DMA_HandleTypeDef hdma_usart1_tx;
-
-
extern UART_HandleTypeDef hlpuart1;
-
-
extern UART_HandleTypeDef huart1;
-
-
/* USER CODE BEGIN EV */
/* USER CODE END EV */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/STM32_WPAN/App/app_ble.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/STM32_WPAN/App/app_ble.c
index 5fddce3c8..85a925fc2 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/STM32_WPAN/App/app_ble.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/STM32_WPAN/App/app_ble.c
@@ -243,6 +243,7 @@ uint8_t manuf_data[14] = {
0x00, /* BLE MAC stop */
};
+
/* USER CODE BEGIN PV */
/* USER CODE END PV */
@@ -401,7 +402,10 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
/* restart advertising */
Adv_Request(APP_BLE_FAST_ADV);
-}
+ /* USER CODE BEGIN EVT_DISCONN_COMPLETE */
+
+ /* USER CODE END EVT_DISCONN_COMPLETE */
+ }
break; /* EVT_DISCONN_COMPLETE */
@@ -432,28 +436,28 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
{
APP_DBG_MSG("EVT_UPDATE_PHY_COMPLETE, status nok \n");
}
-
- ret = hci_le_read_phy(BleApplicationContext.BleApplicationContext_legacy.connectionHandle,&TX_PHY,&RX_PHY);
- if (ret == BLE_STATUS_SUCCESS)
- {
- APP_DBG_MSG("Read_PHY success \n");
-
- if ((TX_PHY == TX_2M) && (RX_PHY == RX_2M))
- {
- APP_DBG_MSG("PHY Param TX= %d, RX= %d \n", TX_PHY, RX_PHY);
- }
- else
- {
- APP_DBG_MSG("PHY Param TX= %d, RX= %d \n", TX_PHY, RX_PHY);
- }
- }
- else
- {
- APP_DBG_MSG("Read conf not succeess \n");
- }
-
- break;
-
+ ret = hci_le_read_phy(BleApplicationContext.BleApplicationContext_legacy.connectionHandle,&TX_PHY,&RX_PHY);
+ if (ret == BLE_STATUS_SUCCESS)
+ {
+ APP_DBG_MSG("Read_PHY success \n");
+
+ if ((TX_PHY == TX_2M) && (RX_PHY == RX_2M))
+ {
+ APP_DBG_MSG("PHY Param TX= %d, RX= %d \n", TX_PHY, RX_PHY);
+ }
+ else
+ {
+ APP_DBG_MSG("PHY Param TX= %d, RX= %d \n", TX_PHY, RX_PHY);
+ }
+ }
+ else
+ {
+ APP_DBG_MSG("Read conf not succeess \n");
+ }
+ /* USER CODE BEGIN EVT_LE_PHY_UPDATE_COMPLETE */
+
+ /* USER CODE END EVT_LE_PHY_UPDATE_COMPLETE */
+ break;
case EVT_LE_CONN_COMPLETE:
{
hci_le_connection_complete_event_rp0 *connection_complete_event;
@@ -466,7 +470,8 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
HW_TS_Stop(BleApplicationContext.Advertising_mgr_timer_Id);
APP_DBG_MSG("EVT_LE_CONN_COMPLETE for connection handle 0x%x\n",
- connection_complete_event->Connection_Handle);
+ connection_complete_event->Connection_Handle);
+
if (BleApplicationContext.Device_Connection_Status == APP_BLE_LP_CONNECTING)
{
/* Connection as client */
@@ -829,8 +834,8 @@ static void Ble_Tl_Init( void )
BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMax,
BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.Use_Fixed_Pin,
BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.Fixed_Pin,
-0
- );
+ 0
+ );
/**
* Initialize whitelist
@@ -873,7 +878,7 @@ static void Adv_Request(APP_BLE_ConnStatus_t New_Status)
ret = aci_gap_set_non_discoverable();
if (ret == BLE_STATUS_SUCCESS)
{
- APP_DBG_MSG("Successfully Stopped Advertising\n");
+ APP_DBG_MSG("Successfully Stopped Advertising \n");
}
else
{
@@ -902,13 +907,13 @@ static void Adv_Request(APP_BLE_ConnStatus_t New_Status)
{
if (New_Status == APP_BLE_FAST_ADV)
{
- APP_DBG_MSG("Successfully Start Fast Advertising\n" );
+ APP_DBG_MSG("Successfully Start Fast Advertising \n" );
/* Start Timer to STOP ADV - TIMEOUT */
HW_TS_Start(BleApplicationContext.Advertising_mgr_timer_Id, INITIAL_ADV_TIMEOUT);
}
else
{
- APP_DBG_MSG("Successfully Start Low Power Advertising\n");
+ APP_DBG_MSG("Successfully Start Low Power Advertising \n");
}
}
else
@@ -995,7 +1000,7 @@ static void Adv_Mgr( void )
* The background is the only place where the application can make sure a new aci command
* is not sent if there is a pending one
*/
- UTIL_SEQ_SetTask(1 << CFG_TASK_ADV_UPDATE_ID, CFG_SCH_PRIO_0);
+ UTIL_SEQ_SetTask(1 << CFG_TASK_ADV_UPDATE_ID, CFG_SCH_PRIO_0);
return;
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/STM32_WPAN/App/ble_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/STM32_WPAN/App/ble_conf.h
index 449a988ed..2e0c37951 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/STM32_WPAN/App/ble_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/STM32_WPAN/App/ble_conf.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : App/ble_conf.h
- * Description : Configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : Configuration file for BLE Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
@@ -49,7 +49,7 @@
* This shall take into account all registered handlers
* (from either the provided services or the custom services)
*/
-#define BLE_CFG_SVC_MAX_NBR_CB 5
+#define BLE_CFG_SVC_MAX_NBR_CB 7
#define BLE_CFG_CLT_MAX_NBR_CB 0
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/STM32_WPAN/App/ble_dbg_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/STM32_WPAN/App/ble_dbg_conf.h
index 759b3e0aa..a24660c50 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/STM32_WPAN/App/ble_dbg_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/STM32_WPAN/App/ble_dbg_conf.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : App/ble_dbg_conf.h
- * Description : Debug configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : Debug configuration file for BLE Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/STM32_WPAN/App/hrs_app.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/STM32_WPAN/App/hrs_app.c
index 7d6a1ebbf..e84751eaa 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/STM32_WPAN/App/hrs_app.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate/STM32_WPAN/App/hrs_app.c
@@ -211,7 +211,7 @@ static void HrMeas( void )
* is not sent if there is a pending one
*/
UTIL_SEQ_SetTask( 1<<CFG_TASK_MEAS_REQ_ID, CFG_SCH_PRIO_0);
- /* USER CODE BEGIN HrMeas */
+/* USER CODE BEGIN HrMeas */
/* USER CODE END HrMeas */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/BLE_HeartRateFreeRTOS.ioc b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/BLE_HeartRateFreeRTOS.ioc
index 740de5dbf..89992543b 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/BLE_HeartRateFreeRTOS.ioc
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/BLE_HeartRateFreeRTOS.ioc
@@ -78,27 +78,29 @@ Mcu.IP9=SYS
Mcu.IPNb=12
Mcu.Name=STM32WB55RGVx
Mcu.Package=VFQFPN68
-Mcu.Pin0=PA2
-Mcu.Pin1=PA3
-Mcu.Pin10=VP_HSEM_VS_HSEM
-Mcu.Pin11=VP_RTC_VS_RTC_Activate
-Mcu.Pin12=VP_STM32_WPAN_VS_BLE_HOST
-Mcu.Pin13=VP_SYS_VS_tim17
-Mcu.Pin14=VP_TINY_LPM_VS_TINY_LPM
-Mcu.Pin2=PA6
-Mcu.Pin3=RF1
-Mcu.Pin4=OSC_OUT
-Mcu.Pin5=OSC_IN
-Mcu.Pin6=PA11
-Mcu.Pin7=PB6
-Mcu.Pin8=PB7
-Mcu.Pin9=VP_FREERTOS_VS_CMSIS_V2
-Mcu.PinsNb=15
+Mcu.Pin0=PC14-OSC32_IN
+Mcu.Pin1=PC15-OSC32_OUT
+Mcu.Pin10=PB7
+Mcu.Pin11=VP_FREERTOS_VS_CMSIS_V2
+Mcu.Pin12=VP_HSEM_VS_HSEM
+Mcu.Pin13=VP_RTC_VS_RTC_Activate
+Mcu.Pin14=VP_STM32_WPAN_VS_BLE_HOST
+Mcu.Pin15=VP_SYS_VS_tim17
+Mcu.Pin16=VP_TINY_LPM_VS_TINY_LPM
+Mcu.Pin2=PA2
+Mcu.Pin3=PA3
+Mcu.Pin4=PA6
+Mcu.Pin5=RF1
+Mcu.Pin6=OSC_OUT
+Mcu.Pin7=OSC_IN
+Mcu.Pin8=PA11
+Mcu.Pin9=PB6
+Mcu.PinsNb=17
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32WB55RGVx
-MxCube.Version=5.3.0
-MxDb.Version=DB.5.0.30
+MxCube.Version=5.4.0
+MxDb.Version=DB.5.0.40
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.DMA1_Channel4_IRQn=true\:15\:0\:true\:false\:true\:true\:false\:true
NVIC.DMA2_Channel4_IRQn=true\:15\:0\:true\:false\:true\:true\:false\:true
@@ -154,6 +156,10 @@ PB7.GPIO_Speed=GPIO_SPEED_FREQ_VERY_HIGH
PB7.Locked=true
PB7.Mode=Asynchronous
PB7.Signal=USART1_RX
+PC14-OSC32_IN.Mode=LSE-External-Oscillator
+PC14-OSC32_IN.Signal=RCC_OSC32_IN
+PC15-OSC32_OUT.Mode=LSE-External-Oscillator
+PC15-OSC32_OUT.Signal=RCC_OSC32_OUT
PCC.Ble.ConnectionInterval=1000.0
PCC.Ble.DataLength=6
PCC.Ble.Mode=Advertising
@@ -176,7 +182,7 @@ ProjectManager.DeletePrevious=true
ProjectManager.DeviceId=STM32WB55RGVx
ProjectManager.FreePins=false
ProjectManager.HalAssertFull=false
-ProjectManager.HeapSize=0x200
+ProjectManager.HeapSize=0x400
ProjectManager.KeepUserCode=true
ProjectManager.LastFirmware=true
ProjectManager.LibraryCopy=2
@@ -186,11 +192,11 @@ ProjectManager.PreviousToolchain=
ProjectManager.ProjectBuild=false
ProjectManager.ProjectFileName=BLE_HeartRateFreeRTOS.ioc
ProjectManager.ProjectName=BLE_HeartRateFreeRTOS
-ProjectManager.StackSize=0x400
+ProjectManager.StackSize=0x1000
ProjectManager.TargetToolchain=EWARM V8
ProjectManager.ToolChainLocation=
ProjectManager.UnderRoot=false
-ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-SystemClock_Config-RCC-false-HAL-false,4-MX_LPUART1_UART_Init-LPUART1-true-HAL-false,5-MX_USART1_UART_Init-USART1-true-HAL-false,6-MX_RF_Init-RF-false-HAL-true,7-MX_RTC_Init-RTC-false-HAL-true,8-APPE_Init-STM32_WPAN-false-HAL-true
+ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-SystemClock_Config-RCC-false-HAL-false,4-MX_LPUART1_UART_Init-LPUART1-true-HAL-false,5-MX_USART1_UART_Init-USART1-true-HAL-false,6-MX_RF_Init-RF-false-HAL-true,7-MX_RTC_Init-RTC-false-HAL-true,8-APPE_Init-STM32_WPAN-false-HAL-false
RCC.ADCFreq_Value=64000000
RCC.AHBFreq_Value=32000000
RCC.APB1Freq_Value=32000000
@@ -212,12 +218,12 @@ RCC.HSI48_VALUE=48000000
RCC.HSI_VALUE=16000000
RCC.I2C1Freq_Value=32000000
RCC.I2C3Freq_Value=32000000
-RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSE_VALUE,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PLLSourceVirtual,PWRFreq_Value,RNGFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LCDFreq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PLLSourceVirtual,PWRFreq_Value,RFWKPClockSelection,RFWKPFreq_Value,RNGFreq_Value,RTCClockSelection,RTCFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.LCDFreq_Value=32768
RCC.LPTIM1Freq_Value=32000000
RCC.LPTIM2Freq_Value=32000000
RCC.LPUART1Freq_Value=32000000
RCC.LSCOPinFreq_Value=32000
-RCC.LSE_VALUE=32768
RCC.LSI_VALUE=32000
RCC.MCO1PinFreq_Value=32000000
RCC.PLLPoutputFreq_Value=64000000
@@ -228,7 +234,11 @@ RCC.PLLSAI1QoutputFreq_Value=64000000
RCC.PLLSAI1RoutputFreq_Value=64000000
RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSI
RCC.PWRFreq_Value=32000000
+RCC.RFWKPClockSelection=RCC_RFWKPCLKSOURCE_LSE
+RCC.RFWKPFreq_Value=32768
RCC.RNGFreq_Value=32000
+RCC.RTCClockSelection=RCC_RTCCLKSOURCE_LSE
+RCC.RTCFreq_Value=32768
RCC.SAI1Freq_Value=64000000
RCC.SMPS1Freq_Value=16000000
RCC.SYSCLKFreq_VALUE=32000000
@@ -261,6 +271,7 @@ STM32_WPAN.CFG_ADV_BD_ADDRESS=0x7257acd87a6c
STM32_WPAN.CFG_DEBUGGER_SUPPORTED=0
STM32_WPAN.CFG_DEBUG_APP_TRACE=0
STM32_WPAN.CFG_DEBUG_BLE_TRACE=0
+STM32_WPAN.CFG_DEBUG_TRACE_UART=hw_uart1
STM32_WPAN.CFG_FAST_CONN_ADV_INTERVAL_MAX=100
STM32_WPAN.CFG_FAST_CONN_ADV_INTERVAL_MAX_HEXA=0xa0
STM32_WPAN.CFG_FAST_CONN_ADV_INTERVAL_MIN=80
@@ -280,7 +291,7 @@ STM32_WPAN.CFG_LP_CONN_ADV_INTERVAL_MIN=0x640
STM32_WPAN.CFG_MITM_PROTECTION=CFG_MITM_PROTECTION_REQUIRED
STM32_WPAN.CFG_RTCCLK_DIVIDER_CONF=0
STM32_WPAN.DBG_TRACE_UART_CFG=hw_uart1
-STM32_WPAN.IPParameters=P2P_SERVER_NUMBER,CFG_FAST_CONN_ADV_INTERVAL_MAX_HEXA,CFG_LP_CONN_ADV_INTERVAL_MAX_HEXA,LOCAL_NAME_FORMATTED,CFG_HW_LPUART1_ENABLED,CFG_DEBUG_BLE_TRACE,CFG_DEBUG_APP_TRACE,DBG_TRACE_UART_CFG,CFG_ADV_BD_ADDRESS,CFG_LP_CONN_ADV_INTERVAL_MAX,CFG_LP_CONN_ADV_INTERVAL_MIN,CFG_HW_LPUART1_DMA_TX_SUPPORTED,LOCAL_NAME,CFG_HW_USART1_ENABLED,CFG_LPM_SUPPORTED,L2CAP_REQUEST_NEW_CONN_PARAM,BT_SIG_HEART_RATE_SENSOR,CFG_DEBUGGER_SUPPORTED,BLE_DBG_DIS_EN,BLE_DBG_HRS_EN,BLE_DBG_SVCCTL_EN,BLE_APPLICATION_TYPE,BLE_CFG_DIS_MANUFACTURER_NAME_STRING,BLE_CFG_DIS_MODEL_NUMBER_STRING,BLE_CFG_DIS_SERIAL_NUMBER_STRING,BLE_CFG_DIS_HARDWARE_REVISION_STRING,BLE_CFG_DIS_FIRMWARE_REVISION_STRING,BLE_CFG_DIS_SOFTWARE_REVISION_STRING,BLE_CFG_DIS_SYSTEM_ID,BLE_CFG_DIS_IEEE_CERTIFICATION,BLE_CFG_DIS_PNP_ID,BLE_CFG_HRS_BODY_SENSOR_LOCATION_CHAR,BLE_CFG_HRS_ENERGY_EXPENDED_INFO_FLAG,BLE_CFG_HRS_ENERGY_RR_INTERVAL_FLAG,CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO,CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION,CFG_HW_RESET_BY_FW,CFG_FAST_CONN_ADV_INTERVAL_MIN,CFG_FAST_CONN_ADV_INTERVAL_MAX,CFG_IO_CAPABILITY,CFG_MITM_PROTECTION,CFG_RTCCLK_DIVIDER_CONF
+STM32_WPAN.IPParameters=P2P_SERVER_NUMBER,CFG_FAST_CONN_ADV_INTERVAL_MAX_HEXA,CFG_LP_CONN_ADV_INTERVAL_MAX_HEXA,LOCAL_NAME_FORMATTED,CFG_HW_LPUART1_ENABLED,CFG_DEBUG_BLE_TRACE,CFG_DEBUG_APP_TRACE,DBG_TRACE_UART_CFG,CFG_ADV_BD_ADDRESS,CFG_LP_CONN_ADV_INTERVAL_MAX,CFG_LP_CONN_ADV_INTERVAL_MIN,CFG_HW_LPUART1_DMA_TX_SUPPORTED,LOCAL_NAME,CFG_HW_USART1_ENABLED,CFG_LPM_SUPPORTED,L2CAP_REQUEST_NEW_CONN_PARAM,BT_SIG_HEART_RATE_SENSOR,CFG_DEBUGGER_SUPPORTED,BLE_DBG_DIS_EN,BLE_DBG_HRS_EN,BLE_DBG_SVCCTL_EN,BLE_APPLICATION_TYPE,BLE_CFG_DIS_MANUFACTURER_NAME_STRING,BLE_CFG_DIS_MODEL_NUMBER_STRING,BLE_CFG_DIS_SERIAL_NUMBER_STRING,BLE_CFG_DIS_HARDWARE_REVISION_STRING,BLE_CFG_DIS_FIRMWARE_REVISION_STRING,BLE_CFG_DIS_SOFTWARE_REVISION_STRING,BLE_CFG_DIS_SYSTEM_ID,BLE_CFG_DIS_IEEE_CERTIFICATION,BLE_CFG_DIS_PNP_ID,BLE_CFG_HRS_BODY_SENSOR_LOCATION_CHAR,BLE_CFG_HRS_ENERGY_EXPENDED_INFO_FLAG,BLE_CFG_HRS_ENERGY_RR_INTERVAL_FLAG,CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO,CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION,CFG_HW_RESET_BY_FW,CFG_FAST_CONN_ADV_INTERVAL_MIN,CFG_FAST_CONN_ADV_INTERVAL_MAX,CFG_IO_CAPABILITY,CFG_MITM_PROTECTION,CFG_RTCCLK_DIVIDER_CONF,CFG_DEBUG_TRACE_UART
STM32_WPAN.IPParametersWithoutCheck=CFG_LP_CONN_ADV_INTERVAL_MAX,CFG_LP_CONN_ADV_INTERVAL_MIN
STM32_WPAN.L2CAP_REQUEST_NEW_CONN_PARAM=1
STM32_WPAN.LOCAL_NAME=HRSTM
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Inc/FreeRTOSConfig.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Inc/FreeRTOSConfig.h
index 80750b59e..6add07b2b 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Inc/FreeRTOSConfig.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Inc/FreeRTOSConfig.h
@@ -48,29 +48,29 @@
/* Ensure stdint is only used by the compiler, and not the assembler. */
#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__)
-#include <stdint.h>
-extern uint32_t SystemCoreClock;
+ #include <stdint.h>
+ extern uint32_t SystemCoreClock;
#endif
-#define configUSE_PREEMPTION 1
-#define configSUPPORT_STATIC_ALLOCATION 1
-#define configSUPPORT_DYNAMIC_ALLOCATION 1
-#define configUSE_IDLE_HOOK 0
-#define configUSE_TICK_HOOK 0
-#define configCPU_CLOCK_HZ ( SystemCoreClock )
-#define configTICK_RATE_HZ ((TickType_t)1000)
+#define configUSE_PREEMPTION 1
+#define configSUPPORT_STATIC_ALLOCATION 1
+#define configSUPPORT_DYNAMIC_ALLOCATION 1
+#define configUSE_IDLE_HOOK 0
+#define configUSE_TICK_HOOK 0
+#define configCPU_CLOCK_HZ ( SystemCoreClock )
+#define configTICK_RATE_HZ ((TickType_t)1000)
#define configMAX_PRIORITIES ( 56 )
-#define configMINIMAL_STACK_SIZE ((uint16_t)128)
+#define configMINIMAL_STACK_SIZE ((uint16_t)128)
#define configTOTAL_HEAP_SIZE ((size_t)6000)
-#define configMAX_TASK_NAME_LEN ( 16 )
+#define configMAX_TASK_NAME_LEN ( 16 )
#define configUSE_TRACE_FACILITY 1
-#define configUSE_16_BIT_TICKS 0
-#define configUSE_MUTEXES 1
-#define configQUEUE_REGISTRY_SIZE 8
-#define configUSE_RECURSIVE_MUTEXES 1
-#define configUSE_COUNTING_SEMAPHORES 1
+#define configUSE_16_BIT_TICKS 0
+#define configUSE_MUTEXES 1
+#define configQUEUE_REGISTRY_SIZE 8
+#define configUSE_RECURSIVE_MUTEXES 1
+#define configUSE_COUNTING_SEMAPHORES 1
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
-#define configUSE_TICKLESS_IDLE 2
+#define configUSE_TICKLESS_IDLE 2
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
@@ -78,8 +78,8 @@ extern uint32_t SystemCoreClock;
/* Software timer definitions. */
#define configUSE_TIMERS 1
-#define configTIMER_TASK_PRIORITY (2)
-#define configTIMER_QUEUE_LENGTH 10
+#define configTIMER_TASK_PRIORITY ( 2 )
+#define configTIMER_QUEUE_LENGTH 10
#define configTIMER_TASK_STACK_DEPTH 256
/* Set the following definitions to 1 to include the API function, or zero
@@ -102,12 +102,13 @@ to exclude the API function. */
* by the application thus the correct define need to be enabled below
*/
#define USE_FreeRTOS_HEAP_4
+
/* Cortex-M specific definitions. */
#ifdef __NVIC_PRIO_BITS
-/* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
-#define configPRIO_BITS __NVIC_PRIO_BITS
+ /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
+ #define configPRIO_BITS __NVIC_PRIO_BITS
#else
-#define configPRIO_BITS 4
+ #define configPRIO_BITS 4
#endif
/* The lowest interrupt priority that can be used in a call to a "set priority"
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Inc/app_common.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Inc/app_common.h
index 2a1d61089..4defc5d7a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Inc/app_common.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Inc/app_common.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : app_common.h
- * Description : App Common application configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : App Common application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Inc/app_conf.h
index 3ff2fd482..674ff4452 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Inc/app_conf.h
@@ -1,20 +1,21 @@
/**
******************************************************************************
* File Name : app_conf.h
- * Description : Application configuration file for BLE middleWare.
+ * Description : Application configuration file for STM32WPAN Middleware.
+ *
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef APP_CONF_H
@@ -22,12 +23,13 @@
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Application Config
******************************************************************************/
-/**< generic parameters ********************************************************/
+/**< generic parameters ******************************************************/
/**
* Define Tx Power
@@ -92,16 +94,29 @@
*/
#define CFG_BLE_ERK {0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21,0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21}
+/* USER CODE BEGIN Generic_Parameters */
+/**
+ * SMPS supply
+ * SMPS not used when Set to 0
+ * SMPS used when Set to 1
+ */
+#define CFG_USE_SMPS 1
+/* USER CODE END Generic_Parameters */
+
/**< specific parameters */
/*****************************************************/
-#define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI4_IRQHandler
-#define PUSH_BUTTON_SW2_EXTI_IRQHandler EXTI0_IRQHandler
-#define PUSH_BUTTON_SW3_EXTI_IRQHandler EXTI1_IRQHandler
/**
- * AD Element - Group B Feature
+ * SMPS supply
+ * SMPS not used when Set to 0
+ * SMPS used when Set to 1
+ */
+#define CFG_USE_SMPS 1
+
+/**
+* AD Element - Group B Feature
*/
-/* LSB - Second Byte */
+/* LSB - Second Byte */
#define CFG_FEATURE_OTA_REBOOT (0x20)
/******************************************************************************
@@ -373,7 +388,6 @@ typedef enum
*/
#define CFG_DEBUG_APP_TRACE 0
-
#if (CFG_DEBUG_APP_TRACE != 0)
#define APP_DBG_MSG PRINT_MESG_DBG
#else
@@ -391,9 +405,6 @@ typedef enum
#define CFG_DEBUGGER_SUPPORTED 1
#endif
-/* USER CODE BEGIN Defines */
-/* USER CODE END Defines */
-
/**
* When CFG_DEBUG_TRACE_FULL is set to 1, the trace are output with the API name, the file name and the line number
* When CFG_DEBUG_TRACE_LIGHT is set to 1, only the debug message is output
@@ -402,7 +413,7 @@ typedef enum
* When both are set to 1, CFG_DEBUG_TRACE_FULL is selected
*/
#define CFG_DEBUG_TRACE_LIGHT 0
-#define CFG_DEBUG_TRACE_FULL 0
+#define CFG_DEBUG_TRACE_FULL 0
#if (( CFG_DEBUG_TRACE != 0 ) && ( CFG_DEBUG_TRACE_LIGHT == 0 ) && (CFG_DEBUG_TRACE_FULL == 0))
#undef CFG_DEBUG_TRACE_FULL
@@ -430,8 +441,11 @@ typedef enum
#define DBG_TRACE_MSG_QUEUE_SIZE 4096
#define MAX_DBG_TRACE_MSG_SIZE 1024
+/* USER CODE BEGIN Defines */
#define CFG_LED_SUPPORTED 0
#define CFG_BUTTON_SUPPORTED 1
+/* USER CODE END Defines */
+
/******************************************************************************
* FreeRTOS
******************************************************************************/
@@ -450,7 +464,7 @@ typedef enum
#define CFG_HCI_USER_EVT_PROCESS_STACK_MEM (0)
#define CFG_HCI_USER_EVT_PROCESS_PRIORITY osPriorityNone
#define CFG_HCI_USER_EVT_PROCESS_STACk_SIZE (128 * 2)
-/* USER CODE BEGIN FreeRTOS_Defines */
+
#define CFG_ADV_UPDATE_PROCESS_NAME "ADV_UPDATE_PROCESS"
#define CFG_ADV_UPDATE_PROCESS_ATTR_BITS (0)
#define CFG_ADV_UPDATE_PROCESS_CB_MEM (0)
@@ -459,7 +473,6 @@ typedef enum
#define CFG_ADV_UPDATE_PROCESS_PRIORITY osPriorityNone
#define CFG_ADV_UPDATE_PROCESS_STACk_SIZE (128 * 6)
-
#define CFG_HRS_PROCESS_NAME "HRS_PROCESS"
#define CFG_HRS_PROCESS_ATTR_BITS (0)
#define CFG_HRS_PROCESS_CB_MEM (0)
@@ -467,6 +480,11 @@ typedef enum
#define CFG_HRS_PROCESS_STACK_MEM (0)
#define CFG_HRS_PROCESS_PRIORITY osPriorityNone
#define CFG_HRS_PROCESS_STACk_SIZE (128 * 5)
+
+/* USER CODE BEGIN FreeRTOS_Defines */
+#define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI4_IRQHandler
+#define PUSH_BUTTON_SW2_EXTI_IRQHandler EXTI0_IRQHandler
+#define PUSH_BUTTON_SW3_EXTI_IRQHandler EXTI1_IRQHandler
/* USER CODE END FreeRTOS_Defines */
/******************************************************************************
@@ -492,6 +510,6 @@ typedef enum
#define CFG_OTP_END_ADRESS OTP_AREA_END_ADDR
-#endif /*APP_CONFIG_H */
+#endif /*APP_CONF_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Inc/stm32_lpm_if.h
index 38e326512..d8e67947f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Inc/stm32_lpm_if.h
@@ -1,46 +1,22 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file stm32_lpm_if.h
-* @brief Header for stm32_lpm_f.c module (device specific LP management)
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
******************************************************************************
* @attention
*
-* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics International N.V.
+* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted, provided that the following conditions are met:
-*
-* 1. Redistribution of source code must retain the above copyright notice,
-* this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following disclaimer in the documentation
-* and/or other materials provided with the distribution.
-* 3. Neither the name of STMicroelectronics nor the names of other
-* contributors to this software may be used to endorse or promote products
-* derived from this software without specific written permission.
-* 4. This software, including modifications and/or derivative works of this
-* software, must execute solely and exclusively on microcontroller or
-* microprocessor devices manufactured by or for STMicroelectronics.
-* 5. Redistribution and use of this software other than as permitted under
-* this license is void and will automatically terminate your rights under
-* this license.
-*
-* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
-* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
-* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+* This software component is licensed by ST under BSD 3-Clause license,
+* the "License"; You may not use this file except in compliance with the
+* License. You may obtain a copy of the License at:
+* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32_LPM_IF_H
@@ -89,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Inc/utilities_conf.h
index c98d97ba1..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Inc/utilities_conf.h
@@ -1,3 +1,4 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* File Name : utilities_conf.h
@@ -9,13 +10,14 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef UTILITIES_CONF_H
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/app_entry.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/app_entry.c
index 28422b84e..6461a975a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/app_entry.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/app_entry.c
@@ -1,19 +1,19 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
- * @file app_entry.c
- * @author MCD Application Team
- * @brief Entry point of the Application
+ * File Name : app_entry.c
+ * Description : Entry application source file for STM32WPAN Middleware
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
******************************************************************************
*/
/* USER CODE END Header */
@@ -84,8 +84,8 @@ static void SystemPower_Config( void );
static void Init_Debug( void );
static void appe_Tl_Init( void );
static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status );
-
static void APPE_SysUserEvtRx( void * pPayload );
+
#if (CFG_HW_LPUART1_ENABLED == 1)
extern void MX_LPUART1_UART_Init(void);
#endif
@@ -102,7 +102,7 @@ static void Button_Init( void );
void APPE_Init( void )
{
SystemPower_Config(); /**< Configure the system Power Mode */
-
+
HW_TS_Init(hw_ts_InitMode_Full, &hrtc); /**< Initialize the TimerServer */
/* USER CODE BEGIN APPE_Init_1 */
@@ -122,7 +122,7 @@ void APPE_Init( void )
/**
* From now, the application is waiting for the ready event ( VS_HCI_C2_Ready )
- * received on the system channel before starting the BLE Stack
+ * received on the system channel before starting the Stack
* This system event is received with APPE_SysUserEvtRx()
*/
/* USER CODE BEGIN APPE_Init_2 */
@@ -238,8 +238,6 @@ static void appe_Tl_Init( void )
return;
}
-
-
static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status )
{
switch (status)
@@ -289,6 +287,7 @@ static void ShciUserEvtProcess(void *argument)
/* USER CODE END SHCI_USER_EVT_PROCESS_2 */
}
}
+
/* USER CODE BEGIN FD_LOCAL_FUNCTIONS */
static void Led_Init( void )
{
@@ -329,6 +328,7 @@ static void Button_Init( void )
* WRAP FUNCTIONS
*
*************************************************************/
+
void shci_notify_asynch_evt(void* pdata)
{
UNUSED(pdata);
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/freertos_port.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/freertos_port.c
index cd639f898..1348d0ffa 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/freertos_port.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/freertos_port.c
@@ -17,7 +17,6 @@
******************************************************************************
*/
-
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -69,7 +68,6 @@ static void LpTimerCb( void );
static void LpTimerStart( uint32_t time_to_sleep );
static void LpEnter( void );
static uint32_t LpGetElapsedTime( void );
-
void vPortSetupTimerInterrupt( void );
/* Functions Definition ------------------------------------------------------*/
@@ -308,8 +306,6 @@ static uint32_t LpGetElapsedTime( void )
*/
HW_TS_Stop(LpTimerContext.LpTimerFreeRTOS_Id);
-
-
return (uint32_t)return_value;
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/hw_timerserver.c
index 52a1bfa0d..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/hw_timerserver.c
@@ -1,22 +1,21 @@
/**
******************************************************************************
- * File Name : hw_timerserver.c
- * Description : Hardware timerserver source file for BLE
- * middleWare.
+ * File Name : hw_timerserver.c
+ * Description : Hardware timerserver source file for STM32WPAN Middleware.
+ *
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/hw_uart.c
index 52e9e2b3a..9a553610d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/hw_uart.c
@@ -1,7 +1,7 @@
/**
******************************************************************************
* File Name : Src/hw_uart.c
- * Description : HW UART source file for BLE middleWare.
+ * Description : HW UART source file for STM32WPAN Middleware.
*
******************************************************************************
* @attention
@@ -48,7 +48,7 @@ extern UART_HandleTypeDef huart1;
hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
} while(0)
- /* Variables ------------------------------------------------------------------*/
+/* Variables -----------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
@@ -65,73 +65,73 @@ extern UART_HandleTypeDef huart1;
void (*HW_hlpuart1TxCb)(void);
#endif
- void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_RX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_RX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_RX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_RX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ return;
+}
+
+void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
{
- HAL_StatusTypeDef hal_status = HAL_OK;
- hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
+ default:
+ break;
}
switch (hal_status)
@@ -161,8 +161,8 @@ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t
hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
{
-HAL_StatusTypeDef hal_status = HAL_OK;
-hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
@@ -250,33 +250,33 @@ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
switch ((uint32_t)huart->Instance)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1RxCb)
- {
- HW_huart1RxCb();
- }
- break;
+ if(HW_huart1RxCb)
+ {
+ HW_huart1RxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1RxCb)
- {
- HW_hlpuart1RxCb();
- }
- break;
+ if(HW_hlpuart1RxCb)
+ {
+ HW_hlpuart1RxCb();
+ }
+ break;
#endif
default:
@@ -292,20 +292,20 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1TxCb)
- {
- HW_huart1TxCb();
- }
- break;
+ if(HW_huart1TxCb)
+ {
+ HW_huart1TxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1TxCb)
- {
- HW_hlpuart1TxCb();
- }
- break;
+ if(HW_hlpuart1TxCb)
+ {
+ HW_hlpuart1TxCb();
+ }
+ break;
#endif
default:
@@ -315,4 +315,4 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
return;
}
- /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/main.c
index d761b3b93..ccc5bddf2 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/main.c
@@ -89,6 +89,7 @@ void MX_USART1_UART_Init(void);
static void MX_RF_Init(void);
static void MX_RTC_Init(void);
void StartDefaultTask(void *argument);
+
/* USER CODE BEGIN PFP */
void PeriphClock_Config(void);
static void Reset_Device( void );
@@ -112,6 +113,8 @@ int main(void)
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
+
+
/* MCU Configuration--------------------------------------------------------*/
@@ -194,25 +197,28 @@ int main(void)
/**
* @brief System Clock Configuration
- * @retval None
- */
+ * @retval None
+ */
void SystemClock_Config(void)
{
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
+ /** Configure LSE Drive Capability
+ */
+ __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
/** Configure the main internal regulator output voltage
*/
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
/** Initializes the CPU, AHB and APB busses clocks
*/
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSI1
- |RCC_OSCILLATORTYPE_HSE;
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE
+ |RCC_OSCILLATORTYPE_LSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ RCC_OscInitStruct.LSEState = RCC_LSE_ON;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
- RCC_OscInitStruct.LSIState = RCC_LSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
@@ -241,8 +247,8 @@ void SystemClock_Config(void)
|RCC_PERIPHCLK_LPUART1;
PeriphClkInitStruct.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2;
PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1;
- PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI;
- PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSI;
+ PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
+ PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSE;
PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSE;
PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE0;
@@ -250,6 +256,23 @@ void SystemClock_Config(void)
{
Error_Handler();
}
+
+ /* USER CODE BEGIN Smps */
+
+#if (CFG_USE_SMPS != 0)
+ /**
+ * Configure and enable SMPS
+ *
+ * The SMPS configuration is not yet supported by CubeMx
+ */
+ LL_PWR_SMPS_SetStartupCurrent(LL_PWR_SMPS_STARTUP_CURRENT_80MA);
+ LL_PWR_SMPS_SetOutputVoltageLevel(LL_PWR_SMPS_OUTPUT_VOLTAGE_1V40);
+ LL_PWR_SMPS_Enable();
+#endif
+
+ /* USER CODE END Smps */
+
+
}
/**
@@ -398,7 +421,13 @@ static void MX_RTC_Init(void)
Error_Handler();
}
/* USER CODE BEGIN RTC_Init 2 */
- MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* Disable RTC registers write protection */
+ LL_RTC_DisableWriteProtection(RTC);
+
+ LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER);
+
+ /* Enable RTC registers write protection */
+ LL_RTC_EnableWriteProtection(RTC);
/* USER CODE END RTC_Init 2 */
}
@@ -408,6 +437,7 @@ static void MX_RTC_Init(void)
*/
static void MX_DMA_Init(void)
{
+
/* DMA controller clock enable */
__HAL_RCC_DMAMUX1_CLK_ENABLE();
__HAL_RCC_DMA1_CLK_ENABLE();
@@ -445,7 +475,13 @@ void PeriphClock_Config(void)
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
- LL_RCC_HSI48_Enable();
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
+ LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -478,30 +514,6 @@ void PeriphClock_Config(void)
HAL_RCCEx_CRSConfig(&RCC_CRSInitStruct);
#endif
- /**
- * Select LSE clock
- */
- LL_RCC_LSE_Enable();
- while(!LL_RCC_LSE_IsReady());
-
- /**
- * Select wakeup source of BLE RF
- */
- LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
-
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
/*************************************************************
@@ -608,6 +620,34 @@ static void Init_Exti( void )
* WRAP FUNCTIONS
*
*************************************************************/
+void HAL_Delay(uint32_t Delay)
+{
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
+
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
+}
/* USER CODE END 4 */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/stm32_lpm_if.c
index 4a9724ef2..68153652a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -266,6 +266,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/stm32wbxx_hal_msp.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/stm32wbxx_hal_msp.c
index 536f84606..207c26eb8 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/stm32wbxx_hal_msp.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/stm32wbxx_hal_msp.c
@@ -5,45 +5,15 @@
* Description : This file provides code for the MSP Initialization
* and de-Initialization codes.
******************************************************************************
- * This notice applies to any and all portions of this file
- * that are not between comment pairs USER CODE BEGIN and
- * USER CODE END. Other portions of this file, whether
- * inserted by the user or by software development tools
- * are owned by their respective copyright owners.
+ * @attention
*
- * Copyright (c) 2019 STMicroelectronics International N.V.
- * All rights reserved.
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted, provided that the following conditions are met:
- *
- * 1. Redistribution of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of other
- * contributors to this software may be used to endorse or promote products
- * derived from this software without specific written permission.
- * 4. This software, including modifications and/or derivative works of this
- * software, must execute solely and exclusively on microcontroller or
- * microprocessor devices manufactured by or for STMicroelectronics.
- * 5. Redistribution and use of this software other than as permitted under
- * this license is void and will automatically terminate your rights under
- * this license.
- *
- * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
- * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
- * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
*
******************************************************************************
*/
@@ -177,6 +147,7 @@ void HAL_UART_MspInit(UART_HandleTypeDef* huart)
{
Error_Handler();
}
+
__HAL_LINKDMA(huart,hdmatx,hdma_lpuart1_tx);
/* LPUART1 interrupt Init */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/stm32wbxx_it.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/stm32wbxx_it.c
index 97bf6f167..33043d814 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/stm32wbxx_it.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/Core/Src/stm32wbxx_it.c
@@ -61,22 +61,14 @@
/* USER CODE END 0 */
/* External variables --------------------------------------------------------*/
-
-
extern DMA_HandleTypeDef hdma_lpuart1_tx;
-
-
extern DMA_HandleTypeDef hdma_usart1_tx;
-
-
extern UART_HandleTypeDef hlpuart1;
-
-
extern UART_HandleTypeDef huart1;
extern TIM_HandleTypeDef htim17;
-
-
+
/* USER CODE BEGIN EV */
+
/* USER CODE END EV */
/******************************************************************************/
@@ -106,6 +98,7 @@ void HardFault_Handler(void)
while (1)
{
/* USER CODE BEGIN W1_HardFault_IRQn 0 */
+
/* USER CODE END W1_HardFault_IRQn 0 */
}
}
@@ -121,6 +114,7 @@ void MemManage_Handler(void)
while (1)
{
/* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */
+
/* USER CODE END W1_MemoryManagement_IRQn 0 */
}
}
@@ -136,6 +130,7 @@ void BusFault_Handler(void)
while (1)
{
/* USER CODE BEGIN W1_BusFault_IRQn 0 */
+
/* USER CODE END W1_BusFault_IRQn 0 */
}
}
@@ -151,6 +146,7 @@ void UsageFault_Handler(void)
while (1)
{
/* USER CODE BEGIN W1_UsageFault_IRQn 0 */
+
/* USER CODE END W1_UsageFault_IRQn 0 */
}
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/STM32_WPAN/App/app_ble.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/STM32_WPAN/App/app_ble.c
index 092bd468d..45a77d596 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/STM32_WPAN/App/app_ble.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/STM32_WPAN/App/app_ble.c
@@ -430,7 +430,10 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
/* restart advertising */
Adv_Request(APP_BLE_FAST_ADV);
- }
+ /* USER CODE BEGIN EVT_DISCONN_COMPLETE */
+
+ /* USER CODE END EVT_DISCONN_COMPLETE */
+ }
break; /* EVT_DISCONN_COMPLETE */
@@ -462,25 +465,27 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
APP_DBG_MSG("EVT_UPDATE_PHY_COMPLETE, status nok \n");
}
- ret = hci_le_read_phy(BleApplicationContext.BleApplicationContext_legacy.connectionHandle,&TX_PHY,&RX_PHY);
- if (ret == BLE_STATUS_SUCCESS)
- {
- APP_DBG_MSG("Read_PHY success \n");
+ ret = hci_le_read_phy(BleApplicationContext.BleApplicationContext_legacy.connectionHandle,&TX_PHY,&RX_PHY);
+ if (ret == BLE_STATUS_SUCCESS)
+ {
+ APP_DBG_MSG("Read_PHY success \n");
- if ((TX_PHY == TX_2M) && (RX_PHY == RX_2M))
- {
- APP_DBG_MSG("PHY Param TX= %d, RX= %d \n", TX_PHY, RX_PHY);
- }
- else
- {
- APP_DBG_MSG("PHY Param TX= %d, RX= %d \n", TX_PHY, RX_PHY);
- }
- }
- else
- {
- APP_DBG_MSG("Read conf not succeess \n");
- }
-
+ if ((TX_PHY == TX_2M) && (RX_PHY == RX_2M))
+ {
+ APP_DBG_MSG("PHY Param TX= %d, RX= %d \n", TX_PHY, RX_PHY);
+ }
+ else
+ {
+ APP_DBG_MSG("PHY Param TX= %d, RX= %d \n", TX_PHY, RX_PHY);
+ }
+ }
+ else
+ {
+ APP_DBG_MSG("Read conf not succeess \n");
+ }
+ /* USER CODE BEGIN EVT_LE_PHY_UPDATE_COMPLETE */
+
+ /* USER CODE END EVT_LE_PHY_UPDATE_COMPLETE */
break;
case EVT_LE_CONN_COMPLETE:
@@ -494,20 +499,18 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
HW_TS_Stop(BleApplicationContext.Advertising_mgr_timer_Id);
- APP_DBG_MSG("EVT_LE_CONN_COMPLETE for connection handle 0x%x\n",
- connection_complete_event->Connection_Handle);
- if (BleApplicationContext.Device_Connection_Status == APP_BLE_LP_CONNECTING)
- {
- /* Connection as client */
- BleApplicationContext.Device_Connection_Status = APP_BLE_CONNECTED_CLIENT;
- }
- else
- {
- /* Connection as server */
- BleApplicationContext.Device_Connection_Status = APP_BLE_CONNECTED_SERVER;
- }
- BleApplicationContext.BleApplicationContext_legacy.connectionHandle =
- connection_complete_event->Connection_Handle;
+ APP_DBG_MSG("EVT_LE_CONN_COMPLETE for connection handle 0x%x\n", connection_complete_event->Connection_Handle);
+ if (BleApplicationContext.Device_Connection_Status == APP_BLE_LP_CONNECTING)
+ {
+ /* Connection as client */
+ BleApplicationContext.Device_Connection_Status = APP_BLE_CONNECTED_CLIENT;
+ }
+ else
+ {
+ /* Connection as server */
+ BleApplicationContext.Device_Connection_Status = APP_BLE_CONNECTED_SERVER;
+ }
+ BleApplicationContext.BleApplicationContext_legacy.connectionHandle = connection_complete_event->Connection_Handle;
/* USER CODE BEGIN HCI_EVT_LE_CONN_COMPLETE */
/* USER CODE END HCI_EVT_LE_CONN_COMPLETE */
@@ -701,7 +704,6 @@ static void Ble_Tl_Init( void )
MtxHciId = osMutexNew( NULL );
SemHciId = osSemaphoreNew( 1, 0, NULL ); /*< Create the semaphore and make it busy at initialization */
-
Hci_Tl_Init_Conf.p_cmdbuffer = (uint8_t*)&BleCmdBuffer;
Hci_Tl_Init_Conf.StatusNotCallBack = BLE_StatusNot;
hci_init(BLE_UserEvtRx, (void*) &Hci_Tl_Init_Conf);
@@ -783,7 +785,7 @@ static void Ble_Hci_Gap_Gatt_Init(void){
* Write Encryption root key used to derive LTK and CSRK
*/
aci_hal_write_config_data( CONFIG_DATA_ER_OFFSET, CONFIG_DATA_ER_LEN, (uint8_t*)BLE_CFG_ER_VALUE );
-
+
/**
* Set TX Power to 0dBm.
*/
@@ -906,7 +908,7 @@ static void Adv_Request(APP_BLE_ConnStatus_t New_Status)
ret = aci_gap_set_non_discoverable();
if (ret == BLE_STATUS_SUCCESS)
{
- APP_DBG_MSG("Successfully Stopped Advertising\n");
+ APP_DBG_MSG("Successfully Stopped Advertising \n");
}
else
{
@@ -935,13 +937,13 @@ static void Adv_Request(APP_BLE_ConnStatus_t New_Status)
{
if (New_Status == APP_BLE_FAST_ADV)
{
- APP_DBG_MSG("Successfully Start Fast Advertising\n" );
+ APP_DBG_MSG("Successfully Start Fast Advertising \n" );
/* Start Timer to STOP ADV - TIMEOUT */
HW_TS_Start(BleApplicationContext.Advertising_mgr_timer_Id, INITIAL_ADV_TIMEOUT);
}
else
{
- APP_DBG_MSG("Successfully Start Low Power Advertising\n");
+ APP_DBG_MSG("Successfully Start Low Power Advertising \n");
}
}
else
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/STM32_WPAN/App/ble_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/STM32_WPAN/App/ble_conf.h
index c5fa31684..2e0c37951 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/STM32_WPAN/App/ble_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/STM32_WPAN/App/ble_conf.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : App/ble_conf.h
- * Description : Configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : Configuration file for BLE Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/STM32_WPAN/App/ble_dbg_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/STM32_WPAN/App/ble_dbg_conf.h
index 759b3e0aa..a24660c50 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/STM32_WPAN/App/ble_dbg_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/STM32_WPAN/App/ble_dbg_conf.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : App/ble_dbg_conf.h
- * Description : Debug configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : Debug configuration file for BLE Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/STM32_WPAN/App/hrs_app.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/STM32_WPAN/App/hrs_app.c
index 07776be28..e3f77ee03 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/STM32_WPAN/App/hrs_app.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/STM32_WPAN/App/hrs_app.c
@@ -236,7 +236,8 @@ static void HrMeas( void )
* is not sent if there is a pending one
*/
osThreadFlagsSet( HrsProcessId, 1 );
- /* USER CODE BEGIN HrMeas */
+
+/* USER CODE BEGIN HrMeas */
/* USER CODE END HrMeas */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/SW4STM32/Production/.cproject b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/SW4STM32/Production/.cproject
index c52a8504c..7f112dede 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/SW4STM32/Production/.cproject
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/SW4STM32/Production/.cproject
@@ -89,7 +89,7 @@
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble"/>
<listOptionValue builtIn="false" value="../../../Core/Inc"/>
- <listOptionValue builtIn="false" value="../../../STM32_WPAN/app"/>
+ <listOptionValue builtIn="false" value="../../../STM32_WPAN/App"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/Third_Party/FreeRTOS/Source/include"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F"/>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Binary/BLE_HeartRate_ota_reference.bin b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Binary/BLE_HeartRate_ota_reference.bin
index 85bde0d4b..2206947b3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Binary/BLE_HeartRate_ota_reference.bin
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Binary/BLE_HeartRate_ota_reference.bin
Binary files differ
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Inc/app_common.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Inc/app_common.h
index 2a1d61089..4defc5d7a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Inc/app_common.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Inc/app_common.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : app_common.h
- * Description : App Common application configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : App Common application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Inc/app_conf.h
index 7964d85b7..e56dcf80d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Inc/app_conf.h
@@ -1,8 +1,9 @@
/**
******************************************************************************
* File Name : app_conf.h
- * Description : Application configuration file for BLE middleWare.
- ******************************************************************************
+ * Description : Application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
@@ -17,17 +18,18 @@
*/
/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef APP_CONFIG_H
-#define APP_CONFIG_H
+#ifndef APP_CONF_H
+#define APP_CONF_H
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Application Config
******************************************************************************/
-/**< generic parameters ********************************************************/
+/**< generic parameters ******************************************************/
/**
* Define Tx Power
@@ -92,6 +94,15 @@
*/
#define CFG_BLE_ERK {0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21,0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21}
+/* USER CODE BEGIN Generic_Parameters */
+/**
+ * SMPS supply
+ * SMPS not used when Set to 0
+ * SMPS used when Set to 1
+ */
+#define CFG_USE_SMPS 1
+/* USER CODE END Generic_Parameters */
+
/**< specific parameters */
/*****************************************************/
#define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI4_IRQHandler
@@ -100,15 +111,15 @@
/**
* SMPS supply
- * Set to 0 do not use the SPMS
- * Set to 1 to use the SMPS @1.7V
+ * SMPS not used when Set to 0
+ * SMPS used when Set to 1
*/
-#define CFG_USE_SMPS_1V7 0
+#define CFG_USE_SMPS 1
/**
* AD Element - Group B Feature
*/
-/* LSB - Second Byte */
+/* LSB - Second Byte */
#define CFG_FEATURE_OTA_REBOOT (0x20)
/******************************************************************************
@@ -380,7 +391,6 @@ typedef enum
*/
#define CFG_DEBUG_APP_TRACE 0
-
#if (CFG_DEBUG_APP_TRACE != 0)
#define APP_DBG_MSG PRINT_MESG_DBG
#else
@@ -398,11 +408,6 @@ typedef enum
#define CFG_DEBUGGER_SUPPORTED 1
#endif
-/* USER CODE BEGIN Defines */
-#define CFG_LED_SUPPORTED 0
-#define CFG_BUTTON_SUPPORTED 1
-/* USER CODE END Defines */
-
/**
* When CFG_DEBUG_TRACE_FULL is set to 1, the trace are output with the API name, the file name and the line number
* When CFG_DEBUG_TRACE_LIGHT is set to 1, only the debug message is output
@@ -503,7 +508,10 @@ typedef enum
typedef enum
{
CFG_LPM_APP,
- CFG_LPM_APP_BLE
+ CFG_LPM_APP_BLE,
+ /* USER CODE BEGIN CFG_LPM_Id_t */
+
+ /* USER CODE END CFG_LPM_Id_t */
} CFG_LPM_Id_t;
/******************************************************************************
@@ -513,6 +521,6 @@ typedef enum
#define CFG_OTP_END_ADRESS OTP_AREA_END_ADDR
-#endif /*APP_CONFIG_H */
+#endif /*APP_CONF_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Inc/stm32_lpm_if.h
index 38e326512..d8e67947f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Inc/stm32_lpm_if.h
@@ -1,46 +1,22 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file stm32_lpm_if.h
-* @brief Header for stm32_lpm_f.c module (device specific LP management)
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
******************************************************************************
* @attention
*
-* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics International N.V.
+* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted, provided that the following conditions are met:
-*
-* 1. Redistribution of source code must retain the above copyright notice,
-* this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following disclaimer in the documentation
-* and/or other materials provided with the distribution.
-* 3. Neither the name of STMicroelectronics nor the names of other
-* contributors to this software may be used to endorse or promote products
-* derived from this software without specific written permission.
-* 4. This software, including modifications and/or derivative works of this
-* software, must execute solely and exclusively on microcontroller or
-* microprocessor devices manufactured by or for STMicroelectronics.
-* 5. Redistribution and use of this software other than as permitted under
-* this license is void and will automatically terminate your rights under
-* this license.
-*
-* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
-* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
-* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+* This software component is licensed by ST under BSD 3-Clause license,
+* the "License"; You may not use this file except in compliance with the
+* License. You may obtain a copy of the License at:
+* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32_LPM_IF_H
@@ -89,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Inc/stm32wbxx_hal_conf.h
index 5c703f75d..31d63e37a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Inc/stm32wbxx_hal_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Inc/stm32wbxx_hal_conf.h
@@ -58,6 +58,7 @@
#define HAL_UART_MODULE_ENABLED
/*#define HAL_USART_MODULE_ENABLED */
/*#define HAL_WWDG_MODULE_ENABLED */
+#define HAL_EXTI_MODULE_ENABLED
#define HAL_CORTEX_MODULE_ENABLED
#define HAL_DMA_MODULE_ENABLED
#define HAL_FLASH_MODULE_ENABLED
@@ -221,6 +222,10 @@
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32wbxx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32wbxx_hal_flash.h"
@@ -333,9 +338,9 @@
* If expr is true, it returns no value.
* @retval None
*/
-#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
+ #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
/* Exported functions ------------------------------------------------------- */
-void assert_failed(uint8_t* file, uint32_t line);
+ void assert_failed(uint8_t* file, uint32_t line);
#else
#define assert_param(expr) ((void)0U)
#endif /* USE_FULL_ASSERT */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Inc/utilities_conf.h
index c98d97ba1..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Inc/utilities_conf.h
@@ -1,3 +1,4 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* File Name : utilities_conf.h
@@ -9,13 +10,14 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef UTILITIES_CONF_H
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/app_entry.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/app_entry.c
index cac322877..90395003a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/app_entry.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/app_entry.c
@@ -69,8 +69,8 @@ static void SystemPower_Config( void );
static void Init_Debug( void );
static void appe_Tl_Init( void );
static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status );
-
static void APPE_SysUserEvtRx( void * pPayload );
+
#if (CFG_HW_LPUART1_ENABLED == 1)
extern void MX_LPUART1_UART_Init(void);
#endif
@@ -107,7 +107,7 @@ void APPE_Init( void )
/**
* From now, the application is waiting for the ready event ( VS_HCI_C2_Ready )
- * received on the system channel before starting the BLE Stack
+ * received on the system channel before starting the Stack
* This system event is received with APPE_SysUserEvtRx()
*/
/* USER CODE BEGIN APPE_Init_2 */
@@ -220,8 +220,6 @@ static void appe_Tl_Init( void )
return;
}
-
-
static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status )
{
UNUSED(status);
@@ -235,7 +233,7 @@ static void APPE_SysUserEvtRx( void * pPayload )
TL_TRACES_Init( );
APP_BLE_Init( );
- UTIL_LPM_SetOffMode(1 << CFG_LPM_APP, UTIL_LPM_ENABLE);
+ UTIL_LPM_SetOffMode(1U << CFG_LPM_APP, UTIL_LPM_ENABLE);
return;
}
@@ -287,7 +285,6 @@ void UTIL_SEQ_Idle( void )
return;
}
-
/**
* @brief This function is called by the scheduler each time an event
* is pending.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/hw_timerserver.c
index 52a1bfa0d..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/hw_timerserver.c
@@ -1,22 +1,21 @@
/**
******************************************************************************
- * File Name : hw_timerserver.c
- * Description : Hardware timerserver source file for BLE
- * middleWare.
+ * File Name : hw_timerserver.c
+ * Description : Hardware timerserver source file for STM32WPAN Middleware.
+ *
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/hw_uart.c
index 52e9e2b3a..9a553610d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/hw_uart.c
@@ -1,7 +1,7 @@
/**
******************************************************************************
* File Name : Src/hw_uart.c
- * Description : HW UART source file for BLE middleWare.
+ * Description : HW UART source file for STM32WPAN Middleware.
*
******************************************************************************
* @attention
@@ -48,7 +48,7 @@ extern UART_HandleTypeDef huart1;
hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
} while(0)
- /* Variables ------------------------------------------------------------------*/
+/* Variables -----------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
@@ -65,73 +65,73 @@ extern UART_HandleTypeDef huart1;
void (*HW_hlpuart1TxCb)(void);
#endif
- void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_RX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_RX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_RX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_RX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ return;
+}
+
+void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
{
- HAL_StatusTypeDef hal_status = HAL_OK;
- hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
+ default:
+ break;
}
switch (hal_status)
@@ -161,8 +161,8 @@ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t
hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
{
-HAL_StatusTypeDef hal_status = HAL_OK;
-hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
@@ -250,33 +250,33 @@ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
switch ((uint32_t)huart->Instance)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1RxCb)
- {
- HW_huart1RxCb();
- }
- break;
+ if(HW_huart1RxCb)
+ {
+ HW_huart1RxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1RxCb)
- {
- HW_hlpuart1RxCb();
- }
- break;
+ if(HW_hlpuart1RxCb)
+ {
+ HW_hlpuart1RxCb();
+ }
+ break;
#endif
default:
@@ -292,20 +292,20 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1TxCb)
- {
- HW_huart1TxCb();
- }
- break;
+ if(HW_huart1TxCb)
+ {
+ HW_huart1TxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1TxCb)
- {
- HW_hlpuart1TxCb();
- }
- break;
+ if(HW_hlpuart1TxCb)
+ {
+ HW_hlpuart1TxCb();
+ }
+ break;
#endif
default:
@@ -315,4 +315,4 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
return;
}
- /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/main.c
index f2340eda0..f65ab4945 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/main.c
@@ -41,10 +41,10 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "app_entry.h"
+#include "app_common.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
-#include "app_common.h"
#include "stm32_lpm.h"
#include "stm32_seq.h"
#include "dbg_trace.h"
@@ -110,6 +110,7 @@ int main(void)
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
+
/* MCU Configuration--------------------------------------------------------*/
@@ -126,17 +127,7 @@ int main(void)
/* USER CODE BEGIN SysInit */
PeriphClock_Config();
-#if( CFG_USE_SMPS_1V7 != 0)
- /**
- * This project is not currently supported by CubeMx
- * The code below should be generated by CubeMx within PeriphClock_Config()
- */
- LL_RCC_SetSMPSPrescaler( LL_RCC_SMPS_DIV_1 );
- LL_PWR_SMPS_SetOutputVoltageLevel( LL_PWR_SMPS_OUTPUT_VOLTAGE_1V70 );
- LL_RCC_SetSMPSClockSource( LL_RCC_SMPS_CLKSOURCE_HSI );
- LL_PWR_SMPS_Enable( );
-#endif
-Init_Exti(); /**< Configure the system Power Mode */
+ Init_Exti(); /**< Configure the system Power Mode */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
@@ -147,6 +138,8 @@ Init_Exti(); /**< Configure the system Power Mode */
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
+
+ /* Init code for STM32_WPAN */
APPE_Init();
/* Infinite loop */
@@ -171,17 +164,20 @@ void SystemClock_Config(void)
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
+ /** Configure LSE Drive Capability
+ */
+ __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
/** Configure the main internal regulator output voltage
*/
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
/** Initializes the CPU, AHB and APB busses clocks
*/
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSI1
- |RCC_OSCILLATORTYPE_HSE;
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE
+ |RCC_OSCILLATORTYPE_LSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ RCC_OscInitStruct.LSEState = RCC_LSE_ON;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
- RCC_OscInitStruct.LSIState = RCC_LSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
@@ -210,8 +206,8 @@ void SystemClock_Config(void)
|RCC_PERIPHCLK_LPUART1;
PeriphClkInitStruct.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2;
PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1;
- PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI;
- PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSI;
+ PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
+ PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSE;
PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSE;
PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE0;
@@ -219,6 +215,23 @@ void SystemClock_Config(void)
{
Error_Handler();
}
+
+ /* USER CODE BEGIN Smps */
+
+#if (CFG_USE_SMPS != 0)
+ /**
+ * Configure and enable SMPS
+ *
+ * The SMPS configuration is not yet supported by CubeMx
+ */
+ LL_PWR_SMPS_SetStartupCurrent(LL_PWR_SMPS_STARTUP_CURRENT_80MA);
+ LL_PWR_SMPS_SetOutputVoltageLevel(LL_PWR_SMPS_OUTPUT_VOLTAGE_1V40);
+ LL_PWR_SMPS_Enable();
+#endif
+
+ /* USER CODE END Smps */
+
+
}
/**
@@ -367,7 +380,13 @@ static void MX_RTC_Init(void)
Error_Handler();
}
/* USER CODE BEGIN RTC_Init 2 */
- MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* Disable RTC registers write protection */
+ LL_RTC_DisableWriteProtection(RTC);
+
+ LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER);
+
+ /* Enable RTC registers write protection */
+ LL_RTC_EnableWriteProtection(RTC);
/* USER CODE END RTC_Init 2 */
}
@@ -377,6 +396,7 @@ static void MX_RTC_Init(void)
*/
static void MX_DMA_Init(void)
{
+
/* DMA controller clock enable */
__HAL_RCC_DMAMUX1_CLK_ENABLE();
__HAL_RCC_DMA1_CLK_ENABLE();
@@ -414,7 +434,13 @@ void PeriphClock_Config(void)
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
- LL_RCC_HSI48_Enable();
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
+ LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -447,30 +473,6 @@ void PeriphClock_Config(void)
HAL_RCCEx_CRSConfig(&RCC_CRSInitStruct);
#endif
- /**
- * Select LSE clock
- */
- LL_RCC_LSE_Enable();
- while(!LL_RCC_LSE_IsReady());
-
- /**
- * Select wakeup source of BLE RF
- */
- LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
-
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
/*************************************************************
@@ -577,21 +579,33 @@ static void Init_Exti( void )
* WRAP FUNCTIONS
*
*************************************************************/
-
-/**
- * This function is empty to avoid starting the SysTick Timer
- */
-HAL_StatusTypeDef HAL_InitTick( uint32_t TickPriority )
+void HAL_Delay(uint32_t Delay)
{
- return (HAL_OK);
-}
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
-/**
- * This function is empty as the SysTick Timer is not used
- */
-void HAL_Delay(__IO uint32_t Delay)
-{
- return;
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
}
/* USER CODE END 4 */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/stm32wbxx_hal_msp.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/stm32wbxx_hal_msp.c
index c6a106fa7..87614ca60 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/stm32wbxx_hal_msp.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/stm32wbxx_hal_msp.c
@@ -5,45 +5,15 @@
* Description : This file provides code for the MSP Initialization
* and de-Initialization codes.
******************************************************************************
- * This notice applies to any and all portions of this file
- * that are not between comment pairs USER CODE BEGIN and
- * USER CODE END. Other portions of this file, whether
- * inserted by the user or by software development tools
- * are owned by their respective copyright owners.
+ * @attention
*
- * Copyright (c) 2019 STMicroelectronics International N.V.
- * All rights reserved.
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted, provided that the following conditions are met:
- *
- * 1. Redistribution of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of other
- * contributors to this software may be used to endorse or promote products
- * derived from this software without specific written permission.
- * 4. This software, including modifications and/or derivative works of this
- * software, must execute solely and exclusively on microcontroller or
- * microprocessor devices manufactured by or for STMicroelectronics.
- * 5. Redistribution and use of this software other than as permitted under
- * this license is void and will automatically terminate your rights under
- * this license.
- *
- * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
- * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
- * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
*
******************************************************************************
*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/stm32wbxx_it.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/stm32wbxx_it.c
index 49dff1991..d469f29ab 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/stm32wbxx_it.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/Core/Src/stm32wbxx_it.c
@@ -60,21 +60,10 @@
/* USER CODE END 0 */
/* External variables --------------------------------------------------------*/
-
-
-
extern DMA_HandleTypeDef hdma_lpuart1_tx;
-
-
extern DMA_HandleTypeDef hdma_usart1_tx;
-
-
extern UART_HandleTypeDef hlpuart1;
-
-
extern UART_HandleTypeDef huart1;
-
-
/* USER CODE BEGIN EV */
/* USER CODE END EV */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/MDK-ARM/BLE_HeartRate_ota.uvprojx b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/MDK-ARM/BLE_HeartRate_ota.uvprojx
index 5aaefe06d..30f5001da 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/MDK-ARM/BLE_HeartRate_ota.uvprojx
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/MDK-ARM/BLE_HeartRate_ota.uvprojx
@@ -16,7 +16,7 @@
<TargetCommonOption>
<Device>STM32WB55RGVx</Device>
<Vendor>STMicroelectronics</Vendor>
- <PackID>Keil.STM32WBxx.0.0.7</PackID>
+ <PackID>Keil.STM32WBxx.0.0.6</PackID>
<PackURL>http://www.keil.com/pack</PackURL>
<Cpu>IROM(0x08007000-0x807FFFF) IRAM(0x20000004-0x2002FC03) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4")</Cpu>
<FlashUtilSpec></FlashUtilSpec>
@@ -82,7 +82,7 @@
<AfterMake>
<RunUserProg1>1</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
- <UserProg1Name>fromelf #L --bin --output=$L@L.bin</UserProg1Name>
+ <UserProg1Name>fromelf #L --bincombined --output=$L@L.bin</UserProg1Name>
<UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
@@ -372,9 +372,7 @@
<IncludeLibs></IncludeLibs>
<IncludeLibsPath></IncludeLibsPath>
<Misc>--keep *.o(TAG_OTA_START)
---keep *.o(TAG_OTA_END)
-
-</Misc>
+--keep *.o(TAG_OTA_END)</Misc>
<LinkerInputFile></LinkerInputFile>
<DisabledWarnings></DisabledWarnings>
</LDads>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/MDK-ARM/stm32wb55xx_flash_cm4.sct b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/MDK-ARM/stm32wb55xx_flash_cm4.sct
index f9094bb6a..3a7d510ae 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/MDK-ARM/stm32wb55xx_flash_cm4.sct
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/MDK-ARM/stm32wb55xx_flash_cm4.sct
@@ -2,10 +2,10 @@
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
-LR_IROM1 0x08007000 0x184 { ; load region size_region
- ER_IROM1_LOW 0x08007000 0x184 { ; load address = execution address
- *.o(RESET, +First)
- *.o(TAG_OTA_START)
+LR_IROM1 0x08007000 0x178 { ; load region size_region
+ ER_IROM1 0x08007000 0x178 { ; load address = execution address
+ *.o(RESET, +First)
+ *.o(TAG_OTA_START)
}
RW_IRAM1 0x20000004 0x2FFFC { ; RW data
.ANY (+RW +ZI)
@@ -16,11 +16,10 @@ LR_IROM1 0x08007000 0x184 { ; load region size_region
*(MB_MEM2)
}
}
-LR_IROM3 0x08007184 0x78E7C {
- ER_IROM1_HIGH 0x08007184 0x78E7C { ; load address = execution address
-
- *(InRoot$$Sections)
- .ANY (+RO)
- *.o(TAG_OTA_END)
+LR_IROM3 0x08007178 0x78E88 {
+ ER_IROM3 0x08007178 0x78E88 { ; load address = execution address
+ *(InRoot$$Sections)
+ .ANY (+RO)
+ *.o(TAG_OTA_END)
}
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/STM32_WPAN/App/app_ble.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/STM32_WPAN/App/app_ble.c
index 9c6aab1d8..926354cca 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/STM32_WPAN/App/app_ble.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/STM32_WPAN/App/app_ble.c
@@ -873,7 +873,7 @@ static void Adv_Request(APP_BLE_ConnStatus_t New_Status)
ret = aci_gap_set_non_discoverable();
if (ret == BLE_STATUS_SUCCESS)
{
- APP_DBG_MSG("Successfully Stopped Advertising\n");
+ APP_DBG_MSG("Successfully Stopped Advertising \n");
}
else
{
@@ -902,13 +902,13 @@ static void Adv_Request(APP_BLE_ConnStatus_t New_Status)
{
if (New_Status == APP_BLE_FAST_ADV)
{
- APP_DBG_MSG("Successfully Start Fast Advertising\n" );
+ APP_DBG_MSG("Successfully Start Fast Advertising \n" );
/* Start Timer to STOP ADV - TIMEOUT */
HW_TS_Start(BleApplicationContext.Advertising_mgr_timer_Id, INITIAL_ADV_TIMEOUT);
}
else
{
- APP_DBG_MSG("Successfully Start Low Power Advertising\n");
+ APP_DBG_MSG("Successfully Start Low Power Advertising \n");
}
}
else
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/STM32_WPAN/App/ble_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/STM32_WPAN/App/ble_conf.h
index 32308401b..3e0d875d2 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/STM32_WPAN/App/ble_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/STM32_WPAN/App/ble_conf.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : App/ble_conf.h
- * Description : Configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : Configuration file for BLE Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
@@ -49,7 +49,7 @@
* This shall take into account all registered handlers
* (from either the provided services or the custom services)
*/
-#define BLE_CFG_SVC_MAX_NBR_CB 5
+#define BLE_CFG_SVC_MAX_NBR_CB 7
#define BLE_CFG_CLT_MAX_NBR_CB 0
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/STM32_WPAN/App/ble_dbg_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/STM32_WPAN/App/ble_dbg_conf.h
index 759b3e0aa..a24660c50 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/STM32_WPAN/App/ble_dbg_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/STM32_WPAN/App/ble_dbg_conf.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : App/ble_dbg_conf.h
- * Description : Debug configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : Debug configuration file for BLE Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/STM32_WPAN/App/hrs_app.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/STM32_WPAN/App/hrs_app.c
index 7d6a1ebbf..e84751eaa 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/STM32_WPAN/App/hrs_app.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRate_ota/STM32_WPAN/App/hrs_app.c
@@ -211,7 +211,7 @@ static void HrMeas( void )
* is not sent if there is a pending one
*/
UTIL_SEQ_SetTask( 1<<CFG_TASK_MEAS_REQ_ID, CFG_SCH_PRIO_0);
- /* USER CODE BEGIN HrMeas */
+/* USER CODE BEGIN HrMeas */
/* USER CODE END HrMeas */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Inc/app_conf.h
index 1445f7998..23815b89d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Inc/app_conf.h
@@ -24,12 +24,13 @@
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Health Thermometer Application Config
******************************************************************************/
-/**< generic parameters ********************************************************/
+/**< generic parameters ******************************************************/
/**
* Define Tx Power
@@ -74,6 +75,17 @@
#define CFG_MITM_PROTECTION CFG_MITM_PROTECTION_REQUIRED
/**
+ * Define PHY
+ */
+#define ALL_PHYS_PREFERENCE 0x00
+#define RX_2M_PREFERRED 0x02
+#define TX_2M_PREFERRED 0x02
+#define TX_1M 0x01
+#define TX_2M 0x02
+#define RX_1M 0x01
+#define RX_2M 0x02
+
+/**
* Generic Access Appearance
*/
#define CFG_UNKNOWN_APPEARANCE (0)
@@ -89,12 +101,23 @@
*/
#define CFG_BLE_ERK {0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21,0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21}
+/* USER CODE BEGIN Generic_Parameters */
+/**
+ * SMPS supply
+ * SMPS not used when Set to 0
+ * SMPS used when Set to 1
+ */
+#define CFG_USE_SMPS 1
+/* USER CODE END Generic_Parameters */
+
/**< specific parameters ********************************************************/
#define CFG_MAX_CONNECTION (8)
#define CFG_DATA_ROLE_MODE 2
#define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI4_IRQHandler
+#define PUSH_BUTTON_SW2_EXTI_IRQHandler EXTI0_IRQHandler
+
/******************************************************************************
* BLE Stack
******************************************************************************/
@@ -174,7 +197,7 @@
* 1 : internal RO
* 0 : external crystal ( no calibration )
*/
-#define CFG_BLE_LSE_SOURCE 1
+#define CFG_BLE_LSE_SOURCE 0
/**
* Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
@@ -390,7 +413,6 @@ typedef enum
#define CFG_LPM_SUPPORTED 0
#define CFG_DEBUGGER_SUPPORTED 1
#endif
-
/**
* When CFG_DEBUG_TRACE_FULL is set to 1, the trace are output with the API name, the file name and the line number
* When CFG_DEBUG_TRACE_LIGHT is set to 1, only the debug message is output
@@ -443,6 +465,7 @@ typedef enum
{
CFG_TASK_CONN_MGR_ID,
CFG_TASK_HID_UPDATE_REQ_ID,
+ CFG_TASK_HID_DISC_REQ_ID,
CFG_TASK_HCI_ASYNCH_EVT_ID,
CFG_LAST_TASK_ID_WITH_HCICMD, /**< Shall be LAST in the list */
@@ -489,6 +512,9 @@ typedef enum
{
CFG_LPM_APP,
CFG_LPM_APP_BLE,
+ /* USER CODE BEGIN CFG_LPM_Id_t */
+
+ /* USER CODE END CFG_LPM_Id_t */
} CFG_LPM_Id_t;
/******************************************************************************
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Inc/stm32_lpm_if.h
index 38e326512..d8e67947f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Inc/stm32_lpm_if.h
@@ -1,46 +1,22 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file stm32_lpm_if.h
-* @brief Header for stm32_lpm_f.c module (device specific LP management)
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
******************************************************************************
* @attention
*
-* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics International N.V.
+* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted, provided that the following conditions are met:
-*
-* 1. Redistribution of source code must retain the above copyright notice,
-* this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following disclaimer in the documentation
-* and/or other materials provided with the distribution.
-* 3. Neither the name of STMicroelectronics nor the names of other
-* contributors to this software may be used to endorse or promote products
-* derived from this software without specific written permission.
-* 4. This software, including modifications and/or derivative works of this
-* software, must execute solely and exclusively on microcontroller or
-* microprocessor devices manufactured by or for STMicroelectronics.
-* 5. Redistribution and use of this software other than as permitted under
-* this license is void and will automatically terminate your rights under
-* this license.
-*
-* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
-* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
-* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+* This software component is licensed by ST under BSD 3-Clause license,
+* the "License"; You may not use this file except in compliance with the
+* License. You may obtain a copy of the License at:
+* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32_LPM_IF_H
@@ -89,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Inc/stm32wbxx_hal_conf.h
index 8cce280aa..4ab9edb7d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Inc/stm32wbxx_hal_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Inc/stm32wbxx_hal_conf.h
@@ -219,6 +219,10 @@
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32wbxx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32wbxx_hal_flash.h"
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Inc/utilities_conf.h
index c98d97ba1..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Inc/utilities_conf.h
@@ -1,3 +1,4 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* File Name : utilities_conf.h
@@ -9,13 +10,14 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef UTILITIES_CONF_H
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Src/app_entry.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Src/app_entry.c
index fceeab57c..5b2d3f212 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Src/app_entry.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Src/app_entry.c
@@ -55,7 +55,6 @@ static void appe_Tl_Init( void );
static void Led_Init( void );
static void Button_Init( void );
static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status );
-
static void APPE_SysUserEvtRx( void * pPayload );
/* Functions Definition ------------------------------------------------------*/
@@ -81,7 +80,7 @@ void APPE_Init( void )
/**
* From now, the application is waiting for the ready event ( VS_HCI_C2_Ready )
- * received on the system channel before starting the BLE Stack
+ * received on the system channel before starting the Stack
* This system event is received with APPE_SysUserEvtRx()
*/
@@ -215,6 +214,7 @@ static void Button_Init( void )
*/
BSP_PB_Init(BUTTON_SW1, BUTTON_MODE_EXTI);
+ BSP_PB_Init(BUTTON_SW2, BUTTON_MODE_EXTI);
#endif
return;
@@ -253,7 +253,6 @@ void UTIL_SEQ_Idle( void )
return;
}
-
void UTIL_SEQ_EvtIdle( UTIL_SEQ_bm_t task_id_bm, UTIL_SEQ_bm_t evt_waited_bm )
{
UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Src/hw_timerserver.c
index 52a1bfa0d..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Src/hw_timerserver.c
@@ -1,22 +1,21 @@
/**
******************************************************************************
- * File Name : hw_timerserver.c
- * Description : Hardware timerserver source file for BLE
- * middleWare.
+ * File Name : hw_timerserver.c
+ * Description : Hardware timerserver source file for STM32WPAN Middleware.
+ *
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Src/hw_uart.c
index c0fc22d58..775aa241d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Src/hw_uart.c
@@ -130,7 +130,7 @@
HAL_NVIC_EnableIRQ(CFG_HW_##__USART_BASE__##_TX_DMA_IRQn); \
} while(0)
- /* Variables ------------------------------------------------------------------*/
+/* Variables ------------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
UART_HandleTypeDef huart1 = {0};
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Src/main.c
index 34d973675..25a8c45e0 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Src/main.c
@@ -195,7 +195,13 @@ static void Init_RTC( void )
hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
HAL_RTC_Init(&hrtc);
- MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* Disable RTC registers write protection */
+ LL_RTC_DisableWriteProtection(RTC);
+
+ LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER);
+
+ /* Enable RTC registers write protection */
+ LL_RTC_EnableWriteProtection(RTC);
return;
}
@@ -218,6 +224,12 @@ void SystemClock_Config( void )
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -268,19 +280,6 @@ void SystemClock_Config( void )
*/
LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
@@ -289,21 +288,33 @@ void SystemClock_Config( void )
* WRAP FUNCTIONS
*
*************************************************************/
-
-/**
- * This function is empty to avoid starting the SysTick Timer
- */
-HAL_StatusTypeDef HAL_InitTick( uint32_t TickPriority )
+void HAL_Delay(uint32_t Delay)
{
- return (HAL_OK);
-}
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
-/**
- * This function is empty as the SysTick Timer is not used
- */
-void HAL_Delay(__IO uint32_t Delay)
-{
- return;
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
}
/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Src/stm32wbxx_it.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Src/stm32wbxx_it.c
index 500aac626..1a9df55be 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Src/stm32wbxx_it.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/Core/Src/stm32wbxx_it.c
@@ -121,6 +121,7 @@ void PUSH_BUTTON_SW1_EXTI_IRQHandler(void)
*/
void PUSH_BUTTON_SW2_EXTI_IRQHandler(void)
{
+ HAL_GPIO_EXTI_IRQHandler(BUTTON_SW2_PIN);
}
/**
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/MDK-ARM/BLE_Hid.uvoptx b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/MDK-ARM/BLE_Hid.uvoptx
index aadda47d9..ca7a7309b 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/MDK-ARM/BLE_Hid.uvoptx
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/MDK-ARM/BLE_Hid.uvoptx
@@ -1,5 +1,26 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_opt.xsd">
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd">
+
+ <SchemaVersion>1.0</SchemaVersion>
+
+ <Header>### uVision Project, (C) Keil Software</Header>
+
+ <Extensions>
+ <cExt>*.c</cExt>
+ <aExt>*.s*; *.src; *.a*</aExt>
+ <oExt>*.obj; *.o</oExt>
+ <lExt>*.lib</lExt>
+ <tExt>*.txt; *.h; *.inc</tExt>
+ <pExt>*.plm</pExt>
+ <CppX>*.cpp</CppX>
+ <nMigrate>0</nMigrate>
+ </Extensions>
+
+ <DaveTm>
+ <dwLowDateTime>0</dwLowDateTime>
+ <dwHighDateTime>0</dwHighDateTime>
+ </DaveTm>
+
<Target>
<TargetName>Production</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
@@ -11,6 +32,7 @@
<BeepAtEnd>1</BeepAtEnd>
<RunSim>0</RunSim>
<RunTarget>1</RunTarget>
+ <RunAbUc>0</RunAbUc>
</OPTTT>
<OPTHX>
<HexSelection>1</HexSelection>
@@ -23,7 +45,7 @@
<PageWidth>79</PageWidth>
<PageLength>66</PageLength>
<TabStop>8</TabStop>
- <ListingPath />
+ <ListingPath></ListingPath>
</OPTLEX>
<ListingPage>
<CreateCListing>1</CreateCListing>
@@ -73,33 +95,43 @@
<tRmem>1</tRmem>
<tRfunc>1</tRfunc>
<tRbox>1</tRbox>
+ <tRtrace>1</tRtrace>
+ <sRSysVw>1</sRSysVw>
+ <tRSysVw>1</tRSysVw>
<sRunDeb>0</sRunDeb>
<sLrtime>0</sLrtime>
- <nTsel>13</nTsel>
- <sDll />
- <sDllPa />
- <sDlgDll />
- <sDlgPa />
- <sIfile />
- <tDll />
- <tDllPa />
- <tDlgDll />
- <tDlgPa />
- <tIfile />
+ <bEvRecOn>1</bEvRecOn>
+ <bSchkAxf>0</bSchkAxf>
+ <bTchkAxf>0</bTchkAxf>
+ <nTsel>6</nTsel>
+ <sDll></sDll>
+ <sDllPa></sDllPa>
+ <sDlgDll></sDlgDll>
+ <sDlgPa></sDlgPa>
+ <sIfile></sIfile>
+ <tDll></tDll>
+ <tDllPa></tDllPa>
+ <tDlgDll></tDlgDll>
+ <tDlgPa></tDlgPa>
+ <tIfile></tIfile>
<pMon>STLink\ST-LINKIII-KEIL_SWO.dll</pMon>
</DebugOpt>
- <TargetDriverDllRegistry>
+ <TargetDriverDllRegistry>
<SetRegEntry>
- <Number>0</Number>
- <Key>ST-LINKIII-KEIL_SWO</Key>
- <Name>-U-O142 -O2254 -S0 -C0 -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC1000 -FN1 -FF0STM32WB_M4.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32WB55RG$CMSIS\Flash\STM32WB_M4.FLM)</Name>
- </SetRegEntry>
- <SetRegEntry>
- <Number>0</Number>
- <Key />
- <Name>-U-O142 -O2254 -S0 -C0 -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC1000 -FN1 -FF0STM32WB_M4.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32WB55RG$CMSIS\Flash\STM32WB_M4.FLM)</Name>
- </SetRegEntry>
- </TargetDriverDllRegistry>
+ <Number>0</Number>
+ <Key>UL2CM3</Key>
+ <Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32WB_M4 -FS08000000 -FL01000000 -FP0($$Device:STM32WB55RGVx$CMSIS\Flash\STM32WB_M4.FLM))</Name>
+ </SetRegEntry>
+ <SetRegEntry>
+ <Number>0</Number>
+ <Key>ST-LINKIII-KEIL_SWO</Key>
+ <Name>-U-O142 -O2254 -S0 -C0 -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC1000 -FN1 -FF0STM32WB_M4.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32WB55RGVx$CMSIS\Flash\STM32WB_M4.FLM)</Name>
+ </SetRegEntry>
+ </TargetDriverDllRegistry>
+ <Breakpoint/>
+ <Tracepoint>
+ <THDelay>0</THDelay>
+ </Tracepoint>
<DebugFlag>
<trace>0</trace>
<periodic>1</periodic>
@@ -126,8 +158,760 @@
<newCpu>0</newCpu>
<uProt>0</uProt>
</DebugFlag>
- <LintExecutable />
- <LintConfigFile />
+ <LintExecutable></LintExecutable>
+ <LintConfigFile></LintConfigFile>
+ <bLintAuto>0</bLintAuto>
+ <bAutoGenD>0</bAutoGenD>
+ <LntExFlags>0</LntExFlags>
+ <pMisraName></pMisraName>
+ <pszMrule></pszMrule>
+ <pSingCmds></pSingCmds>
+ <pMultCmds></pMultCmds>
+ <pMisraNamep></pMisraNamep>
+ <pszMrulep></pszMrulep>
+ <pSingCmdsp></pSingCmdsp>
+ <pMultCmdsp></pMultCmdsp>
</TargetOption>
</Target>
+
+ <Group>
+ <GroupName>::CMSIS</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>1</RteFlg>
+ </Group>
+
+ <Group>
+ <GroupName>Application/Core</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>0</RteFlg>
+ <File>
+ <GroupNumber>2</GroupNumber>
+ <FileNumber>1</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../Core/Src/app_entry.c</PathWithFileName>
+ <FilenameWithoutPath>app_entry.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>2</GroupNumber>
+ <FileNumber>2</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../Core/Src/stm32_lpm_if.c</PathWithFileName>
+ <FilenameWithoutPath>stm32_lpm_if.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>2</GroupNumber>
+ <FileNumber>3</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../Core/Src/hw_timerserver.c</PathWithFileName>
+ <FilenameWithoutPath>hw_timerserver.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>2</GroupNumber>
+ <FileNumber>4</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../Core/Src/hw_uart.c</PathWithFileName>
+ <FilenameWithoutPath>hw_uart.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>2</GroupNumber>
+ <FileNumber>5</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../Core/Src/main.c</PathWithFileName>
+ <FilenameWithoutPath>main.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>2</GroupNumber>
+ <FileNumber>6</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../Core/Src/stm32wbxx_it.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_it.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ </Group>
+
+ <Group>
+ <GroupName>Application/MDK-ARM</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>0</RteFlg>
+ <File>
+ <GroupNumber>3</GroupNumber>
+ <FileNumber>7</FileNumber>
+ <FileType>2</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>startup_stm32wb55xx_cm4.s</PathWithFileName>
+ <FilenameWithoutPath>startup_stm32wb55xx_cm4.s</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ </Group>
+
+ <Group>
+ <GroupName>Application/STM32_WPAN/app</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>0</RteFlg>
+ <File>
+ <GroupNumber>4</GroupNumber>
+ <FileNumber>8</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../STM32_WPAN/App/app_ble.c</PathWithFileName>
+ <FilenameWithoutPath>app_ble.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>4</GroupNumber>
+ <FileNumber>9</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../STM32_WPAN/App/hids_app.c</PathWithFileName>
+ <FilenameWithoutPath>hids_app.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ </Group>
+
+ <Group>
+ <GroupName>Application/STM32_WPAN/target</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>0</RteFlg>
+ <File>
+ <GroupNumber>5</GroupNumber>
+ <FileNumber>10</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../STM32_WPAN/Target/hw_ipcc.c</PathWithFileName>
+ <FilenameWithoutPath>hw_ipcc.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ </Group>
+
+ <Group>
+ <GroupName>Doc</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>0</RteFlg>
+ <File>
+ <GroupNumber>6</GroupNumber>
+ <FileNumber>11</FileNumber>
+ <FileType>5</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../readme.txt</PathWithFileName>
+ <FilenameWithoutPath>readme.txt</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ </Group>
+
+ <Group>
+ <GroupName>Drivers/BSP/P-NUCLEO-WB55.Nucleo</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>0</RteFlg>
+ <File>
+ <GroupNumber>7</GroupNumber>
+ <FileNumber>12</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/BSP/P-NUCLEO-WB55.Nucleo/stm32wbxx_nucleo.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_nucleo.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ </Group>
+
+ <Group>
+ <GroupName>Drivers/CMSIS</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>0</RteFlg>
+ <File>
+ <GroupNumber>8</GroupNumber>
+ <FileNumber>13</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../Core/Src/system_stm32wbxx.c</PathWithFileName>
+ <FilenameWithoutPath>system_stm32wbxx.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ </Group>
+
+ <Group>
+ <GroupName>Drivers/STM32WBxx_HAL_Driver</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>0</RteFlg>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>14</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>15</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_adc.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_adc.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>16</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_adc_ex.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_adc_ex.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>17</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_cortex.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_cortex.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>18</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_dma.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_dma.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>19</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_gpio.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_gpio.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>20</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pwr.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_pwr.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>21</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pwr_ex.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_pwr_ex.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>22</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_spi.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_spi.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>23</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_spi_ex.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_spi_ex.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>24</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rcc.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_rcc.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>25</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rcc_ex.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_rcc_ex.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>26</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rtc.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_rtc.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>27</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rtc_ex.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_rtc_ex.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>28</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_uart.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_uart.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>29</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_uart_ex.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_uart_ex.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ </Group>
+
+ <Group>
+ <GroupName>Middlewares/STM32_WPAN/ble/blesvc</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>0</RteFlg>
+ <File>
+ <GroupNumber>10</GroupNumber>
+ <FileNumber>30</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/svc/Src/hids.c</PathWithFileName>
+ <FilenameWithoutPath>hids.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>10</GroupNumber>
+ <FileNumber>31</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/svc/Src/svc_ctl.c</PathWithFileName>
+ <FilenameWithoutPath>svc_ctl.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ </Group>
+
+ <Group>
+ <GroupName>Middlewares/STM32_WPAN/ble/core</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>0</RteFlg>
+ <File>
+ <GroupNumber>11</GroupNumber>
+ <FileNumber>32</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/core/auto/ble_gap_aci.c</PathWithFileName>
+ <FilenameWithoutPath>ble_gap_aci.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>11</GroupNumber>
+ <FileNumber>33</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/core/auto/ble_gatt_aci.c</PathWithFileName>
+ <FilenameWithoutPath>ble_gatt_aci.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>11</GroupNumber>
+ <FileNumber>34</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/core/auto/ble_hal_aci.c</PathWithFileName>
+ <FilenameWithoutPath>ble_hal_aci.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>11</GroupNumber>
+ <FileNumber>35</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/core/auto/ble_hci_le.c</PathWithFileName>
+ <FilenameWithoutPath>ble_hci_le.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>11</GroupNumber>
+ <FileNumber>36</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/core/auto/ble_l2cap_aci.c</PathWithFileName>
+ <FilenameWithoutPath>ble_l2cap_aci.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>11</GroupNumber>
+ <FileNumber>37</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/core/template/osal.c</PathWithFileName>
+ <FilenameWithoutPath>osal.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ </Group>
+
+ <Group>
+ <GroupName>Middlewares/STM32_WPAN/ble/menu</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>0</RteFlg>
+ <File>
+ <GroupNumber>12</GroupNumber>
+ <FileNumber>38</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/menu/DispTools.c</PathWithFileName>
+ <FilenameWithoutPath>DispTools.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>12</GroupNumber>
+ <FileNumber>39</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/menu/hids_mouse_menu.c</PathWithFileName>
+ <FilenameWithoutPath>hids_mouse_menu.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ </Group>
+
+ <Group>
+ <GroupName>Middlewares/STM32_WPAN/interface/patterns/ble_thread/shci</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>0</RteFlg>
+ <File>
+ <GroupNumber>13</GroupNumber>
+ <FileNumber>40</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci/shci.c</PathWithFileName>
+ <FilenameWithoutPath>shci.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ </Group>
+
+ <Group>
+ <GroupName>Middlewares/STM32_WPAN/interface/patterns/ble_thread/tl</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>0</RteFlg>
+ <File>
+ <GroupNumber>14</GroupNumber>
+ <FileNumber>41</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/hci_tl.c</PathWithFileName>
+ <FilenameWithoutPath>hci_tl.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>14</GroupNumber>
+ <FileNumber>42</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/shci_tl.c</PathWithFileName>
+ <FilenameWithoutPath>shci_tl.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>14</GroupNumber>
+ <FileNumber>43</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/hci_tl_if.c</PathWithFileName>
+ <FilenameWithoutPath>hci_tl_if.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>14</GroupNumber>
+ <FileNumber>44</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/shci_tl_if.c</PathWithFileName>
+ <FilenameWithoutPath>shci_tl_if.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>14</GroupNumber>
+ <FileNumber>45</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_mbox.c</PathWithFileName>
+ <FilenameWithoutPath>tl_mbox.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ </Group>
+
+ <Group>
+ <GroupName>Middlewares/STM32_WPAN/utilities</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>0</RteFlg>
+ <File>
+ <GroupNumber>15</GroupNumber>
+ <FileNumber>46</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/utilities/dbg_trace.c</PathWithFileName>
+ <FilenameWithoutPath>dbg_trace.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>15</GroupNumber>
+ <FileNumber>47</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/utilities/otp.c</PathWithFileName>
+ <FilenameWithoutPath>otp.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>15</GroupNumber>
+ <FileNumber>48</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/utilities/stm_list.c</PathWithFileName>
+ <FilenameWithoutPath>stm_list.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>15</GroupNumber>
+ <FileNumber>49</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/utilities/stm_queue.c</PathWithFileName>
+ <FilenameWithoutPath>stm_queue.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ </Group>
+
+ <Group>
+ <GroupName>Utilities</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>0</RteFlg>
+ <File>
+ <GroupNumber>16</GroupNumber>
+ <FileNumber>50</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Utilities/lpm/tiny_lpm/stm32_lpm.c</PathWithFileName>
+ <FilenameWithoutPath>stm32_lpm.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>16</GroupNumber>
+ <FileNumber>51</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Utilities/sequencer/stm32_seq.c</PathWithFileName>
+ <FilenameWithoutPath>stm32_seq.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ </Group>
+
</ProjectOpt>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/MDK-ARM/BLE_Hid.uvprojx b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/MDK-ARM/BLE_Hid.uvprojx
index 0739d9f93..fa9e3f34a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/MDK-ARM/BLE_Hid.uvprojx
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/MDK-ARM/BLE_Hid.uvprojx
@@ -1,41 +1,45 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" noNamespaceSchemaLocation="project_proj.xsd">
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd">
- <SchemaVersion>1.1</SchemaVersion>
+ <SchemaVersion>2.1</SchemaVersion>
<Header>### uVision Project, (C) Keil Software</Header>
<Targets>
- <Target>
+ <Target>
<TargetName>Production</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
+ <uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>
<Device>STM32WB55RGVx</Device>
<Vendor>STMicroelectronics</Vendor>
+ <PackID>Keil.STM32WBxx_DFP.1.0.0</PackID>
+ <PackURL>http://www.keil.com/pack</PackURL>
<Cpu>IROM(0x08000000-0x807FFFF) IRAM(0x20000004-0x2002FC03) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4")</Cpu>
- <FlashUtilSpec/>
- <StartupFile/>
- <FlashDriverDll/>
- <DeviceId/>
- <RegisterFile/>
- <MemoryEnv/>
- <Cmp/>
- <Asm/>
- <Linker/>
- <OHString/>
- <InfinionOptionDll/>
- <SLE66CMisc/>
- <SLE66AMisc/>
- <SLE66LinkerMisc/>
- <SFDFile/>
+ <FlashUtilSpec></FlashUtilSpec>
+ <StartupFile></StartupFile>
+ <FlashDriverDll></FlashDriverDll>
+ <DeviceId></DeviceId>
+ <RegisterFile></RegisterFile>
+ <MemoryEnv></MemoryEnv>
+ <Cmp></Cmp>
+ <Asm></Asm>
+ <Linker></Linker>
+ <OHString></OHString>
+ <InfinionOptionDll></InfinionOptionDll>
+ <SLE66CMisc></SLE66CMisc>
+ <SLE66AMisc></SLE66AMisc>
+ <SLE66LinkerMisc></SLE66LinkerMisc>
+ <SFDFile>$$Device:STM32WB55RGVx$CMSIS\SVD\STM32WBxx_CM4.svd</SFDFile>
<bCustSvd>0</bCustSvd>
<UseEnv>0</UseEnv>
- <BinPath/>
- <IncludePath/>
- <LibPath/>
- <RegisterFilePath/>
- <DBRegisterFilePath/>
+ <BinPath></BinPath>
+ <IncludePath></IncludePath>
+ <LibPath></LibPath>
+ <RegisterFilePath></RegisterFilePath>
+ <DBRegisterFilePath></DBRegisterFilePath>
<TargetStatus>
<Error>0</Error>
<ExitCodeStop>0</ExitCodeStop>
@@ -50,23 +54,25 @@
<CreateHexFile>0</CreateHexFile>
<DebugInformation>1</DebugInformation>
<BrowseInformation>1</BrowseInformation>
- <ListingPath>Production\List</ListingPath>
+ <ListingPath></ListingPath>
<HexFormatSelection>1</HexFormatSelection>
<Merge32K>0</Merge32K>
<CreateBatchFile>0</CreateBatchFile>
<BeforeCompile>
<RunUserProg1>0</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
- <UserProg1Name/>
- <UserProg2Name/>
+ <UserProg1Name></UserProg1Name>
+ <UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
+ <nStopU1X>0</nStopU1X>
+ <nStopU2X>0</nStopU2X>
</BeforeCompile>
<BeforeMake>
<RunUserProg1>0</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
- <UserProg1Name/>
- <UserProg2Name/>
+ <UserProg1Name></UserProg1Name>
+ <UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopB1X>0</nStopB1X>
@@ -76,12 +82,14 @@
<RunUserProg1>1</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
<UserProg1Name>fromelf #L --bin --output=$L@L.bin</UserProg1Name>
- <UserProg2Name/>
+ <UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
+ <nStopA1X>0</nStopA1X>
+ <nStopA2X>0</nStopA2X>
</AfterMake>
<SelectedForBatchBuild>0</SelectedForBatchBuild>
- <SVCSIdString/>
+ <SVCSIdString></SVCSIdString>
</TargetCommonOption>
<CommonProperty>
<UseCPPCompiler>0</UseCPPCompiler>
@@ -95,9 +103,9 @@
<AssembleAssemblyFile>0</AssembleAssemblyFile>
<PublicsOnly>0</PublicsOnly>
<StopOnExitCode>3</StopOnExitCode>
- <CustomArgument/>
- <IncludeLibraryModules/>
- <ComprImg/>
+ <CustomArgument></CustomArgument>
+ <IncludeLibraryModules></IncludeLibraryModules>
+ <ComprImg>0</ComprImg>
</CommonProperty>
<DllOption>
<SimDllName>SARMCM3.DLL</SimDllName>
@@ -117,47 +125,6 @@
<HexOffset>0</HexOffset>
<Oh166RecLen>16</Oh166RecLen>
</OPTHX>
- <Simulator>
- <UseSimulator>0</UseSimulator>
- <LoadApplicationAtStartup>1</LoadApplicationAtStartup>
- <RunToMain>1</RunToMain>
- <RestoreBreakpoints>1</RestoreBreakpoints>
- <RestoreWatchpoints>1</RestoreWatchpoints>
- <RestoreMemoryDisplay>1</RestoreMemoryDisplay>
- <RestoreFunctions>1</RestoreFunctions>
- <RestoreToolbox>1</RestoreToolbox>
- <LimitSpeedToRealTime>0</LimitSpeedToRealTime>
- <RestoreSysVw>1</RestoreSysVw>
- </Simulator>
- <Target>
- <UseTarget>1</UseTarget>
- <LoadApplicationAtStartup>1</LoadApplicationAtStartup>
- <RunToMain>1</RunToMain>
- <RestoreBreakpoints>1</RestoreBreakpoints>
- <RestoreWatchpoints>1</RestoreWatchpoints>
- <RestoreMemoryDisplay>1</RestoreMemoryDisplay>
- <RestoreFunctions>0</RestoreFunctions>
- <RestoreToolbox>1</RestoreToolbox>
- <RestoreTracepoints>1</RestoreTracepoints>
- <RestoreSysVw>1</RestoreSysVw>
- </Target>
- <RunDebugAfterBuild>0</RunDebugAfterBuild>
- <TargetSelection>13</TargetSelection>
- <SimDlls>
- <CpuDll/>
- <CpuDllArguments/>
- <PeripheralDll/>
- <PeripheralDllArguments/>
- <InitializationFile/>
- </SimDlls>
- <TargetDlls>
- <CpuDll/>
- <CpuDllArguments/>
- <PeripheralDll/>
- <PeripheralDllArguments/>
- <InitializationFile/>
- <Driver>STLink\ST-LINKIII-KEIL_SWO.dll</Driver>
- </TargetDlls>
</DebugOption>
<Utilities>
<Flash1>
@@ -170,11 +137,11 @@
</Flash1>
<bUseTDR>1</bUseTDR>
<Flash2>STLink\ST-LINKIII-KEIL_SWO.dll</Flash2>
- <Flash3/>
- <Flash4/>
- <pFcarmOut/>
- <pFcarmGrp/>
- <pFcArmRoot/>
+ <Flash3></Flash3>
+ <Flash4></Flash4>
+ <pFcarmOut></pFcarmOut>
+ <pFcarmGrp></pFcarmGrp>
+ <pFcArmRoot></pFcArmRoot>
<FcArmLst>0</FcArmLst>
</Utilities>
<TargetArmAds>
@@ -207,7 +174,7 @@
<RvctClst>0</RvctClst>
<GenPPlst>0</GenPPlst>
<AdsCpuType>"Cortex-M4"</AdsCpuType>
- <RvctDeviceName/>
+ <RvctDeviceName></RvctDeviceName>
<mOS>0</mOS>
<uocRom>0</uocRom>
<uocRam>0</uocRam>
@@ -216,12 +183,14 @@
<hadXRAM>0</hadXRAM>
<uocXRam>0</uocXRam>
<RvdsVP>2</RvdsVP>
+ <RvdsMve>0</RvdsMve>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
<useUlib>1</useUlib>
<EndSel>0</EndSel>
<uLtcg>0</uLtcg>
+ <nSecure>0</nSecure>
<RoSelD>3</RoSelD>
<RwSelD>3</RwSelD>
<CodeSel>0</CodeSel>
@@ -274,13 +243,13 @@
</Ocm6>
<IRAM>
<Type>0</Type>
- <StartAddress/>
- <Size/>
+ <StartAddress>0x20000004</StartAddress>
+ <Size>0x2fc00</Size>
</IRAM>
<IROM>
<Type>1</Type>
- <StartAddress/>
- <Size/>
+ <StartAddress>0x8000000</StartAddress>
+ <Size>0x80000</Size>
</IROM>
<XRAM>
<Type>0</Type>
@@ -304,8 +273,8 @@
</OCR_RVCT3>
<OCR_RVCT4>
<Type>1</Type>
- <StartAddress/>
- <Size/>
+ <StartAddress>0x8000000</StartAddress>
+ <Size>0x80000</Size>
</OCR_RVCT4>
<OCR_RVCT5>
<Type>1</Type>
@@ -329,8 +298,8 @@
</OCR_RVCT8>
<OCR_RVCT9>
<Type>0</Type>
- <StartAddress/>
- <Size/>
+ <StartAddress>0x20000004</StartAddress>
+ <Size>0x2fc00</Size>
</OCR_RVCT9>
<OCR_RVCT10>
<Type>0</Type>
@@ -338,7 +307,7 @@
<Size>0x0</Size>
</OCR_RVCT10>
</OnChipMemories>
- <RvctStartVector/>
+ <RvctStartVector></RvctStartVector>
</ArmAdsMisc>
<Cads>
<interw>1</interw>
@@ -355,11 +324,19 @@
<uThumb>0</uThumb>
<uSurpInc>0</uSurpInc>
<uC99>1</uC99>
+ <uGnu>0</uGnu>
<useXO>0</useXO>
+ <v6Lang>1</v6Lang>
+ <v6LangP>1</v6LangP>
+ <vShortEn>1</vShortEn>
+ <vShortWch>1</vShortWch>
+ <v6Lto>0</v6Lto>
+ <v6WtE>0</v6WtE>
+ <v6Rtti>0</v6Rtti>
<VariousControls>
- <MiscControls/>
+ <MiscControls></MiscControls>
<Define>USE_STM32WBXX_NUCLEO,STM32WB55xx,USE_HAL_DRIVER,CORE_CM4</Define>
- <Undefine/>
+ <Undefine></Undefine>
<IncludePath>../../../../../../Middlewares/ST/STM32_WPAN/ble/core/template;../../../../../../Middlewares/ST/STM32_WPAN/ble/core/auto;../../../../../../Middlewares/ST/STM32_WPAN;../../../../../../Drivers/CMSIS/Device/ST/STM32WBxx/Include;../../../../../../Drivers/STM32WBxx_HAL_Driver/Inc;../../../../../../Drivers/BSP/P-NUCLEO-WB55.Nucleo;../../../../../../Middlewares/ST/STM32_WPAN/ble/core/Inc;../../../../../../Middlewares/ST/STM32_WPAN/ble/core/;../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl;../../../../../../Middlewares/ST/STM32_WPAN/utilities;../../../../../../Utilities/lpm/tiny_lpm;../../../../../../Utilities/sequencer;../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/maptab;../../../../../../Middlewares/ST/STM32_WPAN/ble/menu;../../../../../../Drivers/CMSIS/Include;../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci;../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread;../../../../../../Middlewares/ST/STM32_WPAN/ble;../Core/Inc;../STM32_WPAN/app</IncludePath>
</VariousControls>
</Cads>
@@ -371,11 +348,14 @@
<SplitLS>0</SplitLS>
<SwStkChk>0</SwStkChk>
<NoWarn>0</NoWarn>
+ <uSurpInc>0</uSurpInc>
+ <useXO>0</useXO>
+ <uClangAs>0</uClangAs>
<VariousControls>
- <MiscControls/>
- <Define/>
- <Undefine/>
- <IncludePath/>
+ <MiscControls></MiscControls>
+ <Define></Define>
+ <Undefine></Undefine>
+ <IncludePath></IncludePath>
</VariousControls>
</Aads>
<LDads>
@@ -387,22 +367,21 @@
<useFile>0</useFile>
<TextAddressRange>0x08000000</TextAddressRange>
<DataAddressRange>0x20000000</DataAddressRange>
- <pXoBase/>
+ <pXoBase></pXoBase>
<ScatterFile>.\stm32wb55xx_flash_cm4.sct</ScatterFile>
- <IncludeLibs/>
- <IncludeLibsPath/>
- <Misc/>
- <LinkerInputFile/>
- <DisabledWarnings/>
+ <IncludeLibs></IncludeLibs>
+ <IncludeLibsPath></IncludeLibsPath>
+ <Misc></Misc>
+ <LinkerInputFile></LinkerInputFile>
+ <DisabledWarnings></DisabledWarnings>
</LDads>
</TargetArmAds>
- </TargetOption>
+ </TargetOption>
<Groups>
-
- <Group>
+ <Group>
<GroupName>::CMSIS</GroupName>
</Group>
- <Group>
+ <Group>
<GroupName>Application/Core</GroupName>
<Files>
<File>
@@ -439,7 +418,7 @@
</Group>
<Group>
<GroupName>Application/MDK-ARM</GroupName>
- <Files>
+ <Files>
<File>
<FileName>startup_stm32wb55xx_cm4.s</FileName>
<FileType>2</FileType>
@@ -733,9 +712,9 @@
</Files>
</Group>
</Groups>
-
</Target>
</Targets>
+
<RTE>
<apis/>
<components>
@@ -748,4 +727,5 @@
</components>
<files/>
</RTE>
-</Project> \ No newline at end of file
+
+</Project>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/STM32_WPAN/App/app_ble.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/STM32_WPAN/App/app_ble.c
index 682d96429..3e1952217 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/STM32_WPAN/App/app_ble.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/STM32_WPAN/App/app_ble.c
@@ -225,6 +225,7 @@ static void Add_Advertisment_Service_UUID(uint16_t servUUID);
static void Adv_Request(HID_ConnStatus_t New_Status);
static void ConnMgr( void );
static void AdvUpdate ( void );
+static void Disconnection( void );
/* Functions Definition ------------------------------------------------------*/
void APP_BLE_Init( void )
@@ -287,6 +288,7 @@ void APP_BLE_Init( void )
* From here, all initialization are BLE application specific
*/
UTIL_SEQ_RegTask( 1<< CFG_TASK_CONN_MGR_ID, UTIL_SEQ_RFU, AdvUpdate );
+ UTIL_SEQ_RegTask( 1<< CFG_TASK_HID_DISC_REQ_ID, UTIL_SEQ_RFU, Disconnection );
/**
* Initialization of the BLE App Context
@@ -553,7 +555,7 @@ static void Ble_Hci_Gap_Gatt_Init(void){
BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.OOB_Data_Present = 0;
BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMin = 8;
BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMax = 16;
- BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.Use_Fixed_Pin = 1;
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.Use_Fixed_Pin = 0;
BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.Fixed_Pin = 111111;
BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.bonding_mode = 1;
for (index = 0; index < 16; index++)
@@ -718,6 +720,19 @@ static void Adv_Request(HID_ConnStatus_t New_Status)
return;
}
+static void Disconnection( void )
+{
+ tBleStatus result;
+ uint8_t index;
+
+ for(index = 0; index < BLE_CFG_HIDS_NUMBER; index++)
+ {
+ result = aci_gap_terminate(BleApplicationContext.BleApplicationContext_legacy.connectionHandle[index],
+ ERR_RMT_USR_TERM_CONN);
+ APP_DBG_MSG("Disconnection: result = %d\n", result);
+ }
+}
+
void APP_BLE_Key_Button1_Action(void)
{
UTIL_SEQ_SetTask( 1<<CFG_TASK_HID_UPDATE_REQ_ID, CFG_SCH_PRIO_0);
@@ -725,6 +740,7 @@ void APP_BLE_Key_Button1_Action(void)
void APP_BLE_Key_Button2_Action(void)
{
+ UTIL_SEQ_SetTask( 1<<CFG_TASK_HID_DISC_REQ_ID, CFG_SCH_PRIO_0);
}
void APP_BLE_Key_Button3_Action(void)
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/STM32_WPAN/App/ble_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/STM32_WPAN/App/ble_conf.h
index d240a73a4..8697739ad 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/STM32_WPAN/App/ble_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/STM32_WPAN/App/ble_conf.h
@@ -50,7 +50,7 @@
* This shall take into account all registered handlers
* (from either the provided services or the custom services)
*/
-#define BLE_CFG_SVC_MAX_NBR_CB 5
+#define BLE_CFG_SVC_MAX_NBR_CB 7
#define BLE_CFG_CLT_MAX_NBR_CB 0
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/SW4STM32/Production/.cproject b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/SW4STM32/Production/.cproject
index e948387e9..a07074f78 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/SW4STM32/Production/.cproject
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Hid/SW4STM32/Production/.cproject
@@ -89,7 +89,7 @@
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble"/>
<listOptionValue builtIn="false" value="../../../Core/Inc"/>
- <listOptionValue builtIn="false" value="../../../STM32_WPAN/app"/>
+ <listOptionValue builtIn="false" value="../../../STM32_WPAN/App"/>
</option>
<option id="gnu.cpp.compiler.option.preprocessor.def.783237628" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="USE_STM32WBXX_NUCLEO"/>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/app_conf.h
index 68998d74d..cf9898afa 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/app_conf.h
@@ -24,12 +24,13 @@
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* MESH Application Config
******************************************************************************/
-/**< generic parameters ********************************************************/
+/**< generic parameters ******************************************************/
/**
* Define Tx Power
@@ -101,11 +102,22 @@
*/
#define CFG_BLE_ERK {0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21,0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21}
+/* USER CODE BEGIN Generic_Parameters */
+/**
+ * SMPS supply
+ * SMPS not used when Set to 0
+ * SMPS used when Set to 1
+ */
+#define CFG_USE_SMPS 1
+/* USER CODE END Generic_Parameters */
+
/**< specific parameters ********************************************************/
#define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI4_IRQHandler
#define PUSH_BUTTON_SW2_EXTI_IRQHandler EXTI0_IRQHandler
#define PUSH_BUTTON_SW3_EXTI_IRQHandler EXTI1_IRQHandler
+#define POWEROFF_EXTI_IRQHandler EXTI2_IRQHandler
+
#define CFG_MAX_CONNECTION 1
#define RADIO_ACTIVITY_EVENT 0
@@ -202,7 +214,7 @@
* 1 : internal RO
* 0 : external crystal ( no calibration )
*/
-#define CFG_BLE_LSE_SOURCE 1
+#define CFG_BLE_LSE_SOURCE 0
/**
* Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
@@ -388,17 +400,17 @@ typedef enum
* keep debugger enabled while in any low power mode when set to 1
* should be set to 0 in production
*/
-#define CFG_DEBUGGER_SUPPORTED 0
+#define CFG_DEBUGGER_SUPPORTED 1
/**
* When set to 1, the traces are enabled in the BLE services
*/
-#define CFG_DEBUG_BLE_TRACE 0
+#define CFG_DEBUG_BLE_TRACE 1
/**
* Enable or Disable traces in application
*/
-#define CFG_DEBUG_APP_TRACE 0
+#define CFG_DEBUG_APP_TRACE 1
#if (CFG_DEBUG_APP_TRACE != 0)
#define APP_DBG_MSG PRINT_MESG_DBG
@@ -471,6 +483,8 @@ typedef enum
CFG_TASK_ADV_UPDATE_ID,
CFG_TASK_HCI_ASYNCH_EVT_ID,
CFG_TASK_MESH_REQ_ID,
+ CFG_TASK_MESH_BEACON_REQ_ID,
+ CFG_TASK_MESH_UART_RX_REQ_ID,
CFG_LAST_TASK_ID_WITH_HCICMD, /**< Shall be LAST in the list */
} CFG_Task_Id_With_HCI_Cmd_t;
@@ -515,7 +529,7 @@ typedef enum
typedef enum
{
CFG_LPM_APP,
- CFG_LPM_APP_BLE,
+ CFG_LPM_APP_BLE
} CFG_LPM_Id_t;
/******************************************************************************
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/stm32_lpm_if.h
index 38e326512..d8e67947f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/stm32_lpm_if.h
@@ -1,46 +1,22 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file stm32_lpm_if.h
-* @brief Header for stm32_lpm_f.c module (device specific LP management)
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
******************************************************************************
* @attention
*
-* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics International N.V.
+* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted, provided that the following conditions are met:
-*
-* 1. Redistribution of source code must retain the above copyright notice,
-* this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following disclaimer in the documentation
-* and/or other materials provided with the distribution.
-* 3. Neither the name of STMicroelectronics nor the names of other
-* contributors to this software may be used to endorse or promote products
-* derived from this software without specific written permission.
-* 4. This software, including modifications and/or derivative works of this
-* software, must execute solely and exclusively on microcontroller or
-* microprocessor devices manufactured by or for STMicroelectronics.
-* 5. Redistribution and use of this software other than as permitted under
-* this license is void and will automatically terminate your rights under
-* this license.
-*
-* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
-* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
-* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+* This software component is licensed by ST under BSD 3-Clause license,
+* the "License"; You may not use this file except in compliance with the
+* License. You may obtain a copy of the License at:
+* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32_LPM_IF_H
@@ -89,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/stm32wbxx_hal_conf.h
index 6f505b24b..0270583e8 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/stm32wbxx_hal_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/stm32wbxx_hal_conf.h
@@ -219,6 +219,10 @@
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32wbxx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32wbxx_hal_flash.h"
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/stm32wbxx_it.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/stm32wbxx_it.h
index fdc1b1aef..06d41fa17 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/stm32wbxx_it.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/stm32wbxx_it.h
@@ -53,6 +53,10 @@ void RTC_WKUP_IRQHandler(void);
void IPCC_C1_TX_IRQHandler(void);
void IPCC_C1_RX_IRQHandler(void);
+void POWEROFF_EXTI_IRQHandler(void);
+void TIM2_IRQHandler(void);
+void TIM1_CC_IRQHandler(void);
+
#ifdef __cplusplus
}
#endif
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/utilities_conf.h
index c98d97ba1..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/utilities_conf.h
@@ -1,3 +1,4 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* File Name : utilities_conf.h
@@ -9,13 +10,14 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef UTILITIES_CONF_H
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Src/app_entry.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Src/app_entry.c
index 3a10d98c9..7655d360c 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Src/app_entry.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Src/app_entry.c
@@ -33,6 +33,8 @@
#include "app_debug.h"
+#include "appli_mesh.h"
+
/* Private includes -----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
@@ -40,6 +42,12 @@
/* Private typedef -----------------------------------------------------------*/
extern RTC_HandleTypeDef hrtc;
+#ifdef SAVE_MODEL_STATE_POWER_FAILURE_DETECTION
+extern MOBLEUINT8 PowerOnOff_flag;
+#endif
+#ifdef ENABLE_OCCUPANCY_SENSOR
+extern MOBLEUINT8 Occupancy_Flag;
+#endif
/* USER CODE BEGIN PTD */
/* USER CODE END PTD */
@@ -103,12 +111,14 @@ void APPE_Init( void )
Led_Init();
Button_Init();
+
+
/* USER CODE END APPE_Init_1 */
appe_Tl_Init(); /* Initialize all transport layers */
/**
* From now, the application is waiting for the ready event ( VS_HCI_C2_Ready )
- * received on the system channel before starting the BLE Stack
+ * received on the system channel before starting the Stack
* This system event is received with APPE_SysUserEvtRx()
*/
/* USER CODE BEGIN APPE_Init_2 */
@@ -195,7 +205,7 @@ static void APPE_SysUserEvtRx( void * pPayload )
APPD_EnableCPU2( );
APP_BLE_Init( );
- UTIL_LPM_SetOffMode(1 << CFG_LPM_APP, UTIL_LPM_ENABLE);
+ UTIL_LPM_SetOffMode(1U << CFG_LPM_APP, UTIL_LPM_ENABLE);
return;
}
@@ -223,6 +233,7 @@ static void Button_Init( void )
*/
BSP_PB_Init(BUTTON_SW1, BUTTON_MODE_EXTI);
+ BSP_PB_Init(BUTTON_SW2, BUTTON_MODE_EXTI);
#endif
return;
@@ -278,8 +289,21 @@ void HAL_GPIO_EXTI_Callback( uint16_t GPIO_Pin )
{
switch (GPIO_Pin)
{
- case BUTTON_SW1_PIN:
+#ifdef SAVE_MODEL_STATE_POWER_FAILURE_DETECTION
+ case POWEROFF_PIN:
+ {
+ PowerOnOff_flag = 1;
+ }
break;
+#endif
+
+#ifdef ENABLE_OCCUPANCY_SENSOR
+ case BUTTON_SW2_PIN:
+ {
+ Occupancy_Flag = 1;
+ }
+ break;
+#endif
default:
break;
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Src/hw_timerserver.c
index 52a1bfa0d..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Src/hw_timerserver.c
@@ -1,22 +1,21 @@
/**
******************************************************************************
- * File Name : hw_timerserver.c
- * Description : Hardware timerserver source file for BLE
- * middleWare.
+ * File Name : hw_timerserver.c
+ * Description : Hardware timerserver source file for STM32WPAN Middleware.
+ *
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Src/main.c
index 0b70db150..ec1faf587 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Src/main.c
@@ -58,6 +58,8 @@
/* Private macros ------------------------------------------------------------*/
/* Global variables ---------------------------------------------------------*/
RTC_HandleTypeDef hrtc = { 0 }; /**< RTC handler declaration */
+TIM_HandleTypeDef htim1 = { 0 };
+TIM_HandleTypeDef htim2 = { 0 };
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
@@ -89,34 +91,10 @@ int main( void )
Init_Exti( );
- /* Enable CRC clock */
- __HAL_RCC_CRC_CLK_ENABLE();
-
Init_RTC();
- // Enable SMPS supply
- RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
- PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_SMPS ;
- PeriphClkInit.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSI;
- PeriphClkInit.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE1;
-
- HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit);
-
- SET_BIT(PWR->CR5, PWR_CR5_SMPSVOS_2 | PWR_CR5_SMPSVOS_0); /*Nucleo QFN68 Cut2.1 nb00920*/
- CLEAR_BIT(PWR->CR5, PWR_CR5_SMPSVOS_3 | PWR_CR5_SMPSVOS_1);
- SET_BIT(PWR->CR5, PWR_CR5_SMPSEN);
-
- // CPU 1 and 2 at 32 Mz - Clk source HSE without PLL
- RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
- RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK;
- RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSE;
- RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
- RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
- RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
- RCC_ClkInitStruct.AHBCLK2Divider = RCC_SYSCLK_DIV1;
- RCC_ClkInitStruct.AHBCLK4Divider = RCC_SYSCLK_DIV1;
-
- HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2);
+ /* Enable CRC clock */
+ __HAL_RCC_CRC_CLK_ENABLE();
APPE_Init( );
@@ -230,7 +208,13 @@ static void Init_RTC( void )
hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
HAL_RTC_Init(&hrtc);
- MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* Disable RTC registers write protection */
+ LL_RTC_DisableWriteProtection(RTC);
+
+ LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER);
+
+ /* Enable RTC registers write protection */
+ LL_RTC_EnableWriteProtection(RTC);
return;
}
@@ -253,6 +237,12 @@ void SystemClock_Config( void )
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -303,19 +293,6 @@ void SystemClock_Config( void )
*/
LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
@@ -324,5 +301,33 @@ void SystemClock_Config( void )
* WRAP FUNCTIONS
*
*************************************************************/
+void HAL_Delay(uint32_t Delay)
+{
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
+
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
+}
/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Src/stm32wbxx_it.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Src/stm32wbxx_it.c
index dad4055ca..8120bda4a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Src/stm32wbxx_it.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/Core/Src/stm32wbxx_it.c
@@ -23,11 +23,15 @@
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
#include "stm32wbxx_it.h"
+#include "appli_mesh.h"
+#include "PWM_handlers.h"
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
+extern TIM_HandleTypeDef htim1;
+extern TIM_HandleTypeDef htim2;
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
@@ -138,6 +142,19 @@ void PUSH_BUTTON_SW3_EXTI_IRQHandler(void)
HAL_GPIO_EXTI_IRQHandler(BUTTON_SW3_PIN);
}
+#ifdef SAVE_MODEL_STATE_POWER_FAILURE_DETECTION
+/**
+ * @brief This function handles External line
+ * interrupt request.
+ * @param None
+ * @retval None
+ */
+void POWEROFF_EXTI_IRQHandler(void)
+{
+ HAL_GPIO_EXTI_IRQHandler(POWEROFF_PIN);
+}
+#endif
+
#if(CFG_HW_USART1_ENABLED == 1)
void USART1_IRQHandler(void)
{
@@ -184,6 +201,33 @@ void IPCC_C1_RX_IRQHandler(void)
return;
}
+/**
+ * @brief This function handles TIM2 global interrupt.
+ */
+void TIM2_IRQHandler(void)
+{
+ /* USER CODE BEGIN TIM2_IRQn 0 */
+
+ /* USER CODE END TIM2_IRQn 0 */
+ HAL_TIM_IRQHandler(&htim2);
+ /* USER CODE BEGIN TIM2_IRQn 1 */
+
+ /* USER CODE END TIM2_IRQn 1 */
+}
+
+/**
+ * @brief This function handles TIM1 global interrupt.
+ */
+void TIM1_CC_IRQHandler(void)
+{
+ /* USER CODE BEGIN TIM1_IRQn 0 */
+
+ /* USER CODE END TIM1_IRQn 0 */
+ HAL_TIM_IRQHandler(&htim1);
+ /* USER CODE BEGIN TIM1_IRQn 1 */
+
+ /* USER CODE END TIM1_IRQn 1 */
+}
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/EWARM/BLE_MeshLightingDemo.ewp b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/EWARM/BLE_MeshLightingDemo.ewp
index c564db39e..b1726412f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/EWARM/BLE_MeshLightingDemo.ewp
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/EWARM/BLE_MeshLightingDemo.ewp
@@ -121,7 +121,7 @@
</option>
<option>
<name>OGUseCmsis</name>
- <state>1</state>
+ <state>0</state>
</option>
<option>
<name>OGUseCmsisDspLib</name>
@@ -221,7 +221,7 @@
<state>CORE_CM4</state>
<state>STM32</state>
<state>ENABLE_USART</state>
- <state>DISABLE_TRACES</state>
+ <state>TRACE_ENABLE_NO_FUNCTION</state>
</option>
<option>
<name>CCPreprocFile</name>
@@ -387,7 +387,7 @@
<option>
<name>CCOptStrategy</name>
<version>0</version>
- <state>2</state>
+ <state>1</state>
</option>
<option>
<name>CCOptLevelSlave</name>
@@ -454,7 +454,7 @@
<option>
<name>CCOptStrategySlave</name>
<version>0</version>
- <state>2</state>
+ <state>1</state>
</option>
<option>
<name>CCGuardCalls</name>
@@ -1097,9 +1097,15 @@
<name>$PROJ_DIR$\..\STM32_WPAN\app\appli_light.c</name>
</file>
<file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\app\appli_light_lc.c</name>
+ </file>
+ <file>
<name>$PROJ_DIR$\..\STM32_WPAN\app\appli_mesh.c</name>
</file>
<file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\app\appli_nvm.c</name>
+ </file>
+ <file>
<name>$PROJ_DIR$\..\STM32_WPAN\app\appli_sensor.c</name>
</file>
<file>
@@ -1108,6 +1114,15 @@
<file>
<name>$PROJ_DIR$\..\STM32_WPAN\app\models_if.c</name>
</file>
+ <file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\app\pal_nvm.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\app\PWM_config.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\app\PWM_handlers.c</name>
+ </file>
</group>
<group>
<name>target</name>
@@ -1185,6 +1200,12 @@
<name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rtc_ex.c</name>
</file>
<file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_tim.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_tim_ex.c</name>
+ </file>
+ <file>
<name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_uart.c</name>
</file>
<file>
@@ -1210,13 +1231,13 @@
<name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\mesh\MeshModel\Src\light.c</name>
</file>
<file>
- <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\svc\Src\mesh.c</name>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\mesh\MeshModel\Src\light_lc.c</name>
</file>
<file>
- <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\mesh\Src\mesh_cfg.c</name>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\svc\Src\mesh.c</name>
</file>
<file>
- <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\mesh\PAL\STM32WB\pal_nvm.c</name>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\mesh\Src\mesh_cfg.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\mesh\MeshModel\Src\sensors.c</name>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/EWARM/stm32wb55xx_flash_cm4.icf b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/EWARM/stm32wb55xx_flash_cm4.icf
index e06ae25d2..8c55c2b77 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/EWARM/stm32wb55xx_flash_cm4.icf
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/EWARM/stm32wb55xx_flash_cm4.icf
@@ -17,12 +17,8 @@ define symbol __ICFEDIT_size_heap__ = 0x400;
define symbol __ICFEDIT_region_RAM_SHARED_start__ = 0x20030000;
define symbol __ICFEDIT_region_RAM_SHARED_end__ = 0x200327FF;
-define symbol __PROGRAM_END__ = __ICFEDIT_region_ROM_end__ - 0x2000;
-define symbol __CONFIGURATION_START__ = __PROGRAM_END__ + 1;
-
define memory mem with size = 4G;
-
-define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __PROGRAM_END__];
+define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
define region RAM_SHARED_region = mem:[from __ICFEDIT_region_RAM_SHARED_start__ to __ICFEDIT_region_RAM_SHARED_end__];
@@ -30,27 +26,15 @@ define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
/* MB_MEM1 and MB_MEM2 are sections reserved to mailbox communication. It is placed in the shared memory */
-initialize by copy { readwrite, section .ops };
+initialize by copy { readwrite };
do not initialize { section .noinit,
section MAPPING_TABLE,
section MB_MEM1 };
-initialize manually { section .wow };
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
place in ROM_region { readonly };
-define block WOW with fixed order
-{
- section wow_start_mark,
- section .wow,
- section wow_end_mark
-};
-place in RAM_region { readwrite, block WOW,
- block CSTACK, block HEAP };
-place at address mem:__CONFIGURATION_START__ { readonly section .appconfig };
-define symbol _bdaddr = __CONFIGURATION_START__;
-export symbol _bdaddr;
-
+place in RAM_region { readwrite,block CSTACK, block HEAP };
place in RAM_SHARED_region { first section MAPPING_TABLE};
place in RAM_SHARED_region { section MB_MEM1};
place in RAM_SHARED_region { section MB_MEM2};
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/MDK-ARM/BLE_MeshLightingDemo.uvoptx b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/MDK-ARM/BLE_MeshLightingDemo.uvoptx
index b3c154be8..455c240a8 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/MDK-ARM/BLE_MeshLightingDemo.uvoptx
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/MDK-ARM/BLE_MeshLightingDemo.uvoptx
@@ -26,7 +26,7 @@
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<TargetOption>
- <CLKADS>8000000</CLKADS>
+ <CLKADS>12000000</CLKADS>
<OPTTT>
<gFlags>1</gFlags>
<BeepAtEnd>1</BeepAtEnd>
@@ -77,7 +77,7 @@
<tvExpOptDlg>0</tvExpOptDlg>
<IsCurrentTarget>1</IsCurrentTarget>
</OPTFL>
- <CpuCode>0</CpuCode>
+ <CpuCode>18</CpuCode>
<DebugOpt>
<uSim>0</uSim>
<uTrg>1</uTrg>
@@ -95,7 +95,7 @@
<tRmem>1</tRmem>
<tRfunc>1</tRfunc>
<tRbox>1</tRbox>
- <tRtrace>0</tRtrace>
+ <tRtrace>1</tRtrace>
<sRSysVw>1</sRSysVw>
<tRSysVw>1</tRSysVw>
<sRunDeb>0</sRunDeb>
@@ -103,7 +103,7 @@
<bEvRecOn>1</bEvRecOn>
<bSchkAxf>0</bSchkAxf>
<bTchkAxf>0</bTchkAxf>
- <nTsel>6</nTsel>
+ <nTsel>0</nTsel>
<sDll></sDll>
<sDllPa></sDllPa>
<sDlgDll></sDlgDll>
@@ -114,18 +114,18 @@
<tDlgDll></tDlgDll>
<tDlgPa></tDlgPa>
<tIfile></tIfile>
- <pMon>STLink\ST-LINKIII-KEIL_SWO.dll</pMon>
+ <pMon>BIN\UL2CM3.DLL</pMon>
</DebugOpt>
<TargetDriverDllRegistry>
<SetRegEntry>
<Number>0</Number>
<Key>UL2CM3</Key>
- <Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32WB_M4 -FS08000000 -FL0100000 -FP0($$Device:STM32WB55RG$CMSIS\Flash\STM32WB_M4.FLM))</Name>
+ <Name>UL2CM3(-S0 -C0 -P0 ) -FN1 -FC1000 -FD20000000 -FF0STM32WB_M4 -FL01000000 -FS08000000 -FP0($$Device:STM32WB55RGVx$CMSIS\Flash\STM32WB_M4.FLM)</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>ST-LINKIII-KEIL_SWO</Key>
- <Name></Name>
+ <Name>-U-O142 -O2254 -S0 -C0 -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC1000 -FN1 -FF0STM32WB_M4.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32WB55RGVx$CMSIS\Flash\STM32WB_M4.FLM)</Name>
</SetRegEntry>
</TargetDriverDllRegistry>
<Breakpoint/>
@@ -176,7 +176,7 @@
<Group>
<GroupName>Application/Core</GroupName>
- <tvExp>0</tvExp>
+ <tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@@ -268,7 +268,7 @@
<Group>
<GroupName>Application/MDK-ARM</GroupName>
- <tvExp>0</tvExp>
+ <tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@@ -288,7 +288,7 @@
<Group>
<GroupName>Application/STM32_WPAN/app</GroupName>
- <tvExp>0</tvExp>
+ <tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@@ -335,6 +335,18 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
+ <PathWithFileName>../STM32_WPAN/app/appli_light_lc.c</PathWithFileName>
+ <FilenameWithoutPath>appli_light_lc.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>3</GroupNumber>
+ <FileNumber>13</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
<PathWithFileName>../STM32_WPAN/app/appli_mesh.c</PathWithFileName>
<FilenameWithoutPath>appli_mesh.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
@@ -342,7 +354,19 @@
</File>
<File>
<GroupNumber>3</GroupNumber>
- <FileNumber>13</FileNumber>
+ <FileNumber>14</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../STM32_WPAN/app/appli_nvm.c</PathWithFileName>
+ <FilenameWithoutPath>appli_nvm.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>3</GroupNumber>
+ <FileNumber>15</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -354,7 +378,7 @@
</File>
<File>
<GroupNumber>3</GroupNumber>
- <FileNumber>14</FileNumber>
+ <FileNumber>16</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -366,7 +390,7 @@
</File>
<File>
<GroupNumber>3</GroupNumber>
- <FileNumber>15</FileNumber>
+ <FileNumber>17</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -376,17 +400,53 @@
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
+ <File>
+ <GroupNumber>3</GroupNumber>
+ <FileNumber>18</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../STM32_WPAN/app/pal_nvm.c</PathWithFileName>
+ <FilenameWithoutPath>pal_nvm.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>3</GroupNumber>
+ <FileNumber>19</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../STM32_WPAN/app/PWM_config.c</PathWithFileName>
+ <FilenameWithoutPath>PWM_config.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>3</GroupNumber>
+ <FileNumber>20</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../STM32_WPAN/app/PWM_handlers.c</PathWithFileName>
+ <FilenameWithoutPath>PWM_handlers.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
</Group>
<Group>
<GroupName>Application/STM32_WPAN/target</GroupName>
- <tvExp>0</tvExp>
+ <tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>4</GroupNumber>
- <FileNumber>16</FileNumber>
+ <FileNumber>21</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -406,7 +466,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>5</GroupNumber>
- <FileNumber>17</FileNumber>
+ <FileNumber>22</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -420,13 +480,13 @@
<Group>
<GroupName>Drivers/BSP/P-NUCLEO-WB55.Nucleo</GroupName>
- <tvExp>0</tvExp>
+ <tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>6</GroupNumber>
- <FileNumber>18</FileNumber>
+ <FileNumber>23</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -440,13 +500,13 @@
<Group>
<GroupName>Drivers/CMSIS</GroupName>
- <tvExp>0</tvExp>
+ <tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>7</GroupNumber>
- <FileNumber>19</FileNumber>
+ <FileNumber>24</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -460,13 +520,13 @@
<Group>
<GroupName>Drivers/STM32WBxx_HAL_Driver</GroupName>
- <tvExp>0</tvExp>
+ <tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>20</FileNumber>
+ <FileNumber>25</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -478,7 +538,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>21</FileNumber>
+ <FileNumber>26</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -490,7 +550,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>22</FileNumber>
+ <FileNumber>27</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -502,7 +562,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>23</FileNumber>
+ <FileNumber>28</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -514,7 +574,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>24</FileNumber>
+ <FileNumber>29</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -526,7 +586,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>25</FileNumber>
+ <FileNumber>30</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -538,7 +598,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>26</FileNumber>
+ <FileNumber>31</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -550,7 +610,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>27</FileNumber>
+ <FileNumber>32</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -562,7 +622,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>28</FileNumber>
+ <FileNumber>33</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -574,7 +634,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>29</FileNumber>
+ <FileNumber>34</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -586,7 +646,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>30</FileNumber>
+ <FileNumber>35</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -598,7 +658,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>31</FileNumber>
+ <FileNumber>36</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -610,7 +670,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>32</FileNumber>
+ <FileNumber>37</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -622,7 +682,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>33</FileNumber>
+ <FileNumber>38</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -634,7 +694,31 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>34</FileNumber>
+ <FileNumber>39</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_tim.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_tim.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>8</GroupNumber>
+ <FileNumber>40</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_tim_ex.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_tim_ex.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>8</GroupNumber>
+ <FileNumber>41</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -646,7 +730,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>35</FileNumber>
+ <FileNumber>42</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -660,13 +744,13 @@
<Group>
<GroupName>Middlewares/STM32_WPAN/ble/blesvc</GroupName>
- <tvExp>0</tvExp>
+ <tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>9</GroupNumber>
- <FileNumber>36</FileNumber>
+ <FileNumber>43</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -678,7 +762,7 @@
</File>
<File>
<GroupNumber>9</GroupNumber>
- <FileNumber>37</FileNumber>
+ <FileNumber>44</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -690,7 +774,7 @@
</File>
<File>
<GroupNumber>9</GroupNumber>
- <FileNumber>38</FileNumber>
+ <FileNumber>45</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -702,43 +786,43 @@
</File>
<File>
<GroupNumber>9</GroupNumber>
- <FileNumber>39</FileNumber>
+ <FileNumber>46</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/svc/Src/mesh.c</PathWithFileName>
- <FilenameWithoutPath>mesh.c</FilenameWithoutPath>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/light_lc.c</PathWithFileName>
+ <FilenameWithoutPath>light_lc.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>9</GroupNumber>
- <FileNumber>40</FileNumber>
+ <FileNumber>47</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/mesh/Src/mesh_cfg.c</PathWithFileName>
- <FilenameWithoutPath>mesh_cfg.c</FilenameWithoutPath>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/svc/Src/mesh.c</PathWithFileName>
+ <FilenameWithoutPath>mesh.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>9</GroupNumber>
- <FileNumber>41</FileNumber>
+ <FileNumber>48</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/mesh/PAL/STM32WB/pal_nvm.c</PathWithFileName>
- <FilenameWithoutPath>pal_nvm.c</FilenameWithoutPath>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/mesh/Src/mesh_cfg.c</PathWithFileName>
+ <FilenameWithoutPath>mesh_cfg.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>9</GroupNumber>
- <FileNumber>42</FileNumber>
+ <FileNumber>49</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -750,7 +834,7 @@
</File>
<File>
<GroupNumber>9</GroupNumber>
- <FileNumber>43</FileNumber>
+ <FileNumber>50</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -762,7 +846,7 @@
</File>
<File>
<GroupNumber>9</GroupNumber>
- <FileNumber>44</FileNumber>
+ <FileNumber>51</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -774,7 +858,7 @@
</File>
<File>
<GroupNumber>9</GroupNumber>
- <FileNumber>45</FileNumber>
+ <FileNumber>52</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -788,13 +872,13 @@
<Group>
<GroupName>Middlewares/STM32_WPAN/ble/core</GroupName>
- <tvExp>0</tvExp>
+ <tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>10</GroupNumber>
- <FileNumber>46</FileNumber>
+ <FileNumber>53</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -806,7 +890,7 @@
</File>
<File>
<GroupNumber>10</GroupNumber>
- <FileNumber>47</FileNumber>
+ <FileNumber>54</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -818,7 +902,7 @@
</File>
<File>
<GroupNumber>10</GroupNumber>
- <FileNumber>48</FileNumber>
+ <FileNumber>55</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -830,7 +914,7 @@
</File>
<File>
<GroupNumber>10</GroupNumber>
- <FileNumber>49</FileNumber>
+ <FileNumber>56</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -842,7 +926,7 @@
</File>
<File>
<GroupNumber>10</GroupNumber>
- <FileNumber>50</FileNumber>
+ <FileNumber>57</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -854,7 +938,7 @@
</File>
<File>
<GroupNumber>10</GroupNumber>
- <FileNumber>51</FileNumber>
+ <FileNumber>58</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -868,13 +952,13 @@
<Group>
<GroupName>Middlewares/STM32_WPAN/interface/patterns/ble_thread/shci</GroupName>
- <tvExp>0</tvExp>
+ <tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>11</GroupNumber>
- <FileNumber>52</FileNumber>
+ <FileNumber>59</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -888,13 +972,13 @@
<Group>
<GroupName>Middlewares/STM32_WPAN/interface/patterns/ble_thread/tl</GroupName>
- <tvExp>0</tvExp>
+ <tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>12</GroupNumber>
- <FileNumber>53</FileNumber>
+ <FileNumber>60</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -906,7 +990,7 @@
</File>
<File>
<GroupNumber>12</GroupNumber>
- <FileNumber>54</FileNumber>
+ <FileNumber>61</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -918,7 +1002,7 @@
</File>
<File>
<GroupNumber>12</GroupNumber>
- <FileNumber>55</FileNumber>
+ <FileNumber>62</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -930,7 +1014,7 @@
</File>
<File>
<GroupNumber>12</GroupNumber>
- <FileNumber>56</FileNumber>
+ <FileNumber>63</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -942,7 +1026,7 @@
</File>
<File>
<GroupNumber>12</GroupNumber>
- <FileNumber>57</FileNumber>
+ <FileNumber>64</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -956,13 +1040,13 @@
<Group>
<GroupName>Middlewares/STM32_WPAN/utilities</GroupName>
- <tvExp>0</tvExp>
+ <tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>13</GroupNumber>
- <FileNumber>58</FileNumber>
+ <FileNumber>65</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -974,7 +1058,7 @@
</File>
<File>
<GroupNumber>13</GroupNumber>
- <FileNumber>59</FileNumber>
+ <FileNumber>66</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -986,7 +1070,7 @@
</File>
<File>
<GroupNumber>13</GroupNumber>
- <FileNumber>60</FileNumber>
+ <FileNumber>67</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -998,7 +1082,7 @@
</File>
<File>
<GroupNumber>13</GroupNumber>
- <FileNumber>61</FileNumber>
+ <FileNumber>68</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -1010,7 +1094,7 @@
</File>
<File>
<GroupNumber>13</GroupNumber>
- <FileNumber>62</FileNumber>
+ <FileNumber>69</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -1022,7 +1106,7 @@
</File>
<File>
<GroupNumber>13</GroupNumber>
- <FileNumber>63</FileNumber>
+ <FileNumber>70</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -1036,13 +1120,13 @@
<Group>
<GroupName>Middlewares/ST/STM32_WPAN/ble/mesh/Library</GroupName>
- <tvExp>0</tvExp>
+ <tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>14</GroupNumber>
- <FileNumber>64</FileNumber>
+ <FileNumber>71</FileNumber>
<FileType>4</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -1056,13 +1140,13 @@
<Group>
<GroupName>Middlewares/ST/STM32_WPAN/ble/cryptographic/Lib</GroupName>
- <tvExp>0</tvExp>
+ <tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>15</GroupNumber>
- <FileNumber>65</FileNumber>
+ <FileNumber>72</FileNumber>
<FileType>4</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -1074,4 +1158,12 @@
</File>
</Group>
+ <Group>
+ <GroupName>::CMSIS</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>1</RteFlg>
+ </Group>
+
</ProjectOpt>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/MDK-ARM/BLE_MeshLightingDemo.uvprojx b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/MDK-ARM/BLE_MeshLightingDemo.uvprojx
index c6cdbfb7f..d035661f3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/MDK-ARM/BLE_MeshLightingDemo.uvprojx
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/MDK-ARM/BLE_MeshLightingDemo.uvprojx
@@ -14,16 +14,16 @@
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>
- <Device>STM32WB55RG</Device>
+ <Device>STM32WB55RGVx</Device>
<Vendor>STMicroelectronics</Vendor>
- <PackID>Keil.STM32WBxx.0.0.7</PackID>
+ <PackID>Keil.STM32WBxx_DFP.1.0.0</PackID>
<PackURL>http://www.keil.com/pack</PackURL>
- <Cpu>IROM(0x08000000-0x807FFFF) IRAM(0x20000004-0x2002FC03) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4")</Cpu>
+ <Cpu>IRAM(0x20000000,0x000040000) IROM(0x08000000,0x001000000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ESEL ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
<StartupFile></StartupFile>
- <FlashDriverDll></FlashDriverDll>
- <DeviceId></DeviceId>
- <RegisterFile></RegisterFile>
+ <FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32WB_M4 -FS08000000 -FL01000000 -FP0($$Device:STM32WB55RGVx$CMSIS\Flash\STM32WB_M4.FLM))</FlashDriverDll>
+ <DeviceId>0</DeviceId>
+ <RegisterFile>$$Device:STM32WB55RGVx$Drivers\CMSIS\Device\ST\STM32WBxx\Include\stm32wbxx.h</RegisterFile>
<MemoryEnv></MemoryEnv>
<Cmp></Cmp>
<Asm></Asm>
@@ -33,7 +33,7 @@
<SLE66CMisc></SLE66CMisc>
<SLE66AMisc></SLE66AMisc>
<SLE66LinkerMisc></SLE66LinkerMisc>
- <SFDFile>$$Device:STM32WB55RGVx$CMSIS\SVD\STM32WB55_CM4.svd</SFDFile>
+ <SFDFile>$$Device:STM32WB55RGVx$CMSIS\SVD\STM32WBxx_CM4.svd</SFDFile>
<bCustSvd>0</bCustSvd>
<UseEnv>0</UseEnv>
<BinPath></BinPath>
@@ -53,7 +53,7 @@
<CreateExecutable>1</CreateExecutable>
<CreateLib>0</CreateLib>
<CreateHexFile>0</CreateHexFile>
- <DebugInformation>1</DebugInformation>
+ <DebugInformation>0</DebugInformation>
<BrowseInformation>1</BrowseInformation>
<ListingPath></ListingPath>
<HexFormatSelection>1</HexFormatSelection>
@@ -106,15 +106,15 @@
<StopOnExitCode>3</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
- <ComprImg>1</ComprImg>
+ <ComprImg>0</ComprImg>
</CommonProperty>
<DllOption>
<SimDllName>SARMCM3.DLL</SimDllName>
- <SimDllArguments>-REMAP -MPU</SimDllArguments>
+ <SimDllArguments> -REMAP -MPU</SimDllArguments>
<SimDlgDll>DCM.DLL</SimDlgDll>
<SimDlgDllArguments>-pCM4</SimDlgDllArguments>
<TargetDllName>SARMCM3.DLL</TargetDllName>
- <TargetDllArguments>-MPU</TargetDllArguments>
+ <TargetDllArguments> -MPU</TargetDllArguments>
<TargetDlgDll>TCM.DLL</TargetDlgDll>
<TargetDlgDllArguments>-pCM4</TargetDlgDllArguments>
</DllOption>
@@ -134,11 +134,11 @@
<RunIndependent>0</RunIndependent>
<UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
<Capability>1</Capability>
- <DriverSelection>4107</DriverSelection>
+ <DriverSelection>4101</DriverSelection>
</Flash1>
<bUseTDR>1</bUseTDR>
- <Flash2>STLink\ST-LINKIII-KEIL_SWO.dll</Flash2>
- <Flash3>"" ()</Flash3>
+ <Flash2>BIN\UL2CM3.DLL</Flash2>
+ <Flash3></Flash3>
<Flash4></Flash4>
<pFcarmOut></pFcarmOut>
<pFcarmGrp></pFcarmGrp>
@@ -184,11 +184,12 @@
<hadXRAM>0</hadXRAM>
<uocXRam>0</uocXRam>
<RvdsVP>2</RvdsVP>
+ <RvdsMve>0</RvdsMve>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
<useUlib>1</useUlib>
- <EndSel>0</EndSel>
+ <EndSel>1</EndSel>
<uLtcg>0</uLtcg>
<nSecure>0</nSecure>
<RoSelD>3</RoSelD>
@@ -243,13 +244,13 @@
</Ocm6>
<IRAM>
<Type>0</Type>
- <StartAddress>0x20000004</StartAddress>
- <Size>0x2fc00</Size>
+ <StartAddress>0x20000000</StartAddress>
+ <Size>0x40000</Size>
</IRAM>
<IROM>
<Type>1</Type>
<StartAddress>0x8000000</StartAddress>
- <Size>0x80000</Size>
+ <Size>0x1000000</Size>
</IROM>
<XRAM>
<Type>0</Type>
@@ -274,7 +275,7 @@
<OCR_RVCT4>
<Type>1</Type>
<StartAddress>0x8000000</StartAddress>
- <Size>0x80000</Size>
+ <Size>0x1000000</Size>
</OCR_RVCT4>
<OCR_RVCT5>
<Type>1</Type>
@@ -312,7 +313,7 @@
<Cads>
<interw>1</interw>
<Optim>4</Optim>
- <oTime>1</oTime>
+ <oTime>0</oTime>
<SplitLS>0</SplitLS>
<OneElfS>1</OneElfS>
<Strict>0</Strict>
@@ -335,7 +336,7 @@
<v6Rtti>0</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
- <Define>USE_STM32WBXX_NUCLEO,STM32WB55xx,USE_HAL_DRIVER,CORE_CM4,STM32,ENABLE_USART,DISABLE_TRACES</Define>
+ <Define>USE_STM32WBXX_NUCLEO,STM32WB55xx,USE_HAL_DRIVER,CORE_CM4,STM32,ENABLE_USART,TRACE_ENABLE_NO_FUNCTION</Define>
<Undefine></Undefine>
<IncludePath>../../../../../../Drivers/CMSIS/Device/ST/STM32WBxx/Include;../../../../../../Drivers/CMSIS/Include;../../../../../../Drivers/STM32WBxx_HAL_Driver/Inc;../../../../../../Drivers/BSP/P-NUCLEO-WB55.Nucleo;../../../../../../Middlewares/ST/STM32_WPAN/ble/mesh/Inc;../Core/Inc;../../../../../../Middlewares/ST/STM32_WPAN;../../../../../../Middlewares/ST/STM32_WPAN/ble/core/auto;../../../../../../Middlewares/ST/STM32_WPAN/utilities;../../../../../../Utilities/lpm/tiny_lpm;../../../../../../Utilities/sequencer;../../../../../../Middlewares/ST/STM32_WPAN/ble/core/template;../../../../../../Middlewares/ST/STM32_WPAN/ble/core/;../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl;../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci;../../../../../../Drivers/BSP/P-NUCLEO-WB55.Nucleo;../../../../../../Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc;../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread;../STM32_WPAN/app;../../../../../../Middlewares/ST/STM32_WPAN/ble;../../../../../../Middlewares/ST/STM32_WPAN/ble/core/Inc</IncludePath>
</VariousControls>
@@ -368,10 +369,10 @@
<TextAddressRange>0x08000000</TextAddressRange>
<DataAddressRange>0x20000000</DataAddressRange>
<pXoBase></pXoBase>
- <ScatterFile>.\stm32wb55xx_flash_cm4.sct</ScatterFile>
+ <ScatterFile>stm32wb55xx_flash_cm4.sct</ScatterFile>
<IncludeLibs></IncludeLibs>
<IncludeLibsPath></IncludeLibsPath>
- <Misc>--diag_suppress=L6329</Misc>
+ <Misc></Misc>
<LinkerInputFile></LinkerInputFile>
<DisabledWarnings></DisabledWarnings>
</LDads>
@@ -447,11 +448,21 @@
<FilePath>../STM32_WPAN/app/appli_light.c</FilePath>
</File>
<File>
+ <FileName>appli_light_lc.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../STM32_WPAN/app/appli_light_lc.c</FilePath>
+ </File>
+ <File>
<FileName>appli_mesh.c</FileName>
<FileType>1</FileType>
<FilePath>../STM32_WPAN/app/appli_mesh.c</FilePath>
</File>
<File>
+ <FileName>appli_nvm.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../STM32_WPAN/app/appli_nvm.c</FilePath>
+ </File>
+ <File>
<FileName>appli_sensor.c</FileName>
<FileType>1</FileType>
<FilePath>../STM32_WPAN/app/appli_sensor.c</FilePath>
@@ -466,6 +477,21 @@
<FileType>1</FileType>
<FilePath>../STM32_WPAN/app/models_if.c</FilePath>
</File>
+ <File>
+ <FileName>pal_nvm.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../STM32_WPAN/app/pal_nvm.c</FilePath>
+ </File>
+ <File>
+ <FileName>PWM_config.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../STM32_WPAN/app/PWM_config.c</FilePath>
+ </File>
+ <File>
+ <FileName>PWM_handlers.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../STM32_WPAN/app/PWM_handlers.c</FilePath>
+ </File>
</Files>
</Group>
<Group>
@@ -582,6 +608,16 @@
<FilePath>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rtc_ex.c</FilePath>
</File>
<File>
+ <FileName>stm32wbxx_hal_tim.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_tim.c</FilePath>
+ </File>
+ <File>
+ <FileName>stm32wbxx_hal_tim_ex.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_tim_ex.c</FilePath>
+ </File>
+ <File>
<FileName>stm32wbxx_hal_uart.c</FileName>
<FileType>1</FileType>
<FilePath>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_uart.c</FilePath>
@@ -612,6 +648,11 @@
<FilePath>../../../../../../Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/light.c</FilePath>
</File>
<File>
+ <FileName>light_lc.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/light_lc.c</FilePath>
+ </File>
+ <File>
<FileName>mesh.c</FileName>
<FileType>1</FileType>
<FilePath>../../../../../../Middlewares/ST/STM32_WPAN/ble/svc/Src/mesh.c</FilePath>
@@ -622,11 +663,6 @@
<FilePath>../../../../../../Middlewares/ST/STM32_WPAN/ble/mesh/Src/mesh_cfg.c</FilePath>
</File>
<File>
- <FileName>pal_nvm.c</FileName>
- <FileType>1</FileType>
- <FilePath>../../../../../../Middlewares/ST/STM32_WPAN/ble/mesh/PAL/STM32WB/pal_nvm.c</FilePath>
- </File>
- <File>
<FileName>sensors.c</FileName>
<FileType>1</FileType>
<FilePath>../../../../../../Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/sensors.c</FilePath>
@@ -778,13 +814,23 @@
</File>
</Files>
</Group>
+ <Group>
+ <GroupName>::CMSIS</GroupName>
+ </Group>
</Groups>
</Target>
</Targets>
<RTE>
<apis/>
- <components/>
+ <components>
+ <component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.1.2" condition="ARMv6_7_8-M Device">
+ <package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.4.0"/>
+ <targetInfos>
+ <targetInfo name="Production"/>
+ </targetInfos>
+ </component>
+ </components>
<files/>
</RTE>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/MDK-ARM/stm32wb55xx_flash_cm4.sct b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/MDK-ARM/stm32wb55xx_flash_cm4.sct
index 63845c07b..cf34d405e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/MDK-ARM/stm32wb55xx_flash_cm4.sct
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/MDK-ARM/stm32wb55xx_flash_cm4.sct
@@ -1,7 +1,6 @@
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
-
LR_IROM1 0x08000000 0x00080000 { ; load region size_region
ER_IROM1 0x08000000 0x00080000 { ; load address = execution address
*.o (RESET, +First)
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_config.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_config.c
new file mode 100644
index 000000000..e9b50f44e
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_config.c
@@ -0,0 +1,109 @@
+/**
+ *******************************************************************************
+ * @file PWM_config.c
+ * @author BLE Mesh Team
+ * @brief Configuration file for PWM.
+ *******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ *******************************************************************************
+*/
+
+/* Includes ------------------------------------------------------------------*/
+#include "hal_common.h"
+#include "PWM_config.h"
+
+extern TIM_HandleTypeDef htim1;
+extern TIM_HandleTypeDef htim2;
+
+#define PRESCALER_VALUE (uint32_t)(((SystemCoreClock) / 1000000) - 1)
+
+/**
+ *@brief Configure PWM sources and GPIO
+ *@retval None
+ */
+void PWM_Init()
+{
+ TIM_OC_InitTypeDef sConfigOC = {0};
+ TIM_MasterConfigTypeDef sMasterConfig = {0};
+
+ /* GPIO Configuration */
+ GPIO_InitTypeDef GPIO_InitStructure = {0};
+
+
+ /* Configure PWM pins */
+ GPIO_InitStructure.Pin = PWM0_PIN | PWM1_PIN;
+ GPIO_InitStructure.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStructure.Pull = GPIO_PULLUP;
+ GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
+ GPIO_InitStructure.Alternate = GPIO_AF1_TIM1;
+ HAL_GPIO_Init(GPIOD, &GPIO_InitStructure);
+
+ /* Configure PWM pins */
+ GPIO_InitStructure.Pin = PWM2_PIN | PWM3_PIN | PWM4_PIN;
+ GPIO_InitStructure.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStructure.Pull = GPIO_PULLUP;
+ GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
+ GPIO_InitStructure.Alternate = GPIO_AF1_TIM2;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStructure);
+
+ /* MFT Configuration */
+ HAL_NVIC_SetPriority((IRQn_Type)(TIM1_CC_IRQn), 15, 0);
+ HAL_NVIC_EnableIRQ((IRQn_Type)(TIM1_CC_IRQn));
+ HAL_NVIC_SetPriority((IRQn_Type)(TIM2_IRQn), 15, 0);
+ HAL_NVIC_EnableIRQ((IRQn_Type)(TIM2_IRQn));
+
+ htim1.Instance = TIM1;
+ htim1.Init.Prescaler = 0/*PRESCALER_VALUE*/;
+ htim1.Init.CounterMode = TIM_COUNTERMODE_UP;
+ htim1.Init.Period = TIME_PERIOD;
+ htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
+ htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
+ HAL_TIM_PWM_Init(&htim1);
+
+ htim2.Instance = TIM2;
+ htim2.Init.Prescaler = 0/*PRESCALER_VALUE*/;
+ htim2.Init.CounterMode = TIM_COUNTERMODE_UP;
+ htim2.Init.Period = TIME_PERIOD;
+ htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
+ htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
+ HAL_TIM_PWM_Init(&htim2);
+
+ sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
+ sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
+ HAL_TIMEx_MasterConfigSynchronization(&htim1, &sMasterConfig);
+ HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig);
+
+ sConfigOC.OCMode = TIM_OCMODE_PWM1;
+ sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH;
+ sConfigOC.OCFastMode = TIM_OCFAST_DISABLE;
+ sConfigOC.Pulse = MFT1_TON_1;
+ HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_1);
+ sConfigOC.Pulse = MFT2_TON_1;
+ HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_2);
+ sConfigOC.Pulse = MFT1_TON_2;
+ HAL_TIM_PWM_ConfigChannel(&htim2, &sConfigOC, TIM_CHANNEL_1);
+ sConfigOC.Pulse = MFT2_TON_2;
+ HAL_TIM_PWM_ConfigChannel(&htim2, &sConfigOC, TIM_CHANNEL_2);
+ sConfigOC.Pulse = MFT2_TON_3;
+ HAL_TIM_PWM_ConfigChannel(&htim2, &sConfigOC, TIM_CHANNEL_3);
+
+ /* Start channel 1 */
+ HAL_TIM_PWM_Start_IT(&htim1, TIM_CHANNEL_1);
+ /* Start channel 2 */
+ HAL_TIM_PWM_Start_IT(&htim1, TIM_CHANNEL_2);
+ /* Start channel 1 */
+ HAL_TIM_PWM_Start_IT(&htim2, TIM_CHANNEL_1);
+ /* Start channel 2 */
+ HAL_TIM_PWM_Start_IT(&htim2, TIM_CHANNEL_2);
+ /* Start channel 3 */
+ HAL_TIM_PWM_Start_IT(&htim2, TIM_CHANNEL_3);
+}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_config.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_config.h
new file mode 100644
index 000000000..a5e0e1075
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_config.h
@@ -0,0 +1,144 @@
+/******************** (C) COPYRIGHT 2015 STMicroelectronics ********************
+* File Name : PWM/PWM_config.c
+* Author : SNM Application Team
+* Version : V1.0.0
+* Date : September-2015
+* Description : Configuration file for PWM
+********************************************************************************
+* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
+* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
+* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
+* CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
+* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+*******************************************************************************/
+
+//#include "BlueNRG1_mft.h"
+#include "mesh_cfg_usr.h"
+
+/* Macros defined for the number of PWM Provided */
+#define PWM0 0
+#define PWM1 1
+#define PWM2 2
+#define PWM3 3
+#define PWM4 4
+
+/* Setting for the Hardware PWM selection for BlueNRG-1 & BlueNRG-2 board.
+if user want to change the hardware pwm according to his application then user
+can select the given settings.
+
+ SERIAL1_MODE SERIAL2_MODE
+PWM0_PIN GPIO_2 GPIO_4
+PWM1_PIN GPIO_3 GPIO_5
+*/
+
+/*STEVAL_BlueNRG-1
+ *STEVAL_BlueNRG-2
+ * This configuration given below is for the BlueNRG-1 and BlueNRG-2 board.
+ * Here user has selected the PWM0 in SERIAL2_MODE and PWM1 in SERIAL1_MODE.
+ * User can configure software PWM to any of the GPIO which are not used for
+ * hardware PWM.
+*/
+/* PWM pins for MFT1 and MFT2 respectively */
+#if defined STEVAL_BLUENRG_1_BOARD_PWM_SELECTION || defined STEVAL_BLUENRG_2_BOARD_PWM_SELECTION
+
+#define PWM0_PIN GPIO_Pin_4
+#define PWM1_PIN GPIO_Pin_3
+
+/* GPIOs pins (SOFTWARE PWM) used to output a PWM signal */
+#define PWM2_PIN GPIO_Pin_1
+#define PWM3_PIN GPIO_Pin_2
+#define PWM4_PIN GPIO_Pin_14 /*Blue Led*/
+#endif
+/**************************************************************************/
+
+/* CUSTOM BOARD SETTING
+ * Uncomment the macros given below for custom board and comment the above macros
+ * which are given for BlueNRG board.
+ * This configuration given below is for the custom board.
+ * Here user has selected the PWM0 in SERIAL2_MODE and PWM1 in SERIAL2_MODE.
+ * User can configure software PWM to any of the GPIO which are not used for
+ * hardware PWM.
+NOTE - Do not enable the sensor model with this configuration.As GPIO_4 is used
+ for sensor already.
+*/
+/* PWM pins for MFT1 and MFT2 respectively */
+#ifdef CUSTOM_BOARD_PWM_SELECTION
+
+#define PWM0_PIN GPIO_Pin_4
+#define PWM1_PIN GPIO_Pin_5
+
+/* GPIOs pins (SOFTWARE PWM) used to output a PWM signal */
+#define PWM2_PIN GPIO_Pin_0 /* Red Led*/
+#define PWM3_PIN GPIO_Pin_2 /*Green Led*/
+#define PWM4_PIN GPIO_Pin_3 /*Blue Led*/
+
+#endif
+/*************************************************************************/
+
+/*
+ * STEVAL-BLUEMIC-1
+ * This configuration given below is for the BlueNRG-1 and BlueNRG-2 board.
+ * Here user has selected the PWM0 in SERIAL2_MODE and PWM1 in SERIAL1_MODE.
+ * User can configure software PWM to any of the GPIO which are not used for
+ * hardware PWM.
+NOTE - Do not enable the sensor model with this configuration.As GPIO_4 is used
+ for sensor already.
+*/
+/* PWM pins for MFT1 and MFT2 respectively */
+#ifdef STEVAL_BLUEMIC_1_BOARD_PWM_SELECTION
+
+#define PWM0_PIN GPIO_Pin_4
+#define PWM1_PIN GPIO_Pin_3 //blue_led
+
+/* GPIOs pins (SOFTWARE PWM) used to output a PWM signal */
+#define PWM2_PIN GPIO_Pin_8
+#define PWM3_PIN GPIO_Pin_6
+#define PWM4_PIN GPIO_Pin_14
+
+#endif
+/************************************************************************/
+
+/*STM32WB
+ * This configuration given below is for the STM32WB board.
+ * Here user has selected the PWM0 in SERIAL2_MODE and PWM1 in SERIAL1_MODE.
+ * User can configure software PWM to any of the GPIO which are not used for
+ * hardware PWM.
+*/
+/* PWM pins for MFT1 and MFT2 respectively */
+#if defined USE_STM32WBXX_NUCLEO || defined USE_STM32WBXX_USB_DONGLE
+
+#define PWM0_PIN GPIO_PIN_14 /* TIM1_CH1 AF1 */
+#define PWM1_PIN GPIO_PIN_15 /* TIM1_CH2 AF1 */
+
+/* GPIOs pins (SOFTWARE PWM) used to output a PWM signal */
+#define PWM2_PIN GPIO_PIN_0 /* TIM2_CH1 AF1 */
+#define PWM3_PIN GPIO_PIN_1 /* TIM2_CH2 AF1 */
+#define PWM4_PIN GPIO_PIN_2 /* TIM2_CH3 AF1 */
+#endif
+/************************************************************************/
+
+#define TIME_PERIOD 32000
+
+/* TIM1 Channel 1 Timer Ton and T0ff (ticks number) PWM0*/
+#define MFT1_TON_1 (12000 - 1)
+#define MFT1_TOFF_1 (20000 - 1)
+
+/* TIM1 Channel 2 Timer 1 Ton and T0ff (ticks number) PWM1*/
+#define MFT2_TON_1 (8000 - 1 )
+#define MFT2_TOFF_1 (24000 - 1)
+
+/* TIM2 Channel 1 Timer 2 Ton and T0ff (ticks number) PWM2*/
+#define MFT1_TON_2 (16000 - 1)
+#define MFT1_TOFF_2 (16000 -1)
+
+/* TIM2 Channel 2 Timer 2 Ton and T0ff (ticks number) PWM3*/
+#define MFT2_TON_2 (4000 - 1)
+#define MFT2_TOFF_2 (28000 - 1)
+
+/* TIM2 Channel 3 Timer 2 Ton and T0ff (ticks number) PWM4*/
+#define MFT2_TON_3 (4000 - 1)
+#define MFT2_TOFF_3 (28000 - 1)
+
+void PWM_Init(void);
+
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_handlers.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_handlers.c
new file mode 100644
index 000000000..faa56a950
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_handlers.c
@@ -0,0 +1,297 @@
+/**
+********************************************************************************
+* @file PWM_handlers.c
+* @author BLE Mesh Team
+* @version V1.0.0
+* @date 31-July-2018
+* @brief Handlers for PWM and other support functions.
+********************************************************************************
+* @attention
+*
+*<h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
+*
+* Redistribution and use in source and binary forms, with or without modification,
+* are permitted provided that the following conditions are met:
+* 1. Redistributions of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+* 3. Neither the name of STMicroelectronics nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+* Initial BlueNRG-Mesh is built over Motorolas Mesh over Bluetooth Low Energy
+* (MoBLE) technology. The present solution is developed and maintained for both
+* Mesh library and Applications solely by STMicroelectronics.
+*
+******************************************************************************
+*/
+
+/* Includes ------------------------------------------------------------------*/
+#include "hal_common.h"
+#include "PWM_handlers.h"
+#include "mesh_cfg_usr.h"
+
+extern TIM_HandleTypeDef htim1;
+extern TIM_HandleTypeDef htim2;
+
+/* Global Variables */
+uint16_t DUTY;
+int NonZeroPWM0=0;
+int NonZeroPWM1=0;
+uint8_t Duty_flag_A = 0;
+uint16_t PWM0_on,
+ PWM1_on,
+ PWM2_on = MFT1_TON_2, /* Timer2, MFT1 */
+ PWM3_on = MFT2_TON_2, /* Timer2, MFT2 */
+ PWM4_on = MFT2_TON_3; /* Timer2, MFT2 */
+
+uint32_t channel = PWM3_PIN; /* It is the channel with initial lowest duty-cycle */
+uint32_t period = TIME_PERIOD; /* Period in ticks of the PWM signal */
+uint8_t channel_number = 0;
+
+uint32_t PWM_channels[] = {PWM3_PIN, PWM4_PIN}; /* Channels managed by MFT2 Timer 2 */
+uint16_t Ton_values[] = {MFT2_TON_2, MFT2_TON_3}; /* Sorted array containing duty-cycle values
+ respectively for PWM3_PIN and PWM4_PIN */
+uint16_t delta_1 = MFT2_TON_3 - MFT2_TON_2; /* Delta between the first two duty-cycles */
+uint16_t delta = MFT2_TON_3 - MFT2_TON_2;
+
+int number_of_channels = 2; /* Number of channels managed by MFT2 Timer 2 */
+int max_duty = MFT2_TON_3; /* Maximum duty-cycle */
+
+/**
+ *@brief PWM2 handler
+ *@retval None
+ */
+void PWM2_handler()
+{
+ if(__HAL_TIM_GET_FLAG(&htim1, TIM_FLAG_CC1) > 0)
+ {
+ __HAL_TIM_CLEAR_FLAG(&htim1, TIM_FLAG_CC1);
+ if(Duty_flag_A == 1)
+ {
+ HAL_GPIO_WritePin(GPIOA, PWM2_PIN, GPIO_PIN_SET);
+ Duty_flag_A = 0;
+ htim1.Instance->CCR1 = PWM2_on;
+ }
+ else
+ {
+ HAL_GPIO_WritePin(GPIOA, PWM2_PIN, GPIO_PIN_RESET);
+ Duty_flag_A = 1;
+ htim1.Instance->CCR1 = TIME_PERIOD - PWM2_on;
+ }
+ }
+}
+
+/**
+ *@brief PWM3 and PWM4 handler
+ *@retval None
+ */
+void PWM3_PWM4_handler()
+{
+ /*STATE 0
+ if delta != 0, there is a channel with a duty lower than the other one.
+ So the channel with the lower duty is cleared. Delta is period - max_duty
+ (the duty of the other channel)
+ The machine passes to STATE 1.
+
+ if delta == 0, the two channel are cleared together.
+ The machine passes to STATE 2
+
+ The delta is computed for the next timer event*/
+
+ if (channel_number < number_of_channels - 1)
+ {
+ if (delta != 0)
+ {
+// HAL_GPIO_WritePin(GPIOA, channel, GPIO_PIN_RESET);
+ htim2.Instance->CCR2 = delta - 1;
+ htim2.Instance->CCR3 = delta - 1;
+ channel_number ++;
+ delta = period - max_duty; /*computed delta for the next reset of the counter*/
+ channel = PWM_channels[channel_number];
+ }
+ else
+ {
+// HAL_GPIO_WritePin(GPIOA, PWM3_PIN |PWM4_PIN, GPIO_PIN_RESET);
+ delta = period - max_duty;
+ htim2.Instance->CCR2 = delta - 1;
+ htim2.Instance->CCR3 = delta - 1;
+ channel_number = number_of_channels;
+ }
+ }
+ /*STATE 1
+ Here the channel with the max duty-cycle is cleared. The delta is that one
+ computed in STATE 0. The machine passes to STATE 2 */
+ else if (channel_number == number_of_channels - 1)
+ {
+// HAL_GPIO_WritePin(GPIOA, channel, GPIO_PIN_RESET);
+ htim2.Instance->CCR2 = delta - 1;
+ htim2.Instance->CCR3 = delta - 1;
+ channel_number ++;
+ }
+ /*STATE 2
+ All the channels have been cleared and now are set again. The machine passes to STATE 0 */
+ else
+ { /* channel_number > number_of_channels - 1 */
+ HAL_GPIO_WritePin(GPIOA, PWM3_PIN | PWM4_PIN, GPIO_PIN_SET);
+ htim2.Instance->CCR2 = Ton_values[0] - 1;
+ htim2.Instance->CCR3 = Ton_values[1] - 1;
+ Ton_sorting();
+ channel_number = 0;
+ delta = Ton_values[1] - Ton_values[0];
+ channel = PWM_channels[0];
+ }
+}
+
+/**
+ *@brief Sorting on basis of duty cycle
+ *@retval None
+ */
+
+void Ton_sorting(void)
+{
+ if (PWM3_on > PWM4_on)
+ {
+ max_duty = PWM3_on;
+ Ton_values[1] = PWM3_on;
+ Ton_values[0] = PWM4_on;
+ PWM_channels[1] = PWM3_PIN;
+ PWM_channels[0] = PWM4_PIN;
+ }
+ else
+ {
+ max_duty = PWM4_on;
+ Ton_values[0] = PWM3_on;
+ Ton_values[1] = PWM4_on;
+ PWM_channels[0] = PWM3_PIN;
+ PWM_channels[1] = PWM4_PIN;
+ }
+}
+
+
+/**
+ *@brief PWM modification
+ *@param PWM_ID: PWM number
+ *@param duty_cycle: Duty cycle at output
+ *@retval None
+ */
+void Modify_PWM(uint8_t PWM_ID, uint16_t duty_cycle)
+{
+ GPIO_InitTypeDef GPIO_InitStructure1 = {0};
+
+ if (PWM_ID == 0) /* PD14 */
+ {
+ if (duty_cycle == 0 && NonZeroPWM0 == 0)
+ {
+ GPIO_InitStructure1.Pin = PWM0_PIN;
+ GPIO_InitStructure1.Mode = GPIO_MODE_OUTPUT_PP;
+ GPIO_InitStructure1.Pull = GPIO_NOPULL;
+ GPIO_InitStructure1.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
+ HAL_GPIO_Init(GPIOD, &GPIO_InitStructure1);
+ HAL_GPIO_WritePin(GPIOD, PWM0_PIN, GPIO_PIN_RESET);
+
+ NonZeroPWM0=1;
+ }
+ else if ((duty_cycle != 0 && NonZeroPWM0 == 1))
+ {
+ GPIO_InitStructure1.Pin = PWM0_PIN;
+ GPIO_InitStructure1.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStructure1.Pull = GPIO_PULLUP;
+ GPIO_InitStructure1.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
+ GPIO_InitStructure1.Alternate = GPIO_AF1_TIM1;
+ HAL_GPIO_Init(GPIOD, &GPIO_InitStructure1);
+
+ NonZeroPWM0=0;
+ }
+ }
+ else if((PWM_ID == 1)) /* GPIO3 */
+ {
+ if (duty_cycle == 0 && NonZeroPWM1 == 0)
+ {
+ GPIO_InitStructure1.Pin = PWM1_PIN;
+ GPIO_InitStructure1.Mode = GPIO_MODE_OUTPUT_PP;
+ GPIO_InitStructure1.Pull = GPIO_NOPULL;
+ GPIO_InitStructure1.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
+ HAL_GPIO_Init(GPIOD, &GPIO_InitStructure1);
+ HAL_GPIO_WritePin(GPIOD, PWM1_PIN, GPIO_PIN_RESET);
+
+ NonZeroPWM1=1;
+ }
+ else if ((duty_cycle != 0 && NonZeroPWM1 == 1))
+ {
+ GPIO_InitStructure1.Pin = PWM1_PIN;
+ GPIO_InitStructure1.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStructure1.Pull = GPIO_PULLUP;
+ GPIO_InitStructure1.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
+ GPIO_InitStructure1.Alternate = GPIO_AF1_TIM1;
+ HAL_GPIO_Init(GPIOD, &GPIO_InitStructure1);
+
+ NonZeroPWM1=0;
+ }
+ }
+ else
+ {
+ }
+
+ DUTY = duty_cycle;
+ switch (PWM_ID)
+ {
+ case 0: /* PWM0 */
+ {
+ htim1.Instance->CCR1 = DUTY;
+ }
+ break;
+ case 1: /* PWM1 */
+ {
+ htim1.Instance->CCR2 = DUTY;
+ }
+ break;
+ case 2: /* PWM2 */
+ {
+ PWM2_on = DUTY;
+ htim2.Instance->CCR1 = PWM2_on;
+ }
+ break;
+ case 3: /* PWM3 */
+ {
+ PWM3_on = DUTY;
+ htim2.Instance->CCR2 = PWM3_on;
+ }
+ break;
+ case 4: /* PWM4 */
+ {
+ PWM4_on = DUTY;
+ htim2.Instance->CCR3 = PWM4_on;
+ }
+ break;
+ }
+}
+
+/**
+ * @brief Period elapsed callback in non blocking mode
+ * @param htim : TIM handle
+ * @retval None
+ */
+void HAL_TIM_PWM_PulseFinishedCallback(TIM_HandleTypeDef *htim)
+{
+#if 0
+ if(htim->Instance == TIM1)
+ PWM2_handler();
+ else
+ PWM3_PWM4_handler();
+#endif
+}
+
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_handlers.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_handlers.h
new file mode 100644
index 000000000..a27fa757b
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_handlers.h
@@ -0,0 +1,35 @@
+/**
+ ******************************************************************************
+ * @file PWM/PWM_handlers.c
+* @author SNM Application Team
+* @version V1.0.0
+* @date September-2015
+ * @brief Handlers for PWM and other support functions.
+ ******************************************************************************
+ * @attention
+ *
+ * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+ * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
+ * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
+ * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
+ * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
+ * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+ *
+ * <h2><center>&copy; COPYRIGHT 2015 STMicroelectronics</center></h2>
+ ******************************************************************************
+ */
+
+#include "PWM_config.h"
+//#include "SDK_EVAL_Config.h"
+
+/* PWM2 handler */
+void PWM2_handler(void);
+
+/* PWM3 and PWM4 handler */
+void PWM3_PWM4_handler(void);
+
+/* Here the channel with the lower duty-cycle is established*/
+void Ton_sorting(void);
+
+/* Handle modifications in duty cycle */
+void Modify_PWM(uint8_t PWM_ID, uint16_t duty_cycle);
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_generic.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_generic.c
index 3d046ab8e..1b0822341 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_generic.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_generic.c
@@ -27,8 +27,10 @@
#include "generic.h"
#include "light.h"
#include "appli_generic.h"
+#include "appli_light.h"
#include "common.h"
#include "mesh_cfg_usr.h"
+#include "appli_nvm.h"
/** @addtogroup BLE_Mesh
* @{
*/
@@ -40,33 +42,18 @@
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
-#define POWER_OFF_STATE 0X02
-#define POWER_ON_STATE 0X01
-#define POWER_RESTORE_STATE 0X02
-
/* Private variables ---------------------------------------------------------*/
-
-
-MOBLEUINT8 OptionalValidParam = 0;
-MOBLEUINT8 LEDState;
-MOBLEUINT8 StatusCode;
-
-#pragma pack(1)
-typedef struct
-{
- MOBLEUINT8 Present_OnOff;
-}Appli_Generic_OnOffSet;
+
+MOBLEUINT8 RestoreFlag;
+extern MOBLEUINT16 IntensityValue;
+extern MOBLEUINT8 IntensityFlag;
+extern MOBLEUINT8 PowerOnOff_flag;
+extern Appli_LightPwmValue_t Appli_LightPwmValue;
Appli_Generic_OnOffSet AppliOnOffSet;
-
-#pragma pack(1)
-typedef struct
-{
- MOBLEINT16 Present_Level16;
-}Appli_Generic_LevelSet;
-
Appli_Generic_LevelSet AppliLevelSet;
-
+Appli_Generic_PowerOnOffSet AppliPowerOnSet;
+Appli_Generic_DefaultTransitionSet AppliDefaultTransitionSet;
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
@@ -74,7 +61,7 @@ Appli_Generic_LevelSet AppliLevelSet;
#ifdef ENABLE_GENERIC_MODEL_SERVER_ONOFF
/**
* @brief Appli_Generic_OnOff_Set: This function is callback for Application
- when Generic OnOff message is received
+* when Generic OnOff message is received
* @param pGeneric_OnOffParam: Pointer to the parameters received for message
* @param OptionalValid: Flag to inform about the validity of optional parameters
* @retval MOBLE_RESULT
@@ -82,25 +69,56 @@ Appli_Generic_LevelSet AppliLevelSet;
MOBLE_RESULT Appli_Generic_OnOff_Set(Generic_OnOffStatus_t* pGeneric_OnOffParam,
MOBLEUINT8 OptionalValid)
{
- AppliOnOffSet.Present_OnOff = pGeneric_OnOffParam->Present_OnOff;
- if(AppliOnOffSet.Present_OnOff > 0)
- {
- BSP_LED_On(LED_BLUE);
+ AppliOnOffSet.Present_OnOff = pGeneric_OnOffParam->Present_OnOff_State;
+ AppliOnOffSet.Present_OnOffValue = pGeneric_OnOffParam->Present_OnOff_Value;
+
+
+ /* This condition is applicable when user want to on off the light with some default
+ * transition value, or optionalValid =IN_TRANSITION , transition is in progress.
+ */
+ if((OptionalValid == DEFAULT_TRANSITION) || (OptionalValid == IN_TRANSITION))
+ {
+ Appli_LightPwmValue.IntensityValue = AppliOnOffSet.Present_OnOffValue;
+ Light_UpdateLedValue(LOAD_STATE ,Appli_LightPwmValue);
+ }
+ else
+ {
+ if((AppliOnOffSet.Present_OnOff == APPLI_LED_ON) && (OptionalValid == NO_TRANSITION))
+ {
+ Appli_LightPwmValue.IntensityValue = PWM_TIME_PERIOD;
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
}
else
- {
- BSP_LED_Off(LED_BLUE);
- }
+ {
+ Appli_LightPwmValue.IntensityValue = PWM_VALUE_OFF;
+ Light_UpdateLedValue(RESET_STATE , Appli_LightPwmValue);
+ }
+ }
+ if(AppliOnOffSet.Present_OnOffValue > 16000)
+ {
+ BSP_LED_On(LED_BLUE);
+ }
+ else
+ {
+ BSP_LED_Off(LED_BLUE);
+ }
+
+ TRACE_M(TF_SERIAL_CTRL,"#8202%02hx!\n\r",AppliOnOffSet.Present_OnOff);
+
+ /* set the flag value for NVM store */
+ RestoreFlag = GENERIC_ON_OFF_NVM_FLAG;
+
+ AppliNvm_SaveMessageParam();
+
return MOBLE_RESULT_SUCCESS;
}
#endif
-
#ifdef ENABLE_GENERIC_MODEL_SERVER_LEVEL
/**
* @brief Appli_Generic_Level_Set: This function is callback for Application
- when Generic Level message is received
+* when Generic Level message is received
* @param plevelParam: Pointer to the parameters message
* @param OptionalValid: Flag to inform about the validity of optional parameters
* @retval MOBLE_RESULT
@@ -108,19 +126,47 @@ MOBLE_RESULT Appli_Generic_OnOff_Set(Generic_OnOffStatus_t* pGeneric_OnOffParam,
MOBLE_RESULT Appli_Generic_Level_Set(Generic_LevelStatus_t* plevelParam,
MOBLEUINT8 OptionalValid)
{
+ MOBLEUINT16 duty;
+ static MOBLEUINT16 previousIntensity = 0;
- AppliLevelSet.Present_Level16= plevelParam->Present_Level16;
+ AppliLevelSet.Present_Level16= plevelParam->Present_Level16;
+ if(AppliLevelSet.Present_Level16 <= 0)
+ {
+ AppliLevelSet.Present_Level16 = 0;
+ }
+
+ IntensityValue = AppliLevelSet.Present_Level16;
+
+ if(((IntensityValue > previousIntensity) && (IntensityValue <PWM_TIME_PERIOD)) ||
+ IntensityValue == INTENSITY_LEVEL_ZERO)
+ {
+ IntensityFlag = MOBLE_FALSE;
+ }
+ else
+ {
+ IntensityFlag = MOBLE_TRUE;
+ }
+ previousIntensity = IntensityValue;
+ duty = PwmValueMapping(AppliLevelSet.Present_Level16 , 0x7FFF ,0);
+ Appli_LightPwmValue.IntensityValue = duty;
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
+
+ TRACE_M(TF_SERIAL_CTRL,"#8206%04hx!\n\r",AppliLevelSet.Present_Level16);
+
+ /* set the flag value for NVM store */
+ RestoreFlag = GENERIC_LEVEL_NVM_FLAG;
+
+ AppliNvm_SaveMessageParam();
+
/* For demo, if Level is more than 100, switch ON the LED */
if(AppliLevelSet.Present_Level16 >= 50)
{
BSP_LED_On(LED_BLUE);
- LEDState = 1;
}
else
{
BSP_LED_Off(LED_BLUE);
- LEDState = 1;
}
return MOBLE_RESULT_SUCCESS;
@@ -128,7 +174,7 @@ MOBLE_RESULT Appli_Generic_Level_Set(Generic_LevelStatus_t* plevelParam,
/**
* @brief Appli_Generic_LevelDelta_Set: This function is callback for Application
- when Generic Level Delta message is received
+* when Generic Level Delta message is received
* @param pdeltalevelParam: Pointer to the parameters message
* @param OptionalValid: Flag to inform about the validity of optional parameters
* @retval MOBLE_RESULT
@@ -142,13 +188,14 @@ MOBLE_RESULT Appli_Generic_LevelDelta_Set(Generic_LevelStatus_t* pdeltalevelPara
/* For demo, if Level is more than 50, switch ON the LED */
if (AppliLevelSet.Present_Level16 >= 50)
{
+ Appli_LightPwmValue.IntensityValue = PWM_TIME_PERIOD;
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
BSP_LED_On(LED_BLUE);
- LEDState = 1;
}
else
{
+ Light_UpdateLedValue(RESET_STATE , Appli_LightPwmValue);
BSP_LED_Off(LED_BLUE);
- LEDState = 1;
}
return MOBLE_RESULT_SUCCESS;
}
@@ -156,7 +203,7 @@ MOBLE_RESULT Appli_Generic_LevelDelta_Set(Generic_LevelStatus_t* pdeltalevelPara
/**
* @brief Appli_Generic_LevelMove_Set: This function is callback for Application
- when Generic Level Move message is received
+* when Generic Level Move message is received
* @param pdeltaMoveParam: Pointer to the parameters message
* @param OptionalValid: Flag to inform about the validity of optional parameters
* @retval MOBLE_RESULT
@@ -168,18 +215,61 @@ MOBLE_RESULT Appli_Generic_LevelMove_Set(Generic_LevelStatus_t* pdeltaMoveParam,
if(OptionalValid == 1)
{
AppliLevelSet.Present_Level16= pdeltaMoveParam->Present_Level16;
-
- OptionalValidParam = 1;
}
+
return MOBLE_RESULT_SUCCESS;
}
+#endif /* ENABLE_GENERIC_MODEL_SERVER_LEVEL */
-#endif
+#ifdef ENABLE_GENERIC_MODEL_SERVER_POWER_ONOFF
+/**
+* @brief Appli_Generic_PowerOnOff_Set: This function is callback for Application
+* when Generic Power on off set message is received
+* @param pPowerOnOffParam: Pointer to the parameters message
+* @param OptionalValid: Flag to inform about the validity of optional parameters
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Appli_Generic_PowerOnOff_Set(Generic_PowerOnOffParam_t* pPowerOnOffParam,
+ MOBLEUINT8 OptionalValid)
+{
+ AppliPowerOnSet.PowerOnState = pPowerOnOffParam->PowerOnOffState;
+
+ TRACE_M(TF_SERIAL_CTRL,"Generic Power OnOff Set: State %d!\n\r",
+ pPowerOnOffParam->PowerOnOffState);
+
+ /* set the flag value for NVM store */
+ RestoreFlag = GENERIC_ON_OFF_NVM_FLAG;
+
+ AppliNvm_SaveMessageParam();
+
+ return MOBLE_RESULT_SUCCESS;
+}
+#endif /* ENABLE_GENERIC_MODEL_SERVER_POWER_ONOFF */
+
+
+#ifdef ENABLE_GENERIC_MODEL_SERVER_DEFAULT_TRANSITION_TIME
+/**
+* @brief Appli_Generic_DefaultTransitionTime_Set: This function is callback for Application
+* when Generic Power on off set message is received
+* @param pDefaultTimeParam: Pointer to the parameters message
+* @param OptionalValid: Flag to inform about the validity of optional parameters
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Appli_Generic_DefaultTransitionTime_Set(Generic_DefaultTransitionParam_t* pDefaultTimeParam,
+ MOBLEUINT8 OptionalValid)
+{
+
+ AppliDefaultTransitionSet.DefaultTransitionTime = pDefaultTimeParam->DefaultTransitionTime;
+
+ return MOBLE_RESULT_SUCCESS;
+}
+#endif /* ENABLE_GENERIC_MODEL_SERVER_DEFAULT_TRANSITION_TIME */
+
/**
* @brief Appli_Generic_GetOnOffState: This function is callback for Application
- when Generic on off status message is to be provided
+* when Generic on off status message is to be provided
* @param pOnOff_status: Pointer to the status message
* @retval MOBLE_RESULT
*/
@@ -187,11 +277,27 @@ MOBLE_RESULT Appli_Generic_GetOnOffStatus(MOBLEUINT8* pOnOff_Status)
{
*pOnOff_Status = AppliOnOffSet.Present_OnOff;
- *(pOnOff_Status+1) = AppliOnOffSet.Present_OnOff >> 8;
-
+ TRACE_M(TF_SERIAL_CTRL,"Generic Get OnOff Status: Status %d!\n\r",
+ AppliOnOffSet.Present_OnOff);
+
return MOBLE_RESULT_SUCCESS;
}
+/**
+* @brief Appli_Generic_GetOnOffValue: This function is callback for Application
+ to get the PWM value for the generic on off
+* @param pOnOff_Value: Pointer to the status message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Appli_Generic_GetOnOffValue(MOBLEUINT8* pOnOff_Value)
+{
+
+ *pOnOff_Value = AppliOnOffSet.Present_OnOffValue;
+ *(pOnOff_Value+1) = AppliOnOffSet.Present_OnOffValue >> 8;
+ TRACE_M(TF_SERIAL_CTRL,"Generic Get OnOff Value: Value %d!\n\r",
+ AppliOnOffSet.Present_OnOffValue);
+ return MOBLE_RESULT_SUCCESS;
+}
/**
* @brief Appli_Generic_GetLevelStatus: This function is callback for Application
@@ -200,10 +306,40 @@ MOBLE_RESULT Appli_Generic_GetOnOffStatus(MOBLEUINT8* pOnOff_Status)
* @retval MOBLE_RESULT
*/
MOBLE_RESULT Appli_Generic_GetLevelStatus(MOBLEUINT8* pLevel_Status)
-
{
*pLevel_Status = AppliLevelSet.Present_Level16;
*(pLevel_Status+1) = AppliLevelSet.Present_Level16 >> 8;
+ TRACE_M(TF_SERIAL_CTRL,"Generic Get Level Status: Value %d!\n\r",
+ *pLevel_Status);
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Appli_Generic_GetPowerOnOffStatus: This function is callback for Application
+* when Generic Get Power status message is to be provided
+* @param pLevel_status: Pointer to the status message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Appli_Generic_GetPowerOnOffStatus(MOBLEUINT8* pLevel_Status)
+{
+ *pLevel_Status = AppliPowerOnSet.PowerOnState;
+ TRACE_M(TF_SERIAL_CTRL,"Generic Get OnOff Status: Status %d!\n\r",
+ AppliPowerOnSet.PowerOnState);
+
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Appli_Generic_GetDefaultTransitionStatus: This function is callback for Application
+* when Generic Level status message is to be provided
+* @param pTransition_Status: Pointer to the status message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Appli_Generic_GetDefaultTransitionStatus(MOBLEUINT8* pTransition_Status)
+{
+ *pTransition_Status = AppliDefaultTransitionSet.DefaultTransitionTime;
+ TRACE_M(TF_SERIAL_CTRL,"Get Default Transition Status: Status %d!\n\r",
+ AppliDefaultTransitionSet.DefaultTransitionTime);
return MOBLE_RESULT_SUCCESS;
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_generic.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_generic.h
index da1395382..465f16b5f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_generic.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_generic.h
@@ -18,8 +18,8 @@
*/
/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __GENERIC_APPLI_H
-#define __GENERIC_APPLI_H
+#ifndef __APPLI_GENERIC_H
+#define __APPLI_GENERIC_H
/* Includes ------------------------------------------------------------------*/
#include "types.h"
@@ -45,14 +45,38 @@
#define BATTERY_REQUIRE_NO_SERVICE 0X01
#define BATTERY_REQUIRE_SERVICE 0X02
#define BATTERY_SERVICE_UNKNOWN 0X03
+
/* Exported variables ------------------------------------------------------- */
/* Application Variable-------------------------------------------------------*/
+#pragma pack(1)
+typedef struct
+{
+ MOBLEUINT8 Present_OnOff;
+ MOBLEUINT16 Present_OnOffValue;
+}Appli_Generic_OnOffSet;
+
+typedef struct
+{
+ MOBLEINT16 Present_Level16;
+}Appli_Generic_LevelSet;
+
+typedef struct
+{
+ MOBLEINT16 PowerOnState;
+}Appli_Generic_PowerOnOffSet;
+
+typedef struct
+{
+ MOBLEINT16 DefaultTransitionTime;
+}Appli_Generic_DefaultTransitionSet;
+
typedef struct
{
MOBLEUINT8 Is_BatteryPresent;
MOBLEUINT8 Is_Chargeable;
MOBLEUINT8 Is_Serviceable;
}Appli_BatteryUserflag_param_t;
+#pragma pack(4)
/* Exported Functions Prototypes ---------------------------------------------*/
@@ -63,10 +87,19 @@ MOBLE_RESULT Appli_Generic_LevelMove_Set(Generic_LevelStatus_t* pdeltaMoveParam,
MOBLEUINT8 OptionalValid);
MOBLE_RESULT Appli_Generic_Level_Status(MOBLEUINT8* level_status,
MOBLEUINT32 *plength);
+MOBLE_RESULT Appli_Generic_PowerOnOff_Set(Generic_PowerOnOffParam_t* pPowerOnOffParam,
+ MOBLEUINT8 OptionalValid);
+MOBLE_RESULT Appli_Generic_DefaultTransitionTime_Set(Generic_DefaultTransitionParam_t* pDefaultTimeParam,
+ MOBLEUINT8 OptionalValid);
+
MOBLE_RESULT Appli_Generic_GetOnOffStatus(MOBLEUINT8* pOnOff_Status);
+MOBLE_RESULT Appli_Generic_GetOnOffValue(MOBLEUINT8* pOnOff_Value);
MOBLE_RESULT Appli_Generic_GetLevelStatus(MOBLEUINT8* pLevel_Status);
+MOBLE_RESULT Appli_Generic_GetPowerOnOffStatus(MOBLEUINT8* pLevel_Status);
+MOBLE_RESULT Appli_Generic_GetDefaultTransitionStatus(MOBLEUINT8* pTransition_Status) ;
+
-#endif /* __GENERIC_APPLI_H */
+#endif /* __APPLI_GENERIC_H */
/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light.c
index 1380246c8..64998ac3c 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light.c
@@ -28,6 +28,10 @@
#include "appli_generic.h"
#include "common.h"
#include "mesh_cfg.h"
+#include "PWM_handlers.h"
+#include "PWM_config.h"
+#include "appli_nvm.h"
+#include "math.h"
/** @addtogroup BLE_Mesh
* @{
@@ -48,45 +52,9 @@ Following Variables are used for the LIGHTING Lightness MODEL
*******************************************************************************/
#ifdef ENABLE_LIGHT_MODEL_SERVER_LIGHTNESS
-/* Light Lightness set */
-#pragma pack(1)
-typedef struct
-{
- MOBLEUINT16 PresentState16;
- MOBLEUINT16 LastLightness16;
-}Appli_Light_lightnessSet;
-
Appli_Light_lightnessSet ApplilightnessSet;
-
-/* Light Lightness Linear set */
-#pragma pack(1)
-typedef struct
-{
- MOBLEUINT16 PresentState16;
-}Appli_Light_lightnessLinearSet;
-
Appli_Light_lightnessLinearSet ApplilightnessLinearSet;
-/* Light Lightness Default set */
-#pragma pack(1)
-typedef struct
-{
- MOBLEUINT16 LightnessDefault;
-}Appli_Light_lightnessDefaultSet;
-
-Appli_Light_lightnessDefaultSet ApplilightnessDefaultSet;
-
-/* Light Lightness Range set */
-#pragma pack(1)
-typedef struct
-{
- MOBLEUINT8 StatusCode;
- MOBLEUINT16 RangeMin;
- MOBLEUINT16 RangeMax;
-}Appli_Light_lightnessRangeSet;
-
-Appli_Light_lightnessRangeSet ApplilightnessRangeSet = {0x00,0x01,0xFFFF};
-
/******************************************************************************/
#endif /* #ifdef ENABLE_LIGHT_MODEL_SERVER_LIGHTNESS */
/******************************************************************************/
@@ -97,37 +65,8 @@ Following Variables are used for the LIGHTING CTL MODEL
#ifdef ENABLE_LIGHT_MODEL_SERVER_CTL
-/* Light Ctl Set */
-#pragma pack(1)
-typedef struct
-{
- MOBLEUINT16 PresentLightness16;
- MOBLEUINT16 PresentTemperature16;
- MOBLEINT16 PresentCtlDelta16;
-}Appli_Light_CtlSet;
-
Appli_Light_CtlSet AppliCtlSet;
-
-/* Light Ctl Temperature Range Set */
-#pragma pack(1)
-typedef struct
-{
- MOBLEUINT8 StatusCode;
- MOBLEUINT16 RangeMin;
- MOBLEUINT16 RangeMax;
-}Appli_Light_CtlTemperatureRangeSet;
-
Appli_Light_CtlTemperatureRangeSet AppliCtlTemperatureRangeSet;
-
-/* Light Ctl Default set */
-#pragma pack(1)
-typedef struct
-{
- MOBLEUINT16 CtlDefaultLightness16;
- MOBLEUINT16 CtlDefaultTemperature16;
- MOBLEINT16 CtlDefaultDeltaUv;
-}Appli_Light_CtlDefaultSet;
-
Appli_Light_CtlDefaultSet AppliCtlDefaultSet;
/******************************************************************************/
@@ -138,41 +77,23 @@ Appli_Light_CtlDefaultSet AppliCtlDefaultSet;
Following Variables are used for the LIGHTING HSL MODEL
*******************************************************************************/
-
#ifdef ENABLE_LIGHT_MODEL_SERVER_HSL
-/* Light Hsl Hue set */
-#pragma pack(1)
-typedef struct
-{
- MOBLEUINT16 HslLightness16;
- MOBLEUINT16 HslHueLightness16;
- MOBLEUINT16 HslSaturation16;
-}Appli_Light_HslSet;
+ Appli_Light_HslSet AppliHslSet;
+ Appli_Light_RGBSet Appli_RGBParam;
+ Appli_Light_HslRangeSet AppliHslRangeSet;
-Appli_Light_HslSet AppliHslSet;
-
-#pragma pack(1)
-typedef struct
-{
- MOBLEUINT8 StatusCode;
- MOBLEUINT16 HslHueMinRange16;
- MOBLEUINT16 HslHueMaxRange16;
- MOBLEUINT16 HslMinSaturation16;
- MOBLEUINT16 HslMaxSaturation16;
-}Appli_Light_HslRangeSet;
-
-Appli_Light_HslRangeSet AppliHslRangeSet;
-
-/******************************************************************************/
-#endif /* ENABLE_LIGHT_MODEL_SERVER_HSL */
-/******************************************************************************/
+/*******************************************************************************/
+#endif /*End of the LIGHTING HSL MODEL variables */
+/*******************************************************************************/
/*******************************************************************************
-End of the LIGHTING HSL MODEL variables
+Following Variables are used for the RGB board.
*******************************************************************************/
+
+Appli_LightPwmValue_t Appli_LightPwmValue;
-
-MOBLEUINT8 OptionalLightParam = 0;
+extern MOBLEUINT8 RestoreFlag;
+extern MOBLEUINT8 PowerOnOff_flag;
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
@@ -188,17 +109,41 @@ MOBLEUINT8 OptionalLightParam = 0;
MOBLE_RESULT Appli_Light_Lightness_Set(Light_LightnessStatus_t* pLight_LightnessParam,
MOBLEUINT8 OptionalValid)
{
+ MOBLEUINT16 duty;
+
ApplilightnessSet.PresentState16 = pLight_LightnessParam->PresentValue16;
if(pLight_LightnessParam->PresentValue16 != 0x00)
{
ApplilightnessSet.LastLightness16 = pLight_LightnessParam->PresentValue16;
- }
+ }
+ duty = PwmValueMapping(ApplilightnessSet.PresentState16 , 0xfFFF ,0);
+ Appli_LightPwmValue.IntensityValue = duty;
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
+
+ /* For demo, if Level is more than 100, switch ON the LED */
+ if(pLight_LightnessParam->PresentValue16 >= 0x8000)
+ {
+ BSP_LED_On(LED_BLUE);
+ }
+ else
+ {
+ BSP_LED_Off(LED_BLUE);
+ }
+ TRACE_M(TF_SERIAL_CTRL,"#8206%04hx!\n\r",ApplilightnessSet.PresentState16);
+
+ /* set the flag value for NVM store */
+ RestoreFlag = LIGHT_LIGHTNESS_NVM_FLAG;
+
+ AppliNvm_SaveMessageParam();
return MOBLE_RESULT_SUCCESS;
+
}
-#endif
+/******************************************************************************/
+#endif
+/******************************************************************************/
#ifdef ENABLE_LIGHT_MODEL_SERVER_LIGHTNESS
/**
@@ -231,6 +176,7 @@ MOBLE_RESULT Appli_Light_Lightness_Linear_Set(Light_LightnessStatus_t* pLight_Li
MOBLE_RESULT Appli_Light_Lightness_Default_Set(Light_LightnessDefaultParam_t* pLight_LightnessDefaultParam,
MOBLEUINT8 OptionalValid)
{
+ ApplilightnessSet.LightnessDefault = pLight_LightnessDefaultParam->LightnessDefaultStatus;
if(pLight_LightnessDefaultParam->LightnessDefaultStatus > 0)
{
BSP_LED_On(LED_BLUE);
@@ -240,7 +186,6 @@ MOBLE_RESULT Appli_Light_Lightness_Default_Set(Light_LightnessDefaultParam_t* pL
BSP_LED_Off(LED_BLUE);
}
- ApplilightnessDefaultSet.LightnessDefault = pLight_LightnessDefaultParam->LightnessDefaultStatus;
return MOBLE_RESULT_SUCCESS;
}
@@ -259,9 +204,9 @@ MOBLE_RESULT Appli_Light_Lightness_Default_Set(Light_LightnessDefaultParam_t* pL
MOBLE_RESULT Appli_Light_Lightness_Range_Set(Light_LightnessRangeParam_t* pLight_LightnessRangeParam,
MOBLEUINT8 OptionalValid)
{
- ApplilightnessRangeSet.StatusCode = pLight_LightnessRangeParam->StatusCode;
- ApplilightnessRangeSet.RangeMin = pLight_LightnessRangeParam->MinRangeStatus;
- ApplilightnessRangeSet.RangeMax = pLight_LightnessRangeParam->MaxRangeStatus;
+ ApplilightnessSet.StatusCode = pLight_LightnessRangeParam->StatusCode;
+ ApplilightnessSet.RangeMin = pLight_LightnessRangeParam->MinRangeStatus;
+ ApplilightnessSet.RangeMax = pLight_LightnessRangeParam->MaxRangeStatus;
return MOBLE_RESULT_SUCCESS;
}
@@ -281,10 +226,32 @@ MOBLE_RESULT Appli_Light_Lightness_Range_Set(Light_LightnessRangeParam_t* pLight
MOBLE_RESULT Appli_Light_Ctl_Set(Light_CtlStatus_t* pLight_CtlParam,
MOBLEUINT8 OptionalValid)
{
+ float colourRatio;
+ float brightRatio;
AppliCtlSet.PresentLightness16 = pLight_CtlParam->PresentCtlLightness16;
AppliCtlSet.PresentTemperature16 = pLight_CtlParam->PresentCtlTemperature16;
AppliCtlSet.PresentCtlDelta16 = pLight_CtlParam->PresentCtlDelta16;
+ colourRatio = Ratio_CalculateValue(AppliCtlSet.PresentTemperature16 ,MAX_CTL_TEMP_RANGE ,MIN_CTL_TEMP_RANGE);
+
+ brightRatio = Ratio_CalculateValue(AppliCtlSet.PresentLightness16 ,0XFFFF ,0);
+
+ Appli_LightPwmValue.PwmCoolValue = PWM_CoolValue(colourRatio , brightRatio);
+ Appli_LightPwmValue.PwmWarmValue = PWM_WarmValue(colourRatio , brightRatio);
+
+ Rgb_LedOffState();
+
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
+
+ TRACE_M(TF_SERIAL_CTRL,"#825E%04hx%04hx%04hx!\n\r",
+ AppliCtlSet.PresentLightness16,
+ AppliCtlSet.PresentTemperature16,
+ AppliCtlSet.PresentCtlDelta16);
+ /* set the flag value for NVM store */
+ RestoreFlag = LIGHT_CTL_NVM_FLAG;
+
+ AppliNvm_SaveMessageParam();
+
return MOBLE_RESULT_SUCCESS;
}
#endif
@@ -301,9 +268,26 @@ MOBLE_RESULT Appli_Light_Ctl_Set(Light_CtlStatus_t* pLight_CtlParam,
MOBLE_RESULT Appli_Light_CtlTemperature_Set(Light_CtlStatus_t* pLight_CtltempParam,
MOBLEUINT8 OptionalValid)
{
+ float colourRatio;
+ float brightRatio;
AppliCtlSet.PresentTemperature16 = pLight_CtltempParam->PresentCtlTemperature16;
AppliCtlSet.PresentCtlDelta16 = pLight_CtltempParam->PresentCtlDelta16;
+ colourRatio = Ratio_CalculateValue(AppliCtlSet.PresentTemperature16 ,MAX_CTL_TEMP_RANGE ,MIN_CTL_TEMP_RANGE);
+
+ brightRatio = Ratio_CalculateValue(AppliCtlSet.PresentLightness16 ,0XFFFF ,0);
+
+ Appli_LightPwmValue.PwmCoolValue = PWM_CoolValue(colourRatio , brightRatio);
+ Appli_LightPwmValue.PwmWarmValue = PWM_WarmValue(colourRatio , brightRatio);
+
+ Rgb_LedOffState();
+
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
+ /* set the flag value for NVM store */
+ RestoreFlag = LIGHT_CTL_NVM_FLAG;
+
+ AppliNvm_SaveMessageParam();
+
return MOBLE_RESULT_SUCCESS;
}
@@ -364,10 +348,27 @@ MOBLE_RESULT Appli_Light_CtlDefault_Set(Light_CtlDefaultParam_t* pLight_CtlDefau
MOBLE_RESULT Appli_Light_Hsl_Set(Light_HslStatus_t* pLight_HslParam,
MOBLEUINT8 OptionalValid)
{
+
AppliHslSet.HslLightness16 = pLight_HslParam->PresentHslLightness16;
AppliHslSet.HslHueLightness16 = pLight_HslParam->PresentHslHueLightness16;
AppliHslSet.HslSaturation16 = pLight_HslParam->PresentHslSaturation16;
+ /* Function to convert HSL values in RGB values */
+ HSL2RGB_Conversion();
+
+ Appli_LightPwmValue.PwmRedValue = PwmValueMapping(Appli_RGBParam.Red_Value ,0xFFFF ,0x00);
+ Appli_LightPwmValue.PwmGreenValue = PwmValueMapping(Appli_RGBParam.Green_Value ,0xFFFF ,0x00);
+ Appli_LightPwmValue.PwmBlueValue = PwmValueMapping(Appli_RGBParam.Blue_Value ,0xFFFF ,0x00);
+
+ /* when HSL is set, make CTL pwm will bw zero */
+ Ctl_LedOffState();
+
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
+ /* set the flag value for NVM store */
+ RestoreFlag = LIGHT_HSL_NVM_FLAG;
+
+ AppliNvm_SaveMessageParam();
+
return MOBLE_RESULT_SUCCESS;
}
#endif
@@ -386,6 +387,20 @@ MOBLE_RESULT Appli_Light_HslHue_Set(Light_HslStatus_t* pLight_HslHueParam,
{
AppliHslSet.HslHueLightness16 = pLight_HslHueParam->PresentHslHueLightness16;
+ HSL2RGB_Conversion();
+
+ Appli_LightPwmValue.PwmRedValue = PwmValueMapping(Appli_RGBParam.Red_Value ,0xFFFF ,0x00);
+ Appli_LightPwmValue.PwmGreenValue = PwmValueMapping(Appli_RGBParam.Green_Value ,0xFFFF ,0x00);
+ Appli_LightPwmValue.PwmBlueValue = PwmValueMapping(Appli_RGBParam.Blue_Value ,0xFFFF ,0x00);
+
+ Ctl_LedOffState();
+
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
+ /* set the flag value for NVM store */
+ RestoreFlag = LIGHT_HSL_NVM_FLAG;
+
+ AppliNvm_SaveMessageParam();
+
return MOBLE_RESULT_SUCCESS;
}
#endif
@@ -404,6 +419,20 @@ MOBLE_RESULT Appli_Light_HslSaturation_Set(Light_HslStatus_t* pLight_HslSaturati
{
AppliHslSet.HslSaturation16 = pLight_HslSaturationParam->PresentHslSaturation16;
+ HSL2RGB_Conversion();
+
+ Appli_LightPwmValue.PwmRedValue = PwmValueMapping(Appli_RGBParam.Red_Value ,0xFFFF ,0x00);
+ Appli_LightPwmValue.PwmGreenValue = PwmValueMapping(Appli_RGBParam.Green_Value ,0xFFFF ,0x00);
+ Appli_LightPwmValue.PwmBlueValue = PwmValueMapping(Appli_RGBParam.Blue_Value ,0xFFFF ,0x00);
+
+ Ctl_LedOffState();
+
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
+ /* set the flag value for NVM store */
+ RestoreFlag = LIGHT_HSL_NVM_FLAG;
+
+ AppliNvm_SaveMessageParam();
+
return MOBLE_RESULT_SUCCESS;
}
#endif
@@ -424,6 +453,20 @@ MOBLE_RESULT Appli_Light_HslDefault_Set(Light_HslStatus_t* pLight_HslDefaultPara
AppliHslSet.HslHueLightness16 = pLight_HslDefaultParam->PresentHslHueLightness16;
AppliHslSet.HslSaturation16 = pLight_HslDefaultParam->PresentHslSaturation16;
+ HSL2RGB_Conversion();
+
+ Appli_LightPwmValue.PwmRedValue = PwmValueMapping(Appli_RGBParam.Red_Value ,0xFFFF ,0x00);
+ Appli_LightPwmValue.PwmGreenValue = PwmValueMapping(Appli_RGBParam.Green_Value ,0xFFFF ,0x00);
+ Appli_LightPwmValue.PwmBlueValue = PwmValueMapping(Appli_RGBParam.Blue_Value ,0xFFFF ,0x00);
+
+ Ctl_LedOffState();
+
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
+ /* set the flag value for NVM store */
+ RestoreFlag = LIGHT_HSL_NVM_FLAG;
+
+ AppliNvm_SaveMessageParam();
+
return MOBLE_RESULT_SUCCESS;
}
#endif
@@ -466,8 +509,10 @@ MOBLE_RESULT Appli_Light_GetLightnessStatus(MOBLEUINT8* lLightnessState)
{
*(lLightnessState) = ApplilightnessSet.PresentState16;
*(lLightnessState+1) = ApplilightnessSet.PresentState16 >> 8;
- *(lLightnessState+2) = ApplilightnessSet.LastLightness16 ;
- *(lLightnessState+3) = ApplilightnessSet.LastLightness16 >> 8;
+// *(lLightnessState+2) = ApplilightnessSet.LastLightness16 ;
+// *(lLightnessState+3) = ApplilightnessSet.LastLightness16 >> 8;
+ TRACE_M(TF_SERIAL_CTRL,"Get Lighness Status: %d\n\r",
+ ApplilightnessSet.PresentState16);
return MOBLE_RESULT_SUCCESS;
}
@@ -485,6 +530,9 @@ MOBLE_RESULT Appli_Light_GetLightnessLinearStatus(MOBLEUINT8* lLightnessState)
*(lLightnessState+1) = ApplilightnessLinearSet.PresentState16 >> 8;
*(lLightnessState+2) = ApplilightnessSet.LastLightness16 ;
*(lLightnessState+3) = ApplilightnessSet.LastLightness16 >> 8;
+ TRACE_M(TF_SERIAL_CTRL,"Get Lighness Linear Status: present: %d last: %d\n\r",
+ ApplilightnessLinearSet.PresentState16,
+ ApplilightnessSet.LastLightness16);
return MOBLE_RESULT_SUCCESS;
}
@@ -498,8 +546,10 @@ MOBLE_RESULT Appli_Light_GetLightnessLinearStatus(MOBLEUINT8* lLightnessState)
*/
MOBLE_RESULT Appli_Light_GetLightnessDefaultStatus(MOBLEUINT8* lDefaultState)
{
- *(lDefaultState) = ApplilightnessDefaultSet.LightnessDefault;
- *(lDefaultState+1) = ApplilightnessDefaultSet.LightnessDefault >> 8;
+ *(lDefaultState) = ApplilightnessSet.LightnessDefault;
+ *(lDefaultState+1) = ApplilightnessSet.LightnessDefault >> 8;
+ TRACE_M(TF_SERIAL_CTRL,"Get Lighness Default Status: %d\n\r",
+ ApplilightnessSet.LightnessDefault);
return MOBLE_RESULT_SUCCESS;
}
@@ -513,11 +563,15 @@ to get the application values in middleware used for transition change.
*/
MOBLE_RESULT Appli_Light_GetLightnessRangeStatus(MOBLEUINT8* lRangeState)
{
- *(lRangeState) = ApplilightnessRangeSet.StatusCode;
- *(lRangeState+1) = ApplilightnessRangeSet.RangeMin;
- *(lRangeState+2) = ApplilightnessRangeSet.RangeMin >> 8;
- *(lRangeState+3) = ApplilightnessRangeSet.RangeMax;
- *(lRangeState+4) = ApplilightnessRangeSet.RangeMax >> 8;
+ *(lRangeState) = ApplilightnessSet.StatusCode;
+ *(lRangeState+1) = ApplilightnessSet.RangeMin;
+ *(lRangeState+2) = ApplilightnessSet.RangeMin >> 8;
+ *(lRangeState+3) = ApplilightnessSet.RangeMax;
+ *(lRangeState+4) = ApplilightnessSet.RangeMax >> 8;
+ TRACE_M(TF_SERIAL_CTRL,"Get Lighness Range Status: status: %d Min: %d Max: %d\n\r",
+ ApplilightnessSet.StatusCode,
+ ApplilightnessSet.RangeMin,
+ ApplilightnessSet.RangeMax);
return MOBLE_RESULT_SUCCESS;
}
@@ -542,6 +596,12 @@ MOBLE_RESULT Appli_Light_GetCtlLightStatus(MOBLEUINT8* lCtlLightState)
*(lCtlLightState+1) = AppliCtlSet.PresentLightness16 >> 8;
*(lCtlLightState+2) = AppliCtlSet.PresentTemperature16;
*(lCtlLightState+3) = AppliCtlSet.PresentTemperature16 >>8;
+ *(lCtlLightState+4) = AppliCtlSet.PresentCtlDelta16;
+ *(lCtlLightState+5) = AppliCtlSet.PresentCtlDelta16 >>8;
+ TRACE_M(TF_SERIAL_CTRL,"Get Ctl Light Status: lightness: %d temp: %d delta: %d\n\r",
+ AppliCtlSet.PresentLightness16,
+ AppliCtlSet.PresentTemperature16,
+ AppliCtlSet.PresentCtlDelta16);
return MOBLE_RESULT_SUCCESS;
}
@@ -559,6 +619,9 @@ MOBLE_RESULT Appli_Light_GetCtlTemperatureStatus(MOBLEUINT8* lCtlTempState)
*(lCtlTempState+1) = AppliCtlSet.PresentTemperature16 >> 8;
*(lCtlTempState+2) = AppliCtlSet.PresentCtlDelta16;
*(lCtlTempState+3) = AppliCtlSet.PresentCtlDelta16 >>8;
+ TRACE_M(TF_SERIAL_CTRL,"Get Ctl Temperature Status: temp: %d delta: %d\n\r",
+ AppliCtlSet.PresentTemperature16,
+ AppliCtlSet.PresentCtlDelta16);
return MOBLE_RESULT_SUCCESS;
}
@@ -577,6 +640,10 @@ MOBLE_RESULT Appli_Light_GetCtlTemperatureRange(MOBLEUINT8* lCtlTempRange)
*(lCtlTempRange+2) = AppliCtlTemperatureRangeSet.RangeMin >> 8;
*(lCtlTempRange+3) = AppliCtlTemperatureRangeSet.RangeMax;
*(lCtlTempRange+4) = AppliCtlTemperatureRangeSet.RangeMax >>8;
+ TRACE_M(TF_SERIAL_CTRL,"Get Ctl Temperature Range: status: %d Min: %d Max: %d\n\r",
+ AppliCtlTemperatureRangeSet.StatusCode,
+ AppliCtlTemperatureRangeSet.RangeMin,
+ AppliCtlTemperatureRangeSet.RangeMax);
return MOBLE_RESULT_SUCCESS;
}
@@ -596,6 +663,10 @@ MOBLE_RESULT Appli_Light_GetCtlDefaultStatus(MOBLEUINT8* lCtlDefaultState)
*(lCtlDefaultState+3) = AppliCtlDefaultSet.CtlDefaultTemperature16 >>8;
*(lCtlDefaultState+4) = AppliCtlDefaultSet.CtlDefaultDeltaUv;
*(lCtlDefaultState+5) = AppliCtlDefaultSet.CtlDefaultDeltaUv >>8;
+ TRACE_M(TF_SERIAL_CTRL,"Get Ctl Default Status: lightness: %d temp: %d deltaUV: %d\n\r",
+ AppliCtlDefaultSet.CtlDefaultLightness16,
+ AppliCtlDefaultSet.CtlDefaultTemperature16,
+ AppliCtlDefaultSet.CtlDefaultDeltaUv);
return MOBLE_RESULT_SUCCESS;
}
@@ -621,12 +692,14 @@ MOBLE_RESULT Appli_Light_GetHslStatus(MOBLEUINT8* lHslState)
*(lHslState+3) = AppliHslSet.HslHueLightness16 >>8;
*(lHslState+4) = AppliHslSet.HslSaturation16;
*(lHslState+5) = AppliHslSet.HslSaturation16 >>8;
+ TRACE_M(TF_SERIAL_CTRL,"Get Hsl Status: lightness: %d hue: %d saturation: %d\n\r",
+ AppliHslSet.HslLightness16,
+ AppliHslSet.HslHueLightness16,
+ AppliHslSet.HslSaturation16);
return MOBLE_RESULT_SUCCESS;
}
-
-
/**
* @brief Appli_Light_GetHslHueStatus: This function is callback for Application
* to get the application values in middleware used for transition change.
@@ -635,9 +708,10 @@ MOBLE_RESULT Appli_Light_GetHslStatus(MOBLEUINT8* lHslState)
*/
MOBLE_RESULT Appli_Light_GetHslHueStatus(MOBLEUINT8* lHslHueState)
{
-
*(lHslHueState) = AppliHslSet.HslHueLightness16;
*(lHslHueState+1) = AppliHslSet.HslHueLightness16 >>8;
+ TRACE_M(TF_SERIAL_CTRL,"Get Hsl Hue Status: %d\n\r",
+ AppliHslSet.HslHueLightness16);
return MOBLE_RESULT_SUCCESS;
}
@@ -651,13 +725,34 @@ MOBLE_RESULT Appli_Light_GetHslHueStatus(MOBLEUINT8* lHslHueState)
*/
MOBLE_RESULT Appli_Light_GetHslSaturationStatus(MOBLEUINT8* lHslSaturationState)
{
-
*(lHslSaturationState) = AppliHslSet.HslSaturation16;
*(lHslSaturationState+1) = AppliHslSet.HslSaturation16 >>8;
+ TRACE_M(TF_SERIAL_CTRL,"Get Hsl Saturation Status: %d\n\r",
+ AppliHslSet.HslSaturation16);
return MOBLE_RESULT_SUCCESS;
}
+/**
+* @brief Appli_Light_GetHslSatRange: This function is callback for Application
+ to get the application values in middleware used for transition change
+* @param lHslSatRange: Pointer to the status message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Appli_Light_GetHslSatRange(MOBLEUINT8* lHslSatRange)
+{
+ *(lHslSatRange) = AppliHslRangeSet.StatusCode;
+ *(lHslSatRange+1) = AppliHslRangeSet.HslMinSaturation16;
+ *(lHslSatRange+2) = AppliHslRangeSet.HslMinSaturation16 >> 8;
+ *(lHslSatRange+3) = AppliHslRangeSet.HslMaxSaturation16;
+ *(lHslSatRange+4) = AppliHslRangeSet.HslMaxSaturation16 >>8;
+ TRACE_M(TF_SERIAL_CTRL,"Get Hsl Saturation Range: status: %d min: %d max: %d\n\r",
+ AppliHslRangeSet.StatusCode,
+ AppliHslRangeSet.HslMinSaturation16,
+ AppliHslRangeSet.HslMaxSaturation16);
+
+ return MOBLE_RESULT_SUCCESS;
+}
/**
* @brief Appli_Light_GetHslHueRange: This function is callback for Application
@@ -672,43 +767,240 @@ MOBLE_RESULT Appli_Light_GetHslHueRange(MOBLEUINT8* lHslHueRange)
*(lHslHueRange+2) = AppliHslRangeSet.HslHueMinRange16 >> 8;
*(lHslHueRange+3) = AppliHslRangeSet.HslHueMaxRange16;
*(lHslHueRange+4) = AppliHslRangeSet.HslHueMaxRange16 >>8;
+ TRACE_M(TF_SERIAL_CTRL,"Get Hsl Hue Range: status: %d min: %d max: %d\n\r",
+ AppliHslRangeSet.StatusCode,
+ AppliHslRangeSet.HslHueMinRange16,
+ AppliHslRangeSet.HslHueMaxRange16);
return MOBLE_RESULT_SUCCESS;
}
+/******************************************************************************/
+#endif /* ENABLE_LIGHT_MODEL_SERVER_HSL */
+/******************************************************************************/
+
+/* This Function used to initialise the PWM . This is used for the RGB board */
+void Appli_Light_PwmInit()
+{
+
+ Light_UpdateLedValue(RESET_STATE , Appli_LightPwmValue);
+}
+
+#ifdef ENABLE_LIGHT_MODEL_SERVER_HSL
/**
-* @brief Appli_Light_GetHslSatRange: This function is callback for Application
-* to get the application values in middleware used for transition change.
-* @param lHslSatRange: Pointer to the status message
-* @retval MOBLE_RESULT
+* @brief Function to convert the map the RGB values in real values.
+* @param value1: This value corresponds to red led.
+* @param value2: This value corresponds to green led .
+* @param value3: This value corresponds to blue led .
+* @retval void
*/
-MOBLE_RESULT Appli_Light_GetHslSatRange(MOBLEUINT8* lHslSatRange)
-{
- *(lHslSatRange) = AppliHslRangeSet.StatusCode;
- *(lHslSatRange+1) = AppliHslRangeSet.HslMinSaturation16;
- *(lHslSatRange+2) = AppliHslRangeSet.HslMinSaturation16 >> 8;
- *(lHslSatRange+3) = AppliHslRangeSet.HslMaxSaturation16;
- *(lHslSatRange+4) = AppliHslRangeSet.HslMaxSaturation16 >>8;
+void RgbF_Create(MOBLEUINT16 value1, MOBLEUINT16 value2, MOBLEUINT16 value3)
+{
+ Appli_RGBParam.Red_Value = (MOBLEUINT16)(65535 * value1/1000);
+ Appli_RGBParam.Green_Value = (MOBLEUINT16)(65535 * value2/1000);
+ Appli_RGBParam.Blue_Value = (MOBLEUINT16)(65535 * value3/1000);
+}
+
+/**
+* @brief Function to convert the HSL values in RGB values.
+* @param void
+* @retval void
+*/
+void HSL2RGB_Conversion(void)
+{
+
+ MOBLEUINT16 hueValue;
+ float lightnessvalue;
+ float saturationValue;
+ MOBLEUINT16 cValue; /* chroma */
+ MOBLEUINT16 mValue; /* intermediate value used for creating the r,g,b baseline */
+ MOBLEUINT16 xValue; /* intermediate value used for computing r,g,b */
+
+ if(AppliHslSet.HslSaturation16 == 0)
+ {
+ Appli_RGBParam.Red_Value = AppliHslSet.HslLightness16 ;
+ Appli_RGBParam.Green_Value = AppliHslSet.HslLightness16 ;
+ Appli_RGBParam.Blue_Value = AppliHslSet.HslLightness16 ;
+ }
+ else if((AppliHslSet.HslLightness16 == 0xFFFF) || (AppliHslSet.HslLightness16 == 0x00))
+ {
+ Appli_RGBParam.Red_Value = AppliHslSet.HslLightness16 ;
+ Appli_RGBParam.Green_Value = AppliHslSet.HslLightness16 ;
+ Appli_RGBParam.Blue_Value = AppliHslSet.HslLightness16 ;
+ }
+ else
+ {
+ /* Hue is calculated for angular value. so converting in between 0 to 360 degree */
+ hueValue = (MOBLEUINT16)(360 * (float)AppliHslSet.HslHueLightness16/65535);
+ lightnessvalue = (float)AppliHslSet.HslLightness16/65535;
+ saturationValue = (float)AppliHslSet.HslSaturation16/65535;
- return MOBLE_RESULT_SUCCESS;
-}
+ /* Formula to get the values used for RGB conversion */
+ cValue = (MOBLEUINT16)(((1- fabs(2 * lightnessvalue-1))*saturationValue) * 1000);
+ mValue = (MOBLEUINT16)((lightnessvalue * 1000) - (cValue/2));
+ xValue = (MOBLEUINT16)(cValue * (1 - fabs(fmod(hueValue / 60.0, 2.0) - 1)));
+
+ /* Conditons applied for the different angle of hue value */
+ if (hueValue > 0 && hueValue < (HUE_UPPER_LIMIT / 6))
+ {
+ RgbF_Create(cValue + mValue, xValue + mValue, mValue);
+ }
+ else if (hueValue >= (HUE_UPPER_LIMIT / 6) && hueValue < (HUE_UPPER_LIMIT / 3))
+ {
+ RgbF_Create(xValue + mValue, cValue + mValue, mValue);
+ }
+ else if (hueValue >= (HUE_UPPER_LIMIT / 3) && hueValue < (HUE_UPPER_LIMIT / 2))
+ {
+ RgbF_Create(mValue, cValue + mValue, xValue + mValue);
+ }
+ else if (hueValue >= (HUE_UPPER_LIMIT / 2)
+ && hueValue < (2 * HUE_UPPER_LIMIT / 3))
+ {
+ RgbF_Create(mValue, xValue + mValue, cValue + mValue);
+ }
+ else if (hueValue >= (2 * HUE_UPPER_LIMIT / 3)
+ && hueValue < (5 * HUE_UPPER_LIMIT / 6))
+ {
+ RgbF_Create(xValue + mValue, mValue, cValue + mValue);
+ }
+ else if ((hueValue >= (5 * HUE_UPPER_LIMIT / 6) && hueValue <= HUE_UPPER_LIMIT) || (hueValue == 0))
+ {
+ RgbF_Create(cValue + mValue, mValue, xValue + mValue);
+ }
+ else
+ {
+ RgbF_Create(mValue, mValue, mValue);
+ }
+ }
+}
-/******************************************************************************/
-#endif /* ENABLE_LIGHT_MODEL_SERVER_HSL */
-/******************************************************************************/
+#endif
+/**
+* @brief Rgb_LedOffState: This function is called while using CTL, makes all the RGB
+ PWM off state for Application.
+* @param void:
+* @retval void
+*/
+void Rgb_LedOffState(void)
+{
+ Appli_LightPwmValue.PwmRedValue = PWM_VALUE_OFF;
+ Appli_LightPwmValue.PwmGreenValue = PWM_VALUE_OFF;
+ Appli_LightPwmValue.PwmBlueValue = PWM_VALUE_OFF;
+ Appli_LightPwmValue.IntensityValue = PWM_VALUE_OFF;
+}
+/**
+* @brief Ctl_LedOffState: This function is called while using HSL, makes all the
+ cool Warm PWM off state for Application.
+* @param void:
+* @retval void
+*/
+void Ctl_LedOffState(void)
+{
+ Appli_LightPwmValue.PwmWarmValue = PWM_VALUE_OFF;
+ Appli_LightPwmValue.PwmCoolValue = PWM_VALUE_OFF;
+ Appli_LightPwmValue.IntensityValue = PWM_VALUE_OFF;
+}
+
+/**
+* @brief Function to set the values for PWM for RGB board.
+* @param state: decided the state of PWM according to the condition.
+* @retval void
+*/
+void Light_UpdateLedValue(MOBLEUINT8 state ,Appli_LightPwmValue_t light_state)
+{
+
+#ifndef USER_BOARD_1LED
+ if(light_state.IntensityValue > 0)
+ {
+#ifdef USER_BOARD_COOL_WHITE_LED
+ if((light_state.PwmCoolValue == 0) && (light_state.PwmWarmValue == 0))
+ light_state.PwmWarmValue = light_state.IntensityValue;
+#endif
+#ifdef USER_BOARD_RGB_LED
+ if((light_state.PwmRedValue == 0) && (light_state.PwmGreenValue == 0) && (light_state.PwmBlueValue == 0))
+ light_state.PwmBlueValue = light_state.IntensityValue;
+#endif
+ }
+#endif
+
+ if(state == RESUME_STATE)
+ {
+#ifdef USER_BOARD_1LED
+ Modify_PWM(SINGLE_LED, light_state.IntensityValue);
+#endif
+
+#ifdef USER_BOARD_COOL_WHITE_LED
+ Modify_PWM(COOL_LED, light_state.PwmCoolValue);
+ Modify_PWM(WARM_LED, light_state.PwmWarmValue);
+#endif
+
+#ifdef USER_BOARD_RGB_LED
+ Modify_PWM(RED_LED, light_state.PwmRedValue);
+ Modify_PWM(GREEN_LED, light_state.PwmGreenValue);
+ Modify_PWM(BLUE_LED, light_state.PwmBlueValue);
+#endif
+
+ }
+ else if(state == RESET_STATE)
+ {
+#ifdef USER_BOARD_1LED
+ Modify_PWM(SINGLE_LED, PWM_VALUE_OFF);
+#endif
+#ifdef USER_BOARD_COOL_WHITE_LED
+ Modify_PWM(COOL_LED, 0);
+ Modify_PWM(WARM_LED, 0);
+#endif
+#ifdef USER_BOARD_RGB_LED
+ Modify_PWM(RED_LED, PWM_VALUE_OFF);
+ Modify_PWM(GREEN_LED, PWM_VALUE_OFF);
+ Modify_PWM(BLUE_LED, PWM_VALUE_OFF);
+#endif
+ }
+ else if(state == LOAD_STATE)
+ {
+#ifdef USER_BOARD_1LED
+ Modify_PWM(SINGLE_LED, light_state.IntensityValue);
+#endif
+
+#ifdef USER_BOARD_COOL_WHITE_LED
+ Modify_PWM(COOL_LED, light_state.PwmCoolValue);
+ Modify_PWM(WARM_LED, light_state.PwmWarmValue);
+#endif
+#ifdef USER_BOARD_RGB_LED
+ Modify_PWM(RED_LED, light_state.PwmRedValue);
+ Modify_PWM(GREEN_LED, light_state.PwmGreenValue);
+ Modify_PWM(BLUE_LED, light_state.PwmBlueValue);
+#endif
+ }
+ else
+ {
+#ifdef USER_BOARD_1LED
+ Modify_PWM(SINGLE_LED, light_state.IntensityValue);
+#endif
+
+#ifdef USER_BOARD_COOL_WHITE_LED
+ light_state.PwmCoolValue = PWM_DEFAULT_VALUE;
+
+ Modify_PWM(COOL_LED, light_state.PwmCoolValue);
+ Modify_PWM(WARM_LED, light_state.PwmWarmValue);
+#endif
+#ifdef USER_BOARD_RGB_LED
+ Modify_PWM(RED_LED, light_state.PwmRedValue);
+ Modify_PWM(GREEN_LED, light_state.PwmGreenValue);
+ Modify_PWM(BLUE_LED, light_state.PwmBlueValue);
+#endif
+ }
+}
+/**
+* @}
+*/
+/**
+* @}
+*/
+/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
-///**
-// * @}
-// */
-//
-///**
-// * @}
-// */
-//
-///******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
-//
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light.h
index 7b3554951..808e03ff3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light.h
@@ -18,15 +18,95 @@
*/
/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __APPLI_LIGHT_MODEL_H
-#define __APPLI_LIGHT_MODEL_H
+#ifndef __APPLI_LIGHT_H
+#define __APPLI_LIGHT_H
/* Includes ------------------------------------------------------------------*/
#include "types.h"
#include "light.h"
/* Exported macro ------------------------------------------------------------*/
+#define HUE_UPPER_LIMIT 360
/* Exported variables -------------------------------------------------------*/
+
+/* Light Lightness set */
+#pragma pack(1)
+typedef struct
+{
+ MOBLEUINT16 PresentState16;
+ MOBLEUINT16 LastLightness16;
+ MOBLEUINT16 LightnessDefault;
+ MOBLEUINT8 StatusCode;
+ MOBLEUINT16 RangeMin;
+ MOBLEUINT16 RangeMax;
+}Appli_Light_lightnessSet;
+
+
+/* Light Lightness Linear set */
+typedef struct
+{
+ MOBLEUINT16 PresentState16;
+}Appli_Light_lightnessLinearSet;
+
+/* Light Ctl Set */
+typedef struct
+{
+ MOBLEUINT16 PresentLightness16;
+ MOBLEUINT16 PresentTemperature16;
+ MOBLEINT16 PresentCtlDelta16;
+}Appli_Light_CtlSet;
+
+/* Light Ctl Temperature Range Set */
+typedef struct
+{
+ MOBLEUINT8 StatusCode;
+ MOBLEUINT16 RangeMin;
+ MOBLEUINT16 RangeMax;
+}Appli_Light_CtlTemperatureRangeSet;
+
+/* Light Ctl Default set */
+typedef struct
+{
+ MOBLEUINT16 CtlDefaultLightness16;
+ MOBLEUINT16 CtlDefaultTemperature16;
+ MOBLEINT16 CtlDefaultDeltaUv;
+}Appli_Light_CtlDefaultSet;
+
+/* Light Hsl Hue set */
+typedef struct
+{
+ MOBLEUINT16 HslLightness16;
+ MOBLEUINT16 HslHueLightness16;
+ MOBLEUINT16 HslSaturation16;
+}Appli_Light_HslSet;
+
+typedef struct
+{
+ MOBLEUINT16 Red_Value;
+ MOBLEUINT16 Green_Value;
+ MOBLEUINT16 Blue_Value;
+}Appli_Light_RGBSet;
+
+typedef struct
+{
+ MOBLEUINT8 StatusCode;
+ MOBLEUINT16 HslHueMinRange16;
+ MOBLEUINT16 HslHueMaxRange16;
+ MOBLEUINT16 HslMinSaturation16;
+ MOBLEUINT16 HslMaxSaturation16;
+}Appli_Light_HslRangeSet;
+
+typedef struct
+{
+ MOBLEUINT16 IntensityValue;
+ MOBLEUINT16 PwmRedValue;
+ MOBLEUINT16 PwmGreenValue;
+ MOBLEUINT16 PwmBlueValue;
+ MOBLEUINT16 PwmWarmValue;
+ MOBLEUINT16 PwmCoolValue;
+}Appli_LightPwmValue_t;
+#pragma pack(4)
+
/* Exported Functions Prototypes ---------------------------------------------*/
MOBLE_RESULT Appli_Light_Lightness_Set(Light_LightnessStatus_t*, MOBLEUINT8 OptionalValid);
@@ -68,10 +148,15 @@ MOBLE_RESULT Appli_Light_GetHslHueStatus(MOBLEUINT8* lHslHueState);
MOBLE_RESULT Appli_Light_GetHslSaturationStatus(MOBLEUINT8* lHslSaturationState);
MOBLE_RESULT Appli_Light_GetHslHueRange(MOBLEUINT8* lHslHueRange);
MOBLE_RESULT Appli_Light_GetHslSatRange(MOBLEUINT8* lHslSatRange);
-MOBLEUINT16 Light_Actual_LinearBinding(void);
-void Light_Linear_ActualImplicitBinding(MOBLEUINT8 bindingFlag);
+void Appli_Light_PwmInit(void);
+void HSL2RGB_Conversion(void);
+void Ctl_LedOffState(void);
+void Rgb_LedOffState(void);
+void RgbF_Create(MOBLEUINT16 value1, MOBLEUINT16 value2, MOBLEUINT16 value3);
+void Light_UpdateLedValue(MOBLEUINT8 state , Appli_LightPwmValue_t light_state);
+
-#endif /* __APPLI_LIGHT_MODEL_H */
+#endif /* __APPLI_LIGHT_H */
/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light_lc.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light_lc.c
new file mode 100644
index 000000000..b541c256a
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light_lc.c
@@ -0,0 +1,188 @@
+/**
+ ******************************************************************************
+ * @file appli_light_ctrl.c
+ * @author BLE Mesh Team
+ * @brief Application interface for light LC Mesh Models
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "hal_common.h"
+#include "types.h"
+#include "appli_generic.h"
+#include "appli_light.h"
+#include "common.h"
+#include "mesh_cfg_usr.h"
+#include "appli_light_lc.h"
+
+/** @addtogroup BlueNRG_Mesh
+* @{
+*/
+
+/** @addtogroup models_BlueNRG2
+* @{
+*/
+
+/* Private typedef -----------------------------------------------------------*/
+/* Private define ------------------------------------------------------------*/
+/* Private macro -------------------------------------------------------------*/
+/* Private variable ----------------------------------------------------------*/
+
+Appli_LightLC_Set_t Appli_LightLC_set;
+Appli_Light_LC_PropertySet_t Appli_LightLC_PropertySet;
+
+MOBLEUINT16 AmbientLuxLevel;
+/* Private function prototypes -----------------------------------------------*/
+/* Private functions ---------------------------------------------------------*/
+
+/**
+* @brief Appli_Light_LCMode_Set: This function is callback for Application
+when Light LC mode Set message is received
+* @param pLight_LC_Param: Pointer to the parameters received for message
+* @param OptionalValid: Flag to inform about the validity of optional parameters
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Appli_LightLC_Mode_Set(Light_LC_Param_t* pLight_LC_Param,
+ MOBLEUINT8 OptionalValid)
+{
+ Appli_LightLC_set.LC_mode = pLight_LC_Param->LC_mode;
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Appli_LightLC_OM_Set: This function is callback for Application
+when Light LC mode Occupancy Model Set message is received
+* @param pLight_LC_Param: Pointer to the parameters received for message
+* @param OptionalValid: Flag to inform about the validity of optional parameters
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Appli_LightLC_OM_Set(Light_LC_Param_t* pLight_LC_Param,
+ MOBLEUINT8 OptionalValid)
+{
+ Appli_LightLC_set.LC_OM = pLight_LC_Param->LC_OM;
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Appli_LightLC_OnOff_Set: This function is callback for Application
+when Light LC On Off Set message is received
+* @param pLight_LC_Param: Pointer to the parameters received for message
+* @param OptionalValid: Flag to inform about the validity of optional parameters
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Appli_LightLC_OnOff_Set(Light_LC_OnOffState_t* pLight_LC_Param,
+ MOBLEUINT8 OptionalValid)
+{
+ Appli_LightLC_set.Light_OnOffState = pLight_LC_Param->Present_OnOff_State;
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Get_AmbientLuxLevelOutput: This function is given to calculate the Ambient
+ Lux level output from the ambient sensor.
+* @param void:
+* @retval MOBLEUINT16:
+**/
+MOBLEUINT16 Appli_LightLC_Get_AmbientLuxLevelOutput(void)
+{
+ /* Use AmbientLuxLevel global variable to store the value from ambient lux sensor
+ and then use this value to copmpare the lux level output from state machine.
+ */
+
+ return AmbientLuxLevel;
+}
+
+/**
+* @brief Light_LC_LuxLevelPIRegulator: This function will calculate all the parameter
+ Kid,kpu,kiu,kpd and return the value Light Lightness Linear.
+* @param void:
+* @retval MOBLEUINT16:
+**/
+MOBLEUINT16 Appli_Light_LC_PIRegulatorOutput(MOBLEUINT16 tableLuxLevel,MOBLEUINT16 ambientLuxLevel)
+{
+ MOBLEUINT16 luxLevel = 0;
+ /* User can write their code for the calculation */
+
+
+ return luxLevel;
+}
+
+/**
+* @brief Appli_LightLC_Get_ModeStatus: This function is callback for Application
+to get the application values in middleware used for transition change.
+* @param lcModeState: Pointer to the status message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Appli_LightLC_Get_ModeStatus(MOBLEUINT8* plcModeState)
+{
+ *(plcModeState) = Appli_LightLC_set.LC_mode;
+ TRACE_M(TF_SERIAL_CTRL,"Get Mode Status: %d\n\r",
+ Appli_LightLC_set.LC_mode);
+
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Appli_LightLC_Get_OMModeStatus: This function is callback for Application
+to get the application values in middleware used for transition change.
+* @param lcOM_ModeState: Pointer to the status message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Appli_LightLC_Get_OMModeStatus(MOBLEUINT8* plcOM_ModeState)
+{
+ *(plcOM_ModeState) = Appli_LightLC_set.LC_OM;
+ TRACE_M(TF_SERIAL_CTRL,"Get OM Mode Status: %d\n\r",
+ Appli_LightLC_set.LC_OM);
+
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Appli_LightLC_Get_OnOffStatus: This function is callback for Application
+to get the application values in middleware used for transition change.
+* @param lcOnOffState: Pointer to the status message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Appli_LightLC_Get_OnOffStatus(MOBLEUINT8* plcOnOffState)
+{
+ *(plcOnOffState) = Appli_LightLC_set.Light_OnOffState;
+ TRACE_M(TF_SERIAL_CTRL,"Get On Off Status: %d\n\r",
+ Appli_LightLC_set.Light_OnOffState);
+
+
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Appli_LightLC_Get_PropertyStatus: This function is callback for Application
+to get the application values in middleware used for transition change.
+* @param plcPropertyState: Pointer to the status message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Appli_LightLC_Get_PropertyStatus(MOBLEUINT8* plcPropertyState)
+{
+ return MOBLE_RESULT_SUCCESS;
+}
+
+
+/**
+* @}
+*/
+
+/**
+* @}
+*/
+
+/******************* (C) COPYRIGHT 2017 STMicroelectronics *****END OF FILE****/
+
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light_lc.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light_lc.h
new file mode 100644
index 000000000..d91a4cd5e
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light_lc.h
@@ -0,0 +1,92 @@
+/**
+******************************************************************************
+* @file appli_light_ctrl.h
+* @author BLE Mesh Team
+* @version V1.10.000
+* @date 15-Jan-2019
+* @brief Application interface for Light Control Mesh Models
+******************************************************************************
+* @attention
+*
+* <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
+*
+* Redistribution and use in source and binary forms, with or without modification,
+* are permitted provided that the following conditions are met:
+* 1. Redistributions of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+* 3. Neither the name of STMicroelectronics nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+* Initial BlueNRG-Mesh is built over Motorolas Mesh over Bluetooth Low Energy
+* (MoBLE) technology. The present solution is developed and maintained for both
+* Mesh library and Applications solely by STMicroelectronics.
+*
+******************************************************************************
+*/
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __APPLI_LIGHT_LC_H
+#define __APPLI_LIGHT_LC_H
+
+/* Includes ------------------------------------------------------------------*/
+#include "types.h"
+#include "light_lc.h"
+
+
+/* Exported macro ------------------------------------------------------------*/
+/* Exported Functions Prototypes ---------------------------------------------*/
+/*******************************************************************************
+Following Variables are used for the Light LC Mode MODEL
+*******************************************************************************/
+/* Light Lightness set */
+#pragma pack(1)
+typedef struct
+{
+ MOBLEUINT8 LC_mode;
+ MOBLEUINT8 LC_OM;
+ MOBLEUINT8 Light_OnOffState;
+ MOBLEUINT16 Light_OnOffValue;
+}Appli_LightLC_Set_t;
+
+typedef struct
+{
+ MOBLEUINT16 Property_ID;
+ MOBLEUINT16 Property_Value;
+}Appli_Light_LC_PropertySet_t;
+#pragma pack(4)
+
+
+MOBLE_RESULT Appli_LightLC_Mode_Set(Light_LC_Param_t* pLight_LC_Param,
+ MOBLEUINT8 OptionalValid);
+MOBLE_RESULT Appli_LightLC_OM_Set(Light_LC_Param_t* pLight_LC_Param,
+ MOBLEUINT8 OptionalValid);
+MOBLE_RESULT Appli_LightLC_OnOff_Set(Light_LC_OnOffState_t* pLight_LC_Param,
+ MOBLEUINT8 OptionalValid);
+MOBLE_RESULT Appli_LightLC_Get_OnOffStatus(MOBLEUINT8* plcOnOffState);
+MOBLE_RESULT Appli_LightLC_Get_ModeStatus(MOBLEUINT8* plcModeState);
+MOBLE_RESULT Appli_LightLC_Get_OMModeStatus(MOBLEUINT8* plcOM_ModeState);
+MOBLE_RESULT Appli_LightLC_Get_PropertyStatus(MOBLEUINT8* plcPropertyState);
+MOBLEUINT16 Appli_LightLC_Get_AmbientLuxLevelOutput(void);
+MOBLEUINT16 Appli_Light_LC_PIRegulatorOutput(MOBLEUINT16 tableLuxLevel,
+ MOBLEUINT16 ambientLuxLevel);
+
+
+#endif /* __APPLI_LIGHT_LC_H */
+
+/******************* (C) COPYRIGHT 2017 STMicroelectronics *****END OF FILE****/
+
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_mesh.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_mesh.c
index 1a2dd1342..7d500a353 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_mesh.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_mesh.c
@@ -17,6 +17,7 @@
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
+#include "ble_common.h"
#include "app_conf.h"
#include "hal_common.h"
#include "appli_mesh.h"
@@ -27,9 +28,13 @@
#include <string.h>
#include "models_if.h"
#include "mesh_cfg.h"
+#include "generic.h"
+#include "serial_if.h"
+#include "appli_nvm.h"
+//#include "gp_timer.h"
#include "stm32_seq.h"
-
+#include "PWM_config.h"
/** @addtogroup BLE_Mesh
* @{
@@ -46,10 +51,13 @@
#define LONG_PRESS_THRESHOLD 1000U
#define MANUAL_UNPROVISION_TIMER 3000U
#define FLASH_ERASE_TIME 100U
-#define DISCOVER_TIMER 10*60*1000 /* 10 minutes */
+//#define DISCOVER_TIMER 10*60*1000 /* 10 minutes */
+#define DISCOVER_TIMER_INTERVAL /*10*60**/(1000000/CFG_TS_TICK_VAL) /* 10 minutes */
#define DEFAULT_DELAY_PACKET_FROM 500U
#define DEFAULT_DELAY_PACKET_RANDOM_TIME 500U
-
+#define USER_OUTPUT_OOB_APPLI_PROCESS 0U
+#define INPUT_OOB_TIMEOUT 300U /* input Oob30 Sec timeout*/
+#define PBADV_UNPROV_DEV_BEACON_INTERVAL 100U /* 100 ms */
/* Private macro -------------------------------------------------------------*/
#define MAX_APPLI_BUFF_SIZE 8
#define MAX_PENDING_PACKETS_QUE_SIZE 2
@@ -69,17 +77,60 @@ enum ButtonState
BS_OFF,
BS_DEBOUNCE,
BS_SHORT_PRESS,
- BS_LONG_PRESS
+ BS_SHORT_PRESS2,
+ BS_LONG_PRESS,
+ BS_LONG_PRESS2
};
enum ButtonState buttonState = BS_OFF;
tClockTime tBounce = 0;
MOBLEUINT8 Appli_LedState = 0;
+MOBLEUINT16 IntensityValue = INTENSITY_LEVEL_ZERO;
+MOBLEUINT8 IntensityFlag = FALSE;
MOBLEUINT8 ProxyFlag = 0;
MOBLEUINT8 ProvisionFlag = 0;
+
+#ifdef ENABLE_AUTH_TYPE_OUTPUT_OOB
+static MOBLEUINT8 PrvngInProcess = 0;
+static MOBLEUINT32 OutputOobData = 0;
+static MOBLEUINT32 OutputOobBlinkCount = 0;
+#endif
+#ifdef ENABLE_AUTH_TYPE_INPUT_OOB
+MOBLEUINT8 InputOobData[8] = {0};
+MOBLEUINT8 inputOOBDataReady = 0;
+#endif
/*Number Of Elements selected per Node. Maximum Elements supported = 3*/
MOBLEUINT8 NumberOfElements = APPLICATION_NUMBER_OF_ELEMENTS;
+
+#ifdef ENABLE_AUTH_TYPE_STATIC_OOB
+/* 16 octets Static OOB information to be input here. Used during provisioning by Library */
+const MOBLEUINT8 StaticOobBuff[STATIC_OOB_SIZE] = {0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01};
+#else
+const MOBLEUINT8 StaticOobBuff[] = {0};
+#endif
+#ifdef PUB_KEY_TYPE_OOB
+/* 64 octets Public Key information to be input here. It is only required for Public Key OOB case.
+Used during provisioning by Library */
+const MOBLEUINT8 PubKeyBuff[64] = {0xF4, 0x65, 0xE4, 0x3F, 0xF2, 0x3D, 0x3F, 0x1B, 0x9D, 0xC7,
+0xDF, 0xC0, 0x4D, 0xA8, 0x75, 0x81, 0x84, 0xDB, 0xC9, 0x66, 0x20, 0x47, 0x96, 0xEC, 0xCF,
+0x0D, 0x6C, 0xF5, 0xE1, 0x65, 0x00, 0xCC, 0x02, 0x01, 0xD0, 0x48, 0xBC, 0xBB, 0xD8, 0x99,
+0xEE, 0xEF, 0xC4, 0x24, 0x16, 0x4E, 0x33, 0xC2, 0x01, 0xC2, 0xB0, 0x10, 0xCA, 0x6B, 0x4D,
+0x43, 0xA8, 0xA1, 0x55, 0xCA, 0xD8, 0xEC, 0xB2, 0x79};
+
+/* 32 octets Private Key information to be input here. It is only required for Public Key OOB case.
+Used during provisioning by Library */
+const MOBLEUINT8 PrivKeyBuff[32] = {0x52, 0x9A, 0xA0, 0x67, 0x0D, 0x72, 0xCD, 0x64, 0x97, 0x50,
+0x2E, 0xD4, 0x73, 0x50, 0x2B, 0x03, 0x7E, 0x88, 0x03, 0xB5, 0xC6, 0x08, 0x29, 0xA5, 0xA3,
+0xCA, 0xA2, 0x19, 0x50, 0x55, 0x30, 0xBA};
+#else
+const MOBLEUINT8 PubKeyBuff[] = NULL;
+const MOBLEUINT8 PrivKeyBuff[] = NULL;
+#endif
+
+
+
/*Select Node as Sniffer, Means able to sniff all the packets*/
MOBLEUINT8 DisableFilter = 0;
@@ -93,24 +144,43 @@ MOBLEUINT8 nvm_operation;
MOBLEUINT8 nvm_flash_page;
MOBLEUINT8 provisioning_completion;
+/* Timer to control unprovisioned device beacons */
+#if PB_ADV_SUPPORTED
+MOBLEUINT8 discoverTimer_Id;
+#endif
+
/********************* Application configuration **************************/
#if defined(__GNUC__) || defined(__IAR_SYSTEMS_ICC__) || defined(__CC_ARM)
MOBLEUINT8 bdaddr[8];
-extern const MOBLEUINT8 _bdaddr[];
+/* Mesh application data 1 sector used 125 */
+//extern const MOBLEUINT8 _bdaddr[];
+//const void *appNvmBase = _bdaddr;
+
+/* Mesh library configuration 2 sectors used: 126 and 127 */
+//extern const char* _bleNvmBase_data[];
+//const void *mobleNvmBase = _bleNvmBase_data;
#ifdef INTERNAL_UNIQUE_NUMBER_MAC
static void Appli_GetMACfromUniqueNumber(void);
-#endif
+#endif /* INTERNAL_UNIQUE_NUMBER_MAC */
+
+/* NVM addresses for Nucleo 1Mb */
+const void *mobleNvmBase = (const void *)0x0807E000; /* 2 sectors used: 126 and 127 */
+const void *appNvmBase = (const void *)0x0807D000; /* 1 sector used: 125 */
+/* NVM addresses for Nucleo 512Kb */
+//const void *mobleNvmBase = (const void *)0x08056000; /* 2 sectors used: 86 and 87 */
+//const void *appNvmBase = (const void *)0x08055000; /* 1 sector used: 85 */
-extern const char _mobleNvmBase_data[];
-const void *mobleNvmBase = (const void *)0x0807E000;
#else
#error "Unknown compiler"
#endif /* __GNUC__ || defined(__IAR_SYSTEMS_ICC__) || defined(__CC_ARM) */
/* Private function prototypes -----------------------------------------------*/
-static void Appli_LongButtonPress(void);
+//static void Appli_LongButtonPress(void);
static void Appli_ShortButtonPress(void);
+void Appli_OobAuthenticationProcess(void);
+void BLEMesh_UnprovisionCallback(MOBLEUINT8 reason);
+void Appli_LowPowerProcess(void);
/* Private functions ---------------------------------------------------------*/
@@ -125,6 +195,7 @@ static void Appli_ShortButtonPress(void)
BLEMesh_ModelsCommand();
}
+#if 0
/**
* @brief Function calls when a button is pressed for Long duration
* @param void
@@ -134,6 +205,7 @@ static void Appli_LongButtonPress(void)
{
/* User Implementation */
}
+#endif
/**
* @brief Updates the button status
@@ -147,15 +219,14 @@ static void Appli_UpdateButtonState(int isPressed)
{
/* Case for Button State off */
case BS_OFF:
- /* if button is pressed */
if (isPressed)
{
+ /* move to debounce state */
buttonState = BS_DEBOUNCE;
tBounce = Clock_Time();
}
break;
-
- /* Case for Button Debouncing */
+ /* Case for Button Debounce */
case BS_DEBOUNCE:
if (isPressed)
{
@@ -167,33 +238,45 @@ static void Appli_UpdateButtonState(int isPressed)
}
else
{
- break;
+ /* continue to be in BS_DEBOUNCE */
}
}
else
{
buttonState = BS_OFF;
+ }
break;
- }
- /* Case if Button is pressed for small duration */
+ /* Case if Button 1 is pressed for duration > BOUNCE_THRESHOLD */
case BS_SHORT_PRESS:
- if (isPressed && ((Clock_Time() - tBounce) > LONG_PRESS_THRESHOLD))
+ if (isPressed)
+ {
+ if ((Clock_Time() - tBounce) > LONG_PRESS_THRESHOLD)
{
+ /* If Button 1 is pressed for duration > LONG_PRESS_THRESHOLD */
buttonState = BS_LONG_PRESS;
}
else
{
- if (!isPressed)
+ /* continue in same state */
+ }
+ }
+ else
{
+ /* Button 1 short press action */
Appli_ShortButtonPress();
+
+ buttonState = BS_OFF;
}
break;
+ case BS_LONG_PRESS:
+ if (isPressed)
+ {
+ /* Long press action */
+ Appli_IntensityControlPublishing();
}
- /* Case if Button is pressed for long duration */
- case BS_LONG_PRESS:
- if (!isPressed)
+ else
{
- Appli_LongButtonPress();
+ buttonState = BS_OFF;
}
break;
/* Default case */
@@ -201,10 +284,6 @@ static void Appli_UpdateButtonState(int isPressed)
buttonState = BS_OFF;
break;
}
- if (!isPressed)
- {
- buttonState = BS_OFF;
- }
}
/**
@@ -352,6 +431,7 @@ MOBLE_RESULT Appli_BleSetUUIDCb(MOBLEUINT8 *uuid_prefix_data)
memcpy(uuid_prefix_data,uuid_buff,sizeof(uuid_buff));
memcpy(&uuid_prefix_data[10],bdaddr,6); /* Copy bdaddr to last 6 bytes of UUID */
+
return MOBLE_RESULT_SUCCESS;
}
@@ -389,9 +469,13 @@ void Appli_BleGattConnectionCompleteCb(void)
{
ProvisionFlag = 1;
/* Proxy Node, will be called whenever Gatt connection is established */
+ /* Turn ON Red LED*/
ProxyFlag = 1;
-// BSP_LED_On(LED_GREEN);
-
+#if LOW_POWER_FEATURE
+ /* do nothing */
+#else
+ BSP_LED_On(LED_GREEN);
+#endif
}
/**
@@ -403,10 +487,13 @@ void Appli_BleGattDisconnectionCompleteCb(void)
{
ProvisionFlag = 0;
/* Proxy Node, will be called whenever Gatt disconnected */
-
+ /* Turn Off Red LED*/
ProxyFlag = 0;
-// BSP_LED_Off(LED_GREEN);
-
+#if LOW_POWER_FEATURE
+ /* do nothing */
+#else
+ BSP_LED_Off(LED_GREEN);
+#endif
}
/**
@@ -416,9 +503,10 @@ void Appli_BleGattDisconnectionCompleteCb(void)
*/
void Appli_BleUnprovisionedIdentifyCb(MOBLEUINT8 data)
{
-#ifndef DISABLE_TRACES
- printf("Unprovisioned Node Identifier received: %02x\n\r", data);
+#ifdef ENABLE_AUTH_TYPE_OUTPUT_OOB
+ PrvngInProcess = 1;
#endif
+ TRACE_M(TF_PROVISION,"Unprovisioned Node Identifier received: %02x\n\r", data);
}
/**
@@ -430,9 +518,7 @@ MOBLEUINT8 Appli_BleSetNumberOfElementsCb(void)
{
if(NumberOfElements > MAX_NUMB_ELEMENTS)
{
-#ifndef DISABLE_TRACES
- printf("Currently Three Elements per node are supported!\r\n");
-#endif
+ TRACE_M(TF_ELEMENTS,"Currently Three Elements per node are supported!\r\n");
return MAX_NUMB_ELEMENTS;
}
else
@@ -448,11 +534,97 @@ MOBLEUINT8 Appli_BleSetNumberOfElementsCb(void)
*/
MOBLE_RESULT Appli_BleAttentionTimerCb(void)
{
-#ifndef DISABLE_TRACES
- printf("Attention timer callback received \r\n");
+/* avoid printf, if low power feature is supported */
+#if (LOW_POWER_FEATURE == 0)
+ TRACE_M(TF_MISC, " \r\n");
+#endif /* LOW_POWER_FEATURE == 0 */
+ return MOBLE_RESULT_SUCCESS;
+}
+/**
+* @brief Call back function to give Output OOB information
+* @param MOBLEUINT8* output_oob
+* @param MOBLEUINT8 size
+* @retval void
+*/
+void Appli_BleOutputOOBAuthCb(MOBLEUINT8* output_oob, MOBLEUINT8 size)
+{
+#ifdef ENABLE_AUTH_TYPE_OUTPUT_OOB
+ uint32_t ooBData = 0;
+ for (MOBLEUINT8 i = 0; i < size; i++)
+ {
+ ooBData |= (output_oob[i] << 8*i);
+ }
+ OutputOobData = ooBData;
+ TRACE_M(TF_PROVISION,"Output OOB information for provisioner: %ld\n\r", ooBData);
#endif
+}
- return MOBLE_RESULT_SUCCESS;
+#ifdef ENABLE_AUTH_TYPE_OUTPUT_OOB
+/**
+* @brief Process for both output and Input OOB handling
+* @param void
+* @retval void
+*/
+void Appli_OobAuthenticationProcess(void)
+{
+ if(OutputOobBlinkCount < OutputOobData)
+ {
+ OutputOobBlinkCount++;
+ Appli_LedBlink();
+ }
+ else
+ {
+ OutputOobBlinkCount++;
+ Clock_Wait(1000);
+ if(OutputOobBlinkCount > OutputOobData+3)
+ {
+ OutputOobBlinkCount = 0;
+ }
+ }
+}
+#endif
+/**
+* @brief Call back function to provide Input OOB information
+* @param MOBLEUINT8 size
+* @retval MOBLEUINT8*
+*/
+
+MOBLEUINT8* Appli_BleInputOOBAuthCb(MOBLEUINT8 size)
+{
+#if defined (ENABLE_AUTH_TYPE_INPUT_OOB) && (ENABLE_SERIAL_INTERFACE)
+ MOBLEUINT16 inputTimer = 0;
+ TRACE_M(TF_PROVISION,"Input OOB information for provisioner-Size: %d\n\r", size);
+ while(1)
+ {
+ Serial_InterfaceProcess();
+ /* Check if input is completed or timeout */
+ if((inputOOBDataReady != 0x00) | (inputTimer > INPUT_OOB_TIMEOUT))
+ {
+ inputOOBDataReady = 0;
+ break;
+ }
+ Clock_Wait(100);
+ inputTimer++;
+ }
+ return InputOobData;
+#else
+ return NULL;
+#endif
+}
+/**
+* @brief Call back function to provide Input OOB information
+* @param rcvdStringBuff: buffer to store input string
+* @param rcvdStringSize: length of the input string
+* @retval void
+*/
+void Appli_BleSerialInputOOBValue(char *rcvdStringBuff, uint16_t rcvdStringSize)
+{
+#ifdef ENABLE_AUTH_TYPE_INPUT_OOB
+ unsigned long long InputOobDatatemp;
+ sscanf(rcvdStringBuff + 5, "%lld", &InputOobDatatemp);
+ memmove(&InputOobData, &InputOobDatatemp, sizeof(InputOobDatatemp));
+ inputOOBDataReady = 1;
+#endif
}
/**
@@ -493,11 +665,13 @@ void Appli_CheckForUnprovision(void)
if (!interrupted)
{
BLEMesh_Unprovision();
-#ifndef DISABLE_TRACES
- printf("Device is unprovisioned by application \r\n");
-#endif
+ AppliNvm_ClearModelState();
+ TRACE_M(TF_PROVISION,"Device is unprovisioned by application \r\n");
t = Clock_Time();
- while ((Clock_Time() - t) < FLASH_ERASE_TIME);
+ while ((Clock_Time() - t) < FLASH_ERASE_TIME)
+ {
+ BLEMesh_Process();
+ }
while (BSP_PB_GetState(BUTTON_SW1) == BUTTON_PRESSED)
{
@@ -514,18 +688,6 @@ void Appli_CheckForUnprovision(void)
}
/**
-* @brief Application processing
-* This function should be called in main loop
-* @param void
-* @retval void
-*/
-void Appli_Process(void)
-{
- Appli_UpdateButtonState(BSP_PB_GetState(BUTTON_SW1) == BUTTON_PRESSED);
-}
-
-
-/**
* @brief Checks and updates Mac address to generate MAC Address
* @param void
* @retval MOBLEUINT8 sum return the sum calculated mac
@@ -537,7 +699,7 @@ int Appli_CheckBdMacAddr(void)
#ifdef EXTERNAL_MAC_ADDR_MGMT
memcpy(bdaddr, (MOBLEUINT8 *)CFG_ADV_BD_ADDRESS, 7);
- bdaddr[7] = EXTERNAL_MAC_ADDR_MGMT;
+ bdaddr[7] = (EXTERNAL_MAC_ADDR_MGMT | EXTERNAL_MAC_TYPE);
#endif
#ifdef INTERNAL_UNIQUE_NUMBER_MAC
@@ -556,9 +718,13 @@ int Appli_CheckBdMacAddr(void)
result = 1;
}
-#ifdef GENERATE_STATIC_RANDOM_MAC
+#if defined(EXTERNAL_MAC_ADDR_MGMT) && defined(EXTERNAL_MAC_IS_PUBLIC_ADDR)
+ /* Do nothing for modification of 2 MSb */
+#else
bdaddr[5] |= 0xC0; /* 2 Msb bits shall be 11b for Static Random Address */
+#endif
+#ifdef GENERATE_STATIC_RANDOM_MAC
bdaddr[7] = GENERATE_STATIC_RANDOM_MAC;
/* Do nothing for bdaddr, just pass the identification */
result = 1; /* This will overwrite the above for loop result,
@@ -623,18 +789,38 @@ static void Appli_GetMACfromUniqueNumber(void)
#endif
+#if 0
+/**
+* @brief provides the information of the power saving mode
+* @param sleepMode curently unused, to be used in future
+* @retval SleepModes returns the mode of the controller
+*/
+SleepModes App_SleepMode_Check(SleepModes sleepMode)
+{
+ if (buttonState == BS_OFF)
+ {
+ return SLEEPMODE_WAKETIMER;
+ }
+ else
+ {
+ return SLEEPMODE_RUNNING;
+ }
+}
+#endif
+
/**
* @brief callback for unprovision the node by provisioner.
* @param status reserved for future
* @retval void
*/
-void BLEMesh_UnprovisionCallback(MOBLEUINT8 status)
+void BLEMesh_UnprovisionCallback(MOBLEUINT8 reason)
{
ProvisionFlag = 0;
-
-#ifndef DISABLE_TRACES
- printf("Device is unprovisioned by provisioner \n\r");
+ TRACE_M(TF_PROVISION,"Device is unprovisioned by provisioner \n\r");
+#if PB_ADV_SUPPORTED
+ BLEMesh_SetUnprovisionedDevBeaconInterval(100);
#endif
+ AppliNvm_ClearModelState();
}
/**
@@ -645,9 +831,10 @@ void BLEMesh_UnprovisionCallback(MOBLEUINT8 status)
void BLEMesh_ProvisionCallback(void)
{
ProvisionFlag = 1;
-#ifndef DISABLE_TRACES
- printf("Device is provisioned by provisioner \r\n");
+#ifdef ENABLE_AUTH_TYPE_OUTPUT_OOB
+ PrvngInProcess = 0;
#endif
+ TRACE_M(TF_PROVISION,"Device is provisioned by provisioner \r\n");
}
/**
@@ -868,6 +1055,223 @@ void BLEMesh_NeighborRefreshedCallback(const MOBLEUINT8* bdAddr,
}
/**
+* @brief Appli_IntensityControl:Function to increase the intensity of led by
+* Publishing the value.
+* @param void
+*/
+void Appli_IntensityControlPublishing(void)
+{
+ MOBLEUINT8 generic_Level_Buff[3];
+ MOBLE_ADDRESS publishAddress;
+ MOBLEUINT8 elementNumber;
+ MOBLEUINT8 elementIndex;
+
+ /*Select the Element Number for which publication address is required*/
+
+ if (NumberOfElements == 1)
+ {
+ elementNumber = 0x01;
+ }
+
+ else if(NumberOfElements == 2)
+ {
+ elementNumber = 0x02; /*Element 2 is configured as switch*/
+ }
+
+ else if(NumberOfElements == 3)
+ {
+ elementNumber = 0x03; /*Element 3 is configured as switch*/
+ }
+
+ else
+ {
+ elementNumber = 0x01;
+ }
+
+ publishAddress = BLEMesh_GetPublishAddress(elementNumber);
+ elementIndex = elementNumber-1;
+
+ TRACE_M(TF_MISC,"IntensityFlag %d\n\r", IntensityFlag);
+
+ if(IntensityFlag == FALSE)
+ {
+
+ IntensityValue = IntensityValue + (INTENSITY_LEVEL_FULL/5);
+ generic_Level_Buff[0] = (MOBLEUINT8)IntensityValue;
+ generic_Level_Buff[1] = (MOBLEUINT8)(IntensityValue >> 8) ;
+
+ TRACE_M(TF_MISC,"IntensityValue %d\n\r", IntensityValue);
+
+ BLEMesh_SetRemoteData(publishAddress, elementIndex, GENERIC_LEVEL_SET_UNACK ,
+ generic_Level_Buff,3, MOBLE_FALSE, MOBLE_FALSE);
+
+ if(IntensityValue >= INTENSITY_LEVEL_FULL)
+ {
+ IntensityFlag = TRUE;
+ }
+
+ }
+ else
+ {
+
+ IntensityValue = IntensityValue - (INTENSITY_LEVEL_FULL/5);
+ generic_Level_Buff[0] = (MOBLEUINT8)IntensityValue;
+ generic_Level_Buff[1] = (MOBLEUINT8)(IntensityValue >> 8) ;
+
+ TRACE_M(TF_MISC,"IntensityValue %d\n\r", IntensityValue);
+
+ BLEMesh_SetRemoteData(publishAddress, elementIndex, GENERIC_LEVEL_SET_UNACK,
+ generic_Level_Buff, 3, MOBLE_FALSE, MOBLE_FALSE);
+
+ if(IntensityValue <= INTENSITY_LEVEL_ZERO)
+ {
+ IntensityFlag = FALSE;
+ }
+
+ }
+}
+
+/**
+* @brief Low Power mode process
+* If low power feature is supported, device enables low power mode
+* @param void
+* @retval void
+*/
+void Appli_LowPowerProcess(void)
+{
+#if 0
+#if LOW_POWER_FEATURE
+ BluenrgMesh_sleepTime = (MOBLEINT32)BluenrgMesh_GetSleepDuration();
+
+ if (BluenrgMesh_sleepTime > 0)
+ {
+ /* Timer 0 used for low power */
+ HAL_VTimerStart_ms(0, BluenrgMesh_sleepTime);
+
+ /* To start virtual timer */
+ BTLE_StackTick();
+
+ /* save virtual timer current count */
+ SysRefCount = HAL_VTimerGetCurrentTime_sysT32();
+
+ /* wakeup either from io or virtual timer */
+ BlueNRG_Sleep(SLEEPMODE_WAKETIMER, WAKEUP_IO13, WAKEUP_IOx_LOW);
+
+ /* update systick count based on updated virtual timer count */
+ Set_Clock_Time(Clock_Time() +
+ HAL_VTimerDiff_ms_sysT32(HAL_VTimerGetCurrentTime_sysT32(), SysRefCount));
+
+ /* Stop Timer 0 */
+ HAL_VTimer_Stop(0);
+ }
+#endif /* LOW_POWER_FEATURE */
+#endif
+}
+
+/**
+* @brief Application processing
+* This function should be called in main loop
+* @param void
+* @retval void
+*/
+void Appli_Process(void)
+{
+ Appli_UpdateButtonState(BSP_PB_GetState(BUTTON_SW1) == BUTTON_PRESSED);
+
+ Appli_LowPowerProcess();
+
+#ifdef ENABLE_AUTH_TYPE_OUTPUT_OOB
+ if(PrvngInProcess)
+ {
+#if USER_OUTPUT_OOB_APPLI_PROCESS
+ Appli_OobAuthenticationProcess();
+#endif
+ }
+#endif
+#ifdef ENABLE_SAVE_MODEL_STATE_NVM
+ AppliNvm_Process();
+#endif
+
+}
+
+#if PB_ADV_SUPPORTED
+static void UnprovisionedDeviceBeaconApp(void)
+{
+ BLEMesh_SetUnprovisionedDevBeaconInterval(0);
+}
+
+static void UnprovisionedDeviceBeaconTask(void)
+{
+ /**
+ * The code shall be executed in the background as aci command may be sent
+ * The background is the only place where the application can make sure a new aci command
+ * is not sent if there is a pending one
+ */
+ UTIL_SEQ_SetTask( 1<<CFG_TASK_MESH_BEACON_REQ_ID, CFG_SCH_PRIO_0);
+
+ return;
+}
+#endif
+
+#ifdef SAVE_MODEL_STATE_POWER_FAILURE_DETECTION
+/**
+* @brief function to inintiallise the GPIO interrupt fot Power down
+* @param void
+* @retval void
+*/
+static void GPIO_InitNVICPowerOff(void)
+{
+ GPIO_InitTypeDef gpioinitstruct = {0};
+
+ /* Enable the PowerOff GPIO Clock */
+ POWEROFF_GPIO_CLK_ENABLE();
+
+ /* Configure PowerOff pin as input with External interrupt */
+ gpioinitstruct.Pin = POWEROFF_PIN;
+ gpioinitstruct.Pull = GPIO_PULLUP;
+ gpioinitstruct.Mode = GPIO_MODE_IT_FALLING;
+ HAL_GPIO_Init(POWEROFF_GPIO_PORT, &gpioinitstruct);
+
+ /* Enable and set PowerOff EXTI Interrupt to the lowest priority */
+ HAL_NVIC_SetPriority((IRQn_Type)(POWEROFF_EXTI_IRQn), 0x0F, 0x00);
+ HAL_NVIC_EnableIRQ((IRQn_Type)(POWEROFF_EXTI_IRQn));
+}
+#endif
+
+/**
+* @brief Initializes the Application
+* @param void
+* @retval void
+*/
+void Appli_Init(void)
+{
+#ifdef ENABLE_UNPROVISIONING_BY_POWER_ONOFF_CYCLE
+ /* Hardware Factory Restore implementation */
+ AppliNvm_FactorySettingReset();
+#endif
+
+#if PB_ADV_SUPPORTED
+ UTIL_SEQ_RegTask( 1<< CFG_TASK_MESH_BEACON_REQ_ID, UTIL_SEQ_RFU, UnprovisionedDeviceBeaconApp );
+ /**
+ * Create Timer to control unprovisioned device beacons
+ */
+ HW_TS_Create(CFG_TIM_PROC_ID_ISR, &discoverTimer_Id, hw_ts_SingleShot, UnprovisionedDeviceBeaconTask);
+
+ HW_TS_Start(discoverTimer_Id, DISCOVER_TIMER_INTERVAL);
+#endif
+#if ENABLE_SERIAL_INTERFACE
+ Serial_Init();
+#endif
+#ifdef SAVE_MODEL_STATE_POWER_FAILURE_DETECTION
+ GPIO_InitNVICPowerOff();
+#endif
+
+ __HAL_RCC_TIM1_CLK_ENABLE();
+ __HAL_RCC_TIM2_CLK_ENABLE();
+ PWM_Init();
+}
+
+/**
* @}
*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_mesh.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_mesh.h
index a54fff4dc..b56d3dd9e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_mesh.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_mesh.h
@@ -23,6 +23,7 @@
/* Includes ------------------------------------------------------------------*/
#include "types.h"
+#include "mesh_cfg_usr.h"
/* Exported macro ------------------------------------------------------------*/
/* MACROS for Power Level definitions */
@@ -44,6 +45,15 @@
#define TX_POWER_LEVEL_PLUS_4DBM 6 /* = 4 dBm, */
#define TX_POWER_LEVEL_PLUS_8DBM 7 /* = 8 dBm */
+#ifdef SAVE_MODEL_STATE_POWER_FAILURE_DETECTION
+#define POWEROFF_PIN GPIO_PIN_4
+#define POWEROFF_GPIO_PORT GPIOB
+#define POWEROFF_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
+#define POWEROFF_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
+#define POWEROFF_EXTI_LINE GPIO_PIN_4
+#define POWEROFF_EXTI_IRQn EXTI2_IRQn
+#endif
+
/* Exported variables ------------------------------------------------------- */
extern MOBLEUINT8 bdaddr[];
@@ -58,8 +68,12 @@ void Appli_BleGattConnectionCompleteCb(void);
void Appli_BleGattDisconnectionCompleteCb(void);
MOBLEUINT8 Appli_BleSetNumberOfElementsCb(void);
MOBLE_RESULT Appli_BleAttentionTimerCb(void);
+void Appli_BleOutputOOBAuthCb(MOBLEUINT8* output_oob, MOBLEUINT8 size);
+MOBLEUINT8* Appli_BleInputOOBAuthCb(MOBLEUINT8 size);
+void Appli_BleSerialInputOOBValue(char *rcvdStringBuff, uint16_t rcvdStringSize);
MOBLEUINT8 Appli_BleDisableFilterCb(void);
+void Appli_IntensityControlPublishing(void);
int Appli_CheckBdMacAddr(void);
MOBLE_RESULT Appli_LedBlink(void);
@@ -68,7 +82,7 @@ MOBLE_RESULT Appli_LedStateCtrlCb(MOBLEUINT16 ctrl);
void Appli_CheckForUnprovision(void);
void Appli_Process(void);
void Appli_LedCtrl(void);
-
+void Appli_Init(void);
#endif /* __APPLI_MESH_H */
/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_nvm.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_nvm.c
index 6566aa711..7379df8ae 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_nvm.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_nvm.c
@@ -1,9 +1,9 @@
/**
- ******************************************************************************
- * @file appli_nvm.c
- * @author BLE Mesh Team
- * @brief User Application file
- ******************************************************************************
+ ******************************************************************************
+ * @file appli_nvm.c
+ * @author BLE Mesh Team
+ * @brief User Application file
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
@@ -20,16 +20,25 @@
/* Includes ------------------------------------------------------------------*/
#include <string.h>
#include "hal_common.h"
+#include "ble_mesh.h"
#include "appli_nvm.h"
#include "mesh_cfg.h"
+#include "pal_nvm.h"
#include "appli_mesh.h"
+#ifdef SAVE_MODEL_STATE_FOR_ALL_MESSAGES
+#include "common.h"
+#endif
extern const MOBLEUINT8* _bdaddr[];
-extern const void* bnrgmNvmBase;
+//extern const void* mobleNvmBase;
+#ifdef SAVE_MODEL_STATE_FOR_ALL_MESSAGES
+extern MOBLEUINT8 PowerOnOff_flag;
+#endif
+extern const void* appNvmBase;
/* Reserved for Bluenrg-Mesh library */
-#define BLUENRGMESH_NVM_BASE ((unsigned int)bnrgmNvmBase)
-#define BLUENRGMESH_NVM_BACKUP_BASE (BLUENRGMESH_NVM_BASE + PAGE_SIZE)
+//#define BLUENRGMESH_NVM_BASE ((unsigned int)mobleNvmBase)
+//#define BLUENRGMESH_NVM_BACKUP_BASE (BLUENRGMESH_NVM_BASE + PAGE_SIZE)
/*
* Page of size 2k, BlueNRG-1 and BlueNRG-2, reserved for application is divided into 8 subpages of each 256 bytes
@@ -37,11 +46,14 @@ extern const void* bnrgmNvmBase;
* Rest 7 subpages are used on rolling basis for application states.
* First byte of each subpage indicates if page is valid or not
*/
-#define APP_NVM_BASE ((unsigned int)_bdaddr)
+//#define APP_NVM_BASE ((unsigned int)_bdaddr)
+#define APP_NVM_BASE ((unsigned int)appNvmBase)
+#define APP_NVM_SIZE 0x00001000
+
#define APP_NVM_RESERVED_SIZE 256U
#define APP_NVM_SUBPAGE_SIZE 256U
-#define APP_NVM_MAX_SUBPAGE 7U
-#define APP_NVM_SUBPAGE_OFFSET(i) (unsigned int)(APP_NVM_BASE+APP_NVM_RESERVED_SIZE+256*i)
+#define APP_NVM_MAX_SUBPAGE 15U
+#define APP_NVM_SUBPAGE_OFFSET(i) (unsigned int)(APP_NVM_RESERVED_SIZE+256*(i))
/* offsets defined wrt start of subpage */
#define APP_NVM_VALID_FLAG_OFFSET 0U
@@ -53,34 +65,51 @@ extern const void* bnrgmNvmBase;
#define APP_NVM_LIGHT_MODEL_OFFSET (unsigned int)(APP_NVM_VALID_FLAG_SIZE+APP_NVM_RESET_COUNT_SIZE+APP_NVM_GENERIC_MODEL_SIZE)
#define APP_NVM_LIGHT_MODEL_SIZE 16U
+/* Private variables ---------------------------------------------------------*/
+typedef struct
+{
+ MOBLEUINT8 modelData[APP_NVM_GENERIC_MODEL_SIZE+APP_NVM_LIGHT_MODEL_SIZE];
+ MOBLEBOOL erasePageReq;
+ MOBLEBOOL writeReq;
+} APPLI_NVM_REQS;
+
+APPLI_NVM_REQS AppliNvm_Reqs;
+
MOBLE_RESULT AppliNvm_EraseRestoreResvNvm(void);
+MOBLE_RESULT AppliNvm_FindFirstValidSubPage(MOBLEINT8* subPageIndex);
+MOBLE_RESULT AppliNvm_MarkSubpageInvalid(void);
+MOBLE_RESULT AppliNvm_FlashProgram(MOBLEUINT32 offset, void const *buf, MOBLEUINT32 size);
+MOBLE_RESULT AppliNvm_LoadGenericState(uint8_t state[], uint8_t* size);
+MOBLE_RESULT AppliNvm_LoadLightState(uint8_t state[], uint8_t* size);
+#if 0
/**
* @brief This function erases a specified flash page
-* @param void
-* @retval MOBLE_RESULT_SUCCESS on success
+* @param Page Number
+* @retval MOBLE_RESULT_INVALIDARG if PageNumber overflow
+* MOBLE_RESULT_FALSE if flash operation is very close to next radio event
+* MOBLE_RESULT_FAIL if flash command error is set
+* MOBLE_RESULT_SUCCESS on success
*/
-MOBLE_RESULT AppliNvm_FlashErase(void)
+MOBLE_RESULT AppliNvm_FlashErase(uint16_t PageNumber)
{
- if(BluenrgMesh_IsFlashReadyToErase())
+ MOBLE_RESULT result;
+
+ if (PageNumber < N_PAGES)
{
BLEMesh_StopAdvScan();
- FLASH_ErasePage((uint16_t)((APP_NVM_BASE - RESET_MANAGER_FLASH_BASE_ADDRESS) / PAGE_SIZE));
-
- if (FLASH_GetFlagStatus(Flash_CMDERR) == SET)
- {
- return MOBLE_RESULT_FAIL;
- }
- else
- {
- return MOBLE_RESULT_SUCCESS;
- }
+ ATOMIC_SECTION_BEGIN();
+ result = MoblePalNvmErase(APP_NVM_BASE, 0);
+ ATOMIC_SECTION_END();
}
- else
+ else /* Invalid page no */
{
- return MOBLE_RESULT_FALSE;
+ result = MOBLE_RESULT_INVALIDARG;
}
+
+ return result;
}
+#endif
/**
* @brief Program word (32-bit) at a APP_NVM_BASE + APP_NVM_RESERVED_SIZE
@@ -89,34 +118,37 @@ MOBLE_RESULT AppliNvm_FlashErase(void)
* @param Data: word to write
* @retval MOBLE_RESULT_SUCCESS on success
*/
-MOBLE_RESULT AppliNvm_FlashProgram(uint32_t TypeProgram, uint32_t Address, uint32_t Data[])
+//MOBLE_RESULT AppliNvm_FlashProgram(uint32_t TypeProgram, uint32_t Address, uint32_t Data[])
+MOBLE_RESULT AppliNvm_FlashProgram(MOBLEUINT32 offset, void const *buf, MOBLEUINT32 size)
{
- if (Address < (APP_NVM_BASE)
- || Address > (APP_NVM_BASE + PAGE_SIZE)
- || (Address & 0x03 != 0))
- {
- return MOBLE_RESULT_INVALIDARG;
- }
- else
- {
- if(TypeProgram == FLASH_WRITE)
- {
- /* Program 4 bytes (32-bit) at a specified address.*/
- FLASH_ProgramWord(Address, (uint32_t) Data[0]);
- }
- else if(TypeProgram == FLASH_BURSTWRITE)
- {
- /*Program 4 words (128-bit) at a specified address.*/
- FLASH_ProgramWordBurst(Address, (uint32_t*) Data);
- }
- }
-
- if (FLASH_GetFlagStatus(Flash_CMDERR) == SET)
- {
- return MOBLE_RESULT_FAIL;
- }
-
- return MOBLE_RESULT_SUCCESS;
+ MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
+
+ if (offset > PAGE_SIZE)
+ {
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else if (size == 0)
+ {
+ result = MOBLE_RESULT_FALSE;
+ }
+ else if (offset + size > (APP_NVM_BASE + PAGE_SIZE))
+ {
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else if (offset & 3)
+ {
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else if (size & 3)
+ {
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else
+ {
+ result = MoblePalNvmWrite(APP_NVM_BASE, offset, buf, size);
+ }
+
+ return result;
}
/**
@@ -127,15 +159,17 @@ MOBLE_RESULT AppliNvm_FlashProgram(uint32_t TypeProgram, uint32_t Address, uint3
*/
MOBLE_RESULT AppliNvm_FindFirstValidSubPage(MOBLEINT8* subPageIndex)
{
- MOBLEUINT32 valid;
+ MOBLEUINT32 valid[2];
MOBLEINT8 subPageIdx = -1;
MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
/* find valid subpage */
for (MOBLEUINT8 count=0; count<APP_NVM_MAX_SUBPAGE; count++)
{
- memcpy((void*)&valid, (void*)(APP_NVM_SUBPAGE_OFFSET(count)), 4);
- if (valid == 0xFFFFFFFF)
+ unsigned int offset = APP_NVM_SUBPAGE_OFFSET(count);
+
+ memcpy((void*)&valid, (void*)(APP_NVM_BASE + offset), 8);
+ if ((valid[0] == 0xFFFFFFFF) && ((valid[1] == 0xFFFFFFFF)))
{
subPageIdx = count;
break;
@@ -145,8 +179,8 @@ MOBLE_RESULT AppliNvm_FindFirstValidSubPage(MOBLEINT8* subPageIndex)
/* if no valid subpage found, erase all subpages and reset subPageIdx */
if (subPageIdx < 0)
{
- result = AppliNvm_EraseRestoreResvNvm();
- subPageIdx = 0;
+ AppliNvm_Reqs.erasePageReq = MOBLE_TRUE;
+ result = MOBLE_RESULT_FAIL;
}
else
{
@@ -160,80 +194,44 @@ MOBLE_RESULT AppliNvm_FindFirstValidSubPage(MOBLEINT8* subPageIndex)
/**
* @brief Mark first valid subpage as invalid.
-* If no valid subpage found, erase page appli nvm to reset it
-* Also copy model data from current subpage into new subpage
-* It is assumed that all models are consecutive in memory
-* @param model backup flag. If true, copy model states from current subpage to new subpage
+* @param void
* @retval MOBLE_RESULT_SUCCESS on success
*/
-MOBLE_RESULT AppliNvm_MarkSubpageInvalid(MOBLEBOOL modelBackup)
+MOBLE_RESULT AppliNvm_MarkSubpageInvalid(void)
{
MOBLEUINT32 valid = 0;
MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
MOBLEINT8 currSubPageIdx;
- MOBLEINT8 newSubPageIdx;
- MOBLEUINT8 modelBackupData[APP_NVM_GENERIC_MODEL_SIZE+APP_NVM_LIGHT_MODEL_SIZE];
+ MOBLEUINT8 subPageTemp[APP_NVM_SUBPAGE_SIZE];
/* find valid subpage */
result = AppliNvm_FindFirstValidSubPage(&currSubPageIdx);
- if (MOBLE_FAILED(result))
+ if (result != MOBLE_RESULT_SUCCESS)
{
- result = MOBLE_RESULT_FAIL;
+ /* do nothing */
}
else
{
- if (modelBackup == MOBLE_TRUE)
- {
- /* copy model data from current subpage*/
- memcpy((void*)modelBackupData,
- (void*)(APP_NVM_SUBPAGE_OFFSET(currSubPageIdx)+APP_NVM_GENERIC_MODEL_OFFSET),
- APP_NVM_GENERIC_MODEL_SIZE+APP_NVM_LIGHT_MODEL_SIZE);
- }
-
/* mark valid subpage as invalid */
- AppliNvm_FlashProgram(FLASH_WRITE,
- APP_NVM_SUBPAGE_OFFSET(currSubPageIdx)+APP_NVM_VALID_FLAG_OFFSET,
- (uint32_t*)&valid);
-
- /* find next valid subpage */
- result = AppliNvm_FindFirstValidSubPage(&newSubPageIdx);
-
+ memcpy((void*)subPageTemp,
+ (void*)(APP_NVM_SUBPAGE_OFFSET(currSubPageIdx)),
+ APP_NVM_SUBPAGE_SIZE);
+ subPageTemp[APP_NVM_VALID_FLAG_OFFSET] = valid;
+ result = AppliNvm_FlashProgram(APP_NVM_SUBPAGE_OFFSET(currSubPageIdx),
+ (uint32_t*)&subPageTemp,
+ APP_NVM_SUBPAGE_SIZE);
if (MOBLE_FAILED(result))
{
result = MOBLE_RESULT_FAIL;
}
- else if (modelBackup == MOBLE_TRUE)
+ else if (result == MOBLE_RESULT_FALSE)
{
- /* update model data in new subpage */
- for (MOBLEUINT32 count=0; count<APP_NVM_GENERIC_MODEL_SIZE+APP_NVM_LIGHT_MODEL_SIZE; )
- {
- if (FLASH_GetFlagStatus(Flash_CMDERR) == RESET)
- {
- /* If size to be written > 4 words, use FLASH_ProgramWordBurst*/
- if (APP_NVM_GENERIC_MODEL_SIZE+APP_NVM_LIGHT_MODEL_SIZE-count >= 4*N_BYTES_WORD)
- {
- AppliNvm_FlashProgram(FLASH_BURSTWRITE,
- APP_NVM_SUBPAGE_OFFSET(newSubPageIdx)+APP_NVM_GENERIC_MODEL_OFFSET+count,
- (uint32_t*)&modelBackupData[count]);
- count += 4*N_BYTES_WORD;
- }
- /* If size to be written < 4 words, use FLASH_ProgramWord*/
- else
- {
- AppliNvm_FlashProgram(FLASH_WRITE,
- APP_NVM_SUBPAGE_OFFSET(newSubPageIdx)+APP_NVM_GENERIC_MODEL_OFFSET+count,
- (uint32_t*)&modelBackupData[count]);
- count += N_BYTES_WORD;
- }
- }
- else
- {
- /* Flash command error occurred */
- result = MOBLE_RESULT_FAIL;
- break;
- }
- }
+ /* radio busy, try again later */
+ }
+ else
+ {
+ /* do nothing */
}
}
@@ -250,9 +248,10 @@ MOBLE_RESULT AppliNvm_MarkSubpageInvalid(MOBLEBOOL modelBackup)
*/
MOBLE_RESULT AppliNvm_FactorySettingReset(void)
{
- MOBLEINT8 currSubPageIdx;
+ MOBLEINT8 currSubPageIdx = 0;
MOBLE_RESULT result;
MOBLEUINT32 resetCount;
+ MOBLEUINT8 subPageTemp[APP_NVM_SUBPAGE_SIZE];
result = AppliNvm_FindFirstValidSubPage(&currSubPageIdx);
@@ -262,19 +261,40 @@ MOBLE_RESULT AppliNvm_FactorySettingReset(void)
}
else
{
- /* read saved reset counter from subpage */
- memcpy((void*)&resetCount, (void*)(APP_NVM_SUBPAGE_OFFSET(currSubPageIdx)+APP_NVM_RESET_COUNT_OFFSET), 4);
+ if(currSubPageIdx > 0)
+ {
+ /* Not the first reset */
+ /* read the previous subpage */
+ memcpy((void*)&(subPageTemp[0]),
+ (void*)(APP_NVM_BASE + APP_NVM_SUBPAGE_OFFSET(currSubPageIdx-1)),
+ APP_NVM_SUBPAGE_SIZE);
+ }
+ else
+ {
+ /* read the current subpage */
+ memcpy((void*)&(subPageTemp[0]),
+ (void*)(APP_NVM_BASE + APP_NVM_SUBPAGE_OFFSET(currSubPageIdx)),
+ APP_NVM_SUBPAGE_SIZE);
+ }
+
+ /* read reset count from the subpage */
+ memcpy((void*)&resetCount,
+ (void*)&(subPageTemp[APP_NVM_RESET_COUNT_OFFSET]),
+ 4);
resetCount = resetCount << 1; /* Shifting for making Bits 0 from LSB */
+ memcpy((void*)&(subPageTemp[APP_NVM_RESET_COUNT_OFFSET]), (void*)&resetCount, 4);
/* Check for 5 times, 5 LSB are not zero */
if (resetCount > 0xFFFFFFE0)
{
/* update reset count */
- AppliNvm_FlashProgram(FLASH_WRITE,
- APP_NVM_SUBPAGE_OFFSET(currSubPageIdx)+APP_NVM_RESET_COUNT_OFFSET,
- (uint32_t*)&resetCount);
+ result = AppliNvm_FlashProgram(APP_NVM_SUBPAGE_OFFSET(currSubPageIdx),
+ (uint32_t*)&subPageTemp,
+ APP_NVM_SUBPAGE_SIZE);
- if (!memcmp((void*)&resetCount, (void*)(APP_NVM_SUBPAGE_OFFSET(currSubPageIdx)+APP_NVM_RESET_COUNT_OFFSET), 4))
+ if (!memcmp((void*)&subPageTemp[APP_NVM_RESET_COUNT_OFFSET],
+ (void*)(APP_NVM_BASE + APP_NVM_SUBPAGE_OFFSET(currSubPageIdx)+APP_NVM_RESET_COUNT_OFFSET),
+ 4))
{
/* updated value of reset count in flash */
}
@@ -285,33 +305,19 @@ MOBLE_RESULT AppliNvm_FactorySettingReset(void)
{
Appli_LedBlink();
}
-
- result = AppliNvm_MarkSubpageInvalid(MOBLE_TRUE);
-
- if (MOBLE_FAILED(result))
- {
- result = MOBLE_RESULT_FAIL;
- }
}
else /* Device is forced to factory reset, 5 LSBs are zero */
{
/* Unprovision node */
- BluenrgMesh_Unprovision();
+ BLEMesh_Unprovision();
- /* Clear lib data, primary and backup nvm used by BlueNRG-Mesh lib */
- FLASH_ErasePage((uint16_t)((BLUENRGMESH_NVM_BASE - RESET_MANAGER_FLASH_BASE_ADDRESS) / PAGE_SIZE));
- FLASH_ErasePage((uint16_t)((BLUENRGMESH_NVM_BACKUP_BASE - RESET_MANAGER_FLASH_BASE_ADDRESS) / PAGE_SIZE));
+ /* Clear lib data, primary and backup nvm used by BLE-Mesh lib */
+ MoblePalNvmErase(NVM_BASE, 0);
+ MoblePalNvmErase(NVM_BASE, 0x1000);
AppliNvm_ClearModelState();
- result = AppliNvm_MarkSubpageInvalid(MOBLE_FALSE);
-
- if (MOBLE_FAILED(result))
- {
- result = MOBLE_RESULT_FAIL;
- }
-
- BluenrgMesh_SetUnprovisionedDevBeaconInterval(100);
+ BLEMesh_SetUnprovisionedDevBeaconInterval(100);
/* Blink 5 times to indicate factory setting reset */
for (MOBLEUINT8 i=0; i<5; i++)
@@ -329,59 +335,6 @@ MOBLE_RESULT AppliNvm_FactorySettingReset(void)
}
/**
-* @brief This function erases application Flash page data only keeping reserved Nvm data
-* located at APP_NVM_BASE + APP_NVM_RESERVED_SIZE
-* @param void
-* @retval MOBLE_RESULT_SUCCESS on success
-*/
-MOBLE_RESULT AppliNvm_EraseRestoreResvNvm(void)
-{
- MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
- MOBLEUINT8 reserveAreaCopy[APP_NVM_RESERVED_SIZE];
-
- /* save reserve flash area */
- memcpy((void*)reserveAreaCopy, (void*)APP_NVM_BASE, APP_NVM_RESERVED_SIZE);
-
- /* erase page */
- FLASH_ErasePage((uint16_t)((APP_NVM_BASE - RESET_MANAGER_FLASH_BASE_ADDRESS) / PAGE_SIZE));
-
- if (FLASH_GetFlagStatus(Flash_CMDERR) == SET)
- {
- result = MOBLE_RESULT_FAIL;
- }
- else
- {
- /* restore reserve area */
- for (MOBLEUINT32 count=0; count<APP_NVM_RESERVED_SIZE; )
- {
- if (FLASH_GetFlagStatus(Flash_CMDERR) == RESET)
- {
- /* If size to be written > 4 words, use FLASH_ProgramWordBurst*/
- if (APP_NVM_RESERVED_SIZE-count >= 4*N_BYTES_WORD)
- {
- AppliNvm_FlashProgram(FLASH_BURSTWRITE,APP_NVM_BASE + count, (uint32_t*)&reserveAreaCopy[count]);
- count += 4*N_BYTES_WORD;
- }
- /* If size to be written < 4 words, use FLASH_ProgramWord*/
- else
- {
- AppliNvm_FlashProgram(FLASH_WRITE,APP_NVM_BASE + count, (uint32_t*)&reserveAreaCopy[count]);
- count += N_BYTES_WORD;
- }
- }
- else
- {
- /* Flash command error occurred */
- result = MOBLE_RESULT_FAIL;
- break;
- }
- }
- }
-
- return result;
-}
-
-/**
* @brief Save model states in nvm
* @param model state buff
* @param model state buff size
@@ -389,66 +342,19 @@ MOBLE_RESULT AppliNvm_EraseRestoreResvNvm(void)
*/
MOBLE_RESULT AppliNvm_SaveModelState(uint8_t* state, uint8_t size)
{
- MOBLE_RESULT result = MOBLE_RESULT_FAIL; /* if save model state not defined, return MOBLE_RESULT_FAIL */
+ MOBLE_RESULT result = MOBLE_RESULT_SUCCESS; /* if save model state not defined, return MOBLE_RESULT_FAIL */
#if (SAVE_MODEL_STATE_NVM == 1)
- MOBLEINT8 subPageIdx;
-
- if (size > APP_NVM_GENERIC_MODEL_SIZE+APP_NVM_LIGHT_MODEL_SIZE)
+ if (size > APP_NVM_MODEL_SIZE)
{
/* incorrect size */
result = MOBLE_RESULT_FAIL;
}
else
{
- AppliNvm_MarkSubpageInvalid(MOBLE_FALSE);
- result = AppliNvm_FindFirstValidSubPage(&subPageIdx);
-
- if (MOBLE_FAILED(result))
- {
- result = MOBLE_RESULT_FAIL;
- }
- else
- {
- /* update models states */
- for (MOBLEUINT32 count=0; count<size; )
- {
- if (FLASH_GetFlagStatus(Flash_CMDERR) == RESET)
- {
- /* If size to be written > 4 words, use FLASH_ProgramWordBurst*/
- if (APP_NVM_RESERVED_SIZE-count >= 4*N_BYTES_WORD)
- {
- result = AppliNvm_FlashProgram(FLASH_BURSTWRITE,
- APP_NVM_SUBPAGE_OFFSET(subPageIdx)+APP_NVM_GENERIC_MODEL_OFFSET+count,
- (uint32_t*)&state[count]);
- count += 4*N_BYTES_WORD;
- }
- /* If size to be written < 4 words, use FLASH_ProgramWord*/
- else
- {
- result = AppliNvm_FlashProgram(FLASH_WRITE,
- APP_NVM_SUBPAGE_OFFSET(subPageIdx)+APP_NVM_GENERIC_MODEL_OFFSET+count,
- (uint32_t*)&state[count]);
- count += N_BYTES_WORD;
- }
- }
- else
- {
- /* Flash command error occurred */
- result = MOBLE_RESULT_FAIL;
- break;
- }
- }
-
- for (MOBLEUINT8 count=0; count<size; count++)
- {
- TRACE_M(TF_MISC, "%.2x ", *((MOBLEUINT8*)((APP_NVM_SUBPAGE_OFFSET(subPageIdx)+APP_NVM_GENERIC_MODEL_OFFSET+count))));
- }
-
- TRACE_M(TF_MISC,"\r\n");
-
- }
+ memcpy(AppliNvm_Reqs.modelData, state, size);
+ AppliNvm_Reqs.writeReq = MOBLE_TRUE;
}
#endif /* SAVE_MODEL_STATE_NVM */
return result;
@@ -464,8 +370,10 @@ MOBLE_RESULT AppliNvm_ClearModelState(void)
MOBLE_RESULT result = MOBLE_RESULT_FAIL; /* if save model state not defined, return MOBLE_RESULT_FAIL */
#if (SAVE_MODEL_STATE_NVM == 1)
+ MOBLEUINT8 subPageTemp[APP_NVM_SUBPAGE_SIZE];
MOBLEINT8 subPageIdx;
- MOBLEUINT8 clearBuff[16] = {0};
+ MOBLEUINT8 clearBuff[APP_NVM_GENERIC_MODEL_SIZE+APP_NVM_LIGHT_MODEL_SIZE] = {0};
+ MOBLEUINT32 valid = 0;
result = AppliNvm_FindFirstValidSubPage(&subPageIdx);
@@ -475,40 +383,41 @@ MOBLE_RESULT AppliNvm_ClearModelState(void)
}
else
{
- /* clear models states */
- for (MOBLEUINT32 count=0; count<APP_NVM_GENERIC_MODEL_SIZE+APP_NVM_LIGHT_MODEL_SIZE; )
- {
- if (FLASH_GetFlagStatus(Flash_CMDERR) == RESET)
- {
- /* If size to be written > 4 words, use FLASH_ProgramWordBurst*/
- if (APP_NVM_RESERVED_SIZE-count >= 4*N_BYTES_WORD)
- {
- result = AppliNvm_FlashProgram(FLASH_BURSTWRITE,
- APP_NVM_SUBPAGE_OFFSET(subPageIdx)+APP_NVM_GENERIC_MODEL_OFFSET+count,
- (uint32_t*)&clearBuff[count]);
- count += 4*N_BYTES_WORD;
- }
- /* If size to be written < 4 words, use FLASH_ProgramWord*/
- else
- {
- result = AppliNvm_FlashProgram(FLASH_WRITE,
- APP_NVM_SUBPAGE_OFFSET(subPageIdx)+APP_NVM_GENERIC_MODEL_OFFSET+count,
- (uint32_t*)&clearBuff[count]);
- count += N_BYTES_WORD;
- }
- }
- else
- {
- /* Flash command error occurred */
- result = MOBLE_RESULT_FAIL;
- break;
- }
+ if(subPageIdx > 1)
+ { /* Not the first subpage */
+ /* clear models states */
+ memcpy((void*)&(subPageTemp[0]),
+ (void*)(APP_NVM_BASE + APP_NVM_SUBPAGE_OFFSET(subPageIdx-1)),
+ APP_NVM_SUBPAGE_SIZE);
+ memcpy((void*)&subPageTemp[APP_NVM_GENERIC_MODEL_OFFSET],
+ (void*)(clearBuff),
+ APP_NVM_GENERIC_MODEL_SIZE+APP_NVM_LIGHT_MODEL_SIZE);
+ subPageTemp[APP_NVM_VALID_FLAG_OFFSET] = valid;
+
+ result = AppliNvm_FlashProgram(APP_NVM_SUBPAGE_OFFSET(subPageIdx),
+ (uint32_t*)&subPageTemp,
+ APP_NVM_SUBPAGE_SIZE);
+ }
+ else
+ { /* First subpage */
+ memcpy((void*)&(subPageTemp[0]),
+ (void*)(APP_NVM_BASE + APP_NVM_SUBPAGE_OFFSET(subPageIdx)),
+ APP_NVM_SUBPAGE_SIZE);
+ memcpy((void*)&subPageTemp[APP_NVM_GENERIC_MODEL_OFFSET],
+ (void*)(clearBuff),
+ APP_NVM_GENERIC_MODEL_SIZE+APP_NVM_LIGHT_MODEL_SIZE);
+ subPageTemp[APP_NVM_VALID_FLAG_OFFSET] = valid;
+
+ result = AppliNvm_FlashProgram(APP_NVM_SUBPAGE_OFFSET(subPageIdx),
+ (uint32_t*)&subPageTemp,
+ APP_NVM_SUBPAGE_SIZE);
}
}
#endif /* SAVE_MODEL_STATE_NVM */
return result;
}
+#if 0
/**
* @brief Load generic states from nvm
* @param generic state buff
@@ -518,32 +427,41 @@ MOBLE_RESULT AppliNvm_ClearModelState(void)
MOBLE_RESULT AppliNvm_LoadGenericState(uint8_t state[], uint8_t* size)
{
#if (SAVE_MODEL_STATE_NVM == 1)
- MOBLEINT8 subPageIdx;
MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
+ MOBLEUINT8 subPageTemp[APP_NVM_SUBPAGE_SIZE];
+ MOBLEINT8 subPageIdx;
result = AppliNvm_FindFirstValidSubPage(&subPageIdx);
-
- if (MOBLE_FAILED(result))
- {
- *size = 0;
- result = MOBLE_RESULT_FAIL;
- }
- else
- {
- /* read saved reset counter from subpage */
- memcpy((void*)state, (void*)(APP_NVM_SUBPAGE_OFFSET(subPageIdx)+APP_NVM_GENERIC_MODEL_OFFSET), APP_NVM_GENERIC_MODEL_SIZE);
- *size = APP_NVM_GENERIC_MODEL_SIZE;
- }
-
- for (MOBLEUINT8 count=0; count<(*size); count++)
+ if (result == MOBLE_RESULT_SUCCESS)
{
- TRACE_M(TF_MISC, "%.2x ", *(state+count));
+ if(subPageIdx > 0)
+ {
+ /* Not the first reset */
+ /* read the previous subpage */
+ memcpy((void*)&(subPageTemp[0]),
+ (void*)(APP_NVM_BASE + APP_NVM_SUBPAGE_OFFSET(subPageIdx-1)),
+ APP_NVM_SUBPAGE_SIZE);
+
+ memcpy((void*)&(state[0]),
+ (void*)&(subPageTemp[APP_NVM_GENERIC_MODEL_OFFSET]),
+ APP_NVM_GENERIC_MODEL_SIZE);
+ *size = APP_NVM_GENERIC_MODEL_SIZE;
+ }
+ else
+ {
+ /* read the current subpage */
+ memcpy((void*)&(subPageTemp[0]),
+ (void*)(APP_NVM_BASE + APP_NVM_SUBPAGE_OFFSET(subPageIdx)),
+ APP_NVM_SUBPAGE_SIZE);
+
+ memcpy((void*)&(state[0]),
+ (void*)&(subPageTemp[APP_NVM_GENERIC_MODEL_OFFSET]),
+ APP_NVM_GENERIC_MODEL_SIZE);
+ *size = APP_NVM_GENERIC_MODEL_SIZE;
+ }
}
-
- TRACE_M(TF_MISC,"\r\n");
-
return result;
-#else
+#else /* SAVE_MODEL_STATE_NVM */
*size = 0;
return MOBLE_RESULT_SUCCESS;
#endif /* SAVE_MODEL_STATE_NVM */
@@ -558,34 +476,165 @@ MOBLE_RESULT AppliNvm_LoadGenericState(uint8_t state[], uint8_t* size)
MOBLE_RESULT AppliNvm_LoadLightState(uint8_t state[], uint8_t* size)
{
#if (SAVE_MODEL_STATE_NVM == 1)
- MOBLEINT8 subPageIdx;
+// MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
+//
+// memcpy((void*)state, (void*)(AppliNvm_Reqs.modelData+APP_NVM_GENERIC_MODEL_SIZE), APP_NVM_LIGHT_MODEL_SIZE);
+// *size = APP_NVM_GENERIC_MODEL_SIZE;
+//
+// return result;
MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
+ MOBLEUINT8 subPageTemp[APP_NVM_SUBPAGE_SIZE];
+ MOBLEINT8 subPageIdx;
result = AppliNvm_FindFirstValidSubPage(&subPageIdx);
-
- if (MOBLE_FAILED(result))
+ if (result == MOBLE_RESULT_SUCCESS)
{
- *size = 0;
- result = MOBLE_RESULT_FAIL;
+ if(subPageIdx > 1)
+ {
+ /* Not the first reset */
+ /* read the previous subpage */
+ memcpy((void*)&(subPageTemp[0]),
+ (void*)(APP_NVM_BASE + APP_NVM_SUBPAGE_OFFSET(subPageIdx-1)),
+ APP_NVM_SUBPAGE_SIZE);
+
+ memcpy((void*)&(state[0]),
+ (void*)&(subPageTemp[APP_NVM_LIGHT_MODEL_OFFSET]),
+ APP_NVM_LIGHT_MODEL_SIZE);
+ *size = APP_NVM_LIGHT_MODEL_SIZE;
+ }
+ else
+ {
+ /* read the current subpage */
+ memcpy((void*)&(subPageTemp[0]),
+ (void*)(APP_NVM_BASE + APP_NVM_SUBPAGE_OFFSET(subPageIdx)),
+ APP_NVM_SUBPAGE_SIZE);
+
+ memcpy((void*)&(state[0]),
+ (void*)&(subPageTemp[APP_NVM_LIGHT_MODEL_OFFSET]),
+ APP_NVM_LIGHT_MODEL_SIZE);
+ *size = APP_NVM_LIGHT_MODEL_SIZE;
+ }
}
- else
- {
- /* read saved reset counter from subpage */
- memcpy((void*)state, (void*)(APP_NVM_SUBPAGE_OFFSET(subPageIdx)+APP_NVM_LIGHT_MODEL_OFFSET), APP_NVM_LIGHT_MODEL_SIZE);
- *size = APP_NVM_LIGHT_MODEL_SIZE;
+ return result;
+#else /* SAVE_MODEL_STATE_NVM */
+ *size = 0;
+ return MOBLE_RESULT_SUCCESS;
+#endif /* SAVE_MODEL_STATE_NVM */
}
+#endif
- for (MOBLEUINT8 count=0; count<(*size); count++)
- {
- TRACE_M(TF_MISC, "%.2x ", *(state+count));
- }
-
- TRACE_M(TF_MISC,"\r\n");
+/**
+* @brief Load Model states from nvm
+* @param model state buff
+* @param model state buff size
+* @retval MOBLE_RESULT_SUCCESS on success
+*/
+MOBLE_RESULT AppliNvm_LoadModelState(uint8_t state[], uint8_t* size)
+{
+#if (SAVE_MODEL_STATE_NVM == 1)
+ MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
+
+ memcpy((void*)state, (void*)(AppliNvm_Reqs.modelData), APP_NVM_MODEL_SIZE);
+ *size = APP_NVM_MODEL_SIZE;
return result;
-#else
+#else /* SAVE_MODEL_STATE_NVM */
*size = 0;
return MOBLE_RESULT_SUCCESS;
#endif /* SAVE_MODEL_STATE_NVM */
}
+/**
+* @brief Process NVM erase and write requests
+* @param void
+* @retval void
+*/
+void AppliNvm_Process(void)
+{
+ MOBLE_RESULT result;
+ MOBLEINT8 subPageIdx;
+ uint8_t reserveAreaCopy[APP_NVM_RESERVED_SIZE];
+
+ /* Erase if required */
+ if (AppliNvm_Reqs.erasePageReq == MOBLE_TRUE)
+ {
+ /* save reserve flash area */
+ memcpy((void*)reserveAreaCopy, (void*)APP_NVM_BASE, APP_NVM_RESERVED_SIZE);
+
+ result = MoblePalNvmErase(APP_NVM_BASE, 0);
+
+ if (result == MOBLE_RESULT_SUCCESS)
+ {
+ AppliNvm_Reqs.erasePageReq = MOBLE_FALSE;
+ AppliNvm_Reqs.writeReq = MOBLE_TRUE;
+ /* restore reserve area */
+/* FLASH_ProgramWordBurst(APP_NVM_BASE, (uint32_t*)reserveAreaCopy); */
+ result = AppliNvm_FlashProgram(0,
+ (uint32_t*)&reserveAreaCopy,
+ APP_NVM_RESERVED_SIZE);
+ if (result == MOBLE_RESULT_SUCCESS)
+ {
+ AppliNvm_Reqs.writeReq = MOBLE_FALSE;
+ }
+ }
+ }
+
+ if (AppliNvm_Reqs.erasePageReq == MOBLE_FALSE
+ && AppliNvm_Reqs.writeReq == MOBLE_TRUE)
+ {
+ result = AppliNvm_FindFirstValidSubPage(&subPageIdx);
+ if (result == MOBLE_RESULT_SUCCESS)
+ {
+ MOBLEUINT8 subPageTemp[APP_NVM_SUBPAGE_SIZE];
+ MOBLEUINT32 valid = 0;
+
+ if(subPageIdx > 0)
+ {
+ /* Not the first reset */
+ /* read the previous subpage */
+ memcpy((void*)&(subPageTemp[0]),
+ (void*)(APP_NVM_BASE + APP_NVM_SUBPAGE_OFFSET(subPageIdx-1)),
+ APP_NVM_SUBPAGE_SIZE);
+ }
+ else
+ {
+ /* read the current subpage */
+ memcpy((void*)&(subPageTemp[0]),
+ (void*)(APP_NVM_BASE + APP_NVM_SUBPAGE_OFFSET(subPageIdx)),
+ APP_NVM_SUBPAGE_SIZE);
+ }
+
+ memcpy((void*)&(subPageTemp[APP_NVM_GENERIC_MODEL_OFFSET]),
+ (void*)&(AppliNvm_Reqs.modelData),
+ APP_NVM_GENERIC_MODEL_SIZE+APP_NVM_LIGHT_MODEL_SIZE);
+
+ subPageTemp[APP_NVM_VALID_FLAG_OFFSET] = valid;
+
+ result = AppliNvm_FlashProgram(APP_NVM_SUBPAGE_OFFSET(subPageIdx),
+ (uint8_t*)subPageTemp,
+ APP_NVM_SUBPAGE_SIZE);
+
+ if (result == MOBLE_RESULT_SUCCESS)
+ {
+ AppliNvm_Reqs.writeReq = MOBLE_FALSE;
+ }
+ }
+ else
+ {
+ /* do nothing */
+ }
+ }
+}
+
+/**
+* @brief Fuction used to set the flag which is responsible for storing the
+ states in flash.
+* @param void
+* @retval void
+*/
+void AppliNvm_SaveMessageParam (void)
+{
+#ifdef SAVE_MODEL_STATE_FOR_ALL_MESSAGES
+ PowerOnOff_flag = FLAG_SET;
+#endif
+}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_nvm.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_nvm.h
index c54b04bb0..769dc76ad 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_nvm.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_nvm.h
@@ -48,13 +48,16 @@
/* Exported variables ------------------------------------------------------- */
/* Exported Functions Prototypes ---------------------------------------------*/
-MOBLE_RESULT AppliNvm_FlashProgram(uint32_t TypeProgram, uint32_t Address, uint32_t Data[]);
+MOBLE_RESULT AppliNvm_FlashProgram(MOBLEUINT32 offset, void const *buf, MOBLEUINT32 size);
MOBLE_RESULT AppliNvm_FactorySettingReset(void);
-MOBLE_RESULT AppliNvm_FlashErase(void);
+//MOBLE_RESULT AppliNvm_FlashErase(uint16_t PageNumber);
MOBLE_RESULT AppliNvm_SaveModelState(uint8_t* state, uint8_t size);
MOBLE_RESULT AppliNvm_ClearModelState(void);
-MOBLE_RESULT AppliNvm_LoadGenericState(uint8_t state[], uint8_t* size);
-MOBLE_RESULT AppliNvm_LoadLightState(uint8_t state[], uint8_t* size);
+//MOBLE_RESULT AppliNvm_LoadGenericState(uint8_t state[], uint8_t* size);
+//MOBLE_RESULT AppliNvm_LoadLightState(uint8_t state[], uint8_t* size);
+MOBLE_RESULT AppliNvm_LoadModelState(uint8_t state[], uint8_t* size);
+void AppliNvm_Process(void);
+void AppliNvm_SaveMessageParam (void);
#endif /* __APPLI_NVM_H */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_sensor.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_sensor.c
index 4ac99a03c..a6634a857 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_sensor.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_sensor.c
@@ -18,11 +18,14 @@
*/
/* Includes ------------------------------------------------------------------*/
+
#include "hal_common.h"
#include "types.h"
#include "sensors.h"
+#include "light_lc.h"
#include "appli_sensor.h"
#include "mesh_cfg.h"
+//#include "LPS25HB.h"
#include "string.h"
#include "common.h"
#include "math.h"
@@ -37,72 +40,51 @@
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
-
-MODEL_Property_IDTableParam_t Property_ID_Table[NUMBER_OF_SENSOR] = {
- {TEMPERATURE_PID},
- {PRESSURE_PID}
-};
-/* Private macro -------------------------------------------------------------*/
-/* Private variables ---------------------------------------------------------*/
-
-/* Sensor Cadence set */
-
-typedef struct
+#if 0
+/**
+* @brief PRESSURE init structure definition
+*/
+PRESSURE_InitTypeDef InitStructure =
{
- MOBLEUINT16 Prop_ID;
- MOBLEUINT16 PositiveTolerance;
- MOBLEUINT16 NegativeTolerance;
- MOBLEUINT8 SamplingFunction;
- MOBLEUINT8 MeasurementPeriod;
- MOBLEUINT8 UpdateInterval;
-}Appli_Sensor_DescriptorStatus_t;
-
-Appli_Sensor_DescriptorStatus_t Appli_Sensor_DescriptorStatus;
+ LPS25HB_ODR_1Hz,
+ LPS25HB_BDU_READ,
+ LPS25HB_DIFF_ENABLE,
+ LPS25HB_SPI_SIM_3W,
+ LPS25HB_P_RES_AVG_32,
+ LPS25HB_T_RES_AVG_16
+};
+#endif
-/* Sensor Setting set */
-typedef struct
-{
- MOBLEUINT16 Property_ID;
- MOBLEUINT16 Sensor_Setting_ID;
- MOBLEUINT8 Sensor_Setting_Access;
- MOBLEUINT16 Sensor_Setting_Value;
-}Appli_Sensor_SettingSet_t;
+/* Application variables of sensor model definition */
+#ifdef ENABLE_SENSOR_MODEL_SERVER
+Appli_Sensor_DescriptorStatus_t Appli_Sensor_DescriptorStatus;
Appli_Sensor_SettingSet_t Appli_Sensor_SettingSet;
-/* structure of flags used for publishing data */
-typedef struct
-{
- MOBLEBOOL CadenceDurationFlag ;
- MOBLEBOOL DeltaDataFlag ;
-}PublishingDataFlag_t;
-
-/* structure for the cadence set */
-typedef struct
-{
- MOBLEUINT16 Property_ID;
- MOBLEUINT8 FastCadenceDevisor;
- MOBLEUINT8 StatusTriggerType;
- MOBLEUINT8 triggerDeltaDown;
- MOBLEUINT8 triggerDeltaUp;
- MOBLEUINT8 StatusMinInterval;
- float FastCadenceLow;
- float FastCadenceHigh;
-}Sensor_CadenceSet_t;
-
-extern MOBLEUINT8 NumberOfElements;
-extern MOBLEUINT8 ProvisionFlag;
-
/* By Default value used for cadence set for testing. */
Sensor_CadenceSet_t Sensor_CadenceSet[NUMBER_OF_SENSOR] = {
{0x0071 , 0x2 , 2 , 2 ,2 ,0 ,0X05 , 0x64},
{0x2A6D , 0x2 , 1 , 1 , 1, 0, 0X258 , 0x3ED}
};
+#endif
+
+MODEL_Property_IDTableParam_t Property_ID_Table[NUMBER_OF_SENSOR] =
+{
+ {TEMPERATURE_PID},
+ {PRESSURE_PID}
+};
+MOBLEUINT8 Occupancy_Flag = MOBLE_FALSE;
+extern MOBLEUINT8 NumberOfElements;
+extern MOBLEUINT8 ProvisionFlag;
/* Temperature and Pressure init structure*/
+#if 0
+ PRESSURE_DrvTypeDef* xLPS25HBDrv = &LPS25HBDrv;
+#endif
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
+#ifdef ENABLE_SENSOR_MODEL_SERVER
/**
* @brief Appli_Sensor_Cadence_Set: This function is callback for Application
@@ -163,8 +145,6 @@ MOBLE_RESULT Appli_Sensor_Setting_Set(Sensor_SettingParam_t* pSensor_SettingPara
return MOBLE_RESULT_SUCCESS;
}
-
-#ifdef ENABLE_SENSOR_MODEL_SERVER
/**
* @brief Appli_Sensor_Data_Status: This function is callback for Application
when sensor get message is received
@@ -181,11 +161,11 @@ MOBLE_RESULT Appli_Sensor_Data_Status(MOBLEUINT8* sensor_Data , MOBLEUINT32* pLe
MOBLEUINT32 pressureData = 0;
MOBLEUINT8 data_Length = 0x03;
-/*
+#if 0
LPS25HB_GetTemperature((float*)&temperatureData);
LPS25HB_GetPressure((float*)&pressureData);
-*/
+#endif
result = Check_Property_ID(Property_ID_Table , prop_ID);
@@ -236,8 +216,8 @@ MOBLE_RESULT Appli_Sensor_Data_Status(MOBLEUINT8* sensor_Data , MOBLEUINT32* pLe
/* No Comments */
}
- TRACE_M(TF_SENSOR,"the temperature reading from sender in hex 0x%08x \n\r ", temperatureData);
- TRACE_M(TF_SENSOR,"the pressure reading from sender in hex 0x%08x \n\r", pressureData );
+ TRACE_M(TF_SENSOR,"the temperature reading from sender in hex 0x%08lx \n\r ", temperatureData);
+ TRACE_M(TF_SENSOR,"the pressure reading from sender in hex 0x%08lx \n\r", pressureData );
return MOBLE_RESULT_SUCCESS;
}
@@ -252,34 +232,40 @@ when sensor descriptor get message is received
*/
MOBLE_RESULT Appli_Sensor_Descriptor_Status(MOBLEUINT8* sensor_Descriptor , MOBLEUINT32* pLength)
{
- Appli_Sensor_DescriptorStatus_t Appli_Sensor_DescriptorStatus1[] = {{PRESSURE_PID,0x00,0x00,0x00,0x00,0x00},
- {TEMPERATURE_PID,0x00,0x00,0x00,0x00,0x00}};
+ Appli_Sensor_DescriptorStatus_t Appli_Sensor_DescriptorStatus1[] = {{PRESSURE_PID,0xABC,0xDEF,0x03,0x04,0x05},
+ {TEMPERATURE_PID,0xc56,0xd78,0x06,0x07,0x08}};
+ MOBLEUINT32 tolerance;
+ tolerance = Appli_Sensor_DescriptorStatus1[0].NegativeTolerance;
+ tolerance = (tolerance << 12 ) | Appli_Sensor_DescriptorStatus1[0].PositiveTolerance;
*(sensor_Descriptor) = Appli_Sensor_DescriptorStatus1[0].Prop_ID;
*(sensor_Descriptor+1) = Appli_Sensor_DescriptorStatus1[0].Prop_ID >> 8;
- *(sensor_Descriptor+2) = Appli_Sensor_DescriptorStatus1[0].PositiveTolerance;
- *(sensor_Descriptor+3) = Appli_Sensor_DescriptorStatus1[0].PositiveTolerance >> 8;
- *(sensor_Descriptor+4) = Appli_Sensor_DescriptorStatus1[0].NegativeTolerance;
- *(sensor_Descriptor+5) = Appli_Sensor_DescriptorStatus1[0].NegativeTolerance >> 8;
- *(sensor_Descriptor+6) = Appli_Sensor_DescriptorStatus1[0].SamplingFunction;
- *(sensor_Descriptor+7) = Appli_Sensor_DescriptorStatus1[0].MeasurementPeriod;
- *(sensor_Descriptor+8) = Appli_Sensor_DescriptorStatus1[0].UpdateInterval;
+ *(sensor_Descriptor+2) = tolerance;
+ *(sensor_Descriptor+3) = tolerance >> 8;
+ *(sensor_Descriptor+4) = tolerance >> 16;
+ *(sensor_Descriptor+5) = Appli_Sensor_DescriptorStatus1[0].SamplingFunction;
+ *(sensor_Descriptor+6) = Appli_Sensor_DescriptorStatus1[0].MeasurementPeriod;
+ *(sensor_Descriptor+7) = Appli_Sensor_DescriptorStatus1[0].UpdateInterval;
- *(sensor_Descriptor+9) = Appli_Sensor_DescriptorStatus1[1].Prop_ID;
- *(sensor_Descriptor+10) = Appli_Sensor_DescriptorStatus1[1].Prop_ID >> 8;
- *(sensor_Descriptor+11) = Appli_Sensor_DescriptorStatus1[1].PositiveTolerance;
- *(sensor_Descriptor+12) = Appli_Sensor_DescriptorStatus1[1].PositiveTolerance >> 8;
- *(sensor_Descriptor+13) = Appli_Sensor_DescriptorStatus1[1].NegativeTolerance;
- *(sensor_Descriptor+14) = Appli_Sensor_DescriptorStatus1[1].NegativeTolerance >> 8;
- *(sensor_Descriptor+15) = Appli_Sensor_DescriptorStatus1[1].SamplingFunction;
- *(sensor_Descriptor+16) = Appli_Sensor_DescriptorStatus1[1].MeasurementPeriod;
- *(sensor_Descriptor+17) = Appli_Sensor_DescriptorStatus1[1].UpdateInterval;
+ tolerance = Appli_Sensor_DescriptorStatus1[1].NegativeTolerance;
+ tolerance = (tolerance << 12 ) | Appli_Sensor_DescriptorStatus1[1].PositiveTolerance ;
+
+ *(sensor_Descriptor+8) = Appli_Sensor_DescriptorStatus1[1].Prop_ID;
+ *(sensor_Descriptor+9) = Appli_Sensor_DescriptorStatus1[1].Prop_ID >> 8;
+ *(sensor_Descriptor+10) = tolerance;
+ *(sensor_Descriptor+11) = tolerance >> 8;
+ *(sensor_Descriptor+12) = tolerance >> 16;
+ *(sensor_Descriptor+13) = Appli_Sensor_DescriptorStatus1[1].SamplingFunction;
+ *(sensor_Descriptor+14) = Appli_Sensor_DescriptorStatus1[1].MeasurementPeriod;
+ *(sensor_Descriptor+15) = Appli_Sensor_DescriptorStatus1[1].UpdateInterval;
*pLength = 18;
return MOBLE_RESULT_SUCCESS;
}
+#endif
+
/**
* @brief Sensor Process function
* @param Function will continuously monitor the sensors.
@@ -288,29 +274,74 @@ Function used for the Publishing, data monitoring..
*/
void Sensor_Process(void)
{
+
+#ifdef ENABLE_SENSOR_PUBLICATION
float sensorValue[NUMBER_OF_SENSOR];
if(ProvisionFlag == 1)
{
Read_Sensor_Data(&sensorValue[0]);
Sensor_Publication_Process(&sensorValue[0], &Property_ID_Table[0]);
}
+#endif
+/* Occupancy_Flag become True when ever sensor detect occupancy and get interrupt
+ and make flag True to run this routine.
+*/
+ if(Occupancy_Flag == MOBLE_TRUE)
+ {
+ if(BLE_waitPeriod(CONTROLLER_WAIT_TIME))
+ {
+/* publishing the command for LC Light occupancy set message in the sensor status
+ message .
+*/
+ Sensor_LC_Light_Publish();
+ Occupancy_Flag = MOBLE_FALSE;
+ }
+ }
}
/**
+* @brief Function check for the couupancy in the location and send the status
+ message with the ocuppancy value, when the interrupt is detected.
+* @param void
+* @retval void
+*/
+void Sensor_LC_Light_Publish(void)
+{
+ MOBLE_ADDRESS publishAddress;
+ MOBLEUINT8 elementNumber;
+ MOBLEUINT8 occupancyData = 0x1;
+ MOBLEUINT8 sensor_Data[5];
+
+ sensor_Data[1] = (MOBLEUINT8)(LIGHT_CONTROL_LIGHTNESS_ON_ID << 8);
+ sensor_Data[0] = (MOBLEUINT8)LIGHT_CONTROL_LIGHTNESS_ON_ID;
+ sensor_Data[2] = occupancyData;
+
+ elementNumber = BLE_GetElementNumber();
+ publishAddress = BLEMesh_GetPublishAddress(elementNumber);
+
+ BLEMesh_SetRemoteData(publishAddress, 0,
+ SENSOR_STATUS ,
+ sensor_Data,3,
+ MOBLE_FALSE, MOBLE_FALSE);
+
+}
+
+#if defined ENABLE_SENSOR_PUBLICATION && defined ENABLE_SENSOR_MODEL_SERVER
+/**
* @brief Function read the particular sensor value which are called inside.
* @param pSensorValue: pointer to the sensor data array.
* @retval void
*/
void Read_Sensor_Data(float *pSensorValue)
{
- /*
+#if 0
float temp,press;
- LPS25HB_GetTemperature(&temp);
- pSensorValue[0] = temp;
- LPS25HB_GetPressure(&press);
- pSensorValue[1] = press;
- */
+ LPS25HB_GetTemperature(&temp);
+ pSensorValue[0] = temp;
+ LPS25HB_GetPressure(&press);
+ pSensorValue[1] = press;
+#endif
}
/**
@@ -355,7 +386,9 @@ void Sensor_Publication_Process(float* pSensorData, MODEL_Property_IDTableParam_
if((pSensorData[sensor_Count] >= (previousDataValue[sensor_Count] + Sensor_CadenceSet[sensor_Count].triggerDeltaUp)) ||
(pSensorData[sensor_Count] <= (previousDataValue[sensor_Count] - Sensor_CadenceSet[sensor_Count].triggerDeltaDown)))
{
- SensorDataPublish((MOBLEUINT32*)&pSensorData[sensor_Count] , &pProp_ID[sensor_Count].Property_ID);
+ MOBLEUINT16 prop_id = pProp_ID[sensor_Count].Property_ID;
+
+ SensorDataPublish((MOBLEUINT32*)&pSensorData[sensor_Count] , &prop_id);
PublishingDataFlag[sensor_Count].DeltaDataFlag = MOBLE_FALSE;
TRACE_M(TF_SENSOR,"previous value data %.3f \r\n",previousDataValue[sensor_Count]);
@@ -377,7 +410,9 @@ void Sensor_Publication_Process(float* pSensorData, MODEL_Property_IDTableParam_
if(((Clock_Time()- cadenceDurationTick[sensor_Count]) >= publishTime))
{
- SensorDataPublish((MOBLEUINT32*)&pSensorData[sensor_Count] , &pProp_ID[sensor_Count].Property_ID);
+ MOBLEUINT16 prop_id = pProp_ID[sensor_Count].Property_ID;
+
+ SensorDataPublish((MOBLEUINT32*)&pSensorData[sensor_Count] , &prop_id);
PublishingDataFlag[sensor_Count].CadenceDurationFlag = MOBLE_FALSE;
TRACE_M(TF_SENSOR,"Cadence publication of data %.2f \r\n",*((float*)&pSensorData[sensor_Count]));
sensor_Count++;
@@ -389,7 +424,9 @@ void Sensor_Publication_Process(float* pSensorData, MODEL_Property_IDTableParam_
if(((Clock_Time()- cadenceDurationTick[sensor_Count]) >= SENSOR_PUBLISH_PERIOD))
{
- SensorDataPublish((MOBLEUINT32*)&pSensorData[sensor_Count] , &pProp_ID[sensor_Count].Property_ID);
+ MOBLEUINT16 prop_id = pProp_ID[sensor_Count].Property_ID;
+
+ SensorDataPublish((MOBLEUINT32*)&pSensorData[sensor_Count] , &prop_id);
PublishingDataFlag[sensor_Count].CadenceDurationFlag = MOBLE_FALSE;
TRACE_M(TF_SENSOR,"Regular publication of data %.3f \r\n",*((float*)&pSensorData[sensor_Count]));
@@ -469,7 +506,9 @@ void SensorDataPublish(MOBLEUINT32 *pSensor_Value , MOBLEUINT16* pProp_ID)
}
+#endif
+#ifdef ENABLE_SENSOR_MODEL_SERVER
/**
* @brief Appli_Sensor_GetSettingStatus: This function is callback for Application
when sensor setting numbers status message is to be provided
@@ -507,6 +546,15 @@ MOBLE_RESULT Appli_Sensor_GetSetting_IDStatus(MOBLEUINT8* pSetting_Status)
return MOBLE_RESULT_SUCCESS;
}
+#endif
+
+/**
+* @brief Check_Property_ID: This function is used for checking the Property id
+of sensor available in table.
+* @param prop_ID_Table: address of the property id table array.
+* @param prop_ID:received property id of sensor.
+* @retval MOBLE_RESULT
+*/
MOBLE_RESULT Check_Property_ID(const MODEL_Property_IDTableParam_t prop_ID_Table[]
, MOBLEUINT16 prop_ID)
{
@@ -531,12 +579,12 @@ Application interface
*/
MOBLE_RESULT Appli_Sensor_Init(void)
{
- //LPS25HB_Init(&InitStructure);
-
+#if 0
+ LPS25HB_Init(&InitStructure);
+#endif
return MOBLE_RESULT_SUCCESS;
}
-#endif
/**
* @}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_sensor.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_sensor.h
index aacbd6ef9..223a7afc3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_sensor.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_sensor.h
@@ -18,20 +18,63 @@
*/
/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __APPLI_SENSOR_MODEL_H
-#define __APPLI_SENSOR_MODEL_H
+#ifndef __APPLI_SENSOR_H
+#define __APPLI_SENSOR_H
/* Includes ------------------------------------------------------------------*/
#include "types.h"
/* Exported macro ------------------------------------------------------------*/
-/* Exported variables -------------------------------------------------------*/
-/*
- structure for the Property id for the sensors Present inside the firmware.
-*/
+#define CONTROLLER_WAIT_TIME 1000
+/* Exported variables -------------------------------------------------------*/
/* Exported Functions Prototypes ---------------------------------------------*/
+/* Application variables------------------------------------------------------*/
+/* Private variables ---------------------------------------------------------*/
+
+/* Sensor Cadence set */
+#pragma pack(1)
+typedef struct
+{
+ MOBLEUINT16 Prop_ID;
+ MOBLEUINT16 PositiveTolerance;
+ MOBLEUINT16 NegativeTolerance;
+ MOBLEUINT8 SamplingFunction;
+ MOBLEUINT8 MeasurementPeriod;
+ MOBLEUINT8 UpdateInterval;
+}Appli_Sensor_DescriptorStatus_t;
+
+/* Sensor Setting set */
+typedef struct
+{
+ MOBLEUINT16 Property_ID;
+ MOBLEUINT16 Sensor_Setting_ID;
+ MOBLEUINT8 Sensor_Setting_Access;
+ MOBLEUINT16 Sensor_Setting_Value;
+}Appli_Sensor_SettingSet_t;
+
+
+/* structure of flags used for publishing data */
+typedef struct
+{
+ MOBLEBOOL CadenceDurationFlag ;
+ MOBLEBOOL DeltaDataFlag ;
+}PublishingDataFlag_t;
+
+/* structure for the cadence set */
+typedef struct
+{
+ MOBLEUINT16 Property_ID;
+ MOBLEUINT8 FastCadenceDevisor;
+ MOBLEUINT8 StatusTriggerType;
+ MOBLEUINT8 triggerDeltaDown;
+ MOBLEUINT8 triggerDeltaUp;
+ MOBLEUINT8 StatusMinInterval;
+ float FastCadenceLow;
+ float FastCadenceHigh;
+}Sensor_CadenceSet_t;
+#pragma pack(4)
MOBLE_RESULT Appli_Sensor_Cadence_Set(Sensor_CadenceParam_t* pCadence_param, MOBLEUINT16 property_ID,
MOBLEUINT32 length);
@@ -52,8 +95,10 @@ MOBLE_RESULT Appli_Sensor_GetSettingStatus(MOBLEUINT8* pSetting_Status);
MOBLE_RESULT Appli_Sensor_GetSetting_IDStatus(MOBLEUINT8* pSetting_Status);
MOBLE_RESULT Appli_Sensor_Init(void);
void Sensor_Process(void);
+void Sensor_LC_Light_Publish(void);
+
-#endif /* __APPLI_SENSOR_MODEL_H */
+#endif /* __APPLI_SENSOR_H */
/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_vendor.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_vendor.c
index 9512b0a86..eb21cc3e5 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_vendor.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_vendor.c
@@ -17,12 +17,15 @@
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
+#include "app_conf.h"
#include "hal_common.h"
#include "types.h"
#include "ble_mesh.h"
#include "appli_mesh.h"
#include "vendor.h"
#include "appli_vendor.h"
+#include "common.h"
+#include "appli_light.h"
#include "models_if.h"
#include "mesh_cfg.h"
#include <string.h>
@@ -43,6 +46,9 @@
MOBLEUINT8 ResponseBuffer[8];
MOBLEUINT8 BuffLength;
extern MOBLEUINT8 Appli_LedState;
+extern uint16_t DUTY;
+MOBLEUINT32 TestHitCounter = 0;
+extern Appli_LightPwmValue_t Appli_LightPwmValue;
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
@@ -164,8 +170,8 @@ MOBLE_RESULT Appli_Vendor_Test(MOBLEUINT8 const *data, MOBLEUINT32 length)
{
case APPLI_TEST_ECHO:
{
- memcpy ((ResponseBuffer+1),data,length);
- BuffLength = length+1;
+ memcpy ((ResponseBuffer+1),(data+1),length);
+ BuffLength = length;
break;
}
case APPLI_TEST_RANDOMIZATION_RANGE:
@@ -175,11 +181,42 @@ MOBLE_RESULT Appli_Vendor_Test(MOBLEUINT8 const *data, MOBLEUINT32 length)
}
case APPLI_TEST_COUNTER:
{
+ if((DUTY <= PWM_TIME_PERIOD) && (DUTY > 1))
+ {
+ Appli_LightPwmValue.IntensityValue = LED_OFF_VALUE;
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
+ }
+ else
+ {
+ Appli_LightPwmValue.IntensityValue = PWM_TIME_PERIOD;
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
+ }
+ TRACE_M(TF_VENDOR,"Test Counter is running \r\n");
+ ResponseBuffer[0] = subCmd;
+ ResponseBuffer[1] = Appli_LedState ;
+ BuffLength = 2;
/*Insert Test related Commands here*/
break;
}
case APPLI_TEST_INC_COUNTER:
{
+
+ if((DUTY <= PWM_TIME_PERIOD) && (DUTY > 1))
+ {
+ Appli_LightPwmValue.IntensityValue = LED_OFF_VALUE;
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
+ }
+ else
+ {
+ Appli_LightPwmValue.IntensityValue = PWM_TIME_PERIOD;
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
+ }
+
+ TestHitCounter++;
+ TRACE_M(TF_VENDOR,"Command received Count %.2x \r\n",TestHitCounter);
+ ResponseBuffer[0] = subCmd;
+ ResponseBuffer[1] = Appli_LedState ;
+ BuffLength = 2;
/*Insert Test related Commands here*/
break;
}
@@ -194,6 +231,7 @@ MOBLE_RESULT Appli_Vendor_Test(MOBLEUINT8 const *data, MOBLEUINT32 length)
break;
}
}
+
return status;
}
@@ -211,12 +249,14 @@ MOBLE_RESULT Appli_Vendor_LEDControl( MOBLEUINT8 const *data, MOBLEUINT32 length
MOBLE_RESULT status = MOBLE_RESULT_SUCCESS;
MOBLEUINT8 subCommand;
subCommand = data[0];
+ MOBLEUINT16 duty;
+ MOBLEUINT16 intensityValue = 0;
/* tClockTime delay_t = Clock_Time(); */
switch(subCommand)
{
/*
- Meesage Received B0 B1 B2 B3 B4 B5 B6 B7
+ Message Received B0 B1 B2 B3 B4 B5 B6 B7
B0 - Sub-Cmd LED
B1-B7 - Data Bytes
*/
@@ -228,7 +268,11 @@ MOBLE_RESULT Appli_Vendor_LEDControl( MOBLEUINT8 const *data, MOBLEUINT32 length
}
else if(elementNumber == SECOND_ELEMENT)
{
- /* Toggle the state of the Yellow LED */
+ /* user application code */
+ }
+ else if(elementNumber == THIRD_ELEMENT)
+ {
+ /* user application code */
}
break;
}
@@ -238,12 +282,27 @@ MOBLE_RESULT Appli_Vendor_LEDControl( MOBLEUINT8 const *data, MOBLEUINT32 length
{
if(elementNumber == FIRST_ELEMENT)
{
-
- Appli_LedState = !Appli_LedState; /* Toggle the state of the Blue LED */
+ if((Appli_LightPwmValue.IntensityValue <= PWM_TIME_PERIOD) && (Appli_LightPwmValue.IntensityValue > 1))
+ {
+ Appli_LightPwmValue.IntensityValue = LED_OFF_VALUE;
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
+ BSP_LED_Off(LED_BLUE);
+ }
+ else
+ {
+ Appli_LightPwmValue.IntensityValue = PWM_TIME_PERIOD;
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
+ BSP_LED_On(LED_BLUE);
+ }
+
}
else if(elementNumber == SECOND_ELEMENT)
{
- /* Toggle the state of the Yellow LED */
+ /* user application code */
+ }
+ else if(elementNumber == THIRD_ELEMENT)
+ {
+ /* user application code */
}
break;
}
@@ -252,12 +311,21 @@ MOBLE_RESULT Appli_Vendor_LEDControl( MOBLEUINT8 const *data, MOBLEUINT32 length
{
if(elementNumber == FIRST_ELEMENT)
{
-
- Appli_LedState = 1; /* Switch On the Blue LED */
+ Appli_LightPwmValue.IntensityValue = PWM_TIME_PERIOD;
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue); /* PWM_ID = PWM4, mapped on PWM4_PIN (GPIO_14 in mapping) */
+ BSP_LED_On(LED_BLUE);
+ Appli_LedState = 1;
}
else if(elementNumber == SECOND_ELEMENT)
{
- /* Toggle the state of the Yellow LED */
+ Appli_LightPwmValue.IntensityValue = PWM_TIME_PERIOD;
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue); /* PWM_ID = PWM3, mapped on PWM3_PIN (GPIO_2 in mapping) */
+ BSP_LED_On(LED_BLUE);
+ Appli_LedState = 1;
+ }
+ else if(elementNumber == THIRD_ELEMENT)
+ {
+ /* user application code */
}
break;
}
@@ -266,14 +334,53 @@ MOBLE_RESULT Appli_Vendor_LEDControl( MOBLEUINT8 const *data, MOBLEUINT32 length
{
if(elementNumber == FIRST_ELEMENT)
{
-
- Appli_LedState = 0; /* Switch Off the Blue LED */
+ Appli_LightPwmValue.IntensityValue = LED_OFF_VALUE;
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue); /* PWM_ID = PWM4, mapped on PWM4_PIN (GPIO_14 in mapping) */
+ Appli_LedState = 0;
+ BSP_LED_Off(LED_BLUE);
}
else if(elementNumber == SECOND_ELEMENT)
+ {
+ Appli_LightPwmValue.IntensityValue = LED_OFF_VALUE;
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue); /* PWM_ID = PWM3, mapped on PWM3_PIN (GPIO_2 in mapping) */
+ Appli_LedState = 0;
+ BSP_LED_Off(LED_BLUE);
+ }
+ else if(elementNumber == THIRD_ELEMENT)
{
- /* Switch Off the Yellow LED */
+ /* user application code */
}
-
+
+ break;
+ }
+ /* intensity command */
+ case APPLI_CMD_LED_INTENSITY:
+ {
+ if(elementNumber == FIRST_ELEMENT)
+ {
+ intensityValue = data[2] << 8;
+ intensityValue |= data[1];
+
+ duty = PwmValueMapping(intensityValue , 0x7FFF ,0);
+ Appli_LightPwmValue.IntensityValue = duty;
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
+ if(duty > 16000)
+ {
+ BSP_LED_On(LED_BLUE);
+ }
+ else
+ {
+ BSP_LED_Off(LED_BLUE);
+ }
+ }
+ else if(elementNumber == SECOND_ELEMENT)
+ {
+ /* user application code */
+ }
+ else if(elementNumber == THIRD_ELEMENT)
+ {
+ /* user application code */
+ }
break;
}
/* Default case - Not valid command */
@@ -286,14 +393,29 @@ MOBLE_RESULT Appli_Vendor_LEDControl( MOBLEUINT8 const *data, MOBLEUINT32 length
/*Buffer will be sent for Reliable Response*/
/*First Byte is Sub Command and 2nd Byte is LED Status*/
ResponseBuffer[0] = subCommand;
- ResponseBuffer[1] = Appli_LedState ;
- BuffLength = 2;
-
- Appli_LedCtrl(); /* Controls the LED State */
+ if(subCommand == APPLI_CMD_LED_INTENSITY)
+ {
+ ResponseBuffer[1] = intensityValue >> 8 ;
+ ResponseBuffer[2] = intensityValue ;
+ BuffLength = 3;
+ }
+ else
+ {
+ ResponseBuffer[1] = Appli_LedState ;
+ BuffLength = 2;
+ }
return status;
}
+void Appli_GetTestValue (MOBLEUINT8 *responseValue)
+{
+ *responseValue = TestHitCounter;
+ *(responseValue+1) = TestHitCounter >> 8;
+ *(responseValue+2) = TestHitCounter >> 16;
+ *(responseValue+3) = TestHitCounter >> 24;
+ TestHitCounter = 0;
+}
/**
* @}
*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_vendor.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_vendor.h
index 2798ac852..3efba69ed 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_vendor.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_vendor.h
@@ -18,22 +18,25 @@
*/
/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __VENDOR_APPLI_H
-#define __VENDOR_APPLI_H
+#ifndef __APPLI_VENDOR_H
+#define __APPLI_VENDOR_H
/* Includes ------------------------------------------------------------------*/
#include "types.h"
#include "ble_mesh.h"
/* Exported macro ------------------------------------------------------------*/
+#define LED_OFF_VALUE 1U
+#define LED_ON_VALUE 32000U
/* Private define ------------------------------------------------------------*/
MOBLE_RESULT Appli_Vendor_LEDControl( MOBLEUINT8 const *data, MOBLEUINT32 length,
MOBLEUINT8 elementNumber, MOBLE_ADDRESS dst_peer);
MOBLE_RESULT Appli_Vendor_DeviceInfo(MOBLEUINT8 const *data, MOBLEUINT32 length);
MOBLE_RESULT Appli_Vendor_Test(MOBLEUINT8 const *data, MOBLEUINT32 length);
+void Appli_GetTestValue (MOBLEUINT8 *responseValue);
-#endif /* __VENDOR_APPLI_H */
+#endif /* __APPLI_VENDOR_H */
/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/ble_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/ble_conf.h
index 6a258c188..4cc3ce72b 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/ble_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/ble_conf.h
@@ -58,7 +58,7 @@
* This shall take into account all registered handlers
* (from either the provided services or the custom services)
*/
-#define BLE_CFG_SVC_MAX_NBR_CB 5
+#define BLE_CFG_SVC_MAX_NBR_CB 7
#define BLE_CFG_CLT_MAX_NBR_CB 5
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/hal_common.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/hal_common.h
index 3b93e2310..730c40219 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/hal_common.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/hal_common.h
@@ -23,7 +23,7 @@
/* Includes ------------------------------------------------------------------*/
-#if defined(NUCLEO_L152RE) || defined(USE_STM32WBXX_NUCLEO) /* NUCLEO_L152RE */
+#if defined(NUCLEO_L152RE) || defined(USE_STM32WBXX_NUCLEO) || USE_STM32WBXX_USB_DONGLE /* NUCLEO_L152RE */
#include "user_if.h"
#else /* not NUCLEO_L152RE */
#if defined(BLUENRG1) || defined(BLUENRG2) /* BLUENRG1 or BLUENRG2 */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/mesh_cfg.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/mesh_cfg.h
index eea81c61b..6c7fa7965 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/mesh_cfg.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/mesh_cfg.h
@@ -28,30 +28,23 @@
/* Exported macro ------------------------------------------------------------*/
/* Flash parameters */
-#define PAGE_SIZE 2048
+#define PAGE_SIZE 4096
#define RESET_MANAGER_FLASH_BASE_ADDRESS (0x10040000)
-#ifdef TRACE_ENABLE_MODEL
void TraceHeader(const char* func_name, int mode);
#define TraceB0(func_name, ...)
#define TraceB1(func_name, ...) do {TraceHeader(func_name, 0); printf( __VA_ARGS__);} while(0)
#define TraceBX(flags, func_name, ...) TraceB ##flags(func_name, ##__VA_ARGS__)
#define TRACE_M(flag, ...) TraceBX(flag, __func__, ##__VA_ARGS__)
-#else
-#define TRACE_M(flag, ...)
-#endif
/*Enable this Macro to enable the main function prints.
* This trace does not print the function name and clock.
*/
-#ifdef TRACE_ENABLE_NO_FUNCTION
#define TraceC0(...)
#define TraceC1(...) do { printf( __VA_ARGS__);} while(0)
-#define TraceCX(flags, ...) TraceC ##flags( ##__VA_ARGS__)
+//#define TraceCX(flags, ...) TraceC ##flags( ##__VA_ARGS__)
+#define TraceCX(flags, ...) TraceC ##flags( __VA_ARGS__)
#define TRACE_I(flag, ...) TraceCX(flag, ##__VA_ARGS__)
-#else
-#define TRACE_I(flag, ...)
-#endif
#ifdef EXTERNAL_MAC_ADDR_MGMT
@@ -64,6 +57,10 @@ void TraceHeader(const char* func_name, int mode);
#error "Please select atleast one MAC address Option"
#endif
+#ifdef ENABLE_UNPROVISIONING_BY_POWER_ONOFF_CYCLE
+#define ENABLE_SAVE_MODEL_STATE_NVM
+#endif
+
#ifdef ENABLE_SAVE_MODEL_STATE_NVM
#define SAVE_MODEL_STATE_NVM 1
#else
@@ -75,8 +72,24 @@ void TraceHeader(const char* func_name, int mode);
TR_GAP_BETWEEN_TRANSMISSION \
}
+#ifdef ENABLE_PB_ADV
+#define PB_ADV_SUPPORTED 1
+#else
#define PB_ADV_SUPPORTED 0
+#endif
+
+#ifdef ENABLE_PB_GATT
#define PB_GATT_SUPPORTED 1
+#else
+#define PB_GATT_SUPPORTED 0
+#endif
+
+#ifdef ENABLE_PUB_KEY_TYPE_OOB
+#define PUB_KEY_TYPE_OOB MOBLE_TRUE
+#else
+#define PUB_KEY_TYPE_OOB MOBLE_FALSE
+#endif
+
#if (PB_ADV_SUPPORTED == 0 && PB_GATT_SUPPORTED == 0)
#error "Atleast one of PB-ADV and PB-GATT should be defined"
@@ -116,20 +129,50 @@ void TraceHeader(const char* func_name, int mode);
#error "Low power node can't be friend node"
#endif
-#define BLUENRG_MESH_FEATURES (RELAY_FEATURE << 0 | PROXY_FEATURE << 1 | FRIEND_FEATURE << 2)
+#define BLUENRG_MESH_FEATURES (RELAY_FEATURE << 0 | PROXY_FEATURE << 1 | FRIEND_FEATURE << 2 | LOW_POWER_FEATURE << 3)
#define FRIEND_NODE_PARAMS \
{ \
FN_NO_OF_LPNS \
}
+#define LOW_POWER_NODE_PARAMS \
+{ \
+ LPN_RSSI_FACTOR_LEVEL, \
+ LPN_RECIVE_WINDOW_FACTOR_LEVEL, \
+ LPN_MINIMUM_QUEUE_SIZE_LOG, \
+ LPN_RECEIVE_DELAY, \
+ LPN_POLL_TIMEOUT, \
+ LPN_FRIEND_REQUEST_FREQUENCY, \
+ LPN_FRIEND_POLL_FREQUENCY, \
+ LPN_RECEIVE_WINDOW_SIZE, \
+ LPN_SUBSCR_LIST_SIZE, \
+ LPN_MINIMUM_RSSI, \
+ LPN_NO_OF_RETRIES \
+}
-
+/*
+* If PB-GATT and Proxy not supported, optimize related to GATT database not required
+*/
+#if (PB_GATT_SUPPORTED == 0 && PROXY_FEATURE == 0)
+#define BLUENRG_MESH_GATT_REQ 0
+#else
+#define BLUENRG_MESH_GATT_REQ 1
+#endif
#define UNPROV_NODE_INFO_PARAMS \
{ \
+ PUB_KEY_TYPE_OOB, \
+ PubKeyBuff, \
+ PrivKeyBuff, \
STATIC_OOB_SIZE, \
- StaticOobBuff \
+ StaticOobBuff, \
+ OUTPUT_OOB_SIZE, \
+ OUTPUT_OOB_ACTION, \
+ Appli_BleOutputOOBAuthCb, \
+ INPUT_OOB_SIZE, \
+ INPUT_OOB_ACTION, \
+ Appli_BleInputOOBAuthCb \
}
#ifdef ENABLE_NEIGHBOR_TABLE
@@ -170,6 +213,8 @@ void TraceHeader(const char* func_name, int mode);
#if FRIEND_FEATURE
#define FRIEND_BUFF_DYNAMIC_MEMORY_SIZE FN_NO_OF_LPNS*816+4
+#elif LOW_POWER_FEATURE
+#define FRIEND_BUFF_DYNAMIC_MEMORY_SIZE 112U
#else
#define FRIEND_BUFF_DYNAMIC_MEMORY_SIZE 1U
#endif
@@ -179,6 +224,7 @@ void TraceHeader(const char* func_name, int mode);
#define SEGMENTATION_COUNT (MAX_APPLICATION_PACKET_SIZE / 12) + 2
#define SAR_BUFFER_SIZE ((uint8_t)SEGMENTATION_COUNT) * 40
/* Added Interrupt handler for Uart */
+#define SdkEvalComIOUartIrqHandler UART_Handler
#if NEIGHBOR_TABLE_SUPPORTED
#define NEIGHBOR_TABLE_DYNAMIC_MEMORY_SIZE 32U*NEIGHBOR_COUNT
@@ -196,14 +242,14 @@ void TraceHeader(const char* func_name, int mode);
#define ENABLE_SERIAL_INTERFACE 1
#define ENABLE_UT 0
#define ENABLE_SERIAL_CONTROL 1
+#define ENABLE_APPLI_TEST 0
/* Exported variables ------------------------------------------------------- */
extern const DynBufferParam_t DynBufferParam;
extern const tr_params_t TrParams;
extern const lpn_params_t LpnParams;
extern const fn_params_t FnParams;
-extern const unprov_node_info_params_t UnprovNodeInfoParams;
-extern const MOBLEUINT8 StaticOobBuff[STATIC_OOB_SIZE];
+extern const prvn_params_t PrvnParams;
extern const neighbor_table_init_params_t NeighborTableParams;
/* Exported Functions Prototypes ---------------------------------------------*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/mesh_cfg_usr.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/mesh_cfg_usr.h
index f2594f744..6ce7e0810 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/mesh_cfg_usr.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/mesh_cfg_usr.h
@@ -48,7 +48,8 @@
/* Exported macro ------------------------------------------------------------*/
-/* Macros Used for user defined serial print data for models. Either use 0 to disable or 1 to enable
+/* Macros Used for user defined serial print data for models.
+Either use 0 to disable or 1 to enable
@ TF_GENERIC is responsible for the Generic model traces.
@ TF_LIGHT is responsible for the Light model traces.
@ TF_SENSOR is responsible for the Sensor model traces.
@@ -63,19 +64,20 @@
@ TF_MISC is responsible for the other type traces.
*/
-#define TF_GENERIC 0
-#define TF_LIGHT 0
-#define TF_SENSOR 0
-#define TF_VENDOR 0
-#define TF_NEIGHBOUR 0
-#define TF_PROVISION 1
-#define TF_LPN_FRND 0
-#define TF_ELEMENTS 0
-#define TF_ADDRESS 0
-#define TF_HANDLER 1
-#define TF_INIT 1
-#define TF_MISC 0
-#define TF_SERIAL_CTRL 0
+#define TF_GENERIC 1
+#define TF_LIGHT 1
+#define TF_LIGHT_LC 1
+#define TF_SENSOR 1
+#define TF_VENDOR 0
+#define TF_NEIGHBOUR 0
+#define TF_LPN_FRND 0
+#define TF_ELEMENTS 0
+#define TF_ADDRESS 0
+#define TF_PROVISION 1
+#define TF_HANDLER 0
+#define TF_INIT 0
+#define TF_MISC 0
+#define TF_SERIAL_CTRL 1
/*******************************************************************************
*** Following section helps to select right configuration of Models ***********
@@ -85,10 +87,14 @@
/* Define the following Macros to enable the usage of the Server Generic Models */
#define ENABLE_GENERIC_MODEL_SERVER_ONOFF
#define ENABLE_GENERIC_MODEL_SERVER_LEVEL
-/*
-#define ENABLE_GENERIC_MODEL_SERVER_DEFAULT_TRANSITION_TIME
#define ENABLE_GENERIC_MODEL_SERVER_POWER_ONOFF
#define ENABLE_GENERIC_MODEL_SERVER_POWER_ONOFF_SETUP
+//#define ENABLE_GENERIC_MODEL_SERVER_DEFAULT_TRANSITION_TIME
+
+/* The Following Models are not available in this version, will be developed in
+ next version.
+*/
+/*
#define ENABLE_GENERIC_MODEL_SERVER_POWER_LEVEL
#define ENABLE_GENERIC_MODEL_SERVER_POWER_LEVEL_SETUP
#define ENABLE_GENERIC_MODEL_SERVER_BATTERY
@@ -106,53 +112,112 @@
#define ENABLE_GENERIC_MODEL_CLIENT_LEVEL
*/
-/* Define the following Macros to enable the usage of the Light Models */
+/******************************************************************************/
+/******* Define the following Macros to enable the usage of the Light Models */
+/******************************************************************************/
#define ENABLE_LIGHT_MODEL_SERVER_LIGHTNESS
#define ENABLE_LIGHT_MODEL_SERVER_LIGHTNESS_SETUP
#define ENABLE_LIGHT_MODEL_SERVER_CTL
#define ENABLE_LIGHT_MODEL_SERVER_CTL_SETUP
#define ENABLE_LIGHT_MODEL_SERVER_CTL_TEMPERATURE
-//#define ENABLE_LIGHT_MODEL_SERVER_HSL
-//#define ENABLE_LIGHT_MODEL_SERVER_HSL_SETUP
-//#define ENABLE_LIGHT_MODEL_SERVER_HSL_HUE
-//#define ENABLE_LIGHT_MODEL_SERVER_HSL_SATURATION
+#define ENABLE_LIGHT_MODEL_SERVER_HSL
+#define ENABLE_LIGHT_MODEL_SERVER_HSL_SETUP
+#define ENABLE_LIGHT_MODEL_SERVER_HSL_HUE
+#define ENABLE_LIGHT_MODEL_SERVER_HSL_SATURATION
-/*
-#define ENABLE_LIGHT_MODEL_SERVER_XYL
-#define ENABLE_LIGHT_MODEL_SERVER_XYL_SETUP
+/*
+ The following Models are managed in different file light_lc.c in middleware
+*/
#define ENABLE_LIGHT_MODEL_SERVER_LC
#define ENABLE_LIGHT_MODEL_SERVER_LC_SETUP
+
+/*
+ The Following Models are not available in this version
*/
+//#define ENABLE_LIGHT_MODEL_SERVER_XYL
+//#define ENABLE_LIGHT_MODEL_SERVER_XYL_SETUP
+
+
+/* Following Macro helps to know if the Fixed functions are needed or not
+ DO NOT change or add any space at the end of the file */
+#if defined(ENABLE_LIGHT_MODEL_SERVER_LIGHTNESS) \
+ || defined(ENABLE_LIGHT_MODEL_SERVER_LIGHTNESS_SETUP) \
+ || defined(ENABLE_LIGHT_MODEL_SERVER_CTL) \
+ || defined(ENABLE_LIGHT_MODEL_SERVER_CTL_SETUP) \
+ || defined(ENABLE_LIGHT_MODEL_SERVER_CTL_TEMPERATURE) \
+ || defined(ENABLE_LIGHT_MODEL_SERVER_HSL) \
+ || defined(ENABLE_LIGHT_MODEL_SERVER_HSL_SETUP) \
+ || defined(ENABLE_LIGHT_MODEL_SERVER_HSL_HUE) \
+ || defined(ENABLE_LIGHT_MODEL_SERVER_HSL_SATURATION) \
+ || defined(ENABLE_LIGHT_MODEL_SERVER_LC) \
+ || defined(ENABLE_LIGHT_MODEL_SERVER_LC_SETUP) \
+ || defined(ENABLE_LIGHT_MODEL_SERVER_XYL) \
+ || defined(ENABLE_LIGHT_MODEL_SERVER_XYL_SETUP)
+ #define ENABLE_LIGHT_MODEL_SERVER
+#endif
+
+#if defined(ENABLE_LIGHT_MODEL_SERVER_LC) \
+ || defined(ENABLE_LIGHT_MODEL_SERVER_LC_SETUP)
+ #define ENABLE_LIGHT_LC_MODEL_SERVER
+#endif
+/******************************************************************************/
+/*
+Define the Macros for Enabling/disabling the binding of data between the Generic
+and Light model.
+@ define the Macro for enabling the binding
+@ Undefine or comment the macro for disabling the binding.
+*/
+/******************************************************************************/
+//#define ENABLE_MODEL_BINDING
+
+/******************************************************************************/
/* Define the following Macros to enable the usage of the Sensor Models */
+/******************************************************************************/
+
#define ENABLE_SENSOR_MODEL_SERVER
-//#define ENABLE_SENSOR_MODEL_SERVER_SETUP
+#define ENABLE_SENSOR_MODEL_SERVER_SETUP
+
+/* Define the macros for the numbers of sensor present.*/
+#define NUMBER_OF_SENSOR 2
+#define ENABLE_OCCUPANCY_SENSOR
+/*
+Macro is responsible for enabling and desabling the sensor publication.
+Comment this macro to disable the publication
+*/
+//#define ENABLE_SENSOR_PUBLICATION
+/******************************************************************************/
+/* Define the following Macros to enable the usage of the time and scene Models */
+/******************************************************************************/
+
+//#define ENABLE_TIME_MODEL_SERVER
+//#define ENABLE_TIME_MODEL_SERVER_SETUP
+//#define ENABLE_SCENE_MODEL_SERVER
+//#define ENABLE_SCENE_MODEL_SERVER_SETUP
+
+/******************************************************************************/
/*
Macros are defined to enable the setting for the PWM. these Macros are given for
-custom board of BLE, RGB board and default transition
-inserted in generic on off.
-NOTE- Only one macro must be enabled at one time , otherwise get confliction and
- firmware will not work properly.
+eval board of BlueNRG-1 and BlueNRG-2, costom board and STEVAL-BLUEMIC-1 board
+and default transition inserted in generic on off.
+IMPORTATNT NOTE- STEVAL_BLUENRG_1_BOARD_PWM_SELECTION
+ STEVAL_BLUENRG_2_BOARD_PWM_SELECTION
+ STEVAL_BLUEMIC_1_BOARD_PWM_SELECTION
+ CUSTOM_BOARD_PWM_SELECTION
+ GENERIC_ONOFF_DEFAULT_TRANSITION_ENABLE
+Only one macro must be enabled at one time from list of mocros provided here,
+otherwise get confliction and firmware will not work properly.
*/
+/******************************************************************************/
//#define STEVAL_BLUENRG_1_BOARD_PWM_SELECTION
//#define STEVAL_BLUENRG_2_BOARD_PWM_SELECTION
//#define STEVAL_BLUEMIC_1_BOARD_PWM_SELECTION
//#define CUSTOM_BOARD_PWM_SELECTION
-/* Macro to enable default transition for generic on off message.*/
-//#define GENERIC_ONOFF_DEFAULT_TRANSITION_ENABLE
-
-/*
-Define the Macros for Enabling/disabling the binding of data between the Generic and
-Light model.
-@ define the Macro for enabling the binding
-@ Undefine or comment the macro for disabling the binding.
-*/
-//#define ENABLE_MODEL_BINDING
-
+/******************************************************************************/
/*
Define the Macro for enabling/disabling the Publishing with Generic on off
or by Vendor Model.
@@ -161,25 +226,27 @@ or by Vendor Model.
*/
//#define VENDOR_MODEL_PUBLISH
-/* Define the macros for the numbers of sensor present.*/
-#define NUMBER_OF_SENSOR 2
+/******************************************************************************/
-/*
-Macro is responsible for enabling and desabling the sensor publication.
-Comment this macro to disable the publication
-*/
-//#define ENABLE_SENSOR_PUBLICATION
-/* Define the following Macros to change the step resolution and step count value */
-#define TRANSITION_SCALER 4
+/* Maximum Time period value of PWM */
#define PWM_TIME_PERIOD 31990U
-//#define PWM_DEFAULT_VALUE 10000U
-/* Macros are used to update the PWM state according to the condition. */
-//#define RESUME_STATE 1
-//#define RESET_STATE 2
-//#define DEFAULT_STATE 3
-//#define LOAD_STATE 4
+/******************************************************************************/
+/***** MACROS for POWER ON-OFF CYCLE BASED UNPROVISIONING *********************/
+/******************************************************************************/
+
+/*
+Define the following Macro to check the Power-OnOff Cycles
+5 Continous cycles of OnOff with Ontime <2 sec will cause unprovisioning
+*/
+//#define ENABLE_UNPROVISIONING_BY_POWER_ONOFF_CYCLE
+
+#define POWER_ON_OFF_CYCLES_FOR_UNPROVISIONING 5
+#define MASK_BITS_FOR_POWER_ON_OFF_CYCLES (0xFFFFFFFF << POWER_ON_OFF_CYCLES_FOR_UNPROVISIONING)
+ /* 0xFFFFFFE0 */
+#define ON_TIME_IN_SECONDS_FOR_POWER_CYCLING 2
+#define BLINK_TIMES_FOR_FACTORY_RESET 5
/*
Define the following Macro to save Generic and Light Model states in NVM
@@ -187,24 +254,85 @@ This may result into excessive flash erase operations, this should be avoided to
*/
#define ENABLE_SAVE_MODEL_STATE_NVM
+/* Only one Macro will be enable at one time */
+//#define SAVE_MODEL_STATE_FOR_ALL_MESSAGES
+#define SAVE_MODEL_STATE_POWER_FAILURE_DETECTION
+
+/* Macros defined for the number of bytes saved, number of bytes dedicated for ganeric
+ model and light model.
+*/
+#define APP_NVM_GENERIC_MODEL_SIZE 16U
+#define APP_NVM_LIGHT_MODEL_SIZE 16U
+#define APP_NVM_MODEL_SIZE 40U
+
+/*Macros are defined for the selection of the number of led and type of lighting
+ used for the application.
+*if board has one led, uncomment USER_BOARD_1LED
+*if board has cool warm leds, uncomment USER_BOARD_COOL_WHITE_LED
+*if board has RGB leds, uncomment USER_BOARD_RGB_LED
+*if board has RGB leds as well as cool warm leds, uncomment USER_BOARD_COOL_WHITE_LED
+ and USER_BOARD_RGB_LED
+*/
+/* comment ENABLE_GENERIC_MODEL_SERVER_DEFAULT_TRANSITION_TIME when using
+ USER_BOARD_COOL_WHITE_LED ,USER_BOARD_RGB_LED
+ Default transition is provided only for one led.
+*/
+//#define USER_BOARD_1LED
+//#define USER_BOARD_COOL_WHITE_LED
+#define USER_BOARD_RGB_LED
+
+#if defined(STEVAL_BLUEMIC_1_BOARD_PWM_SELECTION)
+ #define SINGLE_LED PWM1
+#endif
+
+/*******************************************************************************
+*** Following section helps to configure the LEDs of Application of Mesh ***********
+*******************************************************************************/
+
+#if defined STEVAL_BLUENRG_1_BOARD_PWM_SELECTION || defined STEVAL_BLUENRG_2_BOARD_PWM_SELECTION
+ #define SINGLE_LED PWM4
+ #define COOL_LED PWM0
+ #define WARM_LED PWM1
+ #define RED_LED PWM2
+ #define GREEN_LED PWM3
+ #define BLUE_LED PWM4
+#endif
+
+#if defined CUSTOM_BOARD_PWM_SELECTION || defined USE_STM32WBXX_NUCLEO || defined USE_STM32WBXX_USB_DONGLE
+ #define SINGLE_LED PWM4
+ #define COOL_LED PWM0
+ #define WARM_LED PWM1
+ #define RED_LED PWM2
+ #define GREEN_LED PWM3
+ #define BLUE_LED PWM4
+#endif
+
+#ifdef STEVAL_BLUEMIC_1_BOARD_PWM_SELECTION
+ #define SINGLE_LED PWM1
+ #define COOL_LED PWM0
+ #define WARM_LED PWM1
+ #define RED_LED PWM2
+ #define GREEN_LED PWM3
+ #define BLUE_LED PWM4
+#endif
/*******************************************************************************
*** Following section helps to configure the Application of Mesh ***********
*******************************************************************************/
-#define APPLICATION_NUMBER_OF_ELEMENTS 1
+#define APPLICATION_NUMBER_OF_ELEMENTS 1
/* Contains a 16-bit company identifier assigned by the Bluetooth SIG
(the list is available @ https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers )
For STMicroelectronics : it is 0x0030 */
-#define COMPANY_ID 0x0030
+#define COMPANY_ID 0x0030
/* Contains a 16-bit vendor-assigned product identifier */
-#define PRODUCT_ID 0x0001
+#define PRODUCT_ID 0x0001
/* Contains a 16-bit vendor-assigned product version ID */
-#define PRODUCT_VERSION_ID 0x0001
+#define PRODUCT_VERSION_ID 0x0001
-#define MAX_APPLICATION_PACKET_SIZE 160
+#define MAX_APPLICATION_PACKET_SIZE 160
/*******************************************************************************
********** MAC Address Configuration *******************************************
@@ -215,18 +343,17 @@ For STMicroelectronics : it is 0x0030 */
* DONT change the Values 0x01, 0x02, 0x03
* SELECT ONLY One of the Option
*/
-//#define GENERATE_STATIC_RANDOM_MAC 0x01
-//#define EXTERNAL_MAC_ADDR_MGMT 0x02
-#define INTERNAL_UNIQUE_NUMBER_MAC 0x03
+//#define GENERATE_STATIC_RANDOM_MAC 0x01
+//#define EXTERNAL_MAC_ADDR_MGMT 0x02
+#define INTERNAL_UNIQUE_NUMBER_MAC 0x03
/* Declare this value as 0x01 if the External Address is PUBLIC Address */
/* For example like this: #define EXTERNAL_MAC_IS_PUBLIC_ADDR 0x1 */
/* Else, by default, the external address will be treated as RANDOM */
-#define EXTERNAL_MAC_IS_PUBLIC_ADDR 0x0
+#define EXTERNAL_MAC_IS_PUBLIC_ADDR 0x0
/******************************************************************************/
-#define STATIC_OOB_SIZE 16U
/*******************************************************************************
****** Following section helps to select right configuration of node ***********
@@ -235,11 +362,46 @@ For STMicroelectronics : it is 0x0030 */
* Minimum gap between successive transmissions
* varies from 10 to 65535
*/
-#define TR_GAP_BETWEEN_TRANSMISSION 50U
+#define TR_GAP_BETWEEN_TRANSMISSION 50U
/*
-* Different features supported by BLE-Mesh. Uncomment according to application.
+* Different provision bearer supported by BlueNRG-Mesh. Define according to application.
+* Atleast one of PB-ADV and PB-GATT should be defined
+*/
+#define ENABLE_PB_ADV
+#define ENABLE_PB_GATT
+#define ENABLE_PUB_KEY_TYPE_OOB
+#define ENABLE_AUTH_TYPE_STATIC_OOB
+#define ENABLE_AUTH_TYPE_OUTPUT_OOB
+//#define ENABLE_AUTH_TYPE_INPUT_OOB
+
+/* Static OOB Configurations */
+#ifdef ENABLE_AUTH_TYPE_STATIC_OOB
+#define STATIC_OOB_SIZE 16U
+#else
+#define STATIC_OOB_SIZE 0U
+#endif
+/* Output OOB Configurations */
+#ifdef ENABLE_AUTH_TYPE_OUTPUT_OOB
+#define OUTPUT_OOB_SIZE 1U
+#define OUTPUT_OOB_ACTION OUTPUT_OOB_ACTION_BIT_BLINK
+#else
+#define OUTPUT_OOB_SIZE 0U
+#define OUTPUT_OOB_ACTION OUTPUT_OOB_ACTION_BIT_BLINK
+#endif
+
+/* Input OOB Configurations */
+#ifdef ENABLE_AUTH_TYPE_INPUT_OOB
+#define INPUT_OOB_SIZE 1U
+#define INPUT_OOB_ACTION INPUT_OOB_ACTION_BIT_PUSH
+#else
+#define INPUT_OOB_SIZE 0U
+#define INPUT_OOB_ACTION INPUT_OOB_ACTION_BIT_PUSH
+#endif
+
+/*
+* Different features supported by BlueNRG-Mesh. Uncomment according to application.
* Low power feature enabled node do not support other features.
* Do not define any other feature if Low Power feature is defined
*/
@@ -250,7 +412,7 @@ For STMicroelectronics : it is 0x0030 */
/*
-* Friend node receive window size is fixed at 255 ms
+* Friend node receive window size is fixed at 50 ms
*/
/*
@@ -265,12 +427,92 @@ For STMicroelectronics : it is 0x0030 */
* Number of Low power nodes that can be associated with Friend node
* varies from 1 to 10
*/
-#define FN_NO_OF_LPNS 2U
+#define FN_NO_OF_LPNS 2U
+
+/*
+* For prioritizing friendship offer with good RSSI link
+* varies from 0 to 3
+* Ref @Mesh_v1.0
+*/
+#define LPN_RSSI_FACTOR_LEVEL 1U
+
+/*
+* For prioritizing friendship offer with good receive window factor
+* varies from 0 to 3
+* Ref @Mesh_v1.0
+*/
+#define LPN_RECIVE_WINDOW_FACTOR_LEVEL 1U
+
+/*
+* Minimum packets queue size required
+* varies from 1 to 7
+* Ref @Mesh_v1.0
+*/
+#define LPN_MINIMUM_QUEUE_SIZE_LOG 2U
+
+/*
+* (unit ms)
+* varies from 0x0A to 0xFF
+* Ref @Mesh_v1.0
+*/
+#define LPN_RECEIVE_DELAY 150U
+
+/*
+* Poll timeout value after which friendship cease to exist (unit 100ms)
+* varies from 0x00000A to 0x34BBFF
+* Ref @Mesh_v1.0
+*/
+#define LPN_POLL_TIMEOUT 2000U
+
+/*
+* Maximum receive window size acceptable to low power node (unit ms)
+* varies from 10 to 255
+* Ref @Mesh_v1.0
+*/
+#define LPN_RECEIVE_WINDOW_SIZE 55U
+
+/*
+* Minimum friend's subscription list size capability required by lpn
+* varies from 1 to 5
+* Ref @Mesh_v1.0
+*/
+#define LPN_SUBSCR_LIST_SIZE 2U
+
+/*
+* Frequency at which low power node would send friend request (unit 100ms)
+* varies from 0 to 255
+*/
+#define LPN_FRIEND_REQUEST_FREQUENCY 50U
+
+/*
+* Frequency at which low power node would poll friend node (unit 100ms)
+* should be less than poll timeout
+*/
+#define LPN_FRIEND_POLL_FREQUENCY 25U
+
+/*
+* Minimum RSSI required by low power node
+* should be less than equal to -60
+*/
+#define LPN_MINIMUM_RSSI -100
+
+/*
+* Retries to be made by lpn before termination of friendship
+* varies from 2 to 10
+*/
+#define LPN_NO_OF_RETRIES 10U
/*
* Enable or disable neighbor table
* if defined -> enabled
+* If MAC address of neighbor changes it appears as new neighbor
+* Neighbor table update can be triggered (configurable) in following cases
+* On receiving Unprovisioned device beacon
+* On receiving Secure network beacon
+* On receiving Mesh message
+* Message with any TTL
+* Message with TTL = 0
* if not defined -> disabled
*/
#define ENABLE_NEIGHBOR_TABLE
@@ -278,27 +520,27 @@ For STMicroelectronics : it is 0x0030 */
/*
* Size of neighbor table
*/
-#define NEIGHBOR_COUNT 5U
+#define NEIGHBOR_COUNT 5U
/*
* (unit s)
* Duration (wrt appear or last refresh) for which neighbor exists in neighbor table
*/
-#define NEIGHBOR_ALIVE_TIME 20U
+#define NEIGHBOR_ALIVE_TIME 20U
/*
* Enable/disable neighbor table update with unprovisioned device beacon
* 0: Disable neighbor table update with unprovisioned device beacon
* 1: Enable neighbor table update with unprovisioned device beacon
*/
-#define NEIGHBOR_UNPRVND_DEV_BEACON_NTU 0U
+#define NEIGHBOR_UNPRVND_DEV_BEACON_NTU 0U
/*
* Enable/disable neighbor table update with secure network beacon
* 0: Disable neighbor table update with secure network beacon
* 1: Enable neighbor table update with secure network beacon
*/
-#define NEIGHBOR_SECURE_NET_BEACON_NTU 1U
+#define NEIGHBOR_SECURE_NET_BEACON_NTU 1U
/*
* Enable/disable neighbor table update with TTL 0 message
@@ -306,9 +548,9 @@ For STMicroelectronics : it is 0x0030 */
* 1: Enable neighbor table update with messages with 0 TTL
* 2: Enable neighbor table update with messages with any TTL
*/
-#define NEIGHBOR_MSG_TTLX_NTU 1U
+#define NEIGHBOR_MSG_TTLX_NTU 1U
-/* Exported variables ------------------------------------------------------- */
+/* Exported variables -------------------------------------------------------*/
/* Exported Functions Prototypes ---------------------------------------------*/
#endif /* __MESH_CFG_USR_H */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/models_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/models_if.c
index e3f3ec4cc..194a3ddca 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/models_if.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/models_if.c
@@ -33,6 +33,11 @@
#include "appli_nvm.h"
#include "ble_hci_le.h"
#include "models_if.h"
+//#include "bluenrg1_api.h"
+#include "PWM_config.h"
+#include "PWM_handlers.h"
+#include "appli_light_lc.h"
+#include "light_lc.h"
/** @addtogroup BLE_Mesh
* @{
@@ -84,7 +89,8 @@ const Appli_Vendor_cb_t VendorAppli_cb =
Appli_Vendor_LEDControl,
Appli_Vendor_DeviceInfo,
Appli_Vendor_Test,
- Appli_LedCtrl
+ Appli_LedCtrl,
+ Appli_GetTestValue
};
__attribute__((aligned(4)))
@@ -96,7 +102,13 @@ const Appli_Generic_cb_t GenericAppli_cb =
/* Generic Level callbacks */
Appli_Generic_Level_Set,
Appli_Generic_LevelDelta_Set,
- Appli_Generic_LevelMove_Set
+ Appli_Generic_LevelMove_Set,
+
+ /* Generic Power on off callbacks */
+ Appli_Generic_PowerOnOff_Set,
+
+ /* Generic Default transition time callbacks */
+ Appli_Generic_DefaultTransitionTime_Set
};
__attribute__((aligned(4)))
@@ -105,9 +117,13 @@ const Appli_Generic_State_cb_t Appli_GenericState_cb =
/* Generic Get On Off status */
Appli_Generic_GetOnOffStatus,
+ Appli_Generic_GetOnOffValue,
/* Generic Get level status */
Appli_Generic_GetLevelStatus,
-
+ /* Generic Get Power on off status */
+ Appli_Generic_GetPowerOnOffStatus,
+ /* Generic Get Default transition time status */
+ Appli_Generic_GetDefaultTransitionStatus
};
__attribute__((aligned(4)))
@@ -125,7 +141,7 @@ const Appli_Light_GetStatus_cb_t Appli_Light_GetStatus_cb =
Appli_Light_GetHslHueStatus,
Appli_Light_GetHslSaturationStatus,
Appli_Light_GetHslHueRange,
- Appli_Light_GetHslSatRange
+ Appli_Light_GetHslSatRange,
};
@@ -152,6 +168,27 @@ const Appli_Light_cb_t LightAppli_cb =
__attribute__((aligned(4)))
+const Appli_Light_Ctrl_cb_t LightLCAppli_cb =
+{
+ /* Light LC mode set callbacks */
+ Appli_LightLC_Mode_Set,
+ Appli_LightLC_OM_Set,
+ Appli_LightLC_OnOff_Set,
+};
+
+__attribute__((aligned(4)))
+const Appli_LightLC_GetStatus_cb_t Appli_LightLC_GetStatus_cb =
+{
+ Appli_LightLC_Get_ModeStatus,
+ Appli_LightLC_Get_OMModeStatus,
+ Appli_LightLC_Get_OnOffStatus,
+ Appli_LightLC_Get_AmbientLuxLevelOutput,
+ Appli_Light_LC_PIRegulatorOutput,
+};
+
+#ifdef ENABLE_SENSOR_MODEL_SERVER
+
+__attribute__((aligned(4)))
const Appli_Sensor_cb_t SensorAppli_cb =
{
/* Sensor Model callbacks */
@@ -168,6 +205,8 @@ const Appli_Sensor_GetStatus_cb_t Appli_Sensor_GetStatus_cb =
Appli_Sensor_GetSetting_IDStatus
};
+#endif
+
__attribute__((aligned(4)))
const MODEL_SIG_cb_t Model_SIG_cb[] =
@@ -177,33 +216,66 @@ const MODEL_SIG_cb_t Model_SIG_cb[] =
GenericModelServer_GetStatusRequestCb,
GenericModelServer_ProcessMessageCb
},
+#ifdef ENABLE_LIGHT_MODEL_SERVER
{
LightModelServer_GetOpcodeTableCb,
LightModelServer_GetStatusRequestCb,
LightModelServer_ProcessMessageCb
},
+#endif
+#if defined(ENABLE_SENSOR_MODEL_SERVER) || defined(ENABLE_SENSOR_MODEL_SERVER_SETUP)
{
SensorModelServer_GetOpcodeTableCb,
SensorModelServer_GetStatusRequestCb,
SensorModelServer_ProcessMessageCb
},
+#endif
+#if defined(ENABLE_TIME_MODEL_SERVER) || defined(ENABLE_SCENE_MODEL_SERVER)
{
Time_SceneModelServer_GetOpcodeTableCb,
Time_SceneModelServer_GetStatusRequestCb,
Time_SceneModelServer_ProcessMessageCb
},
+#endif
+#if defined(ENABLE_LIGHT_MODEL_SERVER_LC) || defined(ENABLE_LIGHT_MODEL_SERVER_LC_SETUP)
+ {
+ Light_LC_ModelServer_GetOpcodeTableCb,
+ Light_LC_ModelServer_GetStatusRequestCb,
+ Light_LC_ModelServer_ProcessMessageCb
+ },
+#endif
{ 0, 0,0 }
};
-/* __attribute__((aligned(4))) const APPLI_SAVE_MODEL_STATE_CB SaveModelState_cb = AppliNvm_SaveModelState; */
+__attribute__((aligned(4))) const APPLI_SAVE_MODEL_STATE_CB SaveModelState_cb = AppliNvm_SaveModelState;
#define MODEL_SIG_COUNT ( ( sizeof(Model_SIG_cb)/sizeof(Model_SIG_cb[0]) - 1 ))
+__attribute__((aligned(4)))
+const MODEL_Vendor_cb_t Model_Vendor_cb[] =
+{
+ {
+ VendorModel_PID1_GetOpcodeTableCb,
+ VendorModel_PID1_GetStatusRequestCb,
+ VendorModel_PID1_ProcessMessageCb
+ },
+ { 0, 0,0 }
+};
+
+#define MODEL_VENDOR_COUNT ( ( sizeof(Model_Vendor_cb)/sizeof(Model_Vendor_cb[0]) - 1 ))
+
extern MOBLEUINT8 NumberOfElements;
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
+void GetApplicationVendorModels(const MODEL_Vendor_cb_t** pModelsTable, MOBLEUINT32* VendorModelscount)
+{
+ *pModelsTable = Model_Vendor_cb ;
+ *VendorModelscount = MODEL_VENDOR_COUNT;
+
+ TRACE_M(TF_VENDOR,"GetApplicationVendorModels \r\n");
+}
/**
* @brief Initialization Commands for Models
@@ -212,24 +284,27 @@ extern MOBLEUINT8 NumberOfElements;
*/
void BLEMesh_ModelsInit(void)
{
-
- /* Callbacks used by BLE-Mesh library */
- BLEMesh_SetVendorCbMap(&vendor_cb);
+ MOBLEUINT8 modelStateLoad_Size;
+ MOBLEUINT8 modelStateLoadBuff[APP_NVM_MODEL_SIZE];
/* Callbacks used by BLE-Mesh Models */
BLEMesh_SetSIGModelsCbMap(Model_SIG_cb, MODEL_SIG_COUNT);
-#if defined ENABLE_GENERIC_MODEL_SERVER_ONOFF || defined ENABLE_LIGHT_MODEL_SERVER_CTL || defined ENABLE_GENERIC_MODEL_SERVER_LEVEL
/* Initialization of PWM value to 1 */
- /* PWM Initialization */
+ Appli_Light_PwmInit();
-#endif
+ /* Load generic model states from nvm */
+ AppliNvm_LoadModelState(modelStateLoadBuff, &modelStateLoad_Size);
+ if (modelStateLoad_Size != 0)
+ {
+ /* update states of generic model */
+ Model_RestoreStates(modelStateLoadBuff, modelStateLoad_Size);
+ }
-#ifdef ENABLE_SENSOR_MODEL_SERVER
+#if defined ENABLE_SENSOR_MODEL_SERVER && !defined CUSTOM_BOARD_PWM_SELECTION
/* Initiallization of sensors */
Appli_Sensor_Init();
-
#endif
}
@@ -243,9 +318,19 @@ void BLEMesh_ModelsProcess(void)
Generic_Process();
Lighting_Process();
Vendor_Process();
-#ifdef ENABLE_SENSOR_PUBLICATION
+/* Define this Macro to enable the publication of sensors data.*/
+#if defined ENABLE_SENSOR_MODEL_SERVER
Sensor_Process();
#endif
+
+#ifdef ENABLE_APPLI_TEST
+ Test_Process();
+#endif
+ ModelSave_Process();
+
+#ifdef ENABLE_LIGHT_MODEL_SERVER_LC
+ Light_control_Process();
+#endif
}
/**
@@ -281,16 +366,11 @@ void BLEMesh_ModelsCommand(void)
if(publishAddress)
{
-#ifndef DISABLE_TRACES
- printf("Published Address is= 0x%2x \n\r", publishAddress);
-#endif
-
+ TRACE_M(TF_ADDRESS,"Published Address is= 0x%2x \n\r", publishAddress);
}
else
{
-#ifndef DISABLE_TRACES
- printf("Publish Address is unassigned!\r\n");
-#endif
+ TRACE_M(TF_ADDRESS,"Publish Address is unassigned!\r\n");
}
#ifdef VENDOR_MODEL_PUBLISH
@@ -374,9 +454,7 @@ void BLEMesh_ModelsDelayPacket(MOBLE_ADDRESS peer,
%DEFAULT_DELAY_PACKET_RANDOM_TIME;
Appli_PendingPackets.head = Appli_PendingPackets.packet;
Appli_PendingPackets.head_index = 0;
-#ifndef DISABLE_TRACES
- printf("Randomized time: %ld\n\r", Appli_PendingPackets.send_time - Clock_Time());
-#endif
+ TRACE_M(TF_MISC, "Randomized time: %d\n\r", Appli_PendingPackets.send_time - Clock_Time());
}
else
{
@@ -421,19 +499,18 @@ void BLEMesh_ModelsSendDelayedPacket(void)
{
for (MOBLEUINT8 count=Appli_PendingPackets.packet_count; count!=0; count--)
{
-#ifndef DISABLE_TRACES
- printf("Sending randomized packets. Packet count: %d \n\r",\
+ TRACE_M(TF_MISC, "Sending randomized packets. Packet count: %d \n\r",\
Appli_PendingPackets.packet_count - count + 1);
-#endif
temp_index = ((Appli_PendingPackets.head_index+MAX_PENDING_PACKETS_QUE_SIZE+1)\
-count)%MAX_PENDING_PACKETS_QUE_SIZE;
ptr = Appli_PendingPackets.packet + temp_index;
- BLEMesh_SendResponse(ptr->peer,
- ptr->dst,
- ptr->command,
- ptr->data,
- ptr->length);
+ VendorModel_SendResponse(VENDOR_STMICRO_CID,
+ ptr->peer,
+ ptr->dst,
+ ptr->command,
+ ptr->data,
+ ptr->length);
}
Appli_PendingPackets.packet_count = 0;
@@ -452,6 +529,9 @@ MOBLEUINT8 BLEMesh_ModelsASCII_To_Char(MOBLEUINT8 tempValue)
return tempValue;
}
+__weak void Test_Process(void)
+{
+}
/**
* @}
*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/models_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/models_if.h
index be510c9b8..59d6ece5e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/models_if.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/models_if.h
@@ -39,7 +39,7 @@ void BLEMesh_ModelsDelayPacket(MOBLE_ADDRESS peer, MOBLE_ADDRESS dst, MOBLEUINT8
MOBLEUINT8 const * data, MOBLEUINT32 length);
void BLEMesh_ModelsSendDelayedPacket(void);
MOBLEUINT8 BLEMesh_ModelsASCII_To_Char(MOBLEUINT8 tempValue);
-#endif /* __MESH_MODELS_H */
+#endif /* __MODELS_H */
/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/pal_nvm.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/pal_nvm.c
new file mode 100644
index 000000000..329ca553d
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/pal_nvm.c
@@ -0,0 +1,487 @@
+/**
+ ******************************************************************************
+ * @file pal_nvm.c
+ * @author BLE Mesh Team
+ * @brief Flash management for the Controller
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+******************************************************************************
+*/
+
+/* Includes ------------------------------------------------------------------*/
+#include "types.h"
+#include "pal_nvm.h"
+#include "pal_if.h"
+#include <string.h>
+
+#include "ble.h"
+#include "shci.h"
+
+/* Private define ------------------------------------------------------------*/
+#define NVM_SIZE 0x00002000
+#define FLASH_SECTOR_SIZE 0x1000
+#define MAX_NVM_PENDING_WRITE_REQS 1
+
+/* Private variables ---------------------------------------------------------*/
+typedef struct
+{
+ MOBLEUINT16 offset;
+ MOBLEUINT16 size;
+ void const *buff;
+} BNRGM_NVM_WRITE;
+
+typedef struct
+{
+ MOBLEUINT8 no_of_pages_to_be_erased;
+ MOBLEUINT8 no_of_write_reqs;
+ MOBLEBOOL backup_req;
+ BNRGM_NVM_WRITE write_req[MAX_NVM_PENDING_WRITE_REQS];
+} BNRGM_NVM_REQS;
+
+BNRGM_NVM_REQS BnrgmNvmReqs = {0};
+
+/* Private functions ---------------------------------------------------------*/
+/**
+ * @brief Gets the page of a given address
+ * @param Addr: Address of the FLASH Memory
+ * @retval The page of a given address
+ */
+static MOBLEUINT32 GetPage(MOBLEUINT32 Addr)
+{
+ MOBLEUINT32 page = 0;
+
+ if (Addr < (FLASH_BASE + FLASH_BANK_SIZE))
+ {
+ /* Bank 1 */
+ page = (Addr - FLASH_BASE) / FLASH_PAGE_SIZE;
+ }
+ else
+ {
+ /* Bank 2 */
+ page = (Addr - (FLASH_BASE + FLASH_BANK_SIZE)) / FLASH_PAGE_SIZE;
+ }
+
+ return page;
+}
+
+#if 0
+/**
+* @brief PalNvmErase
+* @param None
+* @retval Result
+*/
+MOBLE_RESULT PalNvmErase(MOBLEUINT32 address,
+ MOBLEUINT32 offset)
+{
+ HAL_StatusTypeDef status = HAL_OK;
+ uint32_t pageError = 0;
+
+// printf("PalNvmErase >>>\r\n");
+
+ FLASH_EraseInitTypeDef erase;
+ erase.TypeErase = FLASH_TYPEERASE_PAGES;
+ erase.Page = GetPage(address + offset); /* 126 or 127 */;
+ erase.NbPages = FLASH_SECTOR_SIZE >> 12;
+
+ while( LL_HSEM_1StepLock( HSEM, CFG_HW_FLASH_SEMID ) );
+ HAL_FLASH_Unlock();
+ __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_WRPERR | FLASH_FLAG_OPTVERR);
+
+ SHCI_C2_FLASH_EraseActivity( ERASE_ACTIVITY_ON);
+
+ while(LL_FLASH_IsActiveFlag_OperationSuspended());
+ status = HAL_FLASHEx_Erase(&erase, &pageError);
+ while(LL_FLASH_IsActiveFlag_OperationSuspended());
+
+ SHCI_C2_FLASH_EraseActivity( ERASE_ACTIVITY_OFF);
+
+ HAL_FLASH_Lock();
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_FLASH_SEMID, 0 );
+
+// printf("PalNvmErase <<<\r\n");
+
+ return status == HAL_OK ? MOBLE_RESULT_SUCCESS : MOBLE_RESULT_FAIL;
+}
+#endif
+
+/**
+* @brief returns NVM write protect status
+* @param None
+* @retval TRUE if flash is write protected
+*/
+MOBLEBOOL MoblePalNvmIsWriteProtected(void)
+{
+ /* All flash is writable */
+ return MOBLE_FALSE;
+}
+
+/**
+* @brief Read NVM
+* @param address: read start address of nvm
+* @param offset: offset read start address of nvm
+* @param buf: copy of read content
+* @param size: size of memory to be read
+* @param backup: If read from backup memory
+* @retval Result of read operation
+*/
+MOBLE_RESULT MoblePalNvmRead(MOBLEUINT32 address,
+ MOBLEUINT32 offset,
+ void *buf,
+ MOBLEUINT32 size,
+ MOBLEBOOL backup)
+{
+ MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
+
+// printf("MoblePalNvmRead >>>\r\n");
+
+ if (offset > NVM_SIZE)
+ {
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else if (size == 0)
+ {
+ result = MOBLE_RESULT_FALSE;
+ }
+ else if (offset + size > NVM_SIZE)
+ {
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else
+ {
+ memcpy(buf, (void *)(address + offset), size);
+ }
+
+// printf("MoblePalNvmRead <<<\r\n");
+ return result;
+}
+
+/**
+* @brief Compare with NVM
+* @param offset: start address of nvm to compare
+* @param offset: offset start address of nvm
+* @param buf: copy of content
+* @param size: size of memory to be compared
+* @param comparison: outcome of comparison
+* @retval Result
+*/
+MOBLE_RESULT MoblePalNvmCompare(MOBLEUINT32 address,
+ MOBLEUINT32 offset,
+ void const *buf,
+ MOBLEUINT32 size,
+ MOBLE_NVM_COMPARE* comparison)
+{
+ MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
+
+// printf("MoblePalNvmCompare >>>\r\n");
+
+ if ((comparison == NULL) || (buf == NULL))
+ {
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else if (offset > NVM_SIZE)
+ {
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else if (size == 0)
+ {
+ result = MOBLE_RESULT_FALSE;
+ }
+ else if (offset + size > NVM_SIZE)
+ {
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else if (offset & 3)
+ {
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else if (size & 3)
+ {
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else
+ {
+ *comparison = MOBLE_NVM_COMPARE_EQUAL;
+ size >>= 3;
+
+ uint64_t* src = (uint64_t*)buf;
+ uint64_t* dst = (uint64_t*)(address + offset);
+
+ for (MOBLEUINT32 i=0; i<size; ++i)
+ {
+ if ((src[i<<3] != dst[i<<3]) && (*comparison == MOBLE_NVM_COMPARE_EQUAL))
+ {
+ *comparison = MOBLE_NVM_COMPARE_NOT_EQUAL;
+ }
+ if ((src[i<<3] & dst[i<<3]) != dst[i<<3])
+ {
+ *comparison = MOBLE_NVM_COMPARE_NOT_EQUAL_ERASE;
+ break;
+ }
+ }
+ }
+
+// printf("MoblePalNvmCompare <<<\r\n");
+
+ return result;
+}
+
+/**
+* @brief Erase NVM
+* @param None
+* @retval Result
+*/
+MOBLE_RESULT MoblePalNvmErase(MOBLEUINT32 address,
+ MOBLEUINT32 offset)
+{
+#if 0
+ if (BnrgmNvmReqs.no_of_pages_to_be_erased == 0)
+ {
+ BnrgmNvmReqs.no_of_pages_to_be_erased = BNRGM_NVM_SIZE/PAGE_SIZE;
+ }
+
+ return MOBLE_RESULT_SUCCESS;
+#else
+ HAL_StatusTypeDef status = HAL_OK;
+ uint32_t pageError = 0;
+
+// printf("MoblePalNvmErase >>>\r\n");
+
+ FLASH_EraseInitTypeDef erase;
+ erase.TypeErase = FLASH_TYPEERASE_PAGES;
+ erase.Page = GetPage(address + offset); /* 126 or 127 */;
+ erase.NbPages = FLASH_SECTOR_SIZE >> 12;
+
+ while( LL_HSEM_1StepLock( HSEM, CFG_HW_FLASH_SEMID ) );
+ HAL_FLASH_Unlock();
+ __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_WRPERR | FLASH_FLAG_OPTVERR);
+
+// SHCI_C2_FLASH_EraseActivity( ERASE_ACTIVITY_ON);
+
+ while(LL_FLASH_IsActiveFlag_OperationSuspended());
+ status = HAL_FLASHEx_Erase(&erase, &pageError);
+ while(LL_FLASH_IsActiveFlag_OperationSuspended());
+
+// SHCI_C2_FLASH_EraseActivity( ERASE_ACTIVITY_OFF);
+
+ HAL_FLASH_Lock();
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_FLASH_SEMID, 0 );
+
+// printf("MoblePalNvmErase <<<\r\n");
+
+ return status == HAL_OK ? MOBLE_RESULT_SUCCESS : MOBLE_RESULT_FAIL;
+#endif
+}
+
+/**
+* @brief Write to NVM
+* @param offset: wrt start address of nvm
+* @param offset: offset wrt start address of nvm
+* @param buf: copy of write content
+* @param size: size of memory to be written
+* @retval Result
+*/
+MOBLE_RESULT MoblePalNvmWrite(MOBLEUINT32 address,
+ MOBLEUINT32 offset,
+ void const *buf,
+ MOBLEUINT32 size)
+{
+ MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
+
+// printf("MoblePalNvmWrite >>>\r\n");
+
+ if (offset > NVM_SIZE)
+ {
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else if (size == 0)
+ {
+ result = MOBLE_RESULT_FALSE;
+ }
+ else if (offset + size > NVM_SIZE)
+ {
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else if (offset & 3)
+ {
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else if (size & 3)
+ {
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else
+ {
+#if 0
+ /* Check for repeated write request */
+ for (MOBLEUINT8 count = 0; count < BnrgmNvmReqs.no_of_write_reqs; count++)
+ {
+ if ((BnrgmNvmReqs.write_req[count].offset == (MOBLEUINT16)offset) &&
+ (BnrgmNvmReqs.write_req[count].size == (MOBLEUINT16)size) &&
+ (BnrgmNvmReqs.write_req[count].buff == buf))
+ {
+ return result;
+ }
+ }
+
+ if (BnrgmNvmReqs.no_of_write_reqs < MAX_NVM_PENDING_WRITE_REQS)
+ {
+ BnrgmNvmReqs.write_req[BnrgmNvmReqs.no_of_write_reqs].offset = (MOBLEUINT16)offset;
+ BnrgmNvmReqs.write_req[BnrgmNvmReqs.no_of_write_reqs].size = (MOBLEUINT16)size;
+ BnrgmNvmReqs.write_req[BnrgmNvmReqs.no_of_write_reqs].buff = buf;
+ BnrgmNvmReqs.no_of_write_reqs++;
+ }
+ /* If pending write requests already full, overwrite oldest one */
+ else
+ {
+ for (MOBLEINT8 count=0; count<MAX_NVM_PENDING_WRITE_REQS-2; count++)
+ {
+ BnrgmNvmReqs.write_req[count].offset = BnrgmNvmReqs.write_req[count+1].offset;
+ BnrgmNvmReqs.write_req[count].size = BnrgmNvmReqs.write_req[count+1].size;
+ BnrgmNvmReqs.write_req[count].buff = BnrgmNvmReqs.write_req[count+1].buff;
+ }
+
+ BnrgmNvmReqs.write_req[MAX_NVM_PENDING_WRITE_REQS - 1].offset = (MOBLEUINT16)offset;
+ BnrgmNvmReqs.write_req[MAX_NVM_PENDING_WRITE_REQS - 1].size = (MOBLEUINT16)size;
+ BnrgmNvmReqs.write_req[MAX_NVM_PENDING_WRITE_REQS - 1].buff = buf;
+ }
+#else
+ size >>= 3;
+
+ uint64_t* src = (uint64_t*)buf;
+// uint64_t* dst = (uint64_t*)(address + offset);
+
+ HAL_StatusTypeDef status = HAL_OK;
+
+ while( LL_HSEM_1StepLock( HSEM, CFG_HW_FLASH_SEMID ) );
+ HAL_FLASH_Unlock();
+ __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_WRPERR | FLASH_FLAG_OPTVERR);
+ for (size_t i = 0; (i < size) && (status == HAL_OK); i++)
+ {
+// if (src[i<<3] != dst[i<<3])
+// {
+ while(LL_FLASH_IsActiveFlag_OperationSuspended());
+ status = HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLEWORD, address + offset + (i <<3), src[i]);
+ if (status != HAL_OK)
+ {
+ break;
+ }
+// }
+ }
+ HAL_FLASH_Lock();
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_FLASH_SEMID, 0 );
+
+ if (HAL_OK != status)
+ {
+ result = MOBLE_RESULT_FAIL;
+ }
+#endif
+ }
+// printf("MoblePalNvmWrite <<<\r\n");
+
+ return result;
+}
+
+#if 0
+/**
+* @brief Backup process
+* @param None
+* @retval Result
+*/
+static MOBLE_RESULT BnrgmPalNvmBackupProcess(void)
+{
+ MOBLEUINT32 buff[4*N_BYTES_WORD];
+ static MOBLEUINT8 backup_pages_to_be_erased = 0;
+ MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
+
+ if (backup_pages_to_be_erased == 0)
+ {
+ backup_pages_to_be_erased = 1;
+ }
+
+ if(backup_pages_to_be_erased != 0)
+ {
+#if 0
+ BluenrgMesh_StopAdvScan();
+ ATOMIC_SECTION_BEGIN();
+ if(BluenrgMesh_IsFlashReadyToErase())
+ {
+ FLASH_ErasePage((uint16_t)((BNRGM_NVM_BACKUP_BASE - RESET_MANAGER_FLASH_BASE_ADDRESS) / PAGE_SIZE +
+ BNRGM_NVM_BACKUP_SIZE/PAGE_SIZE - backup_pages_to_be_erased));
+
+ if (FLASH_GetFlagStatus(Flash_CMDERR) == SET)
+ {
+ result = MOBLE_RESULT_FAIL;
+ }
+ else
+ {
+ backup_pages_to_be_erased--;
+ }
+ }
+ else
+ {
+ /* do nothing */
+ }
+ ATOMIC_SECTION_END();
+#else
+ result = PalNvmErase(NVM_BASE, FLASH_SECTOR_SIZE);
+ if(result == MOBLE_RESULT_SUCCESS)
+ backup_pages_to_be_erased = 0;
+#endif
+ }
+
+ if (result == MOBLE_RESULT_SUCCESS && backup_pages_to_be_erased == 0)
+ {
+#if 0
+ BluenrgMesh_StopAdvScan();
+ ATOMIC_SECTION_BEGIN();
+ if(BluenrgMesh_IsFlashReadyToErase())
+ {
+ for (size_t i = 0; i < BNRGM_NVM_BACKUP_SIZE && FLASH_GetFlagStatus(Flash_CMDERR) == RESET; )
+ {
+ memcpy((MOBLEUINT8*)buff, (void *)(BNRGM_NVM_BASE + i), 4*N_BYTES_WORD);
+ FLASH_ProgramWordBurst(BNRGM_NVM_BACKUP_BASE + i, (uint32_t*)buff);
+ i += 4*N_BYTES_WORD;
+ }
+
+ if (FLASH_GetFlagStatus(Flash_CMDERR) == SET)
+ {
+ result = MOBLE_RESULT_FAIL;
+ }
+ else
+ {
+ BnrgmNvmReqs.backup_req = MOBLE_FALSE;
+ }
+ }
+ else
+ {
+ /* do nothing */
+ }
+ ATOMIC_SECTION_END();
+#else
+#endif
+ }
+ return result;
+}
+#endif
+
+/**
+* @brief NVM process
+* @param None
+* @retval Result
+*/
+MOBLE_RESULT BnrgmPalNvmProcess(void)
+{
+ /* do nothing */
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/Production/.cproject b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/Production/.cproject
index 2f09b5bd6..86533e7da 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/Production/.cproject
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/Production/.cproject
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
- <cconfiguration id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.2024876806">
- <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.2024876806" moduleId="org.eclipse.cdt.core.settings" name="Debug">
+ <cconfiguration id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.932618172">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.932618172" moduleId="org.eclipse.cdt.core.settings" name="Debug">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@@ -14,29 +14,29 @@
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <configuration artifactExtension="elf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.2024876806" name="Debug" parent="fr.ac6.managedbuild.config.gnu.cross.exe.debug" postannouncebuildStep="Generating binary and Printing size information:" postbuildStep="arm-none-eabi-objcopy -O ihex &quot;${BuildArtifactFileBaseName}.elf&quot; &quot;${BuildArtifactFileBaseName}.hex&quot; &amp;&amp; arm-none-eabi-size &quot;${BuildArtifactFileName}&quot;">
- <folderInfo id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.2024876806." name="/" resourcePath="">
- <toolChain id="fr.ac6.managedbuild.toolchain.gnu.cross.exe.debug.181568189" name="Ac6 STM32 MCU GCC" superClass="fr.ac6.managedbuild.toolchain.gnu.cross.exe.debug">
- <option id="fr.ac6.managedbuild.option.gnu.cross.prefix.263556339" name="Prefix" superClass="fr.ac6.managedbuild.option.gnu.cross.prefix" useByScannerDiscovery="false" value="arm-none-eabi-" valueType="string"/>
- <option id="fr.ac6.managedbuild.option.gnu.cross.mcu.503716213" name="Mcu" superClass="fr.ac6.managedbuild.option.gnu.cross.mcu" useByScannerDiscovery="false" value="STM32WB55RGVx" valueType="string"/>
- <option id="fr.ac6.managedbuild.option.gnu.cross.board.1136911490" name="Board" superClass="fr.ac6.managedbuild.option.gnu.cross.board" useByScannerDiscovery="false" value="P-NUCLEO-WB55.NUCLEO" valueType="string"/>
+ <configuration artifactExtension="elf" artifactName="BLE_MeshLightingDemo" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" errorParsers="org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.GCCErrorParser" id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.932618172" name="Debug" parent="fr.ac6.managedbuild.config.gnu.cross.exe.debug" postannouncebuildStep="Generating binary and Printing size information:" postbuildStep="arm-none-eabi-objcopy -O ihex &quot;${BuildArtifactFileBaseName}.elf&quot; &quot;${BuildArtifactFileBaseName}.hex&quot; &amp;&amp; arm-none-eabi-size &quot;${BuildArtifactFileName}&quot;" preannouncebuildStep="" prebuildStep="">
+ <folderInfo id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.932618172." name="/" resourcePath="">
+ <toolChain errorParsers="" id="fr.ac6.managedbuild.toolchain.gnu.cross.exe.debug.1248264837" name="Ac6 STM32 MCU GCC" superClass="fr.ac6.managedbuild.toolchain.gnu.cross.exe.debug">
+ <option id="fr.ac6.managedbuild.option.gnu.cross.prefix.1386704338" name="Prefix" superClass="fr.ac6.managedbuild.option.gnu.cross.prefix" useByScannerDiscovery="false" value="arm-none-eabi-" valueType="string"/>
+ <option id="fr.ac6.managedbuild.option.gnu.cross.mcu.2089351909" name="Mcu" superClass="fr.ac6.managedbuild.option.gnu.cross.mcu" useByScannerDiscovery="false" value="STM32WB55RGVx" valueType="string"/>
+ <option id="fr.ac6.managedbuild.option.gnu.cross.board.186247487" name="Board" superClass="fr.ac6.managedbuild.option.gnu.cross.board" useByScannerDiscovery="false" value="P-NUCLEO-WB55.NUCLEO" valueType="string"/>
<option id="fr.ac6.managedbuild.option.gnu.cross.core.1083960614" name="Core" superClass="fr.ac6.managedbuild.option.gnu.cross.core" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value="ARM Cortex-M4"/>
<listOptionValue builtIn="false" value="CM4"/>
</option>
- <option id="fr.ac6.managedbuild.option.gnu.cross.instructionSet.1956518772" name="Instruction Set" superClass="fr.ac6.managedbuild.option.gnu.cross.instructionSet" useByScannerDiscovery="false" value="fr.ac6.managedbuild.option.gnu.cross.instructionSet.thumbII" valueType="enumerated"/>
- <option id="fr.ac6.managedbuild.option.gnu.cross.fpu.735458693" name="Floating point hardware" superClass="fr.ac6.managedbuild.option.gnu.cross.fpu" useByScannerDiscovery="false" value="fr.ac6.managedbuild.option.gnu.cross.fpu.fpv4-sp-d16" valueType="enumerated"/>
- <option id="fr.ac6.managedbuild.option.gnu.cross.floatabi.2015591766" name="Floating-point ABI" superClass="fr.ac6.managedbuild.option.gnu.cross.floatabi" useByScannerDiscovery="false" value="fr.ac6.managedbuild.option.gnu.cross.floatabi.softfp" valueType="enumerated"/>
- <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="fr.ac6.managedbuild.targetPlatform.gnu.cross.1306635307" isAbstract="false" osList="all" superClass="fr.ac6.managedbuild.targetPlatform.gnu.cross"/>
- <builder buildPath="${workspace_loc:/Production}/Debug" id="fr.ac6.managedbuild.builder.gnu.cross.1630980178" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="fr.ac6.managedbuild.builder.gnu.cross">
+ <option id="fr.ac6.managedbuild.option.gnu.cross.instructionSet.795821381" name="Instruction Set" superClass="fr.ac6.managedbuild.option.gnu.cross.instructionSet" useByScannerDiscovery="false" value="fr.ac6.managedbuild.option.gnu.cross.instructionSet.thumbII" valueType="enumerated"/>
+ <option id="fr.ac6.managedbuild.option.gnu.cross.fpu.530437801" name="Floating point hardware" superClass="fr.ac6.managedbuild.option.gnu.cross.fpu" useByScannerDiscovery="false" value="fr.ac6.managedbuild.option.gnu.cross.fpu.fpv4-sp-d16" valueType="enumerated"/>
+ <option id="fr.ac6.managedbuild.option.gnu.cross.floatabi.933963350" name="Floating-point ABI" superClass="fr.ac6.managedbuild.option.gnu.cross.floatabi" useByScannerDiscovery="false" value="fr.ac6.managedbuild.option.gnu.cross.floatabi.softfp" valueType="enumerated"/>
+ <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="fr.ac6.managedbuild.targetPlatform.gnu.cross.1585545483" isAbstract="false" osList="all" superClass="fr.ac6.managedbuild.targetPlatform.gnu.cross"/>
+ <builder buildPath="${workspace_loc:/Production}/Debug" errorParsers="org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.CWDLocator" id="fr.ac6.managedbuild.builder.gnu.cross.1262206442" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="fr.ac6.managedbuild.builder.gnu.cross">
<outputEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="Debug"/>
</outputEntries>
</builder>
- <tool id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.538970829" name="MCU GCC Compiler" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler">
- <option defaultValue="gnu.c.optimization.level.none" id="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level.689301737" name="Optimization Level" superClass="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="fr.ac6.managedbuild.gnu.c.optimization.level.size" valueType="enumerated"/>
- <option id="gnu.c.compiler.option.debugging.level.916091050" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/>
- <option id="gnu.c.compiler.option.include.paths.485333623" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
+ <tool command="gcc" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GCCErrorParser" id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.1688180070" name="MCU GCC Compiler" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler">
+ <option defaultValue="gnu.c.optimization.level.none" id="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level.257953186" name="Optimization Level" superClass="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="fr.ac6.managedbuild.gnu.c.optimization.level.size" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.debugging.level.182816955" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.include.paths.476391311" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="../../../../../../../../Drivers/CMSIS/Device/ST/STM32WBxx/Include"/>
<listOptionValue builtIn="false" value="../../../../../../../../Drivers/CMSIS/Include"/>
<listOptionValue builtIn="false" value="../../../../../../../../Drivers/STM32WBxx_HAL_Driver/Inc"/>
@@ -54,27 +54,27 @@
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread"/>
- <listOptionValue builtIn="false" value="../../../STM32_WPAN/App"/>
+ <listOptionValue builtIn="false" value="../../../STM32_WPAN/app"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble"/>
</option>
- <option id="gnu.c.compiler.option.preprocessor.def.symbols.1220472099" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">
+ <option id="gnu.c.compiler.option.preprocessor.def.symbols.2033495193" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="USE_STM32WBXX_NUCLEO"/>
<listOptionValue builtIn="false" value="STM32WB55xx"/>
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
<listOptionValue builtIn="false" value="CORE_CM4"/>
<listOptionValue builtIn="false" value="STM32"/>
<listOptionValue builtIn="false" value="ENABLE_USART"/>
- <listOptionValue builtIn="false" value="DISABLE_TRACES"/>
+ <listOptionValue builtIn="false" value="TRACE_ENABLE_NO_FUNCTION"/>
</option>
- <option id="fr.ac6.managedbuild.gnu.c.compiler.option.misc.other.1128669794" superClass="fr.ac6.managedbuild.gnu.c.compiler.option.misc.other" useByScannerDiscovery="false" value="-fmessage-length=0" valueType="string"/>
- <option id="gnu.c.compiler.option.dialect.std.1207783441" name="Language standard" superClass="gnu.c.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.c.compiler.dialect.default" valueType="enumerated"/>
- <inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c.698353687" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c"/>
- <inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.s.1058732434" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.s"/>
+ <option id="fr.ac6.managedbuild.gnu.c.compiler.option.misc.other.115697242" superClass="fr.ac6.managedbuild.gnu.c.compiler.option.misc.other" useByScannerDiscovery="false" value="-fmessage-length=0" valueType="string"/>
+ <option id="gnu.c.compiler.option.dialect.std.294148235" name="Language standard" superClass="gnu.c.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.c.compiler.dialect.default" valueType="enumerated"/>
+ <inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c.716739049" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c"/>
+ <inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.s.1860983345" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.s"/>
</tool>
- <tool id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.1615975979" name="MCU G++ Compiler" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler">
- <option defaultValue="gnu.cpp.optimization.level.none" id="fr.ac6.managedbuild.gnu.cpp.compiler.option.optimization.level.1559199837" name="Optimization Level" superClass="fr.ac6.managedbuild.gnu.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="fr.ac6.managedbuild.gnu.cpp.optimization.level.most" valueType="enumerated"/>
- <option id="gnu.cpp.compiler.option.debugging.level.1876966172" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
- <option id="gnu.cpp.compiler.option.include.paths.1406683620" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
+ <tool id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.1149542096" name="MCU G++ Compiler" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler">
+ <option defaultValue="gnu.cpp.optimization.level.none" id="fr.ac6.managedbuild.gnu.cpp.compiler.option.optimization.level.543708657" name="Optimization Level" superClass="fr.ac6.managedbuild.gnu.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="fr.ac6.managedbuild.gnu.cpp.optimization.level.most" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.debugging.level.85908244" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.debugging.level.max" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.include.paths.1138011947" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="../../../../../../../../Drivers/CMSIS/Device/ST/STM32WBxx/Include"/>
<listOptionValue builtIn="false" value="../../../../../../../../Drivers/CMSIS/Include"/>
<listOptionValue builtIn="false" value="../../../../../../../../Drivers/STM32WBxx_HAL_Driver/Inc"/>
@@ -96,58 +96,62 @@
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble/core/Inc"/>
</option>
- <option id="gnu.cpp.compiler.option.preprocessor.def.473825495" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">
+ <option id="gnu.cpp.compiler.option.preprocessor.def.symbols.1432075462" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="USE_STM32WBXX_NUCLEO"/>
<listOptionValue builtIn="false" value="STM32WB55xx"/>
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
<listOptionValue builtIn="false" value="CORE_CM4"/>
<listOptionValue builtIn="false" value="STM32"/>
<listOptionValue builtIn="false" value="ENABLE_USART"/>
- <listOptionValue builtIn="false" value="DISABLE_TRACES"/>
+ <listOptionValue builtIn="false" value="TRACE_ENABLE_NO_FUNCTION"/>
</option>
- <option id="fr.ac6.managedbuild.gnu.cpp.compiler.option.misc.other.1170115282" name="Other flags" superClass="fr.ac6.managedbuild.gnu.cpp.compiler.option.misc.other" useByScannerDiscovery="false" value="-fmessage-length=0" valueType="string"/>
- <inputType id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.cpp.1767742474" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.cpp"/>
- <inputType id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.s.211885976" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.s"/>
+ <option id="fr.ac6.managedbuild.gnu.cpp.compiler.option.misc.other.1052602723" name="Other flags" superClass="fr.ac6.managedbuild.gnu.cpp.compiler.option.misc.other" useByScannerDiscovery="false" value="-fmessage-length=0" valueType="string"/>
+ <inputType id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.cpp.2007269099" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.cpp"/>
+ <inputType id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.s.1091643592" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.s"/>
</tool>
- <tool id="fr.ac6.managedbuild.tool.gnu.cross.c.linker.592355865" name="MCU GCC Linker" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.linker">
- <option id="fr.ac6.managedbuild.tool.gnu.cross.c.linker.script.1736692523" name="Linker Script (-T)" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.linker.script" useByScannerDiscovery="false" value="../stm32wb55xx_flash_cm4.ld" valueType="string"/>
- <option id="gnu.c.link.option.libs.2099182212" name="Libraries (-l)" superClass="gnu.c.link.option.libs" useByScannerDiscovery="false" valueType="libs">
+ <tool command="gcc" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GLDErrorParser" id="fr.ac6.managedbuild.tool.gnu.cross.c.linker.339934871" name="MCU GCC Linker" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.linker">
+ <option id="fr.ac6.managedbuild.tool.gnu.cross.c.linker.script.1706582210" name="Linker Script (-T)" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.linker.script" useByScannerDiscovery="false" value="../stm32wb55xx_flash_cm4.ld" valueType="string"/>
+ <option id="gnu.c.link.option.libs.158768156" name="Libraries (-l)" superClass="gnu.c.link.option.libs" useByScannerDiscovery="false" valueType="libs">
<listOptionValue builtIn="false" value=":libBle_Mesh_CM4_GCC.a"/>
<listOptionValue builtIn="false" value=":libSTM32CryptographicV3.0.0_CM4_GCC.a"/>
</option>
- <option id="gnu.c.link.option.paths.1169351268" name="Library search path (-L)" superClass="gnu.c.link.option.paths" useByScannerDiscovery="false" valueType="libPaths">
+ <option id="gnu.c.link.option.paths.990103616" name="Library search path (-L)" superClass="gnu.c.link.option.paths" useByScannerDiscovery="false" valueType="libPaths">
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble/mesh/Library"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble/cryptographic/Lib"/>
</option>
- <option id="gnu.c.link.option.ldflags.1473035949" name="Linker flags" superClass="gnu.c.link.option.ldflags" useByScannerDiscovery="false" value="-specs=nosys.specs -specs=nano.specs" valueType="string"/>
- <option id="gnu.c.link.option.other.833728333" name="Other options (-Xlinker [option])" superClass="gnu.c.link.option.other" useByScannerDiscovery="false"/>
- <inputType id="cdt.managedbuild.tool.gnu.c.linker.input.169280000" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
+ <option id="gnu.c.link.option.ldflags.952719172" name="Linker flags" superClass="gnu.c.link.option.ldflags" useByScannerDiscovery="false" value="-specs=nosys.specs -specs=nano.specs" valueType="string"/>
+ <option id="gnu.c.link.option.other.1268709152" name="Other options (-Xlinker [option])" superClass="gnu.c.link.option.other" useByScannerDiscovery="false"/>
+ <inputType id="cdt.managedbuild.tool.gnu.c.linker.input.876087406" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
- <tool id="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.882849016" name="MCU G++ Linker" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker">
- <option id="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.script.1380114765" name="Linker Script (-T)" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.script" value="../stm32wb55xx_flash_cm4.ld" valueType="string"/>
- <option id="gnu.cpp.link.option.libs.439607079" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
+ <tool id="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.122203931" name="MCU G++ Linker" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker">
+ <option id="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.script.540703595" name="Linker Script (-T)" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.script" value="../stm32wb55xx_flash_cm4.ld" valueType="string"/>
+ <option id="gnu.cpp.link.option.libs.1128966589" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
<listOptionValue builtIn="false" value=":libBle_Mesh_CM4_GCC.a"/>
<listOptionValue builtIn="false" value=":STM32CryptographicV3.1.1_CM4_GCC.a"/>
</option>
- <option id="gnu.cpp.link.option.paths.555549908" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
+ <option id="gnu.cpp.link.option.paths.1601975486" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble/mesh/Library"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble/cryptographic/Lib"/>
</option>
- <option id="gnu.cpp.link.option.flags.1400601417" name="Linker flags" superClass="gnu.cpp.link.option.flags" value="-specs=nosys.specs -specs=nano.specs" valueType="string"/>
- <option id="gnu.cpp.link.option.other.324630630" name="Other options (-Xlinker [option])" superClass="gnu.cpp.link.option.other" useByScannerDiscovery="false"/>
- <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.223964334" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+ <option id="gnu.cpp.link.option.ldflags.297372290" superClass="gnu.cpp.link.option.ldflags" value="-specs=nosys.specs -specs=nano.specs" valueType="string"/>
+ <option id="gnu.cpp.link.option.other.745377539" name="Other options (-Xlinker [option])" superClass="gnu.cpp.link.option.other" useByScannerDiscovery="false"/>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.189262959" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
- <tool id="fr.ac6.managedbuild.tool.gnu.archiver.197539538" name="MCU GCC Archiver" superClass="fr.ac6.managedbuild.tool.gnu.archiver"/>
- <tool id="fr.ac6.managedbuild.tool.gnu.cross.assembler.2061019426" name="MCU GCC Assembler" superClass="fr.ac6.managedbuild.tool.gnu.cross.assembler">
- <option id="gnu.both.asm.option.include.paths.1276375493" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" useByScannerDiscovery="false"/>
- <inputType id="cdt.managedbuild.tool.gnu.assembler.input.37345614" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
- <inputType id="fr.ac6.managedbuild.tool.gnu.cross.assembler.input.399082609" superClass="fr.ac6.managedbuild.tool.gnu.cross.assembler.input"/>
+ <tool id="fr.ac6.managedbuild.tool.gnu.archiver.1818451256" name="MCU GCC Archiver" superClass="fr.ac6.managedbuild.tool.gnu.archiver"/>
+ <tool command="as" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GASErrorParser" id="fr.ac6.managedbuild.tool.gnu.cross.assembler.exe.release.675030795" name="MCU GCC Assembler" superClass="fr.ac6.managedbuild.tool.gnu.cross.assembler.exe.release">
+ <option id="gnu.both.asm.option.include.paths.1641974392" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" useByScannerDiscovery="false"/>
+ <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1675712243" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+ <inputType id="fr.ac6.managedbuild.tool.gnu.cross.assembler.input.236800321" superClass="fr.ac6.managedbuild.tool.gnu.cross.assembler.input"/>
+ </tool>
+ <tool command="as" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GASErrorParser" id="fr.ac6.managedbuild.tool.gnu.cross.assembler.799971244" name="MCU GCC Assembler" superClass="fr.ac6.managedbuild.tool.gnu.cross.assembler">
+ <inputType id="cdt.managedbuild.tool.gnu.assembler.input.2128040906" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+ <inputType id="fr.ac6.managedbuild.tool.gnu.cross.assembler.input.1664035662" superClass="fr.ac6.managedbuild.tool.gnu.cross.assembler.input"/>
</tool>
</toolChain>
</folderInfo>
@@ -160,11 +164,11 @@
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <project id="Production.fr.ac6.managedbuild.target.gnu.cross.exe.382505129" name="Executable" projectType="fr.ac6.managedbuild.target.gnu.cross.exe"/>
+ <project id="Production.fr.ac6.managedbuild.target.gnu.cross.exe.708479980" name="Executable" projectType="fr.ac6.managedbuild.target.gnu.cross.exe"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
- <scannerConfigBuildInfo instanceId="fr.ac6.managedbuild.config.gnu.cross.exe.debug.2024876806;fr.ac6.managedbuild.config.gnu.cross.exe.debug.2024876806.;fr.ac6.managedbuild.tool.gnu.cross.c.compiler.538970829;fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c.698353687">
+ <scannerConfigBuildInfo instanceId="fr.ac6.managedbuild.config.gnu.cross.exe.debug.932618172;fr.ac6.managedbuild.config.gnu.cross.exe.debug.932618172.;fr.ac6.managedbuild.tool.gnu.cross.c.compiler.1688180070;fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c.716739049">
<autodiscovery enabled="false" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/Production/.project b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/Production/.project
index 5b58bd4f6..f2679ddc9 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/Production/.project
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/Production/.project
@@ -85,11 +85,21 @@
<location>PARENT-2-PROJECT_LOC/STM32_WPAN/app/appli_light.c</location>
</link>
<link>
+ <name>Application/STM32_WPAN/app/appli_light_lc.c</name>
+ <type>1</type>
+ <location>PARENT-2-PROJECT_LOC/STM32_WPAN/app/appli_light_lc.c</location>
+ </link>
+ <link>
<name>Application/STM32_WPAN/app/appli_mesh.c</name>
<type>1</type>
<location>PARENT-2-PROJECT_LOC/STM32_WPAN/app/appli_mesh.c</location>
</link>
<link>
+ <name>Application/STM32_WPAN/app/appli_nvm.c</name>
+ <type>1</type>
+ <location>PARENT-2-PROJECT_LOC/STM32_WPAN/app/appli_nvm.c</location>
+ </link>
+ <link>
<name>Application/STM32_WPAN/app/appli_sensor.c</name>
<type>1</type>
<location>PARENT-2-PROJECT_LOC/STM32_WPAN/app/appli_sensor.c</location>
@@ -105,6 +115,21 @@
<location>PARENT-2-PROJECT_LOC/STM32_WPAN/app/models_if.c</location>
</link>
<link>
+ <name>Application/STM32_WPAN/app/pal_nvm.c</name>
+ <type>1</type>
+ <location>PARENT-2-PROJECT_LOC/STM32_WPAN/app/pal_nvm.c</location>
+ </link>
+ <link>
+ <name>Application/STM32_WPAN/app/PWM_config.c</name>
+ <type>1</type>
+ <location>PARENT-2-PROJECT_LOC/STM32_WPAN/app/PWM_config.c</location>
+ </link>
+ <link>
+ <name>Application/STM32_WPAN/app/PWM_handlers.c</name>
+ <type>1</type>
+ <location>PARENT-2-PROJECT_LOC/STM32_WPAN/app/PWM_handlers.c</location>
+ </link>
+ <link>
<name>Application/STM32_WPAN/target/hw_ipcc.c</name>
<type>1</type>
<location>PARENT-2-PROJECT_LOC/STM32_WPAN/target/hw_ipcc.c</location>
@@ -195,6 +220,16 @@
<location>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rtc_ex.c</location>
</link>
<link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_tim.c</name>
+ <type>1</type>
+ <location>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_tim.c</location>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_tim_ex.c</name>
+ <type>1</type>
+ <location>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_tim_ex.c</location>
+ </link>
+ <link>
<name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_uart.c</name>
<type>1</type>
<location>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_uart.c</location>
@@ -220,6 +255,11 @@
<location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/light.c</location>
</link>
<link>
+ <name>Middlewares/STM32_WPAN/ble/blesvc/light_lc.c</name>
+ <type>1</type>
+ <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/light_lc.c</location>
+ </link>
+ <link>
<name>Middlewares/STM32_WPAN/ble/blesvc/mesh.c</name>
<type>1</type>
<location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/svc/Src/mesh.c</location>
@@ -230,11 +270,6 @@
<location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/mesh/Src/mesh_cfg.c</location>
</link>
<link>
- <name>Middlewares/STM32_WPAN/ble/blesvc/pal_nvm.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/mesh/PAL/STM32WB/pal_nvm.c</location>
- </link>
- <link>
<name>Middlewares/STM32_WPAN/ble/blesvc/sensors.c</name>
<type>1</type>
<location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/sensors.c</location>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/Production/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/Production/stm32wb55xx_flash_cm4.ld
index c13e110db..a9ccd801e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/Production/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/Production/stm32wb55xx_flash_cm4.ld
@@ -11,7 +11,7 @@
**
** Environment : System Workbench for MCU
**
-** Distribution: The file is distributed “as is,� without any warranty
+** Distribution: The file is distributed “as is,” without any warranty
** of any kind.
**
*****************************************************************************
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/readme.txt b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/readme.txt
index 035008879..b48f650ab 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/readme.txt
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingDemo/readme.txt
@@ -56,18 +56,29 @@ This is the implementation of the BLE Mesh Lighting profile as specified by the
- BLE/BLE_MeshLightingDemo/STM32_WPAN/App/appli_generic.h Header of BLE Mesh Generic Profile implementation
- BLE/BLE_MeshLightingDemo/STM32_WPAN/App/appli_light.c BLE Mesh Light Profile implementation
- BLE/BLE_MeshLightingDemo/STM32_WPAN/App/appli_light.h Header of BLE Mesh Light Profile implementation
+ - BLE/BLE_MeshLightingDemo/STM32_WPAN/App/appli_light_lc.c BLE Mesh Light Lightness Controller Profile implementation
+ - BLE/BLE_MeshLightingDemo/STM32_WPAN/App/appli_light_lc.h Header of BLE Mesh Light Lightness Controller Profile implementation
- BLE/BLE_MeshLightingDemo/STM32_WPAN/App/appli_mesh.c BLE Mesh application implementation
- BLE/BLE_MeshLightingDemo/STM32_WPAN/App/appli_mesh.h Header of BLE Mesh application implementation
+ - BLE/BLE_MeshLightingDemo/STM32_WPAN/App/appli_nvm.c BLE Mesh NVM application implementation
+ - BLE/BLE_MeshLightingDemo/STM32_WPAN/App/appli_nvm.h Header of BLE Mesh NVM application implementation
- BLE/BLE_MeshLightingDemo/STM32_WPAN/App/appli_sensor.c BLE Mesh Sensor Profile implementation
- BLE/BLE_MeshLightingDemo/STM32_WPAN/App/appli_sensor.h Header of BLE Mesh Sensor Profile implementation
- - BLE/BLE_MeshLightingDemo/STM32_WPAN/App/appli_sensor.c BLE Mesh Vendor Profile implementation
- - BLE/BLE_MeshLightingDemo/STM32_WPAN/App/appli_sensor.h Header of BLE Mesh Vendor Profile implementation
+ - BLE/BLE_MeshLightingDemo/STM32_WPAN/App/appli_vendor.c BLE Mesh Vendor Profile implementation
+ - BLE/BLE_MeshLightingDemo/STM32_WPAN/App/appli_vendor.h Header of BLE Mesh Vendor Profile implementation
- BLE/BLE_MeshLightingDemo/STM32_WPAN/App/ble_conf.h BLE Services configuration
- BLE/BLE_MeshLightingDemo/STM32_WPAN/App/ble_dbg_conf.h BLE Traces configuration of the BLE services
- BLE/BLE_MeshLightingDemo/STM32_WPAN/App/hal_common.h Header for common function of HAL file
- BLE/BLE_MeshLightingDemo/STM32_WPAN/App/mesh_cfg.h Header for Mesh configuration
+ - BLE/BLE_MeshLightingDemo/STM32_WPAN/App/mesh_cfg_usr.h Header for user Mesh configuration
- BLE/BLE_MeshLightingDemo/STM32_WPAN/App/models_if.h Header for the BLE Mesh Models Interface file
- BLE/BLE_MeshLightingDemo/STM32_WPAN/App/models_if.c BLE Mesh Models Interface file
+ - BLE/BLE_MeshLightingDemo/STM32_WPAN/App/pal_nvm.c BLE Mesh NVM management implementation
+ - BLE/BLE_MeshLightingDemo/STM32_WPAN/App/pal_nvm.h Header of BLE Mesh NVM management implementation
+ - BLE/BLE_MeshLightingDemo/STM32_WPAN/App/PWM_config.c Pulse Width Modulation configuration
+ - BLE/BLE_MeshLightingDemo/STM32_WPAN/App/PWM_config.h Header of Pulse Width Modulation configuration
+ - BLE/BLE_MeshLightingDemo/STM32_WPAN/App/PWM_handlers.c Pulse Width Modulation handlers
+ - BLE/BLE_MeshLightingDemo/STM32_WPAN/App/PWM_handlers.h Header of Pulse Width Modulation handlers
- BLE/BLE_MeshLightingDemo/STM32_WPAN/App/svcctl_conf.c Service Controller configuration API
- BLE/BLE_MeshLightingDemo/STM32_WPAN/App/tl_conf.h Configuration file of the Transport layer
- BLE/BLE_MeshLightingDemo/STM32_WPAN/App/tl_if.c Transport Layer interface
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/app_common.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/app_common.h
new file mode 100644
index 000000000..4defc5d7a
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/app_common.h
@@ -0,0 +1,114 @@
+/**
+ ******************************************************************************
+ * File Name : app_common.h
+ * Description : App Common application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_COMMON_H
+#define APP_COMMON_H
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+#include <stdint.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+
+#include "app_conf.h"
+
+ /* -------------------------------- *
+ * Basic definitions *
+ * -------------------------------- */
+
+#undef NULL
+#define NULL 0
+
+#undef FALSE
+#define FALSE 0
+
+#undef TRUE
+#define TRUE (!0)
+
+ /* -------------------------------- *
+ * Critical Section definition *
+ * -------------------------------- */
+#define BACKUP_PRIMASK() uint32_t primask_bit= __get_PRIMASK()
+#define DISABLE_IRQ() __disable_irq()
+#define RESTORE_PRIMASK() __set_PRIMASK(primask_bit)
+
+ /* -------------------------------- *
+ * Macro delimiters *
+ * -------------------------------- */
+
+#define M_BEGIN do {
+
+#define M_END } while(0)
+
+ /* -------------------------------- *
+ * Some useful macro definitions *
+ * -------------------------------- */
+
+#define MAX( x, y ) (((x)>(y))?(x):(y))
+
+#define MIN( x, y ) (((x)<(y))?(x):(y))
+
+#define MODINC( a, m ) M_BEGIN (a)++; if ((a)>=(m)) (a)=0; M_END
+
+#define MODDEC( a, m ) M_BEGIN if ((a)==0) (a)=(m); (a)--; M_END
+
+#define MODADD( a, b, m ) M_BEGIN (a)+=(b); if ((a)>=(m)) (a)-=(m); M_END
+
+#define MODSUB( a, b, m ) MODADD( a, (m)-(b), m )
+
+#define PAUSE( t ) M_BEGIN \
+ __IO int _i; \
+ for ( _i = t; _i > 0; _i -- ); \
+ M_END
+
+#define DIVF( x, y ) ((x)/(y))
+
+#define DIVC( x, y ) (((x)+(y)-1)/(y))
+
+#define DIVR( x, y ) (((x)+((y)/2))/(y))
+
+#define SHRR( x, n ) ((((x)>>((n)-1))+1)>>1)
+
+#define BITN( w, n ) (((w)[(n)/32] >> ((n)%32)) & 1)
+
+#define BITNSET( w, n, b ) M_BEGIN (w)[(n)/32] |= ((U32)(b))<<((n)%32); M_END
+
+ /* -------------------------------- *
+ * Compiler *
+ * -------------------------------- */
+#define PLACE_IN_SECTION( __x__ ) __attribute__((section (__x__)))
+
+#ifdef WIN32
+#define ALIGN(n)
+#else
+#define ALIGN(n) __attribute__((aligned(n)))
+#endif
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /*APP_COMMON_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/app_conf.h
new file mode 100644
index 000000000..f5f123646
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/app_conf.h
@@ -0,0 +1,636 @@
+/**
+ ******************************************************************************
+ * File Name : app_conf.h
+ * Description : Application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_CONF_H
+#define APP_CONF_H
+
+#include "hw.h"
+#include "hw_conf.h"
+#include "hw_if.h"
+
+/******************************************************************************
+ * Application Config
+ ******************************************************************************/
+
+/**< generic parameters ******************************************************/
+
+/**
+ * Define Tx Power
+ */
+#define CFG_TX_POWER (0x18) /**< 0dbm */
+
+/**
+ * Define Advertising parameters
+ */
+#define CFG_ADV_BD_ADDRESS (0x7257acd87a6c)
+#define CFG_FAST_CONN_ADV_INTERVAL_MIN (0x80) /**< 80ms */
+#define CFG_FAST_CONN_ADV_INTERVAL_MAX (0xa0) /**< 100ms */
+#define CFG_LP_CONN_ADV_INTERVAL_MIN (0x640) /**< 1s */
+#define CFG_LP_CONN_ADV_INTERVAL_MAX (0xfa0) /**< 2.5s */
+
+/**
+ * Define IO Authentication
+ */
+#define CFG_BONDING_MODE (1)
+#define CFG_FIXED_PIN (111111)
+#define CFG_USED_FIXED_PIN (0)
+#define CFG_ENCRYPTION_KEY_SIZE_MAX (16)
+#define CFG_ENCRYPTION_KEY_SIZE_MIN (8)
+
+/**
+ * Define IO capabilities
+ */
+#define CFG_IO_CAPABILITY_DISPLAY_ONLY (0x00)
+#define CFG_IO_CAPABILITY_DISPLAY_YES_NO (0x01)
+#define CFG_IO_CAPABILITY_KEYBOARD_ONLY (0x02)
+#define CFG_IO_CAPABILITY_NO_INPUT_NO_OUTPUT (0x03)
+#define CFG_IO_CAPABILITY_KEYBOARD_DISPLAY (0x04)
+
+#define CFG_IO_CAPABILITY CFG_IO_CAPABILITY_DISPLAY_YES_NO
+
+/**
+ * Define MITM modes
+ */
+#define CFG_MITM_PROTECTION_NOT_REQUIRED (0x00)
+#define CFG_MITM_PROTECTION_REQUIRED (0x01)
+
+#define CFG_MITM_PROTECTION CFG_MITM_PROTECTION_REQUIRED
+
+/**
+ * Define PHY
+ */
+#define ALL_PHYS_PREFERENCE 0x00
+#define RX_2M_PREFERRED 0x02
+#define TX_2M_PREFERRED 0x02
+#define TX_1M 0x01
+#define TX_2M 0x02
+#define RX_1M 0x01
+#define RX_2M 0x02
+
+/**
+* Identity root key used to derive LTK and CSRK
+*/
+#define CFG_BLE_IRK {0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0}
+
+/**
+* Encryption root key used to derive LTK and CSRK
+*/
+#define CFG_BLE_ERK {0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21,0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21}
+
+/* USER CODE BEGIN Generic_Parameters */
+/**
+ * SMPS supply
+ * SMPS not used when Set to 0
+ * SMPS used when Set to 1
+ */
+#define CFG_USE_SMPS 1
+/* USER CODE END Generic_Parameters */
+
+/**< specific parameters */
+/*****************************************************/
+/* APP MODES */
+typedef enum {
+ P2P_SERVER = 0,
+ P2P_CLIENT,
+ HEART_RATE,
+ NO_APP,
+} APP_Mode_t;
+
+/* DISCONNECTION STATUS */
+typedef enum {
+ FROM_REMOTE = 0,
+ TO_SWITCH_APP,
+ FROM_AT_CMD,
+} Disconnection_Status_t;
+
+/******************************************************************************
+ * P2P Server
+ ******************************************************************************/
+#define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI4_IRQHandler
+#define PUSH_BUTTON_SW2_EXTI_IRQHandler EXTI0_IRQHandler
+
+#define P2P_SERVER1 1 /*1 = Device is Peripherique*/
+#define P2P_SERVER2 0
+#define P2P_SERVER3 0
+#define P2P_SERVER4 0
+#define P2P_SERVER5 0
+#define P2P_SERVER6 0
+
+#define CFG_DEV_ID_AT_P2P_SERVER (0x83)
+#define CFG_DEV_ID_P2P_SERVER2 (0x84)
+#define CFG_DEV_ID_P2P_SERVER3 (0x87)
+#define CFG_DEV_ID_P2P_SERVER4 (0x88)
+#define CFG_DEV_ID_P2P_SERVER5 (0x89)
+#define CFG_DEV_ID_P2P_SERVER6 (0x8A)
+#define CFG_DEV_ID_P2P_ROUTER (0x85)
+
+#define RADIO_ACTIVITY_EVENT 1
+
+#define CONN_L(x) ((int)((x)/0.625f))
+#define CONN_P(x) ((int)((x)/1.25f))
+
+ /* L2CAP Connection Update request parameters used for test only with smart Phone */
+#define L2CAP_REQUEST_NEW_CONN_PARAM 1
+
+#define L2CAP_INTERVAL_MIN CONN_P(1000) /* 1s */
+#define L2CAP_INTERVAL_MAX CONN_P(1000) /* 1s */
+#define L2CAP_SLAVE_LATENCY 0x0000
+//#define L2CAP_TIMEOUT_MULTIPLIER 0x1F4
+#define L2CAP_TIMEOUT_MULTIPLIER 0x3E8
+
+/******************************************************************************
+ * P2P Client
+ ******************************************************************************/
+
+#define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI4_IRQHandler
+#define CFG_MAX_CONNECTION 1
+#define UUID_128BIT_FORMAT 1
+#define CFG_DEV_ID_AT_P2P_SERVER (0x83)
+#define CONN_L(x) ((int)((x)/0.625f))
+#define CONN_P(x) ((int)((x)/1.25f))
+#define SCAN_P (0x320)
+#define SCAN_L (0x320)
+#define CONN_P1 (CONN_P(50))
+#define CONN_P2 (CONN_P(100))
+#define SUPERV_TIMEOUT (0x1F4)
+#define CONN_L1 (CONN_L(10))
+#define CONN_L2 (CONN_L(10))
+
+/******************************************************************************
+ * SRAM1_BASE for Mode switching
+ ******************************************************************************/
+#define SRAM1_BASE_P2P_SERVER 0x575292
+#define SRAM1_BASE_P2P_CLIENT 0x105789
+#define SRAM1_BASE_HEART_RATE 0x784568
+
+/******************************************************************************
+ * Information Table
+ *
+ * Version
+ * [0:3] = Build - 0: Untracked - 15:Released - x: Tracked version
+ * [4:7] = branch - 0: Mass Market - x: ...
+ * [8:15] = Subversion
+ * [16:23] = Version minor
+ * [24:31] = Version major
+ *
+ ******************************************************************************/
+#define CFG_FW_MAJOR_VERSION (0)
+#define CFG_FW_MINOR_VERSION (0)
+#define CFG_FW_SUBVERSION (1)
+#define CFG_FW_BRANCH (0)
+#define CFG_FW_BUILD (0)
+
+/******************************************************************************
+ * BLE Stack
+ ******************************************************************************/
+/**
+ * Maximum number of simultaneous connections that the device will support.
+ * Valid values are from 1 to 8
+ */
+#define CFG_BLE_NUM_LINK 8
+
+/**
+ * Maximum number of Services that can be stored in the GATT database.
+ * Note that the GAP and GATT services are automatically added so this parameter should be 2 plus the number of user services
+ */
+#define CFG_BLE_NUM_GATT_SERVICES 8
+
+/**
+ * Maximum number of Attributes
+ * (i.e. the number of characteristic + the number of characteristic values + the number of descriptors, excluding the services)
+ * that can be stored in the GATT database.
+ * Note that certain characteristics and relative descriptors are added automatically during device initialization
+ * so this parameters should be 9 plus the number of user Attributes
+ */
+#define CFG_BLE_NUM_GATT_ATTRIBUTES 68
+
+/**
+ * Maximum supported ATT_MTU size
+ */
+#define CFG_BLE_MAX_ATT_MTU (156)
+
+/**
+ * Size of the storage area for Attribute values
+ * This value depends on the number of attributes used by application. In particular the sum of the following quantities (in octets) should be made for each attribute:
+ * - attribute value length
+ * - 5, if UUID is 16 bit; 19, if UUID is 128 bit
+ * - 2, if server configuration descriptor is used
+ * - 2*DTM_NUM_LINK, if client configuration descriptor is used
+ * - 2, if extended properties is used
+ * The total amount of memory needed is the sum of the above quantities for each attribute.
+ */
+#define CFG_BLE_ATT_VALUE_ARRAY_SIZE (1344)
+
+/**
+ * Prepare Write List size in terms of number of packet with ATT_MTU=23 bytes
+ */
+#define CFG_BLE_PREPARE_WRITE_LIST_SIZE ( 0x3A )
+
+/**
+ * Number of allocated memory blocks
+ */
+#define CFG_BLE_MBLOCK_COUNT ( 0x79 )
+
+/**
+ * Enable or disable the Extended Packet length feature. Valid values are 0 or 1.
+ */
+#define CFG_BLE_DATA_LENGTH_EXTENSION 1
+
+/**
+ * Sleep clock accuracy in Slave mode (ppm value)
+ */
+#define CFG_BLE_SLAVE_SCA 500
+
+/**
+ * Sleep clock accuracy in Master mode
+ * 0 : 251 ppm to 500 ppm
+ * 1 : 151 ppm to 250 ppm
+ * 2 : 101 ppm to 150 ppm
+ * 3 : 76 ppm to 100 ppm
+ * 4 : 51 ppm to 75 ppm
+ * 5 : 31 ppm to 50 ppm
+ * 6 : 21 ppm to 30 ppm
+ * 7 : 0 ppm to 20 ppm
+ */
+#define CFG_BLE_MASTER_SCA 0
+
+/**
+ * Source for the 32 kHz slow speed clock
+ * 1 : internal RO
+ * 0 : external crystal ( no calibration )
+ */
+#define CFG_BLE_LSE_SOURCE 0
+
+/**
+ * Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
+ */
+#define CFG_BLE_HSE_STARTUP_TIME 0x148
+
+/**
+ * Maximum duration of the connection event when the device is in Slave mode in units of 625/256 us (~2.44 us)
+ */
+#define CFG_BLE_MAX_CONN_EVENT_LENGTH ( 0xFFFFFFFF )
+
+/**
+ * Viterbi Mode
+ * 1 : enabled
+ * 0 : disabled
+ */
+#define CFG_BLE_VITERBI_MODE 1
+
+/**
+ * LL Only Mode
+ * 1 : LL Only
+ * 0 : LL + Host
+ */
+#define CFG_BLE_LL_ONLY 0
+/******************************************************************************
+ * Transport Layer
+ ******************************************************************************/
+/**
+ * Queue length of BLE Event
+ * This parameter defines the number of asynchronous events that can be stored in the HCI layer before
+ * being reported to the application. When a command is sent to the BLE core coprocessor, the HCI layer
+ * is waiting for the event with the Num_HCI_Command_Packets set to 1. The receive queue shall be large
+ * enough to store all asynchronous events received in between.
+ * When CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE is set to 27, this allow to store three 255 bytes long asynchronous events
+ * between the HCI command and its event.
+ * This parameter depends on the value given to CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE. When the queue size is to small,
+ * the system may hang if the queue is full with asynchronous events and the HCI layer is still waiting
+ * for a CC/CS event, In that case, the notification TL_BLE_HCI_ToNot() is called to indicate
+ * to the application a HCI command did not receive its command event within 30s (Default HCI Timeout).
+ */
+#define CFG_TLBLE_EVT_QUEUE_LENGTH 5
+/**
+ * This parameter should be set to fit most events received by the HCI layer. It defines the buffer size of each element
+ * allocated in the queue of received events and can be used to optimize the amount of RAM allocated by the Memory Manager.
+ * It should not exceed 255 which is the maximum HCI packet payload size (a greater value is a lost of memory as it will
+ * never be used)
+ * It shall be at least 4 to receive the command status event in one frame.
+ * The default value is set to 27 to allow receiving an event of MTU size in a single buffer. This value maybe reduced
+ * further depending on the application.
+ *
+ */
+#define CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE 255 /**< Set to 255 with the memory manager and the mailbox */
+
+#define TL_BLE_EVENT_FRAME_SIZE ( TL_EVT_HDR_SIZE + CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE )
+/******************************************************************************
+ * UART interfaces
+ ******************************************************************************/
+
+/**
+ * Select UART interfaces
+ */
+#define CFG_UART_GUI hw_uart1
+#define CFG_AT_UART hw_lpuart1//hw_uart1
+#define CFG_DEBUG_TRACE_UART //hw_uart1
+#define CFG_CONSOLE_MENU hw_lpuart1
+/******************************************************************************
+ * USB interface
+ ******************************************************************************/
+
+/**
+ * Enable/Disable USB interface
+ */
+#define CFG_USB_INTERFACE_ENABLE 0
+
+/******************************************************************************
+ * Low Power
+ ******************************************************************************/
+/**
+ * When set to 1, the low power mode is enable
+ * When set to 0, the device stays in RUN mode
+ */
+#define CFG_LPM_SUPPORTED 1
+
+/******************************************************************************
+ * Timer Server
+ ******************************************************************************/
+/**
+ * CFG_RTC_WUCKSEL_DIVIDER: This sets the RTCCLK divider to the wakeup timer.
+ * The higher is the value, the better is the power consumption and the accuracy of the timerserver
+ * The lower is the value, the finest is the granularity
+ *
+ * CFG_RTC_ASYNCH_PRESCALER: This sets the asynchronous prescaler of the RTC. It should as high as possible ( to ouput
+ * clock as low as possible) but the output clock should be equal or higher frequency compare to the clock feeding
+ * the wakeup timer. A lower clock speed would impact the accuracy of the timer server.
+ *
+ * CFG_RTC_SYNCH_PRESCALER: This sets the synchronous prescaler of the RTC.
+ * When the 1Hz calendar clock is required, it shall be sets according to other settings
+ * When the 1Hz calendar clock is not needed, CFG_RTC_SYNCH_PRESCALER should be set to 0x7FFF (MAX VALUE)
+ *
+ * CFG_RTCCLK_DIVIDER_CONF:
+ * Shall be set to either 0,2,4,8,16
+ * When set to either 2,4,8,16, the 1Hhz calendar is supported
+ * When set to 0, the user sets its own configuration
+ *
+ * The following settings are computed with LSI as input to the RTC
+ */
+#define CFG_RTCCLK_DIVIDER_CONF 0
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 0)
+/**
+ * Custom configuration
+ * It does not support 1Hz calendar
+ * It divides the RTC CLK by 16
+ */
+#define CFG_RTCCLK_DIV (16)
+#define CFG_RTC_WUCKSEL_DIVIDER (0)
+#define CFG_RTC_ASYNCH_PRESCALER (CFG_RTCCLK_DIV - 1)
+#define CFG_RTC_SYNCH_PRESCALER (0x7FFF)
+
+#else
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 2)
+/**
+ * It divides the RTC CLK by 2
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (3)
+#endif
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 4)
+/**
+ * It divides the RTC CLK by 4
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (2)
+#endif
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 8)
+/**
+ * It divides the RTC CLK by 8
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (1)
+#endif
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 16)
+/**
+ * It divides the RTC CLK by 16
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (0)
+#endif
+
+#define CFG_RTCCLK_DIV CFG_RTCCLK_DIVIDER_CONF
+#define CFG_RTC_ASYNCH_PRESCALER (CFG_RTCCLK_DIV - 1)
+#define CFG_RTC_SYNCH_PRESCALER (DIVR( LSE_VALUE, (CFG_RTC_ASYNCH_PRESCALER+1) ) - 1 )
+
+#endif
+
+/** tick timer value in us */
+#define CFG_TS_TICK_VAL DIVR( (CFG_RTCCLK_DIV * 1000000), LSE_VALUE )
+
+typedef enum
+{
+ CFG_TIM_PROC_ID_ISR,
+} CFG_TimProcID_t;
+
+/******************************************************************************
+ * Debug
+ ******************************************************************************/
+/**
+ * When set, this resets some hw resources to set the device in the same state than the power up
+ * The FW resets only register that may prevent the FW to run properly
+ *
+ * This shall be set to 0 in a final product
+ *
+ */
+#define CFG_HW_RESET_BY_FW 1
+
+/**
+ * keep debugger enabled while in any low power mode when set to 1
+ * should be set to 0 in production
+ */
+#define CFG_DEBUGGER_SUPPORTED 1
+
+/**
+ * When set to 1, the traces are enabled in the BLE services
+ */
+#define CFG_DEBUG_BLE_TRACE 0
+
+/**
+ * Enable or Disable traces in application
+ */
+#define CFG_DEBUG_APP_TRACE 0
+
+#if (CFG_DEBUG_APP_TRACE != 0)
+#define APP_DBG_MSG PRINT_MESG_DBG
+#else
+#define APP_DBG_MSG PRINT_NO_MESG
+#endif
+
+#if ( (CFG_DEBUG_BLE_TRACE != 0) || (CFG_DEBUG_APP_TRACE != 0) )
+#define CFG_DEBUG_TRACE 1
+#endif
+
+#if (CFG_DEBUG_TRACE != 0)
+#undef CFG_LPM_SUPPORTED
+#undef CFG_DEBUGGER_SUPPORTED
+#define CFG_LPM_SUPPORTED 0
+#define CFG_DEBUGGER_SUPPORTED 1
+#endif
+
+/**
+ * When CFG_DEBUG_TRACE_FULL is set to 1, the trace are output with the API name, the file name and the line number
+ * When CFG_DEBUG_TRACE_LIGHT is set to 1, only the debug message is output
+ *
+ * When both are set to 0, no trace are output
+ * When both are set to 1, CFG_DEBUG_TRACE_FULL is selected
+ */
+#define CFG_DEBUG_TRACE_LIGHT 1
+#define CFG_DEBUG_TRACE_FULL 0
+
+#if (( CFG_DEBUG_TRACE != 0 ) && ( CFG_DEBUG_TRACE_LIGHT == 0 ) && (CFG_DEBUG_TRACE_FULL == 0))
+#undef CFG_DEBUG_TRACE_FULL
+#undef CFG_DEBUG_TRACE_LIGHT
+#define CFG_DEBUG_TRACE_FULL 0
+#define CFG_DEBUG_TRACE_LIGHT 1
+#endif
+
+#if ( CFG_DEBUG_TRACE == 0 )
+#undef CFG_DEBUG_TRACE_FULL
+#undef CFG_DEBUG_TRACE_LIGHT
+#define CFG_DEBUG_TRACE_FULL 0
+#define CFG_DEBUG_TRACE_LIGHT 0
+#endif
+
+/**
+ * When not set, the traces is looping on sending the trace over UART
+ */
+#define DBG_TRACE_USE_CIRCULAR_QUEUE 1
+
+/**
+ * max buffer Size to queue data traces and max data trace allowed.
+ * Only Used if DBG_TRACE_USE_CIRCULAR_QUEUE is defined
+ */
+#define DBG_TRACE_MSG_QUEUE_SIZE 4096
+#define MAX_DBG_TRACE_MSG_SIZE 1024
+
+/* USER CODE BEGIN Defines */
+#define CFG_LED_SUPPORTED 1
+#define CFG_BUTTON_SUPPORTED 1
+
+#define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI4_IRQHandler
+#define PUSH_BUTTON_SW2_EXTI_IRQHandler EXTI0_IRQHandler
+#define PUSH_BUTTON_SW3_EXTI_IRQHandler EXTI1_IRQHandler
+/* USER CODE END Defines */
+
+/******************************************************************************
+ * Scheduler
+ ******************************************************************************/
+
+/**
+ * These are the lists of task id registered to the scheduler
+ * Each task id shall be in the range [0:31]
+ * This mechanism allows to implement a generic code in the API TL_BLE_HCI_StatusNot() to comply with
+ * the requirement that a HCI/ACI command shall never be sent if there is already one pending
+ */
+
+/**< Add in that list all tasks that may send a ACI/HCI command */
+typedef enum
+{
+ /* Heart Rate */
+ CFG_TASK_ADV_UPDATE_ID,
+ CFG_TASK_MEAS_REQ_ID,
+ /* P2P Server */
+ CFG_TASK_ADV_CANCEL_ID,
+ CFG_TASK_ADV_REQ_ID,
+ CFG_TASK_SW1_BUTTON_PUSHED_ID, //used by P2P Client as well
+ CFG_TASK_HCI_ASYNCH_EVT_ID,
+ /* P2P Client */
+ CFG_TASK_START_SCAN_ID,
+ CFG_TASK_CONN_DEV_1_ID,
+ CFG_TASK_SEARCH_SERVICE_ID,
+ /* Transparent Mode */
+ CFG_TASK_BLE_HCI_CMD_ID,
+ CFG_TASK_SYS_HCI_CMD_ID,
+ CFG_TASK_HCI_ACL_DATA_ID,
+ CFG_TASK_SYS_LOCAL_CMD_ID,
+ CFG_TASK_TX_TO_HOST_ID,
+/* USER CODE BEGIN CFG_Task_Id_With_HCI_Cmd_t */
+ CFG_TASK_AT_CMD_ANALYSING_ID,
+ CFG_TASK_CONN_UPDATE_ID,
+ CFG_TASK_SV_GAP_DISCON_ID,
+ CFG_TASK_CL_GAP_DISCON_ID,
+ CFG_TASK_CL_L2CAP_CONN_UPDATE_RESP_ID,
+ CFG_TASK_HR_GAP_DISCON_ID,
+ CFG_TASK_SEND_DATA_TO_SERVER_ID,
+ CFG_TASK_CONFIRM_PAIRING_ID,
+ CFG_TASK_REQUEST_PAIRING_ID,
+ CFG_TASK_NOTIFY_ID,
+/* USER CODE END CFG_Task_Id_With_HCI_Cmd_t */
+ CFG_LAST_TASK_ID_WITH_HCICMD, /**< Shall be LAST in the list */
+} CFG_Task_Id_With_HCI_Cmd_t;
+
+/**< Add in that list all tasks that never send a ACI/HCI command */
+typedef enum
+{
+ CFG_FIRST_TASK_ID_WITH_NO_HCICMD = CFG_LAST_TASK_ID_WITH_HCICMD - 1, /**< Shall be FIRST in the list */
+ CFG_TASK_SYSTEM_HCI_ASYNCH_EVT_ID,
+/* USER CODE BEGIN CFG_Task_Id_With_NO_HCI_Cmd_t */
+
+/* USER CODE END CFG_Task_Id_With_NO_HCI_Cmd_t */
+ CFG_LAST_TASK_ID_WITHO_NO_HCICMD /**< Shall be LAST in the list */
+} CFG_Task_Id_With_NO_HCI_Cmd_t;
+#define CFG_TASK_NBR CFG_LAST_TASK_ID_WITHO_NO_HCICMD
+
+/**
+ * This is the list of priority required by the application
+ * Each Id shall be in the range 0..31
+ */
+typedef enum
+{
+ CFG_SCH_PRIO_0,
+ CFG_PRIO_NBR,
+} CFG_SCH_Prio_Id_t;
+
+/**
+ * This is a bit mapping over 32bits listing all events id supported in the application
+ */
+typedef enum
+{
+ CFG_IDLEEVT_HCI_CMD_EVT_RSP_ID,
+ CFG_IDLEEVT_SYSTEM_HCI_CMD_EVT_RSP_ID,
+} CFG_IdleEvt_Id_t;
+
+/******************************************************************************
+ * LOW POWER
+ ******************************************************************************/
+/**
+ * Supported requester to the MCU Low Power Manager - can be increased up to 32
+ * It lits a bit mapping of all user of the Low Power Manager
+ */
+typedef enum
+{
+ CFG_LPM_APP,
+ CFG_LPM_APP_BLE,
+ /* USER CODE BEGIN CFG_LPM_Id_t */
+
+ /* USER CODE END CFG_LPM_Id_t */
+} CFG_LPM_Id_t;
+
+/******************************************************************************
+ * OTP manager
+ ******************************************************************************/
+#define CFG_OTP_BASE_ADDRESS OTP_AREA_BASE
+
+#define CFG_OTP_END_ADRESS OTP_AREA_END_ADDR
+
+#endif /*APP_CONF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/app_entry.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/app_entry.h
new file mode 100644
index 000000000..77ead2384
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/app_entry.h
@@ -0,0 +1,69 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file app_entry.h
+ * @author MCD Application Team
+ * @brief Interface to the application
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_ENTRY_H
+#define APP_ENTRY_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /* Exported types ------------------------------------------------------------*/
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* Exported variables --------------------------------------------------------*/
+/* USER CODE BEGIN EV */
+
+/* USER CODE END EV */
+
+/* Exported macros ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions ---------------------------------------------*/
+ void APPE_Init( void );
+/* USER CODE BEGIN EF */
+
+/* USER CODE END EF */
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /*APP_ENTRY_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/hw_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/hw_conf.h
new file mode 100644
index 000000000..cce3af451
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/hw_conf.h
@@ -0,0 +1,220 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : hw_conf.h
+ * Description : Hardware configuration file for BLE
+ * middleWare.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_CONF_H
+#define HW_CONF_H
+
+/******************************************************************************
+ * Semaphores
+ * THIS SHALL NO BE CHANGED AS THESE SEMAPHORES ARE USED AS WELL ON THE CM0+
+ *****************************************************************************/
+/* Index of the semaphore used to manage the entry Stop Mode procedure */
+#define CFG_HW_ENTRY_STOP_MODE_SEMID 4
+
+/* Index of the semaphore used to access the RCC */
+#define CFG_HW_RCC_SEMID 3
+
+/* Index of the semaphore used to access the FLASH */
+#define CFG_HW_FLASH_SEMID 2
+
+/* Index of the semaphore used to access the PKA */
+#define CFG_HW_PKA_SEMID 1
+
+/* Index of the semaphore used to access the RNG */
+#define CFG_HW_RNG_SEMID 0
+
+/******************************************************************************
+ * HW TIMER SERVER
+ *****************************************************************************/
+/**
+ * The user may define the maximum number of virtual timers supported.
+ * It shall not exceed 255
+ */
+#define CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER 6
+
+/**
+ * The user may define the priority in the NVIC of the RTC_WKUP interrupt handler that is used to manage the
+ * wakeup timer.
+ * This setting is the preemptpriority part of the NVIC.
+ */
+#define CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO 3
+
+/**
+ * The user may define the priority in the NVIC of the RTC_WKUP interrupt handler that is used to manage the
+ * wakeup timer.
+ * This setting is the subpriority part of the NVIC. It does not exist on all processors. When it is not supported
+ * on the CPU, the setting is ignored
+ */
+#define CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO 0
+
+/**
+ * Define a critical section in the Timer server
+ * The Timer server does not support the API to be nested
+ * The Application shall either:
+ * a) Ensure this will never happen
+ * b) Define the critical section
+ * The default implementations is masking all interrupts using the PRIMASK bit
+ * The TimerServer driver uses critical sections to avoid context corruption. This is achieved with the macro
+ * TIMER_ENTER_CRITICAL_SECTION and TIMER_EXIT_CRITICAL_SECTION. When CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION is set
+ * to 1, all STM32 interrupts are masked with the PRIMASK bit of the CortexM CPU. It is possible to use the BASEPRI
+ * register of the CortexM CPU to keep allowed some interrupts with high priority. In that case, the user shall
+ * re-implement TIMER_ENTER_CRITICAL_SECTION and TIMER_EXIT_CRITICAL_SECTION and shall make sure that no TimerServer
+ * API are called when the TIMER critical section is entered
+ */
+#define CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION 1
+
+/**
+ * This value shall reflect the maximum delay there could be in the application between the time the RTC interrupt
+ * is generated by the Hardware and the time when the RTC interrupt handler is called. This time is measured in
+ * number of RTCCLK ticks.
+ * A relaxed timing would be 10ms
+ * When the value is too short, the timerserver will not be able to count properly and all timeout may be random.
+ * When the value is too long, the device may wake up more often than the most optimal configuration. However, the
+ * impact on power consumption would be marginal (unless the value selected is extremely too long). It is strongly
+ * recommended to select a value large enough to make sure it is not too short to ensure reliability of the system
+ * as this will have marginal impact on low power mode
+ */
+#define CFG_HW_TS_RTC_HANDLER_MAX_DELAY ( 10 * (LSI_VALUE/1000) )
+
+ /**
+ * Interrupt ID in the NVIC of the RTC Wakeup interrupt handler
+ * It shall be type of IRQn_Type
+ */
+#define CFG_HW_TS_RTC_WAKEUP_HANDLER_ID RTC_WKUP_IRQn
+
+/******************************************************************************
+ * HW UART
+ *****************************************************************************/
+
+#define CFG_HW_LPUART1_ENABLED 1
+#define CFG_HW_LPUART1_DMA_TX_SUPPORTED 0
+
+#define CFG_HW_USART1_ENABLED 0
+#define CFG_HW_USART1_DMA_TX_SUPPORTED 0
+
+/**
+ * LPUART1
+ */
+#define CFG_HW_LPUART1_PREEMPTPRIORITY 0x0F
+#define CFG_HW_LPUART1_SUBPRIORITY 0
+
+/** < The application shall check the selected source clock is enable */
+#define CFG_HW_LPUART1_SOURCE_CLOCK RCC_LPUART1CLKSOURCE_SYSCLK
+
+#define CFG_HW_LPUART1_BAUDRATE 9600
+#define CFG_HW_LPUART1_WORDLENGTH UART_WORDLENGTH_8B
+#define CFG_HW_LPUART1_STOPBITS UART_STOPBITS_1
+#define CFG_HW_LPUART1_PARITY UART_PARITY_NONE
+#define CFG_HW_LPUART1_HWFLOWCTL UART_HWCONTROL_NONE
+#define CFG_HW_LPUART1_MODE UART_MODE_TX_RX
+#define CFG_HW_LPUART1_ADVFEATUREINIT UART_ADVFEATURE_NO_INIT
+#define CFG_HW_LPUART1_OVERSAMPLING UART_OVERSAMPLING_8
+
+#define CFG_HW_LPUART1_TX_PORT_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE
+#define CFG_HW_LPUART1_TX_PORT GPIOA
+#define CFG_HW_LPUART1_TX_PIN GPIO_PIN_2
+#define CFG_HW_LPUART1_TX_MODE GPIO_MODE_AF_PP
+#define CFG_HW_LPUART1_TX_PULL GPIO_NOPULL
+#define CFG_HW_LPUART1_TX_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_LPUART1_TX_ALTERNATE GPIO_AF8_LPUART1
+
+#define CFG_HW_LPUART1_RX_PORT_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE
+#define CFG_HW_LPUART1_RX_PORT GPIOA
+#define CFG_HW_LPUART1_RX_PIN GPIO_PIN_3
+#define CFG_HW_LPUART1_RX_MODE GPIO_MODE_AF_PP
+#define CFG_HW_LPUART1_RX_PULL GPIO_NOPULL
+#define CFG_HW_LPUART1_RX_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_LPUART1_RX_ALTERNATE GPIO_AF8_LPUART1
+
+#define CFG_HW_LPUART1_CTS_PORT_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE
+#define CFG_HW_LPUART1_CTS_PORT GPIOA
+#define CFG_HW_LPUART1_CTS_PIN GPIO_PIN_6
+#define CFG_HW_LPUART1_CTS_MODE GPIO_MODE_AF_PP
+#define CFG_HW_LPUART1_CTS_PULL GPIO_PULLDOWN
+#define CFG_HW_LPUART1_CTS_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_LPUART1_CTS_ALTERNATE GPIO_AF8_LPUART1
+
+#define CFG_HW_LPUART1_DMA_TX_PREEMPTPRIORITY 0x0F
+#define CFG_HW_LPUART1_DMA_TX_SUBPRIORITY 0
+
+#define CFG_HW_LPUART1_DMAMUX_CLK_ENABLE __HAL_RCC_DMAMUX1_CLK_ENABLE
+#define CFG_HW_LPUART1_DMA_CLK_ENABLE __HAL_RCC_DMA1_CLK_ENABLE
+#define CFG_HW_LPUART1_TX_DMA_REQ DMA_REQUEST_LPUART1_TX
+#define CFG_HW_LPUART1_TX_DMA_CHANNEL DMA1_CHANNEL_4
+#define CFG_HW_LPUART1_TX_DMA_IRQn DMA1_CHANNEL_4_IRQn
+#define CFG_HW_LPUART1_DMA_TX_IRQHandler DMA1_CHANNEL_4_IRQHandler
+
+/**
+ * UART1
+ */
+#define CFG_HW_USART1_PREEMPTPRIORITY 0x0F
+#define CFG_HW_USART1_SUBPRIORITY 0
+
+/** < The application shall check the selected source clock is enable */
+#define CFG_HW_USART1_SOURCE_CLOCK RCC_USART1CLKSOURCE_SYSCLK
+
+#define CFG_HW_USART1_BAUDRATE 115200
+#define CFG_HW_USART1_WORDLENGTH UART_WORDLENGTH_8B
+#define CFG_HW_USART1_STOPBITS UART_STOPBITS_1
+#define CFG_HW_USART1_PARITY UART_PARITY_NONE
+#define CFG_HW_USART1_HWFLOWCTL UART_HWCONTROL_NONE
+#define CFG_HW_USART1_MODE UART_MODE_TX_RX
+#define CFG_HW_USART1_ADVFEATUREINIT UART_ADVFEATURE_NO_INIT
+#define CFG_HW_USART1_OVERSAMPLING UART_OVERSAMPLING_8
+
+#define CFG_HW_USART1_TX_PORT_CLK_ENABLE __HAL_RCC_GPIOB_CLK_ENABLE
+#define CFG_HW_USART1_TX_PORT GPIOB
+#define CFG_HW_USART1_TX_PIN GPIO_PIN_6
+#define CFG_HW_USART1_TX_MODE GPIO_MODE_AF_PP
+#define CFG_HW_USART1_TX_PULL GPIO_NOPULL
+#define CFG_HW_USART1_TX_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_USART1_TX_ALTERNATE GPIO_AF7_USART1
+
+#define CFG_HW_USART1_RX_PORT_CLK_ENABLE __HAL_RCC_GPIOB_CLK_ENABLE
+#define CFG_HW_USART1_RX_PORT GPIOB
+#define CFG_HW_USART1_RX_PIN GPIO_PIN_7
+#define CFG_HW_USART1_RX_MODE GPIO_MODE_AF_PP
+#define CFG_HW_USART1_RX_PULL GPIO_NOPULL
+#define CFG_HW_USART1_RX_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_USART1_RX_ALTERNATE GPIO_AF7_USART1
+
+#define CFG_HW_USART1_CTS_PORT_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE
+#define CFG_HW_USART1_CTS_PORT GPIOA
+#define CFG_HW_USART1_CTS_PIN GPIO_PIN_11
+#define CFG_HW_USART1_CTS_MODE GPIO_MODE_AF_PP
+#define CFG_HW_USART1_CTS_PULL GPIO_PULLDOWN
+#define CFG_HW_USART1_CTS_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_USART1_CTS_ALTERNATE GPIO_AF7_USART1
+
+#define CFG_HW_USART1_DMA_TX_PREEMPTPRIORITY 0x0F
+#define CFG_HW_USART1_DMA_TX_SUBPRIORITY 0
+
+#define CFG_HW_USART1_DMAMUX_CLK_ENABLE __HAL_RCC_DMAMUX1_CLK_ENABLE
+#define CFG_HW_USART1_DMA_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE
+#define CFG_HW_USART1_TX_DMA_REQ DMA_REQUEST_USART1_TX
+#define CFG_HW_USART1_TX_DMA_CHANNEL DMA2_CHANNEL_4
+#define CFG_HW_USART1_TX_DMA_IRQn DMA2_CHANNEL_4_IRQn
+#define CFG_HW_USART1_DMA_TX_IRQHandler DMA2_CHANNEL_4_IRQHandler
+
+#endif /*HW_CONF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/main.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/main.h
new file mode 100644
index 000000000..55097bac8
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/main.h
@@ -0,0 +1,71 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file main.h
+ * @author MCD Application Team
+ * @brief Header for main.c module
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __MAIN_H
+#define __MAIN_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx_hal.h"
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+#include "stm32wbxx_nucleo.h"
+/* USER CODE END Includes */
+
+/* Exported types ------------------------------------------------------------*/
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* Exported macro ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions prototypes ---------------------------------------------*/
+void Error_Handler(void);
+
+/* USER CODE BEGIN EFP */
+
+/* USER CODE END EFP */
+
+/* Private defines -----------------------------------------------------------*/
+/* USER CODE BEGIN Private defines */
+
+/* USER CODE END Private defines */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MAIN_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/stm32_lpm_if.h
new file mode 100644
index 000000000..d8e67947f
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/stm32_lpm_if.h
@@ -0,0 +1,81 @@
+/* USER CODE BEGIN Header */
+/**
+******************************************************************************
+* @file stm32_lpm_if.h
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
+******************************************************************************
+* @attention
+*
+* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+* All rights reserved.</center></h2>
+*
+* This software component is licensed by ST under BSD 3-Clause license,
+* the "License"; You may not use this file except in compliance with the
+* License. You may obtain a copy of the License at:
+* opensource.org/licenses/BSD-3-Clause
+*
+******************************************************************************
+*/
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32_LPM_IF_H
+#define __STM32_LPM_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+
+/**
+ * @brief Enters Low Power Off Mode
+ * @param none
+ * @retval none
+ */
+void PWR_EnterOffMode( void );
+/**
+ * @brief Exits Low Power Off Mode
+ * @param none
+ * @retval none
+ */
+void PWR_ExitOffMode( void );
+
+/**
+ * @brief Enters Low Power Stop Mode
+ * @note ARM exists the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_EnterStopMode( void );
+/**
+ * @brief Exits Low Power Stop Mode
+ * @note Enable the pll at 32MHz
+ * @param none
+ * @retval none
+ */
+void PWR_ExitStopMode( void );
+
+/**
+ * @brief Enters Low Power Sleep Mode
+ * @note ARM exits the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_EnterSleepMode( void );
+
+/**
+ * @brief Exits Low Power Sleep Mode
+ * @note ARM exits the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_ExitSleepMode( void );
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*__STM32_LPM_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/stm32wbxx_hal_conf.h
new file mode 100644
index 000000000..a1c252133
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/stm32wbxx_hal_conf.h
@@ -0,0 +1,354 @@
+/**
+ ******************************************************************************
+ * @file stm32wbxx_hal_conf.h
+ * @author MCD Application Team
+ * @brief HAL configuration file.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32WBxx_HAL_CONF_H
+#define __STM32WBxx_HAL_CONF_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/* Exported types ------------------------------------------------------------*/
+/* Exported constants --------------------------------------------------------*/
+
+/* ########################## Module Selection ############################## */
+/**
+ * @brief This is the list of modules to be used in the HAL driver
+ */
+#define HAL_MODULE_ENABLED
+/*#define HAL_ADC_MODULE_ENABLED */
+/*#define HAL_CRYP_MODULE_ENABLED */
+/*#define HAL_COMP_MODULE_ENABLED */
+/*#define HAL_CRC_MODULE_ENABLED */
+#define HAL_HSEM_MODULE_ENABLED
+/*#define HAL_I2C_MODULE_ENABLED */
+#define HAL_IPCC_MODULE_ENABLED
+/*#define HAL_IRDA_MODULE_ENABLED */
+/*#define HAL_IWDG_MODULE_ENABLED */
+/*#define HAL_LCD_MODULE_ENABLED */
+/*#define HAL_LPTIM_MODULE_ENABLED */
+/*#define HAL_PCD_MODULE_ENABLED */
+/*#define HAL_PKA_MODULE_ENABLED */
+/*#define HAL_QSPI_MODULE_ENABLED */
+/*#define HAL_RNG_MODULE_ENABLED */
+#define HAL_RTC_MODULE_ENABLED
+/*#define HAL_SAI_MODULE_ENABLED */
+/*#define HAL_SMBUS_MODULE_ENABLED */
+/*#define HAL_SMARTCARD_MODULE_ENABLED */
+/*#define HAL_SPI_MODULE_ENABLED */
+/*#define HAL_TIM_MODULE_ENABLED */
+/*#define HAL_TSC_MODULE_ENABLED */
+#define HAL_UART_MODULE_ENABLED
+/*#define HAL_USART_MODULE_ENABLED */
+/*#define HAL_WWDG_MODULE_ENABLED */
+/* #define HAL_EXTI_MODULE_ENABLED */
+#define HAL_CORTEX_MODULE_ENABLED
+#define HAL_DMA_MODULE_ENABLED
+#define HAL_FLASH_MODULE_ENABLED
+#define HAL_GPIO_MODULE_ENABLED
+#define HAL_PWR_MODULE_ENABLED
+#define HAL_RCC_MODULE_ENABLED
+
+#define USE_HAL_ADC_REGISTER_CALLBACKS 0u
+#define USE_HAL_COMP_REGISTER_CALLBACKS 0u
+#define USE_HAL_CRYP_REGISTER_CALLBACKS 0u
+#define USE_HAL_I2C_REGISTER_CALLBACKS 0u
+#define USE_HAL_IRDA_REGISTER_CALLBACKS 0u
+#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0u
+#define USE_HAL_PCD_REGISTER_CALLBACKS 0u
+#define USE_HAL_PKA_REGISTER_CALLBACKS 0u
+#define USE_HAL_QSPI_REGISTER_CALLBACKS 0u
+#define USE_HAL_RNG_REGISTER_CALLBACKS 0u
+#define USE_HAL_RTC_REGISTER_CALLBACKS 0u
+#define USE_HAL_SAI_REGISTER_CALLBACKS 0u
+#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0u
+#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0u
+#define USE_HAL_SPI_REGISTER_CALLBACKS 0u
+#define USE_HAL_TIM_REGISTER_CALLBACKS 0u
+#define USE_HAL_TSC_REGISTER_CALLBACKS 0u
+#define USE_HAL_UART_REGISTER_CALLBACKS 0u
+#define USE_HAL_USART_REGISTER_CALLBACKS 0u
+#define USE_HAL_WWDG_REGISTER_CALLBACKS 0u
+
+/* ########################## Oscillator Values adaptation ####################*/
+/**
+ * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
+ * This value is used by the RCC HAL module to compute the system frequency
+ * (when HSE is used as system clock source, directly or through the PLL).
+ */
+#if !defined (HSE_VALUE)
+#define HSE_VALUE 32000000U /*!< Value of the External oscillator in Hz */
+#endif /* HSE_VALUE */
+
+#if !defined (HSE_STARTUP_TIMEOUT)
+ #define HSE_STARTUP_TIMEOUT ((uint32_t)100) /*!< Time out for HSE start up, in ms */
+#endif /* HSE_STARTUP_TIMEOUT */
+
+/**
+ * @brief Internal Multiple Speed oscillator (MSI) default value.
+ * This value is the default MSI range value after Reset.
+ */
+#if !defined (MSI_VALUE)
+ #define MSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/
+#endif /* MSI_VALUE */
+
+/**
+ * @brief Internal High Speed oscillator (HSI) value.
+ * This value is used by the RCC HAL module to compute the system frequency
+ * (when HSI is used as system clock source, directly or through the PLL).
+ */
+#if !defined (HSI_VALUE)
+#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/
+#endif /* HSI_VALUE */
+
+/**
+ * @brief Internal Low Speed oscillator (LSI1) value.
+ */
+#if !defined (LSI1_VALUE)
+ #define LSI1_VALUE ((uint32_t)32000) /*!< LSI1 Typical Value in Hz*/
+#endif /* LSI1_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
+ The real value may vary depending on the variations
+ in voltage and temperature.*/
+/**
+ * @brief Internal Low Speed oscillator (LSI2) value.
+ */
+#if !defined (LSI2_VALUE)
+ #define LSI2_VALUE ((uint32_t)32000) /*!< LSI2 Typical Value in Hz*/
+#endif /* LSI2_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
+ The real value may vary depending on the variations
+ in voltage and temperature.*/
+
+/**
+ * @brief External Low Speed oscillator (LSE) value.
+ * This value is used by the UART, RTC HAL module to compute the system frequency
+ */
+#if !defined (LSE_VALUE)
+#define LSE_VALUE 32768U /*!< Value of the External oscillator in Hz*/
+#endif /* LSE_VALUE */
+
+/**
+ * @brief Internal Multiple Speed oscillator (HSI48) default value.
+ * This value is the default HSI48 range value after Reset.
+ */
+#if !defined (HSI48_VALUE)
+ #define HSI48_VALUE ((uint32_t)48000000) /*!< Value of the Internal oscillator in Hz*/
+#endif /* HSI48_VALUE */
+
+#if !defined (LSE_STARTUP_TIMEOUT)
+#define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */
+#endif /* HSE_STARTUP_TIMEOUT */
+
+/**
+ * @brief External clock source for SAI1 peripheral
+ * This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source
+ * frequency.
+ */
+#if !defined (EXTERNAL_SAI1_CLOCK_VALUE)
+ #define EXTERNAL_SAI1_CLOCK_VALUE ((uint32_t)2097000) /*!< Value of the SAI1 External clock source in Hz*/
+#endif /* EXTERNAL_SAI1_CLOCK_VALUE */
+
+/* Tip: To avoid modifying this file each time you need to use different HSE,
+ === you can define the HSE value in your toolchain compiler preprocessor. */
+
+/* ########################### System Configuration ######################### */
+/**
+ * @brief This is the HAL system configuration section
+ */
+
+#define VDD_VALUE 3300U /*!< Value of VDD in mv */
+#define TICK_INT_PRIORITY 0U /*!< tick interrupt priority */
+#define USE_RTOS 0U
+#define PREFETCH_ENABLE 1U
+#define INSTRUCTION_CACHE_ENABLE 1U
+#define DATA_CACHE_ENABLE 1U
+
+/* ########################## Assert Selection ############################## */
+/**
+ * @brief Uncomment the line below to expanse the "assert_param" macro in the
+ * HAL drivers code
+ */
+/* #define USE_FULL_ASSERT 1U */
+
+/* ################## SPI peripheral configuration ########################## */
+
+/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
+ * Activated: CRC code is present inside driver
+ * Deactivated: CRC code cleaned from driver
+ */
+
+#define USE_SPI_CRC 0U
+
+/* Includes ------------------------------------------------------------------*/
+/**
+ * @brief Include module's header file
+ */
+#ifdef HAL_DMA_MODULE_ENABLED
+ #include "stm32wbxx_hal_dma.h"
+#endif /* HAL_DMA_MODULE_ENABLED */
+
+#ifdef HAL_ADC_MODULE_ENABLED
+ #include "stm32wbxx_hal_adc.h"
+#endif /* HAL_ADC_MODULE_ENABLED */
+
+#ifdef HAL_COMP_MODULE_ENABLED
+ #include "stm32wbxx_hal_comp.h"
+#endif /* HAL_COMP_MODULE_ENABLED */
+
+#ifdef HAL_CORTEX_MODULE_ENABLED
+ #include "stm32wbxx_hal_cortex.h"
+#endif /* HAL_CORTEX_MODULE_ENABLED */
+
+#ifdef HAL_CRC_MODULE_ENABLED
+ #include "stm32wbxx_hal_crc.h"
+#endif /* HAL_CRC_MODULE_ENABLED */
+
+#ifdef HAL_CRYP_MODULE_ENABLED
+ #include "stm32wbxx_hal_cryp.h"
+#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
+
+#ifdef HAL_FLASH_MODULE_ENABLED
+ #include "stm32wbxx_hal_flash.h"
+#endif /* HAL_FLASH_MODULE_ENABLED */
+
+#ifdef HAL_GPIO_MODULE_ENABLED
+ #include "stm32wbxx_hal_gpio.h"
+#endif /* HAL_GPIO_MODULE_ENABLED */
+
+#ifdef HAL_HSEM_MODULE_ENABLED
+ #include "stm32wbxx_hal_hsem.h"
+#endif /* HAL_HSEM_MODULE_ENABLED */
+
+#ifdef HAL_I2C_MODULE_ENABLED
+ #include "stm32wbxx_hal_i2c.h"
+#endif /* HAL_I2C_MODULE_ENABLED */
+
+#ifdef HAL_IPCC_MODULE_ENABLED
+ #include "stm32wbxx_hal_ipcc.h"
+#endif /* HAL_IPCC_MODULE_ENABLED */
+
+#ifdef HAL_IRDA_MODULE_ENABLED
+ #include "stm32wbxx_hal_irda.h"
+#endif /* HAL_IRDA_MODULE_ENABLED */
+
+#ifdef HAL_IWDG_MODULE_ENABLED
+ #include "stm32wbxx_hal_iwdg.h"
+#endif /* HAL_IWDG_MODULE_ENABLED */
+
+#ifdef HAL_LCD_MODULE_ENABLED
+ #include "stm32wbxx_hal_lcd.h"
+#endif /* HAL_LCD_MODULE_ENABLED */
+
+#ifdef HAL_LPTIM_MODULE_ENABLED
+ #include "stm32wbxx_hal_lptim.h"
+#endif /* HAL_LPTIM_MODULE_ENABLED */
+
+#ifdef HAL_PCD_MODULE_ENABLED
+ #include "stm32wbxx_hal_pcd.h"
+#endif /* HAL_PCD_MODULE_ENABLED */
+
+#ifdef HAL_PKA_MODULE_ENABLED
+ #include "stm32wbxx_hal_pka.h"
+#endif /* HAL_PKA_MODULE_ENABLED */
+
+#ifdef HAL_PWR_MODULE_ENABLED
+ #include "stm32wbxx_hal_pwr.h"
+#endif /* HAL_PWR_MODULE_ENABLED */
+
+#ifdef HAL_QSPI_MODULE_ENABLED
+ #define USE_HAL_QSPI_REGISTER_CALLBACKS 0U
+ #include "stm32wbxx_hal_qspi.h"
+#endif /* HAL_QSPI_MODULE_ENABLED */
+
+#ifdef HAL_RCC_MODULE_ENABLED
+ #include "stm32wbxx_hal_rcc.h"
+#endif /* HAL_RCC_MODULE_ENABLED */
+
+#ifdef HAL_RNG_MODULE_ENABLED
+ #include "stm32wbxx_hal_rng.h"
+#endif /* HAL_RNG_MODULE_ENABLED */
+
+#ifdef HAL_RTC_MODULE_ENABLED
+ #include "stm32wbxx_hal_rtc.h"
+#endif /* HAL_RTC_MODULE_ENABLED */
+
+#ifdef HAL_SAI_MODULE_ENABLED
+ #include "stm32wbxx_hal_sai.h"
+#endif /* HAL_SAI_MODULE_ENABLED */
+
+#ifdef HAL_SMARTCARD_MODULE_ENABLED
+ #include "stm32wbxx_hal_smartcard.h"
+#endif /* HAL_SMARTCARD_MODULE_ENABLED */
+
+#ifdef HAL_SMBUS_MODULE_ENABLED
+ #include "stm32wbxx_hal_smbus.h"
+#endif /* HAL_SMBUS_MODULE_ENABLED */
+
+#ifdef HAL_SPI_MODULE_ENABLED
+ #include "stm32wbxx_hal_spi.h"
+#endif /* HAL_SPI_MODULE_ENABLED */
+
+#ifdef HAL_TIM_MODULE_ENABLED
+ #include "stm32wbxx_hal_tim.h"
+#endif /* HAL_TIM_MODULE_ENABLED */
+
+#ifdef HAL_TSC_MODULE_ENABLED
+ #include "stm32wbxx_hal_tsc.h"
+#endif /* HAL_TSC_MODULE_ENABLED */
+
+#ifdef HAL_UART_MODULE_ENABLED
+ #include "stm32wbxx_hal_uart.h"
+#endif /* HAL_UART_MODULE_ENABLED */
+
+#ifdef HAL_USART_MODULE_ENABLED
+ #include "stm32wbxx_hal_usart.h"
+#endif /* HAL_USART_MODULE_ENABLED */
+
+#ifdef HAL_WWDG_MODULE_ENABLED
+ #include "stm32wbxx_hal_wwdg.h"
+#endif /* HAL_WWDG_MODULE_ENABLED */
+
+/* Exported macro ------------------------------------------------------------*/
+#ifdef USE_FULL_ASSERT
+/**
+ * @brief The assert_param macro is used for function's parameters check.
+ * @param expr If expr is false, it calls assert_failed function
+ * which reports the name of the source file and the source
+ * line number of the call that failed.
+ * If expr is true, it returns no value.
+ * @retval None
+ */
+#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
+/* Exported functions ------------------------------------------------------- */
+void assert_failed(uint8_t* file, uint32_t line);
+#else
+ #define assert_param(expr) ((void)0U)
+#endif /* USE_FULL_ASSERT */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __STM32WBxx_HAL_CONF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/stm32wbxx_it.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/stm32wbxx_it.h
new file mode 100644
index 000000000..4d7078cd3
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/stm32wbxx_it.h
@@ -0,0 +1,77 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file stm32wbxx_it.h
+ * @author MCD Application Team
+ * @brief This file contains the headers of the interrupt handlers.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32WBxx_IT_H
+#define __STM32WBxx_IT_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+#include "app_common.h"
+/* USER CODE END Includes */
+
+/* Exported types ------------------------------------------------------------*/
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* Exported macro ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions prototypes ---------------------------------------------*/
+void NMI_Handler(void);
+void HardFault_Handler(void);
+void MemManage_Handler(void);
+void BusFault_Handler(void);
+void UsageFault_Handler(void);
+void SVC_Handler(void);
+void DebugMon_Handler(void);
+void PendSV_Handler(void);
+void SysTick_Handler(void);
+void DMA1_Channel4_IRQHandler(void);
+void USART1_IRQHandler(void);
+void LPUART1_IRQHandler(void);
+void DMA2_Channel4_IRQHandler(void);
+/* USER CODE BEGIN EFP */
+void RTC_WKUP_IRQHandler(void);
+void IPCC_C1_TX_IRQHandler(void);
+void IPCC_C1_RX_IRQHandler(void);
+void PUSH_BUTTON_SW1_EXTI_IRQHandler(void);
+/* USER CODE END EFP */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __STM32WBxx_IT_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/utilities_conf.h
new file mode 100644
index 000000000..4dde3509a
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Inc/utilities_conf.h
@@ -0,0 +1,68 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : utilities_conf.h
+ * Description : Configuration file for STM32 Utilities.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef UTILITIES_CONF_H
+#define UTILITIES_CONF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "cmsis_compiler.h"
+#include "string.h"
+
+/******************************************************************************
+ * common
+ ******************************************************************************/
+#define UTILS_ENTER_CRITICAL_SECTION( ) uint32_t primask_bit = __get_PRIMASK( );\
+ __disable_irq( )
+
+#define UTILS_EXIT_CRITICAL_SECTION( ) __set_PRIMASK( primask_bit )
+
+#define UTILS_MEMSET8( dest, value, size ) memset( dest, value, size);
+
+/******************************************************************************
+ * tiny low power manager
+ * (any macro that does not need to be modified can be removed)
+ ******************************************************************************/
+#define UTIL_LPM_INIT_CRITICAL_SECTION( )
+#define UTIL_LPM_ENTER_CRITICAL_SECTION( ) UTILS_ENTER_CRITICAL_SECTION( )
+#define UTIL_LPM_EXIT_CRITICAL_SECTION( ) UTILS_EXIT_CRITICAL_SECTION( )
+
+/******************************************************************************
+ * sequencer
+ * (any macro that does not need to be modified can be removed)
+ ******************************************************************************/
+#define UTIL_SEQ_INIT_CRITICAL_SECTION( )
+#define UTIL_SEQ_ENTER_CRITICAL_SECTION( ) UTILS_ENTER_CRITICAL_SECTION( )
+#define UTIL_SEQ_EXIT_CRITICAL_SECTION( ) UTILS_EXIT_CRITICAL_SECTION( )
+#define UTIL_SEQ_CONF_TASK_NBR (32)
+#define UTIL_SEQ_CONF_PRIO_NBR (2)
+#define UTIL_SEQ_MEMSET8( dest, value, size ) UTILS_MEMSET8( dest, value, size )
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*UTILITIES_CONF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/app_entry.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/app_entry.c
new file mode 100644
index 000000000..997336e08
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/app_entry.c
@@ -0,0 +1,419 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file app_entry.c
+ * @author MCD Application Team
+ * @brief Entry point of the Application
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "main.h"
+#include "app_entry.h"
+#include "app_ble_sv.h"
+#include "app_ble_hr.h"
+#include "app_ble_cl.h"
+#include "ble.h"
+#include "tl.h"
+#include "stm32_seq.h"
+#include "shci_tl.h"
+#include "stm32_lpm.h"
+#include "dbg_trace.h"
+#include "uart_app.h"
+
+/* Private includes -----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+extern RTC_HandleTypeDef hrtc;
+/* USER CODE BEGIN PTD */
+
+/* USER CODE END PTD */
+
+/* Private defines -----------------------------------------------------------*/
+#define POOL_SIZE (CFG_TLBLE_EVT_QUEUE_LENGTH*4U*DIVC(( sizeof(TL_PacketHeader_t) + TL_BLE_EVENT_FRAME_SIZE ), 4U))
+#define INFORMATION_SECTION_KEYWORD (0xA56959A6)
+
+/* USER CODE BEGIN PD */
+
+/* USER CODE END PD */
+
+/* Private macros ------------------------------------------------------------*/
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private variables ---------------------------------------------------------*/
+PLACE_IN_SECTION("VERSION") const uint32_t FW_Version = (CFG_FW_MAJOR_VERSION << 24) + (CFG_FW_MINOR_VERSION << 16) + (CFG_FW_SUBVERSION << 8)
++ (CFG_FW_BRANCH << 4) + CFG_FW_BUILD;
+PLACE_IN_SECTION("VERSION") const uint32_t keyword = INFORMATION_SECTION_KEYWORD;
+
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t EvtPool[POOL_SIZE];
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static TL_CmdPacket_t SystemCmdBuffer;
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t SystemSpareEvtBuffer[sizeof(TL_PacketHeader_t) + TL_EVT_HDR_SIZE + 255U];
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t BleSpareEvtBuffer[sizeof(TL_PacketHeader_t) + TL_EVT_HDR_SIZE + 255];
+
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Private functions prototypes-----------------------------------------------*/
+static void SystemPower_Config( void );
+static void Init_Debug( void );
+static void appe_Tl_Init( void );
+static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status );
+static void APPE_SysUserEvtRx( void * pPayload );
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+extern void MX_LPUART1_UART_Init(void);
+#endif
+#if (CFG_HW_USART1_ENABLED == 1)
+extern void MX_USART1_UART_Init(void);
+#endif
+
+/* USER CODE BEGIN PFP */
+static void Led_Init( void );
+static void Button_Init( void );
+static void Mode_Selec( void );
+/* USER CODE END PFP */
+
+
+APP_Mode_t APP_MODE;
+
+/* Functions Definition ------------------------------------------------------*/
+void APPE_Init( void )
+{
+ APP_MODE = NO_APP;
+
+ SystemPower_Config(); /**< Configure the system Power Mode */
+
+ HW_TS_Init(hw_ts_InitMode_Full, &hrtc); /**< Initialize the TimerServer */
+
+/* USER CODE BEGIN APPE_Init_1 */
+ Init_Debug();
+
+ /**
+ * The Standby mode should not be entered before the initialization is over
+ * The default state of the Low Power Manager is to allow the Standby Mode so an request is needed here
+ */
+ UTIL_LPM_SetOffMode(1 << CFG_LPM_APP, UTIL_LPM_DISABLE);
+
+ Led_Init();
+
+ Button_Init();
+
+ Mode_Selec();
+
+ UART_App_Init();
+
+ /* USER CODE END APPE_Init_1 */
+ appe_Tl_Init(); /* Initialize all transport layers */
+
+ /**
+ * From now, the application is waiting for the ready event ( VS_HCI_C2_Ready )
+ * received on the system channel before starting the Stack
+ * This system event is received with APPE_SysUserEvtRx()
+ */
+/* USER CODE BEGIN APPE_Init_2 */
+
+/* USER CODE END APPE_Init_2 */
+ return;
+}
+/* USER CODE BEGIN FD */
+
+/* USER CODE END FD */
+
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+static void Mode_Selec( void )
+{
+ switch(*(uint32_t*)SRAM1_BASE)
+ {
+ case SRAM1_BASE_P2P_SERVER :
+ APP_MODE = P2P_SERVER;
+ break;
+
+ case SRAM1_BASE_P2P_CLIENT :
+ APP_MODE = P2P_CLIENT;
+ break;
+
+ case SRAM1_BASE_HEART_RATE :
+ APP_MODE = HEART_RATE;
+ break;
+
+ default :
+ APP_MODE = NO_APP;
+ break;
+ }
+}
+
+static void Init_Debug( void )
+{
+#if (CFG_DEBUGGER_SUPPORTED == 1)
+ /**
+ * Keep debugger enabled while in any low power mode
+ */
+ HAL_DBGMCU_EnableDBGSleepMode();
+
+ /***************** ENABLE DEBUGGER *************************************/
+ LL_EXTI_EnableIT_32_63(LL_EXTI_LINE_48);
+ LL_C2_EXTI_EnableIT_32_63(LL_EXTI_LINE_48);
+
+#else
+
+ GPIO_InitTypeDef gpio_config = {0};
+
+ gpio_config.Pull = GPIO_NOPULL;
+ gpio_config.Mode = GPIO_MODE_ANALOG;
+
+ gpio_config.Pin = GPIO_PIN_15 | GPIO_PIN_14 | GPIO_PIN_13;
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ HAL_GPIO_Init(GPIOA, &gpio_config);
+ __HAL_RCC_GPIOA_CLK_DISABLE();
+
+ gpio_config.Pin = GPIO_PIN_4 | GPIO_PIN_3;
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+ HAL_GPIO_Init(GPIOB, &gpio_config);
+ __HAL_RCC_GPIOB_CLK_DISABLE();
+
+ HAL_DBGMCU_DisableDBGSleepMode();
+ HAL_DBGMCU_DisableDBGStopMode();
+ HAL_DBGMCU_DisableDBGStandbyMode();
+
+#endif /* (CFG_DEBUGGER_SUPPORTED == 1) */
+
+#if(CFG_DEBUG_TRACE != 0)
+ DbgTraceInit();
+#endif
+
+ return;
+}
+
+/**
+ * @brief Configure the system for power optimization
+ *
+ * @note This API configures the system to be ready for low power mode
+ *
+ * @param None
+ * @retval None
+ */
+static void SystemPower_Config( void )
+{
+
+ /**
+ * Select HSI as system clock source after Wake Up from Stop mode
+ */
+ LL_RCC_SetClkAfterWakeFromStop(LL_RCC_STOP_WAKEUPCLOCK_HSI);
+
+ /* Initialize low power manager */
+ UTIL_LPM_Init( );
+
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+ /**
+ * Enable USB power
+ */
+ HAL_PWREx_EnableVddUSB();
+#endif
+
+ return;
+}
+
+static void appe_Tl_Init( void )
+{
+ TL_MM_Config_t tl_mm_config;
+ SHCI_TL_HciInitConf_t SHci_Tl_Init_Conf;
+ /**< Reference table initialization */
+ TL_Init();
+
+ /**< System channel initialization */
+ UTIL_SEQ_RegTask( 1<< CFG_TASK_SYSTEM_HCI_ASYNCH_EVT_ID, UTIL_SEQ_RFU, shci_user_evt_proc );
+ SHci_Tl_Init_Conf.p_cmdbuffer = (uint8_t*)&SystemCmdBuffer;
+ SHci_Tl_Init_Conf.StatusNotCallBack = APPE_SysStatusNot;
+ shci_init(APPE_SysUserEvtRx, (void*) &SHci_Tl_Init_Conf);
+
+ /**< Memory Manager channel initialization */
+ tl_mm_config.p_BleSpareEvtBuffer = BleSpareEvtBuffer;
+ tl_mm_config.p_SystemSpareEvtBuffer = SystemSpareEvtBuffer;
+ tl_mm_config.p_AsynchEvtPool = EvtPool;
+ tl_mm_config.AsynchEvtPoolSize = POOL_SIZE;
+ TL_MM_Init( &tl_mm_config );
+
+ TL_Enable();
+
+ return;
+}
+
+static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status )
+{
+ UNUSED(status);
+ return;
+}
+
+static void APPE_SysUserEvtRx( void * pPayload )
+{
+ UNUSED(pPayload);
+ /* Traces channel initialization */
+ TL_TRACES_Init( );
+
+ switch(APP_MODE)
+ {
+ case P2P_SERVER :
+ APP_BLE_SV_Init( );
+ break;
+ case P2P_CLIENT :
+ APP_BLE_CL_Init( );
+ break;
+ case HEART_RATE :
+ APP_BLE_HR_Init( );
+ break;
+ default : break;
+ }
+
+ return;
+}
+
+/* USER CODE BEGIN FD_LOCAL_FUNCTIONS */
+static void Led_Init( void )
+{
+#if (CFG_LED_SUPPORTED == 1)
+ /**
+ * Leds Initialization
+ */
+
+ BSP_LED_Init(LED_BLUE);
+ BSP_LED_Init(LED_GREEN);
+ BSP_LED_Init(LED_RED);
+
+#endif
+
+ return;
+}
+
+static void Button_Init( void )
+{
+#if (CFG_BUTTON_SUPPORTED == 1)
+ /**
+ * Button Initialization
+ */
+
+ BSP_PB_Init(BUTTON_SW1, BUTTON_MODE_EXTI);
+ BSP_PB_Init(BUTTON_SW2, BUTTON_MODE_EXTI);
+#endif
+
+ return;
+}
+/* USER CODE END FD_LOCAL_FUNCTIONS */
+
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+
+void UTIL_SEQ_Idle( void )
+{
+#if ( CFG_LPM_SUPPORTED == 1)
+ UTIL_LPM_EnterLowPower( );
+#endif
+ return;
+}
+
+/**
+ * @brief This function is called by the scheduler each time an event
+ * is pending.
+ *
+ * @param evt_waited_bm : Event pending.
+ * @retval None
+ */
+void UTIL_SEQ_EvtIdle( UTIL_SEQ_bm_t task_id_bm, UTIL_SEQ_bm_t evt_waited_bm )
+{
+ UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
+}
+
+void shci_notify_asynch_evt(void* pdata)
+{
+ UTIL_SEQ_SetTask( 1<<CFG_TASK_SYSTEM_HCI_ASYNCH_EVT_ID, CFG_SCH_PRIO_0);
+ return;
+}
+
+void shci_cmd_resp_release(uint32_t flag)
+{
+ UTIL_SEQ_SetEvt( 1<< CFG_IDLEEVT_SYSTEM_HCI_CMD_EVT_RSP_ID );
+ return;
+}
+
+void shci_cmd_resp_wait(uint32_t timeout)
+{
+ UTIL_SEQ_WaitEvt( 1<< CFG_IDLEEVT_SYSTEM_HCI_CMD_EVT_RSP_ID );
+ return;
+}
+
+/**
+ * @brief Initialisation of the trace mechanism
+ * @param None
+ * @retval None
+ */
+#if(CFG_DEBUG_TRACE != 0)
+void DbgOutputInit( void )
+{
+ return;
+}
+
+/**
+ * @brief Management of the traces
+ * @param p_data : data
+ * @param size : size
+ * @param call-back :
+ * @retval None
+ */
+void DbgOutputTraces( uint8_t *p_data, uint16_t size, void (*cb)(void) )
+{
+ HW_UART_Transmit_DMA(CFG_DEBUG_TRACE_UART, p_data, size, cb);
+
+ return;
+}
+#endif
+
+/* USER CODE BEGIN FD_WRAP_FUNCTIONS */
+void HAL_GPIO_EXTI_Callback( uint16_t GPIO_Pin )
+{
+ switch (GPIO_Pin)
+ {
+ case BUTTON_SW1_PIN:
+ APP_BLE_SV_Key_Button1_Action();
+ break;
+
+ case BUTTON_SW2_PIN:
+ APP_BLE_SV_Key_Button2_Action();
+ break;
+
+ case BUTTON_SW3_PIN:
+ APP_BLE_SV_Key_Button3_Action();
+ break;
+
+ default:
+ break;
+
+ }
+ return;
+}
+/* USER CODE END FD_WRAP_FUNCTIONS */
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/hw_timerserver.c
new file mode 100644
index 000000000..c842ba55e
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/hw_timerserver.c
@@ -0,0 +1,893 @@
+/**
+ ******************************************************************************
+ * File Name : hw_timerserver.c
+ * Description : Hardware timerserver source file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "hw_conf.h"
+
+/* Private typedef -----------------------------------------------------------*/
+typedef enum
+{
+ TimerID_Free,
+ TimerID_Created,
+ TimerID_Running
+}TimerIDStatus_t;
+
+typedef enum
+{
+ SSR_Read_Requested,
+ SSR_Read_Not_Requested
+}RequestReadSSR_t;
+
+typedef enum
+{
+ WakeupTimerValue_Overpassed,
+ WakeupTimerValue_LargeEnough
+}WakeupTimerLimitation_Status_t;
+
+typedef struct
+{
+ HW_TS_pTimerCb_t pTimerCallBack;
+ uint32_t CounterInit;
+ uint32_t CountLeft;
+ TimerIDStatus_t TimerIDStatus;
+ HW_TS_Mode_t TimerMode;
+ uint32_t TimerProcessID;
+ uint8_t PreviousID;
+ uint8_t NextID;
+}TimerContext_t;
+
+/* Private defines -----------------------------------------------------------*/
+#define SSR_FORBIDDEN_VALUE 0xFFFFFFFF
+#define TIMER_LIST_EMPTY 0xFFFF
+
+/* Private macros ------------------------------------------------------------*/
+/* Private variables ---------------------------------------------------------*/
+
+/**
+ * START of Section TIMERSERVER_CONTEXT
+ */
+
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile TimerContext_t aTimerContext[CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER];
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile uint8_t CurrentRunningTimerID;
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile uint8_t PreviousRunningTimerID;
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile uint32_t SSRValueOnLastSetup;
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile WakeupTimerLimitation_Status_t WakeupTimerLimitation;
+
+/**
+ * END of Section TIMERSERVER_CONTEXT
+ */
+
+static RTC_HandleTypeDef *phrtc; /**< RTC handle */
+static uint8_t WakeupTimerDivider;
+static uint8_t AsynchPrescalerUserConfig;
+static uint16_t SynchPrescalerUserConfig;
+static volatile uint16_t MaxWakeupTimerSetup;
+
+/* Global variables ----------------------------------------------------------*/
+/* Private function prototypes -----------------------------------------------*/
+static void RestartWakeupCounter(uint16_t Value);
+static uint16_t ReturnTimeElapsed(void);
+static void RescheduleTimerList(void);
+static void UnlinkTimer(uint8_t TimerID, RequestReadSSR_t RequestReadSSR);
+static void LinkTimerBefore(uint8_t TimerID, uint8_t RefTimerID);
+static void LinkTimerAfter(uint8_t TimerID, uint8_t RefTimerID);
+static uint16_t linkTimer(uint8_t TimerID);
+static uint32_t ReadRtcSsrValue(void);
+
+__weak void HW_TS_RTC_CountUpdated_AppNot(void);
+
+/* Functions Definition ------------------------------------------------------*/
+
+/**
+ * @brief Read the RTC_SSR value
+ * As described in the reference manual, the RTC_SSR shall be read twice to ensure
+ * reliability of the value
+ * @param None
+ * @retval SSR value read
+ */
+static uint32_t ReadRtcSsrValue(void)
+{
+ uint32_t first_read;
+ uint32_t second_read;
+
+ first_read = (uint32_t)(READ_BIT(RTC->SSR, RTC_SSR_SS));
+
+ second_read = (uint32_t)(READ_BIT(RTC->SSR, RTC_SSR_SS));
+
+ while(first_read != second_read)
+ {
+ first_read = second_read;
+
+ second_read = (uint32_t)(READ_BIT(RTC->SSR, RTC_SSR_SS));
+ }
+
+ return second_read;
+}
+
+/**
+ * @brief Insert a Timer in the list after the Timer ID specified
+ * @param TimerID: The ID of the Timer
+ * @param RefTimerID: The ID of the Timer to be linked after
+ * @retval None
+ */
+static void LinkTimerAfter(uint8_t TimerID, uint8_t RefTimerID)
+{
+ uint8_t next_id;
+
+ next_id = aTimerContext[RefTimerID].NextID;
+
+ if(next_id != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ aTimerContext[next_id].PreviousID = TimerID;
+ }
+ aTimerContext[TimerID].NextID = next_id;
+ aTimerContext[TimerID].PreviousID = RefTimerID ;
+ aTimerContext[RefTimerID].NextID = TimerID;
+
+ return;
+}
+
+/**
+ * @brief Insert a Timer in the list before the ID specified
+ * @param TimerID: The ID of the Timer
+ * @param RefTimerID: The ID of the Timer to be linked before
+ * @retval None
+ */
+static void LinkTimerBefore(uint8_t TimerID, uint8_t RefTimerID)
+{
+ uint8_t previous_id;
+
+ if(RefTimerID != CurrentRunningTimerID)
+ {
+ previous_id = aTimerContext[RefTimerID].PreviousID;
+
+ aTimerContext[previous_id].NextID = TimerID;
+ aTimerContext[TimerID].NextID = RefTimerID;
+ aTimerContext[TimerID].PreviousID = previous_id ;
+ aTimerContext[RefTimerID].PreviousID = TimerID;
+ }
+ else
+ {
+ aTimerContext[TimerID].NextID = RefTimerID;
+ aTimerContext[RefTimerID].PreviousID = TimerID;
+ }
+
+ return;
+}
+
+/**
+ * @brief Insert a Timer in the list
+ * @param TimerID: The ID of the Timer
+ * @retval None
+ */
+static uint16_t linkTimer(uint8_t TimerID)
+{
+ uint32_t time_left;
+ uint16_t time_elapsed;
+ uint8_t timer_id_lookup;
+ uint8_t next_id;
+
+ if(CurrentRunningTimerID == CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ /**
+ * No timer in the list
+ */
+ PreviousRunningTimerID = CurrentRunningTimerID;
+ CurrentRunningTimerID = TimerID;
+ aTimerContext[TimerID].NextID = CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER;
+
+ SSRValueOnLastSetup = SSR_FORBIDDEN_VALUE;
+ time_elapsed = 0;
+ }
+ else
+ {
+ time_elapsed = ReturnTimeElapsed();
+
+ /**
+ * update count of the timer to be linked
+ */
+ aTimerContext[TimerID].CountLeft += time_elapsed;
+ time_left = aTimerContext[TimerID].CountLeft;
+
+ /**
+ * Search for index where the new timer shall be linked
+ */
+ if(aTimerContext[CurrentRunningTimerID].CountLeft <= time_left)
+ {
+ /**
+ * Search for the ID after the first one
+ */
+ timer_id_lookup = CurrentRunningTimerID;
+ next_id = aTimerContext[timer_id_lookup].NextID;
+ while((next_id != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) && (aTimerContext[next_id].CountLeft <= time_left))
+ {
+ timer_id_lookup = aTimerContext[timer_id_lookup].NextID;
+ next_id = aTimerContext[timer_id_lookup].NextID;
+ }
+
+ /**
+ * Link after the ID
+ */
+ LinkTimerAfter(TimerID, timer_id_lookup);
+ }
+ else
+ {
+ /**
+ * Link before the first ID
+ */
+ LinkTimerBefore(TimerID, CurrentRunningTimerID);
+ PreviousRunningTimerID = CurrentRunningTimerID;
+ CurrentRunningTimerID = TimerID;
+ }
+ }
+
+ return time_elapsed;
+}
+
+/**
+ * @brief Remove a Timer from the list
+ * @param TimerID: The ID of the Timer
+ * @param RequestReadSSR: Request to read the SSR register or not
+ * @retval None
+ */
+static void UnlinkTimer(uint8_t TimerID, RequestReadSSR_t RequestReadSSR)
+{
+ uint8_t previous_id;
+ uint8_t next_id;
+
+ if(TimerID == CurrentRunningTimerID)
+ {
+ PreviousRunningTimerID = CurrentRunningTimerID;
+ CurrentRunningTimerID = aTimerContext[TimerID].NextID;
+ }
+ else
+ {
+ previous_id = aTimerContext[TimerID].PreviousID;
+ next_id = aTimerContext[TimerID].NextID;
+
+ aTimerContext[previous_id].NextID = aTimerContext[TimerID].NextID;
+ if(next_id != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ aTimerContext[next_id].PreviousID = aTimerContext[TimerID].PreviousID;
+ }
+ }
+
+ /**
+ * Timer is out of the list
+ */
+ aTimerContext[TimerID].TimerIDStatus = TimerID_Created;
+
+ if((CurrentRunningTimerID == CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) && (RequestReadSSR == SSR_Read_Requested))
+ {
+ SSRValueOnLastSetup = SSR_FORBIDDEN_VALUE;
+ }
+
+ return;
+}
+
+/**
+ * @brief Return the number of ticks counted by the wakeuptimer since it has been started
+ * @note The API is reading the SSR register to get how many ticks have been counted
+ * since the time the timer has been started
+ * @param None
+ * @retval Time expired in Ticks
+ */
+static uint16_t ReturnTimeElapsed(void)
+{
+ uint32_t return_value;
+ uint32_t wrap_counter;
+
+ if(SSRValueOnLastSetup != SSR_FORBIDDEN_VALUE)
+ {
+ return_value = ReadRtcSsrValue(); /**< Read SSR register first */
+
+ if (SSRValueOnLastSetup >= return_value)
+ {
+ return_value = SSRValueOnLastSetup - return_value;
+ }
+ else
+ {
+ wrap_counter = SynchPrescalerUserConfig - return_value;
+ return_value = SSRValueOnLastSetup + wrap_counter;
+ }
+
+ /**
+ * At this stage, ReturnValue holds the number of ticks counted by SSR
+ * Need to translate in number of ticks counted by the Wakeuptimer
+ */
+ return_value = return_value*AsynchPrescalerUserConfig;
+ return_value = return_value >> WakeupTimerDivider;
+ }
+ else
+ {
+ return_value = 0;
+ }
+
+ return (uint16_t)return_value;
+}
+
+/**
+ * @brief Set the wakeup counter
+ * @note The API is writing the counter value so that the value is decreased by one to cope with the fact
+ * the interrupt is generated with 1 extra clock cycle (See RefManuel)
+ * It assumes all condition are met to be allowed to write the wakeup counter
+ * @param Value: Value to be written in the counter
+ * @retval None
+ */
+static void RestartWakeupCounter(uint16_t Value)
+{
+ /**
+ * The wakeuptimer has been disabled in the calling function to reduce the time to poll the WUTWF
+ * FLAG when the new value will have to be written
+ * __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc);
+ */
+
+ if(Value == 0)
+ {
+ SSRValueOnLastSetup = ReadRtcSsrValue();
+
+ /**
+ * Simulate that the Timer expired
+ */
+ HAL_NVIC_SetPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID);
+ }
+ else
+ {
+ if((Value > 1) ||(WakeupTimerDivider != 1))
+ {
+ Value -= 1;
+ }
+
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == RESET);
+
+ /**
+ * make sure to clear the flags after checking the WUTWF.
+ * It takes 2 RTCCLK between the time the WUTE bit is disabled and the
+ * time the timer is disabled. The WUTWF bit somehow guarantee the system is stable
+ * Otherwise, when the timer is periodic with 1 Tick, it may generate an extra interrupt in between
+ * due to the autoreload feature
+ */
+ __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */
+ __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */
+ HAL_NVIC_ClearPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Clear pending bit in NVIC */
+
+ MODIFY_REG(RTC->WUTR, RTC_WUTR_WUT, Value);
+
+ /**
+ * Update the value here after the WUTWF polling that may take some time
+ */
+ SSRValueOnLastSetup = ReadRtcSsrValue();
+
+ __HAL_RTC_WAKEUPTIMER_ENABLE(phrtc); /**< Enable the Wakeup Timer */
+
+ HW_TS_RTC_CountUpdated_AppNot();
+ }
+
+ return ;
+}
+
+/**
+ * @brief Reschedule the list of timer
+ * @note 1) Update the count left for each timer in the list
+ * 2) Setup the wakeuptimer
+ * @param None
+ * @retval None
+ */
+static void RescheduleTimerList(void)
+{
+ uint8_t localTimerID;
+ uint32_t timecountleft;
+ uint16_t wakeup_timer_value;
+ uint16_t time_elapsed;
+
+ /**
+ * The wakeuptimer is disabled now to reduce the time to poll the WUTWF
+ * FLAG when the new value will have to be written
+ */
+ if((READ_BIT(RTC->CR, RTC_CR_WUTE) == (RTC_CR_WUTE)) == SET)
+ {
+ /**
+ * Wait for the flag to be back to 0 when the wakeup timer is enabled
+ */
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == SET);
+ }
+ __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc); /**< Disable the Wakeup Timer */
+
+ localTimerID = CurrentRunningTimerID;
+
+ /**
+ * Calculate what will be the value to write in the wakeuptimer
+ */
+ timecountleft = aTimerContext[localTimerID].CountLeft;
+
+ /**
+ * Read how much has been counted
+ */
+ time_elapsed = ReturnTimeElapsed();
+
+ if(timecountleft < time_elapsed )
+ {
+ /**
+ * There is no tick left to count
+ */
+ wakeup_timer_value = 0;
+ WakeupTimerLimitation = WakeupTimerValue_LargeEnough;
+ }
+ else
+ {
+ if(timecountleft > (time_elapsed + MaxWakeupTimerSetup))
+ {
+ /**
+ * The number of tick left is greater than the Wakeuptimer maximum value
+ */
+ wakeup_timer_value = MaxWakeupTimerSetup;
+
+ WakeupTimerLimitation = WakeupTimerValue_Overpassed;
+ }
+ else
+ {
+ wakeup_timer_value = timecountleft - time_elapsed;
+ WakeupTimerLimitation = WakeupTimerValue_LargeEnough;
+ }
+
+ }
+
+ /**
+ * update ticks left to be counted for each timer
+ */
+ while(localTimerID != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ if (aTimerContext[localTimerID].CountLeft < time_elapsed)
+ {
+ aTimerContext[localTimerID].CountLeft = 0;
+ }
+ else
+ {
+ aTimerContext[localTimerID].CountLeft -= time_elapsed;
+ }
+ localTimerID = aTimerContext[localTimerID].NextID;
+ }
+
+ /**
+ * Write next count
+ */
+ RestartWakeupCounter(wakeup_timer_value);
+
+ return ;
+}
+
+/* Public functions ----------------------------------------------------------*/
+
+/**
+ * For all public interface except that may need write access to the RTC, the RTC
+ * shall be unlock at the beginning and locked at the output
+ * In order to ease maintainability, the unlock is done at the top and the lock at then end
+ * in case some new implementation is coming in the future
+ */
+
+void HW_TS_RTC_Wakeup_Handler(void)
+{
+ HW_TS_pTimerCb_t ptimer_callback;
+ uint32_t timer_process_id;
+ uint8_t local_current_running_timer_id;
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ uint32_t primask_bit;
+#endif
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+#endif
+
+/* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+
+ /**
+ * Disable the Wakeup Timer
+ * This may speed up a bit the processing to wait the timer to be disabled
+ * The timer is still counting 2 RTCCLK
+ */
+ __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc);
+
+ local_current_running_timer_id = CurrentRunningTimerID;
+
+ if(aTimerContext[local_current_running_timer_id].TimerIDStatus == TimerID_Running)
+ {
+ ptimer_callback = aTimerContext[local_current_running_timer_id].pTimerCallBack;
+ timer_process_id = aTimerContext[local_current_running_timer_id].TimerProcessID;
+
+ /**
+ * It should be good to check whether the TimeElapsed is greater or not than the tick left to be counted
+ * However, due to the inaccuracy of the reading of the time elapsed, it may return there is 1 tick
+ * to be left whereas the count is over
+ * A more secure implementation has been done with a flag to state whereas the full count has been written
+ * in the wakeuptimer or not
+ */
+ if(WakeupTimerLimitation != WakeupTimerValue_Overpassed)
+ {
+ if(aTimerContext[local_current_running_timer_id].TimerMode == hw_ts_Repeated)
+ {
+ UnlinkTimer(local_current_running_timer_id, SSR_Read_Not_Requested);
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+ HW_TS_Start(local_current_running_timer_id, aTimerContext[local_current_running_timer_id].CounterInit);
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+ }
+ else
+ {
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+ HW_TS_Stop(local_current_running_timer_id);
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+ }
+
+ HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
+ }
+ else
+ {
+ RescheduleTimerList();
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+ }
+ }
+ else
+ {
+ /**
+ * We should never end up in this case
+ * However, if due to any bug in the timer server this is the case, the mistake may not impact the user.
+ * We could just clean the interrupt flag and get out from this unexpected interrupt
+ */
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == RESET);
+
+ /**
+ * make sure to clear the flags after checking the WUTWF.
+ * It takes 2 RTCCLK between the time the WUTE bit is disabled and the
+ * time the timer is disabled. The WUTWF bit somehow guarantee the system is stable
+ * Otherwise, when the timer is periodic with 1 Tick, it may generate an extra interrupt in between
+ * due to the autoreload feature
+ */
+ __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */
+ __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+ }
+
+ /* Enable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_ENABLE( phrtc );
+
+ return;
+}
+
+void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
+{
+ uint8_t loop;
+ uint32_t localmaxwakeuptimersetup;
+
+ /**
+ * Get RTC handler
+ */
+ phrtc = hrtc;
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+
+ SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
+
+ /**
+ * Readout the user config
+ */
+ WakeupTimerDivider = (4 - ((uint32_t)(READ_BIT(RTC->CR, RTC_CR_WUCKSEL))));
+
+ AsynchPrescalerUserConfig = (uint8_t)(READ_BIT(RTC->PRER, RTC_PRER_PREDIV_A) >> (uint32_t)POSITION_VAL(RTC_PRER_PREDIV_A)) + 1;
+
+ SynchPrescalerUserConfig = (uint16_t)(READ_BIT(RTC->PRER, RTC_PRER_PREDIV_S)) + 1;
+
+ /**
+ * Margin is taken to avoid wrong calculation when the wrap around is there and some
+ * application interrupts may have delayed the reading
+ */
+ localmaxwakeuptimersetup = ((((SynchPrescalerUserConfig - 1)*AsynchPrescalerUserConfig) - CFG_HW_TS_RTC_HANDLER_MAX_DELAY) >> WakeupTimerDivider);
+
+ if(localmaxwakeuptimersetup >= 0xFFFF)
+ {
+ MaxWakeupTimerSetup = 0xFFFF;
+ }
+ else
+ {
+ MaxWakeupTimerSetup = (uint16_t)localmaxwakeuptimersetup;
+ }
+
+ /**
+ * Configure EXTI module
+ */
+ LL_EXTI_EnableRisingTrig_0_31(RTC_EXTI_LINE_WAKEUPTIMER_EVENT);
+ LL_EXTI_EnableIT_0_31(RTC_EXTI_LINE_WAKEUPTIMER_EVENT);
+
+ if(TimerInitMode == hw_ts_InitMode_Full)
+ {
+ WakeupTimerLimitation = WakeupTimerValue_LargeEnough;
+ SSRValueOnLastSetup = SSR_FORBIDDEN_VALUE;
+
+ /**
+ * Initialize the timer server
+ */
+ for(loop = 0; loop < CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER; loop++)
+ {
+ aTimerContext[loop].TimerIDStatus = TimerID_Free;
+ }
+
+ CurrentRunningTimerID = CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER; /**< Set ID to non valid value */
+
+ __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc); /**< Disable the Wakeup Timer */
+ __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */
+ __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */
+ HAL_NVIC_ClearPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Clear pending bit in NVIC */
+ __HAL_RTC_WAKEUPTIMER_ENABLE_IT(phrtc, RTC_IT_WUT); /**< Enable interrupt in RTC module */
+ }
+ else
+ {
+ if(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTF) != RESET)
+ {
+ /**
+ * Simulate that the Timer expired
+ */
+ HAL_NVIC_SetPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID);
+ }
+ }
+
+ /* Enable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_ENABLE( phrtc );
+
+ HAL_NVIC_SetPriority(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID, CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO, CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO); /**< Set NVIC priority */
+ HAL_NVIC_EnableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Enable NVIC */
+
+ return;
+}
+
+HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pftimeout_handler)
+{
+ HW_TS_ReturnStatus_t localreturnstatus;
+ uint8_t loop = 0;
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ uint32_t primask_bit;
+#endif
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+#endif
+
+ while((loop < CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) && (aTimerContext[loop].TimerIDStatus != TimerID_Free))
+ {
+ loop++;
+ }
+
+ if(loop != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ aTimerContext[loop].TimerIDStatus = TimerID_Created;
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+
+ aTimerContext[loop].TimerProcessID = TimerProcessID;
+ aTimerContext[loop].TimerMode = TimerMode;
+ aTimerContext[loop].pTimerCallBack = pftimeout_handler;
+ *pTimerId = loop;
+
+ localreturnstatus = hw_ts_Successful;
+ }
+ else
+ {
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+
+ localreturnstatus = hw_ts_Failed;
+ }
+
+ return(localreturnstatus);
+}
+
+void HW_TS_Delete(uint8_t timer_id)
+{
+ HW_TS_Stop(timer_id);
+
+ aTimerContext[timer_id].TimerIDStatus = TimerID_Free; /**< release ID */
+
+ return;
+}
+
+void HW_TS_Stop(uint8_t timer_id)
+{
+ uint8_t localcurrentrunningtimerid;
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ uint32_t primask_bit;
+#endif
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+#endif
+
+ HAL_NVIC_DisableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Disable NVIC */
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+
+ if(aTimerContext[timer_id].TimerIDStatus == TimerID_Running)
+ {
+ UnlinkTimer(timer_id, SSR_Read_Requested);
+ localcurrentrunningtimerid = CurrentRunningTimerID;
+
+ if(localcurrentrunningtimerid == CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ /**
+ * List is empty
+ */
+
+ /**
+ * Disable the timer
+ */
+ if((READ_BIT(RTC->CR, RTC_CR_WUTE) == (RTC_CR_WUTE)) == SET)
+ {
+ /**
+ * Wait for the flag to be back to 0 when the wakeup timer is enabled
+ */
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == SET);
+ }
+ __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc); /**< Disable the Wakeup Timer */
+
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == RESET);
+
+ /**
+ * make sure to clear the flags after checking the WUTWF.
+ * It takes 2 RTCCLK between the time the WUTE bit is disabled and the
+ * time the timer is disabled. The WUTWF bit somehow guarantee the system is stable
+ * Otherwise, when the timer is periodic with 1 Tick, it may generate an extra interrupt in between
+ * due to the autoreload feature
+ */
+ __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */
+ __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */
+ HAL_NVIC_ClearPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Clear pending bit in NVIC */
+ }
+ else if(PreviousRunningTimerID != localcurrentrunningtimerid)
+ {
+ RescheduleTimerList();
+ }
+ }
+
+ /* Enable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_ENABLE( phrtc );
+
+ HAL_NVIC_EnableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Enable NVIC */
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+
+ return;
+}
+
+void HW_TS_Start(uint8_t timer_id, uint32_t timeout_ticks)
+{
+ uint16_t time_elapsed;
+ uint8_t localcurrentrunningtimerid;
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ uint32_t primask_bit;
+#endif
+
+ if(aTimerContext[timer_id].TimerIDStatus == TimerID_Running)
+ {
+ HW_TS_Stop( timer_id );
+ }
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+#endif
+
+ HAL_NVIC_DisableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Disable NVIC */
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+
+ aTimerContext[timer_id].TimerIDStatus = TimerID_Running;
+
+ aTimerContext[timer_id].CountLeft = timeout_ticks;
+ aTimerContext[timer_id].CounterInit = timeout_ticks;
+
+ time_elapsed = linkTimer(timer_id);
+
+ localcurrentrunningtimerid = CurrentRunningTimerID;
+
+ if(PreviousRunningTimerID != localcurrentrunningtimerid)
+ {
+ RescheduleTimerList();
+ }
+ else
+ {
+ aTimerContext[timer_id].CountLeft -= time_elapsed;
+ }
+
+ /* Enable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_ENABLE( phrtc );
+
+ HAL_NVIC_EnableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Enable NVIC */
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+
+ return;
+}
+
+uint16_t HW_TS_RTC_ReadLeftTicksToCount(void)
+{
+ uint32_t primask_bit;
+ uint16_t return_value, auro_reload_value, elapsed_time_value;
+
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+
+ if((READ_BIT(RTC->CR, RTC_CR_WUTE) == (RTC_CR_WUTE)) == SET)
+ {
+ auro_reload_value = (uint32_t)(READ_BIT(RTC->WUTR, RTC_WUTR_WUT));
+
+ elapsed_time_value = ReturnTimeElapsed();
+
+ if(auro_reload_value > elapsed_time_value)
+ {
+ return_value = auro_reload_value - elapsed_time_value;
+ }
+ else
+ {
+ return_value = 0;
+ }
+ }
+ else
+ {
+ return_value = TIMER_LIST_EMPTY;
+ }
+
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+
+ return (return_value);
+}
+
+__weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack)
+{
+ pTimerCallBack();
+
+ return;
+}
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/hw_uart.c
new file mode 100644
index 000000000..9a553610d
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/hw_uart.c
@@ -0,0 +1,318 @@
+/**
+ ******************************************************************************
+ * File Name : Src/hw_uart.c
+ * Description : HW UART source file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "hw_conf.h"
+#if (CFG_HW_LPUART1_ENABLED == 1)
+extern UART_HandleTypeDef hlpuart1;
+#endif
+#if (CFG_HW_USART1_ENABLED == 1)
+extern UART_HandleTypeDef huart1;
+#endif
+
+/* Macros --------------------------------------------------------------------*/
+#define HW_UART_RX_IT(__HANDLE__, __USART_BASE__) \
+ do{ \
+ HW_##__HANDLE__##RxCb = cb; \
+ (__HANDLE__).Instance = (__USART_BASE__); \
+ HAL_UART_Receive_IT(&(__HANDLE__), p_data, size); \
+ } while(0)
+
+#define HW_UART_TX_IT(__HANDLE__, __USART_BASE__) \
+ do{ \
+ HW_##__HANDLE__##TxCb = cb; \
+ (__HANDLE__).Instance = (__USART_BASE__); \
+ HAL_UART_Transmit_IT(&(__HANDLE__), p_data, size); \
+ } while(0)
+
+#define HW_UART_TX(__HANDLE__, __USART_BASE__) \
+ do{ \
+ (__HANDLE__).Instance = (__USART_BASE__); \
+ hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
+ } while(0)
+
+/* Variables -----------------------------------------------------------------*/
+#if (CFG_HW_USART1_ENABLED == 1)
+#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
+ DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
+#endif
+ void (*HW_huart1RxCb)(void);
+ void (*HW_huart1TxCb)(void);
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
+ DMA_HandleTypeDef HW_hdma_hlpuart1_tx ={0};
+#endif
+ void (*HW_hlpuart1RxCb)(void);
+ void (*HW_hlpuart1TxCb)(void);
+#endif
+
+void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HW_UART_RX_IT(huart1, USART1);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HW_UART_RX_IT(hlpuart1, LPUART1);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HW_UART_TX_IT(huart1, USART1);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HW_UART_TX_IT(hlpuart1, LPUART1);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
+{
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
+
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HW_UART_TX(huart1, USART1);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HW_UART_TX(hlpuart1, LPUART1);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ switch (hal_status)
+ {
+ case HAL_OK:
+ hw_status = hw_uart_ok;
+ break;
+
+ case HAL_ERROR:
+ hw_status = hw_uart_error;
+ break;
+
+ case HAL_BUSY:
+ hw_status = hw_uart_busy;
+ break;
+
+ case HAL_TIMEOUT:
+ hw_status = hw_uart_to;
+ break;
+
+ default:
+ break;
+ }
+
+ return hw_status;
+}
+
+hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
+
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HW_huart1TxCb = cb;
+ huart1.Instance = USART1;
+ hal_status = HAL_UART_Transmit_DMA(&huart1, p_data, size);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HW_hlpuart1TxCb = cb;
+ hlpuart1.Instance = LPUART1;
+ hal_status = HAL_UART_Transmit_DMA(&hlpuart1, p_data, size);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ switch (hal_status)
+ {
+ case HAL_OK:
+ hw_status = hw_uart_ok;
+ break;
+
+ case HAL_ERROR:
+ hw_status = hw_uart_error;
+ break;
+
+ case HAL_BUSY:
+ hw_status = hw_uart_busy;
+ break;
+
+ case HAL_TIMEOUT:
+ hw_status = hw_uart_to;
+ break;
+
+ default:
+ break;
+ }
+
+ return hw_status;
+}
+
+void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id)
+{
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HAL_UART_IRQHandler(&huart1);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HAL_UART_IRQHandler(&hlpuart1);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
+{
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
+ case hw_uart1:
+ HAL_DMA_IRQHandler(huart1.hdmatx);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
+ case hw_lpuart1:
+ HAL_DMA_IRQHandler(hlpuart1.hdmatx);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
+{
+ switch ((uint32_t)huart->Instance)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case (uint32_t)USART1:
+ if(HW_huart1RxCb)
+ {
+ HW_huart1RxCb();
+ }
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case (uint32_t)LPUART1:
+ if(HW_hlpuart1RxCb)
+ {
+ HW_hlpuart1RxCb();
+ }
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
+{
+ switch ((uint32_t)huart->Instance)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case (uint32_t)USART1:
+ if(HW_huart1TxCb)
+ {
+ HW_huart1TxCb();
+ }
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case (uint32_t)LPUART1:
+ if(HW_hlpuart1TxCb)
+ {
+ HW_hlpuart1TxCb();
+ }
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/main.c
new file mode 100644
index 000000000..d6b19bf43
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/main.c
@@ -0,0 +1,638 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file main.c
+ * @author MCD Application Team
+ * @brief BLE application with BLE core
+ *
+ @verbatim
+ ==============================================================================
+ ##### IMPORTANT NOTE #####
+ ==============================================================================
+
+ This application requests having the stm32wb5x_BLE_Stack_fw.bin binary
+ flashed on the Wireless Coprocessor.
+ If it is not the case, you need to use STM32CubeProgrammer to load the appropriate
+ binary.
+
+ All available binaries are located under following directory:
+ /Projects/STM32_Copro_Wireless_Binaries
+
+ Refer to UM2237 to learn how to use/install STM32CubeProgrammer.
+ Refer to /Projects/STM32_Copro_Wireless_Binaries/ReleaseNote.html for the
+ detailed procedure to change the Wireless Coprocessor binary.
+
+ @endverbatim
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+#include "app_entry.h"
+#include "app_common.h"
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+#include "stm32_lpm.h"
+#include "stm32_seq.h"
+#include "dbg_trace.h"
+#include "hw_conf.h"
+#include "otp.h"
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN PTD */
+
+/* USER CODE END PTD */
+
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN PD */
+
+/* USER CODE END PD */
+
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private variables ---------------------------------------------------------*/
+UART_HandleTypeDef hlpuart1;
+UART_HandleTypeDef huart1;
+DMA_HandleTypeDef hdma_lpuart1_tx;
+DMA_HandleTypeDef hdma_usart1_tx;
+
+RTC_HandleTypeDef hrtc;
+
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+void SystemClock_Config(void);
+static void MX_GPIO_Init(void);
+static void MX_DMA_Init(void);
+void MX_LPUART1_UART_Init(void);
+void MX_USART1_UART_Init(void);
+static void MX_RF_Init(void);
+static void MX_RTC_Init(void);
+/* USER CODE BEGIN PFP */
+void PeriphClock_Config(void);
+static void Reset_Device( void );
+static void Reset_IPCC( void );
+static void Reset_BackupDomain( void );
+static void Init_Exti( void );
+static void Config_HSE(void);
+/* USER CODE END PFP */
+
+/* Private user code ---------------------------------------------------------*/
+/* USER CODE BEGIN 0 */
+
+/* USER CODE END 0 */
+
+/**
+ * @brief The application entry point.
+ * @retval int
+ */
+int main(void)
+{
+ /* USER CODE BEGIN 1 */
+
+ /* USER CODE END 1 */
+
+
+ /* MCU Configuration--------------------------------------------------------*/
+
+ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
+ HAL_Init();
+
+ /* USER CODE BEGIN Init */
+ Reset_Device();
+ Config_HSE();
+ /* USER CODE END Init */
+
+ /* Configure the system clock */
+ SystemClock_Config();
+
+ /* USER CODE BEGIN SysInit */
+ PeriphClock_Config();
+ Init_Exti(); /**< Configure the system Power Mode */
+ /* USER CODE END SysInit */
+
+ /* Initialize all configured peripherals */
+ MX_GPIO_Init();
+ MX_DMA_Init();
+ MX_RF_Init();
+ MX_RTC_Init();
+ /* USER CODE BEGIN 2 */
+
+ /* USER CODE END 2 */
+
+ /* Init code for STM32_WPAN */
+ APPE_Init();
+
+ /* Infinite loop */
+ /* USER CODE BEGIN WHILE */
+ while(1)
+ {
+ UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
+ /* USER CODE END WHILE */
+
+ /* USER CODE BEGIN 3 */
+ }
+ /* USER CODE END 3 */
+}
+
+/**
+ * @brief System Clock Configuration
+ * @retval None
+ */
+void SystemClock_Config(void)
+{
+ RCC_OscInitTypeDef RCC_OscInitStruct = {0};
+ RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
+ RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
+
+ /** Configure LSE Drive Capability
+ */
+ __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
+ /** Configure the main internal regulator output voltage
+ */
+ __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
+ /** Initializes the CPU, AHB and APB busses clocks
+ */
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE
+ |RCC_OSCILLATORTYPE_LSE;
+ RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ RCC_OscInitStruct.LSEState = RCC_LSE_ON;
+ RCC_OscInitStruct.HSIState = RCC_HSI_ON;
+ RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
+ RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
+ if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /** Configure the SYSCLKSource, HCLK, PCLK1 and PCLK2 clocks dividers
+ */
+ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK4|RCC_CLOCKTYPE_HCLK2
+ |RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
+ |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
+ RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSE;
+ RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
+ RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
+ RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
+ RCC_ClkInitStruct.AHBCLK2Divider = RCC_SYSCLK_DIV1;
+ RCC_ClkInitStruct.AHBCLK4Divider = RCC_SYSCLK_DIV1;
+
+ if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /** Initializes the peripherals clocks
+ */
+ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_SMPS|RCC_PERIPHCLK_RFWAKEUP
+ |RCC_PERIPHCLK_RTC|RCC_PERIPHCLK_USART1
+ |RCC_PERIPHCLK_LPUART1|RCC_PERIPHCLK_RNG;
+ PeriphClkInitStruct.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2;
+ PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_LSE;
+ PeriphClkInitStruct.RngClockSelection = RCC_RNGCLKSOURCE_HSI48;
+ PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
+ PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSE;
+ PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSE;
+ PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE0;
+
+ if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
+ {
+ Error_Handler();
+ }
+}
+
+/**
+ * @brief LPUART1 Initialization Function
+ * @param None
+ * @retval None
+ */
+void MX_LPUART1_UART_Init(void)
+{
+
+ /* USER CODE BEGIN LPUART1_Init 0 */
+
+ /* USER CODE END LPUART1_Init 0 */
+
+ /* USER CODE BEGIN LPUART1_Init 1 */
+
+ /* USER CODE END LPUART1_Init 1 */
+ hlpuart1.Instance = LPUART1;
+ hlpuart1.Init.BaudRate = 9600;
+ hlpuart1.Init.WordLength = UART_WORDLENGTH_8B;
+ hlpuart1.Init.StopBits = UART_STOPBITS_1;
+ hlpuart1.Init.Parity = UART_PARITY_NONE;
+ hlpuart1.Init.Mode = UART_MODE_TX_RX;
+ hlpuart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
+ hlpuart1.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
+ hlpuart1.Init.ClockPrescaler = UART_PRESCALER_DIV1;
+ hlpuart1.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
+ hlpuart1.FifoMode = UART_FIFOMODE_DISABLE;
+ if (HAL_UART_Init(&hlpuart1) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_SetTxFifoThreshold(&hlpuart1, UART_TXFIFO_THRESHOLD_1_8) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_SetRxFifoThreshold(&hlpuart1, UART_RXFIFO_THRESHOLD_1_8) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_DisableFifoMode(&hlpuart1) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /* USER CODE BEGIN LPUART1_Init 2 */
+
+ /* Clear WUF flag */
+ /* Wake up MCU from low-power mode on start bit detection */
+ /* Enable Wake Up from Stop Mode Interrupt */
+ WRITE_REG(hlpuart1.Instance->ICR, USART_ICR_WUCF);
+ MODIFY_REG(hlpuart1.Instance->CR3, USART_CR3_WUS, UART_WAKEUP_ON_READDATA_NONEMPTY); /* Wake up on RXNE */
+ SET_BIT(hlpuart1.Instance->CR3, USART_CR3_WUFIE);
+
+ /* Clear OVERRUN flag */
+ WRITE_REG(hlpuart1.Instance->ICR, USART_ICR_ORECF);
+
+ /*Enable UART Stop Mode*/
+ HAL_UARTEx_EnableStopMode(&hlpuart1);
+
+ /* USER CODE END LPUART1_Init 2 */
+
+}
+
+/**
+ * @brief USART1 Initialization Function
+ * @param None
+ * @retval None
+ */
+void MX_USART1_UART_Init(void)
+{
+
+ /* USER CODE BEGIN USART1_Init 0 */
+
+ /* USER CODE END USART1_Init 0 */
+
+ /* USER CODE BEGIN USART1_Init 1 */
+
+ /* USER CODE END USART1_Init 1 */
+ huart1.Instance = USART1;
+ huart1.Init.BaudRate = 115200;
+ huart1.Init.WordLength = UART_WORDLENGTH_8B;
+ huart1.Init.StopBits = UART_STOPBITS_1;
+ huart1.Init.Parity = UART_PARITY_NONE;
+ huart1.Init.Mode = UART_MODE_TX_RX;
+ huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
+ huart1.Init.OverSampling = UART_OVERSAMPLING_8;
+ huart1.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
+ huart1.Init.ClockPrescaler = UART_PRESCALER_DIV1;
+ huart1.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
+ if (HAL_UART_Init(&huart1) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_SetTxFifoThreshold(&huart1, UART_TXFIFO_THRESHOLD_1_8) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_SetRxFifoThreshold(&huart1, UART_RXFIFO_THRESHOLD_1_8) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_DisableFifoMode(&huart1) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /* USER CODE BEGIN USART1_Init 2 */
+
+ /* USER CODE END USART1_Init 2 */
+
+}
+
+/**
+ * @brief RF Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_RF_Init(void)
+{
+
+ /* USER CODE BEGIN RF_Init 0 */
+
+ /* USER CODE END RF_Init 0 */
+
+ /* USER CODE BEGIN RF_Init 1 */
+
+ /* USER CODE END RF_Init 1 */
+ /* USER CODE BEGIN RF_Init 2 */
+
+ /* USER CODE END RF_Init 2 */
+
+}
+
+/**
+ * @brief RTC Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_RTC_Init(void)
+{
+
+ /* USER CODE BEGIN RTC_Init 0 */
+
+ /* USER CODE END RTC_Init 0 */
+
+ /* USER CODE BEGIN RTC_Init 1 */
+
+ /* USER CODE END RTC_Init 1 */
+ /** Initialize RTC Only
+ */
+ hrtc.Instance = RTC;
+ hrtc.Init.HourFormat = RTC_HOURFORMAT_24;
+ hrtc.Init.AsynchPrediv = CFG_RTC_ASYNCH_PRESCALER;
+ hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
+ hrtc.Init.OutPut = RTC_OUTPUT_DISABLE;
+ hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH;
+ hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;
+ if (HAL_RTC_Init(&hrtc) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /* USER CODE BEGIN RTC_Init 2 */
+ /* Disable RTC registers write protection */
+ LL_RTC_DisableWriteProtection(RTC);
+
+ LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER);
+
+ /* Enable RTC registers write protection */
+ LL_RTC_EnableWriteProtection(RTC);
+ /* USER CODE END RTC_Init 2 */
+
+}
+
+/**
+ * Enable DMA controller clock
+ */
+static void MX_DMA_Init(void)
+{
+
+ /* DMA controller clock enable */
+ __HAL_RCC_DMAMUX1_CLK_ENABLE();
+ __HAL_RCC_DMA1_CLK_ENABLE();
+ __HAL_RCC_DMA2_CLK_ENABLE();
+
+ /* DMA interrupt init */
+ /* DMA1_Channel4_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(DMA1_Channel4_IRQn, 15, 0);
+ HAL_NVIC_EnableIRQ(DMA1_Channel4_IRQn);
+ /* DMA2_Channel4_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(DMA2_Channel4_IRQn, 15, 0);
+ HAL_NVIC_EnableIRQ(DMA2_Channel4_IRQn);
+
+}
+
+/**
+ * @brief GPIO Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_GPIO_Init(void)
+{
+
+ /* GPIO Ports Clock Enable */
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+
+}
+
+/* USER CODE BEGIN 4 */
+
+void PeriphClock_Config(void)
+{
+ #if (CFG_USB_INTERFACE_ENABLE != 0)
+ RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
+ RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
+ LL_RCC_HSI48_Enable();
+
+ while(!LL_RCC_HSI48_IsReady());
+
+ /* Select HSI48 as USB clock source */
+ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB;
+ PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_HSI48;
+ HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
+
+ /*Configure the clock recovery system (CRS)**********************************/
+
+ /* Enable CRS Clock */
+ __HAL_RCC_CRS_CLK_ENABLE();
+
+ /* Default Synchro Signal division factor (not divided) */
+ RCC_CRSInitStruct.Prescaler = RCC_CRS_SYNC_DIV1;
+
+ /* Set the SYNCSRC[1:0] bits according to CRS_Source value */
+ RCC_CRSInitStruct.Source = RCC_CRS_SYNC_SOURCE_USB;
+
+ /* HSI48 is synchronized with USB SOF at 1KHz rate */
+ RCC_CRSInitStruct.ReloadValue = RCC_CRS_RELOADVALUE_DEFAULT;
+ RCC_CRSInitStruct.ErrorLimitValue = RCC_CRS_ERRORLIMIT_DEFAULT;
+
+ RCC_CRSInitStruct.Polarity = RCC_CRS_SYNC_POLARITY_RISING;
+
+ /* Set the TRIM[5:0] to the default value*/
+ RCC_CRSInitStruct.HSI48CalibrationValue = RCC_CRS_HSI48CALIBRATION_DEFAULT;
+
+ /* Start automatic synchronization */
+ HAL_RCCEx_CRSConfig(&RCC_CRSInitStruct);
+#endif
+
+ return;
+}
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+
+static void Config_HSE(void)
+{
+ OTP_ID0_t * p_otp;
+
+ /**
+ * Read HSE_Tuning from OTP
+ */
+ p_otp = (OTP_ID0_t *) OTP_Read(0);
+ if (p_otp)
+ {
+ LL_RCC_HSE_SetCapacitorTuning(p_otp->hse_tuning);
+ }
+
+ return;
+}
+
+
+static void Reset_Device( void )
+{
+#if ( CFG_HW_RESET_BY_FW == 1 )
+ Reset_BackupDomain();
+
+ Reset_IPCC();
+#endif
+
+ return;
+}
+
+static void Reset_IPCC( void )
+{
+ LL_AHB3_GRP1_EnableClock(LL_AHB3_GRP1_PERIPH_IPCC);
+
+ LL_C1_IPCC_ClearFlag_CHx(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C2_IPCC_ClearFlag_CHx(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C1_IPCC_DisableTransmitChannel(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C2_IPCC_DisableTransmitChannel(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C1_IPCC_DisableReceiveChannel(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C2_IPCC_DisableReceiveChannel(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ return;
+}
+
+static void Reset_BackupDomain( void )
+{
+ if ((LL_RCC_IsActiveFlag_PINRST() != FALSE) && (LL_RCC_IsActiveFlag_SFTRST() == FALSE))
+ {
+ HAL_PWR_EnableBkUpAccess(); /**< Enable access to the RTC registers */
+
+ /**
+ * Write twice the value to flush the APB-AHB bridge
+ * This bit shall be written in the register before writing the next one
+ */
+ HAL_PWR_EnableBkUpAccess();
+
+ __HAL_RCC_BACKUPRESET_FORCE();
+ __HAL_RCC_BACKUPRESET_RELEASE();
+ }
+
+ return;
+}
+
+static void Init_Exti( void )
+{
+ /**< Disable all wakeup interrupt on CPU1 except LPUART(25), IPCC(36), HSEM(38) */
+ LL_EXTI_DisableIT_0_31( (~0) & (~(LL_EXTI_LINE_25)) );
+ LL_EXTI_DisableIT_32_63( (~0) & (~(LL_EXTI_LINE_36 | LL_EXTI_LINE_38)) );
+
+ return;
+}
+
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+void HAL_Delay(uint32_t Delay)
+{
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
+
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
+}
+/* USER CODE END 4 */
+
+/**
+ * @brief This function is executed in case of error occurrence.
+ * @retval None
+ */
+void Error_Handler(void)
+{
+ /* USER CODE BEGIN Error_Handler_Debug */
+ /* User can add his own implementation to report the HAL error return state */
+
+ /* USER CODE END Error_Handler_Debug */
+}
+
+#ifdef USE_FULL_ASSERT
+/**
+ * @brief Reports the name of the source file and the source line number
+ * where the assert_param error has occurred.
+ * @param file: pointer to the source file name
+ * @param line: assert_param error line source number
+ * @retval None
+ */
+void assert_failed(uint8_t *file, uint32_t line)
+{
+ /* USER CODE BEGIN 6 */
+ /* User can add his own implementation to report the file name and line number,
+ tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
+ /* USER CODE END 6 */
+}
+#endif /* USE_FULL_ASSERT */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/stm32_lpm_if.c
new file mode 100644
index 000000000..f024b61e3
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/stm32_lpm_if.c
@@ -0,0 +1,275 @@
+/* USER CODE BEGIN Header */
+/**
+ ***************************************************************************************
+ * File Name : stm32_lpm_if.c
+ * Description : Low layer function to enter/exit low power modes (stop, sleep).
+ ***************************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "stm32_lpm_if.h"
+#include "stm32_lpm.h"
+#include "app_conf.h"
+/* USER CODE BEGIN include */
+
+/* USER CODE END include */
+
+/* Exported variables --------------------------------------------------------*/
+const struct UTIL_LPM_Driver_s UTIL_PowerDriver =
+{
+ PWR_EnterSleepMode,
+ PWR_ExitSleepMode,
+
+ PWR_EnterStopMode,
+ PWR_ExitStopMode,
+
+ PWR_EnterOffMode,
+ PWR_ExitOffMode,
+};
+
+/* Private function prototypes -----------------------------------------------*/
+static void Switch_On_HSI( void );
+/* USER CODE BEGIN Private_Function_Prototypes */
+
+/* USER CODE END Private_Function_Prototypes */
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN Private_Typedef */
+
+/* USER CODE END Private_Typedef */
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN Private_Define */
+
+/* USER CODE END Private_Define */
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN Private_Macro */
+
+/* USER CODE END Private_Macro */
+/* Private variables ---------------------------------------------------------*/
+/* USER CODE BEGIN Private_Variables */
+
+/* USER CODE END Private_Variables */
+
+/* Functions Definition ------------------------------------------------------*/
+/**
+ * @brief Enters Low Power Off Mode
+ * @param none
+ * @retval none
+ */
+void PWR_EnterOffMode( void )
+{
+/* USER CODE BEGIN PWR_EnterOffMode */
+ /************************************************************************************
+ * ENTER OFF MODE
+ ***********************************************************************************/
+ /*
+ * There is no risk to clear all the WUF here because in the current implementation, this API is called
+ * in critical section. If an interrupt occurs while in that critical section before that point,
+ * the flag is set and will be cleared here but the system will not enter Off Mode
+ * because an interrupt is pending in the NVIC. The ISR will be executed when moving out
+ * of this critical section
+ */
+ LL_PWR_ClearFlag_WU( );
+
+ LL_PWR_SetPowerMode( LL_PWR_MODE_STANDBY );
+
+ LL_LPM_EnableDeepSleep( ); /**< Set SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+#if defined ( __CC_ARM)
+ __force_stores( );
+#endif
+
+ __WFI( );
+/* USER CODE END PWR_EnterOffMode */
+}
+
+/**
+ * @brief Exits Low Power Off Mode
+ * @param none
+ * @retval none
+ */
+void PWR_ExitOffMode( void )
+{
+/* USER CODE BEGIN PWR_ExitOffMode */
+
+/* USER CODE END PWR_ExitOffMode */
+}
+
+/**
+ * @brief Enters Low Power Stop Mode
+ * @note ARM exists the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_EnterStopMode( void )
+{
+/* USER CODE BEGIN PWR_EnterStopMode */
+ /**
+ * This function is called from CRITICAL SECTION
+ */
+ while( LL_HSEM_1StepLock( HSEM, CFG_HW_RCC_SEMID ) );
+
+ if ( ! LL_HSEM_1StepLock( HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID ) )
+ {
+ if( LL_PWR_IsActiveFlag_C2DS( ) )
+ {
+ /* Release ENTRY_STOP_MODE semaphore */
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID, 0 );
+
+ /**
+ * The switch on HSI before entering Stop Mode is required on Cut2.0
+ * It is useless from Cut2.1
+ */
+ Switch_On_HSI( );
+ }
+ }
+ else
+ {
+ /**
+ * The switch on HSI before entering Stop Mode is required on Cut2.0
+ * It is useless from Cut2.1
+ */
+ Switch_On_HSI( );
+ }
+
+ /* Release RCC semaphore */
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_RCC_SEMID, 0 );
+
+ /************************************************************************************
+ * ENTER STOP MODE
+ ***********************************************************************************/
+ LL_PWR_SetPowerMode( LL_PWR_MODE_STOP2 );
+
+ LL_LPM_EnableDeepSleep( ); /**< Set SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+#if defined ( __CC_ARM)
+ __force_stores( );
+#endif
+
+ __WFI();
+/* USER CODE END PWR_EnterStopMode */
+}
+
+/**
+ * @brief Exits Low Power Stop Mode
+ * @note Enable the pll at 32MHz
+ * @param none
+ * @retval none
+ */
+void PWR_ExitStopMode( void )
+{
+/* USER CODE BEGIN PWR_ExitStopMode */
+ /**
+ * This function is called from CRITICAL SECTION
+ */
+
+ /* Release ENTRY_STOP_MODE semaphore */
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID, 0 );
+
+ while( LL_HSEM_1StepLock( HSEM, CFG_HW_RCC_SEMID ) );
+
+ if(LL_RCC_GetSysClkSource( ) == LL_RCC_SYS_CLKSOURCE_STATUS_HSI)
+ {
+ LL_RCC_HSE_Enable( );
+ while(!LL_RCC_HSE_IsReady( ));
+ LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_HSE);
+ while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSE);
+ }
+ else
+ {
+ /**
+ * As long as the current application is fine with HSE as system clock source,
+ * there is nothing to do here
+ */
+ }
+
+ /* Release RCC semaphore */
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_RCC_SEMID, 0 );
+/* USER CODE END PWR_ExitStopMode */
+}
+
+/**
+ * @brief Enters Low Power Sleep Mode
+ * @note ARM exits the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_EnterSleepMode( void )
+{
+/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+#if defined ( __CC_ARM)
+ __force_stores();
+#endif
+
+ __WFI( );
+/* USER CODE END PWR_EnterSleepMode */
+}
+
+/**
+ * @brief Exits Low Power Sleep Mode
+ * @note ARM exits the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_ExitSleepMode( void )
+{
+/* USER CODE BEGIN PWR_ExitSleepMode */
+
+ HAL_ResumeTick();
+
+/* USER CODE END PWR_ExitSleepMode */
+}
+
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+/**
+ * @brief Switch the system clock on HSI
+ * @param none
+ * @retval none
+ */
+static void Switch_On_HSI( void )
+{
+ LL_RCC_HSI_Enable( );
+ while(!LL_RCC_HSI_IsReady( ));
+ LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
+ while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
+}
+
+/* USER CODE BEGIN Private_Functions */
+
+/* USER CODE END Private_Functions */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/stm32wbxx_hal_msp.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/stm32wbxx_hal_msp.c
new file mode 100644
index 000000000..87614ca60
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/stm32wbxx_hal_msp.c
@@ -0,0 +1,318 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : stm32wbxx_hal_msp.c
+ * Description : This file provides code for the MSP Initialization
+ * and de-Initialization codes.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+extern DMA_HandleTypeDef hdma_lpuart1_tx;
+
+extern DMA_HandleTypeDef hdma_usart1_tx;
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN TD */
+
+/* USER CODE END TD */
+
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN Define */
+
+/* USER CODE END Define */
+
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN Macro */
+
+/* USER CODE END Macro */
+
+/* Private variables ---------------------------------------------------------*/
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+/* USER CODE BEGIN PFP */
+
+/* USER CODE END PFP */
+
+/* External functions --------------------------------------------------------*/
+/* USER CODE BEGIN ExternalFunctions */
+
+/* USER CODE END ExternalFunctions */
+
+/* USER CODE BEGIN 0 */
+
+/* USER CODE END 0 */
+/**
+ * Initializes the Global MSP.
+ */
+void HAL_MspInit(void)
+{
+ /* USER CODE BEGIN MspInit 0 */
+
+ /* USER CODE END MspInit 0 */
+
+ __HAL_RCC_HSEM_CLK_ENABLE();
+
+ /* System interrupt init*/
+
+ /* USER CODE BEGIN MspInit 1 */
+
+ /* USER CODE END MspInit 1 */
+}
+
+/**
+* @brief UART MSP Initialization
+* This function configures the hardware resources used in this example
+* @param huart: UART handle pointer
+* @retval None
+*/
+void HAL_UART_MspInit(UART_HandleTypeDef* huart)
+{
+ GPIO_InitTypeDef GPIO_InitStruct = {0};
+ if(huart->Instance==LPUART1)
+ {
+ /* USER CODE BEGIN LPUART1_MspInit 0 */
+
+ /* USER CODE END LPUART1_MspInit 0 */
+ /* Peripheral clock enable */
+ __HAL_RCC_LPUART1_CLK_ENABLE();
+
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ /**LPUART1 GPIO Configuration
+ PA2 ------> LPUART1_TX
+ PA3 ------> LPUART1_RX
+ PA6 ------> LPUART1_CTS
+ */
+ GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_3;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
+ GPIO_InitStruct.Alternate = GPIO_AF8_LPUART1;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+
+ GPIO_InitStruct.Pin = GPIO_PIN_6;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ GPIO_InitStruct.Alternate = GPIO_AF8_LPUART1;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+
+ /* LPUART1 DMA Init */
+ /* LPUART1_TX Init */
+ hdma_lpuart1_tx.Instance = DMA1_Channel4;
+ hdma_lpuart1_tx.Init.Request = DMA_REQUEST_LPUART1_TX;
+ hdma_lpuart1_tx.Init.Direction = DMA_MEMORY_TO_PERIPH;
+ hdma_lpuart1_tx.Init.PeriphInc = DMA_PINC_DISABLE;
+ hdma_lpuart1_tx.Init.MemInc = DMA_MINC_ENABLE;
+ hdma_lpuart1_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
+ hdma_lpuart1_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
+ hdma_lpuart1_tx.Init.Mode = DMA_NORMAL;
+ hdma_lpuart1_tx.Init.Priority = DMA_PRIORITY_LOW;
+ if (HAL_DMA_Init(&hdma_lpuart1_tx) != HAL_OK)
+ {
+ Error_Handler();
+ }
+
+ __HAL_LINKDMA(huart,hdmatx,hdma_lpuart1_tx);
+
+ /* LPUART1 interrupt Init */
+ HAL_NVIC_SetPriority(LPUART1_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(LPUART1_IRQn);
+ /* USER CODE BEGIN LPUART1_MspInit 1 */
+
+ /* USER CODE END LPUART1_MspInit 1 */
+ }
+ else if(huart->Instance==USART1)
+ {
+ /* USER CODE BEGIN USART1_MspInit 0 */
+
+ /* USER CODE END USART1_MspInit 0 */
+ /* Peripheral clock enable */
+ __HAL_RCC_USART1_CLK_ENABLE();
+
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+ /**USART1 GPIO Configuration
+ PA11 ------> USART1_CTS
+ PB6 ------> USART1_TX
+ PB7 ------> USART1_RX
+ */
+ GPIO_InitStruct.Pin = GPIO_PIN_11;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+
+ GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_PULLUP;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
+ GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
+ HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
+
+ /* USART1 DMA Init */
+ /* USART1_TX Init */
+ hdma_usart1_tx.Instance = DMA2_Channel4;
+ hdma_usart1_tx.Init.Request = DMA_REQUEST_USART1_TX;
+ hdma_usart1_tx.Init.Direction = DMA_MEMORY_TO_PERIPH;
+ hdma_usart1_tx.Init.PeriphInc = DMA_PINC_DISABLE;
+ hdma_usart1_tx.Init.MemInc = DMA_MINC_ENABLE;
+ hdma_usart1_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
+ hdma_usart1_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
+ hdma_usart1_tx.Init.Mode = DMA_NORMAL;
+ hdma_usart1_tx.Init.Priority = DMA_PRIORITY_LOW;
+ if (HAL_DMA_Init(&hdma_usart1_tx) != HAL_OK)
+ {
+ Error_Handler();
+ }
+
+ __HAL_LINKDMA(huart,hdmatx,hdma_usart1_tx);
+
+ /* USART1 interrupt Init */
+ HAL_NVIC_SetPriority(USART1_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(USART1_IRQn);
+ /* USER CODE BEGIN USART1_MspInit 1 */
+
+ /* USER CODE END USART1_MspInit 1 */
+ }
+
+}
+
+/**
+* @brief UART MSP De-Initialization
+* This function freeze the hardware resources used in this example
+* @param huart: UART handle pointer
+* @retval None
+*/
+void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
+{
+ if(huart->Instance==LPUART1)
+ {
+ /* USER CODE BEGIN LPUART1_MspDeInit 0 */
+
+ /* USER CODE END LPUART1_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_LPUART1_CLK_DISABLE();
+
+ /**LPUART1 GPIO Configuration
+ PA2 ------> LPUART1_TX
+ PA3 ------> LPUART1_RX
+ PA6 ------> LPUART1_CTS
+ */
+ HAL_GPIO_DeInit(GPIOA, GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_6);
+
+ /* LPUART1 DMA DeInit */
+ HAL_DMA_DeInit(huart->hdmatx);
+
+ /* LPUART1 interrupt DeInit */
+ HAL_NVIC_DisableIRQ(LPUART1_IRQn);
+ /* USER CODE BEGIN LPUART1_MspDeInit 1 */
+
+ /* USER CODE END LPUART1_MspDeInit 1 */
+ }
+ else if(huart->Instance==USART1)
+ {
+ /* USER CODE BEGIN USART1_MspDeInit 0 */
+
+ /* USER CODE END USART1_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_USART1_CLK_DISABLE();
+
+ /**USART1 GPIO Configuration
+ PA11 ------> USART1_CTS
+ PB6 ------> USART1_TX
+ PB7 ------> USART1_RX
+ */
+ HAL_GPIO_DeInit(GPIOA, GPIO_PIN_11);
+
+ HAL_GPIO_DeInit(GPIOB, GPIO_PIN_6|GPIO_PIN_7);
+
+ /* USART1 DMA DeInit */
+ HAL_DMA_DeInit(huart->hdmatx);
+
+ /* USART1 interrupt DeInit */
+ HAL_NVIC_DisableIRQ(USART1_IRQn);
+ /* USER CODE BEGIN USART1_MspDeInit 1 */
+
+ /* USER CODE END USART1_MspDeInit 1 */
+ }
+
+}
+
+/**
+* @brief RTC MSP Initialization
+* This function configures the hardware resources used in this example
+* @param hrtc: RTC handle pointer
+* @retval None
+*/
+void HAL_RTC_MspInit(RTC_HandleTypeDef* hrtc)
+{
+ if(hrtc->Instance==RTC)
+ {
+ /* USER CODE BEGIN RTC_MspInit 0 */
+ HAL_PWR_EnableBkUpAccess(); /**< Enable access to the RTC registers */
+
+ /**
+ * Write twice the value to flush the APB-AHB bridge
+ * This bit shall be written in the register before writing the next one
+ */
+ HAL_PWR_EnableBkUpAccess();
+
+ __HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSE); /**< Select LSI as RTC Input */
+ /* USER CODE END RTC_MspInit 0 */
+ /* Peripheral clock enable */
+ __HAL_RCC_RTC_ENABLE();
+ /* USER CODE BEGIN RTC_MspInit 1 */
+ HAL_RTCEx_EnableBypassShadow(hrtc);
+ /* USER CODE END RTC_MspInit 1 */
+ }
+
+}
+
+/**
+* @brief RTC MSP De-Initialization
+* This function freeze the hardware resources used in this example
+* @param hrtc: RTC handle pointer
+* @retval None
+*/
+void HAL_RTC_MspDeInit(RTC_HandleTypeDef* hrtc)
+{
+ if(hrtc->Instance==RTC)
+ {
+ /* USER CODE BEGIN RTC_MspDeInit 0 */
+
+ /* USER CODE END RTC_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_RTC_DISABLE();
+ /* USER CODE BEGIN RTC_MspDeInit 1 */
+
+ /* USER CODE END RTC_MspDeInit 1 */
+ }
+
+}
+
+/* USER CODE BEGIN 1 */
+
+/* USER CODE END 1 */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/stm32wbxx_it.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/stm32wbxx_it.c
new file mode 100644
index 000000000..cb0b6d47e
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/stm32wbxx_it.c
@@ -0,0 +1,293 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file stm32wbxx_it.c
+ * @author MCD Application Team
+ * @brief Main Interrupt Service Routines.
+ * This file provides template for all exceptions handler and
+ * peripherals interrupt service routine.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+#include "stm32wbxx_it.h"
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN TD */
+
+/* USER CODE END TD */
+
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN PD */
+
+/* USER CODE END PD */
+
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private variables ---------------------------------------------------------*/
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+/* USER CODE BEGIN PFP */
+
+/* USER CODE END PFP */
+
+/* Private user code ---------------------------------------------------------*/
+/* USER CODE BEGIN 0 */
+
+/* USER CODE END 0 */
+
+/* External variables --------------------------------------------------------*/
+extern DMA_HandleTypeDef hdma_lpuart1_tx;
+extern DMA_HandleTypeDef hdma_usart1_tx;
+extern UART_HandleTypeDef hlpuart1;
+extern UART_HandleTypeDef huart1;
+/* USER CODE BEGIN EV */
+
+/* USER CODE END EV */
+
+/******************************************************************************/
+/* Cortex Processor Interruption and Exception Handlers */
+/******************************************************************************/
+/**
+ * @brief This function handles Non maskable interrupt.
+ */
+void NMI_Handler(void)
+{
+ /* USER CODE BEGIN NonMaskableInt_IRQn 0 */
+
+ /* USER CODE END NonMaskableInt_IRQn 0 */
+ /* USER CODE BEGIN NonMaskableInt_IRQn 1 */
+
+ /* USER CODE END NonMaskableInt_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Hard fault interrupt.
+ */
+void HardFault_Handler(void)
+{
+ /* USER CODE BEGIN HardFault_IRQn 0 */
+
+ /* USER CODE END HardFault_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_HardFault_IRQn 0 */
+ /* USER CODE END W1_HardFault_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles Memory management fault.
+ */
+void MemManage_Handler(void)
+{
+ /* USER CODE BEGIN MemoryManagement_IRQn 0 */
+
+ /* USER CODE END MemoryManagement_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */
+ /* USER CODE END W1_MemoryManagement_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles Prefetch fault, memory access fault.
+ */
+void BusFault_Handler(void)
+{
+ /* USER CODE BEGIN BusFault_IRQn 0 */
+
+ /* USER CODE END BusFault_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_BusFault_IRQn 0 */
+ /* USER CODE END W1_BusFault_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles Undefined instruction or illegal state.
+ */
+void UsageFault_Handler(void)
+{
+ /* USER CODE BEGIN UsageFault_IRQn 0 */
+
+ /* USER CODE END UsageFault_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_UsageFault_IRQn 0 */
+ /* USER CODE END W1_UsageFault_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles System service call via SWI instruction.
+ */
+void SVC_Handler(void)
+{
+ /* USER CODE BEGIN SVCall_IRQn 0 */
+
+ /* USER CODE END SVCall_IRQn 0 */
+ /* USER CODE BEGIN SVCall_IRQn 1 */
+
+ /* USER CODE END SVCall_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Debug monitor.
+ */
+void DebugMon_Handler(void)
+{
+ /* USER CODE BEGIN DebugMonitor_IRQn 0 */
+
+ /* USER CODE END DebugMonitor_IRQn 0 */
+ /* USER CODE BEGIN DebugMonitor_IRQn 1 */
+
+ /* USER CODE END DebugMonitor_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Pendable request for system service.
+ */
+void PendSV_Handler(void)
+{
+ /* USER CODE BEGIN PendSV_IRQn 0 */
+
+ /* USER CODE END PendSV_IRQn 0 */
+ /* USER CODE BEGIN PendSV_IRQn 1 */
+
+ /* USER CODE END PendSV_IRQn 1 */
+}
+
+/**
+ * @brief This function handles System tick timer.
+ */
+void SysTick_Handler(void)
+{
+ /* USER CODE BEGIN SysTick_IRQn 0 */
+
+ /* USER CODE END SysTick_IRQn 0 */
+ HAL_IncTick();
+ /* USER CODE BEGIN SysTick_IRQn 1 */
+
+ /* USER CODE END SysTick_IRQn 1 */
+}
+
+/******************************************************************************/
+/* STM32WBxx Peripheral Interrupt Handlers */
+/* Add here the Interrupt Handlers for the used peripherals. */
+/* For the available peripheral interrupt handler names, */
+/* please refer to the startup file (startup_stm32wbxx.s). */
+/******************************************************************************/
+
+/**
+ * @brief This function handles DMA1 channel4 global interrupt.
+ */
+void DMA1_Channel4_IRQHandler(void)
+{
+ /* USER CODE BEGIN DMA1_Channel4_IRQn 0 */
+
+ /* USER CODE END DMA1_Channel4_IRQn 0 */
+ HAL_DMA_IRQHandler(&hdma_lpuart1_tx);
+ /* USER CODE BEGIN DMA1_Channel4_IRQn 1 */
+
+ /* USER CODE END DMA1_Channel4_IRQn 1 */
+}
+
+/**
+ * @brief This function handles USART1 global interrupt.
+ */
+void USART1_IRQHandler(void)
+{
+ /* USER CODE BEGIN USART1_IRQn 0 */
+
+ /* USER CODE END USART1_IRQn 0 */
+ HAL_UART_IRQHandler(&huart1);
+ /* USER CODE BEGIN USART1_IRQn 1 */
+
+ /* USER CODE END USART1_IRQn 1 */
+}
+
+/**
+ * @brief This function handles LPUART1 global interrupt.
+ */
+void LPUART1_IRQHandler(void)
+{
+ /* USER CODE BEGIN LPUART1_IRQn 0 */
+
+ /* USER CODE END LPUART1_IRQn 0 */
+ HAL_UART_IRQHandler(&hlpuart1);
+ /* USER CODE BEGIN LPUART1_IRQn 1 */
+
+ /* USER CODE END LPUART1_IRQn 1 */
+}
+
+/**
+ * @brief This function handles DMA2 channel4 global interrupt.
+ */
+void DMA2_Channel4_IRQHandler(void)
+{
+ /* USER CODE BEGIN DMA2_Channel4_IRQn 0 */
+
+ /* USER CODE END DMA2_Channel4_IRQn 0 */
+ HAL_DMA_IRQHandler(&hdma_usart1_tx);
+ /* USER CODE BEGIN DMA2_Channel4_IRQn 1 */
+
+ /* USER CODE END DMA2_Channel4_IRQn 1 */
+}
+
+/* USER CODE BEGIN 1 */
+/**
+ * @brief This function handles External line
+ * interrupt request.
+ * @param None
+ * @retval None
+ */
+void PUSH_BUTTON_SW1_EXTI_IRQHandler(void)
+{
+ HAL_GPIO_EXTI_IRQHandler(BUTTON_SW1_PIN);
+}
+
+void RTC_WKUP_IRQHandler(void)
+{
+ HW_TS_RTC_Wakeup_Handler();
+}
+
+void IPCC_C1_TX_IRQHandler(void)
+{
+ HW_IPCC_Tx_Handler();
+
+ return;
+}
+
+void IPCC_C1_RX_IRQHandler(void)
+{
+ HW_IPCC_Rx_Handler();
+ return;
+}
+/* USER CODE END 1 */
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/system_stm32wbxx.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/system_stm32wbxx.c
new file mode 100644
index 000000000..d4653a0ce
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/Core/Src/system_stm32wbxx.c
@@ -0,0 +1,353 @@
+/**
+ ******************************************************************************
+ * @file system_stm32wbxx.c
+ * @author MCD Application Team
+ * @brief CMSIS Cortex Device Peripheral Access Layer System Source File
+ *
+ * This file provides two functions and one global variable to be called from
+ * user application:
+ * - SystemInit(): This function is called at startup just after reset and
+ * before branch to main program. This call is made inside
+ * the "startup_stm32wbxx.s" file.
+ *
+ * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used
+ * by the user application to setup the SysTick
+ * timer or configure other parameters.
+ *
+ * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must
+ * be called whenever the core clock is changed
+ * during program execution.
+ *
+ * After each device reset the MSI (4 MHz) is used as system clock source.
+ * Then SystemInit() function is called, in "startup_stm32wbxx.s" file, to
+ * configure the system clock before to branch to main program.
+ *
+ * This file configures the system clock as follows:
+ *=============================================================================
+ *-----------------------------------------------------------------------------
+ * System Clock source | MSI
+ *-----------------------------------------------------------------------------
+ * SYSCLK(Hz) | 4000000
+ *-----------------------------------------------------------------------------
+ * HCLK(Hz) | 4000000
+ *-----------------------------------------------------------------------------
+ * AHB Prescaler | 1
+ *-----------------------------------------------------------------------------
+ * APB1 Prescaler | 1
+ *-----------------------------------------------------------------------------
+ * APB2 Prescaler | 1
+ *-----------------------------------------------------------------------------
+ * PLL_M | 1
+ *-----------------------------------------------------------------------------
+ * PLL_N | 8
+ *-----------------------------------------------------------------------------
+ * PLL_P | 7
+ *-----------------------------------------------------------------------------
+ * PLL_Q | 2
+ *-----------------------------------------------------------------------------
+ * PLL_R | 2
+ *-----------------------------------------------------------------------------
+ * PLLSAI1_P | NA
+ *-----------------------------------------------------------------------------
+ * PLLSAI1_Q | NA
+ *-----------------------------------------------------------------------------
+ * PLLSAI1_R | NA
+ *-----------------------------------------------------------------------------
+ * Require 48MHz for USB OTG FS, | Disabled
+ * SDIO and RNG clock |
+ *-----------------------------------------------------------------------------
+ *=============================================================================
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+
+/** @addtogroup CMSIS
+ * @{
+ */
+
+/** @addtogroup stm32WBxx_system
+ * @{
+ */
+
+/** @addtogroup stm32WBxx_System_Private_Includes
+ * @{
+ */
+
+#include "stm32wbxx.h"
+
+#if !defined (HSE_VALUE)
+ #define HSE_VALUE (32000000UL) /*!< Value of the External oscillator in Hz */
+#endif /* HSE_VALUE */
+
+#if !defined (MSI_VALUE)
+ #define MSI_VALUE (4000000UL) /*!< Value of the Internal oscillator in Hz*/
+#endif /* MSI_VALUE */
+
+#if !defined (HSI_VALUE)
+ #define HSI_VALUE (16000000UL) /*!< Value of the Internal oscillator in Hz*/
+#endif /* HSI_VALUE */
+
+#if !defined (LSI_VALUE)
+ #define LSI_VALUE (32000UL) /*!< Value of LSI in Hz*/
+#endif /* LSI_VALUE */
+
+#if !defined (LSE_VALUE)
+ #define LSE_VALUE (32768UL) /*!< Value of LSE in Hz*/
+#endif /* LSE_VALUE */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_TypesDefinitions
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_Defines
+ * @{
+ */
+
+/*!< Uncomment the following line if you need to relocate your vector Table in
+ Internal SRAM. */
+/* #define VECT_TAB_SRAM */
+#define VECT_TAB_OFFSET 0x0U /*!< Vector Table base offset field.
+ This value must be a multiple of 0x200. */
+
+#define VECT_TAB_BASE_ADDRESS SRAM1_BASE /*!< Vector Table base offset field.
+ This value must be a multiple of 0x200. */
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_Macros
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_Variables
+ * @{
+ */
+ /* The SystemCoreClock variable is updated in three ways:
+ 1) by calling CMSIS function SystemCoreClockUpdate()
+ 2) by calling HAL API function HAL_RCC_GetHCLKFreq()
+ 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
+ Note: If you use this function to configure the system clock; then there
+ is no need to call the 2 first functions listed above, since SystemCoreClock
+ variable is updated automatically.
+ */
+ uint32_t SystemCoreClock = 4000000UL ; /*CPU1: M4 on MSI clock after startup (4MHz)*/
+
+ const uint32_t AHBPrescTable[16UL] = {1UL, 3UL, 5UL, 1UL, 1UL, 6UL, 10UL, 32UL, 2UL, 4UL, 8UL, 16UL, 64UL, 128UL, 256UL, 512UL};
+
+ const uint32_t APBPrescTable[8UL] = {0UL, 0UL, 0UL, 0UL, 1UL, 2UL, 3UL, 4UL};
+
+ const uint32_t MSIRangeTable[16UL] = {100000UL, 200000UL, 400000UL, 800000UL, 1000000UL, 2000000UL, \
+ 4000000UL, 8000000UL, 16000000UL, 24000000UL, 32000000UL, 48000000UL, 0UL, 0UL, 0UL, 0UL}; /* 0UL values are incorrect cases */
+
+ const uint32_t SmpsPrescalerTable[4UL][6UL]={{1UL,3UL,2UL,2UL,1UL,2UL}, \
+ {2UL,6UL,4UL,3UL,2UL,4UL}, \
+ {4UL,12UL,8UL,6UL,4UL,8UL}, \
+ {4UL,12UL,8UL,6UL,4UL,8UL}};
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_FunctionPrototypes
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_Functions
+ * @{
+ */
+
+/**
+ * @brief Setup the microcontroller system.
+ * @param None
+ * @retval None
+ */
+void SystemInit(void)
+{
+ /* Configure the Vector Table location add offset address ------------------*/
+#if defined(VECT_TAB_SRAM) && defined(VECT_TAB_BASE_ADDRESS)
+ /* program in SRAMx */
+ SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAMx for CPU1 */
+#else /* program in FLASH */
+ SCB->VTOR = VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
+#endif
+
+ /* FPU settings ------------------------------------------------------------*/
+ #if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
+ SCB->CPACR |= ((3UL << (10UL*2UL))|(3UL << (11UL*2UL))); /* set CP10 and CP11 Full Access */
+ #endif
+
+ /* Reset the RCC clock configuration to the default reset state ------------*/
+ /* Set MSION bit */
+ RCC->CR |= RCC_CR_MSION;
+
+ /* Reset CFGR register */
+ RCC->CFGR = 0x00070000U;
+
+ /* Reset PLLSAI1ON, PLLON, HSECSSON, HSEON, HSION, and MSIPLLON bits */
+ RCC->CR &= (uint32_t)0xFAF6FEFBU;
+
+ /*!< Reset LSI1 and LSI2 bits */
+ RCC->CSR &= (uint32_t)0xFFFFFFFAU;
+
+ /*!< Reset HSI48ON bit */
+ RCC->CRRCR &= (uint32_t)0xFFFFFFFEU;
+
+ /* Reset PLLCFGR register */
+ RCC->PLLCFGR = 0x22041000U;
+
+ /* Reset PLLSAI1CFGR register */
+ RCC->PLLSAI1CFGR = 0x22041000U;
+
+ /* Reset HSEBYP bit */
+ RCC->CR &= 0xFFFBFFFFU;
+
+ /* Disable all interrupts */
+ RCC->CIER = 0x00000000;
+}
+
+/**
+ * @brief Update SystemCoreClock variable according to Clock Register Values.
+ * The SystemCoreClock variable contains the core clock (HCLK), it can
+ * be used by the user application to setup the SysTick timer or configure
+ * other parameters.
+ *
+ * @note Each time the core clock (HCLK) changes, this function must be called
+ * to update SystemCoreClock variable value. Otherwise, any configuration
+ * based on this variable will be incorrect.
+ *
+ * @note - The system frequency computed by this function is not the real
+ * frequency in the chip. It is calculated based on the predefined
+ * constant and the selected clock source:
+ *
+ * - If SYSCLK source is MSI, SystemCoreClock will contain the MSI_VALUE(*)
+ *
+ * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(**)
+ *
+ * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(***)
+ *
+ * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(***)
+ * or HSI_VALUE(*) or MSI_VALUE(*) multiplied/divided by the PLL factors.
+ *
+ * (*) MSI_VALUE is a constant defined in stm32wbxx_hal.h file (default value
+ * 4 MHz) but the real value may vary depending on the variations
+ * in voltage and temperature.
+ *
+ * (**) HSI_VALUE is a constant defined in stm32wbxx_hal_conf.h file (default value
+ * 16 MHz) but the real value may vary depending on the variations
+ * in voltage and temperature.
+ *
+ * (***) HSE_VALUE is a constant defined in stm32wbxx_hal_conf.h file (default value
+ * 32 MHz), user has to ensure that HSE_VALUE is same as the real
+ * frequency of the crystal used. Otherwise, this function may
+ * have wrong result.
+ *
+ * - The result of this function could be not correct when using fractional
+ * value for HSE crystal.
+ *
+ * @param None
+ * @retval None
+ */
+void SystemCoreClockUpdate(void)
+{
+ uint32_t tmp, msirange, pllvco, pllr, pllsource , pllm;
+
+ /* Get MSI Range frequency--------------------------------------------------*/
+
+ /*MSI frequency range in Hz*/
+ msirange = MSIRangeTable[(RCC->CR & RCC_CR_MSIRANGE) >> RCC_CR_MSIRANGE_Pos];
+
+ /* Get SYSCLK source -------------------------------------------------------*/
+ switch (RCC->CFGR & RCC_CFGR_SWS)
+ {
+ case 0x00: /* MSI used as system clock source */
+ SystemCoreClock = msirange;
+ break;
+
+ case 0x04: /* HSI used as system clock source */
+ /* HSI used as system clock source */
+ SystemCoreClock = HSI_VALUE;
+ break;
+
+ case 0x08: /* HSE used as system clock source */
+ SystemCoreClock = HSE_VALUE;
+ break;
+
+ case 0x0C: /* PLL used as system clock source */
+ /* PLL_VCO = (HSE_VALUE or HSI_VALUE or MSI_VALUE/ PLLM) * PLLN
+ SYSCLK = PLL_VCO / PLLR
+ */
+ pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC);
+ pllm = ((RCC->PLLCFGR & RCC_PLLCFGR_PLLM) >> RCC_PLLCFGR_PLLM_Pos) + 1UL ;
+
+ if(pllsource == 0x02UL) /* HSI used as PLL clock source */
+ {
+ pllvco = (HSI_VALUE / pllm);
+ }
+ else if(pllsource == 0x03UL) /* HSE used as PLL clock source */
+ {
+ pllvco = (HSE_VALUE / pllm);
+ }
+ else /* MSI used as PLL clock source */
+ {
+ pllvco = (msirange / pllm);
+ }
+
+ pllvco = pllvco * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> RCC_PLLCFGR_PLLN_Pos);
+ pllr = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLR) >> RCC_PLLCFGR_PLLR_Pos) + 1UL);
+
+ SystemCoreClock = pllvco/pllr;
+ break;
+
+ default:
+ SystemCoreClock = msirange;
+ break;
+ }
+
+ /* Compute HCLK clock frequency --------------------------------------------*/
+ /* Get HCLK1 prescaler */
+ tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> RCC_CFGR_HPRE_Pos)];
+ /* HCLK clock frequency */
+ SystemCoreClock = SystemCoreClock / tmp;
+
+}
+
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/EWARM/ble_multi_app_at.ewd b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/EWARM/ble_multi_app_at.ewd
new file mode 100644
index 000000000..5b75a501b
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/EWARM/ble_multi_app_at.ewd
@@ -0,0 +1,1419 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <fileVersion>3</fileVersion>
+ <configuration>
+ <name>ble_multi_app_at</name>
+ <toolchain>
+ <name>ARM</name>
+ </toolchain>
+ <debug>1</debug>
+ <settings>
+ <name>C-SPY</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>29</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CInput</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CEndian</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCVariant</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>MemOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MemFile</name>
+ <state>$TOOLKIT_DIR$\CONFIG\debugger\ST\STM32WB_M4.ddf</state>
+ </option>
+ <option>
+ <name>RunToEnable</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RunToName</name>
+ <state>main</state>
+ </option>
+ <option>
+ <name>CExtraOptionsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CExtraOptions</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CFpuProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCDDFArgumentProducer</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCDownloadSuppressDownload</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCDownloadVerifyAll</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCProductVersion</name>
+ <state>8.20.2.14834</state>
+ </option>
+ <option>
+ <name>OCDynDriverList</name>
+ <state>STLINK_ID</state>
+ </option>
+ <option>
+ <name>OCLastSavedByProductVersion</name>
+ <state>8.20.2.14834</state>
+ </option>
+ <option>
+ <name>UseFlashLoader</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CLowLevel</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCBE8Slave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>MacFile2</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CDevice</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>FlashLoadersV3</name>
+ <state>$TOOLKIT_DIR$\config\flashloader\ST\FlashSTM32WB_M4.board</state>
+ </option>
+ <option>
+ <name>OCImagesSuppressCheck1</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesPath1</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCImagesSuppressCheck2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesPath2</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCImagesSuppressCheck3</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesPath3</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OverrideDefFlashBoard</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesOffset1</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCImagesOffset2</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCImagesOffset3</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCImagesUse1</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesUse2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesUse3</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCDeviceConfigMacroFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCDebuggerExtraOption</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCAllMTBOptions</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCMulticoreNrOfCores</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCMulticoreMaster</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCMulticorePort</name>
+ <state>53461</state>
+ </option>
+ <option>
+ <name>OCMulticoreWorkspace</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCMulticoreSlaveProject</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCMulticoreSlaveConfiguration</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCDownloadExtraImage</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCAttachSlave</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MassEraseBeforeFlashing</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>ARMSIM_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>1</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCSimDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCSimEnablePSP</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCSimPspOverrideConfig</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCSimPspConfigFile</name>
+ <state></state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>CADI_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CCadiMemory</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>Fast Model</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCADILogFileCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCADILogFileEditB</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>CMSISDAP_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>4</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCIarProbeScriptFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CMSISDAPResetList</name>
+ <version>1</version>
+ <state>10</state>
+ </option>
+ <option>
+ <name>CMSISDAPHWResetDuration</name>
+ <state>300</state>
+ </option>
+ <option>
+ <name>CMSISDAPHWResetDelay</name>
+ <state>200</state>
+ </option>
+ <option>
+ <name>CMSISDAPDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CMSISDAPInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPMultiTargetEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPMultiTarget</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPJtagSpeedList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPBreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPRestoreBreakpointsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPUpdateBreakpointsEdit</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>RDICatchReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchUndef</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchSWI</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchData</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchPrefetch</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchIRQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchFIQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CatchMMERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchNOCPERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchCHKERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchSTATERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchBUSERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchINTERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchSFERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchHARDERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPMultiCPUEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPMultiCPUNumber</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCProbeCfgOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCProbeConfig</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CMSISDAPProbeConfigRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPSelectedCPUBehaviour</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ICpuName</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCJetEmuParams</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCCMSISDAPUsbSerialNo</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCCMSISDAPUsbSerialNoSelect</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>GDBSERVER_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>TCPIP</name>
+ <state>aaa.bbb.ccc.ddd</state>
+ </option>
+ <option>
+ <name>DoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>LogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCJTagBreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJTagDoUpdateBreakpoints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJTagUpdateBreakpoints</name>
+ <state>_call_main</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>IJET_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>8</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCIarProbeScriptFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IjetResetList</name>
+ <version>1</version>
+ <state>10</state>
+ </option>
+ <option>
+ <name>IjetHWResetDuration</name>
+ <state>300</state>
+ </option>
+ <option>
+ <name>IjetHWResetDelay</name>
+ <state>200</state>
+ </option>
+ <option>
+ <name>IjetPowerFromProbe</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IjetPowerRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>IjetInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetMultiTargetEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetMultiTarget</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetScanChainNonARMDevices</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetIRLength</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetJtagSpeedList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetProtocolRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetSwoPin</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetCpuClockEdit</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IjetSwoPrescalerList</name>
+ <version>1</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetBreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetRestoreBreakpointsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetUpdateBreakpointsEdit</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>RDICatchReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchUndef</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchSWI</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchData</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchPrefetch</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchIRQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchFIQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CatchMMERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchNOCPERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchCHKERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchSTATERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchBUSERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchINTERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchSFERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchHARDERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCProbeCfgOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCProbeConfig</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IjetProbeConfigRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetMultiCPUEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetMultiCPUNumber</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetSelectedCPUBehaviour</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ICpuName</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCJetEmuParams</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IjetPreferETB</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IjetTraceSettingsList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetTraceSizeList</name>
+ <version>0</version>
+ <state>4</state>
+ </option>
+ <option>
+ <name>FlashBoardPathSlave</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCIjetUsbSerialNo</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCIjetUsbSerialNoSelect</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>JLINK_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>16</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>JLinkSpeed</name>
+ <state>1000</state>
+ </option>
+ <option>
+ <name>CCJLinkDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCJLinkHWResetDelay</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>JLinkInitialSpeed</name>
+ <state>1000</state>
+ </option>
+ <option>
+ <name>CCDoJlinkMultiTarget</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCScanChainNonARMDevices</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkMultiTarget</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkIRLength</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkCommRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkTCPIP</name>
+ <state>aaa.bbb.ccc.ddd</state>
+ </option>
+ <option>
+ <name>CCJLinkSpeedRadioV2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCUSBDevice</name>
+ <version>1</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCRDICatchReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchUndef</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchSWI</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchData</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchPrefetch</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchIRQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchFIQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkBreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkDoUpdateBreakpoints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkUpdateBreakpoints</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>CCJLinkInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkResetList</name>
+ <version>6</version>
+ <state>5</state>
+ </option>
+ <option>
+ <name>CCJLinkInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchMMERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchNOCPERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchCHRERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchSTATERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchBUSERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchINTERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchSFERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchHARDERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCJLinkScriptFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCJLinkUsbSerialNo</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCTcpIpAlt</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkTcpIpSerialNo</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCCpuClockEdit</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCSwoClockAuto</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSwoClockEdit</name>
+ <state>2000</state>
+ </option>
+ <option>
+ <name>OCJLinkTraceSource</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCJLinkTraceSourceDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCJLinkDeviceName</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>LMIFTDI_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>2</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>LmiftdiSpeed</name>
+ <state>500</state>
+ </option>
+ <option>
+ <name>CCLmiftdiDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCLmiftdiLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCLmiFtdiInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCLmiFtdiInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>PEMICRO_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>3</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCJPEMicroShowSettings</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>DoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>LogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>STLINK_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>4</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCSTLinkInterfaceRadio</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCSTLinkInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkResetList</name>
+ <version>3</version>
+ <state>4</state>
+ </option>
+ <option>
+ <name>CCCpuClockEdit</name>
+ <state>32.0</state>
+ </option>
+ <option>
+ <name>CCSwoClockAuto</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSwoClockEdit</name>
+ <state>2000</state>
+ </option>
+ <option>
+ <name>DoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>LogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCSTLinkDoUpdateBreakpoints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkUpdateBreakpoints</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchMMERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchNOCPERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchCHRERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchSTATERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchBUSERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchINTERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchSFERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchHARDERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkUsbSerialNo</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCSTLinkUsbSerialNoSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkJtagSpeedList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkDAPNumber</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCSTLinkDebugAccessPortRadio</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>THIRDPARTY_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CThirdPartyDriverDll</name>
+ <state>###Uninitialized###</state>
+ </option>
+ <option>
+ <name>CThirdPartyLogFileCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CThirdPartyLogFileEditB</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>TIFET_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>1</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCMSPFetResetList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetTargetVccTypeDefault</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetTargetVoltage</name>
+ <state>###Uninitialized###</state>
+ </option>
+ <option>
+ <name>CCMSPFetVCCDefault</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCMSPFetTargetSettlingtime</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetRadioJtagSpeedType</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCMSPFetConnection</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetUsbComPort</name>
+ <state>Automatic</state>
+ </option>
+ <option>
+ <name>CCMSPFetAllowAccessToBSL</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCMSPFetRadioEraseFlash</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>XDS100_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>6</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>TIPackageOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>TIPackage</name>
+ <state></state>
+ </option>
+ <option>
+ <name>BoardFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>DoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>LogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCXds100BreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100DoUpdateBreakpoints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100UpdateBreakpoints</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>CCXds100CatchReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchUndef</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchSWI</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchData</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchPrefetch</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchIRQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchFIQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchMMERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchNOCPERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchCHRERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchSTATERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchBUSERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchINTERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchSFERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchHARDERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CpuClockEdit</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCXds100SwoClockAuto</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100SwoClockEdit</name>
+ <state>1000</state>
+ </option>
+ <option>
+ <name>CCXds100HWResetDelay</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100ResetList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100UsbSerialNo</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCXds100UsbSerialNoSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100JtagSpeedList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100InterfaceRadio</name>
+ <state>2</state>
+ </option>
+ <option>
+ <name>CCXds100InterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100ProbeList</name>
+ <version>0</version>
+ <state>2</state>
+ </option>
+ <option>
+ <name>CCXds100SWOPortRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100SWOPort</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <debuggerPlugins>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\Mbed\MbedArmPlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin</file>
+ <loadFlag>1</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\TargetAccessServer\TargetAccessServer.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ </debuggerPlugins>
+ </configuration>
+</project>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/EWARM/ble_multi_app_at.ewp b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/EWARM/ble_multi_app_at.ewp
new file mode 100644
index 000000000..9bf377b88
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/EWARM/ble_multi_app_at.ewp
@@ -0,0 +1,1280 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <fileVersion>3</fileVersion>
+ <configuration>
+ <name>ble_multi_app_at</name>
+ <toolchain>
+ <name>ARM</name>
+ </toolchain>
+ <debug>1</debug>
+ <settings>
+ <name>General</name>
+ <archiveVersion>3</archiveVersion>
+ <data>
+ <version>30</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>ExePath</name>
+ <state>ble_multi_app_at/Exe</state>
+ </option>
+ <option>
+ <name>ObjPath</name>
+ <state>ble_multi_app_at/Obj</state>
+ </option>
+ <option>
+ <name>ListPath</name>
+ <state>ble_multi_app_at/List</state>
+ </option>
+ <option>
+ <name>GEndianMode</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>Input description</name>
+ <state>Full formatting, with multibyte support.</state>
+ </option>
+ <option>
+ <name>Output description</name>
+ <state>Full formatting, with multibyte support.</state>
+ </option>
+ <option>
+ <name>GOutputBinary</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGCoreOrChip</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>GRuntimeLibSelect</name>
+ <version>0</version>
+ <state>2</state>
+ </option>
+ <option>
+ <name>GRuntimeLibSelectSlave</name>
+ <version>0</version>
+ <state>2</state>
+ </option>
+ <option>
+ <name>RTDescription</name>
+ <state>Use the full configuration of the C/C++ runtime library. Full locale interface, C locale, file descriptor support, multibytes in printf and scanf, and hex floats in strtod.</state>
+ </option>
+ <option>
+ <name>OGProductVersion</name>
+ <state>4.41A</state>
+ </option>
+ <option>
+ <name>OGLastSavedByProductVersion</name>
+ <state>8.20.2.14834</state>
+ </option>
+ <option>
+ <name>GeneralEnableMisra</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GeneralMisraVerbose</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGChipSelectEditMenu</name>
+ <state>STM32WB55RG ST STM32WB55RG</state>
+ </option>
+ <option>
+ <name>GenLowLevelInterface</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>GEndianModeBE</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OGBufferedTerminalOutput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GenStdoutInterface</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GeneralMisraRules98</name>
+ <version>0</version>
+ <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
+ </option>
+ <option>
+ <name>GeneralMisraVer</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GeneralMisraRules04</name>
+ <version>0</version>
+ <state>011111111111111110111111111111011111111111111011110100111111111111111111111111111111111111111111101111111111111011111111111111111111111111111</state>
+ </option>
+ <option>
+ <name>RTConfigPath2</name>
+ <state>$TOOLKIT_DIR$\INC\c\DLib_Config_Full.h</state>
+ </option>
+ <option>
+ <name>GBECoreSlave</name>
+ <version>26</version>
+ <state>39</state>
+ </option>
+ <option>
+ <name>OGUseCmsis</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGUseCmsisDspLib</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GRuntimeLibThreads</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CoreVariant</name>
+ <version>26</version>
+ <state>39</state>
+ </option>
+ <option>
+ <name>GFPUDeviceSlave</name>
+ <state>STM32WB55RG ST STM32WB55RG</state>
+ </option>
+ <option>
+ <name>FPU2</name>
+ <version>0</version>
+ <state>4</state>
+ </option>
+ <option>
+ <name>NrRegs</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>NEON</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GFPUCoreSlave2</name>
+ <version>26</version>
+ <state>39</state>
+ </option>
+ <option>
+ <name>OGCMSISPackSelectDevice</name>
+ </option>
+ <option>
+ <name>OgLibHeap</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGLibAdditionalLocale</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGPrintfVariant</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OGPrintfMultibyteSupport</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OGScanfVariant</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OGScanfMultibyteSupport</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>GenLocaleTags</name>
+ <state></state>
+ </option>
+ <option>
+ <name>GenLocaleDisplayOnly</name>
+ <state></state>
+ </option>
+ <option>
+ <name>DSPExtension</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>TrustZone</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>ICCARM</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>34</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CCOptimizationNoSizeConstraints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCDefines</name>
+ <state>USE_STM32WBXX_NUCLEO</state>
+ <state>USE_HAL_DRIVER</state>
+ <state>STM32WB55xx</state>
+ </option>
+ <option>
+ <name>CCPreprocFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPreprocComments</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPreprocLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListCFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListCMnemonics</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListCMessages</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListAssFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListAssSource</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCEnableRemarks</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCDiagSuppress</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCDiagRemark</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCDiagWarning</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCDiagError</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCObjPrefix</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCAllowList</name>
+ <version>1</version>
+ <state>11111110</state>
+ </option>
+ <option>
+ <name>CCDebugInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IEndianMode</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IExtraOptionsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IExtraOptions</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCLangConformance</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSignedPlainChar</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCRequirePrototypes</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCDiagWarnAreErr</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCompilerRuntimeInfo</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IFpuProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OutputFile</name>
+ <state>$FILE_BNAME$.o</state>
+ </option>
+ <option>
+ <name>CCLibConfigHeader</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>PreInclude</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CompilerMisraOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCIncludePath2</name>
+ <state>$PROJ_DIR$/../Core/Inc</state>
+ <state>$PROJ_DIR$/../STM32_WPAN/App</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/STM32WBxx_HAL_Driver/Inc</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/STM32WBxx_HAL_Driver/Inc/Legacy</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/utilities</state>
+ <state>$PROJ_DIR$/../../../../../../Utilities/lpm/tiny_lpm</state>
+ <state>$PROJ_DIR$/../../../../../../Utilities/sequencer</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/ble</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/ble/core/template</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/ble/core</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/CMSIS/Device/ST/STM32WBxx/Include</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/CMSIS/Include</state>
+ <state>$PROJ_DIR$\..\..\..\..\..\..\Drivers\BSP\P-NUCLEO-WB55.Nucleo</state>
+ <state>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\lhci</state>
+ <state>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\svc\Src</state>
+ <state>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\svc\Inc</state>
+ </option>
+ <option>
+ <name>CCStdIncCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCodeSection</name>
+ <state>.text</state>
+ </option>
+ <option>
+ <name>IProcessorMode2</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCOptLevel</name>
+ <state>3</state>
+ </option>
+ <option>
+ <name>CCOptStrategy</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCOptLevelSlave</name>
+ <state>3</state>
+ </option>
+ <option>
+ <name>CompilerMisraRules98</name>
+ <version>0</version>
+ <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
+ </option>
+ <option>
+ <name>CompilerMisraRules04</name>
+ <version>0</version>
+ <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
+ </option>
+ <option>
+ <name>CCPosIndRopi</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPosIndRwpi</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPosIndNoDynInit</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccLang</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccCDialect</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IccAllowVLA</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccStaticDestr</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccCppInlineSemantics</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccCmsis</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IccFloatSemantics</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCNoLiteralPool</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCOptStrategySlave</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCGuardCalls</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCEncSource</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCEncOutput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCEncOutputBom</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCEncInput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccExceptions2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccRTTI2</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>AARM</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>10</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>AObjPrefix</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AEndian</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>ACaseSensitivity</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>MacroChars</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AWarnEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AWarnWhat</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AWarnOne</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AWarnRange1</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AWarnRange2</name>
+ <state></state>
+ </option>
+ <option>
+ <name>ADebug</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AltRegisterNames</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ADefines</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AList</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AListHeader</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AListing</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>Includes</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacDefs</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacExps</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>MacExec</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OnlyAssed</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MultiLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>PageLengthCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>PageLength</name>
+ <state>80</state>
+ </option>
+ <option>
+ <name>TabSpacing</name>
+ <state>8</state>
+ </option>
+ <option>
+ <name>AXRef</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AXRefDefines</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AXRefInternal</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AXRefDual</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AFpuProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AOutputFile</name>
+ <state>$FILE_BNAME$.o</state>
+ </option>
+ <option>
+ <name>ALimitErrorsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ALimitErrorsEdit</name>
+ <state>100</state>
+ </option>
+ <option>
+ <name>AIgnoreStdInclude</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AUserIncludes</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AExtraOptionsCheckV2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AExtraOptionsV2</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AsmNoLiteralPool</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>OBJCOPY</name>
+ <archiveVersion>0</archiveVersion>
+ <data>
+ <version>1</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OOCOutputFormat</name>
+ <version>3</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCOutputOverride</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OOCOutputFile</name>
+ <state>ble_multi_app_at.hex</state>
+ </option>
+ <option>
+ <name>OOCCommandLineProducer</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OOCObjCopyEnable</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>CUSTOM</name>
+ <archiveVersion>3</archiveVersion>
+ <data>
+ <extensions></extensions>
+ <cmdline></cmdline>
+ <hasPrio>0</hasPrio>
+ </data>
+ </settings>
+ <settings>
+ <name>BICOMP</name>
+ <archiveVersion>0</archiveVersion>
+ <data />
+ </settings>
+ <settings>
+ <name>BUILDACTION</name>
+ <archiveVersion>1</archiveVersion>
+ <data>
+ <prebuild></prebuild>
+ <postbuild></postbuild>
+ </data>
+ </settings>
+ <settings>
+ <name>ILINK</name>
+ <archiveVersion>0</archiveVersion>
+ <data>
+ <version>20</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>IlinkLibIOConfig</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>XLinkMisraHandler</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkInputFileSlave</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkOutputFile</name>
+ <state>ble_multi_app_at.out</state>
+ </option>
+ <option>
+ <name>IlinkDebugInfoEnable</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkKeepSymbols</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinaryFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinarySymbol</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinarySegment</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinaryAlign</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkDefines</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkConfigDefines</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkMapFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkLogFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogInitialization</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogModule</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogSection</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogVeneer</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkIcfOverride</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkIcfFile</name>
+ <state>$PROJ_DIR$\stm32wb55xx_flash_cm4.icf</state>
+ </option>
+ <option>
+ <name>IlinkIcfFileSlave</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkEnableRemarks</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkSuppressDiags</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkTreatAsRem</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkTreatAsWarn</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkTreatAsErr</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkWarningsAreErrors</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkUseExtraOptions</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkExtraOptions</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkLowLevelInterfaceSlave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkAutoLibEnable</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkAdditionalLibs</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkOverrideProgramEntryLabel</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkProgramEntryLabelSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkProgramEntryLabel</name>
+ <state>__iar_program_start</state>
+ </option>
+ <option>
+ <name>DoFill</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>FillerByte</name>
+ <state>0xFF</state>
+ </option>
+ <option>
+ <name>FillerStart</name>
+ <state>0x0</state>
+ </option>
+ <option>
+ <name>FillerEnd</name>
+ <state>0x0</state>
+ </option>
+ <option>
+ <name>CrcSize</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcAlign</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcPoly</name>
+ <state>0x11021</state>
+ </option>
+ <option>
+ <name>CrcCompl</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CrcBitOrder</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CrcInitialValue</name>
+ <state>0x0</state>
+ </option>
+ <option>
+ <name>DoCrc</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkBE8Slave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkBufferedTerminalOutput</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkStdoutInterfaceSlave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcFullSize</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkIElfToolPostProcess</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogAutoLibSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogRedirSymbols</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogUnusedFragments</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkCrcReverseByteOrder</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkCrcUseAsInput</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptInline</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkOptExceptionsAllow</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptExceptionsForce</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkCmsis</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptMergeDuplSections</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkOptUseVfe</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptForceVfe</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkStackAnalysisEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkStackControlFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkStackCallGraphFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CrcAlgorithm</name>
+ <version>1</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcUnitSize</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkThreadsSlave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkLogCallGraph</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkIcfFile_AltDefault</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkEncInput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkEncOutput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkEncOutputBom</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkHeapSelect</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkLocaleSelect</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>IARCHIVE</name>
+ <archiveVersion>0</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>IarchiveInputs</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IarchiveOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IarchiveOutput</name>
+ <state>###Unitialized###</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>BILINK</name>
+ <archiveVersion>0</archiveVersion>
+ <data />
+ </settings>
+ </configuration>
+ <group>
+ <name>Application</name>
+ <group>
+ <name>EWARM</name>
+ <file>
+ <name>$PROJ_DIR$\startup_stm32wb55xx_cm4.s</name>
+ </file>
+ </group>
+ <group>
+ <name>User</name>
+ <group>
+ <name>Core</name>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\app_entry.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\hw_timerserver.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\hw_uart.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\main.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\stm32_lpm_if.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\stm32wbxx_hal_msp.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\stm32wbxx_it.c</name>
+ </file>
+ </group>
+ <group>
+ <name>STM32_WPAN</name>
+ <group>
+ <name>App</name>
+ <file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\App\app_ble_cl.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\App\app_ble_common.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\App\app_ble_hr.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\App\app_ble_sv.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\App\dis_app.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\App\hrs_app.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\App\p2p_client_app.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\App\p2p_server_app.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\App\uart_app.c</name>
+ </file>
+ </group>
+ <group>
+ <name>Target</name>
+ <file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\Target\hw_ipcc.c</name>
+ </file>
+ </group>
+ </group>
+ </group>
+ </group>
+ <group>
+ <name>Doc</name>
+ <file>
+ <name>$PROJ_DIR$\..\readme.txt</name>
+ </file>
+ </group>
+ <group>
+ <name>Drivers</name>
+ <group>
+ <name>BSP</name>
+ <group>
+ <name>P-NUCLEO-WB55.Nucleo</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\BSP\P-NUCLEO-WB55.Nucleo\stm32wbxx_nucleo.c</name>
+ </file>
+ </group>
+ </group>
+ <group>
+ <name>CMSIS</name>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\system_stm32wbxx.c</name>
+ </file>
+ </group>
+ <group>
+ <name>STM32WBxx_HAL_Driver</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_cortex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_dma.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_dma_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_flash.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_flash_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_gpio.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_hsem.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_ipcc.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_pwr.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_pwr_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rcc.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rcc_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rtc.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rtc_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_tim.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_tim_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_uart.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_uart_ex.c</name>
+ </file>
+ </group>
+ </group>
+ <group>
+ <name>Middlewares</name>
+ <group>
+ <name>STM32_WPAN</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\core\auto\ble_gap_aci.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\core\auto\ble_gatt_aci.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\core\auto\ble_hal_aci.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\core\auto\ble_hci_le.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\core\auto\ble_l2cap_aci.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\utilities\dbg_trace.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\svc\Src\dis.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\hci_tl.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\hci_tl_if.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\svc\Src\hrs.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\lhci\lhci.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\core\template\osal.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\utilities\otp.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\svc\Src\p2p_stm.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\shci\shci.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\shci_tl.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\shci_tl_if.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\utilities\stm_list.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\utilities\stm_queue.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\svc\Src\svc_ctl.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\tl_mbox.c</name>
+ </file>
+ </group>
+ </group>
+ <group>
+ <name>Utilities</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Utilities\lpm\tiny_lpm\stm32_lpm.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Utilities\sequencer\stm32_seq.c</name>
+ </file>
+ </group>
+</project>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/EWARM/ble_multi_app_at.eww b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/EWARM/ble_multi_app_at.eww
new file mode 100644
index 000000000..6a1ba964e
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/EWARM/ble_multi_app_at.eww
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workspace>
+ <project>
+ <path>$WS_DIR$\ble_multi_app_at.ewp</path>
+ </project>
+ <batchBuild />
+</workspace>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/EWARM/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/EWARM/startup_stm32wb55xx_cm4.s
new file mode 100644
index 000000000..1f886ff59
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/EWARM/startup_stm32wb55xx_cm4.s
@@ -0,0 +1,517 @@
+;******************************************************************************
+;* File Name : startup_stm32wb55xx_cm4.s
+;* Author : MCD Application Team
+;* Description : M4 core vector table of the STM32WB55xx devices for the
+;* IAR (EWARM) toolchain.
+;*
+;* This module performs:
+;* - Set the initial SP
+;* - Set the initial PC == _iar_program_start,
+;* - Set the vector table entries with the exceptions ISR
+;* address.
+;* - Branches to main in the C library (which eventually
+;* calls main()).
+;* After Reset the Cortex-M4 processor is in Thread mode,
+;* priority is Privileged, and the Stack is set to Main.
+;******************************************************************************
+;* @attention
+;*
+;* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+;* All rights reserved.</center></h2>
+;*
+;* This software component is licensed by ST under BSD 3-Clause license,
+;* the "License"; You may not use this file except in compliance with the
+;* License. You may obtain a copy of the License at:
+;* opensource.org/licenses/BSD-3-Clause
+;*
+;******************************************************************************
+;
+;
+; The modules in this file are included in the libraries, and may be replaced
+; by any user-defined modules that define the PUBLIC symbol _program_start or
+; a user defined start symbol.
+; To override the cstartup defined in the library, simply add your modified
+; version to the workbench project.
+;
+; The vector table is normally located at address 0.
+; When debugging in RAM, it can be located in RAM, aligned to at least 2^6.
+; The name "__vector_table" has special meaning for C-SPY:
+; it is where the SP start value is found, and the NVIC vector
+; table register (VTOR) is initialized to this address if != 0.
+;
+; Cortex-M version
+;
+
+ MODULE ?cstartup
+
+ ;; Forward declaration of sections.
+ SECTION CSTACK:DATA:NOROOT(3)
+
+ SECTION .intvec:CODE:NOROOT(2)
+
+ EXTERN __iar_program_start
+ EXTERN SystemInit
+ PUBLIC __vector_table
+
+ DATA
+__vector_table
+ DCD sfe(CSTACK)
+ DCD Reset_Handler ; Reset Handler
+
+ DCD NMI_Handler ; NMI Handler
+ DCD HardFault_Handler ; Hard Fault Handler
+ DCD MemManage_Handler ; MPU Fault Handler
+ DCD BusFault_Handler ; Bus Fault Handler
+ DCD UsageFault_Handler ; Usage Fault Handler
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD SVC_Handler ; SVCall Handler
+ DCD DebugMon_Handler ; Debug Monitor Handler
+ DCD 0 ; Reserved
+ DCD PendSV_Handler ; PendSV Handler
+ DCD SysTick_Handler ; SysTick Handler
+
+ ; External Interrupts
+ DCD WWDG_IRQHandler ; Window WatchDog
+ DCD PVD_PVM_IRQHandler ; PVD and PVM Interrupt
+ DCD TAMP_STAMP_LSECSS_IRQHandler ; RTC Tamper, TimeStamp Interrupts and LSECSS Interrupts
+ DCD RTC_WKUP_IRQHandler ; RTC Wakeup Interrupt
+ DCD FLASH_IRQHandler ; FLASH global Interrupt
+ DCD RCC_IRQHandler ; RCC Interrupt
+ DCD EXTI0_IRQHandler ; EXTI Line 0 Interrupt
+ DCD EXTI1_IRQHandler ; EXTI Line 1 Interrupt
+ DCD EXTI2_IRQHandler ; EXTI Line 2 Interrupt
+ DCD EXTI3_IRQHandler ; EXTI Line 3 Interrup
+ DCD EXTI4_IRQHandler ; EXTI Line 4 Interrupt
+ DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 Interrupt
+ DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2 Interrupt
+ DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3 Interrupt
+ DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4 Interrupt
+ DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5 Interrupt
+ DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6 Interrupt
+ DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7 Interrupt
+ DCD ADC1_IRQHandler ; ADC1 Interrupt
+ DCD USB_HP_IRQHandler ; USB High Priority Interrupt
+ DCD USB_LP_IRQHandler ; USB Low Priority Interrupt
+ DCD C2SEV_PWR_C2H_IRQHandler ; CPU M0+ SEV Interrupt
+ DCD COMP_IRQHandler ; COMP1 and COMP2 Interrupts
+ DCD EXTI9_5_IRQHandler ; EXTI Lines [9:5] Interrupt
+ DCD TIM1_BRK_IRQHandler ; TIM1 Break Interrupt
+ DCD TIM1_UP_TIM16_IRQHandler ; TIM1 Update and TIM16 global Interrupts
+ DCD TIM1_TRG_COM_TIM17_IRQHandler ; TIM1 Trigger and Communication and TIM17 global Interrupts
+ DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare Interrupt
+ DCD TIM2_IRQHandler ; TIM2 Global Interrupt
+ DCD PKA_IRQHandler ; PKA Interrupt
+ DCD I2C1_EV_IRQHandler ; I2C1 Event Interrupt
+ DCD I2C1_ER_IRQHandler ; I2C1 Error Interrupt
+ DCD I2C3_EV_IRQHandler ; I2C3 Event Interrupt
+ DCD I2C3_ER_IRQHandler ; I2C3 Error Interrupt
+ DCD SPI1_IRQHandler ; SPI1 Interrupt
+ DCD SPI2_IRQHandler ; SPI2 Interrupt
+ DCD USART1_IRQHandler ; USART1 Interrupt
+ DCD LPUART1_IRQHandler ; LPUART1 Interrupt
+ DCD SAI1_IRQHandler ; SAI Interrupt
+ DCD TSC_IRQHandler ; TSC Interrupt
+ DCD EXTI15_10_IRQHandler ; EXTI Lines1[15:10 ]Interrupts
+ DCD RTC_Alarm_IRQHandler ; RTC Alarms (A and B) Interrupt
+ DCD CRS_IRQHandler ; CRS interrupt
+ DCD PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler ; WKUP Interrupt from PWR
+ DCD IPCC_C1_RX_IRQHandler ; IPCC CPU1 RX occupied interrupt
+ DCD IPCC_C1_TX_IRQHandler ; IPCC CPU1 RX free interrupt
+ DCD HSEM_IRQHandler ; HSEM0 Interrupt
+ DCD LPTIM1_IRQHandler ; LPTIM1 Interrupt
+ DCD LPTIM2_IRQHandler ; LPTIM2 Interrupt
+ DCD LCD_IRQHandler ; LCD Interrupt
+ DCD QUADSPI_IRQHandler ; QUADSPI Interrupt
+ DCD AES1_IRQHandler ; AES1 Interrupt
+ DCD AES2_IRQHandler ; AES2 Interrupt
+ DCD RNG_IRQHandler ; RNG1 Interrupt
+ DCD FPU_IRQHandler ; FPU Interrupt
+ DCD DMA2_Channel1_IRQHandler ; DMA2 Channel 1 Interrupt
+ DCD DMA2_Channel2_IRQHandler ; DMA2 Channel 2 Interrupt
+ DCD DMA2_Channel3_IRQHandler ; DMA2 Channel 3 Interrupt
+ DCD DMA2_Channel4_IRQHandler ; DMA2 Channel 4 Interrupt
+ DCD DMA2_Channel5_IRQHandler ; DMA2 Channel 5 Interrupt
+ DCD DMA2_Channel6_IRQHandler ; DMA2 Channel 6 Interrupt
+ DCD DMA2_Channel7_IRQHandler ; DMA2 Channel 7 Interrupt
+ DCD DMAMUX1_OVR_IRQHandler ; DMAMUX overrun Interrupt
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Default interrupt handlers.
+;;
+ THUMB
+
+ PUBWEAK Reset_Handler
+ SECTION .text:CODE:NOROOT:REORDER(2)
+Reset_Handler
+ LDR R0, =SystemInit
+ BLX R0
+ LDR R0, =__iar_program_start
+ BX R0
+
+ PUBWEAK NMI_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+NMI_Handler
+ B NMI_Handler
+
+ PUBWEAK HardFault_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+HardFault_Handler
+ B HardFault_Handler
+
+ PUBWEAK MemManage_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+MemManage_Handler
+ B MemManage_Handler
+
+ PUBWEAK BusFault_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+BusFault_Handler
+ B BusFault_Handler
+
+ PUBWEAK UsageFault_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+UsageFault_Handler
+ B UsageFault_Handler
+
+ PUBWEAK SVC_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SVC_Handler
+ B SVC_Handler
+
+ PUBWEAK DebugMon_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DebugMon_Handler
+ B DebugMon_Handler
+
+ PUBWEAK PendSV_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+PendSV_Handler
+ B PendSV_Handler
+
+ PUBWEAK SysTick_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SysTick_Handler
+ B SysTick_Handler
+
+ PUBWEAK WWDG_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+WWDG_IRQHandler
+ B WWDG_IRQHandler
+
+ PUBWEAK PVD_PVM_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+PVD_PVM_IRQHandler
+ B PVD_PVM_IRQHandler
+
+ PUBWEAK TAMP_STAMP_LSECSS_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TAMP_STAMP_LSECSS_IRQHandler
+ B TAMP_STAMP_LSECSS_IRQHandler
+
+ PUBWEAK RTC_WKUP_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+RTC_WKUP_IRQHandler
+ B RTC_WKUP_IRQHandler
+
+ PUBWEAK FLASH_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+FLASH_IRQHandler
+ B FLASH_IRQHandler
+
+ PUBWEAK RCC_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+RCC_IRQHandler
+ B RCC_IRQHandler
+
+ PUBWEAK EXTI0_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI0_IRQHandler
+ B EXTI0_IRQHandler
+
+ PUBWEAK EXTI1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI1_IRQHandler
+ B EXTI1_IRQHandler
+
+ PUBWEAK EXTI2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI2_IRQHandler
+ B EXTI2_IRQHandler
+
+ PUBWEAK EXTI3_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI3_IRQHandler
+ B EXTI3_IRQHandler
+
+ PUBWEAK EXTI4_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI4_IRQHandler
+ B EXTI4_IRQHandler
+
+ PUBWEAK DMA1_Channel1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel1_IRQHandler
+ B DMA1_Channel1_IRQHandler
+
+ PUBWEAK DMA1_Channel2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel2_IRQHandler
+ B DMA1_Channel2_IRQHandler
+
+ PUBWEAK DMA1_Channel3_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel3_IRQHandler
+ B DMA1_Channel3_IRQHandler
+
+ PUBWEAK DMA1_Channel4_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel4_IRQHandler
+ B DMA1_Channel4_IRQHandler
+
+ PUBWEAK DMA1_Channel5_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel5_IRQHandler
+ B DMA1_Channel5_IRQHandler
+
+ PUBWEAK DMA1_Channel6_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel6_IRQHandler
+ B DMA1_Channel6_IRQHandler
+
+ PUBWEAK DMA1_Channel7_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel7_IRQHandler
+ B DMA1_Channel7_IRQHandler
+
+ PUBWEAK ADC1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+ADC1_IRQHandler
+ B ADC1_IRQHandler
+
+ PUBWEAK USB_HP_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+USB_HP_IRQHandler
+ B USB_HP_IRQHandler
+
+ PUBWEAK USB_LP_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+USB_LP_IRQHandler
+ B USB_LP_IRQHandler
+
+ PUBWEAK C2SEV_PWR_C2H_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+C2SEV_PWR_C2H_IRQHandler
+ B C2SEV_PWR_C2H_IRQHandler
+
+ PUBWEAK COMP_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+COMP_IRQHandler
+ B COMP_IRQHandler
+
+ PUBWEAK EXTI9_5_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI9_5_IRQHandler
+ B EXTI9_5_IRQHandler
+
+ PUBWEAK TIM1_BRK_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM1_BRK_IRQHandler
+ B TIM1_BRK_IRQHandler
+
+ PUBWEAK TIM1_UP_TIM16_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM1_UP_TIM16_IRQHandler
+ B TIM1_UP_TIM16_IRQHandler
+
+ PUBWEAK TIM1_TRG_COM_TIM17_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM1_TRG_COM_TIM17_IRQHandler
+ B TIM1_TRG_COM_TIM17_IRQHandler
+
+ PUBWEAK TIM1_CC_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM1_CC_IRQHandler
+ B TIM1_CC_IRQHandler
+
+ PUBWEAK TIM2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM2_IRQHandler
+ B TIM2_IRQHandler
+
+ PUBWEAK PKA_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+PKA_IRQHandler
+ B PKA_IRQHandler
+
+ PUBWEAK I2C1_EV_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+I2C1_EV_IRQHandler
+ B I2C1_EV_IRQHandler
+
+ PUBWEAK I2C1_ER_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+I2C1_ER_IRQHandler
+ B I2C1_ER_IRQHandler
+
+ PUBWEAK I2C3_EV_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+I2C3_EV_IRQHandler
+ B I2C3_EV_IRQHandler
+
+ PUBWEAK I2C3_ER_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+I2C3_ER_IRQHandler
+ B I2C3_ER_IRQHandler
+
+ PUBWEAK SPI1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SPI1_IRQHandler
+ B SPI1_IRQHandler
+
+ PUBWEAK SPI2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SPI2_IRQHandler
+ B SPI2_IRQHandler
+
+ PUBWEAK USART1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+USART1_IRQHandler
+ B USART1_IRQHandler
+
+ PUBWEAK LPUART1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+LPUART1_IRQHandler
+ B LPUART1_IRQHandler
+
+ PUBWEAK SAI1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SAI1_IRQHandler
+ B SAI1_IRQHandler
+
+ PUBWEAK TSC_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TSC_IRQHandler
+ B TSC_IRQHandler
+
+ PUBWEAK EXTI15_10_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI15_10_IRQHandler
+ B EXTI15_10_IRQHandler
+
+ PUBWEAK RTC_Alarm_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+RTC_Alarm_IRQHandler
+ B RTC_Alarm_IRQHandler
+
+ PUBWEAK CRS_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+CRS_IRQHandler
+ B CRS_IRQHandler
+
+ PUBWEAK PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler
+ B PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler
+
+ PUBWEAK IPCC_C1_RX_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+IPCC_C1_RX_IRQHandler
+ B IPCC_C1_RX_IRQHandler
+
+ PUBWEAK IPCC_C1_TX_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+IPCC_C1_TX_IRQHandler
+ B IPCC_C1_TX_IRQHandler
+
+ PUBWEAK HSEM_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+HSEM_IRQHandler
+ B HSEM_IRQHandler
+
+ PUBWEAK LPTIM1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+LPTIM1_IRQHandler
+ B LPTIM1_IRQHandler
+
+ PUBWEAK LPTIM2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+LPTIM2_IRQHandler
+ B LPTIM2_IRQHandler
+
+ PUBWEAK LCD_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+LCD_IRQHandler
+ B LCD_IRQHandler
+
+ PUBWEAK QUADSPI_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+QUADSPI_IRQHandler
+ B QUADSPI_IRQHandler
+
+ PUBWEAK AES1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+AES1_IRQHandler
+ B AES1_IRQHandler
+
+ PUBWEAK AES2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+AES2_IRQHandler
+ B AES2_IRQHandler
+
+ PUBWEAK RNG_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+RNG_IRQHandler
+ B RNG_IRQHandler
+
+ PUBWEAK FPU_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+FPU_IRQHandler
+ B FPU_IRQHandler
+
+ PUBWEAK DMA2_Channel1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel1_IRQHandler
+ B DMA2_Channel1_IRQHandler
+
+ PUBWEAK DMA2_Channel2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel2_IRQHandler
+ B DMA2_Channel2_IRQHandler
+
+ PUBWEAK DMA2_Channel3_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel3_IRQHandler
+ B DMA2_Channel3_IRQHandler
+
+ PUBWEAK DMA2_Channel4_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel4_IRQHandler
+ B DMA2_Channel4_IRQHandler
+
+ PUBWEAK DMA2_Channel5_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel5_IRQHandler
+ B DMA2_Channel5_IRQHandler
+
+ PUBWEAK DMA2_Channel6_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel6_IRQHandler
+ B DMA2_Channel6_IRQHandler
+
+ PUBWEAK DMA2_Channel7_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel7_IRQHandler
+ B DMA2_Channel7_IRQHandler
+
+ PUBWEAK DMAMUX1_OVR_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMAMUX1_OVR_IRQHandler
+ B DMAMUX1_OVR_IRQHandler
+
+ END
+
+;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE*****
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/EWARM/stm32wb55xx_flash_cm4.icf b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/EWARM/stm32wb55xx_flash_cm4.icf
new file mode 100644
index 000000000..5f36da686
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/EWARM/stm32wb55xx_flash_cm4.icf
@@ -0,0 +1,40 @@
+/*###ICF### Section handled by ICF editor, don't touch! ****/
+/*-Editor annotation file-*/
+/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
+/*-Specials-*/
+define symbol __ICFEDIT_intvec_start__ = 0x08000000;
+/*-Memory Regions-*/
+/***** FLASH Part dedicated to M4 *****/
+define symbol __ICFEDIT_region_ROM_start__ = 0x08000000;
+define symbol __ICFEDIT_region_ROM_end__ = 0x0807FFFF;
+define symbol __ICFEDIT_region_RAM_start__ = 0x20000004;
+define symbol __ICFEDIT_region_RAM_end__ = 0x2002FFFF;
+/*-Sizes-*/
+define symbol __ICFEDIT_size_cstack__ = 0x1000;
+define symbol __ICFEDIT_size_heap__ = 0x400;
+/**** End of ICF editor section. ###ICF###*/
+
+define symbol __ICFEDIT_region_RAM_SHARED_start__ = 0x20030000;
+define symbol __ICFEDIT_region_RAM_SHARED_end__ = 0x200327FF;
+
+define memory mem with size = 4G;
+define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
+define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
+define region RAM_SHARED_region = mem:[from __ICFEDIT_region_RAM_SHARED_start__ to __ICFEDIT_region_RAM_SHARED_end__];
+
+define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
+define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
+
+/* MB_MEM1 and MB_MEM2 are sections reserved to mailbox communication. It is placed in the shared memory */
+initialize by copy { readwrite };
+do not initialize { section .noinit,
+ section MAPPING_TABLE,
+ section MB_MEM1 };
+
+place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
+
+place in ROM_region { readonly };
+place in RAM_region { readwrite,block CSTACK, block HEAP };
+place in RAM_SHARED_region { first section MAPPING_TABLE};
+place in RAM_SHARED_region { section MB_MEM1};
+place in RAM_SHARED_region { section MB_MEM2};
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/MDK-ARM/ble_multi_app_at.uvoptx b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/MDK-ARM/ble_multi_app_at.uvoptx
new file mode 100644
index 000000000..8b5ed4a5a
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/MDK-ARM/ble_multi_app_at.uvoptx
@@ -0,0 +1,1013 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd">
+
+ <SchemaVersion>1.0</SchemaVersion>
+
+ <Header>### uVision Project, (C) Keil Software</Header>
+
+ <Extensions>
+ <cExt>*.c</cExt>
+ <aExt>*.s*; *.src; *.a*</aExt>
+ <oExt>*.obj; *.o</oExt>
+ <lExt>*.lib</lExt>
+ <tExt>*.txt; *.h; *.inc</tExt>
+ <pExt>*.plm</pExt>
+ <CppX>*.cpp</CppX>
+ <nMigrate>0</nMigrate>
+ </Extensions>
+
+ <DaveTm>
+ <dwLowDateTime>0</dwLowDateTime>
+ <dwHighDateTime>0</dwHighDateTime>
+ </DaveTm>
+
+ <Target>
+ <TargetName>ble_multi_app_at</TargetName>
+ <ToolsetNumber>0x4</ToolsetNumber>
+ <ToolsetName>ARM-ADS</ToolsetName>
+ <TargetOption>
+ <CLKADS>12000000</CLKADS>
+ <OPTTT>
+ <gFlags>1</gFlags>
+ <BeepAtEnd>1</BeepAtEnd>
+ <RunSim>0</RunSim>
+ <RunTarget>1</RunTarget>
+ <RunAbUc>0</RunAbUc>
+ </OPTTT>
+ <OPTHX>
+ <HexSelection>1</HexSelection>
+ <FlashByte>65535</FlashByte>
+ <HexRangeLowAddress>0</HexRangeLowAddress>
+ <HexRangeHighAddress>0</HexRangeHighAddress>
+ <HexOffset>0</HexOffset>
+ </OPTHX>
+ <OPTLEX>
+ <PageWidth>79</PageWidth>
+ <PageLength>66</PageLength>
+ <TabStop>8</TabStop>
+ <ListingPath></ListingPath>
+ </OPTLEX>
+ <ListingPage>
+ <CreateCListing>1</CreateCListing>
+ <CreateAListing>1</CreateAListing>
+ <CreateLListing>1</CreateLListing>
+ <CreateIListing>0</CreateIListing>
+ <AsmCond>1</AsmCond>
+ <AsmSymb>1</AsmSymb>
+ <AsmXref>0</AsmXref>
+ <CCond>1</CCond>
+ <CCode>0</CCode>
+ <CListInc>0</CListInc>
+ <CSymb>0</CSymb>
+ <LinkerCodeListing>0</LinkerCodeListing>
+ </ListingPage>
+ <OPTXL>
+ <LMap>1</LMap>
+ <LComments>1</LComments>
+ <LGenerateSymbols>1</LGenerateSymbols>
+ <LLibSym>1</LLibSym>
+ <LLines>1</LLines>
+ <LLocSym>1</LLocSym>
+ <LPubSym>1</LPubSym>
+ <LXref>0</LXref>
+ <LExpSel>0</LExpSel>
+ </OPTXL>
+ <OPTFL>
+ <tvExp>1</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <IsCurrentTarget>1</IsCurrentTarget>
+ </OPTFL>
+ <CpuCode>18</CpuCode>
+ <DebugOpt>
+ <uSim>0</uSim>
+ <uTrg>1</uTrg>
+ <sLdApp>1</sLdApp>
+ <sGomain>1</sGomain>
+ <sRbreak>1</sRbreak>
+ <sRwatch>1</sRwatch>
+ <sRmem>1</sRmem>
+ <sRfunc>1</sRfunc>
+ <sRbox>1</sRbox>
+ <tLdApp>1</tLdApp>
+ <tGomain>1</tGomain>
+ <tRbreak>1</tRbreak>
+ <tRwatch>1</tRwatch>
+ <tRmem>1</tRmem>
+ <tRfunc>1</tRfunc>
+ <tRbox>1</tRbox>
+ <tRtrace>0</tRtrace>
+ <sRSysVw>1</sRSysVw>
+ <tRSysVw>1</tRSysVw>
+ <sRunDeb>0</sRunDeb>
+ <sLrtime>0</sLrtime>
+ <bEvRecOn>1</bEvRecOn>
+ <bSchkAxf>0</bSchkAxf>
+ <bTchkAxf>0</bTchkAxf>
+ <nTsel>6</nTsel>
+ <sDll></sDll>
+ <sDllPa></sDllPa>
+ <sDlgDll></sDlgDll>
+ <sDlgPa></sDlgPa>
+ <sIfile></sIfile>
+ <tDll></tDll>
+ <tDllPa></tDllPa>
+ <tDlgDll></tDlgDll>
+ <tDlgPa></tDlgPa>
+ <tIfile></tIfile>
+ <pMon>STLink\ST-LINKIII-KEIL_SWO.dll</pMon>
+ </DebugOpt>
+ <TargetDriverDllRegistry>
+ <SetRegEntry>
+ <Number>0</Number>
+ <Key>UL2CM3</Key>
+ <Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32WB_M4 -FS08000000 -FL01000000 -FP0($$Device:STM32WB55RGVx$CMSIS\Flash\STM32WB_M4.FLM))</Name>
+ </SetRegEntry>
+ <SetRegEntry>
+ <Number>0</Number>
+ <Key>ST-LINKIII-KEIL_SWO</Key>
+ <Name>-U066AFF393132534E43042615 -O2254 -SF4000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P2 -N00("ARM CoreSight SW-DP") -D00(6BA02477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC1000 -FN1 -FF0STM32WB_M4.FLM -FS08000000 -FL01000000 -FP0($$Device:STM32WB55RGVx$CMSIS\Flash\STM32WB_M4.FLM)</Name>
+ </SetRegEntry>
+ </TargetDriverDllRegistry>
+ <Breakpoint/>
+ <Tracepoint>
+ <THDelay>0</THDelay>
+ </Tracepoint>
+ <DebugFlag>
+ <trace>0</trace>
+ <periodic>1</periodic>
+ <aLwin>0</aLwin>
+ <aCover>0</aCover>
+ <aSer1>0</aSer1>
+ <aSer2>0</aSer2>
+ <aPa>0</aPa>
+ <viewmode>0</viewmode>
+ <vrSel>0</vrSel>
+ <aSym>0</aSym>
+ <aTbox>0</aTbox>
+ <AscS1>0</AscS1>
+ <AscS2>0</AscS2>
+ <AscS3>0</AscS3>
+ <aSer3>0</aSer3>
+ <eProf>0</eProf>
+ <aLa>0</aLa>
+ <aPa1>0</aPa1>
+ <AscS4>0</AscS4>
+ <aSer4>0</aSer4>
+ <StkLoc>0</StkLoc>
+ <TrcWin>0</TrcWin>
+ <newCpu>0</newCpu>
+ <uProt>0</uProt>
+ </DebugFlag>
+ <LintExecutable></LintExecutable>
+ <LintConfigFile></LintConfigFile>
+ <bLintAuto>0</bLintAuto>
+ <bAutoGenD>0</bAutoGenD>
+ <LntExFlags>0</LntExFlags>
+ <pMisraName></pMisraName>
+ <pszMrule></pszMrule>
+ <pSingCmds></pSingCmds>
+ <pMultCmds></pMultCmds>
+ <pMisraNamep></pMisraNamep>
+ <pszMrulep></pszMrulep>
+ <pSingCmdsp></pSingCmdsp>
+ <pMultCmdsp></pMultCmdsp>
+ </TargetOption>
+ </Target>
+
+ <Group>
+ <GroupName>Application/MDK-ARM</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>0</RteFlg>
+ <File>
+ <GroupNumber>1</GroupNumber>
+ <FileNumber>1</FileNumber>
+ <FileType>2</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>startup_stm32wb55xx_cm4.s</PathWithFileName>
+ <FilenameWithoutPath>startup_stm32wb55xx_cm4.s</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ </Group>
+
+ <Group>
+ <GroupName>Application/User/Core</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>0</RteFlg>
+ <File>
+ <GroupNumber>2</GroupNumber>
+ <FileNumber>2</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../Core/Src/app_entry.c</PathWithFileName>
+ <FilenameWithoutPath>app_entry.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>2</GroupNumber>
+ <FileNumber>3</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../Core/Src/hw_timerserver.c</PathWithFileName>
+ <FilenameWithoutPath>hw_timerserver.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>2</GroupNumber>
+ <FileNumber>4</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../Core/Src/hw_uart.c</PathWithFileName>
+ <FilenameWithoutPath>hw_uart.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>2</GroupNumber>
+ <FileNumber>5</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../Core/Src/main.c</PathWithFileName>
+ <FilenameWithoutPath>main.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>2</GroupNumber>
+ <FileNumber>6</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../Core/Src/stm32_lpm_if.c</PathWithFileName>
+ <FilenameWithoutPath>stm32_lpm_if.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>2</GroupNumber>
+ <FileNumber>7</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../Core/Src/stm32wbxx_hal_msp.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_msp.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>2</GroupNumber>
+ <FileNumber>8</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../Core/Src/stm32wbxx_it.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_it.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ </Group>
+
+ <Group>
+ <GroupName>Application/User/STM32_WPAN/App</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>0</RteFlg>
+ <File>
+ <GroupNumber>3</GroupNumber>
+ <FileNumber>9</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../STM32_WPAN/App/app_ble_cl.c</PathWithFileName>
+ <FilenameWithoutPath>app_ble_cl.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>3</GroupNumber>
+ <FileNumber>10</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../STM32_WPAN/App/app_ble_common.c</PathWithFileName>
+ <FilenameWithoutPath>app_ble_common.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>3</GroupNumber>
+ <FileNumber>11</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../STM32_WPAN/App/app_ble_hr.c</PathWithFileName>
+ <FilenameWithoutPath>app_ble_hr.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>3</GroupNumber>
+ <FileNumber>12</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../STM32_WPAN/App/app_ble_sv.c</PathWithFileName>
+ <FilenameWithoutPath>app_ble_sv.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>3</GroupNumber>
+ <FileNumber>13</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../STM32_WPAN/App/dis_app.c</PathWithFileName>
+ <FilenameWithoutPath>dis_app.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>3</GroupNumber>
+ <FileNumber>14</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../STM32_WPAN/App/hrs_app.c</PathWithFileName>
+ <FilenameWithoutPath>hrs_app.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>3</GroupNumber>
+ <FileNumber>15</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../STM32_WPAN/App/p2p_client_app.c</PathWithFileName>
+ <FilenameWithoutPath>p2p_client_app.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>3</GroupNumber>
+ <FileNumber>16</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../STM32_WPAN/App/p2p_server_app.c</PathWithFileName>
+ <FilenameWithoutPath>p2p_server_app.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>3</GroupNumber>
+ <FileNumber>17</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../STM32_WPAN/App/uart_app.c</PathWithFileName>
+ <FilenameWithoutPath>uart_app.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ </Group>
+
+ <Group>
+ <GroupName>Application/User/STM32_WPAN/Target</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>0</RteFlg>
+ <File>
+ <GroupNumber>4</GroupNumber>
+ <FileNumber>18</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../STM32_WPAN/Target/hw_ipcc.c</PathWithFileName>
+ <FilenameWithoutPath>hw_ipcc.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ </Group>
+
+ <Group>
+ <GroupName>Doc</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>0</RteFlg>
+ <File>
+ <GroupNumber>5</GroupNumber>
+ <FileNumber>19</FileNumber>
+ <FileType>5</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../readme.txt</PathWithFileName>
+ <FilenameWithoutPath>readme.txt</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ </Group>
+
+ <Group>
+ <GroupName>Drivers/BSP/P-NUCLEO-WB55.Nucleo</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>0</RteFlg>
+ <File>
+ <GroupNumber>6</GroupNumber>
+ <FileNumber>20</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/BSP/P-NUCLEO-WB55.Nucleo/stm32wbxx_nucleo.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_nucleo.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ </Group>
+
+ <Group>
+ <GroupName>Drivers/CMSIS</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>0</RteFlg>
+ <File>
+ <GroupNumber>7</GroupNumber>
+ <FileNumber>21</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../Core/Src/system_stm32wbxx.c</PathWithFileName>
+ <FilenameWithoutPath>system_stm32wbxx.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ </Group>
+
+ <Group>
+ <GroupName>Drivers/STM32WBxx_HAL_Driver</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>0</RteFlg>
+ <File>
+ <GroupNumber>8</GroupNumber>
+ <FileNumber>22</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>8</GroupNumber>
+ <FileNumber>23</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_cortex.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_cortex.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>8</GroupNumber>
+ <FileNumber>24</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_dma.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_dma.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>8</GroupNumber>
+ <FileNumber>25</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_dma_ex.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_dma_ex.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>8</GroupNumber>
+ <FileNumber>26</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_flash.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_flash.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>8</GroupNumber>
+ <FileNumber>27</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_flash_ex.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_flash_ex.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>8</GroupNumber>
+ <FileNumber>28</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_gpio.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_gpio.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>8</GroupNumber>
+ <FileNumber>29</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_hsem.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_hsem.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>8</GroupNumber>
+ <FileNumber>30</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_ipcc.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_ipcc.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>8</GroupNumber>
+ <FileNumber>31</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pwr.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_pwr.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>8</GroupNumber>
+ <FileNumber>32</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pwr_ex.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_pwr_ex.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>8</GroupNumber>
+ <FileNumber>33</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rcc.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_rcc.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>8</GroupNumber>
+ <FileNumber>34</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rcc_ex.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_rcc_ex.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>8</GroupNumber>
+ <FileNumber>35</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rtc.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_rtc.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>8</GroupNumber>
+ <FileNumber>36</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rtc_ex.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_rtc_ex.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>8</GroupNumber>
+ <FileNumber>37</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_tim.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_tim.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>8</GroupNumber>
+ <FileNumber>38</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_tim_ex.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_tim_ex.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>8</GroupNumber>
+ <FileNumber>39</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_uart.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_uart.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>8</GroupNumber>
+ <FileNumber>40</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_uart_ex.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_uart_ex.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ </Group>
+
+ <Group>
+ <GroupName>Middlewares/STM32_WPAN</GroupName>
+ <tvExp>1</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>0</RteFlg>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>41</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/core/auto/ble_gap_aci.c</PathWithFileName>
+ <FilenameWithoutPath>ble_gap_aci.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>42</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/core/auto/ble_gatt_aci.c</PathWithFileName>
+ <FilenameWithoutPath>ble_gatt_aci.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>43</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/core/auto/ble_hal_aci.c</PathWithFileName>
+ <FilenameWithoutPath>ble_hal_aci.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>44</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/core/auto/ble_hci_le.c</PathWithFileName>
+ <FilenameWithoutPath>ble_hci_le.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>45</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/core/auto/ble_l2cap_aci.c</PathWithFileName>
+ <FilenameWithoutPath>ble_l2cap_aci.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>46</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/utilities/dbg_trace.c</PathWithFileName>
+ <FilenameWithoutPath>dbg_trace.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>47</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/svc/Src/dis.c</PathWithFileName>
+ <FilenameWithoutPath>dis.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>48</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/hci_tl.c</PathWithFileName>
+ <FilenameWithoutPath>hci_tl.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>49</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/hci_tl_if.c</PathWithFileName>
+ <FilenameWithoutPath>hci_tl_if.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>50</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/svc/Src/hrs.c</PathWithFileName>
+ <FilenameWithoutPath>hrs.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>51</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/lhci/lhci.c</PathWithFileName>
+ <FilenameWithoutPath>lhci.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>52</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/core/template/osal.c</PathWithFileName>
+ <FilenameWithoutPath>osal.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>53</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/utilities/otp.c</PathWithFileName>
+ <FilenameWithoutPath>otp.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>54</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/svc/Src/p2p_stm.c</PathWithFileName>
+ <FilenameWithoutPath>p2p_stm.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>55</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci/shci.c</PathWithFileName>
+ <FilenameWithoutPath>shci.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>56</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/shci_tl.c</PathWithFileName>
+ <FilenameWithoutPath>shci_tl.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>57</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/shci_tl_if.c</PathWithFileName>
+ <FilenameWithoutPath>shci_tl_if.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>58</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/utilities/stm_list.c</PathWithFileName>
+ <FilenameWithoutPath>stm_list.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>59</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/utilities/stm_queue.c</PathWithFileName>
+ <FilenameWithoutPath>stm_queue.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>60</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_mbox.c</PathWithFileName>
+ <FilenameWithoutPath>tl_mbox.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>9</GroupNumber>
+ <FileNumber>61</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\svc\Src\svc_ctl.c</PathWithFileName>
+ <FilenameWithoutPath>svc_ctl.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ </Group>
+
+ <Group>
+ <GroupName>Utilities</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>0</RteFlg>
+ <File>
+ <GroupNumber>10</GroupNumber>
+ <FileNumber>62</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Utilities/lpm/tiny_lpm/stm32_lpm.c</PathWithFileName>
+ <FilenameWithoutPath>stm32_lpm.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>10</GroupNumber>
+ <FileNumber>63</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>../../../../../../Utilities/sequencer/stm32_seq.c</PathWithFileName>
+ <FilenameWithoutPath>stm32_seq.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ </Group>
+
+</ProjectOpt>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/MDK-ARM/ble_multi_app_at.uvprojx b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/MDK-ARM/ble_multi_app_at.uvprojx
new file mode 100644
index 000000000..41b84e066
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/MDK-ARM/ble_multi_app_at.uvprojx
@@ -0,0 +1,756 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd">
+
+ <SchemaVersion>2.1</SchemaVersion>
+
+ <Header>### uVision Project, (C) Keil Software</Header>
+
+ <Targets>
+ <Target>
+ <TargetName>ble_multi_app_at</TargetName>
+ <ToolsetNumber>0x4</ToolsetNumber>
+ <ToolsetName>ARM-ADS</ToolsetName>
+ <pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
+ <uAC6>0</uAC6>
+ <TargetOption>
+ <TargetCommonOption>
+ <Device>STM32WB55RGVx</Device>
+ <Vendor>STMicroelectronics</Vendor>
+ <PackID>Keil.STM32WBxx.0.0.6</PackID>
+ <PackURL>http://www.keil.com/pack</PackURL>
+ <Cpu>IRAM(0x20000000,0x000040000) IROM(0x08000000,0x001000000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ESEL ELITTLE</Cpu>
+ <FlashUtilSpec></FlashUtilSpec>
+ <StartupFile></StartupFile>
+ <FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32WB_M4 -FS08000000 -FL01000000 -FP0($$Device:STM32WB55RGVx$CMSIS\Flash\STM32WB_M4.FLM))</FlashDriverDll>
+ <DeviceId>0</DeviceId>
+ <RegisterFile>$$Device:STM32WB55RGVx$Drivers\CMSIS\Device\ST\STM32WBxx\Include\stm32wbxx.h</RegisterFile>
+ <MemoryEnv></MemoryEnv>
+ <Cmp></Cmp>
+ <Asm></Asm>
+ <Linker></Linker>
+ <OHString></OHString>
+ <InfinionOptionDll></InfinionOptionDll>
+ <SLE66CMisc></SLE66CMisc>
+ <SLE66AMisc></SLE66AMisc>
+ <SLE66LinkerMisc></SLE66LinkerMisc>
+ <SFDFile>$$Device:STM32WB55RGVx$CMSIS\SVD\STM32WBxx_CM4.svd</SFDFile>
+ <bCustSvd>0</bCustSvd>
+ <UseEnv>0</UseEnv>
+ <BinPath></BinPath>
+ <IncludePath></IncludePath>
+ <LibPath></LibPath>
+ <RegisterFilePath></RegisterFilePath>
+ <DBRegisterFilePath></DBRegisterFilePath>
+ <TargetStatus>
+ <Error>0</Error>
+ <ExitCodeStop>0</ExitCodeStop>
+ <ButtonStop>0</ButtonStop>
+ <NotGenerated>0</NotGenerated>
+ <InvalidFlash>1</InvalidFlash>
+ </TargetStatus>
+ <OutputDirectory>ble_multi_app_at\Exe\</OutputDirectory>
+ <OutputName>ble_multi_app_at</OutputName>
+ <CreateExecutable>1</CreateExecutable>
+ <CreateLib>0</CreateLib>
+ <CreateHexFile>1</CreateHexFile>
+ <DebugInformation>1</DebugInformation>
+ <BrowseInformation>1</BrowseInformation>
+ <ListingPath></ListingPath>
+ <HexFormatSelection>1</HexFormatSelection>
+ <Merge32K>0</Merge32K>
+ <CreateBatchFile>0</CreateBatchFile>
+ <BeforeCompile>
+ <RunUserProg1>0</RunUserProg1>
+ <RunUserProg2>0</RunUserProg2>
+ <UserProg1Name></UserProg1Name>
+ <UserProg2Name></UserProg2Name>
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
+ <nStopU1X>0</nStopU1X>
+ <nStopU2X>0</nStopU2X>
+ </BeforeCompile>
+ <BeforeMake>
+ <RunUserProg1>0</RunUserProg1>
+ <RunUserProg2>0</RunUserProg2>
+ <UserProg1Name></UserProg1Name>
+ <UserProg2Name></UserProg2Name>
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
+ <nStopB1X>0</nStopB1X>
+ <nStopB2X>0</nStopB2X>
+ </BeforeMake>
+ <AfterMake>
+ <RunUserProg1>0</RunUserProg1>
+ <RunUserProg2>0</RunUserProg2>
+ <UserProg1Name></UserProg1Name>
+ <UserProg2Name></UserProg2Name>
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
+ <nStopA1X>0</nStopA1X>
+ <nStopA2X>0</nStopA2X>
+ </AfterMake>
+ <SelectedForBatchBuild>0</SelectedForBatchBuild>
+ <SVCSIdString></SVCSIdString>
+ </TargetCommonOption>
+ <CommonProperty>
+ <UseCPPCompiler>0</UseCPPCompiler>
+ <RVCTCodeConst>0</RVCTCodeConst>
+ <RVCTZI>0</RVCTZI>
+ <RVCTOtherData>0</RVCTOtherData>
+ <ModuleSelection>0</ModuleSelection>
+ <IncludeInBuild>1</IncludeInBuild>
+ <AlwaysBuild>0</AlwaysBuild>
+ <GenerateAssemblyFile>0</GenerateAssemblyFile>
+ <AssembleAssemblyFile>0</AssembleAssemblyFile>
+ <PublicsOnly>0</PublicsOnly>
+ <StopOnExitCode>3</StopOnExitCode>
+ <CustomArgument></CustomArgument>
+ <IncludeLibraryModules></IncludeLibraryModules>
+ <ComprImg>1</ComprImg>
+ </CommonProperty>
+ <DllOption>
+ <SimDllName>SARMCM3.DLL</SimDllName>
+ <SimDllArguments> -REMAP -MPU</SimDllArguments>
+ <SimDlgDll>DCM.DLL</SimDlgDll>
+ <SimDlgDllArguments>-pCM4</SimDlgDllArguments>
+ <TargetDllName>SARMCM3.DLL</TargetDllName>
+ <TargetDllArguments> -MPU</TargetDllArguments>
+ <TargetDlgDll>TCM.DLL</TargetDlgDll>
+ <TargetDlgDllArguments>-pCM4</TargetDlgDllArguments>
+ </DllOption>
+ <DebugOption>
+ <OPTHX>
+ <HexSelection>1</HexSelection>
+ <HexRangeLowAddress>0</HexRangeLowAddress>
+ <HexRangeHighAddress>0</HexRangeHighAddress>
+ <HexOffset>0</HexOffset>
+ <Oh166RecLen>16</Oh166RecLen>
+ </OPTHX>
+ </DebugOption>
+ <Utilities>
+ <Flash1>
+ <UseTargetDll>1</UseTargetDll>
+ <UseExternalTool>0</UseExternalTool>
+ <RunIndependent>0</RunIndependent>
+ <UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
+ <Capability>1</Capability>
+ <DriverSelection>4100</DriverSelection>
+ </Flash1>
+ <bUseTDR>1</bUseTDR>
+ <Flash2>STLink\ST-LINKIII-KEIL_SWO.dll</Flash2>
+ <Flash3>"" ()</Flash3>
+ <Flash4></Flash4>
+ <pFcarmOut></pFcarmOut>
+ <pFcarmGrp></pFcarmGrp>
+ <pFcArmRoot></pFcArmRoot>
+ <FcArmLst>0</FcArmLst>
+ </Utilities>
+ <TargetArmAds>
+ <ArmAdsMisc>
+ <GenerateListings>0</GenerateListings>
+ <asHll>1</asHll>
+ <asAsm>1</asAsm>
+ <asMacX>1</asMacX>
+ <asSyms>1</asSyms>
+ <asFals>1</asFals>
+ <asDbgD>1</asDbgD>
+ <asForm>1</asForm>
+ <ldLst>0</ldLst>
+ <ldmm>1</ldmm>
+ <ldXref>1</ldXref>
+ <BigEnd>0</BigEnd>
+ <AdsALst>1</AdsALst>
+ <AdsACrf>1</AdsACrf>
+ <AdsANop>0</AdsANop>
+ <AdsANot>0</AdsANot>
+ <AdsLLst>1</AdsLLst>
+ <AdsLmap>1</AdsLmap>
+ <AdsLcgr>1</AdsLcgr>
+ <AdsLsym>1</AdsLsym>
+ <AdsLszi>1</AdsLszi>
+ <AdsLtoi>1</AdsLtoi>
+ <AdsLsun>1</AdsLsun>
+ <AdsLven>1</AdsLven>
+ <AdsLsxf>1</AdsLsxf>
+ <RvctClst>0</RvctClst>
+ <GenPPlst>0</GenPPlst>
+ <AdsCpuType>"Cortex-M4"</AdsCpuType>
+ <RvctDeviceName></RvctDeviceName>
+ <mOS>0</mOS>
+ <uocRom>0</uocRom>
+ <uocRam>0</uocRam>
+ <hadIROM>1</hadIROM>
+ <hadIRAM>1</hadIRAM>
+ <hadXRAM>0</hadXRAM>
+ <uocXRam>0</uocXRam>
+ <RvdsVP>2</RvdsVP>
+ <hadIRAM2>0</hadIRAM2>
+ <hadIROM2>0</hadIROM2>
+ <StupSel>8</StupSel>
+ <useUlib>1</useUlib>
+ <EndSel>1</EndSel>
+ <uLtcg>0</uLtcg>
+ <nSecure>0</nSecure>
+ <RoSelD>3</RoSelD>
+ <RwSelD>3</RwSelD>
+ <CodeSel>0</CodeSel>
+ <OptFeed>0</OptFeed>
+ <NoZi1>0</NoZi1>
+ <NoZi2>0</NoZi2>
+ <NoZi3>0</NoZi3>
+ <NoZi4>0</NoZi4>
+ <NoZi5>0</NoZi5>
+ <Ro1Chk>0</Ro1Chk>
+ <Ro2Chk>0</Ro2Chk>
+ <Ro3Chk>0</Ro3Chk>
+ <Ir1Chk>1</Ir1Chk>
+ <Ir2Chk>0</Ir2Chk>
+ <Ra1Chk>0</Ra1Chk>
+ <Ra2Chk>0</Ra2Chk>
+ <Ra3Chk>0</Ra3Chk>
+ <Im1Chk>1</Im1Chk>
+ <Im2Chk>0</Im2Chk>
+ <OnChipMemories>
+ <Ocm1>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </Ocm1>
+ <Ocm2>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </Ocm2>
+ <Ocm3>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </Ocm3>
+ <Ocm4>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </Ocm4>
+ <Ocm5>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </Ocm5>
+ <Ocm6>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </Ocm6>
+ <IRAM>
+ <Type>0</Type>
+ <StartAddress>0x20000000</StartAddress>
+ <Size>0x40000</Size>
+ </IRAM>
+ <IROM>
+ <Type>1</Type>
+ <StartAddress>0x8000000</StartAddress>
+ <Size>0x1000000</Size>
+ </IROM>
+ <XRAM>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </XRAM>
+ <OCR_RVCT1>
+ <Type>1</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </OCR_RVCT1>
+ <OCR_RVCT2>
+ <Type>1</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </OCR_RVCT2>
+ <OCR_RVCT3>
+ <Type>1</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </OCR_RVCT3>
+ <OCR_RVCT4>
+ <Type>1</Type>
+ <StartAddress>0x8000000</StartAddress>
+ <Size>0x1000000</Size>
+ </OCR_RVCT4>
+ <OCR_RVCT5>
+ <Type>1</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </OCR_RVCT5>
+ <OCR_RVCT6>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </OCR_RVCT6>
+ <OCR_RVCT7>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </OCR_RVCT7>
+ <OCR_RVCT8>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </OCR_RVCT8>
+ <OCR_RVCT9>
+ <Type>0</Type>
+ <StartAddress>0x20000000</StartAddress>
+ <Size>0x40000</Size>
+ </OCR_RVCT9>
+ <OCR_RVCT10>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </OCR_RVCT10>
+ </OnChipMemories>
+ <RvctStartVector></RvctStartVector>
+ </ArmAdsMisc>
+ <Cads>
+ <interw>1</interw>
+ <Optim>4</Optim>
+ <oTime>0</oTime>
+ <SplitLS>0</SplitLS>
+ <OneElfS>1</OneElfS>
+ <Strict>0</Strict>
+ <EnumInt>0</EnumInt>
+ <PlainCh>0</PlainCh>
+ <Ropi>0</Ropi>
+ <Rwpi>0</Rwpi>
+ <wLevel>2</wLevel>
+ <uThumb>0</uThumb>
+ <uSurpInc>0</uSurpInc>
+ <uC99>0</uC99>
+ <uGnu>0</uGnu>
+ <useXO>0</useXO>
+ <v6Lang>1</v6Lang>
+ <v6LangP>1</v6LangP>
+ <vShortEn>1</vShortEn>
+ <vShortWch>1</vShortWch>
+ <v6Lto>0</v6Lto>
+ <v6WtE>0</v6WtE>
+ <v6Rtti>0</v6Rtti>
+ <VariousControls>
+ <MiscControls>--C99</MiscControls>
+ <Define>USE_STM32WBXX_NUCLEO,USE_HAL_DRIVER,STM32WB55xx</Define>
+ <Undefine></Undefine>
+ <IncludePath>../Core/Inc;../STM32_WPAN/App;../../../../../../Drivers/STM32WBxx_HAL_Driver/Inc;../../../../../../Drivers/STM32WBxx_HAL_Driver/Inc/Legacy;../../../../../../Middlewares/ST/STM32_WPAN;../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread;../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl;../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci;../../../../../../Middlewares/ST/STM32_WPAN/utilities;../../../../../../Utilities/lpm/tiny_lpm;../../../../../../Utilities/sequencer;../../../../../../Middlewares/ST/STM32_WPAN/ble;../../../../../../Middlewares/ST/STM32_WPAN/ble/core/template;../../../../../../Middlewares/ST/STM32_WPAN/ble/core;../../../../../../Drivers/CMSIS/Device/ST/STM32WBxx/Include;../../../../../../Drivers/CMSIS/Include;../../../../../../Drivers/BSP/P-NUCLEO-WB55.Nucleo;../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/lhci;../../../../../../Middlewares/ST/STM32_WPAN/ble/svc/Src;../../../../../../Middlewares/ST/STM32_WPAN/ble/svc/Inc</IncludePath>
+ </VariousControls>
+ </Cads>
+ <Aads>
+ <interw>1</interw>
+ <Ropi>0</Ropi>
+ <Rwpi>0</Rwpi>
+ <thumb>0</thumb>
+ <SplitLS>0</SplitLS>
+ <SwStkChk>0</SwStkChk>
+ <NoWarn>0</NoWarn>
+ <uSurpInc>0</uSurpInc>
+ <useXO>0</useXO>
+ <uClangAs>0</uClangAs>
+ <VariousControls>
+ <MiscControls></MiscControls>
+ <Define></Define>
+ <Undefine></Undefine>
+ <IncludePath></IncludePath>
+ </VariousControls>
+ </Aads>
+ <LDads>
+ <umfTarg>0</umfTarg>
+ <Ropi>0</Ropi>
+ <Rwpi>0</Rwpi>
+ <noStLib>0</noStLib>
+ <RepFail>1</RepFail>
+ <useFile>0</useFile>
+ <TextAddressRange>0x08000000</TextAddressRange>
+ <DataAddressRange>0x20000000</DataAddressRange>
+ <pXoBase></pXoBase>
+ <ScatterFile>stm32wb55xx_flash_cm4.sct</ScatterFile>
+ <IncludeLibs></IncludeLibs>
+ <IncludeLibsPath></IncludeLibsPath>
+ <Misc>--diag_suppress=L6329</Misc>
+ <LinkerInputFile></LinkerInputFile>
+ <DisabledWarnings></DisabledWarnings>
+ </LDads>
+ </TargetArmAds>
+ </TargetOption>
+ <Groups>
+ <Group>
+ <GroupName>Application/MDK-ARM</GroupName>
+ <Files>
+ <File>
+ <FileName>startup_stm32wb55xx_cm4.s</FileName>
+ <FileType>2</FileType>
+ <FilePath>startup_stm32wb55xx_cm4.s</FilePath>
+ </File>
+ </Files>
+ </Group>
+ <Group>
+ <GroupName>Application/User/Core</GroupName>
+ <Files>
+ <File>
+ <FileName>app_entry.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../Core/Src/app_entry.c</FilePath>
+ </File>
+ <File>
+ <FileName>hw_timerserver.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../Core/Src/hw_timerserver.c</FilePath>
+ </File>
+ <File>
+ <FileName>hw_uart.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../Core/Src/hw_uart.c</FilePath>
+ </File>
+ <File>
+ <FileName>main.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../Core/Src/main.c</FilePath>
+ </File>
+ <File>
+ <FileName>stm32_lpm_if.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../Core/Src/stm32_lpm_if.c</FilePath>
+ </File>
+ <File>
+ <FileName>stm32wbxx_hal_msp.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../Core/Src/stm32wbxx_hal_msp.c</FilePath>
+ </File>
+ <File>
+ <FileName>stm32wbxx_it.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../Core/Src/stm32wbxx_it.c</FilePath>
+ </File>
+ </Files>
+ </Group>
+ <Group>
+ <GroupName>Application/User/STM32_WPAN/App</GroupName>
+ <Files>
+ <File>
+ <FileName>app_ble_cl.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../STM32_WPAN/App/app_ble_cl.c</FilePath>
+ </File>
+ <File>
+ <FileName>app_ble_common.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../STM32_WPAN/App/app_ble_common.c</FilePath>
+ </File>
+ <File>
+ <FileName>app_ble_hr.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../STM32_WPAN/App/app_ble_hr.c</FilePath>
+ </File>
+ <File>
+ <FileName>app_ble_sv.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../STM32_WPAN/App/app_ble_sv.c</FilePath>
+ </File>
+ <File>
+ <FileName>dis_app.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../STM32_WPAN/App/dis_app.c</FilePath>
+ </File>
+ <File>
+ <FileName>hrs_app.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../STM32_WPAN/App/hrs_app.c</FilePath>
+ </File>
+ <File>
+ <FileName>p2p_client_app.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../STM32_WPAN/App/p2p_client_app.c</FilePath>
+ </File>
+ <File>
+ <FileName>p2p_server_app.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../STM32_WPAN/App/p2p_server_app.c</FilePath>
+ </File>
+ <File>
+ <FileName>uart_app.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../STM32_WPAN/App/uart_app.c</FilePath>
+ </File>
+ </Files>
+ </Group>
+ <Group>
+ <GroupName>Application/User/STM32_WPAN/Target</GroupName>
+ <Files>
+ <File>
+ <FileName>hw_ipcc.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../STM32_WPAN/Target/hw_ipcc.c</FilePath>
+ </File>
+ </Files>
+ </Group>
+ <Group>
+ <GroupName>Doc</GroupName>
+ <Files>
+ <File>
+ <FileName>readme.txt</FileName>
+ <FileType>5</FileType>
+ <FilePath>../readme.txt</FilePath>
+ </File>
+ </Files>
+ </Group>
+ <Group>
+ <GroupName>Drivers/BSP/P-NUCLEO-WB55.Nucleo</GroupName>
+ <Files>
+ <File>
+ <FileName>stm32wbxx_nucleo.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Drivers/BSP/P-NUCLEO-WB55.Nucleo/stm32wbxx_nucleo.c</FilePath>
+ </File>
+ </Files>
+ </Group>
+ <Group>
+ <GroupName>Drivers/CMSIS</GroupName>
+ <Files>
+ <File>
+ <FileName>system_stm32wbxx.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../Core/Src/system_stm32wbxx.c</FilePath>
+ </File>
+ </Files>
+ </Group>
+ <Group>
+ <GroupName>Drivers/STM32WBxx_HAL_Driver</GroupName>
+ <Files>
+ <File>
+ <FileName>stm32wbxx_hal.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal.c</FilePath>
+ </File>
+ <File>
+ <FileName>stm32wbxx_hal_cortex.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_cortex.c</FilePath>
+ </File>
+ <File>
+ <FileName>stm32wbxx_hal_dma.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_dma.c</FilePath>
+ </File>
+ <File>
+ <FileName>stm32wbxx_hal_dma_ex.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_dma_ex.c</FilePath>
+ </File>
+ <File>
+ <FileName>stm32wbxx_hal_flash.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_flash.c</FilePath>
+ </File>
+ <File>
+ <FileName>stm32wbxx_hal_flash_ex.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_flash_ex.c</FilePath>
+ </File>
+ <File>
+ <FileName>stm32wbxx_hal_gpio.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_gpio.c</FilePath>
+ </File>
+ <File>
+ <FileName>stm32wbxx_hal_hsem.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_hsem.c</FilePath>
+ </File>
+ <File>
+ <FileName>stm32wbxx_hal_ipcc.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_ipcc.c</FilePath>
+ </File>
+ <File>
+ <FileName>stm32wbxx_hal_pwr.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pwr.c</FilePath>
+ </File>
+ <File>
+ <FileName>stm32wbxx_hal_pwr_ex.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pwr_ex.c</FilePath>
+ </File>
+ <File>
+ <FileName>stm32wbxx_hal_rcc.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rcc.c</FilePath>
+ </File>
+ <File>
+ <FileName>stm32wbxx_hal_rcc_ex.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rcc_ex.c</FilePath>
+ </File>
+ <File>
+ <FileName>stm32wbxx_hal_rtc.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rtc.c</FilePath>
+ </File>
+ <File>
+ <FileName>stm32wbxx_hal_rtc_ex.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rtc_ex.c</FilePath>
+ </File>
+ <File>
+ <FileName>stm32wbxx_hal_tim.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_tim.c</FilePath>
+ </File>
+ <File>
+ <FileName>stm32wbxx_hal_tim_ex.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_tim_ex.c</FilePath>
+ </File>
+ <File>
+ <FileName>stm32wbxx_hal_uart.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_uart.c</FilePath>
+ </File>
+ <File>
+ <FileName>stm32wbxx_hal_uart_ex.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_uart_ex.c</FilePath>
+ </File>
+ </Files>
+ </Group>
+ <Group>
+ <GroupName>Middlewares/STM32_WPAN</GroupName>
+ <Files>
+ <File>
+ <FileName>ble_gap_aci.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Middlewares/ST/STM32_WPAN/ble/core/auto/ble_gap_aci.c</FilePath>
+ </File>
+ <File>
+ <FileName>ble_gatt_aci.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Middlewares/ST/STM32_WPAN/ble/core/auto/ble_gatt_aci.c</FilePath>
+ </File>
+ <File>
+ <FileName>ble_hal_aci.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Middlewares/ST/STM32_WPAN/ble/core/auto/ble_hal_aci.c</FilePath>
+ </File>
+ <File>
+ <FileName>ble_hci_le.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Middlewares/ST/STM32_WPAN/ble/core/auto/ble_hci_le.c</FilePath>
+ </File>
+ <File>
+ <FileName>ble_l2cap_aci.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Middlewares/ST/STM32_WPAN/ble/core/auto/ble_l2cap_aci.c</FilePath>
+ </File>
+ <File>
+ <FileName>dbg_trace.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Middlewares/ST/STM32_WPAN/utilities/dbg_trace.c</FilePath>
+ </File>
+ <File>
+ <FileName>dis.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Middlewares/ST/STM32_WPAN/ble/svc/Src/dis.c</FilePath>
+ </File>
+ <File>
+ <FileName>hci_tl.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/hci_tl.c</FilePath>
+ </File>
+ <File>
+ <FileName>hci_tl_if.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/hci_tl_if.c</FilePath>
+ </File>
+ <File>
+ <FileName>hrs.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Middlewares/ST/STM32_WPAN/ble/svc/Src/hrs.c</FilePath>
+ </File>
+ <File>
+ <FileName>lhci.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/lhci/lhci.c</FilePath>
+ </File>
+ <File>
+ <FileName>osal.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Middlewares/ST/STM32_WPAN/ble/core/template/osal.c</FilePath>
+ </File>
+ <File>
+ <FileName>otp.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Middlewares/ST/STM32_WPAN/utilities/otp.c</FilePath>
+ </File>
+ <File>
+ <FileName>p2p_stm.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Middlewares/ST/STM32_WPAN/ble/svc/Src/p2p_stm.c</FilePath>
+ </File>
+ <File>
+ <FileName>shci.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci/shci.c</FilePath>
+ </File>
+ <File>
+ <FileName>shci_tl.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/shci_tl.c</FilePath>
+ </File>
+ <File>
+ <FileName>shci_tl_if.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/shci_tl_if.c</FilePath>
+ </File>
+ <File>
+ <FileName>stm_list.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Middlewares/ST/STM32_WPAN/utilities/stm_list.c</FilePath>
+ </File>
+ <File>
+ <FileName>stm_queue.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Middlewares/ST/STM32_WPAN/utilities/stm_queue.c</FilePath>
+ </File>
+ <File>
+ <FileName>tl_mbox.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_mbox.c</FilePath>
+ </File>
+ <File>
+ <FileName>svc_ctl.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\svc\Src\svc_ctl.c</FilePath>
+ </File>
+ </Files>
+ </Group>
+ <Group>
+ <GroupName>Utilities</GroupName>
+ <Files>
+ <File>
+ <FileName>stm32_lpm.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Utilities/lpm/tiny_lpm/stm32_lpm.c</FilePath>
+ </File>
+ <File>
+ <FileName>stm32_seq.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>../../../../../../Utilities/sequencer/stm32_seq.c</FilePath>
+ </File>
+ </Files>
+ </Group>
+ </Groups>
+ </Target>
+ </Targets>
+
+ <RTE>
+ <apis/>
+ <components/>
+ <files/>
+ </RTE>
+
+</Project>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/MDK-ARM/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/MDK-ARM/startup_stm32wb55xx_cm4.s
new file mode 100644
index 000000000..e05e3c5ca
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/MDK-ARM/startup_stm32wb55xx_cm4.s
@@ -0,0 +1,368 @@
+;******************************************************************************
+;* File Name : startup_stm32wb55xx_cm4.s
+;* Author : MCD Application Team
+;* Description : STM32WB55xx devices vector table for MDK-ARM toolchain.
+;* This module performs:
+;* - Set the initial SP
+;* - Set the initial PC == Reset_Handler
+;* - Set the vector table entries with the exceptions ISR address
+;* - Branches to __main in the C library (which eventually
+;* calls main()).
+;* After Reset the CortexM4 processor is in Thread mode,
+;* priority is Privileged, and the Stack is set to Main.
+;* <<< Use Configuration Wizard in Context Menu >>>
+;******************************************************************************
+;* @attention
+;*
+;* Copyright (c) 2019 STMicroelectronics. All rights reserved.
+;*
+;* This software component is licensed by ST under BSD 3-Clause license,
+;* the "License"; You may not use this file except in compliance with the
+;* License. You may obtain a copy of the License at:
+;* opensource.org/licenses/BSD-3-Clause
+;*
+;******************************************************************************
+
+; Amount of memory (in bytes) allocated for Stack
+; Tailor this value to your application needs
+; <h> Stack Configuration
+; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+
+Stack_Size EQU 0x1000
+
+ AREA STACK, NOINIT, READWRITE, ALIGN=3
+Stack_Mem SPACE Stack_Size
+__initial_sp
+
+
+; <h> Heap Configuration
+; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+; </h>
+
+Heap_Size EQU 0x400
+
+ AREA HEAP, NOINIT, READWRITE, ALIGN=3
+__heap_base
+Heap_Mem SPACE Heap_Size
+__heap_limit
+
+ PRESERVE8
+ THUMB
+
+
+; Vector Table Mapped to Address 0 at Reset
+ AREA RESET, DATA, READONLY
+ EXPORT __Vectors
+ EXPORT __Vectors_End
+ EXPORT __Vectors_Size
+
+__Vectors DCD __initial_sp ; Top of Stack
+ DCD Reset_Handler ; Reset Handler
+ DCD NMI_Handler ; NMI Handler
+ DCD HardFault_Handler ; Hard Fault Handler
+ DCD MemManage_Handler ; MPU Fault Handler
+ DCD BusFault_Handler ; Bus Fault Handler
+ DCD UsageFault_Handler ; Usage Fault Handler
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD SVC_Handler ; SVCall Handler
+ DCD DebugMon_Handler ; Debug Monitor Handler
+ DCD 0 ; Reserved
+ DCD PendSV_Handler ; PendSV Handler
+ DCD SysTick_Handler ; SysTick Handler
+
+ ; External Interrupts
+ DCD WWDG_IRQHandler ; Window WatchDog
+ DCD PVD_PVM_IRQHandler ; PVD and PVM detector
+ DCD TAMP_STAMP_LSECSS_IRQHandler ; RTC Tamper and TimeStamp Interrupts and LSECSS Interrupts
+ DCD RTC_WKUP_IRQHandler ; RTC Wakeup Interrupt
+ DCD FLASH_IRQHandler ; FLASH global Interrupt
+ DCD RCC_IRQHandler ; RCC Interrupt
+ DCD EXTI0_IRQHandler ; EXTI Line 0 Interrupt
+ DCD EXTI1_IRQHandler ; EXTI Line 1 Interrupt
+ DCD EXTI2_IRQHandler ; EXTI Line 2 Interrupt
+ DCD EXTI3_IRQHandler ; EXTI Line 3 Interrup
+ DCD EXTI4_IRQHandler ; EXTI Line 4 Interrupt
+ DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 Interrupt
+ DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2 Interrupt
+ DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3 Interrupt
+ DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4 Interrupt
+ DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5 Interrupt
+ DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6 Interrupt
+ DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7 Interrupt
+ DCD ADC1_IRQHandler ; ADC1 Interrupt
+ DCD USB_HP_IRQHandler ; USB High Priority Interrupt
+ DCD USB_LP_IRQHandler ; USB Low Priority Interrupt
+ DCD C2SEV_PWR_C2H_IRQHandler ; CPU M0+ SEV Interrupt
+ DCD COMP_IRQHandler ; COMP1 and COMP2 Interrupts
+ DCD EXTI9_5_IRQHandler ; EXTI Lines [9:5] Interrupt
+ DCD TIM1_BRK_IRQHandler ; TIM1 Break Interrupt
+ DCD TIM1_UP_TIM16_IRQHandler ; TIM1 Update and TIM16 global Interrupts
+ DCD TIM1_TRG_COM_TIM17_IRQHandler ; TIM1 Trigger and Communication and TIM17 global Interrupts
+ DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare Interrupt
+ DCD TIM2_IRQHandler ; TIM2 Global Interrupt
+ DCD PKA_IRQHandler ; PKA Interrupt
+ DCD I2C1_EV_IRQHandler ; I2C1 Event Interrupt
+ DCD I2C1_ER_IRQHandler ; I2C1 Error Interrupt
+ DCD I2C3_EV_IRQHandler ; I2C3 Event Interrupt
+ DCD I2C3_ER_IRQHandler ; I2C3 Error Interrupt
+ DCD SPI1_IRQHandler ; SPI1 Interrupt
+ DCD SPI2_IRQHandler ; SPI2 Interrupt
+ DCD USART1_IRQHandler ; USART1 Interrupt
+ DCD LPUART1_IRQHandler ; LPUART1 Interrupt
+ DCD SAI1_IRQHandler ; SAI Interrupt
+ DCD TSC_IRQHandler ; TSC Interrupt
+ DCD EXTI15_10_IRQHandler ; EXTI Lines1[15:10 ]Interrupts
+ DCD RTC_Alarm_IRQHandler ; RTC Alarms (A and B) Interrupt
+ DCD CRS_IRQHandler ; CRS interrupt
+ DCD PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler ; WKUP Interrupt from PWR
+ DCD IPCC_C1_RX_IRQHandler ; IPCC CPU1 RX occupied interrupt
+ DCD IPCC_C1_TX_IRQHandler ; IPCC CPU1 RX free interrupt
+ DCD HSEM_IRQHandler ; HSEM0 Interrupt
+ DCD LPTIM1_IRQHandler ; LPTIM1 Interrupt
+ DCD LPTIM2_IRQHandler ; LPTIM2 Interrupt
+ DCD LCD_IRQHandler ; LCD Interrupt
+ DCD QUADSPI_IRQHandler ; QUADSPI Interrupt
+ DCD AES1_IRQHandler ; AES1 Interrupt
+ DCD AES2_IRQHandler ; AES2 Interrupt
+ DCD RNG_IRQHandler ; RNG1 Interrupt
+ DCD FPU_IRQHandler ; FPU Interrupt
+ DCD DMA2_Channel1_IRQHandler ; DMA2 Channel 1 Interrupt
+ DCD DMA2_Channel2_IRQHandler ; DMA2 Channel 2 Interrupt
+ DCD DMA2_Channel3_IRQHandler ; DMA2 Channel 3 Interrupt
+ DCD DMA2_Channel4_IRQHandler ; DMA2 Channel 4 Interrupt
+ DCD DMA2_Channel5_IRQHandler ; DMA2 Channel 5 Interrupt
+ DCD DMA2_Channel6_IRQHandler ; DMA2 Channel 6 Interrupt
+ DCD DMA2_Channel7_IRQHandler ; DMA2 Channel 7 Interrupt
+ DCD DMAMUX1_OVR_IRQHandler ; DMAMUX overrun Interrupt
+
+__Vectors_End
+
+__Vectors_Size EQU __Vectors_End - __Vectors
+
+ AREA |.text|, CODE, READONLY
+
+; Reset handler
+Reset_Handler PROC
+ EXPORT Reset_Handler [WEAK]
+ IMPORT SystemInit
+ IMPORT __main
+
+ LDR R0, =SystemInit
+ BLX R0
+ LDR R0, =__main
+ BX R0
+ ENDP
+
+; Dummy Exception Handlers (infinite loops which can be modified)
+
+NMI_Handler PROC
+ EXPORT NMI_Handler [WEAK]
+ B .
+ ENDP
+HardFault_Handler\
+ PROC
+ EXPORT HardFault_Handler [WEAK]
+ B .
+ ENDP
+MemManage_Handler\
+ PROC
+ EXPORT MemManage_Handler [WEAK]
+ B .
+ ENDP
+BusFault_Handler\
+ PROC
+ EXPORT BusFault_Handler [WEAK]
+ B .
+ ENDP
+UsageFault_Handler\
+ PROC
+ EXPORT UsageFault_Handler [WEAK]
+ B .
+ ENDP
+SVC_Handler PROC
+ EXPORT SVC_Handler [WEAK]
+ B .
+ ENDP
+DebugMon_Handler\
+ PROC
+ EXPORT DebugMon_Handler [WEAK]
+ B .
+ ENDP
+PendSV_Handler PROC
+ EXPORT PendSV_Handler [WEAK]
+ B .
+ ENDP
+SysTick_Handler PROC
+ EXPORT SysTick_Handler [WEAK]
+ B .
+ ENDP
+
+Default_Handler PROC
+
+ EXPORT WWDG_IRQHandler [WEAK]
+ EXPORT PVD_PVM_IRQHandler [WEAK]
+ EXPORT TAMP_STAMP_LSECSS_IRQHandler [WEAK]
+ EXPORT RTC_WKUP_IRQHandler [WEAK]
+ EXPORT FLASH_IRQHandler [WEAK]
+ EXPORT RCC_IRQHandler [WEAK]
+ EXPORT EXTI0_IRQHandler [WEAK]
+ EXPORT EXTI1_IRQHandler [WEAK]
+ EXPORT EXTI2_IRQHandler [WEAK]
+ EXPORT EXTI3_IRQHandler [WEAK]
+ EXPORT EXTI4_IRQHandler [WEAK]
+ EXPORT DMA1_Channel1_IRQHandler [WEAK]
+ EXPORT DMA1_Channel2_IRQHandler [WEAK]
+ EXPORT DMA1_Channel3_IRQHandler [WEAK]
+ EXPORT DMA1_Channel4_IRQHandler [WEAK]
+ EXPORT DMA1_Channel5_IRQHandler [WEAK]
+ EXPORT DMA1_Channel6_IRQHandler [WEAK]
+ EXPORT DMA1_Channel7_IRQHandler [WEAK]
+ EXPORT ADC1_IRQHandler [WEAK]
+ EXPORT USB_HP_IRQHandler [WEAK]
+ EXPORT USB_LP_IRQHandler [WEAK]
+ EXPORT C2SEV_PWR_C2H_IRQHandler [WEAK]
+ EXPORT COMP_IRQHandler [WEAK]
+ EXPORT EXTI9_5_IRQHandler [WEAK]
+ EXPORT TIM1_BRK_IRQHandler [WEAK]
+ EXPORT TIM1_UP_TIM16_IRQHandler [WEAK]
+ EXPORT TIM1_TRG_COM_TIM17_IRQHandler [WEAK]
+ EXPORT TIM1_CC_IRQHandler [WEAK]
+ EXPORT TIM2_IRQHandler [WEAK]
+ EXPORT PKA_IRQHandler [WEAK]
+ EXPORT I2C1_EV_IRQHandler [WEAK]
+ EXPORT I2C1_ER_IRQHandler [WEAK]
+ EXPORT I2C3_EV_IRQHandler [WEAK]
+ EXPORT I2C3_ER_IRQHandler [WEAK]
+ EXPORT SPI1_IRQHandler [WEAK]
+ EXPORT SPI2_IRQHandler [WEAK]
+ EXPORT USART1_IRQHandler [WEAK]
+ EXPORT LPUART1_IRQHandler [WEAK]
+ EXPORT SAI1_IRQHandler [WEAK]
+ EXPORT TSC_IRQHandler [WEAK]
+ EXPORT EXTI15_10_IRQHandler [WEAK]
+ EXPORT RTC_Alarm_IRQHandler [WEAK]
+ EXPORT CRS_IRQHandler [WEAK]
+ EXPORT PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler [WEAK]
+ EXPORT IPCC_C1_RX_IRQHandler [WEAK]
+ EXPORT IPCC_C1_TX_IRQHandler [WEAK]
+ EXPORT HSEM_IRQHandler [WEAK]
+ EXPORT LPTIM1_IRQHandler [WEAK]
+ EXPORT LPTIM2_IRQHandler [WEAK]
+ EXPORT LCD_IRQHandler [WEAK]
+ EXPORT QUADSPI_IRQHandler [WEAK]
+ EXPORT AES1_IRQHandler [WEAK]
+ EXPORT AES2_IRQHandler [WEAK]
+ EXPORT RNG_IRQHandler [WEAK]
+ EXPORT FPU_IRQHandler [WEAK]
+ EXPORT DMA2_Channel1_IRQHandler [WEAK]
+ EXPORT DMA2_Channel2_IRQHandler [WEAK]
+ EXPORT DMA2_Channel3_IRQHandler [WEAK]
+ EXPORT DMA2_Channel4_IRQHandler [WEAK]
+ EXPORT DMA2_Channel5_IRQHandler [WEAK]
+ EXPORT DMA2_Channel6_IRQHandler [WEAK]
+ EXPORT DMA2_Channel7_IRQHandler [WEAK]
+ EXPORT DMAMUX1_OVR_IRQHandler [WEAK]
+
+WWDG_IRQHandler
+PVD_PVM_IRQHandler
+TAMP_STAMP_LSECSS_IRQHandler
+RTC_WKUP_IRQHandler
+FLASH_IRQHandler
+RCC_IRQHandler
+EXTI0_IRQHandler
+EXTI1_IRQHandler
+EXTI2_IRQHandler
+EXTI3_IRQHandler
+EXTI4_IRQHandler
+DMA1_Channel1_IRQHandler
+DMA1_Channel2_IRQHandler
+DMA1_Channel3_IRQHandler
+DMA1_Channel4_IRQHandler
+DMA1_Channel5_IRQHandler
+DMA1_Channel6_IRQHandler
+DMA1_Channel7_IRQHandler
+ADC1_IRQHandler
+USB_HP_IRQHandler
+USB_LP_IRQHandler
+C2SEV_PWR_C2H_IRQHandler
+COMP_IRQHandler
+EXTI9_5_IRQHandler
+TIM1_BRK_IRQHandler
+TIM1_UP_TIM16_IRQHandler
+TIM1_TRG_COM_TIM17_IRQHandler
+TIM1_CC_IRQHandler
+TIM2_IRQHandler
+PKA_IRQHandler
+I2C1_EV_IRQHandler
+I2C1_ER_IRQHandler
+I2C3_EV_IRQHandler
+I2C3_ER_IRQHandler
+SPI1_IRQHandler
+SPI2_IRQHandler
+USART1_IRQHandler
+LPUART1_IRQHandler
+SAI1_IRQHandler
+TSC_IRQHandler
+EXTI15_10_IRQHandler
+RTC_Alarm_IRQHandler
+CRS_IRQHandler
+PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler
+IPCC_C1_RX_IRQHandler
+IPCC_C1_TX_IRQHandler
+HSEM_IRQHandler
+LPTIM1_IRQHandler
+LPTIM2_IRQHandler
+LCD_IRQHandler
+QUADSPI_IRQHandler
+AES1_IRQHandler
+AES2_IRQHandler
+RNG_IRQHandler
+FPU_IRQHandler
+DMA2_Channel1_IRQHandler
+DMA2_Channel2_IRQHandler
+DMA2_Channel3_IRQHandler
+DMA2_Channel4_IRQHandler
+DMA2_Channel5_IRQHandler
+DMA2_Channel6_IRQHandler
+DMA2_Channel7_IRQHandler
+DMAMUX1_OVR_IRQHandler
+
+ B .
+
+ ENDP
+
+ ALIGN
+
+;*******************************************************************************
+; User Stack and Heap initialization
+;*******************************************************************************
+ IF :DEF:__MICROLIB
+
+ EXPORT __initial_sp
+ EXPORT __heap_base
+ EXPORT __heap_limit
+
+ ELSE
+
+ IMPORT __use_two_region_memory
+ EXPORT __user_initial_stackheap
+
+__user_initial_stackheap
+
+ LDR R0, = Heap_Mem
+ LDR R1, =(Stack_Mem + Stack_Size)
+ LDR R2, = (Heap_Mem + Heap_Size)
+ LDR R3, = Stack_Mem
+ BX LR
+
+ ALIGN
+
+ ENDIF
+
+ END
+
+;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE*****
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/MDK-ARM/stm32wb55xx_flash_cm4.sct b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/MDK-ARM/stm32wb55xx_flash_cm4.sct
new file mode 100644
index 000000000..63845c07b
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/MDK-ARM/stm32wb55xx_flash_cm4.sct
@@ -0,0 +1,21 @@
+; *************************************************************
+; *** Scatter-Loading Description File generated by uVision ***
+; *************************************************************
+
+LR_IROM1 0x08000000 0x00080000 { ; load region size_region
+ ER_IROM1 0x08000000 0x00080000 { ; load address = execution address
+ *.o (RESET, +First)
+ *(InRoot$$Sections)
+ .ANY (+RO)
+ }
+ RW_IRAM1 0x20000004 0x2FFFC { ; RW data
+ .ANY (+RW +ZI)
+ }
+ RW_RAM_SHARED 0x20030000 0x2800 { ; RW data
+ *(MAPPING_TABLE)
+ *(MB_MEM1)
+ *(MB_MEM2)
+ }
+ }
+
+
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_cl.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_cl.c
new file mode 100644
index 000000000..d126fc44e
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_cl.c
@@ -0,0 +1,1142 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file app_ble_cl.c
+ * @author MCD Application Team
+ * @brief BLE Application
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+
+#include "dbg_trace.h"
+
+#include "ble.h"
+#include "tl.h"
+#include "app_ble_cl.h"
+
+#include "stm32_seq.h"
+#include "shci.h"
+#include "stm32_lpm.h"
+#include "otp.h"
+
+#include "p2p_client_app.h"
+#include "uart_app.h"
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+#include "main.h"
+/* USER CODE END Includes */
+
+extern uint8_t BD_Addr[6];
+
+extern Disconnection_Status_t disconnection_status; //0 disconnection from Remote; 1 disconnection from Application to switch of BLE App; 2 disconnection ordered by AT command
+
+extern uint8_t autoconn_status;
+
+extern PairingContext_t PairingContext;
+
+/* Private typedef -----------------------------------------------------------*/
+
+/**
+ * security parameters structure
+ */
+typedef struct _tSecurityParams
+{
+/**
+ * IO capability of the device
+ */
+uint8_t ioCapability;
+
+/**
+ * Authentication requirement of the device
+ * Man In the Middle protection required?
+ */
+uint8_t mitm_mode;
+
+/**
+ * bonding mode of the device
+ */
+uint8_t bonding_mode;
+
+/**
+ * Flag to tell whether OOB data has
+ * to be used during the pairing process
+ */
+uint8_t OOB_Data_Present;
+
+/**
+ * OOB data to be used in the pairing process if
+ * OOB_Data_Present is set to TRUE
+ */
+uint8_t OOB_Data[16];
+
+/**
+ * this variable indicates whether to use a fixed pin
+ * during the pairing process or a passkey has to be
+ * requested to the application during the pairing process
+ * 0 implies use fixed pin and 1 implies request for passkey
+ */
+uint8_t Use_Fixed_Pin;
+
+/**
+ * minimum encryption key size requirement
+ */
+uint8_t encryptionKeySizeMin;
+
+/**
+ * maximum encryption key size requirement
+ */
+uint8_t encryptionKeySizeMax;
+
+/**
+ * fixed pin to be used in the pairing process if
+ * Use_Fixed_Pin is set to 1
+ */
+uint32_t Fixed_Pin;
+
+/**
+ * this flag indicates whether the host has to initiate
+ * the security, wait for pairing or does not have any security
+ * requirements.\n
+ * 0x00 : no security required
+ * 0x01 : host should initiate security by sending the slave security
+ * request command
+ * 0x02 : host need not send the clave security request but it
+ * has to wait for paiirng to complete before doing any other
+ * processing
+ */
+uint8_t initiateSecurity;
+} tSecurityParams;
+
+/**
+ * global context
+ * contains the variables common to all
+ * services
+ */
+typedef struct _tBLEProfileGlobalContext
+{
+
+/**
+ * security requirements of the host
+ */
+tSecurityParams bleSecurityParam;
+
+/**
+ * gap service handle
+ */
+uint16_t gapServiceHandle;
+
+/**
+ * device name characteristic handle
+ */
+uint16_t devNameCharHandle;
+
+/**
+ * appearance characteristic handle
+ */
+uint16_t appearanceCharHandle;
+
+ /**
+ * connection handle of the current active connection
+ * When not in connection, the handle is set to 0xFFFF
+ */
+ uint16_t connectionHandle;
+
+/**
+ * length of the UUID list to be used while advertising
+ */
+uint8_t advtServUUIDlen;
+
+/**
+ * the UUID list to be used while advertising
+ */
+uint8_t advtServUUID[100];
+
+} BleGlobalContext_t;
+
+typedef struct
+{
+BleGlobalContext_t BleApplicationContext_legacy;
+APP_BLE_ConnStatus_t Device_Connection_Status;
+uint8_t SwitchOffGPIO_timer_Id;
+uint8_t DeviceServerFound;
+} BleApplicationContext_t;
+
+/* USER CODE BEGIN PTD */
+
+/* USER CODE END PTD */
+
+/* Private defines -----------------------------------------------------------*/
+#define APPBLE_GAP_DEVICE_NAME_LENGTH 7
+#define BD_ADDR_SIZE_LOCAL 6
+
+/* USER CODE BEGIN PD */
+/* USER CODE END PD */
+
+/* Private macros ------------------------------------------------------------*/
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private variables ---------------------------------------------------------*/
+PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static TL_CmdPacket_t BleCmdBuffer;
+
+static const uint8_t M_bd_addr[BD_ADDR_SIZE_LOCAL] =
+ {
+ (uint8_t)((CFG_ADV_BD_ADDRESS & 0x0000000000FF)),
+ (uint8_t)((CFG_ADV_BD_ADDRESS & 0x00000000FF00) >> 8),
+ (uint8_t)((CFG_ADV_BD_ADDRESS & 0x000000FF0000) >> 16),
+ (uint8_t)((CFG_ADV_BD_ADDRESS & 0x0000FF000000) >> 24),
+ (uint8_t)((CFG_ADV_BD_ADDRESS & 0x00FF00000000) >> 32),
+ (uint8_t)((CFG_ADV_BD_ADDRESS & 0xFF0000000000) >> 40)
+ };
+
+static uint8_t bd_addr_udn[BD_ADDR_SIZE_LOCAL];
+
+/**
+* Identity root key used to derive LTK and CSRK
+*/
+static const uint8_t BLE_CFG_IR_VALUE[16] = CFG_BLE_IRK;
+
+/**
+* Encryption root key used to derive LTK and CSRK
+*/
+static const uint8_t BLE_CFG_ER_VALUE[16] = CFG_BLE_ERK;
+
+tBDAddr SERVER_REMOTE_BDADDR[5];
+uint8_t index_bd_addr;
+
+P2PC_APP_ConnHandle_Not_evt_t handleNotificationCL;
+
+PLACE_IN_SECTION("BLE_APP_CONTEXT") static BleApplicationContext_t BleApplicationContext;
+
+/* USER CODE BEGIN PV */
+
+APP_BLE_ConnStatus_t CL_Connection_Status;
+
+static char bd_address_str[12];
+
+static aci_l2cap_connection_update_req_event_rp0 *l2cap_conn_upd_req_event;
+
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+static void BLE_UserEvtRx( void * pPayload );
+static void BLE_StatusNot( HCI_TL_CmdStatus_t status );
+static void Ble_Tl_Init( void );
+static void Ble_Hci_Gap_Gatt_Init(void);
+static const uint8_t* BleGetBdAddress( void );
+static void Scan_Request( void );
+static void Connect_Request( void );
+//static void Switch_OFF_GPIO( void );
+static void APP_BLE_CL_GAP_Disconnect( void );
+static void BLE_CL_L2CAP_Conn_Update( void );
+static void Confirm_Pairing( void );
+static void Pairing_Request ( void );
+
+/* USER CODE BEGIN PFP */
+
+/* USER CODE END PFP */
+
+/* Private user code ---------------------------------------------------------*/
+/* USER CODE BEGIN 0 */
+
+/* USER CODE END 0 */
+
+/* Functions Definition ------------------------------------------------------*/
+void APP_BLE_CL_Init( void )
+{
+/* USER CODE BEGIN APP_BLE_Init_1 */
+
+ index_bd_addr = 0;
+
+/* USER CODE END APP_BLE_Init_1 */
+ SHCI_C2_Ble_Init_Cmd_Packet_t ble_init_cmd_packet =
+ {
+ {{0,0,0}}, /**< Header unused */
+ {0, /** pBleBufferAddress not used */
+ 0, /** BleBufferSize not used */
+ CFG_BLE_NUM_GATT_ATTRIBUTES,
+ CFG_BLE_NUM_GATT_SERVICES,
+ CFG_BLE_ATT_VALUE_ARRAY_SIZE,
+ CFG_BLE_NUM_LINK,
+ CFG_BLE_DATA_LENGTH_EXTENSION,
+ CFG_BLE_PREPARE_WRITE_LIST_SIZE,
+ CFG_BLE_MBLOCK_COUNT,
+ CFG_BLE_MAX_ATT_MTU,
+ CFG_BLE_SLAVE_SCA,
+ CFG_BLE_MASTER_SCA,
+ CFG_BLE_LSE_SOURCE,
+ CFG_BLE_MAX_CONN_EVENT_LENGTH,
+ CFG_BLE_HSE_STARTUP_TIME,
+ CFG_BLE_VITERBI_MODE,
+ CFG_BLE_LL_ONLY,
+ 0}
+ };
+
+ /**
+ * Initialize Ble Transport Layer
+ */
+ Ble_Tl_Init( );
+
+ /**
+ * Do not allow standby in the application
+ */
+ UTIL_LPM_SetOffMode(1 << CFG_LPM_APP_BLE, UTIL_LPM_DISABLE);
+
+/**
+ * Register the hci transport layer to handle BLE User Asynchronous Events
+ */
+ UTIL_SEQ_RegTask( 1<<CFG_TASK_HCI_ASYNCH_EVT_ID, UTIL_SEQ_RFU, hci_user_evt_proc);
+
+ /**
+ * Starts the BLE Stack on CPU2
+ */
+ SHCI_C2_BLE_Init( &ble_init_cmd_packet );
+
+ /**
+ * Initialization of HCI & GATT & GAP layer
+ */
+ Ble_Hci_Gap_Gatt_Init();
+
+ /**
+ * Initialization of the BLE Services
+ */
+ SVCCTL_Init();
+
+ /**
+ * From here, all initialization are BLE application specific
+ */
+ UTIL_SEQ_RegTask( 1<<CFG_TASK_START_SCAN_ID, UTIL_SEQ_RFU, Scan_Request);
+ UTIL_SEQ_RegTask( 1<<CFG_TASK_CONN_DEV_1_ID, UTIL_SEQ_RFU, Connect_Request);
+ UTIL_SEQ_RegTask( 1<<CFG_TASK_CL_GAP_DISCON_ID, UTIL_SEQ_RFU, APP_BLE_CL_GAP_Disconnect);
+ UTIL_SEQ_RegTask( 1<<CFG_TASK_CL_L2CAP_CONN_UPDATE_RESP_ID, UTIL_SEQ_RFU, BLE_CL_L2CAP_Conn_Update);
+ UTIL_SEQ_RegTask( 1<<CFG_TASK_CONFIRM_PAIRING_ID, UTIL_SEQ_RFU, Confirm_Pairing);
+ UTIL_SEQ_RegTask( 1<<CFG_TASK_REQUEST_PAIRING_ID, UTIL_SEQ_RFU, Pairing_Request);
+
+ /**
+ * Initialization of the BLE App Context
+ */
+
+ BleApplicationContext.Device_Connection_Status = APP_BLE_IDLE;
+ CL_Connection_Status = APP_BLE_IDLE;
+
+ /**
+ * Initialize P2P Client Application
+ */
+ P2PC_APP_Init();
+
+/* USER CODE BEGIN APP_BLE_Init_2 */
+
+ /**
+ * Send a acknowledgement of the correct initialization of the p2p application
+ */
+ UART_App_SendData("\r\nCL OK\r\n", 9);
+
+/* USER CODE END APP_BLE_Init_2 */
+ return;
+}
+
+SVCCTL_UserEvtFlowStatus_t SVCCTL_App_CL_Notification( void *pckt )
+{
+ hci_event_pckt *event_pckt;
+ evt_le_meta_event *meta_evt;
+ hci_le_connection_complete_event_rp0 * connection_complete_event;
+ evt_blue_aci *blue_evt;
+ hci_le_advertising_report_event_rp0 * le_advertising_event;
+ event_pckt = (hci_event_pckt*) ((hci_uart_pckt *) pckt)->data;
+ hci_disconnection_complete_event_rp0 *cc = (void *) event_pckt->data;
+
+ /* Pairing */
+ aci_gap_numeric_comparison_value_event_rp0 *evt_numeric_value;
+ aci_gap_pairing_complete_event_rp0 *pairing_complete;
+ uint32_t numeric_value;
+ char numeric_value_str[20];
+ /*****/
+
+ uint8_t result;
+ uint8_t event_type, event_data_size;
+ int k = 0;
+ uint8_t adtype, adlength;
+
+ int i;
+ uint8_t different;
+
+ switch (event_pckt->evt)
+ {
+ /* USER CODE BEGIN evt */
+
+ /* USER CODE END evt */
+ case EVT_VENDOR:
+ {
+ handleNotificationCL.P2P_Evt_Opcode = PEERC_DISCON_HANDLE_EVT;
+ blue_evt = (evt_blue_aci*) event_pckt->data;
+ /* USER CODE BEGIN EVT_VENDOR */
+
+ /* USER CODE END EVT_VENDOR */
+ switch (blue_evt->ecode)
+ {
+ /* USER CODE BEGIN ecode */
+ case EVT_BLUE_GAP_SLAVE_SECURITY_INITIATED:
+// UTIL_SEQ_SetTask( 1<<CFG_TASK_REQUEST_PAIRING_ID, CFG_SCH_PRIO_0);
+ break;
+
+ case EVT_BLUE_GAP_NUMERIC_COMPARISON_VALUE :
+ UART_App_SendData("\r\n", 2);
+ PairingContext.PairingConfirmRequested = 1;
+ evt_numeric_value = (aci_gap_numeric_comparison_value_event_rp0 *)blue_evt->data;
+ numeric_value = evt_numeric_value->Numeric_Value;
+ sprintf(numeric_value_str, "%d", (int)numeric_value);
+ UART_App_SendData((char *)numeric_value_str, (uint8_t)(strlen(numeric_value_str)));
+ UART_App_SendData(":PREQ?\r\n", 8);
+ break;
+
+ case EVT_BLUE_GAP_PAIRING_CMPLT :
+ pairing_complete = (aci_gap_pairing_complete_event_rp0*)blue_evt->data;
+ if (pairing_complete->Status == 0)
+ {
+ UART_App_SendData("\r\nP\r\n", 5);
+ PairingContext.PairingComplete = 1;
+ }
+ else UART_App_SendData("\r\nF\r\n", 5);
+ break;
+ /* USER CODE END ecode */
+
+ case EVT_BLUE_GAP_PROCEDURE_COMPLETE:
+ {
+ /* USER CODE BEGIN EVT_BLUE_GAP_PROCEDURE_COMPLETE */
+
+ /* USER CODE END EVT_BLUE_GAP_PROCEDURE_COMPLETE */
+ aci_gap_proc_complete_event_rp0 *gap_evt_proc_complete = (void*) blue_evt->data;
+ /* CHECK GAP GENERAL DISCOVERY PROCEDURE COMPLETED & SUCCEED */
+ if (gap_evt_proc_complete->Procedure_Code == GAP_GENERAL_DISCOVERY_PROC
+ && gap_evt_proc_complete->Status == 0x00)
+ {
+ /* USER CODE BEGIN GAP_GENERAL_DISCOVERY_PROC */
+ BSP_LED_Off(LED_BLUE);
+ if(!autoconn_status) UART_App_SendData("\r\nOK\r\n", 6);
+ /* USER CODE END GAP_GENERAL_DISCOVERY_PROC */
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("-- GAP GENERAL DISCOVERY PROCEDURE_COMPLETED\n");
+#endif
+ if(autoconn_status)
+ {
+ /* if the bd address given by the user correspond to the device found, connect to it */
+ if (BleApplicationContext.DeviceServerFound == 0x01 && BleApplicationContext.Device_Connection_Status != APP_BLE_CONNECTED_CLIENT)
+ {
+ UTIL_SEQ_SetTask(1 << CFG_TASK_CONN_DEV_1_ID, CFG_SCH_PRIO_0);
+ }
+ else if(BleApplicationContext.DeviceServerFound == 0x00) UART_App_SendData("\r\nNF\r\n", 6);
+ autoconn_status = 0;
+ }
+ }
+ }
+ break;
+
+ case EVT_BLUE_L2CAP_CONNECTION_UPDATE_REQ :
+ l2cap_conn_upd_req_event = (aci_l2cap_connection_update_req_event_rp0 *) blue_evt->data;
+
+ UTIL_SEQ_SetTask(1 << CFG_TASK_CL_L2CAP_CONN_UPDATE_RESP_ID, CFG_SCH_PRIO_0);
+ break;
+ default:
+ /* USER CODE BEGIN ecode_default */
+
+ /* USER CODE END ecode_default */
+ break;
+
+ }
+ }
+ break;
+
+ case EVT_DISCONN_COMPLETE:
+ {
+ /* USER CODE BEGIN EVT_DISCONN_COMPLETE */
+
+ /* USER CODE END EVT_DISCONN_COMPLETE */
+ if (cc->Connection_Handle == BleApplicationContext.BleApplicationContext_legacy.connectionHandle)
+ {
+ BleApplicationContext.BleApplicationContext_legacy.connectionHandle = 0;
+ BleApplicationContext.Device_Connection_Status = APP_BLE_IDLE;
+ CL_Connection_Status = APP_BLE_IDLE;
+ BleApplicationContext.DeviceServerFound = 0x00;
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("\r\n\r** DISCONNECTION EVENT WITH SERVER \n");
+#endif
+ if (disconnection_status == TO_SWITCH_APP) //Disconnection done by application for switching app
+ {
+ handleNotificationCL.P2P_Evt_Opcode = PEERC_DISCON_SWITCH_HANDLE_EVT;
+ handleNotificationCL.ConnectionHandle = BleApplicationContext.BleApplicationContext_legacy.connectionHandle;
+ P2PC_APP_Notification(&handleNotificationCL);
+ }
+ else { //Deconnection done by user/client or by order from an AT command
+ handleNotificationCL.P2P_Evt_Opcode = PEERC_DISCON_HANDLE_EVT;
+ handleNotificationCL.ConnectionHandle = BleApplicationContext.BleApplicationContext_legacy.connectionHandle;
+ P2PC_APP_Notification(&handleNotificationCL);
+ }
+ }
+ }
+ break; /* EVT_DISCONN_COMPLETE */
+
+ case EVT_LE_META_EVENT:
+ {
+ /* USER CODE BEGIN EVT_LE_META_EVENT */
+
+ /* USER CODE END EVT_LE_META_EVENT */
+ meta_evt = (evt_le_meta_event*) event_pckt->data;
+
+ switch (meta_evt->subevent)
+ {
+ /* USER CODE BEGIN subevent */
+
+ /* USER CODE END subevent */
+ case EVT_LE_CONN_COMPLETE:
+ /* USER CODE BEGIN EVT_LE_CONN_COMPLETE */
+
+ /* USER CODE END EVT_LE_CONN_COMPLETE */
+ /**
+ * The connection is done,
+ */
+ connection_complete_event = (hci_le_connection_complete_event_rp0 *) meta_evt->data;
+ BleApplicationContext.BleApplicationContext_legacy.connectionHandle = connection_complete_event->Connection_Handle;
+ BleApplicationContext.Device_Connection_Status = APP_BLE_CONNECTED_CLIENT;
+ CL_Connection_Status = APP_BLE_CONNECTED_CLIENT;
+
+ /* CONNECTION WITH CLIENT */
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("\r\n\r** CONNECTION EVENT WITH SERVER \n");
+#endif
+ handleNotificationCL.P2P_Evt_Opcode = PEERC_CONN_HANDLE_EVT;
+ handleNotificationCL.ConnectionHandle = BleApplicationContext.BleApplicationContext_legacy.connectionHandle;
+ P2PC_APP_Notification(&handleNotificationCL);
+
+ result = aci_gatt_disc_all_primary_services(BleApplicationContext.BleApplicationContext_legacy.connectionHandle);
+ if (result == BLE_STATUS_SUCCESS)
+ {
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("\r\n\r** GATT SERVICES & CHARACTERISTICS DISCOVERY \n");
+ APP_DBG_MSG("* GATT : Start Searching Primary Services \r\n\r");
+#endif
+ }
+ else
+ {
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("BLE_CTRL_App_Notification(), All services discovery Failed \r\n\r");
+#endif
+ }
+
+ break; /* HCI_EVT_LE_CONN_COMPLETE */
+
+ case EVT_LE_ADVERTISING_REPORT:
+ {
+ uint8_t *adv_report_data;
+ /* USER CODE BEGIN EVT_LE_ADVERTISING_REPORT */
+
+ /* USER CODE END EVT_LE_ADVERTISING_REPORT */
+ le_advertising_event = (hci_le_advertising_report_event_rp0 *) meta_evt->data;
+
+ event_type = le_advertising_event->Advertising_Report[0].Event_Type;
+
+ event_data_size = le_advertising_event->Advertising_Report[0].Length_Data;
+
+ adv_report_data = (uint8_t*)(&le_advertising_event->Advertising_Report[0].Length_Data) + 1;
+ k = 0;
+
+ /* search AD TYPE 0x09 (Complete Local Name) */
+ /* search AD Type 0x02 (16 bits UUIDS) */
+ if (event_type == ADV_IND)
+ {
+
+ /*ISOLATION OF BD ADDRESS AND LOCAL NAME*/
+
+
+ while(k < event_data_size)
+ {
+ adlength = adv_report_data[k];
+ adtype = adv_report_data[k + 1];
+ switch (adtype)
+ {
+ case AD_TYPE_FLAGS: /* now get flags */
+ /* USER CODE BEGIN AD_TYPE_FLAGS */
+
+ /* USER CODE END AD_TYPE_FLAGS */
+ break;
+
+ case AD_TYPE_TX_POWER_LEVEL: /* Tx power level */
+ /* USER CODE BEGIN AD_TYPE_TX_POWER_LEVEL */
+
+ /* USER CODE END AD_TYPE_TX_POWER_LEVEL */
+ break;
+ case AD_TYPE_MANUFACTURER_SPECIFIC_DATA: /* Manufactureur Specific */
+ /* USER CODE BEGIN AD_TYPE_MANUFACTURER_SPECIFIC_DATA */
+
+ /* USER CODE END AD_TYPE_MANUFACTURER_SPECIFIC_DATA */
+ if (adlength >= 7 && adv_report_data[k + 2] == 0x01)
+ { /* ST VERSION ID 01 */
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("--- ST MANUFACTURER ID --- \n");
+#endif
+ switch (adv_report_data[k + 3])
+ { /* Demo ID */
+ case CFG_DEV_ID_AT_P2P_SERVER: /* (0End Device 1) */
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("-- SERVER DETECTED -- VIA MAN ID\n");
+#endif
+ if (autoconn_status)
+ {
+ if (strncmp((char *)(BD_Addr), (char *)(le_advertising_event->Advertising_Report[0].Address), 6) == 0)
+ {
+ BleApplicationContext.DeviceServerFound = 0x01;
+ }
+ }
+ else //autoconn_status == 0
+ {
+ /* Send via UART the 5 first bd addresses found */
+ different = 0; //Variable to check if the currently stored BD Address correspond to the one chosen by the user, if not "different" is incremented
+
+ for (i = 0; i < 5; i++)
+ {
+ if (strncmp((char *)(SERVER_REMOTE_BDADDR[i]), (char *)(le_advertising_event->Advertising_Report[0].Address), 6) != 0)
+ {
+ different++;
+ }
+ }
+ if ( different == 5 && index_bd_addr < 4) //The found BD Address is not registered and the array is not full
+ {
+ /* We register the BD address found */
+ for(i = 0; i < 6; i++) SERVER_REMOTE_BDADDR[index_bd_addr][i] = le_advertising_event->Advertising_Report[0].Address[i];
+
+ UART_App_ConvertBleDataToString((uint8_t*)(le_advertising_event->Advertising_Report[0].Address), bd_address_str, 12);
+ UART_App_SendData("\r\n", 2);
+ UART_App_SendData((char *)bd_address_str, 12);
+ UART_App_SendData("\r\n", 2);
+
+ index_bd_addr++;
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ }
+ break;
+ case AD_TYPE_SERVICE_DATA: /* service data 16 bits */
+ /* USER CODE BEGIN AD_TYPE_SERVICE_DATA */
+
+ /* USER CODE END AD_TYPE_SERVICE_DATA */
+ break;
+ default:
+ /* USER CODE BEGIN adtype_default */
+
+ /* USER CODE END adtype_default */
+ break;
+ } /* end switch Data[k+adlength] */
+ k += adlength + 1;
+ } /* end while */
+
+ } /* end if ADV_IND */
+ }
+
+ break;
+
+ default:
+ /* USER CODE BEGIN subevent_default */
+
+ /* USER CODE END subevent_default */
+ break;
+
+ }
+ }
+ break; /* HCI_EVT_LE_META_EVENT */
+
+ default:
+ /* USER CODE BEGIN evt_default */
+
+ /* USER CODE END evt_default */
+ break;
+ }
+
+ return (SVCCTL_UserEvtFlowEnable);
+}
+
+APP_BLE_ConnStatus_t APP_BLE_CL_Get_Client_Connection_Status( uint16_t Connection_Handle )
+{
+
+ if (BleApplicationContext.BleApplicationContext_legacy.connectionHandle == Connection_Handle)
+ {
+ return BleApplicationContext.Device_Connection_Status;
+ }
+ return APP_BLE_IDLE;
+}
+
+
+/* USER CODE BEGIN FD */
+
+/**
+ * @brief Disconnect the Link before switching to another BLE Application
+ * @param None
+ * @retval None
+ */
+static void APP_BLE_CL_GAP_Disconnect(){
+ tBleStatus result;
+ result = aci_gap_terminate(BleApplicationContext.BleApplicationContext_legacy.connectionHandle, ERR_RMT_USR_TERM_CONN);
+
+ if (result == BLE_STATUS_SUCCESS)
+ {
+ APP_DBG_MSG(" \r\n\r** TERMINATE CONNECTION ** \r\n\r");
+ }
+ else
+ {
+ APP_DBG_MSG("-- APP_BLE_CL_GAP_Disconnect, Failed \r\n\r");
+ BSP_LED_On(LED_RED);
+ }
+ return;
+}
+
+
+void APP_BLE_CL_Key_Button1_Action(void)
+{
+ P2PC_APP_SW1_Button_Action();
+}
+
+void APP_BLE_CL_Key_Button2_Action(void)
+{
+}
+
+void APP_BLE_CL_Key_Button3_Action(void)
+{
+}
+/* USER CODE END FD */
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+static void Ble_Tl_Init( void )
+{
+ HCI_TL_HciInitConf_t Hci_Tl_Init_Conf;
+
+ Hci_Tl_Init_Conf.p_cmdbuffer = (uint8_t*)&BleCmdBuffer;
+ Hci_Tl_Init_Conf.StatusNotCallBack = BLE_StatusNot;
+ hci_init(BLE_UserEvtRx, (void*) &Hci_Tl_Init_Conf);
+
+ return;
+}
+
+ static void Ble_Hci_Gap_Gatt_Init(void){
+
+ uint8_t role;
+ uint8_t index;
+ uint16_t gap_service_handle, gap_dev_name_char_handle, gap_appearance_char_handle;
+ const uint8_t *bd_addr;
+ uint32_t srd_bd_addr[2];
+ uint16_t appearance[1] = { BLE_CFG_GAP_APPEARANCE };
+
+ /**
+ * Initialize HCI layer
+ */
+ /*HCI Reset to synchronise BLE Stack*/
+ hci_reset();
+
+ /**
+ * Write the BD Address
+ */
+
+ bd_addr = BleGetBdAddress();
+ aci_hal_write_config_data(CONFIG_DATA_PUBADDR_OFFSET,
+ CONFIG_DATA_PUBADDR_LEN,
+ (uint8_t*) bd_addr);
+
+ /**
+ * Static random Address
+ * The two upper bits shall be set to 1
+ * The lowest 32bits is read from the UDN to differentiate between devices
+ * The RNG may be used to provide a random number on each power on
+ */
+ srd_bd_addr[1] = 0x0000ED6E;
+ srd_bd_addr[0] = LL_FLASH_GetUDN( );
+ aci_hal_write_config_data( CONFIG_DATA_RANDOM_ADDRESS_OFFSET, CONFIG_DATA_RANDOM_ADDRESS_LEN, (uint8_t*)srd_bd_addr );
+
+ /**
+ * Write Identity root key used to derive LTK and CSRK
+ */
+ aci_hal_write_config_data( CONFIG_DATA_IR_OFFSET, CONFIG_DATA_IR_LEN, (uint8_t*)BLE_CFG_IR_VALUE );
+
+ /**
+ * Write Encryption root key used to derive LTK and CSRK
+ */
+ aci_hal_write_config_data( CONFIG_DATA_ER_OFFSET, CONFIG_DATA_ER_LEN, (uint8_t*)BLE_CFG_ER_VALUE );
+
+ /**
+ * Set TX Power to 0dBm.
+ */
+ aci_hal_set_tx_power_level(1, CFG_TX_POWER);
+
+/**
+ * Initialize GATT interface
+ */
+ aci_gatt_init();
+
+ /**
+ * Initialize GAP interface
+ */
+ role = 0;
+
+#if (BLE_CFG_PERIPHERAL == 1)
+ role |= GAP_PERIPHERAL_ROLE;
+#endif
+
+#if (BLE_CFG_CENTRAL == 1)
+ role |= GAP_CENTRAL_ROLE;
+#endif
+
+ if (role > 0)
+ {
+ const char *name = "STM32WB";
+
+ aci_gap_init(role, 0,
+ APPBLE_GAP_DEVICE_NAME_LENGTH,
+ &gap_service_handle, &gap_dev_name_char_handle, &gap_appearance_char_handle);
+
+ if (aci_gatt_update_char_value(gap_service_handle, gap_dev_name_char_handle, 0, strlen(name), (uint8_t *) name))
+ {
+ BLE_DBG_SVCCTL_MSG("Device Name aci_gatt_update_char_value failed.\n");
+ }
+ }
+
+ if(aci_gatt_update_char_value(gap_service_handle,
+ gap_appearance_char_handle,
+ 0,
+ 2,
+ (uint8_t *)&appearance))
+ {
+ BLE_DBG_SVCCTL_MSG("Appearance aci_gatt_update_char_value failed.\n");
+ }
+
+ /**
+ * Initialize IO capability
+ */
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.ioCapability = CFG_IO_CAPABILITY;
+ aci_gap_set_io_capability(BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.ioCapability);
+
+ /**
+ * Initialize authentication
+ */
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.mitm_mode = CFG_MITM_PROTECTION;
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.OOB_Data_Present = 0;
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMin = 8;
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMax = 16;
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.Use_Fixed_Pin = 1;
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.Fixed_Pin = 111111;
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.bonding_mode = 0;
+ for (index = 0; index < 16; index++)
+ {
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.OOB_Data[index] = (uint8_t) index;
+ }
+
+ aci_gap_set_authentication_requirement(BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.bonding_mode,
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.mitm_mode,
+ 1,
+ 0,
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMin,
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMax,
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.Use_Fixed_Pin,
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.Fixed_Pin,
+ 0
+ );
+
+ /**
+ * Initialize whitelist
+ */
+ if (BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.bonding_mode)
+ {
+ aci_gap_configure_whitelist();
+ }
+
+}
+
+static void Scan_Request( void )
+{
+ /* USER CODE BEGIN Scan_Request_1 */
+
+ /* USER CODE END Scan_Request_1 */
+ tBleStatus result;
+ if (BleApplicationContext.Device_Connection_Status != APP_BLE_CONNECTED_CLIENT)
+ {
+ /* USER CODE BEGIN APP_BLE_CONNECTED_CLIENT */
+ BSP_LED_On(LED_BLUE);
+ /* USER CODE END APP_BLE_CONNECTED_CLIENT */
+ result = aci_gap_start_general_discovery_proc(SCAN_P, SCAN_L, PUBLIC_ADDR, 1);
+ if (result == BLE_STATUS_SUCCESS)
+ {
+ /* USER CODE BEGIN BLE_SCAN_SUCCESS */
+
+ /* USER CODE END BLE_SCAN_SUCCESS */
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG(" \r\n\r** START GENERAL DISCOVERY (SCAN) ** \r\n\r");
+#endif
+ }
+ else
+ {
+ /* USER CODE BEGIN BLE_SCAN_FAILED */
+ UART_App_SendData("\r\nF\r\n", 5);
+ BSP_LED_On(LED_RED);
+ /* USER CODE END BLE_SCAN_FAILED */
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("-- BLE_App_Start_Limited_Disc_Req, Failed \r\n\r");
+#endif
+ }
+ }
+ /* USER CODE BEGIN Scan_Request_2 */
+
+ /* USER CODE END Scan_Request_2 */
+ return;
+}
+
+static void Connect_Request( void )
+{
+ /* USER CODE BEGIN Connect_Request_1 */
+
+ /* USER CODE END Connect_Request_1 */
+ tBleStatus result;
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("\r\n\r** CREATE CONNECTION TO SERVER ** \r\n\r");
+#endif
+
+ if (BleApplicationContext.Device_Connection_Status != APP_BLE_CONNECTED_CLIENT)
+ {
+ result = aci_gap_create_connection(SCAN_P,
+ SCAN_L,
+ PUBLIC_ADDR, BD_Addr,//SERVER_REMOTE_BDADDR,
+ PUBLIC_ADDR,
+ CONN_P1,
+ CONN_P2,
+ 0,
+ SUPERV_TIMEOUT,
+ CONN_L1,
+ CONN_L2);
+
+ if (result == BLE_STATUS_SUCCESS)
+ {
+ /* USER CODE BEGIN BLE_CONNECT_SUCCESS */
+
+ /* USER CODE END BLE_CONNECT_SUCCESS */
+ BleApplicationContext.Device_Connection_Status = APP_BLE_LP_CONNECTING;
+ CL_Connection_Status = APP_BLE_LP_CONNECTING;
+ BSP_LED_Off(LED_RED);
+
+ }
+ else
+ {
+ /* USER CODE BEGIN BLE_CONNECT_FAILED */
+ UART_App_SendData("\r\nF\r\n", 5);
+ BSP_LED_On(LED_RED);
+ /* USER CODE END BLE_CONNECT_FAILED */
+ BleApplicationContext.Device_Connection_Status = APP_BLE_IDLE;
+ CL_Connection_Status = APP_BLE_IDLE;
+
+ }
+ }
+ /* USER CODE BEGIN Connect_Request_2 */
+
+ /* USER CODE END Connect_Request_2 */
+ return;
+}
+
+//static void Switch_OFF_GPIO(){
+///* USER CODE BEGIN Switch_OFF_GPIO */
+// BSP_LED_Off(LED_GREEN);
+///* USER CODE END Switch_OFF_GPIO */
+//}
+
+const uint8_t* BleGetBdAddress( void )
+{
+ uint8_t *otp_addr;
+ const uint8_t *bd_addr;
+ uint32_t udn;
+ uint32_t company_id;
+ uint32_t device_id;
+
+ udn = LL_FLASH_GetUDN();
+
+ if(udn != 0xFFFFFFFF)
+ {
+ company_id = LL_FLASH_GetSTCompanyID();
+ device_id = LL_FLASH_GetDeviceID();
+
+ bd_addr_udn[0] = (uint8_t)(udn & 0x000000FF);
+ bd_addr_udn[1] = (uint8_t)( (udn & 0x0000FF00) >> 8 );
+ bd_addr_udn[2] = (uint8_t)( (udn & 0x00FF0000) >> 16 );
+ bd_addr_udn[3] = (uint8_t)device_id;
+ bd_addr_udn[4] = (uint8_t)(company_id & 0x000000FF);;
+ bd_addr_udn[5] = (uint8_t)( (company_id & 0x0000FF00) >> 8 );
+
+ bd_addr = (const uint8_t *)bd_addr_udn;
+ }
+ else
+ {
+ otp_addr = OTP_Read(0);
+ if(otp_addr)
+ {
+ bd_addr = ((OTP_ID0_t*)otp_addr)->bd_address;
+ }
+ else
+ {
+ bd_addr = M_bd_addr;
+ }
+
+ }
+
+ return bd_addr;
+}
+/* USER CODE BEGIN FD_LOCAL_FUNCTIONS */
+
+static void BLE_CL_L2CAP_Conn_Update(void)
+{
+ tBleStatus result;
+
+ result = aci_l2cap_connection_parameter_update_resp(l2cap_conn_upd_req_event->Connection_Handle,
+ l2cap_conn_upd_req_event->Interval_Min, l2cap_conn_upd_req_event->Interval_Max,
+ l2cap_conn_upd_req_event->Slave_Latency, l2cap_conn_upd_req_event->Timeout_Multiplier,
+ (l2cap_conn_upd_req_event->Interval_Min)/2, (l2cap_conn_upd_req_event->Interval_Max)/2,
+ l2cap_conn_upd_req_event->Identifier,
+ 0x01);
+
+ if( result == BLE_STATUS_SUCCESS )
+ {
+ UART_App_SendData("\r\nOK\r\n", 6);
+ }
+ else
+ {
+ UART_App_SendData("\r\nF\r\n", 5);
+ }
+ return;
+}
+
+static void Confirm_Pairing ( void )
+{
+ tBleStatus result;
+
+ result = aci_gap_numeric_comparison_value_confirm_yesno(BleApplicationContext.BleApplicationContext_legacy.connectionHandle,0x01);
+
+ if( result != BLE_STATUS_SUCCESS )
+ {
+ UART_App_SendData("\r\nF\r\n", 5);
+ }
+
+ return;
+}
+
+static void Pairing_Request ( void )
+{
+ tBleStatus result;
+
+ result = aci_gap_send_pairing_req(BleApplicationContext.BleApplicationContext_legacy.connectionHandle, 0x01);
+
+ if( result != BLE_STATUS_SUCCESS )
+ {
+ UART_App_SendData("\r\nF\r\n", 5);
+ }
+
+ return;
+}
+
+/* USER CODE END FD_LOCAL_FUNCTIONS */
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+//void hci_notify_asynch_evt(void* pdata)
+//{
+// UTIL_SEQ_SetTask(1 << CFG_TASK_HCI_ASYNCH_EVT_ID, CFG_SCH_PRIO_0);
+// return;
+//}
+//
+//void hci_cmd_resp_release(uint32_t flag)
+//{
+// UTIL_SEQ_SetEvt(1 << CFG_IDLEEVT_HCI_CMD_EVT_RSP_ID);
+// return;
+//}
+//
+//void hci_cmd_resp_wait(uint32_t timeout)
+//{
+// UTIL_SEQ_WaitEvt(1 << CFG_IDLEEVT_HCI_CMD_EVT_RSP_ID);
+// return;
+//}
+
+static void BLE_UserEvtRx( void * pPayload )
+{
+ SVCCTL_UserEvtFlowStatus_t svctl_return_status;
+ tHCI_UserEvtRxParam *pParam;
+
+ pParam = (tHCI_UserEvtRxParam *)pPayload;
+
+ svctl_return_status = SVCCTL_UserEvtRx((void *)&(pParam->pckt->evtserial));
+ if (svctl_return_status != SVCCTL_UserEvtFlowDisable)
+{
+ pParam->status = HCI_TL_UserEventFlow_Enable;
+}
+ else
+{
+ pParam->status = HCI_TL_UserEventFlow_Disable;
+ }
+}
+
+static void BLE_StatusNot( HCI_TL_CmdStatus_t status )
+{
+ uint32_t task_id_list;
+ switch (status)
+ {
+ case HCI_TL_CmdBusy:
+ /**
+ * All tasks that may send an aci/hci commands shall be listed here
+ * This is to prevent a new command is sent while one is already pending
+ */
+ task_id_list = (1 << CFG_LAST_TASK_ID_WITH_HCICMD) - 1;
+ UTIL_SEQ_PauseTask(task_id_list);
+
+ break;
+
+ case HCI_TL_CmdAvailable:
+ /**
+ * All tasks that may send an aci/hci commands shall be listed here
+ * This is to prevent a new command is sent while one is already pending
+ */
+ task_id_list = (1 << CFG_LAST_TASK_ID_WITH_HCICMD) - 1;
+ UTIL_SEQ_ResumeTask(task_id_list);
+
+ break;
+
+ default:
+ break;
+ }
+ return;
+}
+
+//void SVCCTL_ResumeUserEventFlow( void )
+//{
+// hci_resume_flow();
+// return;
+//}
+
+/* USER CODE BEGIN FD_WRAP_FUNCTIONS */
+
+/* USER CODE END FD_WRAP_FUNCTIONS */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_cl.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_cl.h
new file mode 100644
index 000000000..4bc492475
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_cl.h
@@ -0,0 +1,79 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file app_ble_cl.h
+ * @author MCD Application Team
+ * @brief Header for ble application
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_BLE_CL_H
+#define APP_BLE_CL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+#include "hci_tl.h"
+#include "app_ble_common.h"
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Exported types ------------------------------------------------------------*/
+
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* External variables --------------------------------------------------------*/
+/* USER CODE BEGIN EV */
+
+/* USER CODE END EV */
+
+/* Exported macro ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions ---------------------------------------------*/
+ void APP_BLE_CL_Init( void );
+
+ APP_BLE_ConnStatus_t APP_BLE_CL_Get_Client_Connection_Status( uint16_t Connection_Handle );
+
+ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_CL_Notification( void *pckt );
+
+/* USER CODE BEGIN EF */
+ void APP_BLE_CL_Key_Button1_Action(void);
+ void APP_BLE_CL_Key_Button2_Action(void);
+ void APP_BLE_CL_Key_Button3_Action(void);
+/* USER CODE END EF */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*APP_BLE_CL_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_common.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_common.c
new file mode 100644
index 000000000..320cb3e28
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_common.c
@@ -0,0 +1,117 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file app_ble_common.c
+ * @author MCD Application Team
+ * @brief BLE Application
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+
+#include "app_common.h"
+
+#include "ble.h"
+#include "tl.h"
+#include "app_ble_common.h"
+#include "app_ble_sv.h"
+#include "app_ble_hr.h"
+#include "app_ble_cl.h"
+
+#include "stm32_seq.h"
+#include "shci.h"
+#include "stm32_lpm.h"
+#include "otp.h"
+
+extern APP_Mode_t APP_MODE;
+/* Private includes ----------------------------------------------------------*/
+
+/* Private typedef -----------------------------------------------------------*/
+
+/* Private defines -----------------------------------------------------------*/
+
+/* Private macro -------------------------------------------------------------*/
+/* Private variables ---------------------------------------------------------*/
+
+/* Private function prototypes -----------------------------------------------*/
+void APP_BLE_Common_Init( void );
+
+/* Functions Definition ------------------------------------------------------*/
+void APP_BLE_Common_Init( void )
+{
+
+ return;
+}
+
+SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
+{
+ switch(APP_MODE){
+ case P2P_SERVER :
+ SVCCTL_App_SV_Notification(pckt);
+ break;
+ case P2P_CLIENT :
+ SVCCTL_App_CL_Notification(pckt);
+ break;
+ case HEART_RATE :
+ SVCCTL_App_HR_Notification(pckt);
+ break;
+ default : break;
+ }
+
+ return (SVCCTL_UserEvtFlowEnable);
+}
+
+void SVCCTL_SvcInit(void)
+{
+ if(APP_MODE == HEART_RATE) DIS_Init();
+
+ if(APP_MODE == HEART_RATE) HRS_Init();
+
+ if(APP_MODE == P2P_SERVER || APP_MODE == P2P_CLIENT) P2PS_STM_Init();
+
+ return;
+}
+
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+void hci_notify_asynch_evt(void* pdata)
+{
+ UTIL_SEQ_SetTask(1 << CFG_TASK_HCI_ASYNCH_EVT_ID, CFG_SCH_PRIO_0);
+ return;
+}
+
+void hci_cmd_resp_release(uint32_t flag)
+{
+ UTIL_SEQ_SetEvt(1 << CFG_IDLEEVT_SYSTEM_HCI_CMD_EVT_RSP_ID);
+ return;
+}
+
+void hci_cmd_resp_wait(uint32_t timeout)
+{
+ UTIL_SEQ_WaitEvt(1 << CFG_IDLEEVT_SYSTEM_HCI_CMD_EVT_RSP_ID);
+ return;
+}
+
+void SVCCTL_ResumeUserEventFlow( void )
+{
+ hci_resume_flow();
+ return;
+}
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_common.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_common.h
new file mode 100644
index 000000000..fe8a2e1c1
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_common.h
@@ -0,0 +1,68 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file app_ble_sv.h
+ * @author MCD Application Team
+ * @brief Header for ble application
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_BLE_COMMON_H
+#define APP_BLE_COMMON_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+#include "hci_tl.h"
+
+/* Private includes ----------------------------------------------------------*/
+/* Exported types ------------------------------------------------------------*/
+ typedef enum
+ {
+ APP_BLE_IDLE,
+ APP_BLE_FAST_ADV,
+ APP_BLE_LP_ADV,
+ APP_BLE_SCAN,
+ APP_BLE_LP_CONNECTING,
+ APP_BLE_CONNECTED_SERVER,
+ APP_BLE_CONNECTED_CLIENT,
+
+ APP_BLE_DISCOVER_SERVICES,
+ APP_BLE_DISCOVER_CHARACS,
+ APP_BLE_DISCOVER_WRITE_DESC,
+ APP_BLE_DISCOVER_NOTIFICATION_CHAR_DESC,
+ APP_BLE_ENABLE_NOTIFICATION_DESC,
+ APP_BLE_DISABLE_NOTIFICATION_DESC
+ } APP_BLE_ConnStatus_t;
+
+/* Exported constants --------------------------------------------------------*/
+
+/* External variables --------------------------------------------------------*/
+
+/* Exported macro ------------------------------------------------------------*/
+
+/* Exported functions ---------------------------------------------*/
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*APP_BLE_COMMON_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_hr.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_hr.c
new file mode 100644
index 000000000..153fb15fa
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_hr.c
@@ -0,0 +1,1054 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file app_ble_hr.c
+ * @author MCD Application Team
+ * @brief BLE Application
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+
+#include "app_common.h"
+
+#include "dbg_trace.h"
+#include "tl.h"
+#include "app_ble_hr.h"
+
+#include "stm32_seq.h"
+#include "shci.h"
+#include "stm32_lpm.h"
+#include "otp.h"
+#include "dis_app.h"
+#include "hrs_app.h"
+#include "uart_app.h"
+
+extern Disconnection_Status_t disconnection_status; //0 disconnection from Remote; 1 disconnection from Application to switch of BLE App; 2 disconnection ordered by AT command
+
+extern PairingContext_t PairingContext;
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+
+/**
+ * security parameters structure
+ */
+typedef struct _tSecurityParams
+{
+ /**
+ * IO capability of the device
+ */
+ uint8_t ioCapability;
+
+ /**
+ * Authentication requirement of the device
+ * Man In the Middle protection required?
+ */
+ uint8_t mitm_mode;
+
+ /**
+ * bonding mode of the device
+ */
+ uint8_t bonding_mode;
+
+ /**
+ * Flag to tell whether OOB data has
+ * to be used during the pairing process
+ */
+ uint8_t OOB_Data_Present;
+
+ /**
+ * OOB data to be used in the pairing process if
+ * OOB_Data_Present is set to TRUE
+ */
+ uint8_t OOB_Data[16];
+
+ /**
+ * this variable indicates whether to use a fixed pin
+ * during the pairing process or a passkey has to be
+ * requested to the application during the pairing process
+ * 0 implies use fixed pin and 1 implies request for passkey
+ */
+ uint8_t Use_Fixed_Pin;
+
+ /**
+ * minimum encryption key size requirement
+ */
+ uint8_t encryptionKeySizeMin;
+
+ /**
+ * maximum encryption key size requirement
+ */
+ uint8_t encryptionKeySizeMax;
+
+ /**
+ * fixed pin to be used in the pairing process if
+ * Use_Fixed_Pin is set to 1
+ */
+ uint32_t Fixed_Pin;
+
+ /**
+ * this flag indicates whether the host has to initiate
+ * the security, wait for pairing or does not have any security
+ * requirements.\n
+ * 0x00 : no security required
+ * 0x01 : host should initiate security by sending the slave security
+ * request command
+ * 0x02 : host need not send the clave security request but it
+ * has to wait for paiirng to complete before doing any other
+ * processing
+ */
+ uint8_t initiateSecurity;
+}tSecurityParams;
+
+/**
+ * global context
+ * contains the variables common to all
+ * services
+ */
+typedef struct _tBLEProfileGlobalContext
+{
+
+ /**
+ * security requirements of the host
+ */
+ tSecurityParams bleSecurityParam;
+
+ /**
+ * gap service handle
+ */
+ uint16_t gapServiceHandle;
+
+ /**
+ * device name characteristic handle
+ */
+ uint16_t devNameCharHandle;
+
+ /**
+ * appearance characteristic handle
+ */
+ uint16_t appearanceCharHandle;
+
+ /**
+ * connection handle of the current active connection
+ * When not in connection, the handle is set to 0xFFFF
+ */
+ uint16_t connectionHandle;
+
+ /**
+ * length of the UUID list to be used while advertising
+ */
+ uint8_t advtServUUIDlen;
+
+ /**
+ * the UUID list to be used while advertising
+ */
+ uint8_t advtServUUID[100];
+
+}BleGlobalContext_t;
+
+typedef struct
+{
+ BleGlobalContext_t BleApplicationContext_legacy;
+ APP_BLE_ConnStatus_t Device_Connection_Status;
+ /**
+ * ID of the Advertising Timeout
+ */
+ uint8_t Advertising_mgr_timer_Id;
+
+}BleApplicationContext_t;
+/* USER CODE BEGIN PTD */
+
+/* USER CODE END PTD */
+
+/* Private defines -----------------------------------------------------------*/
+#define APPBLE_GAP_DEVICE_NAME_LENGTH 7
+#define FAST_ADV_TIMEOUT (30*1000*1000/CFG_TS_TICK_VAL) /**< 30s */
+#define INITIAL_ADV_TIMEOUT (60*1000*1000/CFG_TS_TICK_VAL) /**< 60s */
+
+#define BD_ADDR_SIZE_LOCAL 6
+
+/* USER CODE BEGIN PD */
+#define LED_ON_TIMEOUT (0.005*1000*1000/CFG_TS_TICK_VAL) /**< 5ms */
+/* USER CODE END PD */
+
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private variables ---------------------------------------------------------*/
+PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static TL_CmdPacket_t BleCmdBuffer;
+
+static const uint8_t M_bd_addr[BD_ADDR_SIZE_LOCAL] =
+ {
+ (uint8_t)((CFG_ADV_BD_ADDRESS & 0x0000000000FF)),
+ (uint8_t)((CFG_ADV_BD_ADDRESS & 0x00000000FF00) >> 8),
+ (uint8_t)((CFG_ADV_BD_ADDRESS & 0x000000FF0000) >> 16),
+ (uint8_t)((CFG_ADV_BD_ADDRESS & 0x0000FF000000) >> 24),
+ (uint8_t)((CFG_ADV_BD_ADDRESS & 0x00FF00000000) >> 32),
+ (uint8_t)((CFG_ADV_BD_ADDRESS & 0xFF0000000000) >> 40)
+ };
+
+static uint8_t bd_addr_udn[BD_ADDR_SIZE_LOCAL];
+
+/**
+* Identity root key used to derive LTK and CSRK
+*/
+static const uint8_t BLE_CFG_IR_VALUE[16] = CFG_BLE_IRK;
+
+/**
+* Encryption root key used to derive LTK and CSRK
+*/
+static const uint8_t BLE_CFG_ER_VALUE[16] = CFG_BLE_ERK;
+
+PLACE_IN_SECTION("BLE_APP_CONTEXT") static BleApplicationContext_t BleApplicationContext;
+PLACE_IN_SECTION("BLE_APP_CONTEXT") static uint16_t AdvIntervalMin, AdvIntervalMax;
+
+static const char local_name[] = { AD_TYPE_COMPLETE_LOCAL_NAME ,'S','T','A','T','H','R'};//{ AD_TYPE_COMPLETE_LOCAL_NAME ,'H','R','S','T','M'};
+uint8_t manuf_data_hr[14] = {
+ sizeof(manuf_data_hr)-1, AD_TYPE_MANUFACTURER_SPECIFIC_DATA,
+ 0x01/*SKD version */,
+ 0x00 /* Generic*/,
+ 0x00 /* GROUP A Feature */,
+ 0x00 /* GROUP A Feature */,
+ 0x00 /* GROUP B Feature */,
+ 0x00 /* GROUP B Feature */,
+ 0x00, /* BLE MAC start -MSB */
+ 0x00,
+ 0x00,
+ 0x00,
+ 0x00,
+ 0x00, /* BLE MAC stop */
+
+};
+/* USER CODE BEGIN PV */
+
+HRS_APP_ConnHandle_Not_evt_t handleNotificationHR;
+
+APP_BLE_ConnStatus_t HR_Connection_Status;
+
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+static void BLE_UserEvtRx( void * pPayload );
+static void BLE_StatusNot( HCI_TL_CmdStatus_t status );
+static void Ble_Tl_Init( void );
+static void Ble_Hci_Gap_Gatt_Init(void);
+static const uint8_t* BleGetBdAddress( void );
+static void Adv_Request( APP_BLE_ConnStatus_t New_Status );
+//static void Add_Advertisment_Service_UUID( uint16_t servUUID );
+static void Adv_Mgr( void );
+static void Adv_Update( void );
+
+/* USER CODE BEGIN PFP */
+
+static void APP_BLE_HR_GAP_Disconnect( void);
+static void Confirm_Pairing( void );
+static void Pairing_Request ( void );
+
+/* USER CODE END PFP */
+
+/* Functions Definition ------------------------------------------------------*/
+void APP_BLE_HR_Init( void )
+{
+/* USER CODE BEGIN APP_BLE_Init_1 */
+
+/* USER CODE END APP_BLE_Init_1 */
+ SHCI_C2_Ble_Init_Cmd_Packet_t ble_init_cmd_packet =
+ {
+ {{0,0,0}}, /**< Header unused */
+ {0, /** pBleBufferAddress not used */
+ 0, /** BleBufferSize not used */
+ CFG_BLE_NUM_GATT_ATTRIBUTES,
+ CFG_BLE_NUM_GATT_SERVICES,
+ CFG_BLE_ATT_VALUE_ARRAY_SIZE,
+ CFG_BLE_NUM_LINK,
+ CFG_BLE_DATA_LENGTH_EXTENSION,
+ CFG_BLE_PREPARE_WRITE_LIST_SIZE,
+ CFG_BLE_MBLOCK_COUNT,
+ CFG_BLE_MAX_ATT_MTU,
+ CFG_BLE_SLAVE_SCA,
+ CFG_BLE_MASTER_SCA,
+ CFG_BLE_LSE_SOURCE,
+ CFG_BLE_MAX_CONN_EVENT_LENGTH,
+ CFG_BLE_HSE_STARTUP_TIME,
+ CFG_BLE_VITERBI_MODE,
+ CFG_BLE_LL_ONLY,
+ 0}
+ };
+
+ /**
+ * Initialize Ble Transport Layer
+ */
+ Ble_Tl_Init( );
+
+ /**
+ * Do not allow standby in the application
+ */
+ UTIL_LPM_SetOffMode(1 << CFG_LPM_APP_BLE, UTIL_LPM_DISABLE);
+
+ /**
+ * Register the hci transport layer to handle BLE User Asynchronous Events
+ */
+ UTIL_SEQ_RegTask( 1<<CFG_TASK_HCI_ASYNCH_EVT_ID, UTIL_SEQ_RFU, hci_user_evt_proc);
+
+ /**
+ * Starts the BLE Stack on CPU2
+ */
+ SHCI_C2_BLE_Init( &ble_init_cmd_packet );
+
+ /**
+ * Initialization of HCI & GATT & GAP layer
+ */
+ Ble_Hci_Gap_Gatt_Init();
+
+ /**
+ * Initialization of the BLE Services
+ */
+ SVCCTL_Init();
+
+ /**
+ * Initialization of the BLE App Context
+ */
+ BleApplicationContext.Device_Connection_Status = APP_BLE_IDLE;
+ HR_Connection_Status = APP_BLE_IDLE;
+ BleApplicationContext.BleApplicationContext_legacy.connectionHandle = 0xFFFF;
+ /**
+ * From here, all initialization are BLE application specific
+ */
+ UTIL_SEQ_RegTask( 1<<CFG_TASK_ADV_UPDATE_ID, UTIL_SEQ_RFU, Adv_Update);
+ UTIL_SEQ_RegTask( 1<<CFG_TASK_HR_GAP_DISCON_ID, UTIL_SEQ_RFU, APP_BLE_HR_GAP_Disconnect);
+ UTIL_SEQ_RegTask( 1<<CFG_TASK_CONFIRM_PAIRING_ID, UTIL_SEQ_RFU, Confirm_Pairing);
+ UTIL_SEQ_RegTask( 1<<CFG_TASK_REQUEST_PAIRING_ID, UTIL_SEQ_RFU, Pairing_Request);
+ /**
+ * Initialization of ADV - Ad Manufacturer Element
+ */
+
+ /**
+ * Initialize DIS Application
+ */
+ DISAPP_Init();
+
+ /**
+ * Initialize HRS Application
+ */
+ HRSAPP_Init();
+
+ /**
+ * Create timer to handle the connection state machine
+ */
+
+ HW_TS_Create(CFG_TIM_PROC_ID_ISR, &(BleApplicationContext.Advertising_mgr_timer_Id), hw_ts_SingleShot, Adv_Mgr);
+
+ /**
+ * Make device discoverable
+ */
+ BleApplicationContext.BleApplicationContext_legacy.advtServUUID[0] = NULL;//AD_TYPE_16_BIT_SERV_UUID;
+ BleApplicationContext.BleApplicationContext_legacy.advtServUUIDlen = 0;//1;
+// Add_Advertisment_Service_UUID(HEART_RATE_SERVICE_UUID);
+ /* Initialize intervals for reconnexion without intervals update */
+ AdvIntervalMin = CFG_FAST_CONN_ADV_INTERVAL_MIN;
+ AdvIntervalMax = CFG_FAST_CONN_ADV_INTERVAL_MAX;
+
+ /**
+ * Start to Advertise to be connected by Collector
+ */
+ Adv_Request(APP_BLE_FAST_ADV);
+
+/* USER CODE BEGIN APP_BLE_Init_2 */
+
+ /**
+ * Send a acknowledgement of the correct initialization of the p2p application
+ */
+ UART_App_SendData("\r\nHR OK\r\n", 9);
+
+
+/* USER CODE END APP_BLE_Init_2 */
+ return;
+}
+
+SVCCTL_UserEvtFlowStatus_t SVCCTL_App_HR_Notification( void *pckt )
+{
+ hci_event_pckt *event_pckt;
+ evt_le_meta_event *meta_evt;
+ evt_blue_aci *blue_evt;
+ /* Pairing */
+ aci_gap_numeric_comparison_value_event_rp0 *evt_numeric_value;
+ aci_gap_pairing_complete_event_rp0 *pairing_complete;
+ uint32_t numeric_value;
+ char numeric_value_str[20];
+ /*****/
+
+ event_pckt = (hci_event_pckt*) ((hci_uart_pckt *) pckt)->data;
+
+ switch (event_pckt->evt)
+ {
+ case EVT_DISCONN_COMPLETE:
+ {
+ hci_disconnection_complete_event_rp0 *disconnection_complete_event;
+ disconnection_complete_event = (hci_disconnection_complete_event_rp0 *) event_pckt->data;
+
+ if (disconnection_complete_event->Connection_Handle == BleApplicationContext.BleApplicationContext_legacy.connectionHandle)
+ {
+ BleApplicationContext.BleApplicationContext_legacy.connectionHandle = 0;
+ BleApplicationContext.Device_Connection_Status = APP_BLE_IDLE;
+ HR_Connection_Status = APP_BLE_IDLE;
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("\r\n\r** DISCONNECTION EVENT WITH CLIENT \n");
+#endif
+ }
+
+ if (disconnection_status == TO_SWITCH_APP) //Disconnection done by application for switching app
+ {
+ handleNotificationHR.HR_Evt_Opcode = HR_DISCON_SWITCH_HANDLE_EVT;
+ handleNotificationHR.ConnectionHandle = BleApplicationContext.BleApplicationContext_legacy.connectionHandle;
+ HRS_APP_Notification(&handleNotificationHR);
+ }
+ else { //Deconnection done by user/client
+ PairingContext.PairingComplete = 0; //The pairing is reset to allow the user to perform a pairing on next connection
+
+ handleNotificationHR.HR_Evt_Opcode = HR_DISCON_HANDLE_EVT;
+ handleNotificationHR.ConnectionHandle = BleApplicationContext.BleApplicationContext_legacy.connectionHandle;
+ HRS_APP_Notification(&handleNotificationHR);
+ /* restart advertising */
+ Adv_Request(APP_BLE_FAST_ADV);
+ }
+}
+
+ break; /* EVT_DISCONN_COMPLETE */
+
+ case EVT_LE_META_EVENT:
+ {
+ meta_evt = (evt_le_meta_event*) event_pckt->data;
+ /* USER CODE BEGIN EVT_LE_META_EVENT */
+
+ /* USER CODE END EVT_LE_META_EVENT */
+ switch (meta_evt->subevent)
+ {
+ case EVT_LE_CONN_UPDATE_COMPLETE:
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("\r\n\r** CONNECTION UPDATE EVENT WITH CLIENT \n");
+#endif
+ /* USER CODE BEGIN EVT_LE_CONN_UPDATE_COMPLETE */
+
+ /* USER CODE END EVT_LE_CONN_UPDATE_COMPLETE */
+ break;
+ case EVT_LE_CONN_COMPLETE:
+ {
+ hci_le_connection_complete_event_rp0 *connection_complete_event;
+
+ /**
+ * The connection is done, there is no need anymore to schedule the LP ADV
+ */
+ connection_complete_event = (hci_le_connection_complete_event_rp0 *) meta_evt->data;
+
+ HW_TS_Stop(BleApplicationContext.Advertising_mgr_timer_Id);
+
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("EVT_LE_CONN_COMPLETE for connection handle 0x%x\n",
+ connection_complete_event->Connection_Handle);
+#endif
+ if (BleApplicationContext.Device_Connection_Status == APP_BLE_LP_CONNECTING)
+ {
+ /* Connection as client */
+ BleApplicationContext.Device_Connection_Status = APP_BLE_CONNECTED_CLIENT;
+ HR_Connection_Status = APP_BLE_CONNECTED_CLIENT;
+ }
+ else
+ {
+ /* Connection as server */
+ BleApplicationContext.Device_Connection_Status = APP_BLE_CONNECTED_SERVER;
+ HR_Connection_Status = APP_BLE_CONNECTED_SERVER;
+ }
+ BleApplicationContext.BleApplicationContext_legacy.connectionHandle =
+ connection_complete_event->Connection_Handle;
+ /* USER CODE BEGIN HCI_EVT_LE_CONN_COMPLETE */
+
+ handleNotificationHR.HR_Evt_Opcode = HR_CONN_HANDLE_EVT;
+ handleNotificationHR.ConnectionHandle = BleApplicationContext.BleApplicationContext_legacy.connectionHandle;
+ HRS_APP_Notification(&handleNotificationHR);
+
+ /* USER CODE END HCI_EVT_LE_CONN_COMPLETE */
+ }
+ break; /* HCI_EVT_LE_CONN_COMPLETE */
+
+ default:
+ /* USER CODE BEGIN SUBEVENT_DEFAULT */
+
+ /* USER CODE END SUBEVENT_DEFAULT */
+ break;
+ }
+ }
+ break; /* HCI_EVT_LE_META_EVENT */
+
+ case EVT_VENDOR:
+ blue_evt = (evt_blue_aci*) event_pckt->data;
+ /* USER CODE BEGIN EVT_VENDOR */
+
+ /* USER CODE END EVT_VENDOR */
+ switch (blue_evt->ecode)
+ {
+ /* USER CODE BEGIN ecode */
+
+ /* USER CODE END ecode */
+ case EVT_BLUE_GAP_PROCEDURE_COMPLETE:
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("\r\n\r** EVT_BLUE_GAP_PROCEDURE_COMPLETE \n");
+#endif
+ /* USER CODE BEGIN EVT_BLUE_GAP_PROCEDURE_COMPLETE */
+
+ /* USER CODE END EVT_BLUE_GAP_PROCEDURE_COMPLETE */
+ break; /* EVT_BLUE_GAP_PROCEDURE_COMPLETE */
+
+ /* Pairing */
+ case EVT_BLUE_GAP_NUMERIC_COMPARISON_VALUE:
+ UART_App_SendData("\r\n", 2);
+ PairingContext.PairingConfirmRequested = 1;
+ evt_numeric_value = (aci_gap_numeric_comparison_value_event_rp0 *)blue_evt->data;
+ numeric_value = evt_numeric_value->Numeric_Value;
+ sprintf(numeric_value_str, "%d", (int)numeric_value);
+ UART_App_SendData((char *)numeric_value_str, (uint8_t)(strlen(numeric_value_str)));
+ UART_App_SendData(":PREQ?\r\n", 8);
+// APP_DBG_MSG("numeric_value = %x\n", numeric_value);
+// aci_gap_numeric_comparison_value_confirm_yesno(BleApplicationContext.BleApplicationContext_legacy.connectionHandle,0x01);
+ break;
+
+ case EVT_BLUE_GAP_PAIRING_CMPLT: //aci_gap_pairing_complete_event_process
+ pairing_complete = (aci_gap_pairing_complete_event_rp0*)blue_evt->data;
+// APP_DBG_MSG("BLE_CTRL_App_Notification: EVT_BLUE_GAP_PAIRING_CMPLT, pairing_complete->Status = %d\n",pairing_complete->Status);
+ if (pairing_complete->Status == 0)
+ {
+ UART_App_SendData("\r\nP\r\n", 5);
+ PairingContext.PairingComplete = 1;
+ }
+ else UART_App_SendData("\r\nF\r\n", 5);
+ break;
+ }
+ break; /* EVT_VENDOR */
+
+ default:
+ /* USER CODE BEGIN ECODE_DEFAULT*/
+
+ /* USER CODE END ECODE_DEFAULT*/
+ break;
+ }
+
+ return (SVCCTL_UserEvtFlowEnable);
+}
+
+APP_BLE_ConnStatus_t APP_BLE_HR_Get_Server_Connection_Status(void)
+{
+ return BleApplicationContext.Device_Connection_Status;
+}
+
+/**
+ * @brief Disconnect the Link before switching to another BLE Application
+ * @param None
+ * @retval None
+ */
+static void APP_BLE_HR_GAP_Disconnect(){
+ tBleStatus result;
+ result = aci_gap_terminate(BleApplicationContext.BleApplicationContext_legacy.connectionHandle, ERR_RMT_USR_TERM_CONN);
+
+ if (result == BLE_STATUS_SUCCESS)
+ {
+ APP_DBG_MSG(" \r\n\r** TERMINATE CONNECTION ** \r\n\r");
+ }
+ else
+ {
+ APP_DBG_MSG("-- APP_BLE_HR_GAP_Disconnect, Failed \r\n\r");
+ BSP_LED_On(LED_RED);
+ }
+ return;
+}
+
+/* USER CODE BEGIN FD*/
+void APP_BLE_HR_Key_Button1_Action(void)
+{
+
+}
+
+void APP_BLE_HR_Key_Button2_Action(void)
+{
+
+}
+
+void APP_BLE_HR_Key_Button3_Action(void)
+{
+}
+
+/* USER CODE END FD*/
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+static void Ble_Tl_Init( void )
+{
+ HCI_TL_HciInitConf_t Hci_Tl_Init_Conf;
+
+ Hci_Tl_Init_Conf.p_cmdbuffer = (uint8_t*)&BleCmdBuffer;
+ Hci_Tl_Init_Conf.StatusNotCallBack = BLE_StatusNot;
+ hci_init(BLE_UserEvtRx, (void*) &Hci_Tl_Init_Conf);
+
+ return;
+}
+
+ static void Ble_Hci_Gap_Gatt_Init(void){
+
+ uint8_t role;
+ uint8_t index;
+ uint16_t gap_service_handle, gap_dev_name_char_handle, gap_appearance_char_handle;
+ const uint8_t *bd_addr;
+ uint32_t srd_bd_addr[2];
+ uint16_t appearance[1] = { BLE_CFG_GAP_APPEARANCE };
+
+ /**
+ * Initialize HCI layer
+ */
+ /*HCI Reset to synchronise BLE Stack*/
+ hci_reset();
+
+ /**
+ * Write the BD Address
+ */
+
+ bd_addr = BleGetBdAddress();
+ aci_hal_write_config_data(CONFIG_DATA_PUBADDR_OFFSET,
+ CONFIG_DATA_PUBADDR_LEN,
+ (uint8_t*) bd_addr);
+
+ /* BLE MAC in ADV Packet */
+ manuf_data_hr[ sizeof(manuf_data_hr)-6] = bd_addr[5];
+ manuf_data_hr[ sizeof(manuf_data_hr)-5] = bd_addr[4];
+ manuf_data_hr[ sizeof(manuf_data_hr)-4] = bd_addr[3];
+ manuf_data_hr[ sizeof(manuf_data_hr)-3] = bd_addr[2];
+ manuf_data_hr[ sizeof(manuf_data_hr)-2] = bd_addr[1];
+ manuf_data_hr[ sizeof(manuf_data_hr)-1] = bd_addr[0];
+
+ /**
+ * Write Identity root key used to derive LTK and CSRK
+ */
+ aci_hal_write_config_data(CONFIG_DATA_IR_OFFSET,
+ CONFIG_DATA_IR_LEN,
+ (uint8_t*) BLE_CFG_IR_VALUE);
+
+ /**
+ * Write Encryption root key used to derive LTK and CSRK
+ */
+ aci_hal_write_config_data(CONFIG_DATA_ER_OFFSET,
+ CONFIG_DATA_ER_LEN,
+ (uint8_t*) BLE_CFG_ER_VALUE);
+
+ /**
+ * Write random bd_address
+ */
+ /* random_bd_address = R_bd_address;
+ aci_hal_write_config_data(CONFIG_DATA_RANDOM_ADDRESS_WR,
+ CONFIG_DATA_RANDOM_ADDRESS_LEN,
+ (uint8_t*) random_bd_address);
+ */
+
+ /**
+ * Static random Address
+ * The two upper bits shall be set to 1
+ * The lowest 32bits is read from the UDN to differentiate between devices
+ * The RNG may be used to provide a random number on each power on
+ */
+ srd_bd_addr[1] = 0x0000ED6E;
+ srd_bd_addr[0] = LL_FLASH_GetUDN( );
+ aci_hal_write_config_data( CONFIG_DATA_RANDOM_ADDRESS_OFFSET, CONFIG_DATA_RANDOM_ADDRESS_LEN, (uint8_t*)srd_bd_addr );
+
+ /**
+ * Write Identity root key used to derive LTK and CSRK
+ */
+ aci_hal_write_config_data( CONFIG_DATA_IR_OFFSET, CONFIG_DATA_IR_LEN, (uint8_t*)BLE_CFG_IR_VALUE );
+
+ /**
+ * Write Encryption root key used to derive LTK and CSRK
+ */
+ aci_hal_write_config_data( CONFIG_DATA_ER_OFFSET, CONFIG_DATA_ER_LEN, (uint8_t*)BLE_CFG_ER_VALUE );
+
+ /**
+ * Set TX Power to 0dBm.
+ */
+ aci_hal_set_tx_power_level(1, CFG_TX_POWER);
+
+ /**
+ * Initialize GATT interface
+ */
+ aci_gatt_init();
+
+ /**
+ * Initialize GAP interface
+ */
+ role = 0;
+
+#if (BLE_CFG_PERIPHERAL == 1)
+ role |= GAP_PERIPHERAL_ROLE;
+#endif
+
+#if (BLE_CFG_CENTRAL == 1)
+ role |= GAP_CENTRAL_ROLE;
+#endif
+
+ if (role > 0)
+ {
+ const char *name = "STM32WB";
+ aci_gap_init(role, 0,
+ APPBLE_GAP_DEVICE_NAME_LENGTH,
+ &gap_service_handle, &gap_dev_name_char_handle, &gap_appearance_char_handle);
+
+ if (aci_gatt_update_char_value(gap_service_handle, gap_dev_name_char_handle, 0, strlen(name), (uint8_t *) name))
+ {
+ BLE_DBG_SVCCTL_MSG("Device Name aci_gatt_update_char_value failed.\n");
+ }
+ }
+
+ if(aci_gatt_update_char_value(gap_service_handle,
+ gap_appearance_char_handle,
+ 0,
+ 2,
+ (uint8_t *)&appearance))
+ {
+ BLE_DBG_SVCCTL_MSG("Appearance aci_gatt_update_char_value failed.\n");
+ }
+/**
+ * Initialize Default PHY
+ */
+ hci_le_set_default_phy(ALL_PHYS_PREFERENCE,TX_2M_PREFERRED,RX_2M_PREFERRED);
+
+ /**
+ * Initialize IO capability
+ */
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.ioCapability = CFG_IO_CAPABILITY;
+ aci_gap_set_io_capability(BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.ioCapability);
+
+ /**
+ * Initialize authentication
+ */
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.mitm_mode = CFG_MITM_PROTECTION;
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.OOB_Data_Present = 0;
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMin = 8;
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMax = 16;
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.Use_Fixed_Pin = 1;
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.Fixed_Pin = 1111;
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.bonding_mode = 0;
+ for (index = 0; index < 16; index++)
+ {
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.OOB_Data[index] = (uint8_t) index;
+ }
+
+ aci_gap_set_authentication_requirement(BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.bonding_mode,
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.mitm_mode,
+ 1,
+ 0,
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMin,
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMax,
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.Use_Fixed_Pin,
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.Fixed_Pin,
+0
+ );
+
+ /**
+ * Initialize whitelist
+ */
+ if (BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.bonding_mode)
+ {
+ aci_gap_configure_whitelist();
+ }
+}
+
+static void Adv_Request(APP_BLE_ConnStatus_t New_Status)
+{
+ tBleStatus ret = BLE_STATUS_INVALID_PARAMS;
+ uint16_t Min_Inter, Max_Inter;
+
+ if (New_Status == APP_BLE_FAST_ADV)
+ {
+ Min_Inter = AdvIntervalMin;
+ Max_Inter = AdvIntervalMax;
+ }
+ else
+ {
+ Min_Inter = CFG_LP_CONN_ADV_INTERVAL_MIN;
+ Max_Inter = CFG_LP_CONN_ADV_INTERVAL_MAX;
+ }
+
+ /**
+ * Stop the timer, it will be restarted for a new shot
+ * It does not hurt if the timer was not running
+ */
+ HW_TS_Stop(BleApplicationContext.Advertising_mgr_timer_Id);
+
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("First index in %d state \n",
+ BleApplicationContext.Device_Connection_Status);
+#endif
+ if ((New_Status == APP_BLE_LP_ADV)
+ && ((BleApplicationContext.Device_Connection_Status == APP_BLE_FAST_ADV)
+ || (BleApplicationContext.Device_Connection_Status == APP_BLE_LP_ADV)))
+ {
+ /* Connection in ADVERTISE mode have to stop the current advertising */
+ ret = aci_gap_set_non_discoverable();
+ if (ret == BLE_STATUS_SUCCESS)
+ {
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("Successfully Stopped Advertising");
+#endif
+ }
+ else
+ {
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("Stop Advertising Failed , result: %d \n", ret);
+#endif
+ }
+ }
+
+ BleApplicationContext.Device_Connection_Status = New_Status;
+ HR_Connection_Status = New_Status;
+ /* Start Fast or Low Power Advertising */
+ ret = aci_gap_set_discoverable(
+ ADV_IND,
+ Min_Inter,
+ Max_Inter,
+ PUBLIC_ADDR,
+ NO_WHITE_LIST_USE, /* use white list */
+ sizeof(local_name),
+ (uint8_t*) &local_name,
+ BleApplicationContext.BleApplicationContext_legacy.advtServUUIDlen,
+ BleApplicationContext.BleApplicationContext_legacy.advtServUUID,
+ 0,
+ 0);
+
+ /* Update Advertising data */
+ ret = aci_gap_update_adv_data(sizeof(manuf_data_hr), (uint8_t*) manuf_data_hr);
+
+ if (ret == BLE_STATUS_SUCCESS)
+ {
+ if (New_Status == APP_BLE_FAST_ADV)
+ {
+ APP_DBG_MSG("Successfully Start Fast Advertising " );
+ /* Start Timer to STOP ADV - TIMEOUT */
+ HW_TS_Start(BleApplicationContext.Advertising_mgr_timer_Id, INITIAL_ADV_TIMEOUT);
+ }
+ else
+ {
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("Successfully Start Low Power Advertising ");
+#endif
+ }
+ UART_App_SendData("\r\nA\r\n", 5);
+ }
+ else
+ {
+ if (New_Status == APP_BLE_FAST_ADV)
+ {
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("Start Fast Advertising Failed , result: %d \n", ret);
+#endif
+ }
+ else
+ {
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("Start Low Power Advertising Failed , result: %d \n", ret);
+#endif
+ }
+ UART_App_SendData("\r\nF\r\n", 5);
+ }
+
+ return;
+}
+
+const uint8_t* BleGetBdAddress( void )
+{
+ uint8_t *otp_addr;
+ const uint8_t *bd_addr;
+ uint32_t udn;
+ uint32_t company_id;
+ uint32_t device_id;
+
+ udn = LL_FLASH_GetUDN();
+
+ if(udn != 0xFFFFFFFF)
+ {
+ company_id = LL_FLASH_GetSTCompanyID();
+ device_id = LL_FLASH_GetDeviceID();
+
+ bd_addr_udn[0] = (uint8_t)(udn & 0x000000FF);
+ bd_addr_udn[1] = (uint8_t)( (udn & 0x0000FF00) >> 8 );
+ bd_addr_udn[2] = (uint8_t)( (udn & 0x00FF0000) >> 16 );
+ bd_addr_udn[3] = (uint8_t)device_id;
+ bd_addr_udn[4] = (uint8_t)(company_id & 0x000000FF);;
+ bd_addr_udn[5] = (uint8_t)( (company_id & 0x0000FF00) >> 8 );
+
+ bd_addr = (const uint8_t *)bd_addr_udn;
+ }
+ else
+ {
+ otp_addr = OTP_Read(0);
+ if(otp_addr)
+ {
+ bd_addr = ((OTP_ID0_t*)otp_addr)->bd_address;
+ }
+ else
+ {
+ bd_addr = M_bd_addr;
+ }
+
+ }
+
+ return bd_addr;
+}
+
+/* USER CODE BEGIN FD_LOCAL_FUNCTION */
+static void Confirm_Pairing ( void )
+{
+ aci_gap_numeric_comparison_value_confirm_yesno(BleApplicationContext.BleApplicationContext_legacy.connectionHandle,0x01);
+}
+
+static void Pairing_Request ( void )
+{
+ aci_gap_slave_security_req(BleApplicationContext.BleApplicationContext_legacy.connectionHandle);
+}
+/* USER CODE END FD_LOCAL_FUNCTION */
+
+/*************************************************************
+ *
+ *SPECIFIC FUNCTIONS
+ *
+ *************************************************************/
+//static void Add_Advertisment_Service_UUID( uint16_t servUUID )
+//{
+// BleApplicationContext.BleApplicationContext_legacy.advtServUUID[BleApplicationContext.BleApplicationContext_legacy.advtServUUIDlen] =
+// (uint8_t) (servUUID & 0xFF);
+// BleApplicationContext.BleApplicationContext_legacy.advtServUUIDlen++;
+// BleApplicationContext.BleApplicationContext_legacy.advtServUUID[BleApplicationContext.BleApplicationContext_legacy.advtServUUIDlen] =
+// (uint8_t) (servUUID >> 8) & 0xFF;
+// BleApplicationContext.BleApplicationContext_legacy.advtServUUIDlen++;
+//
+// return;
+//}
+
+static void Adv_Mgr( void )
+{
+ /**
+ * The code shall be executed in the background as an aci command may be sent
+ * The background is the only place where the application can make sure a new aci command
+ * is not sent if there is a pending one
+ */
+ UTIL_SEQ_SetTask(1 << CFG_TASK_ADV_UPDATE_ID, CFG_SCH_PRIO_0);
+
+ return;
+}
+
+static void Adv_Update( void )
+{
+ Adv_Request(APP_BLE_LP_ADV);
+
+ return;
+}
+
+/* USER CODE BEGIN FD_SPECIFIC_FUNCTIONS */
+
+/* USER CODE END FD_SPECIFIC_FUNCTIONS */
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+//void hci_notify_asynch_evt(void* pdata)
+//{
+// UTIL_SEQ_SetTask(1 << CFG_TASK_HCI_ASYNCH_EVT_ID, CFG_SCH_PRIO_0);
+// return;
+//}
+
+//void hci_cmd_resp_release(uint32_t flag)
+//{
+// UTIL_SEQ_SetEvt(1 << CFG_IDLEEVT_SYSTEM_HCI_CMD_EVT_RSP_ID);
+// return;
+//}
+
+//void hci_cmd_resp_wait(uint32_t timeout)
+//{
+// UTIL_SEQ_WaitEvt(1 << CFG_IDLEEVT_SYSTEM_HCI_CMD_EVT_RSP_ID);
+// return;
+//}
+
+static void BLE_UserEvtRx( void * pPayload )
+{
+ SVCCTL_UserEvtFlowStatus_t svctl_return_status;
+ tHCI_UserEvtRxParam *pParam;
+
+ pParam = (tHCI_UserEvtRxParam *)pPayload;
+
+ svctl_return_status = SVCCTL_UserEvtRx((void *)&(pParam->pckt->evtserial));
+ if (svctl_return_status != SVCCTL_UserEvtFlowDisable)
+ {
+ pParam->status = HCI_TL_UserEventFlow_Enable;
+ }
+ else
+ {
+ pParam->status = HCI_TL_UserEventFlow_Disable;
+ }
+}
+
+static void BLE_StatusNot( HCI_TL_CmdStatus_t status )
+{
+ uint32_t task_id_list;
+ switch (status)
+ {
+ case HCI_TL_CmdBusy:
+ /**
+ * All tasks that may send an aci/hci commands shall be listed here
+ * This is to prevent a new command is sent while one is already pending
+ */
+ task_id_list = (1 << CFG_LAST_TASK_ID_WITH_HCICMD) - 1;
+ UTIL_SEQ_PauseTask(task_id_list);
+
+ break;
+
+ case HCI_TL_CmdAvailable:
+ /**
+ * All tasks that may send an aci/hci commands shall be listed here
+ * This is to prevent a new command is sent while one is already pending
+ */
+ task_id_list = (1 << CFG_LAST_TASK_ID_WITH_HCICMD) - 1;
+ UTIL_SEQ_ResumeTask(task_id_list);
+
+ break;
+
+ default:
+ break;
+ }
+ return;
+}
+
+//void SVCCTL_ResumeUserEventFlow( void )
+//{
+// hci_resume_flow();
+// return;
+//}
+
+/* USER CODE BEGIN FD_WRAP_FUNCTIONS */
+
+/* USER CODE END FD_WRAP_FUNCTIONS */
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_hr.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_hr.h
new file mode 100644
index 000000000..dba4cde54
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_hr.h
@@ -0,0 +1,81 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file app_ble_hr.h
+ * @author MCD Application Team
+ * @brief Header for ble application
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_BLE_HR_H
+#define APP_BLE_HR_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+#include "hci_tl.h"
+#include "ble.h"
+#include "app_ble_common.h"
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Exported types ------------------------------------------------------------*/
+
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* External variables --------------------------------------------------------*/
+/* USER CODE BEGIN EV */
+
+/* USER CODE END EV */
+
+/* Exported macro ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions ---------------------------------------------*/
+ void APP_BLE_HR_Init( void );
+
+ APP_BLE_ConnStatus_t APP_BLE_HR_Get_Server_Connection_Status(void);
+
+ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_HR_Notification( void *pckt );
+
+/* USER CODE BEGIN EF */
+void APP_BLE_HR_Key_Button1_Action(void);
+void APP_BLE_HR_Key_Button2_Action(void);
+void APP_BLE_HR_Key_Button3_Action(void);
+
+/* USER CODE END EF */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*APP_BLE_HR_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_sv.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_sv.c
new file mode 100644
index 000000000..5b7d58adc
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_sv.c
@@ -0,0 +1,1271 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file app_ble_sv.c
+ * @author MCD Application Team
+ * @brief BLE Application
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+
+#include "app_common.h"
+
+#include "dbg_trace.h"
+#include "tl.h"
+#include "app_ble_sv.h"
+
+#include "stm32_seq.h"
+#include "shci.h"
+#include "stm32_lpm.h"
+#include "otp.h"
+#include "p2p_server_app.h"
+#include "uart_app.h"
+
+
+extern Disconnection_Status_t disconnection_status; //0 disconnection from Remote; 1 disconnection from Application to switch of BLE App; 2 disconnection ordered by AT command
+
+extern uint16_t Connection_Update_Interval;
+
+extern PairingContext_t PairingContext;
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+
+/**
+ * security parameters structure
+ */
+typedef struct _tSecurityParams
+{
+ /**
+ * IO capability of the device
+ */
+ uint8_t ioCapability;
+
+ /**
+ * Authentication requirement of the device
+ * Man In the Middle protection required?
+ */
+ uint8_t mitm_mode;
+
+ /**
+ * bonding mode of the device
+ */
+ uint8_t bonding_mode;
+
+ /**
+ * Flag to tell whether OOB data has
+ * to be used during the pairing process
+ */
+ uint8_t OOB_Data_Present;
+
+ /**
+ * OOB data to be used in the pairing process if
+ * OOB_Data_Present is set to TRUE
+ */
+ uint8_t OOB_Data[16];
+
+ /**
+ * this variable indicates whether to use a fixed pin
+ * during the pairing process or a passkey has to be
+ * requested to the application during the pairing process
+ * 0 implies use fixed pin and 1 implies request for passkey
+ */
+ uint8_t Use_Fixed_Pin;
+
+ /**
+ * minimum encryption key size requirement
+ */
+ uint8_t encryptionKeySizeMin;
+
+ /**
+ * maximum encryption key size requirement
+ */
+ uint8_t encryptionKeySizeMax;
+
+ /**
+ * fixed pin to be used in the pairing process if
+ * Use_Fixed_Pin is set to 1
+ */
+ uint32_t Fixed_Pin;
+
+ /**
+ * this flag indicates whether the host has to initiate
+ * the security, wait for pairing or does not have any security
+ * requirements.\n
+ * 0x00 : no security required
+ * 0x01 : host should initiate security by sending the slave security
+ * request command
+ * 0x02 : host need not send the clave security request but it
+ * has to wait for paiirng to complete before doing any other
+ * processing
+ */
+ uint8_t initiateSecurity;
+}tSecurityParams;
+
+/**
+ * global context
+ * contains the variables common to all
+ * services
+ */
+typedef struct _tBLEProfileGlobalContext
+{
+
+ /**
+ * security requirements of the host
+ */
+ tSecurityParams bleSecurityParam;
+
+ /**
+ * gap service handle
+ */
+ uint16_t gapServiceHandle;
+
+ /**
+ * device name characteristic handle
+ */
+ uint16_t devNameCharHandle;
+
+ /**
+ * appearance characteristic handle
+ */
+ uint16_t appearanceCharHandle;
+
+ /**
+ * connection handle of the current active connection
+ * When not in connection, the handle is set to 0xFFFF
+ */
+ uint16_t connectionHandle;
+
+ /**
+ * length of the UUID list to be used while advertising
+ */
+ uint8_t advtServUUIDlen;
+
+ /**
+ * the UUID list to be used while advertising
+ */
+ uint8_t advtServUUID[100];
+
+}BleGlobalContext_t;
+
+typedef struct
+{
+ BleGlobalContext_t BleApplicationContext_legacy;
+ APP_BLE_ConnStatus_t Device_Connection_Status;
+ /**
+ * ID of the Advertising Timeout
+ */
+ uint8_t Advertising_mgr_timer_Id;
+
+ uint8_t SwitchOffGPIO_timer_Id;
+}BleApplicationContext_t;
+/* USER CODE BEGIN PTD */
+
+/* USER CODE END PTD */
+
+/* Private defines -----------------------------------------------------------*/
+#define APPBLE_GAP_DEVICE_NAME_LENGTH 7
+#define FAST_ADV_TIMEOUT 5*(30*1000*1000/CFG_TS_TICK_VAL) /**< 5*30s */
+#define INITIAL_ADV_TIMEOUT 5*(60*1000*1000/CFG_TS_TICK_VAL) /**< 5*60s */
+
+#define BD_ADDR_SIZE_LOCAL 6
+
+/* USER CODE BEGIN PD */
+#define LED_ON_TIMEOUT (0.005*1000*1000/CFG_TS_TICK_VAL) /**< 5ms */
+/* USER CODE END PD */
+
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private variables ---------------------------------------------------------*/
+PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static TL_CmdPacket_t BleCmdBuffer;
+
+static const uint8_t M_bd_addr[BD_ADDR_SIZE_LOCAL] =
+ {
+ (uint8_t)((CFG_ADV_BD_ADDRESS & 0x0000000000FF)),
+ (uint8_t)((CFG_ADV_BD_ADDRESS & 0x00000000FF00) >> 8),
+ (uint8_t)((CFG_ADV_BD_ADDRESS & 0x000000FF0000) >> 16),
+ (uint8_t)((CFG_ADV_BD_ADDRESS & 0x0000FF000000) >> 24),
+ (uint8_t)((CFG_ADV_BD_ADDRESS & 0x00FF00000000) >> 32),
+ (uint8_t)((CFG_ADV_BD_ADDRESS & 0xFF0000000000) >> 40)
+ };
+
+static uint8_t bd_addr_udn[BD_ADDR_SIZE_LOCAL];
+
+/**
+* Identity root key used to derive LTK and CSRK
+*/
+static const uint8_t BLE_CFG_IR_VALUE[16] = CFG_BLE_IRK;
+
+/**
+* Encryption root key used to derive LTK and CSRK
+*/
+static const uint8_t BLE_CFG_ER_VALUE[16] = CFG_BLE_ERK;
+
+PLACE_IN_SECTION("BLE_APP_CONTEXT") static BleApplicationContext_t BleApplicationContext;
+PLACE_IN_SECTION("BLE_APP_CONTEXT") static uint16_t AdvIntervalMin, AdvIntervalMax;
+
+P2PS_APP_ConnHandle_Not_evt_t handleNotification;
+
+#if L2CAP_REQUEST_NEW_CONN_PARAM != 0
+#define SIZE_TAB_CONN_INT 2
+uint8_t index_con_int, mutex;
+#endif
+
+APP_BLE_ConnStatus_t SV_Connection_Status;
+
+
+
+/**
+ * Advertising Data
+ */
+#if (P2P_SERVER1 != 0)
+static const char local_name[] = { AD_TYPE_COMPLETE_LOCAL_NAME ,'A','T','P','2','P','S','V'};
+uint8_t manuf_data_sv[14] = {
+ sizeof(manuf_data_sv)-1, AD_TYPE_MANUFACTURER_SPECIFIC_DATA,
+ 0x01/*SKD version */,
+ CFG_DEV_ID_AT_P2P_SERVER /* STM32WB - P2P Server 1*/,
+ 0x00 /* GROUP A Feature */,
+ 0x00 /* GROUP A Feature */,
+ 0x00 /* GROUP B Feature */,
+ 0x00 /* GROUP B Feature */,
+ 0x00, /* BLE MAC start -MSB */
+ 0x00,
+ 0x00,
+ 0x00,
+ 0x00,
+ 0x00, /* BLE MAC stop */
+};
+#endif
+/**
+ * Advertising Data
+ */
+#if (P2P_SERVER2 != 0)
+static const char local_name[] = { AD_TYPE_COMPLETE_LOCAL_NAME, 'P', '2', 'P', 'S', 'R', 'V', '2'};
+uint8_t manuf_data_sv[14] = {
+ sizeof(manuf_data_sv)-1, AD_TYPE_MANUFACTURER_SPECIFIC_DATA,
+ 0x01/*SKD version */,
+ CFG_DEV_ID_P2P_SERVER2 /* STM32WB - P2P Server 2*/,
+ 0x00 /* GROUP A Feature */,
+ 0x00 /* GROUP A Feature */,
+ 0x00 /* GROUP B Feature */,
+ 0x00 /* GROUP B Feature */,
+ 0x00, /* BLE MAC start -MSB */
+ 0x00,
+ 0x00,
+ 0x00,
+ 0x00,
+ 0x00, /* BLE MAC stop */
+};
+
+#endif
+
+#if (P2P_SERVER3 != 0)
+static const char local_name[] = { AD_TYPE_COMPLETE_LOCAL_NAME, 'P', '2', 'P', 'S', 'R', 'V', '3'};
+uint8_t manuf_data_sv[14] = {
+ sizeof(manuf_data_sv)-1, AD_TYPE_MANUFACTURER_SPECIFIC_DATA,
+ 0x01/*SKD version */,
+ CFG_DEV_ID_P2P_SERVER3 /* STM32WB - P2P Server 3*/,
+ 0x00 /* GROUP A Feature */,
+ 0x00 /* GROUP A Feature */,
+ 0x00 /* GROUP B Feature */,
+ 0x00 /* GROUP B Feature */,
+ 0x00, /* BLE MAC start -MSB */
+ 0x00,
+ 0x00,
+ 0x00,
+ 0x00,
+ 0x00, /* BLE MAC stop */
+};
+#endif
+
+#if (P2P_SERVER4 != 0)
+static const char local_name[] = { AD_TYPE_COMPLETE_LOCAL_NAME, 'P', '2', 'P', 'S', 'R', 'V', '4'};
+uint8_t manuf_data_sv[14] = {
+ sizeof(manuf_data_sv)-1, AD_TYPE_MANUFACTURER_SPECIFIC_DATA,
+ 0x01/*SKD version */,
+ CFG_DEV_ID_P2P_SERVER4 /* STM32WB - P2P Server 4*/,
+ 0x00 /* GROUP A Feature */,
+ 0x00 /* GROUP A Feature */,
+ 0x00 /* GROUP B Feature */,
+ 0x00 /* GROUP B Feature */,
+ 0x00, /* BLE MAC start -MSB */
+ 0x00,
+ 0x00,
+ 0x00,
+ 0x00,
+ 0x00, /* BLE MAC stop */
+};
+#endif
+
+#if (P2P_SERVER5 != 0)
+static const char local_name[] = { AD_TYPE_COMPLETE_LOCAL_NAME, 'P', '2', 'P', 'S', 'R', 'V', '5'};
+uint8_t manuf_data_sv[14] = {
+ sizeof(manuf_data_sv)-1, AD_TYPE_MANUFACTURER_SPECIFIC_DATA,
+ 0x01/*SKD version */,
+ CFG_DEV_ID_P2P_SERVER5 /* STM32WB - P2P Server 5*/,
+ 0x00 /* GROUP A Feature */,
+ 0x00 /* GROUP A Feature */,
+ 0x00 /* GROUP B Feature */,
+ 0x00 /* GROUP B Feature */,
+ 0x00, /* BLE MAC start -MSB */
+ 0x00,
+ 0x00,
+ 0x00,
+ 0x00,
+ 0x00, /* BLE MAC stop */
+};
+#endif
+
+#if (P2P_SERVER6 != 0)
+static const char local_name[] = { AD_TYPE_COMPLETE_LOCAL_NAME, 'P', '2', 'P', 'S', 'R', 'V', '6'};
+uint8_t manuf_data_sv[14] = {
+ sizeof(manuf_data_sv)-1, AD_TYPE_MANUFACTURER_SPECIFIC_DATA,
+ 0x01/*SKD version */,
+ CFG_DEV_ID_P2P_SERVER6 /* STM32WB - P2P Server 1*/,
+ 0x00 /* GROUP A Feature */,
+ 0x00 /* GROUP A Feature */,
+ 0x00 /* GROUP B Feature */,
+ 0x00 /* GROUP B Feature */,
+ 0x00, /* BLE MAC start -MSB */
+ 0x00,
+ 0x00,
+ 0x00,
+ 0x00,
+ 0x00, /* BLE MAC stop */
+};
+#endif
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+static void BLE_UserEvtRx( void * pPayload );
+static void BLE_StatusNot( HCI_TL_CmdStatus_t status );
+static void Ble_Tl_Init( void );
+static void Ble_Hci_Gap_Gatt_Init(void);
+static const uint8_t* BleGetBdAddress( void );
+static void Adv_Request( APP_BLE_ConnStatus_t New_Status );
+static void Adv_Req( void );
+static void Adv_Cancel( void );
+//static void Adv_Cancel_Req( void );
+static void Switch_OFF_GPIO( void );
+#if(L2CAP_REQUEST_NEW_CONN_PARAM != 0)
+static void BLE_SVC_L2CAP_Conn_Update(uint16_t Connection_Handle);
+#endif
+static void APP_BLE_SV_GAP_Disconnect( void );
+static void Confirm_Pairing( void );
+static void Pairing_Request ( void );
+
+/* USER CODE BEGIN PFP */
+
+/* USER CODE END PFP */
+
+/* Functions Definition ------------------------------------------------------*/
+void APP_BLE_SV_Init( void )
+{
+/* USER CODE BEGIN APP_BLE_Init_1 */
+/* USER CODE END APP_BLE_Init_1 */
+ SHCI_C2_Ble_Init_Cmd_Packet_t ble_init_cmd_packet =
+ {
+ {{0,0,0}}, /**< Header unused */
+ {0, /** pBleBufferAddress not used */
+ 0, /** BleBufferSize not used */
+ CFG_BLE_NUM_GATT_ATTRIBUTES,
+ CFG_BLE_NUM_GATT_SERVICES,
+ CFG_BLE_ATT_VALUE_ARRAY_SIZE,
+ CFG_BLE_NUM_LINK,
+ CFG_BLE_DATA_LENGTH_EXTENSION,
+ CFG_BLE_PREPARE_WRITE_LIST_SIZE,
+ CFG_BLE_MBLOCK_COUNT,
+ CFG_BLE_MAX_ATT_MTU,
+ CFG_BLE_SLAVE_SCA,
+ CFG_BLE_MASTER_SCA,
+ CFG_BLE_LSE_SOURCE,
+ CFG_BLE_MAX_CONN_EVENT_LENGTH,
+ CFG_BLE_HSE_STARTUP_TIME,
+ CFG_BLE_VITERBI_MODE,
+ CFG_BLE_LL_ONLY,
+ 0}
+ };
+
+ /**
+ * Initialize Ble Transport Layer
+ */
+ Ble_Tl_Init( );
+
+ /**
+ * Do not allow standby in the application
+ */
+ UTIL_LPM_SetOffMode(1 << CFG_LPM_APP_BLE, UTIL_LPM_DISABLE);
+
+ /**
+ * Register the hci transport layer to handle BLE User Asynchronous Events
+ */
+ UTIL_SEQ_RegTask( 1<<CFG_TASK_HCI_ASYNCH_EVT_ID, UTIL_SEQ_RFU, hci_user_evt_proc);
+
+ /**
+ * Starts the BLE Stack on CPU2
+ */
+ SHCI_C2_BLE_Init( &ble_init_cmd_packet );
+
+ /**
+ * Initialization of HCI & GATT & GAP layer
+ */
+ Ble_Hci_Gap_Gatt_Init();
+
+ /**
+ * Initialization of the BLE Services
+ */
+ SVCCTL_Init();
+
+ /**
+ * Initialization of the BLE App Context
+ */
+ BleApplicationContext.Device_Connection_Status = APP_BLE_IDLE;
+ SV_Connection_Status = APP_BLE_IDLE;
+ BleApplicationContext.BleApplicationContext_legacy.connectionHandle = 0xFFFF;
+ /**
+ * From here, all initialization are BLE application specific
+ */
+ UTIL_SEQ_RegTask( 1<<CFG_TASK_ADV_CANCEL_ID, UTIL_SEQ_RFU, Adv_Cancel);
+ UTIL_SEQ_RegTask( 1<<CFG_TASK_ADV_REQ_ID, UTIL_SEQ_RFU, Adv_Req);
+ UTIL_SEQ_RegTask( 1<<CFG_TASK_CONN_UPDATE_ID, UTIL_SEQ_RFU, APP_BLE_SV_Conn_Update);
+ UTIL_SEQ_RegTask( 1<<CFG_TASK_SV_GAP_DISCON_ID, UTIL_SEQ_RFU, APP_BLE_SV_GAP_Disconnect);
+ UTIL_SEQ_RegTask( 1<<CFG_TASK_CONFIRM_PAIRING_ID, UTIL_SEQ_RFU, Confirm_Pairing);
+ UTIL_SEQ_RegTask( 1<<CFG_TASK_REQUEST_PAIRING_ID, UTIL_SEQ_RFU, Pairing_Request);
+
+ /**
+ * Initialization of ADV - Ad Manufacturer Element
+ */
+#if(RADIO_ACTIVITY_EVENT != 0)
+ aci_hal_set_radio_activity_mask(0x0006);
+#endif
+
+#if (L2CAP_REQUEST_NEW_CONN_PARAM != 0 )
+ index_con_int = 0;
+ mutex = 1;
+#endif
+ /**
+ * Initialize P2P Server Application
+ */
+ P2PS_APP_Init();
+
+ /**
+ * Create timer to handle the Advertising Stop
+ */
+// HW_TS_Create(CFG_TIM_PROC_ID_ISR, &(BleApplicationContext.Advertising_mgr_timer_Id), hw_ts_SingleShot, Adv_Cancel_Req);
+ /**
+ * Create timer to handle the Led Switch OFF
+ */
+ HW_TS_Create(CFG_TIM_PROC_ID_ISR, &(BleApplicationContext.SwitchOffGPIO_timer_Id), hw_ts_SingleShot, Switch_OFF_GPIO);
+
+ /**
+ * Make device discoverable
+ */
+ BleApplicationContext.BleApplicationContext_legacy.advtServUUID[0] = NULL;
+ BleApplicationContext.BleApplicationContext_legacy.advtServUUIDlen = 0;
+ /* Initialize intervals for reconnexion without intervals update */
+ AdvIntervalMin = CFG_FAST_CONN_ADV_INTERVAL_MIN;
+ AdvIntervalMax = CFG_FAST_CONN_ADV_INTERVAL_MAX;
+
+ /**
+ * Send a acknowledgement of the correct initialization of the p2p application
+ */
+ UART_App_SendData("\r\nSV OK\r\n", 9);
+
+ /**
+ * Start to Advertise to be connected by P2P Client
+ */
+// Adv_Request(APP_BLE_FAST_ADV);
+
+/* USER CODE BEGIN APP_BLE_Init_2 */
+
+
+/* USER CODE END APP_BLE_Init_2 */
+ return;
+}
+
+SVCCTL_UserEvtFlowStatus_t SVCCTL_App_SV_Notification( void *pckt )
+{
+ hci_event_pckt *event_pckt;
+ evt_le_meta_event *meta_evt;
+ evt_blue_aci *blue_evt;
+ /* Pairing */
+ aci_gap_numeric_comparison_value_event_rp0 *evt_numeric_value;
+ aci_gap_pairing_complete_event_rp0 *pairing_complete;
+ uint32_t numeric_value;
+ char numeric_value_str[20];
+ /*****/
+
+ event_pckt = (hci_event_pckt*) ((hci_uart_pckt *) pckt)->data;
+
+ switch (event_pckt->evt)
+ {
+ case EVT_DISCONN_COMPLETE:
+ {
+ hci_disconnection_complete_event_rp0 *disconnection_complete_event;
+ disconnection_complete_event = (hci_disconnection_complete_event_rp0 *) event_pckt->data;
+
+ if (disconnection_complete_event->Connection_Handle == BleApplicationContext.BleApplicationContext_legacy.connectionHandle)
+ {
+ BleApplicationContext.BleApplicationContext_legacy.connectionHandle = 0;
+ BleApplicationContext.Device_Connection_Status = APP_BLE_IDLE;
+ SV_Connection_Status = APP_BLE_IDLE;
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("\r\n\r** DISCONNECTION EVENT WITH CLIENT \n");
+#endif
+ }
+
+ if (disconnection_status == TO_SWITCH_APP) //Disconnection done by application for switching app
+ {
+ handleNotification.P2P_Evt_Opcode = PEER_DISCON_SWITCH_HANDLE_EVT;
+ handleNotification.ConnectionHandle = BleApplicationContext.BleApplicationContext_legacy.connectionHandle;
+ P2PS_APP_Notification(&handleNotification);
+ }
+ else { //Deconnection done by user/client
+ /* restart advertising */
+// Adv_Request(APP_BLE_FAST_ADV);
+
+ PairingContext.PairingComplete = 0; //The pairing is reset to allow the user to perform a pairing on next connection
+ /*
+ * SPECIFIC to P2P Server APP
+ */
+ handleNotification.P2P_Evt_Opcode = PEER_DISCON_HANDLE_EVT;
+ handleNotification.ConnectionHandle = BleApplicationContext.BleApplicationContext_legacy.connectionHandle;
+ P2PS_APP_Notification(&handleNotification);
+ }
+
+
+
+}
+
+ break; /* EVT_DISCONN_COMPLETE */
+
+ case EVT_LE_META_EVENT:
+ {
+ meta_evt = (evt_le_meta_event*) event_pckt->data;
+ /* USER CODE BEGIN EVT_LE_META_EVENT */
+
+ /* USER CODE END EVT_LE_META_EVENT */
+ switch (meta_evt->subevent)
+ {
+ case EVT_LE_CONN_UPDATE_COMPLETE:
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("\r\n\r** CONNECTION UPDATE EVENT WITH CLIENT \n");
+#endif
+ /* USER CODE BEGIN EVT_LE_CONN_UPDATE_COMPLETE */
+
+ /* USER CODE END EVT_LE_CONN_UPDATE_COMPLETE */
+ break;
+ case EVT_LE_CONN_COMPLETE:
+ {
+ hci_le_connection_complete_event_rp0 *connection_complete_event;
+
+ /**
+ * The connection is done, there is no need anymore to schedule the LP ADV
+ */
+ connection_complete_event = (hci_le_connection_complete_event_rp0 *) meta_evt->data;
+
+// HW_TS_Stop(BleApplicationContext.Advertising_mgr_timer_Id);
+
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("EVT_LE_CONN_COMPLETE for connection handle 0x%x\n",
+ connection_complete_event->Connection_Handle);
+#endif
+ if (BleApplicationContext.Device_Connection_Status == APP_BLE_LP_CONNECTING)
+ {
+ /* Connection as client */
+ BleApplicationContext.Device_Connection_Status = APP_BLE_CONNECTED_CLIENT;
+ SV_Connection_Status = APP_BLE_CONNECTED_CLIENT;
+ }
+ else
+ {
+ /* Connection as server */
+ BleApplicationContext.Device_Connection_Status = APP_BLE_CONNECTED_SERVER;
+ SV_Connection_Status = APP_BLE_CONNECTED_SERVER;
+ }
+ BleApplicationContext.BleApplicationContext_legacy.connectionHandle =
+ connection_complete_event->Connection_Handle;
+
+ /* USER CODE BEGIN HCI_EVT_LE_CONN_COMPLETE */
+ /*
+* SPECIFIC to P2P Server APP
+*/
+ handleNotification.P2P_Evt_Opcode = PEER_CONN_HANDLE_EVT;
+ handleNotification.ConnectionHandle = BleApplicationContext.BleApplicationContext_legacy.connectionHandle;
+ P2PS_APP_Notification(&handleNotification);
+/**/
+ /* USER CODE END HCI_EVT_LE_CONN_COMPLETE */
+ }
+ break; /* HCI_EVT_LE_CONN_COMPLETE */
+
+ default:
+ /* USER CODE BEGIN SUBEVENT_DEFAULT */
+
+ /* USER CODE END SUBEVENT_DEFAULT */
+ break;
+ }
+ }
+ break; /* HCI_EVT_LE_META_EVENT */
+
+ case EVT_VENDOR:
+ blue_evt = (evt_blue_aci*) event_pckt->data;
+ /* USER CODE BEGIN EVT_VENDOR */
+
+ /* USER CODE END EVT_VENDOR */
+ switch (blue_evt->ecode)
+ {
+ /* USER CODE BEGIN ecode */
+
+ /* USER CODE END ecode */
+/*
+* SPECIFIC to P2P Server APP
+*/
+ case EVT_BLUE_L2CAP_CONNECTION_UPDATE_RESP:
+#if (L2CAP_REQUEST_NEW_CONN_PARAM != 0 )
+ mutex = 1;
+ UART_App_SendData("\r\nOK\r\n", 6);
+#endif
+ /* USER CODE BEGIN EVT_BLUE_L2CAP_CONNECTION_UPDATE_RESP */
+
+ /* USER CODE END EVT_BLUE_L2CAP_CONNECTION_UPDATE_RESP */
+ break;
+ case EVT_BLUE_GAP_PROCEDURE_COMPLETE:
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("\r\n\r** EVT_BLUE_GAP_PROCEDURE_COMPLETE \n");
+#endif
+ /* USER CODE BEGIN EVT_BLUE_GAP_PROCEDURE_COMPLETE */
+
+ /* USER CODE END EVT_BLUE_GAP_PROCEDURE_COMPLETE */
+ break; /* EVT_BLUE_GAP_PROCEDURE_COMPLETE */
+
+ /* Pairing */
+// case EVT_BLUE_GAP_PASS_KEY_REQUEST:
+// aci_gap_pass_key_resp(BleApplicationContext.BleApplicationContext_legacy.connectionHandle, 1111);
+// break;
+ case EVT_BLUE_GAP_NUMERIC_COMPARISON_VALUE:
+ UART_App_SendData("\r\n", 2);
+ PairingContext.PairingConfirmRequested = 1;
+ evt_numeric_value = (aci_gap_numeric_comparison_value_event_rp0 *)blue_evt->data;
+ numeric_value = evt_numeric_value->Numeric_Value;
+ sprintf(numeric_value_str, "%d", (int)numeric_value);
+ UART_App_SendData((char *)numeric_value_str, (uint8_t)(strlen(numeric_value_str)));
+ UART_App_SendData(":PREQ?\r\n", 8);
+// APP_DBG_MSG("numeric_value = %x\n", numeric_value);
+// aci_gap_numeric_comparison_value_confirm_yesno(BleApplicationContext.BleApplicationContext_legacy.connectionHandle,0x01);
+ break;
+
+ case EVT_BLUE_GAP_PAIRING_CMPLT: //aci_gap_pairing_complete_event_process
+ pairing_complete = (aci_gap_pairing_complete_event_rp0*)blue_evt->data;
+// APP_DBG_MSG("BLE_CTRL_App_Notification: EVT_BLUE_GAP_PAIRING_CMPLT, pairing_complete->Status = %d\n",pairing_complete->Status);
+ if (pairing_complete->Status == 0)
+ {
+ UART_App_SendData("\r\nP\r\n", 5);
+ PairingContext.PairingComplete = 1;
+ }
+ else UART_App_SendData("\r\nF\r\n", 5);
+ break;
+
+#if(RADIO_ACTIVITY_EVENT != 0)
+ case 0x0004:
+ /* USER CODE BEGIN RADIO_ACTIVITY_EVENT*/
+ BSP_LED_On(LED_GREEN);
+ HW_TS_Start(BleApplicationContext.SwitchOffGPIO_timer_Id, (uint32_t)LED_ON_TIMEOUT);
+ /* USER CODE END RADIO_ACTIVITY_EVENT*/
+ break; /* RADIO_ACTIVITY_EVENT */
+#endif
+ }
+ break; /* EVT_VENDOR */
+
+ default:
+ /* USER CODE BEGIN ECODE_DEFAULT*/
+
+ /* USER CODE END ECODE_DEFAULT*/
+ break;
+ }
+
+ return (SVCCTL_UserEvtFlowEnable);
+}
+
+APP_BLE_ConnStatus_t APP_BLE_SV_Get_Server_Connection_Status(void)
+{
+ return BleApplicationContext.Device_Connection_Status;
+}
+
+void APP_BLE_SV_Conn_Update(void)
+{
+#if (L2CAP_REQUEST_NEW_CONN_PARAM != 0 )
+ if (BleApplicationContext.Device_Connection_Status != APP_BLE_FAST_ADV && BleApplicationContext.Device_Connection_Status != APP_BLE_IDLE)
+ {
+ BLE_SVC_L2CAP_Conn_Update(BleApplicationContext.BleApplicationContext_legacy.connectionHandle);
+
+ }
+ return;
+#endif
+}
+
+/**
+ * @brief Disconnect the Link before switching to another BLE Application
+ * @param None
+ * @retval None
+ */
+static void APP_BLE_SV_GAP_Disconnect(){
+ tBleStatus result;
+ result = aci_gap_terminate(BleApplicationContext.BleApplicationContext_legacy.connectionHandle, ERR_RMT_USR_TERM_CONN);
+
+ if (result == BLE_STATUS_SUCCESS)
+ {
+ APP_DBG_MSG(" \r\n\r** TERMINATE CONNECTION ** \r\n\r");
+ }
+ else
+ {
+ APP_DBG_MSG("-- APP_BLE_SV_GAP_Disconnect, Failed \r\n\r");
+ BSP_LED_On(LED_RED);
+ }
+ return;
+}
+
+/* USER CODE BEGIN FD*/
+void APP_BLE_SV_Key_Button1_Action(void)
+{
+ P2PS_APP_SW1_Button_Action();
+}
+
+void APP_BLE_SV_Key_Button2_Action(void)
+{
+}
+
+void APP_BLE_SV_Key_Button3_Action(void)
+{
+}
+
+/* USER CODE END FD*/
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+static void Ble_Tl_Init( void )
+{
+ HCI_TL_HciInitConf_t Hci_Tl_Init_Conf;
+
+ Hci_Tl_Init_Conf.p_cmdbuffer = (uint8_t*)&BleCmdBuffer;
+ Hci_Tl_Init_Conf.StatusNotCallBack = BLE_StatusNot;
+ hci_init(BLE_UserEvtRx, (void*) &Hci_Tl_Init_Conf);
+
+ return;
+}
+
+ static void Ble_Hci_Gap_Gatt_Init(void){
+
+ uint8_t role;
+ uint8_t index;
+ uint16_t gap_service_handle, gap_dev_name_char_handle, gap_appearance_char_handle;
+ const uint8_t *bd_addr;
+ uint32_t srd_bd_addr[2];
+ uint16_t appearance[1] = { BLE_CFG_GAP_APPEARANCE };
+
+ /**
+ * Initialize HCI layer
+ */
+ /*HCI Reset to synchronise BLE Stack*/
+ hci_reset();
+
+ /**
+ * Write the BD Address
+ */
+
+ bd_addr = BleGetBdAddress();
+ aci_hal_write_config_data(CONFIG_DATA_PUBADDR_OFFSET,
+ CONFIG_DATA_PUBADDR_LEN,
+ (uint8_t*) bd_addr);
+
+ /* BLE MAC in ADV Packet */
+ manuf_data_sv[ sizeof(manuf_data_sv)-6] = bd_addr[5];
+ manuf_data_sv[ sizeof(manuf_data_sv)-5] = bd_addr[4];
+ manuf_data_sv[ sizeof(manuf_data_sv)-4] = bd_addr[3];
+ manuf_data_sv[ sizeof(manuf_data_sv)-3] = bd_addr[2];
+ manuf_data_sv[ sizeof(manuf_data_sv)-2] = bd_addr[1];
+ manuf_data_sv[ sizeof(manuf_data_sv)-1] = bd_addr[0];
+
+ /**
+ * Static random Address
+ * The two upper bits shall be set to 1
+ * The lowest 32bits is read from the UDN to differentiate between devices
+ * The RNG may be used to provide a random number on each power on
+ */
+ srd_bd_addr[1] = 0x0000ED6E;
+ srd_bd_addr[0] = LL_FLASH_GetUDN( );
+ aci_hal_write_config_data( CONFIG_DATA_RANDOM_ADDRESS_OFFSET, CONFIG_DATA_RANDOM_ADDRESS_LEN, (uint8_t*)srd_bd_addr );
+
+ /**
+ * Write Identity root key used to derive LTK and CSRK
+ */
+ aci_hal_write_config_data( CONFIG_DATA_IR_OFFSET, CONFIG_DATA_IR_LEN, (uint8_t*)BLE_CFG_IR_VALUE );
+
+ /**
+ * Write Encryption root key used to derive LTK and CSRK
+ */
+ aci_hal_write_config_data( CONFIG_DATA_ER_OFFSET, CONFIG_DATA_ER_LEN, (uint8_t*)BLE_CFG_ER_VALUE );
+
+ /**
+ * Set TX Power to 0dBm.
+ */
+ aci_hal_set_tx_power_level(1, CFG_TX_POWER);
+
+ /**
+ * Initialize GATT interface
+ */
+ aci_gatt_init();
+
+ /**
+ * Initialize GAP interface
+ */
+ role = 0;
+
+#if (BLE_CFG_PERIPHERAL == 1)
+ role |= GAP_PERIPHERAL_ROLE;
+#endif
+
+#if (BLE_CFG_CENTRAL == 1)
+ role |= GAP_CENTRAL_ROLE;
+#endif
+
+ if (role > 0)
+ {
+ const char *name = "STM32WB";
+ aci_gap_init(role, 0,
+ APPBLE_GAP_DEVICE_NAME_LENGTH,
+ &gap_service_handle, &gap_dev_name_char_handle, &gap_appearance_char_handle);
+
+ if (aci_gatt_update_char_value(gap_service_handle, gap_dev_name_char_handle, 0, strlen(name), (uint8_t *) name))
+ {
+ BLE_DBG_SVCCTL_MSG("Device Name aci_gatt_update_char_value failed.\n");
+ }
+ }
+
+ if(aci_gatt_update_char_value(gap_service_handle,
+ gap_appearance_char_handle,
+ 0,
+ 2,
+ (uint8_t *)&appearance))
+ {
+ BLE_DBG_SVCCTL_MSG("Appearance aci_gatt_update_char_value failed.\n");
+ }
+/**
+ * Initialize Default PHY
+ */
+ hci_le_set_default_phy(ALL_PHYS_PREFERENCE,TX_2M_PREFERRED,RX_2M_PREFERRED);
+
+ /**
+ * Initialize IO capability
+ */
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.ioCapability = CFG_IO_CAPABILITY;
+ aci_gap_set_io_capability(BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.ioCapability);
+
+ /**
+ * Initialize authentication
+ */
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.mitm_mode = CFG_MITM_PROTECTION;
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.OOB_Data_Present = 0;
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMin = 8;
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMax = 16;
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.Use_Fixed_Pin = 1;
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.Fixed_Pin = 1111;
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.bonding_mode = 0;
+ for (index = 0; index < 16; index++)
+ {
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.OOB_Data[index] = (uint8_t) index;
+ }
+
+ aci_gap_set_authentication_requirement(BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.bonding_mode,
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.mitm_mode,
+ 1,
+ 0,
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMin,
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMax,
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.Use_Fixed_Pin,
+ BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.Fixed_Pin,
+ 0
+ );
+
+ /**
+ * Initialize whitelist
+ */
+ if (BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.bonding_mode)
+ {
+ aci_gap_configure_whitelist();
+ }
+}
+
+static void Adv_Request(APP_BLE_ConnStatus_t New_Status)
+{
+ tBleStatus ret = BLE_STATUS_INVALID_PARAMS;
+ uint16_t Min_Inter, Max_Inter;
+
+ if (New_Status == APP_BLE_FAST_ADV)
+ {
+ Min_Inter = AdvIntervalMin;
+ Max_Inter = AdvIntervalMax;
+ }
+ else
+ {
+ Min_Inter = CFG_LP_CONN_ADV_INTERVAL_MIN;
+ Max_Inter = CFG_LP_CONN_ADV_INTERVAL_MAX;
+ }
+
+ /**
+ * Stop the timer, it will be restarted for a new shot
+ * It does not hurt if the timer was not running
+ */
+// HW_TS_Stop(BleApplicationContext.Advertising_mgr_timer_Id);
+
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("First index in %d state \n",
+ BleApplicationContext.Device_Connection_Status);
+#endif
+ if ((New_Status == APP_BLE_LP_ADV)
+ && ((BleApplicationContext.Device_Connection_Status == APP_BLE_FAST_ADV)
+ || (BleApplicationContext.Device_Connection_Status == APP_BLE_LP_ADV)))
+ {
+ /* Connection in ADVERTISE mode have to stop the current advertising */
+ ret = aci_gap_set_non_discoverable();
+ if (ret == BLE_STATUS_SUCCESS)
+ {
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("Successfully Stopped Advertising");
+#endif
+ }
+ else
+ {
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("Stop Advertising Failed , result: %d \n", ret);
+#endif
+ }
+ }
+
+ BleApplicationContext.Device_Connection_Status = New_Status;
+ SV_Connection_Status = New_Status;
+ /* Start Fast or Low Power Advertising */
+ ret = aci_gap_set_discoverable(
+ ADV_IND,
+ Min_Inter,
+ Max_Inter,
+ PUBLIC_ADDR,
+ NO_WHITE_LIST_USE, /* use white list */
+ sizeof(local_name),
+ (uint8_t*) &local_name,
+ BleApplicationContext.BleApplicationContext_legacy.advtServUUIDlen,
+ BleApplicationContext.BleApplicationContext_legacy.advtServUUID,
+ 0,
+ 0);
+ /* Update Advertising data */
+ ret = aci_gap_update_adv_data(sizeof(manuf_data_sv), (uint8_t*) manuf_data_sv);
+
+ if (ret == BLE_STATUS_SUCCESS)
+ {
+ if (New_Status == APP_BLE_FAST_ADV)
+ {
+ APP_DBG_MSG("Successfully Start Fast Advertising " );
+ /* Start Timer to STOP ADV - TIMEOUT */
+// HW_TS_Start(BleApplicationContext.Advertising_mgr_timer_Id, INITIAL_ADV_TIMEOUT);
+ }
+ else
+ {
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("Successfully Start Low Power Advertising ");
+#endif
+ }
+ UART_App_SendData("\r\nA\r\n", 5);
+ }
+ else
+ {
+ if (New_Status == APP_BLE_FAST_ADV)
+ {
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("Start Fast Advertising Failed , result: %d \n", ret);
+#endif
+ }
+ else
+ {
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("Start Low Power Advertising Failed , result: %d \n", ret);
+#endif
+ }
+ UART_App_SendData("\r\nF\r\n", 5);
+ }
+
+ return;
+}
+
+const uint8_t* BleGetBdAddress( void )
+{
+ uint8_t *otp_addr;
+ const uint8_t *bd_addr;
+ uint32_t udn;
+ uint32_t company_id;
+ uint32_t device_id;
+
+ udn = LL_FLASH_GetUDN();
+
+ if(udn != 0xFFFFFFFF)
+ {
+ company_id = LL_FLASH_GetSTCompanyID();
+ device_id = LL_FLASH_GetDeviceID();
+
+ bd_addr_udn[0] = (uint8_t)(udn & 0x000000FF);
+ bd_addr_udn[1] = (uint8_t)( (udn & 0x0000FF00) >> 8 );
+ bd_addr_udn[2] = (uint8_t)( (udn & 0x00FF0000) >> 16 );
+ bd_addr_udn[3] = (uint8_t)device_id;
+ bd_addr_udn[4] = (uint8_t)(company_id & 0x000000FF);;
+ bd_addr_udn[5] = (uint8_t)( (company_id & 0x0000FF00) >> 8 );
+
+ bd_addr = (const uint8_t *)bd_addr_udn;
+ }
+ else
+ {
+ otp_addr = OTP_Read(0);
+ if(otp_addr)
+ {
+ bd_addr = ((OTP_ID0_t*)otp_addr)->bd_address;
+ }
+ else
+ {
+ bd_addr = M_bd_addr;
+ }
+
+ }
+
+ return bd_addr;
+}
+
+/* USER CODE BEGIN FD_LOCAL_FUNCTION */
+static void Confirm_Pairing ( void )
+{
+ aci_gap_numeric_comparison_value_confirm_yesno(BleApplicationContext.BleApplicationContext_legacy.connectionHandle,0x01);
+}
+
+static void Pairing_Request ( void )
+{
+ aci_gap_slave_security_req(BleApplicationContext.BleApplicationContext_legacy.connectionHandle);
+}
+/* USER CODE END FD_LOCAL_FUNCTION */
+
+/*************************************************************
+ *
+ *SPECIFIC FUNCTIONS FOR P2P SERVER
+ *
+ *************************************************************/
+static void Adv_Cancel( void )
+{
+/* USER CODE BEGIN Adv_Cancel_1 */
+ BSP_LED_Off(LED_GREEN);
+/* USER CODE END Adv_Cancel_1 */
+
+ if (BleApplicationContext.Device_Connection_Status != APP_BLE_CONNECTED_SERVER)
+ {
+
+ tBleStatus result = 0x00;
+
+ result = aci_gap_set_non_discoverable();
+
+ BleApplicationContext.Device_Connection_Status = APP_BLE_IDLE;
+ SV_Connection_Status = APP_BLE_IDLE;
+ if (result == BLE_STATUS_SUCCESS)
+ {
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG(" \r\n\r");APP_DBG_MSG("** STOP ADVERTISING ** \r\n\r");
+#endif
+ UART_App_SendData("\r\nOK\r\n", 6);
+ }
+ else
+ {
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("** STOP ADVERTISING ** Failed \r\n\r");
+#endif
+ UART_App_SendData("\r\nF\r\n", 5);
+ }
+
+ }
+
+/* USER CODE BEGIN Adv_Cancel_2 */
+
+/* USER CODE END Adv_Cancel_2 */
+ return;
+}
+
+//static void Adv_Cancel_Req( void )
+//{
+///* USER CODE BEGIN Adv_Cancel_Req_1 */
+//
+///* USER CODE END Adv_Cancel_Req_1 */
+// UTIL_SEQ_SetTask(1 << CFG_TASK_ADV_CANCEL_ID, CFG_SCH_PRIO_0);
+///* USER CODE BEGIN Adv_Cancel_Req_2 */
+//
+///* USER CODE END Adv_Cancel_Req_2 */
+// return;
+//}
+
+static void Adv_Req( void )
+{
+/* USER CODE BEGIN Adv_Req_1 */
+
+/* USER CODE END Adv_Req_1 */
+ Adv_Request(APP_BLE_FAST_ADV);
+/* USER CODE BEGIN Adv_Req_2 */
+
+/* USER CODE END Adv_Req_2 */
+ return;
+}
+
+static void Switch_OFF_GPIO(){
+/* USER CODE BEGIN Switch_OFF_GPIO */
+ BSP_LED_Off(LED_GREEN);
+/* USER CODE END Switch_OFF_GPIO */
+}
+
+#if(L2CAP_REQUEST_NEW_CONN_PARAM != 0)
+void BLE_SVC_L2CAP_Conn_Update(uint16_t Connection_Handle)
+{
+/* USER CODE BEGIN BLE_SVC_L2CAP_Conn_Update_1 */
+
+/* USER CODE END BLE_SVC_L2CAP_Conn_Update_1 */
+ if(mutex == 1) {
+ mutex = 0;
+ index_con_int = (index_con_int + 1)%SIZE_TAB_CONN_INT;
+ uint16_t interval_min = CONN_P(Connection_Update_Interval);
+ uint16_t interval_max = CONN_P(Connection_Update_Interval);
+ uint16_t slave_latency = L2CAP_SLAVE_LATENCY;
+ uint16_t timeout_multiplier = L2CAP_TIMEOUT_MULTIPLIER;
+ tBleStatus result;
+
+ result = aci_l2cap_connection_parameter_update_req(BleApplicationContext.BleApplicationContext_legacy.connectionHandle,
+ interval_min, interval_max,
+ slave_latency, timeout_multiplier);
+ if( result == BLE_STATUS_SUCCESS )
+ {
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("BLE_SVC_L2CAP_Conn_Update(), Successfully \r\n\r");
+#endif
+ }
+ else
+ {
+ UART_App_SendData("\r\nF\r\n", 5);
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("BLE_SVC_L2CAP_Conn_Update(), Failed \r\n\r");
+#endif
+ }
+ }
+/* USER CODE BEGIN BLE_SVC_L2CAP_Conn_Update_2 */
+
+/* USER CODE END BLE_SVC_L2CAP_Conn_Update_2 */
+ return;
+}
+#endif
+
+/* USER CODE BEGIN FD_SPECIFIC_FUNCTIONS */
+
+/* USER CODE END FD_SPECIFIC_FUNCTIONS */
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+//void hci_notify_asynch_evt(void* pdata)
+//{
+// UTIL_SEQ_SetTask(1 << CFG_TASK_HCI_ASYNCH_EVT_ID, CFG_SCH_PRIO_0);
+// return;
+//}
+//
+//void hci_cmd_resp_release(uint32_t flag)
+//{
+// UTIL_SEQ_SetEvt(1 << CFG_IDLEEVT_SYSTEM_HCI_CMD_EVT_RSP_ID);
+// return;
+//}
+//
+//void hci_cmd_resp_wait(uint32_t timeout)
+//{
+// UTIL_SEQ_WaitEvt(1 << CFG_IDLEEVT_SYSTEM_HCI_CMD_EVT_RSP_ID);
+// return;
+//}
+
+static void BLE_UserEvtRx( void * pPayload )
+{
+ SVCCTL_UserEvtFlowStatus_t svctl_return_status;
+ tHCI_UserEvtRxParam *pParam;
+
+ pParam = (tHCI_UserEvtRxParam *)pPayload;
+
+ svctl_return_status = SVCCTL_UserEvtRx((void *)&(pParam->pckt->evtserial));
+ if (svctl_return_status != SVCCTL_UserEvtFlowDisable)
+ {
+ pParam->status = HCI_TL_UserEventFlow_Enable;
+ }
+ else
+ {
+ pParam->status = HCI_TL_UserEventFlow_Disable;
+ }
+}
+
+static void BLE_StatusNot( HCI_TL_CmdStatus_t status )
+{
+ uint32_t task_id_list;
+ switch (status)
+ {
+ case HCI_TL_CmdBusy:
+ /**
+ * All tasks that may send an aci/hci commands shall be listed here
+ * This is to prevent a new command is sent while one is already pending
+ */
+ task_id_list = (1 << CFG_LAST_TASK_ID_WITH_HCICMD) - 1;
+ UTIL_SEQ_PauseTask(task_id_list);
+
+ break;
+
+ case HCI_TL_CmdAvailable:
+ /**
+ * All tasks that may send an aci/hci commands shall be listed here
+ * This is to prevent a new command is sent while one is already pending
+ */
+ task_id_list = (1 << CFG_LAST_TASK_ID_WITH_HCICMD) - 1;
+ UTIL_SEQ_ResumeTask(task_id_list);
+
+ break;
+
+ default:
+ break;
+ }
+ return;
+}
+
+//void SVCCTL_ResumeUserEventFlow( void )
+//{
+// hci_resume_flow();
+// return;
+//}
+
+/* USER CODE BEGIN FD_WRAP_FUNCTIONS */
+
+/* USER CODE END FD_WRAP_FUNCTIONS */
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_sv.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_sv.h
new file mode 100644
index 000000000..541988d48
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/app_ble_sv.h
@@ -0,0 +1,82 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file app_ble_sv.h
+ * @author MCD Application Team
+ * @brief Header for ble application
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_BLE_SV_H
+#define APP_BLE_SV_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+#include "hci_tl.h"
+#include "ble.h"
+#include "app_ble_common.h"
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Exported types ------------------------------------------------------------*/
+
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* External variables --------------------------------------------------------*/
+/* USER CODE BEGIN EV */
+
+/* USER CODE END EV */
+
+/* Exported macro ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions ---------------------------------------------*/
+ void APP_BLE_SV_Init( void );
+ void APP_BLE_SV_Conn_Update(void);
+
+ APP_BLE_ConnStatus_t APP_BLE_SV_Get_Server_Connection_Status(void);
+
+ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_SV_Notification( void *pckt );
+
+/* USER CODE BEGIN EF */
+void APP_BLE_SV_Key_Button1_Action(void);
+void APP_BLE_SV_Key_Button2_Action(void);
+void APP_BLE_SV_Key_Button3_Action(void);
+
+/* USER CODE END EF */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*APP_BLE_SV_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/ble_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/ble_conf.h
new file mode 100644
index 000000000..1abc07f89
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/ble_conf.h
@@ -0,0 +1,106 @@
+/**
+ ******************************************************************************
+ * File Name : App/ble_conf.h
+ * Description : Configuration file for BLE Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef BLE_CONF_H
+#define BLE_CONF_H
+
+#include "app_conf.h"
+
+/******************************************************************************
+ *
+ * BLE SERVICES CONFIGURATION
+ * blesvc
+ *
+ ******************************************************************************/
+
+ /**
+ * This setting shall be set to '1' if the device needs to support the Peripheral Role
+ * In the MS configuration, both BLE_CFG_PERIPHERAL and BLE_CFG_CENTRAL shall be set to '1'
+ */
+#define BLE_CFG_PERIPHERAL 1
+
+/**
+ * This setting shall be set to '1' if the device needs to support the Central Role
+ * In the MS configuration, both BLE_CFG_PERIPHERAL and BLE_CFG_CENTRAL shall be set to '1'
+ */
+#define BLE_CFG_CENTRAL 1
+
+/**
+ * There is one handler per service enabled
+ * Note: There is no handler for the Device Information Service
+ *
+ * This shall take into account all registered handlers
+ * (from either the provided services or the custom services)
+ */
+#define BLE_CFG_SVC_MAX_NBR_CB 5
+
+#define BLE_CFG_CLT_MAX_NBR_CB 1
+
+/******************************************************************************
+ * Device Information Service (DIS)
+ ******************************************************************************/
+/**< Options: Supported(1) or Not Supported(0) */
+#define BLE_CFG_DIS_MANUFACTURER_NAME_STRING 1
+#define BLE_CFG_DIS_MODEL_NUMBER_STRING 0
+#define BLE_CFG_DIS_SERIAL_NUMBER_STRING 0
+#define BLE_CFG_DIS_HARDWARE_REVISION_STRING 0
+#define BLE_CFG_DIS_FIRMWARE_REVISION_STRING 0
+#define BLE_CFG_DIS_SOFTWARE_REVISION_STRING 0
+#define BLE_CFG_DIS_SYSTEM_ID 0
+#define BLE_CFG_DIS_IEEE_CERTIFICATION 0
+#define BLE_CFG_DIS_PNP_ID 0
+
+/**
+ * device information service characteristic lengths
+ */
+#define BLE_CFG_DIS_SYSTEM_ID_LEN_MAX (8)
+#define BLE_CFG_DIS_MODEL_NUMBER_STRING_LEN_MAX (32)
+#define BLE_CFG_DIS_SERIAL_NUMBER_STRING_LEN_MAX (32)
+#define BLE_CFG_DIS_FIRMWARE_REVISION_STRING_LEN_MAX (32)
+#define BLE_CFG_DIS_HARDWARE_REVISION_STRING_LEN_MAX (32)
+#define BLE_CFG_DIS_SOFTWARE_REVISION_STRING_LEN_MAX (32)
+#define BLE_CFG_DIS_MANUFACTURER_NAME_STRING_LEN_MAX (32)
+#define BLE_CFG_DIS_IEEE_CERTIFICATION_LEN_MAX (32)
+#define BLE_CFG_DIS_PNP_ID_LEN_MAX (7)
+
+/******************************************************************************
+ * Heart Rate Service (HRS)
+ ******************************************************************************/
+#define BLE_CFG_HRS_BODY_SENSOR_LOCATION_CHAR 1/**< BODY SENSOR LOCATION CHARACTERISTIC */
+#define BLE_CFG_HRS_ENERGY_EXPENDED_INFO_FLAG 1/**< ENERGY EXTENDED INFO FLAG */
+#define BLE_CFG_HRS_ENERGY_RR_INTERVAL_FLAG 1/**< Max number of RR interval values - Shall not be greater than 9 */
+
+
+/******************************************************************************
+ * GAP Service - Apprearance
+ ******************************************************************************/
+
+#define BLE_CFG_UNKNOWN_APPEARANCE (0)
+#define BLE_CFG_HR_SENSOR_APPEARANCE (832)
+#define BLE_CFG_GAP_APPEARANCE (BLE_CFG_UNKNOWN_APPEARANCE)
+
+
+/******************************************************************************
+ * OTA
+ ******************************************************************************/
+#define BLE_CFG_OTA_REBOOT_CHAR 0
+
+#endif /*BLE_CONF_H */
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/ble_dbg_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/ble_dbg_conf.h
new file mode 100644
index 000000000..79e3c4965
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/ble_dbg_conf.h
@@ -0,0 +1,199 @@
+/**
+ ******************************************************************************
+ * File Name : App/ble_dbg_conf.h
+ * Description : Debug configuration file for BLE Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __BLE_DBG_CONF_H
+#define __BLE_DBG_CONF_H
+
+/**
+ * Enable or Disable traces from BLE
+ */
+
+#define BLE_DBG_APP_EN 0
+#define BLE_DBG_DIS_EN 0
+#define BLE_DBG_HRS_EN 0
+#define BLE_DBG_SVCCTL_EN 0
+#define BLE_DBG_BLS_EN 0
+#define BLE_DBG_HTS_EN 0
+#define BLE_DBG_P2P_STM_EN 1
+
+/**
+ * Macro definition
+ */
+#if ( BLE_DBG_APP_EN != 0 )
+#define BLE_DBG_APP_MSG PRINT_MESG_DBG
+#else
+#define BLE_DBG_APP_MSG PRINT_NO_MESG
+#endif
+
+#if ( BLE_DBG_DIS_EN != 0 )
+#define BLE_DBG_DIS_MSG PRINT_MESG_DBG
+#else
+#define BLE_DBG_DIS_MSG PRINT_NO_MESG
+#endif
+
+#if ( BLE_DBG_HRS_EN != 0 )
+#define BLE_DBG_HRS_MSG PRINT_MESG_DBG
+#else
+#define BLE_DBG_HRS_MSG PRINT_NO_MESG
+#endif
+
+#if ( BLE_DBG_P2P_STM_EN != 0 )
+#define BLE_DBG_P2P_STM_MSG PRINT_MESG_DBG
+#else
+#define BLE_DBG_P2P_STM_MSG PRINT_NO_MESG
+#endif
+
+#if ( BLE_DBG_TEMPLATE_STM_EN != 0 )
+#define BLE_DBG_TEMPLATE_STM_MSG PRINT_MESG_DBG
+#else
+#define BLE_DBG_TEMPLATE_STM_MSG PRINT_NO_MESG
+#endif
+
+#if ( BLE_DBG_EDS_STM_EN != 0 )
+#define BLE_DBG_EDS_STM_MSG PRINT_MESG_DBG
+#else
+#define BLE_DBG_EDS_STM_MSG PRINT_NO_MESG
+#endif
+
+#if ( BLE_DBG_LBS_STM_EN != 0 )
+#define BLE_DBG_LBS_STM_MSG PRINT_MESG_DBG
+#else
+#define BLE_DBG_LBS_STM_MSG PRINT_NO_MESG
+#endif
+
+#if ( BLE_DBG_SVCCTL_EN != 0 )
+#define BLE_DBG_SVCCTL_MSG PRINT_MESG_DBG
+#else
+#define BLE_DBG_SVCCTL_MSG PRINT_NO_MESG
+#endif
+
+#if (BLE_DBG_CTS_EN != 0)
+#define BLE_DBG_CTS_MSG PRINT_MESG_DBG
+#else
+#define BLE_DBG_CTS_MSG PRINT_NO_MESG
+#endif
+
+#if (BLE_DBG_HIDS_EN != 0)
+#define BLE_DBG_HIDS_MSG PRINT_MESG_DBG
+#else
+#define BLE_DBG_HIDS_MSG PRINT_NO_MESG
+#endif
+
+#if (BLE_DBG_PASS_EN != 0)
+#define BLE_DBG_PASS_MSG PRINT_MESG_DBG
+#else
+#define BLE_DBG_PASS_MSG PRINT_NO_MESG
+#endif
+
+#if (BLE_DBG_BLS_EN != 0)
+#define BLE_DBG_BLS_MSG PRINT_MESG_DBG
+#else
+#define BLE_DBG_BLS_MSG PRINT_NO_MESG
+#endif
+
+#if (BLE_DBG_HTS_EN != 0)
+#define BLE_DBG_HTS_MSG PRINT_MESG_DBG
+#else
+#define BLE_DBG_HTS_MSG PRINT_NO_MESG
+#endif
+
+#if (BLE_DBG_ANS_EN != 0)
+#define BLE_DBG_ANS_MSG PRINT_MESG_DBG
+#else
+#define BLE_DBG_ANS_MSG PRINT_NO_MESG
+#endif
+
+#if (BLE_DBG_ESS_EN != 0)
+#define BLE_DBG_ESS_MSG PRINT_MESG_DBG
+#else
+#define BLE_DBG_ESS_MSG PRINT_NO_MESG
+#endif
+
+#if (BLE_DBG_GLS_EN != 0)
+#define BLE_DBG_GLS_MSG PRINT_MESG_DBG
+#else
+#define BLE_DBG_GLS_MSG PRINT_NO_MESG
+#endif
+
+#if (BLE_DBG_BAS_EN != 0)
+#define BLE_DBG_BAS_MSG PRINT_MESG_DBG
+#else
+#define BLE_DBG_BAS_MSG PRINT_NO_MESG
+#endif
+
+#if (BLE_DBG_RTUS_EN != 0)
+#define BLE_DBG_RTUS_MSG PRINT_MESG_DBG
+#else
+#define BLE_DBG_RTUS_MSG PRINT_NO_MESG
+#endif
+
+#if (BLE_DBG_HPS_EN != 0)
+#define BLE_DBG_HPS_MSG PRINT_MESG_DBG
+#else
+#define BLE_DBG_HPS_MSG PRINT_NO_MESG
+#endif
+
+#if (BLE_DBG_TPS_EN != 0)
+#define BLE_DBG_TPS_MSG PRINT_MESG_DBG
+#else
+#define BLE_DBG_TPS_MSG PRINT_NO_MESG
+#endif
+
+#if (BLE_DBG_LLS_EN != 0)
+#define BLE_DBG_LLS_MSG PRINT_MESG_DBG
+#else
+#define BLE_DBG_LLS_MSG PRINT_NO_MESG
+#endif
+
+#if (BLE_DBG_IAS_EN != 0)
+#define BLE_DBG_IAS_MSG PRINT_MESG_DBG
+#else
+#define BLE_DBG_IAS_MSG PRINT_NO_MESG
+#endif
+
+#if (BLE_DBG_WSS_EN != 0)
+#define BLE_DBG_WSS_MSG PRINT_MESG_DBG
+#else
+#define BLE_DBG_WSS_MSG PRINT_NO_MESG
+#endif
+
+#if (BLE_DBG_LNS_EN != 0)
+#define BLE_DBG_LNS_MSG PRINT_MESG_DBG
+#else
+#define BLE_DBG_LNS_MSG PRINT_NO_MESG
+#endif
+
+#if (BLE_DBG_SCPS_EN != 0)
+#define BLE_DBG_SCPS_MSG PRINT_MESG_DBG
+#else
+#define BLE_DBG_SCPS_MSG PRINT_NO_MESG
+#endif
+
+#if (BLE_DBG_DTS_EN != 0)
+#define BLE_DBG_DTS_MSG PRINT_MESG_DBG
+#define BLE_DBG_DTS_BUF PRINT_LOG_BUFF_DBG
+#else
+#define BLE_DBG_DTS_MSG PRINT_NO_MESG
+#define BLE_DBG_DTS_BUF PRINT_NO_MESG
+#endif
+
+#endif /*__BLE_DBG_CONF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/dis_app.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/dis_app.c
new file mode 100644
index 000000000..59c66fad3
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/dis_app.c
@@ -0,0 +1,221 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file dis_app.c
+ * @author MCD Application Team
+ * @brief Device Information Service Application
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "ble.h"
+#include "dis_app.h"
+
+/* Private includes -----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN PTD */
+
+/* USER CODE END PTD */
+
+/* Private defines -----------------------------------------------------------*/
+/* USER CODE BEGIN PD */
+
+/* USER CODE END PD */
+
+/* Private macros ------------------------------------------------------------*/
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private variables ---------------------------------------------------------*/
+#if ((BLE_CFG_DIS_SYSTEM_ID != 0) || (CFG_MENU_DEVICE_INFORMATION != 0))
+static const uint8_t system_id[BLE_CFG_DIS_SYSTEM_ID_LEN_MAX] =
+{
+ (uint8_t)((DISAPP_MANUFACTURER_ID & 0xFF0000) >> 16),
+ (uint8_t)((DISAPP_MANUFACTURER_ID & 0x00FF00) >> 8),
+ (uint8_t)(DISAPP_MANUFACTURER_ID & 0x0000FF),
+ 0xFE,
+ 0xFF,
+ (uint8_t)((DISAPP_OUI & 0xFF0000) >> 16),
+ (uint8_t)((DISAPP_OUI & 0x00FF00) >> 8),
+ (uint8_t)(DISAPP_OUI & 0x0000FF)
+};
+#endif
+
+#if ((BLE_CFG_DIS_IEEE_CERTIFICATION != 0) || (CFG_MENU_DEVICE_INFORMATION != 0))
+static const uint8_t ieee_id[BLE_CFG_DIS_IEEE_CERTIFICATION_LEN_MAX] =
+{
+ 0xFE, 0xCA, 0xFE, 0xCA, 0xFE, 0xCA, 0xFE, 0xCA,
+ 0xFE, 0xCA, 0xFE, 0xCA, 0xFE, 0xCA, 0xFE, 0xCA,
+ 0xFE, 0xCA, 0xFE, 0xCA, 0xFE, 0xCA, 0xFE, 0xCA,
+ 0xFE, 0xCA, 0xFE, 0xCA, 0xFE, 0xCA, 0xFE, 0xCA,
+};
+#endif
+#if ((BLE_CFG_DIS_PNP_ID != 0) || (CFG_MENU_DEVICE_INFORMATION != 0))
+static const uint8_t pnp_id[BLE_CFG_DIS_PNP_ID_LEN_MAX] =
+{
+ 0x1,
+ 0xAD, 0xDE,
+ 0xDE, 0xDA,
+ 0x01, 0x00
+};
+#endif
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+/* USER CODE BEGIN PFP */
+
+/* USER CODE END PFP */
+
+/* Functions Definition ------------------------------------------------------*/
+void DISAPP_Init(void)
+{
+/* USER CODE BEGIN DISAPP_Init */
+ DIS_Data_t dis_information_data;
+
+#if ((BLE_CFG_DIS_MANUFACTURER_NAME_STRING != 0) || (CFG_MENU_DEVICE_INFORMATION != 0))
+ /**
+ * Update MANUFACTURER NAME Information
+ *
+ * @param UUID
+ * @param pPData
+ * @return
+ */
+ dis_information_data.pPayload = (uint8_t*)DISAPP_MANUFACTURER_NAME;
+ dis_information_data.Length = sizeof(DISAPP_MANUFACTURER_NAME);
+ DIS_UpdateChar(MANUFACTURER_NAME_UUID, &dis_information_data);
+#endif
+
+#if ((BLE_CFG_DIS_MODEL_NUMBER_STRING != 0) || (CFG_MENU_DEVICE_INFORMATION != 0))
+ /**
+ * Update MODEL NUMBERInformation
+ *
+ * @param UUID
+ * @param pPData
+ * @return
+ */
+ dis_information_data.pPayload = (uint8_t*)DISAPP_MODEL_NUMBER;
+ dis_information_data.Length = sizeof(DISAPP_MODEL_NUMBER);
+ DIS_UpdateChar(MODEL_NUMBER_UUID, &dis_information_data);
+#endif
+
+#if ((BLE_CFG_DIS_SERIAL_NUMBER_STRING != 0) || (CFG_MENU_DEVICE_INFORMATION != 0))
+ /**
+ * Update SERIAL NUMBERInformation
+ *
+ * @param UUID
+ * @param pPData
+ * @return
+ */
+ dis_information_data.pPayload = (uint8_t*)DISAPP_SERIAL_NUMBER;
+ dis_information_data.Length = sizeof(DISAPP_SERIAL_NUMBER);
+ DIS_UpdateChar(SERIAL_NUMBER_UUID, &dis_information_data);
+#endif
+
+#if ((BLE_CFG_DIS_HARDWARE_REVISION_STRING != 0) || (CFG_MENU_DEVICE_INFORMATION != 0))
+ /**
+ * Update HARDWARE REVISION NUMBERInformation
+ *
+ * @param UUID
+ * @param pPData
+ * @return
+ */
+ dis_information_data.pPayload = (uint8_t*)DISAPP_HARDWARE_REVISION_NUMBER;
+ dis_information_data.Length = sizeof(DISAPP_HARDWARE_REVISION_NUMBER);
+ DIS_UpdateChar(HARDWARE_REVISION_UUID, &dis_information_data);
+#endif
+
+#if ((BLE_CFG_DIS_FIRMWARE_REVISION_STRING != 0) || (CFG_MENU_DEVICE_INFORMATION != 0))
+ /**
+ * Update FIRMWARE REVISION NUMBERInformation
+ *
+ * @param UUID
+ * @param pPData
+ * @return
+ */
+ dis_information_data.pPayload = (uint8_t*)DISAPP_FIRMWARE_REVISION_NUMBER;
+ dis_information_data.Length = sizeof(DISAPP_FIRMWARE_REVISION_NUMBER);
+ DIS_UpdateChar(FIRMWARE_REVISION_UUID, &dis_information_data);
+#endif
+
+#if ((BLE_CFG_DIS_SOFTWARE_REVISION_STRING != 0) || (CFG_MENU_DEVICE_INFORMATION != 0))
+ /**
+ * Update SOFTWARE REVISION NUMBERInformation
+ *
+ * @param UUID
+ * @param pPData
+ * @return
+ */
+ dis_information_data.pPayload = (uint8_t*)DISAPP_SOFTWARE_REVISION_NUMBER;
+ dis_information_data.Length = sizeof(DISAPP_SOFTWARE_REVISION_NUMBER);
+ DIS_UpdateChar(SOFTWARE_REVISION_UUID, &dis_information_data);
+#endif
+
+#if ((BLE_CFG_DIS_SYSTEM_ID != 0) || (CFG_MENU_DEVICE_INFORMATION != 0))
+
+ /**
+ * Update SYSTEM ID Information
+ *
+ * @param UUID
+ * @param pPData
+ * @return
+ */
+ dis_information_data.pPayload = (uint8_t *)system_id;
+ dis_information_data.Length = BLE_CFG_DIS_SYSTEM_ID_LEN_MAX;
+ DIS_UpdateChar(SYSTEM_ID_UUID, &dis_information_data);
+#endif
+
+#if ((BLE_CFG_DIS_IEEE_CERTIFICATION != 0) || (CFG_MENU_DEVICE_INFORMATION != 0))
+
+ /**
+ * Update IEEE CERTIFICATION ID Information
+ *
+ * @param UUID
+ * @param pPData
+ * @return
+ */
+ dis_information_data.pPayload = (uint8_t *)ieee_id;
+ dis_information_data.Length = BLE_CFG_DIS_IEEE_CERTIFICATION_LEN_MAX;
+ DIS_UpdateChar(IEEE_CERTIFICATION_UUID, &dis_information_data);
+#endif
+
+#if ((BLE_CFG_DIS_PNP_ID != 0) || (CFG_MENU_DEVICE_INFORMATION != 0))
+
+ /**
+ * Update PNP ID Information
+ *
+ * @param UUID
+ * @param pPData
+ * @return
+ */
+ dis_information_data.pPayload = (uint8_t *)pnp_id;
+ dis_information_data.Length = BLE_CFG_DIS_PNP_ID_LEN_MAX;
+ DIS_UpdateChar(PNP_ID_UUID, &dis_information_data);
+#endif
+/* USER CODE END DISAPP_Init */
+}
+
+/* USER CODE BEGIN FD */
+
+/* USER CODE END FD */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/dis_app.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/dis_app.h
new file mode 100644
index 000000000..196ec9937
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/dis_app.h
@@ -0,0 +1,77 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file dis_app.h
+ * @author MCD Application Team
+ * @brief Header for dis_application.c module
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __DIS_APP_H
+#define __DIS_APP_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+
+/* Private includes -----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Exported types ------------------------------------------------------------*/
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* External variables --------------------------------------------------------*/
+/* USER CODE BEGIN EV */
+
+/* USER CODE END EV */
+
+/* Exported macros -----------------------------------------------------------*/
+#define DISAPP_MANUFACTURER_NAME "STM"
+#define DISAPP_MODEL_NUMBER "4502-1.0"
+#define DISAPP_SERIAL_NUMBER "1.0"
+#define DISAPP_HARDWARE_REVISION_NUMBER "1.0"
+#define DISAPP_FIRMWARE_REVISION_NUMBER "1.0"
+#define DISAPP_SOFTWARE_REVISION_NUMBER "1.0"
+#define DISAPP_OUI 0x123456
+#define DISAPP_MANUFACTURER_ID 0x9ABCDE
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions ------------------------------------------------------- */
+void DISAPP_Init(void);
+/* USER CODE BEGIN EF */
+
+/* USER CODE END EF */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*__DIS_APP_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/hrs_app.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/hrs_app.c
new file mode 100644
index 000000000..8dbad464e
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/hrs_app.c
@@ -0,0 +1,235 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hrs_app.c
+ * @author MCD Application Team
+ * @brief Heart Rate Service Application
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+
+#include "ble.h"
+#include "hrs_app.h"
+#include "stm32_seq.h"
+#include "uart_app.h"
+
+extern APP_Mode_t Next_Mode;
+
+extern HR_Notify_Context_t HR_Notify_Context;
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+typedef struct
+{
+ HRS_BodySensorLocation_t BodySensorLocationChar;
+ HRS_MeasVal_t MeasurementvalueChar;
+ uint8_t ResetEnergyExpended;
+ uint8_t TimerMeasurement_Id;
+ uint8_t Notifications_Status;
+} HRSAPP_Context_t;
+/* USER CODE BEGIN PTD */
+
+/* USER CODE END PTD */
+
+/* Private defines ------------------------------------------------------------*/
+/* USER CODE BEGIN PD */
+
+/* USER CODE END PD */
+
+/* Private macros ------------------------------------------------------------*/
+#define HRSAPP_MEASUREMENT_INTERVAL (1000000/CFG_TS_TICK_VAL) /**< 1s */
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private variables ---------------------------------------------------------*/
+/**
+ * START of Section BLE_APP_CONTEXT
+ */
+
+PLACE_IN_SECTION("BLE_APP_CONTEXT") static HRSAPP_Context_t HRSAPP_Context;
+
+/**
+ * END of Section BLE_APP_CONTEXT
+ */
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Private functions prototypes-----------------------------------------------*/
+static void HRSAPP_Measurement(void);
+/* USER CODE BEGIN PFP */
+
+/* USER CODE END PFP */
+
+/* Functions Definition ------------------------------------------------------*/
+void HRS_Notification(HRS_App_Notification_evt_t *pNotification)
+{
+/* USER CODE BEGIN HRS_Notification_1 */
+
+/* USER CODE END HRS_Notification_1 */
+ switch(pNotification->HRS_Evt_Opcode)
+ {
+/* USER CODE BEGIN HRS_Notification_HRS_Evt_Opcode */
+
+/* USER CODE END HRS_Notification_HRS_Evt_Opcode */
+#if (BLE_CFG_HRS_ENERGY_EXPENDED_INFO_FLAG != 0)
+ case HRS_RESET_ENERGY_EXPENDED_EVT:
+/* USER CODE BEGIN HRS_RESET_ENERGY_EXPENDED_EVT */
+ HRSAPP_Context.MeasurementvalueChar.EnergyExpended = 0;
+ HRSAPP_Context.ResetEnergyExpended = 1;
+ UART_App_SendData("\r\nR=01\r\n", 8);
+/* USER CODE END HRS_RESET_ENERGY_EXPENDED_EVT */
+ break;
+#endif
+
+ case HRS_NOTIFICATION_ENABLED:
+/* USER CODE BEGIN HRS_NOTIFICATION_ENABLED */
+
+ HRSAPP_Context.Notifications_Status = 1;
+ UART_App_SendData("\r\nN=1\r\n", 7);
+/* USER CODE END HRS_NOTIFICATION_ENABLED */
+ break;
+
+ case HRS_NOTIFICATION_DISABLED:
+/* USER CODE BEGIN HRS_NOTIFICATION_DISABLED */
+ HRSAPP_Context.Notifications_Status = 0;
+ UART_App_SendData("\r\nN=0\r\n", 7);
+/* USER CODE END HRS_NOTIFICATION_DISABLED */
+ break;
+
+ default:
+/* USER CODE BEGIN HRS_Notification_Default */
+
+/* USER CODE END HRS_Notification_Default */
+ break;
+ }
+/* USER CODE BEGIN HRS_Notification_2 */
+
+/* USER CODE END HRS_Notification_2 */
+ return;
+}
+
+void HRS_APP_Notification(HRS_APP_ConnHandle_Not_evt_t *pNotification)
+{
+ switch(pNotification->HR_Evt_Opcode)
+ {
+ case HR_CONN_HANDLE_EVT :
+ UART_App_SendData("\r\nC\r\n", 5);
+ break;
+
+ case HR_DISCON_HANDLE_EVT :
+ UART_App_SendData("\r\nD\r\n", 5);
+ break;
+
+ case HR_DISCON_SWITCH_HANDLE_EVT :
+ switch (Next_Mode) {
+ case P2P_CLIENT :
+ *(volatile uint32_t*) SRAM1_BASE = SRAM1_BASE_P2P_CLIENT;
+ break;
+ case P2P_SERVER :
+ *(volatile uint32_t*) SRAM1_BASE = SRAM1_BASE_P2P_SERVER;
+ break;
+ default : break;
+ }
+ NVIC_SystemReset();
+ break;
+
+ default:
+ break;
+ }
+ return;
+}
+
+void HRSAPP_Init(void)
+{
+ UTIL_SEQ_RegTask( 1<< CFG_TASK_MEAS_REQ_ID, UTIL_SEQ_RFU, HRSAPP_Measurement );
+/* USER CODE BEGIN HRSAPP_Init */
+
+ HRSAPP_Context.Notifications_Status = 0;
+ /**
+ * Set Body Sensor Location
+ */
+ HRSAPP_Context.ResetEnergyExpended = 0;
+ HRSAPP_Context.BodySensorLocationChar = HRS_BODY_SENSOR_LOCATION_HAND;
+ HRS_UpdateChar(SENSOR_LOCATION_UUID, (uint8_t *)&HRSAPP_Context.BodySensorLocationChar);
+
+
+ /**
+ * Set Flags for measurement value
+ */
+
+ HRSAPP_Context.MeasurementvalueChar.Flags = ( HRS_HRM_VALUE_FORMAT_UINT16 |
+ HRS_HRM_SENSOR_CONTACTS_PRESENT |
+ HRS_HRM_SENSOR_CONTACTS_SUPPORTED |
+ HRS_HRM_ENERGY_EXPENDED_PRESENT |
+ HRS_HRM_RR_INTERVAL_PRESENT );
+
+#if (BLE_CFG_HRS_ENERGY_EXPENDED_INFO_FLAG != 0)
+ if(HRSAPP_Context.MeasurementvalueChar.Flags & HRS_HRM_ENERGY_EXPENDED_PRESENT)
+ HRSAPP_Context.MeasurementvalueChar.EnergyExpended = 10;
+#endif
+
+#if (BLE_CFG_HRS_ENERGY_RR_INTERVAL_FLAG != 0)
+ if(HRSAPP_Context.MeasurementvalueChar.Flags & HRS_HRM_RR_INTERVAL_PRESENT)
+ {
+ uint8_t i;
+
+ HRSAPP_Context.MeasurementvalueChar.NbreOfValidRRIntervalValues = BLE_CFG_HRS_ENERGY_RR_INTERVAL_FLAG;
+ for(i = 0; i < BLE_CFG_HRS_ENERGY_RR_INTERVAL_FLAG; i++)
+ HRSAPP_Context.MeasurementvalueChar.aRRIntervalValues[i] = 1024;
+ }
+#endif
+
+/* USER CODE END HRSAPP_Init */
+ return;
+}
+
+static void HRSAPP_Measurement(void)
+{
+/* USER CODE BEGIN HRSAPP_Measurement */
+ if(HRSAPP_Context.Notifications_Status == 1)
+ {
+
+ HRSAPP_Context.MeasurementvalueChar.MeasurementValue = HR_Notify_Context.Measurement;
+#if (BLE_CFG_HRS_ENERGY_EXPENDED_INFO_FLAG != 0)
+ if((HRSAPP_Context.MeasurementvalueChar.Flags & HRS_HRM_ENERGY_EXPENDED_PRESENT) &&
+ (HRSAPP_Context.ResetEnergyExpended == 0))
+ HRSAPP_Context.MeasurementvalueChar.EnergyExpended = HR_Notify_Context.EnergyExpended;
+ else if(HRSAPP_Context.ResetEnergyExpended == 1)
+ HRSAPP_Context.ResetEnergyExpended = 0;
+#endif
+
+ HRS_UpdateChar(HEART_RATE_MEASURMENT_UUID, (uint8_t *)&HRSAPP_Context.MeasurementvalueChar);
+
+ UART_App_SendData("\r\nOK\r\n", 6);
+ }
+ else UART_App_SendData("\r\nF\r\n", 5);
+
+/* USER CODE END HRSAPP_Measurement */
+ return;
+}
+
+/* USER CODE BEGIN FD */
+
+/* USER CODE END FD */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/hrs_app.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/hrs_app.h
new file mode 100644
index 000000000..9000a7d6d
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/hrs_app.h
@@ -0,0 +1,81 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hrs_app.h
+ * @author MCD Application Team
+ * @brief Header for hrs_application.c module
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __HRS_APP_H
+#define __HRS_APP_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Exported types ------------------------------------------------------------*/
+/* USER CODE BEGIN ET */
+typedef enum
+{
+ HR_CONN_HANDLE_EVT,
+ HR_DISCON_HANDLE_EVT,
+ HR_DISCON_SWITCH_HANDLE_EVT,
+} HRS_APP__Opcode_Notification_evt_t;
+
+typedef struct
+{
+ HRS_APP__Opcode_Notification_evt_t HR_Evt_Opcode;
+ uint16_t ConnectionHandle;
+}HRS_APP_ConnHandle_Not_evt_t;
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* External variables --------------------------------------------------------*/
+/* USER CODE BEGIN EV */
+
+/* USER CODE END EV */
+
+/* Exported macros ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions ---------------------------------------------*/
+void HRS_APP_Notification( HRS_APP_ConnHandle_Not_evt_t *pNotification );
+void HRSAPP_Init( void );
+/* USER CODE BEGIN EF */
+
+/* USER CODE END EF */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*__HRS_APP_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/p2p_client_app.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/p2p_client_app.c
new file mode 100644
index 000000000..6648246d6
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/p2p_client_app.c
@@ -0,0 +1,806 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file p2p_server_app.c
+ * @author MCD Application Team
+ * @brief peer to peer Server Application
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+
+#include "main.h"
+#include "app_common.h"
+
+#include "dbg_trace.h"
+
+#include "ble.h"
+#include "p2p_client_app.h"
+
+#include "stm32_seq.h"
+#include "app_ble_cl.h"
+#include "uart_app.h"
+
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+extern APP_Mode_t Next_Mode;
+
+extern uint8_t WriteCharData[2];
+
+/* Private typedef -----------------------------------------------------------*/
+
+typedef enum
+{
+ P2P_START_TIMER_EVT,
+ P2P_STOP_TIMER_EVT,
+ P2P_NOTIFICATION_INFO_RECEIVED_EVT,
+} P2P_Client_Opcode_Notification_evt_t;
+
+typedef struct
+{
+ uint8_t * pPayload;
+ uint8_t Length;
+}P2P_Client_Data_t;
+
+typedef struct
+{
+ P2P_Client_Opcode_Notification_evt_t P2P_Client_Evt_Opcode;
+ P2P_Client_Data_t DataTransfered;
+}P2P_Client_App_Notification_evt_t;
+
+typedef struct
+{
+ /**
+ * state of the P2P Client
+ * state machine
+ */
+ APP_BLE_ConnStatus_t state;
+
+ /**
+ * connection handle
+ */
+ uint16_t connHandle;
+
+ /**
+ * handle of the P2P service
+ */
+ uint16_t P2PServiceHandle;
+
+ /**
+ * end handle of the P2P service
+ */
+ uint16_t P2PServiceEndHandle;
+
+ /**
+ * handle of the Tx characteristic - Write To Server
+ *
+ */
+ uint16_t P2PWriteToServerCharHdle;
+
+ /**
+ * handle of the client configuration
+ * descriptor of Tx characteristic
+ */
+ uint16_t P2PWriteToServerDescHandle;
+
+ /**
+ * handle of the Rx characteristic - Notification From Server
+ *
+ */
+ uint16_t P2PNotificationCharHdle;
+
+ /**
+ * handle of the client configuration
+ * descriptor of Rx characteristic
+ */
+ uint16_t P2PNotificationDescHandle;
+
+}P2P_ClientContext_t;
+
+/* USER CODE BEGIN PTD */
+typedef struct{
+ uint8_t Device_Led_Selection;
+ uint8_t Led1;
+}P2P_LedCharValue_t;
+
+typedef struct{
+ uint8_t Device_Button_Selection;
+ uint8_t Button1;
+}P2P_ButtonCharValue_t;
+
+typedef struct
+{
+
+ uint8_t Notification_Status; /* used to chek if P2P Server is enabled to Notify */
+
+ P2P_LedCharValue_t LedControl;
+ P2P_ButtonCharValue_t ButtonStatus;
+
+ uint16_t ConnectionHandle;
+
+
+} P2P_Client_App_Context_t;
+
+/* USER CODE END PTD */
+
+/* Private defines ------------------------------------------------------------*/
+/* USER CODE BEGIN PD */
+
+/* USER CODE END PD */
+
+/* Private macros -------------------------------------------------------------*/
+#define UNPACK_2_BYTE_PARAMETER(ptr) \
+ (uint16_t)((uint16_t)(*((uint8_t *)ptr))) | \
+ (uint16_t)((((uint16_t)(*((uint8_t *)ptr + 1))) << 8))
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private variables ---------------------------------------------------------*/
+/**
+ * START of Section BLE_APP_CONTEXT
+ */
+
+PLACE_IN_SECTION("BLE_APP_CONTEXT") static P2P_ClientContext_t aP2PClientContext[BLE_CFG_CLT_MAX_NBR_CB];
+
+/**
+ * END of Section BLE_APP_CONTEXT
+ */
+/* USER CODE BEGIN PV */
+PLACE_IN_SECTION("BLE_APP_CONTEXT") static P2P_Client_App_Context_t P2P_Client_App_Context;
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+static void Gatt_Notification(P2P_Client_App_Notification_evt_t *pNotification);
+static SVCCTL_EvtAckStatus_t Event_Handler(void *Event);
+/* USER CODE BEGIN PFP */
+static tBleStatus Write_Char(uint16_t UUID, uint8_t Service_Instance, uint8_t *pPayload);
+static void Button_Trigger_Received( void );
+static void Update_Service( void );
+static void Send_Data_To_Write_Characterisitc( void );
+/* USER CODE END PFP */
+
+/* Functions Definition ------------------------------------------------------*/
+/**
+ * @brief Service initialization
+ * @param None
+ * @retval None
+ */
+void P2PC_APP_Init(void)
+{
+ uint8_t index =0;
+/* USER CODE BEGIN P2PC_APP_Init_1 */
+ UTIL_SEQ_RegTask( 1<< CFG_TASK_SEARCH_SERVICE_ID, UTIL_SEQ_RFU, Update_Service );
+ UTIL_SEQ_RegTask( 1<< CFG_TASK_SW1_BUTTON_PUSHED_ID, UTIL_SEQ_RFU, Button_Trigger_Received );
+ UTIL_SEQ_RegTask( 1<< CFG_TASK_SEND_DATA_TO_SERVER_ID, UTIL_SEQ_RFU, Send_Data_To_Write_Characterisitc );
+
+ BSP_LED_Off(LED_GREEN);
+
+ /**
+ * Initialize LedButton Service
+ */
+ P2P_Client_App_Context.Notification_Status=0;
+ P2P_Client_App_Context.ConnectionHandle = 0x00;
+
+ P2P_Client_App_Context.LedControl.Device_Led_Selection=0x00;/* device Led */
+ P2P_Client_App_Context.LedControl.Led1=0x00; /* led OFF */
+ P2P_Client_App_Context.ButtonStatus.Device_Button_Selection=0x01;/* Device1 */
+ P2P_Client_App_Context.ButtonStatus.Button1=0x00;
+/* USER CODE END P2PC_APP_Init_1 */
+ for(index = 0; index < BLE_CFG_CLT_MAX_NBR_CB; index++)
+ {
+ aP2PClientContext[index].state= APP_BLE_IDLE;
+ }
+
+ /**
+ * Register the event handler to the BLE controller
+ */
+ SVCCTL_RegisterCltHandler(Event_Handler);
+
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("-- P2P CLIENT INITIALIZED \n");
+#endif
+
+/* USER CODE BEGIN P2PC_APP_Init_2 */
+
+/* USER CODE END P2PC_APP_Init_2 */
+ return;
+}
+
+void P2PC_APP_Notification(P2PC_APP_ConnHandle_Not_evt_t *pNotification)
+{
+/* USER CODE BEGIN P2PC_APP_Notification_1 */
+
+/* USER CODE END P2PC_APP_Notification_1 */
+ switch(pNotification->P2P_Evt_Opcode)
+ {
+/* USER CODE BEGIN P2P_Evt_Opcode */
+
+/* USER CODE END P2P_Evt_Opcode */
+
+ case PEERC_CONN_HANDLE_EVT :
+/* USER CODE BEGIN PEER_CONN_HANDLE_EVT */
+ P2P_Client_App_Context.ConnectionHandle = pNotification->ConnectionHandle;
+ UART_App_SendData("\r\nC\r\n", 5);
+// BSP_LED_On(LED_GREEN);
+/* USER CODE END PEER_CONN_HANDLE_EVT */
+ break;
+
+ case PEERC_DISCON_HANDLE_EVT :
+/* USER CODE BEGIN PEER_DISCON_HANDLE_EVT */
+ {
+ uint8_t index = 0;
+ P2P_Client_App_Context.ConnectionHandle = 0x00;
+ while((index < BLE_CFG_CLT_MAX_NBR_CB) &&
+ (aP2PClientContext[index].state != APP_BLE_IDLE))
+ {
+ aP2PClientContext[index].state = APP_BLE_IDLE;
+ }
+ UART_App_SendData("\r\nD\r\n", 5);
+ BSP_LED_Off(LED_BLUE);
+ BSP_LED_Off(LED_GREEN);
+ }
+/* USER CODE END PEER_DISCON_HANDLE_EVT */
+ break;
+ case PEERC_DISCON_SWITCH_HANDLE_EVT :
+ switch (Next_Mode) {
+ case P2P_SERVER :
+ *(volatile uint32_t*) SRAM1_BASE = SRAM1_BASE_P2P_SERVER;
+ break;
+ case HEART_RATE :
+ *(volatile uint32_t*) SRAM1_BASE = SRAM1_BASE_HEART_RATE;
+ break;
+ default : break;
+ }
+ NVIC_SystemReset();
+ break;
+
+ default:
+/* USER CODE BEGIN P2P_Evt_Opcode_Default */
+
+/* USER CODE END P2P_Evt_Opcode_Default */
+ break;
+ }
+/* USER CODE BEGIN P2PC_APP_Notification_2 */
+
+/* USER CODE END P2PC_APP_Notification_2 */
+ return;
+}
+/* USER CODE BEGIN FD */
+void P2PC_APP_SW1_Button_Action(void)
+{
+
+ UTIL_SEQ_SetTask(1<<CFG_TASK_SW1_BUTTON_PUSHED_ID, CFG_SCH_PRIO_0);
+
+}
+/* USER CODE END FD */
+
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+
+/**
+ * @brief Event handler
+ * @param Event: Address of the buffer holding the Event
+ * @retval Ack: Return whether the Event has been managed or not
+ */
+static SVCCTL_EvtAckStatus_t Event_Handler(void *Event)
+{
+ SVCCTL_EvtAckStatus_t return_value;
+ hci_event_pckt *event_pckt;
+ evt_blue_aci *blue_evt;
+
+ P2P_Client_App_Notification_evt_t Notification;
+
+ return_value = SVCCTL_EvtNotAck;
+ event_pckt = (hci_event_pckt *)(((hci_uart_pckt*)Event)->data);
+
+
+
+ switch(event_pckt->evt)
+ {
+ case EVT_VENDOR:
+ {
+ blue_evt = (evt_blue_aci*)event_pckt->data;
+ switch(blue_evt->ecode)
+ {
+
+ case EVT_BLUE_ATT_READ_BY_GROUP_TYPE_RESP:
+ {
+ aci_att_read_by_group_type_resp_event_rp0 *pr = (void*)blue_evt->data;
+ uint8_t numServ, i, idx;
+ uint16_t uuid, handle;
+
+ uint8_t index;
+ handle = pr->Connection_Handle;
+ index = 0;
+ while((index < BLE_CFG_CLT_MAX_NBR_CB) &&
+ (aP2PClientContext[index].state != APP_BLE_IDLE))
+ {
+ APP_BLE_ConnStatus_t status;
+
+ status = APP_BLE_CL_Get_Client_Connection_Status(aP2PClientContext[index].connHandle);
+
+ if((aP2PClientContext[index].state == APP_BLE_CONNECTED_CLIENT)&&
+ (status == APP_BLE_IDLE))
+ {
+ /* Handle deconnected */
+
+ aP2PClientContext[index].state = APP_BLE_IDLE;
+ aP2PClientContext[index].connHandle = 0xFFFF;
+ break;
+ }
+ index++;
+ }
+
+ if(index < BLE_CFG_CLT_MAX_NBR_CB)
+ {
+ aP2PClientContext[index].connHandle= handle;
+
+
+ numServ = (pr->Data_Length) / pr->Attribute_Data_Length;
+
+ /* the event data will be
+ * 2bytes start handle
+ * 2bytes end handle
+ * 2 or 16 bytes data
+ * we are intersted only if the UUID is 16 bit.
+ * So check if the data length is 6
+ */
+#if (UUID_128BIT_FORMAT==1)
+ if (pr->Attribute_Data_Length == 20)
+ {
+ idx = 16;
+#else
+ if (pr->Attribute_Data_Length == 6)
+ {
+ idx = 4;
+#endif
+ for (i=0; i<numServ; i++)
+ {
+ uuid = UNPACK_2_BYTE_PARAMETER(&pr->Attribute_Data_List[idx]);
+ if(uuid == P2P_SERVICE_UUID)
+ {
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("-- GATT : P2P_SERVICE_UUID FOUND - connection handle 0x%x \n", aP2PClientContext[index].connHandle);
+#endif
+#if (UUID_128BIT_FORMAT==1)
+ aP2PClientContext[index].P2PServiceHandle = UNPACK_2_BYTE_PARAMETER(&pr->Attribute_Data_List[idx-16]);
+ aP2PClientContext[index].P2PServiceEndHandle = UNPACK_2_BYTE_PARAMETER (&pr->Attribute_Data_List[idx-14]);
+#else
+ aP2PClientContext[index].P2PServiceHandle = UNPACK_2_BYTE_PARAMETER(&pr->Attribute_Data_List[idx-4]);
+ aP2PClientContext[index].P2PServiceEndHandle = UNPACK_2_BYTE_PARAMETER (&pr->Attribute_Data_List[idx-2]);
+#endif
+ aP2PClientContext[index].state = APP_BLE_DISCOVER_CHARACS ;
+ }
+ idx += 6;
+ }
+ }
+ }
+ }
+ break;
+
+ case EVT_BLUE_ATT_READ_BY_TYPE_RESP:
+ {
+
+ aci_att_read_by_type_resp_event_rp0 *pr = (void*)blue_evt->data;
+ uint8_t idx;
+ uint16_t uuid, handle;
+
+ /* the event data will be
+ * 2 bytes start handle
+ * 1 byte char properties
+ * 2 bytes handle
+ * 2 or 16 bytes data
+ */
+
+ uint8_t index;
+
+ index = 0;
+ while((index < BLE_CFG_CLT_MAX_NBR_CB) &&
+ (aP2PClientContext[index].connHandle != pr->Connection_Handle))
+ index++;
+
+ if(index < BLE_CFG_CLT_MAX_NBR_CB)
+ {
+
+ /* we are interested in only 16 bit UUIDs */
+#if (UUID_128BIT_FORMAT==1)
+ idx = 17;
+ if (pr->Handle_Value_Pair_Length == 21)
+#else
+ idx = 5;
+ if (pr->Handle_Value_Pair_Length == 7)
+#endif
+ {
+ pr->Data_Length -= 1;
+ while(pr->Data_Length > 0)
+ {
+ uuid = UNPACK_2_BYTE_PARAMETER(&pr->Handle_Value_Pair_Data[idx]);
+ /* store the characteristic handle not the attribute handle */
+#if (UUID_128BIT_FORMAT==1)
+ handle = UNPACK_2_BYTE_PARAMETER(&pr->Handle_Value_Pair_Data[idx-14]);
+#else
+ handle = UNPACK_2_BYTE_PARAMETER(&pr->Handle_Value_Pair_Data[idx-2]);
+#endif
+ if(uuid == P2P_WRITE_CHAR_UUID)
+ {
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("-- GATT : WRITE_UUID FOUND - connection handle 0x%x\n", aP2PClientContext[index].connHandle);
+#endif
+ aP2PClientContext[index].state = APP_BLE_DISCOVER_WRITE_DESC;
+ aP2PClientContext[index].P2PWriteToServerCharHdle = handle;
+ }
+
+ else if(uuid == P2P_NOTIFY_CHAR_UUID)
+ {
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("-- GATT : NOTIFICATION_CHAR_UUID FOUND - connection handle 0x%x\n", aP2PClientContext[index].connHandle);
+#endif
+ aP2PClientContext[index].state = APP_BLE_DISCOVER_NOTIFICATION_CHAR_DESC;
+ aP2PClientContext[index].P2PNotificationCharHdle = handle;
+ }
+#if (UUID_128BIT_FORMAT==1)
+ pr->Data_Length -= 21;
+ idx += 21;
+#else
+ pr->Data_Length -= 7;
+ idx += 7;
+#endif
+ }
+ }
+ }
+ }
+ break;
+
+ case EVT_BLUE_ATT_FIND_INFORMATION_RESP:
+ {
+ aci_att_find_info_resp_event_rp0 *pr = (void*)blue_evt->data;
+
+ uint8_t numDesc, idx, i;
+ uint16_t uuid, handle;
+
+ /*
+ * event data will be of the format
+ * 2 bytes handle
+ * 2 bytes UUID
+ */
+
+ uint8_t index;
+
+ index = 0;
+ while((index < BLE_CFG_CLT_MAX_NBR_CB) &&
+ (aP2PClientContext[index].connHandle != pr->Connection_Handle))
+
+ index++;
+
+ if(index < BLE_CFG_CLT_MAX_NBR_CB)
+ {
+
+ numDesc = (pr->Event_Data_Length) / 4;
+ /* we are interested only in 16 bit UUIDs */
+ idx = 0;
+ if (pr->Format == UUID_TYPE_16)
+ {
+ for (i=0; i<numDesc; i++)
+ {
+ handle = UNPACK_2_BYTE_PARAMETER(&pr->Handle_UUID_Pair[idx]);
+ uuid = UNPACK_2_BYTE_PARAMETER(&pr->Handle_UUID_Pair[idx+2]);
+
+ if(uuid == CLIENT_CHAR_CONFIG_DESCRIPTOR_UUID)
+ {
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("-- GATT : CLIENT_CHAR_CONFIG_DESCRIPTOR_UUID- connection handle 0x%x\n", aP2PClientContext[index].connHandle);
+#endif
+ if( aP2PClientContext[index].state == APP_BLE_DISCOVER_NOTIFICATION_CHAR_DESC)
+ {
+
+ aP2PClientContext[index].P2PNotificationDescHandle = handle;
+// aP2PClientContext[index].state = APP_BLE_ENABLE_NOTIFICATION_DESC;
+ aP2PClientContext[index].state = APP_BLE_CONNECTED_CLIENT;
+
+ }
+ }
+ idx += 4;
+ }
+ }
+ }
+ }
+ break; /*EVT_BLUE_ATT_FIND_INFORMATION_RESP*/
+
+ case EVT_BLUE_GATT_NOTIFICATION:
+ {
+ aci_gatt_notification_event_rp0 *pr = (void*)blue_evt->data;
+ uint8_t index;
+
+ index = 0;
+ while((index < BLE_CFG_CLT_MAX_NBR_CB) &&
+ (aP2PClientContext[index].connHandle != pr->Connection_Handle))
+ index++;
+
+ if(index < BLE_CFG_CLT_MAX_NBR_CB)
+ {
+
+ if ( (pr->Attribute_Handle == aP2PClientContext[index].P2PNotificationCharHdle) &&
+ (pr->Attribute_Value_Length == (2)) )
+ {
+
+ Notification.P2P_Client_Evt_Opcode = P2P_NOTIFICATION_INFO_RECEIVED_EVT;
+ Notification.DataTransfered.Length = pr->Attribute_Value_Length;
+ Notification.DataTransfered.pPayload = &pr->Attribute_Value[0];
+
+ Gatt_Notification(&Notification);
+
+ /* INFORM APPLICATION BUTTON IS PUSHED BY END DEVICE */
+
+ }
+ }
+ }
+ break;/* end EVT_BLUE_GATT_NOTIFICATION */
+
+ case EVT_BLUE_GATT_PROCEDURE_COMPLETE:
+ {
+ aci_gatt_proc_complete_event_rp0 *pr = (void*)blue_evt->data;
+#if(CFG_DEBUG_APP_TRACE != 0)
+ APP_DBG_MSG("-- GATT : EVT_BLUE_GATT_PROCEDURE_COMPLETE \n");
+ APP_DBG_MSG("\n");
+#endif
+
+
+ uint8_t index;
+
+ index = 0;
+ while((index < BLE_CFG_CLT_MAX_NBR_CB) &&
+ (aP2PClientContext[index].connHandle != pr->Connection_Handle))
+ index++;
+
+ if(index < BLE_CFG_CLT_MAX_NBR_CB)
+ {
+
+ UTIL_SEQ_SetTask( 1<<CFG_TASK_SEARCH_SERVICE_ID, CFG_SCH_PRIO_0);
+
+ }
+ }
+ break; /*EVT_BLUE_GATT_PROCEDURE_COMPLETE*/
+
+ default:
+ break;
+ }
+ }
+
+ break; /* HCI_EVT_VENDOR_SPECIFIC */
+
+ default:
+ break;
+ }
+
+ return(return_value);
+}/* end BLE_CTRL_Event_Acknowledged_Status_t */
+
+void Gatt_Notification(P2P_Client_App_Notification_evt_t *pNotification)
+{
+/* USER CODE BEGIN Gatt_Notification_1*/
+
+/* USER CODE END Gatt_Notification_1 */
+ switch(pNotification->P2P_Client_Evt_Opcode)
+ {
+/* USER CODE BEGIN P2P_Client_Evt_Opcode */
+
+/* USER CODE END P2P_Client_Evt_Opcode */
+
+ case P2P_NOTIFICATION_INFO_RECEIVED_EVT:
+/* USER CODE BEGIN P2P_NOTIFICATION_INFO_RECEIVED_EVT */
+ {
+ UART_App_SendData("\r\nR=", 4);
+ char received_val_str[4];
+ uint8_t received_val[2];
+ uint8_t k;
+ for(k = 0; k < 2; k++) received_val[k] = pNotification->DataTransfered.pPayload[k];
+ UART_App_ConvertBleDataToString(received_val, received_val_str, 4);
+ UART_App_SendData((char *)received_val_str, 4);
+ UART_App_SendData("\r\n", 2);
+
+ P2P_Client_App_Context.LedControl.Device_Led_Selection=pNotification->DataTransfered.pPayload[0];
+ switch(P2P_Client_App_Context.LedControl.Device_Led_Selection) {
+
+ case 0x01 : {
+
+ P2P_Client_App_Context.LedControl.Led1=pNotification->DataTransfered.pPayload[1];
+
+ if(P2P_Client_App_Context.LedControl.Led1==0x00){
+ BSP_LED_Off(LED_BLUE);
+ APP_DBG_MSG(" -- P2P APPLICATION CLIENT : NOTIFICATION RECEIVED - LED OFF \n\r");
+ APP_DBG_MSG(" \n\r");
+ } else {
+ APP_DBG_MSG(" -- P2P APPLICATION CLIENT : NOTIFICATION RECEIVED - LED ON\n\r");
+ APP_DBG_MSG(" \n\r");
+ BSP_LED_On(LED_BLUE);
+ }
+
+ break;
+ }
+ default : break;
+ }
+
+ }
+/* USER CODE END P2P_NOTIFICATION_INFO_RECEIVED_EVT */
+ break;
+
+ default:
+/* USER CODE BEGIN P2P_Client_Evt_Opcode_Default */
+
+/* USER CODE END P2P_Client_Evt_Opcode_Default */
+ break;
+ }
+/* USER CODE BEGIN Gatt_Notification_2*/
+
+/* USER CODE END Gatt_Notification_2 */
+ return;
+}
+
+uint8_t P2P_Client_APP_Get_State( void ) {
+ return aP2PClientContext[0].state;
+}
+/* USER CODE BEGIN LF */
+/**
+ * @brief Feature Characteristic update
+ * @param pFeatureValue: The address of the new value to be written
+ * @retval None
+ */
+tBleStatus Write_Char(uint16_t UUID, uint8_t Service_Instance, uint8_t *pPayload)
+{
+
+ tBleStatus ret = BLE_STATUS_INVALID_PARAMS;
+ uint8_t index;
+
+ index = 0;
+ while((index < BLE_CFG_CLT_MAX_NBR_CB) &&
+ (aP2PClientContext[index].state != APP_BLE_IDLE))
+ {
+
+ switch(UUID)
+ {
+ case P2P_WRITE_CHAR_UUID: /* SERVER RX -- so CLIENT TX */
+ ret = aci_gatt_write_without_resp(aP2PClientContext[index].connHandle,
+ aP2PClientContext[index].P2PWriteToServerCharHdle,
+ 2, /* charValueLen */
+ (uint8_t *) pPayload);
+
+ break;
+
+ default:
+ break;
+ }
+ index++;
+ }
+
+ return ret;
+}/* end Write_Char() */
+
+void Button_Trigger_Received(void)
+{
+
+
+ APP_DBG_MSG("-- P2P APPLICATION CLIENT : BUTTON PUSHED - WRITE TO SERVER \n ");
+ APP_DBG_MSG(" \n\r");
+ if(P2P_Client_App_Context.ButtonStatus.Button1==0x00){
+ P2P_Client_App_Context.ButtonStatus.Button1=0x01;
+ }else {
+ P2P_Client_App_Context.ButtonStatus.Button1=0x00;
+ }
+
+ Write_Char( P2P_WRITE_CHAR_UUID, 0, (uint8_t *)&P2P_Client_App_Context.ButtonStatus);
+
+ return;
+}
+
+void Send_Data_To_Write_Characterisitc(void)
+{
+ Write_Char( P2P_WRITE_CHAR_UUID, 0, (uint8_t *)WriteCharData);
+
+ UART_App_SendData("\r\nOK\r\n", 6);
+}
+
+void Enable_Notification( void )
+{
+ aP2PClientContext[0].state = APP_BLE_ENABLE_NOTIFICATION_DESC;
+
+ UTIL_SEQ_SetTask( 1<<CFG_TASK_SEARCH_SERVICE_ID, CFG_SCH_PRIO_0);
+}
+
+void Disable_Notification( void )
+{
+ aP2PClientContext[0].state = APP_BLE_DISABLE_NOTIFICATION_DESC;
+
+ UTIL_SEQ_SetTask( 1<<CFG_TASK_SEARCH_SERVICE_ID, CFG_SCH_PRIO_0);
+}
+
+void Update_Service()
+{
+ uint16_t enable = 0x0001;
+ uint16_t disable = 0x0000;
+
+
+ uint8_t index;
+
+ index = 0;
+ while((index < BLE_CFG_CLT_MAX_NBR_CB) &&
+ (aP2PClientContext[index].state != APP_BLE_IDLE))
+ {
+
+
+ switch(aP2PClientContext[index].state)
+ {
+
+ case APP_BLE_DISCOVER_SERVICES:
+ APP_DBG_MSG("P2P_DISCOVER_SERVICES\n");
+ break;
+ case APP_BLE_DISCOVER_CHARACS:
+ APP_DBG_MSG("* GATT : Discover P2P Characteristics\n");
+ aci_gatt_disc_all_char_of_service(aP2PClientContext[index].connHandle,
+ aP2PClientContext[index].P2PServiceHandle,
+ aP2PClientContext[index].P2PServiceEndHandle);
+
+ break;
+ case APP_BLE_DISCOVER_WRITE_DESC: /* Not Used - No decriptor */
+ APP_DBG_MSG("* GATT : Discover Descriptor of TX - Write Characteritic\n");
+ aci_gatt_disc_all_char_desc(aP2PClientContext[index].connHandle,
+ aP2PClientContext[index].P2PWriteToServerCharHdle,
+ aP2PClientContext[index].P2PWriteToServerCharHdle+2);
+
+ break;
+ case APP_BLE_DISCOVER_NOTIFICATION_CHAR_DESC:
+ APP_DBG_MSG("* GATT : Discover Descriptor of Rx - Notification Characteritic\n");
+ aci_gatt_disc_all_char_desc(aP2PClientContext[index].connHandle,
+ aP2PClientContext[index].P2PNotificationCharHdle,
+ aP2PClientContext[index].P2PNotificationCharHdle+2);
+
+ break;
+ case APP_BLE_ENABLE_NOTIFICATION_DESC:
+ APP_DBG_MSG("* GATT : Enable Server Notification\n");
+ aci_gatt_write_char_desc(aP2PClientContext[index].connHandle,
+ aP2PClientContext[index].P2PNotificationDescHandle,
+ 2,
+ (uint8_t *)&enable);
+
+ aP2PClientContext[index].state = APP_BLE_CONNECTED_CLIENT;
+ BSP_LED_Off(LED_RED);
+ UART_App_SendData("\r\nOK\r\n", 6);
+
+ break;
+ case APP_BLE_DISABLE_NOTIFICATION_DESC :
+ APP_DBG_MSG("* GATT : Disable Server Notification\n");
+ aci_gatt_write_char_desc(aP2PClientContext[index].connHandle,
+ aP2PClientContext[index].P2PNotificationDescHandle,
+ 2,
+ (uint8_t *)&disable);
+
+ aP2PClientContext[index].state = APP_BLE_CONNECTED_CLIENT;
+ UART_App_SendData("\r\nOK\r\n", 6);
+ break;
+ default:
+ break;
+ }
+ index++;
+ }
+ return;
+}
+/* USER CODE END LF */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/p2p_client_app.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/p2p_client_app.h
new file mode 100644
index 000000000..07c940f8f
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/p2p_client_app.h
@@ -0,0 +1,86 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file p2p_server_app.h
+ * @author MCD Application Team
+ * @brief Header for p2p_server_app.c module
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __P2P_APPLICATION_H
+#define __P2P_APPLICATION_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Exported types ------------------------------------------------------------*/
+typedef enum
+{
+ PEERC_CONN_HANDLE_EVT,
+ PEERC_DISCON_HANDLE_EVT,
+ PEERC_DISCON_SWITCH_HANDLE_EVT,
+} P2PC_APP_Opcode_Notification_evt_t;
+
+typedef struct
+{
+ P2PC_APP_Opcode_Notification_evt_t P2P_Evt_Opcode;
+ uint16_t ConnectionHandle;
+
+}P2PC_APP_ConnHandle_Not_evt_t;
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* External variables --------------------------------------------------------*/
+/* USER CODE BEGIN EV */
+
+/* USER CODE END EV */
+
+/* Exported macros ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions ---------------------------------------------*/
+void P2PC_APP_Init( void );
+void P2PC_APP_Notification( P2PC_APP_ConnHandle_Not_evt_t *pNotification );
+uint8_t P2P_Client_APP_Get_State( void );
+/* USER CODE BEGIN EFP */
+void P2PC_APP_SW1_Button_Action(void);
+void Enable_Notification( void );
+void Disable_Notification( void );
+/* USER CODE END EFP */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*__P2P_APPLICATION_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/p2p_server_app.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/p2p_server_app.c
new file mode 100644
index 000000000..66d93c0cf
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/p2p_server_app.c
@@ -0,0 +1,402 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file p2p_server_app.c
+ * @author MCD Application Team
+ * @brief peer to peer Server Application
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+#include "app_common.h"
+#include "dbg_trace.h"
+#include "ble.h"
+#include "p2p_server_app.h"
+#include "stm32_seq.h"
+#include "uart_app.h"
+
+extern APP_Mode_t Next_Mode;
+
+extern uint8_t NotifyCharData[2];
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN PTD */
+ typedef struct{
+ uint8_t Device_Led_Selection;
+ uint8_t Led1;
+ }P2P_LedCharValue_t;
+
+ typedef struct{
+ uint8_t Device_Button_Selection;
+ uint8_t ButtonStatus;
+ }P2P_ButtonCharValue_t;
+
+typedef struct
+{
+ uint8_t Notification_Status; /* used to chek if P2P Server is enabled to Notify */
+ P2P_LedCharValue_t LedControl;
+ P2P_ButtonCharValue_t ButtonControl;
+ uint16_t ConnectionHandle;
+} P2P_Server_App_Context_t;
+
+/* USER CODE END PTD */
+
+/* Private defines ------------------------------------------------------------*/
+/* USER CODE BEGIN PD */
+
+/* USER CODE END PD */
+
+/* Private macros -------------------------------------------------------------*/
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private variables ---------------------------------------------------------*/
+/* USER CODE BEGIN PV */
+
+/**
+ * START of Section BLE_APP_CONTEXT
+ */
+
+PLACE_IN_SECTION("BLE_APP_CONTEXT") static P2P_Server_App_Context_t P2P_Server_App_Context;
+
+/**
+ * END of Section BLE_APP_CONTEXT
+ */
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+/* USER CODE BEGIN PFP */
+static void P2PS_Send_Notification(void);
+static void P2PS_APP_LED_BUTTON_context_Init(void);
+/* USER CODE END PFP */
+
+/* Functions Definition ------------------------------------------------------*/
+void P2PS_STM_App_Notification(P2PS_STM_App_Notification_evt_t *pNotification)
+{
+/* USER CODE BEGIN P2PS_STM_App_Notification_1 */
+
+/* USER CODE END P2PS_STM_App_Notification_1 */
+ switch(pNotification->P2P_Evt_Opcode)
+ {
+ case P2PS_STM__NOTIFY_ENABLED_EVT:
+/* USER CODE BEGIN P2PS_STM__NOTIFY_ENABLED_EVT */
+ P2P_Server_App_Context.Notification_Status = 1;
+ UART_App_SendData("\r\nN=1\r\n", 7);
+ APP_DBG_MSG("-- P2P APPLICATION SERVER : NOTIFICATION ENABLED\n");
+ APP_DBG_MSG(" \n\r");
+/* USER CODE END P2PS_STM__NOTIFY_ENABLED_EVT */
+ break;
+
+ case P2PS_STM_NOTIFY_DISABLED_EVT:
+/* USER CODE BEGIN P2PS_STM_NOTIFY_DISABLED_EVT */
+ P2P_Server_App_Context.Notification_Status = 0;
+ UART_App_SendData("\r\nN=0\r\n", 7);
+ APP_DBG_MSG("-- P2P APPLICATION SERVER : NOTIFICATION DISABLED\n");
+ APP_DBG_MSG(" \n\r");
+/* USER CODE END P2PS_STM_NOTIFY_DISABLED_EVT */
+ break;
+
+ case P2PS_STM_WRITE_EVT:
+/* USER CODE BEGIN P2PS_STM_WRITE_EVT */
+ UART_App_SendData("\r\nR=", 4);
+ char received_val_str[4];
+ uint8_t received_val[2];
+ uint8_t k;
+ for(k = 0; k < 2; k++) received_val[k] = pNotification->DataTransfered.pPayload[k];
+ UART_App_ConvertBleDataToString(received_val, received_val_str, 4);
+ UART_App_SendData((char *)received_val_str, 4);
+ UART_App_SendData("\r\n", 2);
+
+ if(pNotification->DataTransfered.pPayload[0] == 0x00){ /* ALL Deviceselected - may be necessary as LB Routeur informs all connection */
+ if(pNotification->DataTransfered.pPayload[1] == 0x01)
+ {
+ BSP_LED_On(LED_BLUE);
+ APP_DBG_MSG("-- P2P APPLICATION SERVER : LED1 ON\n");
+ APP_DBG_MSG(" \n\r");
+ P2P_Server_App_Context.LedControl.Led1=0x01; /* LED1 ON */
+ }
+ if(pNotification->DataTransfered.pPayload[1] == 0x00)
+ {
+ BSP_LED_Off(LED_BLUE);
+ APP_DBG_MSG("-- P2P APPLICATION SERVER : LED1 OFF\n");
+ APP_DBG_MSG(" \n\r");
+ P2P_Server_App_Context.LedControl.Led1=0x00; /* LED1 OFF */
+ }
+ }
+#if(P2P_SERVER1 != 0)
+ if(pNotification->DataTransfered.pPayload[0] == 0x01){ /* end device 1 selected - may be necessary as LB Routeur informs all connection */
+ if(pNotification->DataTransfered.pPayload[1] == 0x01)
+ {
+ BSP_LED_On(LED_BLUE);
+ APP_DBG_MSG("-- P2P APPLICATION SERVER 1 : LED1 ON\n");
+ APP_DBG_MSG(" \n\r");
+ P2P_Server_App_Context.LedControl.Led1=0x01; /* LED1 ON */
+ }
+ if(pNotification->DataTransfered.pPayload[1] == 0x00)
+ {
+ BSP_LED_Off(LED_BLUE);
+ APP_DBG_MSG("-- P2P APPLICATION SERVER 1 : LED1 OFF\n");
+ APP_DBG_MSG(" \n\r");
+ P2P_Server_App_Context.LedControl.Led1=0x00; /* LED1 OFF */
+ }
+ }
+#endif
+#if(P2P_SERVER2 != 0)
+ if(pNotification->DataTransfered.pPayload[0] == 0x02){ /* end device 2 selected */
+ if(pNotification->DataTransfered.pPayload[1] == 0x01)
+ {
+ BSP_LED_On(LED_BLUE);
+ APP_DBG_MSG("-- P2P APPLICATION SERVER 2 : LED1 ON\n");
+ APP_DBG_MSG(" \n\r");
+ P2P_Server_App_Context.LedControl.Led1=0x01; /* LED1 ON */
+ }
+ if(pNotification->DataTransfered.pPayload[1] == 0x00)
+ {
+ BSP_LED_Off(LED_BLUE);
+ APP_DBG_MSG("-- P2P APPLICATION SERVER 2 : LED1 OFF\n");
+ APP_DBG_MSG(" \n\r");
+ P2P_Server_App_Context.LedControl.Led1=0x00; /* LED1 OFF */
+ }
+ }
+#endif
+#if(P2P_SERVER3 != 0)
+ if(pNotification->DataTransfered.pPayload[0] == 0x03){ /* end device 3 selected - may be necessary as LB Routeur informs all connection */
+ if(pNotification->DataTransfered.pPayload[1] == 0x01)
+ {
+ BSP_LED_On(LED_BLUE);
+ APP_DBG_MSG("-- P2P APPLICATION SERVER 3 : LED1 ON\n");
+ APP_DBG_MSG(" \n\r");
+ P2P_Server_App_Context.LedControl.Led1=0x01; /* LED1 ON */
+ }
+ if(pNotification->DataTransfered.pPayload[1] == 0x00)
+ {
+ BSP_LED_Off(LED_BLUE);
+ APP_DBG_MSG("-- P2P APPLICATION SERVER 3 : LED1 OFF\n");
+ APP_DBG_MSG(" \n\r");
+ P2P_Server_App_Context.LedControl.Led1=0x00; /* LED1 OFF */
+ }
+ }
+#endif
+#if(P2P_SERVER4 != 0)
+ if(pNotification->DataTransfered.pPayload[0] == 0x04){ /* end device 4 selected */
+ if(pNotification->DataTransfered.pPayload[1] == 0x01)
+ {
+ BSP_LED_On(LED_BLUE);
+ APP_DBG_MSG("-- P2P APPLICATION SERVER 2 : LED1 ON\n");
+ APP_DBG_MSG(" \n\r");
+ P2P_Server_App_Context.LedControl.Led1=0x01; /* LED1 ON */
+ }
+ if(pNotification->DataTransfered.pPayload[1] == 0x00)
+ {
+ BSP_LED_Off(LED_BLUE);
+ APP_DBG_MSG("-- P2P APPLICATION SERVER 2 : LED1 OFF\n");
+ APP_DBG_MSG(" \n\r");
+ P2P_Server_App_Context.LedControl.Led1=0x00; /* LED1 OFF */
+ }
+ }
+#endif
+#if(P2P_SERVER5 != 0)
+ if(pNotification->DataTransfered.pPayload[0] == 0x05){ /* end device 5 selected - may be necessary as LB Routeur informs all connection */
+ if(pNotification->DataTransfered.pPayload[1] == 0x01)
+ {
+ BSP_LED_On(LED_BLUE);
+ APP_DBG_MSG("-- P2P APPLICATION SERVER 5 : LED1 ON\n");
+ APP_DBG_MSG(" \n\r");
+ P2P_Server_App_Context.LedControl.Led1=0x01; /* LED1 ON */
+ }
+ if(pNotification->DataTransfered.pPayload[1] == 0x00)
+ {
+ BSP_LED_Off(LED_BLUE);
+ APP_DBG_MSG("-- P2P APPLICATION SERVER 5 : LED1 OFF\n");
+ APP_DBG_MSG(" \n\r");
+ P2P_Server_App_Context.LedControl.Led1=0x00; /* LED1 OFF */
+ }
+ }
+#endif
+#if(P2P_SERVER6 != 0)
+ if(pNotification->DataTransfered.pPayload[0] == 0x06){ /* end device 6 selected */
+ if(pNotification->DataTransfered.pPayload[1] == 0x01)
+ {
+ BSP_LED_On(LED_BLUE);
+ APP_DBG_MSG("-- P2P APPLICATION SERVER 6 : LED1 ON\n");
+ APP_DBG_MSG(" \n\r");
+ P2P_Server_App_Context.LedControl.Led1=0x01; /* LED1 ON */
+ }
+ if(pNotification->DataTransfered.pPayload[1] == 0x00)
+ {
+ BSP_LED_Off(LED_BLUE);
+ APP_DBG_MSG("-- P2P APPLICATION SERVER 6 : LED1 OFF\n");
+ APP_DBG_MSG(" \n\r");
+ P2P_Server_App_Context.LedControl.Led1=0x00; /* LED1 OFF */
+ }
+ }
+#endif
+/* USER CODE END P2PS_STM_WRITE_EVT */
+ break;
+
+ default:
+/* USER CODE BEGIN P2PS_STM_App_Notification_default */
+
+/* USER CODE END P2PS_STM_App_Notification_default */
+ break;
+ }
+/* USER CODE BEGIN P2PS_STM_App_Notification_2 */
+
+/* USER CODE END P2PS_STM_App_Notification_2 */
+ return;
+}
+
+void P2PS_APP_Notification(P2PS_APP_ConnHandle_Not_evt_t *pNotification)
+{
+/* USER CODE BEGIN P2PS_APP_Notification_1 */
+
+/* USER CODE END P2PS_APP_Notification_1 */
+ switch(pNotification->P2P_Evt_Opcode)
+ {
+/* USER CODE BEGIN P2PS_APP_Notification_P2P_Evt_Opcode */
+
+/* USER CODE END P2PS_APP_Notification_P2P_Evt_Opcode */
+ case PEER_CONN_HANDLE_EVT :
+/* USER CODE BEGIN PEER_CONN_HANDLE_EVT */
+ UART_App_SendData("\r\nC\r\n", 5);
+/* USER CODE END PEER_CONN_HANDLE_EVT */
+ break;
+
+ case PEER_DISCON_HANDLE_EVT :
+/* USER CODE BEGIN PEER_DISCON_HANDLE_EVT */
+ UART_App_SendData("\r\nD\r\n", 5);
+ P2PS_APP_LED_BUTTON_context_Init();
+/* USER CODE END PEER_DISCON_HANDLE_EVT */
+ break;
+
+ case PEER_DISCON_SWITCH_HANDLE_EVT :
+ switch (Next_Mode) {
+ case P2P_CLIENT :
+ *(volatile uint32_t*) SRAM1_BASE = SRAM1_BASE_P2P_CLIENT;
+ break;
+ case HEART_RATE :
+ *(volatile uint32_t*) SRAM1_BASE = SRAM1_BASE_HEART_RATE;
+ break;
+ default : break;
+ }
+ NVIC_SystemReset();
+ break;
+
+ default:
+/* USER CODE BEGIN P2PS_APP_Notification_default */
+
+/* USER CODE END P2PS_APP_Notification_default */
+ break;
+ }
+/* USER CODE BEGIN P2PS_APP_Notification_2 */
+
+/* USER CODE END P2PS_APP_Notification_2 */
+ return;
+}
+
+void P2PS_APP_Init(void)
+{
+/* USER CODE BEGIN P2PS_APP_Init */
+ UTIL_SEQ_RegTask( 1<< CFG_TASK_NOTIFY_ID, UTIL_SEQ_RFU, P2PS_Send_Notification );
+
+ /**
+ * Initialize LedButton Service
+ */
+ P2P_Server_App_Context.Notification_Status=0;
+ P2PS_APP_LED_BUTTON_context_Init();
+/* USER CODE END P2PS_APP_Init */
+ return;
+}
+
+/* USER CODE BEGIN FD */
+void P2PS_APP_LED_BUTTON_context_Init(void){
+
+ BSP_LED_Off(LED_BLUE);
+
+ #if(P2P_SERVER1 != 0)
+ P2P_Server_App_Context.LedControl.Device_Led_Selection=0x01; /* Device1 */
+ P2P_Server_App_Context.LedControl.Led1=0x00; /* led OFF */
+ P2P_Server_App_Context.ButtonControl.Device_Button_Selection=0x01;/* Device1 */
+ P2P_Server_App_Context.ButtonControl.ButtonStatus=0x00;
+#endif
+#if(P2P_SERVER2 != 0)
+ P2P_Server_App_Context.LedControl.Device_Led_Selection=0x02; /* Device2 */
+ P2P_Server_App_Context.LedControl.Led1=0x00; /* led OFF */
+ P2P_Server_App_Context.ButtonControl.Device_Button_Selection=0x02;/* Device2 */
+ P2P_Server_App_Context.ButtonControl.ButtonStatus=0x00;
+#endif
+#if(P2P_SERVER3 != 0)
+ P2P_Server_App_Context.LedControl.Device_Led_Selection=0x03; /* Device3 */
+ P2P_Server_App_Context.LedControl.Led1=0x00; /* led OFF */
+ P2P_Server_App_Context.ButtonControl.Device_Button_Selection=0x03; /* Device3 */
+ P2P_Server_App_Context.ButtonControl.ButtonStatus=0x00;
+#endif
+#if(P2P_SERVER4 != 0)
+ P2P_Server_App_Context.LedControl.Device_Led_Selection=0x04; /* Device4 */
+ P2P_Server_App_Context.LedControl.Led1=0x00; /* led OFF */
+ P2P_Server_App_Context.ButtonControl.Device_Button_Selection=0x04; /* Device4 */
+ P2P_Server_App_Context.ButtonControl.ButtonStatus=0x00;
+#endif
+ #if(P2P_SERVER5 != 0)
+ P2P_Server_App_Context.LedControl.Device_Led_Selection=0x05; /* Device5 */
+ P2P_Server_App_Context.LedControl.Led1=0x00; /* led OFF */
+ P2P_Server_App_Context.ButtonControl.Device_Button_Selection=0x05; /* Device5 */
+ P2P_Server_App_Context.ButtonControl.ButtonStatus=0x00;
+#endif
+#if(P2P_SERVER6 != 0)
+ P2P_Server_App_Context.LedControl.Device_Led_Selection=0x06; /* device6 */
+ P2P_Server_App_Context.LedControl.Led1=0x00; /* led OFF */
+ P2P_Server_App_Context.ButtonControl.Device_Button_Selection=0x06; /* Device6 */
+ P2P_Server_App_Context.ButtonControl.ButtonStatus=0x00;
+#endif
+}
+
+void P2PS_APP_SW1_Button_Action(void)
+{
+}
+/* USER CODE END FD */
+
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+/* USER CODE BEGIN FD_LOCAL_FUNCTIONS*/
+void P2PS_Send_Notification(void)
+{
+ tBleStatus status;
+
+ if(P2P_Server_App_Context.Notification_Status){
+ status = P2PS_STM_App_Update_Char(P2P_NOTIFY_CHAR_UUID, (uint8_t *)NotifyCharData);
+ if (status == BLE_STATUS_SUCCESS) UART_App_SendData("\r\nOK\r\n", 6);
+ else UART_App_SendData("\r\nF\r\n", 5);
+ } else {
+ APP_DBG_MSG("-- P2P APPLICATION SERVER : CAN'T INFORM CLIENT - NOTIFICATION DISABLED\n ");
+ UART_App_SendData("\r\nF\r\n", 5);
+ }
+
+ return;
+}
+
+/* USER CODE END FD_LOCAL_FUNCTIONS*/
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/p2p_server_app.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/p2p_server_app.h
new file mode 100644
index 000000000..628edb0f9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/p2p_server_app.h
@@ -0,0 +1,82 @@
+/* USER CODE BEGIN */
+/**
+ ******************************************************************************
+ * File Name : App/p2p_server_app.h
+ * Description : Header for p2p_server_app.c module
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __P2P_SERVER_APP_H
+#define __P2P_SERVER_APP_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Exported types ------------------------------------------------------------*/
+typedef enum
+{
+ PEER_CONN_HANDLE_EVT,
+ PEER_DISCON_HANDLE_EVT,
+ PEER_DISCON_SWITCH_HANDLE_EVT,
+} P2PS_APP__Opcode_Notification_evt_t;
+
+typedef struct
+{
+ P2PS_APP__Opcode_Notification_evt_t P2P_Evt_Opcode;
+ uint16_t ConnectionHandle;
+}P2PS_APP_ConnHandle_Not_evt_t;
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* External variables --------------------------------------------------------*/
+/* USER CODE BEGIN EV */
+
+/* USER CODE END EV */
+
+/* Exported macros ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions ---------------------------------------------*/
+ void P2PS_APP_Init( void );
+ void P2PS_APP_Notification( P2PS_APP_ConnHandle_Not_evt_t *pNotification );
+/* USER CODE BEGIN EF */
+ void P2PS_APP_SW1_Button_Action( void );
+
+/* USER CODE END EF */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*__P2P_SERVER_APP_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/uart_app.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/uart_app.c
new file mode 100644
index 000000000..2b2c6d656
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/uart_app.c
@@ -0,0 +1,521 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file uart_app.c
+ * @author MCD Application Team
+ * @brief UART Application
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+#include "app_common.h"
+#include "dbg_trace.h"
+#include "ble.h"
+#include "uart_app.h"
+#include "stm32_seq.h"
+#include "app_ble_common.h"
+#include "p2p_client_app.h"
+
+#if (CFG_HW_USART1_ENABLED == 1)
+extern void MX_USART1_UART_Init(void);
+extern UART_HandleTypeDef huart1;
+#endif
+#if (CFG_HW_LPUART1_ENABLED == 1)
+extern void MX_LPUART1_UART_Init(void);
+extern UART_HandleTypeDef hlpuart1;
+#endif
+
+extern APP_Mode_t APP_MODE;
+
+extern APP_BLE_ConnStatus_t SV_Connection_Status;
+extern APP_BLE_ConnStatus_t CL_Connection_Status;
+extern APP_BLE_ConnStatus_t HR_Connection_Status;
+
+extern tBDAddr SERVER_REMOTE_BDADDR[5];
+extern uint8_t index_bd_addr;
+
+PairingContext_t PairingContext;
+
+APP_Mode_t Next_Mode;
+
+uint8_t WriteCharData[2];
+uint8_t NotifyCharData[2];
+
+uint8_t BD_Addr[6];
+
+Disconnection_Status_t disconnection_status;
+
+HR_Notify_Context_t HR_Notify_Context;
+
+uint16_t Connection_Update_Interval;
+
+uint8_t autoconn_status;
+
+/* Private includes ----------------------------------------------------------*/
+
+/* Private typedef -----------------------------------------------------------*/
+/* AT Commands */
+
+typedef enum
+{
+ AT = 0,
+ AT_SV,
+ AT_SV_ADV_START,
+ AT_SV_ADV_STOP,
+ AT_SV_NOTIFY,
+ AT_SV_CONN_UPD,
+ AT_CL,
+ AT_CL_WRITE,
+ AT_CL_SCAN,
+ AT_CL_CONN,
+ AT_CL_DISCONN,
+ AT_CL_AUTOCONN,
+ AT_CL_EN,
+ AT_CL_DIS,
+ AT_HR,
+ AT_HR_NOTIFY,
+ AT_PAIRING_START,
+ AT_PAIRING_CONFIRM,
+ AT_CLEAR_BONDING,
+ AT_END_CMD,
+} AT_Cmd_Type_t;
+
+typedef enum
+{
+ NO_PARAM = 0,
+ PARAM,
+} Param_t;
+
+typedef enum
+{
+ NO_MULTI_PARAM = 0,
+ MULTI_PARAM,
+} Multi_Param_state_t;
+
+typedef struct {
+ Multi_Param_state_t state;
+ uint8_t index;
+} Multi_Param_t;
+
+typedef struct {
+ char *ATCmdStr;
+ int SizeATCmdStr;
+ AT_Cmd_Type_t AT_Cmd_Type;
+} AT_CMD_t;
+
+/* Private defines ------------------------------------------------------------*/
+/* Private macros -------------------------------------------------------------*/
+
+/* Private variables ---------------------------------------------------------*/
+static char pDataRx[32]; /* Buffer used for AT cmd reception */
+static uint8_t indexRx = 0;
+static uint8_t pCharRx[5]; /* Buffer used for Rx input character */
+
+static Param_t param;
+static Multi_Param_t multi_param;
+
+/*
+ * Used to compare the command received from user.
+ * In direct relation with AT_Cmd_Type_t
+ */
+static const AT_CMD_t AT_CMD[] = {
+ {"AT\r",sizeof("AT\r"),AT},
+ {"AT+SV\r",sizeof("AT+SV\r"),AT_SV},
+ {"AT+SV$ADV_START\r",sizeof("AT+SV$ADV_START\r"),AT_SV_ADV_START},
+ {"AT+SV$ADV_STOP\r",sizeof("AT+SV$ADV_STOP\r"),AT_SV_ADV_STOP},
+ {"AT+SV$NOTIFY",sizeof("AT+SV$NOTIFY"),AT_SV_NOTIFY}, /* command with param */
+ {"AT+SV$CONN_UPD",sizeof("AT+SV$CONN_UPD"),AT_SV_CONN_UPD}, /* command with param */
+ {"AT+CL\r",sizeof("AT+CL\r"),AT_CL},
+ {"AT+CL$WRITE",sizeof("AT+CL$WRITE"),AT_CL_WRITE}, /* command with param */
+ {"AT+CL$SCAN\r",sizeof("AT+CL$SCAN\r"),AT_CL_SCAN},
+ {"AT+CL$CONN",sizeof("AT+CL$CONN"),AT_CL_CONN}, /* command with param */
+ {"AT+CL$DISCONN\r",sizeof("AT+CL$DISCONN\r"),AT_CL_DISCONN},
+ {"AT+CL$AUTOCONN",sizeof("AT+CL$AUTOCONN"),AT_CL_AUTOCONN}, /* command with param */
+ {"AT+CL$EN\r",sizeof("AT+CL$EN\r"),AT_CL_EN},
+ {"AT+CL$DIS\r",sizeof("AT+CL$DIS\r"),AT_CL_DIS},
+ {"AT+HR\r",sizeof("AT+HR\r"),AT_HR},
+ {"AT+HR$NOTIFY",sizeof("AT+HR$NOTIFY"),AT_HR_NOTIFY}, /* command with param */
+ {"AT+S$PAIRING_START\r",sizeof("AT+S$PAIRING_START\r"),AT_PAIRING_START},
+ {"AT+S$PAIRING_CONFIRM",sizeof("AT+S$PAIRING_CONFIRM"),AT_PAIRING_CONFIRM}, /* command with param */
+ {"AT+S$CLEAR_BONDING\r",sizeof("AT+S$CLEAR_BONDING\r"),AT_CLEAR_BONDING},
+ {"unknown cmd\r",sizeof("unknown cmd\r"),AT_END_CMD}};
+
+/* Private functions prototypes-----------------------------------------------*/
+static void RxCpltCallback(void);
+static void at_cmd_analysing(void);
+static uint8_t* hex_decode(const char *in, size_t len, uint8_t *out);
+//static uint16_t dec_decode(const char *in, uint16_t *out, size_t len);
+
+
+void UART_App_Init( void ) {
+
+ Next_Mode = P2P_SERVER;
+ param = NO_PARAM;
+ multi_param.state = NO_MULTI_PARAM;
+ disconnection_status = FROM_REMOTE;
+ autoconn_status = 0;
+
+ PairingContext.PairingConfirmRequested = 0;
+ PairingContext.PairingComplete = 0;
+
+ UTIL_SEQ_RegTask( 1<< CFG_TASK_AT_CMD_ANALYSING_ID, UTIL_SEQ_RFU, at_cmd_analysing);
+
+#if (CFG_HW_USART1_ENABLED == 1)
+ MX_USART1_UART_Init();
+#endif
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ MX_LPUART1_UART_Init();
+#endif
+
+
+ /*cleanup the pDataRx buffer*/
+ memset(pDataRx, 0x00, 32);
+
+ HW_UART_Receive_IT(CFG_AT_UART, (uint8_t *)pCharRx, 1, RxCpltCallback);
+
+ return;
+}
+
+char* UART_App_ConvertBleDataToString(const uint8_t *in, char *out, size_t len)
+{
+ int i, j;
+ char in_separated[32];
+ for(i = 0, j = 0; i < len; i+=2, j++)
+ {
+ in_separated[i+1] = in[j] & 0x0F;
+ in_separated[i] = (in[j]>>4) & 0x0F;
+ out[i] = in_separated[i] > 9 ? (in_separated[i] - 10) + 'A' : in_separated[i] + '0';
+ out[i+1] = in_separated[i+1] > 9 ? (in_separated[i+1] - 10) + 'A' : in_separated[i+1] + '0';
+ }
+
+ return out;
+}
+
+void UART_App_SendData(char * message, uint8_t len)
+{
+ HAL_UART_Transmit(&hlpuart1, (uint8_t*)message, len, 5000);
+}
+
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+
+static void RxCpltCallback( void )
+{
+ pDataRx[indexRx++] = pCharRx[0];
+ if(*pCharRx == '\r') { //End of AT Command
+ UTIL_SEQ_SetTask( 1<<CFG_TASK_AT_CMD_ANALYSING_ID, CFG_SCH_PRIO_0);
+ }
+ else if(*pCharRx == '=') param = PARAM;
+ else if(*pCharRx == ',')
+ {
+ multi_param.state = MULTI_PARAM;
+ multi_param.index = indexRx - 1;
+ }
+
+ HW_UART_Receive_IT(CFG_AT_UART, (uint8_t *)pCharRx, 1, RxCpltCallback);
+
+ return;
+}
+
+static void at_cmd_analysing( void )
+{
+ int i, j;
+ AT_Cmd_Type_t at_type = AT_END_CMD;
+ uint8_t bd_addr_str[12];
+ uint8_t write_char_data_str[4];
+ uint8_t notify_char_data_str[4];
+
+ for (i = 0; i < AT_END_CMD; i++)
+ {
+ if (strncmp(pDataRx, AT_CMD[i].ATCmdStr, (AT_CMD[i].SizeATCmdStr)-1) == 0)
+ {
+ /* command has been found*/
+ at_type = AT_CMD[i].AT_Cmd_Type;
+ break;
+ }
+ }
+
+ switch(at_type){
+ case AT :
+ UART_App_SendData("\r\nOK\r\n", 6);
+ break;
+ case AT_SV :
+ Next_Mode = P2P_SERVER;
+ if(APP_MODE == P2P_SERVER) UART_App_SendData("\r\nERROR\r\n", 9);
+ else {
+ /* Switch to P2P Server */
+ disconnection_status = TO_SWITCH_APP;
+ if((APP_MODE == HEART_RATE) && (HR_Connection_Status == APP_BLE_CONNECTED_SERVER))
+ {
+ UTIL_SEQ_SetTask( 1<<CFG_TASK_HR_GAP_DISCON_ID, CFG_SCH_PRIO_0);
+ }
+ else if((APP_MODE == P2P_CLIENT) && (CL_Connection_Status == APP_BLE_CONNECTED_CLIENT))
+ {
+ UTIL_SEQ_SetTask( 1<<CFG_TASK_CL_GAP_DISCON_ID, CFG_SCH_PRIO_0);
+ }
+ else {
+ *(volatile uint32_t*) SRAM1_BASE = SRAM1_BASE_P2P_SERVER;
+ NVIC_SystemReset();
+ }
+ }
+ break;
+ case AT_SV_ADV_START :
+ if( APP_MODE != P2P_SERVER ) UART_App_SendData("\r\nERROR\r\n", 9);
+ else {
+ /* Request advertising */
+ UTIL_SEQ_SetTask(1 << CFG_TASK_ADV_REQ_ID, CFG_SCH_PRIO_0);
+ }
+ break;
+ case AT_SV_ADV_STOP :
+ if( APP_MODE != P2P_SERVER ) UART_App_SendData("\r\nERROR\r\n", 9);
+ else {
+ /* Cancel advertising */
+ UTIL_SEQ_SetTask(1 << CFG_TASK_ADV_CANCEL_ID, CFG_SCH_PRIO_0);
+ }
+ break;
+ case AT_SV_NOTIFY :
+ if((APP_MODE != P2P_SERVER) || (param != PARAM)) UART_App_SendData("\r\nERROR\r\n", 9);
+ else {
+ if((pDataRx[12] == '=') && (pDataRx[17] == '\r'))
+ {
+ for(i = 0; i < 4; i++) notify_char_data_str[i] = pDataRx[i+13];
+ hex_decode((char *)notify_char_data_str, 4, NotifyCharData);
+ /* Notify the Client */
+ UTIL_SEQ_SetTask( 1<<CFG_TASK_NOTIFY_ID, CFG_SCH_PRIO_0);
+ }
+ else UART_App_SendData("\r\nERROR\r\n", 9);
+ }
+ break;
+ case AT_SV_CONN_UPD :
+ if(APP_MODE != P2P_SERVER) UART_App_SendData("\r\nERROR\r\n", 9);
+ else {
+ uint8_t lenConnUpdStr;
+ lenConnUpdStr = (indexRx-1)-(14+1); /* indexRx - 1 to compensate the indexRx++ when filling the pDataRx buffer */
+ if(pDataRx[14] == '=' && lenConnUpdStr <= 4 )
+ { //The format of the command is correct and the length of the parameter as well
+ char ConnUpdStr[5];
+ for(i = 0; i < lenConnUpdStr; i++) ConnUpdStr[i] = pDataRx[15+i];
+ /* TODO : Verify that the entered values are correct. Ex: Discard a value like .1#2 */
+ Connection_Update_Interval = (uint16_t) atoi(ConnUpdStr);
+ if(Connection_Update_Interval <= 4000 && Connection_Update_Interval >= 10)
+ {
+ /* Change connection interval */
+ UTIL_SEQ_SetTask( 1<<CFG_TASK_CONN_UPDATE_ID, CFG_SCH_PRIO_0);
+ }
+ else UART_App_SendData("\r\nERROR\r\n", 9);
+ }
+ else UART_App_SendData("\r\nERROR\r\n", 9);
+
+ }
+ break;
+ case AT_CL :
+ Next_Mode = P2P_CLIENT;
+ if(APP_MODE == P2P_CLIENT) UART_App_SendData("\r\nERROR\r\n", 9);
+ else {
+ /* Switch to P2P Client */
+ disconnection_status = TO_SWITCH_APP;
+ if((APP_MODE == HEART_RATE) && (HR_Connection_Status == APP_BLE_CONNECTED_SERVER))
+ {
+ UTIL_SEQ_SetTask( 1<<CFG_TASK_HR_GAP_DISCON_ID, CFG_SCH_PRIO_0);
+ }
+ else if((APP_MODE == P2P_SERVER) && (SV_Connection_Status == APP_BLE_CONNECTED_SERVER))
+ {
+ UTIL_SEQ_SetTask( 1<<CFG_TASK_SV_GAP_DISCON_ID, CFG_SCH_PRIO_0);
+ }
+ else {
+ *(volatile uint32_t*) SRAM1_BASE = SRAM1_BASE_P2P_CLIENT;
+ NVIC_SystemReset();
+ }
+ }
+ break;
+ case AT_CL_WRITE :
+ if(APP_MODE != P2P_CLIENT || (param != PARAM)) UART_App_SendData("\r\nERROR\r\n", 9);
+ else {
+ if((pDataRx[11] == '=') && (pDataRx[16] == '\r'))
+ {
+ for(i = 0; i < 4; i++) write_char_data_str[i] = pDataRx[i+12];
+ hex_decode((char *)write_char_data_str, 4, WriteCharData);
+ /* Send a write command to turn on/off the Led of the Server */
+ UTIL_SEQ_SetTask(1<<CFG_TASK_SEND_DATA_TO_SERVER_ID, CFG_SCH_PRIO_0);
+ }
+ else UART_App_SendData("\r\nERROR\r\n", 9);
+ }
+ break;
+ case AT_CL_SCAN :
+ if( APP_MODE != P2P_CLIENT ) UART_App_SendData("\r\nERROR\r\n", 9);
+ else {
+ /* Clear BD Address buffer in order to be able to re-send the BD addresses discovered during a previous scan on the UART */
+ for(i = 0; i < 5; i++)
+ {
+ for(j = 0; j < 6; j++)
+ {
+ SERVER_REMOTE_BDADDR[i][j] = 0;
+ }
+ }
+ index_bd_addr = 0;
+ /* Scan the devices and send the found ones via UART */
+ UTIL_SEQ_SetTask(1<<CFG_TASK_START_SCAN_ID, CFG_SCH_PRIO_0);
+ }
+ break;
+ case AT_CL_CONN :
+ if((APP_MODE != P2P_CLIENT) || (param != PARAM)) UART_App_SendData("\r\nERROR\r\n", 9); //Make sure we are in P2P Client mode and the parameter is set
+ else {
+ if((pDataRx[10] == '=') && (pDataRx[23] == '\r'))
+ {
+ /* Command is correct regarding the bd address input */
+ for(i = 0; i < 12; i++) bd_addr_str[i] = pDataRx[i+11];
+ hex_decode((char *)bd_addr_str, 12, BD_Addr);
+ /* Connect to the indicated device */
+ UTIL_SEQ_SetTask(1 << CFG_TASK_CONN_DEV_1_ID, CFG_SCH_PRIO_0);
+ }
+ else UART_App_SendData("\r\nERROR\r\n", 9);
+ }
+ break;
+ case AT_CL_DISCONN :
+ if((APP_MODE != P2P_CLIENT) || (CL_Connection_Status != APP_BLE_CONNECTED_CLIENT)) UART_App_SendData("\r\nERROR\r\n", 9); //Make sure we are in P2P Client mode and the Client is connected to a Server
+ else {
+ disconnection_status = FROM_AT_CMD;
+ /* Disconnect from the connected device */
+ UTIL_SEQ_SetTask( 1<<CFG_TASK_CL_GAP_DISCON_ID, CFG_SCH_PRIO_0);
+ }
+ break;
+ case AT_CL_AUTOCONN :
+ if((APP_MODE != P2P_CLIENT) || (param != PARAM)) UART_App_SendData("\r\nERROR\r\n", 9); //Make sure we are in P2P Client mode and the parameter is set
+ else {
+ if((pDataRx[14] == '=') && (pDataRx[27] == '\r'))
+ {
+ /* Command is correct */
+ autoconn_status = 1;
+ for(i = 0; i < 12; i++) bd_addr_str[i] = pDataRx[i+15];
+ hex_decode((char *)bd_addr_str, 12, BD_Addr);
+ /* Scan the devices and if one correspond to the BD address given by the user, connect to it */
+ UTIL_SEQ_SetTask(1<<CFG_TASK_START_SCAN_ID, CFG_SCH_PRIO_0);
+ }
+ else UART_App_SendData("\r\nERROR\r\n", 9);
+ }
+ break;
+ case AT_CL_EN :
+ if(APP_MODE != P2P_CLIENT) UART_App_SendData("\r\nERROR\r\n", 9);
+ else {
+ /* Enable notifications */
+ Enable_Notification();
+ }
+ break;
+ case AT_CL_DIS :
+ if(APP_MODE != P2P_CLIENT) UART_App_SendData("\r\nERROR\r\n", 9);
+ else {
+ /* Disable notifications */
+ Disable_Notification();
+ }
+ break;
+ case AT_HR :
+ Next_Mode = HEART_RATE;
+ if(APP_MODE == HEART_RATE) UART_App_SendData("\r\nERROR\r\n", 9);
+ else {
+ /* Switch to Heart Rate */
+ disconnection_status = TO_SWITCH_APP;
+ if((APP_MODE == P2P_SERVER) && (SV_Connection_Status == APP_BLE_CONNECTED_SERVER))
+ {
+ UTIL_SEQ_SetTask( 1<<CFG_TASK_SV_GAP_DISCON_ID, CFG_SCH_PRIO_0);
+ }
+ else if((APP_MODE == P2P_CLIENT) && (CL_Connection_Status == APP_BLE_CONNECTED_CLIENT))
+ {
+ UTIL_SEQ_SetTask( 1<<CFG_TASK_CL_GAP_DISCON_ID, CFG_SCH_PRIO_0);
+ }
+ else {
+ *(volatile uint32_t*) SRAM1_BASE = SRAM1_BASE_HEART_RATE;
+ NVIC_SystemReset();
+ }
+ }
+ break;
+ case AT_HR_NOTIFY :
+ if((APP_MODE != HEART_RATE) || (param != PARAM) || (multi_param.state != MULTI_PARAM)) UART_App_SendData("\r\nERROR\r\n", 9);
+ else {
+ if(pDataRx[12] == '=')
+ {
+ /* Parse data */
+ uint8_t len_val1;
+ uint8_t len_val2;
+ char val1_str[16];
+ char val2_str[16];
+
+ len_val1 = multi_param.index - (12 + 1);
+ len_val2 = indexRx - (multi_param.index +1);
+
+ for(i = 0; i < len_val1; i++) val1_str[i] = pDataRx[i+13];
+ for(i = 0; i < len_val2; i++) val2_str[i] = pDataRx[i+multi_param.index+1];
+
+ HR_Notify_Context.Measurement = (uint16_t) atoi(val1_str);
+ HR_Notify_Context.EnergyExpended = (uint16_t) atoi(val2_str);
+
+ /* Notify the Client */
+ UTIL_SEQ_SetTask( 1<<CFG_TASK_MEAS_REQ_ID, CFG_SCH_PRIO_0);
+ }
+ else UART_App_SendData("\r\nERROR\r\n", 9);
+ }
+ break;
+ case AT_PAIRING_START :
+ if(!PairingContext.PairingComplete)
+ {
+ UTIL_SEQ_SetTask( 1<<CFG_TASK_REQUEST_PAIRING_ID, CFG_SCH_PRIO_0);
+ }
+ break;
+ case AT_PAIRING_CONFIRM :
+ if(param != PARAM) UART_App_SendData("\r\nERROR\r\n", 9);
+ else {
+ if(pDataRx[20] == '=')
+ {
+ if(pDataRx[21] == 'Y' && PairingContext.PairingConfirmRequested == 1)
+ {
+ PairingContext.PairingConfirmRequested = 0;
+ UTIL_SEQ_SetTask( 1<<CFG_TASK_CONFIRM_PAIRING_ID, CFG_SCH_PRIO_0);
+ }
+ }
+ }
+ break;
+ case AT_CLEAR_BONDING :
+ aci_gap_clear_security_db();
+ UART_App_SendData("\r\nOK\r\n", 6);
+ break;
+ default : /* Error */
+ UART_App_SendData("\r\nERROR\r\n", 9);
+ break;
+ }
+
+ param = NO_PARAM;
+
+ /*cleanup the pDataRx buffer*/
+ memset(pDataRx, 0x00, 32);
+ indexRx = 0;
+}
+
+static uint8_t* hex_decode(const char *in, size_t len,uint8_t *out)
+{
+ unsigned int i, t, hn, ln;
+
+ for (t = 0,i = 0; i < len; i+=2,++t) {
+ hn = in[i] > '9' ? in[i] - 'A' + 10 : in[i] - '0'; //upper part of the hexa value
+ ln = in[i+1] > '9' ? in[i+1] - 'A' + 10 : in[i+1] - '0'; //lower part of the hexa value
+ out[t] = (hn << 4 ) | ln;
+ }
+ return out;
+}
+
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/uart_app.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/uart_app.h
new file mode 100644
index 000000000..b961f4419
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/App/uart_app.h
@@ -0,0 +1,59 @@
+/* USER CODE BEGIN */
+/**
+ ******************************************************************************
+ * File Name : App/uart_app.h
+ * Description : Header for uart_app.c module
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __UART_APP_H
+#define __UART_APP_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+
+/* Private includes ----------------------------------------------------------*/
+
+
+/* Exported functions ---------------------------------------------*/
+void UART_App_Init( void );
+char* UART_App_ConvertBleDataToString(const uint8_t *in, char *out, size_t len);
+void UART_App_SendData(char * message, uint8_t len);
+
+/* Exported typedef ---------------------------------------------*/
+
+typedef struct {
+ uint16_t Measurement;
+ uint16_t EnergyExpended;
+} HR_Notify_Context_t;
+
+typedef struct
+{
+ uint8_t PairingConfirmRequested;
+ uint8_t PairingComplete;
+} PairingContext_t;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*__UART_APP_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/Target/hw_ipcc.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/Target/hw_ipcc.c
new file mode 100644
index 000000000..7b22ea955
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/STM32_WPAN/Target/hw_ipcc.c
@@ -0,0 +1,517 @@
+/**
+ ******************************************************************************
+ * File Name : Target/hw_ipcc.c
+ * Description : Hardware IPCC source file for BLE
+ * middleWare.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "mbox_def.h"
+
+/* Global variables ---------------------------------------------------------*/
+/* Private defines -----------------------------------------------------------*/
+#define HW_IPCC_TX_PENDING( channel ) ( !(LL_C1_IPCC_IsActiveFlag_CHx( IPCC, channel )) ) && (((~(IPCC->C1MR)) & (channel << 16U)))
+#define HW_IPCC_RX_PENDING( channel ) (LL_C2_IPCC_IsActiveFlag_CHx( IPCC, channel )) && (((~(IPCC->C1MR)) & (channel << 0U)))
+
+/* Private macros ------------------------------------------------------------*/
+/* Private typedef -----------------------------------------------------------*/
+/* Private variables ---------------------------------------------------------*/
+static void (*FreeBufCb)( void );
+
+/* Private function prototypes -----------------------------------------------*/
+static void HW_IPCC_BLE_EvtHandler( void );
+static void HW_IPCC_BLE_AclDataEvtHandler( void );
+static void HW_IPCC_MM_FreeBufHandler( void );
+static void HW_IPCC_SYS_CmdEvtHandler( void );
+static void HW_IPCC_SYS_EvtHandler( void );
+static void HW_IPCC_TRACES_EvtHandler( void );
+
+#ifdef THREAD_WB
+static void HW_IPCC_OT_CmdEvtHandler( void );
+static void HW_IPCC_THREAD_NotEvtHandler( void );
+static void HW_IPCC_THREAD_CliNotEvtHandler( void );
+#endif
+
+#ifdef MAC_802_15_4_WB
+static void HW_IPCC_MAC_802_15_4_CmdEvtHandler( void );
+static void HW_IPCC_MAC_802_15_4_NotEvtHandler( void );
+#endif
+
+#ifdef ZIGBEE_WB
+static void HW_IPCC_ZIGBEE_CmdEvtHandler( void );
+static void HW_IPCC_ZIGBEE_StackNotifEvtHandler( void );
+static void HW_IPCC_ZIGBEE_CliNotifEvtHandler( void );
+#endif
+
+/* Public function definition -----------------------------------------------*/
+
+/******************************************************************************
+ * INTERRUPT HANDLER
+ ******************************************************************************/
+void HW_IPCC_Rx_Handler( void )
+{
+ if (HW_IPCC_RX_PENDING( HW_IPCC_SYSTEM_EVENT_CHANNEL ))
+ {
+ HW_IPCC_SYS_EvtHandler();
+ }
+#ifdef MAC_802_15_4_WB
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL ))
+ {
+ HW_IPCC_MAC_802_15_4_NotEvtHandler();
+ }
+#endif /* MAC_802_15_4_WB */
+#ifdef THREAD_WB
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL ))
+ {
+ HW_IPCC_THREAD_NotEvtHandler();
+ }
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL ))
+ {
+ HW_IPCC_THREAD_CliNotEvtHandler();
+ }
+#endif /* THREAD_WB */
+#ifdef ZIGBEE_WB
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL ))
+ {
+ HW_IPCC_ZIGBEE_StackNotifEvtHandler();
+ }
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL ))
+ {
+ HW_IPCC_ZIGBEE_CliNotifEvtHandler();
+ }
+#endif /* ZIGBEE_WB */
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_BLE_EVENT_CHANNEL ))
+ {
+ HW_IPCC_BLE_EvtHandler();
+ }
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_TRACES_CHANNEL ))
+ {
+ HW_IPCC_TRACES_EvtHandler();
+ }
+
+ return;
+}
+
+void HW_IPCC_Tx_Handler( void )
+{
+ if (HW_IPCC_TX_PENDING( HW_IPCC_SYSTEM_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_SYS_CmdEvtHandler();
+ }
+#ifdef MAC_802_15_4_WB
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_MAC_802_15_4_CmdEvtHandler();
+ }
+#endif /* MAC_802_15_4_WB */
+#ifdef THREAD_WB
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_OT_CmdEvtHandler();
+ }
+#endif /* THREAD_WB */
+#ifdef ZIGBEE_WB
+ if (HW_IPCC_TX_PENDING( HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_ZIGBEE_CmdEvtHandler();
+ }
+#endif /* ZIGBEE_WB */
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_SYSTEM_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_SYS_CmdEvtHandler();
+ }
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_MM_RELEASE_BUFFER_CHANNEL ))
+ {
+ HW_IPCC_MM_FreeBufHandler();
+ }
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_HCI_ACL_DATA_CHANNEL ))
+ {
+ HW_IPCC_BLE_AclDataEvtHandler();
+ }
+
+ return;
+}
+/******************************************************************************
+ * GENERAL
+ ******************************************************************************/
+void HW_IPCC_Enable( void )
+{
+ /**
+ * In case the SBSFU is implemented, it may have already set the C2BOOT bit to startup the CPU2.
+ * In that case, to keep the mechanism transparent to the user application, it shall call the system command
+ * SHCI_C2_Reinit( ) before jumping to the application.
+ * When the CPU2 receives that command, it waits for its event input to be set to restart the CPU2 firmware.
+ * This is required because once C2BOOT has been set once, a clear/set on C2BOOT has no effect.
+ * When SHCI_C2_Reinit( ) is not called, generating an event to the CPU2 does not have any effect
+ * So, by default, the application shall both set the event flag and set the C2BOOT bit.
+ */
+ __SEV( ); /* Set the internal event flag and send an event to the CPU2 */
+ __WFE( ); /* Clear the internal event flag */
+ LL_PWR_EnableBootC2( );
+
+ return;
+}
+
+void HW_IPCC_Init( void )
+{
+ LL_AHB3_GRP1_EnableClock( LL_AHB3_GRP1_PERIPH_IPCC );
+
+ LL_C1_IPCC_EnableIT_RXO( IPCC );
+ LL_C1_IPCC_EnableIT_TXF( IPCC );
+
+ HAL_NVIC_EnableIRQ(IPCC_C1_RX_IRQn);
+ HAL_NVIC_EnableIRQ(IPCC_C1_TX_IRQn);
+
+ return;
+}
+
+/******************************************************************************
+ * BLE
+ ******************************************************************************/
+void HW_IPCC_BLE_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_BLE_EVENT_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_BLE_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_BLE_CMD_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_BLE_EvtHandler( void )
+{
+ HW_IPCC_BLE_RxEvtNot();
+
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_BLE_EVENT_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_BLE_SendAclData( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_HCI_ACL_DATA_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_HCI_ACL_DATA_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_BLE_AclDataEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_HCI_ACL_DATA_CHANNEL );
+
+ HW_IPCC_BLE_AclDataAckNot();
+
+ return;
+}
+
+__weak void HW_IPCC_BLE_AclDataAckNot( void ){};
+__weak void HW_IPCC_BLE_RxEvtNot( void ){};
+
+/******************************************************************************
+ * SYSTEM
+ ******************************************************************************/
+void HW_IPCC_SYS_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_SYSTEM_EVENT_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_SYS_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_SYSTEM_CMD_RSP_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_SYSTEM_CMD_RSP_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_SYS_CmdEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_SYSTEM_CMD_RSP_CHANNEL );
+
+ HW_IPCC_SYS_CmdEvtNot();
+
+ return;
+}
+
+static void HW_IPCC_SYS_EvtHandler( void )
+{
+ HW_IPCC_SYS_EvtNot();
+
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_SYSTEM_EVENT_CHANNEL );
+
+ return;
+}
+
+__weak void HW_IPCC_SYS_CmdEvtNot( void ){};
+__weak void HW_IPCC_SYS_EvtNot( void ){};
+
+/******************************************************************************
+ * MAC 802.15.4
+ ******************************************************************************/
+#ifdef MAC_802_15_4_WB
+void HW_IPCC_MAC_802_15_4_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_MAC_802_15_4_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_MAC_802_15_4_SendAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_MAC_802_15_4_CmdEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL );
+
+ HW_IPCC_MAC_802_15_4_CmdEvtNot();
+
+ return;
+}
+
+static void HW_IPCC_MAC_802_15_4_NotEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_MAC_802_15_4_EvtNot();
+
+ return;
+}
+__weak void HW_IPCC_MAC_802_15_4_CmdEvtNot( void ){};
+__weak void HW_IPCC_MAC_802_15_4_EvtNot( void ){};
+#endif
+
+/******************************************************************************
+ * THREAD
+ ******************************************************************************/
+#ifdef THREAD_WB
+void HW_IPCC_THREAD_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_OT_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_CLI_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_THREAD_CLI_CMD_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_THREAD_SendAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_THREAD_CliSendAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_OT_CmdEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+
+ HW_IPCC_OT_CmdEvtNot();
+
+ return;
+}
+
+static void HW_IPCC_THREAD_NotEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_THREAD_EvtNot();
+
+ return;
+}
+
+static void HW_IPCC_THREAD_CliNotEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_THREAD_CliEvtNot();
+
+ return;
+}
+
+__weak void HW_IPCC_OT_CmdEvtNot( void ){};
+__weak void HW_IPCC_CLI_CmdEvtNot( void ){};
+__weak void HW_IPCC_THREAD_EvtNot( void ){};
+
+#endif /* THREAD_WB */
+
+/******************************************************************************
+ * ZIGBEE
+ ******************************************************************************/
+#ifdef ZIGBEE_WB
+void HW_IPCC_ZIGBEE_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_ZIGBEE_SendAppliCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_ZIGBEE_SendCliCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_THREAD_CLI_CMD_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_ZIGBEE_SendAppliCmdAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_ZIGBEE_SendCliCmdAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_ZIGBEE_CmdEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+
+ HW_IPCC_ZIGBEE_AppliCmdNotification();
+
+ return;
+}
+
+static void HW_IPCC_ZIGBEE_StackNotifEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_ZIGBEE_AppliAsyncEvtNotification();
+
+ return;
+}
+
+static void HW_IPCC_ZIGBEE_CliNotifEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_ZIGBEE_CliEvtNotification();
+
+ return;
+}
+
+__weak void HW_IPCC_ZIGBEE_AppliCmdNotification( void ){};
+__weak void HW_IPCC_ZIGBEE_AppliAsyncEvtNotification( void ){};
+__weak void HW_IPCC_ZIGBEE_CliEvtNotification( void ){};
+#endif /* ZIGBEE_WB */
+
+/******************************************************************************
+ * MEMORY MANAGER
+ ******************************************************************************/
+void HW_IPCC_MM_SendFreeBuf( void (*cb)( void ) )
+{
+ if ( LL_C1_IPCC_IsActiveFlag_CHx( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL ) )
+ {
+ FreeBufCb = cb;
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+ }
+ else
+ {
+ cb();
+
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+ }
+
+ return;
+}
+
+static void HW_IPCC_MM_FreeBufHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+
+ FreeBufCb();
+
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+
+ return;
+}
+
+/******************************************************************************
+ * TRACES
+ ******************************************************************************/
+void HW_IPCC_TRACES_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_TRACES_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_TRACES_EvtHandler( void )
+{
+ HW_IPCC_TRACES_EvtNot();
+
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_TRACES_CHANNEL );
+
+ return;
+}
+
+__weak void HW_IPCC_TRACES_EvtNot( void ){};
+
+/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/SW4STM32/BLE_MultiAppAt/.cproject b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/SW4STM32/BLE_MultiAppAt/.cproject
new file mode 100644
index 000000000..360396269
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/SW4STM32/BLE_MultiAppAt/.cproject
@@ -0,0 +1,201 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+ <storageModule moduleId="org.eclipse.cdt.core.settings">
+ <cconfiguration id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.186557892">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.186557892" moduleId="org.eclipse.cdt.core.settings" name="Debug">
+ <externalSettings />
+ <extensions>
+ <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser" />
+ <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser" />
+ <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser" />
+ <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser" />
+ <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser" />
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser" />
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactExtension="elf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.186557892" name="Debug" parent="fr.ac6.managedbuild.config.gnu.cross.exe.debug" postannouncebuildStep="Generating hex and Printing size information:" postbuildStep="arm-none-eabi-objcopy -O ihex &quot;${BuildArtifactFileBaseName}.elf&quot; &quot;${BuildArtifactFileBaseName}.hex&quot; &amp;&amp; arm-none-eabi-size &quot;${BuildArtifactFileName}&quot;">
+ <folderInfo id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.186557892." name="/" resourcePath="">
+ <toolChain id="fr.ac6.managedbuild.toolchain.gnu.cross.exe.debug.581438154" name="Ac6 STM32 MCU GCC" superClass="fr.ac6.managedbuild.toolchain.gnu.cross.exe.debug">
+ <option id="fr.ac6.managedbuild.option.gnu.cross.prefix.1039857997" name="Prefix" superClass="fr.ac6.managedbuild.option.gnu.cross.prefix" value="arm-none-eabi-" valueType="string" />
+ <option id="fr.ac6.managedbuild.option.gnu.cross.mcu.1203159679" name="Mcu" superClass="fr.ac6.managedbuild.option.gnu.cross.mcu" value="STM32WB55RGVx" valueType="string" />
+ <option id="fr.ac6.managedbuild.option.gnu.cross.board.1372440300" name="Board" superClass="fr.ac6.managedbuild.option.gnu.cross.board" value="P-NUCLEO-WB55.NUCLEO" valueType="string" />
+ <option id="fr.ac6.managedbuild.option.gnu.cross.core.1083960614" name="Core" superClass="fr.ac6.managedbuild.option.gnu.cross.core" valueType="stringList">
+ <listOptionValue builtIn="false" value="ARM Cortex-M4" />
+ <listOptionValue builtIn="false" value="CM4" />
+ </option>
+ <option id="fr.ac6.managedbuild.option.gnu.cross.instructionSet.573214506" name="Instruction Set" superClass="fr.ac6.managedbuild.option.gnu.cross.instructionSet" value="fr.ac6.managedbuild.option.gnu.cross.instructionSet.thumbII" valueType="enumerated" />
+ <option id="fr.ac6.managedbuild.option.gnu.cross.fpu.860021008" name="Floating point hardware" superClass="fr.ac6.managedbuild.option.gnu.cross.fpu" value="fr.ac6.managedbuild.option.gnu.cross.fpu.fpv4-sp-d16" valueType="enumerated" />
+ <option id="fr.ac6.managedbuild.option.gnu.cross.floatabi.1215900952" name="Floating-point ABI" superClass="fr.ac6.managedbuild.option.gnu.cross.floatabi" value="fr.ac6.managedbuild.option.gnu.cross.floatabi.hard" valueType="enumerated" />
+ <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="fr.ac6.managedbuild.targetPlatform.gnu.cross.806304321" isAbstract="false" osList="all" superClass="fr.ac6.managedbuild.targetPlatform.gnu.cross" />
+ <builder buildPath="${workspace_loc:/ble_multi_app_at}/Debug" id="fr.ac6.managedbuild.builder.gnu.cross.1487861510" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="fr.ac6.managedbuild.builder.gnu.cross">
+ <outputEntries>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="Debug" />
+ </outputEntries>
+ </builder>
+
+ <tool id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.1504589846" name="MCU GCC Compiler" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler">
+ <option defaultValue="gnu.c.optimization.level.none" id="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level.660496895" name="Optimization Level" superClass="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="fr.ac6.managedbuild.gnu.c.optimization.level.size" valueType="enumerated" />
+ <option id="gnu.c.compiler.option.debugging.level.848830022" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated" />
+ <option id="gnu.c.compiler.option.include.paths.1597026139" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath"><listOptionValue builtIn="false" value="../../../Core/Inc" /><listOptionValue builtIn="false" value="../../../STM32_WPAN/App" /><listOptionValue builtIn="false" value="../../../../../../../../Drivers/STM32WBxx_HAL_Driver/Inc" /><listOptionValue builtIn="false" value="../../../../../../../../Drivers/STM32WBxx_HAL_Driver/Inc/Legacy" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/utilities" /><listOptionValue builtIn="false" value="../../../../../../../../Utilities/lpm/tiny_lpm" /><listOptionValue builtIn="false" value="../../../../../../../../Utilities/sequencer" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble/core/template" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble/core" /><listOptionValue builtIn="false" value="../../../../../../../../Drivers/CMSIS/Device/ST/STM32WBxx/Include" /><listOptionValue builtIn="false" value="../../../../../../../../Drivers/CMSIS/Include" /><listOptionValue builtIn="false" value="../../../../../../../../Drivers/BSP/P-NUCLEO-WB55.Nucleo" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/lhci" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble/svc/Src" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble/svc/Inc" /></option>
+ <option id="gnu.c.compiler.option.preprocessor.def.symbols.1460212809" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols"><listOptionValue builtIn="false" value="USE_STM32WBXX_NUCLEO" /><listOptionValue builtIn="false" value="USE_HAL_DRIVER" /><listOptionValue builtIn="false" value="STM32WB55xx" /></option>
+ <option id="fr.ac6.managedbuild.gnu.c.compiler.option.misc.other.1125107205" superClass="fr.ac6.managedbuild.gnu.c.compiler.option.misc.other" value="-fmessage-length=0" valueType="string" />
+ <inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c.962158481" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c" />
+ <inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.s.1606612068" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.s" />
+ </tool>
+ <tool id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.858114747" name="MCU G++ Compiler" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler">
+ <option defaultValue="gnu.cpp.optimization.level.none" id="fr.ac6.managedbuild.gnu.cpp.compiler.option.optimization.level.199295621" name="Optimization Level" superClass="fr.ac6.managedbuild.gnu.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="fr.ac6.managedbuild.gnu.cpp.optimization.level.size" valueType="enumerated" />
+ <option id="gnu.cpp.compiler.option.debugging.level.1913057085" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated" />
+ <option id="gnu.cpp.compiler.option.include.paths.1219134927" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath"><listOptionValue builtIn="false" value="../../../Core/Inc" /><listOptionValue builtIn="false" value="../../../STM32_WPAN/App" /><listOptionValue builtIn="false" value="../../../../../../../../Drivers/STM32WBxx_HAL_Driver/Inc" /><listOptionValue builtIn="false" value="../../../../../../../../Drivers/STM32WBxx_HAL_Driver/Inc/Legacy" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/utilities" /><listOptionValue builtIn="false" value="../../../../../../../../Utilities/lpm/tiny_lpm" /><listOptionValue builtIn="false" value="../../../../../../../../Utilities/sequencer" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble/core/template" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble/core" /><listOptionValue builtIn="false" value="../../../../../../../../Drivers/CMSIS/Device/ST/STM32WBxx/Include" /><listOptionValue builtIn="false" value="../../../../../../../../Drivers/CMSIS/Include" /><listOptionValue builtIn="false" value="../../../../../../../../Drivers/BSP/P-NUCLEO-WB55.Nucleo" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/lhci" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble/svc/Src" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble/svc/Inc" /></option>
+ <option id="gnu.cpp.compiler.option.preprocessor.def.546757646" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols"><listOptionValue builtIn="false" value="USE_STM32WBXX_NUCLEO" /><listOptionValue builtIn="false" value="USE_HAL_DRIVER" /><listOptionValue builtIn="false" value="STM32WB55xx" /></option>
+ <option id="fr.ac6.managedbuild.gnu.cpp.compiler.option.misc.other.1016831914" superClass="fr.ac6.managedbuild.gnu.cpp.compiler.option.misc.other" value="-fmessage-length=0" valueType="string" />
+ <inputType id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.cpp.1219279242" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.cpp" />
+ <inputType id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.s.1370884803" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.s" />
+ </tool>
+ <tool id="fr.ac6.managedbuild.tool.gnu.cross.c.linker.1076671478" name="MCU GCC Linker" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.linker">
+ <option id="fr.ac6.managedbuild.tool.gnu.cross.c.linker.script.1573864803" name="Linker Script (-T)" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.linker.script" value="../stm32wb55xx_flash_cm4.ld" valueType="string" />
+ <option id="gnu.c.link.option.libs.1600860379" name="Libraries (-l)" superClass="gnu.c.link.option.libs" valueType="libs" />
+ <option id="gnu.c.link.option.paths.1280243558" name="Library search path (-L)" superClass="gnu.c.link.option.paths" valueType="libPaths" />
+ <option id="gnu.c.link.option.ldflags.219916395" superClass="gnu.c.link.option.ldflags" value="-specs=nosys.specs -specs=nano.specs" valueType="string" />
+ <option id="gnu.c.link.option.other.1141008382" name="Other options (-Xlinker [option])" superClass="gnu.c.link.option.other" useByScannerDiscovery="false" valueType="stringList" />
+ <inputType id="cdt.managedbuild.tool.gnu.c.linker.input.600290977" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
+ <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)" />
+ <additionalInput kind="additionalinput" paths="$(LIBS)" />
+ </inputType>
+ </tool>
+ <tool id="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.1200213178" name="MCU G++ Linker" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker">
+ <option id="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.script.1927909423" name="Linker Script (-T)" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.script" value="../stm32wb55xx_flash_cm4.ld" valueType="string" />
+ <option id="gnu.cpp.link.option.libs.1767931887" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs" />
+ <option id="gnu.cpp.link.option.paths.1150241898" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths" />
+ <option id="gnu.cpp.link.option.flags.1228279002" superClass="gnu.cpp.link.option.flags" value="-specs=nosys.specs -specs=nano.specs" valueType="string" />
+ <option id="gnu.cpp.link.option.other.1449383098" name="Other options (-Xlinker [option])" superClass="gnu.cpp.link.option.other" useByScannerDiscovery="false" valueType="stringList" />
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1270652376" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+ <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)" />
+ <additionalInput kind="additionalinput" paths="$(LIBS)" />
+ </inputType>
+ </tool>
+ <tool id="fr.ac6.managedbuild.tool.gnu.archiver.2122235672" name="MCU GCC Archiver" superClass="fr.ac6.managedbuild.tool.gnu.archiver" />
+ <tool id="fr.ac6.managedbuild.tool.gnu.cross.assembler.1749585121" name="MCU GCC Assembler" superClass="fr.ac6.managedbuild.tool.gnu.cross.assembler">
+ <option id="gnu.both.asm.option.include.paths.1704168204" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
+
+
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.assembler.input.409578849" superClass="cdt.managedbuild.tool.gnu.assembler.input" />
+ <inputType id="fr.ac6.managedbuild.tool.gnu.cross.assembler.input.151878919" superClass="fr.ac6.managedbuild.tool.gnu.cross.assembler.input" />
+ </tool>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry excluding="" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="" />
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings" />
+ </cconfiguration>
+ <cconfiguration id="fr.ac6.managedbuild.config.gnu.cross.exe.release.746946791">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="fr.ac6.managedbuild.config.gnu.cross.exe.release.746946791" moduleId="org.eclipse.cdt.core.settings" name="Release">
+ <externalSettings />
+ <extensions>
+ <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser" />
+ <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser" />
+ <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser" />
+ <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser" />
+ <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser" />
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser" />
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactExtension="elf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" cleanCommand="rm -rf" description="" id="fr.ac6.managedbuild.config.gnu.cross.exe.release.746946791" name="Release" parent="fr.ac6.managedbuild.config.gnu.cross.exe.release" postannouncebuildStep="Generating hex and Printing size information:" postbuildStep="arm-none-eabi-objcopy -O ihex &quot;${BuildArtifactFileBaseName}.elf&quot; &quot;${BuildArtifactFileBaseName}.hex&quot; &amp;&amp; arm-none-eabi-size &quot;${BuildArtifactFileName}&quot;">
+ <folderInfo id="fr.ac6.managedbuild.config.gnu.cross.exe.release.746946791." name="/" resourcePath="">
+ <toolChain id="fr.ac6.managedbuild.toolchain.gnu.cross.exe.release.1541052874" name="Ac6 STM32 MCU GCC" superClass="fr.ac6.managedbuild.toolchain.gnu.cross.exe.release">
+ <option id="fr.ac6.managedbuild.option.gnu.cross.prefix.1039857997" name="Prefix" superClass="fr.ac6.managedbuild.option.gnu.cross.prefix" value="arm-none-eabi-" valueType="string" />
+ <option id="fr.ac6.managedbuild.option.gnu.cross.mcu.1203159679" name="Mcu" superClass="fr.ac6.managedbuild.option.gnu.cross.mcu" value="STM32WB55RGVx" valueType="string" />
+ <option id="fr.ac6.managedbuild.option.gnu.cross.board.1372440300" name="Board" superClass="fr.ac6.managedbuild.option.gnu.cross.board" value="P-NUCLEO-WB55.NUCLEO" valueType="string" />
+ <option id="fr.ac6.managedbuild.option.gnu.cross.core.1083960614" name="Core" superClass="fr.ac6.managedbuild.option.gnu.cross.core" valueType="stringList">
+ <listOptionValue builtIn="false" value="ARM Cortex-M4" />
+ <listOptionValue builtIn="false" value="CM4" />
+ </option>
+ <option id="fr.ac6.managedbuild.option.gnu.cross.instructionSet.573214506" name="Instruction Set" superClass="fr.ac6.managedbuild.option.gnu.cross.instructionSet" value="fr.ac6.managedbuild.option.gnu.cross.instructionSet.thumbII" valueType="enumerated" />
+ <option id="fr.ac6.managedbuild.option.gnu.cross.fpu.860021008" name="Floating point hardware" superClass="fr.ac6.managedbuild.option.gnu.cross.fpu" value="fr.ac6.managedbuild.option.gnu.cross.fpu.fpv4-sp-d16" valueType="enumerated" />
+ <option id="fr.ac6.managedbuild.option.gnu.cross.floatabi.1215900952" name="Floating-point ABI" superClass="fr.ac6.managedbuild.option.gnu.cross.floatabi" value="fr.ac6.managedbuild.option.gnu.cross.floatabi.hard" valueType="enumerated" />
+ <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="fr.ac6.managedbuild.targetPlatform.gnu.cross.806304321" isAbstract="false" osList="all" superClass="fr.ac6.managedbuild.targetPlatform.gnu.cross" />
+ <builder buildPath="${workspace_loc:/ble_multi_app_at}/Release" id="fr.ac6.managedbuild.builder.gnu.cross.1487861510" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="fr.ac6.managedbuild.builder.gnu.cross">
+ <outputEntries>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="Release" />
+ </outputEntries>
+ </builder>
+
+ <tool id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.1504589846" name="MCU GCC Compiler" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler">
+ <option defaultValue="gnu.c.optimization.level.none" id="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level.660496895" name="Optimization Level" superClass="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="fr.ac6.managedbuild.gnu.c.optimization.level.size" valueType="enumerated" />
+ <option id="gnu.c.compiler.option.debugging.level.848830022" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated" />
+ <option id="gnu.c.compiler.option.include.paths.1597026139" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath"><listOptionValue builtIn="false" value="../../../Core/Inc" /><listOptionValue builtIn="false" value="../../../STM32_WPAN/App" /><listOptionValue builtIn="false" value="../../../../../../../../Drivers/STM32WBxx_HAL_Driver/Inc" /><listOptionValue builtIn="false" value="../../../../../../../../Drivers/STM32WBxx_HAL_Driver/Inc/Legacy" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/utilities" /><listOptionValue builtIn="false" value="../../../../../../../../Utilities/lpm/tiny_lpm" /><listOptionValue builtIn="false" value="../../../../../../../../Utilities/sequencer" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble/core/template" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble/core" /><listOptionValue builtIn="false" value="../../../../../../../../Drivers/CMSIS/Device/ST/STM32WBxx/Include" /><listOptionValue builtIn="false" value="../../../../../../../../Drivers/CMSIS/Include" /><listOptionValue builtIn="false" value="../../../../../../../../Drivers/BSP/P-NUCLEO-WB55.Nucleo" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/lhci" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble/svc/Src" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble/svc/Inc" /></option>
+ <option id="gnu.c.compiler.option.preprocessor.def.symbols.1460212809" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols"><listOptionValue builtIn="false" value="USE_STM32WBXX_NUCLEO" /><listOptionValue builtIn="false" value="USE_HAL_DRIVER" /><listOptionValue builtIn="false" value="STM32WB55xx" /></option>
+ <option id="fr.ac6.managedbuild.gnu.c.compiler.option.misc.other.1125107205" superClass="fr.ac6.managedbuild.gnu.c.compiler.option.misc.other" value="-fmessage-length=0" valueType="string" />
+ <inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c.962158481" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c" />
+ <inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.s.1606612068" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.s" />
+ </tool>
+ <tool id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.858114747" name="MCU G++ Compiler" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler">
+ <option defaultValue="gnu.cpp.optimization.level.none" id="fr.ac6.managedbuild.gnu.cpp.compiler.option.optimization.level.199295621" name="Optimization Level" superClass="fr.ac6.managedbuild.gnu.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="fr.ac6.managedbuild.gnu.cpp.optimization.level.size" valueType="enumerated" />
+ <option id="gnu.cpp.compiler.option.debugging.level.1913057085" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.debugging.level.max" valueType="enumerated" />
+ <option id="gnu.cpp.compiler.option.include.paths.1219134927" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath"><listOptionValue builtIn="false" value="../../../Core/Inc" /><listOptionValue builtIn="false" value="../../../STM32_WPAN/App" /><listOptionValue builtIn="false" value="../../../../../../../../Drivers/STM32WBxx_HAL_Driver/Inc" /><listOptionValue builtIn="false" value="../../../../../../../../Drivers/STM32WBxx_HAL_Driver/Inc/Legacy" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/utilities" /><listOptionValue builtIn="false" value="../../../../../../../../Utilities/lpm/tiny_lpm" /><listOptionValue builtIn="false" value="../../../../../../../../Utilities/sequencer" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble/core/template" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble/core" /><listOptionValue builtIn="false" value="../../../../../../../../Drivers/CMSIS/Device/ST/STM32WBxx/Include" /><listOptionValue builtIn="false" value="../../../../../../../../Drivers/CMSIS/Include" /><listOptionValue builtIn="false" value="../../../../../../../../Drivers/BSP/P-NUCLEO-WB55.Nucleo" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/lhci" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble/svc/Src" /><listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble/svc/Inc" /></option>
+ <option id="gnu.cpp.compiler.option.preprocessor.def.symbols.1284475127" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols"><listOptionValue builtIn="false" value="USE_STM32WBXX_NUCLEO" /><listOptionValue builtIn="false" value="USE_HAL_DRIVER" /><listOptionValue builtIn="false" value="STM32WB55xx" /></option>
+ <option id="fr.ac6.managedbuild.gnu.cpp.compiler.option.misc.other.1016831914" superClass="fr.ac6.managedbuild.gnu.cpp.compiler.option.misc.other" value="-fmessage-length=0" valueType="string" />
+ <inputType id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.cpp.1219279242" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.cpp" />
+ <inputType id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.s.1370884803" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.s" />
+ </tool>
+ <tool id="fr.ac6.managedbuild.tool.gnu.cross.c.linker.1076671478" name="MCU GCC Linker" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.linker">
+ <option id="fr.ac6.managedbuild.tool.gnu.cross.c.linker.script.1573864803" name="Linker Script (-T)" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.linker.script" value="../stm32wb55xx_flash_cm4.ld" valueType="string" />
+ <option id="gnu.c.link.option.libs.1600860379" name="Libraries (-l)" superClass="gnu.c.link.option.libs" valueType="libs" />
+ <option id="gnu.c.link.option.paths.1280243558" name="Library search path (-L)" superClass="gnu.c.link.option.paths" valueType="libPaths" />
+ <option id="gnu.c.link.option.ldflags.219916395" superClass="gnu.c.link.option.ldflags" value="-specs=nosys.specs -specs=nano.specs" valueType="string" />
+ <option id="gnu.c.link.option.other.1141008382" name="Other options (-Xlinker [option])" superClass="gnu.c.link.option.other" useByScannerDiscovery="false" valueType="stringList" />
+ <inputType id="cdt.managedbuild.tool.gnu.c.linker.input.600290977" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
+ <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)" />
+ <additionalInput kind="additionalinput" paths="$(LIBS)" />
+ </inputType>
+ </tool>
+ <tool id="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.1200213178" name="MCU G++ Linker" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker">
+ <option id="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.script.1927909423" name="Linker Script (-T)" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.script" value="../stm32wb55xx_flash_cm4.ld" valueType="string" />
+ <option id="gnu.cpp.link.option.libs.1767931887" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs" />
+ <option id="gnu.cpp.link.option.paths.1150241898" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths" />
+ <option id="gnu.cpp.link.option.ldflags.746920153" superClass="gnu.cpp.link.option.ldflags" value="-specs=nosys.specs -specs=nano.specs" valueType="string" />
+ <option id="gnu.cpp.link.option.other.1449383098" name="Other options (-Xlinker [option])" superClass="gnu.cpp.link.option.other" useByScannerDiscovery="false" valueType="stringList" />
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1270652376" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+ <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)" />
+ <additionalInput kind="additionalinput" paths="$(LIBS)" />
+ </inputType>
+ </tool>
+ <tool id="fr.ac6.managedbuild.tool.gnu.archiver.2122235672" name="MCU GCC Archiver" superClass="fr.ac6.managedbuild.tool.gnu.archiver" />
+ <tool id="fr.ac6.managedbuild.tool.gnu.cross.assembler.exe.release.537913474" name="MCU GCC Assembler" superClass="fr.ac6.managedbuild.tool.gnu.cross.assembler.exe.release">
+ <option id="gnu.both.asm.option.include.paths.1704168204" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
+
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.assembler.input.409578849" superClass="cdt.managedbuild.tool.gnu.assembler.input" />
+ <inputType id="fr.ac6.managedbuild.tool.gnu.cross.assembler.input.151878919" superClass="fr.ac6.managedbuild.tool.gnu.cross.assembler.input" />
+ </tool>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry excluding="" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="" />
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings" />
+ </cconfiguration>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <project id="ble_multi_app_at.fr.ac6.managedbuild.target.gnu.cross.exe.61749870" name="Executable" projectType="fr.ac6.managedbuild.target.gnu.cross.exe" />
+ </storageModule>
+ <storageModule moduleId="scannerConfiguration">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="" />
+ <scannerConfigBuildInfo instanceId="fr.ac6.managedbuild.config.gnu.cross.exe.debug.186557892;fr.ac6.managedbuild.config.gnu.cross.exe.debug.186557892.;fr.ac6.managedbuild.tool.gnu.cross.c.compiler.1504589846;fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c.962158481">
+ <autodiscovery enabled="false" problemReportingEnabled="true" selectedProfileId="" />
+ </scannerConfigBuildInfo>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders" />
+ <storageModule moduleId="refreshScope" versionNumber="2">
+ <configuration artifactName="${ProjName}" configurationName="Debug">
+ <resource resourceType="PROJECT" workspacePath="ble_multi_app_at" />
+ </configuration>
+ </storageModule>
+</cproject>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/SW4STM32/BLE_MultiAppAt/.project b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/SW4STM32/BLE_MultiAppAt/.project
new file mode 100644
index 000000000..eba96994d
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/SW4STM32/BLE_MultiAppAt/.project
@@ -0,0 +1,349 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>ble_multi_app_at</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+ <triggers>clean,full,incremental,</triggers>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+ <triggers>full,incremental,</triggers>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+ <nature>fr.ac6.mcu.ide.core.MCUProjectNature</nature>
+ </natures>
+ <linkedResources>
+ <link>
+ <name>Doc/readme.txt</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/readme.txt</locationURI>
+ </link>
+ <link>
+ <name>Utilities/stm32_lpm.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Utilities/lpm/tiny_lpm/stm32_lpm.c</locationURI>
+ </link>
+ <link>
+ <name>Utilities/stm32_seq.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Utilities/sequencer/stm32_seq.c</locationURI>
+ </link>
+ <link>
+ <name>Application/SW4STM32/startup_stm32wb55xx_cm4.s</name>
+ <type>1</type>
+ <locationURI>PARENT-1-PROJECT_LOC/startup_stm32wb55xx_cm4.s</locationURI>
+ </link>
+ <link>
+ <name>Application/SW4STM32/syscalls.c</name>
+ <type>1</type>
+ <locationURI>PARENT-1-PROJECT_LOC/syscalls.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/CMSIS/system_stm32wbxx.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/Core/Src/system_stm32wbxx.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_cortex.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_cortex.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_dma.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_dma.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_dma_ex.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_dma_ex.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_flash.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_flash.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_flash_ex.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_flash_ex.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_gpio.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_gpio.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_hsem.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_hsem.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_ipcc.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_ipcc.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_pwr.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pwr.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_pwr_ex.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pwr_ex.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_rcc.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rcc.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_rcc_ex.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rcc_ex.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_rtc.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rtc.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_rtc_ex.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rtc_ex.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_tim.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_tim.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_tim_ex.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_tim_ex.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_uart.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_uart.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_uart_ex.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_uart_ex.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/ble_gap_aci.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_gap_aci.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/ble_gatt_aci.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_gatt_aci.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/ble_hal_aci.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_hal_aci.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/ble_hci_le.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_hci_le.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/ble_l2cap_aci.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_l2cap_aci.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/dbg_trace.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/utilities/dbg_trace.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/dis.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/svc/Src/dis.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/hci_tl.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/hci_tl.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/hci_tl_if.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/hci_tl_if.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/hrs.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/svc/Src/hrs.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/lhci.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/lhci/lhci.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/osal.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/core/template/osal.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/otp.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/utilities/otp.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/p2p_stm.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/svc/Src/p2p_stm.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/shci.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci/shci.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/shci_tl.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/shci_tl.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/shci_tl_if.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/shci_tl_if.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/stm_list.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/utilities/stm_list.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/stm_queue.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/utilities/stm_queue.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/svc_ctl.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/svc/Src/svc_ctl.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/tl_mbox.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_mbox.c</locationURI>
+ </link>
+ <link>
+ <name>Application/User/Core/app_entry.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/Core/Src/app_entry.c</locationURI>
+ </link>
+ <link>
+ <name>Application/User/Core/hw_timerserver.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/Core/Src/hw_timerserver.c</locationURI>
+ </link>
+ <link>
+ <name>Application/User/Core/hw_uart.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/Core/Src/hw_uart.c</locationURI>
+ </link>
+ <link>
+ <name>Application/User/Core/main.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/Core/Src/main.c</locationURI>
+ </link>
+ <link>
+ <name>Application/User/Core/stm32_lpm_if.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/Core/Src/stm32_lpm_if.c</locationURI>
+ </link>
+ <link>
+ <name>Application/User/Core/stm32wbxx_hal_msp.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/Core/Src/stm32wbxx_hal_msp.c</locationURI>
+ </link>
+ <link>
+ <name>Application/User/Core/stm32wbxx_it.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/Core/Src/stm32wbxx_it.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/BSP/P-NUCLEO-WB55.Nucleo/stm32wbxx_nucleo.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/BSP/P-NUCLEO-WB55.Nucleo/stm32wbxx_nucleo.c</locationURI>
+ </link>
+ <link>
+ <name>Application/User/STM32_WPAN/App/app_ble_cl.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/STM32_WPAN/App/app_ble_cl.c</locationURI>
+ </link>
+ <link>
+ <name>Application/User/STM32_WPAN/App/app_ble_common.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/STM32_WPAN/App/app_ble_common.c</locationURI>
+ </link>
+ <link>
+ <name>Application/User/STM32_WPAN/App/app_ble_hr.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/STM32_WPAN/App/app_ble_hr.c</locationURI>
+ </link>
+ <link>
+ <name>Application/User/STM32_WPAN/App/app_ble_sv.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/STM32_WPAN/App/app_ble_sv.c</locationURI>
+ </link>
+ <link>
+ <name>Application/User/STM32_WPAN/App/dis_app.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/STM32_WPAN/App/dis_app.c</locationURI>
+ </link>
+ <link>
+ <name>Application/User/STM32_WPAN/App/hrs_app.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/STM32_WPAN/App/hrs_app.c</locationURI>
+ </link>
+ <link>
+ <name>Application/User/STM32_WPAN/App/p2p_client_app.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/STM32_WPAN/App/p2p_client_app.c</locationURI>
+ </link>
+ <link>
+ <name>Application/User/STM32_WPAN/App/p2p_server_app.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/STM32_WPAN/App/p2p_server_app.c</locationURI>
+ </link>
+ <link>
+ <name>Application/User/STM32_WPAN/App/uart_app.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/STM32_WPAN/App/uart_app.c</locationURI>
+ </link>
+ <link>
+ <name>Application/User/STM32_WPAN/Target/hw_ipcc.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/STM32_WPAN/Target/hw_ipcc.c</locationURI>
+ </link>
+ </linkedResources>
+</projectDescription>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/SW4STM32/BLE_MultiAppAt/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/SW4STM32/BLE_MultiAppAt/stm32wb55xx_flash_cm4.ld
new file mode 100644
index 000000000..303201bd2
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/SW4STM32/BLE_MultiAppAt/stm32wb55xx_flash_cm4.ld
@@ -0,0 +1,187 @@
+/**
+*****************************************************************************
+**
+** File : stm32wb55xx_flash_cm4.ld
+**
+** Abstract : System Workbench Minimal System calls file
+**
+** For more information about which c-functions
+** need which of these lowlevel functions
+** please consult the Newlib libc-manual
+**
+** Environment : System Workbench for MCU
+**
+** Distribution: The file is distributed “as is,” without any warranty
+** of any kind.
+**
+*****************************************************************************
+**
+** <h2><center>&copy; COPYRIGHT(c) 2019 Ac6</center></h2>
+**
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+** 1. Redistributions of source code must retain the above copyright notice,
+** this list of conditions and the following disclaimer.
+** 2. Redistributions in binary form must reproduce the above copyright notice,
+** this list of conditions and the following disclaimer in the documentation
+** and/or other materials provided with the distribution.
+** 3. Neither the name of Ac6 nor the names of its contributors
+** may be used to endorse or promote products derived from this software
+** without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+*****************************************************************************
+*/
+
+/* Entry Point */
+ENTRY(Reset_Handler)
+
+/* Highest address of the user mode stack */
+_estack = 0x20030000; /* end of RAM */
+/* Generate a link error if heap and stack don't fit into RAM */
+_Min_Heap_Size = 0x400; /* required amount of heap */
+_Min_Stack_Size = 0x1000; /* required amount of stack */
+
+/* Specify the memory areas */
+MEMORY
+{
+FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K
+RAM1 (xrw) : ORIGIN = 0x20000004, LENGTH = 191K
+RAM_SHARED (xrw) : ORIGIN = 0x20030000, LENGTH = 10K
+}
+
+/* Define output sections */
+SECTIONS
+{
+ /* The startup code goes first into FLASH */
+ .isr_vector :
+ {
+ . = ALIGN(4);
+ KEEP(*(.isr_vector)) /* Startup code */
+ . = ALIGN(4);
+ } >FLASH
+
+ /* The program code and other data goes into FLASH */
+ .text :
+ {
+ . = ALIGN(4);
+ *(.text) /* .text sections (code) */
+ *(.text*) /* .text* sections (code) */
+ *(.glue_7) /* glue arm to thumb code */
+ *(.glue_7t) /* glue thumb to arm code */
+ *(.eh_frame)
+
+ KEEP (*(.init))
+ KEEP (*(.fini))
+
+ . = ALIGN(4);
+ _etext = .; /* define a global symbols at end of code */
+ } >FLASH
+
+ /* Constant data goes into FLASH */
+ .rodata :
+ {
+ . = ALIGN(4);
+ *(.rodata) /* .rodata sections (constants, strings, etc.) */
+ *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
+ . = ALIGN(4);
+ } >FLASH
+
+ .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
+ .ARM : {
+ __exidx_start = .;
+ *(.ARM.exidx*)
+ __exidx_end = .;
+ } >FLASH
+
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array*))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ } >FLASH
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array*))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ } >FLASH
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(SORT(.fini_array.*)))
+ KEEP (*(.fini_array*))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ } >FLASH
+
+ /* used by the startup to initialize data */
+ _sidata = LOADADDR(.data);
+
+ /* Initialized data sections goes into RAM, load LMA copy after code */
+ .data :
+ {
+ . = ALIGN(4);
+ _sdata = .; /* create a global symbol at data start */
+ *(.data) /* .data sections */
+ *(.data*) /* .data* sections */
+
+ . = ALIGN(4);
+ _edata = .; /* define a global symbol at data end */
+ } >RAM1 AT> FLASH
+
+
+ /* Uninitialized data section */
+ . = ALIGN(4);
+ .bss :
+ {
+ /* This is used by the startup in order to initialize the .bss secion */
+ _sbss = .; /* define a global symbol at bss start */
+ __bss_start__ = _sbss;
+ *(.bss)
+ *(.bss*)
+ *(COMMON)
+
+ . = ALIGN(4);
+ _ebss = .; /* define a global symbol at bss end */
+ __bss_end__ = _ebss;
+ } >RAM1
+
+ /* User_heap_stack section, used to check that there is enough RAM left */
+ ._user_heap_stack :
+ {
+ . = ALIGN(8);
+ PROVIDE ( end = . );
+ PROVIDE ( _end = . );
+ . = . + _Min_Heap_Size;
+ . = . + _Min_Stack_Size;
+ . = ALIGN(8);
+ } >RAM1
+
+
+
+ /* Remove information from the standard libraries */
+ /DISCARD/ :
+ {
+ libc.a ( * )
+ libm.a ( * )
+ libgcc.a ( * )
+ }
+
+ .ARM.attributes 0 : { *(.ARM.attributes) }
+ MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
+ MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
+ MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+}
+
+
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/SW4STM32/startup_stm32wb55xx_cm4.s
new file mode 100644
index 000000000..023c1b016
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -0,0 +1,427 @@
+/**
+ ******************************************************************************
+ * @file startup_stm32wb55xx_cm4.s
+ * @author MCD Application Team
+ * @brief STM32WB55xx devices vector table GCC toolchain.
+ * This module performs:
+ * - Set the initial SP
+ * - Set the initial PC == Reset_Handler,
+ * - Set the vector table entries with the exceptions ISR address
+ * - Branches to main in the C library (which eventually
+ * calls main()).
+ * After Reset the Cortex-M4 processor is in Thread mode,
+ * priority is Privileged, and the Stack is set to Main.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+
+ .syntax unified
+ .cpu cortex-m4
+ .fpu softvfp
+ .thumb
+
+.global g_pfnVectors
+.global Default_Handler
+
+/* start address for the initialization values of the .data section.
+defined in linker script */
+.word _sidata
+/* start address for the .data section. defined in linker script */
+.word _sdata
+/* end address for the .data section. defined in linker script */
+.word _edata
+/* start address for the .bss section. defined in linker script */
+.word _sbss
+/* end address for the .bss section. defined in linker script */
+.word _ebss
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ ldr r0, =_sdata
+ ldr r1, =_edata
+ ldr r2, =_sidata
+ movs r3, #0
+ b LoopCopyDataInit
+
+CopyDataInit:
+ ldr r4, [r2, r3]
+ str r4, [r0, r3]
+ adds r3, r3, #4
+
+LoopCopyDataInit:
+ adds r4, r0, r3
+ cmp r4, r1
+ bcc CopyDataInit
+
+/* Zero fill the bss segment. */
+ ldr r2, =_sbss
+ ldr r4, =_ebss
+ movs r3, #0
+ b LoopFillZerobss
+
+FillZerobss:
+ str r3, [r2]
+ adds r2, r2, #4
+
+LoopFillZerobss:
+ cmp r2, r4
+ bcc FillZerobss
+
+/* Call the clock system intitialization function.*/
+ bl SystemInit
+/* Call static constructors */
+ bl __libc_init_array
+/* Call the application s entry point.*/
+ bl main
+
+LoopForever:
+ b LoopForever
+
+.size Reset_Handler, .-Reset_Handler
+
+/**
+ * @brief This is the code that gets called when the processor receives an
+ * unexpected interrupt. This simply enters an infinite loop, preserving
+ * the system state for examination by a debugger.
+ *
+ * @param None
+ * @retval None
+*/
+ .section .text.Default_Handler,"ax",%progbits
+Default_Handler:
+Infinite_Loop:
+ b Infinite_Loop
+ .size Default_Handler, .-Default_Handler
+/******************************************************************************
+*
+* The minimal vector table for a Cortex-M4. Note that the proper constructs
+* must be placed on this to ensure that it ends up at physical address
+* 0x0000.0000.
+*
+******************************************************************************/
+ .section .isr_vector,"a",%progbits
+ .type g_pfnVectors, %object
+ .size g_pfnVectors, .-g_pfnVectors
+
+
+g_pfnVectors:
+ .word _estack
+ .word Reset_Handler
+ .word NMI_Handler
+ .word HardFault_Handler
+ .word MemManage_Handler
+ .word BusFault_Handler
+ .word UsageFault_Handler
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word SVC_Handler
+ .word DebugMon_Handler
+ .word 0
+ .word PendSV_Handler
+ .word SysTick_Handler
+ .word WWDG_IRQHandler
+ .word PVD_PVM_IRQHandler
+ .word TAMP_STAMP_LSECSS_IRQHandler
+ .word RTC_WKUP_IRQHandler
+ .word FLASH_IRQHandler
+ .word RCC_IRQHandler
+ .word EXTI0_IRQHandler
+ .word EXTI1_IRQHandler
+ .word EXTI2_IRQHandler
+ .word EXTI3_IRQHandler
+ .word EXTI4_IRQHandler
+ .word DMA1_Channel1_IRQHandler
+ .word DMA1_Channel2_IRQHandler
+ .word DMA1_Channel3_IRQHandler
+ .word DMA1_Channel4_IRQHandler
+ .word DMA1_Channel5_IRQHandler
+ .word DMA1_Channel6_IRQHandler
+ .word DMA1_Channel7_IRQHandler
+ .word ADC1_IRQHandler
+ .word USB_HP_IRQHandler
+ .word USB_LP_IRQHandler
+ .word C2SEV_PWR_C2H_IRQHandler
+ .word COMP_IRQHandler
+ .word EXTI9_5_IRQHandler
+ .word TIM1_BRK_IRQHandler
+ .word TIM1_UP_TIM16_IRQHandler
+ .word TIM1_TRG_COM_TIM17_IRQHandler
+ .word TIM1_CC_IRQHandler
+ .word TIM2_IRQHandler
+ .word PKA_IRQHandler
+ .word I2C1_EV_IRQHandler
+ .word I2C1_ER_IRQHandler
+ .word I2C3_EV_IRQHandler
+ .word I2C3_ER_IRQHandler
+ .word SPI1_IRQHandler
+ .word SPI2_IRQHandler
+ .word USART1_IRQHandler
+ .word LPUART1_IRQHandler
+ .word SAI1_IRQHandler
+ .word TSC_IRQHandler
+ .word EXTI15_10_IRQHandler
+ .word RTC_Alarm_IRQHandler
+ .word CRS_IRQHandler
+ .word PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler
+ .word IPCC_C1_RX_IRQHandler
+ .word IPCC_C1_TX_IRQHandler
+ .word HSEM_IRQHandler
+ .word LPTIM1_IRQHandler
+ .word LPTIM2_IRQHandler
+ .word LCD_IRQHandler
+ .word QUADSPI_IRQHandler
+ .word AES1_IRQHandler
+ .word AES2_IRQHandler
+ .word RNG_IRQHandler
+ .word FPU_IRQHandler
+ .word DMA2_Channel1_IRQHandler
+ .word DMA2_Channel2_IRQHandler
+ .word DMA2_Channel3_IRQHandler
+ .word DMA2_Channel4_IRQHandler
+ .word DMA2_Channel5_IRQHandler
+ .word DMA2_Channel6_IRQHandler
+ .word DMA2_Channel7_IRQHandler
+ .word DMAMUX1_OVR_IRQHandler
+
+/*******************************************************************************
+*
+* Provide weak aliases for each Exception handler to the Default_Handler.
+* As they are weak aliases, any function with the same name will override
+* this definition.
+*
+*******************************************************************************/
+ .weak NMI_Handler
+ .thumb_set NMI_Handler,Default_Handler
+
+ .weak HardFault_Handler
+ .thumb_set HardFault_Handler,Default_Handler
+
+ .weak MemManage_Handler
+ .thumb_set MemManage_Handler,Default_Handler
+
+ .weak BusFault_Handler
+ .thumb_set BusFault_Handler,Default_Handler
+
+ .weak UsageFault_Handler
+ .thumb_set UsageFault_Handler,Default_Handler
+
+ .weak SVC_Handler
+ .thumb_set SVC_Handler,Default_Handler
+
+ .weak DebugMon_Handler
+ .thumb_set DebugMon_Handler,Default_Handler
+
+ .weak PendSV_Handler
+ .thumb_set PendSV_Handler,Default_Handler
+
+ .weak SysTick_Handler
+ .thumb_set SysTick_Handler,Default_Handler
+
+ .weak WWDG_IRQHandler
+ .thumb_set WWDG_IRQHandler,Default_Handler
+
+ .weak PVD_PVM_IRQHandler
+ .thumb_set PVD_PVM_IRQHandler,Default_Handler
+
+ .weak TAMP_STAMP_LSECSS_IRQHandler
+ .thumb_set TAMP_STAMP_LSECSS_IRQHandler,Default_Handler
+
+ .weak RTC_WKUP_IRQHandler
+ .thumb_set RTC_WKUP_IRQHandler,Default_Handler
+
+ .weak FLASH_IRQHandler
+ .thumb_set FLASH_IRQHandler,Default_Handler
+
+ .weak RCC_IRQHandler
+ .thumb_set RCC_IRQHandler,Default_Handler
+
+ .weak EXTI0_IRQHandler
+ .thumb_set EXTI0_IRQHandler,Default_Handler
+
+ .weak EXTI1_IRQHandler
+ .thumb_set EXTI1_IRQHandler,Default_Handler
+
+ .weak EXTI2_IRQHandler
+ .thumb_set EXTI2_IRQHandler,Default_Handler
+
+ .weak EXTI3_IRQHandler
+ .thumb_set EXTI3_IRQHandler,Default_Handler
+
+ .weak EXTI4_IRQHandler
+ .thumb_set EXTI4_IRQHandler,Default_Handler
+
+ .weak DMA1_Channel1_IRQHandler
+ .thumb_set DMA1_Channel1_IRQHandler,Default_Handler
+
+ .weak DMA1_Channel2_IRQHandler
+ .thumb_set DMA1_Channel2_IRQHandler,Default_Handler
+
+ .weak DMA1_Channel3_IRQHandler
+ .thumb_set DMA1_Channel3_IRQHandler,Default_Handler
+
+ .weak DMA1_Channel4_IRQHandler
+ .thumb_set DMA1_Channel4_IRQHandler,Default_Handler
+
+ .weak DMA1_Channel5_IRQHandler
+ .thumb_set DMA1_Channel5_IRQHandler,Default_Handler
+
+ .weak DMA1_Channel6_IRQHandler
+ .thumb_set DMA1_Channel6_IRQHandler,Default_Handler
+
+ .weak DMA1_Channel7_IRQHandler
+ .thumb_set DMA1_Channel7_IRQHandler,Default_Handler
+
+ .weak ADC1_IRQHandler
+ .thumb_set ADC1_IRQHandler,Default_Handler
+
+ .weak USB_HP_IRQHandler
+ .thumb_set USB_HP_IRQHandler,Default_Handler
+
+ .weak USB_LP_IRQHandler
+ .thumb_set USB_LP_IRQHandler,Default_Handler
+
+ .weak C2SEV_PWR_C2H_IRQHandler
+ .thumb_set C2SEV_PWR_C2H_IRQHandler,Default_Handler
+
+ .weak COMP_IRQHandler
+ .thumb_set COMP_IRQHandler,Default_Handler
+
+ .weak EXTI9_5_IRQHandler
+ .thumb_set EXTI9_5_IRQHandler,Default_Handler
+
+ .weak TIM1_BRK_IRQHandler
+ .thumb_set TIM1_BRK_IRQHandler,Default_Handler
+
+ .weak TIM1_UP_TIM16_IRQHandler
+ .thumb_set TIM1_UP_TIM16_IRQHandler,Default_Handler
+
+ .weak TIM1_TRG_COM_TIM17_IRQHandler
+ .thumb_set TIM1_TRG_COM_TIM17_IRQHandler,Default_Handler
+
+ .weak TIM1_CC_IRQHandler
+ .thumb_set TIM1_CC_IRQHandler,Default_Handler
+
+ .weak TIM2_IRQHandler
+ .thumb_set TIM2_IRQHandler,Default_Handler
+
+ .weak PKA_IRQHandler
+ .thumb_set PKA_IRQHandler,Default_Handler
+
+ .weak I2C1_EV_IRQHandler
+ .thumb_set I2C1_EV_IRQHandler,Default_Handler
+
+ .weak I2C1_ER_IRQHandler
+ .thumb_set I2C1_ER_IRQHandler,Default_Handler
+
+ .weak I2C3_EV_IRQHandler
+ .thumb_set I2C3_EV_IRQHandler,Default_Handler
+
+ .weak I2C3_ER_IRQHandler
+ .thumb_set I2C3_ER_IRQHandler,Default_Handler
+
+ .weak SPI1_IRQHandler
+ .thumb_set SPI1_IRQHandler,Default_Handler
+
+ .weak SPI2_IRQHandler
+ .thumb_set SPI2_IRQHandler,Default_Handler
+
+ .weak USART1_IRQHandler
+ .thumb_set USART1_IRQHandler,Default_Handler
+
+ .weak LPUART1_IRQHandler
+ .thumb_set LPUART1_IRQHandler,Default_Handler
+
+ .weak SAI1_IRQHandler
+ .thumb_set SAI1_IRQHandler,Default_Handler
+
+ .weak TSC_IRQHandler
+ .thumb_set TSC_IRQHandler,Default_Handler
+
+ .weak EXTI15_10_IRQHandler
+ .thumb_set EXTI15_10_IRQHandler,Default_Handler
+
+ .weak RTC_Alarm_IRQHandler
+ .thumb_set RTC_Alarm_IRQHandler,Default_Handler
+
+ .weak CRS_IRQHandler
+ .thumb_set CRS_IRQHandler,Default_Handler
+
+ .weak PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler
+ .thumb_set PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler,Default_Handler
+
+ .weak IPCC_C1_RX_IRQHandler
+ .thumb_set IPCC_C1_RX_IRQHandler,Default_Handler
+
+ .weak IPCC_C1_TX_IRQHandler
+ .thumb_set IPCC_C1_TX_IRQHandler,Default_Handler
+
+ .weak HSEM_IRQHandler
+ .thumb_set HSEM_IRQHandler,Default_Handler
+
+ .weak LPTIM1_IRQHandler
+ .thumb_set LPTIM1_IRQHandler,Default_Handler
+
+ .weak LPTIM2_IRQHandler
+ .thumb_set LPTIM2_IRQHandler,Default_Handler
+
+ .weak LCD_IRQHandler
+ .thumb_set LCD_IRQHandler,Default_Handler
+
+ .weak QUADSPI_IRQHandler
+ .thumb_set QUADSPI_IRQHandler,Default_Handler
+
+ .weak AES1_IRQHandler
+ .thumb_set AES1_IRQHandler,Default_Handler
+
+ .weak AES2_IRQHandler
+ .thumb_set AES2_IRQHandler,Default_Handler
+
+ .weak RNG_IRQHandler
+ .thumb_set RNG_IRQHandler,Default_Handler
+
+ .weak FPU_IRQHandler
+ .thumb_set FPU_IRQHandler,Default_Handler
+
+ .weak DMA2_Channel1_IRQHandler
+ .thumb_set DMA2_Channel1_IRQHandler,Default_Handler
+
+ .weak DMA2_Channel2_IRQHandler
+ .thumb_set DMA2_Channel2_IRQHandler,Default_Handler
+
+ .weak DMA2_Channel3_IRQHandler
+ .thumb_set DMA2_Channel3_IRQHandler,Default_Handler
+
+ .weak DMA2_Channel4_IRQHandler
+ .thumb_set DMA2_Channel4_IRQHandler,Default_Handler
+
+ .weak DMA2_Channel5_IRQHandler
+ .thumb_set DMA2_Channel5_IRQHandler,Default_Handler
+
+ .weak DMA2_Channel6_IRQHandler
+ .thumb_set DMA2_Channel6_IRQHandler,Default_Handler
+
+ .weak DMA2_Channel7_IRQHandler
+ .thumb_set DMA2_Channel7_IRQHandler,Default_Handler
+
+ .weak DMAMUX1_OVR_IRQHandler
+ .thumb_set DMAMUX1_OVR_IRQHandler,Default_Handler
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/SW4STM32/syscalls.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/SW4STM32/syscalls.c
new file mode 100644
index 000000000..e266506b6
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/SW4STM32/syscalls.c
@@ -0,0 +1,204 @@
+/**
+*****************************************************************************
+**
+** File : syscalls.c
+**
+** Abstract : System Workbench Minimal System calls file
+**
+** For more information about which c-functions
+** need which of these lowlevel functions
+** please consult the Newlib libc-manual
+**
+** Environment : System Workbench for MCU
+**
+** Distribution: The file is distributed as is, without any warranty
+** of any kind.
+**
+*****************************************************************************
+**
+** <h2><center>&copy; COPYRIGHT(c) 2019 Ac6</center></h2>
+**
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+** 1. Redistributions of source code must retain the above copyright notice,
+** this list of conditions and the following disclaimer.
+** 2. Redistributions in binary form must reproduce the above copyright notice,
+** this list of conditions and the following disclaimer in the documentation
+** and/or other materials provided with the distribution.
+** 3. Neither the name of Ac6 nor the names of its contributors
+** may be used to endorse or promote products derived from this software
+** without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+*****************************************************************************
+*/
+
+/* Includes */
+#include <sys/stat.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <stdio.h>
+#include <signal.h>
+#include <time.h>
+#include <sys/time.h>
+#include <sys/times.h>
+
+
+/* Variables */
+//#undef errno
+extern int errno;
+extern int __io_putchar(int ch) __attribute__((weak));
+extern int __io_getchar(void) __attribute__((weak));
+
+register char * stack_ptr asm("sp");
+
+char *__env[1] = { 0 };
+char **environ = __env;
+
+
+/* Functions */
+void initialise_monitor_handles()
+{
+}
+
+int _getpid(void)
+{
+ return 1;
+}
+
+int _kill(int pid, int sig)
+{
+ errno = EINVAL;
+ return -1;
+}
+
+void _exit (int status)
+{
+ _kill(status, -1);
+ while (1) {} /* Make sure we hang here */
+}
+
+__attribute__((weak)) int _read(int file, char *ptr, int len)
+{
+ int DataIdx;
+
+ for (DataIdx = 0; DataIdx < len; DataIdx++)
+ {
+ *ptr++ = __io_getchar();
+ }
+
+return len;
+}
+
+__attribute__((weak)) int _write(int file, char *ptr, int len)
+{
+ int DataIdx;
+
+ for (DataIdx = 0; DataIdx < len; DataIdx++)
+ {
+ __io_putchar(*ptr++);
+ }
+ return len;
+}
+
+caddr_t _sbrk(int incr)
+{
+ extern char end asm("end");
+ static char *heap_end;
+ char *prev_heap_end;
+
+ if (heap_end == 0)
+ heap_end = &end;
+
+ prev_heap_end = heap_end;
+ if (heap_end + incr > stack_ptr)
+ {
+// write(1, "Heap and stack collision\n", 25);
+// abort();
+ errno = ENOMEM;
+ return (caddr_t) -1;
+ }
+
+ heap_end += incr;
+
+ return (caddr_t) prev_heap_end;
+}
+
+int _close(int file)
+{
+ return -1;
+}
+
+
+int _fstat(int file, struct stat *st)
+{
+ st->st_mode = S_IFCHR;
+ return 0;
+}
+
+int _isatty(int file)
+{
+ return 1;
+}
+
+int _lseek(int file, int ptr, int dir)
+{
+ return 0;
+}
+
+int _open(char *path, int flags, ...)
+{
+ /* Pretend like we always fail */
+ return -1;
+}
+
+int _wait(int *status)
+{
+ errno = ECHILD;
+ return -1;
+}
+
+int _unlink(char *name)
+{
+ errno = ENOENT;
+ return -1;
+}
+
+int _times(struct tms *buf)
+{
+ return -1;
+}
+
+int _stat(char *file, struct stat *st)
+{
+ st->st_mode = S_IFCHR;
+ return 0;
+}
+
+int _link(char *old, char *new)
+{
+ errno = EMLINK;
+ return -1;
+}
+
+int _fork(void)
+{
+ errno = EAGAIN;
+ return -1;
+}
+
+int _execve(char *name, char **argv, char **env)
+{
+ errno = ENOMEM;
+ return -1;
+}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/readme.txt b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/readme.txt
new file mode 100644
index 000000000..b7d8fc32e
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MultiAppAt/readme.txt
@@ -0,0 +1,138 @@
+/**
+ @page ble_multi_app_at Application
+
+ @verbatim
+ ******************************************************************************
+ * @file BLE/ble_multi_app_at/readme.txt
+ * @author MCD Application Team
+ * @brief Description of the ble_multi_app_at application
+ ******************************************************************************
+ *
+ * Copyright (c) 2019 STMicroelectronics. All rights reserved.
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ @endverbatim
+
+@par Example Description
+
+How to use multi BLE applications using a network processor architecture.
+
+
+@par Directory contents
+
+ - BLE/ble_multi_app_at/Core/Inc/stm32wbxx_hal_conf.h HAL configuration file
+ - BLE/ble_multi_app_at/Core/Inc/stm32wbxx_it.h Interrupt handlers header file
+ - BLE/ble_multi_app_at/Core/Inc/main.h Header for main.c module
+ - BLE/ble_multi_app_at/STM32_WPAN/App/app_ble_sv.h Header for app_ble_sv.c module
+ - BLE/ble_multi_app_at/STM32_WPAN/App/app_ble_cl.h Header for app_ble_cl.c module
+ - BLE/ble_multi_app_at/STM32_WPAN/App/app_ble_hr.h Header for app_ble_hr.c module
+ - BLE/ble_multi_app_at/STM32_WPAN/App/app_ble_common.h Header for app_ble_common.c module
+ - BLE/ble_multi_app_at/Core/Inc/app_common.h Header for all modules with common definition
+ - BLE/ble_multi_app_at/Core/Inc/app_conf.h Parameters configuration file of the application
+ - BLE/ble_multi_app_at/Core/Inc/app_entry.h Parameters configuration file of the application
+ - BLE/ble_multi_app_at/STM32_WPAN/App/ble_conf.h BLE Services configuration
+ - BLE/ble_multi_app_at/STM32_WPAN/App/ble_dbg_conf.h BLE Traces configuration of the BLE services
+ - BLE/ble_multi_app_at/STM32_WPAN/App/p2p_server_app.h Header for p2p_server_app.c module
+ - BLE/ble_multi_app_at/STM32_WPAN/App/p2p_client_app.h Header for p2p_client_app.c module
+ - BLE/ble_multi_app_at/STM32_WPAN/App/hrs_app.h Header for hrs_app.c module
+ - BLE/ble_multi_app_at/STM32_WPAN/App/dis_app.h Header for dis_app.c module
+ - BLE/ble_multi_app_at/STM32_WPAN/App/uart_app.h Header for uart_app.c module
+ - BLE/ble_multi_app_at/Core/Inc/hw_conf.h Configuration file of the HW
+ - BLE/ble_multi_app_at/Core/Inc/utilities_conf.h Configuration file of the utilities
+ - BLE/ble_multi_app_at/Core/Src/stm32wbxx_it.c Interrupt handlers
+ - BLE/ble_multi_app_at/Core/Src/main.c Main program
+ - BLE/ble_multi_app_at/Core/Src/system_stm32wbxx.c stm32wbxx system source file
+ - BLE/ble_multi_app_at/STM32_WPAN/App/app_ble_sv.c AT_P2PServer BLE Profile implementation
+ - BLE/ble_multi_app_at/STM32_WPAN/App/app_ble_cl.c AT_P2PClient BLE Profile implementation
+ - BLE/ble_multi_app_at/STM32_WPAN/App/app_ble_hr.c AT_HeartRate BLE Profile implementation
+ - BLE/ble_multi_app_at/STM32_WPAN/App/app_ble_common.c Common functions of the BLE Profile implementations
+ - BLE/ble_multi_app_at/Core/Src/app_entry.c Initialization of the application
+ - BLE/ble_multi_app_at/STM32_WPAN/App/p2p_server_app.c P2P Server application
+ - BLE/ble_multi_app_at/STM32_WPAN/App/p2p_client_app.c P2P Client application
+ - BLE/ble_multi_app_at/STM32_WPAN/App/hrs_app.c Heart Rate application
+ - BLE/ble_multi_app_at/STM32_WPAN/App/dis_app.c Device Information application
+ - BLE/ble_multi_app_at/STM32_WPAN/App/uart_app.c UART application
+ - BLE/ble_multi_app_at/STM32_WPAN/Target/hw_ipcc.c IPCC Driver
+ - BLE/ble_multi_app_at/Core/Src/stm32_lpm_if.c Low Power Manager Interface
+ - BLE/ble_multi_app_at/Core/Src/hw_timerserver.c Timer Server based on RTC
+ - BLE/ble_multi_app_at/Core/Src/hw_uart.c UART Driver
+
+@par Hardware and Software environment
+
+ - This application runs on STM32WB55xx device, Nucleo board (MB1355C)
+
+ - Nucleo board (MB1355C) Set-up
+ - Connect the Nucleo Board to your PC with a USB cable type A to mini-B to ST-LINK connector (USB_STLINK).
+ - Please ensure that the ST-LINK connectors and jumpers are fitted.
+
+One STM32WB55xx and one computer running a Terminal like TeraTerm are used. The computer is the orders giver and the STM32WB55xx is the slave that listens to the orders and performs them.
+The STM32WB55xx can either run the AT_P2PServer application, the AT_P2PClient application or the AT_HeartRate application.
+To manipulate each application, you can refer to the BLE_p2pServer, BLE_p2pClient and BLE_HeartRate documentation for more details.
+
+@par How to use it ?
+
+This application requests having the stm32wb5x_BLE_Stack_fw.bin binary flashed on the Wireless Coprocessor.
+If it is not the case, you need to use STM32CubeProgrammer to load the appropriate binary.
+All available binaries are located under /Projects/STM32_Copro_Wireless_Binaries directory.
+Refer to UM2237 to learn how to use/install STM32CubeProgrammer.
+Refer to /Projects/STM32_Copro_Wireless_Binaries/ReleaseNote.html for the detailed procedure to change the
+Wireless Coprocessor binary.
+
+In order to make the program work, you must do the following :
+ - Open your preferred toolchain
+ - Rebuild all files and load the image into Target memory
+
+First demonstration
+On the android/ios device, enable the Bluetooth communications, and if not done before,
+ - Install the ST BLE Profile application on the android device
+ https://play.google.com/store/apps/details?id=com.stm.bluetoothlevalidation&hl=en
+ https://itunes.apple.com/fr/App/st-ble-profile/id1081331769?mt=8
+
+ - Install the ST BLE Sensor application on the ios/android device
+ https://play.google.com/store/apps/details?id=com.st.bluems
+ https://itunes.apple.com/us/App/st-bluems/id993670214?mt=8
+
+ - Power on the Nucleo board with the ble_multi_app_at application
+ - Open your favorite Terminal software (e.g. TeraTerm) and connect to the correct serial port with "Local echo" activated and a BaudRate of 9600 bauds. The other settings should stay by default.
+ - Then, type "AT\r", you should receive "OK", meaning that the application should be operational.
+ - Type "AT+SV\r", you should receive "SV OK". You are now in AT P2P Server mode.
+ - Type "AT+SV$ADV_START\r". You should receive A and see a green led blinking rapidly on the board.
+ - Then, with your phone, click on the App icon, ST BLE Sensor (android device)
+ - select the ATP2PSV in the device list, connect to the device and play with the App as well as the terminal, using commands described in the Application Note.
+
+
+Second demonstration
+ - Power on the Nucleo board with the ble_multi_app_at application
+ - Open your favorite Terminal software (e.g. TeraTerm) and connect to the correct serial port with "Local echo" activated and a BaudRate of 9600 bauds. The other settings should stay by default.
+ - Then, type "AT\r", you should receive "OK", meaning that the application should be operational.
+ - Type "AT+HR\r", you should receive "HR OK". You are now in AT Heart Rate mode.
+ - Then, with your phone, click on the App icon, nRF Connect (android device)
+ - connect to the device
+ - select the STATHR in the device list, connect to it and play with the App as well as the terminal, using commands described in the Application Note.
+
+Third demonstration
+ - Power on two Nucleo boards with the ble_multi_app_at application
+ For AT P2P Server
+ - Open your favorite Terminal software (e.g. TeraTerm) and connect to the correct serial port with "Local echo" activated and a BaudRate of 9600 bauds. The other settings should stay by default.
+ - Then, type "AT\r", you should receive "OK", meaning that the application should be operational.
+ - Type "AT+SV\r", you should receive "SV OK". You are now in AT P2P Server mode.
+ - Type "AT+SV$ADV_START\r". You should receive A and see a green led blinking rapidly on the board.
+ - After receiving the character "C", you can start playing with the terminal, using commands described in the Application Note.
+ For AT P2P Client
+ - Open your favorite Terminal software (e.g. TeraTerm) and connect to the correct serial port with "Local echo" activated and a BaudRate of 9600 bauds. The other settings should stay by default.
+ - Then, type "AT\r", you should receive "OK", meaning that the application should be operational.
+ - Type "AT+CL\r", you should receive "CL OK". You are now in AT P2P Server mode.
+ - Type "AT+CL$SCAN\r". You should receive the BD Address of the AT P2P Server currently advertising.
+ - Then, type "AT+CL$CONN=XXXXXXXXXXXX\r" with the correct BD Address. You should see C displayed on both terminals. The Client and Server are now connected.
+ - Play with the terminal, using commands described in the Application Note.
+
+ For more details refer to the Application Note:
+ AN5379 - Examples of AT commands on STM32WB
+
+ * <h3><center>&copy; COPYRIGHT STMicroelectronics</center></h3>
+ */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Binary/BLE_Ota_reference.hex b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Binary/BLE_Ota_reference.hex
index b190abb8c..84d8114a1 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Binary/BLE_Ota_reference.hex
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Binary/BLE_Ota_reference.hex
@@ -1,1101 +1,1088 @@
:020000040800F2
-:10000000E8230020DD420008E5410008E741000840
-:10001000F9420008FD42000801430008000000000A
-:10002000000000000000000000000000E94100089E
-:10003000EB41000800000000ED410008EF4100081E
-:1000400005430008094300080D430008FF4100086C
-:100050001143000815430008194300081D43000818
-:100060002143000825430008294300082D430008C8
-:100070003143000835430008394300083D43000878
-:100080004143000845430008494300084D43000828
-:100090005143000855430008594300085D430008D8
-:1000A0006143000865430008694300086D43000888
-:1000B0007143000875430008794300087D43000838
-:1000C0008143000885430008894300088D430008E8
-:1000D000F341000891430008954300089943000844
-:1000E0009D430008A1430008A5430008A943000858
-:1000F0000742000803420008AD430008B14300086E
-:10010000B5430008B9430008BD430008C1430008D7
-:10011000C5430008C9430008CD430008D143000887
-:10012000D5430008D9430008F9410008DD43000821
-:10013000E1430008E5430008E943000838B504003E
-:1001400009D004F17C05686808B900F01EF800F0D9
+:10000000F023002019420008214100082341000884
+:1000100035420008394200083D4200080000000057
+:100020000000000000000000000000002541000862
+:100030002741000800000000294100082B4100086A
+:100040004142000845420008494200083B4100087F
+:100050004D4200085142000855420008594200082C
+:100060005D420008614200086542000869420008DC
+:100070006D4200087142000875420008794200088C
+:100080007D4200088142000885420008894200083C
+:100090008D420008914200089542000899420008EC
+:1000A0009D420008A1420008A5420008A94200089C
+:1000B000AD420008B1420008B5420008B94200084C
+:1000C000BD420008C1420008C5420008C9420008FC
+:1000D0002F410008CD420008D1420008D542000857
+:1000E000D9420008DD420008E1420008E54200086C
+:1000F000434100083F410008E9420008ED42000882
+:10010000F1420008F5420008F9420008FD420008EB
+:100110000143000805430008094300080D43000897
+:100120001143000815430008354100081943000831
+:100130001D430008214300082543000838B504008A
+:1001400009D004F17C05696809B900F01EF800F0D7
:1001500021F8012801D1012032BDA06A08B100F0C8
:100160002AF800F00AF821F02A01FFE7816000F088
-:100170001BF8BDE8324000F0C0BD2068416821F4A2
-:1001800090414160206881687047002129702046B5
-:1001900000F09DBE2420686020680168490849007D
-:1001A0000160204600F0DEB82068016841F00101DE
-:1001B000016020467047204600F03CBD2068816801
-:1001C0004A06704770B504462568E9692A68AB6835
-:1001D00011F00F000CD1880602D5900601D4D8008A
-:1001E00079D5E16E002975D02046BDE870400847FA
-:1001F0005848034208BF12F4907F6CD0CE0709D54F
-:10020000D60507D501262E62D4F8885045F00105A1
-:10021000C4F888508D070AD5DD0708D52668022561
-:100220003562D4F8885045F00405C4F888504D076D
-:100230000AD5DD0708D5266804253562D4F888502C
-:1002400045F00205C4F888500D070CD5950601D479
-:10025000034208D0256808202862D4F8880040F0BE
-:100260000800C4F88800D4F8880000286FD08906F8
-:1002700007D5900601D4D80003D5E16E09B1204618
-:100280008847D4F8880021688A68510601D400079D
-:100290001AD5204600F08EFDFFF790FF0FD500F035
-:1002A0005BF860B1DFF87C198163A06F00F00BFF91
-:1002B00000284CD0A06F816BBDE8704008472046F5
-:1002C000BDE8704000F0D4BF204600F0D1FF002010
-:1002D000C4F8880070BDC80209D5580207D54FF48C
-:1002E000801028622046BDE8704000F0C3BF0806B9
-:1002F00009D5100601D4180205D5216F39B320465F
-:10030000BDE87040084748060FD550060DD528684F
-:1003100020F0400028602021C4F8801000202067D1
-:100320002046BDE8704000F04ABE080206D55000E5
-:1003300004D52046BDE8704000F09DBFC80148BF0D
-:10034000002A04D52046BDE8704000F095BF70BD7E
-:100350000000000001000010816821F04001816070
-:10036000A06F70472DE9F84F0446DFF86C0A276844
-:10037000DFF868BA3968DFF868AA0140A06801436D
-:100380002069014360690143E0690143606E0143F4
-:10039000396000267968E06821F4405101437960B2
-:1003A000B046A169DFF83C0A87421CBF206A0143BE
-:1003B000BA68DFF8340A02401143B9604FF480751F
-:1003C000F96A606A090940EA0111F9625F454FF470
-:1003D00000404FF400714FF480624FF400634FF41B
-:1003E000805C4FF4005E4FF4804929D1DAF800B008
-:1003F0000BF0030BBBF1030F3ED8DFE80BF0023725
-:10040000343A4FF0010AD4F81CB05746BBF5004F00
-:100410004FF6F07A40F01183012F09D0022F00F03F
-:100420005482042F00F08D82082F00F0C282F5E282
-:1004300000F07FFF0146606A002840F01B8242E224
-:10044000DFF8A0B95F4517D1DAF800A01AF4406AC6
-:1004500027D0BAF5806F09D0BAF5006F03D0BAF58E
-:10046000406F06D008E04FF0020A07E04FF0040AA0
-:1004700004E04FF0080A01E04FF0100ADFF864B919
-:100480005F45C0D1BAF1000F0BD0BAF1020F49D0CD
-:10049000BAF1040F00F08280BAF1080F00F0B080CA
-:1004A000B3E300F03EFF0146606A58B3012808BF7D
-:1004B000022028D0022808BF042024D0032808BF27
-:1004C000062020D0042808BF08201CD0052808BF1B
-:1004D0000A2018D0062808BF0C2014D0072808BF0F
-:1004E000102010D0082808BF20200CD0092808BFF1
-:1004F000402008D00A2808BF802004D00B2808BF5D
-:10050000284600D00120B1FBF0F0002800F07F83E6
-:10051000626802EB4201884203D31103814280F0FA
-:10052000A18072E3606AB0B3012808BFDFF8BC089D
-:10053000EED0022808BFDFF8B808E9D0032808BFCA
-:10054000DFF8B008E4D0042808BFDFF8AC08DFD03B
-:10055000052808BFDFF8A408DAD0062808BFDFF8AE
-:10056000A008D5D0072808BFDFF89808D0D0082801
-:1005700008BFDFF89408CBD0092808BFDFF88C0843
-:10058000C6D00A2808BFDFF88808C1D00B2808BFEA
-:100590004FF22440BCD0DFF87C08B9E700F077FECA
-:1005A0000146606A58B3012808BF0220ABD0022878
-:1005B00008BF0420A7D0032808BF0620A3D0042822
-:1005C00008BF08209FD0052808BF0A209BD0062816
-:1005D00008BF0C2097D0072808BF102093D0082808
-:1005E00008BF20208FD0092808BF40208BD00A28C0
-:1005F00008BF802087D00B2808BF284683D081E71A
-:10060000676A002F84D0012F08BF4846FAD0022F16
-:1006100008BF7046F6D0032F08BF41F25550F1D005
-:10062000042F08BF6046EDD0052F08BF40F6CC4030
-:10063000E8D0062F08BF40F6AA2012D0072F08BF27
-:1006400018460ED0082F08BF10460AD0092F08BF41
-:10065000084606D00A2F08BF284602D00B2F00D12B
-:10066000802055E7BAF1000F0BD0BAF1020F38D055
-:10067000BAF1040F00F07280BAF1080F00F0A78001
-:10068000ECE000F04EFE0146606A40B3012808BF6E
-:1006900002251ED0022808BF04251AD0032808BF4F
-:1006A000062516D0042808BF082512D0052808BF43
-:1006B0000A250ED0062808BF0C250AD0072808BF37
-:1006C000102506D0082808BF202502D0092808BF19
-:1006D000402572D00A280CBF80250B286DD001253B
-:1006E0006BE0606A002836D0012808BFDFF8386761
-:1006F0002BD0022808BFDFF8346726D0032808BFB4
-:10070000DFF82C6721D0042808BFDFF828671CD049
-:10071000052808BFDFF8206717D0062808BFDFF8D4
-:100720001C6712D0072808BFDFF814670DD008280F
-:1007300008BFDFF8106708D0092808BFDFF808678E
-:1007400003D00A2808BFDFF804677CD00B2808BF55
-:10075000DFF8C06677D0DFF8F86674E000F097FD48
-:100760000146606A40B3012808BF022525D002284F
-:1007700008BF042521D0032808BF06251DD0042862
-:1007800008BF082519D0052808BF0A2515D0062856
-:1007900008BF0C2511D0072808BF10250DD0082848
-:1007A00008BF202509D0092808BF402505D00A2800
-:1007B0000CBF80250B2800D001256268B1FBF5F63F
-:1007C0005008002110EB062051EB166141E0606AF1
-:1007D000002836D0012808BF4FF4800633D0022805
-:1007E00008BF4FF400162ED0032808BFDFF8646658
-:1007F00029D0042808BF4FF4801624D0052808BF4C
-:10080000DFF854661FD0062808BFDFF850661AD0FC
-:10081000072808BF4FF4002615D0082808BF4FF45A
-:10082000802610D0092808BF4FF400360BD00A28C4
-:1008300008BF4FF4803606D00B2808BF4FF400469F
-:1008400001D04FF40006C246002116EB52004AEBDD
-:100850000101002300F08AFD064601E04FF0010887
-:10086000A6F54070DFF8F815884280F0CE81216847
-:10087000CE60CCE1012808BF02251AD0022808BFAB
-:10088000042516D0032808BF062512D0042808BF67
-:1008900008250ED0052808BF0A250AD0062808BF5B
-:1008A0000C2506D0072808BF102502D0082808BF4D
-:1008B000202575D0092808BF402571D00A280CBF13
-:1008C00080250B286CD001256AE0606AB0B301284E
-:1008D00008BFDFF8400521D0022808BFDFF80C056B
-:1008E0001CD0032808BFDFF87C0517D0042808BFF8
-:1008F000DFF8FC0412D0052808BFDFF86C050DD026
-:10090000062808BFDFF8EC0408D0072808BFDFF886
-:10091000E80403D0082808BFDFF8E8047AD00928E3
-:1009200008BFDFF8E40475D00A2808BFDFF8DC044C
-:1009300070D00B2808BFDFF8D8046BD0DFF80C05A7
-:1009400068E000F0A4FC0146606A40B3012808BFDB
-:10095000022525D0022808BF042521D0032808BF7E
-:1009600006251DD0042808BF082519D0052808BF72
-:100970000A2515D0062808BF0C2511D0072808BF66
-:1009800010250DD0082808BF202509D0092808BF48
-:10099000402505D00A280CBF80250B2800D0012552
-:1009A0006068B1FBF5F1420802EB4102B2FBF0F6E0
-:1009B00032E0666A66B3012E2CD0022E08BF48468C
-:1009C00028D0032E08BF42F6AA2023D0042E08BF49
-:1009D00070461FD0052E08BF41F698101AD0062E7B
-:1009E00008BF41F2545015D0072E08BF604611D001
-:1009F000082E08BF18460DD0092E08BF104609D092
-:100A00000A2E08BF084605D00B2E08BF284601D085
-:100A10004FF4803000F008F9B6B201E04FF0010861
-:100A2000A6F11000504580F0F0800AEA0601C6F3F6
-:100A3000420001432068C160E9E0012F07D0022F86
-:100A400035D0042F6DD0082F00F0A280D4E000F044
-:100A500070FC0146606A40B3012808BF022512D02D
-:100A6000022808BF04250ED0032808BF06250AD097
-:100A7000042808BF082506D0052808BF0A2502D08B
-:100A8000062808BF0C257BD0072808BF102577D083
-:100A9000082808BF202573D0092808BF40256FD03B
-:100AA0000A280CBF80250B286AD0012568E0606AFF
-:100AB000A0B3012808BFDFF8341330D0022808BFE4
-:100AC000DFF82C132BD0032808BFDFF8281326D01B
-:100AD000042808BFDFF8201321D0052808BFDFF85D
-:100AE0001C131CD0062808BFDFF8141317D00728E2
-:100AF00008BFDFF8101312D0082808BFDFF808136A
-:100B00000DD0092808BFC14909D00A2808BFC0492B
-:100B100005D00B2808BF4FF2244100D0BD496068C2
-:100B200031E000F0B4FB0146606A40B3012808BF21
-:100B3000022525D0022808BF042521D0032808BF9C
-:100B400006251DD0042808BF082519D0052808BF90
-:100B50000A2515D0062808BF0C2511D0072808BF84
-:100B600010250DD0082808BF202509D0092808BF66
-:100B7000402505D00A280CBF80250B2800D0012570
-:100B80006068B1FBF5F101EB5001B1FBF0F631E02B
-:100B9000666A6EB3012E08BF484629D0022E08BFF0
-:100BA000704625D0032E08BF41F2555020D0042EA8
-:100BB00008BF60461CD0052E08BF40F6CC4017D0B9
-:100BC000062E08BF40F6AA2012D0072E08BF1846EE
-:100BD0000ED0082E08BF10460AD0092E08BF0846BE
-:100BE00006D00A2E08BF284602D00B2E08BF802050
-:100BF00000F01AF8B6B201E04FF00108A6F11000BB
-:100C0000504502D22068C66001E04FF0010804F1AF
-:100C100068000121418001800021416081604046DF
-:100C2000BDE8F28F190E0008616800EB5100B0FBBF
-:100C3000F1F6704790F82810CA0706D50268536885
-:100C4000C16A23F400330B43536090F828108A07DD
-:100C500006D502685368016B23F480330B4353605D
-:100C600090F828104A0706D502685368416B23F4B0
-:100C700080230B43536090F828100A0706D50268BA
-:100C80005368816B23F400430B43536090F82810A2
-:100C9000CA0606D502689368C16B23F480530B43E0
-:100CA000936090F828108A0606D502689368016C54
-:100CB00023F400530B43936090F828104A0610D594
-:100CC00002685368416C23F480130B435360416CFA
-:100CD000B1F5801F05D15368816C23F4C0030B4329
-:100CE000536090F828100A0606D501684A68C06C5F
-:100CF00022F4002202434A607047F8B5044604F12A
-:100D00007C050020E8606FF07E4700F047FC064657
-:100D1000206801680A0708D50097334600224FF47F
-:100D20000011204600F016F860B9206801684A07F3
-:100D30000AD50097334600224FF48001204600F088
-:100D400009F808B10320F2BD20206860A8600020E7
-:100D50002870F2BD2DE9F041069C05460E469046EE
-:100D60001F462868C1693140B1420CBF01200020F4
-:100D700040451CD114F1010FF3D000F00FFCC01B53
-:100D8000844201D3002CECD12868016821F4D07191
-:100D900001602868816849084900816005F17C008C
-:100DA00020214160816000210170032000E00020CB
-:100DB000BDE8F08101680A6822F490720A60DFF8E9
-:100DC000AC10026893680B4093602021C0F8841037
-:100DD0000021C16670470000F369FFCF0038014071
-:100DE0008800005800800040FFF4FF1100127A00D4
-:100DF00000093D00AAB0280080841E00006A180087
-:100E00005558140040420F0020A1070090D0030065
-:100E100048E801000024F400806A00F15601002235
-:100E20000A810A8000F024BA0000127A0000093D0D
-:100E300000AAB0280080841E00006A1800555814CB
-:100E40000040420F0020A1070090D0030048E801B5
-:100E5000000024F40055150000CC0C0000AA0A0084
-:100E600000FD0F005461510000D43000FEFFFFEF81
-:100E7000584900E0584981B00A6802430A6009688D
-:100E800008400090009801B0704798B95348544901
-:100E900001604FF4E131416000218160C160016176
-:100EA00081610C2141614FF40041C16100218162E7
-:100EB000FFF744B97047002804BF4848FFF782B9DC
-:100EC000704718B94548406F00F033B9704738B5DE
-:100ED00086B004466846142100F066FB2168404A4B
-:100EE00091425FD10220FFF7C5FF402000F05CF87F
-:100EF0003D4D284600F05CFB0220FFF7BBFF802041
-:100F000000F052F8284600F053FB0120FFF7B2FF33
-:100F10004FF400600221009001910291072003210B
-:100F20000391049069464FF0904000F041FB2F4838
-:100F30002F4D816A8908890041F0010181620022F8
-:100F4000016841F4804101600F21006800F4804095
-:100F500005900598242000F021FC242000F03BFCA3
-:100F60000220FFF785FF0420FFF782FF2148286059
-:100F70000F2068601020A8600020E86080202861B1
-:100F800000206861A861E8612862284600F034F812
-:100F90006567AC6200220F213A2000F0FFFB3A2087
-:100FA00000F019FC07B030BD009002210020019133
-:100FB000029003210720039104906946704700685E
-:100FC0000749884204D107490868002818BF00472C
-:100FD00070470000480000584C000058481100209D
-:100FE00000380140E0130020000400486000005871
-:100FF000541200204404024038B5040001D10120FD
-:1010000032BD2168DFF84002814204F1240500F07E
-:1010100042F8022068700A68A0686FF30E1202435B
-:10102000E06802432069024360690243A069024309
-:10103000E0690243206A02430A60204600F0DAF8C1
-:10104000A068B0F5804F04BF00216160696A207913
-:1010500000F014F838B1052805D2204600F0E4F875
-:1010600000F012F803E0002028636863A863002002
-:10107000A861012068700020287032BD0860A96A4C
-:10108000E86A486060687047296B00200860696BF7
-:10109000A86B486070470AD2DFF8B00142181423E9
-:1010A000B2FBF3F292002A62DFF8A40109E0DFF854
-:1010B000A40142181423B2FBF3F292002A62DFF873
-:1010C0009801E861704738B500F124020024517896
-:1010D000022903D004209061012428E001680B68F4
-:1010E00023F00E030B6001680D686D086D000D6044
-:1010F000516A0B6823F480730B60012192F8203051
-:10110000D56903F01C0399406960936AD16A5960FC
-:10111000116B31B10B6823F480730B60536B916BCF
-:101120005960012151701470516901B188472046FE
-:1011300032BDF8B500F124010423CA6914680268BD
-:10114000156891F8206006F01C0603FA06F73C4289
-:1011500010D06F070ED51468A50603D4156825F0C6
-:101160000405156000F03DF8C968002938D0BDE8D5
-:10117000F4400847022303FA06F73C4213D0AF07B6
-:1011800011D51468A50605D4156825F00A05156063
-:1011900001224A7000F025F800220A708968F9B12E
-:1011A000BDE8F4400847082303FA06F6344217D096
-:1011B0002B0715D5136823F00E031360012291F855
-:1011C0002030CC6903F01C039A40626001228A61DE
-:1011D0004A7000220A70096911B1BDE8F44008475D
-:1011E000F1BD91F82020CC6902F01C0293406360AD
-:1011F00070470000416C0268134B89089A4234BF63
-:10120000164B174B03EB8101816402F0FF02083A91
-:101210001421B2FBF1F1134AC26401F01C01012256
-:1012200002FA01F10165704701790F4A02EB810270
-:101230004265491E0D4A826501F0030101228A4080
-:10124000C26570470000000008040240F8FFFDBFBF
-:1012500000000240F8FBFDBF00040240000802400D
-:101260001C08024080080240FC080240400902407D
-:101270007047000070477047704700004FF0B04063
-:10128000006800F0F000B02888BFB020704738B583
-:101290004FF0B044304DA16811F00C0106D1FFF7BA
-:1012A000EDFFC0F3031055F8200032BD04292B4A8E
-:1012B00005D008292A4804D12168C90222D5104640
-:1012C00032BDE16801F00301022904D0032904D1F1
-:1012D0002168C90207D5104605E0FFF7CFFFC0F32C
-:1012E000031055F82000E168E268E368C1F30621C5
-:1012F0004843C2F30211491C5B0FB0FBF1F05B1CC9
-:10130000B0FBF3F032BD80B5FFF7C1FF1149FFE735
-:10131000144A0968C1F3031152F82110B0FBF1F02F
-:1013200002BD80B5FFF7EFFF00F010F8C1F3022116
-:1013300006E080B5FFF7E7FF00F008F8C1F3C2212F
-:1013400012F8211001F01F01C84002BD0149064AF0
-:1013500009687047080000589C3E00080024F4000B
-:101360000048E8015C3E000878420008B3BBD9B1F0
-:10137000B2F5803F7DD2022A1ED98C46B1FBF2F134
-:1013800002FB11C31B0443EA1043B3FBF2FC02FB54
-:101390001C3380B240EA0343B3FBF2F002FB10328D
-:1013A00040EA0C4000237047022A05D98446B0FB6E
-:1013B000F2F002FB10C270474AB105D100F0010201
-:1013C00049085FEA3000704700220023704700F0B0
-:1013D00043BA0B000200002100207047904271EBDD
-:1013E000030CF6D3B3F5803F2FD2F0B5B3FA83F7F1
-:1013F000B1FA81F4A7F10F0E3D1B5340CEF1200648
-:1014000002FA0EF2F3415340B5F10F0746D80F3CF4
-:101410002C444140C4F12006A040F1414140B1FBC1
-:10142000F3F603FB1611A2FB0645001BA94102D2ED
-:10143000761E8018594180EA010221FA0EF362FA01
-:101440000EF200215A403046F0BD30B4B1FBF3FC3F
-:1014500003FB1C11A2FB0C45001BA94103D2ACF1FC
-:10146000010C8018594130BC02460B4660460021F1
-:101470007047B2F1807F65D3F0B5B2FA82F7B1FA66
-:1014800081F4C7F10F063D1B22FA06F307F1110E96
-:10149000F24120355A40B5F10F07B8D94140C4F1A7
-:1014A0002006A040F1414140B1FBF3FC03FB1C11BD
-:1014B000A2FB0C45001BA94103D2BCF1010C801812
-:1014C00059410F2F12D30F3FC90341EA5041B1FBDD
-:1014D000F3F603FB1611A2FB0645D4EBC030A9417D
-:1014E00002D2761E8018594146EACC3C07B34140EF
-:1014F000C7F12006B840F1414140B1FBF3F603FBD0
-:101500001611A2FB0645001BA94102D2761E8018C7
-:10151000594180EA010221FA0EF3C7F1200462FA70
-:101520000EF20CFA07F05A402CFA04F13043F0BDE9
-:1015300080EA010221FA0EF3002162FA0EF26046FF
-:101540005A40F0BD8C46B1FBF2F102FB11C31B0205
-:1015500043EA1063B3FBF2FC02FB1C331B024CEAB0
-:10156000002043EA1063B3FBF2FC02FB1C331B02B6
-:101570004CEA002043EA1063B3FBF2FC02FB1C338D
-:101580001B024CEA002043EA1063B3FBF2FC02FBAF
-:101590001C324CEA0020002370470000014800681C
-:1015A000704700BF60100020002200F057B9000013
-:1015B0002DE9F84F4FF0000C634A644BDFF890813F
-:1015C0004FF00F0982460F4633E0624DAA4514BF23
-:1015D000072504258D40254348F82E50C1431C683B
-:1015E00001EA040E7C68E50348BF40EA0E0EC3F82A
-:1015F00000E05C6801EA040E7C68A50348BF40EA8D
-:101600000E0EC3F804E0146801EA040E7C68E502DB
-:1016100048BF40EA0E0EC2F800E0546801EA040E2A
-:1016200079688C0248BF40EA0E0EC2F804E00CF163
-:10163000010C396831FA0CF000F07C80012000FACE
-:101640000CFE1EEA0100F2D07C68022C18BF122C9E
-:101650004FEA8C0110D14FEADC040AEB840401F05C
-:101660001C05266A09FA05FB26EA0B06D7F810B016
-:101670000BFA05F5354325624FEA4C040325DAF8E9
-:10168000006097F804B0A540ED430BF0030B2E402B
-:101690000BFA04FB4BEA0606CAF800607E68012ECE
-:1016A00018BF022E03D0112E18BF122E17D1DAF850
-:1016B0000860D7F80CB02E400BFA04FB4BEA060684
-:1016C000CAF80860DAF8046026EA0E0E7E68C6F3EF
-:1016D000001606FA0CF646EA0E06CAF80460DAF8B6
-:1016E0000C603540BE6806FA04F42C43CAF80C407E
-:1016F0007C68E4009BD54FEA9C0E58F82E5001F010
-:101700000C0109FA01F425EA0404BAF1904F08BF6C
-:1017100000250ED0104DAA4508BF012509D00F4D58
-:10172000AA4508BF022504D00D4DAA457FF44DAF50
-:1017300003254FE7BDE8F18F81B0002A14BF816116
-:10174000816201B07047000000080058800800580E
-:10175000080001400010004800040048000800484C
-:10176000000C00480901020081B002D432488154C3
-:1017700005E0324802F00F02104400F8041C01B0EA
-:1017800070472F4A13684FF6FF0100020B4000F428
-:10179000E06018432B4908431060704738B5284B68
-:1017A0001C68C4F30223C3F10704052C28BF0424DA
-:1017B0001D1D072D34BF0023DB1E012505FA04F48F
-:1017C000641E2140994005FA03F35B1E1A40114341
-:1017D000BDE83440C6E7010007D4012200F01F0134
-:1017E000194B8A40400943F82020704701000BD470
-:1017F000012200F01F01154B8A40400943F82020C8
-:10180000BFF34F8FBFF36F8F7047010007D40122E2
-:1018100000F01F010E4B8A40400943F8202070471A
-:10182000010007D4012200F01F010A4B8A40400941
-:1018300043F820207047000000E400E018ED00E0CD
-:101840000CED00E00000FA0500E100E080E100E0BE
-:1018500000E200E080E200E07047000000B500BF59
-:10186000130096469446103928BFA0E80C50FAD8C9
-:101870005FEA417C28BF0CC048BF40F8042BC90771
-:1018800028BF20F8022B48BF00F8012B00BD000044
-:10189000DFF8F0140A6892B200E00246086880B2ED
-:1018A0008242FAD170472DE9FC4104461825DFF841
-:1018B000D884DFF8D864684308EB0007307806283E
-:1018C00008D131787170347078754FF0FF307060E6
-:1018D000002039E000F077F8B9680918B96008F11C
-:1018E0000803B96832786A439A589142327813D320
-:1018F00008F1150315FB02FC13F80C30062B25D05C
-:1019000008F108066B43F358994222BF08F115030A
-:101910006A439A5CEED219E01146337869439A42E1
-:101920000BD008F1140308F1150C5B5C15FB03F5F3
-:101930000CF805407A753B7500E07A7508F11402E1
-:101940005454317871703470BDE8F68111466943A2
-:1019500008F115035B5C062B04D008F1140615FB97
-:1019600003F574557B753A7508F115025454EBE78D
-:10197000F8B5DFF81834DFF810541E781824024642
-:101980006243B0422A4404D118785870507D1870D0
-:101990000FE0167D507D92F815C005F115076643DE
-:1019A000062807F806C004D0167D143514FB00F491
-:1019B0002E55012010731878062802BF00294FF019
-:1019C000FF315960F1BD10B5DFF8C043606810F118
-:1019D000010F0FD0FFF75CFF6168DFF8B42381428D
-:1019E00061683CBF5388C918081A51784843117878
-:1019F000C84000E0002080B210BD2DE9F84FDFF8AC
-:101A00009053DFF890B3D5F80880D8F80000DBF8E1
-:101A100000104A0500F06AF9DFF87063DFF868A388
-:101A200021F4806181604FF0180934780AF10800D0
-:101A300019FB04F14758FFF7C6FF874217D200276A
-:101A40000121B170062C3DD019FB04F40AF1080104
-:101A50000AF108020959814223BF0AF10801095914
-:101A6000091A002111510AEB04014C7DEAE7A9880B
-:101A70004118B94202D2AF880021E2E73F1ADFE7FE
-:101A8000022802DA2878012800D07F1ED8F800004A
-:101A9000C1684A07FAD500F02FF9DBF80C00000CFA
-:101AA000BFB247EA0047CBF80C70FFF7F1FE706059
-:101AB000A8680068816841F480618160AFF30080AC
-:101AC000BDE8F18FB8B20028DAD1FFF7E1FE70600F
-:101AD0000320BDE8F24FFFF798BE2DE9F843EFF37E
-:101AE000108872B6AA4DA84BA8680168CA224A623B
-:101AF00053204862A54A886820F4806088601820D6
-:101B00001678374647431F44387B022826D13C6865
-:101B1000D7F810909078F0B17A7B012A0AD1012190
-:101B20003046FFF725FF88F310887968304600F0CB
-:101B3000F0F804E088F31088304600F09BF8A868BD
-:101B40000068CA214162224653214162484631461B
-:101B500000F02AF90BE0FFF750FF06E0C8684207E3
-:101B6000FCD500F07EF88C49086088F31088FF21CE
-:101B7000A86802685162BDE8F183F8B5844CA160A1
-:101B8000CA2209684A6253224A62824A136843F0B1
-:101B900020031360136803F00703C3F104032370E9
-:101BA00095682D0C05F07F056D1C6570EDB292688F
-:101BB000C2F30E02521C628092B2521E6A43A2F518
-:101BC000A072DA404FF6FF739A422CBFA380A28026
-:101BD000724A136843F400231360714B1D6845F487
-:101BE00000251D6048BB6948674E01238370182596
-:101BF0004FF0FF33436000235FFA83FC06F10C07CC
-:101C000015FB0CFC4FF0000E07F80CE05B1CDFB27C
-:101C1000062FF1DB06230370886820F4806088605B
-:101C200000F01FF8D0600320FFF7FAFDA1680868F4
-:101C3000826842F48042826005E0C868410544BF82
-:101C40000320FFF7E2FDA1680A68FF20506200222E
-:101C500003210320FFF7A2FDBDE8F2400320FFF7B8
-:101C6000BABDC86800F0800060F49060C8604FF4AE
-:101C700000207047F8B50746EFF3108472B60320D2
-:101C8000FFF7B4FD424DAE683068CA2141623A4662
-:101C900053214162182043494243895C02291BD1E8
-:101CA00000213846FFF764FE3848017806290ED136
-:101CB000306838490A68530500F018F821F480614B
-:101CC0008160C1684A07FCD500F016F804E040784E
-:101CD000884218BFFFF791FEA9680A68FF2050628A
-:101CE0000320FFF778FD84F31088F1BD02D5C168A9
-:101CF0004A07FCD481687047C16801F0800161F433
-:101D00009061C1604FF40020234908600320FFF771
-:101D100087BD2DE9F04180460F46424618201A49FA
-:101D200042438C18207B022804BF4046FFF7A2FFE5
-:101D3000EFF3108572B60320FFF758FD144EB0681C
-:101D40000068CA2141625321416202202073A760CA
-:101D500067604046FFF7A7FD0C490A784978914231
-:101D600002D0FFF74AFE02E0A168081AA060FF2037
-:101D7000B1680A6850620320FFF72DFD85F31088D3
-:101D8000BDE8F08128280040B8100020D4130020BE
-:101D900044130020082800400C0800580008005890
-:101DA00080080058C41000201047000018B595B0F6
-:101DB00009A80FF2BC21874C302200F081F90FF204
-:101DC00065200190009469460FF2412000F0BCF9B3
-:101DD0000121022000F097FA7F4A0021012000F043
-:101DE0000CFB09A800F0A6FB0020ADF81A0000F0DB
-:101DF000B5FB00F0D3F802460621002000F0D2FB2C
-:101E00004EF66E50089007AA74490868079006219C
-:101E10002E2000F0C7FB0FF230221021182000F016
-:101E2000C1FB0FF234221021082000F0BBFB182167
-:101E3000012000F0DEFB00F007FC0DF1160006A902
-:101E40000190009105AB07220021012000F095FDD3
-:101E50000FF2E410BDF8181000900723BDF814002D
-:101E6000002200F0B1FC0DF11A0000900223BDF831
-:101E70001610BDF81400002200F0A6FC002000F0AF
-:101E800030FD0020049010235549039108200022C2
-:101E900001930090029200230121012000F03AFDFD
-:101EA00000F0FEFD4F484FF4004101600221006F39
-:101EB000019100F0FF004FF000514A780292062A8B
-:101EC0000ED200200870BFF34F8F474947480A6879
-:101ED00002F4E06202430A60BFF34F8F00BFFDE7E8
-:101EE00089780391891888423CBF801A039000F0DA
-:101EF0005EFE694601A800F0C5FE00F066FE00F037
-:101F00004DF83B4942790A7202794A72C2788A7264
-:101F10008278CA7242780A730278521C4A73062188
-:101F200042798DF8052002798DF80420C2788DF869
-:101F3000032082788DF8022042788DF801206A46CD
-:101F40000078401C8DF80000002000F02BFB00F012
-:101F50000AF816B010BD80B54078052808BF00F01B
-:101F600002F8012002BD00B587B000200690059060
-:101F700000220FF2F4000492082100230290019144
-:101F800000920393A0228021002000F061FC07B0A2
-:101F90005DF804EB16490E2000F01FBD10B50F4987
-:101FA0000A6812F1010F0DD012484B6802701B0A2B
-:101FB000140A120C4470827049680371C1701B0AC4
-:101FC000437110BD002000F0DFFE08B90FF2700071
-:101FD00010BD0000A8080320872100088075FF1F9E
-:101FE00007B20100104000580CED00E00400FA05B3
-:101FF00004000020AC1300200021012000F00ABAE8
-:10200000012000F029BA012000F02EBA10B50446D4
-:10201000616801F1080000F06EFD00B10120207040
-:1020200010BD000010B1012803D07047012000F05E
-:1020300001BA00F007BA0000424C45636F726500B8
-:102040006C7AD8AC57720000123456789ABCDEF025
-:10205000123456789ABCDEF0FEDCBA09876543215B
-:10206000FEDCBA09876543210953544D5F4F544143
-:102070000000000000000000000000000000000060
-:102080000000000044000800400508013A799C0067
-:10209000F4010001FFFFFFFF480101000000000004
-:1020A00062B38B0708D0521E11F8013B00F8013BC8
-:1020B00000F024808B07F6D1830740F0208000BF1A
-:1020C000103A07D330B4B1E83810103AA0E838100D
-:1020D000F9D230BC530724BFB1E80810A0E80810BB
-:1020E00044BF51F8043B40F8043BD20724BF31F809
-:1020F000022B20F8022B44BF0B7803707047121F8D
-:1021000017D35B0009D151F8043B20F8023B1B0CAC
-:10211000121F20F8023BF6D20BE051F8043B00F806
-:10212000013B1B0A20F8023B1B0C121F00F8013B6D
-:10213000F3D238BF121D521E24BF11F8013B00F824
-:10214000013BF8D8704700007FB50C46684D6168C8
-:10215000684EE8612962284600F028FE246805F1EF
-:10216000240000604060746006F108000060406078
-:1021700001203070296829B10FF2411000900294BB
-:10218000684688477FBD3EB5594C5A4D02E00098DD
-:1021900000F0B4FE05F1080000F001FFD8B928787E
-:1021A000002818D0694605F1080000F021FF012041
-:1021B0002870E1690029EAD00098029001A88847B8
-:1021C0009DF8040028700028E1D1009905F108006D
-:1021D00000F0EEFEDEE737BD2DE9F84306460020AD
-:1021E00000F05FF874883088B268DFF80481C4F3C7
-:1021F000090444EA8024F068A4B2C1B2204600F089
-:102200003CF8002748F2E8094846FFF7FCFE08E0E2
-:102210006888A04202D1316928780870687800B1D6
-:10222000012708F1240000F0BAFEF0B9694608F170
-:10223000240000F0DDFE009800F10B05407A0F2825
-:10224000E6D0B5F80110A1420DD10098817AC81EE0
-:102250007169C0B28842C8BF0846706102463069E1
-:10226000E91CFFF71DFF2878D9E73800CCD0012002
-:1022700000F017F80020BDE8F28310B513461D4AA0
-:102280005468A4F80900E1720A46194604F10C00EA
-:10229000FFF706FF164A1369BDE810400021002031
-:1022A00018471349096A82B008B921B101E011B198
-:1022B000012002B0084702B07047000010B5014687
-:1022C000487A0F2818BF0E2807D10B4800F07AFE75
-:1022D000BDE810400020FFF793BE064C04F1080053
-:1022E00000F070FE04F10800BDE81040FFF784BE66
-:1022F000B412002080130020D81200200C480021C6
-:1023000001604160704710B500F00CF85C6819B1CD
-:10231000012904D1204301E024EA0000586082F33F
-:10232000108810BDEFF3108272B6014B70470000A9
-:10233000B41300202DE9FC47554CDFF85891A569EE
-:102340002840A0614FF0010A4FF0FF3830E0491CEF
-:1023500054F831000642FAD004EBC10718407968FE
-:102360001040014208BFC7F804807E68304000F08A
-:1023700093F860620AFA00F086437E60EFF3108102
-:1023800072B6626A20690AFA02F2D24310402061F2
-:10239000022004EBC00353F8086C1640401E43F8BB
-:1023A000086CF6D181F31088606A59F820108847CC
-:1023B00063692069A2691840104207D0E069216A68
-:1023C000084203D1002103EA0206C1E7C046C04625
-:1023D000EFF3108972B6216960690140A06901427A
-:1023E00001BFE169206A014200F0C1FE89F3108853
-:1023F000C046C046A561BDE8F38738B51446EFF383
-:10240000108572B600F048F8224941F8204085F363
-:10241000108831BD10B5EFF3108272B61C4B1C69E9
-:1024200004431C6153F83140204343F8310082F3E8
-:10243000108810BDEFF3108172B6154A536923EA74
-:10244000000005E0EFF3108172B6114A536918439A
-:10245000506181F310887047EFF3108172B60C4A17
-:10246000D3691843D061F4E770B5094C656A266AF0
-:102470002062012101FA05F502E0284600F078FE0D
-:10248000216AE0690842F8D088432662E06170BDA5
-:1024900038100020D411002002460020110C09043D
-:1024A00004BF1020120412F07F4F04BF0830120244
-:1024B0000FF2180112F0704F04BF001D1201120F2D
-:1024C000C0F11F00895C401A70470000040302023B
-:1024D0000101010100000000000000001FB50446DA
-:1024E00000F030F84FF6524000F09AFE14B19DF81B
-:1024F0000F0020700EE01FB5002408B100900424E6
-:1025000009B10191241D6B466A46E1B24FF6544071
-:1025100000F086FE9DF80E0004B010BD00F080FEB5
-:102520009DF80E0005B000BDF8B500F00BF84FF6B1
-:102530005A40F3E7F8B500F10C026B4621214FF643
-:102540006640EBE76B46002200217047F8B500F1CA
-:102550000C026B460F214FF66840DFE700B587B0ED
-:1025600000F010F8012003220690ADF80420ADF829
-:10257000062000F011F800284CBFFF209DF8000055
-:1025800007B000BD00208DF800001822002101A82E
-:1025900000F09CBE03900691CDF814D0002101A854
-:1025A000FFF71ABE18B50C46C7B0114600228DF8C9
-:1025B00000208DF81C008DF81D4022460DF11E00F4
-:1025C00000F07EFE00F02AF83F200C21ADF8040058
-:1025D000ADF8061007A8012103900691A41C0494ED
-:1025E00000F02CF800284CBFFF209DF8000048B0F8
-:1025F00010BD00B5C7B000F00AF80F2000F013F8C6
-:1026000000284CBFFF209DF8000047B000BD00220D
-:102610008DF800208DF81C008DF81D101822002167
-:1026200001A800F053BEADF8060007A902200490EF
-:102630003F22012003910690ADF80420CDF814D07C
-:10264000002101A8FFF7C8BD00B587B000208DF8B4
-:10265000000000F0E0F840F20110ADF806003F2263
-:102660000120069000F0ECF800284CBFFF209DF8F8
-:10267000000007B000BD2DE9F84107460128C7B0AA
-:10268000884615461E4608BF022003D002280CBF0C
-:10269000102000200DF11D010C1800F036F8012F5C
-:1026A0008DF81C7002D0022F18D019E002273A468C
-:1026B00041460DF11D0000F003FE2570667000F02C
-:1026C000AAF83F204FF4817100F016F8FF1C049720
-:1026D00000F0B8F8002805D5FF2009E01027E6E74C
-:1026E000472005E09DF8000010B94E9800F067F80B
-:1026F000FFE748B0BDE8F081ADF80400ADF8061082
-:1027000007A8032103900691704703220021684621
-:1027100000F0DCBD2DE9F64F0C460546012CC7B094
-:102720009B4608BF022003D0022C0CBF10200020C3
-:102730000DF11F010E18FFF7E8FF012CADF81C503A
-:102740008DF81E4002D0022C2CD02DE00227569C82
-:10275000559DDDF85091DDF84CA1DDF84881489990
-:102760003A4600F054F8A6F800B086F8028086F8E1
-:1027700003A086F804907571B47100F04CF83F2006
-:10278000ADF804004FF4827107A8ADF8061003906D
-:1027900003210A370497069100F054F8002805D564
-:1027A000FF2009E01027D2E7472005E09DF8000050
-:1027B00010B9579800F003F849B0BDE8F08FBDF8A4
-:1027C000011001800020704730B5C7B01C464A9BFD
-:1027D00000F026F800258DF800508DF821402246A3
-:1027E00019460DF1220000F06BFD00F014F83F20B7
-:1027F0004FF4837100F01BF8A41D049400F022F83C
-:1028000000284CBFFF209DF8000047B030BD0DF1FF
-:102810001F0000F055BD1822002101A800F056BD90
-:10282000ADF81C00ADF81E108DF820207047ADF8F3
-:102830000400ADF8061007A8012103900691704727
-:10284000ADF80420CDF814D0002101A8FFF7C4BCD6
-:102850002DE9F84DC7B09446DDF840E1519A559DF9
-:10286000569EDDF84CA1ADF81D108DF81C004FF000
-:10287000000BADF81FC08DF821308DF822E000F07C
-:1028800024F800F017F824F8095F668000F0CCF80F
-:102890003F20832100F0ECF8574406910D37049750
-:1028A00000F0CEF800284CBFFF209DF8000048B093
-:1028B000BDE8F08D88F800A007AC5499E4195246A1
-:1028C00008F10100544400F0FBBC8DF823201746AA
-:1028D00052998DF800B00DF1240809A8B84400F011
-:1028E000EFBC00B5C7B000F00CF8852000F090F800
-:1028F00000F0A3F800284CBFFF209DF8000047B06F
-:1029000000BD00218DF81C008DF80010182201A8D0
-:1029100000F0DCBC2DE9F841C7B04FF0000800F032
-:1029200026F80DF12300DDF844E14E9F4F9E509DA7
-:10293000529C8DF81F30C0F800E08DF800808DF8B3
-:1029400020708DF821608DF822508DF8274000F01E
-:102950006BF88620ADF8060007A90C2000F069F896
-:1029600000284CBFFF209DF8000000F08DB88DF8C6
-:102970001C0007A8417082707047F8B5C8B00546C2
-:102980000E4617461C4600F023F808A846708770CC
-:102990008DF8205000F067F88A21ADF80A103F202A
-:1029A000032100F053F8002848BFFF200ED49DF803
-:1029B000000058B94F994E98BDF801202280BDF80B
-:1029C00003200280BDF805000880002049B0F0BD5A
-:1029D00007220021684600F079BC18B5C7B004464C
-:1029E00000F01EF88DF81C40224600F049F800F077
-:1029F0001BF83F208E2100F04AF8641C049400F07C
-:102A00001FF800284CBFFF209DF8000048B010BD03
-:102A1000ADF8060007A901203F22039104907047FA
-:102A200000208DF8000070471822002101A800F056
-:102A30004DBC04903F22012003910690ADF8042084
-:102A4000CDF814D0002101A8FFF7C6BBADF80800EF
-:102A5000059108A8072104900791CDF818D000210E
-:102A600002A8FFF7B9BB1822002102A800F02EBC73
-:102A7000ADF80400ADF8061007A8012103907047D7
-:102A80000DF11D0000F01CBC48B0BDE8F081ADF8B0
-:102A90000400ADF8061007A80121039006917047C5
-:102AA00080B52948002101750176C046C046C04660
-:102AB000C046C046C046C046C046C046C046C046E6
-:102AC000C046C046C046C046C046C046C046C046D6
-:102AD000C046C046C04600F03FFCC046C046BDE808
-:102AE000014000F0B1BC18490A7D41F82200087D80
-:102AF000401C0875704770B504466078FF2802BF17
-:102B0000B4F8031001F47F41B1F5406F12D10026F3
-:102B10000D4D00E0761C297DF0B288420AD2F1B258
-:102B200055F82110204688470100F3D002D0022832
-:102B300005D006E02046BDE87040FFF70CBA002043
-:102B400070BD012070BD000028130020DFF800F0E8
-:102B5000891000202DE9F041444F064638780128BD
-:102B6000884614461D4608BF02201BD0012139703B
-:102B70000020786000F018F8010011D1012E2246E3
-:102B80002B46404602D100F063F802E01146FFF701
-:102B9000DDFF00F009F836490A6822EA06060E60F1
-:102BA00000213970BDE8F0814FF47A7018E03249A5
-:102BB000CA680020002A07D5304B314A0B600A60F2
-:102BC000C968002948BF0120704729490A6842F0B6
-:102BD00000420A6000200968002958BF01207047A0
-:102BE00070B50546FEF7DAFC0646224C2068C103A4
-:102BF00010D5FEF7D3FC801BA842F7D3032070BD8D
-:102C00001A494860012070BDFEF7C8FC801BA8422D
-:102C100019D3F3E72068C10744BF012121604CF2BA
-:102C2000FA310840A16801F08041084310F0404F9C
-:102C300002D0A2680A43A26081001CBF20F040417C
-:102C400021600028DCD120684103DDD4002070BD64
-:102C500010B507490C6844F001040C6040F8042BDF
-:102C6000BFF36F8F036010BD0000000068130020E9
-:102C70001440005810400058084000582301674590
-:102C8000AB89EFCD2DE9F04100F05CF8884608BF34
-:102C9000022055D000F05BF800F05EF801004DD145
-:102CA0002968DFF8D470042908D1786940F48030AD
-:102CB00040F00400786100F04FF819E04FF0FF3168
-:102CC000C8F800106E6800E0761C6968AA685118A0
-:102CD0008E4208D2304600F043F800F03DF8010083
-:102CE000F2D0C8F800607A69DFF890100A407A6183
-:102CF00039688A050FD53A6822F400723A6039685B
-:102D000041F4006139603A6822F400623A6039683F
-:102D100041F4007139603A6851050FD5396821F4E2
-:102D2000806139603A6842F480523A60396821F42F
-:102D3000805139603A6842F480623A600021217023
-:102D4000BDE8F0810F4C054620780128704700202F
-:102D500001216060217070474FF47A70FFF740BF27
-:102D600007490A6822F4FF6242EAC00242F4803254
-:102D700042F002020A6070470040005805F8FFFF69
-:102D8000144000586813002001460648064AC379DB
-:102D90008B4218BF904218BF0838F8D18B4218BF39
-:102DA00000207047F873FF1F0070FF1F0249016089
-:102DB00002490161704700BFF72D0008212E00086D
-:102DC00000F0B8BB6B486C49016001F12002426021
-:102DD00001F13002826001F13C02C26001F1440263
-:102DE000026101F16002426101F1640282617031AD
-:102DF000C16100F0A7BB38B50446604D05F1100075
-:102E000000F0CAF85B494868A1680160E168C160E8
-:102E1000456005F11001816000F0B0FB58482DE0DD
-:102E200080B554494A6813680120187200F0ACFB61
-:102E3000002002BD38B5524C504D07E0694605F1FF
-:102E4000100000F0D5F800982168884705F11000BF
-:102E500000F0A5F80028F1D031BD49484168084785
-:102E600038B50446474D2846006040604148C06878
-:102E7000A1680160456000F08CFB43482168016057
-:102E800061684160002032BD80B53A49CA68136864
-:102E90001020187200F083FB002002BD3549CA687B
-:102EA000394910680B68184738B5374C354D06E07E
-:102EB0006946284600F09CF80098616888472846D3
-:102EC00000F06DF80028F3D031BD38B504462F4D21
-:102ED0002846006040602E48006040602548006938
-:102EE000A1688160E168C160056121680160616875
-:102EF0004160216941616169816131BD80B50146EF
-:102F0000234800F05FF8BDE802400FF2090000F02E
-:102F100056BB000038B5174C1D4D08E069462846E1
-:102F200000F066F800992069006900F04BF8284627
-:102F300000F035F80028F1D031BD10B5154C204611
-:102F4000006040600B4841690C60BDE8104000F033
-:102F50004ABB1CB50F4C06E06946204600F048F815
-:102F60000098C046C046204600F019F80028F3D06B
-:102F700013BD000000000320B409032088080320CB
-:102F8000C4130020A0080320CC1300202C0A032027
-:102F9000BC130020340A0320006040607047EFF348
-:102FA000108172B6026882420CBF012000201CE032
-:102FB000EFF3108272B603680B6048600160086826
-:102FC000416023E0EFF3108272B6086043684B6003
-:102FD00041604868016019E0EFF3108172B6436800
-:102FE00002681A6042680068426081F31088704786
-:102FF00010B5EFF3108472B602680A600068FFE74C
-:10300000FFF7EAFF84F3108810BD086082F3108890
-:1030100070470000BFF34F8F284929480A6802F41F
-:10302000E06202430A60BFF34F8F00BFFDE710B5B7
-:103030002448254C88B0016841F400410160FFF745
-:103040005DF922490020FEF798FD00F0ECFA01211D
-:103050000120FFF758F9002000F012FC012000F0D9
-:103060000FFC022000F00CFC012000F030FC0121DC
-:10307000002000F042FCFFF7A5FE154A00210220C7
-:10308000FFF7BBF904F23C500FF2490100900191A7
-:1030900069460FF2450000F079F804F2547002908E
-:1030A00004F5C96140F23C5005900391049402A8D4
-:1030B000FFF70BFFFFF784FE08B010BD0CED00E03A
-:1030C0000400FA050800005828000320E012002040
-:1030D000CF3100087047000038B5406800F10B059B
-:1030E0002988B1F5124F15D1002000F0FBFBA8781C
-:1030F0004FF0005478B92178022908BF20702FD0F2
-:1031000000F0A0FA00210120FFF7FDF8BDE83140F2
-:10311000FEF74CBE31BD0020FFF7E0F9FF281FD0BD
-:1031200028B1002000F0D3FB00F01DF8FCE7207868
-:10313000022809D100212170FFF7F6F9002000F0E4
-:10314000C6FB00F010F8FCE70220207000210020F0
-:10315000FFF7D1F9002000F0BAFB00F004F8FCE71B
-:10316000FFF758FF00BF0121002000F025BC704789
-:103170004FF0FF30FFF7DEB800210220FFF74AB919
-:103180000220FFF769B90220FFF76EB97FB50C4640
-:10319000484D6168484EE8612962284600F030FCDD
-:1031A0002468746006F1080000604060012000F0AF
-:1031B0005DF801203070296841B10FF2D5000FF29F
-:1031C000D902009001920294684688477FBD3EB5BF
-:1031D000384C394D02E00098FFF790FE05F10800E9
-:1031E000FFF7DDFED8B92878002818D0694605F128
-:1031F0000800FFF7FDFE01202870E1690029EAD0F0
-:103200000098029001A888479DF8040028700028C3
-:10321000E1D1009905F10800FFF7CAFEDEE737BDEE
-:103220002DE9F04105460E4690461C46002000F070
-:103230001DF8214F7868A0F80950C6723246414601
-:103240000C30FEF72DFF1B4A136900210020984720
-:1032500048F2E800FFF797FF79688A78D21C04F1FA
-:103260000800FEF71DFFBDE8F04101201CB5114923
-:10327000124C096A20B901B188470020207013BDA3
-:103280000120207011B1BDE81C40084713BD0000AB
-:103290000020FFF775BF000010B50146064C04F191
-:1032A0000800FFF78FFE04F10800BDE81040FFF7AB
-:1032B00063BF00000413002090130020E4130020DB
-:1032C00010B50446FEF7ECFE204610BD10B50446CE
-:1032D00010460A460146204600F09CFB204610BDE1
-:1032E0001CB541780024FF2934D1B0F80310444ABA
-:1032F00040F60143C91A02D016391AD02AE0538881
-:10330000B0F807105B1C99420BD100218DF8041016
-:1033100000F10D0200920124B0F80B108DF8051099
-:1033200015E0D288521C914214D101248DF804403A
-:1033300006E0117A71B11472032101248DF8041092
-:1033400000F10D020092B0F80B008DF80500684600
-:1033500000F0A4FB204616BD10B586B02948284CC5
-:10336000FFF7C1FB0094082301220FF29C01022009
-:10337000FFF781F9002104910191A01C05900A2218
-:1033800001230421039202930091042320880FF269
-:1033900088020221FFF7BEF90021049102910191F8
-:1033A000201D05900A2220210392009101232088EC
-:1033B0000FF274020221FFF7ADF9A01D0590012163
-:1033C0000491029100200A220190042103920091AD
-:1033D000142320880FF260020221FFF79BF90020DE
-:1033E000207206B010BD80B500910122044881888A
-:1033F0000272012300880022FFF7E6F902BD0000F7
-:10340000A0130020E13200088FE5B3D52E7F4A9843
-:103410002A487ACC20FE000019ED82AEED214C9DA9
-:103420004145228E22FE000019ED82AEED214C9D19
-:103430004145228E23FE000019ED82AEED214C9D08
-:103440004145228E24FE000070470000C0680840FD
-:10345000884201D10120704700207047C0690840B0
-:10346000884201D1012070470020704710B5614C9F
-:1034700002212046FFF7F2FF38B16068C0438107A0
-:1034800003D5FFF711FD022018E001212046FFF7C8
-:10349000E5FF38B16068C043C10703D5FFF7CAFC38
-:1034A00001200BE008212046FFF7D8FF38B1606803
-:1034B000C043010703D5FFF74CFD0820A06010BDF5
-:1034C00010B54C4C00F033F818B96068C043810364
-:1034D00006D400F02CF830B96068C043810302D5EF
-:1034E000BDE8104064E0082100F022F870B960687F
-:1034F000C04301030AD560683F4940F40020606082
-:10350000086880474FF40020A06010BD202100F023
-:103510000FF858B96068C043810207D5606840F46D
-:1035200000106060BDE81040FFF797BC10BD02219D
-:1035300020468BE740BF20BF3048016841F400417E
-:103540000160704780B52E48016841F48011016028
-:10355000006800F48010009000982648016841F04F
-:1035600001010160026842F4803202602C20FEF703
-:1035700032F9BDE802402D20FEF72DB9214801683F
-:1035800049084900016070471F494FF480300860C6
-:1035900070471C48016821F002010160704719481A
-:1035A0004FF400314160016821F40031016070473F
-:1035B0001448016841F400310160FFF76FBC38B571
-:1035C00004460C4D08212846FFF740FF30B10A4859
-:1035D0000460686820F40020686031BDA0474FF4A3
-:1035E0000021A96031BD0748016821F00801016090
-:1035F00070470000000C0058DC1300200C04005839
-:1036000050000058040C0058080C0058484900E0CD
-:10361000484981B00A6802430A600968084000907E
-:10362000009801B0704780B500F015FB00F015FB65
-:103630004148016841F48031016000F01DFBBDE8A4
-:1036400001400EE000B587B068460FF200211C2251
-:10365000FEF736FDFFF771FC6846FEF777FF07B00F
-:1036600000BDF0B585B068461421FDF79DFF00262A
-:103670000025002400210FF2D40000EBC102907954
-:1036800088B11368B3F1904F08D02C4FBB4208D0DB
-:103690002B4FBB4204BF9088044304E0908806434C
-:1036A00001E090880543491C2029E4DB00200290BA
-:1036B0000121032003900191B0B288B10090012054
-:1036C000FFF7A4FF0120FFF7A3FF69464FF09040EA
-:1036D000FDF76EFF0022B1B24FF09040FEF72CF8DC
-:1036E000A8B280B100900220FFF790FF0220FFF700
-:1036F0008FFF124E69463046FDF75AFF0022A9B2ED
-:103700003046FEF719F8A0B280B100900420FFF710
-:103710007DFF0420FFF77CFF094D69462846FDF731
-:1037200047FF0022A1B22846FEF706F805B0F0BD1B
-:103730004C0000584C010058900800580004004804
-:10374000000800480020FDF7A0BB00000000004872
-:1037500001000000000000480100000000000048D7
-:1037600001000000000000480100000000000048C7
-:1037700001000000000000480100000000000048B7
-:1037800001000000000000480100000000000048A7
-:103790000100000000000048010000000000004897
-:1037A0000100000000000048010000000000004887
-:1037B0000100000000000048010000000000004877
-:1037C0000100000000000048010000000000004867
-:1037D0000100000000000048010000000000004857
-:1037E0000100000000000048010000000000004847
-:1037F0000100000000000048010000000000004837
-:103800000100000000000048010000000000004826
-:103810000100000000000048010000000000004816
-:103820000100000000000048010000000000004806
-:1038300001000000000000480100000000000048F6
-:10384000010000000000004801000000000000002E
-:1038500000000000000000004C370008200003209A
-:103860002400032020040400DFF81C1181B00A6842
-:1038700002430A60096808400090009801B0704750
-:1038800078B585B0044600F07AF80220FFF7ECFF27
-:1038900000F010F800950120019000210220039013
-:1038A0000291694656F82400FDF782FE00F009F8FF
-:1038B00006B070BD0FF2E000DFF8D06030F81450B1
-:1038C000704756F8240000222946FDF735BF0FF255
-:1038D000C801DFF8B83031F8101053F82000012289
-:1038E000FDF72ABF0FF2B001DFF8A03031F8101059
-:1038F00053F820000022FDF71FBFF0B585B0054644
-:103900000C4600F03CF80DB9042004E0012D18BF6E
-:10391000022D02D10820FFF7A7FF2000DFF870601A
-:103920000FF27C070DD137F81500009000210191AE
-:10393000012002900221039100F01CF80120C046F2
-:10394000C046012C14D137F8150000900121DFF892
-:1039500044000190029100F00DF80FF24C00445D1C
-:1039600000220F2160B2FDF719FF60B2FDF733FFAF
-:1039700005B0F0BD694656F82500FDF719BE68464A
-:103980001421FDF711BE00004C0000586C100020FF
-:10399000781000200000211020000100020000002B
-:1039A00010000100020000000A060700114801682B
-:1039B00041F480710160704710B50C460E49002833
-:1039C000086805D1810507D500F06EF920B110BD5A
-:1039D000810558BF00F062F90848016821F0040130
-:1039E000012C016001D130BF10BD40BF20BF20BFFE
-:1039F00010BD0000000400581404005810ED00E051
-:103A00000249016002490161704700BF612E000850
-:103A1000892E000862F30F2262F31F42401810F053
-:103A2000030308D0C91A1FD3DB0748BF00F8012DD4
-:103A300028BF20F8022D130030B414461546103963
-:103A400028BF20E93C00FAD8490728BF20E90C002C
-:103A500048BF40F8042D890028BF20F8022D48BF38
-:103A600000F8012D30BC7047C91818BF00F8012DAF
-:103A7000CB0728BF00F8012D7047000000EB810044
-:103A8000614AD0F88010914201D001207047002097
-:103A9000704742F4806240F8212070472DE9F843D6
-:103AA0000546DFF868912879DFF86481594E20B126
-:103AB000012826D003286AD016E029680A78012A4E
-:103AC0004FF0006004D0022A10D0072A11D00BE07A
-:103AD00000227274306028686A79411C521E304698
-:103AE000FEF7DEFA00213174BDE8F1830121717423
-:103AF000F0E701208DF8000069460220FFF773FC13
-:103B0000F2E76C79002702214046FFF7B7FF002853
-:103B1000F9D1FFF74CF822E0296806F1080339448F
-:103B20001844FEF7BDFA00F07FF8D6E902233168A9
-:103B30000120FFF70FF8D6F800C0D6E90201DCE952
-:103B400000238B4208BF824209D10CF1080030608B
-:103B5000307CC0F10800241AC71900203074307C72
-:103B6000C0F108029442D7D2FFF72FF800F058F8BE
-:103B7000002CB9D02868337CC11906F10800224610
-:103B80001844FEF78DFA307C24183474ACE7307C8E
-:103B9000D0B102214046FFF771FF0028F9D1FFF7AD
-:103BA00006F804E000F040F80120FEF7D3FF31688A
-:103BB000D6E90223D1E900459D4208BF9442F1D1E4
-:103BC000FFF703F800F02CF8707C90B101288BD13E
-:103BD0004FF0005100200870BFF34F8F0E490F487F
-:103BE0000A6802F4E06202430A60BFF34F8F00BF2D
-:103BF000FDE7FEF773FC0020FEF770FC01210020BA
-:103C0000FFF7DAFEFAE700000004008010400058D9
-:103C100000140058501300200CED00E00400FA05D9
-:103C200000220221404634E7D9F80000C00C10F011
-:103C30000100F9D170470000032010B5FDF7A1FD88
-:103C40000F200020C0460024002814BF012400F0EB
-:103C500011F8204610BD064805E00548016841F00E
-:103C6000020101607047016841F001010160704785
-:103C7000042004E07047000080B5FFF763FD0221D7
-:103C800000910023044800F124014FF48052001DEC
-:103C900000F02CF801BD000014000020104801685D
-:103CA00041F480410160704710B50D4A0D4B10681A
-:103CB00020F48040106032211C680B48B4FBF0F007
-:103CC000484351698B0506D5002818BF401EF8D11E
-:103CD00001E0002010BD50698105FAD5032010BD18
-:103CE000000400588410002040420F0010B5029CD0
-:103CF000016042600021C160016141618161038115
-:103D0000A107047704D5008910B14FF0FF3010BD32
-:103D1000002010BD4748484A01681268B1F1006FA1
-:103D20000AD3120302F47F22444882188A4203D342
-:103D300008684349884201D000207047012070473D
-:103D400080B5404940480860016881F308884068B0
-:103D5000804730BF01BD10B5FFF7DCFF4FF00054C6
-:103D600020B100202070BDE81040E9E7012020705C
-:103D700007206070FF20A07010BD38B5334C20685C
-:103D8000C00002D4206880011AD54FF00055287871
-:103D900028B9FFF7BFFF10B1FFF7D2FF12E0287874
-:103DA00048B9FFF7B7FF30B90120287007206870C5
-:103DB000FF20A87006E02878012818BF022801D04B
-:103DC000FFF7C9FF2248016841F47001016000203B
-:103DD000FEF7DAFF40B180791E49A160A16821F4A5
-:103DE0007C5141EA0021A1604FF0B040016841F4EC
-:103DF0008031016018490A68D208D20042F00102FD
-:103E00000A600A6802F00702012AFAD101688903F0
-:103E1000FCD581688908890041F0020181608168D0
-:103E200001F00C010829FAD1016849084900016034
-:103E300031BD00004071000880400058FCFFFF07C2
-:103E4000298A449408ED00E00070000894000058AE
-:103E500088ED00E0FECAFECA0040005801000000E4
-:103E60000300000005000000010000000100000048
-:103E7000060000000A000000200000000200000010
-:103E800004000000080000001000000040000000D6
-:103E9000800000000001000000020000A086010078
-:103EA000400D0300801A060000350C0040420F0050
-:103EB00080841E0000093D0000127A000024F400F6
-:103EC00000366E010048E801006CDC0200000000D2
-:103ED00000000000000000000000000038B50400F1
-:103EE00044D094F8210028B9002184F820102046FD
-:103EF000C046C04600F049F8FF2510B100F03FF879
-:103F000034E02168DFF8B0008A6802408A602168E6
-:103F10008A68636820690343A06903431A438A607F
-:103F20002168E068086120680169A26841EA0241ED
-:103F300001612068C16821F08001C1602068C16C06
-:103F400089088900C1642168CA6CE3696069034318
-:103F50001A43CA6420688168880609D400F020F8F2
-:103F600030B120684562042100F01FF8012032BD05
-:103F700020684562012184F82110002032BD2068AC
-:103F80004562042184F821107047022084F8210042
-:103F9000CA2021684862532022685062204626E0E9
-:103FA00020460BE02068C0F8248084F8211000200F
-:103FB00084F8200070470000BFFF8FFF70B50446F3
-:103FC00040F2E9362068C16821F0A001C160FDF728
-:103FD000E5FA05462068C168880606D4FDF7DEFAD2
-:103FE000401BB042F6D3032070BD002070BD70B5F9
-:103FF00004462068C1684A0612D44FF0FF32C260FE
-:1040000040F2E936FDF7CAFA05462068C16848065D
-:1040100006D4FDF7C3FA401BB042F6D3032070BDAF
-:10402000002070BD10B5FFF707FE404CE06840016E
-:104030000ED5E068C0000BD4FFF7B8FCFFF7B6FC64
-:10404000A06840F48030A060A06820F48030A060B8
-:1040500000F04BF8FFF7AAFCFFF7A8FCA06840F0BF
-:104060000100A060A0688007FCD5E06820F4404013
-:1040700040F48040E060E06840084000E060206973
-:1040800040F00100206120698007FCD500222068F3
-:1040900020F040602060264801680260026902F05A
-:1040A00050020261FFF782FCFFF780FCA06820F459
-:1040B000407040F48070A0600F21A06840F4004080
-:1040C000A0601C4C1C48816047F6FF71C160046011
-:1040D000FFF704FFA068C008C000A060FEF7A7FFBC
-:1040E0004FF0FF30FEF726F9FAE7144881B0016877
-:1040F00041F4801101603F21006800F480100090BD
-:1041000000980F4841604161016841F47C110160F1
-:10411000026942F47C120261016841F03F010160D2
-:10412000026942F03F02026101B070478800005806
-:104130008008005800280040E0120020500000587D
-:10414000040C005819E050F8042BD30744BFA9F120
-:1041500001039A18091F0023042942F8043BF9D2ED
-:104160005FEA817C134604D54FF0000CA2F800C032
-:104170009B1CC90744BF0021197050F8041B00297B
-:10418000E1D1704730B5016884684218416802EB9C
-:104190005103C9070BD54C4409E012F9011B12F871
-:1041A000015B002904F8015B05D5491CF9D19A424D
-:1041B000F3D10C3030BD491EF1D5F8E710B50749F1
-:1041C00079441831064C7C44163404E00A68081D12
-:1041D000114488470146A142F8D110BD6400000097
-:1041E000980000007047FEE770477047704700F086
-:1041F0000DB80020FCF75FBE0020FCF762BEFDF7A3
-:104200006CBCFFF75DB9FFF731B9000002490A68DD
-:10421000886882180A607047601000204EF6885146
-:10422000CEF20001086840F470000860BFF34F8FC1
-:10423000BFF36F8F4FF00070E1EE100A704700007F
-:1042400005FFFFFF30030000B810002080080000C9
-:1042500028000320000000002DFFFFFF9001000058
-:1042600046010000040000201DFFFFFF23020000A4
-:1042700004000000200003200000000000000000F7
-:10428000000000000000000001000000020000002B
-:1042900003000000040000000120C046002801D0F7
-:1042A000FFF78CFFAFF300800020AFF30080FFF733
-:1042B000B9FE00F000F800F001B8000007463846EB
-:1042C00000F002F8FBE7000080B5AFF30080024A7F
-:1042D00011001820ABBEFBE7260002000148804712
-:1042E000014800477B3D0008ED420008AFF3008025
-:1042F000FFF794FFFFF7D0FFFFF7FEBFFFF7FEBF0A
+:100170001BF8BDE8324000F0DEBD2068416821F484
+:1001800090414160206881687047002028702046B7
+:1001900000F0C8BE2421696020680268520852003D
+:1001A0000260204600F0F0B82068016841F00101CB
+:1001B000016020467047204600F05ABD20688168E3
+:1001C0004A067047F8B5044640F60F002568E9690D
+:1001D0002A68AB6808400DD1880602D5960602D47D
+:1001E000D80040F18980E16E00294FD02046BDE85B
+:1001F000F44008476248034204BF624E32427BD05B
+:10020000CE0709D5D70507D501262E62D4F8885028
+:1002100045F00105C4F888508D070AD5DE0708D5DA
+:10022000276802253D62D4F8885045F00405C4F8DB
+:1002300088504D070AD5DE0708D5276804253D629A
+:10024000D4F8885045F00205C4F888500D070CD545
+:10025000960601D4034208D0256808202862D4F805
+:10026000880040F00800C4F8880008050BD5550147
+:1002700009D526684FF400603062D4F8880040F059
+:100280002000C4F88800D4F88800002870D08806C0
+:1002900007D5910601D4D80003D5E16E09B12046F7
+:1002A0008847D4F8880021688A68510602D410F083
+:1002B000280F1AD0204600F0B2FDFFF77FFF0FD5C0
+:1002C00000F057F860B1DFF888198163A06F00F083
+:1002D00022FF00284CD0A06F816BBDE8F440084796
+:1002E0002046BDE8F24000F0EDBF204600F0EAFFF6
+:1002F0000020C4F88800F1BDC80209D55E0207D508
+:100300004FF4801028622046BDE8F24000F0F8BFAC
+:10031000080609D5160601D4180205D5216F39B390
+:100320002046BDE8F440084748060FD553060DD5D2
+:10033000286820F0400028602021C4F880100020A8
+:1003400020672046BDE8F24000F063BE080206D5F3
+:10035000530004D52046BDE8F24000F0D2BFC801EA
+:1003600048BF002A04D52046BDE8F24000F0CABFCD
+:10037000F1BD816821F040018160A06F70470000ED
+:1003800001000010200100042DE9F84F0446DFF8B9
+:10039000C8182768DFF8C4B83A68A068DFF8C0A8B2
+:1003A0000A402169024360690A43E1690243606EC1
+:1003B0000A4302433A6000267968E068DFF894282F
+:1003C00021F44051014379609742A1691CBF206A22
+:1003D0000143BA68DFF8680A02401143B960B046C9
+:1003E000F96A606A090940EA0111F9625F454FF450
+:1003F00000404FF480754FF400714FF480624FF469
+:1004000000634FF4805C4FF4005E4FF4804929D1C3
+:10041000DAF800B00BF0030BBBF1030F3ED8DFE8B6
+:100420000BF00237343A4FF0010AD4F81CB05746AB
+:10043000BBF5004F4FF6F07A40F01283012F09D040
+:10044000022F00F05582042F00F08E82082F00F05A
+:10045000C382F6E200F0B3FF0146606A002840F074
+:100460001C8243E2DFF8ECB75F4517D1DAF800A051
+:100470001AF4406A27D0BAF5806F09D0BAF5006F38
+:1004800003D0BAF5406F06D008E04FF0020A07E04B
+:100490004FF0040A04E04FF0080A01E04FF0100AA0
+:1004A000DFF8B0B75F45C0D1BAF1000F0BD0BAF199
+:1004B000020F49D0BAF1040F00F08280BAF1080FA0
+:1004C00000F0B180B7E300F072FF0146606A58B3F4
+:1004D000012808BF022028D0022808BF042024D009
+:1004E000032808BF062020D0042808BF08201CD0FD
+:1004F000052808BF0A2018D0062808BF0C2014D0F1
+:10050000072808BF102010D0082808BF20200CD0D2
+:10051000092808BF402008D00A2808BF802004D03E
+:100520000B2808BF284600D00120B1FBF0F00028BE
+:1005300000F08383626802EB4201884203D3130315
+:10054000834280F0A28076E3606AB0B3012808BFDE
+:10055000DFF8F008EED0022808BFDFF8EC08E9D099
+:10056000032808BFDFF8E408E4D0042808BFDFF858
+:10057000E008DFD0052808BFDFF8D808DAD0062861
+:1005800008BFDFF8D408D5D0072808BFDFF8CC08AB
+:10059000D0D0082808BFDFF8C808CBD0092808BF8A
+:1005A000DFF8C008C6D00A2808BFDFF8BC08C1D0F1
+:1005B0000B2808BF4FF22440BCD0DFF8B008B9E7E1
+:1005C00000F0ABFE0146606A0028ADD0012808BFEC
+:1005D0000220AAD0022808BF0420A6D0032808BF02
+:1005E0000620A2D0042808BF08209ED0052808BFF6
+:1005F0000A209AD0062808BF0C2096D0072808BFEA
+:10060000102092D0082808BF20208ED0092808BFCB
+:1006100040208AD00A2808BF802086D00B2808BF37
+:100620002846FAD080E7676A002FC8D0012F08BF9C
+:10063000484629D0022F08BF704625D0032F08BF97
+:1006400041F2555020D0042F08BF60461CD0052F22
+:1006500008BF40F6CC4017D0062F08BF40F6AA20AE
+:1006600012D0072F08BF18460ED0082F08BF10461B
+:100670000AD0092F08BF084606D00A2F08BF28460F
+:1006800002D00B2F00D1802054E7BAF1000F0BD01D
+:10069000BAF1020F38D0BAF1040F00F07280BAF14B
+:1006A000080F00F0A780ECE000F081FE0146606AD0
+:1006B00040B3012808BF02251ED0022808BF042528
+:1006C0001AD0032808BF062516D0042808BF08251D
+:1006D00012D0052808BF0A250ED0062808BF0C2511
+:1006E0000AD0072808BF102506D0082808BF2025F3
+:1006F00002D0092808BF402572D00A280CBF8025E7
+:100700000B286DD001256BE0606A002836D00128E7
+:1007100008BFDFF86C672BD0022808BFDFF86467DA
+:1007200026D0032808BFDFF8606721D0042808BF5F
+:10073000DFF858671CD0052808BFDFF8546717D0CA
+:10074000062808BFDFF84C6712D0072808BFDFF87B
+:1007500048670DD0082808BFDFF8406708D009288F
+:1007600008BFDFF83C6703D00A2808BFDFF834670A
+:100770007CD00B2808BFDFF8F46677D0DFF8286755
+:1007800074E000F0CAFD0146606A40B3012808BF6A
+:10079000022525D0022808BF042521D0032808BF40
+:1007A00006251DD0042808BF082519D0052808BF34
+:1007B0000A2515D0062808BF0C2511D0072808BF28
+:1007C00010250DD0082808BF202509D0092808BF0A
+:1007D000402505D00A280CBF80250B2800D0012514
+:1007E0006268B1FBF5F65008002110EB062051EBD2
+:1007F000166141E0606A002836D0012808BF4FF436
+:10080000800633D0022808BF4FF400162ED00328EC
+:1008100008BFDFF8986629D0042808BF4FF4801677
+:1008200024D0052808BFDFF888661FD0062808BF37
+:10083000DFF880661AD0072808BF4FF4002615D0CD
+:10084000082808BF4FF4802610D0092808BF4FF4AD
+:1008500000360BD00A2808BF4FF4803606D00B288C
+:1008600008BF4FF4004601D04FF40006C2460021F5
+:1008700016EB52004AEB0101002300F0BDFD0646D5
+:1008800001E04FF00108A6F54070DFF82C16884211
+:1008900080F0D1812268D660CFE1012808BF02250F
+:1008A0001AD0022808BF042516D0032808BF062541
+:1008B00012D0042808BF08250ED0052808BF0A2535
+:1008C0000AD0062808BF0C2506D0072808BF102527
+:1008D00002D0082808BF202575D0092808BF402568
+:1008E00071D00A280CBF80250B286CD001256AE046
+:1008F000606AB0B3012808BFDFF8700521D0022874
+:1009000008BFDFF840051CD0032808BFDFF8AC059E
+:1009100017D0042808BFDFF8300512D0052808BF1B
+:10092000DFF89C050DD0062808BFDFF8200508D0A9
+:10093000072808BFDFF8180503D0082808BFDFF82C
+:100940001C057AD0092808BFDFF8140575D00A28DD
+:1009500008BFDFF8100570D00B2808BFDFF80805C6
+:100960006BD0DFF8400568E000F0D7FC0146606A14
+:1009700040B3012808BF022525D0022808BF04255E
+:1009800021D0032808BF06251DD0042808BF08254C
+:1009900019D0052808BF0A2515D0062808BF0C2540
+:1009A00011D0072808BF10250DD0082808BF202522
+:1009B00009D0092808BF402505D00A280CBF80258A
+:1009C0000B2800D001256068B1FBF5F1420802EB6D
+:1009D0004102B2FBF0F632E0666A66B3012E2CD01B
+:1009E000022E08BF484628D0032E08BF42F6AA2090
+:1009F00023D0042E08BF70461FD0052E08BF41F635
+:100A000098101AD0062E08BF41F2545015D0072E68
+:100A100008BF604611D0082E08BF18460DD0092E19
+:100A200008BF104609D00A2E08BF084605D00B2E75
+:100A300008BF284601D04FF4803000F013F9B6B259
+:100A400001E04FF00108A6F11000504580F0F3805E
+:100A50000AEA0601C6F3420001432068C160ECE0E7
+:100A6000012F07D0022F35D0042F70D0082F00F0AF
+:100A7000A580D7E000F0A3FC0146606A40B30128DE
+:100A800008BF022516D0022808BF042512D003286B
+:100A900008BF06250ED0042808BF08250AD005285F
+:100AA00008BF0A2506D0062808BF0C2502D0072853
+:100AB00008BF10257AD0082808BF202576D009283D
+:100AC00008BF402572D00A280CBF80250B286DD0A6
+:100AD00001256BE0606AB0B3012808BFDFF864133A
+:100AE00033D0022808BFDFF860132ED0032808BFD8
+:100AF000DFF8581329D0042808BFDFF8541324D096
+:100B0000052808BFDFF84C131FD0062808BFDFF800
+:100B100048131AD0072808BFDFF8401315D008285B
+:100B200008BFDFF83C1310D0092808BFDFF83413E2
+:100B30000BD00A2808BFDFF8301306D00B2808BFF7
+:100B40004FF2244101D0DFF82413606831E000F057
+:100B5000E4FB0146606A40B3012808BF022525D0A6
+:100B6000022808BF042521D0032808BF06251DD070
+:100B7000042808BF082519D0052808BF0A2515D064
+:100B8000062808BF0C2511D0072808BF10250DD056
+:100B9000082808BF202509D0092808BF402505D00E
+:100BA0000A280CBF80250B2800D001256068B1FB06
+:100BB000F5F101EB5001B1FBF0F631E0666A6EB37E
+:100BC000012E08BF484629D0022E08BF704625D006
+:100BD000032E08BF41F2555020D0042E08BF6046B6
+:100BE0001CD0052E08BF40F6CC4017D0062E08BFFB
+:100BF00040F6AA2012D0072E08BF18460ED0082EA5
+:100C000008BF10460AD0092E08BF084606D00A2E93
+:100C100008BF284602D00B2E08BF802000F022F823
+:100C2000B6B201E04FF00108A6F11000504502D223
+:100C30002168CE6001E04FF0010804F16800012155
+:100C4000002341800180436083604046BDE8F28F0D
+:100C5000710E000800800040F369FFCF00380140AA
+:100C600088000058616800EB5100B0FBF1F6704756
+:100C700090F82810CA0706D502685368C16A23F4A1
+:100C800000330B43536090F828108A0706D502689A
+:100C90005368016B23F480330B43536090F82810A2
+:100CA0004A0706D502685368416B23F480230B433F
+:100CB000536090F828100A0706D502685368816BC4
+:100CC00023F400430B43536090F82810CA0606D55E
+:100CD00002689368C16B23F480530B43936090F8D0
+:100CE00028108A0606D502689368016C23F4005325
+:100CF0000B43936090F828104A0610D50268536899
+:100D0000416C23F480130B435360436CB3F5801F95
+:100D100005D15368816C23F4C0030B43536090F8F2
+:100D200028100A0606D501684A68C06C22F4002221
+:100D300002434A607047F8B5044604F17C05002080
+:100D4000E8606FF07E4700F0DBFB06462068016834
+:100D50000A0708D50097334600224FF400112046B9
+:100D600000F016F860B9206801684A070AD50097B4
+:100D7000334600224FF48001204600F009F808B104
+:100D80000320F2BD20206860A86000202870F2BD1A
+:100D90002DE9F041069C05460E4690461F46286800
+:100DA000C1693140B1420CBF01200020404528D12B
+:100DB00014F1010FF3D000F0A3FBC01B844200D359
+:100DC0004CB92868016821F4D071016000F01CF86A
+:100DD0000021017013E0286801684A07DFD5C16966
+:100DE0000A05DCD54FF4006101622868026822F42C
+:100DF000D0720260002200F007F8C1600270032088
+:100E000000E00020BDE8F0812868816849084900B9
+:100E1000816005F17C00202141608160704701689C
+:100E20000A6822F490720A60DFF8981002689368EA
+:100E30000B4093602022C0F884200021C1667047D7
+:100E4000FFF4FF1100127A0000093D00AAB028004B
+:100E500080841E00006A18005558140040420F009C
+:100E600020A1070090D0030048E801000024F4000E
+:100E7000806A00F1560100220A810A8000F022BA3D
+:100E80000000127A0000093D00AAB0280080841EEC
+:100E900000006A18005558140040420F0020A107B6
+:100EA0000090D0030048E801000024F4005515002C
+:100EB00000CC0C0000AA0A0000FD0F005461510094
+:100EC00000D43000FEFFFFEF574900E0574981B0E2
+:100ED0000A6802430A60096808400090009801B05F
+:100EE000704790B95248534901604FF4E132426073
+:100EF00000230C224FF400418360C36003618361CF
+:100F00004261C1618362FFF719B97047002804BFCD
+:100F10004748FFF757B9704718B94548406F00F088
+:100F200030B9704770B586B004466846142100F0A9
+:100F3000EDFA25683F4EB54262D10220FFF7C6FFA9
+:100F40000221019100220292402000F05BF83B4D0B
+:100F5000284600F0DFFA0220FFF7B8FF02210191D6
+:100F600000220292802000F04DF8284600F0D2FACC
+:100F70000120FFF7ABFF0221019102914FF40060C5
+:100F800000F040F84FF0904000F0C4FA2C482D4D8E
+:100F9000816A8908890041F00101816200220168AB
+:100FA00041F4804101600F21006800F48040059009
+:100FB0000598242000F08AFB242000F0A4FB0220E6
+:100FC000FFF782FF0420FFF77FFF1F4828600F21F3
+:100FD000696000201022E86080216861A861E861F2
+:100FE0002862AA602961284600F030F86567AC6283
+:100FF00000220F213A2000F069FB3A2000F083FB29
+:1010000006B070BD03210090039107220492694647
+:10101000704700680749884204D1074A10680028D1
+:1010200018BF004770470000480000584C000058A7
+:101030004811002000380140E4130020000400485B
+:1010400060000058541200204404024070B50400AF
+:1010500001D1012070BD2268DFF840329A4204F1CC
+:1010600024050BD2DFF8380281181426B1FBF6F103
+:101070008900DFF830322962EB610AE0DFF82802EC
+:1010800081181423B1FBF3F18900DFF820022962F3
+:10109000E861022169701368A068E1686FF30E13BC
+:1010A000034320690B4361690343A0690B43E16972
+:1010B0000343206A0B4303431360204600F0C2F849
+:1010C000A068B0F5804F04BF00216160696A207993
+:1010D00000F01BF838B1052805D2204600F0CFF803
+:1010E00000F00CF803E0002028636863A863002187
+:1010F000A961012068702970002070BD296B002053
+:101100000860696BA86B486070470860A96AE86A64
+:1011100048606068704738B500F1240200245178B7
+:10112000022903D004209061012428E001680B68A3
+:1011300023F00E030B6001680D686D086D000D60F3
+:10114000516A0B6823F480730B60012192F8203000
+:10115000D56903F01C0399406960936AD16A5960AC
+:10116000116B31B10B6823F480730B60536B916B7F
+:101170005960012151701470516901B188472046AE
+:1011800032BDF8B500F124010423CA69146802686D
+:10119000156891F8206006F01C0603FA06F73C4239
+:1011A00010D06F070ED51468A50603D4146824F078
+:1011B0000404146000F03DF8C968002938D0BDE887
+:1011C000F4400847022303FA06F73C4213D0AF0766
+:1011D00011D51468A50605D4146824F00A04146017
+:1011E00001224A7000F025F800220A708968F9B1DE
+:1011F000BDE8F4400847082303FA06F6344217D046
+:101200002B0715D5146824F00E041460012291F800
+:101210002030CC6903F01C039A40626001228A618D
+:101220004A7000220A70096911B1BDE8F44008470C
+:10123000F1BD91F82020CC6902F01C02934063605C
+:101240007047000010B5416C0268144B89089A423F
+:1012500039BF174C04EB8101164B03EB810181640C
+:1012600002F0FF02083A1421B2FBF1F1012301F070
+:101270001C01114AC26403FA01F1016510BD017934
+:101280000E4A0F4B836502EB81024265491E012223
+:1012900001F003018A40C265704700000804024063
+:1012A000F8FFFDBF00000240F8FBFDBF0004024054
+:1012B000000802401C08024080080240FC0802406E
+:1012C00040090240704730B4002513E050F8042B69
+:1012D000D30744BFA9F101039A18091F042942F852
+:1012E000045BFAD213468C0744BF15809B1CC907C8
+:1012F00048BF1D7050F8041B0029E7D130BC70476F
+:1013000070477047704700004FF0B040006800F031
+:10131000F000B02888BFB020704738B54FF0B04417
+:10132000304DA16811F00C0106D1FFF7EDFFC0F3BD
+:10133000031055F8200032BD04292B4A05D0082996
+:101340002A4804D12168C90222D5104632BDE1687D
+:1013500001F00301022904D0032904D12168C90244
+:1013600007D5104605E0FFF7CFFFC0F3031055F88F
+:101370002000E168E268E368C1F306214843C2F354
+:101380000211491C5B0FB0FBF1F05B1CB0FBF3F0EA
+:1013900032BD80B5FFF7C1FF1149FFE7144A096864
+:1013A000C1F3031152F82110B0FBF1F002BD80B57A
+:1013B000FFF7EFFF00F010F8C1F3022106E080B55F
+:1013C000FFF7E7FF00F008F8C1F3C22112F821107F
+:1013D00001F01F01C84002BD0149064A0968704773
+:1013E00008000058504000080024F4000048E801BC
+:1013F00010400008B4410008D3BBD9B1B2F5803F1A
+:101400005BD2022A1ED98C46B1FBF2F102FB11C35A
+:101410001B0443EA1043B3FBF2FC02FB1C3380B213
+:1014200040EA0343B3FBF2F002FB103240EA0C4007
+:1014300000237047022A05D98446B0FBF2F002FB74
+:1014400010C270474AB105D100F0010249085FEAB5
+:101450003000704700220023704700F0ABB90B004A
+:101460000200002100207047F7D3002200237047BC
+:10147000904271EB030CF2D370B5B1FA81F4B3FA78
+:1014800083F52C1BA340C4F1200532FA05F6334343
+:10149000A2405FF00046E64002E05B085FEA3202ED
+:1014A000841A71EB030524BF204629467641F4D304
+:1014B00002000B003000002170BD70B5B1FA81F45C
+:1014C000B2FA82F5C4F120046419B4F12006DAD32B
+:1014D000B2405FF00044F440002502E052085FEAA9
+:1014E0003303C61A71EB020E24BF304671466441C5
+:1014F0006D41F3D302000B002000290070BD0000F5
+:1015000001480068704700BF60100020002200F012
+:1015100053B900002DE9F04106460A464FF0000C91
+:101520004FF00F082CE0554FBE4214BF4FF0070E8E
+:101530004FF0040E0EFA01F1294344F82310C14381
+:101540004F4C236855680B40ED0348BF03432360AD
+:10155000636855680B40AD0348BF03436360494C63
+:10156000236855680B40ED0248BF0343236063685E
+:101570000B4051688D0248BF034363600CF1010CBE
+:10158000106830FA0CF172D0012303FA0CF3184002
+:10159000F4D05468022C18BF122C4FEA8C010ED1E3
+:1015A0004FEADC0406EB840401F01C0E256A08FAFD
+:1015B0000EF7BD43176907FA0EF73D4325624FEA60
+:1015C0004C0403253768A540ED4305EA070E17795B
+:1015D00007F00307A74047EA0E0737605768012F57
+:1015E00018BF022F03D0112F18BF122F11D1B768C7
+:1015F00005EA070ED768A74047EA0E07B760776885
+:1016000027EA03035768C7F3001707FA0CF73B43B1
+:101610007360F3681D40936803FA04F42C43F4608C
+:101620005468E300AAD5184C4FEA9C0354F8237081
+:1016300001F00C0108FA01F5B6F1904F27EA050513
+:1016400008BF4FF0000E11D0104FBE4208BF4FF040
+:10165000010E0BD00E4FBE4208BF4FF0020E05D058
+:101660000C4FBE427FF45FAF4FF0030E62E7BDE860
+:10167000F0810AB1816170478162704700100048B3
+:101680008008005800080058080001400004004885
+:1016900000080048000C00480901020002D43C4840
+:1016A000815470473B4B02F00F021A4402F8041CAD
+:1016B0007047394B19684FF6FF020002114000F4E1
+:1016C000E0600843354908431860704738B5324B2D
+:1016D0001C68C4F30223C3F10704052C28BF0424AB
+:1016E0001D1D072D34BF0023DB1E012505FA04F460
+:1016F000641E2140994005FA03F35B1E1A40114312
+:10170000BDE83440C8E7010007D4012200F01F0102
+:10171000234B8A40400943F82020704701000BD436
+:10172000012200F01F011F4B8A40400943F820208E
+:10173000BFF34F8FBFF36F8F704710B5401EB0F1EE
+:10174000807F01D3012010BD174C60600F214FF046
+:10175000FF30FFF7A1FF0021A160072020600020DB
+:1017600010BD010007D4012200F01F010F4B8A4079
+:10177000400943F820207047010007D4012200F0FF
+:101780001F010B4B8A40400943F82020704700009E
+:1017900000E400E018ED00E00CED00E00000FA05C8
+:1017A00000E100E080E100E010E000E000E200E0A5
+:1017B00080E200E07047000000B500BF13009646CD
+:1017C0009446103928BFA0E80C50FAD85FEA417C53
+:1017D00028BF0CC048BF40F8042BC90728BF20F819
+:1017E000022B48BF00F8012B00BD0000DFF8FC14FD
+:1017F0000A6892B200E00246086880B28242FAD1DA
+:1018000070472DE9F041DFF8E864DFF8E8843178CB
+:10181000044618256843062908EB000708D13078EC
+:101820007070347079754FF0FF30706000203DE0CB
+:1018300000F07BF8B9680918B96008F10803B968C5
+:1018400032786A439A589142327813D308F11503DB
+:1018500015FB02FC13F80C30062B29D008F1080602
+:101860006B43F358994222BF08F115036A439A5C0F
+:10187000ECD21DE01146337869439A420FD008F14B
+:10188000140C08F1150E1CF8013015FB03F50EF8C9
+:1018900005407A753B7508F11402545403E008F1D1
+:1018A00014037A755C54317871703470BDE8F0813E
+:1018B0001146694308F115035B5C062B04D008F15F
+:1018C000140615FB03F574557B753A7508F115027E
+:1018D0005454EBE7F0B5DFF81834DFF818541E78ED
+:1018E000182402466243B0422A4404D11878587042
+:1018F000547D1C700FE0167D507D92F815C005F1E7
+:1019000015076643062807F806C004D0167D14356F
+:1019100014FB00F42E55012010731A78062A02BF1A
+:1019200000294FF0FF305860F0BD10B5DFF8C0431C
+:10193000606810F1010F10D0FFF758FF6168DFF801
+:10194000B82381422FBF636861685388CB185178F0
+:101950001278181A4843D04000E0002080B210BD31
+:101960002DE9F84FDFF89053DFF890B3D5F80880F1
+:10197000D8F80000DBF800104A0500F07AF9DFF82B
+:101980007063DFF870A321F4806181604FF0180963
+:1019900034780AF1080019FB04F14758FFF7C5FF36
+:1019A000874211D200270121B170062C3FD019FBCC
+:1019B00004F40AF108010A59824210D200230B51A3
+:1019C0000AEB04014C7DF0E7A9884118B94202D224
+:1019D000AF880021E8E701223F1AB270E5E70A5913
+:1019E0000AF10803121A1A51EAE7022802DA2878E3
+:1019F000012800D07F1ED8F80000C1684A07FAD538
+:101A000000F02AF9DBF80C00000CBFB247EA0047EF
+:101A1000CBF80C70FFF7EAFE7060A8680068816878
+:101A200041F480618160AFF30080BDE8F18FB8B20E
+:101A30000028DAD1FFF7DAFE70600320BDE8F24F2C
+:101A4000FFF78FBE2DE9F843EFF3108872B6AA4D69
+:101A5000A84BA8680168CA224A625320486218202D
+:101A60008A6822F480628A60A14A16783746474322
+:101A70001F44387B022823D13C68D7F81090907817
+:101A8000D8B17A7B012A0AD101213046FFF722FF23
+:101A900088F310887968304600F0F1F804E088F3A4
+:101AA0001088304600F09EF8A86800F01AF8314619
+:101AB0002246484600F02CF90DE0FFF751FF08E000
+:101AC000C8684207FCD500F086F84FF400208C4926
+:101AD000086088F31088FF22A86801684A62BDE8A0
+:101AE000F1830068CA214162532242627047F8B50F
+:101AF000814CA160CA2209684A6253237F4A4B6223
+:101B0000156845F020051560136803F00703C3F15D
+:101B10000403237095682D0C05F07F056D1C65701E
+:101B2000EDB29268C2F30E02521C628092B2521E53
+:101B30006A43A2F5A072DA404FF6FF739A422CBFB7
+:101B4000A380A2806F4A136843F4002313606E4B96
+:101B50001D6845F400251D6048BB6548012383705E
+:101B60004FF0FF3545600023624D00260C355FFACB
+:101B700083FC182717FB0CFC5B1CDFB205F80C601C
+:101B8000062FF4DB06230370886820F480608860E9
+:101B900000F021F84FF40021D1600320FFF7ECFDA5
+:101BA000A0680068816841F48041816005E0C868F0
+:101BB000410544BF0320FFF7D4FDA1680A68FF2058
+:101BC0005062002203210320FFF780FDBDE8F240B0
+:101BD0000320FFF798BDC86800F0800060F49060B3
+:101BE000C8607047F8B50746EFF3108472B603205B
+:101BF000FFF794FD404DAE683068FFF773FF3B463A
+:101C0000182042494343CA5C022A1BD100213846AE
+:101C1000FFF760FE3648017806290ED13068374953
+:101C20000A68530500F025F821F480618160C168DD
+:101C30004A07FCD500F010F804E04078884218BF4D
+:101C4000FFF78EFEA9680A68FF2050620320FFF7A5
+:101C50005AFD84F31088F1BDC16801F0800161F480
+:101C60009061C1604FF40020254908600320FFF710
+:101C700083BD02D5C1684A07FCD4816870472DE94D
+:101C8000F04180460F46424618201A4942438C18BC
+:101C9000237B022B04BF4046FFF7A4FFEFF3108520
+:101CA00072B60320FFF73AFD134EB068FFF719FF35
+:101CB00002202073A76067604046FFF7A2FD0C4931
+:101CC0000A784978914202D0FFF74AFE02E0A16803
+:101CD000081AA060FF20B1680A6850620320FFF76D
+:101CE00012FD85F31088BDE8F0810000282800402F
+:101CF000D8130020B81000209813002008280040B6
+:101D00000C0800580008005880080058C410002033
+:101D10001047000030B595B009A88549854C0FF2F1
+:101D20006525302200F054F90094019569460FF2C0
+:101D30003D2000F059F90121022000F038FA7E4AD6
+:101D40000021012000F0AAFA09A800F043FB0020BE
+:101D5000ADF81A0000F052FB00F0D0F80246062160
+:101D6000002000F076FB4EF66E51744A0891062171
+:101D70001068079007AA2E2000F06BFB8AA21021A2
+:101D8000182000F066FB00BF8BA21021082000F095
+:101D900060FB1821012000F07DFB00F0B2FB0DF18B
+:101DA000160006A90190009105AB07220021012031
+:101DB00000F045FD78A0BDF8181000900723BDF88D
+:101DC0001400002200F05AFC0DF11A0000900223CA
+:101DD000BDF81610BDF81400002200F04FFC0020E2
+:101DE00000F0EAFC002004901023554903910820DC
+:101DF000002201930090029200230121012000F0B3
+:101E0000EFFC00F0B3FD4F484FF400410160016F5B
+:101E10000220019001F0FF014FF000504278029241
+:101E2000062A0ED200210170BFF34F8F4649474862
+:101E30000A6802F4E06202430A60BFF34F8F00BFFA
+:101E4000FDE7837803939B1899423CBF891A03915D
+:101E500000F020FE694601A800F08EFE00F02AFE88
+:101E600000F04CF83A4942790A7203794B72C27811
+:101E70008A728378CB7242780A7303785B1C4B7347
+:101E8000062142798DF8052003798DF80430C27857
+:101E90008DF8032083788DF8023042788DF8012088
+:101EA0006A460078401C8DF80000002000F0D1FA4E
+:101EB00000F00AF815B030BD80B54078052808BF9D
+:101EC00000F002F8012002BD00B587B000200690A6
+:101ED000059000223CA00492082100230290019169
+:101EE00000920393A0228021002000F014FC07B090
+:101EF0005DF804EB16490E2000F0D0BC10B50F4978
+:101F00000A6812F1010F0DD012484B6802701B0ACB
+:101F1000140A120C4470827049680371C1701B0A64
+:101F2000437110BD002000F0A7FE00B91CA010BD39
+:101F3000C8400008AC080320272000088075FF1F58
+:101F400007B20100104000580CED00E00400FA0553
+:101F500004000020B01300200021012000F0ABB9E4
+:101F6000012000F0CAB9012000F0CFB910B5044635
+:101F7000616801F1080000F009FD00B10120207046
+:101F800010BD000010B1012803D07047012000F0FF
+:101F9000A2B900F0A8B90000424C45636F72650019
+:101FA0006C7AD8AC57720000123456789ABCDEF0C6
+:101FB000123456789ABCDEF0FEDCBA0987654321FC
+:101FC000FEDCBA09876543210953544D5F4F5441E4
+:101FD0004AB1000011F8013B521E00F8013B1CBF42
+:101FE00011F8013BF8E770477FB50C466A4D616810
+:101FF0006A4EE8612962284600F052FE246805F125
+:10200000240000604060746006F1080000604060D9
+:1020100001203070296829B10FF249120092029410
+:10202000684688477FBD1FB55C4C04F1080000F08E
+:1020300044FEE8B92078D8B1694604F1080000F000
+:1020400065FE012054492070C96941B10098029091
+:1020500001A888479DF804102170080003D000985B
+:1020600000F007FF04E0009904F1080000F02EFEE4
+:1020700004F1080000F021FE28B9207818B104F11D
+:102080000800FFF769FF1FBD2DE9FC410446002051
+:1020900000F05EF866882088A268DFF8FC80C6F34E
+:1020A000090646EA8026E068B6B2C1B2304600F0C2
+:1020B0003BF8002548F2E800FFF755FF08E0788874
+:1020C000B04202D1226939781170787800B10125C7
+:1020D00008F1240000F0F1FDF0B9694608F1240090
+:1020E00000F014FE0098014600F10B07487A0F2813
+:1020F000E5D0B7F80100B0420CD1887A6169C01E02
+:10210000C0B28842C8BF0846606102462069F91C17
+:10211000FFF75EFF3878D9E72800CBD0012000F028
+:1021200017F80020BDE8F68110B513461B4A546825
+:10213000A4F80900E1720A46194604F10C00FFF701
+:1021400047FF154A1369BDE81040002100201847D9
+:102150001149096A08B921B1084700291CBF0120AB
+:102160000847704710B50146487A0F2818BF0E2857
+:1021700007D10B4800F0B4FDBDE810400020FFF788
+:10218000EFBE064C04F1080000F0AAFD04F10800BF
+:10219000BDE81040FFF7E0BEB41200207813002025
+:1021A000D81200200C48002101604160704710B532
+:1021B00000F00CF85C6819B1012904D1204301E05A
+:1021C00024EA0000586082F3108810BDEFF31082FB
+:1021D00072B6014B70470000B81300202DE9F041A2
+:1021E000544CDFF85481A5692840A06131E0491CB6
+:1021F00054F831000742FAD004EBC107184079685F
+:102200001040014204BF4FF0FF327A607E683040D8
+:1022100000F094F86062012101FA00F086437E60CC
+:10222000EFF3108272B6606A23698140C9430B40A4
+:102230002361022004EBC00353F8087C0F40401ECA
+:1022400043F8087CF6D182F31088606A58F82010B1
+:10225000884763692069A2691840104207D0E06985
+:10226000216A084203D1002103EA0207C0E7C04601
+:10227000C046EFF3108872B621696069A269014017
+:10228000114201BFE069216A084200F0ECFE88F3C8
+:102290001088C046C046A561BDE8F08138B5144637
+:1022A000EFF3108572B600F049F8234941F8204059
+:1022B00085F3108831BD30B5EFF3108272B61D4B37
+:1022C0001C6904431C6153F83150284343F8310022
+:1022D00082F3108830BDEFF3108172B6154A53694E
+:1022E00023EA000005E0EFF3108172B6114A53694A
+:1022F0001843506181F310887047EFF3108172B674
+:102300000C4AD3691843D061F4E770B5094C656A8B
+:10231000266A2062012101FA05F502E0284600F054
+:10232000A3FE216AE0690842F8D088432662E06192
+:1023300070BD000038100020D4110020024600209B
+:10234000110C090404BF1020120412F07F4F04BFC7
+:102350000830120205A312F0704F04BF001D1201D5
+:10236000120FC0F11F00995C401A7047040302026B
+:102370000101010100000000000000001FB504463B
+:1023800000F030F84FF6524000F0CEFE14B19DF848
+:102390000F0020700EE01FB5002408B10090042447
+:1023A00009B10191241D6B466A46E1B24FF65440D3
+:1023B00000F0BAFE9DF80E0004B010BD00F0B4FEAF
+:1023C0009DF80E0005B000BDF8B500F00BF84FF613
+:1023D0005A40F3E7F8B500F10C026B4621214FF6A5
+:1023E0006640EBE76B46002200217047F8B500F12C
+:1023F0000C026B460F214FF66840DFE700B587B04F
+:1024000000F013F800F020F8032100F009F800F0C4
+:1024100013F800284CBFFF209DF8000007B000BD56
+:10242000ADF80410ADF80610704700208DF80000DC
+:102430007047049207A9039101220692CDF814D0A7
+:10244000002101A8FFF720BE1822002101A800F0FA
+:10245000C1BE18B50C46C7B0114600F03BF88DF868
+:102460001D4022460DF11E0000F0AEFE00F027F8E0
+:102470003F21ADF804100C2200F026F8A41C0692AF
+:10248000049400F038F800284CBFFF209DF80000AD
+:1024900048B010BD00B5C7B000F00AF80F2200F038
+:1024A0001FF800284CBFFF209DF8000047B000BD7A
+:1024B00000238DF81C008DF81D108DF800301822B7
+:1024C000002101A800F086BEADF8062007A90391FF
+:1024D0000122704700228DF800208DF81C00704703
+:1024E000ADF806203F21ADF804100222049207A99E
+:1024F000039101220692CDF814D0002101A8FFF724
+:10250000C3BD00B587B000208DF8000000F0E3F8EF
+:1025100040F2011200F0F9F80122069200F0E2F810
+:1025200000284CBFFF209DF8000007B000BD2DE93A
+:10253000F84104460128C7B0884616461F4608BF22
+:10254000022003D002280CBF102000200DF11D0333
+:102550001D1800F035F8012C8DF81C4002D0022C1B
+:102560001AD01BE00224224641460DF11D0000F066
+:102570002BFE2E706F7000F0AEF800F0A6F84FF44E
+:10258000817200F017F8E41C0692049400F0AAF897
+:10259000002805D5FF2009E01024E4E7472005E0E6
+:1025A0009DF8000010B94E9800F063F8FFE748B0BE
+:1025B000BDE8F081ADF8062007A90391032270471A
+:1025C00003220021684600F005BE2DE9F64F0C46B7
+:1025D0000546012CC7B09B4608BF022003D0022C41
+:1025E0000CBF102000200DF11F031E18FFF7E8FF9D
+:1025F000012CADF81C508DF81E4002D0022C2BD0BF
+:102600002CE00227569C559DDDF85091DDF84CA139
+:10261000DDF8488148993A4600F053F8A6F800B032
+:1026200086F8028086F803A086F804907571B4716C
+:1026300000F051F800F049F84FF4827207A9ADF8A4
+:10264000062003910A3703220497069200F04AF805
+:10265000002805D5FF2009E01027D3E7472005E033
+:102660009DF8000010B9579800F003F849B0BDE894
+:10267000F08FBDF8011001800020704778B5C7B019
+:102680001D464C9B00F034F800268DF800608DF854
+:1026900021502A4619460DF1220000F095FD00F068
+:1026A0001AF800F012F84FF4837200F028F8AD1D0C
+:1026B00000F016F800284CBFFF209DF8000049B03C
+:1026C00060BD0DF11F0000F07FBD3F21ADF804108B
+:1026D00070478DF800301822002101A800F07ABD63
+:1026E00006920495CDF814D0002101A8FFF7CCBCC8
+:1026F000ADF81C00ADF81E108DF820207047ADF825
+:10270000062007A9039101227047ADF806203F215A
+:10271000ADF8041070472DE9F84DC7B09446DDF8C8
+:1027200040E1519A559D569EDDF84CA1ADF81D1023
+:102730008DF81C004FF0000BADF81FC08DF8213054
+:102740008DF822E000F02CF800F01FF824F8095F63
+:10275000668000F0DAF83F20ADF804008321012004
+:10276000ADF8061000F00AF800F0D9F800284CBFC8
+:10277000FF209DF8000048B0BDE8F08D07AA57443F
+:10278000069003920D370497704788F800A007ACB5
+:102790005499E419524608F10100544400F014BD64
+:1027A0008DF82320174652998DF800B00DF12408BA
+:1027B00009A8B84400F008BD00B5C7B000F08CF817
+:1027C00000F0A3F800F09BF8852200F08BF800F0F1
+:1027D000A5F800284CBFFF209DF8000047B000BDC1
+:1027E0002DE9F043C7B0DDF838814F9E509D519FD1
+:1027F000529C8DF81C004FF0000907A88DF800903E
+:10280000417082700DF123018DF81F308DF820800A
+:102810008DF821608DF822500F608DF8274000F070
+:1028200074F8862200F065F80C2200F073F8002896
+:102830004CBFFF209DF8000047B0BDE8F083F8B51D
+:10284000C8B005460E4617461C4600F022F808A8F8
+:10285000467087708DF8205000F078F88A2200F0DA
+:1028600064F8032200F067F8002848BFFF200ED468
+:102870009DF8000058B94F994E98BDF8012022806C
+:10288000BDF803300380BDF805000880002049B082
+:10289000F0BD07220021684600F09CBC18B5C7B007
+:1028A000002304468DF800308DF81C40224600F0CD
+:1028B00052F800F02AF800F022F88E2200F04FF8CB
+:1028C000641C0692049400F02AF800284CBFFF20F4
+:1028D0009DF8000048B010BD00228DF800208DF852
+:1028E0001C007047ADF8062007A90391012204924D
+:1028F0007047ADF806203F21ADF8041070473F2126
+:10290000ADF8041070478DF800301822002101A89E
+:1029100000F060BC049207A9039101220692CDF851
+:1029200014D0002101A8FFF7AFBBADF80A203F216A
+:10293000ADF808107047059208A904910722079284
+:10294000CDF818D0002102A8FFF79EBB1822002165
+:1029500002A800F03FBC0DF11D0000F035BCADF841
+:10296000062007A903910122704700001C4900209E
+:10297000087700221B48027000F036B818490A7F19
+:1029800041F82200087F401C0877704770B5044664
+:102990006078FF2802BFB4F8030000F47F40B0F570
+:1029A000406F12D100260E4D00E0761C297FF0B258
+:1029B00088420AD2F1B255F8212020469047010002
+:1029C000F3D002D0022805D006E02046BDE87040D2
+:1029D000FFF772BA002070BD012070BD000000003A
+:1029E00028130020E813002080B5C046C046C0462A
+:1029F000C046C046C046C046C046C046C046C046A7
+:102A0000C046C046C046C046C046C046C046C04696
+:102A1000C046C046C046C046C04600F021FCC04685
+:102A2000C046C046C046BDE8014000F08FBC000073
+:102A3000DFF800F0891000202DE9F041484E0746EC
+:102A400030780128884614461D4608BF02201CD055
+:102A5000012030700021716000F019F8010012D1DE
+:102A6000012F22462B4603D1404600F06BF803E0CD
+:102A700011464046FFF7DCFF00F009F839490A68C3
+:102A800022EA07070F6000213170BDE8F0814FF4A2
+:102A90007A701AE03549CA680020002A00D47047CD
+:102AA00010B5334A334C0A600C60C968002948BF2E
+:102AB000012010BD2B490A6842F000420A60002044
+:102AC0000968002958BF0120704770B50546FEF718
+:102AD00017FD0646244C2068C10310D5FEF710FDF3
+:102AE000801BA842F7D3032070BD1D494860012018
+:102AF00070BDFEF705FD801BA84216D3F3E72068E2
+:102B0000C10744BF01222260A2684CF2FA3108409A
+:102B100002F08042104310F0404F00F00BF81CBF51
+:102B200020F0404222600028DFD120684103E0D439
+:102B3000002070BD04D0A26800F040410A43A260AA
+:102B40008100704710B507490C6844F001040C601F
+:102B500040F8042BBFF36F8F036010BD000000002E
+:102B600060130020144000581040005808400058DE
+:102B700023016745AB89EFCD2DE9F04100F05EF808
+:102B8000884608BF022057D00120207000216160D4
+:102B900000F059F801004DD12968DFF8CC70042904
+:102BA00008D1786940F4803040F00400786100F08A
+:102BB0004AF819E04FF0FF31C8F800106E6800E0E5
+:102BC000761C6968AA6851188E4208D2304600F017
+:102BD0003EF800F038F80100F2D0C8F800607A69D9
+:102BE000DFF888100A407A613A6891050FD53A6893
+:102BF00022F400723A60396841F4006139603A6841
+:102C000022F400623A60396841F4007139603A6830
+:102C100051050FD53A6822F480623A60396841F470
+:102C2000805139603A6822F480523A60396841F440
+:102C30008061396000222270BDE8F0810D4C0546AC
+:102C40002078012870474FF47A70FFF73EBF08499B
+:102C50000A6822F4FF6242EAC00242F4803242F083
+:102C600002020A60704700000040005805F8FFFFAC
+:102C7000144000586013002020B501460648074D57
+:102C8000C2798A4218BFA84218BF0838F8D18A42D0
+:102C900018BF002020BD00BFF873FF1F0070FF1F8A
+:102CA0000249034A01600261704700BF6D2D0008B0
+:102CB000972D0008006040607047EFF3108172B6F6
+:102CC000026882420CBF012000201CE0EFF310825A
+:102CD00072B603680B60486001600868416023E0D9
+:102CE000EFF3108272B6086043684B604160486839
+:102CF000016019E0EFF3108172B6436802681A6050
+:102D000042680068426081F31088704710B5EFF3A5
+:102D1000108472B602680A600068FFE7FFF7EAFFF6
+:102D200084F3108810BD086082F31088704700009B
+:102D300000F082BB6C486D49016001F120024260E5
+:102D400001F13003836001F13C02026201F14403AE
+:102D5000C36001F14C02026101F16803436101F1BA
+:102D60006C0282617831C16100F06EBB38B50446F7
+:102D70005F4D05F11000FFF79DFF5B494868A168B2
+:102D8000016005F11001E268C2608160456000F0F9
+:102D900077FB58482DE080B553494A6813680120F5
+:102DA000187200F073FB002002BD38B5514C504D35
+:102DB00007E0694605F11000FFF7A8FF00982168B9
+:102DC000884705F11000FFF778FF0028F1D031BDEA
+:102DD00048484168084738B50446474D28460060D2
+:102DE00040604149C868A1680160456000F053FB3C
+:102DF00042482168016062684260002032BD80B5AF
+:102E00003949CA6813681020187200F04AFB002084
+:102E100002BD3549CA68394910680B68184738B58A
+:102E2000364C354D06E069462846FFF76FFF00989F
+:102E3000616888472846FFF740FF0028F3D031BD7E
+:102E400038B504462E4D2846006040602D4800608D
+:102E5000406025480069A1688160E268C260056140
+:102E60002168016062684260216941616269826132
+:102E700031BD80B501462348FFF732FFBDE802406F
+:102E80000FF2050000F01DBB38B5174C1D4D08E0D2
+:102E900069462846FFF73AFF009920690069FFF765
+:102EA0001FFF2846FFF709FF0028F1D031BD10B5FC
+:102EB000154C2046006040600B4948690460BDE83D
+:102EC000104000F012BB1CB50F4C06E069462046CE
+:102ED000FFF71CFF0098C046C0462046FFF7EDFEF6
+:102EE0000028F3D013BD000000000320B809032020
+:102EF0008C080320C8130020A4080320D01300204E
+:102F00003C0A0320C0130020440A0320BFF34F8F64
+:102F1000284929480A6802F4E06202430A60BFF3C4
+:102F20004F8F00BFFDE710B52448254C88B00168DD
+:102F300041F400410160FFF735F922490020FEF716
+:102F4000D6FD00F0F2FA01210120FFF730F9002050
+:102F500000F09AFB012000F097FB022000F094FBA8
+:102F6000012000F0B5FB0121002000F0CAFBFFF7B3
+:102F7000E1FE154A00210220FFF790F904F23C51CE
+:102F8000009169460FF245020FF24500019200F0F0
+:102F900079F804F25471029104F5C96240F23C518F
+:102FA00003920591049402A8FFF74AFFFFF7C0FEC1
+:102FB00008B010BD0CED00E00400FA050800005850
+:102FC0002C000320E0120020C730000870470000EA
+:102FD00038B5406800F10B052988B1F5124F15D1BD
+:102FE000002000F07DFBA8784FF0005478B92178DC
+:102FF000022908BF20702FD000F0A6FA002101207E
+:10300000FFF7D5F8BDE83140FEF784BE31BD0020A2
+:10301000FFF7B4F9FF281FD028B1002000F058FBBB
+:1030200000F01DF8FCE72078022809D1002121706A
+:10303000FFF7CAF9002000F04BFB00F010F8FCE7A6
+:103040000220207000210020FFF7A5F9002000F0E9
+:103050003FFB00F004F8FCE7FFF758FF00BF012139
+:10306000002000F0ADBB70474FF0FF30FFF7B6B85F
+:1030700000210220FFF71FB90220FFF73EB902200E
+:10308000FFF743B97FB50C464C4D61684C4EE86183
+:103090002962284600F0B8FB2468746006F1080035
+:1030A00000604060012000F065F801203070296860
+:1030B00041B10FF2E5020FF2E9030092019302948D
+:1030C000684688477FBD1FB53D4C04F10800FFF7F7
+:1030D000F4FDE8B92078D8B1694604F10800FFF79B
+:1030E00015FE012035492070C96941B10098029050
+:1030F00001A888479DF804102170080003D00098AB
+:10310000FFF7B7FE04E0009904F10800FFF7DEFDC9
+:1031100004F10800FFF7D1FD28B9207818B104F1B7
+:103120000800FFF7A5FF1FBD2DE9F04105460E463B
+:1031300090461C46002000F01DF8214F7868A0F84A
+:103140000950C672324641460C30FEF741FF1B4A19
+:10315000136900210020984748F2E800FFF78FFF2D
+:1031600079688A78D21C04F10800FEF731FFBDE8C7
+:10317000F041012010B51149124C096A20B901B182
+:1031800088470021217010BD0120207011B1BDE8D9
+:103190001040084710BD00000020FFF76DBF000081
+:1031A00010B50146064C04F10800FFF799FD04F143
+:1031B0000800BDE81040FFF75BBF000004130020CB
+:1031C00088130020E913002010B50446FEF700FF25
+:1031D000204610BD10B5044610460A46014620465A
+:1031E00000F01CFB204610BD1CB541780024FF29CF
+:1031F00034D1B0F80310434A40F60143C91A02D053
+:1032000016391AD02AE05388B0F807105B1C99428F
+:103210000BD1002200F10D038DF80420009301244E
+:10322000B0F80B108DF8051015E0D288521C9142B1
+:1032300014D101248DF8044006E0117A71B11472A2
+:10324000032201248DF8042000F10D030093B0F84F
+:103250000B008DF80500684600F0FAFA204616BD0E
+:1032600010B586B02848274CFFF788FB0094082348
+:103270005FF0010225A10220FFF759F90021049116
+:103280000191A01C05900A220123042103920293BC
+:1032900000910423B4F8000020A20221FFF795F961
+:1032A0000021049102910191201D05900A22202104
+:1032B00003920091012320881CA20221FFF785F9C7
+:1032C000A01D059001210491029100200A22019085
+:1032D0000421039200911423B4F8000017A20221E4
+:1032E000FFF773F90020207206B010BD1CB50091E5
+:1032F0000124044881880472012300880022FFF71A
+:10330000BDF916BDA4130020E93100088FE5B3D53F
+:103310002E7F4A982A487ACC20FE000019ED82AE12
+:10332000ED214C9D4145228E22FE000019ED82AE1A
+:10333000ED214C9D4145228E23FE000019ED82AE09
+:10334000ED214C9D4145228E24FE00007047000077
+:10335000C0680840884201D10120704700207047B2
+:10336000C0690840884201D10120704700207047A1
+:1033700010B5614C02212046FFF7F2FF38B16068BA
+:10338000C043810703D5FFF74AFD022018E0012161
+:103390002046FFF7E5FF38B16068C043C10703D599
+:1033A000FFF703FD01200BE008212046FFF7D8FFBF
+:1033B00038B16068C043010703D5FFF784FD0820DA
+:1033C000A06010BD10B54C4C00F033F818B960681F
+:1033D000C043810306D400F02CF830B96068C043C4
+:1033E000810302D5BDE8104064E0082100F022F816
+:1033F00070B96068C04301030AD560683F4940F472
+:1034000000206060086880474FF40022A26010BD71
+:10341000202100F00FF858B96068C043810207D539
+:10342000606840F400106060BDE81040FFF7D0BC59
+:1034300010BD022120468BE740BF20BF3048016805
+:1034400041F400410160704780B52E48016841F4A5
+:1034500080110160006800F48010009000982648F8
+:10346000016841F001010160026842F480320260AB
+:103470002C20FEF748F9BDE802402D20FEF743B9A5
+:103480002148016849084900016070471F494FF40D
+:103490008030086070471C48016821F0020101601B
+:1034A000704719484FF400314160026822F400323D
+:1034B000026070471448016841F400310160FFF771
+:1034C000A8BC38B504460C4D08212846FFF740FF3C
+:1034D00030B10A480460696821F40021696031BD97
+:1034E000A0474FF40020A86031BD0748016821F0D3
+:1034F0000801016070470000000C0058E013002034
+:103500000C04005850000058040C0058080C0058D7
+:10351000484900E0484981B00A6802430A600968E6
+:1035200008400090009801B0704780B500F07AFA2A
+:1035300000F07AFA4148016841F48031016000F0FE
+:1035400085FABDE801400EE000B587B04FEA0D00F6
+:1035500040A11C22FEF73CFDFFF7A9FC6846FEF7E0
+:1035600045FF07B000BDF0B585B068461421FDF7F2
+:10357000CDFF0026002500240021314A02EBC102C4
+:10358000907988B11368B3F1904F08D02D4FBB42AA
+:1035900008D02D4FBB4204BF9088044304E09088BC
+:1035A000064301E092881543491C2029E5DB0021F0
+:1035B00002910122032101920391B0B288B10090DF
+:1035C0000120FFF7A5FF0120FFF7A4FF69464FF098
+:1035D0009040FDF79FFF0022B1B24FF09040FEF700
+:1035E00048F8A8B280B100900220FFF791FF0220B6
+:1035F000FFF790FF134E69463046FDF78BFF002220
+:10360000A9B23046FEF735F8A0B280B10090042090
+:10361000FFF77EFF0420FFF77DFF0B4D694628462C
+:10362000FDF778FF0022A1B22846FEF722F805B088
+:10363000F0BD00004C0000584C01005890080058A4
+:10364000103F000800040048000800480020FDF773
+:1036500048BC000000000000000000000000000066
+:10366000103F000824000320280003202004040049
+:10367000DFF81C1181B00A6802430A60096808403B
+:103680000090009801B0704778B585B0044600F00E
+:103690007BF80220FFF7ECFF0FF20411DFF8F46073
+:1036A00031F814500095012101910022022102926B
+:1036B0000391694656F82400FDF72CFF00F002F84C
+:1036C00006B070BD56F8240000222946FDF7D1BF90
+:1036D00010B500F00DF8BDE810400122FDF7C9BF9C
+:1036E00010B500F005F8BDE810400022FDF7C1BF9D
+:1036F0000FF2AC03DFF89C4033F8101054F82000B0
+:10370000704730B585B004460D4600F03DF8210005
+:1037100008BF042004D0012C18BF022C02D10820BD
+:10372000FFF7A6FF2900DFF870200FF27C000ED112
+:1037300030F814100091002301930121022302911B
+:10374000039300F01CF8012000F012FA15E0012D9F
+:1037500013D130F81400DFF8443000900295019343
+:1037600000F00DF80FF24800045D00220F2160B256
+:10377000FDF7ACFF60B2FDF7C6FF05B030BD69468E
+:1037800052F82400FDF7C6BE68461421FDF7BEBE00
+:103790004C0000586C100020781000200000211010
+:1037A00020000100020000001000010002000000E3
+:1037B0000A0607001148016841F4807101607047F2
+:1037C00010B50C460E490028086805D1810507D5BB
+:1037D00000F0FAF920B110BD810558BF00F0EEF9F4
+:1037E0000848016821F00401012C016001D130BFBB
+:1037F00010BD40BF20BF20BF10BD00000004005816
+:103800001404005810ED00E00249034A016002610F
+:10381000704700BFD72D0008FF2D00084018491C35
+:103820001CBFB1F1010100F8012DF9D17047000072
+:1038300000EB8100664AD0F88010914201D001204F
+:1038400070470020704742F4806240F821207047A2
+:103850002DE9F8430546DFF87C912879DFF8788177
+:103860005E4E20B1012830D0032874D016E02968BC
+:103870000A78012A4FF0006004D0022A10D0072AEB
+:103880001BD00BE00023737430606A792B68521EE2
+:10389000591C3046FEF79CFB00223274BDE8F183D0
+:1038A00001217174306028686A79411C521E3046CB
+:1038B000FEF78EFB00213174F0E701208DF8000047
+:1038C00069460220FFF712FDE8E76C790027022124
+:1038D0004046FFF7ADFF0028F9D1FFF7DBF822E003
+:1038E000296806F1080339441844FEF771FB00F01B
+:1038F0007FF8D6E9022331680120FFF79DF8D6F85A
+:1039000000C0D6E90201DCE900238B4208BF8242F5
+:1039100009D10CF108003060307CC0F10800241A95
+:10392000C71900203074307CC0F108029442D7D20D
+:10393000FFF7C0F800F058F8002CAFD02868357CAD
+:10394000C11906F1080322465819FEF741FB307CE5
+:1039500024183474A2E7307CD0B102214046FFF72E
+:1039600067FF0028F9D1FFF795F804E000F040F870
+:103970000120FFF761F83168D6E90223D1E900455B
+:103980009D4208BF9442F1D1FFF794F800F02CF863
+:10399000707C90B10128DDD14FF0005200211170F0
+:1039A000BFF34F8F0E490F480B6803F4E0630343E6
+:1039B0000B60BFF34F8F00BFFDE7FEF7DFFC002079
+:1039C000FEF7DCFC01210020FFF7FAFEFAE7000019
+:1039D00000040080104000580014005848130020D4
+:1039E0000CED00E00400FA050022022140462AE71F
+:1039F000D9F80000C00C10F00100F9D170470000A8
+:103A0000032010B5FDF755FE0F2000F0FFF800244D
+:103A1000002814BF012400F017F8204610BD084804
+:103A200080687047074805E00648016841F00201D8
+:103A300001607047016841F00101016070470000BA
+:103A400060100020042004E07047000080B5FFF7FC
+:103A5000FDFD022100910023044800F124014FF4F0
+:103A60008052001D00F0F4F801BD00001400002099
+:103A700010B5FFF7C5FF4A4C606840010ED560687D
+:103A8000C0000BD4FFF796FEFFF794FE206840F4C9
+:103A900080302060216821F48031216000F022F81C
+:103AA000FFF788FEFFF786FE206840F001002060E7
+:103AB00020688007FCD5002261683A4821F4404123
+:103AC00041F48041616001680260036903F05003C2
+:103AD000036100F028F8FFF726FA4FF0FF30FEF7F9
+:103AE0007DFBFAE7304881B0016841F48011016044
+:103AF0003F21006800F48010009000982B4841603E
+:103B00004161016841F47C110160026942F47C1258
+:103B10000261016841F03F010160026942F03F0229
+:103B2000026101B0704710B5FFF744FEFFF742FE97
+:103B30001B481F4C016821F4407141F48071016001
+:103B40000F21026842F40042026047F6FF721948F2
+:103B50008160C260046000F091F8CA206062532165
+:103B60006162FF21A068C008C000A060616210BD52
+:103B700038B50446FDF7C4FC14F1010F054609D021
+:103B8000FFF74DFF041905E00B48016821F004011F
+:103B9000016030BFFDF7B4FC401BA042F4D331BD3F
+:103BA000900000588008005850000058040C00583D
+:103BB00000280040E012002010ED00E010480168ED
+:103BC00041F480410160704710B50D4A0D4B1068FB
+:103BD00020F48040106032211C680B48B4FBF0F0E8
+:103BE00048435369990506D5002818BF401EF8D1EF
+:103BF00001E0002010BD50698105FAD5032010BDF9
+:103C0000000400588410002040420F0070B50F4E91
+:103C10000446B0680025A8B1FDF7BBFBB2684FF4BD
+:103C20007A71B1FBF2F2B0FBF2F0FDF786FD48B914
+:103C3000102C07D2002221464FF0FF30FDF746FD41
+:103C4000746000E00125284670BD00BF60100020B0
+:103C500030B5039C016000250021C1604161056110
+:103C6000A107856142600381047704D5008910B102
+:103C70004FF0FF3030BD002030BD000070B50400B3
+:103C800049D094F8210028B9002184F8201020465A
+:103C9000C046C04600F04EF853202168486200F04C
+:103CA00052F8FF2510B100F03FF834E02168DFF84A
+:103CB000AC008A6802408A6022689368666821695D
+:103CC000A0690E430643334393602068E1680161B5
+:103CD00020680169A26841EA024101612068C16867
+:103CE00021F08001C1602068C16C89088900C1642D
+:103CF0002168CA6CE369606903431A43CA64216896
+:103D00008868810609D400F01CF830B1206845624B
+:103D1000042100F01DF8012070BD206845620121DA
+:103D200084F82110002070BD20684562042184F8C9
+:103D300021107047022084F82100CA2122685162B4
+:103D4000704720460CE0204623E02068C0F824801D
+:103D500084F82110002084F820007047BFFF8FFFF7
+:103D600038B504462068C16821F0A001C160FDF7A4
+:103D7000C7FB05462068C168880608D4FDF7C0FB6C
+:103D8000401B40F2E9318842F4D3032032BD0020C9
+:103D900032BD38B504462068C1684A0612D44FF0D7
+:103DA000FF31C160FDF7ACFB05462068C1684806DD
+:103DB00008D4FDF7A5FB401B40F2E9318842F4D35B
+:103DC000032032BD002032BD4748484A01681268CE
+:103DD000B1F1006F0AD3120302F47F224448821823
+:103DE0008A4203D308684349884201D000207047C3
+:103DF0000120704780B5404940480860026882F35E
+:103E000008884068804730BF01BD10B5FFF7DCFF70
+:103E10004FF0005420B100202070BDE81040E9E7C9
+:103E200001210720FF2221706070A27010BD38B5FB
+:103E3000334C2068C00002D4206880011AD54FF0AE
+:103E40000055287828B9FFF7BFFF10B1FFF7D2FF60
+:103E500012E0287848B9FFF7B7FF30B901200721F1
+:103E6000FF2228706970AA7006E02878012818BF20
+:103E7000022801D0FFF7C9FF2248016841F4700110
+:103E800001600020FEF7F8FE40B180791E49A16074
+:103E9000A26822F47C5242EA0022A2604FF0B040B5
+:103EA000016841F48031016018490A68D208D200E3
+:103EB00042F001020A600A6802F00702012AFAD100
+:103EC00001688903FCD582689208920042F00202E0
+:103ED0008260816801F00C010829FAD10168490863
+:103EE0004900016031BD0000407100088040005869
+:103EF000FCFFFF07298A449408ED00E000700008E9
+:103F00009400005888ED00E0FECAFECA0040005848
+:103F1000000000480100000000000048010000000F
+:103F200000000048010000000000004801000000FF
+:103F300000000048010000000000004801000000EF
+:103F400000000048010000000000004801000000DF
+:103F500000000048010000000000004801000000CF
+:103F600000000048010000000000004801000000BF
+:103F700000000048010000000000004801000000AF
+:103F8000000000480100000000000048010000009F
+:103F9000000000480100000000000048010000008F
+:103FA000000000480100000000000048010000007F
+:103FB000000000480100000000000048010000006F
+:103FC000000000480100000000000048010000005F
+:103FD000000000480100000000000048010000004F
+:103FE000000000480100000000000048010000003F
+:103FF000000000480100000000000048010000002F
+:10400000000000480100000000000048010000001E
+:104010000100000003000000050000000100000096
+:1040200001000000060000000A000000200000005F
+:104030000200000004000000080000001000000062
+:1040400040000000800000000001000000020000AD
+:10405000A0860100400D0300801A060000350C0008
+:1040600040420F0080841E0000093D0000127A00CB
+:104070000024F40000366E010048E801006CDC0208
+:104080000000000000000000000000000000000030
+:1040900030B5016884684218416802EB5103C907D2
+:1040A0000BD54C4409E012F9011B12F8015B002901
+:1040B00004F8015B05D5491CF9D19A42F3D10C30C3
+:1040C00030BD491EF1D5F8E70000000000000000F7
+:1040D0000000000000000000000000004400080094
+:1040E000400508013A799C00F4010000FFFFFFFF42
+:1040F000480101000000000010B50749794418315B
+:10410000064C7C44163404E00A68081D11448847B4
+:104110000146A142F8D110BD6400000098000000E3
+:104120007047FEE770477047704700F00DB80020F9
+:10413000FCF7ECBE0020FCF7EFBEFDF783BCFFF7F9
+:1041400041B9FFF715B9000002490A68886882186A
+:104150000A607047601000204EF68851CEF20001D0
+:10416000086840F470000860BFF34F8FBFF36F8F93
+:104170004FF00070E1EE100A704700004BD1FFFFD6
+:1041800034030000B8100020800800002C00032039
+:1041900000000000FDFEFFFF90010000460100004E
+:1041A00004000020EDFEFFFF2302000004000000D9
+:1041B00024000320000000000000000000000000B8
+:1041C00000000000010000000200000003000000E9
+:1041D000040000000120C046002801D0FFF78CFF3A
+:1041E000AFF300800020AFF30080FFF741FC00F048
+:1041F00000F800F001B800000746384600F002F869
+:10420000FBE7000080B5AFF30080024A11001820E0
+:10421000ABBEFBE72600020001488047014800478B
+:104220002F3E000829420008AFF30080FFF794FFFB
+:10423000FFF7D0FFFFF7FEBFFFF7FEBFFFF7FEBFA0
+:10424000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFA2
+:10425000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF92
+:10426000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF82
+:10427000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF72
+:10428000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF62
+:10429000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF52
+:1042A000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF42
+:1042B000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF32
+:1042C000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF22
+:1042D000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF12
+:1042E000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF02
+:1042F000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFF2
:10430000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFE1
:10431000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFD1
-:10432000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFC1
-:10433000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFB1
-:10434000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFA1
-:10435000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF91
-:10436000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF81
-:10437000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF71
-:10438000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF61
-:10439000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF51
-:1043A000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF41
-:1043B000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF31
-:1043C000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF21
-:1043D000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF11
-:1043E000FFF7FEBFFFF7FEBFFFF7FEBF030DFF01A4
-:1043F00086F400000181008100810081008100813C
-:1044000000810081008100810081008100810081A4
-:104410000081008100810081008100810081008194
-:104420000081008100810081008100810081008184
-:104430000081008100A900F8FFF0000010FD0000DD
-:1044400001FC004A04004800040048000400480041
-:10445000080048000C0048000C004800093D0030EE
-:10446000B50A4B5A6842F480225A60EFF310847206
-:10447000B6802251F8045B40F8045B521EF9D11853
-:1044800068C103FCD484F3108830BD10400058F894
-:01449000002B
-:04000005080042EDC0
+:10432000FFF7FEBFFFF7FEBF030DFF0186F400009D
+:104330000181008100810081008100810081008174
+:104340000081008100810081008100810081008165
+:104350000081008100810081008100810081008155
+:104360000081008100810081008100810081008145
+:1043700000A900F8FFF0000010FD000001FC004A59
+:1043800004004800040048000400480008004800F9
+:104390000C0048000C004800093D0030B50A4B5A9B
+:1043A0006842F480225A60EFF3108472B680225182
+:1043B000F8045B40F8045B521EF9D11868C103FC95
+:0D43C000D484F3108830BD10400058F80080
+:040000050800422984
:00000001FF
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Inc/app_conf.h
index 463f79288..0f4e12724 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Inc/app_conf.h
@@ -24,12 +24,13 @@
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* OTA Application Config
******************************************************************************/
-/**< generic parameters ********************************************************/
+/**< generic parameters ******************************************************/
/**
* Define Tx Power
@@ -83,6 +84,15 @@
*/
#define CFG_BLE_ERK {0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21,0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21}
+/* USER CODE BEGIN Generic_Parameters */
+/**
+ * SMPS supply
+ * SMPS not used when Set to 0
+ * SMPS used when Set to 1
+ */
+#define CFG_USE_SMPS 1
+/* USER CODE END Generic_Parameters */
+
/**< specific parameters ********************************************************/
/**
* AD Element - DEV ID
@@ -197,7 +207,7 @@
* 1 : internal RO
* 0 : external crystal ( no calibration )
*/
-#define CFG_BLE_LSE_SOURCE 1
+#define CFG_BLE_LSE_SOURCE 0
/**
* Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
@@ -412,7 +422,6 @@ typedef enum
#define CFG_LPM_SUPPORTED 0
#define CFG_DEBUGGER_SUPPORTED 1
#endif
-
/**
* When CFG_DEBUG_TRACE_FULL is set to 1, the trace are output with the API name, the file name and the line number
* When CFG_DEBUG_TRACE_LIGHT is set to 1, only the debug message is output
@@ -509,6 +518,9 @@ typedef enum
{
CFG_LPM_APP,
CFG_LPM_APP_BLE,
+ /* USER CODE BEGIN CFG_LPM_Id_t */
+
+ /* USER CODE END CFG_LPM_Id_t */
} CFG_LPM_Id_t;
/******************************************************************************
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Inc/stm32_lpm_if.h
index 38e326512..d8e67947f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Inc/stm32_lpm_if.h
@@ -1,46 +1,22 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file stm32_lpm_if.h
-* @brief Header for stm32_lpm_f.c module (device specific LP management)
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
******************************************************************************
* @attention
*
-* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics International N.V.
+* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted, provided that the following conditions are met:
-*
-* 1. Redistribution of source code must retain the above copyright notice,
-* this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following disclaimer in the documentation
-* and/or other materials provided with the distribution.
-* 3. Neither the name of STMicroelectronics nor the names of other
-* contributors to this software may be used to endorse or promote products
-* derived from this software without specific written permission.
-* 4. This software, including modifications and/or derivative works of this
-* software, must execute solely and exclusively on microcontroller or
-* microprocessor devices manufactured by or for STMicroelectronics.
-* 5. Redistribution and use of this software other than as permitted under
-* this license is void and will automatically terminate your rights under
-* this license.
-*
-* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
-* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
-* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+* This software component is licensed by ST under BSD 3-Clause license,
+* the "License"; You may not use this file except in compliance with the
+* License. You may obtain a copy of the License at:
+* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32_LPM_IF_H
@@ -89,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Inc/stm32wbxx_hal_conf.h
index 8cce280aa..4ab9edb7d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Inc/stm32wbxx_hal_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Inc/stm32wbxx_hal_conf.h
@@ -219,6 +219,10 @@
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32wbxx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32wbxx_hal_flash.h"
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Inc/utilities_conf.h
index c98d97ba1..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Inc/utilities_conf.h
@@ -1,3 +1,4 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* File Name : utilities_conf.h
@@ -9,13 +10,14 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef UTILITIES_CONF_H
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Src/app_debug.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Src/app_debug.c
index d644267b3..81f0b31a8 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Src/app_debug.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Src/app_debug.c
@@ -64,7 +64,7 @@ typedef PACKED_STRUCT
/* Private macros ------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static APPD_TracesConfig_t APPD_TracesConfig={0, 0, 0, 0};
-PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static APPD_GeneralConfig_t APPD_GeneralConfig={BLE_DTB_CFG, 0, 0, 0};
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static APPD_GeneralConfig_t APPD_GeneralConfig={BLE_DTB_CFG, {0, 0, 0}};
/**
* THE DEBUG ON GPIO FOR CPU2 IS INTENDED TO BE USED ONLY ON REQUEST FROM ST SUPPORT
@@ -74,36 +74,39 @@ PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static APPD_GeneralConfig_t APPD_GeneralCon
*/
static const APPD_GpioConfig_t aGpioConfigList[GPIO_CFG_NBR_OF_FEATURES] =
{
- { GPIOA, LL_GPIO_PIN_0, 0, 0},
- { GPIOA, LL_GPIO_PIN_0, 0, 0},
- { GPIOA, LL_GPIO_PIN_0, 0, 0},
- { GPIOA, LL_GPIO_PIN_0, 0, 0},
- { GPIOA, LL_GPIO_PIN_0, 0, 0},
- { GPIOA, LL_GPIO_PIN_0, 0, 0},
- { GPIOA, LL_GPIO_PIN_0, 0, 0},
- { GPIOA, LL_GPIO_PIN_0, 0, 0},
- { GPIOA, LL_GPIO_PIN_0, 0, 0},
- { GPIOA, LL_GPIO_PIN_0, 0, 0},
- { GPIOA, LL_GPIO_PIN_0, 0, 0},
- { GPIOA, LL_GPIO_PIN_0, 0, 0},
- { GPIOA, LL_GPIO_PIN_0, 0, 0},
- { GPIOA, LL_GPIO_PIN_0, 0, 0},
- { GPIOA, LL_GPIO_PIN_0, 0, 0},
- { GPIOA, LL_GPIO_PIN_0, 0, 0},
- { GPIOA, LL_GPIO_PIN_0, 0, 0},
- { GPIOA, LL_GPIO_PIN_0, 0, 0},
- { GPIOA, LL_GPIO_PIN_0, 0, 0},
- { GPIOA, LL_GPIO_PIN_0, 0, 0},
- { GPIOA, LL_GPIO_PIN_0, 0, 0},
- { GPIOA, LL_GPIO_PIN_0, 0, 0},
- { GPIOA, LL_GPIO_PIN_0, 0, 0},
- { GPIOA, LL_GPIO_PIN_0, 0, 0},
- { GPIOA, LL_GPIO_PIN_0, 0, 0},
- { GPIOA, LL_GPIO_PIN_0, 0, 0},
- { GPIOA, LL_GPIO_PIN_0, 0, 0},
- { GPIOA, LL_GPIO_PIN_0, 0, 0},
- { GPIOA, LL_GPIO_PIN_0, 0, 0},
- { GPIOA, LL_GPIO_PIN_0, 0, 0},
+ { GPIOA, LL_GPIO_PIN_0, 0, 0}, /* BLE_ISR - Set on Entry / Reset on Exit */
+ { GPIOA, LL_GPIO_PIN_0, 0, 0}, /* BLE_STACK_TICK - Set on Entry / Reset on Exit */
+ { GPIOA, LL_GPIO_PIN_0, 0, 0}, /* BLE_CMD_PROCESS - Set on Entry / Reset on Exit */
+ { GPIOA, LL_GPIO_PIN_0, 0, 0}, /* BLE_ACL_DATA_PROCESS - Set on Entry / Reset on Exit */
+ { GPIOA, LL_GPIO_PIN_0, 0, 0}, /* SYS_CMD_PROCESS - Set on Entry / Reset on Exit */
+ { GPIOA, LL_GPIO_PIN_0, 0, 0}, /* RNG_PROCESS - Set on Entry / Reset on Exit */
+ { GPIOA, LL_GPIO_PIN_0, 0, 0}, /* NVM_PROCESS - Set on Entry / Reset on Exit */
+ { GPIOA, LL_GPIO_PIN_0, 0, 0}, /* IPCC_GENERAL - Set on Entry / Reset on Exit */
+ { GPIOA, LL_GPIO_PIN_0, 0, 0}, /* IPCC_BLE_CMD_RX - Set on Entry / Reset on Exit */
+ { GPIOA, LL_GPIO_PIN_0, 0, 0}, /* IPCC_BLE_EVT_TX - Set on Entry / Reset on Exit */
+ { GPIOA, LL_GPIO_PIN_0, 0, 0}, /* IPCC_BLE_ACL_DATA_RX - Set on Entry / Reset on Exit */
+ { GPIOA, LL_GPIO_PIN_0, 0, 0}, /* IPCC_SYS_CMD_RX - Set on Entry / Reset on Exit */
+ { GPIOA, LL_GPIO_PIN_0, 0, 0}, /* IPCC_SYS_EVT_TX - Set on Entry / Reset on Exit */
+ { GPIOA, LL_GPIO_PIN_0, 0, 0}, /* IPCC_CLI_CMD_RX - Set on Entry / Reset on Exit */
+ { GPIOA, LL_GPIO_PIN_0, 0, 0}, /* IPCC_OT_CMD_RX - Set on Entry / Reset on Exit */
+ { GPIOA, LL_GPIO_PIN_0, 0, 0}, /* IPCC_OT_ACK_TX - Set on Entry / Reset on Exit */
+ { GPIOA, LL_GPIO_PIN_0, 0, 0}, /* IPCC_CLI_ACK_TX - Set on Entry / Reset on Exit */
+ { GPIOA, LL_GPIO_PIN_0, 0, 0}, /* IPCC_MEM_MANAGER_RX - Set on Entry / Reset on Exit */
+ { GPIOA, LL_GPIO_PIN_0, 0, 0}, /* IPCC_TRACES_TX - Set on Entry / Reset on Exit */
+ { GPIOA, LL_GPIO_PIN_0, 0, 0}, /* HARD_FAULT - Set on Entry / Reset on Exit */
+/* From v1.1.1 */
+ { GPIOA, LL_GPIO_PIN_0, 0, 0}, /* IP_CORE_LP_STATUS - Set on Entry / Reset on Exit */
+/* From v1.2.0 */
+ { GPIOA, LL_GPIO_PIN_0, 0, 0}, /* END_OF_CONNECTION_EVENT - Set on Entry / Reset on Exit */
+ { GPIOA, LL_GPIO_PIN_0, 0, 0}, /* TIMER_SERVER_CALLBACK - Toggle on Entry */
+ { GPIOA, LL_GPIO_PIN_0, 0, 0}, /* PES_ACTIVITY - Set on Entry / Reset on Exit */
+ { GPIOA, LL_GPIO_PIN_0, 0, 0}, /* MB_BLE_SEND_EVT - Set on Entry / Reset on Exit */
+/* From v1.3.0 */
+ { GPIOA, LL_GPIO_PIN_0, 0, 0}, /* BLE_NO_DELAY - Set on Entry / Reset on Exit */
+ { GPIOA, LL_GPIO_PIN_0, 0, 0}, /* BLE_STACK_STORE_NVM_CB - Set on Entry / Reset on Exit */
+ { GPIOA, LL_GPIO_PIN_0, 0, 0}, /* NVMA_WRITE_ONGOING - Set on Entry / Reset on Exit */
+ { GPIOA, LL_GPIO_PIN_0, 0, 0}, /* NVMA_WRITE_COMPLETE - Set on Entry / Reset on Exit */
+ { GPIOA, LL_GPIO_PIN_0, 0, 0}, /* NVMA_CLEANUP - Set on Entry / Reset on Exit */
{ GPIOA, LL_GPIO_PIN_0, 0, 0},
{ GPIOA, LL_GPIO_PIN_0, 0, 0},
};
@@ -184,13 +187,13 @@ void APPD_EnableCPU2( void )
{
SHCI_C2_DEBUG_Init_Cmd_Packet_t DebugCmdPacket =
{
- {0,0,0}, /**< Does not need to be initialized */
- (uint8_t *)aGpioConfigList,
+ {{0,0,0}}, /**< Does not need to be initialized */
+ {(uint8_t *)aGpioConfigList,
(uint8_t *)&APPD_TracesConfig,
(uint8_t *)&APPD_GeneralConfig,
GPIO_CFG_NBR_OF_FEATURES,
NBR_OF_TRACES_CONFIG_PARAMETERS,
- NBR_OF_GENERAL_CONFIG_PARAMETERS
+ NBR_OF_GENERAL_CONFIG_PARAMETERS}
};
/**< Traces channel initialization */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Src/app_entry.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Src/app_entry.c
index 1b11245c9..4c46b8e58 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Src/app_entry.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Src/app_entry.c
@@ -55,7 +55,6 @@ static void appe_Tl_Init( void );
static void Led_Init( void );
static void Button_Init( void );
static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status );
-
static void APPE_SysUserEvtRx( void * pPayload );
static void APPE_SysevtReadyProcessing( SHCI_C2_Ready_Evt_t *pReadyEvt );
@@ -82,7 +81,7 @@ void APPE_Init( void )
/**
* From now, the application is waiting for the ready event ( VS_HCI_C2_Ready )
- * received on the system channel before starting the BLE Stack
+ * received on the system channel before starting the Stack
* This system event is received with APPE_SysUserEvtRx()
*/
@@ -350,7 +349,6 @@ void UTIL_SEQ_Idle( void )
return;
}
-
void UTIL_SEQ_EvtIdle( UTIL_SEQ_bm_t task_id_bm, UTIL_SEQ_bm_t evt_waited_bm )
{
UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Src/hw_timerserver.c
index 52a1bfa0d..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Src/hw_timerserver.c
@@ -1,22 +1,21 @@
/**
******************************************************************************
- * File Name : hw_timerserver.c
- * Description : Hardware timerserver source file for BLE
- * middleWare.
+ * File Name : hw_timerserver.c
+ * Description : Hardware timerserver source file for STM32WPAN Middleware.
+ *
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Src/hw_uart.c
index c0fc22d58..775aa241d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Src/hw_uart.c
@@ -130,7 +130,7 @@
HAL_NVIC_EnableIRQ(CFG_HW_##__USART_BASE__##_TX_DMA_IRQn); \
} while(0)
- /* Variables ------------------------------------------------------------------*/
+/* Variables ------------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
UART_HandleTypeDef huart1 = {0};
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Src/main.c
index 34d973675..25a8c45e0 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Src/main.c
@@ -195,7 +195,13 @@ static void Init_RTC( void )
hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
HAL_RTC_Init(&hrtc);
- MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* Disable RTC registers write protection */
+ LL_RTC_DisableWriteProtection(RTC);
+
+ LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER);
+
+ /* Enable RTC registers write protection */
+ LL_RTC_EnableWriteProtection(RTC);
return;
}
@@ -218,6 +224,12 @@ void SystemClock_Config( void )
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -268,19 +280,6 @@ void SystemClock_Config( void )
*/
LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
@@ -289,21 +288,33 @@ void SystemClock_Config( void )
* WRAP FUNCTIONS
*
*************************************************************/
-
-/**
- * This function is empty to avoid starting the SysTick Timer
- */
-HAL_StatusTypeDef HAL_InitTick( uint32_t TickPriority )
+void HAL_Delay(uint32_t Delay)
{
- return (HAL_OK);
-}
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
-/**
- * This function is empty as the SysTick Timer is not used
- */
-void HAL_Delay(__IO uint32_t Delay)
-{
- return;
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
}
/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/STM32_WPAN/App/ble_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/STM32_WPAN/App/ble_conf.h
index 3ebf5cc82..3162e1277 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/STM32_WPAN/App/ble_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/STM32_WPAN/App/ble_conf.h
@@ -50,7 +50,7 @@
* This shall take into account all registered handlers
* (from either the provided services or the custom services)
*/
-#define BLE_CFG_SVC_MAX_NBR_CB 5
+#define BLE_CFG_SVC_MAX_NBR_CB 7
#define BLE_CFG_CLT_MAX_NBR_CB 0
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/SW4STM32/Production/.cproject b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/SW4STM32/Production/.cproject
index 7cee5e1e3..9f9137d77 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/SW4STM32/Production/.cproject
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Ota/SW4STM32/Production/.cproject
@@ -17,16 +17,16 @@
<configuration artifactExtension="elf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.1111606708" name="Debug" parent="fr.ac6.managedbuild.config.gnu.cross.exe.debug" postannouncebuildStep="Generating hex and Printing size information:" postbuildStep="arm-none-eabi-objcopy -O ihex &quot;${BuildArtifactFileBaseName}.elf&quot; &quot;${BuildArtifactFileBaseName}.hex&quot; &amp;&amp; arm-none-eabi-size &quot;${BuildArtifactFileName}&quot;">
<folderInfo id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.1111606708." name="/" resourcePath="">
<toolChain id="fr.ac6.managedbuild.toolchain.gnu.cross.exe.debug.1480013877" name="Ac6 STM32 MCU GCC" superClass="fr.ac6.managedbuild.toolchain.gnu.cross.exe.debug">
- <option id="fr.ac6.managedbuild.option.gnu.cross.prefix.1380329305" name="Prefix" superClass="fr.ac6.managedbuild.option.gnu.cross.prefix" useByScannerDiscovery="false" value="arm-none-eabi-" valueType="string"/>
- <option id="fr.ac6.managedbuild.option.gnu.cross.mcu.1679444810" name="Mcu" superClass="fr.ac6.managedbuild.option.gnu.cross.mcu" useByScannerDiscovery="false" value="STM32WB55RGVx" valueType="string"/>
- <option id="fr.ac6.managedbuild.option.gnu.cross.board.1859223420" name="Board" superClass="fr.ac6.managedbuild.option.gnu.cross.board" useByScannerDiscovery="false" value="P-NUCLEO-WB55.NUCLEO" valueType="string"/>
- <option id="fr.ac6.managedbuild.option.gnu.cross.core.1083960614" name="Core" superClass="fr.ac6.managedbuild.option.gnu.cross.core" useByScannerDiscovery="false" valueType="stringList">
+ <option id="fr.ac6.managedbuild.option.gnu.cross.prefix.1380329305" name="Prefix" superClass="fr.ac6.managedbuild.option.gnu.cross.prefix" value="arm-none-eabi-" valueType="string"/>
+ <option id="fr.ac6.managedbuild.option.gnu.cross.mcu.1679444810" name="Mcu" superClass="fr.ac6.managedbuild.option.gnu.cross.mcu" value="STM32WB55RGVx" valueType="string"/>
+ <option id="fr.ac6.managedbuild.option.gnu.cross.board.1859223420" name="Board" superClass="fr.ac6.managedbuild.option.gnu.cross.board" value="P-NUCLEO-WB55.NUCLEO" valueType="string"/>
+ <option id="fr.ac6.managedbuild.option.gnu.cross.core.1083960614" name="Core" superClass="fr.ac6.managedbuild.option.gnu.cross.core" valueType="stringList">
<listOptionValue builtIn="false" value="ARM Cortex-M4"/>
<listOptionValue builtIn="false" value="CM4"/>
</option>
- <option id="fr.ac6.managedbuild.option.gnu.cross.instructionSet.2125993333" name="Instruction Set" superClass="fr.ac6.managedbuild.option.gnu.cross.instructionSet" useByScannerDiscovery="false" value="fr.ac6.managedbuild.option.gnu.cross.instructionSet.thumbII" valueType="enumerated"/>
- <option id="fr.ac6.managedbuild.option.gnu.cross.fpu.609782680" name="Floating point hardware" superClass="fr.ac6.managedbuild.option.gnu.cross.fpu" useByScannerDiscovery="false" value="fr.ac6.managedbuild.option.gnu.cross.fpu.fpv4-sp-d16" valueType="enumerated"/>
- <option id="fr.ac6.managedbuild.option.gnu.cross.floatabi.986342475" name="Floating-point ABI" superClass="fr.ac6.managedbuild.option.gnu.cross.floatabi" useByScannerDiscovery="false" value="fr.ac6.managedbuild.option.gnu.cross.floatabi.hard" valueType="enumerated"/>
+ <option id="fr.ac6.managedbuild.option.gnu.cross.instructionSet.2125993333" name="Instruction Set" superClass="fr.ac6.managedbuild.option.gnu.cross.instructionSet" value="fr.ac6.managedbuild.option.gnu.cross.instructionSet.thumbII" valueType="enumerated"/>
+ <option id="fr.ac6.managedbuild.option.gnu.cross.fpu.609782680" name="Floating point hardware" superClass="fr.ac6.managedbuild.option.gnu.cross.fpu" value="fr.ac6.managedbuild.option.gnu.cross.fpu.fpv4-sp-d16" valueType="enumerated"/>
+ <option id="fr.ac6.managedbuild.option.gnu.cross.floatabi.986342475" name="Floating-point ABI" superClass="fr.ac6.managedbuild.option.gnu.cross.floatabi" value="fr.ac6.managedbuild.option.gnu.cross.floatabi.hard" valueType="enumerated"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="fr.ac6.managedbuild.targetPlatform.gnu.cross.1214800679" isAbstract="false" osList="all" superClass="fr.ac6.managedbuild.targetPlatform.gnu.cross"/>
<builder buildPath="${workspace_loc:/Production}/Debug" id="fr.ac6.managedbuild.builder.gnu.cross.500418524" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="fr.ac6.managedbuild.builder.gnu.cross">
<outputEntries>
@@ -62,7 +62,6 @@
<listOptionValue builtIn="false" value="CORE_CM4"/>
</option>
<option id="fr.ac6.managedbuild.gnu.c.compiler.option.misc.other.1413052383" superClass="fr.ac6.managedbuild.gnu.c.compiler.option.misc.other" useByScannerDiscovery="false" value="-fmessage-length=0" valueType="string"/>
- <option id="fr.ac6.managedbuid.gnu.c.compiler.option.misc.other.1693011140" superClass="fr.ac6.managedbuid.gnu.c.compiler.option.misc.other" useByScannerDiscovery="false" value="-fmessage-length=0 -Wno-missing-braces" valueType="string"/>
<inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c.1381889185" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c"/>
<inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.s.1474105906" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.s"/>
</tool>
@@ -87,7 +86,7 @@
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble"/>
<listOptionValue builtIn="false" value="../../../Core/Inc"/>
- <listOptionValue builtIn="false" value="../../../STM32_WPAN/app"/>
+ <listOptionValue builtIn="false" value="../../../STM32_WPAN/App"/>
</option>
<option id="gnu.cpp.compiler.option.preprocessor.def.1213837356" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="USE_STM32WBXX_NUCLEO"/>
@@ -100,10 +99,10 @@
<inputType id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.s.766934766" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.s"/>
</tool>
<tool id="fr.ac6.managedbuild.tool.gnu.cross.c.linker.928828797" name="MCU GCC Linker" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.linker">
- <option id="fr.ac6.managedbuild.tool.gnu.cross.c.linker.script.1232757584" name="Linker Script (-T)" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.linker.script" useByScannerDiscovery="false" value="../stm32wb55xx_flash_cm4.ld" valueType="string"/>
- <option id="gnu.c.link.option.libs.132146619" name="Libraries (-l)" superClass="gnu.c.link.option.libs" useByScannerDiscovery="false"/>
- <option id="gnu.c.link.option.paths.1795253084" name="Library search path (-L)" superClass="gnu.c.link.option.paths" useByScannerDiscovery="false"/>
- <option id="gnu.c.link.option.ldflags.474489529" name="Linker flags" superClass="gnu.c.link.option.ldflags" useByScannerDiscovery="false" value="-specs=nosys.specs -specs=nano.specs" valueType="string"/>
+ <option id="fr.ac6.managedbuild.tool.gnu.cross.c.linker.script.1232757584" name="Linker Script (-T)" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.linker.script" value="../stm32wb55xx_flash_cm4.ld" valueType="string"/>
+ <option id="gnu.c.link.option.libs.132146619" name="Libraries (-l)" superClass="gnu.c.link.option.libs"/>
+ <option id="gnu.c.link.option.paths.1795253084" name="Library search path (-L)" superClass="gnu.c.link.option.paths"/>
+ <option id="gnu.c.link.option.ldflags.474489529" name="Linker flags" superClass="gnu.c.link.option.ldflags" value="-specs=nosys.specs -specs=nano.specs" valueType="string"/>
<option id="gnu.c.link.option.other.325768696" name="Other options (-Xlinker [option])" superClass="gnu.c.link.option.other" useByScannerDiscovery="false"/>
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.49258605" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
@@ -123,7 +122,7 @@
</tool>
<tool id="fr.ac6.managedbuild.tool.gnu.archiver.1892133396" name="MCU GCC Archiver" superClass="fr.ac6.managedbuild.tool.gnu.archiver"/>
<tool id="fr.ac6.managedbuild.tool.gnu.cross.assembler.1312283572" name="MCU GCC Assembler" superClass="fr.ac6.managedbuild.tool.gnu.cross.assembler">
- <option id="gnu.both.asm.option.include.paths.1849360374" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" useByScannerDiscovery="false"/>
+ <option id="gnu.both.asm.option.include.paths.1849360374" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths"/>
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.2001319719" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
<inputType id="fr.ac6.managedbuild.tool.gnu.cross.assembler.input.771691530" superClass="fr.ac6.managedbuild.tool.gnu.cross.assembler.input"/>
</tool>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Inc/app_conf.h
index b8ce35c9a..cedf8f16e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Inc/app_conf.h
@@ -24,12 +24,13 @@
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Health Thermometer Application Config
******************************************************************************/
-/**< generic parameters ********************************************************/
+/**< generic parameters ******************************************************/
/**
* Define Tx Power
@@ -85,6 +86,15 @@
*/
#define CFG_BLE_ERK {0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21,0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21}
+/* USER CODE BEGIN Generic_Parameters */
+/**
+ * SMPS supply
+ * SMPS not used when Set to 0
+ * SMPS used when Set to 1
+ */
+#define CFG_USE_SMPS 1
+/* USER CODE END Generic_Parameters */
+
/**< specific parameters ********************************************************/
@@ -168,7 +178,7 @@
* 1 : internal RO
* 0 : external crystal ( no calibration )
*/
-#define CFG_BLE_LSE_SOURCE 1
+#define CFG_BLE_LSE_SOURCE 0
/**
* Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
@@ -384,7 +394,6 @@ typedef enum
#define CFG_LPM_SUPPORTED 0
#define CFG_DEBUGGER_SUPPORTED 1
#endif
-
/**
* When CFG_DEBUG_TRACE_FULL is set to 1, the trace are output with the API name, the file name and the line number
* When CFG_DEBUG_TRACE_LIGHT is set to 1, only the debug message is output
@@ -483,6 +492,9 @@ typedef enum
{
CFG_LPM_APP,
CFG_LPM_APP_BLE,
+ /* USER CODE BEGIN CFG_LPM_Id_t */
+
+ /* USER CODE END CFG_LPM_Id_t */
} CFG_LPM_Id_t;
/******************************************************************************
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Inc/stm32_lpm_if.h
index 38e326512..d8e67947f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Inc/stm32_lpm_if.h
@@ -1,46 +1,22 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file stm32_lpm_if.h
-* @brief Header for stm32_lpm_f.c module (device specific LP management)
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
******************************************************************************
* @attention
*
-* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics International N.V.
+* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted, provided that the following conditions are met:
-*
-* 1. Redistribution of source code must retain the above copyright notice,
-* this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following disclaimer in the documentation
-* and/or other materials provided with the distribution.
-* 3. Neither the name of STMicroelectronics nor the names of other
-* contributors to this software may be used to endorse or promote products
-* derived from this software without specific written permission.
-* 4. This software, including modifications and/or derivative works of this
-* software, must execute solely and exclusively on microcontroller or
-* microprocessor devices manufactured by or for STMicroelectronics.
-* 5. Redistribution and use of this software other than as permitted under
-* this license is void and will automatically terminate your rights under
-* this license.
-*
-* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
-* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
-* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+* This software component is licensed by ST under BSD 3-Clause license,
+* the "License"; You may not use this file except in compliance with the
+* License. You may obtain a copy of the License at:
+* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32_LPM_IF_H
@@ -89,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Inc/stm32wbxx_hal_conf.h
index 8cce280aa..4ab9edb7d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Inc/stm32wbxx_hal_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Inc/stm32wbxx_hal_conf.h
@@ -219,6 +219,10 @@
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32wbxx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32wbxx_hal_flash.h"
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Inc/utilities_conf.h
index c98d97ba1..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Inc/utilities_conf.h
@@ -1,3 +1,4 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* File Name : utilities_conf.h
@@ -9,13 +10,14 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef UTILITIES_CONF_H
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Src/app_entry.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Src/app_entry.c
index 5d267284c..a4281a8eb 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Src/app_entry.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Src/app_entry.c
@@ -55,7 +55,6 @@ static void appe_Tl_Init( void );
static void Led_Init( void );
static void Button_Init( void );
static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status );
-
static void APPE_SysUserEvtRx( void * pPayload );
/* Functions Definition ------------------------------------------------------*/
@@ -81,7 +80,7 @@ void APPE_Init( void )
/**
* From now, the application is waiting for the ready event ( VS_HCI_C2_Ready )
- * received on the system channel before starting the BLE Stack
+ * received on the system channel before starting the Stack
* This system event is received with APPE_SysUserEvtRx()
*/
@@ -253,7 +252,6 @@ void UTIL_SEQ_Idle( void )
return;
}
-
void UTIL_SEQ_EvtIdle( UTIL_SEQ_bm_t task_id_bm, UTIL_SEQ_bm_t evt_waited_bm )
{
UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Src/hw_timerserver.c
index 52a1bfa0d..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Src/hw_timerserver.c
@@ -1,22 +1,21 @@
/**
******************************************************************************
- * File Name : hw_timerserver.c
- * Description : Hardware timerserver source file for BLE
- * middleWare.
+ * File Name : hw_timerserver.c
+ * Description : Hardware timerserver source file for STM32WPAN Middleware.
+ *
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Src/hw_uart.c
index c0fc22d58..775aa241d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Src/hw_uart.c
@@ -130,7 +130,7 @@
HAL_NVIC_EnableIRQ(CFG_HW_##__USART_BASE__##_TX_DMA_IRQn); \
} while(0)
- /* Variables ------------------------------------------------------------------*/
+/* Variables ------------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
UART_HandleTypeDef huart1 = {0};
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Src/main.c
index 34d973675..25a8c45e0 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Src/main.c
@@ -195,7 +195,13 @@ static void Init_RTC( void )
hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
HAL_RTC_Init(&hrtc);
- MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* Disable RTC registers write protection */
+ LL_RTC_DisableWriteProtection(RTC);
+
+ LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER);
+
+ /* Enable RTC registers write protection */
+ LL_RTC_EnableWriteProtection(RTC);
return;
}
@@ -218,6 +224,12 @@ void SystemClock_Config( void )
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -268,19 +280,6 @@ void SystemClock_Config( void )
*/
LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
@@ -289,21 +288,33 @@ void SystemClock_Config( void )
* WRAP FUNCTIONS
*
*************************************************************/
-
-/**
- * This function is empty to avoid starting the SysTick Timer
- */
-HAL_StatusTypeDef HAL_InitTick( uint32_t TickPriority )
+void HAL_Delay(uint32_t Delay)
{
- return (HAL_OK);
-}
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
-/**
- * This function is empty as the SysTick Timer is not used
- */
-void HAL_Delay(__IO uint32_t Delay)
-{
- return;
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
}
/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/STM32_WPAN/App/app_ble.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/STM32_WPAN/App/app_ble.c
index 453d5485d..b532ecb93 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/STM32_WPAN/App/app_ble.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/STM32_WPAN/App/app_ble.c
@@ -640,7 +640,7 @@ static void Adv_Request( APP_BLE_ConnStatus_t New_Status )
ret = aci_gap_set_non_discoverable();
if (ret == BLE_STATUS_SUCCESS)
{
- APP_DBG_MSG("Successfully Stopped Advertising\n");
+ APP_DBG_MSG("Successfully Stopped Advertising \n");
}
else
{
@@ -668,13 +668,13 @@ static void Adv_Request( APP_BLE_ConnStatus_t New_Status )
{
if (New_Status == APP_BLE_FAST_ADV)
{
- APP_DBG_MSG("Successfully Start Fast Advertising\n" );
+ APP_DBG_MSG("Successfully Start Fast Advertising \n" );
/* Start Timer to STOP ADV - TIMEOUT */
HW_TS_Start(BleApplicationContext.Advertising_mgr_timer_Id, INITIAL_ADV_TIMEOUT);
}
else
{
- APP_DBG_MSG("Successfully Start Low Power Advertising\n");
+ APP_DBG_MSG("Successfully Start Low Power Advertising \n");
}
}
else
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/STM32_WPAN/App/ble_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/STM32_WPAN/App/ble_conf.h
index dafbbd25e..ef00701bf 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/STM32_WPAN/App/ble_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/STM32_WPAN/App/ble_conf.h
@@ -50,7 +50,7 @@
* This shall take into account all registered handlers
* (from either the provided services or the custom services)
*/
-#define BLE_CFG_SVC_MAX_NBR_CB 5
+#define BLE_CFG_SVC_MAX_NBR_CB 7
#define BLE_CFG_CLT_MAX_NBR_CB 0
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/SW4STM32/Production/.cproject b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/SW4STM32/Production/.cproject
index 559611bb5..b80b45cf8 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/SW4STM32/Production/.cproject
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/SW4STM32/Production/.cproject
@@ -89,7 +89,7 @@
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble"/>
<listOptionValue builtIn="false" value="../../../Core/Inc"/>
- <listOptionValue builtIn="false" value="../../../STM32_WPAN/app"/>
+ <listOptionValue builtIn="false" value="../../../STM32_WPAN/App"/>
</option>
<option id="gnu.cpp.compiler.option.preprocessor.def.1766434856" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="USE_STM32WBXX_NUCLEO"/>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/SW4STM32/Production/.project b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/SW4STM32/Production/.project
index 8372e92da..afa476d0a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/SW4STM32/Production/.project
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_Proximity/SW4STM32/Production/.project
@@ -65,24 +65,24 @@
<location>PARENT-2-PROJECT_LOC/Core/Src/stm32wbxx_it.c</location>
</link>
<link>
- <name>Application/STM32_WPAN/app/app_ble.c</name>
+ <name>Application/STM32_WPAN/App/app_ble.c</name>
<type>1</type>
- <location>PARENT-2-PROJECT_LOC/STM32_WPAN/app/app_ble.c</location>
+ <location>PARENT-2-PROJECT_LOC/STM32_WPAN/App/app_ble.c</location>
</link>
<link>
- <name>Application/STM32_WPAN/app/ias_app.c</name>
+ <name>Application/STM32_WPAN/App/ias_app.c</name>
<type>1</type>
- <location>PARENT-2-PROJECT_LOC/STM32_WPAN/app/ias_app.c</location>
+ <location>PARENT-2-PROJECT_LOC/STM32_WPAN/App/ias_app.c</location>
</link>
<link>
- <name>Application/STM32_WPAN/app/lls_app.c</name>
+ <name>Application/STM32_WPAN/App/lls_app.c</name>
<type>1</type>
- <location>PARENT-2-PROJECT_LOC/STM32_WPAN/app/lls_app.c</location>
+ <location>PARENT-2-PROJECT_LOC/STM32_WPAN/App/lls_app.c</location>
</link>
<link>
- <name>Application/STM32_WPAN/app/tps_app.c</name>
+ <name>Application/STM32_WPAN/App/tps_app.c</name>
<type>1</type>
- <location>PARENT-2-PROJECT_LOC/STM32_WPAN/app/tps_app.c</location>
+ <location>PARENT-2-PROJECT_LOC/STM32_WPAN/App/tps_app.c</location>
</link>
<link>
<name>Application/STM32_WPAN/target/hw_ipcc.c</name>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/BLE_TransparentMode.ioc b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/BLE_TransparentMode.ioc
index 6be484c38..c0f80ac60 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/BLE_TransparentMode.ioc
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/BLE_TransparentMode.ioc
@@ -60,36 +60,42 @@ LPUART1.WordLength=UART_WORDLENGTH_8B
Mcu.Family=STM32WB
Mcu.IP0=DMA
Mcu.IP1=HSEM
+Mcu.IP10=TINY_LPM
+Mcu.IP11=USART1
Mcu.IP2=LPUART1
Mcu.IP3=NVIC
Mcu.IP4=RCC
Mcu.IP5=RF
Mcu.IP6=RTC
-Mcu.IP7=STM32_WPAN
-Mcu.IP8=SYS
-Mcu.IP9=USART1
-Mcu.IPNb=10
+Mcu.IP7=SEQUENCER
+Mcu.IP8=STM32_WPAN
+Mcu.IP9=SYS
+Mcu.IPNb=12
Mcu.Name=STM32WB55RGVx
Mcu.Package=VFQFPN68
-Mcu.Pin0=PA2
-Mcu.Pin1=PA3
-Mcu.Pin10=VP_RTC_VS_RTC_Activate
-Mcu.Pin11=VP_STM32_WPAN_VS_BLE_HOST
-Mcu.Pin12=VP_SYS_VS_Systick
-Mcu.Pin2=PA6
-Mcu.Pin3=RF1
-Mcu.Pin4=OSC_OUT
-Mcu.Pin5=OSC_IN
-Mcu.Pin6=PA11
-Mcu.Pin7=PB6
-Mcu.Pin8=PB7
-Mcu.Pin9=VP_HSEM_VS_HSEM
-Mcu.PinsNb=13
+Mcu.Pin0=PC14-OSC32_IN
+Mcu.Pin1=PC15-OSC32_OUT
+Mcu.Pin10=PB7
+Mcu.Pin11=VP_HSEM_VS_HSEM
+Mcu.Pin12=VP_RTC_VS_RTC_Activate
+Mcu.Pin13=VP_SEQUENCER_VS_SEQUENCER
+Mcu.Pin14=VP_STM32_WPAN_VS_BLE_HOST
+Mcu.Pin15=VP_SYS_VS_Systick
+Mcu.Pin16=VP_TINY_LPM_VS_TINY_LPM
+Mcu.Pin2=PA2
+Mcu.Pin3=PA3
+Mcu.Pin4=PA6
+Mcu.Pin5=RF1
+Mcu.Pin6=OSC_OUT
+Mcu.Pin7=OSC_IN
+Mcu.Pin8=PA11
+Mcu.Pin9=PB6
+Mcu.PinsNb=17
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32WB55RGVx
-MxCube.Version=5.2.1
-MxDb.Version=DB.5.0.21
+MxCube.Version=5.4.0
+MxDb.Version=DB.5.0.40
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false
NVIC.DMA1_Channel4_IRQn=true\:15\:0\:true\:false\:true\:false\:true
NVIC.DMA2_Channel4_IRQn=true\:15\:0\:true\:false\:true\:false\:true
@@ -142,6 +148,10 @@ PB7.GPIO_Speed=GPIO_SPEED_FREQ_VERY_HIGH
PB7.Locked=true
PB7.Mode=Asynchronous
PB7.Signal=USART1_RX
+PC14-OSC32_IN.Mode=LSE-External-Oscillator
+PC14-OSC32_IN.Signal=RCC_OSC32_IN
+PC15-OSC32_OUT.Mode=LSE-External-Oscillator
+PC15-OSC32_OUT.Signal=RCC_OSC32_OUT
PCC.Ble.ConnectionInterval=1000.0
PCC.Ble.DataLength=6
PCC.Ble.Mode=Advertising
@@ -164,7 +174,7 @@ ProjectManager.DeletePrevious=true
ProjectManager.DeviceId=STM32WB55RGVx
ProjectManager.FreePins=false
ProjectManager.HalAssertFull=false
-ProjectManager.HeapSize=0x200
+ProjectManager.HeapSize=0x400
ProjectManager.KeepUserCode=true
ProjectManager.LastFirmware=true
ProjectManager.LibraryCopy=2
@@ -174,11 +184,11 @@ ProjectManager.PreviousToolchain=
ProjectManager.ProjectBuild=false
ProjectManager.ProjectFileName=BLE_TransparentMode.ioc
ProjectManager.ProjectName=BLE_TransparentMode
-ProjectManager.StackSize=0x400
+ProjectManager.StackSize=0x1000
ProjectManager.TargetToolchain=EWARM V8
ProjectManager.ToolChainLocation=
ProjectManager.UnderRoot=false
-ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-SystemClock_Config-RCC-false-HAL-false,4-MX_LPUART1_UART_Init-LPUART1-true-HAL-false,5-MX_USART1_UART_Init-USART1-true-HAL-false,6-MX_RF_Init-RF-false-HAL-true,7-MX_RTC_Init-RTC-false-HAL-true,8-MX_STM32_WPAN_Init-STM32_WPAN-false-HAL-true
+ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-SystemClock_Config-RCC-false-HAL-false,4-MX_LPUART1_UART_Init-LPUART1-true-HAL-false,5-MX_USART1_UART_Init-USART1-true-HAL-false,6-MX_RF_Init-RF-false-HAL-true,7-MX_RTC_Init-RTC-false-HAL-true,8-APPE_Init-STM32_WPAN-false-HAL-false
RCC.ADCFreq_Value=64000000
RCC.AHBFreq_Value=32000000
RCC.APB1Freq_Value=32000000
@@ -200,12 +210,12 @@ RCC.HSI48_VALUE=48000000
RCC.HSI_VALUE=16000000
RCC.I2C1Freq_Value=32000000
RCC.I2C3Freq_Value=32000000
-RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSE_VALUE,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PLLSourceVirtual,PWRFreq_Value,RNGFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LCDFreq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PLLSourceVirtual,PWRFreq_Value,RFWKPClockSelection,RFWKPFreq_Value,RNGFreq_Value,RTCClockSelection,RTCFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.LCDFreq_Value=32768
RCC.LPTIM1Freq_Value=32000000
RCC.LPTIM2Freq_Value=32000000
RCC.LPUART1Freq_Value=32000000
RCC.LSCOPinFreq_Value=32000
-RCC.LSE_VALUE=32768
RCC.LSI_VALUE=32000
RCC.MCO1PinFreq_Value=32000000
RCC.PLLPoutputFreq_Value=64000000
@@ -216,7 +226,11 @@ RCC.PLLSAI1QoutputFreq_Value=64000000
RCC.PLLSAI1RoutputFreq_Value=64000000
RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSI
RCC.PWRFreq_Value=32000000
+RCC.RFWKPClockSelection=RCC_RFWKPCLKSOURCE_LSE
+RCC.RFWKPFreq_Value=32768
RCC.RNGFreq_Value=32000
+RCC.RTCClockSelection=RCC_RTCCLKSOURCE_LSE
+RCC.RTCFreq_Value=32768
RCC.SAI1Freq_Value=64000000
RCC.SMPS1Freq_Value=16000000
RCC.SYSCLKFreq_VALUE=32000000
@@ -228,11 +242,6 @@ RCC.VCOOutputFreq_Value=128000000
RCC.VCOSAI1OutputFreq_Value=128000000
RF1.Mode=RF1_Activate
RF1.Signal=RF_RF1
-RTC.AsynchPrediv=CFG_RTC_ASYNCH_PRESCALER
-RTC.HourFormat=RTC_HOURFORMAT_24
-RTC.IPParameters=HourFormat,AsynchPrediv,SynchPrediv
-RTC.IPParametersWithoutCheck=AsynchPrediv,SynchPrediv
-RTC.SynchPrediv=CFG_RTC_SYNCH_PRESCALER
STM32_WPAN.BLE_APPLICATION_TYPE=TRANSPARENT_MODE
STM32_WPAN.BLE_CFG_DIS_MODEL_NUMBER_STRING=1
STM32_WPAN.BLE_CFG_DIS_SYSTEM_ID=1
@@ -244,6 +253,7 @@ STM32_WPAN.CFG_CONSOLE_MENU=hw_lpuart1
STM32_WPAN.CFG_DEBUGGER_SUPPORTED=0
STM32_WPAN.CFG_DEBUG_APP_TRACE=0
STM32_WPAN.CFG_DEBUG_BLE_TRACE=0
+STM32_WPAN.CFG_DEBUG_TRACE_LIGHT=0
STM32_WPAN.CFG_FAST_CONN_ADV_INTERVAL_MAX_HEXA=0x0
STM32_WPAN.CFG_FAST_CONN_ADV_INTERVAL_MIN_HEXA=0x0
STM32_WPAN.CFG_HW_LPUART1_DMA_TX_SUPPORTED=0
@@ -260,7 +270,7 @@ STM32_WPAN.CFG_LP_CONN_ADV_INTERVAL_MAX_HEXA=0xfa0
STM32_WPAN.CFG_LP_CONN_ADV_INTERVAL_MIN=0x640
STM32_WPAN.CFG_RTCCLK_DIVIDER_CONF=0
STM32_WPAN.CFG_UART_GUI=hw_uart1
-STM32_WPAN.IPParameters=CFG_FAST_CONN_ADV_INTERVAL_MAX_HEXA,CFG_LP_CONN_ADV_INTERVAL_MAX_HEXA,LOCAL_NAME_FORMATTED,CFG_HW_LPUART1_ENABLED,CFG_DEBUG_BLE_TRACE,CFG_DEBUG_APP_TRACE,CFG_CONSOLE_MENU,CFG_ADV_BD_ADDRESS,CFG_LP_CONN_ADV_INTERVAL_MAX,CFG_LP_CONN_ADV_INTERVAL_MIN,CFG_HW_LPUART1_DMA_TX_SUPPORTED,LOCAL_NAME,CFG_HW_USART1_ENABLED,CFG_LPM_SUPPORTED,BLE_CFG_DIS_MODEL_NUMBER_STRING,BLE_CFG_DIS_SYSTEM_ID,BLE_CFG_HTS_MEASUREMENT_INTERVAL,BLE_CFG_HTS_TEMPERATURE_INTERVAL_MAX_VALUE,BLE_APPLICATION_TYPE,CFG_FAST_CONN_ADV_INTERVAL_MIN_HEXA,CFG_DEBUGGER_SUPPORTED,CFG_UART_GUI,BLE_TRANSPARENT_MODE_UART,CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO,CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION,CFG_HW_RESET_BY_FW,CFG_RTCCLK_DIVIDER_CONF
+STM32_WPAN.IPParameters=CFG_FAST_CONN_ADV_INTERVAL_MAX_HEXA,CFG_LP_CONN_ADV_INTERVAL_MAX_HEXA,LOCAL_NAME_FORMATTED,CFG_HW_LPUART1_ENABLED,CFG_DEBUG_BLE_TRACE,CFG_DEBUG_APP_TRACE,CFG_CONSOLE_MENU,CFG_ADV_BD_ADDRESS,CFG_LP_CONN_ADV_INTERVAL_MAX,CFG_LP_CONN_ADV_INTERVAL_MIN,CFG_HW_LPUART1_DMA_TX_SUPPORTED,LOCAL_NAME,CFG_HW_USART1_ENABLED,CFG_LPM_SUPPORTED,BLE_CFG_DIS_MODEL_NUMBER_STRING,BLE_CFG_DIS_SYSTEM_ID,BLE_CFG_HTS_MEASUREMENT_INTERVAL,BLE_CFG_HTS_TEMPERATURE_INTERVAL_MAX_VALUE,BLE_APPLICATION_TYPE,CFG_FAST_CONN_ADV_INTERVAL_MIN_HEXA,CFG_DEBUGGER_SUPPORTED,CFG_UART_GUI,BLE_TRANSPARENT_MODE_UART,CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO,CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION,CFG_HW_RESET_BY_FW,CFG_RTCCLK_DIVIDER_CONF,CFG_DEBUG_TRACE_LIGHT
STM32_WPAN.IPParametersWithoutCheck=CFG_LP_CONN_ADV_INTERVAL_MAX,CFG_LP_CONN_ADV_INTERVAL_MIN,BLE_CFG_HTS_TEMPERATURE_INTERVAL_MAX_VALUE
STM32_WPAN.LOCAL_NAME=HTSTM
STM32_WPAN.LOCAL_NAME_FORMATTED=,'H','T','S','T','M'
@@ -290,8 +300,12 @@ VP_HSEM_VS_HSEM.Mode=HSEM_Activate
VP_HSEM_VS_HSEM.Signal=HSEM_VS_HSEM
VP_RTC_VS_RTC_Activate.Mode=RTC_Enabled
VP_RTC_VS_RTC_Activate.Signal=RTC_VS_RTC_Activate
+VP_SEQUENCER_VS_SEQUENCER.Mode=SEQUENCER_Enabled
+VP_SEQUENCER_VS_SEQUENCER.Signal=SEQUENCER_VS_SEQUENCER
VP_STM32_WPAN_VS_BLE_HOST.Mode=STM32_WPAN_Enabled
VP_STM32_WPAN_VS_BLE_HOST.Signal=STM32_WPAN_VS_BLE_HOST
VP_SYS_VS_Systick.Mode=SysTick
VP_SYS_VS_Systick.Signal=SYS_VS_Systick
+VP_TINY_LPM_VS_TINY_LPM.Mode=TINY_LPM_Enabled
+VP_TINY_LPM_VS_TINY_LPM.Signal=TINY_LPM_VS_TINY_LPM
board=custom
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Binary/BLE_TransparentMode_reference.hex b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Binary/BLE_TransparentMode_reference.hex
index cccfbcebf..731bb6481 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Binary/BLE_TransparentMode_reference.hex
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Binary/BLE_TransparentMode_reference.hex
@@ -1,1136 +1,1136 @@
:020000040800F2
-:10000000E014002099460008954400089744000831
-:10001000994400089B4400089D440008000000002B
-:100020000000000000000000000000009F440008E5
-:10003000A144000800000000A3440008A5440008F3
-:10004000B5460008B9460008BD460008D744000878
-:10005000C1460008C5460008C9460008CD4600084C
-:10006000D1460008D5460008D1440008D94600080A
-:10007000DD460008E1460008A9440008E5460008FE
-:10008000E9460008ED460008F1460008F54600087C
-:10009000F9460008FD46000801470008054700082A
-:1000A000094700080D4700081147000815470008D8
-:1000B000194700081D470008214700082547000888
-:1000C000294700082D470008314700083547000838
-:1000D000AF440008B5440008394700083D47000810
-:1000E0004147000845470008494700084D470008B8
-:1000F000DF440008DB44000851470008554700086A
-:10010000594700085D470008614700086547000837
-:10011000694700086D4700087147000875470008E7
-:10012000794700087D470008BB4400088147000864
-:1001300085470008894700088D47000838B5040046
-:1001400009D004F17C05686808B900F01EF800F0D9
+:10000000E0140020A1460008A9440008AB44000801
+:10001000AD440008AF440008B144000800000000EF
+:10002000000000000000000000000000B3440008D1
+:10003000B544000800000000B7440008B9440008B7
+:10004000BD460008C1460008C5460008EB4400084C
+:10005000C9460008CD460008D1460008D54600082C
+:10006000D9460008DD460008E5440008E1460008DE
+:10007000E5460008E9460008BD440008ED460008D2
+:10008000F1460008F5460008F9460008FD4600085C
+:100090000147000805470008094700080D47000808
+:1000A0001147000815470008194700081D470008B8
+:1000B0002147000825470008294700082D47000868
+:1000C0003147000835470008394700083D47000818
+:1000D000C3440008C94400084147000845470008D8
+:1000E000494700084D470008514700085547000898
+:1000F000F3440008EF440008594700085D47000832
+:100100006147000865470008694700086D47000817
+:100110007147000875470008794700087D470008C7
+:100120008147000885470008CF4400088947000838
+:100130008D470008914700089547000838B504002E
+:1001400009D004F17C05696809B900F01EF800F0D7
:1001500021F8012801D1012032BDA06A08B100F0C8
:100160002AF800F00AF821F02A01FFE7816000F088
-:100170001BF8BDE8324000F08CBE2068416821F4D5
-:1001800090414160206881687047002129702046B5
-:1001900001F0A5B82420686020680168490849007A
-:1001A0000160204600F0AAB92068016841F0010111
-:1001B000016020467047204600F008BE30B500F1CF
+:100170001BF8BDE8324000F0ACBE2068416821F4B5
+:1001800090414160206881687047002028702046B7
+:1001900001F0CFB82421696020680268520852003B
+:1001A0000260204600F0BEB92068016841F00101FC
+:1001B000016020467047204600F028BE30B500F1AF
:1001C0007C035C68202C41D109B1140001D10120CD
:1001D00030BD1C78012C39D001251D7000F154046C
:1001E0000165228062800021E161D960212159608E
-:1001F00021698268B1F1005F13D1B2F5805F04BF5D
-:100200000169002907BFDFF8C422E261DFF8C012EC
-:10021000E161002119700068816841F4000181608A
-:1002200012E0B2F5805F04BF0169002907BFDFF863
-:10023000A422E261DFF8A012E161002119700068D8
+:1001F00022698168B2F1005F13D1B1F5805F04BF5D
+:100200000169002907BFDFF8F422E261DFF8F0128C
+:10021000E16100221A700068816841F40001816088
+:1002200012E0B1F5805F04BF0169002907BFDFF864
+:10023000D422E261DFF8D012E16100221A70006876
:10024000016841F080010160002030BD022030BD16
-:1002500030B500F17C039C68202C6AD109B11400F0
-:1002600001D1012030BD1C78012C62D001251D7008
+:1002500030B500F17C039C68202C6BD109B11400EF
+:1002600001D1012030BD1C78012C63D001251D7007
:1002700000F15C0481652280628000212161FF25FC
-:100280008168B1F5805F04D1016961B940F2FF1561
-:1002900009E011B9016929B905E0B1F1805F06D122
-:1002A000016911B97F25A58003E03F2100E000210D
-:1002B000A1800021D9602221996001688D6845F0F4
-:1002C00001058D60A168B1F1005F1CD1A589AA422A
-:1002D00019D38268B2F5805F04BF0169002907BFA6
-:1002E000DFF8F8212261DFF8F8112161002119708F
-:1002F00001680A6842F480720A600068816841F00F
-:100300008051816013E08268B2F5805F04BF0169AB
-:10031000002907BFDFF8CC212261DFF8CC11216171
-:10032000002119700068016841F49071016000209B
-:1003300030BD022030BD206881684A06704770B524
-:1003400004462568E9692A68AB6811F00F000CD1F2
-:10035000880602D5900601D4D80079D5E16E00292F
-:1003600075D02046BDE8704008476048034208BF8A
-:1003700012F4907F6CD0CE0709D5D60507D501269B
-:100380002E62D4F8885045F00105C4F888508D07D6
-:100390000AD5DD0708D5266802253562D4F88850CD
-:1003A00045F00405C4F888504D070AD5DD0708D587
-:1003B000266804253562D4F8885045F00205C4F853
-:1003C00088500D070CD5950601D4034208D0256846
-:1003D00008202862D4F8880040F00800C4F888009B
-:1003E000D4F8880000286FD0890607D5900601D47C
-:1003F000D80003D5E16E09B120468847D4F88800BB
-:1004000021688A68510601D400071AD5204600F0F9
-:100410009DFDFFF790FF0FD500F06AF860B1DFF89F
-:100420009C198163A06F01F088F800284CD0A06F60
-:10043000816BBDE8704008472046BDE8704001F080
-:1004400051B9204601F04EF90020C4F8880070BD73
-:10045000C80209D5580207D54FF4801028622046FB
-:10046000BDE8704001F0C6B9080609D5100601D4F0
-:10047000180205D5216F39B32046BDE87040084702
-:1004800048060FD550060DD5286820F0400028609A
-:100490002021C4F88010002020672046BDE870406D
-:1004A00001F0C6B9080206D5500004D52046BDE8C3
-:1004B000704001F0CFB9C80148BF002A04D52046DA
-:1004C000BDE8704001F0C7B970BD00006D100008B4
-:1004D0002D100008FF0F0008D50F0008AF1100080D
-:1004E00057110008E9100008C510000801000010AD
-:1004F000816821F040018160A06F70472DE9F84FBD
-:100500000446DFF86C0A2768DFF868BA3968DFF854
-:1005100068AA0140A0680143206901436069014362
-:10052000E0690143606E0143396000267968E06844
-:1005300021F4405101437960B046A169DFF83C0ADB
-:1005400087421CBF206A0143BA68DFF8340A0240C0
-:100550001143B9604FF48075F96A606A090940EA8D
-:100560000111F9625F454FF400404FF400714FF400
-:1005700080624FF400634FF4805C4FF4005E4FF4F0
-:10058000804929D1DAF800B00BF0030BBBF1030F5F
-:100590003ED8DFE80BF00237343A4FF0010AD4F8C6
-:1005A0001CB05746BBF5004F4FF6F07A40F0118370
-:1005B000012F09D0022F00F05482042F00F08D8209
-:1005C000082F00F0C282F5E201F01AFD0146606AD0
-:1005D000002840F01B8242E2DFF8A0B95F4517D146
-:1005E000DAF800A01AF4406A27D0BAF5806F09D073
-:1005F000BAF5006F03D0BAF5406F06D008E04FF0AF
-:10060000020A07E04FF0040A04E04FF0080A01E094
-:100610004FF0100ADFF864B95F45C0D1BAF1000F9E
-:100620000BD0BAF1020F49D0BAF1040F00F082806A
-:10063000BAF1080F00F0B080B3E301F0D9FC014635
-:10064000606A58B3012808BF022028D0022808BFDA
-:10065000042024D0032808BF062020D0042808BF87
-:1006600008201CD0052808BF0A2018D0062808BF7B
-:100670000C2014D0072808BF102010D0082808BF6D
-:1006800020200CD0092808BF402008D00A2808BF25
-:10069000802004D00B2808BF284600D00120B1FBE1
-:1006A000F0F0002800F07F83626802EB420188428C
-:1006B00003D31103814280F0A18072E3606AB0B37A
-:1006C000012808BFDFF8BC08EED0022808BFDFF819
-:1006D000B808E9D0032808BFDFF8B008E4D0042840
-:1006E00008BFDFF8AC08DFD0052808BFDFF8A40892
-:1006F000DAD0062808BFDFF8A008D5D0072808BF41
-:10070000DFF89808D0D0082808BFDFF89408CBD0CD
-:10071000092808BFDFF88C08C6D00A2808BFDFF810
-:100720008808C1D00B2808BF4FF22440BCD0DFF8A6
-:100730007C08B9E701F012FC0146606A58B3012851
-:1007400008BF0220ABD0022808BF0420A7D003288E
-:1007500008BF0620A3D0042808BF08209FD0052882
-:1007600008BF0A209BD0062808BF0C2097D0072876
-:1007700008BF102093D0082808BF20208FD0092858
-:1007800008BF40208BD00A2808BF802087D00B28C4
-:1007900008BF284683D081E7676A002F84D0012FE5
-:1007A00008BF4846FAD0022F08BF7046F6D0032F84
-:1007B00008BF41F25550F1D0042F08BF6046EDD07C
-:1007C000052F08BF40F6CC40E8D0062F08BF40F602
-:1007D000AA2012D0072F08BF18460ED0082F08BF36
-:1007E00010460AD0092F08BF084606D00A2F08BFB6
-:1007F000284602D00B2F00D1802055E7BAF1000F18
-:100800000BD0BAF1020F38D0BAF1040F00F07280A9
-:10081000BAF1080F00F0A780ECE001F0E9FB014617
-:10082000606A40B3012808BF02251ED0022808BF15
-:1008300004251AD0032808BF062516D0042808BFAF
-:10084000082512D0052808BF0A250ED0062808BFA3
-:100850000C250AD0072808BF102506D0082808BF95
-:10086000202502D0092808BF402572D00A280CBFD5
-:1008700080250B286DD001256BE0606A002836D0FA
-:10088000012808BFDFF874692BD0022808BFDFF801
-:10089000706926D0032808BFDFF8686921D00428D2
-:1008A00008BFDFF864691CD0052808BFDFF85C6961
-:1008B00017D0062808BFDFF8586912D0072808BFEC
-:1008C000DFF850690DD0082808BFDFF84C6908D060
-:1008D000092808BFDFF8446903D00A2808BFDFF8F9
-:1008E00040697CD00B2808BFDFF8C06677D0DFF8FE
-:1008F000346974E001F032FB0146606A40B30128BC
-:1009000008BF022525D0022808BF042521D00328CE
-:1009100008BF06251DD0042808BF082519D00528C2
-:1009200008BF0A2515D0062808BF0C2511D00728B6
-:1009300008BF10250DD0082808BF202509D0092898
-:1009400008BF402505D00A280CBF80250B2800D001
-:1009500001256268B1FBF5F65008002110EB062076
-:1009600051EB166141E0606A002836D0012808BFCB
-:100970004FF4800633D0022808BF4FF400162ED063
-:10098000032808BFDFF8A06829D0042808BF4FF467
-:10099000801624D0052808BFDFF890681FD00628ED
-:1009A00008BFDFF88C681AD0072808BF4FF400266C
-:1009B00015D0082808BF4FF4802610D0092808BF9A
-:1009C0004FF400360BD00A2808BF4FF4803606D00B
-:1009D0000B2808BF4FF4004601D04FF40006C24672
-:1009E000002116EB52004AEB0101002301F094FBB9
-:1009F000064601E04FF00108A6F54070DFF8341814
-:100A0000884280F0CE812168CE60CCE1012808BF09
-:100A100002251AD0022808BF042516D0032808BFD3
-:100A2000062512D0042808BF08250ED0052808BFC7
-:100A30000A250AD0062808BF0C2506D0072808BFBB
-:100A4000102502D0082808BF202575D0092808BF26
-:100A5000402571D00A280CBF80250B286CD00125B9
-:100A60006AE0606AB0B3012808BFDFF8400521D012
-:100A7000022808BFDFF80C051CD0032808BFDFF8E8
-:100A8000B80717D0042808BFDFF8FC0412D00528E7
-:100A900008BFDFF8A8070DD0062808BFDFF8EC0470
-:100AA00008D0072808BFDFF8E80403D0082808BFEB
-:100AB000DFF8E8047AD0092808BFDFF8E40475D02D
-:100AC0000A2808BFDFF8DC0470D00B2808BFDFF865
-:100AD000D8046BD0DFF8480768E001F03FFA014620
-:100AE000606A40B3012808BF022525D0022808BF4C
-:100AF000042521D0032808BF06251DD0042808BFDF
-:100B0000082519D0052808BF0A2515D0062808BFD2
-:100B10000C2511D0072808BF10250DD0082808BFC4
-:100B2000202509D0092808BF402505D00A280CBF78
-:100B300080250B2800D001256068B1FBF5F1420843
-:100B400002EB4102B2FBF0F632E0666A66B3012EB8
-:100B50002CD0022E08BF484628D0032E08BF42F6EC
-:100B6000AA2023D0042E08BF70461FD0052E08BF30
-:100B700041F698101AD0062E08BF41F2545015D0F5
-:100B8000072E08BF604611D0082E08BF18460DD0AA
-:100B9000092E08BF104609D00A2E08BF084605D006
-:100BA0000B2E08BF284601D04FF4803000F008F922
-:100BB000B6B201E04FF00108A6F11000504580F0F8
-:100BC000F0800AEA0601C6F3420001432068C160D2
-:100BD000E9E0012F07D0022F35D0042F6DD0082F68
-:100BE00000F0A280D4E001F00BFA0146606A40B345
-:100BF000012808BF022512D0022808BF04250ED004
-:100C0000032808BF06250AD0042808BF082506D0F7
-:100C1000052808BF0A2502D0062808BF0C257BD06E
-:100C2000072808BF102577D0082808BF202573D0D3
-:100C3000092808BF40256FD00A280CBF80250B2843
-:100C40006AD0012568E0606AA0B3012808BFDFF818
-:100C5000341330D0022808BFDFF82C132BD0032820
-:100C600008BFDFF8281326D0042808BFDFF82013B8
-:100C700021D0052808BFDFF81C131CD0062808BFA8
-:100C8000DFF8141317D0072808BFDFF8101312D0AD
-:100C9000082808BFDFF808130DD0092808BFC1498C
-:100CA00009D00A2808BFC04905D00B2808BF4FF259
-:100CB000244100D0BD49606831E001F04FF90146A0
-:100CC000606A40B3012808BF022525D0022808BF6A
-:100CD000042521D0032808BF06251DD0042808BFFD
-:100CE000082519D0052808BF0A2515D0062808BFF1
-:100CF0000C2511D0072808BF10250DD0082808BFE3
-:100D0000202509D0092808BF402505D00A280CBF96
-:100D100080250B2800D001256068B1FBF5F101EBBF
-:100D20005001B1FBF0F631E0666A6EB3012E08BFE8
-:100D3000484629D0022E08BF704625D0032E08BF92
-:100D400041F2555020D0042E08BF60461CD0052E1D
-:100D500008BF40F6CC4017D0062E08BF40F6AA20A8
-:100D600012D0072E08BF18460ED0082E08BF104616
-:100D70000AD0092E08BF084606D00A2E08BF28460A
-:100D800002D00B2E08BF802000F01AF8B6B201E0A6
-:100D90004FF00108A6F11000504502D22068C6604D
-:100DA00001E04FF0010804F1680001214180018059
-:100DB0000021416081604046BDE8F28FC50F000808
-:100DC000616800EB5100B0FBF1F6704790F8281015
-:100DD000CA0706D502685368C16A23F400330B437F
-:100DE000536090F828108A0706D502685368016B93
-:100DF00023F480330B43536090F828104A0706D53C
-:100E000002685368416B23F480230B43536090F8CE
-:100E100028100A0706D502685368816B23F4004343
-:100E20000B43536090F82810CA0606D502689368F1
-:100E3000C16B23F480530B43936090F828108A060B
-:100E400006D502689368016C23F400530B4393604A
-:100E500090F828104A0610D502685368416C23F4B4
-:100E600080130B435360416CB1F5801F05D153686B
-:100E7000816C23F4C0030B43536090F828100A06DA
-:100E800006D501684A68C06C22F4002202434A6019
-:100E90007047F8B5044604F17C050020E8606FF067
-:100EA0007E4701F051FA0646206801680A0708D516
-:100EB0000097334600224FF40011204600F016F848
-:100EC00060B9206801684A070AD5009733460022B6
-:100ED0004FF48001204600F009F808B10320F2BD6C
-:100EE00020206860A86000202870F2BD2DE9F04144
-:100EF000069C05460E4690461F462868C16931404B
-:100F0000B1420CBF0120002040451CD114F1010F5B
-:100F1000F3D001F019FAC01B844201D3002CECD1AC
-:100F20002868016821F4D071016028688168490847
-:100F30004900816005F17C00202141608160002131
-:100F40000170032000E00020BDE8F08101680A681C
-:100F500022F490720A60DFF8E812026893680B408E
-:100F600093602021C0F884100021C1667047000002
-:100F7000F369FFCF0038014088000058008000402E
-:100F8000FFF4FF1100127A0000093D00AAB028000A
-:100F900080841E00006A18005558140040420F005B
-:100FA00020A1070090D0030048E801000024F400CD
-:100FB000136823F0800313600068016841F040016A
-:100FC00001607047806A00F1560100220A810A80A0
-:100FD00000F088BBD0F8801021290FD10268B0F84A
-:100FE000561001B9E4E7036D19789162016D4A1C4E
-:100FF0000265B0F856104A1EA0F856207047D0F887
-:101000008010212911D10268B0F8561001B9CFE73C
-:10101000036D1988C1F308019162016D8A1C026594
-:10102000B0F856104A1EA0F856207047D0F880102D
-:10103000212900D0704730B500F15602938A0CE0A8
-:10104000E1690D0608D5016D0D78A562016D4C1C96
-:1010500004651488611E11805B1E99B229B1046871
-:1010600011880029ECD100F023F830BDD0F88010B1
-:10107000212900D0704730B500F15602938A0EE066
-:10108000E1690D060AD5016D0D88C5F30805A56255
-:10109000016D8C1C04651488611E11805B1E99B261
-:1010A00029B1046811880029EAD100F001F830BDA7
-:1010B000A26822F40002A2600068016841F04001C9
-:1010C0000160704710B500F027F808D100F02AF849
-:1010D0000B70816D4B1C00F019F821B929E088696B
-:1010E00040F00800886110BD10B500F015F808D177
-:1010F00000F018F80B80816D8B1C00F007F821B907
-:1011000017E0886940F00800886110BD8365238876
-:10111000591E21802188704700F16C020168936993
-:10112000222B70474B6A00F15E0461880B40816D91
-:10113000704701680B6823F490730B6001688B683B
-:101140005B085B008B602021916100211160BDE88C
-:10115000104000F063BB2DE9F84300F07DF81CD18E
-:101160006789DFF8DC900AE000F08DF80870B06D58
-:10117000411C00F06BF808B900F08BF87F1EB8B284
-:101180000028F1D1208850B16189884207DA00F047
-:1011900074F82C4800F06AF801E000F002F8BDE8AD
-:1011A000F1833068816941F00801816170472DE960
-:1011B000F84300F051F81CD16789DFF884900AE009
-:1011C00000F061F80880B06D811C00F03FF808B9AC
-:1011D00000F05FF87F1EB8B20028F1D1208850B12E
-:1011E0006189884207DA00F048F8174800F03EF8B5
-:1011F00001E0FFF7D6FFBDE8F18300000000127A9E
-:101200000000093D00AAB0280080841E00006A1872
-:10121000005558140040420F0020A1070090D00351
-:101220000048E801000024F40055150000CC0C0033
-:1012300000AA0A0000FD0F005461510000D43000E4
-:10124000FEFFFFEFC5100008E9100008B165218816
-:10125000481E208020887047064606F15E0406F18D
-:101260006C05B4F80280A8692228704728603068AD
-:10127000016841F02001016070473068816821F009
-:101280008051816070473068406AB16D08EA0000A3
-:1012900070473068016821F48071016030688168AE
-:1012A00009EA010181602020A86100202860304601
-:1012B00000F0B4BA614981B00A6802430A60096863
-:1012C000084008E05E4881B0016841F400210160F7
-:1012D000006800F400200090009801B0704738B515
-:1012E00086B004466846142101F034F82068554A57
-:1012F000554990422ED10868544D40F001000860D5
-:10130000096801F00101059105980120FFF7D2FF5E
-:101310000C2000900221002001910290032108205E
-:10132000039100F05AF8402000F050F8082000F037
-:1013300054F847482860112000F055F808B101F032
-:1013400058F96567AC6200220021252001F06EF992
-:10135000252037E03F4A904236D148683E4D40F460
-:1013600080404860486800F480400590059801205E
-:10137000FFF7A0FF0220FFF79DFF4FF4006000F091
-:1013800025F8072000F029F8C02000900221012054
-:1013900001910290032107200391049069462F4890
-:1013A00001F0A2F92E4828600F2000F01CF808B1C7
-:1013B00001F01FF96567AC6200220021242001F0D2
-:1013C00035F9242001F04FF907B030BD009002211B
-:1013D00000200290039001917047049069464FF0FD
-:1013E000904001F081B968601020A8600020E8609A
-:1013F0008020286100206861A861E8612862284691
-:1014000000F034B810B5044616492068884213D15C
-:1014100001F04EFA01F04CFA1348016821F44071D2
-:1014200041F480710160026842F40042026020468B
-:10143000BDE8104001F050BA10BD00004C0000584B
-:1014400050000058008000405C00005890030020CD
-:101450004400024000380140F0030020000400482E
-:1014600044040240002800409000005838B50400B1
-:1014700001D1012032BD2168DFF84002814204F130
-:10148000240500F042F8022068700A68A0686FF333
-:101490000E120243E068024320690243606902437E
-:1014A000A0690243E0690243206A02430A602046C1
-:1014B00000F0DAF8A068B0F5804F04BF0021616049
-:1014C000696A207900F014F838B1052805D2204661
-:1014D00000F0E4F800F012F803E0002028636863ED
-:1014E000A8630020A861012068700020287032BD28
-:1014F0000860A96AE86A486060687047296B002044
-:101500000860696BA86B486070470AD2DFF8B001C9
-:1015100042181423B2FBF3F292002A62DFF8A4010E
-:1015200009E0DFF8A40142181423B2FBF3F29200A1
-:101530002A62DFF89801E861704738B500F12402AB
-:1015400000245178022903D004209061012428E06E
-:1015500001680B6823F00E030B6001680D686D08CD
-:101560006D000D60516A0B6823F480730B600121DC
-:1015700092F82030D56903F01C0399406960936AA2
-:10158000D16A5960116B31B10B6823F480730B6021
-:10159000536B916B5960012151701470516901B105
-:1015A0008847204632BDF8B500F124010423CA69FA
-:1015B00014680268156891F8206006F01C0603FAAA
-:1015C00006F73C4210D06F070ED51468A50603D469
-:1015D000156825F00405156000F03DF8C96800297C
-:1015E00038D0BDE8F4400847022303FA06F73C422E
-:1015F00013D0AF0711D51468A50605D4156825F0DA
-:101600000A05156001224A7000F025F800220A70D0
-:101610008968F9B1BDE8F4400847082303FA06F6E3
-:10162000344217D02B0715D5136823F00E0313602F
-:10163000012291F82030CC6903F01C039A406260CB
-:1016400001228A614A7000220A70096911B1BDE85D
-:10165000F4400847F1BD91F82020CC6902F01C024B
-:101660009340636070470000416C0268134B890827
-:101670009A4234BF164B174B03EB8101816402F091
-:10168000FF02083A1421B2FBF1F1134AC26401F0DF
-:101690001C01012202FA01F10165704701790F4A2C
-:1016A00002EB81024265491E0D4A826501F0030189
-:1016B00001228A40C2657047000000000804024011
-:1016C000F8FFFDBF00000240F8FBFDBF0004024030
-:1016D000000802401C08024080080240FC0802404A
-:1016E000400902407047000010B500F17C010A7803
-:1016F000012A01D1022010BD01230B7024224A606F
-:10170000026813681468640864001460002242666A
-:1017100023F0005300680360202048600020087018
-:1017200010BD70B500F01EF801D1022070BD00F0B0
-:101730001FF822F0604209E070B500F013F801D103
-:10174000022070BD00F014F822F060621143816045
-:10175000204600F01AF8206806602020686000200B
-:10176000287070BD044604F17C0528780128704774
-:1017700001222A70242068602068066802685208E6
-:1017800052000260206882687047FFB50FF2540271
-:101790000FF25806D2E9003402A9C1E90034D6E9B3
-:1017A0000071CDE90071416E11B90121012213E0F0
-:1017B00001688A688968520E02F00702490F02AC7C
-:1017C000655CA45C1DF801101DF80220ED00E4002A
-:1017D00095FBF1F194FBF2F2683041800280FFBD8D
-:1017E00000000000010101030701000008040204D9
-:1017F000080101017047000030B912480360124827
-:10180000124B0360FEF724BD704730B910480360E7
-:101810000D480E4B0360FEF7D1BC704700680B49C2
-:10182000884204D107490868002818BF004770475C
-:1018300000680649884204D105490868002818BF95
-:1018400000477047D4040020840200200038014083
-:10185000D8040020704770474FF0B040006800F097
-:10186000F000B02888BFB02070472DE9F041040097
-:1018700066D0207881064FF0B04537D5A868E96872
-:1018800010F00C0001F0030104D00C2808BF01295E
-:1018900040F081802868800702D5E06900284FD099
-:1018A000FFF7DAFF616A884207D2084600F0B9FB09
-:1018B000002819D100F056FA10E0286820F0F00056
-:1018C000014329606968206A21F47F4141EA0021CF
-:1018D0006960606A00F0A5FB002805D101F03CF8C2
-:1018E000002000F083FE002840F086812078C107A8
-:1018F00011D5A868E96800F00C00082801F0030180
-:1019000003D00C2808BF032967D12868800302D5BB
-:101910006068002814D0217888071AD5A868E9687B
-:1019200000F00C00042801F0030104D00C2808BFCB
-:10193000022940F087802868400503D5E068002828
-:1019400000F05A816968206921F0FE4141EA006196
-:1019500069602168DFF8646711F0180F00F0768184
-:101960006069002800F0A880C906706840F1958081
-:10197000800707D4706840F0010000F00CFA0746B9
-:101980007068800700F13A8100F0DEFCC01B03287C
-:10199000F6D30320DFE1E06978B1296841F0010165
-:1019A00000F0D2FA06462868800700F1368100F080
-:1019B000CBFC801B0328F6D3EBE7286840084000E7
-:1019C00000F0E3F90646286800F0C8F98ED000F070
-:1019D000BBFC801B0328F6D3DBE76068B0F5803FD3
-:1019E00006D0B0F5A02F296807D141F480212960E5
-:1019F000286840F48030286006E021F480312960B6
-:101A00002A6822F480222A60606860B100F09CFCA1
-:101A10000646286880033FF57EAF00F095FC801BEA
-:101A20006528F6D3B5E700F08FFC06462868400C21
-:101A300010F001003FF46FAF00F086FC801B6528BA
-:101A4000F4D3A6E7E06878B1296841F4807100F02A
-:101A50007BFA06462868400500F1E28000F074FC3D
-:101A6000801B0328F6D394E7286820F4807000F0E8
-:101A70008CF906462868800A10F001003FF469AF2F
-:101A800000F062FC801B0328F4D382E700F05CFCCA
-:101A9000C01B0328C0F0D6807BE740F0010000F0B7
-:101AA0007AF907467068800700F1E78000F04CFC87
-:101AB000C01B0328F6D36CE7706820F0040000F028
-:101AC0006AF907467068C00810F0010000F0E48071
-:101AD00000F03AFCC01B0428F4D35AE7052830680C
-:101AE00006D140F004003060316841F0010105E0AA
-:101AF000400840003060316821F004013160A06886
-:101B000041F2893768B100F01FFC804630688007D9
-:101B100000F1D78000F018FCA0EB0800B842F5D324
-:101B200037E700F011FC8046306800F017F900F04C
-:101B3000C88000F009FCA0EB0800B842F4D328E705
-:101B400000F002FCC01B0328C0F0C98021E7B06888
-:101B500040084000B06000F0F7FB0746B06800F0B6
-:101B6000FDF800F0C08000F0EFFBC01B0328F5D3A8
-:101B70000FE700F0E9FB801B0328C0F0C68008E7F0
-:101B800000F0E2FB001B0328C0F0E08001E7E968F9
-:101B9000DFF82C0589088900E960E9680140E960FF
-:101BA00000F0D2FB044600F0EBF823D000F0CCFBB1
-:101BB000001B0328F7D3ECE6E868226B00F0030172
-:101BC000914202BF00F07001626B914214D1A26B8E
-:101BD000C0F30621914202BF00F47811E26B9142FA
-:101BE0000AD1226C00F06061914202BF00F06040B7
-:101BF000616C884200F0AE800120ACE0706840F07B
-:101C0000040000F0C8F807467068000710D400F020
-:101C10009BFBC01B0428F7D3BBE600F0A3F865E6E6
-:101C20006868216920F0FE4040EA0160686090E643
-:101C30007068A16920F4706040EA0120706000F0D3
-:101C4000A7F8074600F089F87FF420AF2078410715
-:101C500037D5DFF870743868C10529D400F028FE44
-:101C600000F072FB80463868C10521D400F06CFB9F
-:101C7000A0EB08000328F6D38BE6706820F0040080
-:101C800070607068C00810F00100DFD000F05CFBED
-:101C9000C01B0428F5D37CE600F07AF8074600F074
-:101CA0005CF8D3D000F050FBC01B0328F7D370E6DC
-:101CB000A06801287FF412AF306840F00100306066
-:101CC0001DE7217848060ED5A06A00283FF43FAFF3
-:101CD000B16841F00101B16000F036FB0746B06821
-:101CE00080077FF52DAFE06AA0B3A96801F00C0171
-:101CF0000C293FF461AF0228286820F0807028602A
-:101D00007FF445AF00F020FB064600F039F87FF481
-:101D100030AFE968DFF8B003A26B0140206B0143EC
-:101D2000606B0143E06B41EA02210143206C0143F7
-:101D3000606C0143E960286840F080702860E968C1
-:101D400041F08051E96000F0FFFA04462868800104
-:101D50007FF516AF0020BDE8F0817068400810F0F4
-:101D6000010070472968606A21F0F0010143296091
-:101D70006868216A20F47F4040EA0120686070476B
-:101D80002868400E10F001007047286000F0DCBAAF
-:101D9000706840084000706000F0D6BA2DE9F84342
-:101DA0000400884644D0DFF8246300F0C8F847D226
-:101DB00000F0CDF8074600F0C2F841D000F0C4FAB8
-:101DC000C01B0228F7D90320B7E000F0BDFA401B82
-:101DD000022843D9F7E700F0B7FAA0EB0900022880
-:101DE0004CD9F0E700F0B0FAA0EB0900022854D972
-:101DF000E9E700F0A9FA401B02285DD9E3E700F00B
-:101E0000A3FA401B022867D9DDE700F09DFA401BCA
-:101E1000484577D3D7E7032802D13968890103E021
-:101E20000028396802D1890762D401E049055FD4EE
-:101E3000012082E000F088FAC01B022872D9C2E7B4
-:101E4000207881074FF0B0470BD5B968A06821F022
-:101E5000F0010143B96000F077FA0546B868C003A5
-:101E6000B3D52078DFF8505281060AD52968606919
-:101E700021F0F001014300F067F8814628688003F3
-:101E8000A9D5207841060BD52968A069090909015F
-:101E900041EA101100F058F881462868C003A1D526
-:101EA000207841070BD5B968E06821F4E06101436F
-:101EB000B96000F049FA0546B868800399D52078E2
-:101EC00001070CD5B868216920F4605040EAC100D0
-:101ED000B86000F039FA0546B86840038FD520781D
-:101EE000C10717D56068022895D1396889039FD545
-:101EF000B968890840EA8100B86041F2893900F088
-:101F000023FA0546B868616800F00C00B0EB810F59
-:101F10007FF47BAF306800F00700804505D200F009
-:101F200016F8074600F00BF884D100F015FD00F01C
-:101F3000B5FDBDE8F24300F059BBBDE8F28330685F
-:101F400000F0070040457047296000F0FDB9316896
-:101F5000C90848EAC101316000F0F6B938B54FF060
-:101F6000B0445C4DA16811F00C0106D1FFF774FC80
-:101F7000C0F3031055F8200032BD0429564A05D09D
-:101F80000829564804D12168C90222D5104632BD1D
-:101F9000E16801F00301022904D0032904D121687A
-:101FA000C90207D5104605E0FFF756FCC0F3031041
-:101FB00055F82000E168E268E368C1F30621484370
-:101FC000C2F30211491C5B0FB0FBF1F05B1CB0FBCC
-:101FD000F3F032BD80B5FFF7C1FF3D49FFE7404A4E
-:101FE0000968C1F3031152F82110B0FBF1F002BDF2
-:101FF00080B5FFF7EFFF00F010F8C1F3022106E013
-:1020000080B5FFF7E7FF00F008F8C1F3C22112F82E
-:10201000211001F01F01C84002BD2D49314A096855
-:10202000704770B52B49B1282EBFCC6AC0F303109E
-:1020300051F820402048056800F04CFD28492A4A04
-:1020400005F00F0551F82510B4FBF1F10024B1FBA8
-:10205000F2F1B0F5007F0FF2B002204609D10FF285
-:102060008C0353F820508D4214D2401C0328F8D919
-:1020700012E00FF2880353F820508D420AD2401C20
-:102080000328F8D308E000F05FF9801B03280BD386
-:10209000032070BD52F820400C4D2868C00844EA67
-:1020A000C000FFF772FE0646296801F00701A14251
-:1020B000E9D1002070BD00000801005890000058D0
-:1020C000FFFFFEEE000400588C80C1110040005854
-:1020D00008000058342A00080024F4000048E801F1
-:1020E000F42900081846000840420F0012000000C2
-:1020F0002400000036000000400000000600000040
-:102100000C000000100000000000000001000000B2
-:102110000200000004000000B3BBD9B1B2F5803F5B
-:102120007DD2022A1ED98C46B1FBF2F102FB11C30B
-:102130001B0443EA1043B3FBF2FC02FB1C3380B2E6
-:1021400040EA0343B3FBF2F002FB103240EA0C40DA
-:1021500000237047022A05D98446B0FBF2F002FB47
-:1021600010C270474AB105D100F0010249085FEA88
-:102170003000704700220023704700F0B3BC0B0012
-:102180000200002100207047904271EB030CF6D34F
-:10219000B3F5803F2FD2F0B5B3FA83F7B1FA81F4EB
-:1021A000A7F10F0E3D1B5340CEF1200602FA0EF2AE
-:1021B000F3415340B5F10F0746D80F3C2C44414042
-:1021C000C4F12006A040F1414140B1FBF3F603FB0E
-:1021D0001611A2FB0645001BA94102D2761E8018EB
-:1021E000594180EA010221FA0EF362FA0EF200214F
-:1021F0005A403046F0BD30B4B1FBF3FC03FB1C1178
-:10220000A2FB0C45001BA94103D2ACF1010C8018C4
-:10221000594130BC02460B46604600217047B2F17E
-:10222000807F65D3F0B5B2FA82F7B1FA81F4C7F1D5
-:102230000F063D1B22FA06F307F1110EF24120357D
-:102240005A40B5F10F07B8D94140C4F12006A0406B
-:10225000F1414140B1FBF3FC03FB1C11A2FB0C4517
-:10226000001BA94103D2BCF1010C801859410F2F6A
-:1022700012D30F3FC90341EA5041B1FBF3F603FB10
-:102280001611A2FB0645D4EBC030A94102D2761E3E
-:102290008018594146EACC3C07B34140C7F12006BB
-:1022A000B840F1414140B1FBF3F603FB1611A2FB2C
-:1022B0000645001BA94102D2761E8018594180EACA
-:1022C000010221FA0EF3C7F1200462FA0EF20CFAB1
-:1022D00007F05A402CFA04F13043F0BD80EA0102C5
-:1022E00021FA0EF3002162FA0EF260465A40F0BD68
-:1022F0008C46B1FBF2F102FB11C31B0243EA1063EF
-:10230000B3FBF2FC02FB1C331B024CEA002043EA45
-:102310001063B3FBF2FC02FB1C331B024CEA0020EF
-:1023200043EA1063B3FBF2FC02FB1C331B024CEAD2
-:10233000002043EA1063B3FBF2FC02FB1C324CEAC0
-:10234000002000237047000001480068704700BF6C
-:102350002C000020002200F0C7BB0000964900E0DE
-:10236000964981B00A6802430A60096808400090F3
-:10237000009801B0704710B500F07CFB904C60688D
-:1023800040010ED56068C0000BD400F091FA00F057
-:102390008FFA206840F480302060216821F4803179
-:1023A000216000F0E8F8002000F0B8FB40B180792F
-:1023B0008449E160E16821F47C5141EA0021E16057
-:1023C00000F044F800F0B9F87F48804C0168002222
-:1023D0000260026902F0500202610120FFF7C0FFB3
-:1023E0000220FFF7BDFF0420FFF7B8FF0220FFF730
-:1023F000B5FF0120FFF7B2FF00220F210E2000F0F1
-:1024000015F90E2000F02FF900220F213A2000F0DC
-:102410000DF93A2000F027F900216D4841600F21A5
-:102420008160046047F6FF71C16000210161816134
-:10243000C16100F085FBA068C008C000A06000F08A
-:102440002EFC4FF0FF3000F0D5FCFAE780B5AEB0BF
-:102450001CA84821FFF77EFF01A81C21FFF77AFF87
-:1024600008A85021FFF776FF5A48016821F4C0619F
-:1024700041F4007101600B21006800F4C06000901D
-:102480004FF4803200981C914FF480701F904021CF
-:1024900020910520219000211D9227911CA8FFF773
-:1024A000E4F96F2001900221002002910390049032
-:1024B000059006900790012101A8FFF76FFC43F6F5
-:1024C0000300089000210E910F914FF400404FF44B
-:1024D000007119901891002002211B901A9108A8F0
-:1024E00000F064FD2FB000BD10B53B4C3B4800F040
-:1024F00017F84FF40040E061002020626062A062A3
-:102500002046FDF71BFE00212046FFF70AF90021B7
-:102510002046FFF711F92046BDE81040FFF7E4B868
-:1025200020604FF4E13060600020A060E060206136
-:102530000C2060610020A06170472948816841F04B
-:102540000101816081688907FCD5C16821F440419F
-:1025500041F48041C160C16849084900C160016916
-:1025600041F00101016101698907FCD5016821F091
-:102570004061016070471B4881B0016841F48011DF
-:1025800001603F21006800F4801000900098164818
-:1025900041604161016841F47C110160026942F4CB
-:1025A0007C120261016841F03F010160026942F062
-:1025B0003F02026101B07047480000584C000058CB
-:1025C00090000058FECAFECA80080058002800404B
-:1025D000500400200004005884020020003801400C
-:1025E0008800005850000058040C00580020704724
-:1025F000704770470901020081B002D4324881540B
-:1026000005E0324802F00F02104400F8041C01B04B
-:1026100070472F4A13684FF6FF0100020B4000F489
-:10262000E06018432B4908431060704738B5284BC9
-:102630001C68C4F30223C3F10704052C28BF04243B
-:102640001D1D072D34BF0023DB1E012505FA04F4F0
-:10265000641E2140994005FA03F35B1E1A401143A2
-:10266000BDE83440C6E7010007D4012200F01F0195
-:10267000194B8A40400943F82020704701000BD4D1
-:10268000012200F01F01154B8A40400943F8202029
-:10269000BFF34F8FBFF36F8F7047010007D4012244
-:1026A00000F01F010E4B8A40400943F8202070477C
-:1026B000010007D4012200F01F010A4B8A404009A3
-:1026C00043F820207047000000E400E018ED00E02F
-:1026D0000CED00E00000FA0500E100E080E100E020
-:1026E00000E200E080E200E02DE9F84F4FF0000C3E
-:1026F000674A684BDFF8A0814FF00F0982460F460A
-:1027000033E0664DAA4514BF072504258D402543B7
-:1027100048F82E50C1431C6801EA040E7C68E503AA
-:1027200048BF40EA0E0EC3F800E05C6801EA040E00
-:102730007C68A50348BF40EA0E0EC3F804E01468A5
-:1027400001EA040E7C68E50248BF40EA0E0EC2F8BA
-:1027500000E0546801EA040E79688C0248BF40EA40
-:102760000E0EC2F804E00CF1010C396831FA0CF0DD
-:1027700000F07C80012000FA0CFE1EEA0100F2D07D
-:102780007C68022C18BF122C4FEA8C0110D14FEA42
-:10279000DC040AEB840401F01C05266A09FA05FB37
-:1027A00026EA0B06D7F810B00BFA05F5354325627B
-:1027B0004FEA4C040325DAF8006097F804B0A5400E
-:1027C000ED430BF0030B2E400BFA04FB4BEA06061D
-:1027D000CAF800607E68012E18BF022E03D0112EA9
-:1027E00018BF122E17D1DAF80860D7F80CB02E40B7
-:1027F0000BFA04FB4BEA0606CAF80860DAF8046034
-:1028000026EA0E0E7E68C6F3001606FA0CF646EAB5
-:102810000E06CAF80460DAF80C603540BE6806FAA5
-:1028200004F42C43CAF80C407C68E4009BD54FEAC2
-:102830009C0E58F82E5001F00C0109FA01F425EA1B
-:102840000404BAF1904F08BF00250ED0144DAA45DC
-:1028500008BF012509D0134DAA4508BF022504D0A1
-:10286000114DAA457FF44DAF03254FE7BDE8F18F29
-:1028700081B0002A14BF8161816201B070470B4AA8
-:10288000136803421CBF106000F0AEBA704700002E
-:102890000008005880080058080001400010004857
-:1028A0000004004800080048000C00480C080058CC
-:1028B0000248016841F480710160704700040058CB
-:1028C0008A60FF2102685162012180F821100021F5
-:1028D00080F820100020704790F82010012901D1C5
-:1028E00002207047012280F82020022180F8211068
-:1028F000CA210268516253210368596201688A68DB
-:1029000042F02002FFF7DCBF3249002008604FF49C
-:10291000E0223148016841F4700101604FF0B0419C
-:10292000086840F0010008608A602C480A6802408C
-:102930002B480A60036823F00503036042685208CD
-:102940005200426000222748C8600861086820F4ED
-:10295000802008608A6170474FF0B0410FF2D400C8
-:102960000A68C2F3031250F822008A6802F00C02CF
-:10297000042A04D0082A04D00C2A04D01CE01A48E7
-:102980001AE01A4818E0CA68CB68C3F3021302F0D1
-:1029900003025B1C022A08BF134802D0032A08BFA7
-:1029A0001248B0FBF3F2C868CB68C0F306205B0F97
-:1029B00042435B1CB2FBF3F00D4A0FF23803106088
-:1029C00088681168C0F3031053F82000B1FBF0F0E1
-:1029D0001060704708ED00E088ED00E0FBFEF6FABD
-:1029E00094000058001004220024F4000048E8017C
-:1029F000500000200100000003000000050000005E
-:102A00000100000001000000060000000A000000B4
-:102A10002000000002000000040000000800000088
-:102A200010000000400000008000000000010000D5
-:102A300000020000A0860100400D0300801A06007D
-:102A400000350C0040420F0080841E0000093D004C
-:102A500000127A000024F40000366E010048E801FC
-:102A6000006CDC020000000000000000000000001C
-:102A700000000000144810B5016841F48071016045
-:102A80000320FFF7C6FD0020FFF7B0FD002400285B
-:102A900014BF0124FEF716FC204610BD0B48406809
-:102AA00070470B480BE00A48016821F00201016001
-:102AB00070470748016821F0040101607047016810
-:102AC0004908490001607047004000582C00002070
-:102AD000042004E0DFF80800006800F4C0607047DC
-:102AE000000400587047000000B500BF1300964670
-:102AF0009446103928BFA0E80C50FAD85FEA417C10
-:102B000028BF0CC048BF40F8042BC90728BF20F8D5
-:102B1000022B48BF00F8012B00BD0000014606480B
-:102B2000064AC3798B4218BF904218BF0838F8D1C3
-:102B30008B4218BF00207047F873FF1F0070FF1F03
-:102B400038B5040044D094F8210028B9002184F855
-:102B500020102046FEF756FC00F049F8FF2510B182
-:102B600000F03FF834E02168DFF8B0008A680240E6
-:102B70008A6021688A68636820690343A069034307
-:102B80001A438A602168E068086120680169A268C8
-:102B900041EA024101612068C16821F08001C16001
-:102BA0002068C16C89088900C1642168CA6CE36926
-:102BB000606903431A43CA6420688168880609D49F
-:102BC00000F020F830B120684562042100F01FF8C1
-:102BD000012032BD20684562012184F821100020C7
-:102BE00032BD20684562042184F82110704702201C
-:102BF00084F82100CA20216848625320226850626C
-:102C0000204626E020460BE02068C0F8248084F8A7
-:102C10002110002084F8200070470000BFFF8FFFC4
-:102C200070B5044640F2E9362068C16821F0A00181
-:102C3000C160FFF789FB05462068C168880606D495
-:102C4000FFF782FB401BB042F6D3032070BD00208B
-:102C500070BD70B504462068C1684A0612D44FF0B2
-:102C6000FF32C26040F2E936FFF76EFB054620688E
-:102C7000C168480606D4FFF767FB401BB042F6D395
-:102C8000032070BD002070BD4D4981B00A68024329
-:102C90000A60096808400090009801B0704718B5B4
-:102CA000484C89B0206840F40040206000F0E2FA0F
-:102CB0004549002000F099FC68461421FFF74AFBC3
-:102CC0000020029003214FF4604000900191012008
-:102CD000FFF7DAFF69464FF09040FFF705FD606CA3
-:102CE000400840006064182100910220FFF7CCFFEB
-:102CF00069463648FFF7F8FC606C20F0020060641B
-:102D0000FFF7CFFEFFF7CFFEFFF7D3FE0121012033
-:102D100000F0C2FA002000F08CFD012000F089FDD7
-:102D2000022000F086FD012000F0ABFD0121002013
-:102D300000F0BBFD00F010FE2548264C00F001FF1E
-:102D40000FF259020021202000F0B7F804F23C50A5
-:102D5000029021490FF22D0001900091684600F089
-:102D600053FE04F25470039004F5C96140F23C50E4
-:102D700006900491059403A800F07BFE00F0EAFDA4
-:102D80000AB010BD80B50146114800F0E6FEBDE86E
-:102D900004400021202000F09DB8000080B500F024
-:102DA000A0FE0021012000F077FA6946084800F0F3
-:102DB000EAFE009800F076FE00F0F6FE01BD00008D
-:102DC0004C0000580800005850040020000400483F
-:102DD000A004002020000320733C000800F070BA1B
-:102DE0004FF0FF3000F006B8102808BF00F050BFC9
-:102DF000704700002DE9FC474E4CDFF83C91A56977
-:102E00002840A0614FF0010A4FF0FF3830E0491C24
-:102E100054F831000642FAD004EBC1071840796833
-:102E20001040014208BFC7F804807E68304000F0BF
-:102E300085F860620AFA00F086437E60EFF3108145
-:102E400072B6626A20690AFA02F2D2431040206127
-:102E5000022004EBC00353F8086C1640401E43F8F0
-:102E6000086CF6D181F31088606A59F82010884701
-:102E700063692069A2691840104207D0E069216A9D
-:102E8000084203D1002103EA0206C1E701F066F817
-:102E9000EFF3108972B6216960690140A0690142AF
-:102EA00001BFE169206A0142FFF798FF89F31088AA
-:102EB00001F055F8A561BDE8F38738B51446EFF386
-:102EC000108572B600F03AF81B4941F8204085F3AE
-:102ED000108831BD10B5EFF3108272B6154B1C6926
-:102EE00004431C6153F83140204343F8310082F31E
-:102EF000108810BD506181F310887047EFF3108186
-:102F000072B60C4AD3691843D061F4E770B5094C26
-:102F1000656A266A2062012101FA05F502E0284669
-:102F2000FFF75EFF216AE0690842F8D08843266215
-:102F3000E06170BD04000020100300200246002064
-:102F4000110C090404BF1020120412F07F4F04BFBB
-:102F5000083012020FF2180112F0704F04BF001D6A
-:102F60001201120FC0F11F00895C401A7047000067
-:102F70000403020201010101000000000000000042
-:102F8000DFF8EC120A68030903F47F2300019A4377
-:102F900000F47F2000F068B9DFF8D4221368010C38
-:102FA00023EA014343EA0043136070472DE9F843E5
-:102FB000054600262878DFF8B8724106B0464FF083
-:102FC000B0442DD5286B70B1B0F5800F06D0B0F5A8
-:102FD000000F18BFB0F5400F17D01FE0E06840F4B5
-:102FE0008030E060C5E0206820F080602060FFF75E
-:102FF000ABF981462068000140F1A880FFF7A4F9F1
-:10300000A0EB09000228F5D90326AFE0FFF79CF9F1
-:10301000A0EB0900022840F2A180F5E70126B046A6
-:103020002868010531D5B86800F44078286C8045DF
-:103030002AD0FFF73DFCB8F1000FB96805D1286C24
-:1030400021F440710143B9601EE0B86840F480305B
-:10305000B86021F44071B86820F48030B860286C02
-:103060000143B960B868C0070ED5FFF76DF9804617
-:1030700041F28939B868800706D4FFF765F9A0EBFB
-:1030800008004845F6D30326B0462878C10705D581
-:103090003968A869890840EA810139602878810780
-:1030A00005D53968E86921F4406101433960287821
-:1030B000C10644BFA86AFFF76FFF2878810644BFA6
-:1030C000E86AFFF769FF2878410744BF286AFFF7DD
-:1030D00057FF2878010744BF686AFFF751FF286847
-:1030E000C1055CD53968686B21F0406101433960E6
-:1030F000686BB0F1006F03D1E16841F08071E1606D
-:10310000686BB0F1806F4AD100F0A0F806462068E5
-:10311000000135D5FFF718F9801B0228F7D94FF0C9
-:1031200003083CE0FFF710F9801B022830D9F6E7CE
-:10313000FFF70AF9801B022852D94FF0030861E01B
-:10314000FFF702F9801B022855D9F6E700F075F861
-:10315000A86821F4781100F07FF88146206800010A
-:103160007FF554AF216968690143216130007FF424
-:1031700056AF3968286B21F44001014339604FE7AD
-:1031800000F05BF8E86821F0606100F065F8064641
-:1031900020680001C6D5216968690143216128685A
-:1031A000810505D53968A86B21F04041014339609C
-:1031B0002868410526D53968E86B21F04051014364
-:1031C0003960E86BB0F1005F03D1E16841F4803110
-:1031D000E160E86BB0F1805F14D100F037F806468B
-:1031E00020680001A4D400F028F8286921F060418B
-:1031F00000F032F8064620680001A1D5216968690F
-:10320000014321612868C10405D5F968686C21F47F
-:1032100040410143F960286881040BD5616AE86C7C
-:1032200021F0300101436162616AA86C890840EABB
-:10323000810161624046BDE8F2832069696820F43B
-:10324000FE4040EA0120206121697047216821F099
-:1032500080612160FFF778B801432161206840F068
-:1032600080602060FFF770B810430860704700006E
-:10327000880000582048002101604160704710B567
-:1032800000F019F81C6819B1012904D1204301E0AC
-:1032900024EA000018600BE010B500F00CF85C6840
-:1032A00019B1012904D1204301E024EA000058604B
-:1032B00082F3108810BDEFF3108272B60E4B704788
-:1032C00038B5EFF3108472B60B490C4D086820B185
-:1032D00029688847686880470AE0486820B1A9687B
-:1032E0008847E868804703E0286980476869804725
-:1032F00084F3108831BD0000A80400208046000837
-:10330000DFF8F0140A6892B200E00246086880B262
-:103310008242FAD170472DE9FC4104461825DFF8B6
-:10332000D884DFF8D864684308EB000730780628B3
-:1033300008D131787170347078754FF0FF3070605B
-:10334000002039E000F077F8B9680918B96008F191
-:103350000803B96832786A439A589142327813D395
-:1033600008F1150315FB02FC13F80C30062B25D0D1
-:1033700008F108066B43F358994222BF08F1150380
-:103380006A439A5CEED219E01146337869439A4257
-:103390000BD008F1140308F1150C5B5C15FB03F569
-:1033A0000CF805407A753B7500E07A7508F1140257
-:1033B0005454317871703470BDE8F6811146694318
-:1033C00008F115035B5C062B04D008F1140615FB0D
-:1033D00003F574557B753A7508F115025454EBE703
-:1033E000F8B5DFF81834DFF810541E7818240246B8
-:1033F0006243B0422A4404D118785870507D187046
-:103400000FE0167D507D92F815C005F11507664353
-:10341000062807F806C004D0167D143514FB00F406
-:103420002E55012010731878062802BF00294FF08E
-:10343000FF315960F1BD10B5DFF8C043606810F18D
-:10344000010F0FD0FFF75CFF6168DFF8B423814202
-:1034500061683CBF5388C918081A517848431178ED
-:10346000C84000E0002080B210BD2DE9F84FDFF821
-:103470009053DFF890B3D5F80880D8F80000DBF857
-:1034800000104A0500F06AF9DFF87063DFF868A3FE
-:1034900021F4806181604FF0180934780AF1080046
-:1034A00019FB04F14758FFF7C6FF874217D20027E0
-:1034B0000121B170062C3DD019FB04F40AF108017A
-:1034C0000AF108020959814223BF0AF1080109598A
-:1034D000091A002111510AEB04014C7DEAE7A98881
-:1034E0004118B94202D2AF880021E2E73F1ADFE774
-:1034F000022802DA2878012800D07F1ED8F80000C0
-:10350000C1684A07FAD500F02FF9DBF80C00000C6F
-:10351000BFB247EA0047CBF80C70FFF7F1FE7060CE
-:10352000A8680068816841F480618160AFF3008021
-:10353000BDE8F18FB8B20028DAD1FFF7E1FE706084
-:103540000320BDE8F24FFFF7A8B82DE9F843EFF3E9
-:10355000108872B6AA4DA84BA8680168CA224A62B0
-:1035600053204862A54A886820F48060886018204B
-:103570001678374647431F44387B022826D13C68DB
-:10358000D7F810909078F0B17A7B012A0AD1012106
-:103590003046FFF725FF88F310887968304600F041
-:1035A000F0F804E088F31088304600F09BF8A86833
-:1035B0000068CA2141622246532141624846314691
-:1035C00000F02AF90BE0FFF750FF06E0C868420759
-:1035D000FCD500F07EF88C49086088F31088FF2144
-:1035E000A86802685162BDE8F183F8B5844CA16017
-:1035F000CA2209684A6253224A62824A136843F027
-:1036000020031360136803F00703C3F1040323705E
-:1036100095682D0C05F07F056D1C6570EDB2926804
-:10362000C2F30E02521C628092B2521E6A43A2F58D
-:10363000A072DA404FF6FF739A422CBFA380A2809B
-:10364000724A136843F400231360714B1D6845F4FC
-:1036500000251D6048BB6948674E0123837018250B
-:103660004FF0FF33436000235FFA83FC06F10C0741
-:1036700015FB0CFC4FF0000E07F80CE05B1CDFB2F2
-:10368000062FF1DB06230370886820F480608860D1
-:1036900000F01FF8D0600320FFF70AF8A16808685F
-:1036A000826842F48042826005E0C868410544BFF8
-:1036B0000320FEF7F2FFA1680A68FF205062002293
-:1036C00003210320FEF7B2FFBDE8F2400320FEF71E
-:1036D000CABFC86800F0800060F49060C8604FF412
-:1036E00000207047F8B50746EFF3108472B6032048
-:1036F000FEF7C4FF424DAE683068CA2141623A46C7
-:1037000053214162182043494243895C02291BD15D
-:1037100000213846FFF764FE3848017806290ED1AB
-:10372000306838490A68530500F018F821F48061C0
-:103730008160C1684A07FCD500F016F804E04078C3
-:10374000884218BFFFF791FEA9680A68FF205062FF
-:103750000320FEF788FF84F31088F1BD02D5C1680D
-:103760004A07FCD481687047C16801F0800161F4A8
-:103770009061C1604FF40020234908600320FEF7E8
-:1037800097BF2DE9F04180460F46424618201A495E
-:1037900042438C18207B022804BF4046FFF7A2FF5B
-:1037A000EFF3108572B60320FEF768FF144EB06881
-:1037B0000068CA2141625321416202202073A76040
-:1037C00067604046FFF7A7FD0C490A7849789142A7
-:1037D00002D0FFF74AFE02E0A168081AA060FF20AD
-:1037E000B1680A6850620320FEF73DFF85F3108838
-:1037F000BDE8F0812828004068010020C8040020AE
-:1038000094040020082800400C08005800080058C4
-:10381000800800587401002010470000444981B01E
-:103820000A6802430A60096808400090009801B0E5
-:10383000704778B585B0044668461421FEF78AFDC6
-:103840000220FFF7EBFF00F010F800950120019037
-:103850000021022003900291694656F82400FEF7E9
-:1038600043FF00F008F806B070BD0FF2D400314EEF
-:1038700030F81450704756F8240000222946FEF70D
-:10388000F7BF0FF2BC012B4B31F8101053F820009A
-:103890000122FEF7EDBF0FF2A801264B31F8101000
-:1038A00053F820000022FEF7E3BFF0B585B00546CF
-:1038B0000C4668461421FEF74DFD0DB9042004E0C6
-:1038C000012D18BF022D02D10820FFF7A7FF20000D
-:1038D000194E0FF274070DD137F815000090002132
-:1038E0000191012002900221039100F01BF80120B8
-:1038F000FEF77EFE012C13D137F815000090012150
-:103900000E480190029100F00DF80FF24400445D62
-:1039100000220F2160B2FEF789FE60B2FEF7A3FE1F
-:1039200005B0F0BD694656F82500FEF7DDBE000083
-:103930004C000058380000204400002000002110F6
-:103940002000010002000000100001000200000041
-:103950000A06070000F078BB70487149016001F168
-:103960002002426001F13002826001F13C02C2603B
-:1039700001F14402026101F16002426101F164025D
-:1039800082617031C16100F067BB38B50446654D96
-:1039900005F1100000F0D5F860494868A1680160A1
-:1039A000E168C160456005F11001816000F070FBC5
-:1039B0005D4837E080B559494A681368012018729C
-:1039C00000F06CFB002002BD38B5574C554D07E0A8
-:1039D000694605F1100000F0D6F800982168884784
-:1039E00005F1100000F0B0F80028F1D031BD80B52D
-:1039F0004A494A68D1680220087200F054FB00204E
-:103A000002BD49484168084738B50446474D284635
-:103A100000F097F84148C068A1680160456000F077
-:103A20004BFB43482168016061684160002032BD62
-:103A300080B53A49CA6813681020187200F042FB3A
-:103A4000002002BD3549CA68394910680B6818471B
-:103A500038B5374C354D06E06946284600F093F8F6
-:103A6000009861688847284600F06EF80028F3D077
-:103A700031BD38B504462F4D284600F062F82E4877
-:103A800000F05FF825480069A1688160E168C160C5
-:103A90000561216801606168416021694161616976
-:103AA000816131BD80B50146234800F056F8BDE87C
-:103AB00002400FF2090000F015BB000038B5174CAA
-:103AC0001D4D08E06946284600F05DF80099206920
-:103AD000006900F042F8284600F036F80028F1D0DE
-:103AE00031BD10B5154C204600F02BF80B4841694C
-:103AF0000C60BDE8104000F009BB1CB50F4C06E09F
-:103B00006946204600F03FF8009800F019F820467A
-:103B100000F01AF80028F3D013BD000000000320C5
-:103B2000B40A0320940A0320B8040020AC0A03203E
-:103B3000C00400202C0B0320B0040020340B032011
-:103B40007047006040607047EFF3108172B6026802
-:103B500082420CBF0120002012E0EFF3108272B607
-:103B6000086043684B6041604868016019E0EFF30A
-:103B7000108172B6436802681A6042680068426049
-:103B800081F31088704710B5EFF3108472B60268A5
-:103B90000A600068FFE7FFF7EAFF84F3108810BDB2
-:103BA000086082F31088704710B590B004A80FF237
-:103BB0007C31DFF85043302200F0CAFA2068DFF889
-:103BC00048434FF6FC7101EA8001DFF840034118D9
-:103BD000DFF83C030290E16000F5867003900FF27D
-:103BE000B9210FF2CD20019000916846FFF7CDFE7C
-:103BF00001210220FFF750FB01210220FFF73FFBCC
-:103C00000020E070A07004A800F0ECFA0FF201129E
-:103C100000210820FFF751F9BE4A00210120FFF7DB
-:103C20004CF90FF2990200211020FFF746F9BA4A29
-:103C300000210220FFF741F9B84A00210420FFF7D4
-:103C40003CF9012060700020A06004F11800FFF72B
-:103C500078FFFEF749FC04F110006060002020703E
-:103C600001220FF2011304F11001FDF7C5FD10B0A0
-:103C700010BD80B5A44A917831B100209070012028
-:103C8000BDE80240FFF73AB9014602F1180007E12A
-:103C900010B59D4CE07830B90120FFF7FCFD012103
-:103CA000E170002105E00120FFF7EBFD0020E0704E
-:103CB0000121BDE810400220FFF7E1BA38B5EFF36B
-:103CC0001084914D6878012821D10021697005F197
-:103CD000180005F10801FFF756FFE878A0B9A868B9
-:103CE0000FF28113017A022972B607BFB0F80B20D8
-:103CF000521D827AD21C00F1080192B20020FDF719
-:103D000084FD84F3108831BDBDE83140AAE031BDA7
-:103D100010B5834CB4F809004FF66052811A04D0F4
-:103D2000491E06D0491E08D00BE0204600F062FA7A
-:103D300011E0204600F099FA0DE0204600F0BBFAB1
-:103D400009E0A0810120A073E072042020720E20FF
-:103D500060720420A07221467248FFF7FEFEBDE8A3
-:103D60001040A1E0F8B5684D69682A780024002069
-:103D70001AB1022A64D013D358E00978012905D07A
-:103D8000022907D0102918BF202907D10120287047
-:103D900003244BE001202870042447E0012445E07F
-:103DA0000E78E868022E11D0102E02D0202E03D0FB
-:103DB0001CE0CC78C0681BE0CC78594805F11001B4
-:103DC00000F108070A6840F8082F18E04068CA7830
-:103DD0000979C36802EB012403F10807052205F104
-:103DE0001001384600F0A4F9052009E0CC784068BD
-:103DF000016805F1100001F108070168396004202D
-:103E00006F60A1B211B1022129700FE0022E25D0FE
-:103E1000102E1DD0202E1ED000210120FFF75AF8B1
-:103E2000002005F11001287001246960A2B201B0E0
-:103E300069683D4BBDE8F04001440020FDF7DCBC63
-:103E4000087802280AD0102802D0202803D0E3E7FF
-:103E500000210220E2E700210820DFE70021042002
-:103E6000DCE700001CB5284C01206070E0680169A7
-:103E7000A0688A68904205D3C9681144884238BF57
-:103E8000FFF710FE04F11800FFF75EFE10B9BDE861
-:103E90001C4009E013BD000080B50146DFF8840036
-:103EA000FFF75BFEBDE8044000211020FFF712B8C9
-:103EB000704770B51446134A134E12681D4601230D
-:103EC000B3704FF6FC7303EA8203104AD3180A4614
-:103ED000DE683668A6F80900F17206F10C0021468A
-:103EE00000F026F900210020FFF7A2FD0120FFF7D6
-:103EF0000DF8314605F10800B278BDE87040D21CDB
-:103F000000F016B93C400058740400200000032063
-:103F100080080320B5390008313A0008EF3900085D
-:103F20005C0000208C040020653D000800000000BB
-:103F30000000000000000000000000000000000081
-:103F400044000800400508013A799C00F401000192
-:103F5000FFFFFFFF480101000000000070477047AD
-:103F6000C0680840884201D1012070470020704796
-:103F7000C0690840884201D1012070470020704785
-:103F800010B5654C02212046FFF7F2FF38B160689A
-:103F9000C043810703D5FFF75BFD022018E0012134
-:103FA0002046FFF7E5FF38B16068C043C10703D57D
-:103FB000FFF70AFD01200BE008212046FFF7D8FF9C
-:103FC00038B16068C043010703D5FFF796FD0820AC
-:103FD000A06010BD10B5504C00F033F818B96068FF
-:103FE000C043810306D400F02CF830B96068C043A8
-:103FF000810302D5BDE810406DE0082100F022F8F1
-:1040000070B96068C04301030AD56068434940F451
-:1040100000206060086880474FF40020A06010BD59
-:10402000202100F00FF858B96068C043810207D51D
-:10403000606840F400106060BDE81040FFF7E1BC2C
-:1040400010BD022120468BE740BF20BF34480168E5
-:1040500041F400410160704780B53248016841F485
-:1040600080110160006800F48010009000982A48D8
-:10407000016841F001010160026842F4803202608F
-:104080002C20FEF7F0FABDE802402D20FEF7EBBA37
-:1040900025480168490849000160704723494FF4E9
-:1040A00080300860704720484FF40011416001687B
-:1040B00021F40011016070471B48016821F00201E2
-:1040C0000160704718484FF400314160016821F4E5
-:1040D0000031016070471448016841F4003101600B
-:1040E000FFF7B0BC38B504460B4D08212846FFF752
-:1040F00037FF30B109480460686820F40020686028
-:1041000031BDA0474FF40021A96031BD06480168C8
-:1041100021F0080101607047000C0058D004002015
-:104120000C04005850000058040C0058080C0058AB
-:1041300062B38B0708D0521E11F8013B00F8013B17
-:1041400000F024808B07F6D1830740F0208000BF69
-:10415000103A07D330B4B1E83810103AA0E838105C
-:10416000F9D230BC530724BFB1E80810A0E808100A
-:1041700044BF51F8043B40F8043BD20724BF31F858
-:10418000022B20F8022B44BF0B7803707047121FDC
-:1041900017D35B0009D151F8043B20F8023B1B0CFC
-:1041A000121F20F8023BF6D20BE051F8043B00F856
-:1041B000013B1B0A20F8023B1B0C121F00F8013BBD
-:1041C000F3D238BF121D521E24BF11F8013B00F874
-:1041D000013BF8D870470000FFF76BFE9DF80E001A
-:1041E00005B000BDF8B500F10C026B4621214FF679
-:1041F0006640F1E770B5EFF31081027B012A02D02F
-:10420000022A07D00DE000F028F8137800F01FF81C
-:1042100014700CE000F021F8138800F018F81480F6
-:1042200005E000F01AF8136800F011F8146081F34B
-:104230001088212101720E214172042181724FF6F2
-:1042400060518181002181730121C17270BD2646B8
-:1042500023EA040435402C43704772B6D0F811208D
-:10426000D0F80D40D0F81550704781B0017B01297E
-:1042700002D0022904D008E0D0F80D10097807E038
-:10428000D0F80D100A88009203E0D0F80D100968EC
-:1042900000910E21417221220821817202724FF693
-:1042A000615181810121C17200218173009A40F81E
-:1042B0000F2F01B0704738B50446212020720E2020
-:1042C00060724220A0724FF66250A0810120E0721D
-:1042D0000020A0731D4D1E480168090CA4F80F10A2
-:1042E0000068C0F30B00A4F811001A4801781A48BE
-:1042F00001F01F01E174416821754168090AC4F8A1
-:1043000015100268C4F819200169C4F81D1041692C
-:10431000C4F8211004F129018069C4F82500286837
-:1043200002680A600C222B68191D04F12D00FFF7AA
-:10433000FFFE286800F11001102204F13900FFF798
-:10434000F7FE06480168C4F8491031BD000003209B
-:10435000002004E00075FF1F8075FF1F90470008D4
-:1043600000EB81003B4AD0F88010914201D001203F
-:1043700070470020704742F4806240F82120704767
-:1043800035481F2181610168C908C90041F0030156
-:1043900001603248016841F0040157E0704710B5F0
-:1043A0002F4C00F048F80028FBD1042100F044F81D
-:1043B00028B92C480068010403D500F03FF800F04C
-:1043C00054F8002203212046FFF7D5FF2248016858
-:1043D000C908C90041F0020101602048016841F0AC
-:1043E0000401016030BF10BD10B51D4C00F026F86F
-:1043F00000F021F80028FBD14FF0B040816801F0B7
-:104400000C01042911D1016841F480310160016877
-:104410008903FCD581688908890041F00201816027
-:10442000816801F00C010829FAD12046BDE810404E
-:10443000002203219FE70321204691E70022042167
-:10444000204698E70548016821F00401016030BF6B
-:1044500070470000000400800004005810ED00E0E8
-:10446000001400588804005870474FF0B0400168AD
-:1044700041F48071016001684905FCD581688908B3
-:10448000890041F001018160816801F00C0104297B
-:10449000FAD170477047FEE7FEE7FEE7FEE7704798
-:1044A0007047704700F01EB80548FDF77CB8054816
-:1044B000FBF745BF0448FBF742BF0448FDF773B85C
-:1044C0009003002084020020F8010020F003002067
-:1044D0001020FEF7D4B9FFF738B8FFF77BBDFFF720
-:1044E0004FBD000002490A68886882180A60704758
-:1044F0002C00002019E050F8042BD30744BFA9F189
-:1045000001039A18091F0023042942F8043BF9D239
-:104510005FEA817C134604D54FF0000CA2F800C07E
-:104520009B1CC90744BF0021197050F8041B0029C7
-:10453000E1D1704730B5016884684218416802EBE8
-:104540005103C9070BD54C4409E012F9011B12F8BD
-:10455000015B002904F8015B05D5491CF9D19A4299
-:10456000F3D10C3030BD491EF1D5F8E710B500F09D
-:1045700013F802000023DB4300241068984203D0A4
-:1045800011000220ABBE14605068984203D0111D88
-:104590000220ABBE546010BD01487047000000000F
-:1045A0005400002010B5074979441831064C7C446A
-:1045B000163404E00A68081D114488470146A142E8
-:1045C000F8D110BD2C000000500000004EF68851BC
-:1045D000CEF20001086840F470000860BFF34F8F0E
-:1045E000BFF36F8F4FF00070E1EE100A70470000CC
-:1045F00005FFFFFF800400005C000020940A00001B
-:1046000020000320000000002DFFFFFF88010000B4
-:10461000580000000400002000000000000000001E
-:104620000000000000000000010000000200000087
-:10463000030000000400000000F00DF8002801D085
-:10464000FFF7B0FFAFF300800020AFF30080FDF76D
-:1046500092FE00F002F80120704700F001B800005F
-:104660000746384600F002F8FBE7000080B5FFF788
-:104670007DFF024A11001820ABBEFBE726000200B6
-:1046800045440008694400089F430008E9430008C6
-:10469000814300089D4300080148804701480047C6
-:1046A00009290008A9460008AFF30080FFF78EFF34
-:1046B000FFF7C2FFFFF7FEBFFFF7FEBFFFF7FEBF2A
+:100280008168B1F5805F04D1016991B940F2FF1531
+:100290000FE019B9016961B17F2107E0B1F1805F19
+:1002A00006D1016909B97F2503E03F21A18001E062
+:1002B0000025A5800021D96022259D6001688D68F8
+:1002C00045F001058D60A168B1F1005F1CD1A189E5
+:1002D0008A4219D38268B2F5805F04BF01690029A0
+:1002E00007BFDFF828222261DFF8241221610022F3
+:1002F0001A7001680B6843F480730B6000688168B2
+:1003000041F08051816013E08168B1F5805F04BFE6
+:100310000169002907BFDFF8FC212261DFF8F8112D
+:10032000216100221A700068016841F49071016037
+:10033000002030BD022030BD206881684A06704729
+:10034000F8B5044640F60F002568E9692A68AB68ED
+:1003500008400DD1880602D5960602D4D80040F197
+:100360008980E16E00294FD02046BDE8F44008475F
+:100370006A48034204BF6A4E32427BD0CE0709D599
+:10038000D70507D501262E62D4F8885045F001051F
+:10039000C4F888508D070AD5DE0708D527680225DE
+:1003A0003D62D4F8885045F00405C4F888504D07E4
+:1003B0000AD5DE0708D5276804253D62D4F88850A1
+:1003C00045F00205C4F888500D070CD5960601D4F7
+:1003D000034208D0256808202862D4F8880040F03D
+:1003E0000800C4F8880008050BD5550109D5266812
+:1003F0004FF400603062D4F8880040F02000C4F868
+:100400008800D4F88800002870D0880607D59106A7
+:1004100001D4D80003D5E16E09B120468847D4F84D
+:10042000880021688A68510602D410F0280F1AD07B
+:10043000204600F0C2FDFFF77FFF0FD500F057F810
+:1004400060B1DFF8A8198163A06F01F092F800286D
+:100450004CD0A06F816BBDE8F44008472046BDE852
+:10046000F24001F05DB9204601F05AF90020C4F8CD
+:100470008800F1BDC80209D55E0207D54FF480108F
+:1004800028622046BDE8F24001F0F0B9080609D51F
+:10049000160601D4180205D5216F39B32046BDE8F0
+:1004A000F440084748060FD553060DD5286820F0BC
+:1004B000400028602021C4F88010002020672046DA
+:1004C000BDE8F24001F0F9B9080206D5530004D5A1
+:1004D0002046BDE8F24001F003BAC80148BF002A37
+:1004E00004D52046BDE8F24001F0FBB9F1BD8168BA
+:1004F00021F040018160A06F70470000C910000822
+:10050000891000085B10000831100008071200086D
+:10051000B311000845110008211100080100001066
+:10052000200100042DE9F84F0446DFF8C8182768B9
+:10053000DFF8C4B83A68A068DFF8C0A80A402169AB
+:10054000024360690A43E1690243606E0A43024361
+:100550003A6000267968E068DFF8942821F4405179
+:10056000014379609742A1691CBF206A0143BA68C0
+:10057000DFF8680A02401143B960B046F96A606A60
+:10058000090940EA0111F9625F454FF400404FF458
+:1005900080754FF400714FF480624FF400634FF4A4
+:1005A000805C4FF4005E4FF4804929D1DAF800B046
+:1005B0000BF0030BBBF1030F3ED8DFE80BF0023763
+:1005C000343A4FF0010AD4F81CB05746BBF5004F3F
+:1005D0004FF6F07A40F01283012F09D0022F00F07D
+:1005E0005582042F00F08E82082F00F0C382F6E2BD
+:1005F00001F045FD0146606A002840F01C8243E29C
+:10060000DFF8ECB75F4517D1DAF800A01AF4406ABA
+:1006100027D0BAF5806F09D0BAF5006F03D0BAF5CC
+:10062000406F06D008E04FF0020A07E04FF0040ADE
+:1006300004E04FF0080A01E04FF0100ADFF8B0B70D
+:100640005F45C0D1BAF1000F0BD0BAF1020F49D00B
+:10065000BAF1040F00F08280BAF1080F00F0B18007
+:10066000B7E301F004FD0146606A58B3012808BFF2
+:10067000022028D0022808BF042024D0032808BF65
+:10068000062020D0042808BF08201CD0052808BF59
+:100690000A2018D0062808BF0C2014D0072808BF4D
+:1006A000102010D0082808BF20200CD0092808BF2F
+:1006B000402008D00A2808BF802004D00B2808BF9B
+:1006C000284600D00120B1FBF0F0002800F0838321
+:1006D000626802EB4201884203D31303834280F035
+:1006E000A28076E3606AB0B3012808BFDFF8F008A3
+:1006F000EED0022808BFDFF8EC08E9D0032808BFD5
+:10070000DFF8E408E4D0042808BFDFF8E008DFD011
+:10071000052808BFDFF8D808DAD0062808BFDFF8B8
+:10072000D408D5D0072808BFDFF8CC08D0D00828D7
+:1007300008BFDFF8C808CBD0092808BFDFF8C00819
+:10074000C6D00A2808BFDFF8BC08C1D00B2808BFF4
+:100750004FF22440BCD0DFF8B008B9E701F03DFC0F
+:100760000146606A0028ADD0012808BF0220AAD047
+:10077000022808BF0420A6D0032808BF0620A2D064
+:10078000042808BF08209ED0052808BF0A209AD058
+:10079000062808BF0C2096D0072808BF102092D04A
+:1007A000082808BF20208ED0092808BF40208AD002
+:1007B0000A2808BF802086D00B2808BF2846FAD018
+:1007C00080E7676A002FC8D0012F08BF484629D0AC
+:1007D000022F08BF704625D0032F08BF41F25550A5
+:1007E00020D0042F08BF60461CD0052F08BF40F65C
+:1007F000CC4017D0062F08BF40F6AA2012D0072FF2
+:1008000008BF18460ED0082F08BF10460AD0092F7F
+:1008100008BF084606D00A2F08BF284602D00B2F73
+:1008200000D1802054E7BAF1000F0BD0BAF1020FCB
+:1008300038D0BAF1040F00F07280BAF1080F00F05E
+:10084000A780ECE001F013FC0146606A40B3012888
+:1008500008BF02251ED0022808BF04251AD003288D
+:1008600008BF062516D0042808BF082512D0052881
+:1008700008BF0A250ED0062808BF0C250AD0072875
+:1008800008BF102506D0082808BF202502D0092857
+:1008900008BF402572D00A280CBF80250B286DD0D8
+:1008A00001256BE0606A002836D0012808BFDFF818
+:1008B000A0692BD0022808BFDFF8986926D003284A
+:1008C00008BFDFF8946921D0042808BFDFF88C69DD
+:1008D0001CD0052808BFDFF8886917D0062808BF94
+:1008E000DFF8E86912D0072808BFDFF8E4690DD007
+:1008F000082808BFDFF8DC6908D0092808BFDFF83E
+:10090000D86903D00A2808BFDFF8D0697CD00B284B
+:1009100008BFDFF8F46677D0DFF8C46974E001F04F
+:100920005CFB0146606A40B3012808BF022525D060
+:10093000022808BF042521D0032808BF06251DD0A2
+:10094000042808BF082519D0052808BF0A2515D096
+:10095000062808BF0C2511D0072808BF10250DD088
+:10096000082808BF202509D0092808BF402505D040
+:100970000A280CBF80250B2800D001256268B1FB36
+:10098000F5F65008002110EB062051EB166141E00E
+:10099000606A002836D0012808BF4FF4800633D0A3
+:1009A000022808BF4FF400162ED0032808BFDFF836
+:1009B000346929D0042808BF4FF4801624D00528B4
+:1009C00008BFDFF824691FD0062808BFDFF81C69BC
+:1009D0001AD0072808BF4FF4002615D0082808BFF2
+:1009E0004FF4802610D0092808BF4FF400360BD0F2
+:1009F0000A2808BF4FF4803606D00B2808BF4FF4F2
+:100A0000004601D04FF40006C246002116EB52000A
+:100A10004AEB0101002301F0BFFB064601E04FF065
+:100A20000108A6F54070DFF8C818884280F0D1812F
+:100A30002268D660CFE1012808BF02251AD002281B
+:100A400008BF042516D0032808BF062512D00428A5
+:100A500008BF08250ED0052808BF0A250AD0062899
+:100A600008BF0C2506D0072808BF102502D008288B
+:100A700008BF202575D0092808BF402571D00A2855
+:100A80000CBF80250B286CD001256AE0606AB0B3EA
+:100A9000012808BFDFF8700521D0022808BFDFF861
+:100AA00040051CD0032808BFDFF8480817D00428E9
+:100AB00008BFDFF8300512D0052808BFDFF8380876
+:100AC0000DD0062808BFDFF8200508D0072808BF8A
+:100AD000DFF8180503D0082808BFDFF81C057AD016
+:100AE000092808BFDFF8140575D00A2808BFDFF809
+:100AF000100570D00B2808BFDFF808056BD0DFF8B1
+:100B0000DC0768E001F069FA0146606A40B3012839
+:100B100008BF022525D0022808BF042521D00328BC
+:100B200008BF06251DD0042808BF082519D00528B0
+:100B300008BF0A2515D0062808BF0C2511D00728A4
+:100B400008BF10250DD0082808BF202509D0092886
+:100B500008BF402505D00A280CBF80250B2800D0EF
+:100B600001256068B1FBF5F1420802EB4102B2FBDE
+:100B7000F0F632E0666A66B3012E2CD0022E08BF72
+:100B8000484628D0032E08BF42F6AA2023D0042EC0
+:100B900008BF70461FD0052E08BF41F698101AD026
+:100BA000062E08BF41F2545015D0072E08BF6046EC
+:100BB00011D0082E08BF18460DD0092E08BF1046C8
+:100BC00009D00A2E08BF084605D00B2E08BF2846BC
+:100BD00001D04FF4803000F013F9B6B201E04FF0CD
+:100BE0000108A6F11000504580F0F3800AEA0601E2
+:100BF000C6F3420001432068C160ECE0012F07D03A
+:100C0000022F35D0042F70D0082F00F0A580D7E038
+:100C100001F035FA0146606A40B3012808BF022599
+:100C200016D0022808BF042512D0032808BF0625C5
+:100C30000ED0042808BF08250AD0052808BF0A25B9
+:100C400006D0062808BF0C2502D0072808BF1025AB
+:100C50007AD0082808BF202576D0092808BF40256B
+:100C600072D00A280CBF80250B286DD001256BE0BF
+:100C7000606AB0B3012808BFDFF8641333D00228DC
+:100C800008BFDFF860132ED0032808BFDFF8581321
+:100C900029D0042808BFDFF8541324D0052808BF42
+:100CA000DFF84C131FD0062808BFDFF848131AD00E
+:100CB000072808BFDFF8401315D0082808BFDFF861
+:100CC0003C1310D0092808BFDFF834130BD00A28D2
+:100CD00008BFDFF8301306D00B2808BF4FF22441BD
+:100CE00001D0DFF82413606831E001F076F90146A5
+:100CF000606A40B3012808BF022525D0022808BF3A
+:100D0000042521D0032808BF06251DD0042808BFCC
+:100D1000082519D0052808BF0A2515D0062808BFC0
+:100D20000C2511D0072808BF10250DD0082808BFB2
+:100D3000202509D0092808BF402505D00A280CBF66
+:100D400080250B2800D001256068B1FBF5F101EB8F
+:100D50005001B1FBF0F631E0666A6EB3012E08BFB8
+:100D6000484629D0022E08BF704625D0032E08BF62
+:100D700041F2555020D0042E08BF60461CD0052EED
+:100D800008BF40F6CC4017D0062E08BF40F6AA2078
+:100D900012D0072E08BF18460ED0082E08BF1046E6
+:100DA0000AD0092E08BF084606D00A2E08BF2846DA
+:100DB00002D00B2E08BF802000F022F8B6B201E06E
+:100DC0004FF00108A6F11000504502D22168CE6014
+:100DD00001E04FF0010804F1680001210023418087
+:100DE0000180436083604046BDE8F28F2110000817
+:100DF00000800040F369FFCF0038014088000058B0
+:100E0000616800EB5100B0FBF1F6704790F82810D4
+:100E1000CA0706D502685368C16A23F400330B433E
+:100E2000536090F828108A0706D502685368016B52
+:100E300023F480330B43536090F828104A0706D5FB
+:100E400002685368416B23F480230B43536090F88E
+:100E500028100A0706D502685368816B23F4004303
+:100E60000B43536090F82810CA0606D502689368B1
+:100E7000C16B23F480530B43936090F828108A06CB
+:100E800006D502689368016C23F400530B4393600A
+:100E900090F828104A0610D502685368416C23F474
+:100EA00080130B435360436CB3F5801F05D1536827
+:100EB000816C23F4C0030B43536090F828100A069A
+:100EC00006D501684A68C06C22F4002202434A60D9
+:100ED0007047F8B5044604F17C050020E8606FF027
+:100EE0007E4701F0DDF90646206801680A0708D54B
+:100EF0000097334600224FF40011204600F016F808
+:100F000060B9206801684A070AD500973346002275
+:100F10004FF48001204600F009F808B10320F2BD2B
+:100F200020206860A86000202870F2BD2DE9F04103
+:100F3000069C05460E4690461F462868C16931400A
+:100F4000B1420CBF01200020404528D114F1010F0F
+:100F5000F3D001F0A5F9C01B844200D34CB9286836
+:100F6000016821F4D071016000F01CF800210170CB
+:100F700013E0286801684A07DFD5C1690A05DCD596
+:100F80004FF4006101622868026822F4D0720260A6
+:100F9000002200F007F8C1600270032000E000208A
+:100FA000BDE8F0812868816849084900816005F141
+:100FB0007C00202141608160704701680A6822F44A
+:100FC00090720A60DFF83413026893680B409360F4
+:100FD0002022C0F884200021C1667047FFF4FF1171
+:100FE00000127A0000093D00AAB0280080841E008B
+:100FF000006A18005558140040420F0020A1070055
+:1010000090D0030048E801000024F400136823F0A6
+:10101000800313600068016841F04001016070477F
+:10102000806A00F1560100220A810A8000F078BB34
+:10103000D0F8801021290FD10268B0F8561001B9FC
+:10104000E4E7016D0B789362016D4A1C0265B0F80C
+:1010500056104A1EA0F856207047D0F8801021295B
+:1010600011D10268B0F8561001B9CFE7016D0B88B5
+:10107000C3F308039362016D8A1C0265B0F8561031
+:101080004A1EA0F856207047D0F88010212900D0C1
+:10109000704730B500F15602938A0CE0E1690D0605
+:1010A00008D5016D0D78A562016D4C1C046515888D
+:1010B000691E11805B1E99B229B10468118800294C
+:1010C000ECD100F023F830BDD0F88010212900D0F9
+:1010D000704730B500F15602938A0EE0E1690D06C3
+:1010E0000AD5016D0D88C5F30805A562016D8C1C3C
+:1010F00004651588691E11805B1E99B229B10468C8
+:1011000011880029EAD100F001F830BDA16821F46E
+:101110000001A1600068016841F040010160704772
+:1011200070B500F027F808D100F02AF82B70816D17
+:101130004B1C00F019F821B929E0886940F008003B
+:10114000886170BD70B500F015F808D100F018F88E
+:101150002B80816D8B1C00F007F821B917E088699E
+:1011600040F00800886170BD836525886E1E26806A
+:101170002188704700F16C0201689369222B704747
+:101180004B6A856D00F15E0461880B407047016811
+:101190000B6823F490730B6001688B685B085B003D
+:1011A0008B602021916100231360BDE8704000F046
+:1011B0007ABB2DE9F04100F05BF81AD167890AE0AB
+:1011C00000F06DF80870B06D421C00F04BF808B9E3
+:1011D00000F06BF87F1EB8B20028F1D1208850B122
+:1011E0006189884207DA00F054F8454800F04AF86F
+:1011F00001E000F002F8BDE8F0813068816941F05B
+:101200000801816170472DE9F04100F031F81AD1F1
+:1012100067890AE000F043F80880B06D821C00F096
+:1012200021F808B900F041F87F1EB8B20028F1D1CA
+:10123000208850B16189884207DA00F02AF83148E5
+:1012400000F020F801E0FFF7D8FFBDE8F0810000D2
+:101250000000127A0000093D00AAB0280080841E18
+:1012600000006A18B26521884B1E238020887047D1
+:10127000064606F15E0406F16C05B4F80280A86922
+:101280002228704728603068016841F02001016021
+:1012900070473068816821F0805181607047306804
+:1012A000406AB16D08EA000070473068134A01686F
+:1012B00021F48071016020233068816811408160D1
+:1012C000AB6100202860304600F0EDBA005558149C
+:1012D0000040420F0020A1070090D0030048E80121
+:1012E000000024F40055150000CC0C0000AA0A00F0
+:1012F00000FD0F005461510000D43000FEFFFFEFED
+:1013000021110008451100085B4981B00A680243B9
+:101310000A600968084008E0584881B0016841F453
+:1013200000210160006800F400200090009801B0E6
+:10133000704738B586B004466846142100F0B6FF01
+:1013400020684F4D4F49A84230D108684E4D40F0BB
+:1013500001000860096801F001010591059801206C
+:10136000FFF7D2FF02210191002202920C200321FB
+:101370000090039100F04FF8002202920392402067
+:1013800002210090019100F046F8404828601121A8
+:1013900000F048F808B101F0DBF86567AC620022A4
+:1013A0000021252001F0F0F8252030E0384A904255
+:1013B0002FD14868374D40F480404860486800F4B9
+:1013C0008040059005980120FFF79EFF0220FFF75F
+:1013D0009BFF0221019101220292C0200321009073
+:1013E00003910722049269462B4801F041F92B48EA
+:1013F00028600F2100F016F808B101F0A9F8656720
+:10140000AC6200220021242001F0BEF8242001F06B
+:10141000D8F807B030BD0822049269464FF09040DA
+:1014200001F026B9696000201022E860802168611F
+:10143000A861E8612862AA602961284600F034B8F2
+:1014400010B5044616492068884213D101F0DEF930
+:1014500001F0DCF91348016821F4407141F4807116
+:101460000160026842F4004202602046BDE810407C
+:1014700001F0DFB910BD00004C00005850000058CA
+:10148000008000405C0000589003002044000240AF
+:1014900000380140F00300200004004844040240EA
+:1014A000002800409000005870B5040001D10120D0
+:1014B00070BD2268DFF840329A4204F124050BD255
+:1014C000DFF8380281181426B1FBF6F18900DFF845
+:1014D00030322962EB610AE0DFF828028118142318
+:1014E000B1FBF3F18900DFF820022962E8610221F3
+:1014F00069701368A068E1686FF30E1303432069F5
+:101500000B4361690343A0690B43E1690343206A0C
+:101510000B4303431360204600F0C2F8A068B0F507
+:10152000804F04BF00216160696A207900F01BF8D8
+:1015300038B1052805D2204600F0CFF800F00CF8AD
+:1015400003E0002028636863A8630021A9610120EB
+:1015500068702970002070BD296B00200860696BDD
+:10156000A86B486070470860A96AE86A48606068CC
+:10157000704738B500F1240200245178022903D0C5
+:1015800004209061012428E001680B6823F00E0319
+:101590000B6001680D686D086D000D60516A0B6885
+:1015A00023F480730B60012192F82030D56903F099
+:1015B0001C0399406960936AD16A5960116B31B11B
+:1015C0000B6823F480730B60536B916B596001219E
+:1015D00051701470516901B18847204632BDF8B589
+:1015E00000F124010423CA6914680268156891F89F
+:1015F000206006F01C0603FA06F73C4210D06F0785
+:101600000ED51468A50603D4146824F004041460ED
+:1016100000F03DF8C968002938D0BDE8F44008471B
+:10162000022303FA06F73C4213D0AF0711D5146822
+:10163000A50605D4146824F00A04146001224A7037
+:1016400000F025F800220A708968F9B1BDE8F4407D
+:101650000847082303FA06F6344217D02B0715D59E
+:10166000146824F00E041460012291F82030CC6933
+:1016700003F01C039A40626001228A614A700022D2
+:101680000A70096911B1BDE8F4400847F1BD91F84D
+:101690002020CC6902F01C02934063607047000078
+:1016A00010B5416C0268144B89089A4239BF174C37
+:1016B00004EB8101164B03EB8101816402F0FF0210
+:1016C000083A1421B2FBF1F1012301F01C01114A87
+:1016D000C26403FA01F1016510BD01790E4A0F4B96
+:1016E000836502EB81024265491E012201F003017C
+:1016F0008A40C2657047000008040240F8FFFDBF41
+:1017000000000240F8FBFDBF000402400008024058
+:101710001C08024080080240FC08024040090240C8
+:10172000704730B4002513E050F8042BD30744BFB2
+:10173000A9F101039A18091F042942F8045BFAD29F
+:1017400013468C0744BF15809B1CC90748BF1D70FA
+:1017500050F8041B0029E7D130BC704710B500F1E8
+:101760007C010A78012A01D1022010BD01220A70F1
+:1017700024234B60026813681468640864001460D2
+:101780000022426623F000530068036020224A6072
+:1017900000230B70002010BD70B500F01FF801D1C0
+:1017A000022070BD00F020F822F0604209E070B520
+:1017B00000F014F801D1022070BD00F015F822F0FD
+:1017C000606211438160204600F01CF820680660CA
+:1017D0002021696000222A70002070BD044604F1B7
+:1017E0007C052878012870470120287024226A602F
+:1017F0002068066802685208520002602068826809
+:1018000070470000FFB500BF14A200BF15A6D2E9C3
+:10181000003402A9C1E90034D6E90071CDE90071B4
+:10182000416E11B90121012213E001688A688968BB
+:10183000520E02F00702490F02AC655CA45C1DF871
+:1018400001101DF80220ED00E40095FBF1F194FB7E
+:10185000F2F2683041800280FFBD00000101010307
+:10186000070100000804020408010101704700009C
+:10187000002800D0704710B5154C00F00FF8BDE8F7
+:101880001040FEF7E5BC002800D0704710B5114CA1
+:1018900000F004F8BDE81040FEF790BC0E4823604D
+:1018A0000E4B0360704700680C49884204D1084A17
+:1018B0001068002818BF0047704700680749884231
+:1018C00004D1044A1068002818BF00477047000080
+:1018D000D4040020D80400208402002000380140F5
+:1018E000704770474FF0B040006800F0F000B0283B
+:1018F00088BFB02070472DE9F041040062D0207805
+:1019000081064FF0B04533D5A868E96810F00C00A7
+:1019100001F0030104D00C2808BF012940F07E80AB
+:101920002868810702D5E06900284BD0FFF7DAFF6D
+:10193000616A884207D2084600F0B2FB002815D140
+:1019400000F052FA0AE0286820F0F000014300F0AD
+:1019500050FA606A00F0A4FB002807D100F0AAFF4B
+:10196000DFF8D407006800F0F5FF002840F08E8112
+:101970002078C10711D5A868E96800F00C00082894
+:1019800001F0030103D00C2808BF032969D128689E
+:10199000810302D56068002814D0217888071AD501
+:1019A000A868E96800F00C00042801F0030104D0E5
+:1019B0000C2808BF022940F08D802868410503D516
+:1019C000E068002800F062816868216920F0FE402C
+:1019D00040EA016068602168DFF8606711F0180F65
+:1019E00000F076816069002800F0AF80C80670685A
+:1019F00040F19C80800708D4716841F0010171605A
+:101A000000F04EFC07467068800700F1418100F04D
+:101A100047FCC01B0328F6D30320DEE1E06978B160
+:101A2000296841F0010100F0CEFA064628688007D7
+:101A300000F13D8100F034FC801B0328F6D3EBE776
+:101A4000286840084000286000F02AFC0646286804
+:101A500000F0C6F98CD000F023FC801B0328F6D3DD
+:101A6000DAE76068B0F5803F04D1286840F4803040
+:101A7000286011E0B0F5A02F286806D140F480203E
+:101A80002860296841F4803105E020F48030286026
+:101A9000296821F480212960606860B100F000FCB1
+:101AA0000646286880033FF578AF00F0F9FB801BFD
+:101AB0006528F6D3B0E700F0F3FB06462868400C33
+:101AC00010F001003FF469AF00F0EAFB801B6528CD
+:101AD000F4D3A1E7E06878B1296841F4807100F09F
+:101AE00072FA0646286840053FF56EAF00F0D8FB55
+:101AF000801B0328F6D38FE7286820F480702860C5
+:101B000000F0CEFB06462868800A10F001003FF482
+:101B100062AF00F0C5FB801B0328F4D37CE700F024
+:101B2000BFFBC01B0328C0F0CF8075E740F0010069
+:101B300000F070F907467068800700F1E08000F05F
+:101B4000AFFBC01B0328F6D366E7706820F00400E3
+:101B500000F060F907467068C00810F0010000F05E
+:101B6000DD8000F09DFBC01B0428F4D354E705285A
+:101B7000306806D140F004003060316841F0010166
+:101B800005E0400840003060316821F00401316018
+:101B9000A06841F2893768B100F082FB8046306866
+:101BA000800700F1D08000F07BFBA0EB0800B8427A
+:101BB000F5D331E700F074FB8046306800F010F98F
+:101BC00000F0C18000F06CFBA0EB0800B842F4D339
+:101BD00022E700F065FBC01B0328C0F0C2801BE7B2
+:101BE00040084000B06000F05BFB0746B06800F0C2
+:101BF000F7F800F0BA8000F053FBC01B0328F5D3C0
+:101C00000AE700F04DFB801B0328C0F0C08003E70B
+:101C100000F046FB001B0328C0F0DA80FCE6E96810
+:101C2000DFF81C0589088900E960E9680140E9607E
+:101C300000F036FB044600F0E5F825D000F030FB5C
+:101C4000001B0328F7D3E7E601281FD0E868226BC2
+:101C500000F00301914202BF00F07001626B9142FB
+:101C600014D1A26BC0F30621914202BF00F4781197
+:101C7000E26B91420AD1226C00F06061914202BF96
+:101C800000F06040616C884200F0A6800120A4E072
+:101C9000706840F0040000F0BDF807467068000767
+:101CA00008D400F0FDFAC01B0428F7D3B4E600F016
+:101CB0009BF85DE67068A16920F4706040EA01203D
+:101CC000706000F0A4F8074600F089F87FF427AFB1
+:101CD0002078410737D5DFF86C743868C10529D4FE
+:101CE00000F094FD00F0DCFA80463868C10521D48C
+:101CF00000F0D6FAA0EB08000328F6D38CE6706853
+:101D000020F0040070607068C00810F00100DFD09F
+:101D100000F0C6FAC01B0428F5D37DE600F077F882
+:101D2000074600F05CF8D3D000F0BAFAC01B0328D5
+:101D3000F7D371E6A06801287FF419AF306840F04E
+:101D40000100306024E721784A060ED5A06A0028F9
+:101D5000B0683FF445AF40F00100B06000F0A0FA79
+:101D60000746B06880077FF534AFE06AA0B3A96882
+:101D700001F00C010C293FF467AF0228286820F01D
+:101D8000807028607FF44BAF00F08AFA064600F0BE
+:101D900039F87FF436AFEA68DFF8AC03216BA36B48
+:101DA0000240606B0A430243E16B206C42EA03226B
+:101DB0000A43616C02430A43EA60286840F080707D
+:101DC0002860E96841F08051E96000F069FA044652
+:101DD000286880017FF51CAF0020BDE8F0817068A5
+:101DE000400810F0010070472968606A21F0F00196
+:101DF000014329606968206A21F47F4141EA00219A
+:101E0000696070472868400E10F0010070477068E4
+:101E100040084000706000F043BA2DE9F843040028
+:101E2000884646D0DFF8246300F0C8F849D200F0B5
+:101E3000CDF8074600F0C2F843D000F031FAC01BDD
+:101E40000228F7D90320B7E000F02AFA401B022845
+:101E500045D9F7E700F024FAA0EB090002284ED993
+:101E6000F0E700F01DFAA0EB0900022856D9E9E7D7
+:101E700000F016FA401B02285FD9E3E700F010FAE1
+:101E8000401B022869D9DDE700F00AFA401B41F245
+:101E90008931884275D3D5E7032802D13968890191
+:101EA00003E00028396802D1890762D401E04905BE
+:101EB0005FD4012080E000F0F3F9C01B022870D944
+:101EC000C0E7207881074FF0B0470BD5BA68A0680B
+:101ED00022F0F0020243BA6000F0E2F90546B86869
+:101EE000C003B1D52178DFF84C5288060AD529689D
+:101EF000606921F0F001014300F065F8814628682F
+:101F00008003A7D5217848060BD52968A06909095F
+:101F1000090141EA101100F056F881462868C00313
+:101F20009FD5217848070BD5B968E06821F4E061B6
+:101F30000143B96000F0B4F90546B868800397D54D
+:101F4000217808070CD5B968206921F4605141EA6D
+:101F5000C001B96000F0A4F90546B86840038DD50A
+:101F60002178C80715D56068022895D1396889039A
+:101F70009FD5BA68920840EA8200B86000F090F9F4
+:101F80000546B868616800F00C00B0EB810F7FF483
+:101F90007BAF306800F00700804505D200F016F8EE
+:101FA000074600F00BF886D100F084FC00F008FD35
+:101FB000BDE8F24300F0CEBCBDE8F283306800F02B
+:101FC000070040457047296000F06AB93168C908C8
+:101FD00048EAC101316000F063B938B54FF0B04450
+:101FE0005C4DA16811F00C0106D1FFF77BFCC0F33A
+:101FF000031055F8200032BD0429574A05D008299E
+:10200000564804D12168C90222D5104632BDE16884
+:1020100001F00301022904D0032904D12168C90277
+:1020200007D5104605E0FFF75DFCC0F3031055F837
+:102030002000E168E268E368C1F306214843C2F387
+:102040000211491C5B0FB0FBF1F05B1CB0FBF3F01D
+:1020500032BD80B5FFF7C1FF3D49FFE7404A09683F
+:10206000C1F3031152F82110B0FBF1F002BD80B5AD
+:10207000FFF7EFFF00F010F8C1F3022106E080B592
+:10208000FFF7E7FF00F008F8C1F3C22112F82110B2
+:1020900001F01F01C84002BD2D49324A096870474E
+:1020A00070B52C49B1282EBFCC6AC0F3031051F88B
+:1020B00020402048056800F0A3FC294905F00F05E1
+:1020C00051F825202849B4FBF2F20024B2FBF1F1CB
+:1020D000B0F5007F2CA2204609D100BF23A353F8FE
+:1020E00020508D4214D2401C0328F8D912E000BFC2
+:1020F00022A353F820508D420AD2401C0328F8D363
+:1021000008E000F0CDF8801B03280CD3032070BD3D
+:1021100052F820400D4D2868C00844EAC0002860ED
+:1021200000F0BEF80646286800F00700A042E8D19B
+:10213000002070BD080100583000002090000058B9
+:10214000FFFFFEEE000400588C80C11100400058D3
+:1021500008000058684400080024F4000048E80122
+:10216000284400082046000840420F0012000000EA
+:1021700024000000360000004000000006000000BF
+:102180000C00000010000000000000000100000032
+:102190000200000004000000D3BBD9B1B2F5803FBB
+:1021A0005BD2022A1ED98C46B1FBF2F102FB11C3AD
+:1021B0001B0443EA1043B3FBF2FC02FB1C3380B266
+:1021C00040EA0343B3FBF2F002FB103240EA0C405A
+:1021D00000237047022A05D98446B0FBF2F002FBC7
+:1021E00010C270474AB105D100F0010249085FEA08
+:1021F0003000704700220023704700F009BC0B003C
+:102200000200002100207047F7D30022002370470E
+:10221000904271EB030CF2D370B5B1FA81F4B3FACA
+:1022200083F52C1BA340C4F1200532FA05F6334395
+:10223000A2405FF00046E64002E05B085FEA32023F
+:10224000841A71EB030524BF204629467641F4D356
+:1022500002000B003000002170BD70B5B1FA81F4AE
+:10226000B2FA82F5C4F120046419B4F12006DAD37D
+:10227000B2405FF00044F440002502E052085FEAFB
+:102280003303C61A71EB020E24BF30467146644117
+:102290006D41F3D302000B002000290070BD000047
+:1022A00001480068704700BF2C000020002200F0A9
+:1022B000B1BB0000984900E0984981B00A68024328
+:1022C0000A60096808400090009801B0704710B596
+:1022D00000F062FB924C606840010ED56068C0005F
+:1022E0000BD400F093FA00F091FA206840F48030AB
+:1022F0002060216821F48031216000F0D3F80020B3
+:1023000000F0A2FB40B180798649E160E26822F4E6
+:102310007C5242EA0022E26000F048F88248834C96
+:10232000016800220260036903F050030361012089
+:10233000FFF7C2FF0220FFF7BFFF0420FFF7BAFF3D
+:102340000220FFF7B7FF0120FFF7B4FF00220F21A3
+:102350000E2000F019F90E2000F033F900220F21B1
+:102360003A2000F011F93A2000F02BF900210F2259
+:102370006F484160826047F6FF710022C1600261D0
+:102380008261C261046000F073FBCA206062532165
+:102390006162FF21A068C008C000A060616200F017
+:1023A00018FC4FF0FF3000F0BFFCFAE710B5AEB0FC
+:1023B000604C1CA82146482200F078FD01A81C2191
+:1023C000FFF774FF08A804F14801502200F06EFDE9
+:1023D0005348016821F0180101604FF480335648DA
+:1023E000026822F4C06242F40072026007220068B0
+:1023F00000F4C06000904FF4807400991C92012199
+:102400001E91002240211D93209127921F941CA809
+:10241000FFF771FA6F2002210190029100220392CE
+:102420000492059206920792012101A8FFF7F5FC9C
+:1024300043F60301002208910E9200214FF48042DE
+:1024400002230F9119921A931B91189408A800F077
+:102450004FFD2EB010BD10B5384C394820604FF4F8
+:10246000E1310C20606100224FF40040E06100F097
+:1024700010F82046FDF762FE00212046FFF78CF998
+:1024800000212046FFF793F92046BDE81040FFF7F2
+:1024900065B96160A260E2602261A261226262624B
+:1024A000A2627047274881B0016841F48011016041
+:1024B0003F21006800F4801000900098224841609D
+:1024C0004161016841F47C110160026942F47C12AF
+:1024D0000261016841F03F010160026942F03F0280
+:1024E000026101B0704738B50446FFF7D9FE14F118
+:1024F000010F054609D000F066FA041905E01348FB
+:10250000016821F00401016030BFFFF7C9FE401BE4
+:10251000A042F4D331BD0000480000584C000058E0
+:1025200090000058FECAFECA8008005800280040EB
+:10253000500400209043000800040058840200204A
+:102540000038014050000058040C005810ED00E025
+:10255000704700000901020002D43C4881547047D2
+:102560003B4B02F00F021A4402F8041C7047394B2F
+:1025700019684FF6FF020002114000F4E0600843C2
+:10258000354908431860704738B5324B1C68C4F3AE
+:102590000223C3F10704052C28BF04241D1D072DA9
+:1025A00034BF0023DB1E012505FA04F4641E21401C
+:1025B000994005FA03F35B1E1A401143BDE834400D
+:1025C000C8E7010007D4012200F01F01234B8A4015
+:1025D000400943F82020704701000BD4012200F08D
+:1025E0001F011F4B8A40400943F82020BFF34F8F43
+:1025F000BFF36F8F704710B5401EB0F1807F01D3DD
+:10260000012010BD174C60600F214FF0FF30FFF725
+:10261000A1FF0021A16007202060002010BD010063
+:1026200007D4012200F01F010F4B8A40400943F8F4
+:1026300020207047010007D4012200F01F010B4B3E
+:102640008A40400943F820207047000000E400E081
+:1026500018ED00E00CED00E00000FA0500E100E0FC
+:1026600080E100E010E000E000E200E080E200E055
+:102670002DE9F04106460A464FF0000C4FF00F08D6
+:102680002CE05A4FBE4214BF4FF0070E4FF0040E1D
+:102690000EFA01F1294344F82310C143544C236836
+:1026A00055680B40ED0348BF0343236063685568DA
+:1026B0000B40AD0348BF034363604E4C236855682D
+:1026C0000B40ED0248BF0343236063680B40516831
+:1026D0008D0248BF034363600CF1010C106830FAAF
+:1026E0000CF172D0012303FA0CF31840F4D05468B3
+:1026F000022C18BF122C4FEA8C010ED14FEADC04D9
+:1027000006EB840401F01C0E256A08FA0EF7BD439F
+:10271000176907FA0EF73D4325624FEA4C0403257B
+:102720003768A540ED4305EA070E177907F0030760
+:10273000A74047EA0E0737605768012F18BF022FDE
+:1027400003D0112F18BF122F11D1B76805EA070E59
+:10275000D768A74047EA0E07B760776827EA030300
+:102760005768C7F3001707FA0CF73B437360F36829
+:102770001D40936803FA04F42C43F4605468E300AA
+:10278000AAD51D4C4FEA9C0354F8237001F00C01AC
+:1027900008FA01F5B6F1904F27EA050508BF4FF09A
+:1027A000000E11D0154FBE4208BF4FF0010E0BD0E6
+:1027B000134FBE4208BF4FF0020E05D0114FBE426C
+:1027C0007FF45FAF4FF0030E62E7BDE8F0810AB11E
+:1027D00081617047816270470B4A136803421CBFD6
+:1027E000106000F09BBA7047000000000010004825
+:1027F0008008005800080058080001400004004804
+:1028000000080048000C00480C0800580248016805
+:1028100041F4807101607047000400588A60FF2114
+:102820000268516280F82130002180F820100020D9
+:10283000704790F82010012901D102207047012132
+:1028400080F82010022280F82120CA2103685962F2
+:10285000532201684A62012301688A6842F020021B
+:10286000FFF7DCBF3249002008604FF0B04131482B
+:10287000026842F4700202604FF4E022086840F0FF
+:10288000010008608A600B682B4803402B480B60EE
+:10289000026822F005020260002243685B085B00C8
+:1028A00043602748C8600861086820F480200860F9
+:1028B0008A61704710B54FF0B04222491068C0F3EA
+:1028C000031001EB8003186C936803F00C03042BD6
+:1028D00004D0082B04D00C2B04D01CE01A481AE0BA
+:1028E0001A4818E0D368D468C4F3021403F0030351
+:1028F000641C022B08BF144802D0032B08BF1348E6
+:10290000B0FBF4F3D068D468C0F30620640F4343EF
+:10291000641CB3FBF4F00E4B186090681A68C0F3A7
+:10292000031051F82000B2FBF0F0186010BD000059
+:1029300008ED00E088ED00E0FBFEF6FA9400005898
+:1029400000100422284400080024F4000048E80194
+:102950005000002070B50F4E0446B0680025A8B1A5
+:10296000FFF777FBB2684FF47A71B1FBF2F2B0FB7C
+:10297000F2F0FFF740FE48B9102C07D200222146A2
+:102980004FF0FF30FFF700FE746000E0012528469D
+:1029900070BD00BF2C000020164810B5016841F43E
+:1029A000807101600320FFF7E2FD0020FFF7D2FFF6
+:1029B0000024002814BF0124FEF7AEFC204610BD01
+:1029C0000D48406870470C48806870470B480BE022
+:1029D0000A48016821F00201016070470748016858
+:1029E00021F0040101607047016849084900016055
+:1029F00070470000004000582C000020042004E034
+:102A0000DFF80800006800F4C06070470004005858
+:102A10007047000000B500BF130096469446103979
+:102A200028BFA0E80C50FAD85FEA417C28BF0CC050
+:102A300048BF40F8042BC90728BF20F8022B48BF25
+:102A400000F8012B00BD000020B501460648074DE7
+:102A5000C2798A4218BFA84218BF0838F8D18A4202
+:102A600018BF002020BD00BFF873FF1F0070FF1FBC
+:102A700070B5040049D094F8210028B9002184F8E9
+:102A800020102046FEF7DCFC00F04EF853202168B1
+:102A9000486200F052F8FF2510B100F03FF834E032
+:102AA0002168DFF8AC008A6802408A602268936877
+:102AB00066682169A0690E4306433343936020682A
+:102AC000E168016120680169A26841EA024101618F
+:102AD0002068C16821F08001C1602068C16C89084C
+:102AE0008900C1642168CA6CE369606903431A43C1
+:102AF000CA6421688868810609D400F01CF830B1E6
+:102B000020684562042100F01DF8012070BD206896
+:102B10004562012184F82110002070BD20684562C3
+:102B2000042184F821107047022084F82100CA2172
+:102B300022685162704720460CE0204623E020685E
+:102B4000C0F8248084F82110002084F82000704709
+:102B5000BFFF8FFF38B504462068C16821F0A0018F
+:102B6000C160FFF79DFB05462068C168880608D450
+:102B7000FFF796FB401B40F2E9318842F4D3032073
+:102B800032BD002032BD38B504462068C1684A060F
+:102B900012D44FF0FF31C160FFF782FB0546206879
+:102BA000C168480608D4FFF77BFB401B40F2E931BF
+:102BB0008842F4D3032032BD002032BD4D4981B09C
+:102BC0000A6802430A60096808400090009801B052
+:102BD000704718B5484C89B0206840F40040206028
+:102BE00000F00AFB4549002000F0CDFC68461421A6
+:102BF000FFF75CFB0020029003214FF4604201913B
+:102C000000920120FFF7DAFF69464FF09040FFF78E
+:102C10002FFD606C40084000606418210091022084
+:102C2000FFF7CCFF69463648FFF722FD606C20F0C5
+:102C300002006064FFF7CAFEFFF7CAFEFFF7CEFE90
+:102C40000121012000F0EAFA002000F0BBFD012084
+:102C500000F0B8FD022000F0B5FD012000F0D6FD27
+:102C60000121002000F0ECFD00F042FE2548264C3A
+:102C700000F035FF0FF259020021202000F0B4F8D7
+:102C800004F23C50029021490FF22D020091019272
+:102C9000684600F088FE04F25471039104F5C9629D
+:102CA00040F23C5104920691059403A800F0B0FE56
+:102CB00000F01CFE0AB010BD80B50146114800F0BE
+:102CC0001AFFBDE804400021202000F09AB800005F
+:102CD00080B500F0D4FE0021012000F09FFA694683
+:102CE000084800F01EFF009800F0ABFE00F02AFF3D
+:102CF00001BD00004C00005808000058500400209E
+:102D000000040048A004002024000320113C000817
+:102D100000F098BA4FF0FF3000F006B8102808BF56
+:102D200000F085BF704700002DE9F0414D4CDFF801
+:102D30003881A5692840A06131E0491C54F8310070
+:102D40000742FAD004EBC1071840796810400142ED
+:102D500004BF4FF0FF327A607E68304000F086F8A2
+:102D60006062012101FA00F086437E60EFF3108279
+:102D700072B6606A23698140C9430B402361022017
+:102D800004EBC00353F8087C0F40401E43F8087C56
+:102D9000F6D182F31088606A58F82010884763697A
+:102DA0002069A2691840104207D0E069216A0842F0
+:102DB00003D1002103EA0207C0E701F089F8EFF32D
+:102DC000108872B621696069A2690140114201BF91
+:102DD000E069216A0842FFF79BFF88F3108801F041
+:102DE00078F8A561BDE8F08138B51446EFF3108599
+:102DF00072B600F03BF81C4941F8204085F310887A
+:102E000031BD30B5EFF3108272B6164B1C69044326
+:102E10001C6153F83150284343F8310082F3108885
+:102E200030BD506181F310887047EFF3108172B6A6
+:102E30000C4AD3691843D061F4E770B5094C656A50
+:102E4000266A2062012101FA05F502E02846FFF713
+:102E500061FF216AE0690842F8D088432662E06198
+:102E600070BD000004000020100300200246002076
+:102E7000110C090404BF1020120412F07F4F04BF8C
+:102E80000830120205A312F0704F04BF001D12019A
+:102E9000120FC0F11F00995C401A70470403020230
+:102EA0000101010100000000000000004AB1000023
+:102EB00011F8013B521E00F8013B1CBF11F8013B09
+:102EC000F8E77047DFF82C130A68030903F47F233F
+:102ED00000019A4300F47F2000F088B9DFF8142342
+:102EE0001368010C23EA014343EA0043136070476F
+:102EF0002DE9F843054600242878DFF8F8624106FA
+:102F0000A0464FF0B0472DD5286B70B1B0F5800FBB
+:102F100006D0B0F5000F18BFB0F5400F17D01FE076
+:102F2000F96841F48031F960F3E0386820F080609E
+:102F30003860FFF7B5F981463868000140F1D68066
+:102F4000FFF7AEF9A0EB09000228F5D90324DDE074
+:102F5000FFF7A6F9A0EB0900022840F2CF80F5E7C1
+:102F60000124A0462868010531D5B06800F44078F6
+:102F7000286C80452AD0FFF749FCB8F1000FB168F2
+:102F800005D1286C21F440710143B1601EE0B068A6
+:102F900040F48030B06021F44071B06820F480309B
+:102FA000B060286C0143B160B068C0070ED5FFF770
+:102FB00077F98046B068800708D4FFF771F9A0EB75
+:102FC000080041F289318842F4D30324A0462878CE
+:102FD000C10705D53268A869920840EA82023260CA
+:102FE0002978880705D53168E86921F440610143F3
+:102FF00031602978C80644BFA86AFFF76FFF2878B8
+:10300000810644BFE86AFFF769FF2878410744BF9B
+:10301000286AFFF757FF2878010744BF686AFFF75F
+:1030200051FF2868C1051ED53268686B22F04062E6
+:1030300002433260696BB1F1006F00F0C9F8686B50
+:10304000B0F1806F0FD1396821F0806100F0CBF8CA
+:1030500004463868000163D5FFF722F9001B0228F7
+:10306000F7D94FF0030870E0FFF71AF9001B0228A8
+:1030700064D9F6E7316821F04041316020F080509A
+:10308000326822F0406210433060A86BB0F1C05F3C
+:1030900000F09EF82868410576D53268E86B22F08A
+:1030A000405202433260E96BB1F1005F03D1F8682E
+:1030B00040F48030F860E86BB0F1805F64D139682B
+:1030C00021F0806100F08FF80446386800014CD58B
+:1030D000FFF7E6F8001B0228F7D94FF0030853E08A
+:1030E000FFF7DEF8001B022847D9F6E700F067F883
+:1030F000A86821F4781100F071F881463868000161
+:103100007FF526AF3969686901433961002C7FF486
+:1031100028AF3168286B21F440010143316021E779
+:103120003969686821F4FE4141EA00213961396951
+:10313000E86821F0606100F051F804463868000149
+:1031400092D5396968690143396129688805A1D533
+:10315000A86BB0F1804F1CBFB0F1004F002889D19F
+:10316000316821F0404108438EE700F028F82869D3
+:1031700021F0604100F032F8044638680001AFD514
+:1031800039696869014339612968C80405D5F1685E
+:10319000686C21F440410143F160296888040BD533
+:1031A000796AE86C21F0300101437962796AA86C90
+:1031B000890840EA810179624046BDE8F2833869B6
+:1031C000696820F4FE4040EA01203861396970479F
+:1031D00003D1F86840F08070F860704701433961AE
+:1031E000396841F080613960FFF75AB810430860D0
+:1031F00070470000880000582048002101604160AD
+:10320000704710B500F019F81C6819B1012904D1F4
+:10321000204301E024EA000018600BE010B500F044
+:103220000CF85C6819B1012904D1204301E024EABB
+:103230000000586082F3108810BDEFF3108272B660
+:103240000E4B704738B5EFF3108472B60B490C4D36
+:10325000086820B1296888476A6890470AE048688A
+:1032600020B1A8688047E968884703E0286980475B
+:103270006969884784F3108831BD0000A8040020E4
+:1032800088460008DFF8FC140A6892B200E00246A3
+:10329000086880B28242FAD170472DE9F041DFF828
+:1032A000E864DFF8E8843178044618256843062985
+:1032B00008EB000708D130787070347079754FF0E2
+:1032C000FF30706000203DE000F07BF8B96809181D
+:1032D000B96008F10803B96832786A439A58914294
+:1032E000327813D308F1150315FB02FC13F80C30E8
+:1032F000062B29D008F108066B43F358994222BFE8
+:1033000008F115036A439A5CECD21DE0114633784C
+:1033100069439A420FD008F1140C08F1150E1CF8FD
+:10332000013015FB03F50EF805407A753B7508F181
+:103330001402545403E008F114037A755C54317894
+:1033400071703470BDE8F0811146694308F11503CE
+:103350005B5C062B04D008F1140615FB03F57455CD
+:103360007B753A7508F115025454EBE7F0B5DFF8B8
+:103370001834DFF818541E78182402466243B0420D
+:103380002A4404D118785870547D1C700FE0167DC3
+:10339000507D92F815C005F115076643062807F819
+:1033A00006C004D0167D143514FB00F42E55012000
+:1033B00010731A78062A02BF00294FF0FF305860B8
+:1033C000F0BD10B5DFF8C043606810F1010F10D0F8
+:1033D000FFF758FF6168DFF8B82381422FBF6368A9
+:1033E00061685388CB1851781278181A4843D04036
+:1033F00000E0002080B210BD2DE9F84FDFF89053B7
+:10340000DFF890B3D5F80880D8F80000DBF800109A
+:103410004A0500F07AF9DFF87063DFF870A321F451
+:10342000806181604FF0180934780AF1080019FBB7
+:1034300004F14758FFF7C5FF874211D20027012149
+:10344000B170062C3FD019FB04F40AF108010A59A7
+:10345000824210D200230B510AEB04014C7DF0E7AD
+:10346000A9884118B94202D2AF880021E8E70122B9
+:103470003F1AB270E5E70A590AF10803121A1A5105
+:10348000EAE7022802DA2878012800D07F1ED8F85F
+:103490000000C1684A07FAD500F02AF9DBF80C00F1
+:1034A000000CBFB247EA0047CBF80C70FFF7EAFE0A
+:1034B0007060A8680068816841F480618160AFF342
+:1034C0000080BDE8F18FB8B20028DAD1FFF7DAFE4C
+:1034D00070600320BDE8F24FFFF7A1B82DE9F84373
+:1034E000EFF3108872B6AA4DA84BA8680168CA22EB
+:1034F0004A625320486218208A6822F480628A60F7
+:10350000A14A1678374647431F44387B022823D107
+:103510003C68D7F810909078D8B17A7B012A0AD10C
+:1035200001213046FFF722FF88F310887968304682
+:1035300000F0F1F804E088F31088304600F09EF8BF
+:10354000A86800F01AF831462246484600F02CF9E7
+:103550000DE0FFF751FF08E0C8684207FCD500F016
+:1035600086F84FF400208C49086088F31088FF2209
+:10357000A86801684A62BDE8F1830068CA21416217
+:10358000532242627047F8B5814CA160CA22096893
+:103590004A6253237F4A4B62156845F02005156047
+:1035A000136803F00703C3F10403237095682D0C1F
+:1035B00005F07F056D1C6570EDB29268C2F30E02D6
+:1035C000521C628092B2521E6A43A2F5A072DA4087
+:1035D0004FF6FF739A422CBFA380A2806F4A1368F4
+:1035E00043F4002313606E4B1D6845F400251D60F5
+:1035F00048BB6548012383704FF0FF3545600023C9
+:10360000624D00260C355FFA83FC182717FB0CFC73
+:103610005B1CDFB205F80C60062FF4DB0623037099
+:10362000886820F48060886000F021F84FF4002161
+:10363000D1600320FEF7FEFFA0680068816841F4B6
+:103640008041816005E0C868410544BF0320FEF762
+:10365000E6FFA1680A68FF205062002203210320D0
+:10366000FEF792FFBDE8F2400320FEF7AABFC8684C
+:1036700000F0800060F49060C8607047F8B50746BD
+:10368000EFF3108472B60320FEF7A6FF404DAE683C
+:103690003068FFF773FF3B46182042494343CA5C3A
+:1036A000022A1BD100213846FFF760FE3648017818
+:1036B00006290ED1306837490A68530500F025F80D
+:1036C00021F480618160C1684A07FCD500F010F8E0
+:1036D00004E04078884218BFFFF78EFEA9680A68A8
+:1036E000FF2050620320FEF76CFF84F31088F1BDC9
+:1036F000C16801F0800161F49061C1604FF4002065
+:10370000254908600320FEF795BF02D5C1684A0726
+:10371000FCD4816870472DE9F04180460F4642464F
+:1037200018201A4942438C18237B022B04BF4046C1
+:10373000FFF7A4FFEFF3108572B60320FEF74CFFEE
+:10374000134EB068FFF719FF02202073A76067606F
+:103750004046FFF7A2FD0C490A784978914202D011
+:10376000FFF74AFE02E0A168081AA060FF20B168D6
+:103770000A6850620320FEF724FF85F31088BDE835
+:10378000F081000028280040C804002068010020C3
+:1037900094040020082800400C0800580008005835
+:1037A000800800587401002010470000464981B08D
+:1037B0000A6802430A60096808400090009801B056
+:1037C0007047000078B585B0044668461421FEF7BE
+:1037D0006DFD0220FFF7EAFF3FA13C4E31F8145087
+:1037E0000095012101910022022102920391694674
+:1037F00056F82400FEF73CFF00F002F806B070BD5A
+:1038000056F8240000222946FEF7E1BF10B500F06B
+:103810000FF8BDE810400122FEF7D9BF10B500F047
+:1038200007F8BDE810400022FEF7D1BF00000000FD
+:1038300029A3264C33F8101054F8200070470000DC
+:1038400030B585B004460D4668461421FEF72EFDBE
+:10385000210008BF042004D0012C18BF022C02D183
+:103860000820FFF7A3FF2900DFF864201CA00ED179
+:1038700030F81410009100230193012102230291DA
+:10388000039300F01BF80120FEF72DFE14E0012D3C
+:1038900012D130F814000F4B00900295019300F004
+:1038A0000DF800BF10A0045D00220F2160B2FEF7EA
+:1038B0006BFE60B2FEF785FE05B030BD694652F87A
+:1038C0002400FEF7D5BE00004C0000583800002050
+:1038D0004400002000002110200001000200000030
+:1038E00010000100020000000A06070000F066BB9D
+:1038F00071487249016001F12002426001F1300318
+:10390000836001F13C02026201F14403C36001F1F2
+:103910004C02026101F16803436101F16C028261B2
+:103920007831C16100F052BB38B50446644D05F1F1
+:10393000100000F0D4F860494868A168016005F102
+:103940001001E268C2608160456000F05BFB5D4889
+:1039500037E080B558494A6813680120187200F0B2
+:1039600057FB002002BD38B5564C554D07E069465F
+:1039700005F1100000F0D5F800982168884705F19E
+:10398000100000F0AFF80028F1D031BD80B54A49F1
+:103990004A68D1680220087200F03FFB002002BD97
+:1039A00048484168084738B50446474D284600F066
+:1039B00096F84149C868A1680160456000F036FB8F
+:1039C00042482168016062684260002032BD80B5D3
+:1039D0003949CA6813681020187200F02DFB0020C6
+:1039E00002BD3549CA68394910680B68184738B5AF
+:1039F000364C354D06E06946284600F092F80098AE
+:103A000061688847284600F06DF80028F3D031BD82
+:103A100038B504462E4D284600F061F82D4800F0D8
+:103A20005EF825480069A1688160E268C2600561AE
+:103A30002168016062684260216941616269826156
+:103A400031BD80B50146234800F055F8BDE802407D
+:103A50000FF2050000F000BB38B5174C1D4D08E013
+:103A60006946284600F05DF800992069006900F079
+:103A700042F8284600F036F80028F1D031BD10B5E4
+:103A8000154C204600F02BF80B4948690460BDE84E
+:103A9000104000F0F5BA1CB50F4C06E06946204610
+:103AA00000F03FF8009800F019F8204600F01AF8EE
+:103AB0000028F3D013BD000000000320B80A032043
+:103AC000980A0320B8040020B00A0320C004002094
+:103AD0003C0B0320B0040020440B0320704700601F
+:103AE00040607047EFF3108172B6026882420CBFEB
+:103AF0000120002012E0EFF3108272B608604368E4
+:103B00004B6041604868016019E0EFF3108172B6C4
+:103B1000436802681A6042680068426081F3108856
+:103B2000704710B5EFF3108472B602680A6000683F
+:103B3000FFE7FFF7EAFF84F3108810BD086082F307
+:103B40001088704710B590B004A8DFF85813DFF85C
+:103B500058433022FFF7AAF92068DFF850430FF2EC
+:103B6000D92200924FF6FC7101EA8001DFF8400390
+:103B70004118E1606846DFF83C13029101F5867157
+:103B800003910FF2CD210191FFF7CEFE012102201A
+:103B9000FFF744FB01210220FFF733FB0020E07018
+:103BA000A07004A800F084FA0FF20512002108208A
+:103BB000FFF71AF9C04A00210120FFF715F90FF2AB
+:103BC0009D0200211020FFF70FF9BC4A00210220BE
+:103BD000FFF70AF9BA4A00210420FFF705F901208E
+:103BE00060700021A16004F11800FFF778FFFEF774
+:103BF00032FC04F1100000216060217001220FF2FC
+:103C0000051304F110010020FDF732FE10B010BDC5
+:103C100080B5A64A917831B1002393700120BDE8A8
+:103C20000240FFF702B9014602F1180008E110B5A1
+:103C30009E4CE07830B90120FFF7F0FD0121E170E2
+:103C4000002105E00120FFF7E1FD0020E0700121E7
+:103C5000BDE810400220FFF7D4BA000038B5EFF3FA
+:103C60001084924D6878012821D100226A7005F1F4
+:103C7000080105F11800FFF754FFE878A0B9A8681B
+:103C80000FF28113017A022972B607BFB0F80B2038
+:103C9000521D827AD21C00F1080192B20020FDF779
+:103CA000F2FD84F3108831BDBDE83140AAE031BD9A
+:103CB00010B5844CB4F809004FF66052811A04D054
+:103CC000491E06D0491E08D00BE0204600F0F8F946
+:103CD00011E0204600F02FFA0DE0204600F050FAE7
+:103CE00009E0A0810E210120A073E0726172212001
+:103CF00020720420A07221467348FFF7FCFEBDE845
+:103D00001040A1E0F8B5694D69682A7800240020C8
+:103D10001AB1022A64D013D358E00978012905D0DA
+:103D2000022907D0102918BF202907D101202870A7
+:103D300003244BE001202870042447E0012445E0DF
+:103D40000E78E868022E11D0102E02D0202E03D05B
+:103D50001CE0CC78C0681BE0CC785A4805F1100113
+:103D600000F108070A6840F8082F18E04068CA7890
+:103D70000979C36802EB012403F10807052205F164
+:103D800010013846FFF792F8052009E0CC7840682A
+:103D9000016805F1100001F108070168396004208D
+:103DA0006F60A1B211B102222A700FE0022E25D05D
+:103DB000102E1DD0202E1ED000210120FFF721F84B
+:103DC000002005F11001287001246960A2B201B041
+:103DD00069683E4BBDE8F04001440020FDF748BD56
+:103DE000087802280AD0102802D0202803D0E3E760
+:103DF00000210220E2E700210820DFE70021042063
+:103E0000DCE7000010B5294CE16801206070096909
+:103E1000A0688A68904205D3C9681144884238BFB7
+:103E2000FFF70FFE04F11800FFF75CFE10B9BDE8C4
+:103E3000104009E010BD000080B50146224800BFD7
+:103E4000FFF759FEBDE8044000211020FEF7D9BF5E
+:103E5000704770B51446144A144E12681D4601236B
+:103E6000B3704FF6FC7303EA8203114AD3180A4673
+:103E7000DE683668A6F80900F17206F10C002146EA
+:103E8000FFF714F800210020FFF7A1FD0120FEF745
+:103E9000D4FF314605F10800B278BDE87040D21C6D
+:103EA000FFF704B8404500083C4000587404002067
+:103EB000000003208408032053390008CF3900088C
+:103EC0008D3900085C0000208C040020053D0008AE
+:103ED00070477047C0680840884201D10120704790
+:103EE00000207047C0690840884201D10120704716
+:103EF0000020704710B5654C02212046FFF7F2FF05
+:103F000038B16068C043810703D5FFF770FD022018
+:103F100018E001212046FFF7E5FF38B16068C04393
+:103F2000C10703D5FFF71FFD01200BE00821204644
+:103F3000FFF7D8FF38B16068C043010703D5FFF72A
+:103F4000AAFD0820A06010BD10B5504C00F033F859
+:103F500018B96068C043810306D400F02CF830B96A
+:103F60006068C043810302D5BDE810406DE00821C0
+:103F700000F022F870B96068C04301030AD5606898
+:103F8000434940F400206060086880474FF40022F5
+:103F9000A26010BD202100F00FF858B96068C0433E
+:103FA000810207D5606840F400106060BDE81040F1
+:103FB000FFF7F6BC10BD022120468BE740BF20BFB3
+:103FC0003448016841F400410160704780B53248CF
+:103FD000016841F480110160006800F480100090D5
+:103FE00000982A48016841F001010160026842F42A
+:103FF000803202602C20FEF7E4FABDE802402D205A
+:10400000FEF7DFBA2548016849084900016070479A
+:1040100023494FF480300860704720484FF4001166
+:104020004160026822F40012026070471B48016878
+:1040300021F002010160704718484FF400314160DF
+:10404000026822F40032026070471448016841F4AB
+:1040500000310160FFF7C5BC38B504460B4D08219F
+:104060002846FFF737FF30B109480460696821F43A
+:104070000021696031BDA0474FF40020A86031BD28
+:104080000648016821F0080101607047000C0058E3
+:10409000D00400200C04005850000058040C0058B4
+:1040A000080C0058FFF7D5FE9DF80E0005B000BDC6
+:1040B000F8B500F10C026B4621214FF66640F1E79E
+:1040C00070B5EFF31081027B012A02D0022A07D0DB
+:1040D0000DE000F028F8137800F01FF814700CE0E1
+:1040E00000F021F8138800F018F8148005E000F0C3
+:1040F0001AF8136800F011F8146081F31088212178
+:104100000E220172427204214FF660528172828146
+:10411000002101228173C27270BD264623EA040485
+:1041200035402C43704772B6D0F81120D0F80D40BE
+:10413000D0F81550704781B0017B012902D00229C7
+:1041400004D007E0D0F80D10097806E0D0F80D1083
+:10415000098802E0D0F80D100968009121220E2193
+:10416000417202724FF661510822818182720021F0
+:1041700001228173C272009940F80F1F01B070478D
+:1041800038B50446212020720E2161724220A072AF
+:104190004FF66251A1810120E0720021A1731D48F8
+:1041A0001D4D0168090CA4F80F100068C0F30B0046
+:1041B000A4F8110019480178194801F01F01E174B1
+:1041C000416821754168090AC4F815100168C4F8EE
+:1041D00019100169C4F81D104169C4F8211004F1D7
+:1041E00029018069C4F82500286802680A600C2249
+:1041F0002B68191D04F12D00FEF758FE29681022C6
+:10420000103104F13900FEF751FE06480168C4F888
+:10421000491031BD002004E0000003200075FF1F9D
+:104220008075FF1F9847000800EB81003D4AD0F8D9
+:104230008010914201D0012070470020704742F465
+:10424000806240F82120704737481F218161026851
+:10425000D208D20042F0030202603448016841F003
+:104260000401016030BF7047704710B5304C00F05A
+:1042700048F80028FBD1042100F044F828B92D4863
+:104280000068010403D500F03FF800F057F8002261
+:1042900003212046FFF7D3FF23480168C908C9005E
+:1042A00041F0020101602148016841F00401016010
+:1042B00030BF10BD10B51E4C00F026F800F021F8FC
+:1042C0000028FBD14FF0B040816801F00C010429B7
+:1042D00011D1016841F48031016001688903FCD586
+:1042E00082689208920042F002028260816801F0C6
+:1042F0000C010829FAD12046BDE810400022032114
+:104300009DE7032120468FE700220421204696E7FF
+:1043100080B500F02DF80548016821F00401016026
+:1043200030BF01BD000400800004005810ED00E023
+:10433000001400588804005800F022B84FF0B04034
+:10434000016841F48071016001684905FCD582680B
+:104350009208920042F001028260416A8908890055
+:104360004162816801F00C010429FAD17047000014
+:104370000248016821F002010160704710E000E08E
+:104380000248016841F002010160704710E000E05E
+:10439000000000000000000000000000000000001D
+:1043A000000000000000000000000000000000000D
+:1043B00000000000000000000000000000000000FD
+:1043C00000000000000000000000000000000000ED
+:1043D00000000000000000000000000000000000DD
+:1043E00000000000000000000000000000000000CD
+:1043F00000000000000000000000000000000000BD
+:1044000000000000000000000000000000000000AC
+:10441000000000000000000000000000000000009C
+:104420000000000000000000010000000300000088
+:10443000050000000100000001000000060000006F
+:104440000A0000002000000002000000040000003C
+:104450000800000010000000400000008000000084
+:104460000001000000020000A0860100400D0300D2
+:10447000801A060000350C0040420F0080841E00A8
+:1044800000093D0000127A000024F40000366E019D
+:104490000048E801006CDC020000000000000000A1
+:1044A00000000000000000007047FEE7FEE7FEE7A6
+:1044B000FEE770477047704700F01EB80548FDF7EB
+:1044C0008EB80548FBF73CBF0448FBF739BF0448EA
+:1044D000FDF785B89003002084020020F801002039
+:1044E000F00300201020FEF777B9FEF7F7BFFFF7C3
+:1044F0002BBDFFF7FFBC000002490A6888688218DC
+:104500000A6070472C00002030B5016884684218AA
+:10451000416802EB5103C9070BD54C4409E012F97D
+:10452000011B12F8015B002904F8015B05D5491C49
+:10453000F9D19A42F3D10C3030BD491EF1D5F8E7DC
+:10454000000000000000000000000000000000006B
+:104550000000000044000800400508013A799C0072
+:10456000F4010000FFFFFFFF480101000000000010
+:1045700080B500F015F802000023DB431068984274
+:1045800004D011000220ABBE002010605068984299
+:1045900004D0111D0220ABBE0020506001BD000000
+:1045A00001487047000000005400002010B5074982
+:1045B00079441831064C7C44163404E00A68081D1E
+:1045C000114488470146A142F8D110BD2C000000DB
+:1045D000500000004EF68851CEF20001086840F409
+:1045E00070000860BFF34F8FBFF36F8F4FF0007004
+:1045F000E1EE100A704700002BD1FFFF800400009D
+:104600005C000020940A0000240003200000000049
+:10461000F9FEFFFF880100005800000004000020A0
+:10462000000000000000000000000000000000008A
+:104630000100000002000000030000000400000070
+:1046400000F00DF8002801D0FFF7B0FFAFF30080B5
+:104650000020AFF30080FDF73AFE00F002F80120E1
+:10466000704700F001B800000746384600F002F835
+:10467000FBE7000080B5FFF77BFF024A110018201E
+:10468000ABBEFBE7260002001143000839430008D7
+:104690006B420008B5420008494200086942000820
+:1046A000014880470148004765280008B1460008D6
+:1046B000AFF30080FFF78EFFFFF7C2FFFFF7FEBFEB
:1046C000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF1E
:1046D000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF0E
:1046E000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFFE
@@ -1144,8 +1144,9 @@
:10476000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF7D
:10477000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF6D
:10478000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF5D
-:1047900000010000EC00F8FFF0000010FD00000137
-:1047A000FC001A0400480004004800040048000807
-:1047B0000048000C0048000C004800093D00F8FFCC
-:04000005080046A900
+:10479000FFF7FEBFFFF7FEBF00010000EC00F8FFCF
+:1047A000F0000010FD000001FC001A0400480004A5
+:1047B00000480004004800080048000C0048000CB5
+:0847C000004800093D00F8FF6C
+:04000005080046B1F8
:00000001FF
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Inc/app_common.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Inc/app_common.h
index 2a1d61089..4defc5d7a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Inc/app_common.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Inc/app_common.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : app_common.h
- * Description : App Common application configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : App Common application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Inc/app_conf.h
index 12ae7a466..ae8c26a96 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Inc/app_conf.h
@@ -1,8 +1,9 @@
/**
******************************************************************************
* File Name : app_conf.h
- * Description : Application configuration file for BLE middleWare.
- ******************************************************************************
+ * Description : Application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
@@ -17,11 +18,12 @@
*/
/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef APP_CONFIG_H
-#define APP_CONFIG_H
+#ifndef APP_CONF_H
+#define APP_CONF_H
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Application Config
@@ -37,6 +39,15 @@
*/
#define CFG_BLE_ERK {0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21,0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21}
+/* USER CODE BEGIN Generic_Parameters */
+/**
+ * SMPS supply
+ * SMPS not used when Set to 0
+ * SMPS used when Set to 1
+ */
+#define CFG_USE_SMPS 1
+/* USER CODE END Generic_Parameters */
+
/**< specific parameters */
/*****************************************************/
#define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI4_IRQHandler
@@ -137,7 +148,7 @@
* 1 : internal RO
* 0 : external crystal ( no calibration )
*/
-#define CFG_BLE_LSE_SOURCE 1
+#define CFG_BLE_LSE_SOURCE 0
/**
* Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
@@ -327,7 +338,6 @@ typedef enum
*/
#define CFG_DEBUG_APP_TRACE 0
-
#if (CFG_DEBUG_APP_TRACE != 0)
#define APP_DBG_MSG PRINT_MESG_DBG
#else
@@ -345,11 +355,6 @@ typedef enum
#define CFG_DEBUGGER_SUPPORTED 1
#endif
-/* USER CODE BEGIN Defines */
-#define CFG_LED_SUPPORTED 1
-#define CFG_BUTTON_SUPPORTED 1
-/* USER CODE END Defines */
-
/**
* When CFG_DEBUG_TRACE_FULL is set to 1, the trace are output with the API name, the file name and the line number
* When CFG_DEBUG_TRACE_LIGHT is set to 1, only the debug message is output
@@ -357,7 +362,7 @@ typedef enum
* When both are set to 0, no trace are output
* When both are set to 1, CFG_DEBUG_TRACE_FULL is selected
*/
-#define CFG_DEBUG_TRACE_LIGHT 1
+#define CFG_DEBUG_TRACE_LIGHT 0
#define CFG_DEBUG_TRACE_FULL 0
#if (( CFG_DEBUG_TRACE != 0 ) && ( CFG_DEBUG_TRACE_LIGHT == 0 ) && (CFG_DEBUG_TRACE_FULL == 0))
@@ -386,6 +391,11 @@ typedef enum
#define DBG_TRACE_MSG_QUEUE_SIZE 4096
#define MAX_DBG_TRACE_MSG_SIZE 1024
+/* USER CODE BEGIN Defines */
+#define CFG_LED_SUPPORTED 1
+#define CFG_BUTTON_SUPPORTED 1
+/* USER CODE END Defines */
+
/******************************************************************************
* Scheduler
******************************************************************************/
@@ -452,6 +462,9 @@ typedef enum
{
CFG_LPM_APP,
CFG_LPM_APP_BLE,
+ /* USER CODE BEGIN CFG_LPM_Id_t */
+
+ /* USER CODE END CFG_LPM_Id_t */
} CFG_LPM_Id_t;
/******************************************************************************
@@ -461,6 +474,6 @@ typedef enum
#define CFG_OTP_END_ADRESS OTP_AREA_END_ADDR
-#endif /*APP_CONFIG_H */
+#endif /*APP_CONF_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Inc/stm32_lpm_if.h
index 38e326512..d8e67947f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Inc/stm32_lpm_if.h
@@ -1,46 +1,22 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file stm32_lpm_if.h
-* @brief Header for stm32_lpm_f.c module (device specific LP management)
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
******************************************************************************
* @attention
*
-* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics International N.V.
+* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted, provided that the following conditions are met:
-*
-* 1. Redistribution of source code must retain the above copyright notice,
-* this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following disclaimer in the documentation
-* and/or other materials provided with the distribution.
-* 3. Neither the name of STMicroelectronics nor the names of other
-* contributors to this software may be used to endorse or promote products
-* derived from this software without specific written permission.
-* 4. This software, including modifications and/or derivative works of this
-* software, must execute solely and exclusively on microcontroller or
-* microprocessor devices manufactured by or for STMicroelectronics.
-* 5. Redistribution and use of this software other than as permitted under
-* this license is void and will automatically terminate your rights under
-* this license.
-*
-* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
-* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
-* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+* This software component is licensed by ST under BSD 3-Clause license,
+* the "License"; You may not use this file except in compliance with the
+* License. You may obtain a copy of the License at:
+* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32_LPM_IF_H
@@ -89,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Inc/stm32wbxx_hal_conf.h
index 5c703f75d..31d63e37a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Inc/stm32wbxx_hal_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Inc/stm32wbxx_hal_conf.h
@@ -58,6 +58,7 @@
#define HAL_UART_MODULE_ENABLED
/*#define HAL_USART_MODULE_ENABLED */
/*#define HAL_WWDG_MODULE_ENABLED */
+#define HAL_EXTI_MODULE_ENABLED
#define HAL_CORTEX_MODULE_ENABLED
#define HAL_DMA_MODULE_ENABLED
#define HAL_FLASH_MODULE_ENABLED
@@ -221,6 +222,10 @@
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32wbxx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32wbxx_hal_flash.h"
@@ -333,9 +338,9 @@
* If expr is true, it returns no value.
* @retval None
*/
-#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
+ #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
/* Exported functions ------------------------------------------------------- */
-void assert_failed(uint8_t* file, uint32_t line);
+ void assert_failed(uint8_t* file, uint32_t line);
#else
#define assert_param(expr) ((void)0U)
#endif /* USE_FULL_ASSERT */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Inc/utilities_conf.h
index c98d97ba1..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Inc/utilities_conf.h
@@ -1,3 +1,4 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* File Name : utilities_conf.h
@@ -9,13 +10,14 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef UTILITIES_CONF_H
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/app_entry.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/app_entry.c
index b48774303..bc9ca9496 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/app_entry.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/app_entry.c
@@ -76,6 +76,7 @@ static void Init_Debug( void );
static void appe_Tl_Init( void );
static void APPE_SysUserEvtRx( TL_EvtPacket_t * p_evt_rx );
static void shci_user_evt_proc( void );
+
#if (CFG_HW_LPUART1_ENABLED == 1)
extern void MX_LPUART1_UART_Init(void);
#endif
@@ -113,7 +114,7 @@ void APPE_Init( void )
/**
* From now, the application is waiting for the ready event ( VS_HCI_C2_Ready )
- * received on the system channel before starting the BLE Stack
+ * received on the system channel before starting the Stack
* This system event is received with APPE_SysUserEvtRx()
*/
/* USER CODE BEGIN APPE_Init_2 */
@@ -228,8 +229,6 @@ static void appe_Tl_Init( void )
return;
}
-
-
static void APPE_SysUserEvtRx( TL_EvtPacket_t * p_evt_rx )
{
LST_insert_tail (&SysEvtQueue, (tListNode *)p_evt_rx);
@@ -304,7 +303,6 @@ void UTIL_SEQ_Idle( void )
return;
}
-
/**
* @brief This function is called by the scheduler each time an event
* is pending.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/hw_timerserver.c
index 52a1bfa0d..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/hw_timerserver.c
@@ -1,22 +1,21 @@
/**
******************************************************************************
- * File Name : hw_timerserver.c
- * Description : Hardware timerserver source file for BLE
- * middleWare.
+ * File Name : hw_timerserver.c
+ * Description : Hardware timerserver source file for STM32WPAN Middleware.
+ *
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/hw_uart.c
index 52e9e2b3a..9a553610d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/hw_uart.c
@@ -1,7 +1,7 @@
/**
******************************************************************************
* File Name : Src/hw_uart.c
- * Description : HW UART source file for BLE middleWare.
+ * Description : HW UART source file for STM32WPAN Middleware.
*
******************************************************************************
* @attention
@@ -48,7 +48,7 @@ extern UART_HandleTypeDef huart1;
hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
} while(0)
- /* Variables ------------------------------------------------------------------*/
+/* Variables -----------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
@@ -65,73 +65,73 @@ extern UART_HandleTypeDef huart1;
void (*HW_hlpuart1TxCb)(void);
#endif
- void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_RX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_RX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_RX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_RX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ return;
+}
+
+void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
{
- HAL_StatusTypeDef hal_status = HAL_OK;
- hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
+ default:
+ break;
}
switch (hal_status)
@@ -161,8 +161,8 @@ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t
hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
{
-HAL_StatusTypeDef hal_status = HAL_OK;
-hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
@@ -250,33 +250,33 @@ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
switch ((uint32_t)huart->Instance)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1RxCb)
- {
- HW_huart1RxCb();
- }
- break;
+ if(HW_huart1RxCb)
+ {
+ HW_huart1RxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1RxCb)
- {
- HW_hlpuart1RxCb();
- }
- break;
+ if(HW_hlpuart1RxCb)
+ {
+ HW_hlpuart1RxCb();
+ }
+ break;
#endif
default:
@@ -292,20 +292,20 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1TxCb)
- {
- HW_huart1TxCb();
- }
- break;
+ if(HW_huart1TxCb)
+ {
+ HW_huart1TxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1TxCb)
- {
- HW_hlpuart1TxCb();
- }
- break;
+ if(HW_hlpuart1TxCb)
+ {
+ HW_hlpuart1TxCb();
+ }
+ break;
#endif
default:
@@ -315,4 +315,4 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
return;
}
- /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/main.c
index 89612d53b..72d282bcf 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/main.c
@@ -41,10 +41,10 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "app_entry.h"
+#include "app_common.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
-#include "app_common.h"
#include "stm32_lpm.h"
#include "stm32_seq.h"
#include "dbg_trace.h"
@@ -110,6 +110,7 @@ int main(void)
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
+
/* MCU Configuration--------------------------------------------------------*/
@@ -137,6 +138,8 @@ int main(void)
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
+
+ /* Init code for STM32_WPAN */
APPE_Init();
/* Infinite loop */
@@ -161,17 +164,20 @@ void SystemClock_Config(void)
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
+ /** Configure LSE Drive Capability
+ */
+ __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
/** Configure the main internal regulator output voltage
*/
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
/** Initializes the CPU, AHB and APB busses clocks
*/
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSI1
- |RCC_OSCILLATORTYPE_HSE;
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE
+ |RCC_OSCILLATORTYPE_LSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ RCC_OscInitStruct.LSEState = RCC_LSE_ON;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
- RCC_OscInitStruct.LSIState = RCC_LSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
@@ -200,8 +206,8 @@ void SystemClock_Config(void)
|RCC_PERIPHCLK_LPUART1;
PeriphClkInitStruct.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2;
PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1;
- PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI;
- PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSI;
+ PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
+ PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSE;
PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSE;
PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE0;
@@ -357,7 +363,13 @@ static void MX_RTC_Init(void)
Error_Handler();
}
/* USER CODE BEGIN RTC_Init 2 */
- MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* Disable RTC registers write protection */
+ LL_RTC_DisableWriteProtection(RTC);
+
+ LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER);
+
+ /* Enable RTC registers write protection */
+ LL_RTC_EnableWriteProtection(RTC);
/* USER CODE END RTC_Init 2 */
}
@@ -367,6 +379,7 @@ static void MX_RTC_Init(void)
*/
static void MX_DMA_Init(void)
{
+
/* DMA controller clock enable */
__HAL_RCC_DMAMUX1_CLK_ENABLE();
__HAL_RCC_DMA2_CLK_ENABLE();
@@ -404,7 +417,13 @@ void PeriphClock_Config(void)
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
- LL_RCC_HSI48_Enable();
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
+ LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -437,30 +456,6 @@ void PeriphClock_Config(void)
HAL_RCCEx_CRSConfig(&RCC_CRSInitStruct);
#endif
- /**
- * Select LSE clock
- */
- LL_RCC_LSE_Enable();
- while(!LL_RCC_LSE_IsReady());
-
- /**
- * Select wakeup source of BLE RF
- */
- LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
-
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
/*************************************************************
@@ -567,21 +562,33 @@ static void Init_Exti( void )
* WRAP FUNCTIONS
*
*************************************************************/
-
-/**
- * This function is empty to avoid starting the SysTick Timer
- */
-HAL_StatusTypeDef HAL_InitTick( uint32_t TickPriority )
+void HAL_Delay(uint32_t Delay)
{
- return (HAL_OK);
-}
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
-/**
- * This function is empty as the SysTick Timer is not used
- */
-void HAL_Delay(__IO uint32_t Delay)
-{
- return;
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
}
/* USER CODE END 4 */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/stm32_lpm_if.c
index b0018ac58..f705150a1 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -61,7 +61,6 @@ static void Switch_On_HSI( void );
/* USER CODE END Private_Variables */
-/* Functions Definition ------------------------------------------------------*/
/**
* @brief Enters Low Power Off Mode
* @param none
@@ -214,6 +213,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +242,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +262,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/stm32wbxx_hal_msp.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/stm32wbxx_hal_msp.c
index c6a106fa7..c901df1a4 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/stm32wbxx_hal_msp.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/stm32wbxx_hal_msp.c
@@ -5,45 +5,15 @@
* Description : This file provides code for the MSP Initialization
* and de-Initialization codes.
******************************************************************************
- * This notice applies to any and all portions of this file
- * that are not between comment pairs USER CODE BEGIN and
- * USER CODE END. Other portions of this file, whether
- * inserted by the user or by software development tools
- * are owned by their respective copyright owners.
+ * @attention
*
- * Copyright (c) 2019 STMicroelectronics International N.V.
- * All rights reserved.
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted, provided that the following conditions are met:
- *
- * 1. Redistribution of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of other
- * contributors to this software may be used to endorse or promote products
- * derived from this software without specific written permission.
- * 4. This software, including modifications and/or derivative works of this
- * software, must execute solely and exclusively on microcontroller or
- * microprocessor devices manufactured by or for STMicroelectronics.
- * 5. Redistribution and use of this software other than as permitted under
- * this license is void and will automatically terminate your rights under
- * this license.
- *
- * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
- * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
- * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
*
******************************************************************************
*/
@@ -186,13 +156,13 @@ void HAL_UART_MspInit(UART_HandleTypeDef* huart)
PB6 ------> USART1_TX
PB7 ------> USART1_RX
*/
- GPIO_InitStruct.Pin = GPIO_PIN_11;
+ /* GPIO_InitStruct.Pin = GPIO_PIN_11;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
+*/
GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_PULLUP;
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/stm32wbxx_it.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/stm32wbxx_it.c
index a7303c94a..f06353d51 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/stm32wbxx_it.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/Core/Src/stm32wbxx_it.c
@@ -60,21 +60,10 @@
/* USER CODE END 0 */
/* External variables --------------------------------------------------------*/
-
-
-
extern DMA_HandleTypeDef hdma_lpuart1_tx;
-
-
extern DMA_HandleTypeDef hdma_usart1_tx;
-
-
extern UART_HandleTypeDef hlpuart1;
-
-
extern UART_HandleTypeDef huart1;
-
-
/* USER CODE BEGIN EV */
/* USER CODE END EV */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/STM32_WPAN/App/ble_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/STM32_WPAN/App/ble_conf.h
index d01420613..ec2d0e166 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/STM32_WPAN/App/ble_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/STM32_WPAN/App/ble_conf.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : App/ble_conf.h
- * Description : Configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : Configuration file for BLE Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
@@ -49,7 +49,7 @@
* This shall take into account all registered handlers
* (from either the provided services or the custom services)
*/
-#define BLE_CFG_SVC_MAX_NBR_CB 5
+#define BLE_CFG_SVC_MAX_NBR_CB 7
#define BLE_CFG_CLT_MAX_NBR_CB 0
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/STM32_WPAN/App/ble_dbg_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/STM32_WPAN/App/ble_dbg_conf.h
index 9b0dec37b..1f9b21135 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/STM32_WPAN/App/ble_dbg_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/STM32_WPAN/App/ble_dbg_conf.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : App/ble_dbg_conf.h
- * Description : Debug configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : Debug configuration file for BLE Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/STM32_WPAN/App/tm.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/STM32_WPAN/App/tm.c
index 2a36cd0b0..f16c24684 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/STM32_WPAN/App/tm.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_TransparentMode/STM32_WPAN/App/tm.c
@@ -285,7 +285,7 @@ static void TM_SysLocalCmd ( void )
((TL_CcEvt_t *)(((TL_EvtPacket_t*)&SysLocalCmd)->evtserial.evt.payload))->cmdcode = SysLocalCmd.cmdserial.cmd.cmdcode;
((TL_CcEvt_t *)(((TL_EvtPacket_t*)&SysLocalCmd)->evtserial.evt.payload))->payload[0] = 0x01;
((TL_CcEvt_t *)(((TL_EvtPacket_t*)&SysLocalCmd)->evtserial.evt.payload))->numcmd = 1;
- ((TL_EvtPacket_t*)&SysLocalCmd)->evtserial.type = TL_BLEEVT_PKT_TYPE;
+ ((TL_EvtPacket_t*)&SysLocalCmd)->evtserial.type = TL_LOCRSP_PKT_TYPE;
((TL_EvtPacket_t*)&SysLocalCmd)->evtserial.evt.evtcode = TL_BLEEVT_CC_OPCODE;
((TL_EvtPacket_t*)&SysLocalCmd)->evtserial.evt.plen = TL_EVT_CS_PAYLOAD_SIZE;
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/BLE_p2pClient.ioc b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/BLE_p2pClient.ioc
index 02263ad43..9163b7c63 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/BLE_p2pClient.ioc
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/BLE_p2pClient.ioc
@@ -73,27 +73,29 @@ Mcu.IP9=SYS
Mcu.IPNb=12
Mcu.Name=STM32WB55RGVx
Mcu.Package=VFQFPN68
-Mcu.Pin0=PA2
-Mcu.Pin1=PA3
-Mcu.Pin10=VP_RTC_VS_RTC_Activate
-Mcu.Pin11=VP_SEQUENCER_VS_SEQUENCER
-Mcu.Pin12=VP_STM32_WPAN_VS_BLE_HOST
-Mcu.Pin13=VP_SYS_VS_Systick
-Mcu.Pin14=VP_TINY_LPM_VS_TINY_LPM
-Mcu.Pin2=PA6
-Mcu.Pin3=RF1
-Mcu.Pin4=OSC_OUT
-Mcu.Pin5=OSC_IN
-Mcu.Pin6=PA11
-Mcu.Pin7=PB6
-Mcu.Pin8=PB7
-Mcu.Pin9=VP_HSEM_VS_HSEM
-Mcu.PinsNb=15
+Mcu.Pin0=PC14-OSC32_IN
+Mcu.Pin1=PC15-OSC32_OUT
+Mcu.Pin10=PB7
+Mcu.Pin11=VP_HSEM_VS_HSEM
+Mcu.Pin12=VP_RTC_VS_RTC_Activate
+Mcu.Pin13=VP_SEQUENCER_VS_SEQUENCER
+Mcu.Pin14=VP_STM32_WPAN_VS_BLE_HOST
+Mcu.Pin15=VP_SYS_VS_Systick
+Mcu.Pin16=VP_TINY_LPM_VS_TINY_LPM
+Mcu.Pin2=PA2
+Mcu.Pin3=PA3
+Mcu.Pin4=PA6
+Mcu.Pin5=RF1
+Mcu.Pin6=OSC_OUT
+Mcu.Pin7=OSC_IN
+Mcu.Pin8=PA11
+Mcu.Pin9=PB6
+Mcu.PinsNb=17
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32WB55RGVx
-MxCube.Version=5.3.0
-MxDb.Version=DB.5.0.30
+MxCube.Version=5.4.0
+MxDb.Version=DB.5.0.40
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false
NVIC.DMA1_Channel4_IRQn=true\:15\:0\:true\:false\:true\:false\:true
NVIC.DMA2_Channel4_IRQn=true\:15\:0\:true\:false\:true\:false\:true
@@ -146,6 +148,10 @@ PB7.GPIO_Speed=GPIO_SPEED_FREQ_VERY_HIGH
PB7.Locked=true
PB7.Mode=Asynchronous
PB7.Signal=USART1_RX
+PC14-OSC32_IN.Mode=LSE-External-Oscillator
+PC14-OSC32_IN.Signal=RCC_OSC32_IN
+PC15-OSC32_OUT.Mode=LSE-External-Oscillator
+PC15-OSC32_OUT.Signal=RCC_OSC32_OUT
PCC.Ble.ConnectionInterval=1000.0
PCC.Ble.DataLength=6
PCC.Ble.Mode=Advertising
@@ -168,7 +174,7 @@ ProjectManager.DeletePrevious=true
ProjectManager.DeviceId=STM32WB55RGVx
ProjectManager.FreePins=false
ProjectManager.HalAssertFull=false
-ProjectManager.HeapSize=0x200
+ProjectManager.HeapSize=0x400
ProjectManager.KeepUserCode=true
ProjectManager.LastFirmware=true
ProjectManager.LibraryCopy=2
@@ -178,11 +184,11 @@ ProjectManager.PreviousToolchain=
ProjectManager.ProjectBuild=false
ProjectManager.ProjectFileName=BLE_p2pClient.ioc
ProjectManager.ProjectName=BLE_p2pClient
-ProjectManager.StackSize=0x400
+ProjectManager.StackSize=0x1000
ProjectManager.TargetToolchain=EWARM V8
ProjectManager.ToolChainLocation=
ProjectManager.UnderRoot=false
-ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-SystemClock_Config-RCC-false-HAL-false,4-MX_LPUART1_UART_Init-LPUART1-true-HAL-false,5-MX_USART1_UART_Init-USART1-true-HAL-false,6-MX_RF_Init-RF-false-HAL-true,7-MX_RTC_Init-RTC-false-HAL-true,8-MX_STM32_WPAN_Init-STM32_WPAN-false-HAL-true
+ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-SystemClock_Config-RCC-false-HAL-false,4-MX_LPUART1_UART_Init-LPUART1-true-HAL-false,5-MX_USART1_UART_Init-USART1-true-HAL-false,6-MX_RF_Init-RF-false-HAL-true,7-MX_RTC_Init-RTC-false-HAL-true,8-APPE_Init-STM32_WPAN-false-HAL-false
RCC.ADCFreq_Value=64000000
RCC.AHBFreq_Value=32000000
RCC.APB1Freq_Value=32000000
@@ -204,12 +210,12 @@ RCC.HSI48_VALUE=48000000
RCC.HSI_VALUE=16000000
RCC.I2C1Freq_Value=32000000
RCC.I2C3Freq_Value=32000000
-RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSE_VALUE,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PLLSourceVirtual,PWRFreq_Value,RNGFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LCDFreq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PLLSourceVirtual,PWRFreq_Value,RFWKPClockSelection,RFWKPFreq_Value,RNGFreq_Value,RTCClockSelection,RTCFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.LCDFreq_Value=32768
RCC.LPTIM1Freq_Value=32000000
RCC.LPTIM2Freq_Value=32000000
RCC.LPUART1Freq_Value=32000000
RCC.LSCOPinFreq_Value=32000
-RCC.LSE_VALUE=32768
RCC.LSI_VALUE=32000
RCC.MCO1PinFreq_Value=32000000
RCC.PLLPoutputFreq_Value=64000000
@@ -220,7 +226,11 @@ RCC.PLLSAI1QoutputFreq_Value=64000000
RCC.PLLSAI1RoutputFreq_Value=64000000
RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSI
RCC.PWRFreq_Value=32000000
+RCC.RFWKPClockSelection=RCC_RFWKPCLKSOURCE_LSE
+RCC.RFWKPFreq_Value=32768
RCC.RNGFreq_Value=32000
+RCC.RTCClockSelection=RCC_RTCCLKSOURCE_LSE
+RCC.RTCFreq_Value=32768
RCC.SAI1Freq_Value=64000000
RCC.SMPS1Freq_Value=16000000
RCC.SYSCLKFreq_VALUE=32000000
@@ -232,17 +242,14 @@ RCC.VCOOutputFreq_Value=128000000
RCC.VCOSAI1OutputFreq_Value=128000000
RF1.Mode=RF1_Activate
RF1.Signal=RF_RF1
-RTC.AsynchPrediv=CFG_RTC_ASYNCH_PRESCALER
-RTC.HourFormat=RTC_HOURFORMAT_24
-RTC.IPParameters=HourFormat,AsynchPrediv,SynchPrediv
-RTC.IPParametersWithoutCheck=AsynchPrediv,SynchPrediv
-RTC.SynchPrediv=CFG_RTC_SYNCH_PRESCALER
STM32_WPAN.BLE_APPLICATION_TYPE=BLE_CLIENT_PROFILE
STM32_WPAN.BLE_CFG_CLT_MAX_NBR_CB=1
STM32_WPAN.CFG_ADV_BD_ADDRESS=0x7257acd87a6c
STM32_WPAN.CFG_DEBUGGER_SUPPORTED=1
-STM32_WPAN.CFG_DEBUG_APP_TRACE=0
-STM32_WPAN.CFG_DEBUG_BLE_TRACE=0
+STM32_WPAN.CFG_DEBUG_APP_TRACE=1
+STM32_WPAN.CFG_DEBUG_BLE_TRACE=1
+STM32_WPAN.CFG_DEBUG_TRACE_LIGHT=1
+STM32_WPAN.CFG_DEBUG_TRACE_UART=hw_uart1
STM32_WPAN.CFG_FAST_CONN_ADV_INTERVAL_MAX_HEXA=0x0
STM32_WPAN.CFG_FAST_CONN_ADV_INTERVAL_MIN_HEXA=0x0
STM32_WPAN.CFG_HW_LPUART1_DMA_TX_SUPPORTED=0
@@ -262,7 +269,7 @@ STM32_WPAN.CFG_MITM_PROTECTION=CFG_MITM_PROTECTION_REQUIRED
STM32_WPAN.CFG_RTCCLK_DIVIDER_CONF=0
STM32_WPAN.CUSTOM_P2P_CLIENT=Enabled
STM32_WPAN.DBG_TRACE_UART_CFG=hw_uart1
-STM32_WPAN.IPParameters=P2P_SERVER_NUMBER,CFG_FAST_CONN_ADV_INTERVAL_MAX_HEXA,CFG_LP_CONN_ADV_INTERVAL_MAX_HEXA,LOCAL_NAME_FORMATTED,CFG_HW_LPUART1_ENABLED,CFG_DEBUG_BLE_TRACE,CFG_DEBUG_APP_TRACE,DBG_TRACE_UART_CFG,CFG_ADV_BD_ADDRESS,CFG_LP_CONN_ADV_INTERVAL_MAX,CFG_LP_CONN_ADV_INTERVAL_MIN,CFG_HW_LPUART1_DMA_TX_SUPPORTED,LOCAL_NAME,CFG_HW_USART1_ENABLED,CFG_LPM_SUPPORTED,L2CAP_REQUEST_NEW_CONN_PARAM,BLE_APPLICATION_TYPE,CFG_FAST_CONN_ADV_INTERVAL_MIN_HEXA,CUSTOM_P2P_CLIENT,BLE_CFG_CLT_MAX_NBR_CB,CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO,CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION,CFG_HW_RESET_BY_FW,CFG_DEBUGGER_SUPPORTED,CFG_IO_CAPABILITY,CFG_MITM_PROTECTION,CFG_RTCCLK_DIVIDER_CONF
+STM32_WPAN.IPParameters=P2P_SERVER_NUMBER,CFG_FAST_CONN_ADV_INTERVAL_MAX_HEXA,CFG_LP_CONN_ADV_INTERVAL_MAX_HEXA,LOCAL_NAME_FORMATTED,CFG_HW_LPUART1_ENABLED,CFG_DEBUG_BLE_TRACE,CFG_DEBUG_APP_TRACE,DBG_TRACE_UART_CFG,CFG_ADV_BD_ADDRESS,CFG_LP_CONN_ADV_INTERVAL_MAX,CFG_LP_CONN_ADV_INTERVAL_MIN,CFG_HW_LPUART1_DMA_TX_SUPPORTED,LOCAL_NAME,CFG_HW_USART1_ENABLED,CFG_LPM_SUPPORTED,L2CAP_REQUEST_NEW_CONN_PARAM,BLE_APPLICATION_TYPE,CFG_FAST_CONN_ADV_INTERVAL_MIN_HEXA,CUSTOM_P2P_CLIENT,BLE_CFG_CLT_MAX_NBR_CB,CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO,CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION,CFG_HW_RESET_BY_FW,CFG_DEBUGGER_SUPPORTED,CFG_IO_CAPABILITY,CFG_MITM_PROTECTION,CFG_RTCCLK_DIVIDER_CONF,CFG_DEBUG_TRACE_UART,CFG_DEBUG_TRACE_LIGHT
STM32_WPAN.IPParametersWithoutCheck=CFG_LP_CONN_ADV_INTERVAL_MAX,CFG_LP_CONN_ADV_INTERVAL_MIN
STM32_WPAN.L2CAP_REQUEST_NEW_CONN_PARAM=1
STM32_WPAN.LOCAL_NAME=P2PSRV1
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Binary/BLE_p2pClient_reference.hex b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Binary/BLE_p2pClient_reference.hex
index ca4e07a4a..fdb577499 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Binary/BLE_p2pClient_reference.hex
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Binary/BLE_p2pClient_reference.hex
@@ -1,1970 +1,1970 @@
:020000040800F2
-:10000000C8270020B57A0008ED780008EF780008CE
-:10001000F1780008F3780008F57800080000000087
-:10002000000000000000000000000000F778000859
-:10003000F978000800000000FB780008FD7800084F
-:10004000D77A0008DB7A0008DF7A00082F790008E9
-:10005000E37A0008E77A0008EB7A0008EF7A0008F4
-:10006000F37A0008F77A000829790008FB7A00087B
-:10007000FF7A0008037B000801790008077B00086D
-:100080000B7B00080F7B0008137B0008177B000820
-:100090001B7B00081F7B0008237B0008277B0008D0
-:1000A0002B7B00082F7B0008337B0008377B000880
-:1000B0003B7B00083F7B0008437B0008477B000830
-:1000C0004B7B00084F7B0008537B0008577B0008E0
-:1000D000077900080D7900085B7B00085F7B00084A
-:1000E000637B0008677B00086B7B00086F7B000860
-:1000F0003779000833790008737B0008777B0008A4
-:100100007B7B00087F7B0008837B0008877B0008DF
-:100110008B7B00088F7B0008937B0008977B00088F
-:100120009B7B00089F7B000813790008A37B0008D5
-:10013000A77B0008AB7B0008AF7B00082DE9F84FD8
-:100140000FF2D017A2B0D7E90045CDE900452C9EAB
-:10015000DFF82C7C04918DF8436000210FF2BC1471
-:100160000D9112944FF0FF368246904699460FE06B
-:10017000C3462C461BF8011B0498D0470028049066
-:1001800000F0B2800D98401C641E0D90F2D1A8447E
-:1001900098F80000252807D10021079108910991BE
-:1001A0000A910B910C910DE06A463146404600F0F1
-:1001B000FDFF050001D10D98B4E0D9D50125E6E792
-:1001C00041F0010118F8010F2028F9D023280CD0A4
-:1001D0002B2804D02D2805D0302809D086E041F006
-:1001E0000201EFE741F00401ECE741F00801E9E723
-:1001F00041F01001E6E700200F900AE00F98B842A6
-:1002000005DA00EB800302EB4302303A0F9208F16B
-:10021000010898F80020A2F130000A28EED398F8DF
-:1002200000002E2818BF0E9629D118F8010F2A2891
-:100230000BD1D9F80000C9F8000008F1010850F806
-:10024000042BC9F800000E9219E02D280CBF18F8F5
-:10025000010B002000220E920BE040B90E9ABA4228
-:1002600005DA02EB820403EB4403303B0E9308F102
-:10027000010898F80030A3F130020A2AEDD3ADF856
-:100280004010129898F8001000F09CFF08B118F880
-:10029000010B8DF842009DF84200682804BF98F8D1
-:1002A0000010682903D162208DF8420008E06C2814
-:1002B00004BF98F800006C2804D171218DF8421019
-:1002C00008F1010813A806904A4618F8013B02A954
-:1002D000504600F067F838B913AA02A9504600F05A
-:1002E000C9F900287FF554AF30461BE02A2882D197
-:1002F000D9F80020C9F8002052F8040BC9F80020F2
-:1003000000280F9003D540420F9041F0040108F1FE
-:10031000010884E70000000000000000686A6C74B7
-:100320007A4C000023B0BDE8F08F622820D0682806
-:1003300011D06A2803D06C2827D0712825D10868ED
-:10034000C01D20F007000860D0E9002308300860D5
-:10035000194610467047002A0A680A60106803D0E0
-:10036000121D0A6000B217E0121D0A6080B217E089
-:10037000002A0A680A60106803D0121D0A6040B2A1
-:100380000AE0121D0A60C0B20AE0002A0A680A6088
-:10039000106803D0121D0A60C1177047121D0A6051
-:1003A000002170477CB50D4611461C462E69B4F1FC
-:1003B000250200F04D811C3A00F08680121F022AAF
-:1003C00040F282800E3A00F00781521F5AD0093A5B
-:1003D0007AD0921E16D0521E35D0521E022A73D9E0
-:1003E000121F30D0521F00F09A80521E4AD0521E67
-:1003F00000F0E480D21E00F0FD80921E42D0D21E9A
-:1004000040D02BE195F83A206C2A09D06869421C4B
-:100410006A610A680A6052F8043B0A60335427E1B3
-:100420000A680A6052F8043B0A60002100930191B7
-:100430004FF0FF322A6329466A4600F096F90028F9
-:1004400040F1168101E195F83A000122FFF76DFFB6
-:10045000C5E900010023994204DA6869411C696119
-:100460002D210DE0288F810704D56869411C696141
-:100470002B2105E0C00722D56869411C6961202154
-:1004800031541CE095F83A000022FFF74EFFC5E911
-:10049000000195F83800010711D5D5E900230020A7
-:1004A000834208BF82420AD044F02000782806D157
-:1004B000686930213154401C411C69613454214623
-:1004C00068693044E86083E00868C01D20F00700D8
-:1004D0000860D0E9002308300860C5E90023D5E9A9
-:1004E0000001C80F04D06869411C69612D210DE02D
-:1004F000288F810704D56869411C69612B2105E0BB
-:10050000C00704D56869411C6961202131546869BC
-:100510003044E8602146284600F032FAA8E005F1B0
-:100520003A02507820B14FF0FF340FF6243070E0DB
-:100530001078622808D0682824D06A2812D06C2845
-:100540002ED071280ED02BE00A680A6052F8040BF6
-:100550000A6020B94FF0FF340FF60C3059E0E96A19
-:10056000017085E00A680A6052F8040B0A6020B93D
-:100570004FF0FF340FF6F0204BE0EA6AD317C0E9E2
-:10058000002375E00A680A6052F8040B0A6020B97B
-:100590004FF0FF340FF6D0203BE0E96A018067E0BE
-:1005A0000A680A6052F8040B0A6020B94FF0FF3461
-:1005B0000FF6B4202DE0E96A016059E00A680A608C
-:1005C00052F8040B0A600021C5E90001EE607821B1
-:1005D000284600F029F94BE06C2285F83A200B6898
-:1005E0000B6053F8042B0B6052BB4FF0FF340FF637
-:1005F000AC200EE095F83A206C2AF0D0086808602C
-:1006000050F8044B0860EC603CB94FF0FF340FF633
-:10061000702000F0F1FD201A76BD2E6B002E04D55F
-:10062000204600F00BFE044608E03246002120463A
-:1006300000F020FE002814BF041B3446AC6117E014
-:10064000294600F092F8002812D54FF0FF3076BD11
-:100650006869411C69612521315409E06969481CB8
-:10066000686125227254210002D0411C6961345412
-:10067000002076BD2DE9F0410E460546716B70698C
-:10068000B46A091A306A091AB069091A706A091A33
-:10069000F069091A96F838000C1B410790460DD4F2
-:1006A000002C0BDD2746B0682021A8470028B06049
-:1006B00057D0F06A401C7F1EF062F4D17369424645
-:1006C0003146284600F0ACFC00284AD1376A002F9A
-:1006D0000ADDB0683021A8470028B06041D0F06A38
-:1006E000401C7F1EF062F4D1B369F268314628469F
-:1006F00000F096FCA8BB776A002F09DDB0683021B6
-:10070000A847B06068B3F06A401C7F1EF062F5D164
-:10071000F068B169F36942183146284600F080FC60
-:10072000F8B9B76A002F09DDB0683021A847B0607A
-:10073000B8B1F06A401C7F1EF062F5D196F838001F
-:1007400041070BD5002C09DDB0682021A847B06017
-:1007500038B1F06A401C641EF062F5D10020BDE89B
-:10076000F0814FF0FF30BDE8F0812DE9F8470D46EC
-:10077000A3B02F6B002F8146904648BF6FF0004713
-:1007800000F0A4FD696B40180FF62C118128D1E907
-:100790000023CDE9012328BF4FF0FF303ED20024D3
-:1007A000002F2FDDD8F8001001AA684600F000FDE8
-:1007B0000646002E35D4D8F8000008B9761E30D48D
-:1007C000B7421FDB6869301881280AD300206863AC
-:1007D00003AA29464846FFF74DFF040012D4002023
-:1007E000686103A8D5F814A032466946504400F069
-:1007F00073FDB244C5F814A058F8040B002818BFC4
-:10080000BF1BCDD12CB903AA29464846FFF732FFBA
-:10081000044614B9002068616863204624B0BDE82E
-:10082000F0874FF0FF34F8E72DE9FC4707468A468A
-:100830003E69BAF16F0F08BF082405D04AF02001C5
-:10084000782914BF0A2410243C25D7E90023BAF1E3
-:10085000640F18BFBAF1690F9046994606D100217E
-:100860008B4203DAD8F1000869EB49090020814581
-:1008700008BF80451FD1386BE8B9082C4CD197F8D8
-:100880003800010748D530203B2586F83B0043E07F
-:1008900000280ED597F8380000F01400102808D171
-:1008A0007A6B7869121A386A121A511A0029C8BF6D
-:1008B0003962BDE8F3878DF800A0404649462246DC
-:1008C000E31700F05DFD3032D0B26D1E3A2801957D
-:1008D00004DB9DF80000A0F151018A1872554046D2
-:1008E00049462246E31700F04BFD8046894600202A
-:1008F000814508BF804503D0F86871198842DCD370
-:10090000082C09D197F83800010705D5715D302909
-:1009100002D06D1E30207055C5F13C01B9617019CF
-:10092000F860386B8142B3DA411A39624FF6EF70E2
-:10093000398F01403987BDE8F3872DE9D04306465A
-:100940000F4614464FF00008DFF8389412E0E00735
-:1009500007D542464B463046394600F029FE06464A
-:100960000F464046494642464B4600F021FE641081
-:1009700080468946002CEAD130463946BDE8D0830E
-:100980002DE9F34F054641F020048DB0D5E90089EB
-:10099000612C02AE09D0286B002848BF062003D482
-:1009A00008BF672C01D101202863D5E90023580036
-:1009B0004015401C0ED119030CD00320A8619DF8EE
-:1009C000380061381A2802D20FF2F46111E00FF2F8
-:1009D000F4610EE058004015401C0FD119030DD1F1
-:1009E0000320A8619DF8380061381A2814D30FF24B
-:1009F000DC61E868032200F06FFCD3E1194621F0C6
-:100A00000043B3F5801F10460DD20027BB4208BF3C
-:100A1000BA42019703D111E00FF2AC61E9E701AAF4
-:100A200000F098FE0AE0DFF8607307EB1352DFF87E
-:100A30005C3301921940DFF858331943C5E90001CE
-:100A4000612C0ED1E86830210170811CE9609DF8AD
-:100A5000381061290CBF7821582141706869801CC9
-:100A60006861D5E900AB2BF0004300202AF00002BA
-:100A7000834204BF8242002300F05A81612C40F07F
-:100A8000A980286B00284CBF2120401C00904046C4
-:100A9000009F7F1C49460022002300F093FED946A8
-:100AA00001988DF8082038BF89F00049001F019097
-:100AB000002FD0460DF1090040F3498140F2FF714B
-:100AC000DFF8D0B20C91064640464946002200238A
-:100AD00000F090FE80F03A814800400D00F11C02C9
-:100AE00010D0002A0EDD0C98824205DB09F0004090
-:100AF00040EA0B01002013E0A448084040EA0251FC
-:100B000040460DE029F00043002028F00002834217
-:100B100008BF82420FBF40461C22404600F082FEC2
-:100B20008046894600F01CFFFF1F002F044609DDA8
-:100B300000F034FF02460B464046494600F040FFB5
-:100B400080468946F01D072104E004F00F0200F8FA
-:100B5000012D2411002C01DD491EF6D5491E5CBF74
-:100B6000002200F8012DF9D5ECE00020194602AA78
-:100B70000A4400E05B1E12F80149491E8442F9D084
-:100B80000F2804D10DF10900425C521C4254002987
-:100B900004D50198001D02AE5B1C0190591E12D4B1
-:100BA0009DF838007218147804F130085FFA88F460
-:100BB000392CC4BFA0F13A04A044491E02F80189AF
-:100BC000F1D58DF83800286B002840F1B080591E0F
-:100BD0002963ACE0404649460022002300F0F2FDC4
-:100BE000019938BF89F0004947F2975041436A4A5A
-:100BF00091FBF2F20192D2F1070204DD4046494630
-:100C0000FFF79BFE0AE0524200206449FFF795FE81
-:100C100002460B464046494600F044FF8046662C9B
-:100C2000286BDFF87CB106BF019F0A3706273F1803
-:100C3000142FC8BF142730208DF8080089460DF105
-:100C4000090000E03046002F34DD064640464946A4
-:100C500001F04CF801460A4606F1080304200A2672
-:100C6000B2FBF6F606EB860EA2EB4E02303203F82C
-:100C7000012C0A22B6FBF2F202EB820EA6EB4E0624
-:100C80003036401E03F8026DE9D1083F002F03F112
-:100C90000806D7DD084601F03DF802460B464046FF
-:100CA000494600F08DFE00225B4600F081FC804644
-:100CB0008946CBE70DF10901401A0DF1090604E060
-:100CC0000199491E401E0191761C31783029F7D0D8
-:100CD000662C02D10199491C03E0652C0CBF01214F
-:100CE00000212B6BCB189842B8BF431E002B1ED49B
-:100CF000834204DAF05C3528A8BF392000DA3020BE
-:100D00001946721E02EB010800E05B1E18F80199FB
-:100D1000491E8145F9D0392802D1705C401C7054BD
-:100D2000002904D50198401C16465B1C01900198CF
-:100D300000B200901BB29DF838103246284600F0F1
-:100D400034F82FE0C61D002F3FF7BEAE30460DF140
-:100D50000901401A009903468842C8BF0B46002B80
-:100D60000DF109063FF52FAF8342BFF6FEAE0DF140
-:100D70000900C05C07287FF7F8AE0F20F6E60000F8
-:100D8000CBCCCC0C0000244002FCFFFFFFFF0F8007
-:100D90000000E03F0000F07FA08601000000F03F6F
-:100DA00084D797410FB0BDE8F08F2DE9F84783B0A5
-:100DB00006468A461746984600F0FCF9B8F1000F3F
-:100DC000406A356B90F8009003DC4FF001080FF299
-:100DD0000037BDF930404AF02000662808BF641C87
-:100DE00015D0672840F0848014F1040FC0F286808B
-:100DF000AC4280F2838096F83800641C010702D46C
-:100E0000A845B8BF454620B22D1A48BF00250FFAA5
-:100E100084FAF068B169BAF1000F25DC4A1C30236E
-:100E20004354002D03DC96F83800010703D5F06821
-:100E300000F80290521C15EB0A0FB8BF6C4220B2AA
-:100E4000441941424445B8BFA046B26171620FFAED
-:100E500088F5F561F068B3692A463946184400F010
-:100E60003BFA641BB462C4E022B29045084417DA2E
-:100E70004246394600F030FAB0694044B061AAEB0E
-:100E80000801002D716203DC96F838100A0705D5B9
-:100E9000F16801F80090F069401CF061B562A8E0CB
-:100EA000394600F019FAB069002D5044A8EB040847
-:100EB00003DC96F838100A0703D5F16801F80090B2
-:100EC000401CB0610FFA88F08542F068B369B8BF82
-:100ED000A8460FFA88F207EB0A01184400F0FCF963
-:100EE000B0690FFA88F10844B061681A706280E056
-:100EF000BAF1610F14D14FF0700A16E0A84504DA78
-:100F000096F838100A0758BF45466D1E48BF0025A1
-:100F1000BAF1670F14BF4FF0450A4FF0650A04E0BD
-:100F2000BAF1410F08BF4FF0500AB169F368481C8D
-:100F3000B061002D17F8012B5A5403DC96F83810D5
-:100F40000A071BD5F168431CB36101F80090002D1E
-:100F500014DDA8F101080FFA88F08542F068B8BFE7
-:100F6000A8460FFA88F23946184400F0B5F9B0697E
-:100F70000FFA88F108446D1AB0617562F068B169C2
-:100F80000844002C80F800A003D42B214170811C60
-:100F900003E02D2141706442811C00206A460AE072
-:100FA00023460A2493FBF4F404EB8405A3EB4503E6
-:100FB00002F8013B401C24B2002CF1DC012806DCC5
-:100FC0004AF02002652A04BF302201F8012B48B9FB
-:100FD000302001F8010B07E0401E1DF800203032E0
-:100FE00001F8012B0028F7DCF068B2691044091AF7
-:100FF000F16196F8380000F0140010280DD17169E5
-:10100000B0694118706A4118F0694118B06A411816
-:10101000706B8142BCBF411A316204B0BDE8F087F9
-:10102000F8B505460E4617461C46002074B117F861
-:10103000011BB068A847B06030B1F06A401CF06294
-:101040000020641EF3D1F2BD4FF0FF30F2BD00006E
-:101050007072696E74665F733A20256E20646973DE
-:10106000616C6C6F776564007072696E74663A20AB
-:1010700062616420256E20617267756D656E740013
-:101080007072696E74665F733A20626164202573C2
-:1010900020617267756D656E740000007072696E14
-:1010A00074665F733A2062616420256C73206172FC
-:1010B00067756D656E7400000000000000000000A0
-:1010C0006E616E004E414E00696E6600494E4600EC
-:1010D0003000F0B40246106895681318506803EBAE
-:1010E0005004C00721D54D441FE0F0BC02F10C00B4
-:1010F000704713F8017B05F8017B491EF9D1A0B1B7
-:10110000B60813F8011B06F00306032E08BF13F8F8
-:10111000016B01EB06214942801C294405D011F8DE
-:10112000016B05F8016B401EF9D1A342DDD013F825
-:10113000016B16F0030104BF13F8011BC91C300931
-:101140000F28DAD113F8010B0F30D6E71B48704790
-:1011500030B45368D418042B09DA41B1057804F887
-:10116000015B10F8015B15B15B1C491EF3E753608E
-:1011700030BC704738B514461D4661B1FFF7E8FF33
-:1011800061686A6B204690476FF00102811A02D0B5
-:10119000491E03D005E06FF0010032BD4FF0FF3073
-:1011A00032BD0021616032BDDA6B1047034BE1E7CD
-:1011B000024BF9E70248704700000000B010002021
-:1011C000781000200278C9B28A421AB11CBF10F808
-:1011D000012FF9E718BF00207047B1F5807F02D3D7
-:1011E0004FF0FF3070470170012070470078401EBB
-:1011F0008041C043C00F704780B508B90FF21C0092
-:1012000005490B681BB122220021984701E000F03C
-:101210008EFD222002BD0000BC170020636F6E739C
-:10122000747261696E742068616E646C65723A20D4
-:10123000626164206D6573736167650000F101038D
-:10124000810704D010F8011B89B18107FAD1026827
-:10125000B2F10131914311F0803F04BF50F8042FE7
-:10126000F6E710F8011B11B110F8011BFBE7C01ADB
-:1012700070470000C9B2830706D0521E22D310F86F
-:10128000013B9942F7D11FE0083A13D302F104025F
-:1012900041EA012141EA014150F8043B121F21BFFC
-:1012A0004B40A3F1013C2CEA030C1CF0803FF3D02F
-:1012B000C9B2001F083210F8013B521E28BF91EA44
-:1012C000030FF8D818BF0120401E704780B5FFF704
-:1012D0003DFF006C02BD000062B38B0708D0521EB8
-:1012E00011F8013B00F8013B00F024808B07F6D198
-:1012F000830740F0208000BF103A07D330B4B1E834
-:101300003810103AA0E83810F9D230BC530724BF87
-:10131000B1E80810A0E8081044BF51F8043B40F8B9
-:10132000043BD20724BF31F8022B20F8022B44BF24
-:101330000B7803707047121F17D35B0009D151F867
-:10134000043B20F8023B1B0C121F20F8023BF6D294
-:101350000BE051F8043B00F8013B1B0A20F8023B6C
-:101360001B0C121F00F8013BF3D238BF121D521E96
-:1013700024BF11F8013B00F8013BF8D8704700008A
-:10138000B3BBD9B1B2F5803F7DD2022A1ED98C46BB
-:10139000B1FBF2F102FB11C31B0443EA1043B3FBA0
-:1013A000F2FC02FB1C3380B240EA0343B3FBF2F0D1
-:1013B00002FB103240EA0C4000237047022A05D994
-:1013C0008446B0FBF2F002FB10C270474AB105D16F
-:1013D00000F0010249085FEA300070470022002354
-:1013E000704700F0A7BC0B000200002100207047EE
-:1013F000904271EB030CF6D3B3F5803F2FD2F0B5DA
-:10140000B3FA83F7B1FA81F4A7F10F0E3D1B5340F5
-:10141000CEF1200602FA0EF2F3415340B5F10F0768
-:1014200046D80F3C2C444140C4F12006A040F14175
-:101430004140B1FBF3F603FB1611A2FB0645001B6E
-:10144000A94102D2761E8018594180EA010221FA90
-:101450000EF362FA0EF200215A403046F0BD30B46D
-:10146000B1FBF3FC03FB1C11A2FB0C45001BA941C3
-:1014700003D2ACF1010C8018594130BC02460B4636
-:10148000604600217047B2F1807F65D3F0B5B2FAB3
-:1014900082F7B1FA81F4C7F10F063D1B22FA06F379
-:1014A00007F1110EF24120355A40B5F10F07B8D9B6
-:1014B0004140C4F12006A040F1414140B1FBF3FCA2
-:1014C00003FB1C11A2FB0C45001BA94103D2BCF17C
-:1014D000010C801859410F2F12D30F3FC90341EA65
-:1014E0005041B1FBF3F603FB1611A2FB0645D4EB0A
-:1014F000C030A94102D2761E8018594146EACC3C40
-:1015000007B34140C7F12006B840F1414140B1FB6B
-:10151000F3F603FB1611A2FB0645001BA94102D2FC
-:10152000761E8018594180EA010221FA0EF3C7F1B4
-:10153000200462FA0EF20CFA07F05A402CFA04F179
-:101540003043F0BD80EA010221FA0EF3002162FA75
-:101550000EF260465A40F0BD8C46B1FBF2F102FB40
-:1015600011C31B0243EA1063B3FBF2FC02FB1C3302
-:101570001B024CEA002043EA1063B3FBF2FC02FBBF
-:101580001C331B024CEA002043EA1063B3FBF2FC5D
-:1015900002FB1C331B024CEA002043EA1063B3FB3E
-:1015A000F2FC02FB1C324CEA0020002370470000D2
-:1015B000B0B581EA030C0CF0004C40F2FF7515EA5F
-:1015C00011541DBF15EA1357AC42AF4239E0E4197C
-:1015D00023EA455343F48013C90241F0004141EA34
-:1015E000505EC7021100A7FB020200284FF0000066
-:1015F000EEFB01204FF00001E3FB072118BF42F092
-:101600000102401800214941E3FB0E01A4F580646A
-:101610000F0302D252004041494154F101046CDDF4
-:10162000470872F1004250F1000051EB0451A1F55E
-:1016300080115CBF41EA0C01B0BD4CEA05510020AD
-:10164000B0BD05EA1357AC4214BFAF4241E050EAC7
-:10165000410E1CBF52EA430E02E061460020B0BDBD
-:1016600024423C441BD15FEA070EF6D0090302BFB7
-:1016700001460020AEF1140EB1FA81F7AEEB07047B
-:1016800001FA07FE0C37C7F1200100FA07F7C8403E
-:101690004EEA000E23EA455343F48013A2E733F0E9
-:1016A0000043B3FA83F704BFB2FA82FE77440B3FDC
-:1016B000E41BB7F1200E2FBF02FA0EF3BB40C7F1B7
-:1016C000200E22FA0EFE38BF43EA0E03BA40641C15
-:1016D00082E750EA410E14BF52EA430E6FF0000158
-:1016E0004FF4001717EB430F8ABF194617EB410F52
-:1016F000B5E74CEA05510020B0BDD4F10104B4F1C6
-:1017000020070FDAC4F12007520828BF42F0010277
-:1017100010FA07F501FA07F7E1BF2A43E040384322
-:10172000E1400FE0352C98DCC7F1200452EA40027A
-:1017300020FA07F218BF42F0010231FA07F0A14087
-:101740000A43002172F1004250F1000051EB0C01FC
-:10175000B0BD000010B5144600F002F8226010BDC4
-:10176000C1F30A5343B14A0012F5001F28D2A3F275
-:10177000FE32A1EB0251704750EA410C20D001F03B
-:10178000004C31EA0C01B1FA81F204BFB0FA80F3E7
-:10179000D2180B3AB2F120032CBF00FA03F19140AA
-:1017A00041EA0C013EBFC2F1200C20FA0CF31943B0
-:1017B0009040524240F2FD33D21A01EB0351704780
-:1017C000002270474FF4001C1CEB410F94BF1CEB30
-:1017D000430F09E041EA030C50EA4C0C52EA0C0CAE
-:1017E00003D2994208BF9042704714BF8B42824295
-:1017F000704700004FF4001C1CEB410F94BF1CEB22
-:10180000430F09E041EA030C50EA4C0C52EA0C0C7D
-:1018100003D28B4208BF8242704714BF9942904264
-:1018200070470000124254D440F2FF7C1CEA11536E
-:101830000FD0634531D09B1863453CBF01EB02518B
-:10184000704701F0004141EA0C510020AFF30080E5
-:10185000704750EA410320D001F0004C91EA0C019E
-:101860001CD0B1FA81F30B3B9A420DD9D21A9940A0
-:1018700051EA0C01C3F1200C20FA0CFC61449840A1
-:10188000531C40F2FF7CD7E7914041EA0C01C2F1C2
-:10189000200C20FA0CF3194390407047B0FA80F303
-:1018A0001533202BE0D3202AEED3203A203B9A4256
-:1018B00009D9D21A00FA03F141EA0C010020531CA5
-:1018C00040F2FF7CB8E700FA02F141EA0C01002087
-:1018D0007047524240F2FF7C1CEA11530DD0634521
-:1018E000DBD0B2EB030C3CBFA1EB025170470CF113
-:1018F000010221EA035141F4801150EA410CCCD09D
-:1019000001F0004C352A27DC30B481EA0C01B2F139
-:10191000200309DAC2F12003044601FA03F5D0409E
-:101920002843D1409C400CE0C3F12002450020FA3E
-:1019300003F418BF44F0010421FA03F091400C4372
-:10194000002174F1004550F1000051EB0C012442DC
-:1019500030BC7FF47BAF70476146002076E7000023
-:10196000C1F30A5340F2FE329B1A14DDD3F1200377
-:101970004FEAE17208DDC90241EA505141F00040EE
-:10198000D84080185040704703F2E13010B1D24384
-:1019900082F000407047002070470000C11768B116
-:1019A0004840401AB0FA80F29040D21CC907C2F5F4
-:1019B000846241EA025202EBD021400570470000E8
-:1019C00070B44FF0004591EA030F40F1B5816B40D0
-:1019D000841A71EB030603D2001BB1411219734143
-:1019E0004FF4001C1CEB410F34BF7CEB430442E07E
-:1019F0000C0DA4EB1356352E4FDC45EAC323DB0A4E
-:101A000045EAC121C912B6F120050DDD63FA05F6DC
-:101A1000EB4086EA0305124218BF45F00105C018E5
-:101A200051F100010CD213E062FA06F5F240554084
-:101A3000F3415A40B340F3405A408018594107D30C
-:101A400049085FEA30005FEA350528BF45F0010527
-:101A500001F58011420875F1004250F1000041EBA0
-:101A600004514E0016F5001F70BC38BF70470020AF
-:101A7000090D090570471CEB410F10D252EA4306CD
-:101A80000BD0BCEB410F05D80C0DAB43661E342EBA
-:101A9000B6DD02E0AB438018594170BC704770BCA2
-:101AA00070470000F0B540F2FF7581EA030C0CF0BE
-:101AB000004C15EA11541DBF15EA1357AC42AF4252
-:101AC000E5E0BC41C1F31301C3F31303801A99414C
-:101AD00043F4801304D2641E4000494180185941E8
-:101AE000C90241EA5051B1FBF3F603FB1611A2FB08
-:101AF0000675D7EBC020A94102D2761E8018594145
-:101B0000C90241EA5051B1FBF3FE03FB1E11A2FBD7
-:101B10000E75D7EBC020A94103D2AEF1010E80189B
-:101B20005941890241EA9051760546EA8E2EB1FB71
-:101B3000F3F603FB1611A2FB0675D7EB8020A94133
-:101B400002D2761E80185941C90241EA50514EEA2C
-:101B5000060EB1FBF3F603FB1611A2FB0675D7EBDD
-:101B6000C020A94102D2761E80185941C90241EA1B
-:101B70005051B1FBF3F703FB1711A2FB0735D3EB71
-:101B8000C020A94167F100070CBF004247F00107E0
-:101B900066F3D5274FEA1E31B80814F5806412DDCC
-:101BA000BD0775F1004250EB0E5051EB045111F599
-:101BB000801F5CBF41EA0C01F0BD4CF07F6141F039
-:101BC000E0410020F0BDBD076D0840EA0E5041F431
-:101BD0008011D4F10104B4F120060ADAC4F1200620
-:101BE0000200E04001FA06F3E1401843B240154319
-:101BF0000EE0342C13DCC6F1200445EA40056D08E4
-:101C000020FA06F2154321FA06F0A1400D43002107
-:101C100075F1004250F1000051EB0C01F0BD0020C5
-:101C20005FEA0C01F0BDCFB992185B41B3FA83F7BC
-:101C300004BFB2FA82F6BF190B3FB7F120062FBFDF
-:101C400002FA06F3BB40C7F1200622FA06F638BFB7
-:101C50003343BA401CB1E419641E33E77F4231F0CC
-:101C60000041B1FA81F404BFB0FA80F6A4190B3C2C
-:101C7000B4F120062FBF00FA06F1A140C4F12006FE
-:101C800020FA06F638BF3143A0403C1B1AE7AC42AD
-:101C90001ABF05EA1357AF4212E050EA41061CBFD3
-:101CA00052EA4306BFE750EA4107304661461CBF8F
-:101CB00041EA0551F0BD52EA430C08BFC143F0BDF3
-:101CC00000204FF4001616EB410F98BF16EB430FA0
-:101CD00008BF16EB410F24BFC14305E016EB430FCD
-:101CE0000CBF61464CEA0551F0BD0000400D49189B
-:101CF00040EA81200CD2490DA1F58061491C40F0D9
-:101D0000004005DBD1F11F0154BFC840C017704728
-:101D100000207047014648B1B0FA80F18840C91CE4
-:101D2000C1F58461090501EBD02140057047012010
-:101D300000F0B6B870470000841A71EB030604D2B5
-:101D40006E40001BB141121973414FF4001C1CEB93
-:101D5000410F34BF7CEB430682E00C0DA4EB13561D
-:101D6000362E7BDC012E45EAC32341DC43EA525385
-:101D700012BFD20292025B08240545EAC12141EA62
-:101D80005051D2EBC020994125D407D1B0FA80F64A
-:101D900010FA06F162D00020203608E0B1FA81F690
-:101DA000B140C6F1200220FA02F21143B0404FEADE
-:101DB000F474B4EB465434F001064FEA74040AD8C4
-:101DC000D6F50016760D04F00044F04061FA06F2F4
-:101DD0005040F1404840C00A40EA415021F00041E3
-:101DE00028BF5FEA500550F1000044EBD12135E0F7
-:101DF000DB0A45EAC121C90AB6F120050EDD42EA37
-:101E00000242120CC5F1200603FA06F6EB4042EA44
-:101E100006056D42984161F100010DE062FA06F598
-:101E2000F240554063FA06FC82EA0C02F3405A4045
-:101E30006D42904161EB030111F4801F05D1641ED6
-:101E4000620502D06D004041494121F480114308F0
-:101E500075F1004350F1000041EB045170BC704734
-:101E60001CEB410F15D223F0004352EA43060BD07E
-:101E70004FEA4C0CBCEB410F04D80C0D661E342EFF
-:101E8000B7DDEBE7801A994150EA410608BF00210F
-:101E9000E4E708BF1CEB430F28BF6FF00001DDE74C
-:101EA00080B5AFF30080024A11001820ABBEFBE7FB
-:101EB0002600020038B5040009D004F17C056868EA
-:101EC00008B900F01EF800F021F8012801D1012026
-:101ED00032BDA06A08B100F02AF800F00AF821F03B
-:101EE0002A01FFE7816000F01BF8BDE8324000F0F6
-:101EF00010BE2068416821F49041416020688168EB
-:101F0000704700212970204600F023BF242068601C
-:101F100020680168490849000160204600F02EB998
-:101F20002068016841F001010160204670472046A9
-:101F300000F08CBD70B5044604F17C05134668685A
-:101F4000202836D149B3180027D02878012830D06E
-:101F500001222A7004F15406216533807380002029
-:101F6000E86021206860306AC8B1DFF8F411C1620E
-:101F7000DFF8F001316A0863316ADFF8EC01486389
-:101F80000020316A88632068216D00F12802306AE0
-:101F900001F00DF818B100F00EF8012070BD2168B5
-:101FA00040200862002028702068816841F080018C
-:101FB00008E0022070BD1020E8600020287020207A
-:101FC000686070478160002070BD206881684A06A3
-:101FD000704770B504462568E9692A68AB6811F056
-:101FE0000F000CD1880602D5900601D4D80079D50F
-:101FF000E16E002975D02046BDE8704008475B4877
-:10200000034208BF12F4907F6CD0CE0709D5D605E5
-:1020100007D501262E62D4F8885045F00105C4F892
-:1020200088508D070AD5DD0708D526680225356258
-:10203000D4F8885045F00405C4F888504D070AD5F7
-:10204000DD0708D5266804253562D4F8885045F0A8
-:102050000205C4F888500D070CD5950601D403423B
-:1020600008D0256808202862D4F8880040F00800CD
-:10207000C4F88800D4F8880000286FD0890607D5F6
-:10208000900601D4D80003D5E16E09B120468847F7
-:10209000D4F8880021688A68510601D400071AD54F
-:1020A000204600F0A1FDFFF790FF0FD500F060F88B
-:1020B00060B1DFF888198163A06F00F0BBFF0028D2
-:1020C0004CD0A06F816BBDE8704008472046BDE84A
-:1020D000704001F09FB8204601F09CF80020C4F841
-:1020E000880070BDC80209D5580207D54FF480108A
-:1020F00028622046BDE8704001F014B9080609D5F1
-:10210000100601D4180205D5216F39B32046BDE869
-:102110007040084748060FD550060DD5286820F0B6
-:10212000400028602021C4F880100020206720464D
-:10213000BDE8704001F00FB9080206D5500004D583
-:102140002046BDE8704001F017B9C80148BF002A19
-:1021500004D52046BDE8704001F00FB970BD000005
-:102160004D2C00087B2C0008812C00080100001079
-:10217000816821F040018160A06F70472DE9F84F20
-:102180000446DFF8880A2768DFF884BA3968DFF880
-:1021900084AA0140A06801432069014360690143AA
-:1021A000E0690143606E0143396000267968E068A8
-:1021B00021F4405101437960B046A169DFF8580A23
-:1021C00087421CBF206A0143BA68DFF8500A024008
-:1021D0001143B9604FF48075F96A606A090940EAF1
-:1021E0000111F9625F454FF400404FF400714FF464
-:1021F00080624FF400634FF4805C4FF4005E4FF454
-:10220000804929D1DAF800B00BF0030BBBF1030FC2
-:102210003ED8DFE80BF00237343A4FF0010AD4F829
-:102220001CB05746BBF5004F4FF6F07A40F01183D3
-:10223000012F09D0022F00F05482042F00F08D826C
-:10224000082F00F0C282F5E201F06CFC0146606AE2
-:10225000002840F01B8242E2DFF8BCB95F4517D18D
-:10226000DAF800A01AF4406A27D0BAF5806F09D0D6
-:10227000BAF5006F03D0BAF5406F06D008E04FF012
-:10228000020A07E04FF0040A04E04FF0080A01E0F8
-:102290004FF0100ADFF880B95F45C0D1BAF1000FE6
-:1022A0000BD0BAF1020F49D0BAF1040F00F08280CE
-:1022B000BAF1080F00F0B080B3E301F02BFC014647
-:1022C000606A58B3012808BF022028D0022808BF3E
-:1022D000042024D0032808BF062020D0042808BFEB
-:1022E00008201CD0052808BF0A2018D0062808BFDF
-:1022F0000C2014D0072808BF102010D0082808BFD1
-:1023000020200CD0092808BF402008D00A2808BF88
-:10231000802004D00B2808BF284600D00120B1FB44
-:10232000F0F0002800F07F83626802EB42018842EF
-:1023300003D31103814280F0A18072E3606AB0B3DD
-:10234000012808BFDFF8D808EED0022808BFDFF860
-:10235000D408E9D0032808BFDFF8CC08E4D004286B
-:1023600008BFDFF8C808DFD0052808BFDFF8C008BD
-:10237000DAD0062808BFDFF8BC08D5D0072808BF88
-:10238000DFF8B408D0D0082808BFDFF8B008CBD0F9
-:10239000092808BFDFF8A808C6D00A2808BFDFF858
-:1023A000A408C1D00B2808BF4FF22440BCD0DFF8EE
-:1023B0009808B9E701F064FB0146606A58B3012848
-:1023C00008BF0220ABD0022808BF0420A7D00328F2
-:1023D00008BF0620A3D0042808BF08209FD00528E6
-:1023E00008BF0A209BD0062808BF0C2097D00728DA
-:1023F00008BF102093D0082808BF20208FD00928BC
-:1024000008BF40208BD00A2808BF802087D00B2827
-:1024100008BF284683D081E7676A002F84D0012F48
-:1024200008BF4846FAD0022F08BF7046F6D0032FE7
-:1024300008BF41F25550F1D0042F08BF6046EDD0DF
-:10244000052F08BF40F6CC40E8D0062F08BF40F665
-:10245000AA2012D0072F08BF18460ED0082F08BF99
-:1024600010460AD0092F08BF084606D00A2F08BF19
-:10247000284602D00B2F00D1802055E7BAF1000F7B
-:102480000BD0BAF1020F38D0BAF1040F00F072800D
-:10249000BAF1080F00F0A780ECE001F03BFB014629
-:1024A000606A40B3012808BF02251ED0022808BF79
-:1024B00004251AD0032808BF062516D0042808BF13
-:1024C000082512D0052808BF0A250ED0062808BF07
-:1024D0000C250AD0072808BF102506D0082808BFF9
-:1024E000202502D0092808BF402572D00A280CBF39
-:1024F00080250B286DD001256BE0606A002836D05E
-:10250000012808BFDFF8D8672BD0022808BFDFF802
-:10251000D46726D0032808BFDFF8CC6721D0042871
-:1025200008BFDFF8C8671CD0052808BFDFF8C06700
-:1025300017D0062808BFDFF8BC6712D0072808BFED
-:10254000DFF8B4670DD0082808BFDFF8B06708D0FF
-:10255000092808BFDFF8A86703D00A2808BFDFF8FA
-:10256000A4677CD00B2808BFDFF8DC6677D0DFF8E3
-:10257000986774E001F084FA0146606A40B301286C
-:1025800008BF022525D0022808BF042521D0032832
-:1025900008BF06251DD0042808BF082519D0052826
-:1025A00008BF0A2515D0062808BF0C2511D007281A
-:1025B00008BF10250DD0082808BF202509D00928FC
-:1025C00008BF402505D00A280CBF80250B2800D065
-:1025D00001256268B1FBF5F65008002110EB0620DA
-:1025E00051EB166141E0606A002836D0012808BF2F
-:1025F0004FF4800633D0022808BF4FF400162ED0C7
-:10260000032808BFDFF8046729D0042808BF4FF467
-:10261000801624D0052808BFDFF8F4661FD00628EE
-:1026200008BFDFF8F0661AD0072808BF4FF400266D
-:1026300015D0082808BF4FF4802610D0092808BFFD
-:102640004FF400360BD00A2808BF4FF4803606D06E
-:102650000B2808BF4FF4004601D04FF40006C246D5
-:10266000002116EB52004AEB01010023FEF788FE21
-:10267000064601E04FF00108A6F54070DFF8981615
-:10268000884280F0CE812168CE60CCE1012808BF6D
-:1026900002251AD0022808BF042516D0032808BF37
-:1026A000062512D0042808BF08250ED0052808BF2B
-:1026B0000A250AD0062808BF0C2506D0072808BF1F
-:1026C000102502D0082808BF202575D0092808BF8A
-:1026D000402571D00A280CBF80250B286CD001251D
-:1026E0006AE0606AB0B3012808BFDFF85C0521D05A
-:1026F000022808BFDFF828051CD0032808BFDFF830
-:102700001C0617D0042808BFDFF8180512D00528CA
-:1027100008BFDFF80C060DD0062808BFDFF8080553
-:1027200008D0072808BFDFF8040503D0082808BF31
-:10273000DFF804057AD0092808BFDFF8000575D056
-:102740000A2808BFDFF8F80470D00B2808BFDFF8AC
-:10275000F4046BD0DFF8AC0568E001F091F90146B4
-:10276000606A40B3012808BF022525D0022808BFAF
-:10277000042521D0032808BF06251DD0042808BF42
-:10278000082519D0052808BF0A2515D0062808BF36
-:102790000C2511D0072808BF10250DD0082808BF28
-:1027A000202509D0092808BF402505D00A280CBFDC
-:1027B00080250B2800D001256068B1FBF5F14208A7
-:1027C00002EB4102B2FBF0F632E0666A66B3012E1C
-:1027D0002CD0022E08BF484628D0032E08BF42F650
-:1027E000AA2023D0042E08BF70461FD0052E08BF94
-:1027F00041F698101AD0062E08BF41F2545015D059
-:10280000072E08BF604611D0082E08BF18460DD00D
-:10281000092E08BF104609D00A2E08BF084605D069
-:102820000B2E08BF284601D04FF4803000F008F985
-:10283000B6B201E04FF00108A6F11000504580F05B
-:10284000F0800AEA0601C6F3420001432068C16035
-:10285000E9E0012F07D0022F35D0042F6DD0082FCB
-:1028600000F0A280D4E001F05DF90146606A40B357
-:10287000012808BF022512D0022808BF04250ED067
-:10288000032808BF06250AD0042808BF082506D05B
-:10289000052808BF0A2502D0062808BF0C257BD0D2
-:1028A000072808BF102577D0082808BF202573D037
-:1028B000092808BF40256FD00A280CBF80250B28A7
-:1028C0006AD0012568E0606AA0B3012808BFDFF87C
-:1028D000501330D0022808BFDFF848132BD003284C
-:1028E00008BFDFF8441326D0042808BFDFF83C13E4
-:1028F00021D0052808BFDFF838131CD0062808BFF0
-:10290000DFF8301317D0072808BFDFF82C1312D0D8
-:10291000082808BFDFF824130DD0092808BFC849CC
-:1029200009D00A2808BFC74905D00B2808BF4FF2B5
-:10293000244100D0C449606831E001F0A1F80146AB
-:10294000606A40B3012808BF022525D0022808BFCD
-:10295000042521D0032808BF06251DD0042808BF60
-:10296000082519D0052808BF0A2515D0062808BF54
-:102970000C2511D0072808BF10250DD0082808BF46
-:10298000202509D0092808BF402505D00A280CBFFA
-:1029900080250B2800D001256068B1FBF5F101EB23
-:1029A0005001B1FBF0F631E0666A6EB3012E08BF4C
-:1029B000484629D0022E08BF704625D0032E08BFF6
-:1029C00041F2555020D0042E08BF60461CD0052E81
-:1029D00008BF40F6CC4017D0062E08BF40F6AA200C
-:1029E00012D0072E08BF18460ED0082E08BF10467A
-:1029F0000AD0092E08BF084606D00A2E08BF28466E
-:102A000002D00B2E08BF802000F01AF8B6B201E009
-:102A10004FF00108A6F11000504502D22068C660B0
-:102A200001E04FF0010804F16800012141800180BC
-:102A30000021416081604046BDE8F28FCF2C000844
-:102A4000616800EB5100B0FBF1F6704790F8281078
-:102A5000CA0706D502685368C16A23F400330B43E2
-:102A6000536090F828108A0706D502685368016BF6
-:102A700023F480330B43536090F828104A0706D59F
-:102A800002685368416B23F480230B43536090F832
-:102A900028100A0706D502685368816B23F40043A7
-:102AA0000B43536090F82810CA0606D50268936855
-:102AB000C16B23F480530B43936090F828108A066F
-:102AC00006D502689368016C23F400530B439360AE
-:102AD00090F828104A0610D502685368416C23F418
-:102AE00080130B435360416CB1F5801F05D15368CF
-:102AF000816C23F4C0030B43536090F828100A063E
-:102B000006D501684A68C06C22F4002202434A607C
-:102B10007047F8B5044604F17C050020E8606FF0CA
-:102B20007E4701F08BF80646206801680A0708D541
-:102B30000097334600224FF40011204600F016F8AB
-:102B400060B9206801684A070AD500973346002219
-:102B50004FF48001204600F009F808B10320F2BDCF
-:102B600020206860A86000202870F2BD2DE9F041A7
-:102B7000069C05460E4690461F462868C1693140AE
-:102B8000B1420CBF0120002040451CD114F1010FBF
-:102B9000F3D001F053F8C01B844201D3002CECD1D8
-:102BA0002868016821F4D0710160286881684908AB
-:102BB0004900816005F17C00202141608160002195
-:102BC0000170032000E00020BDE8F08101680A6880
-:102BD00022F0C0020A6001688A6822F400028A605A
-:102BE0002021C0F88010704701680A6822F49072B2
-:102BF0000A60DFF83011026893680B40936020216F
-:102C0000C0F884100021C16670470000F369FFCF4F
-:102C1000003801408800005800800040FFF4FF1198
-:102C200000127A0000093D00AAB0280080841E002E
-:102C3000006A18005558140040420F0020A10700F8
-:102C400090D0030048E801000024F400816A006885
-:102C50000268930644BF084600F07DBB0020A1F83F
-:102C600056000868826822F0800282600868FFE7E8
-:102C7000016841F0400101607047806A00F0E4BFE4
-:102C8000F8B5846A04F1800504F1560728686E6877
-:102C900021688A68110606D5212804D100203880D1
-:102CA0002046FFF793FF20688168480606D5222E4C
-:102CB00004D1002038812046FFF796FFA86840F035
-:102CC0001000A8602046BDE8F24000F0A3BA806A78
-:102CD00000F1560100220A810A8000F09BBA000030
-:102CE0000000127A0000093D00AAB0280080841E6E
-:102CF00000006A18005558140040420F0020A10738
-:102D00000090D0030048E801000024F400551500AD
-:102D100000CC0C0000AA0A0000FD0F005461510015
-:102D200000D43000FEFFFFEF614981B00A68024322
-:102D30000A600968084008E05E4881B0016841F413
-:102D400000210160006800F400200090009801B0AC
-:102D5000704738B586B004466846142100F076FF07
-:102D60002068554A554990422ED10868544D40F08C
-:102D700001000860096801F0010105910598012032
-:102D8000FFF7D2FF0C200090022100200191029059
-:102D900003210820039100F05AF8402000F050F879
-:102DA000082000F054F847482860112000F055F83A
-:102DB00008B101F09AF86567AC6200220021252075
-:102DC00001F0B0F8252037E03F4A904236D14868FC
-:102DD0003E4D40F480404860486800F480400590D3
-:102DE00005980120FFF7A0FF0220FFF79DFF4FF499
-:102DF000006000F025F8072000F029F8C0200090BE
-:102E000002210120019102900321072003910490E7
-:102E100069462F4801F0E4F82E4828600F2000F0A2
-:102E20001CF808B101F061F86567AC62002200216E
-:102E3000242001F077F8242001F091F807B030BD8C
-:102E400000900221002002900390019170470490AD
-:102E500069464FF0904001F0C3B868601020A86048
-:102E60000020E8608020286100206861A861E86196
-:102E70002862284600F034B810B504461649206888
-:102E8000884213D101F090F901F08EF913480168DE
-:102E900021F4407141F480710160026842F4004203
-:102EA00002602046BDE8104001F092B910BD00005C
-:102EB0004C00005850000058008000405C00005852
-:102EC0002C15002044000240003801408C150020E1
-:102ED00000040048440402400028004090000058CC
-:102EE00038B5040001D1012032BD2168DFF8FC02B1
-:102EF000814204F1240500F042F8022068700A685B
-:102F0000A0686FF30E120243E06802432069024397
-:102F100060690243A0690243E0690243206A0243F8
-:102F20000A60204600F039F9A068B0F5804F04BF70
-:102F300000216160696A207900F014F838B1052831
-:102F400005D2204600F043F900F012F803E000201B
-:102F500028636863A8630020A861012068700020CE
-:102F6000287032BD0860A96AE86A486060687047E6
-:102F7000296B00200860696BA86B486070470AD213
-:102F8000DFF86C0242181423B2FBF3F292002A62BB
-:102F9000DFF8600209E0DFF8600242181423B2FB98
-:102FA000F3F292002A62DFF85402E8617047F8B544
-:102FB000044604F1240600253078012801D10220BE
-:102FC000F2BD01273770707801282FD10227777062
-:102FD000B561206807687F087F000760204600F021
-:102FE000C0F82168F06820B10A6842F00E020A6059
-:102FF00008E0086820F0040008602068016841F0DB
-:103000000A010160706A0168CA0303D5026842F4CC
-:1030100080720260306B18B1016841F48071016008
-:103020002068026842F00102026001E0357002256A
-:103030002846F2BD38B500F1240200245178022957
-:1030400003D004209061012428E001680B6823F07C
-:103050000E030B6001680D686D086D000D60516A0C
-:103060000B6823F480730B60012192F82030D5693E
-:1030700003F01C0399406960936AD16A5960116B2F
-:1030800031B10B6823F480730B60536B916B596003
-:10309000012151701470516901B18847204632BD39
-:1030A000F8B500F124010423CA69146802681568A0
-:1030B00091F8206006F01C0603FA06F73C4210D097
-:1030C0006F070ED51468A50603D4156825F004050E
-:1030D000156000F03DF8C968002938D0BDE8F4401B
-:1030E0000847022303FA06F73C4213D0AF0711D575
-:1030F0001468A50605D4156825F00A051560012297
-:103100004A7000F025F800220A708968F9B1BDE81C
-:10311000F4400847082303FA06F6344217D02B0779
-:1031200015D5136823F00E031360012291F82030A7
-:10313000CC6903F01C039A40626001228A614A70E4
-:1031400000220A70096911B1BDE8F4400847F1BDD9
-:1031500091F82020CC6902F01C0293406360704714
-:10316000000078B5C56C046D6C60446D14B1846D5D
-:10317000C56D6560012590F84440066C04F01C04A0
-:10318000A5407560046863608068102802D1A26061
-:10319000E16071BDA160E26071BD416C0268134BDA
-:1031A00089089A4234BF164B164B03EB81018164A8
-:1031B00002F0FF02083A1421B2FBF1F1124AC26494
-:1031C00001F01C01012202FA01F101657047017949
-:1031D0000E4A02EB81024265491E0D4A826501F0EA
-:1031E000030101228A40C2657047000008040240C2
-:1031F000F8FFFDBF00000240F8FBFDBF00040240E5
-:10320000000802401C08024080080240FC080240FE
-:10321000400902407047000010B500F17C010A78B7
-:10322000012A01D1022010BD01230B7024224A6023
-:10323000026813681468640864001460002242661F
-:1032400023F00053006803602020486000200870CD
-:1032500010BD70B500F01EF801D1022070BD00F065
-:103260001FF822F0604209E070B500F013F801D1B8
-:10327000022070BD00F014F822F0606211438160FA
-:10328000204600F01AF820680660202068600020C0
-:10329000287070BD044604F17C0528780128704729
-:1032A00001222A702420686020680668026852089B
-:1032B00052000260206882687047FFB50FF2540226
-:1032C0000FF25806D2E9003402A9C1E90034D6E968
-:1032D0000071CDE90071416E11B90121012213E0A5
-:1032E00001688A688968520E02F00702490F02AC31
-:1032F000655CA45C1DF801101DF80220ED00E400DF
-:1033000095FBF1F194FBF2F2683041800280FFBD41
-:10331000000000000101010307010000080402048D
-:10332000080101017047000010B5002488B9114858
-:1033300003600E480E4B0360FEF7FCFD012805D02C
-:1033400007D3032804D038BF022402E0012400E0A0
-:103350000324204610BD00680549884204D1054970
-:103360000868002818BF004770470000A01300201D
-:1033700000380140B8170020704770474FF0B04048
-:10338000006800F0F000B02888BFB02070472DE939
-:10339000F041040066D0207881064FF0B04537D563
-:1033A000A868E96810F00C0001F0030104D00C28B3
-:1033B00008BF012940F081802868800702D5E069B4
-:1033C00000284FD0FFF7DAFF616A884207D208462B
-:1033D00000F0B9FB002819D100F056FA10E0286877
-:1033E00020F0F000014329606968206A21F47F41E0
-:1033F00041EA00216960606A00F0A5FB002805D160
-:1034000000F026FF002000F06DFD002840F08681CE
-:103410002078C10711D5A868E96800F00C000828D9
-:1034200001F0030103D00C2808BF032967D12868E5
-:10343000800302D56068002814D0217888071AD547
-:10344000A868E96800F00C00042801F0030104D02A
-:103450000C2808BF022940F087802868400503D562
-:10346000E068002800F05A816968206921F0FE4177
-:1034700041EA006169602168DFF8646711F0180FA4
-:1034800000F076816069002800F0A880C9067068A5
-:1034900040F19580800707D4706840F0010000F08B
-:1034A0000CFA07467068800700F13A8100F0C6FB0D
-:1034B000C01B0328F6D30320DFE1E06978B1296857
-:1034C00041F0010100F0D2FA06462868800700F1B9
-:1034D000368100F0B3FB801B0328F6D3EBE72868A6
-:1034E0004008400000F0E3F90646286800F0C8F9FB
-:1034F0008ED000F0A3FB801B0328F6D3DBE76068C7
-:10350000B0F5803F06D0B0F5A02F296807D141F46F
-:1035100080212960286840F48030286006E021F48A
-:10352000803129602A6822F480222A60606860B1B4
-:1035300000F084FB0646286880033FF57EAF00F06C
-:103540007DFB801B6528F6D3B5E700F077FB0646C8
-:103550002868400C10F001003FF46FAF00F06EFBE4
-:10356000801B6528F4D3A6E7E06878B1296841F4A8
-:10357000807100F07BFA06462868400500F1E28081
-:1035800000F05CFB801B0328F6D394E7286820F446
-:10359000807000F08CF906462868800A10F001005F
-:1035A0003FF469AF00F04AFB801B0328F4D382E7A5
-:1035B00000F044FBC01B0328C0F0D6807BE740F03E
-:1035C000010000F07AF907467068800700F1E78093
-:1035D00000F034FBC01B0328F6D36CE7706820F0C2
-:1035E000040000F06AF907467068C00810F0010096
-:1035F00000F0E48000F022FBC01B0428F4D35AE75B
-:103600000528306806D140F004003060316841F090
-:10361000010105E0400840003060316821F00401FC
-:103620003160A06841F2893768B100F007FB80463D
-:103630003068800700F1D78000F000FBA0EB0800A5
-:10364000B842F5D337E700F0F9FA8046306800F069
-:1036500017F900F0C88000F0F1FAA0EB0800B842BA
-:10366000F4D328E700F0EAFAC01B0328C0F0C980B1
-:1036700021E7B06840084000B06000F0DFFA07467C
-:10368000B06800F0FDF800F0C08000F0D7FAC01B71
-:103690000328F5D30FE700F0D1FA801B0328C0F010
-:1036A000C68008E700F0CAFA001B0328C0F0E080DB
-:1036B00001E7E968DFF82C0589088900E960E96815
-:1036C0000140E96000F0BAFA044600F0EBF823D0BC
-:1036D00000F0B4FA001B0328F7D3ECE6E868226B8D
-:1036E00000F00301914202BF00F07001626B914251
-:1036F00014D1A26BC0F30621914202BF00F47811ED
-:10370000E26B91420AD1226C00F06061914202BFEB
-:1037100000F06040616C884200F0AE800120ACE0B7
-:10372000706840F0040000F0C8F8074670680007B1
-:1037300010D400F083FAC01B0428F7D3BBE600F0D6
-:10374000A3F865E66868216920F0FE4040EA016060
-:10375000686090E67068A16920F4706040EA01201A
-:10376000706000F0A7F8074600F089F87FF420AFFA
-:103770002078410737D5DFF870743868C10529D43F
-:1037800000F012FD00F05AFA80463868C10521D4D5
-:1037900000F054FAA0EB08000328F6D38BE670681B
-:1037A00020F0040070607068C00810F00100DFD0E5
-:1037B00000F044FAC01B0428F5D37CE600F07AF848
-:1037C000074600F05CF8D3D000F038FAC01B03289D
-:1037D000F7D370E6A06801287FF412AF306840F09C
-:1037E000010030601DE7217848060ED5A06A002848
-:1037F0003FF43FAFB16841F00101B16000F01EFA43
-:103800000746B06880077FF52DAFE06AA0B3A968CE
-:1038100001F00C010C293FF461AF0228286820F068
-:10382000807028607FF445AF00F008FA064600F08B
-:1038300039F87FF430AFE968DFF8B003A26B0140DC
-:10384000206B0143606B0143E06B41EA02210143BD
-:10385000206C0143606C0143E960286840F080708F
-:103860002860E96841F08051E96000F0E7F904461A
-:10387000286880017FF516AF0020BDE8F0817068F0
-:10388000400810F0010070472968606A21F0F001DB
-:10389000014329606868216A20F47F4040EA0120E2
-:1038A000686070472868400E10F00100704728607B
-:1038B00000F0C4B9706840084000706000F0BEB904
-:1038C0002DE9F8430400884644D0DFF8246300F073
-:1038D000C8F847D200F0CDF8074600F0C2F841D052
-:1038E00000F0ACF9C01B0228F7D90320B7E000F0C4
-:1038F000A5F9401B022843D9F7E700F09FF9A0EB98
-:10390000090002284CD9F0E700F098F9A0EB090073
-:10391000022854D9E9E700F091F9401B02285DD94B
-:10392000E3E700F08BF9401B022867D9DDE700F0E0
-:1039300085F9401B484577D3D7E7032802D139687A
-:10394000890103E00028396802D1890762D401E0C7
-:1039500049055FD4012082E000F070F9C01B022805
-:1039600072D9C2E7207881074FF0B0470BD5B9680C
-:10397000A06821F0F0010143B96000F05FF905464D
-:10398000B868C003B3D52078DFF8505281060AD555
-:103990002968606921F0F001014300F067F8814671
-:1039A00028688003A9D5207841060BD52968A0692D
-:1039B0000909090141EA101100F058F88146286808
-:1039C000C003A1D5207841070BD5B968E06821F480
-:1039D000E0610143B96000F031F90546B868800341
-:1039E00099D5207801070CD5B868216920F460507A
-:1039F00040EAC100B86000F021F90546B86840030C
-:103A00008FD52078C10717D56068022895D139680D
-:103A100089039FD5B968890840EA8100B86041F2FE
-:103A2000893900F00BF90546B868616800F00C00B0
-:103A3000B0EB810F7FF47BAF306800F0070080456A
-:103A400005D200F016F8074600F00BF884D100F01C
-:103A5000FFFB00F09FFCBDE8F24300F043BABDE875
-:103A6000F283306800F0070040457047296000F09D
-:103A7000E5B83168C90848EAC101316000F0DEB834
-:103A800038B54FF0B0445C4DA16811F00C0106D17F
-:103A9000FFF774FCC0F3031055F8200032BD042971
-:103AA000564A05D00829564804D12168C90222D5B2
-:103AB000104632BDE16801F00301022904D0032958
-:103AC00004D12168C90207D5104605E0FFF756FC6E
-:103AD000C0F3031055F82000E168E268E368C1F321
-:103AE00006214843C2F30211491C5B0FB0FBF1F001
-:103AF0005B1CB0FBF3F032BD80B5FFF7C1FF3D4961
-:103B0000FFE7404A0968C1F3031152F82110B0FBE6
-:103B1000F1F002BD80B5FFF7EFFF00F010F8C1F340
-:103B2000022106E080B5FFF7E7FF00F008F8C1F3D7
-:103B3000C22112F8211001F01F01C84002BD2D4919
-:103B4000314A0968704770B52B49B1282EBFCC6A3D
-:103B5000C0F3031051F820402048056800F02AFC0B
-:103B600028492A4A05F00F0551F82510B4FBF1F158
-:103B70000024B1FBF2F1B0F5007F0FF2B002204655
-:103B800009D10FF28C0353F820508D4214D2401CFF
-:103B90000328F8D912E00FF2880353F820508D4221
-:103BA0000AD2401C0328F8D308E000F047F8801B35
-:103BB00003280BD3032070BD52F820400C4D286819
-:103BC000C00844EAC000FFF772FE0646296801F00B
-:103BD0000701A142E9D1002070BD00000801005892
-:103BE00090000058FFFFFEEE000400588C80C111C9
-:103BF00000400058080000582C4300080024F4003E
-:103C00000048E801EC4200083C7A000840420F00FE
-:103C100012000000240000003600000040000000F8
-:103C2000060000000C000000100000000000000072
-:103C300001000000020000000400000001480068CC
-:103C4000704700BF5010002070470000002200F0B5
-:103C5000B9BB0000964900E0964981B00A6802436A
-:103C60000A60096808400090009801B0704710B5DC
-:103C700000F07CFB904C606840010ED56068C0008D
-:103C80000BD400F091FA00F08FFA206840F48030F5
-:103C90002060216821F48031216000F0E8F80020E4
-:103CA00000F0AAFB40B180798449E160E16821F429
-:103CB0007C5141EA0021E16000F044F800F0B9F8DD
-:103CC0007F48804C016800220260026902F05002C5
-:103CD00002610120FFF7C0FF0220FFF7BDFF0420B3
-:103CE000FFF7B8FF0220FFF7B5FF0120FFF7B2FF93
-:103CF00000220F210E2000F015F90E2000F02FF900
-:103D000000220F213A2000F00DF93A2000F027F9A7
-:103D100000216D4841600F218160046047F6FF710A
-:103D2000C160002101618161C16100F077FBA06881
-:103D3000C008C000A06000F015FC4FF0FF3000F09C
-:103D40009FFCFAE780B5AEB01CA84821FFF77EFFC4
-:103D500001A81C21FFF77AFF08A85021FFF776FF82
-:103D60005A48016821F4C06141F4007101600B21DF
-:103D7000006800F4C06000904FF4803200981C91FD
-:103D80004FF480701F904021209105202190002148
-:103D90001D9227911CA8FFF7FAFA6F2001900221CB
-:103DA0000020029103900490059006900790012155
-:103DB00001A8FFF785FD43F60300089000210E914E
-:103DC0000F914FF400404FF40071199018910020AA
-:103DD00002211B901A9108A800F03CFD2FB000BDF5
-:103DE00010B53B4C3B4800F017F84FF40040E06141
-:103DF000002020626062A0622046FEF75BF800218E
-:103E00002046FFF726FA00212046FFF72DFA20462C
-:103E1000BDE81040FFF700BA20604FF4E130606069
-:103E20000020A060E06020610C2060610020A061A3
-:103E300070472948816841F00101816081688907E4
-:103E4000FCD5C16821F4404141F48041C160C168A2
-:103E500049084900C160016941F00101016101693E
-:103E60008907FCD5016821F04061016070471B485B
-:103E700081B0016841F4801101603F21006800F4C5
-:103E8000801000900098164841604161016841F43B
-:103E90007C110160026942F47C120261016841F008
-:103EA0003F010160026942F03F02026101B07047C8
-:103EB000480000584C00005890000058FECAFECA46
-:103EC0008008005800280040B81600200004005860
-:103ED000A01300200038014088000058500000580E
-:103EE000040C005800207047704770470901020019
-:103EF00081B002D43248815405E0324802F00F020A
-:103F0000104400F8041C01B070472F4A13684FF6A4
-:103F1000FF0100020B4000F4E06018432B49084306
-:103F20001060704738B5284B1C68C4F30223C3F1F6
-:103F30000704052C28BF04241D1D072D34BF0023B2
-:103F4000DB1E012505FA04F4641E2140994005FAA0
-:103F500003F35B1E1A401143BDE83440C6E701007D
-:103F600007D4012200F01F01194B8A40400943F891
-:103F70002020704701000BD4012200F01F01154BD7
-:103F80008A40400943F82020BFF34F8FBFF36F8F63
-:103F90007047010007D4012200F01F010E4B8A4038
-:103FA000400943F820207047010007D4012200F0A7
-:103FB0001F010A4B8A40400943F820207047000047
-:103FC00000E400E018ED00E00CED00E00000FA0570
-:103FD00000E100E080E100E000E200E080E200E0DB
-:103FE0002DE9F84F4FF0000C674A684BDFF8A081CD
-:103FF0004FF00F0982460F4633E0664DAA4514BFC5
-:10400000072504258D40254348F82E50C1431C68E0
-:1040100001EA040E7C68E50348BF40EA0E0EC3F8CF
-:1040200000E05C6801EA040E7C68A50348BF40EA32
-:104030000E0EC3F804E0146801EA040E7C68E50281
-:1040400048BF40EA0E0EC2F800E0546801EA040ED0
-:1040500079688C0248BF40EA0E0EC2F804E00CF109
-:10406000010C396831FA0CF000F07C80012000FA74
-:104070000CFE1EEA0100F2D07C68022C18BF122C44
-:104080004FEA8C0110D14FEADC040AEB840401F002
-:104090001C05266A09FA05FB26EA0B06D7F810B0BC
-:1040A0000BFA05F5354325624FEA4C040325DAF88F
-:1040B000006097F804B0A540ED430BF0030B2E40D1
-:1040C0000BFA04FB4BEA0606CAF800607E68012E74
-:1040D00018BF022E03D0112E18BF122E17D1DAF8F6
-:1040E0000860D7F80CB02E400BFA04FB4BEA06062A
-:1040F000CAF80860DAF8046026EA0E0E7E68C6F395
-:10410000001606FA0CF646EA0E06CAF80460DAF85B
-:104110000C603540BE6806FA04F42C43CAF80C4023
-:104120007C68E4009BD54FEA9C0E58F82E5001F0B5
-:104130000C0109FA01F425EA0404BAF1904F08BF12
-:1041400000250ED0144DAA4508BF012509D0134DF6
-:10415000AA4508BF022504D0114DAA457FF44DAFF2
-:1041600003254FE7BDE8F18F81B0002A14BF8161BC
-:10417000816201B070470B4A136803421CBF106094
-:1041800000F070BA7047000000080058800800581E
-:1041900008000140001000480004004800080048E2
-:1041A000000C00480C0800580248016841F4807176
-:1041B00001607047000400588A60FF210268516264
-:1041C000012180F82110002180F820100020704784
-:1041D00090F82010012901D102207047012280F8B7
-:1041E0002020022180F82110CA2102685162532147
-:1041F0000368596201688A6842F02002FFF7DCBF59
-:104200003249002008604FF4E0223148016841F44F
-:10421000700101604FF0B041086840F00100086093
-:104220008A602C480A6802402B480A60036823F021
-:10423000050303604268520852004260002227488A
-:10424000C8600861086820F4802008608A617047AF
-:104250004FF0B0410FF2D4000A68C2F3031250F8D5
-:1042600022008A6802F00C02042A04D0082A04D032
-:104270000C2A04D01CE01A481AE01A4818E0CA6850
-:10428000CB68C3F3021302F003025B1C022A08BFCF
-:10429000134802D0032A08BF1248B0FBF3F2C868E3
-:1042A000CB68C0F306205B0F42435B1CB2FBF3F00C
-:1042B0000D4A0FF23803106088681168C0F30310CC
-:1042C00053F82000B1FBF0F01060704708ED00E0FB
-:1042D00088ED00E0FBFEF6FA94000058001004227E
-:1042E0000024F4000048E8017410002001000000E0
-:1042F00003000000050000000100000001000000B4
-:10430000060000000A00000020000000020000007B
-:104310000400000008000000100000004000000041
-:10432000800000000001000000020000A0860100E3
-:10433000400D0300801A060000350C0040420F00BB
-:1043400080841E0000093D0000127A000024F40061
-:1043500000366E010048E801006CDC02000000003D
-:104360000000000000000000000000000E4810B532
-:10437000016841F4807101600320FFF7C6FD002051
-:10438000FFF7B0FD0024002814BF0124FEF7D4FC81
-:10439000204610BD0548406870470548FFE70168A2
-:1043A00041F00101016070470040005850100020AA
-:1043B000042004E0DFF80800006800F4C0607047E3
-:1043C0000004005800B500BF13009646944610390B
-:1043D00028BFA0E80C50FAD85FEA417C28BF0CC087
-:1043E00048BF40F8042BC90728BF20F8022B48BF5C
-:1043F00000F8012B00BD000001460648064AC379BB
-:104400008B4218BF904218BF0838F8D18B4218BFB2
-:1044100000207047F873FF1F0070FF1F38B50400BD
-:1044200044D094F8210028B9002184F820102046B7
-:10443000FEF722FD00F049F8FF2510B100F03FF82B
-:1044400034E02168DFF8B0008A6802408A602168A1
-:104450008A68636820690343A06903431A438A603A
-:104460002168E068086120680169A26841EA0241A8
-:1044700001612068C16821F08001C1602068C16CC1
-:1044800089088900C1642168CA6CE36960690343D3
-:104490001A43CA6420688168880609D400F020F8AD
-:1044A00030B120684562042100F01FF8012032BDC0
-:1044B00020684562012184F82110002032BD206867
-:1044C0004562042184F821107047022084F82100FD
-:1044D000CA2021684862532022685062204626E0A4
-:1044E00020460BE02068C0F8248084F821100020CA
-:1044F00084F8200070470000BFFF8FFF70B50446AE
-:1045000040F2E9362068C16821F0A001C160FFF7E0
-:1045100095FB05462068C168880606D4FFF78EFB28
-:10452000401BB042F6D3032070BD002070BD70B5B3
-:1045300004462068C1684A0612D44FF0FF32C260B8
-:1045400040F2E936FFF77AFB05462068C168480665
-:1045500006D4FFF773FB401BB042F6D3032070BDB7
-:10456000002070BD10B52848284C88B0016841F47F
-:104570000041016000F0D2FA2549002000F05FFC04
-:10458000FFF70BFF2348016841F480310160026CA2
-:1045900042F48032026400F0ACFD0121012000F001
-:1045A000C2FA002000F0EFFD012000F0ECFD022037
-:1045B00000F0E9FD012000F00EFE0121002000F0D6
-:1045C0001EFE00F073FE144A0021402000F0BBF8EC
-:1045D00004F23C500FF245010090019169460FF240
-:1045E000410000F04FFF04F25470029004F5C961DD
-:1045F00040F23C5005900391049402A800F0D9FECB
-:1046000000F052FE08B010BD080000582000032042
-:10461000B816002090080058C754000870470000E2
-:1046200080B500F0FEFE00F0C7FFBDE804400021A9
-:10463000012000F078BA70474FF0FF3000F020B84A
-:104640000021402000F08CB8022000F0ABB802201E
-:1046500000F0B0B8FFF7C4BB13460A46014600207D
-:10466000FEF762BE012805D0022805D0102805D12A
-:1046700001F0C2B801F0CFB801F0CEB87047000029
-:104680002DE9FC47554CDFF85891A5692840A061F9
-:104690004FF0010A4FF0FF3830E0491C54F8310068
-:1046A0000642FAD004EBC107184079681040014275
-:1046B00008BFC7F804807E68304000F093F860625D
-:1046C0000AFA00F086437E60EFF3108172B6626AE8
-:1046D00020690AFA02F2D24310402061022004EB62
-:1046E000C00353F8086C1640401E43F8086CF6D11E
-:1046F00081F31088606A59F820108847636920693F
-:10470000A2691840104207D0E069216A084203D12B
-:10471000002103EA0206C1E701F0B8FAEFF31089BD
-:1047200072B6216960690140A069014201BFE16977
-:10473000206A0142FFF77FFF89F3108801F0A7FA92
-:10474000A561BDE8F38738B51446EFF3108572B65E
-:1047500000F048F8224941F8204085F3108831BD27
-:1047600010B5EFF3108272B61C4B1C6904431C6138
-:1047700053F83140204343F8310082F3108810BDD4
-:10478000EFF3108172B6154A536923EA000005E081
-:10479000EFF3108172B6114A53691843506181F3E7
-:1047A00010887047EFF3108172B60C4AD369184332
-:1047B000D061F4E770B5094C656A266A2062012170
-:1047C00001FA05F502E02846FFF736FF216AE069A5
-:1047D0000842F8D088432662E06170BD28100020AE
-:1047E0002C14002002460020110C090404BF1020E4
-:1047F000120412F07F4F04BF083012020FF21801AA
-:1048000012F0704F04BF001D1201120FC0F11F0003
-:10481000895C401A70470000040302020101010193
-:104820000000000000000000DFF8EC120A68030935
-:1048300003F47F2300019A4300F47F2000F068B95D
-:10484000DFF8D4221368010C23EA014343EA004352
-:10485000136070472DE9F843054600262878DFF8F5
-:10486000B8724106B0464FF0B0442DD5286B70B1F8
-:10487000B0F5800F06D0B0F5000F18BFB0F5400FAF
-:1048800017D01FE0E06840F48030E060C5E02068A9
-:1048900020F080602060FFF7D1F981462068000198
-:1048A00040F1A880FFF7CAF9A0EB09000228F5D96A
-:1048B0000326AFE0FFF7C2F9A0EB0900022840F29F
-:1048C000A180F5E70126B0462868010531D5B86812
-:1048D00000F44078286C80452AD0FFF765FCB8F1D9
-:1048E000000FB96805D1286C21F440710143B9600B
-:1048F0001EE0B86840F48030B86021F44071B868B8
-:1049000020F48030B860286C0143B960B868C007F3
-:104910000ED5FFF793F9804641F28939B8688007D0
-:1049200006D4FFF78BF9A0EB08004845F6D3032621
-:10493000B0462878C10705D53968A869890840EAD2
-:10494000810139602878810705D53968E86921F443
-:104950004061014339602878C10644BFA86AFFF767
-:104960006FFF2878810644BFE86AFFF769FF28785F
-:10497000410744BF286AFFF757FF2878010744BF63
-:10498000686AFFF751FF2868C1055CD53968686B14
-:1049900021F0406101433960686BB0F1006F03D1D1
-:1049A000E16841F08071E160686BB0F1806F4AD1DD
-:1049B00000F0A0F806462068000135D5FFF73EF963
-:1049C000801B0228F7D94FF003083CE0FFF736F9C7
-:1049D000801B022830D9F6E7FFF730F9801B022848
-:1049E00052D94FF0030861E0FFF728F9801B022835
-:1049F00055D9F6E700F075F8A86821F4781100F0B1
-:104A00007FF88146206800017FF554AF216968690D
-:104A10000143216130007FF456AF3968286B21F4DF
-:104A20004001014339604FE700F05BF8E86821F08E
-:104A3000606100F065F8064620680001C6D521696E
-:104A40006869014321612868810505D53968A86B2B
-:104A500021F04041014339602868410526D5396875
-:104A6000E86B21F0405101433960E86BB0F1005F21
-:104A700003D1E16841F48031E160E86BB0F1805F1F
-:104A800014D100F037F8064620680001A4D400F0E5
-:104A900028F8286921F0604100F032F806462068C5
-:104AA0000001A1D521696869014321612868C10419
-:104AB00005D5F968686C21F440410143F960286824
-:104AC00081040BD5616AE86C21F030010143616219
-:104AD000616AA86C890840EA810161624046BDE8CC
-:104AE000F2832069696820F4FE4040EA01202061D9
-:104AF00021697047216821F080612160FFF79EB82D
-:104B000001432161206840F080602060FFF796B883
-:104B10001043086070470000880000580C480021CE
-:104B200001604160704710B500F00CF85C6819B185
-:104B3000012904D1204301E024EA0000586082F3F7
-:104B4000108810BDEFF3108272B6014B7047000061
-:104B50007C170020DFF83C150A6892B200E002469C
-:104B6000086880B28242FAD170472DE9FC410446C0
-:104B70001825DFF82485DFF82465684308EB000773
-:104B80003078062808D131787170347078754FF01C
-:104B9000FF307060002039E000F077F8B96809183C
-:104BA000B96008F10803B96832786A439A589142AB
-:104BB000327813D308F1150315FB02FC13F80C30FF
-:104BC000062B25D008F108066B43F358994222BF03
-:104BD00008F115036A439A5CEED219E01146337866
-:104BE00069439A420BD008F1140308F1150C5B5C81
-:104BF00015FB03F50CF805407A753B7500E07A75F6
-:104C000008F114025454317871703470BDE8F681A3
-:104C10001146694308F115035B5C062B04D008F1CB
-:104C2000140615FB03F574557B753A7508F11502EA
-:104C30005454EBE7F8B5DFF86434DFF85C541E78C1
-:104C4000182402466243B0422A4404D118785870AE
-:104C5000507D18700FE0167D507D92F815C005F15B
-:104C600015076643062807F806C004D0167D1435DC
-:104C700014FB00F42E55012010731878062802BF8B
-:104C800000294FF0FF315960F1BD10B5DFF80C4439
-:104C9000606810F1010F0FD0FFF75CFF6168DFF86B
-:104CA0000024814261683CBF5388C918081A5178B2
-:104CB00048431178C84000E0002080B210BD2DE9C3
-:104CC000F84FDFF8DC53DFF8DCB3D5F80880D8F80C
-:104CD0000000DBF800104A0500F090F9DFF8BC6333
-:104CE000DFF8B4A321F4806181604FF018093478B3
-:104CF0000AF1080019FB04F14758FFF7C6FF874285
-:104D000017D200270121B170062C3DD019FB04F405
-:104D10000AF108010AF108020959814223BF0AF188
-:104D200008010959091A002111510AEB04014C7DAF
-:104D3000EAE7A9884118B94202D2AF880021E2E728
-:104D40003F1ADFE7022802DA2878012800D07F1E08
-:104D5000D8F80000C1684A07FAD500F055F9DBF829
-:104D60000C00000CBFB247EA0047CBF80C70FFF70D
-:104D7000F1FE7060A8680068816841F4806181601C
-:104D8000AFF30080BDE8F18FB8B20028DAD1FFF7A9
-:104D9000E1FE70600320BDE8F24FFFF7FAB82DE99D
-:104DA000F843EFF3108872B6BD4DBB4BA86801689D
-:104DB000CA224A6253204862B84A886820F4806058
-:104DC000886018201678374647431F44387B0228EE
-:104DD00026D13C68D7F810909078F0B17A7B012A00
-:104DE0000AD101213046FFF725FF88F31088796842
-:104DF000304600F016F904E088F31088304600F0E1
-:104E0000C1F8A8680068CA21416222465321416264
-:104E10004846314600F050F90BE0FFF750FF06E03E
-:104E2000C8684207FCD500F07EF89F49086088F307
-:104E30001088FF21A86802685162BDE8F183F8B5C7
-:104E4000974CA160CA2209684A6253224A62954A75
-:104E5000136843F020031360136803F00703C3F1E2
-:104E60000403237095682D0C05F07F056D1C65709B
-:104E7000EDB29268C2F30E02521C628092B2521ED0
-:104E80006A43A2F5A072DA404FF6FF739A422CBF34
-:104E9000A380A280854A136843F400231360844BE7
-:104EA0001D6845F400251D6048BB7C487A4E0123EF
-:104EB000837018254FF0FF33436000235FFA83FCB3
-:104EC00006F10C0715FB0CFC4FF0000E07F80CE088
-:104ED0005B1CDFB2062FF1DB06230370886820F429
-:104EE0008060886000F01FF8D0600320FFF75CF856
-:104EF000A1680868826842F48042826005E0C86860
-:104F0000410544BF0320FFF744F8A1680A68FF2069
-:104F10005062002203210320FFF704F8BDE8F240AD
-:104F20000320FFF71CB8C86800F0800060F49060B0
-:104F3000C8604FF400207047F0B504460025EFF339
-:104F4000108672B61827DFF850C10CF10C0007FB71
-:104F500005FE10F80E0010B16D1C062DF5DB062DB8
-:104F60000CD06F430CEB07000127077386F3108802
-:104F70000461427303600D700020F0BD86F3108859
-:104F80000120F0BDF8B50746EFF3108472B6032098
-:104F9000FEF7F0FF424DAE683068CA2141623A46E2
-:104FA00053214162182043494243895C02291BD1A5
-:104FB00000213846FFF73EFE3848017806290ED119
-:104FC000306838490A68530500F018F821F4806108
-:104FD0008160C1684A07FCD500F016F804E040780B
-:104FE000884218BFFFF76BFEA9680A68FF2050626D
-:104FF0000320FEF7B4FF84F31088F1BD02D5C16829
-:105000004A07FCD481687047C16801F0800161F4EF
-:105010009061C1604FF40020234908600320FEF72F
-:10502000C3BF2DE9F04180460F46424618201A4979
-:1050300042438C18207B022804BF4046FFF7A2FFA2
-:10504000EFF3108572B60320FEF794FF144EB0689C
-:105050000068CA2141625321416202202073A76087
-:1050600067604046FFF781FD0C490A784978914214
-:1050700002D0FFF724FE02E0A168081AA060FF201A
-:10508000B1680A6850620320FEF769FF85F3108853
-:10509000BDE8F0812828004084120020AC170020D1
-:1050A00068170020082800400C0800580008005825
-:1050B00080080058901200201047000038B5EFF328
-:1050C000108472B6284D6946281D00F0FAFE694624
-:1050D000281D00F053FF38B184F31088BDF800108C
-:1050E000224AFFF7B9FA31BD0120287084F31088F5
-:1050F00031BD80B5FFF7AEFA0221009100231A48B6
-:1051000000F124014FF48052001D00F0C1FD01BDEB
-:1051100000BFF8B514460026EFF3108510F1010F1B
-:105120001ED001281CBF02284FF0FF3618D1BCB199
-:10513000264672B60C4F012392B2381D00F0BCFD1A
-:1051400000281CBF3978002908D000223A7085F366
-:105150001088A1B2054AFFF77FFA01E085F31088B5
-:105160003046F2BD0000000004000020BD500008E1
-:10517000444981B00A6802430A6009680840009007
-:10518000009801B0704778B585B004466846142190
-:10519000FEF75CFD0220FFF7EBFF00F010F8009532
-:1051A000012001900021022003900291694656F8E7
-:1051B0002400FEF715FF00F008F806B070BD0FF2EE
-:1051C000D400314E30F81450704756F824000022B5
-:1051D0002946FEF7C9BF0FF2BC012B4B31F8101066
-:1051E00053F820000122FEF7BFBF0FF2A801264BA3
-:1051F00031F8101053F820000022FEF7B5BFF0B5CB
-:1052000085B005460C4668461421FEF71FFD0DB912
-:10521000042004E0012D18BF022D02D10820FFF761
-:10522000A7FF2000194E0FF274070DD137F81500B3
-:10523000009000210191012002900221039100F0D1
-:105240001BF80120FEF750FE012C13D137F8150092
-:10525000009001210E480190029100F00DF80FF22C
-:105260004400445D00220F2160B2FEF75BFE60B295
-:10527000FEF775FE05B0F0BD694656F82500FEF74D
-:10528000AFBE00004C0000585C10002068100020E9
-:1052900000002110200001000200000010000100A9
-:1052A000020000000A06070000F026BF6B486C49A8
-:1052B000016001F12002426001F13002826001F1DF
-:1052C0003C02C26001F14402026101F160024261EC
-:1052D00001F1640282617031C16100F015BF38B51F
-:1052E0000446604D05F1100000F072FF5B4948680C
-:1052F000A1680160E168C160456005F1100181604D
-:1053000000F01EFF58482DE080B554494A681368E4
-:105310000120187200F01AFF002002BD38B5524C6F
-:10532000504D07E0694605F1100000F07DFF009840
-:105330002168884705F1100000F04DFF0028F1D0EA
-:1053400031BD49484168084738B50446474D2846AD
-:1053500000F03EFF4148C068A1680160456000F070
-:10536000FAFE43482168016061684160002032BD57
-:1053700080B53A49CA6813681020187200F0F1FE2F
-:10538000002002BD3549CA68394910680B681847C2
-:1053900038B5374C354D06E06946284600F044FFE5
-:1053A000009861688847284600F015FF0028F3D070
-:1053B00031BD38B504462F4D284600F009FF2E4870
-:1053C00000F006FF25480069A1688160E168C160BE
-:1053D000056121680160616841602169416161691D
-:1053E000816131BD80B50146234800F007FFBDE86B
-:1053F00002400FF2090000F0C4BE000038B5174C9F
-:105400001D4D08E06946284600F00EFF009920690E
-:10541000006900F0F3FE284600F0DDFE0028F1D020
-:1054200031BD10B5154C204600F0D2FE0B48416945
-:105430000C60BDE8104000F0B8BE1CB50F4C06E093
-:105440006946204600F0F0FE009800F019F820466A
-:1054500000F0C1FE0028F3D013BD000000000320BF
-:10546000AC090320800803208C1700209808032033
-:1054700094170020240A0320841700202C0A0320FC
-:10548000704700007FB50C46484D6168484EE861A2
-:105490002962284600F0DAFE2468746006F10800EC
-:1054A00000F096FE012000F05DF8012030702968C0
-:1054B00041B10FF2D5000FF2D9020090019202948F
-:1054C000684688477FBD3EB5384C394D02E00098AC
-:1054D000FFF788FF05F1080000F07DFED8B92878B5
-:1054E000002818D0694605F1080000F09DFE012053
-:1054F0002870E1690029EAD00098029001A8884745
-:105500009DF8040028700028E1D1009905F10800F9
-:1055100000F06AFEDEE737BD2DE9F04105460E4694
-:1055200090461C46002000F01DF8214F7868A0F836
-:105530000950C672324641460C30FBF7CDFE1B4A7D
-:10554000136900210020984748F2E800FFF77FF830
-:1055500079688A78D21C04F10800FBF7BDFEBDE82B
-:10556000F04101201CB51149124C096A20B901B162
-:1055700088470020207013BD0120207011B1BDE8C4
-:105580001C40084713BD00000020FFF75DB8000075
-:1055900010B50146064C04F1080000F02FFE04F19E
-:1055A0000800BDE81040FFF74BB80000DC160020F3
-:1055B00058170020C417002010B58EB002A80FF2B3
-:1055C0009C61DFF810443022FBF796FE0FF2554045
-:1055D0000190009469460FF23540DFF8FC4300F07B
-:1055E0003FFE01210220FFF79EFADFF8F0230021A1
-:1055F0002020FFF7A8F802A800F012FF00F00DF934
-:1056000000F016FF0FF2393200210120FFF79BF85E
-:105610000FF2693200210220FFF795F8002084F88C
-:105620009000202000F0A3FF00F0D6FF0FF2C1335E
-:10563000002204F191010020FFF77EFC0EB010BDA6
-:105640002DE9F043074685B07878DFF88C43DFF822
-:10565000906305284FF0000804F1900554D03E28CF
-:1056600063D0FF280DD101203072B7F80300042861
-:1056700042D040F20741884204D040F602018842FD
-:1056800018D0A6E07879022804BFB9790029F8D1AA
-:105690000020FFF7AAFD0FF2A03001F0DBFAA87896
-:1056A000012806D12978062903D000210220FFF71E
-:1056B00057F88EE0002000F05AFFF879307301258A
-:1056C0003889F08179893182BA897282FB89B38203
-:1056D000388A04950090F082357BE08C0395102683
-:1056E0000296019601F0CAFA10B10220FFF773FD8D
-:1056F000202000F03CFF6CE00120FFF76CFD687893
-:105700000A21FFF78EFC64E0B888E18C884260D102
-:10571000A4F8268085F800800FF24C3001F09AFA48
-:105720000120307200F059F853E0F878012802D0D7
-:1057300002281DD04DE0B7F80500E084062028704F
-:105740000FF24C3001F086FA86F8088000F045F838
-:10575000E08C01F01CFB30B90FF25C3001F07AFAFA
-:105760000FF2883001E00FF2B43001F073FA30E04C
-:1057700097F80D90787960BB29E007EB0800847BEF
-:10578000C07BFF2821D1072C1FDB07EB0800007C22
-:1057900001281AD10FF2C43001F05CFA07EB0800BF
-:1057A000407C832811D10FF2D43001F053FA01204C
-:1057B000A870F8793070387A7070787AB070B87AEA
-:1057C000F070F87A3071387B7071641CA044C84561
-:1057D000D3DB012005B0BDE8F083E08C708106F1D9
-:1057E000080000F01ABF7C49CA8C824202D191F8AD
-:1057F000900070470020704780B501F02EF8062811
-:1058000005D0BDE8044000210120FEF7A9BFBDE896
-:10581000014000F014BF7047704718B589B00020F0
-:10582000ADF81A0001F071FB6E4C216811F1010F07
-:105830000DD06D4862680170120A0B0A090C817064
-:10584000437061680271C170120A427105E0002064
-:10585000FEF7D2FD08B90FF2DC3002460621002027
-:1058600000F050FE4EF66E50089007AA20685A4C81
-:10587000079006212E2000F045FE0FF2C0321021C5
-:10588000182000F03FFE0FF2C4321021082000F073
-:1058900039FE1821012000F05CFE01F031FA0DF113
-:1058A000160006A90190009105AB072200210420F3
-:1058B00001F09BFB0FF2E820BDF8181000900723C1
-:1058C000BDF81400002201F032FA0DF11A00009028
-:1058D0000223BDF81610BDF81400002201F027FACB
-:1058E0000020207001F035FB012060700020E07086
-:1058F000082060751020A075012020753B48A0612C
-:105900000120A0700020C1B221440871401CC1B226
-:105910001029F8DB002004900023A069617803902F
-:105920000022207D0290A07D0190607D0090A078F3
-:1059300001F028FBA07808B101F08FFB0AB010BD80
-:10594000254890F89010062900D1704780B50020B6
-:10595000FFF741FC4FF4487101230022084601F093
-:1059600097FB10B90FF2402004E00220FFF733FC50
-:105970000FF26420BDE8024001F06CB918B587B0A1
-:105980000FF28420144C01F065F994F89000062879
-:105990001DD01021069105914FF4FA70049050210A
-:1059A00000230291282200200393019200904FF4DB
-:1059B00048710B4B0022084601F08FFB08B9042008
-:1059C00003E00220FFF707FC002084F8900008B0F5
-:1059D00010BD0000A0080320F01100209F62000805
-:1059E000001700208075FF1F7417002007B2010008
-:1059F0000120FFF7FABB00212020FEF7B1BE0120F5
-:105A0000FEF7D0BE0120FEF7D5BE000010B504465B
-:105A1000616801F1080000F038FD00B1012020703C
-:105A200010BD000010B1012803D070473F20FEF7E1
-:105A3000A7BE3F20FEF7ACBE2D2D2047415020478A
-:105A4000454E4552414C20444953434F56455259C7
-:105A50002050524F4345445552455F434F4D504CA3
-:105A6000455445440A0000000D0A0D2A2A204449E5
-:105A700053434F4E4E454354494F4E204556454E95
-:105A800054205749544820534552564552200A0045
-:105A90000D0A0D2A2A20434F4E4E454354494F4E7E
-:105AA000204556454E542057495448205345525698
-:105AB0004552200A000000000D0A0D2A2A20474105
-:105AC00054542053455256494345532026204348B9
-:105AD0004152414354455249535449435320444948
-:105AE00053434F5645525920200A00002A2047416F
-:105AF0005454203A202053746172742053656172AB
-:105B00006368696E67205072696D617279205365B0
-:105B1000727669636573200D0A0D0000424C455F83
-:105B20004354524C5F4170705F4E6F746966696395
-:105B30006174696F6E28292C20416C6C207365722A
-:105B4000766963657320646973636F766572792023
-:105B50004661696C6564200D0A0D00002D2D2D2015
-:105B60005354204D414E55464143545552455220C1
-:105B70004944202D2D2D200A000000002D2D2053FA
-:105B80004552564552204445544543544544202DE2
-:105B90002D20564941204D414E2049440A00000025
-:105BA00053544D3332574200200D0A0D2A2A2053F8
-:105BB000544152542047454E4552414C204449538C
-:105BC000434F5645525920285343414E29202A2AF3
-:105BD00020200D0A0D0000002D2D20424C455F4174
-:105BE00070705F53746172745F4C696D6974656441
-:105BF0005F446973635F5265712C204661696C650F
-:105C000064200D0A0D0000000D0A0D2A2A204352BF
-:105C10004541544520434F4E4E454354494F4E2035
-:105C2000544F20534552564552202A2A20200D0A0F
-:105C30000D0000006C7AD8AC577200001234567810
-:105C40009ABCDEF0123456789ABCDEF0FEDCBA095B
-:105C500087654321FEDCBA09876543210000000007
-:105C60000000000000000000000000000000000034
-:105C700044000800400508013A799C00F401000145
-:105C8000FFFFFFFF48010100000000007047704760
-:105C900010B5029C016042600021C1600161416158
-:105CA00081610381A107047704D5008910B14FF009
-:105CB000FF3010BD002010BD2DE9F04F064685B025
-:105CC00030890C460027BB4600287169DC460CBFB2
-:105CD0004FF00208D84681B168B930697768451C31
-:105CE000BD4228BFED1B3768385C7D5D00EB0527A2
-:105CF000BF1CBFB203E0074600E000B102463069B6
-:105D0000F568A84223BF7568281AC01B00201546F5
-:105D100008EB050903FB09FE864532BF0020B0FBF6
-:105D2000F9FA09FB1A00C0B2804509DA96F81C900E
-:105D30005FEAC97A48BF84465FEA897048BFC446B3
-:105D4000100000F0B4807068714461448842C0F073
-:105D5000AE8008EB020080B20390D946100AADF87D
-:105D600002000294ADF80020049359E0800740D56A
-:105D70003089002840F09B803268D018A34600F894
-:105D8000024C200A32681A4402F8010C224630689C
-:105D90001844FBF7A1FA706920187061B069019C82
-:105DA000401CB061200A31680C70316848701CE0FA
-:105DB0008CB3307FC207D9D5308940B931681944D6
-:105DC000FF2001F8020C3168194401F8010C4FF072
-:105DD000000B7069241874612C463089002340B987
-:105DE00031680C70210A3068417002237069801C90
-:105DF000706108EB04070021BFB231615CB1DA4485
-:105E0000029800EB0A01306822461844FBF764FA56
-:105E100070692418746109F10109B069401CB0610E
-:105E2000049A70683169914545D2791881422CBF36
-:105E3000081A0846306103463089A0B93068BDF8B9
-:105E40000010C1545B1C70683168834228BF1B1A64
-:105E5000BDF80200C8545B1C7068834228BF1B1A3F
-:105E60007069801C706105FB09FA7468BDF8000058
-:105E7000E41A844288BF0446029800EB0A01281BFA
-:105E8000AC42019003D093D2307F002890D1376884
-:105E90002246F818FBF720FA706920187061A346B3
-:105EA000019C039F0023A9E73068404400E00020E4
-:105EB00005B0BDE8F08F88448045F5D3A8EB000815
-:105EC000F2E778B5028900230B80002A44690CBFF1
-:105ED00002250025002C4FD0028952B9C2684668BD
-:105EE000531CB34228BF9B1B0668B25CF35C02EBF9
-:105EF00003220A80027F02F00302012A25D10B88C7
-:105F00004FF6FF72934204BF0289002A09D0C3688A
-:105F100002699A4219D20289BAB14668F31A9342C9
-:105F200013D24368C268E41A14190022C2604461A3
-:105F300002894AB902681478012B94BFC3F10103A6
-:105F40000123D25C04EB02220A80C468426806681E
-:105F50002B19934228BF9B1A33440E884169891B31
-:105F6000491B416105D034192D19954228BFAD1A3E
-:105F7000C5608169491E8161184672BDF8B5028904
-:105F800000230B80002A42690CBF02240024002A4F
-:105F90003BD0C56802892B464AB946686A1CB242A2
-:105FA00028BF921B0668775DB25C07EB02220A806D
-:105FB000067F06F00306012E20D10F884FF6FF72F0
-:105FC000974204BF0289002A07D142680023012AB0
-:105FD00094BFC2F1010201220AE00269AA420DD275
-:105FE00002895AB14668751B954207D2002304E026
-:105FF00005682E78AA5C06EB02220A8041680068D8
-:10600000E4188C4228BF641A03191846F2BD000038
-:10601000C0680840884201D10120704700207047C5
-:10602000C0690840884201D10120704700207047B4
-:1060300010B5614C02212046FFF7F2FF38B16068CD
-:10604000C043810703D5FFF7A3F9022018E001211F
-:106050002046FFF7E5FF38B16068C043C10703D5AC
-:10606000FFF75CF901200BE008212046FFF7D8FF7D
-:1060700038B16068C043010703D5FFF7DEF9082097
-:10608000A06010BD10B54C4C00F033F818B9606832
-:10609000C043810306D400F02CF830B96068C043D7
-:1060A000810302D5BDE8104064E0082100F022F829
-:1060B00070B96068C04301030AD560683F4940F485
-:1060C00000206060086880474FF40020A06010BD89
-:1060D000202100F00FF858B96068C043810207D54D
-:1060E000606840F400106060BDE81040FFF729B917
-:1060F00010BD022120468BE740BF20BF3048016819
-:1061000041F400410160704780B52E48016841F4B8
-:1061100080110160006800F480100090009826480B
-:10612000016841F001010160026842F480320260BE
-:106130002C20FDF714FFBDE802402D20FDF70FBF16
-:106140002148016849084900016070471F494FF420
-:106150008030086070471C48016821F0020101602E
-:10616000704719484FF400314160016821F4003153
-:10617000016070471448016841F400310160FFF785
-:1061800001B938B504460C4D08212846FFF740FFF9
-:1061900030B10A480460686820F40020686031BDAE
-:1061A000A0474FF40021A96031BD0748016821F0E4
-:1061B0000801016070470000000C0058B41700206F
-:1061C0000C04005850000058040C0058080C0058EB
-:1061D000006040607047EFF3108172B6026882423F
-:1061E0000CBF012000201CE0EFF3108272B60368A0
-:1061F0000B60486001600868416023E0EFF31082A3
-:1062000072B6086043684B6041604868016019E0FD
-:10621000EFF3108172B6436802681A604268006842
-:10622000426081F31088704710B5EFF3108472B6A6
-:1062300002680A600068FFE7FFF7EAFF84F310884E
-:1062400010BD086082F310887047000002490160A9
-:1062500002490161704700BF4953000871530008AB
-:106260007FB50C46684D6168684EE8612962284632
-:1062700000F0AAFF246805F12400FFF7A9FF74606D
-:1062800006F10800FFF7A4FF01203070296829B14A
-:106290000FF2411000900294684688477FBD3EB5DA
-:1062A000594C5A4D02E00098FFF79CF805F10800A0
-:1062B000FFF791FFD8B92878002818D0694605F172
-:1062C0000800FFF7B1FF01202870E1690029EAD03A
-:1062D0000098029001A888479DF8040028700028C3
-:1062E000E1D1009905F10800FFF77EFFDEE737BD39
-:1062F0002DE9F8430646002000F05FF874883088E6
-:10630000B268DFF80481C4F3090444EA8024F06829
-:10631000A4B2C1B2204600F03CF8002748F2E809D8
-:106320004846FFF76FFB08E06888A04202D1316958
-:1063300028780870687800B1012708F12400FFF779
-:106340004AFFF0B9694608F12400FFF76DFF009895
-:1063500000F10B05407A0F28E6D0B5F80110A142F4
-:106360000DD10098817AC81E7169C0B28842C8BF39
-:106370000846706102463069E91CFAF7ADFF2878DB
-:10638000D9E73800CCD0012000F017F80020BDE894
-:10639000F28310B513461D4A5468A4F80900E1724F
-:1063A0000A46194604F10C00FAF796FF164A1369DB
-:1063B000BDE810400021002018471349096A82B047
-:1063C00008B921B101E011B1012002B0084702B0C3
-:1063D0007047000010B50146487A0F2818BF0E28F4
-:1063E00007D10B48FFF70AFFBDE810400020FFF778
-:1063F00006BB064C04F10800FFF700FF04F108009B
-:10640000BDE81040FFF7F7BA8C16002048170020AF
-:10641000B0160020FFF780F89DF80E0005B000BD13
-:10642000F8B500F10C026B4621214FF66640F1E70A
-:1064300080B532490020087500223148027100F011
-:10644000CDFE00F0CCFE00F0CBFE00F0CAFE00F066
-:10645000C9FE00F0C8FE00F0C7FE00F0C6FE00F066
-:10646000C5FE00F0C4FE00F0C3FE00F0C2FE00F066
-:10647000C1FEBDE8014000F0BEBE21490A7941F8E5
-:1064800022000879401C0871704770B50446607896
-:10649000FF2802BFB4F8031001F47F41B1F5406F4B
-:1064A0001FD10025154E317DE8B2884222D2E9B2D3
-:1064B00056F8211020468847002808BF6D1CF2D0EE
-:1064C00018E0761C2979F0B288420AD2F1B255F868
-:1064D0002110204688470100F3D002D0022805D0C1
-:1064E00006E02046BDE87040FFF7AAB8002070BD66
-:1064F000012070BD0026024DE4E7000030170020A7
-:10650000A417002018B50C46C7B0114600228DF81C
-:1065100000208DF81C008DF81D4022460DF11E0054
-:1065200000F06AFE00F03BF83F200C21ADF80400BB
-:10653000ADF8061007A8012103900691A41C04944D
-:1065400000F043F800284CBFFF209DF8000048B041
-:1065500010BD00B5C7B000F01BF80F2000F02AF8FE
-:1065600000284CBFFF209DF8000047B000BD00B5DB
-:10657000C7B00021ADF81C0000F016F8182000F09C
-:1065800019F800284CBFFF209DF8000047B000BD5F
-:1065900000228DF800208DF81C008DF81D101822A7
-:1065A000002101A800F02EBE8DF80010182201A8CD
-:1065B00000F028BEADF8060007A9022004903F2293
-:1065C000012003910690ADF80420CDF814D00021ED
-:1065D00001A8FFF78DBE000080B50FF2B92200219F
-:1065E0000420FEF7B0F80FF2792200210820FEF710
-:1065F000AAF8CD4800210180C18081700121C170BD
-:106600000021017101720FF24100FFF736FFBDE872
-:1066100002400FF2243000F01DBB0278C24912B1D3
-:10662000012A03D070474088C88070470020C88086
-:10663000087A08B100220A720020FEF7D6BD0021B8
-:106640000820FEF78DB800002DE9F84F0546687860
-:10665000FF2812D1B44CB5F80300618940F604421A
-:10666000801A00F08B80801E4DD0001F06D0401F86
-:1066700000F0B780401E00F0DD80EBE0B5F805606B
-:10668000207A58B10846FFF7AEF8217A062908BFEC
-:106690000028F2D120724FF6FF7060816681E879A0
-:1066A000297A91FBF0F914285FFA89F9E5D14FF0C6
-:1066B000100A00270FF29C284FF64066F8B24845B2
-:1066C000DBDA05EB0A0B9BF809009BF80A1040EA9D
-:1066D0000120B04211D16189404600F0BBFAABF114
-:1066E00007000178427841EA0221A1818178C078CF
-:1066F00041EA0021E181082121720AF106005FFAD6
-:1067000080FA7F1CDAE7B5F80500814202BF112646
-:10671000E87915283CD1297A0FF2AC290FF2702BB9
-:10672000481E28724FF6426A4FF64168287A0028C0
-:10673000A3D0A91905F10A02487A11F8057D925DE6
-:10674000497840EA022047EA01276189404508D09C
-:1067500050450CD1484600F07DFA0A202072A782ED
-:1067600005E0584600F076FA092020722782153697
-:10677000287AA0F115012972F6B2D7E7B5F805001D
-:10678000814201BF95F808B04FF00008E879012870
-:1067900060D100270FF2742942F6021AF8B2B0EB6A
-:1067A0009B0F57DA05EB080005F10A01C27A467A19
-:1067B000007B11F8081042EA0022524546EA012601
-:1067C00009D16189484600F045FA207A0A2802D1A9
-:1067D000E6820B21217208F104005FFA80F87F1C29
-:1067E000DCE7B5F80500814202BFB5F80700A18AD1
-:1067F00088422FD1687A022802BFA87A60700128E7
-:1068000028D1E87AA07046A448B9FEF7EEFC0FF252
-:10681000742000F01FFA204600F01CFA1AE00FF274
-:10682000A42000F017FA204600F014FA0020FEF72A
-:10683000D2FC0FE00FF21C2000F00CFA39A000F09F
-:1068400009FA6089B5F80510884203D100210420B7
-:10685000FDF786FF0020BDE8F28F3348007A7047CD
-:1068600010B50FF2A020304C00F0F4F92CA000F08D
-:10687000F1F92079401E8041C00F2071207A38B193
-:10688000218A6089E31CBDE81040022200F0EDBAC5
-:1068900010BD00001CB50120ADF80000224C207A8C
-:1068A00000283BD0C01F052838D8DFE800F00308D7
-:1068B0001218232F0FF28C2000F0CCF913BD0FF229
-:1068C0009C2000F0C7F9E289A189608900F079FA7B
-:1068D00013BD0FF2B02000F0BDF9218A04E00FF2E1
-:1068E000E02000F0B7F9A18A60898A1C92B200F01A
-:1068F00079FA13BD0FF20C3000F0ACF900F016F885
-:10690000062020720220FEF770FC13BD0FF21C302F
-:1069100000F0A0F900F00AF80620207213BD000074
-:10692000200A0D000A00000018170020E18A608983
-:106930006B46022200F06CBA2D2D205032502043BD
-:106940004C49454E5420494E495449414C495A45B9
-:1069500044200A002D2D2047415454203A20503223
-:10696000505F534552564943455F5555494420466B
-:106970004F554E44202D20636F6E6E656374696FB2
-:106980006E2068616E646C652030782578200A007E
-:106990002D2D2047415454203A2057524954455FE9
-:1069A0005555494420464F554E44202D20636F6E67
-:1069B0006E656374696F6E2068616E646C6520300B
-:1069C0007825780A000000002D2D204741545420DE
-:1069D0003A204E4F54494649434154494F4E5F4334
-:1069E0004841525F5555494420464F554E4420205A
-:1069F0002D20636F6E6E656374696F6E2068616EC3
-:106A0000646C6520307825780A0000002D2D204721
-:106A1000415454203A20434C49454E545F43484129
-:106A2000525F434F4E4649475F4445534352495096
-:106A3000544F525F555549442D20636F6E6E656308
-:106A400074696F6E2068616E646C6520307825789B
-:106A50000A0000002D2D2047415454203A2045566D
-:106A6000545F424C55455F474154545F50524F4329
-:106A700045445552455F434F4D504C455445200ABF
-:106A800000000000202D2D20503250204150504C4D
-:106A900049434154494F4E20434C49454E54203AB6
-:106AA000204E4F54494649434154494F4E20524588
-:106AB000434549564544202D204C4544204F4646E9
-:106AC000200A0D00202D2D20503250204150504CD6
-:106AD00049434154494F4E20434C49454E54203A76
-:106AE000204E4F54494649434154494F4E20524548
-:106AF000434549564544202D204C4544204F4E0ADD
-:106B00000D0000002D2D20503250204150504C4996
-:106B1000434154494F4E20434C49454E5420203A5E
-:106B200020425554544F4E20505553484544202D33
-:106B300020575249544520544F20534552564552F0
-:106B4000200A20005032505F444953434F5645526B
-:106B50005F53455256494345530A00002A20474196
-:106B60005454203A20446973636F76657220503222
-:106B700050204368617261637465726973746963FC
-:106B8000730A00002A2047415454203A2044697374
-:106B9000636F7665722044657363726970746F7297
-:106BA000206F66205458202D205772697465204349
-:106BB0006861726163746572697469630A000000D8
-:106BC0002A2047415454203A20446973636F766504
-:106BD000722044657363726970746F72206F6620EF
-:106BE0005278202D204E6F74696669636174696FF5
-:106BF0006E20436861726163746572697469630AC7
-:106C0000000000002A2047415454203A20456E617C
-:106C1000626C6520536572766572204E6F7469668A
-:106C200069636174696F6E0A000000002A204741A1
-:106C30005454203A2044697361626C652053657234
-:106C4000766572204E6F74696669636174696F6EF0
-:106C50000A0000000EB4C0B5024603A8002101904E
-:106C6000009101AB0121044878440C30F9F766FA31
-:106C700006BC5DF810FB00BF1B0E00002DE9F841BB
-:106C8000C7B04FF00008ADF81C00DDF838C14F9ECA
-:106C9000509F519D529C8DF8008007A84180ADF80F
-:106CA0002020ADF82230A0F808C0ADF8266087811A
-:106CB0008DF82A508DF82B4000F015F84FF4C17074
-:106CC000ADF8060007A9102004903F22012003918F
-:106CD000069000F00DF800284CBFFF209DF8000042
-:106CE00048B0BDE8F0811822002101A800F08ABA5E
-:106CF000ADF80420CDF814D0002101A8FFF7F8BAB0
-:106D000000B587B000208DF8000000F07CF840F25C
-:106D10000110ADF806003F220120069000F0EDF8CA
-:106D200000284CBFFF209DF8000007B000BD30B523
-:106D3000C7B01C464A9B00F0C7F800258DF80050EC
-:106D40008DF82140224619460DF1220000F054FA38
-:106D500000F059F83F204FF4837100F0BCF8A41DF7
-:106D6000049400F0CCF800284CBFFF209DF80000F0
-:106D700047B030BD0023ADF81C008DF8003007A8E7
-:106D8000418082800021182201A800F03BBA00B5A2
-:106D9000C7B000F010F8FFF7F6FF0F2102914FF493
-:106DA0008970022100F0A1F800284CBFFF209DF857
-:106DB000000047B000BD0021ADF81C008DF80010A8
-:106DC000704700B5C7B0FFF7D5FF0F21029140F221
-:106DD000151000F089F800284CBFFF209DF8000036
-:106DE00047B000BD00B5C7B0FFF7C4FF0F21029147
-:106DF00040F2171000F078F800284CBFFF209DF8F3
-:106E0000000047B000BD1822002101A800F0FAB927
-:106E100018B5C7B000F011F800F045F8FFF7F3FF20
-:106E200040F2211100F013F800F069F800284CBF7F
-:106E3000FF209DF8000048B010BD1446ADF81C00BE
-:106E4000002207A88DF80020418004717047ADF83A
-:106E500006103F2007A9ADF8040003910F2001217F
-:106E600002900691641D0494704718B5C7B000F0F5
-:106E700010F8FFF7C8FF3F2040F2231100F019F887
-:106E800000F03DF800284CBFFF209DF8000048B0FE
-:106E900010BD144600228DF80020ADF81C00ADF89E
-:106EA0001E108DF82040224619460DF1210000F0F9
-:106EB000A3B9ADF80400ADF8061007A801210390AE
-:106EC0000691641D04947047ADF81C00ADF81E10C7
-:106ED0008DF820207047ADF80400ADF8061007A823
-:106EE00001210390069170470621ADF80600049138
-:106EF00007A801213F2203900691ADF80420CDF8A8
-:106F000014D0002101A8FFF7F3B900B587B000F055
-:106F100010F8012003220690ADF80420ADF80620F9
-:106F200000F011F800284CBFFF209DF8000007B0CA
-:106F300000BD00208DF800001822002101A800F0FB
-:106F400061B903900691CDF814D0002101A8FFF794
-:106F5000CFB900B5C7B000F00CF8852000F075F887
-:106F600000F014F900284CBFFF209DF8000047B046
-:106F700000BD00218DF81C008DF80010182201A81A
-:106F800000F040B92DE9F841C7B04FF0000800F01B
-:106F900026F80DF12300DDF844E14E9F4F9E509DF1
-:106FA000529C8DF81F30C0F800E08DF800808DF8FD
-:106FB00020708DF821608DF822508DF8274000F068
-:106FC00087F88620ADF8060007A90C2000F0DAF853
-:106FD00000284CBFFF209DF8000000F0F2B88DF8AB
-:106FE0001C0007A8417082707047F8B5C8B005460C
-:106FF0000E4617461C4600F023F808A84670877016
-:107000008DF8205000F0D8F88A21ADF80A103F2002
-:10701000032100F0C4F8002848BFFF200ED49DF8DB
-:10702000000058B94F994E98BDF801202280BDF854
-:1070300003200280BDF805000880002049B0F0BDA3
-:1070400007220021684600F0DDB8ADF8060007A968
-:1070500001203F2203910490704700B587B000F0F3
-:1070600013F800F035F8922000F009F800F08EF8DF
-:1070700000284CBFFF209DF8000007B000BDADF810
-:1070800006003F220120704700208DF80000704765
-:1070900018B5C7B000F011F800F01AF80F210291EE
-:1070A0009720062100F065F800F071F800284CBF29
-:1070B000FF209DF8000048B010BD0024ADF81C0072
-:1070C0008DF8213007A8418002718DF8004070478B
-:1070D0001822002101A800F095B82DE9F04F0646CE
-:1070E000C7B000F020F800F012F8FFF7F1FF3F20E2
-:1070F000ADF804009C2100F030F800F04AF80028B8
-:107100004CBFFF209DF8000047B0BDE8F08F8DF820
-:107110002790B581ADF82AB03782ADF82E80B482C1
-:10712000ADF832A0704708461946559CDDF84091ED
-:10713000519DDDF848B1539FDDF85081DDF858A12D
-:10714000ADF81C60002307AE8DF8003070803271FE
-:107150000DF12100062200F04FB80F200290ADF88B
-:1071600006101820049007A901200391069070478B
-:107170000321ADF80600049107A801213F220390E6
-:107180000691704704903F22012003910690ADF8CC
-:107190000420CDF814D0002101A8FFF7A9B8ADF85C
-:1071A0000800059108A8072104900791CDF818D090
-:1071B000002102A8FFF79CB81822002102A800F0C5
-:1071C00021B848B0BDE8F08102490160024901617F
-:1071D000704700BFDF52000809530008704770472E
-:1071E00070477047704770477047704770477047E7
-:1071F000704770477047704710B50446FAF76CF84F
-:10720000204610BD10B5044610460A4601462046E9
-:1072100000F002F8204610BD62F30F2262F31F4215
-:10722000401810F0030308D0C91A1FD3DB0748BF6A
-:1072300000F8012D28BF20F8022D130030B41446A9
-:107240001546103928BF20E93C00FAD8490728BF65
-:1072500020E90C0048BF40F8042D890028BF20F821
-:10726000022D48BF00F8012D30BC7047C91818BF67
-:1072700000F8012DCB0728BF00F8012D7047000052
-:1072800010B50446AFF30080204600F005F8044630
-:10729000AFF30080204610BD7CB500F10F06F60864
-:1072A000F600B04240D2082E04D2082602E0083090
-:1072B00000F047F8DFF804512C68210005D10020C8
-:1072C00007E00268B24221D2011D08680028F8D107
-:1072D0002068291D0A68824222D01368B34238BF51
-:1072E000111DF7D312E093190B60801B54685C608A
-:1072F0000B6818601660096800291DBF48680028DF
-:10730000081D0020286002F1080076BD61B10A68FE
-:107310001068A0F10803B342E5D250680860EAE7BC
-:1073200000F04EF80028C2D1002076BD10B5040050
-:1073300006D0AFF30080204600F003F8AFF30080E2
-:1073400010BD002800D1704750B4A0F108021368A6
-:10735000072B2BD913F0070F28D1184C616809B1FE
-:107360008A4202D25160626013E0486800B39042E2
-:1073700038BF0146F9D31BE0964203D11B180B60BE
-:107380000A4606E0486810B1134498420ED3506094
-:107390004A60506850B11368D118814206D100216B
-:1073A00021600168CB1813604068506050BC704782
-:1073B00008680E18B242DFD250BC70479C170020FC
-:1073C0000749086808B1002070470648C008C00097
-:1073D00008600549C908C900091A0160704700BF63
-:1073E000C0170020CF270020C82B00202DE9F04136
-:1073F00007468846387810F0030F16461D4633D0EE
-:10740000384600F099F878BBB8F1000F1CBFD8E9F6
-:1074100000018619012D2ED13888C10415D5396A8D
-:1074200007F14402384600F0A3F83A6B044602B96B
-:107430003A69F968384600F09BF8361B341A7A69C5
-:10744000F968384600F094F8261A1EB94DB916F1BD
-:10745000010F09D097F903002A46314600F08EF853
-:10746000064616F1010F09D12320AFF300804FF03B
-:10747000FF30BDE8F081022DE8D1EBE7388810F449
-:10748000405F0ED07868F86038617861B8617868DC
-:10749000F86107F14400386207F13000786200209B
-:1074A0003863B8F1000F05D0D8E9020107F13402C2
-:1074B000C2E9000139884CF6FF60014039800020A4
-:1074C000BDE8F08170B50546AFF3008028888104DF
-:1074D00015D56E680024EA6895F90300314691429B
-:1074E00012D2521AFDF714FE10F1010F1CBF002832
-:1074F0003618F0D10FE04DF6FF7001402980284684
-:10750000AFF30080002070BD00220021FDF700FED7
-:1075100010F1010F00D101246868E860A861E861FA
-:10752000002C2988E7D041F4007129802846AFF368
-:1075300000804FF0FF3070BDF8B5A0B9AFF3008008
-:1075400000250A4E08244FF0FF37306820B1FFF7BE
-:10755000B9FF002848BF3D46361D641EF5D1AFF384
-:1075600000802846F2BDBDE8F240ABE7D011002014
-:10757000914234BF511A0021084670473EB50400BD
-:107580000D00012A02D100F063F807E0022A07D1BA
-:1075900000940020019069460C20ABBE2D1801E03C
-:1075A000002A0CD10094019569460A20ABBE002840
-:1075B00005D100222100280000F027F801E000207A
-:1075C000C04303B030BD000010B4314A002113465F
-:1075D0001C6884421EBF491C9C6884421EBF491C13
-:1075E0001C69844209D09C69491C844205D0491C0D
-:1075F00020331029ECD310BC7047002342F83130FF
-:1076000002EBC1014B6010BC704778B4204C0023E2
-:1076100025462E688E421EBF5B1CAE688E421EBF82
-:107620005B1C2E698E4209D0AE695B1C8E4205D070
-:107630005B1C2035102BECD372BC7047054604EB65
-:10764000C303012A04BF59684D195D6072BC7047BD
-:1076500010B40F4A002113461C6884421EBF491C07
-:107660009C6884421EBF491C1C6984420AD09C69E4
-:10767000491C844206D0491C20331029ECD310BC8D
-:107680000020704702EBC100406810BC704700004A
-:10769000AC14002010B50446E068A169884251D3BB
-:1076A000218849F202030B40022B08D008044CBF8A
-:1076B0004FF400704FF48440014321803BE001F41B
-:1076C000C042B2F5C04F06D1A168884203D320461C
-:1076D000FFF732FF78BB208810F4406F02BF60686C
-:1076E00004F14401884217D14FF40070FFF7C8FD40
-:1076F000606030B904F144006060E060401CA0604C
-:107700000AE0218841F040012180E060606100F5DD
-:1077100000726068A260E06160682061A068A0619A
-:10772000207841070AD502220021204600F00CF8FB
-:1077300010F1010F02D14FF0FF3010BD208840F44E
-:10774000C0402080002010BD70B504460D4616468E
-:10775000AFF3008033462A4600212046FFF746FE5D
-:1077600005462046AFF30080284670BD38B50400BA
-:107770000ED0207810F0030F03D094F903000028F6
-:1077800009D5AFF30080204600F030F8AFF3008059
-:107790004FF0FF3032BD2046FFF7CEFE0546AFF377
-:1077A00000802078410644BF606800F05DF800204A
-:1077B000606094F90300022804D900F057F808B17A
-:1077C0004FF0FF35E06B48B100F05CF808B14FF0C6
-:1077D000FF35E06B00F048F80020E063204600F041
-:1077E00005F8AFF30080284632BD000001780A0694
-:1077F00026D51C4A13680021834203D1002342F896
-:1078000021301BE05368012183421EBF022193688F
-:107810008342F3D0D368032183421EBF042113693E
-:107820008342EBD05369052183421EBF0621936931
-:1078300083421EBF0721D3698342DFD000F014B812
-:10784000002101804FF0FF31C17000F1440141601F
-:10785000C160016141618161C161016200F130017A
-:1078600041627047D0110020FFF760BD1CB50200D7
-:10787000009269460220ABBE04001000FFF7A4FE90
-:10788000200016BDE0B50090F9F7D8FC01906946DC
-:107890000E20ABBE03B000BD38B50C46C5B22046C5
-:1078A000AFF30080E068A169884204D32046FFF767
-:1078B000F1FE00280FD4E068401CE06000F8015D94
-:1078C0002088010503D440050BD50A2D09D1204697
-:1078D000FFF732FE28B12046AFF300804FF0FF30B3
-:1078E00032BD2046AFF30080284632BD7047FEE728
-:1078F000FEE7FEE7FEE770477047704700F01EB8EE
-:107900000548FBF7CDBB0548FAF763BB0448FAF717
-:1079100060BB0448FBF7C4BB2C150020A01300205B
-:10792000141300208C1500201020FCF724BCFDF758
-:1079300036BAFEF7A7BBFEF77BBB000002490A6818
-:10794000886882180A6070475010002019E050F8CB
-:10795000042BD30744BFA9F101039A18091F002380
-:10796000042942F8043BF9D25FEA817C134604D52E
-:107970004FF0000CA2F800C09B1CC90744BF0021B7
-:10798000197050F8041B0029E1D1704738B50D4D2E
-:107990000824286800281CBF017811F0030F05D0C7
-:1079A00090F90310002958BFFFF7E0FE2D1D641E5B
-:1079B000EFD1BDE83840002200214FF0FF30FDF745
-:1079C000A7BB00BFD011002010B50749794418317A
-:1079D000064C7C44163404E00A68081D11448847AC
-:1079E0000146A142F8D110BD2C000000500000005B
-:1079F0004EF68851CEF20001086840F4700008602D
-:107A0000BFF34F8FBFF36F8F4FF00070E1EE100A9E
-:107A10007047000039FFFFFFD8050000F01100207B
-:107A2000800800002000032000000000A796FFFF50
-:107A30008401000096010000040000200000000006
-:107A40000000000000000000000000000100000035
-:107A500002000000030000000400000000F00DF828
-:107A6000002801D0FFF7B0FFAFF300800020AFF394
-:107A70000080FCF7FCF800F002F80120704700F0ED
-:107A800001B800000746FFF781FF3846FAF708FA09
-:107A9000FBE738B504460D46284600F005F8A84235
-:107AA00018BF0024204632BD0149FFF7F5BE00BFD4
-:107AB000401100200148804701480047014200086A
-:107AC000C57A0008AFF30080FFF792FFFFF7C6FF0B
-:107AD00000002E004300FFF7FEBFFFF7FEBFFFF7D9
+:10000000D0270020597A0008357800083778000892
+:10001000397800083B7800083D78000800000000AF
+:100020000000000000000000000000003F78000811
+:100030004178000800000000437800084578000877
+:100040007B7A00087F7A0008837A000877780008B6
+:10005000877A00088B7A00088F7A0008937A000864
+:10006000977A00089B7A0008717800089F7A000848
+:10007000A37A0008A77A000849780008AB7A00083C
+:10008000AF7A0008B37A0008B77A0008BB7A000894
+:10009000BF7A0008C37A0008C77A0008CB7A000844
+:1000A000CF7A0008D37A0008D77A0008DB7A0008F4
+:1000B000DF7A0008E37A0008E77A0008EB7A0008A4
+:1000C000EF7A0008F37A0008F77A0008FB7A000854
+:1000D0004F78000855780008FF7A0008037B000875
+:1000E000077B00080B7B00080F7B0008137B0008D0
+:1000F0007F7800087B780008177B00081B7B0008CE
+:100100001F7B0008237B0008277B00082B7B00084F
+:100110002F7B0008337B0008377B00083B7B0008FF
+:100120003F7B0008437B00085B780008477B0008A2
+:100130004B7B00084F7B0008537B00082DE9F04FF4
+:100140000FF2A41CA1B0DCE90089CDE900892A9D49
+:10015000DFF8DC9B049100248DF843500D944FF0A0
+:10016000FF38824616461F460FE0B3462C461BF862
+:10017000011B0498D0470028049000F0A2800D983D
+:10018000401C641E0D90F2D176193078252808D1D4
+:10019000002100220791089209910A920B910C927A
+:1001A0000DE06A464146304600F0DAFF050001D115
+:1001B0000D98A1E0D9D50125E6E741F0010116F837
+:1001C000010F2028F9D023280CD02B2804D02D286B
+:1001D00005D0302809D076E041F00201EFE741F088
+:1001E0000401ECE741F00801E9E741F01001E6E71E
+:1001F0000F9209E00F98484505DA00EB800402EB06
+:100200004402303A0F92761C3278A2F130000A286C
+:10021000F0D330782E2818BFCDF8388022D116F8C8
+:10022000010F2A2807D138683860761C50F8042B53
+:1002300038600E9216E02D280CBF761C002000229C
+:100240000E920AE040B90E9A4A4505DA02EB8204A2
+:1002500003EB4403303B0E93761C3378A3F130025A
+:100260000A2AEFD3ADF8401021A0317800F082FFC8
+:1002700008B116F8010B8DF842009DF8420068287D
+:1002800004D1307868280AD1622105E06C2804BFC7
+:1002900030786C2803D171218DF84210761C12A899
+:1002A00006903A4616F8013B02A9504600F064F861
+:1002B00038B912AA02A9504600F0C8F900287FF503
+:1002C00064AF404618E02A2892D13A683A6052F862
+:1002D000040B3A6000280F9003D540420F9041F084
+:1002E0000401761C95E700000000000000000000FB
+:1002F000686A6C747A4C000021B0BDE8F08F622807
+:1003000020D0682811D06A2803D06C2827D0712803
+:1003100025D10868C01D20F007000860D0E900233F
+:1003200008300860194610467047002A0A680A60BB
+:10033000106803D0121D0A6000B217E0121D0A6097
+:1003400080B217E0002A0A680A60106803D0121D04
+:100350000A6040B20AE0121D0A60C0B20AE0002A38
+:100360000A680A60106803D0121D0A60C11770473E
+:10037000121D0A60002170477CB50D4611461C46CF
+:100380002E69B4F1250200F04F811C3A00F0848000
+:10039000121F022A40F280800E3A00F00981521F9B
+:1003A00059D0093A78D0921E16D0521E35D0521E1E
+:1003B000022A71D9121F30D0521F00F09880521EAD
+:1003C00049D0521E00F0E280D21E00F0FF80921E43
+:1003D00041D0D21E3FD02DE195F83A406C2C09D087
+:1003E0006869421C6A610A680A6052F8043B0A6044
+:1003F000335429E10A680A6052F8043B0A6000930A
+:10040000002201924FF0FF332B636A46294600F029
+:1004100098F9002840F1188103E195F83A0001228B
+:10042000FFF76DFFC5E90001002904D56869411C8B
+:1004300069612D220DE0288F810704D56869411C70
+:1004400069612B2205E0C00721D56869411C6961FB
+:10045000202232541BE095F83A000022FFF74FFFAC
+:10046000C5E9000195F83800010710D5D5E900234A
+:10047000002B08BF002A0AD044F02000782806D1BB
+:10048000686930213154401C421C6A613454214651
+:1004900068693044E86087E00868C01D20F0070004
+:1004A0000860D0E9002308300860C5E90023D5E9D9
+:1004B0000001C80F04D06869411C69612D220DE05C
+:1004C000288F810704D56869411C69612B2205E0EA
+:1004D000C00704D56869411C6961202232546869EB
+:1004E0003044E8602146284600F036FAACE005F1D9
+:1004F0003A02507820B14FF0FF340FF6043074E028
+:100500001078622808D0682824D06A2812D06C2875
+:100510002ED071280ED02BE00A680A6052F8040B26
+:100520000A6020B94FF0FF340FF6EC205DE0E96A75
+:10053000017089E00A680A6052F8040B0A6020B969
+:100540004FF0FF340FF6D0204FE0EA6AD317C0E92E
+:10055000002379E00A680A6052F8040B0A6020B9A7
+:100560004FF0FF340FF6B0203FE0E96A01806BE006
+:100570000A680A6052F8040B0A6020B94FF0FF3491
+:100580000FF6942031E0E96A01605DE00A680A60D4
+:1005900052F8040B0A60002120F0000221F0FF3322
+:1005A000C5E90023EE607821284600F02DF94BE0E4
+:1005B0006C2285F83A200B680B6053F8042B0B6013
+:1005C00052BB4FF0FF340FF684200EE095F83A202E
+:1005D0006C2AF0D00868086050F8044B0860EC60A2
+:1005E0003CB94FF0FF340FF6482000F0EBFD201A25
+:1005F00076BD2E6B002E04D5204600F003FE044687
+:1006000008E032460021204600F026FE002814BFF4
+:10061000041B3446AC6117E0294600F092F800282C
+:1006200012D54FF0FF3076BD6869411C6961252203
+:10063000325409E06969481C68612522725421001E
+:1006400002D0431C6B613454002076BD2DE9F0418B
+:100650000E4605469046726B7069316AB46A121A8A
+:10066000B069521A716A121AF069521A121A96F87F
+:100670003800141B41070DD4002C0BDD2746B06851
+:100680002021A8470028B06057D0F06A401C7F1E88
+:10069000F062F4D1736942463146284600F098FC76
+:1006A00000284AD1376A002F0ADDB0683021A847F8
+:1006B0000028B06041D0F06A401C7F1EF062F4D187
+:1006C000B369F2683146284600F082FCA8BB776A1D
+:1006D000002F09DDB0683021A847B06068B3F06A28
+:1006E000401C7F1EF062F5D1F068B169F3694218D1
+:1006F0003146284600F06CFCF8B9B76A002F09DDD6
+:10070000B0683021A847B060B8B1F06A401C7F1EC5
+:10071000F062F5D196F8380041070BD5002C09DDC1
+:10072000B0682021A847B06038B1F06A401C641E50
+:10073000F062F5D10020BDE8F0814FF0FF30BDE858
+:10074000F0812DE9F8470D46A3B02F6B002F064628
+:10075000904648BF6FF000470FF60C1400F0A8FD5C
+:10076000D4E90023696B4018CDE90123812828BF13
+:100770004FF0FF3042D20024002F33DDD8F80010B4
+:1007800001AA684600F0EEFC8146B9F1000F38D4AA
+:10079000D8F8000010B9B9F1010932D44F4521DB76
+:1007A0006869484481280AD30021696303AA29465D
+:1007B0003046FFF74BFF040014D40020686103AB00
+:1007C000D5F814A04A46694603EB0A0000F076FD0E
+:1007D000CA44C5F814A058F8040B002818BFA7EBAA
+:1007E0000907C9D14CB903AA29463046FFF72EFFA5
+:1007F000044614B9002068616863204624B0BDE84F
+:10080000F0874FF0FF34F8E72DE9FC4307466F29E6
+:100810003E6908BF082405D041F02000782814BFA5
+:100820000A2410243C25D7E90023642918BF69292C
+:100830009046994605D1002B03D5D8F1000869EB05
+:100840004909B9F1000F08BFB8F1000F1FD1386B8B
+:10085000E8B9082C4CD197F83800010748D530206A
+:100860003B2586F83B0043E000280ED597F838007A
+:1008700000F01400102808D17B6B7969386A5B1A84
+:100880001B1A9A1A002AC8BF3A62BDE8F3838DF892
+:100890000010404649462246E31700F01BFD303267
+:1008A000D0B26D1E3A28019504DB9DF80000A0F13E
+:1008B00051018A187255404649462246E31700F016
+:1008C00009FD80465FEA010908BFB8F1000F03D0B7
+:1008D000F86871198842DCD3082C09D197F83800E0
+:1008E000010705D5705D302802D06D1E302070558F
+:1008F000C5F13C02BA617119F960386B8242B3DA12
+:10090000821A3A624FF6EF70398F01403987BDE89D
+:10091000F3832DE9D04306460F4614464FF00008F6
+:10092000DFF8109412E0E00707D542464B46304608
+:10093000394600F053FD06460F46404649464246BA
+:100940004B4600F04BFD641080468946002CEAD1EE
+:1009500030463946BDE8D0832DE9F84F05468A4632
+:100960004AF020048EB0D5E90089612C02AE09D08E
+:10097000286B002848BF062003D408BF672C01D18C
+:1009800001202863D5E900014A005215521C0DD1FF
+:100990000B030BD0AAF1610103201A29A86102D22E
+:1009A0000FF2CC6110E00FF2CC610DE04A0052155D
+:1009B000521C0ED10B030CD1AAF1610103201A299C
+:1009C000A86116D30FF2B461E868032200F076FC48
+:1009D000C0E1CDE90C01DDE90C2323F00043B3F5C0
+:1009E000801F0DD20027002B08BF002A019703D1DA
+:1009F00011E00FF28461E7E701AA00F0C1FD0AE00F
+:100A0000CD48CE4900EB1350DDE90C2301900B409B
+:100A1000CB4910461943C5E90001612C0DD1E868A6
+:100A200030210170821CBAF1610FEA600CBF78219D
+:100A3000582141706869801C6861D5E90001CDE9E1
+:100A40000C01DDE90C2333F0004104BF0028002332
+:100A500000F04881612C40F0A080286B49460028B6
+:100A60004CBF4FF0210B00F1010B40460022002348
+:100A7000DDE90C8900F0BCFD01990BF1010738BFDD
+:100A800089F00049091F002F01918DF808200DF110
+:100A9000090040F33581A949009106464046494680
+:100AA0000022002300F0BCFD80F029814800400DA9
+:100AB00000F11C0211D0002A0FDD40F2FF739A42B0
+:100AC00005DBA04909F000400143002011E0009B34
+:100AD000194041EA025140460BE028F0000039F08D
+:100AE000004108BF00280FBF49461C22494600F0BC
+:100AF000AFFD8046894600F049FEFF1F002F0446E7
+:100B000009DD00F061FE02460B464046494600F012
+:100B10006DFE80468946F01D072104E004F00F02B7
+:100B200000F8012D2411002C01DD491EF6D5491EC7
+:100B30005CBF002200F8012DF9D5DCE00020194649
+:100B400002AA0A4400E05B1E12F80149491E8442D1
+:100B5000F9D00F2804D10DF10900425C521C425417
+:100B6000002904D50198001D02AE5B1C0190581E9F
+:100B70000CD43118AAF13A040A783032D7B23A2F9D
+:100B8000A8BFA218401E01F80129F5D5286B00283E
+:100B900040F1A780591E2963A3E001996A4A47F2F0
+:100BA0009750414391FBF2F2019229F00046D2F1B5
+:100BB000070204DD40463146FFF7ABFE0AE0524231
+:100BC00000206249FFF7A5FE02460B46404631462B
+:100BD00000F07EFE8046662C286B06BF019F0A3718
+:100BE00006273F18142FC8BF142730208DF808009F
+:100BF00089460DF1090000E03046002F34DD06463D
+:100C00004046494600F088FF01460A4606F10803BF
+:100C100004200A26B2FBF6F606EB860EA2EB4E0285
+:100C2000303203F8012C0A22B6FBF2F202EB820EFC
+:100C3000A6EB4E063036401E03F8026DE9D1083FA0
+:100C4000002F03F10806D7DD084600F079FF0246C1
+:100C50000B464046494600F0C9FD00223C4B00F0DF
+:100C6000BDFB80468946CBE70DF10901401A0DF125
+:100C7000090604E00199491E401E0191761C317855
+:100C80003029F7D0662C02D10199491C03E0652C6C
+:100C90000CBF012100212B6BCB189842B8BF431E1B
+:100CA000002B1ED4834204DAF05C3528A8BF39201B
+:100CB00000DA30201946721E02EB010800E05B1ECC
+:100CC00018F80199491E8145F9D0392802D1705C84
+:100CD000401C7054002904D50198401C16465B1C2A
+:100CE0000190019800B200901BB23246514628464E
+:100CF00000F034F82EE0C61D002F3FF7CFAE30468F
+:100D00000DF10901401A03465845C8BF5B46002B48
+:100D10000DF109063FF53AAF8342BFF60FAF0DF173
+:100D20000900C15C07297FF709AF0F2007E7000022
+:100D3000CBCCCC0C0000244002FCFFFFFFFF0F8057
+:100D40000000E03F0000F07FA08601000000F03FBF
+:100D500084D797410FB0BDE8F08F00002DE9F84728
+:100D600083B006468A461746984600F0FDF9B8F16A
+:100D7000000F406A356B90F8009002DC4FF00108DC
+:100D8000BFA74AF02000BDF93040662808BF641CA8
+:100D900015D0672840F0848014F1040FC0F28680DB
+:100DA000AC4280F2838096F83800641C010702D4BC
+:100DB000A845B8BF454620B22D1A48BF00250FFAF6
+:100DC00084FAF068B169BAF1000F25DC4A1C3023BF
+:100DD0004354002D03DC96F83800010703D5F06872
+:100DE00000F80290521C15EB0A0FB8BF6C4220B2FB
+:100DF000441941424445B8BFA046B26171620FFA3E
+:100E000088F5F561F068B3692A463946184400F060
+:100E100055FA641BB462C4E022B29045084417DA64
+:100E20004246394600F04AFAB0694044B061AAEB44
+:100E30000801002D716203DC96F838100A0705D509
+:100E4000F16801F80090F069401CF061B562A8E01B
+:100E5000394600F033FAB069002D5044A8EB04087D
+:100E600003DC96F838100A0703D5F16801F8009002
+:100E7000401CB0610FFA88F08542F368B069B8BFD2
+:100E8000A8460FFA88F207EB0A01184400F016FA98
+:100E9000B1690FFA88F00144B161281A706280E0EC
+:100EA000BAF1610F14D14FF0700A16E0A84504DAC8
+:100EB00096F838100A0758BF45466D1E48BF0025F2
+:100EC000BAF1670F14BF4FF0450A4FF0650A04E00E
+:100ED000BAF1410F08BF4FF0500AB169F368481CDE
+:100EE000B061002D17F8012B5A5403DC96F8381026
+:100EF0000A071BD5F168431CB36101F80090002D6F
+:100F000014DDA8F101080FFA88F039468542F76828
+:100F1000B8BFA8460FFA88F2F81800F0CFF9B06908
+:100F20000FFA88F108446D1AB0617562F068B16912
+:100F30000844002C80F800A003D42B224270811CAE
+:100F400003E02D2141706442811C00206A460AE0C2
+:100F500023460A2493FBF4F404EB8405A3EB450336
+:100F600002F8013B401C24B2002CF1DC012806DC15
+:100F70004AF02002652A04BF302201F8012B48B94B
+:100F8000302001F8010B07E0401E1DF8003030331F
+:100F900001F8013B0028F7DCF268B0691044091A37
+:100FA000F16196F8380000F0140010280DD1726934
+:100FB000B169706A8A18F1698218B06A8A18821851
+:100FC000706B8242BCBF821A326204B0BDE8F08707
+:100FD000F8B505460E4617461C46002074B117F8B2
+:100FE000011BB068A847B06030B1F06A401CF062E5
+:100FF0000020641EF3D1F2BD4FF0FF30F2BD0000BF
+:101000007072696E74665F733A20256E206469732E
+:10101000616C6C6F776564007072696E74663A20FB
+:1010200062616420256E20617267756D656E740063
+:101030007072696E74665F733A2062616420257312
+:1010400020617267756D656E740000007072696E64
+:1010500074665F733A2062616420256C732061724C
+:1010600067756D656E7400000000000000000000F0
+:101070006E616E004E414E00696E6600494E46003C
+:101080003000F0B40246106895681318506803EBFE
+:101090005004C0071DD54D441BE013F8017B05F833
+:1010A000017B491EF9D1A0B1B60813F8011B06F067
+:1010B0000306032E08BF13F8016B01EB062149421A
+:1010C000801C294405D011F8016B05F8016B401E06
+:1010D000F9D1A3420ED013F8016B16F0030104BF3F
+:1010E00013F8011BC91C30090F28DAD113F8010BC2
+:1010F0000F30D6E7F0BC02F10C0070471B48704778
+:1011000070B45368D418042B09DA41B1057804F897
+:10111000015B10F8016B16B15B1C491EF3E75360CD
+:1011200070BC704738B514461D4661B1FFF7E8FF43
+:1011300061686A6B204690476FF00102811A02D005
+:10114000491E01D001E003E005E00021616032BDED
+:101150006FF0010032BD4FF0FF3032BDDA6B104747
+:10116000024BDFE7014BF9E701487047B010002060
+:1011700078100020C9B202788A421AB11CBF10F858
+:10118000012FF9E718BF0020704730B4002513E0A5
+:1011900050F8042BD30744BFA9F101039A18091F83
+:1011A000042942F8045BFAD213468C0744BF158029
+:1011B0009B1CC90748BF1D7050F8041B0029E7D1CC
+:1011C00030BC704780B500B906A005490B681BB15B
+:1011D00022220021984701E000F0BFFC222002BD3E
+:1011E000C4170020636F6E73747261696E74206837
+:1011F000616E646C65723A20626164206D65737320
+:101200006167650000F10103810704D010F8011B3C
+:10121000820781B1FAD10268A2F10131914311F044
+:10122000803104BF50F8042FF6E709BAB1FA81F112
+:1012300000EBD100401CC01A7047B1F5807F02D38B
+:101240004FF0FF3070470170012070470078401E5A
+:101250008041C043C00F7047C9B2830706D0521EF9
+:1012600022D310F8013B9942F7D11FE0083A13D37B
+:1012700002F1040241EA012141EA014150F8043B34
+:10128000121F21BF4B40A3F1013C2CEA030C1CF0C0
+:10129000803FF3D0C9B2001F083210F8013B521E44
+:1012A00028BF91EA030FF8D818BF0120401E7047ED
+:1012B00080B5FFF723FF006C02BD00004AB10000BB
+:1012C00011F8013B521E00F8013B1CBF11F8013B15
+:1012D000F8E77047D3BBD9B1B2F5803F5BD2022AA1
+:1012E0001ED98C46B1FBF2F102FB11C31B0443EA89
+:1012F0001043B3FBF2FC02FB1C3380B240EA034311
+:10130000B3FBF2F002FB103240EA0C4000237047BE
+:10131000022A05D98446B0FBF2F002FB10C27047E6
+:101320004AB105D100F0010249085FEA3000704778
+:1013300000220023704700F013BC0B0002000021C4
+:1013400000207047F7D3002200237047904271EBD2
+:10135000030CF2D370B5B1FA81F4B3FA83F52C1B08
+:10136000A340C4F1200532FA05F63343A2405FF0F2
+:101370000046E64002E05B085FEA3202841A71EB45
+:10138000030524BF204629467641F4D302000B0012
+:101390003000002170BD70B5B1FA81F4B2FA82F567
+:1013A000C4F120046419B4F12006DAD3B2405FF02E
+:1013B0000044F440002502E052085FEA3303C61AF5
+:1013C00071EB020E24BF3046714664416D41F3D388
+:1013D00002000B002000290070BD0000B0B581EABA
+:1013E000030C0CF0004C40F2FF7515EA11541DBFC0
+:1013F00015EA1357AC42AF4239E0E41923EA4553EA
+:1014000043F48013C90241F0004141EA505EC70233
+:101410001100A7FB020200284FF00000EEFB0120A4
+:101420004FF00001E3FB072118BF42F00102401812
+:1014300000214941E3FB0E01A4F580640F0302D2B1
+:1014400052004041494154F101046CDD470872F1FA
+:10145000004250F1000051EB0451A1F580115CBF36
+:1014600041EA0C01B0BD4CEA05510020B0BD05EACF
+:101470001357AC4214BFAF4241E050EA410E1CBFCB
+:1014800052EA430E02E061460020B0BD24423C44D3
+:101490001BD15FEA070EF6D0090302BF0146002008
+:1014A000AEF1140EB1FA81F7AEEB070401FA07FEB4
+:1014B0000C37C7F1200100FA07F7C8404EEA000ECA
+:1014C00023EA455343F48013A2E733F00043B3FA11
+:1014D00083F704BFB2FA82FE77440B3FE41BB7F1F7
+:1014E000200E2FBF02FA0EF3BB40C7F1200E22FAE6
+:1014F0000EFE38BF43EA0E03BA40641C82E750EA8E
+:10150000410E14BF52EA430E6FF000014FF4001772
+:1015100017EB430F8ABF194617EB410FB5E74CEAAB
+:1015200005510020B0BDD4F10104B4F120070FDA59
+:10153000C4F12007520828BF42F0010210FA07F553
+:1015400001FA07F7E1BF2A43E0403843E1400FE0EA
+:10155000352C98DCC7F1200452EA400220FA07F249
+:1015600018BF42F0010231FA07F0A1400A430021FE
+:1015700072F1004250F1000051EB0C01B0BD0000CF
+:1015800010B5144600F002F8226010BDC1F30A53F2
+:1015900043B14A0012F5001F28D2A3F2FE32A1EB9C
+:1015A0000251704750EA410C20D001F0004C31EA62
+:1015B0000C01B1FA81F204BFB0FA80F3D2180B3AF1
+:1015C000B2F120032CBF00FA03F1914041EA0C0173
+:1015D0003EBFC2F1200C20FA0CF319439040524256
+:1015E00040F2FD33D21A01EB0351704700227047DD
+:1015F0004FF4001C1CEB410F94BF1CEB430F09E0A0
+:1016000041EA030C50EA4C0C52EA0C0C03D299420A
+:1016100008BF9042704714BF8B428242704700005F
+:101620004FF4001C1CEB410F94BF1CEB430F09E06F
+:1016300041EA030C50EA4C0C52EA0C0C03D28B42E8
+:1016400008BF8242704714BF994290427047000021
+:10165000124254D440F2FF7C1CEA11530FD0634570
+:1016600031D09B1863453CBF01EB0251704701F03C
+:10167000004141EA0C510020AFF30080704750EA6E
+:10168000410320D001F0004C91EA0C011CD0B1FACA
+:1016900081F30B3B9A420DD9D21A994051EA0C01C1
+:1016A000C3F1200C20FA0CFC61449840531C40F21A
+:1016B000FF7CD7E7914041EA0C01C2F1200C20FAEF
+:1016C0000CF3194390407047B0FA80F31533202B88
+:1016D000E0D3202AEED3203A203B9A4209D9D21AED
+:1016E00000FA03F141EA0C010020531C40F2FF7C98
+:1016F000B8E700FA02F141EA0C01002070475242BB
+:1017000040F2FF7C1CEA11530DD06345DBD0B2EBF5
+:10171000030C3CBFA1EB025170470CF1010221EA1E
+:10172000035141F4801150EA410CCCD001F0004C3F
+:10173000352A27DC30B481EA0C01B2F1200309DA42
+:10174000C2F12003044601FA03F5D0402843D140FA
+:101750009C400CE0C3F12002450020FA03F418BFBE
+:1017600044F0010421FA03F091400C43002174F18C
+:10177000004550F1000051EB0C01244230BC7FF4D5
+:101780007BAF70476146002076E70000C1F30A5343
+:1017900040F2FE329B1A14DDD3F120034FEAE172CE
+:1017A00008DDC90241EA505141F00040D84080189C
+:1017B0005040704703F2E13010B1D24382F0004054
+:1017C0007047002070470000C11768B14840401AB8
+:1017D000B0FA80F29040D21CC907C2F5846241EA97
+:1017E000025202EBD02140057047000070B44FF068
+:1017F000004591EA030F40F1B5816B40841A71EB0B
+:10180000030603D2001BB141121973414FF4001CAF
+:101810001CEB410F34BF7CEB430442E00C0DA4EB06
+:101820001356352E4FDC45EAC323DB0A45EAC121B6
+:10183000C912B6F120050DDD63FA05F6EB4086EA24
+:101840000305124218BF45F00105C01851F100010F
+:101850000CD213E062FA06F5F2405540F3415A40CB
+:10186000B340F3405A408018594107D349085FEA12
+:1018700030005FEA350528BF45F0010501F580110C
+:10188000420875F1004250F1000041EB04514E0056
+:1018900016F5001F70BC38BF70470020090D090500
+:1018A00070471CEB410F10D252EA43060BD0BCEB41
+:1018B000410F05D80C0DAB43661E342EB6DD02E099
+:1018C000AB438018594170BC704770BC7047000032
+:1018D000F0B540F2FF7581EA030C0CF0004C15EAFC
+:1018E00011541DBF15EA1357AC42AF42E5E0BC41AD
+:1018F000C1F31301C3F31303801A994143F4801316
+:1019000004D2641E4000494180185941C90241EA8D
+:101910005051B1FBF3F603FB1611A2FB0675D7EB92
+:10192000C020A94102D2761E80185941C90241EA5D
+:101930005051B1FBF3FE03FB1E11A2FB0E75D7EB5A
+:10194000C020A94103D2AEF1010E8018594189028D
+:1019500041EA9051760546EA8E2EB1FBF3F603FB81
+:101960001611A2FB0675D7EB8020A94102D2761E84
+:1019700080185941C90241EA50514EEA060EB1FBA6
+:10198000F3F603FB1611A2FB0675D7EBC020A941A5
+:1019900002D2761E80185941C90241EA5051B1FB6A
+:1019A000F3F703FB1711A2FB0735D3EBC020A941C6
+:1019B00067F100070CBF004247F0010766F3D52727
+:1019C0004FEA1E31B80814F5806412DDBD0775F1C9
+:1019D000004250EB0E5051EB045111F5801F5CBFDB
+:1019E00041EA0C01F0BD4CF07F6141F0E041002084
+:1019F000F0BDBD076D0840EA0E5041F48011D4F1EE
+:101A00000104B4F120060ADAC4F120060200E04025
+:101A100001FA06F3E1401843B24015430EE0342CBE
+:101A200013DCC6F1200445EA40056D0820FA06F2F1
+:101A3000154321FA06F0A1400D43002175F1004243
+:101A400050F1000051EB0C01F0BD00205FEA0C01E9
+:101A5000F0BDCFB992185B41B3FA83F704BFB2FA75
+:101A600082F6BF190B3FB7F120062FBF02FA06F32B
+:101A7000BB40C7F1200622FA06F638BF3343BA400E
+:101A80001CB1E419641E33E77F4231F00041B1FA22
+:101A900081F404BFB0FA80F6A4190B3CB4F120061F
+:101AA0002FBF00FA06F1A140C4F1200620FA06F685
+:101AB00038BF3143A0403C1B1AE7AC421ABF05EACD
+:101AC0001357AF4212E050EA41061CBF52EA4306E8
+:101AD000BFE750EA4107304661461CBF41EA055165
+:101AE000F0BD52EA430C08BFC143F0BD00204FF4E3
+:101AF000001616EB410F98BF16EB430F08BF16EB0D
+:101B0000410F24BFC14305E016EB430F0CBF6146F4
+:101B10004CEA0551F0BD0000400D491840EA812013
+:101B20000CD2490DA1F58061491C40F0004005DB55
+:101B3000D1F11F0154BFC840C01770470020704743
+:101B4000014648B1B0FA80F18840C91CC1F58461F2
+:101B5000090501EBD02140057047012000F0B8B81D
+:101B600070470000841A71EB030604D26E40001B1C
+:101B7000B141121973414FF4001C1CEB410F34BFEB
+:101B80007CEB430683E00C0DA4EB1356362E00F3DA
+:101B90007C80012E45EAC32341DC43EA525312BF45
+:101BA000D20292025B08240545EAC12141EA505164
+:101BB000D2EBC020994125D407D1B0FA80F610FAB3
+:101BC00006F162D00020203608E0B1FA81F6B1407B
+:101BD000C6F1200220FA02F21143B0404FEAF47439
+:101BE000B4EB465434F001064FEA74040AD8D6F533
+:101BF0000016760D04F00044F04061FA06F2504001
+:101C0000F1404840C00A40EA415021F0004128BF5D
+:101C10005FEA500550F1000044EBD12135E0DB0ACA
+:101C200045EAC121C90AB6F120050EDD42EA0242A9
+:101C3000120CC5F1200603FA06F6EB4042EA06054F
+:101C40006D42984161F100010DE062FA06F5F24043
+:101C5000554063FA06FC82EA0C02F3405A406D429A
+:101C6000904161EB030111F4801F05D1641E6205F0
+:101C700002D06D004041494121F48011430875F1C3
+:101C8000004350F1000041EB045170BC70471CEB65
+:101C9000410F15D223F0004352EA43060BD04FEA1E
+:101CA0004C0CBCEB410F04D80C0D661E342EB7DD76
+:101CB000EBE7801A994150EA410608BF0021E4E7AA
+:101CC00008BF1CEB430F28BF6FF00001DDE70000E9
+:101CD00080B5AFF30080024A11001820ABBEFBE7CD
+:101CE0002600020038B5040009D004F17C056968BB
+:101CF00009B900F01EF800F021F8012801D10120F7
+:101D000032BDA06A08B100F02AF800F00AF821F00C
+:101D10002A01FFE7816000F01BF8BDE8324000F0C7
+:101D20002EBE2068416821F490414160206881689E
+:101D3000704700202870204600F04FBF24216960C2
+:101D400020680268520852000260204600F040B944
+:101D50002068016841F0010101602046704720467B
+:101D600000F0AABD70B5044604F17C05134668680E
+:101D7000202836D149B3180027D02878012830D040
+:101D800001222A7004F154062165338073800020FB
+:101D9000E86021216960306AC8B1DFF82012C162B1
+:101DA000DFF81C02316A0863316ADFF81802486301
+:101DB0000020316A88632068216D00F12802306AB2
+:101DC00001F035F818B100F00EF8012070BD21685F
+:101DD0004020086200222A702068816841F080015A
+:101DE00008E0022070BD1020E86000212970202248
+:101DF0006A6070478160002070BD206881684A0673
+:101E00007047F8B5044640F60F002568E9692A686E
+:101E1000AB6808400DD1880602D5960602D4D800DA
+:101E200040F18980E16E00294FD02046BDE8F440A2
+:101E300008476548034204BF644E32427BD0CE0758
+:101E400009D5D70507D501262E62D4F8885045F06C
+:101E50000105C4F888508D070AD5DE0708D5276824
+:101E600002253D62D4F8885045F00405C4F8885036
+:101E70004D070AD5DE0708D5276804253D62D4F84A
+:101E8000885045F00205C4F888500D070CD5960619
+:101E900001D4034208D0256808202862D4F88800BD
+:101EA00040F00800C4F8880008050BD5550109D595
+:101EB00026684FF400603062D4F8880040F02000BB
+:101EC000C4F88800D4F88800002870D0880607D5A8
+:101ED000910601D4D80003D5E16E09B120468847A8
+:101EE000D4F8880021688A68510602D410F0280FBF
+:101EF0001AD0204600F0C5FDFFF77FFF0FD500F098
+:101F000057F860B1DFF890198163A06F00F0CEFF41
+:101F100000284CD0A06F816BBDE8F44008472046F4
+:101F2000BDE8F24001F0BAB8204601F0B7F8002051
+:101F3000C4F88800F1BDC80209D55E0207D54FF488
+:101F4000801028622046BDE8F24001F031B9080651
+:101F500009D5160601D4180205D5216F39B32046DC
+:101F6000BDE8F440084748060FD553060DD528684C
+:101F700020F0400028602021C4F880100020206755
+:101F80002046BDE8F24001F02CB9080206D5530006
+:101F900004D52046BDE8F24001F034B9C80148BF7D
+:101FA000002A04D52046BDE8F24001F02CB9F1BD6D
+:101FB000816821F040018160A06F7047D52A000838
+:101FC000032B0008092B0008010000102001000469
+:101FD0002DE9F84F0446DFF8C8182768DFF8C4B8C1
+:101FE0003A68A068DFF8C0A80A4021690243606926
+:101FF0000A43E1690243606E0A4302433A600026E5
+:102000007968E068DFF8942821F440510143796051
+:102010009742A1691CBF206A0143BA68DFF8840AAD
+:1020200002401143B960B046F96A606A090940EAA2
+:102030000111F9625F454FF400404FF480754FF491
+:1020400000714FF480624FF400634FF4805C4FF4F2
+:10205000005E4FF4804929D1DAF800B00BF0030B91
+:10206000BBF1030F3ED8DFE80BF00237343A4FF0F4
+:10207000010AD4F81CB05746BBF5004F4FF6F07A72
+:1020800040F01283012F09D0022F00F05582042F57
+:1020900000F08E82082F00F0C382F6E201F081FC8E
+:1020A0000146606A002840F01C8243E2DFF8ECB78A
+:1020B0005F4517D1DAF800A01AF4406A27D0BAF5C4
+:1020C000806F09D0BAF5006F03D0BAF5406F06D023
+:1020D00008E04FF0020A07E04FF0040A04E04FF076
+:1020E000080A01E04FF0100ADFF8B0B75F45C0D131
+:1020F000BAF1000F0BD0BAF1020F49D0BAF1040FB8
+:1021000000F08280BAF1080F00F0B180B7E301F06F
+:1021100040FC0146606A58B3012808BF022028D05D
+:10212000022808BF042024D0032808BF062020D09E
+:10213000042808BF08201CD0052808BF0A2018D092
+:10214000062808BF0C2014D0072808BF102010D084
+:10215000082808BF20200CD0092808BF402008D03C
+:102160000A2808BF802004D00B2808BF284600D0CA
+:102170000120B1FBF0F0002800F08383626802EBDD
+:102180004201884203D31303834280F0A28076E3A6
+:10219000606AB0B3012808BFDFF80C09EED002284E
+:1021A00008BFDFF80809E9D0032808BFDFF80009F5
+:1021B000E4D0042808BFDFF8FC08DFD0052808BFFA
+:1021C000DFF8F408DAD0062808BFDFF8F008D5D029
+:1021D000072808BFDFF8E808D0D0082808BFDFF8D4
+:1021E000E408CBD0092808BFDFF8DC08C6D00A28ED
+:1021F00008BFDFF8D808C1D00B2808BF4FF2244031
+:10220000BCD0DFF8CC08B9E701F079FB0146606A81
+:102210000028ADD0012808BF0220AAD0022808BF9C
+:102220000420A6D0032808BF0620A2D0042808BF97
+:1022300008209ED0052808BF0A209AD0062808BF8B
+:102240000C2096D0072808BF102092D0082808BF7D
+:1022500020208ED0092808BF40208AD00A2808BF35
+:10226000802086D00B2808BF2846FAD080E7676A0E
+:10227000002FC8D0012F08BF484629D0022F08BF21
+:10228000704625D0032F08BF41F2555020D0042FAF
+:1022900008BF60461CD0052F08BF40F6CC4017D0C1
+:1022A000062F08BF40F6AA2012D0072F08BF1846F5
+:1022B0000ED0082F08BF10460AD0092F08BF0846C5
+:1022C00006D00A2F08BF284602D00B2F00D180204D
+:1022D00054E7BAF1000F0BD0BAF1020F38D0BAF1BF
+:1022E000040F00F07280BAF1080F00F0A780ECE054
+:1022F00001F04FFB0146606A40B3012808BF022588
+:102300001ED0022808BF04251AD0032808BF0625BE
+:1023100016D0042808BF082512D0052808BF0A25B2
+:102320000ED0062808BF0C250AD0072808BF1025A4
+:1023300006D0082808BF202502D0092808BF40255C
+:1023400072D00A280CBF80250B286DD001256BE0C8
+:10235000606A002836D0012808BFDFF80C682BD04F
+:10236000022808BFDFF8046826D0032808BFDFF87A
+:10237000006821D0042808BFDFF8F8671CD00528C2
+:1023800008BFDFF8F46717D0062808BFDFF8EC674E
+:1023900012D0072808BFDFF8E8670DD0082808BF6B
+:1023A000DFF8E06708D0092808BFDFF8DC6703D052
+:1023B0000A2808BFDFF8D4677CD00B2808BFDFF8F5
+:1023C000106777D0DFF8C86774E001F098FA01462B
+:1023D000606A40B3012808BF022525D0022808BF43
+:1023E000042521D0032808BF06251DD0042808BFD6
+:1023F000082519D0052808BF0A2515D0062808BFCA
+:102400000C2511D0072808BF10250DD0082808BFBB
+:10241000202509D0092808BF402505D00A280CBF6F
+:1024200080250B2800D001256268B1FBF5F6500825
+:10243000002110EB062051EB166141E0606A002894
+:1024400036D0012808BF4FF4800633D0022808BFD9
+:102450004FF400162ED0032808BFDFF8386729D0C4
+:10246000042808BF4FF4801624D0052808BFDFF8E1
+:1024700028671FD0062808BFDFF820671AD0072872
+:1024800008BF4FF4002615D0082808BF4FF4802657
+:1024900010D0092808BF4FF400360BD00A2808BF17
+:1024A0004FF4803606D00B2808BF4FF4004601D009
+:1024B0004FF40006C246002116EB52004AEB010120
+:1024C0000023FEF707FF064601E04FF00108A6F5DE
+:1024D0004070DFF8CC16884280F0D1812268D66047
+:1024E000CFE1012808BF02251AD0022808BF042521
+:1024F00016D0032808BF062512D0042808BF0825D7
+:102500000ED0052808BF0A250AD0062808BF0C25CA
+:1025100006D0072808BF102502D0082808BF2025AC
+:1025200075D0092808BF402571D00A280CBF802526
+:102530000B286CD001256AE0606AB0B3012808BF9F
+:10254000DFF88C0521D0022808BFDFF85C051CD01D
+:10255000032808BFDFF84C0617D0042808BFDFF8AF
+:102560004C0512D0052808BFDFF83C060DD0062820
+:1025700008BFDFF83C0508D0072808BFDFF834059E
+:1025800003D0082808BFDFF838057AD0092808BF2B
+:10259000DFF8300575D00A2808BFDFF82C0570D0A9
+:1025A0000B2808BFDFF824056BD0DFF8E00568E0F2
+:1025B00001F0A5F90146606A40B3012808BF022571
+:1025C00025D0022808BF042521D0032808BF0625EE
+:1025D0001DD0042808BF082519D0052808BF0A25E2
+:1025E00015D0062808BF0C2511D0072808BF1025D4
+:1025F0000DD0082808BF202509D0092808BF40258C
+:1026000005D00A280CBF80250B2800D00125606862
+:10261000B1FBF5F1420802EB4102B2FBF0F632E009
+:10262000666A66B3012E2CD0022E08BF484628D019
+:10263000032E08BF42F6AA2023D0042E08BF7046FE
+:102640001FD0052E08BF41F698101AD0062E08BFDD
+:1026500041F2545015D0072E08BF604611D0082E05
+:1026600008BF18460DD0092E08BF104609D00A2E03
+:1026700008BF084605D00B2E08BF284601D04FF4EE
+:10268000803000F013F9B6B201E04FF00108A6F176
+:102690001000504580F0F3800AEA0601C6F34200BC
+:1026A00001432068C160ECE0012F07D0022F35D034
+:1026B000042F70D0082F00F0A580D7E001F071F949
+:1026C0000146606A40B3012808BF022516D00228DF
+:1026D00008BF042512D0032808BF06250ED0042801
+:1026E00008BF08250AD0052808BF0A2506D00628F5
+:1026F00008BF0C2502D0072808BF10257AD008286B
+:1027000008BF202576D0092808BF402572D00A28A6
+:102710000CBF80250B286DD001256BE0606AB0B33B
+:10272000012808BFDFF8801333D0022808BFDFF884
+:102730007C132ED0032808BFDFF8741329D0042897
+:1027400008BFDFF8701324D0052808BFDFF868132E
+:102750001FD0062808BFDFF864131AD0072808BF67
+:10276000DFF85C1315D0082808BFDFF8581310D025
+:10277000092808BFDFF850130BD00A2808BFDFF87C
+:102780004C1306D00B2808BF4FF2244101D0DFF8CC
+:102790004013606831E001F0B2F80146606A40B36E
+:1027A000012808BF022525D0022808BF042521D012
+:1027B000032808BF06251DD0042808BF082519D006
+:1027C000052808BF0A2515D0062808BF0C2511D0FA
+:1027D000072808BF10250DD0082808BF202509D0DC
+:1027E000092808BF402505D00A280CBF80250B28E2
+:1027F00000D001256068B1FBF5F101EB5001B1FBA0
+:10280000F0F631E0666A6EB3012E08BF484629D063
+:10281000022E08BF704625D0032E08BF41F2555046
+:1028200020D0042E08BF60461CD0052E08BF40F6FD
+:10283000CC4017D0062E08BF40F6AA2012D0072E93
+:1028400008BF18460ED0082E08BF10460AD0092E21
+:1028500008BF084606D00A2E08BF284602D00B2E15
+:1028600008BF802000F022F8B6B201E04FF0010866
+:10287000A6F11000504502D22168CE6001E04FF071
+:10288000010804F1680001210023418001804360B8
+:1028900083604046BDE8F28F572B0008008000405F
+:1028A000F369FFCF0038014088000058616800EBF1
+:1028B0005100B0FBF1F6704790F82810CA0706D512
+:1028C00002685368C16A23F400330B43536090F8E5
+:1028D00028108A0706D502685368016B23F48033F9
+:1028E0000B43536090F828104A0706D502685368D6
+:1028F000416B23F480230B43536090F828100A07A0
+:1029000006D502685368816B23F400430B43536080
+:1029100090F82810CA0606D502689368C16B23F4A4
+:1029200080530B43936090F828108A0606D50268FE
+:102930009368016C23F400530B43936090F82810C4
+:102940004A0610D502685368416C23F480130B4388
+:102950005360436CB3F5801F05D15368816C23F439
+:10296000C0030B43536090F828100A0606D501688F
+:102970004A68C06C22F4002202434A607047F8B5EE
+:10298000044604F17C050020E8606FF07E4701F00A
+:1029900095F80646206801680A0708D5009733466F
+:1029A00000224FF40011204600F016F860B92068AC
+:1029B00001684A070AD50097334600224FF4800188
+:1029C000204600F009F808B10320F2BD202068601D
+:1029D000A86000202870F2BD2DE9F041069C054654
+:1029E0000E4690461F462868C1693140B1420CBF6F
+:1029F00001200020404528D114F1010FF3D001F04F
+:102A00005DF8C01B844200D34CB92868016821F4EA
+:102A1000D071016000F01CF80021017013E02868FB
+:102A200001684A07DFD5C1690A05DCD54FF40061AA
+:102A300001622868026822F4D0720260002200F06D
+:102A400007F8C1600270032000E00020BDE8F081BB
+:102A50002868816849084900816005F17C002021CF
+:102A600041608160704701680A6822F0C0020A6014
+:102A700001688A6822F400028A602021C0F8801070
+:102A8000704701680A6822F490720A60DFF81C112E
+:102A9000026893680B4093602022C0F884200021D4
+:102AA000C1667047FFF4FF1100127A0000093D0073
+:102AB000AAB0280080841E00006A1800555814002F
+:102AC00040420F0020A1070090D0030048E8010019
+:102AD0000024F400816A00680268930644BF084637
+:102AE00000F07FBB0020A1F856000868826822F041
+:102AF000800282600868FFE7016841F040010160E0
+:102B00007047806A00F0E0BFF8B5846A04F1800580
+:102B100004F1560728686E6821688A68110606D590
+:102B2000212804D1002038802046FFF79CFF21682F
+:102B30008868410606D5222E04D10020388120461F
+:102B4000FFF79FFFA86840F01000A8602046BDE88E
+:102B5000F24000F0A3BA806A00F1560100220A8117
+:102B60000A8000F09BBA00000000127A0000093DC4
+:102B700000AAB0280080841E00006A18005558146E
+:102B80000040420F0020A1070090D0030048E80158
+:102B9000000024F40055150000CC0C0000AA0A0027
+:102BA00000FD0F005461510000D43000FEFFFFEF24
+:102BB000604981B00A6802430A600968084008E079
+:102BC0005D4881B0016841F400210160006800F4B3
+:102BD00000200090009801B0704738B586B00446D8
+:102BE0006846142100F072FF2068544D5449A842F1
+:102BF00030D10868534D40F001000860096801F0C9
+:102C00000101059105980120FFF7D2FF02210191F2
+:102C1000002202920C2003210090039100F05AF848
+:102C2000002202920392402002210090019100F0C4
+:102C300051F845482860112100F053F808B101F01F
+:102C400097F86567AC6200220021252001F0ACF8FE
+:102C500025203BE03D4A90423AD148683C4D40F443
+:102C600080404860486800F4804005900598012045
+:102C7000FFF79EFF0220FFF79BFF002202920392C4
+:102C80004FF40060022100900191072200F023F828
+:102C90000221019101220292C020032100900391A0
+:102CA0000722049269462B4801F0F2F82A4828606E
+:102CB0000F2100F016F808B101F05AF86567AC6210
+:102CC00000220021242001F06FF8242001F089F86F
+:102CD00007B030BD0822049269464FF0904001F0E1
+:102CE000D7B8696000201022E86080216861A8617F
+:102CF000E8612862AA602961284600F033B810B55F
+:102D0000044616492068884213D101F08FF901F07A
+:102D10008DF91348016821F4407141F4807101601C
+:102D2000026842F4004202602046BDE8104001F013
+:102D300090B910BD4C000058500000580080004071
+:102D40005C0000582C15002044000240003801406F
+:102D50008C15002000040048440402400028004074
+:102D60009000005870B5040001D1012070BD2268A8
+:102D7000DFF800339A4204F124050BD2DFF8F802A1
+:102D800081181426B1FBF6F18900DFF8F0322962D0
+:102D9000EB610AE0DFF8E80281181423B1FBF3F1DC
+:102DA0008900DFF8E0022962E86102216970136896
+:102DB000A068E1686FF30E13034320690B43616958
+:102DC0000343A0690B43E1690343206A0B430343B8
+:102DD0001360204600F022F9A068B0F5804F04BFD0
+:102DE00000216160696A207900F01BF838B105287C
+:102DF00005D2204600F02FF900F00CF803E0002087
+:102E000028636863A8630021A961012068702970A4
+:102E1000002070BD296B00200860696BA86B4860BA
+:102E200070470860A96AE86A486060687047F8B54A
+:102E3000044604F1240600253078012801D102203F
+:102E4000F2BD012030707778012F2BD102207070F5
+:102E5000B561206807687F087F000760204600F0A2
+:102E6000C1F82168F06820B10A6842F00E020A60D9
+:102E700008E0086820F0040008602068016841F05C
+:102E80000A010160706A0168CA0301D500F044F8C4
+:102E9000306B08B100F040F82068016841F0010192
+:102EA000016001E0357002252846F2BD38B500F119
+:102EB000240200245178022903D0042090610124C7
+:102EC00028E001680B6823F00E030B6001680D68B1
+:102ED0006D086D000D60516A0B6823F480730B6000
+:102EE000012192F82030D56903F01C0399406960F4
+:102EF000936AD16A5960116B31B10B6823F4807306
+:102F00000B60536B916B59600121517014705169C2
+:102F100001B18847204632BD016841F480710160EB
+:102F20007047F8B500F124010423CA6914680268E7
+:102F3000156891F8206006F01C0603FA06F73C427B
+:102F400010D06F070ED51468A50603D4146824F0BA
+:102F50000404146000F03DF8C968002938D0BDE8C9
+:102F6000F4400847022303FA06F73C4213D0AF07A8
+:102F700011D51468A50605D4146824F00A04146059
+:102F800001224A7000F025F800220A708968F9B120
+:102F9000BDE8F4400847082303FA06F6344217D088
+:102FA0002B0715D5146824F00E041460012291F843
+:102FB0002030CC6903F01C039A40626001228A61D0
+:102FC0004A7000220A70096911B1BDE8F44008474F
+:102FD000F1BD91F82020CC6902F01C02934063609F
+:102FE0007047000070B5C56C046D6C60446D14B121
+:102FF000856DC46D6C60012490F84450066C05F03A
+:103000001C05AC407460046863608068102802D1BD
+:10301000A260E16070BDA160E26070BD10B5416C5E
+:103020000268144B89089A4239BF174C04EB81019E
+:10303000164B03EB8101816402F0FF02083A142170
+:10304000B2FBF1F1012301F01C01114AC26403FA41
+:1030500001F1016510BD01790E4A0F4B836502EB4A
+:1030600081024265491E012201F003018A40C265C6
+:103070007047000008040240F8FFFDBF0000024056
+:10308000F8FBFDBF00040240000802401C0802409B
+:1030900080080240FC0802404009024070470000DE
+:1030A00010B500F17C010A78012A01D1022010BD7F
+:1030B00001220A7024234B600268136814686408B4
+:1030C000640014600022426623F00053006803602D
+:1030D00020224A6000230B70002010BD70B500F064
+:1030E0001FF801D1022070BD00F020F822F06042EC
+:1030F00009E070B500F014F801D1022070BD00F0B5
+:1031000015F822F0606211438160204600F01CF83F
+:10311000206806602021696000222A70002070BDAE
+:10312000044604F17C0528780128704701202870A6
+:1031300024226A6020680668026852085200026011
+:103140002068826870470000FFB500BF14A200BF6E
+:1031500015A6D2E9003402A9C1E90034D6E900710C
+:10316000CDE90071416E11B90121012213E001681E
+:103170008A688968520E02F00702490F02AC655C4A
+:10318000A45C1DF801101DF80220ED00E40095FB81
+:10319000F1F194FBF2F2683041800280FFBD000043
+:1031A00001010103070100000804020408010101F4
+:1031B0007047000038B5002488B90F4D0F482B60C8
+:1031C0000F4B0360FEF7CEFD012805D007D303287F
+:1031D00004D038BF022402E0012400E0032420468A
+:1031E00032BD00680649884204D1034A10680028AD
+:1031F00018BF004770470000C0170020A013002030
+:1032000000380140704770474FF0B040006800F050
+:10321000F000B02888BFB02070472DE9F0410400CD
+:1032200062D0207881064FF0B04533D5A868E968B0
+:1032300010F00C0001F0030104D00C2808BF012994
+:1032400040F07E802868810702D5E06900284BD0D5
+:10325000FFF7DAFF616A884207D2084600F0B2FB46
+:10326000002815D100F052FA0AE0286820F0F0009A
+:10327000014300F050FA606A00F0A4FB002807D177
+:1032800000F028FFDFF8D407006800F073FF002883
+:1032900040F08E812078C10711D5A868E96800F058
+:1032A0000C00082801F0030103D00C2808BF0329F3
+:1032B00069D12868810302D56068002814D021787C
+:1032C00088071AD5A868E96800F00C00042801F006
+:1032D000030104D00C2808BF022940F08D80286823
+:1032E000410503D5E068002800F062816868216923
+:1032F00020F0FE4040EA016068602168DFF8606706
+:1033000011F0180F00F076816069002800F0AF809E
+:10331000C806706840F19C80800708D4716841F04D
+:103320000101716000F0CAFB07467068800700F178
+:10333000418100F0C3FBC01B0328F6D30320DEE16C
+:10334000E06978B1296841F0010100F0CEFA064643
+:103350002868800700F13D8100F0B0FB801B032846
+:10336000F6D3EBE7286840084000286000F0A6FB91
+:103370000646286800F0C6F98CD000F09FFB801B41
+:103380000328F6D3DAE76068B0F5803F04D12868F7
+:1033900040F48030286011E0B0F5A02F286806D1F5
+:1033A00040F480202860296841F4803105E020F451
+:1033B00080302860296821F480212960606860B12C
+:1033C00000F07CFB0646286880033FF578AF00F0EC
+:1033D00075FB801B6528F6D3B0E700F06FFB06464F
+:1033E0002868400C10F001003FF469AF00F066FB64
+:1033F000801B6528F4D3A1E7E06878B1296841F41F
+:10340000807100F072FA0646286840053FF56EAFFD
+:1034100000F054FB801B0328F6D38FE7286820F4C4
+:103420008070286000F04AFB06462868800A10F089
+:1034300001003FF462AF00F041FB801B0328F4D38E
+:103440007CE700F03BFBC01B0328C0F0CF8075E792
+:1034500040F0010000F070F907467068800700F145
+:10346000E08000F02BFBC01B0328F6D366E77068F2
+:1034700020F0040000F060F907467068C00810F002
+:10348000010000F0DD8000F019FBC01B0428F4D31C
+:1034900054E70528306806D140F0040030603168F8
+:1034A00041F0010105E0400840003060316821F042
+:1034B00004013160A06841F2893768B100F0FEFA7A
+:1034C00080463068800700F1D08000F0F7FAA0EB6A
+:1034D0000800B842F5D331E700F0F0FA80463068D2
+:1034E00000F010F900F0C18000F0E8FAA0EB08004D
+:1034F000B842F4D322E700F0E1FAC01B0328C0F081
+:10350000C2801BE740084000B06000F0D7FA0746D1
+:10351000B06800F0F7F800F0BA8000F0CFFAC01BF6
+:103520000328F5D30AE700F0C9FA801B0328C0F08E
+:10353000C08003E700F0C2FA001B0328C0F0DA8065
+:10354000FCE6E968DFF81C0589088900E960E9689C
+:103550000140E96000F0B2FA044600F0E5F825D039
+:1035600000F0ACFA001B0328F7D3E7E601281FD0D0
+:10357000E868226B00F00301914202BF00F0700185
+:10358000626B914214D1A26BC0F30621914202BF3B
+:1035900000F47811E26B91420AD1226C00F0606174
+:1035A000914202BF00F06040616C884200F0A6804A
+:1035B0000120A4E0706840F0040000F0BDF8074668
+:1035C0007068000708D400F079FAC01B0428F7D30C
+:1035D000B4E600F09BF85DE67068A16920F47060C5
+:1035E00040EA0120706000F0A4F8074600F089F876
+:1035F0007FF427AF2078410737D5DFF86C7438683F
+:10360000C10529D400F012FD00F058FA8046386850
+:10361000C10521D400F052FAA0EB08000328F6D32C
+:103620008CE6706820F0040070607068C00810F0CC
+:103630000100DFD000F042FAC01B0428F5D37DE67C
+:1036400000F077F8074600F05CF8D3D000F036FAC7
+:10365000C01B0328F7D371E6A06801287FF419AFD7
+:10366000306840F00100306024E721784A060ED52A
+:10367000A06A0028B0683FF445AF40F00100B06098
+:1036800000F01CFA0746B06880077FF534AFE06AA7
+:10369000A0B3A96801F00C010C293FF467AF022820
+:1036A000286820F0807028607FF44BAF00F006FAA5
+:1036B000064600F039F87FF436AFEA68DFF8AC036D
+:1036C000216BA36B0240606B0A430243E16B206CE9
+:1036D00042EA03220A43616C02430A43EA60286813
+:1036E00040F080702860E96841F08051E96000F0A6
+:1036F000E5F90446286880017FF51CAF0020BDE88D
+:10370000F0817068400810F0010070472968606A15
+:1037100021F0F001014329606968206A21F47F41AA
+:1037200041EA0021696070472868400E10F00100EE
+:103730007047706840084000706000F0BFB92DE924
+:10374000F8430400884646D0DFF8246300F0C8F848
+:1037500049D200F0CDF8074600F0C2F843D000F09F
+:10376000ADF9C01B0228F7D90320B7E000F0A6F995
+:10377000401B022845D9F7E700F0A0F9A0EB0900AB
+:1037800002284ED9F0E700F099F9A0EB09000228D1
+:1037900056D9E9E700F092F9401B02285FD9E3E728
+:1037A00000F08CF9401B022869D9DDE700F086F9AA
+:1037B000401B41F28931884275D3D5E7032802D1F5
+:1037C0003968890103E00028396802D1890762D489
+:1037D00001E049055FD4012080E000F06FF9C01BD3
+:1037E000022870D9C0E7207881074FF0B0470BD589
+:1037F000BA68A06822F0F0020243BA6000F05EF9F5
+:103800000546B868C003B1D52178DFF84C52880668
+:103810000AD52968606921F0F001014300F065F8DC
+:10382000814628688003A7D5217848060BD52968EA
+:10383000A0690909090141EA101100F056F8814612
+:103840002868C0039FD5217848070BD5B968E06880
+:1038500021F4E0610143B96000F030F90546B86831
+:10386000800397D5217808070CD5B968206921F421
+:10387000605141EAC001B96000F020F90546B8681E
+:1038800040038DD52178C80715D56068022895D1E9
+:10389000396889039FD5BA68920840EA8200B86007
+:1038A00000F00CF90546B868616800F00C00B0EB58
+:1038B000810F7FF47BAF306800F00700804505D2B0
+:1038C00000F016F8074600F00BF886D100F002FC75
+:1038D00000F086FCBDE8F24300F04CBCBDE8F2838A
+:1038E000306800F0070040457047296000F0E6B8F6
+:1038F0003168C90848EAC101316000F0DFB838B565
+:103900004FF0B0445C4DA16811F00C0106D1FFF7F7
+:103910007BFCC0F3031055F8200032BD0429574A40
+:1039200005D00829564804D12168C90222D510467D
+:1039300032BDE16801F00301022904D0032904D15A
+:103940002168C90207D5104605E0FFF75DFCC0F30A
+:10395000031055F82000E168E268E368C1F306212E
+:103960004843C2F30211491C5B0FB0FBF1F05B1C32
+:10397000B0FBF3F032BD80B5FFF7C1FF3D49FFE773
+:10398000404A0968C1F3031152F82110B0FBF1F06D
+:1039900002BD80B5FFF7EFFF00F010F8C1F3022180
+:1039A00006E080B5FFF7E7FF00F008F8C1F3C22199
+:1039B00012F8211001F01F01C84002BD2D49324A02
+:1039C0000968704770B52C49B1282EBFCC6AC0F386
+:1039D000031051F820402048056800F015FC2949E3
+:1039E00005F00F0551F825202849B4FBF2F2002418
+:1039F000B2FBF1F1B0F5007F2CA2204609D100BF47
+:103A000023A353F820508D4214D2401C0328F8D928
+:103A100012E000BF22A353F820508D420AD2401C6E
+:103A20000328F8D308E000F049F8801B03280CD3E2
+:103A3000032070BD52F820400D4D2868C00844EAAC
+:103A4000C000286000F03AF80646286800F0070039
+:103A5000A042E8D1002070BD080100585410002099
+:103A600090000058FFFFFEEE000400588C80C1114A
+:103A70000040005808000058947600080024F40024
+:103A80000048E80154760008E079000840420F0041
+:103A9000120000002400000036000000400000007A
+:103AA000060000000C0000001000000000000000F4
+:103AB000010000000200000004000000014800684E
+:103AC000704700BF5010002070470000002200F037
+:103AD000A3BB0000984900E0984981B00A680243FE
+:103AE0000A60096808400090009801B0704710B55E
+:103AF00000F062FB924C606840010ED56068C00027
+:103B00000BD400F093FA00F091FA206840F4803072
+:103B10002060216821F48031216000F0D3F800207A
+:103B200000F094FB40B180798649E160E26822F4BC
+:103B30007C5242EA0022E26000F048F88248834C5E
+:103B4000016800220260036903F050030361012051
+:103B5000FFF7C2FF0220FFF7BFFF0420FFF7BAFF05
+:103B60000220FFF7B7FF0120FFF7B4FF00220F216B
+:103B70000E2000F019F90E2000F033F900220F2179
+:103B80003A2000F011F93A2000F02BF900210F2221
+:103B90006F484160826047F6FF710022C160026198
+:103BA0008261C261046000F065FBCA20606253213B
+:103BB0006162FF21A068C008C000A060616200F0DF
+:103BC000FFFB4FF0FF3000F089FCFAE710B5AEB014
+:103BD000604C1CA821464822FDF770FB01A81C215F
+:103BE000FFF774FF08A804F148015022FDF766FBB7
+:103BF0005348016821F0180101604FF480335648A2
+:103C0000026822F4C06242F4007202600722006877
+:103C100000F4C06000904FF4807400991C92012160
+:103C20001E91002240211D93209127921F941CA8D1
+:103C3000FFF7F3FA6F200221019002910022039214
+:103C40000492059206920792012101A8FFF777FDE1
+:103C500043F60301002208910E9200214FF48042A6
+:103C600002230F9119921A931B91189408A800F03F
+:103C70001BFD2EB010BD10B5384C394820604FF4F4
+:103C8000E1310C20606100224FF40040E06100F05F
+:103C900010F82046FEF726F800212046FFF71EFA0E
+:103CA00000212046FFF725FA2046BDE81040FFF727
+:103CB000F7B96160A260E2602261A2612262626281
+:103CC000A2627047274881B0016841F48011016009
+:103CD0003F21006800F48010009000982248416065
+:103CE0004161016841F47C110160026942F47C1277
+:103CF0000261016841F03F010160026942F03F0248
+:103D0000026101B0704738B50446FFF7D7FE14F1E1
+:103D1000010F054609D000F066FA041905E01348C2
+:103D2000016821F00401016030BFFFF7C7FE401BAE
+:103D3000A042F4D331BD0000480000584C000058A8
+:103D400090000058FECAFECA8008005800280040B3
+:103D5000B81600202C75000800040058A01300209D
+:103D60000038014050000058040C005810ED00E0ED
+:103D7000704700000901020002D43C48815470479A
+:103D80003B4B02F00F021A4402F8041C7047394BF7
+:103D900019684FF6FF020002114000F4E06008438A
+:103DA000354908431860704738B5324B1C68C4F376
+:103DB0000223C3F10704052C28BF04241D1D072D71
+:103DC00034BF0023DB1E012505FA04F4641E2140E4
+:103DD000994005FA03F35B1E1A401143BDE83440D5
+:103DE000C8E7010007D4012200F01F01234B8A40DD
+:103DF000400943F82020704701000BD4012200F055
+:103E00001F011F4B8A40400943F82020BFF34F8F0A
+:103E1000BFF36F8F704710B5401EB0F1807F01D3A4
+:103E2000012010BD174C60600F214FF0FF30FFF7ED
+:103E3000A1FF0021A16007202060002010BD01002B
+:103E400007D4012200F01F010F4B8A40400943F8BC
+:103E500020207047010007D4012200F01F010B4B06
+:103E60008A40400943F820207047000000E400E049
+:103E700018ED00E00CED00E00000FA0500E100E0C4
+:103E800080E100E010E000E000E200E080E200E01D
+:103E90002DE9F04106460A464FF0000C4FF00F089E
+:103EA0002CE05A4FBE4214BF4FF0070E4FF0040EE5
+:103EB0000EFA01F1294344F82310C143544C2368FE
+:103EC00055680B40ED0348BF0343236063685568A2
+:103ED0000B40AD0348BF034363604E4C23685568F5
+:103EE0000B40ED0248BF0343236063680B405168F9
+:103EF0008D0248BF034363600CF1010C106830FA77
+:103F00000CF172D0012303FA0CF31840F4D054687A
+:103F1000022C18BF122C4FEA8C010ED14FEADC04A0
+:103F200006EB840401F01C0E256A08FA0EF7BD4367
+:103F3000176907FA0EF73D4325624FEA4C04032543
+:103F40003768A540ED4305EA070E177907F0030728
+:103F5000A74047EA0E0737605768012F18BF022FA6
+:103F600003D0112F18BF122F11D1B76805EA070E21
+:103F7000D768A74047EA0E07B760776827EA0303C8
+:103F80005768C7F3001707FA0CF73B437360F368F1
+:103F90001D40936803FA04F42C43F4605468E30072
+:103FA000AAD51D4C4FEA9C0354F8237001F00C0174
+:103FB00008FA01F5B6F1904F27EA050508BF4FF062
+:103FC000000E11D0154FBE4208BF4FF0010E0BD0AE
+:103FD000134FBE4208BF4FF0020E05D0114FBE4234
+:103FE0007FF45FAF4FF0030E62E7BDE8F0810AB1E6
+:103FF00081617047816270470B4A136803421CBF9E
+:10400000106000F05DBA704700000000001000482A
+:1040100080080058000800580800014000040048CB
+:1040200000080048000C00480C08005802480168CD
+:1040300041F4807101607047000400588A60FF21DC
+:104040000268516280F82130002180F820100020A1
+:10405000704790F82010012901D1022070470121FA
+:1040600080F82010022280F82120CA2103685962BA
+:10407000532201684A62012301688A6842F02002E3
+:10408000FFF7DCBF3249002008604FF0B0413148F3
+:10409000026842F4700202604FF4E022086840F0C7
+:1040A000010008608A600B682B4803402B480B60B6
+:1040B000026822F005020260002243685B085B0090
+:1040C00043602748C8600861086820F480200860C1
+:1040D0008A61704710B54FF0B04222491068C0F3B2
+:1040E000031001EB8003186C936803F00C03042B9E
+:1040F00004D0082B04D00C2B04D01CE01A481AE082
+:104100001A4818E0D368D468C4F3021403F0030318
+:10411000641C022B08BF144802D0032B08BF1348AD
+:10412000B0FBF4F3D068D468C0F30620640F4343B7
+:10413000641CB3FBF4F00E4B186090681A68C0F36F
+:10414000031051F82000B2FBF0F0186010BD000021
+:1041500008ED00E088ED00E0FBFEF6FA9400005860
+:1041600000100422547600080024F4000048E801FE
+:104170007410002070B50F4E0446B0680025A8B139
+:10418000FFF7F9FBB2684FF47A71B1FBF2F2B0FBC2
+:10419000F2F0FFF740FE48B9102C07D2002221466A
+:1041A0004FF0FF30FFF700FE746000E00125284665
+:1041B00070BD00BF50100020104810B5016841F4D8
+:1041C000807101600320FFF7E2FD0020FFF7D2FFBE
+:1041D0000024002814BF0124FEF7F2FC204610BD85
+:1041E0000748406870470648806870470548FFE701
+:1041F000016841F001010160704700000040005873
+:1042000050100020042004E0DFF80800006800F4EB
+:10421000C06070470004005800B500BF1300964608
+:104220009446103928BFA0E80C50FAD85FEA417CC8
+:1042300028BF0CC048BF40F8042BC90728BF20F88E
+:10424000022B48BF00F8012B00BD000020B501463D
+:104250000648074DC2798A4218BFA84218BF0838DD
+:10426000F8D18A4218BF002020BD00BFF873FF1F9D
+:104270000070FF1F70B5040049D094F8210028B9E0
+:10428000002184F820102046FEF739FD00F04EF89A
+:1042900053202168486200F052F8FF2510B100F069
+:1042A0003FF834E02168DFF8AC008A6802408A6099
+:1042B0002268936866682169A0690E430643334308
+:1042C00093602068E168016120680169A26841EAA1
+:1042D000024101612068C16821F08001C16020684D
+:1042E000C16C89088900C1642168CA6CE36960698E
+:1042F00003431A43CA6421688868810609D400F020
+:104300001CF830B120684562042100F01DF801203E
+:1043100070BD20684562012184F82110002070BD25
+:1043200020684562042184F821107047022084F837
+:104330002100CA2122685162704720460CE02046C5
+:1043400023E02068C0F8248084F82110002084F83D
+:1043500020007047BFFF8FFF38B504462068C16852
+:1043600021F0A001C160FFF7A9FB05462068C168E4
+:10437000880608D4FFF7A2FB401B40F2E9318842CF
+:10438000F4D3032032BD002032BD38B50446206886
+:10439000C1684A0612D44FF0FF31C160FFF78EFBAF
+:1043A00005462068C168480608D4FFF787FB401B14
+:1043B00040F2E9318842F4D3032032BD002032BDFF
+:1043C00010B52848284C88B0016841F400410160CC
+:1043D00000F0EEFA2549002000F087FCFFF706FF09
+:1043E0002348016841F480310160026C42F480325C
+:1043F000026400F0D0FD0121012000F0DEFA00206F
+:1044000000F012FE012000F00FFE022000F00CFE72
+:10441000012000F02DFE0121002000F043FE00F0FD
+:1044200099FE144A0021402000F0B8F804F23C51F3
+:10443000009169460FF241020FF24100019200F033
+:1044400077FF04F25471029104F5C96240F23C51C5
+:1044500003920591049402A800F002FF00F078FE98
+:1044600008B010BD0800005824000320B816002032
+:1044700090080058735300087047000080B500F0A2
+:1044800026FF00F0F7FFBDE804400021012000F006
+:1044900094BA70474FF0FF3000F020B80021402060
+:1044A00000F089B8022000F0A8B8022000F0ADB8F2
+:1044B000FFF7E1BB13460A4601460020FEF77ABE2D
+:1044C000012805D0022805D0102805D101F0F2B846
+:1044D00001F0FFB801F0FEB8704700002DE9F0418F
+:1044E000544CDFF85481A5692840A06131E0491C93
+:1044F00054F831000742FAD004EBC107184079683C
+:104500001040014204BF4FF0FF327A607E683040B5
+:1045100000F094F86062012101FA00F086437E60A9
+:10452000EFF3108272B6606A23698140C9430B4081
+:104530002361022004EBC00353F8087C0F40401EA7
+:1045400043F8087CF6D182F31088606A58F820108E
+:10455000884763692069A2691840104207D0E06962
+:10456000216A084203D1002103EA0207C0E701F0F3
+:10457000EDF9EFF3108872B621696069A269014014
+:10458000114201BFE069216A0842FFF782FF88F308
+:10459000108801F0DCF9A561BDE8F08138B514465A
+:1045A000EFF3108572B600F049F8234941F8204036
+:1045B00085F3108831BD30B5EFF3108272B61D4B14
+:1045C0001C6904431C6153F83150284343F83100FF
+:1045D00082F3108830BDEFF3108172B6154A53692B
+:1045E00023EA000005E0EFF3108172B6114A536927
+:1045F0001843506181F310887047EFF3108172B651
+:104600000C4AD3691843D061F4E770B5094C656A68
+:10461000266A2062012101FA05F502E02846FFF72B
+:1046200039FF216AE0690842F8D088432662E061D8
+:1046300070BD0000281000202C140020024600202D
+:10464000110C090404BF1020120412F07F4F04BFA4
+:104650000830120205A312F0704F04BF001D1201B2
+:10466000120FC0F11F00995C401A70470403020248
+:10467000010101010000000000000000DFF82C1320
+:104680000A68030903F47F2300019A4300F47F20A2
+:1046900000F088B9DFF814231368010C23EA014302
+:1046A00043EA0043136070472DE9F84305460024B0
+:1046B0002878DFF8F8624106A0464FF0B0472DD5C4
+:1046C000286B70B1B0F5800F06D0B0F5000F18BFA1
+:1046D000B0F5400F17D01FE0F96841F48031F96060
+:1046E000F3E0386820F080603860FFF7E7F9814632
+:1046F0003868000140F1D680FFF7E0F9A0EB09002F
+:104700000228F5D90324DDE0FFF7D8F9A0EB090072
+:10471000022840F2CF80F5E70124A0462868010571
+:1047200031D5B06800F44078286C80452AD0FFF776
+:104730007DFCB8F1000FB16805D1286C21F44071FF
+:104740000143B1601EE0B06840F48030B06021F4F5
+:104750004071B06820F48030B060286C0143B160D3
+:10476000B068C0070ED5FFF7A9F98046B06880078A
+:1047700008D4FFF7A3F9A0EB080041F28931884281
+:10478000F4D30324A0462878C10705D53268A86968
+:10479000920840EA820232602978880705D531689C
+:1047A000E86921F44061014331602978C80644BFBB
+:1047B000A86AFFF76FFF2878810644BFE86AFFF711
+:1047C00069FF2878410744BF286AFFF757FF287818
+:1047D000010744BF686AFFF751FF2868C1051ED56D
+:1047E0003268686B22F0406202433260696BB1F15B
+:1047F000006F00F0C9F8686BB0F1806F0FD13968B5
+:1048000021F0806100F0CBF804463868000163D5E0
+:10481000FFF754F9001B0228F7D94FF0030870E0A6
+:10482000FFF74CF9001B022864D9F6E7316821F044
+:104830004041316020F08050326822F040621043E5
+:104840003060A86BB0F1C05F00F09EF828684105A9
+:1048500076D53268E86B22F0405202433260E96B51
+:10486000B1F1005F03D1F86840F48030F860E86B84
+:10487000B0F1805F64D1396821F0806100F08FF879
+:104880000446386800014CD5FFF718F9001B0228D0
+:10489000F7D94FF0030853E0FFF710F9001B022887
+:1048A00047D9F6E700F067F8A86821F4781100F01E
+:1048B00071F88146386800017FF526AF396968696B
+:1048C00001433961002C7FF428AF3168286B21F453
+:1048D00040010143316021E73969686821F4FE41F4
+:1048E00041EA002139613969E86821F0606100F02E
+:1048F00051F804463868000192D539696869014366
+:10490000396129688805A1D5A86BB0F1804F1CBF1B
+:10491000B0F1004F002889D1316821F040410843AF
+:104920008EE700F028F8286921F0604100F032F8A5
+:10493000044638680001AFD53969686901433961B7
+:104940002968C80405D5F168686C21F44041014329
+:10495000F160296888040BD5796AE86C21F0300190
+:1049600001437962796AA86C890840EA8101796219
+:104970004046BDE8F2833869696820F4FE4040EAA9
+:10498000012038613969704703D1F86840F08070C0
+:10499000F860704701433961396841F080613960DE
+:1049A000FFF78CB81043086070470000880000587B
+:1049B0000C48002101604160704710B500F00CF810
+:1049C0005C6819B1012904D1204301E024EA000008
+:1049D000586082F3108810BDEFF3108272B6014B5D
+:1049E0007047000084170020DFF84C150A6892B267
+:1049F00000E00246086880B28242FAD170472DE991
+:104A0000F041DFF83865DFF838853178044618253D
+:104A10006843062908EB000708D1307870703470BD
+:104A200079754FF0FF30706000203DE000F07BF8BA
+:104A3000B9680918B96008F10803B96832786A439F
+:104A40009A589142327813D308F1150315FB02FCF2
+:104A500013F80C30062B29D008F108066B43F358E5
+:104A6000994222BF08F115036A439A5CECD21DE01B
+:104A70001146337869439A420FD008F1140C08F1BB
+:104A8000150E1CF8013015FB03F50EF805407A757C
+:104A90003B7508F11402545403E008F114037A75CD
+:104AA0005C54317871703470BDE8F081114669430F
+:104AB00008F115035B5C062B04D008F1140615FB06
+:104AC00003F574557B753A7508F115025454EBE7FC
+:104AD000F0B5DFF86834DFF868541E781824024611
+:104AE0006243B0422A4404D118785870547D1C7037
+:104AF0000FE0167D507D92F815C005F1150766434D
+:104B0000062807F806C004D0167D143514FB00F4FF
+:104B10002E55012010731A78062A02BF00294FF083
+:104B2000FF305860F0BD10B5DFF81044606810F138
+:104B3000010F10D0FFF758FF6168DFF808248142A9
+:104B40002FBF636861685388CB1851781278181AA0
+:104B50004843D04000E0002080B210BD2DE9F84F5E
+:104B6000DFF8E053DFF8E0B3D5F80880D8F80000AC
+:104B7000DBF800104A0500F0A2F9DFF8C063DFF8A7
+:104B8000C0A321F4806181604FF0180934780AF1E4
+:104B9000080019FB04F14758FFF7C5FF874211D2FF
+:104BA00000270121B170062C3FD019FB04F40AF153
+:104BB00008010A59824210D200230B510AEB04016A
+:104BC0004C7DF0E7A9884118B94202D2AF88002194
+:104BD000E8E701223F1AB270E5E70A590AF1080333
+:104BE000121A1A51EAE7022802DA2878012800D0BE
+:104BF0007F1ED8F80000C1684A07FAD500F052F9C4
+:104C0000DBF80C00000CBFB247EA0047CBF80C7091
+:104C1000FFF7EAFE7060A8680068816841F480616F
+:104C20008160AFF30080BDE8F18FB8B20028DAD11F
+:104C3000FFF7DAFE70600320BDE8F24FFFF7FFB820
+:104C40002DE9F843EFF3108872B6BE4DBC4BA8684F
+:104C50000168CA224A625320486218208A6822F4F6
+:104C600080628A60B54A1678374647431F44387BCE
+:104C7000022823D13C68D7F810909078D8B17A7B7D
+:104C8000012A0AD101213046FFF722FF88F310885C
+:104C90007968304600F019F904E088F3108830464E
+:104CA00000F0C6F8A86800F01AF8314622464846D7
+:104CB00000F054F90DE0FFF751FF08E0C868420723
+:104CC000FCD500F086F84FF40020A049086088F376
+:104CD0001088FF22A86801684A62BDE8F183006875
+:104CE000CA214162532242627047F8B5954CA160D7
+:104CF000CA2209684A625323934A4B62156845F0F9
+:104D000020051560136803F00703C3F10403237043
+:104D100095682D0C05F07F056D1C6570EDB29268ED
+:104D2000C2F30E02521C628092B2521E6A43A2F576
+:104D3000A072DA404FF6FF739A422CBFA380A28084
+:104D4000834A136843F400231360824B1D6845F4C3
+:104D500000251D6048BB7948012383704FF0FF3563
+:104D600045600023764D00260C355FFA83FC18273A
+:104D700017FB0CFC5B1CDFB205F80C60062FF4DBA4
+:104D800006230370886820F48060886000F021F8B2
+:104D90004FF40021D1600320FFF75CF8A0680068A1
+:104DA000816841F48041816005E0C868410544BFE5
+:104DB0000320FFF744F8A1680A68FF205062002230
+:104DC00003210320FEF7F0FFBDE8F2400320FFF7C8
+:104DD00008B8C86800F0800060F49060C860704750
+:104DE0002DE9F04104460025EFF3108672B618272E
+:104DF000DFF84CC10CF10C0E07FB05F81EF808009B
+:104E000010B16D1C062DF5DB062D0CD06F430CEB9D
+:104E100007000127077386F310880461427303605B
+:104E20000D70002002E086F310880120BDE8F081BB
+:104E3000F8B50746EFF3108472B60320FEF7DCFFE7
+:104E4000404DAE683068FFF74BFF3B4618204249A3
+:104E50004343CA5C022A1BD100213846FFF738FEC3
+:104E60003648017806290ED1306837490A6853055B
+:104E700000F025F821F480618160C1684A07FCD503
+:104E800000F010F804E04078884218BFFFF766FE93
+:104E9000A9680A68FF2050620320FEF7A2FF84F38E
+:104EA0001088F1BDC16801F0800161F49061C160BA
+:104EB0004FF40020254908600320FEF7CBBF02D540
+:104EC000C1684A07FCD4816870472DE9F0418046EB
+:104ED0000F46424618201A4942438C18237B022B66
+:104EE00004BF4046FFF7A4FFEFF3108572B603201E
+:104EF000FEF782FF134EB068FFF7F1FE0220207329
+:104F0000A76067604046FFF77AFD0C490A78497848
+:104F1000914202D0FFF722FE02E0A168081AA060C9
+:104F2000FF20B1680A6850620320FEF75AFF85F33C
+:104F30001088BDE8F081000028280040B417002048
+:104F40008412002070170020082800400C08005828
+:104F500000080058800800589012002010470000F8
+:104F600038B5EFF3108472B6274D6946281D00F05E
+:104F70000AFE6946281D00F060FE38B184F31088EF
+:104F8000BDF80010214AFFF795FA31BD01202870C5
+:104F900084F3108831BD80B5FFF78AFA02210091B1
+:104FA0000023194800F124014FF48052001D00F045
+:104FB000CFFC01BD00BFF8B514460026EFF3108505
+:104FC00010F1010F1ED001281CBF02284FF0FF3640
+:104FD00018D1BCB1264672B60B4F012392B2381DD0
+:104FE00000F0CBFC00281CBF3978002908D0002233
+:104FF0003A7085F31088A1B2044AFFF75BFA01E02A
+:1050000085F310883046F2BD04000020614F00088F
+:10501000464981B00A6802430A6009680840009066
+:10502000009801B07047000078B585B00446684626
+:105030001421FEF74BFD0220FFF7EAFF3FA13C4E93
+:1050400031F81450009501210191002202210292B1
+:105050000391694656F82400FEF71AFF00F002F8A3
+:1050600006B070BD56F8240000222946FEF7BFBFE7
+:1050700010B500F00FF8BDE810400122FEF7B7BFF1
+:1050800010B500F007F8BDE810400022FEF7AFBFF2
+:105090000000000029A3264C33F8101054F820001B
+:1050A0007047000030B585B004460D4668461421AF
+:1050B000FEF70CFD210008BF042004D0012C18BF0E
+:1050C000022C02D10820FFF7A3FF2900DFF864209B
+:1050D0001CA00ED130F8141000910023019301217F
+:1050E00002230291039300F01BF80120FEF70BFE50
+:1050F00014E0012D12D130F814000F4B00900295EE
+:10510000019300F00DF800BF10A0045D00220F21F4
+:1051100060B2FEF749FE60B2FEF763FE05B030BD37
+:10512000694652F82400FEF7B3BE00004C00005858
+:105130005C100020681000200000211020000100F9
+:105140000200000010000100020000000A06070033
+:1051500000F034BE6C486D49016001F120024260EC
+:1051600001F13003836001F13C02026201F144036A
+:10517000C36001F14C02026101F16803436101F176
+:105180006C0282617831C16100F020BE38B50446FE
+:105190005F4D05F1100000F07DFE5B494868A16895
+:1051A000016005F11001E268C2608160456000F0B5
+:1051B00029FE58482DE080B553494A6813680120FC
+:1051C000187200F025FE002002BD38B5514C504D3C
+:1051D00007E0694605F1100000F088FE009821689C
+:1051E000884705F1100000F058FE0028F1D031BDCD
+:1051F00048484168084738B50446474D284600F0FE
+:1052000049FE4149C868A1680160456000F005FE9B
+:1052100042482168016062684260002032BD80B56A
+:105220003949CA6813681020187200F0FCFD00208C
+:1052300002BD3549CA68394910680B68184738B546
+:10524000364C354D06E06946284600F04FFE009882
+:1052500061688847284600F020FE0028F3D031BD61
+:1052600038B504462E4D284600F014FE2D4800F0B7
+:1052700011FE25480069A1688160E268C26005618D
+:1052800021680160626842602169416162698261EE
+:1052900031BD80B50146234800F012FEBDE8024052
+:1052A0000FF2050000F0CFBD38B5174C1D4D08E0DA
+:1052B0006946284600F01AFE00992069006900F04E
+:1052C000FFFD284600F0E9FD0028F1D031BD10B502
+:1052D000154C204600F0DEFD0B4948690460BDE82E
+:1052E000104000F0C4BD1CB50F4C06E069462046D6
+:1052F00000F0FCFD009800F019F8204600F0CDFD0C
+:105300000028F3D013BD000000000320B0090320E3
+:1053100084080320941700209C0803209C17002079
+:10532000340A03208C1700203C0A03207047000039
+:105330007FB50C464C4D61684C4EE86129622846A9
+:1053400000F0E6FD2468746006F1080000F0A2FD9C
+:10535000012000F065F801203070296841B10FF29A
+:10536000E5020FF2E9030092019302946846884730
+:105370007FBD1FB53D4C04F1080000F08EFDE8B97B
+:105380002078D8B1694604F1080000F0AFFD012093
+:1053900035492070C96941B10098029001A8884739
+:1053A0009DF804102170080003D00098FFF771FFEA
+:1053B00004E0009904F1080000F078FD04F1080011
+:1053C00000F06BFD28B9207818B104F10800FFF750
+:1053D00065F81FBD2DE9F04105460E4690461C4676
+:1053E000002000F01DF8214F7868A0F80950C6721F
+:1053F000324641460C30FBF761FF1B4A136900211E
+:105400000020984748F2E800FFF74FF879688A785B
+:10541000D21C04F10800FBF751FFBDE8F041012068
+:1054200010B51149124C096A20B901B18847002111
+:10543000217010BD0120207011B1BDE81040084757
+:1054400010BD00000020FFF72DB8000010B5014688
+:10545000064C04F1080000F033FD04F10800BDE83B
+:105460001040FFF71BB80000DC160020601700207A
+:10547000CC17002038B58EB002A8DFF80C14DFF886
+:105480000C440FF265453022FBF718FF009401959C
+:1054900069460FF23D40DFF8F84300F043FD01217B
+:1054A0000220FFF78AFADFF8EC2300212020FFF723
+:1054B00075F802A800F01AFE00F00EF900F01EFECA
+:1054C0000FF2353200210120FFF768F80FF2653244
+:1054D00000210220FFF762F8002084F890002020CD
+:1054E00000F0AAFE00F0E4FE0FF2C933002204F13E
+:1054F00091010020FFF774FC0FB030BD2DE9F84793
+:10550000044685B06078DFF88873DFF88C63DFF8D5
+:105510008C8305284FF0000A07F1900553D03E28F0
+:1055200062D0FF280DD101213172B4F803000428A4
+:1055300041D040F20742904204D040F6020290422D
+:1055400017D0A4E06179022904BFA1790029F8D11C
+:105550000020FFF795FD404601F06CF8A87801287F
+:1055600006D12978062903D000210220FFF723F86D
+:105570008DE0002000F060FEE07930732189357BFA
+:10558000F18161893182A2897282E389B382208AA2
+:10559000F08201241026009004940395029601964F
+:1055A000F88C01F05BF810B10220FFF761FD2020BC
+:1055B00000F042FE6BE00120FFF75AFD68780A21F7
+:1055C000FFF783FC63E0A088F98C88425FD1A7F8DD
+:1055D00026A085F800A008F1300001F02BF801208A
+:1055E000307200F058F852E0E078012802D002282A
+:1055F0001DD04CE0B4F80510F9840620287008F19D
+:10560000580001F017F886F808A000F044F8F88C6C
+:1056100001F09FF830B908F1800001F00BF808F1B3
+:10562000B40001E008F1E40001F004F82FE0677B2A
+:10563000607960BB29E004EB0A00C17B90F80E9012
+:10564000FF291FD1B9F1070F1CDB007C012819D1FC
+:10565000AAA000F0EFFF04EB0A00407C832811D1E0
+:1056600008F5927000F0E6FF0120A870E179317032
+:10567000207A7070617AB170A07AF070E17A31713D
+:10568000207B707109F101008244BA45D3DB01200F
+:1056900006B0BDE8F08706F10800F98C718100F0D2
+:1056A00026BE7B49CA8C824202D191F89000704795
+:1056B0000020704780B500F034FF062805D0BDE813
+:1056C000044000210120FEF776BFBDE8014000F054
+:1056D0001FBE70477047000018B589B00020ADF8B4
+:1056E0001A0001F01AF96E4C216811F1010F0DD06A
+:1056F0006C4862680170120A0B0A090C81704370D1
+:1057000061680271C170120A427104E00020FEF764
+:105710009DFD00B983A002460621002000F05DFD3A
+:105720004EF66E51089107AA2068594C0790062141
+:105730002E2000F052FD00BF7CA21021182000F0A6
+:105740004CFD00BF7DA21021082000F046FD18216D
+:10575000012000F063FD00F0C3FF0DF1160006A963
+:105760000190009105AB07220021042001F043F9CC
+:105770006AA0BDF8181000900723BDF8140000229D
+:1057800000F0C4FF0DF11A0000900223BDF81610BE
+:10579000BDF81400002200F0B9FF0020207001F0D5
+:1057A000E7F8012060700021E17008206075102189
+:1057B000A17501202075A07000203B49A161C1B2F4
+:1057C00021440871401CC1B21029F8DB002004906C
+:1057D0000023A169207D039102900122A17D607DBB
+:1057E000019100906178A07801F0D6F8A07808B116
+:1057F00001F03DF90AB010BD254890F89010062937
+:1058000000D1704710B50020FFF732FC4FF448710B
+:1058100001230022084601F043F9244C08B9204630
+:1058200004E00220FFF724FC04F13000BDE8104042
+:1058300000F000BF18B587B01D48154C00F0FAFE07
+:1058400094F8900006281CD01021069105914FF481
+:10585000FA720492502100230291282003930190B0
+:10586000002200924FF448710B4B084601F04DF9AD
+:1058700008B9042003E00220FFF7FAFB002084F8B7
+:10588000900008B010BD000010790008A4080320A3
+:10589000F0110020635F000820170020006E000850
+:1058A0008075FF1F7C17002007B201008077000879
+:1058B000407900080120FFF7E3BB00212020FEF71C
+:1058C0007ABE0120FEF799BE0120FEF79EBE0000C1
+:1058D00010B50446616801F1080000F01FFC00B13A
+:1058E0000120207010BD000010B1012803D07047C6
+:1058F0003F20FEF770BE3F20FEF775BE2D2D2D20F8
+:105900005354204D414E5546414354555245522023
+:105910004944202D2D2D200A0000000053544D3302
+:10592000325742006C7AD8AC577200001234567865
+:105930009ABCDEF0123456789ABCDEF0FEDCBA096E
+:1059400087654321FEDCBA098765432170477047AC
+:1059500030B5039C016000250021C16041610561F3
+:10596000A107856142600381047704D5008910B1E5
+:105970004FF0FF3030BD002030BD2DE9F84F064616
+:1059800084B030890C460025002700287169BC4688
+:105990000CBF4FF00208B84699B180B930697568FC
+:1059A00000F1010BAB4528BFABEB050B3568285C5C
+:1059B00015F80BB000EB0B25AD1CADB203E00546AE
+:1059C00000E000B102463069D6F80CB05845934665
+:1059D00023BFD6F804E0AEEB0000401B002008EB2C
+:1059E0000B0903FB09FE864532BF0020B0FBF9FA24
+:1059F00009FB1A00C0B2804509DA96F81C905FEAEC
+:105A0000C97A48BF84465FEA897048BFC44610001F
+:105A100000F0AF807068714461448842C0F0A98092
+:105A2000B9460294ADF80020039357E082073CD5B5
+:105A30003089002840F09D8032681A44270A02F815
+:105A4000024C2246D6F800C09C440CF8017C274644
+:105A500030681844FBF732FC7169B06961187161F4
+:105A6000401C019CB06117E09CB3307FC207DDD5BC
+:105A7000308948B930681844FF2100F8021CFF2221
+:105A80003168194401F8012C0027706924187461E9
+:105A90005C463089002340B931680C70200A3268B6
+:105AA000507002237069801C706108EB04050020AF
+:105AB000ADB230616CB1BA440298D6F800C000EBC8
+:105AC0000A0122460CEB0300FBF7F8FB706924186F
+:105AD000746109F10109B069401CB061039A7068F2
+:105AE0003169914549D2691881422CBF081A08468C
+:105AF000306103463089A8B93168BDF80000C85448
+:105B00005B1C70683168834228BF1B1ABDF8000017
+:105B1000000AC8545B1C7068834228BF1B1A706956
+:105B2000801C70610BFB09FA7468BDF800000299D3
+:105B3000E41A844288BF0446ABEB04025C4551443E
+:105B4000019203D090D2307F00288DD13768224651
+:105B5000F818FBF7B3FB7069201870612746BDF891
+:105B60000050019C45440023ADB2A3E73068404497
+:105B700000E0002005B0BDE8F08F88448045F5D3F3
+:105B8000A8EB0008F2E770B5028900230B80002A19
+:105B900044690CBF02250025002C4CD0028952B963
+:105BA000C2684668531CB34228BF9B1B0668B25CA0
+:105BB000F35C02EB032200F086F825D10A884FF649
+:105BC000FF739A4204BF0289002A09D0C3680269A0
+:105BD0009A4219D20289BAB14668F31A934213D293
+:105BE0004368C268E41A1419446100240289C4603D
+:105BF0004AB902681478012B94BFC3F10103012351
+:105C0000D25C04EB02220A80C468426806682B1941
+:105C1000934228BF9B1A33440E884169891B491B54
+:105C2000416105D034192D19954228BFAD1AC560C0
+:105C30008169491E8161184670BDF0B50289002353
+:105C40000B80002A42690CBF02240024002A38D0AD
+:105C5000C56802892B464AB946686A1CB24228BF09
+:105C6000921B0668775DB25C07EB022200F02BF80E
+:105C700020D10A884FF6FF76B24204BF0289002A7B
+:105C800007D142680023012A94BFC2F10102012218
+:105C90000AE00269AA420DD202895AB14668751B10
+:105CA000954207D2002304E005682E78AA5C06EB33
+:105CB00002220A8041680068E4188C4228BF641AF6
+:105CC00003191846F0BD0A80027F02F00302012A80
+:105CD00070470000C0680840884201D10120704729
+:105CE00000207047C0690840884201D101207047F8
+:105CF0000020704710B5614C02212046FFF7F2FFEB
+:105D000038B16068C043810703D5FFF798FA0220D5
+:105D100018E001212046FFF7E5FF38B16068C04375
+:105D2000C10703D5FFF751FA01200BE008212046F7
+:105D3000FFF7D8FF38B16068C043010703D5FFF70C
+:105D4000D2FA0820A06010BD10B54C4C00F033F81A
+:105D500018B96068C043810306D400F02CF830B94C
+:105D60006068C043810302D5BDE8104064E00821AB
+:105D700000F022F870B96068C04301030AD560687A
+:105D80003F4940F400206060086880474FF40022DB
+:105D9000A26010BD202100F00FF858B96068C04320
+:105DA000810207D5606840F400106060BDE81040D3
+:105DB000FFF71EBA10BD022120468BE740BF20BF6F
+:105DC0003048016841F400410160704780B52E48B9
+:105DD000016841F480110160006800F480100090B7
+:105DE00000982648016841F001010160026842F410
+:105DF000803202602C20FDF7F4FFBDE802402D2028
+:105E0000FDF7EFBF2148016849084900016070476C
+:105E10001F494FF48030086070471C48016821F02A
+:105E200002010160704719484FF400314160026877
+:105E300022F40032026070471448016841F40031D6
+:105E40000160FFF7F6B938B504460C4D0821284625
+:105E5000FFF740FF30B10A480460696821F400216F
+:105E6000696031BDA0474FF40020A86031BD0748EC
+:105E7000016821F00801016070470000000C005823
+:105E8000BC1700200C04005850000058040C0058A7
+:105E9000080C0058006040607047EFF3108172B644
+:105EA000026882420CBF012000201CE0EFF3108248
+:105EB00072B603680B60486001600868416023E0C7
+:105EC000EFF3108272B6086043684B604160486827
+:105ED000016019E0EFF3108172B6436802681A603E
+:105EE00042680068426081F31088704710B5EFF394
+:105EF000108472B602680A600068FFE7FFF7EAFFE5
+:105F000084F3108810BD086082F310887047000089
+:105F10000249034A01600261704700BFF75100085F
+:105F20001F5200087FB50C466A4D61686A4EE861F1
+:105F30002962284600F058FE246805F12400FFF786
+:105F4000A9FF746006F10800FFF7A4FF012030707C
+:105F5000296829B10FF249120092029468468847D5
+:105F60007FBD1FB55C4C04F10800FFF796FFE8B950
+:105F70002078D8B1694604F10800FFF7B7FF012087
+:105F800054492070C96941B10098029001A888471E
+:105F90009DF804102170080003D00098FFF779F9EC
+:105FA00004E0009904F10800FFF780FF04F1080005
+:105FB000FFF773FF28B9207818B104F10800FFF744
+:105FC0007CFC1FBD2DE9FC410446002000F05EF87A
+:105FD00066882088A268DFF8FC80C6F3090646EAD6
+:105FE0008026E068B6B2C1B2304600F03BF800252A
+:105FF00048F2E800FFF768FC08E07888B04202D178
+:10600000226939781170787800B1012508F12400EF
+:10601000FFF743FFF0B9694608F12400FFF766FF78
+:106020000098014600F10B07487A0F28E5D0B7F831
+:106030000100B0420CD1887A6169C01EC0B28842AA
+:10604000C8BF0846606102462069F91CFBF736F9B3
+:106050003878D9E72800CBD0012000F017F80020CD
+:10606000BDE8F68110B513461B4A5468A4F8090030
+:10607000E1720A46194604F10C00FBF71FF9154AB4
+:106080001369BDE810400021002018471149096A32
+:1060900008B921B1084700291CBF012008477047F3
+:1060A00010B50146487A0F2818BF0E2807D10B48B3
+:1060B000FFF706FFBDE810400020FFF702BC064CCA
+:1060C00004F10800FFF7FCFE04F10800BDE81040F1
+:1060D000FFF7F3BB8C16002050170020B0160020ED
+:1060E000FFF778F99DF80E0005B000BDF8B500F196
+:1060F0000C026B4621214FF66640F1E72349002050
+:10610000087700222248027100F044B820490A7939
+:1061100041F822000879401C0871704770B50446A8
+:106120006078FF2802BFB4F8030000F47F40B0F5A8
+:10613000406F1FD10025154E317FE8B2884222D230
+:10614000E9B256F8212020469047002808BF6D1C70
+:10615000F2D018E0761C2979F0B288420AD2F1B266
+:1061600055F82120204690470100F3D002D00228A4
+:1061700005D006E02046BDE87040FFF7BFB900201B
+:1061800070BD012070BD0026014DE4E7001700201E
+:10619000AC17002080B500F031FD00F030FD00F0BC
+:1061A0002FFD00F02EFD00F02DFD00F02CFD00F085
+:1061B0002BFD00F02AFD00F029FD00F028FD00F085
+:1061C00027FD00F026FD00F025FD00F024FD00F085
+:1061D00023FDBDE8014000F020BD18B50C46C7B056
+:1061E000114600F04EF88DF81D4022460DF11E00BC
+:1061F00000F014FD00F03AF83F21ADF804100C2235
+:1062000000F039F8A41C0692049400F04BF8002822
+:106210004CBFFF209DF8000048B010BD00B5C7B0CE
+:1062200000F01DF80F2200F032F800284CBFFF20CC
+:106230009DF8000047B000BD00B5C7B000228DF842
+:106240000020ADF81C0000F011F8182200F01FF833
+:1062500000284CBFFF209DF8000047B000BD002380
+:106260008DF81C008DF81D108DF8003018220021CB
+:1062700001A800F0D9BCADF8062007A903910122BE
+:10628000704700228DF800208DF81C007047ADF893
+:1062900006203F21ADF804100222049207A90391C1
+:1062A00001220692CDF814D0002101A8FFF78ABE82
+:1062B00080B50FF2A92200210420FEF76FF90FF23A
+:1062C000692200210820FEF769F9C4480021012253
+:1062D0000180C1808170C270017101720FF23900BA
+:1062E000FFF714FFBDE80240C3A000F0A3B9027895
+:1062F000BA4912B1012A03D070474088C88070475C
+:106300000022087ACA8000B10A720020FEF7B8BEE7
+:1063100000210820FEF74FB92DE9F04704466078C8
+:10632000FF2814D1AD4DB4F803006989DFF8B092AD
+:1063300040F60442801A00F08880801E47D0001F7B
+:1063400006D0401F00F0B080401E00F0D780E5E08E
+:10635000B4F80570287A58B10846FFF7A2F9297AEF
+:10636000062908BF0028F2D14FF6FF712872698113
+:106370006F81E079217A91FBF0F814285FFA88F8B0
+:10638000E5D110264FF0000A5FFA8AF04045DEDAC8
+:10639000A719787AB97A40EA01204FF64062904214
+:1063A00010D16989484600F045F9F81F0178427814
+:1063B00041EA0221A9818178C07841EA0021E9817E
+:1063C00008212972B61DF6B20AF1010ADCE7B4F819
+:1063D0000500814202BF4FF01108E07915283DD138
+:1063E000207A411E2172207A0028B0D004EB0801E7
+:1063F00004F10A02487A11F8057D12F8083049784C
+:1064000040EA032047EA01274FF64162698990423A
+:106410000BD04FF6426398420ED109F1740000F0A0
+:1064200009F90A202872AF8206E009F13C0000F069
+:1064300001F9092028722F82207AA0F1150108F1B4
+:10644000150021725FFA80F8CDE7B4F805008142AB
+:1064500001BF94F808800026E07901285ED1B24699
+:106460005FFA8AF0B0EB980F58DAA01904F10A012C
+:10647000477A8A5DC17A007B47EA022741EA002118
+:1064800042F6021291420AD1698909F1B80000F07E
+:10649000D1F8287A0A2802D10B20EF822872361D03
+:1064A000F6B20AF1010ADBE7B4F80500814202BF47
+:1064B000B4F80710A88A814230D1617A022902BF5C
+:1064C000A07A6870012829D194F80B0052A4A87012
+:1064D00048B9FEF7D5FD09F5987000F0ABF82046F5
+:1064E00000F0A8F81AE009F5B87000F0A3F820460B
+:1064F00000F0A0F80020FEF7BBFD0FE009F580706A
+:1065000000F098F843A000F095F86889B4F80510F9
+:10651000884203D100210420FEF74DF80020BDE899
+:10652000F0872E48007A704710B52E482B4C00F0AB
+:1065300081F800BF38A000F07DF82079401E80412E
+:10654000C00F2071207A38B1218A6089E31CBDE830
+:106550001040022200F0A1B910BD00001CB51F4C74
+:10656000217A01200029ADF8000036D0C91F052985
+:106570001D4832D8DFE801F0030810151F2A00BFBC
+:1065800026A000F057F813BD00F054F8E289A18965
+:10659000608900F004F913BD283000F04BF8218A1F
+:1065A00003E0643000F046F8A18A60898A1C92B248
+:1065B00000F015F913BDA83000F03CF800F016F813
+:1065C000062020720220FEF75BFD13BDD03000F0E4
+:1065D00031F800F00BF80620207213BD38170020A8
+:1065E000506C000894780008B4700008E18A608953
+:1065F0006B46022200F024B92D2D2050325020434A
+:106600004C49454E5420494E495449414C495A45FC
+:1066100044200A000A000000200A0D005032505F9A
+:10662000444953434F5645525F534552564943459B
+:10663000530A00000EB4C0B5024603A80021019021
+:10664000009101AB0121044878440C30F9F776FD44
+:1066500006BC5DF810FB00BFDF1300002DE9F84217
+:10666000C7B04FF00009ADF81C00DDF838C14F9EEF
+:10667000509F519D529C8DF8009007A84180ADF825
+:106680002020ADF82230A0F808C0ADF82660878140
+:106690008DF82A508DF82B4000F017F84FF4C17296
+:1066A000ADF806203F21ADF804101022049207A98E
+:1066B00003910122069200F00DF800284CBFFF2044
+:1066C0009DF8000048B0BDE8F0821822002101A822
+:1066D00000F0AABACDF814D0002101A8FFF772BCCF
+:1066E00000B587B000208DF8000000F09CF840F263
+:1066F000011200F00CF90122069200F09BF800282C
+:106700004CBFFF209DF8000007B000BD78B5C7B0B2
+:106710001D464C9B00F0EEF800268DF800608DF8C9
+:1067200021502A4619460DF1220000F077FA00F0B8
+:106730007AF800F067F84FF4837200F0E2F8AD1DCC
+:1067400000F076F800284CBFFF209DF8000049B00B
+:1067500060BD00B5C7B000F011F800F064F800F0BB
+:1067600051F84FF4897200F00FF800F063F8002838
+:106770004CBFFF209DF8000047B000BD00228DF8FF
+:106780000020ADF81C0070470F210291ADF80620E3
+:106790000221049107AA012106910392704718B5BE
+:1067A000C7B000F00FF800F02DF840F2151200F01D
+:1067B0002DF800F03FF800284CBFFF209DF80000A6
+:1067C00048B010BD0024ADF81C008DF8004007A8AB
+:1067D000418082800021182201A800F025BA18B556
+:1067E000C7B0FFF7EFFF00F00DF840F2171200F00E
+:1067F0000DF800F01FF800284CBFFF209DF80000A6
+:1068000048B010BD3F21ADF8041070470F21029130
+:10681000ADF806200621049107AA012106910392F2
+:1068200070478DF800301822002101A800F0FCB953
+:1068300006920495CDF814D0002101A8FFF7C2BB41
+:1068400030B5C7B000F011F800F046F8FFF7EBFFE5
+:1068500040F2211100F013F8FFF7ECFF00284CBFC5
+:10686000FF209DF8000047B030BD1446ADF81C0075
+:10687000002507A88DF80050418004717047ADF8DD
+:1068800006100F2202923F2007A9ADF804000391E1
+:106890000122641D06920494704730B5C7B000F021
+:1068A00011F8FFF7C0FFFFF7ADFF40F2231200F031
+:1068B00018F8FFF7BFFF00284CBFFF209DF800002D
+:1068C00047B030BDADF81C00ADF81E1014460025D1
+:1068D0008DF800508DF8204019460DF1210000F090
+:1068E0009DB9ADF8062007A903910122641D069207
+:1068F00004947047ADF81C00ADF81E108DF82020F0
+:106900007047ADF8062007A9039101227047ADF842
+:1069100006203F21ADF80410704700B587B000F0A5
+:1069200013F800F020F8032100F009F800F013F844
+:1069300000284CBFFF209DF8000007B000BDADF857
+:106940000410ADF80610704700208DF80000704765
+:10695000049207A9039101220692CDF814D00021D8
+:1069600001A8FFF72FBB1822002101A800F05CB995
+:1069700000B5C7B000F06EF800F0C2F800F0AFF854
+:10698000852200F06DF800F012F900284CBFFF20BE
+:106990009DF8000047B000BD2DE9F043C7B0DDF819
+:1069A00038814F9E509D519F529C8DF81C004FF096
+:1069B000000907A88DF80090417082700DF1230145
+:1069C0008DF81F308DF820808DF821608DF82250D1
+:1069D0000F608DF8274000F093F8862200F05AF8F7
+:1069E0000C2200F0E0F800284CBFFF209DF80000CA
+:1069F00047B0BDE8F083F8B5C8B005460E46174667
+:106A00001C4600F022F808A8467087708DF82050C8
+:106A100000F0E5F88A2200F0D1F8032200F0D4F863
+:106A2000002848BFFF200ED49DF8000058B94F99A8
+:106A30004E98BDF801202280BDF803300380BDF8D8
+:106A400005000880002049B0F0BD072200216846FB
+:106A500000F0EAB800228DF800208DF81C00704785
+:106A6000ADF8062007A9039101220492704700B5F2
+:106A700087B000208DF8000000F042F8922200F06C
+:106A800009F800F093F800284CBFFF209DF80000A3
+:106A900007B000BDADF806203F21ADF804107047E7
+:106AA00030B5C7B000F010F800F02AF800F017F881
+:106AB000972200F018F800F07BF800284CBFFF2068
+:106AC0009DF8000048B020BD0025ADF81C008DF8F1
+:106AD000213007A8418002718DF8005070473F2196
+:106AE000ADF8041070470F210291ADF80620062181
+:106AF000049107AA01210691039270478DF8003096
+:106B00001822002101A800F08FB82DE9F04F0026CF
+:106B1000C7B000F01DF800F00FF8FFF7F1FF0F22EB
+:106B200002929C2100F02EF800284CBFFF209DF817
+:106B3000000047B0BDE8F08F8DF82790B581ADF823
+:106B40002AB03782ADF82E80B482ADF832A07047FB
+:106B50008446559CDDF84091519DDDF848B1539F26
+:106B6000DDF85081DDF858A18DF80060ADF81CC04B
+:106B700007AE084670803271194606220DF12100D9
+:106B800000F04CB8ADF80610182204923F2007A977
+:106B9000ADF80400039101220692CDF814D0002133
+:106BA00001A8FFF70FBA049207A9039101220692E8
+:106BB000CDF814D0002101A8FFF704BAADF80A20DF
+:106BC0003F21ADF808107047059208A904910722EB
+:106BD0000792CDF818D0002102A8FFF7F3B91822C8
+:106BE000002102A800F020B80249034A01600261B6
+:106BF000704700BF8D510008B751000870477047BB
+:106C000070477047704770477047704770477047CC
+:106C100070477047704770477047704710B504461B
+:106C2000FAF74CFB204610BD10B5044610460A4644
+:106C30000146204600F002F8204610BD4018491CCD
+:106C40001CBFB1F1010100F8012DF9D1704700001E
+:106C50002D2D2047415454203A205032505F534547
+:106C600052564943455F5555494420464F554E4479
+:106C7000202D20636F6E6E656374696F6E2068618E
+:106C80006E646C652030782578200A002D2D204711
+:106C9000415454203A2057524954455F5555494470
+:106CA00020464F554E44202D20636F6E6E656374F1
+:106CB000696F6E2068616E646C6520307825780A93
+:106CC000000000002D2D2047415454203A204E4F03
+:106CD00054494649434154494F4E5F434841525FEE
+:106CE0005555494420464F554E4420202D20636F72
+:106CF0006E6E656374696F6E2068616E646C65208A
+:106D0000307825780A0000002D2D2047415454206A
+:106D10003A20434C49454E545F434841525F434FEC
+:106D20004E4649475F44455343524950544F525F82
+:106D3000555549442D20636F6E6E656374696F6E9F
+:106D40002068616E646C6520307825780A00000048
+:106D50002D2D2047415454203A204556545F424C33
+:106D600055455F474154545F50524F434544555237
+:106D7000455F434F4D504C455445200A00000000EC
+:106D8000202D2D20503250204150504C4943415429
+:106D9000494F4E20434C49454E54203A204E4F54C3
+:106DA000494649434154494F4E205245434549566F
+:106DB0004544202D204C4544204F4646200A0D00D6
+:106DC000202D2D20503250204150504C49434154E9
+:106DD000494F4E20434C49454E54203A204E4F5483
+:106DE000494649434154494F4E205245434549562F
+:106DF0004544202D204C4544204F4E0A0D000000F4
+:106E00002D2D204741502047454E4552414C2044AE
+:106E10004953434F564552592050524F43454455CC
+:106E200052455F434F4D504C455445440A000000C5
+:106E30000D0A0D2A2A20444953434F4E4E454354D0
+:106E4000494F4E204556454E5420574954482053EB
+:106E50004552564552200A000D0A0D2A2A20434F5A
+:106E60004E4E454354494F4E204556454E542057AB
+:106E700049544820534552564552200A000000000C
+:106E80000D0A0D2A2A204741545420534552564991
+:106E900043455320262043484152414354455249DB
+:106EA000535449435320444953434F564552592064
+:106EB000200A00002A2047415454203A20205374CD
+:106EC00061727420536561726368696E67205072E5
+:106ED000696D617279205365727669636573200DFF
+:106EE0000A0D0000424C455F4354524C5F417070A4
+:106EF0005F4E6F74696669636174696F6E28292CCF
+:106F000020416C6C207365727669636573206469D7
+:106F100073636F76657279204661696C6564200DD4
+:106F20000A0D00002D2D2053455256455220444550
+:106F3000544543544544202D2D20564941204D4170
+:106F40004E2049440A00000010B50446AFF300800B
+:106F5000204600F005F80446AFF30080204610BD3F
+:106F600070B500F10F06F608F600B04240D2082EC8
+:106F700004D2082602E0083000F047F8DFF8045198
+:106F80002C68210005D1002007E00268B24221D21E
+:106F9000011D08680028F8D12068291D0A6882426E
+:106FA00022D01368B34238BF111DF7D312E09319F2
+:106FB0000B60801B54685C600B6818601660096881
+:106FC00000291DBF48680028081D0020286002F124
+:106FD000080070BD61B10A681068A0F10803B342EF
+:106FE000E5D250680860EAE700F04EF80028C2D108
+:106FF000002070BD10B5040006D0AFF3008020461D
+:1070000000F003F8AFF3008010BD002800D17047F6
+:1070100070B4A0F108021368072B2BD913F0070FE7
+:1070200028D1184C616809B18A4202D2516062606D
+:1070300013E0486800B3904238BF0146F9D31BE023
+:10704000964203D11B180B600A4606E0486810B14F
+:10705000134498420ED350604A60506850B1136890
+:10706000D518854206D1002626600168CB1813602A
+:107070004068506070BC704708680E18B242DFD29A
+:1070800070BC7047A41700200749086808B10020A9
+:1070900070470648C008C00008600549C908C90013
+:1070A000091A0160704700BFC8170020D7270020C9
+:1070B000D02B00202A2047415454203A20446973A1
+:1070C000636F76657220503250204368617261634D
+:1070D0007465726973746963730A00002A204741FA
+:1070E0005454203A20446973636F76657220446576
+:1070F0007363726970746F72206F66205458202D0C
+:1071000020577269746520436861726163746572A7
+:10711000697469630A0000002A2047415454203AE8
+:1071200020446973636F7665722044657363726986
+:1071300070746F72206F66205278202D204E6F740D
+:10714000696669636174696F6E2043686172616327
+:10715000746572697469630A000000002A2047415F
+:107160005454203A20456E61626C652053657276F6
+:107170006572204E6F74696669636174696F6E0A27
+:10718000000000002A2047415454203A20446973EB
+:1071900061626C6520536572766572204E6F74690A
+:1071A0006669636174696F6E0A0000002DE9F04141
+:1071B00007468846387810F0030F16461D4633D030
+:1071C000384600F099F878BBB8F1000F1CBFD8E939
+:1071D00000018619012D2ED13888C10415D5396AD0
+:1071E00007F14402384600F0A3F83A6B044602B9AE
+:1071F0003A69F968384600F09BF8361B341A7A6908
+:10720000F968384600F094F8261A1EB94DB916F1FF
+:10721000010F09D097F903002A46314600F08EF895
+:10722000064616F1010F09D12320AFF300804FF07D
+:10723000FF30BDE8F081022DE8D1EBE7388810F48B
+:10724000405F0ED07868F86038617861B86107F106
+:1072500044017868F861396207F1300000217862F2
+:107260003963B8F1000F05D0D8E9020107F1340203
+:10727000C2E900013B884CF6FF6003403B800020E0
+:10728000BDE8F08170B50546AFF300802888810421
+:1072900015D56E680024EA6895F9030031469142DD
+:1072A00012D2521AFDF786FE10F1010F1CBF002802
+:1072B0003618F0D10FE04DF6FF70014029802846C6
+:1072C000AFF30080002070BD00220021FDF772FEA8
+:1072D00010F1010F00D101246868E860A861E8613D
+:1072E000002C2988E7D041F4007129802846AFF3AB
+:1072F00000804FF0FF3070BDF8B5A0B9AFF300804B
+:1073000000250A4E08244FF0FF37306820B1FFF700
+:10731000B9FF002848BF3D46361D641EF5D1AFF3C6
+:1073200000802846F2BDBDE8F240ABE7D011002056
+:10733000914234BF511A0021084670473EB50400FF
+:107340000D00012A02D100F063F807E0022A07D1FC
+:1073500000940020019069460C20ABBE2D1801E07E
+:10736000002A0CD10094019569460A20ABBE002882
+:1073700005D100222100280000F027F801E00020BC
+:10738000C04303B030BD000010B4314A00211346A1
+:107390001C6884421EBF491C9C6884421EBF491C55
+:1073A0001C69844209D09C69491C844205D0491C4F
+:1073B00020331029ECD310BC7047002342F8313041
+:1073C00002EBC1014B6010BC704770B4204C00232D
+:1073D00025462E688E421EBF5B1CAE688E421EBFC5
+:1073E0005B1C2E698E4209D0AE695B1C8E4205D0B3
+:1073F0005B1C2035102BECD370BC7047054604EBAA
+:10740000C303012A04BF59684D195D6070BC704701
+:1074100010B40F4A002113461C6884421EBF491C49
+:107420009C6884421EBF491C1C6984420AD09C6926
+:10743000491C844206D0491C20331029ECD310BCCF
+:107440000020704702EBC100406810BC704700008C
+:10745000AC14002010B50446E068A169884251D3FD
+:10746000218849F202030B40022B08D008044CBFCC
+:107470004FF400704FF48440014321803BE001F45D
+:10748000C042B2F5C04F06D1A168884203D320465E
+:10749000FFF732FF78BB208810F4406F02BF6068AE
+:1074A00004F14401884217D14FF40070FFF74CFDFE
+:1074B000606030B904F144006060E060401CA0608E
+:1074C0000AE0218841F040012180E060606100F520
+:1074D00000726068A260E0616068A1682061A161DB
+:1074E000207841070AD502220021204600F00CF83E
+:1074F00010F1010F02D14FF0FF3010BD208840F491
+:10750000C0402080002010BD70B504460D461646D0
+:10751000AFF3008033462A4600212046FFF746FE9F
+:1075200005462046AFF30080284670BD00000000ED
+:10753000000000000000000000000000000000004B
+:10754000000000000000000000000000000000003B
+:10755000000000000000000000000000000000002B
+:10756000000000000000000000000000000000001B
+:10757000000000000000000000000000000000000B
+:1075800000000000000000000000000000000000FB
+:1075900000000000000000000000000000000000EB
+:1075A00000000000000000000000000000000000DB
+:1075B00000000000000000000000000000000000CB
+:1075C0000000000018B401780A0627D51F4A136886
+:1075D0000021834203D1002442F821401BE053687C
+:1075E000012183421EBF022193688342F3D0D368F6
+:1075F000032183421EBF042113698342EBD05369E8
+:10760000052183421EBF0621936983421EBF0721C5
+:10761000D3698342DFD012BC00F01AB80021018088
+:107620004FF0FF3200F14401C270C1604161C1619D
+:1076300000F1440300F1440200F1300143600261B3
+:1076400082610262416211BC70470000D0110020CB
+:10765000FFF7D0BC0100000003000000050000009F
+:107660000100000001000000060000000A00000008
+:1076700020000000020000000400000008000000DC
+:107680001000000040000000800000000001000029
+:1076900000020000A0860100400D0300801A0600D1
+:1076A00000350C0040420F0080841E0000093D00A0
+:1076B00000127A000024F40000366E010048E80150
+:1076C000006CDC0200000000000000000000000070
+:1076D0000000000038B504000ED0207810F0030F31
+:1076E00003D094F90300002809D5AFF300802046A9
+:1076F000FFF768FFAFF300804FF0FF3032BD204648
+:10770000FFF7FAFD0546AFF300802078410644BF3D
+:107710006068FFF79DFF0020606094F90300022875
+:1077200004D900F016F808B14FF0FF35E06B48B10E
+:1077300000F01BF808B14FF0FF35E06BFFF788FF52
+:107740000020E0632046FFF73DFFAFF300802846AE
+:1077500032BD1CB50200009269460220ABBE040097
+:107760001000FFF711FE200016BDE0B50090F9F7FC
+:1077700049FD019069460E20ABBE03B000BD00007C
+:10778000200D0A0D2A2A2053544152542047454EB9
+:107790004552414C20444953434F564552592028A5
+:1077A0005343414E29202A2A20200D0A0D000000B3
+:1077B0002D2D20424C455F4170705F53746172748F
+:1077C0005F4C696D697465645F446973635F52659A
+:1077D000712C204661696C6564200D0A0D00000063
+:1077E00038B50C46C5B22046AFF30080E068A16909
+:1077F000884204D32046FFF72DFE00280FD4E0680E
+:10780000401CE06000F8015D2088010503D44005BC
+:107810000BD50A2D09D12046FFF76EFD28B1204671
+:10782000AFF300804FF0FF3032BD2046AFF3008051
+:10783000284632BD7047FEE7FEE7FEE7FEE77047E9
+:107840007047704700F01EB80548FBF76ABB054853
+:10785000FAF7D7BA0448FAF7D4BA0448FBF761BB81
+:107860002C150020A0130020141300208C150020DC
+:107870001020FCF7C1BBFDF7E3B9FEF765BAFEF7D0
+:1078800039BA000002490A68886882180A6070479D
+:10789000501000202D2D20503250204150504C4986
+:1078A000434154494F4E20434C49454E5420203AC1
+:1078B00020425554544F4E20505553484544202D96
+:1078C00020575249544520544F2053455256455253
+:1078D000200A200038B50D4D0824286800281CBF58
+:1078E000017811F0030F05D090F90310002958BF5B
+:1078F000FFF7F0FE2D1D641EEFD1BDE838400022D9
+:1079000000214FF0FF30FDF755BB00BFD011002024
+:107910000000000000000000000000000000000067
+:107920000000000044000800400508013A799C006E
+:10793000F4010000FFFFFFFF48010100000000000C
+:107940000D0A0D2A2A2043524541544520434F4EEB
+:107950004E454354494F4E20544F205345525645AF
+:1079600052202A2A20200D0A0D00000010B50749D8
+:1079700079441831064C7C44163404E00A68081D2A
+:10798000114488470146A142F8D110BD2C000000E7
+:10799000500000004EF68851CEF20001086840F415
+:1079A00070000860BFF34F8FBFF36F8F4FF0007010
+:1079B000E1EE100A70470000D397FFFFE0050000DA
+:1079C000F0110020800800002400032000000000C7
+:1079D000B396FFFF84010000960100000400002020
+:1079E0000000000000000000000000000000000097
+:1079F000010000000200000003000000040000007D
+:107A000000F00DF8002801D0FFF7B0FFAFF30080C1
+:107A10000020AFF30080FCF76AF800F002F80120C4
+:107A2000704700F001B800000746FFF753FF3846E3
+:107A3000FAF74EF9FBE738B504460D46284600F044
+:107A400005F8A84218BF0024204632BD0149FFF7BF
+:107A5000C7BE00BF401100200148804701480047D1
+:107A600085400008697A0008AFF30080FFF792FFB5
+:107A7000FFF7C6FF00002E004300FFF7FEBFFFF731
+:107A8000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF72A
+:107A9000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF71A
+:107AA000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF70A
+:107AB000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7FA
+:107AC000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7EA
+:107AD000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7DA
:107AE000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7CA
:107AF000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7BA
:107B0000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7A9
@@ -1972,24 +1972,19 @@
:107B2000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF789
:107B3000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF779
:107B4000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF769
-:107B5000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF759
-:107B6000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF749
-:107B7000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF739
-:107B8000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF729
-:107B9000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF719
-:107BA000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF709
-:107BB000FEBF0000F3FF010001F1FF01F1FF01F141
-:107BC000FF01F1FF01F1FF01F1FF01F1FF01F1FF01
-:107BD00001F1FF01F1FF01F1FF01F1FF01F1FF01EF
-:107BE000F1FF01F1350152FF01ED3F101210113D7F
-:107BF0005410700104004804120804520C04F005EB
-:107C000007093D00D07A0008046158F200D2141030
-:107C1000010000D40C215CFC021778100020B71082
-:107C200013ED117E110143DB113C2101100701040A
-:107C300000003C1100203D04523C04211BA108F32C
-:107C4000112811641007020401013C1600208C0465
-:107C5000523C0431405108128444F21370484003EE
-:107C6000080202EC1540210821042134610812CCDD
-:0F7C700044F212B84816F818124028F206882C71
-:0400000508007AC5B0
+:107B5000FEBFFFF7FEBF0000F3FF010001F1FF01D0
+:107B6000F1FF01F1FF01F1FF01F1FF01F1FF01F16F
+:107B7000FF01F1FF01F1FF01F1FF01F1FF01F1FF51
+:107B800001F1FF01F1FF01F1350152FF01ED3F105D
+:107B90001210113D541070010400480412080452E0
+:107BA0000C04F00507093D00747A0008046158F2DE
+:107BB00000761410010000780C215CFC021778108C
+:107BC0000020B710134D127E1101433B123C2101DE
+:107BD0001007010400003C1100203D04523C042128
+:107BE0001BA108F3112811641007020401013C16BF
+:107BF00000208C04523C0431405108128444F2139A
+:107C000070484003080202EC154021082104213489
+:107C1000610812CC44F212B84816F818124028F243
+:037C200006882CA7
+:0400000508007A690C
:00000001FF
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Inc/app_common.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Inc/app_common.h
index 2a1d61089..4defc5d7a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Inc/app_common.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Inc/app_common.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : app_common.h
- * Description : App Common application configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : App Common application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Inc/app_conf.h
index 11216c1f2..67fa9c6d8 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Inc/app_conf.h
@@ -1,8 +1,9 @@
/**
******************************************************************************
* File Name : app_conf.h
- * Description : Application configuration file for BLE middleWare.
- ******************************************************************************
+ * Description : Application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
@@ -17,17 +18,18 @@
*/
/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef APP_CONFIG_H
-#define APP_CONFIG_H
+#ifndef APP_CONF_H
+#define APP_CONF_H
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Application Config
******************************************************************************/
-/**< generic parameters ********************************************************/
+/**< generic parameters ******************************************************/
/**
* Define Tx Power
@@ -77,9 +79,17 @@
*/
#define CFG_BLE_ERK {0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21,0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21}
+/* USER CODE BEGIN Generic_Parameters */
+/**
+ * SMPS supply
+ * SMPS not used when Set to 0
+ * SMPS used when Set to 1
+ */
+#define CFG_USE_SMPS 1
+/* USER CODE END Generic_Parameters */
+
/**< specific parameters */
/*****************************************************/
-#define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI4_IRQHandler
#define CFG_MAX_CONNECTION 1
#define UUID_128BIT_FORMAT 1
#define CFG_DEV_ID_P2P_SERVER1 (0x83)
@@ -94,11 +104,6 @@
#define CONN_L2 (CONN_L(10))
#define OOB_DEMO 1 /* Out Of Box Demo */
-#define CFG_MAX_CONNECTION 1
-#define UUID_128BIT_FORMAT 1
-
-#define CFG_DEV_ID_P2P_SERVER1 (0x83)
-
/******************************************************************************
* BLE Stack
******************************************************************************/
@@ -178,7 +183,7 @@
* 1 : internal RO
* 0 : external crystal ( no calibration )
*/
-#define CFG_BLE_LSE_SOURCE 1
+#define CFG_BLE_LSE_SOURCE 0
/**
* Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
@@ -384,12 +389,6 @@ typedef enum
#define CFG_LPM_SUPPORTED 0
#define CFG_DEBUGGER_SUPPORTED 1
#endif
-
-/* USER CODE BEGIN Defines */
-#define CFG_LED_SUPPORTED 1
-#define CFG_BUTTON_SUPPORTED 1
-/* USER CODE END Defines */
-
/**
* When CFG_DEBUG_TRACE_FULL is set to 1, the trace are output with the API name, the file name and the line number
* When CFG_DEBUG_TRACE_LIGHT is set to 1, only the debug message is output
@@ -426,6 +425,13 @@ typedef enum
#define DBG_TRACE_MSG_QUEUE_SIZE 4096
#define MAX_DBG_TRACE_MSG_SIZE 1024
+/* USER CODE BEGIN Defines */
+#define CFG_LED_SUPPORTED 1
+#define CFG_BUTTON_SUPPORTED 1
+
+#define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI4_IRQHandler
+/* USER CODE END Defines */
+
/******************************************************************************
* Scheduler
******************************************************************************/
@@ -493,7 +499,10 @@ typedef enum
typedef enum
{
CFG_LPM_APP,
- CFG_LPM_APP_BLE
+ CFG_LPM_APP_BLE,
+ /* USER CODE BEGIN CFG_LPM_Id_t */
+
+ /* USER CODE END CFG_LPM_Id_t */
} CFG_LPM_Id_t;
/******************************************************************************
@@ -503,6 +512,6 @@ typedef enum
#define CFG_OTP_END_ADRESS OTP_AREA_END_ADDR
-#endif /*APP_CONFIG_H */
+#endif /*APP_CONF_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Inc/stm32_lpm_if.h
index 38e326512..d8e67947f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Inc/stm32_lpm_if.h
@@ -1,46 +1,22 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file stm32_lpm_if.h
-* @brief Header for stm32_lpm_f.c module (device specific LP management)
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
******************************************************************************
* @attention
*
-* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics International N.V.
+* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted, provided that the following conditions are met:
-*
-* 1. Redistribution of source code must retain the above copyright notice,
-* this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following disclaimer in the documentation
-* and/or other materials provided with the distribution.
-* 3. Neither the name of STMicroelectronics nor the names of other
-* contributors to this software may be used to endorse or promote products
-* derived from this software without specific written permission.
-* 4. This software, including modifications and/or derivative works of this
-* software, must execute solely and exclusively on microcontroller or
-* microprocessor devices manufactured by or for STMicroelectronics.
-* 5. Redistribution and use of this software other than as permitted under
-* this license is void and will automatically terminate your rights under
-* this license.
-*
-* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
-* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
-* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+* This software component is licensed by ST under BSD 3-Clause license,
+* the "License"; You may not use this file except in compliance with the
+* License. You may obtain a copy of the License at:
+* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32_LPM_IF_H
@@ -89,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Inc/stm32wbxx_hal_conf.h
index 5c703f75d..31d63e37a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Inc/stm32wbxx_hal_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Inc/stm32wbxx_hal_conf.h
@@ -58,6 +58,7 @@
#define HAL_UART_MODULE_ENABLED
/*#define HAL_USART_MODULE_ENABLED */
/*#define HAL_WWDG_MODULE_ENABLED */
+#define HAL_EXTI_MODULE_ENABLED
#define HAL_CORTEX_MODULE_ENABLED
#define HAL_DMA_MODULE_ENABLED
#define HAL_FLASH_MODULE_ENABLED
@@ -221,6 +222,10 @@
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32wbxx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32wbxx_hal_flash.h"
@@ -333,9 +338,9 @@
* If expr is true, it returns no value.
* @retval None
*/
-#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
+ #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
/* Exported functions ------------------------------------------------------- */
-void assert_failed(uint8_t* file, uint32_t line);
+ void assert_failed(uint8_t* file, uint32_t line);
#else
#define assert_param(expr) ((void)0U)
#endif /* USE_FULL_ASSERT */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Inc/utilities_conf.h
index c98d97ba1..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Inc/utilities_conf.h
@@ -1,3 +1,4 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* File Name : utilities_conf.h
@@ -9,13 +10,14 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef UTILITIES_CONF_H
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/app_entry.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/app_entry.c
index d1bdfdfbb..97a6a8b82 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/app_entry.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/app_entry.c
@@ -69,8 +69,8 @@ static void SystemPower_Config( void );
static void Init_Debug( void );
static void appe_Tl_Init( void );
static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status );
-
static void APPE_SysUserEvtRx( void * pPayload );
+
#if (CFG_HW_LPUART1_ENABLED == 1)
extern void MX_LPUART1_UART_Init(void);
#endif
@@ -107,7 +107,7 @@ void APPE_Init( void )
/**
* From now, the application is waiting for the ready event ( VS_HCI_C2_Ready )
- * received on the system channel before starting the BLE Stack
+ * received on the system channel before starting the Stack
* This system event is received with APPE_SysUserEvtRx()
*/
/* USER CODE BEGIN APPE_Init_2 */
@@ -220,8 +220,6 @@ static void appe_Tl_Init( void )
return;
}
-
-
static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status )
{
UNUSED(status);
@@ -235,7 +233,7 @@ static void APPE_SysUserEvtRx( void * pPayload )
TL_TRACES_Init( );
APP_BLE_Init( );
- UTIL_LPM_SetOffMode(1 << CFG_LPM_APP, UTIL_LPM_ENABLE);
+ UTIL_LPM_SetOffMode(1U << CFG_LPM_APP, UTIL_LPM_ENABLE);
return;
}
@@ -285,7 +283,6 @@ void UTIL_SEQ_Idle( void )
return;
}
-
/**
* @brief This function is called by the scheduler each time an event
* is pending.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/hw_timerserver.c
index 52a1bfa0d..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/hw_timerserver.c
@@ -1,22 +1,21 @@
/**
******************************************************************************
- * File Name : hw_timerserver.c
- * Description : Hardware timerserver source file for BLE
- * middleWare.
+ * File Name : hw_timerserver.c
+ * Description : Hardware timerserver source file for STM32WPAN Middleware.
+ *
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/hw_uart.c
index 52e9e2b3a..9a553610d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/hw_uart.c
@@ -1,7 +1,7 @@
/**
******************************************************************************
* File Name : Src/hw_uart.c
- * Description : HW UART source file for BLE middleWare.
+ * Description : HW UART source file for STM32WPAN Middleware.
*
******************************************************************************
* @attention
@@ -48,7 +48,7 @@ extern UART_HandleTypeDef huart1;
hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
} while(0)
- /* Variables ------------------------------------------------------------------*/
+/* Variables -----------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
@@ -65,73 +65,73 @@ extern UART_HandleTypeDef huart1;
void (*HW_hlpuart1TxCb)(void);
#endif
- void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_RX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_RX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_RX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_RX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ return;
+}
+
+void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
{
- HAL_StatusTypeDef hal_status = HAL_OK;
- hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
+ default:
+ break;
}
switch (hal_status)
@@ -161,8 +161,8 @@ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t
hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
{
-HAL_StatusTypeDef hal_status = HAL_OK;
-hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
@@ -250,33 +250,33 @@ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
switch ((uint32_t)huart->Instance)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1RxCb)
- {
- HW_huart1RxCb();
- }
- break;
+ if(HW_huart1RxCb)
+ {
+ HW_huart1RxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1RxCb)
- {
- HW_hlpuart1RxCb();
- }
- break;
+ if(HW_hlpuart1RxCb)
+ {
+ HW_hlpuart1RxCb();
+ }
+ break;
#endif
default:
@@ -292,20 +292,20 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1TxCb)
- {
- HW_huart1TxCb();
- }
- break;
+ if(HW_huart1TxCb)
+ {
+ HW_huart1TxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1TxCb)
- {
- HW_hlpuart1TxCb();
- }
- break;
+ if(HW_hlpuart1TxCb)
+ {
+ HW_hlpuart1TxCb();
+ }
+ break;
#endif
default:
@@ -315,4 +315,4 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
return;
}
- /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/main.c
index 89612d53b..72d282bcf 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/main.c
@@ -41,10 +41,10 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "app_entry.h"
+#include "app_common.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
-#include "app_common.h"
#include "stm32_lpm.h"
#include "stm32_seq.h"
#include "dbg_trace.h"
@@ -110,6 +110,7 @@ int main(void)
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
+
/* MCU Configuration--------------------------------------------------------*/
@@ -137,6 +138,8 @@ int main(void)
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
+
+ /* Init code for STM32_WPAN */
APPE_Init();
/* Infinite loop */
@@ -161,17 +164,20 @@ void SystemClock_Config(void)
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
+ /** Configure LSE Drive Capability
+ */
+ __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
/** Configure the main internal regulator output voltage
*/
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
/** Initializes the CPU, AHB and APB busses clocks
*/
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSI1
- |RCC_OSCILLATORTYPE_HSE;
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE
+ |RCC_OSCILLATORTYPE_LSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ RCC_OscInitStruct.LSEState = RCC_LSE_ON;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
- RCC_OscInitStruct.LSIState = RCC_LSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
@@ -200,8 +206,8 @@ void SystemClock_Config(void)
|RCC_PERIPHCLK_LPUART1;
PeriphClkInitStruct.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2;
PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1;
- PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI;
- PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSI;
+ PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
+ PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSE;
PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSE;
PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE0;
@@ -357,7 +363,13 @@ static void MX_RTC_Init(void)
Error_Handler();
}
/* USER CODE BEGIN RTC_Init 2 */
- MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* Disable RTC registers write protection */
+ LL_RTC_DisableWriteProtection(RTC);
+
+ LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER);
+
+ /* Enable RTC registers write protection */
+ LL_RTC_EnableWriteProtection(RTC);
/* USER CODE END RTC_Init 2 */
}
@@ -367,6 +379,7 @@ static void MX_RTC_Init(void)
*/
static void MX_DMA_Init(void)
{
+
/* DMA controller clock enable */
__HAL_RCC_DMAMUX1_CLK_ENABLE();
__HAL_RCC_DMA2_CLK_ENABLE();
@@ -404,7 +417,13 @@ void PeriphClock_Config(void)
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
- LL_RCC_HSI48_Enable();
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
+ LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -437,30 +456,6 @@ void PeriphClock_Config(void)
HAL_RCCEx_CRSConfig(&RCC_CRSInitStruct);
#endif
- /**
- * Select LSE clock
- */
- LL_RCC_LSE_Enable();
- while(!LL_RCC_LSE_IsReady());
-
- /**
- * Select wakeup source of BLE RF
- */
- LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
-
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
/*************************************************************
@@ -567,21 +562,33 @@ static void Init_Exti( void )
* WRAP FUNCTIONS
*
*************************************************************/
-
-/**
- * This function is empty to avoid starting the SysTick Timer
- */
-HAL_StatusTypeDef HAL_InitTick( uint32_t TickPriority )
+void HAL_Delay(uint32_t Delay)
{
- return (HAL_OK);
-}
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
-/**
- * This function is empty as the SysTick Timer is not used
- */
-void HAL_Delay(__IO uint32_t Delay)
-{
- return;
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
}
/* USER CODE END 4 */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/stm32wbxx_hal_msp.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/stm32wbxx_hal_msp.c
index c6a106fa7..87614ca60 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/stm32wbxx_hal_msp.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/stm32wbxx_hal_msp.c
@@ -5,45 +5,15 @@
* Description : This file provides code for the MSP Initialization
* and de-Initialization codes.
******************************************************************************
- * This notice applies to any and all portions of this file
- * that are not between comment pairs USER CODE BEGIN and
- * USER CODE END. Other portions of this file, whether
- * inserted by the user or by software development tools
- * are owned by their respective copyright owners.
+ * @attention
*
- * Copyright (c) 2019 STMicroelectronics International N.V.
- * All rights reserved.
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted, provided that the following conditions are met:
- *
- * 1. Redistribution of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of other
- * contributors to this software may be used to endorse or promote products
- * derived from this software without specific written permission.
- * 4. This software, including modifications and/or derivative works of this
- * software, must execute solely and exclusively on microcontroller or
- * microprocessor devices manufactured by or for STMicroelectronics.
- * 5. Redistribution and use of this software other than as permitted under
- * this license is void and will automatically terminate your rights under
- * this license.
- *
- * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
- * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
- * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
*
******************************************************************************
*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/stm32wbxx_it.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/stm32wbxx_it.c
index a7303c94a..f06353d51 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/stm32wbxx_it.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/Core/Src/stm32wbxx_it.c
@@ -60,21 +60,10 @@
/* USER CODE END 0 */
/* External variables --------------------------------------------------------*/
-
-
-
extern DMA_HandleTypeDef hdma_lpuart1_tx;
-
-
extern DMA_HandleTypeDef hdma_usart1_tx;
-
-
extern UART_HandleTypeDef hlpuart1;
-
-
extern UART_HandleTypeDef huart1;
-
-
/* USER CODE BEGIN EV */
/* USER CODE END EV */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/STM32_WPAN/App/app_ble.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/STM32_WPAN/App/app_ble.c
index e38041f66..d030bbd9d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/STM32_WPAN/App/app_ble.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/STM32_WPAN/App/app_ble.c
@@ -394,12 +394,10 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
if (gap_evt_proc_complete->Procedure_Code == GAP_GENERAL_DISCOVERY_PROC
&& gap_evt_proc_complete->Status == 0x00)
{
- /* USER CODE BEGIN GAP_GENERAL_DISCOVERY_PROC */
- BSP_LED_Off(LED_BLUE);
- /* USER CODE END GAP_GENERAL_DISCOVERY_PROC */
-#if(CFG_DEBUG_APP_TRACE != 0)
+ /* USER CODE BEGIN GAP_GENERAL_DISCOVERY_PROC */
+ BSP_LED_Off(LED_BLUE);
+ /* USER CODE END GAP_GENERAL_DISCOVERY_PROC */
APP_DBG_MSG("-- GAP GENERAL DISCOVERY PROCEDURE_COMPLETED\n");
-#endif
/*if a device found, connect to it, device 1 being chosen first if both found*/
if (BleApplicationContext.DeviceServerFound == 0x01 && BleApplicationContext.Device_Connection_Status != APP_BLE_CONNECTED_CLIENT)
{
@@ -471,9 +469,7 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
{
BleApplicationContext.BleApplicationContext_legacy.connectionHandle = 0;
BleApplicationContext.Device_Connection_Status = APP_BLE_IDLE;
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("\r\n\r** DISCONNECTION EVENT WITH SERVER \n");
-#endif
handleNotification.P2P_Evt_Opcode = PEER_DISCON_HANDLE_EVT;
handleNotification.ConnectionHandle = BleApplicationContext.BleApplicationContext_legacy.connectionHandle;
P2PC_APP_Notification(&handleNotification);
@@ -505,9 +501,7 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
BleApplicationContext.Device_Connection_Status = APP_BLE_CONNECTED_CLIENT;
/* CONNECTION WITH CLIENT */
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("\r\n\r** CONNECTION EVENT WITH SERVER \n");
-#endif
handleNotification.P2P_Evt_Opcode = PEER_CONN_HANDLE_EVT;
handleNotification.ConnectionHandle = BleApplicationContext.BleApplicationContext_legacy.connectionHandle;
P2PC_APP_Notification(&handleNotification);
@@ -515,16 +509,12 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
result = aci_gatt_disc_all_primary_services(BleApplicationContext.BleApplicationContext_legacy.connectionHandle);
if (result == BLE_STATUS_SUCCESS)
{
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("\r\n\r** GATT SERVICES & CHARACTERISTICS DISCOVERY \n");
APP_DBG_MSG("* GATT : Start Searching Primary Services \r\n\r");
-#endif
}
else
{
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("BLE_CTRL_App_Notification(), All services discovery Failed \r\n\r");
-#endif
}
break; /* HCI_EVT_LE_CONN_COMPLETE */
@@ -541,6 +531,11 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
event_data_size = le_advertising_event->Advertising_Report[0].Length_Data;
+ /* WARNING: be careful when decoding advertising report as its raw format cannot be mapped on a C structure.
+ The data and RSSI values could not be directly decoded from the RAM using the data and RSSI field from hci_le_advertising_report_event_rp0 structure.
+ Instead they must be read by using offsets (please refer to BLE specification).
+ RSSI = *(uint8_t*) (adv_report_data + le_advertising_event->Advertising_Report[0].Length_Data);
+ */
adv_report_data = (uint8_t*)(&le_advertising_event->Advertising_Report[0].Length_Data) + 1;
k = 0;
@@ -549,13 +544,12 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
if (event_type == ADV_IND)
{
- /*ISOLATION OF BD ADDRESS AND LOCAL NAME*/
+ /* ISOLATION OF BD ADDRESS AND LOCAL NAME */
-
while(k < event_data_size)
{
- adlength = adv_report_data[k];
- adtype = adv_report_data[k + 1];
+ adlength = adv_report_data[k];
+ adtype = adv_report_data[k + 1];
switch (adtype)
{
case AD_TYPE_FLAGS: /* now get flags */
@@ -569,21 +563,17 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
/* USER CODE END AD_TYPE_TX_POWER_LEVEL */
break;
- case AD_TYPE_MANUFACTURER_SPECIFIC_DATA: /* Manufactureur Specific */
+ case AD_TYPE_MANUFACTURER_SPECIFIC_DATA: /* Manufacturer Specific */
/* USER CODE BEGIN AD_TYPE_MANUFACTURER_SPECIFIC_DATA */
/* USER CODE END AD_TYPE_MANUFACTURER_SPECIFIC_DATA */
if (adlength >= 7 && adv_report_data[k + 2] == 0x01)
{ /* ST VERSION ID 01 */
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("--- ST MANUFACTURER ID --- \n");
-#endif
switch (adv_report_data[k + 3])
{ /* Demo ID */
- case CFG_DEV_ID_P2P_SERVER1: /* (0End Device 1) */
-#if(CFG_DEBUG_APP_TRACE != 0)
+ case CFG_DEV_ID_P2P_SERVER1: /* (0End Device 1) */
APP_DBG_MSG("-- SERVER DETECTED -- VIA MAN ID\n");
-#endif
BleApplicationContext.DeviceServerFound = 0x01;
SERVER_REMOTE_BDADDR[0] = le_advertising_event->Advertising_Report[0].Address[0];
SERVER_REMOTE_BDADDR[1] = le_advertising_event->Advertising_Report[0].Address[1];
@@ -801,7 +791,7 @@ static void Ble_Tl_Init( void )
aci_gap_set_authentication_requirement(BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.bonding_mode,
BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.mitm_mode,
- 0,
+ 1,
0,
BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMin,
BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMax,
@@ -837,18 +827,14 @@ static void Scan_Request( void )
/* USER CODE BEGIN BLE_SCAN_SUCCESS */
/* USER CODE END BLE_SCAN_SUCCESS */
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG(" \r\n\r** START GENERAL DISCOVERY (SCAN) ** \r\n\r");
-#endif
}
else
{
/* USER CODE BEGIN BLE_SCAN_FAILED */
- BSP_LED_On(LED_RED);
+ BSP_LED_On(LED_RED);
/* USER CODE END BLE_SCAN_FAILED */
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("-- BLE_App_Start_Limited_Disc_Req, Failed \r\n\r");
-#endif
}
}
/* USER CODE BEGIN Scan_Request_2 */
@@ -863,9 +849,8 @@ static void Connect_Request( void )
/* USER CODE END Connect_Request_1 */
tBleStatus result;
-#if(CFG_DEBUG_APP_TRACE != 0)
+
APP_DBG_MSG("\r\n\r** CREATE CONNECTION TO SERVER ** \r\n\r");
-#endif
if (BleApplicationContext.Device_Connection_Status != APP_BLE_CONNECTED_CLIENT)
{
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/STM32_WPAN/App/ble_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/STM32_WPAN/App/ble_conf.h
index dde5ede6f..82d851668 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/STM32_WPAN/App/ble_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/STM32_WPAN/App/ble_conf.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : App/ble_conf.h
- * Description : Configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : Configuration file for BLE Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
@@ -49,7 +49,7 @@
* This shall take into account all registered handlers
* (from either the provided services or the custom services)
*/
-#define BLE_CFG_SVC_MAX_NBR_CB 5
+#define BLE_CFG_SVC_MAX_NBR_CB 7
#define BLE_CFG_CLT_MAX_NBR_CB 1
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/STM32_WPAN/App/ble_dbg_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/STM32_WPAN/App/ble_dbg_conf.h
index 9b0dec37b..1f9b21135 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/STM32_WPAN/App/ble_dbg_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/STM32_WPAN/App/ble_dbg_conf.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : App/ble_dbg_conf.h
- * Description : Debug configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : Debug configuration file for BLE Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/STM32_WPAN/App/p2p_client_app.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/STM32_WPAN/App/p2p_client_app.c
index 391fe3e1d..2e2db17cc 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/STM32_WPAN/App/p2p_client_app.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pClient/STM32_WPAN/App/p2p_client_app.c
@@ -339,7 +339,7 @@ static SVCCTL_EvtAckStatus_t Event_Handler(void *Event)
* 2bytes start handle
* 2bytes end handle
* 2 or 16 bytes data
- * we are intersted only if the UUID is 16 bit.
+ * we are interested only if the UUID is 16 bit.
* So check if the data length is 6
*/
#if (UUID_128BIT_FORMAT==1)
@@ -540,7 +540,6 @@ static SVCCTL_EvtAckStatus_t Event_Handler(void *Event)
APP_DBG_MSG("\n");
#endif
-
uint8_t index;
index = 0;
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/BLE_p2pRouteur.ioc b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/BLE_p2pRouteur.ioc
index 2d39bc153..74ca179df 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/BLE_p2pRouteur.ioc
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/BLE_p2pRouteur.ioc
@@ -73,27 +73,29 @@ Mcu.IP9=SYS
Mcu.IPNb=12
Mcu.Name=STM32WB55RGVx
Mcu.Package=VFQFPN68
-Mcu.Pin0=PA2
-Mcu.Pin1=PA3
-Mcu.Pin10=VP_RTC_VS_RTC_Activate
-Mcu.Pin11=VP_SEQUENCER_VS_SEQUENCER
-Mcu.Pin12=VP_STM32_WPAN_VS_BLE_HOST
-Mcu.Pin13=VP_SYS_VS_Systick
-Mcu.Pin14=VP_TINY_LPM_VS_TINY_LPM
-Mcu.Pin2=PA6
-Mcu.Pin3=RF1
-Mcu.Pin4=OSC_OUT
-Mcu.Pin5=OSC_IN
-Mcu.Pin6=PA11
-Mcu.Pin7=PB6
-Mcu.Pin8=PB7
-Mcu.Pin9=VP_HSEM_VS_HSEM
-Mcu.PinsNb=15
+Mcu.Pin0=PC14-OSC32_IN
+Mcu.Pin1=PC15-OSC32_OUT
+Mcu.Pin10=PB7
+Mcu.Pin11=VP_HSEM_VS_HSEM
+Mcu.Pin12=VP_RTC_VS_RTC_Activate
+Mcu.Pin13=VP_SEQUENCER_VS_SEQUENCER
+Mcu.Pin14=VP_STM32_WPAN_VS_BLE_HOST
+Mcu.Pin15=VP_SYS_VS_Systick
+Mcu.Pin16=VP_TINY_LPM_VS_TINY_LPM
+Mcu.Pin2=PA2
+Mcu.Pin3=PA3
+Mcu.Pin4=PA6
+Mcu.Pin5=RF1
+Mcu.Pin6=OSC_OUT
+Mcu.Pin7=OSC_IN
+Mcu.Pin8=PA11
+Mcu.Pin9=PB6
+Mcu.PinsNb=17
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32WB55RGVx
-MxCube.Version=5.3.0
-MxDb.Version=DB.5.0.30
+MxCube.Version=5.4.0
+MxDb.Version=DB.5.0.40
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false
NVIC.DMA1_Channel4_IRQn=true\:15\:0\:true\:false\:true\:false\:true
NVIC.DMA2_Channel4_IRQn=true\:15\:0\:true\:false\:true\:false\:true
@@ -146,6 +148,10 @@ PB7.GPIO_Speed=GPIO_SPEED_FREQ_VERY_HIGH
PB7.Locked=true
PB7.Mode=Asynchronous
PB7.Signal=USART1_RX
+PC14-OSC32_IN.Mode=LSE-External-Oscillator
+PC14-OSC32_IN.Signal=RCC_OSC32_IN
+PC15-OSC32_OUT.Mode=LSE-External-Oscillator
+PC15-OSC32_OUT.Signal=RCC_OSC32_OUT
PCC.Ble.ConnectionInterval=1000.0
PCC.Ble.DataLength=6
PCC.Ble.Mode=Advertising
@@ -168,7 +174,7 @@ ProjectManager.DeletePrevious=true
ProjectManager.DeviceId=STM32WB55RGVx
ProjectManager.FreePins=false
ProjectManager.HalAssertFull=false
-ProjectManager.HeapSize=0x200
+ProjectManager.HeapSize=0x400
ProjectManager.KeepUserCode=true
ProjectManager.LastFirmware=true
ProjectManager.LibraryCopy=2
@@ -178,11 +184,11 @@ ProjectManager.PreviousToolchain=
ProjectManager.ProjectBuild=false
ProjectManager.ProjectFileName=BLE_p2pRouteur.ioc
ProjectManager.ProjectName=BLE_p2pRouteur
-ProjectManager.StackSize=0x400
+ProjectManager.StackSize=0x1000
ProjectManager.TargetToolchain=EWARM V8
ProjectManager.ToolChainLocation=
ProjectManager.UnderRoot=false
-ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-SystemClock_Config-RCC-false-HAL-false,4-MX_LPUART1_UART_Init-LPUART1-true-HAL-false,5-MX_USART1_UART_Init-USART1-true-HAL-false,6-MX_RF_Init-RF-false-HAL-true,7-MX_RTC_Init-RTC-false-HAL-true,8-MX_STM32_WPAN_Init-STM32_WPAN-false-HAL-true
+ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-SystemClock_Config-RCC-false-HAL-false,4-MX_LPUART1_UART_Init-LPUART1-true-HAL-false,5-MX_USART1_UART_Init-USART1-true-HAL-false,6-MX_RF_Init-RF-false-HAL-true,7-MX_RTC_Init-RTC-false-HAL-true,8-APPE_Init-STM32_WPAN-false-HAL-false
RCC.ADCFreq_Value=64000000
RCC.AHBFreq_Value=32000000
RCC.APB1Freq_Value=32000000
@@ -204,12 +210,12 @@ RCC.HSI48_VALUE=48000000
RCC.HSI_VALUE=16000000
RCC.I2C1Freq_Value=32000000
RCC.I2C3Freq_Value=32000000
-RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSE_VALUE,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PLLSourceVirtual,PWRFreq_Value,RNGFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LCDFreq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PLLSourceVirtual,PWRFreq_Value,RFWKPClockSelection,RFWKPFreq_Value,RNGFreq_Value,RTCClockSelection,RTCFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.LCDFreq_Value=32768
RCC.LPTIM1Freq_Value=32000000
RCC.LPTIM2Freq_Value=32000000
RCC.LPUART1Freq_Value=32000000
RCC.LSCOPinFreq_Value=32000
-RCC.LSE_VALUE=32768
RCC.LSI_VALUE=32000
RCC.MCO1PinFreq_Value=32000000
RCC.PLLPoutputFreq_Value=64000000
@@ -220,7 +226,11 @@ RCC.PLLSAI1QoutputFreq_Value=64000000
RCC.PLLSAI1RoutputFreq_Value=64000000
RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSI
RCC.PWRFreq_Value=32000000
+RCC.RFWKPClockSelection=RCC_RFWKPCLKSOURCE_LSE
+RCC.RFWKPFreq_Value=32768
RCC.RNGFreq_Value=32000
+RCC.RTCClockSelection=RCC_RTCCLKSOURCE_LSE
+RCC.RTCFreq_Value=32768
RCC.SAI1Freq_Value=64000000
RCC.SMPS1Freq_Value=16000000
RCC.SYSCLKFreq_VALUE=32000000
@@ -232,17 +242,14 @@ RCC.VCOOutputFreq_Value=128000000
RCC.VCOSAI1OutputFreq_Value=128000000
RF1.Mode=RF1_Activate
RF1.Signal=RF_RF1
-RTC.AsynchPrediv=CFG_RTC_ASYNCH_PRESCALER
-RTC.HourFormat=RTC_HOURFORMAT_24
-RTC.IPParameters=HourFormat,AsynchPrediv,SynchPrediv
-RTC.IPParametersWithoutCheck=AsynchPrediv,SynchPrediv
-RTC.SynchPrediv=CFG_RTC_SYNCH_PRESCALER
STM32_WPAN.BLE_APPLICATION_TYPE=BLE_ROUTER_PROFILE
STM32_WPAN.BLE_CFG_CLT_MAX_NBR_CB=6
STM32_WPAN.CFG_ADV_BD_ADDRESS=0xAA22334455AA
STM32_WPAN.CFG_DEBUGGER_SUPPORTED=1
-STM32_WPAN.CFG_DEBUG_APP_TRACE=0
-STM32_WPAN.CFG_DEBUG_BLE_TRACE=0
+STM32_WPAN.CFG_DEBUG_APP_TRACE=1
+STM32_WPAN.CFG_DEBUG_BLE_TRACE=1
+STM32_WPAN.CFG_DEBUG_TRACE_LIGHT=1
+STM32_WPAN.CFG_DEBUG_TRACE_UART=hw_uart1
STM32_WPAN.CFG_FAST_CONN_ADV_INTERVAL_MAX_HEXA=0x0
STM32_WPAN.CFG_FAST_CONN_ADV_INTERVAL_MIN_HEXA=0x0
STM32_WPAN.CFG_HW_LPUART1_DMA_TX_SUPPORTED=0
@@ -262,7 +269,7 @@ STM32_WPAN.CFG_MITM_PROTECTION=CFG_MITM_PROTECTION_REQUIRED
STM32_WPAN.CFG_RTCCLK_DIVIDER_CONF=0
STM32_WPAN.CUSTOM_P2P_ROUTER=Enabled
STM32_WPAN.DBG_TRACE_UART_CFG=hw_uart1
-STM32_WPAN.IPParameters=P2P_SERVER_NUMBER,CFG_FAST_CONN_ADV_INTERVAL_MAX_HEXA,CFG_LP_CONN_ADV_INTERVAL_MAX_HEXA,LOCAL_NAME_FORMATTED,CFG_HW_LPUART1_ENABLED,CFG_DEBUG_BLE_TRACE,CFG_DEBUG_APP_TRACE,DBG_TRACE_UART_CFG,CFG_ADV_BD_ADDRESS,CFG_LP_CONN_ADV_INTERVAL_MAX,CFG_LP_CONN_ADV_INTERVAL_MIN,CFG_HW_LPUART1_DMA_TX_SUPPORTED,LOCAL_NAME,CFG_HW_USART1_ENABLED,CFG_LPM_SUPPORTED,L2CAP_REQUEST_NEW_CONN_PARAM,BLE_APPLICATION_TYPE,CFG_FAST_CONN_ADV_INTERVAL_MIN_HEXA,CUSTOM_P2P_ROUTER,BLE_CFG_CLT_MAX_NBR_CB,CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO,CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION,CFG_HW_RESET_BY_FW,CFG_DEBUGGER_SUPPORTED,CFG_IO_CAPABILITY,CFG_MITM_PROTECTION,CFG_RTCCLK_DIVIDER_CONF
+STM32_WPAN.IPParameters=P2P_SERVER_NUMBER,CFG_FAST_CONN_ADV_INTERVAL_MAX_HEXA,CFG_LP_CONN_ADV_INTERVAL_MAX_HEXA,LOCAL_NAME_FORMATTED,CFG_HW_LPUART1_ENABLED,CFG_DEBUG_BLE_TRACE,CFG_DEBUG_APP_TRACE,DBG_TRACE_UART_CFG,CFG_ADV_BD_ADDRESS,CFG_LP_CONN_ADV_INTERVAL_MAX,CFG_LP_CONN_ADV_INTERVAL_MIN,CFG_HW_LPUART1_DMA_TX_SUPPORTED,LOCAL_NAME,CFG_HW_USART1_ENABLED,CFG_LPM_SUPPORTED,L2CAP_REQUEST_NEW_CONN_PARAM,BLE_APPLICATION_TYPE,CFG_FAST_CONN_ADV_INTERVAL_MIN_HEXA,CUSTOM_P2P_ROUTER,BLE_CFG_CLT_MAX_NBR_CB,CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO,CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION,CFG_HW_RESET_BY_FW,CFG_DEBUGGER_SUPPORTED,CFG_IO_CAPABILITY,CFG_MITM_PROTECTION,CFG_RTCCLK_DIVIDER_CONF,CFG_DEBUG_TRACE_UART,CFG_DEBUG_TRACE_LIGHT
STM32_WPAN.IPParametersWithoutCheck=CFG_LP_CONN_ADV_INTERVAL_MAX,CFG_LP_CONN_ADV_INTERVAL_MIN
STM32_WPAN.L2CAP_REQUEST_NEW_CONN_PARAM=1
STM32_WPAN.LOCAL_NAME=P2PROUT
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Inc/app_common.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Inc/app_common.h
index 2a1d61089..4defc5d7a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Inc/app_common.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Inc/app_common.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : app_common.h
- * Description : App Common application configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : App Common application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Inc/app_conf.h
index bf1970ec1..12ca2e31b 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Inc/app_conf.h
@@ -1,8 +1,9 @@
/**
******************************************************************************
* File Name : app_conf.h
- * Description : Application configuration file for BLE middleWare.
- ******************************************************************************
+ * Description : Application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
@@ -17,17 +18,18 @@
*/
/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef APP_CONFIG_H
-#define APP_CONFIG_H
+#ifndef APP_CONF_H
+#define APP_CONF_H
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Application Config
******************************************************************************/
-/**< generic parameters ********************************************************/
+/**< generic parameters ******************************************************/
/**
* Define Tx Power
@@ -38,8 +40,8 @@
* Define Advertising parameters
*/
#define CFG_ADV_BD_ADDRESS (0xAA22334455AA)
-#define LEDBUTTON_CONN_ADV_INTERVAL_MIN (0x1FA)
-#define LEDBUTTON_CONN_ADV_INTERVAL_MAX (0x3E8)
+#define LEDBUTTON_CONN_ADV_INTERVAL_MIN (0x1FA)
+#define LEDBUTTON_CONN_ADV_INTERVAL_MAX (0x3E8)
/**
* Define IO Authentication
@@ -79,11 +81,17 @@
*/
#define CFG_BLE_ERK {0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21,0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21}
+/* USER CODE BEGIN Generic_Parameters */
+/**
+ * SMPS supply
+ * SMPS not used when Set to 0
+ * SMPS used when Set to 1
+ */
+#define CFG_USE_SMPS 1
+/* USER CODE END Generic_Parameters */
+
/**< specific parameters */
/*****************************************************/
-#define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI4_IRQHandler
-
-#define BLE_CLI_LED_BUTTON 1 /**< LED BUTTON CLIENT */
#define CFG_MAX_CONNECTION 8
#define UUID_128BIT_FORMAT 1
@@ -187,7 +195,7 @@
* 1 : internal RO
* 0 : external crystal ( no calibration )
*/
-#define CFG_BLE_LSE_SOURCE 1
+#define CFG_BLE_LSE_SOURCE 0
/**
* Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
@@ -394,11 +402,6 @@ typedef enum
#define CFG_DEBUGGER_SUPPORTED 1
#endif
-/* USER CODE BEGIN Defines */
-#define CFG_LED_SUPPORTED 1
-#define CFG_BUTTON_SUPPORTED 1
-/* USER CODE END Defines */
-
/**
* When CFG_DEBUG_TRACE_FULL is set to 1, the trace are output with the API name, the file name and the line number
* When CFG_DEBUG_TRACE_LIGHT is set to 1, only the debug message is output
@@ -435,6 +438,14 @@ typedef enum
#define DBG_TRACE_MSG_QUEUE_SIZE 4096
#define MAX_DBG_TRACE_MSG_SIZE 1024
+/* USER CODE BEGIN Defines */
+#define CFG_LED_SUPPORTED 1
+#define CFG_BUTTON_SUPPORTED 1
+
+#define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI4_IRQHandler
+#define BLE_CLI_LED_BUTTON 1 /**< LED BUTTON CLIENT */
+/* USER CODE END Defines */
+
/******************************************************************************
* Scheduler
******************************************************************************/
@@ -506,7 +517,10 @@ typedef enum
typedef enum
{
CFG_LPM_APP,
- CFG_LPM_APP_BLE
+ CFG_LPM_APP_BLE,
+ /* USER CODE BEGIN CFG_LPM_Id_t */
+
+ /* USER CODE END CFG_LPM_Id_t */
} CFG_LPM_Id_t;
/******************************************************************************
@@ -516,6 +530,6 @@ typedef enum
#define CFG_OTP_END_ADRESS OTP_AREA_END_ADDR
-#endif /*APP_CONFIG_H */
+#endif /*APP_CONF_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Inc/stm32_lpm_if.h
index 38e326512..d8e67947f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Inc/stm32_lpm_if.h
@@ -1,46 +1,22 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file stm32_lpm_if.h
-* @brief Header for stm32_lpm_f.c module (device specific LP management)
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
******************************************************************************
* @attention
*
-* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics International N.V.
+* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted, provided that the following conditions are met:
-*
-* 1. Redistribution of source code must retain the above copyright notice,
-* this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following disclaimer in the documentation
-* and/or other materials provided with the distribution.
-* 3. Neither the name of STMicroelectronics nor the names of other
-* contributors to this software may be used to endorse or promote products
-* derived from this software without specific written permission.
-* 4. This software, including modifications and/or derivative works of this
-* software, must execute solely and exclusively on microcontroller or
-* microprocessor devices manufactured by or for STMicroelectronics.
-* 5. Redistribution and use of this software other than as permitted under
-* this license is void and will automatically terminate your rights under
-* this license.
-*
-* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
-* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
-* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+* This software component is licensed by ST under BSD 3-Clause license,
+* the "License"; You may not use this file except in compliance with the
+* License. You may obtain a copy of the License at:
+* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32_LPM_IF_H
@@ -89,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Inc/stm32wbxx_hal_conf.h
index 5c703f75d..31d63e37a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Inc/stm32wbxx_hal_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Inc/stm32wbxx_hal_conf.h
@@ -58,6 +58,7 @@
#define HAL_UART_MODULE_ENABLED
/*#define HAL_USART_MODULE_ENABLED */
/*#define HAL_WWDG_MODULE_ENABLED */
+#define HAL_EXTI_MODULE_ENABLED
#define HAL_CORTEX_MODULE_ENABLED
#define HAL_DMA_MODULE_ENABLED
#define HAL_FLASH_MODULE_ENABLED
@@ -221,6 +222,10 @@
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32wbxx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32wbxx_hal_flash.h"
@@ -333,9 +338,9 @@
* If expr is true, it returns no value.
* @retval None
*/
-#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
+ #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
/* Exported functions ------------------------------------------------------- */
-void assert_failed(uint8_t* file, uint32_t line);
+ void assert_failed(uint8_t* file, uint32_t line);
#else
#define assert_param(expr) ((void)0U)
#endif /* USE_FULL_ASSERT */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Inc/utilities_conf.h
index c98d97ba1..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Inc/utilities_conf.h
@@ -1,3 +1,4 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* File Name : utilities_conf.h
@@ -9,13 +10,14 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef UTILITIES_CONF_H
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/app_entry.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/app_entry.c
index d1bdfdfbb..97a6a8b82 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/app_entry.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/app_entry.c
@@ -69,8 +69,8 @@ static void SystemPower_Config( void );
static void Init_Debug( void );
static void appe_Tl_Init( void );
static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status );
-
static void APPE_SysUserEvtRx( void * pPayload );
+
#if (CFG_HW_LPUART1_ENABLED == 1)
extern void MX_LPUART1_UART_Init(void);
#endif
@@ -107,7 +107,7 @@ void APPE_Init( void )
/**
* From now, the application is waiting for the ready event ( VS_HCI_C2_Ready )
- * received on the system channel before starting the BLE Stack
+ * received on the system channel before starting the Stack
* This system event is received with APPE_SysUserEvtRx()
*/
/* USER CODE BEGIN APPE_Init_2 */
@@ -220,8 +220,6 @@ static void appe_Tl_Init( void )
return;
}
-
-
static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status )
{
UNUSED(status);
@@ -235,7 +233,7 @@ static void APPE_SysUserEvtRx( void * pPayload )
TL_TRACES_Init( );
APP_BLE_Init( );
- UTIL_LPM_SetOffMode(1 << CFG_LPM_APP, UTIL_LPM_ENABLE);
+ UTIL_LPM_SetOffMode(1U << CFG_LPM_APP, UTIL_LPM_ENABLE);
return;
}
@@ -285,7 +283,6 @@ void UTIL_SEQ_Idle( void )
return;
}
-
/**
* @brief This function is called by the scheduler each time an event
* is pending.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/hw_timerserver.c
index 52a1bfa0d..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/hw_timerserver.c
@@ -1,22 +1,21 @@
/**
******************************************************************************
- * File Name : hw_timerserver.c
- * Description : Hardware timerserver source file for BLE
- * middleWare.
+ * File Name : hw_timerserver.c
+ * Description : Hardware timerserver source file for STM32WPAN Middleware.
+ *
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/hw_uart.c
index 52e9e2b3a..9a553610d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/hw_uart.c
@@ -1,7 +1,7 @@
/**
******************************************************************************
* File Name : Src/hw_uart.c
- * Description : HW UART source file for BLE middleWare.
+ * Description : HW UART source file for STM32WPAN Middleware.
*
******************************************************************************
* @attention
@@ -48,7 +48,7 @@ extern UART_HandleTypeDef huart1;
hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
} while(0)
- /* Variables ------------------------------------------------------------------*/
+/* Variables -----------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
@@ -65,73 +65,73 @@ extern UART_HandleTypeDef huart1;
void (*HW_hlpuart1TxCb)(void);
#endif
- void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_RX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_RX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_RX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_RX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ return;
+}
+
+void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
{
- HAL_StatusTypeDef hal_status = HAL_OK;
- hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
+ default:
+ break;
}
switch (hal_status)
@@ -161,8 +161,8 @@ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t
hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
{
-HAL_StatusTypeDef hal_status = HAL_OK;
-hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
@@ -250,33 +250,33 @@ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
switch ((uint32_t)huart->Instance)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1RxCb)
- {
- HW_huart1RxCb();
- }
- break;
+ if(HW_huart1RxCb)
+ {
+ HW_huart1RxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1RxCb)
- {
- HW_hlpuart1RxCb();
- }
- break;
+ if(HW_hlpuart1RxCb)
+ {
+ HW_hlpuart1RxCb();
+ }
+ break;
#endif
default:
@@ -292,20 +292,20 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1TxCb)
- {
- HW_huart1TxCb();
- }
- break;
+ if(HW_huart1TxCb)
+ {
+ HW_huart1TxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1TxCb)
- {
- HW_hlpuart1TxCb();
- }
- break;
+ if(HW_hlpuart1TxCb)
+ {
+ HW_hlpuart1TxCb();
+ }
+ break;
#endif
default:
@@ -315,4 +315,4 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
return;
}
- /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/main.c
index 89612d53b..72d282bcf 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/main.c
@@ -41,10 +41,10 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "app_entry.h"
+#include "app_common.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
-#include "app_common.h"
#include "stm32_lpm.h"
#include "stm32_seq.h"
#include "dbg_trace.h"
@@ -110,6 +110,7 @@ int main(void)
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
+
/* MCU Configuration--------------------------------------------------------*/
@@ -137,6 +138,8 @@ int main(void)
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
+
+ /* Init code for STM32_WPAN */
APPE_Init();
/* Infinite loop */
@@ -161,17 +164,20 @@ void SystemClock_Config(void)
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
+ /** Configure LSE Drive Capability
+ */
+ __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
/** Configure the main internal regulator output voltage
*/
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
/** Initializes the CPU, AHB and APB busses clocks
*/
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSI1
- |RCC_OSCILLATORTYPE_HSE;
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE
+ |RCC_OSCILLATORTYPE_LSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ RCC_OscInitStruct.LSEState = RCC_LSE_ON;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
- RCC_OscInitStruct.LSIState = RCC_LSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
@@ -200,8 +206,8 @@ void SystemClock_Config(void)
|RCC_PERIPHCLK_LPUART1;
PeriphClkInitStruct.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2;
PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1;
- PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI;
- PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSI;
+ PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
+ PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSE;
PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSE;
PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE0;
@@ -357,7 +363,13 @@ static void MX_RTC_Init(void)
Error_Handler();
}
/* USER CODE BEGIN RTC_Init 2 */
- MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* Disable RTC registers write protection */
+ LL_RTC_DisableWriteProtection(RTC);
+
+ LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER);
+
+ /* Enable RTC registers write protection */
+ LL_RTC_EnableWriteProtection(RTC);
/* USER CODE END RTC_Init 2 */
}
@@ -367,6 +379,7 @@ static void MX_RTC_Init(void)
*/
static void MX_DMA_Init(void)
{
+
/* DMA controller clock enable */
__HAL_RCC_DMAMUX1_CLK_ENABLE();
__HAL_RCC_DMA2_CLK_ENABLE();
@@ -404,7 +417,13 @@ void PeriphClock_Config(void)
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
- LL_RCC_HSI48_Enable();
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
+ LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -437,30 +456,6 @@ void PeriphClock_Config(void)
HAL_RCCEx_CRSConfig(&RCC_CRSInitStruct);
#endif
- /**
- * Select LSE clock
- */
- LL_RCC_LSE_Enable();
- while(!LL_RCC_LSE_IsReady());
-
- /**
- * Select wakeup source of BLE RF
- */
- LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
-
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
/*************************************************************
@@ -567,21 +562,33 @@ static void Init_Exti( void )
* WRAP FUNCTIONS
*
*************************************************************/
-
-/**
- * This function is empty to avoid starting the SysTick Timer
- */
-HAL_StatusTypeDef HAL_InitTick( uint32_t TickPriority )
+void HAL_Delay(uint32_t Delay)
{
- return (HAL_OK);
-}
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
-/**
- * This function is empty as the SysTick Timer is not used
- */
-void HAL_Delay(__IO uint32_t Delay)
-{
- return;
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
}
/* USER CODE END 4 */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/stm32wbxx_hal_msp.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/stm32wbxx_hal_msp.c
index c6a106fa7..87614ca60 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/stm32wbxx_hal_msp.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/stm32wbxx_hal_msp.c
@@ -5,45 +5,15 @@
* Description : This file provides code for the MSP Initialization
* and de-Initialization codes.
******************************************************************************
- * This notice applies to any and all portions of this file
- * that are not between comment pairs USER CODE BEGIN and
- * USER CODE END. Other portions of this file, whether
- * inserted by the user or by software development tools
- * are owned by their respective copyright owners.
+ * @attention
*
- * Copyright (c) 2019 STMicroelectronics International N.V.
- * All rights reserved.
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted, provided that the following conditions are met:
- *
- * 1. Redistribution of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of other
- * contributors to this software may be used to endorse or promote products
- * derived from this software without specific written permission.
- * 4. This software, including modifications and/or derivative works of this
- * software, must execute solely and exclusively on microcontroller or
- * microprocessor devices manufactured by or for STMicroelectronics.
- * 5. Redistribution and use of this software other than as permitted under
- * this license is void and will automatically terminate your rights under
- * this license.
- *
- * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
- * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
- * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
*
******************************************************************************
*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/stm32wbxx_it.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/stm32wbxx_it.c
index a7303c94a..f06353d51 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/stm32wbxx_it.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/Core/Src/stm32wbxx_it.c
@@ -60,21 +60,10 @@
/* USER CODE END 0 */
/* External variables --------------------------------------------------------*/
-
-
-
extern DMA_HandleTypeDef hdma_lpuart1_tx;
-
-
extern DMA_HandleTypeDef hdma_usart1_tx;
-
-
extern UART_HandleTypeDef hlpuart1;
-
-
extern UART_HandleTypeDef huart1;
-
-
/* USER CODE BEGIN EV */
/* USER CODE END EV */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/STM32_WPAN/App/app_ble.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/STM32_WPAN/App/app_ble.c
index 850596156..cdb60e38e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/STM32_WPAN/App/app_ble.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/STM32_WPAN/App/app_ble.c
@@ -553,13 +553,11 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification(void *pckt)
if (gap_evt_proc_complete->Procedure_Code == GAP_GENERAL_DISCOVERY_PROC
&& gap_evt_proc_complete->Status == 0x00)
{
- /* USER CODE BEGIN GAP_GENERAL_DISCOVERY_PROC */
- BSP_LED_Off(LED_BLUE);
- /* USER CODE END GAP_GENERAL_DISCOVERY_PROC */
+ /* USER CODE BEGIN GAP_GENERAL_DISCOVERY_PROC */
+ BSP_LED_Off(LED_BLUE);
+ /* USER CODE END GAP_GENERAL_DISCOVERY_PROC */
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("-- GAP GENERAL DISCOVERY PROCEDURE_COMPLETED\n");
-#endif
/*if a device found, connect to it, device 1 being chosen first if both found*/
if (BleApplicationContext.EndDevice1Found == 0x01
&& BleApplicationContext.EndDevice_Connection_Status[0] != APP_BLE_CONNECTED)
@@ -624,9 +622,7 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification(void *pckt)
CONN_L2,
APP_BLE_p2p_Conn_Update_req.Identifier,
0x00);
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("\r\n\r** NO UPDATE \n");
-#endif
if(result != BLE_STATUS_SUCCESS) {
/* USER CODE BEGIN BLE_STATUS_SUCCESS */
BSP_LED_On(LED_RED);
@@ -653,9 +649,7 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification(void *pckt)
/* USER CODE END EVT_DISCONN_COMPLETE */
if (cc->Connection_Handle == BleApplicationContext.connectionHandleEndDevice1)
{
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("\r\n\r** DISCONNECTION EVENT OF END DEVICE 1 \n");
-#endif
BleApplicationContext.EndDevice_Connection_Status[0] = APP_BLE_IDLE;
BleApplicationContext.connectionHandleEndDevice1 = 0xFFFF;
handleNotification.P2P_Evt_Opcode = P2P_SERVER1_DISCON_HANDLE_EVT;
@@ -777,9 +771,7 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification(void *pckt)
if (dev1 == 1)
{
/* Inform Application it is End Device 1 */
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("-- CONNECTION SUCCESS WITH END DEVICE 1\n");
-#endif
BleApplicationContext.EndDevice_Connection_Status[0] = APP_BLE_CONNECTED;
BleApplicationContext.connectionHandleEndDevice1 = connection_handle;
BleApplicationContext.BleApplicationContext_legacy.connectionHandle[0] = connection_handle;
@@ -789,16 +781,12 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification(void *pckt)
result = aci_gatt_disc_all_primary_services(BleApplicationContext.connectionHandleEndDevice1);
if (result == BLE_STATUS_SUCCESS)
{
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("\r\n\r** GATT SERVICES & CHARACTERISTICS DISCOVERY \n");
APP_DBG_MSG("* GATT : Start Searching Primary Services \r\n\r");
-#endif
}
else
{
-#if(CFG_DEBUG_APP_TRACE != 0)
- APP_DBG_MSG("BLE_CTRL_App_Notification(), All services discovery Failed \r\n\r");
-#endif
+ APP_DBG_MSG("BLE_CTRL_App_Notification(), All services discovery Failed \r\n\r");
}
#if (CFG_P2P_DEMO_MULTI != 0)
/* USER CODE BEGIN EVT_LE_CONN_COMPLETE_Multi_3 */
@@ -961,9 +949,7 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification(void *pckt)
else
{
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("-- CONNECTION SUCCESS WITH SMART PHONE\n");
-#endif
BleApplicationContext.connectionHandleCentral = connection_handle;
handleNotification.P2P_Evt_Opcode = SMART_PHONE1_CONN_HANDLE_EVT;
handleNotification.ConnectionHandle = connection_handle;
@@ -983,6 +969,11 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification(void *pckt)
event_data_size = le_advertising_event->Advertising_Report[0].Length_Data;
+ /* WARNING: be careful when decoding advertising report as its raw format cannot be mapped on a C structure.
+ The data and RSSI values could not be directly decoded from the RAM using the data and RSSI field from hci_le_advertising_report_event_rp0 structure.
+ Instead they must be read by using offsets (please refer to BLE specification).
+ RSSI = *(uint8_t*) (adv_report_data + le_advertising_event->Advertising_Report[0].Length_Data);
+ */
adv_report_data = (uint8_t*)(&le_advertising_event->Advertising_Report[0].Length_Data) + 1;
k = 0;
/* search AD TYPE 0x09 (Complete Local Name) */
@@ -1025,15 +1016,11 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification(void *pckt)
/* USER CODE END Manufactureur_Specific */
if (adlength >= 7 && adv_report_data[k + 2] == 0x01)
{ /* ST VERSION ID 01 */
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("--- ST MANUFACTURER ID --- \n");
-#endif
switch (adv_report_data[k + 3])
{
case CFG_DEV_ID_P2P_SERVER1:
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("-- P2P SERVER 1 DETECTED -- VIA MAN ID\n");
-#endif
BleApplicationContext.EndDevice1Found = 0x01;
P2P_SERVER1_BDADDR[0] = le_advertising_event->Advertising_Report[0].Address[0];
P2P_SERVER1_BDADDR[1] = le_advertising_event->Advertising_Report[0].Address[1];
@@ -1392,18 +1379,14 @@ static void Scan_Request( void )
/* USER CODE BEGIN BLE_SCAN_SUCCESS */
/* USER CODE END BLE_SCAN_SUCCESS */
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG(" \r\n\r** START GENERAL DISCOVERY (SCAN) ** \r\n\r");
-#endif
}
else
{
/* USER CODE BEGIN BLE_SCAN_FAILED */
BSP_LED_On(LED_RED);
/* USER CODE END BLE_SCAN_FAILED */
- #if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("-- BLE_App_Start_Limited_Disc_Req, Failed \r\n\r");
-#endif
}
}
/* USER CODE BEGIN Scan_Request_2 */
@@ -1446,19 +1429,15 @@ static void Adv_Request( void )
/* USER CODE BEGIN BLE_CONNECT_SUCCESS */
/* USER CODE END BLE_CONNECT_SUCCESS */
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG(" \r\n\r");
APP_DBG_MSG("** START ADVERTISING ** \r\n\r");
-#endif
}
else
{
/* USER CODE BEGIN BLE_CONNECT_FAILED */
BSP_LED_On(LED_RED);
/* USER CODE END BLE_CONNECT_FAILED */
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("BLE_APP_Adv_Request(), Failed \r\n\r");
-#endif
}
}
/* USER CODE BEGIN Connect_Request_2 */
@@ -1475,9 +1454,7 @@ static void Adv_Request( void )
static void ConnReq1( void )
{
tBleStatus result;
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("\r\n\r** CREATE CONNECTION TO END DEVICE 1 ** \r\n\r");
-#endif
if (BleApplicationContext.EndDevice_Connection_Status[0] != APP_BLE_CONNECTED)
{
/* USER CODE BEGIN APP_BLE_CONNECTED_SUCCESS_END_DEVICE_1 */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/STM32_WPAN/App/ble_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/STM32_WPAN/App/ble_conf.h
index 77aa32132..97a0dab10 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/STM32_WPAN/App/ble_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/STM32_WPAN/App/ble_conf.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : App/ble_conf.h
- * Description : Configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : Configuration file for BLE Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
@@ -49,7 +49,7 @@
* This shall take into account all registered handlers
* (from either the provided services or the custom services)
*/
-#define BLE_CFG_SVC_MAX_NBR_CB 5
+#define BLE_CFG_SVC_MAX_NBR_CB 7
#define BLE_CFG_CLT_MAX_NBR_CB 6
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/STM32_WPAN/App/ble_dbg_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/STM32_WPAN/App/ble_dbg_conf.h
index 9b0dec37b..1f9b21135 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/STM32_WPAN/App/ble_dbg_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/STM32_WPAN/App/ble_dbg_conf.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : App/ble_dbg_conf.h
- * Description : Debug configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : Debug configuration file for BLE Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/STM32_WPAN/App/p2p_routeur_app.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/STM32_WPAN/App/p2p_routeur_app.c
index 316264a36..6414e560a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/STM32_WPAN/App/p2p_routeur_app.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pRouteur/STM32_WPAN/App/p2p_routeur_app.c
@@ -612,8 +612,6 @@ static SVCCTL_EvtAckStatus_t Client_Event_Handler(void *Event)
return_value = SVCCTL_EvtNotAck;
event_pckt = (hci_event_pckt *)(((hci_uart_pckt*)Event)->data);
-
-
switch(event_pckt->evt)
{
case EVT_VENDOR:
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/BLE_p2pServer.ioc b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/BLE_p2pServer.ioc
index 9aee060ea..d2b0ef3f5 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/BLE_p2pServer.ioc
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/BLE_p2pServer.ioc
@@ -73,27 +73,29 @@ Mcu.IP9=SYS
Mcu.IPNb=12
Mcu.Name=STM32WB55RGVx
Mcu.Package=VFQFPN68
-Mcu.Pin0=PA2
-Mcu.Pin1=PA3
-Mcu.Pin10=VP_RTC_VS_RTC_Activate
-Mcu.Pin11=VP_SEQUENCER_VS_SEQUENCER
-Mcu.Pin12=VP_STM32_WPAN_VS_BLE_HOST
-Mcu.Pin13=VP_SYS_VS_Systick
-Mcu.Pin14=VP_TINY_LPM_VS_TINY_LPM
-Mcu.Pin2=PA6
-Mcu.Pin3=RF1
-Mcu.Pin4=OSC_OUT
-Mcu.Pin5=OSC_IN
-Mcu.Pin6=PA11
-Mcu.Pin7=PB6
-Mcu.Pin8=PB7
-Mcu.Pin9=VP_HSEM_VS_HSEM
-Mcu.PinsNb=15
+Mcu.Pin0=PC14-OSC32_IN
+Mcu.Pin1=PC15-OSC32_OUT
+Mcu.Pin10=PB7
+Mcu.Pin11=VP_HSEM_VS_HSEM
+Mcu.Pin12=VP_RTC_VS_RTC_Activate
+Mcu.Pin13=VP_SEQUENCER_VS_SEQUENCER
+Mcu.Pin14=VP_STM32_WPAN_VS_BLE_HOST
+Mcu.Pin15=VP_SYS_VS_Systick
+Mcu.Pin16=VP_TINY_LPM_VS_TINY_LPM
+Mcu.Pin2=PA2
+Mcu.Pin3=PA3
+Mcu.Pin4=PA6
+Mcu.Pin5=RF1
+Mcu.Pin6=OSC_OUT
+Mcu.Pin7=OSC_IN
+Mcu.Pin8=PA11
+Mcu.Pin9=PB6
+Mcu.PinsNb=17
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32WB55RGVx
-MxCube.Version=5.3.0
-MxDb.Version=DB.5.0.30
+MxCube.Version=5.4.0
+MxDb.Version=DB.5.0.40
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false
NVIC.DMA1_Channel4_IRQn=true\:15\:0\:true\:false\:true\:false\:true
NVIC.DMA2_Channel4_IRQn=true\:15\:0\:true\:false\:true\:false\:true
@@ -146,6 +148,10 @@ PB7.GPIO_Speed=GPIO_SPEED_FREQ_VERY_HIGH
PB7.Locked=true
PB7.Mode=Asynchronous
PB7.Signal=USART1_RX
+PC14-OSC32_IN.Mode=LSE-External-Oscillator
+PC14-OSC32_IN.Signal=RCC_OSC32_IN
+PC15-OSC32_OUT.Mode=LSE-External-Oscillator
+PC15-OSC32_OUT.Signal=RCC_OSC32_OUT
PCC.Ble.ConnectionInterval=1000.0
PCC.Ble.DataLength=6
PCC.Ble.Mode=Advertising
@@ -168,7 +174,7 @@ ProjectManager.DeletePrevious=true
ProjectManager.DeviceId=STM32WB55RGVx
ProjectManager.FreePins=false
ProjectManager.HalAssertFull=false
-ProjectManager.HeapSize=0x200
+ProjectManager.HeapSize=0x400
ProjectManager.KeepUserCode=true
ProjectManager.LastFirmware=true
ProjectManager.LibraryCopy=2
@@ -178,11 +184,11 @@ ProjectManager.PreviousToolchain=
ProjectManager.ProjectBuild=false
ProjectManager.ProjectFileName=BLE_p2pServer.ioc
ProjectManager.ProjectName=BLE_p2pServer
-ProjectManager.StackSize=0x400
+ProjectManager.StackSize=0x1000
ProjectManager.TargetToolchain=EWARM V8
ProjectManager.ToolChainLocation=
ProjectManager.UnderRoot=false
-ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-SystemClock_Config-RCC-false-HAL-false,4-MX_LPUART1_UART_Init-LPUART1-true-HAL-false,5-MX_USART1_UART_Init-USART1-true-HAL-false,6-MX_RF_Init-RF-false-HAL-true,7-MX_RTC_Init-RTC-false-HAL-true,8-MX_STM32_WPAN_Init-STM32_WPAN-false-HAL-true
+ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-SystemClock_Config-RCC-false-HAL-false,4-MX_LPUART1_UART_Init-LPUART1-true-HAL-false,5-MX_USART1_UART_Init-USART1-true-HAL-false,6-MX_RF_Init-RF-false-HAL-true,7-MX_RTC_Init-RTC-false-HAL-true,8-APPE_Init-STM32_WPAN-false-HAL-false
RCC.ADCFreq_Value=64000000
RCC.AHBFreq_Value=32000000
RCC.APB1Freq_Value=32000000
@@ -204,12 +210,12 @@ RCC.HSI48_VALUE=48000000
RCC.HSI_VALUE=16000000
RCC.I2C1Freq_Value=32000000
RCC.I2C3Freq_Value=32000000
-RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSE_VALUE,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PLLSourceVirtual,PWRFreq_Value,RNGFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LCDFreq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PLLSourceVirtual,PWRFreq_Value,RFWKPClockSelection,RFWKPFreq_Value,RNGFreq_Value,RTCClockSelection,RTCFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.LCDFreq_Value=32768
RCC.LPTIM1Freq_Value=32000000
RCC.LPTIM2Freq_Value=32000000
RCC.LPUART1Freq_Value=32000000
RCC.LSCOPinFreq_Value=32000
-RCC.LSE_VALUE=32768
RCC.LSI_VALUE=32000
RCC.MCO1PinFreq_Value=32000000
RCC.PLLPoutputFreq_Value=64000000
@@ -220,7 +226,11 @@ RCC.PLLSAI1QoutputFreq_Value=64000000
RCC.PLLSAI1RoutputFreq_Value=64000000
RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSI
RCC.PWRFreq_Value=32000000
+RCC.RFWKPClockSelection=RCC_RFWKPCLKSOURCE_LSE
+RCC.RFWKPFreq_Value=32768
RCC.RNGFreq_Value=32000
+RCC.RTCClockSelection=RCC_RTCCLKSOURCE_LSE
+RCC.RTCFreq_Value=32768
RCC.SAI1Freq_Value=64000000
RCC.SMPS1Freq_Value=16000000
RCC.SYSCLKFreq_VALUE=32000000
@@ -232,13 +242,9 @@ RCC.VCOOutputFreq_Value=128000000
RCC.VCOSAI1OutputFreq_Value=128000000
RF1.Mode=RF1_Activate
RF1.Signal=RF_RF1
-RTC.AsynchPrediv=CFG_RTC_ASYNCH_PRESCALER
-RTC.HourFormat=RTC_HOURFORMAT_24
-RTC.IPParameters=HourFormat,AsynchPrediv,SynchPrediv
-RTC.IPParametersWithoutCheck=AsynchPrediv,SynchPrediv
-RTC.SynchPrediv=CFG_RTC_SYNCH_PRESCALER
STM32_WPAN.BLE_APPLICATION_TYPE=BLE_SERVER_PROFILE
STM32_WPAN.BLE_CFG_SVC_MAX_NBR_CB=1
+STM32_WPAN.BLE_DBG_APP_EN=0
STM32_WPAN.BLE_DBG_P2P_STM_EN=1
STM32_WPAN.BT_SIG_BEACON=Disabled
STM32_WPAN.BT_SIG_BLOOD_PRESSURE_SENSOR=Disabled
@@ -247,8 +253,10 @@ STM32_WPAN.BT_SIG_HEART_RATE_SENSOR=Disabled
STM32_WPAN.CFG_ADV_BD_ADDRESS=0x7257acd87a6c
STM32_WPAN.CFG_CONSOLE_MENU=hw_lpuart1
STM32_WPAN.CFG_DEBUGGER_SUPPORTED=1
-STM32_WPAN.CFG_DEBUG_APP_TRACE=0
-STM32_WPAN.CFG_DEBUG_BLE_TRACE=0
+STM32_WPAN.CFG_DEBUG_APP_TRACE=1
+STM32_WPAN.CFG_DEBUG_BLE_TRACE=1
+STM32_WPAN.CFG_DEBUG_TRACE_LIGHT=1
+STM32_WPAN.CFG_DEBUG_TRACE_UART=hw_uart1
STM32_WPAN.CFG_FAST_CONN_ADV_INTERVAL_MAX=100
STM32_WPAN.CFG_FAST_CONN_ADV_INTERVAL_MAX_HEXA=0xa0
STM32_WPAN.CFG_FAST_CONN_ADV_INTERVAL_MIN=80
@@ -269,7 +277,7 @@ STM32_WPAN.CFG_RTCCLK_DIVIDER_CONF=0
STM32_WPAN.CUSTOM_P2P_SERVER=Enabled
STM32_WPAN.CUSTOM_TEMPLATE=Disabled
STM32_WPAN.DBG_TRACE_UART_CFG=hw_uart1
-STM32_WPAN.IPParameters=P2P_SERVER_NUMBER,CFG_FAST_CONN_ADV_INTERVAL_MAX_HEXA,CFG_LP_CONN_ADV_INTERVAL_MAX_HEXA,LOCAL_NAME_FORMATTED,CFG_HW_LPUART1_ENABLED,CFG_DEBUG_BLE_TRACE,CFG_DEBUG_APP_TRACE,DBG_TRACE_UART_CFG,CFG_CONSOLE_MENU,CFG_ADV_BD_ADDRESS,CFG_LP_CONN_ADV_INTERVAL_MAX,CFG_LP_CONN_ADV_INTERVAL_MIN,BLE_DBG_P2P_STM_EN,LOCAL_NAME,CFG_HW_USART1_ENABLED,CFG_LPM_SUPPORTED,L2CAP_REQUEST_NEW_CONN_PARAM,BLE_APPLICATION_TYPE,BT_SIG_BEACON,BT_SIG_BLOOD_PRESSURE_SENSOR,BT_SIG_HEALTH_THERMOMETER_SENSOR,BT_SIG_HEART_RATE_SENSOR,CUSTOM_P2P_SERVER,CUSTOM_TEMPLATE,BLE_CFG_SVC_MAX_NBR_CB,CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO,CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION,CFG_HW_RESET_BY_FW,CFG_DEBUGGER_SUPPORTED,CFG_FAST_CONN_ADV_INTERVAL_MIN,CFG_FAST_CONN_ADV_INTERVAL_MAX,CFG_IO_CAPABILITY,CFG_MITM_PROTECTION,CFG_RTCCLK_DIVIDER_CONF
+STM32_WPAN.IPParameters=P2P_SERVER_NUMBER,CFG_FAST_CONN_ADV_INTERVAL_MAX_HEXA,CFG_LP_CONN_ADV_INTERVAL_MAX_HEXA,LOCAL_NAME_FORMATTED,CFG_HW_LPUART1_ENABLED,CFG_DEBUG_BLE_TRACE,CFG_DEBUG_APP_TRACE,DBG_TRACE_UART_CFG,CFG_CONSOLE_MENU,CFG_ADV_BD_ADDRESS,CFG_LP_CONN_ADV_INTERVAL_MAX,CFG_LP_CONN_ADV_INTERVAL_MIN,BLE_DBG_P2P_STM_EN,LOCAL_NAME,CFG_HW_USART1_ENABLED,CFG_LPM_SUPPORTED,L2CAP_REQUEST_NEW_CONN_PARAM,BLE_APPLICATION_TYPE,BT_SIG_BEACON,BT_SIG_BLOOD_PRESSURE_SENSOR,BT_SIG_HEALTH_THERMOMETER_SENSOR,BT_SIG_HEART_RATE_SENSOR,CUSTOM_P2P_SERVER,CUSTOM_TEMPLATE,BLE_CFG_SVC_MAX_NBR_CB,CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO,CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO,CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION,CFG_HW_RESET_BY_FW,CFG_DEBUGGER_SUPPORTED,CFG_FAST_CONN_ADV_INTERVAL_MIN,CFG_FAST_CONN_ADV_INTERVAL_MAX,CFG_IO_CAPABILITY,CFG_MITM_PROTECTION,CFG_RTCCLK_DIVIDER_CONF,CFG_DEBUG_TRACE_UART,BLE_DBG_APP_EN,CFG_DEBUG_TRACE_LIGHT
STM32_WPAN.IPParametersWithoutCheck=CFG_LP_CONN_ADV_INTERVAL_MAX,CFG_LP_CONN_ADV_INTERVAL_MIN
STM32_WPAN.L2CAP_REQUEST_NEW_CONN_PARAM=1
STM32_WPAN.LOCAL_NAME=P2PSRV1
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Binary/BLE_p2pServer_reference.hex b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Binary/BLE_p2pServer_reference.hex
index e85b99187..2c941e775 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Binary/BLE_p2pServer_reference.hex
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Binary/BLE_p2pServer_reference.hex
@@ -1,2039 +1,2039 @@
:020000040800F2
-:10000000B8270020017F0008E17C0008E37C00089D
-:10001000E57C0008E77C0008E97C0008000000009F
-:10002000000000000000000000000000EB7C000861
-:10003000ED7C000800000000EF7C0008F17C000867
-:10004000237F0008277F00082B7F0008297D0008F8
-:100050002F7F0008337F0008237D0008377F0008CA
-:100060003B7F00083F7F00081D7D0008437F00089C
-:10007000477F00084B7F0008F57C00084F7F000891
-:10008000537F0008577F00085B7F00085F7F0008F0
-:10009000637F0008677F00086B7F00086F7F0008A0
-:1000A000737F0008777F00087B7F00087F7F000850
-:1000B000837F0008877F00088B7F00088F7F000800
-:1000C000937F0008977F00089B7F00089F7F0008B0
-:1000D000FB7C0008017D0008A37F0008A77F0008C3
-:1000E000AB7F0008AF7F0008B37F0008B77F000830
-:1000F000317D00082D7D0008BB7F0008BF7F000810
-:10010000C37F0008C77F0008CB7F0008CF7F0008AF
-:10011000D37F0008D77F0008DB7F0008DF7F00085F
-:10012000E37F0008E77F0008077D0008EB7F0008F9
-:10013000EF7F0008F37F0008F77F00082DE9F84FF4
-:100140000FF2D017A2B0D7E90045CDE900452C9EAB
-:10015000DFF82C7C04918DF8436000210FF2BC1471
-:100160000D9112944FF0FF368246904699460FE06B
-:10017000C3462C461BF8011B0498D0470028049066
-:1001800000F0B2800D98401C641E0D90F2D1A8447E
-:1001900098F80000252807D10021079108910991BE
-:1001A0000A910B910C910DE06A463146404600F0F1
-:1001B000FDFF050001D10D98B4E0D9D50125E6E792
-:1001C00041F0010118F8010F2028F9D023280CD0A4
-:1001D0002B2804D02D2805D0302809D086E041F006
-:1001E0000201EFE741F00401ECE741F00801E9E723
-:1001F00041F01001E6E700200F900AE00F98B842A6
-:1002000005DA00EB800302EB4302303A0F9208F16B
-:10021000010898F80020A2F130000A28EED398F8DF
-:1002200000002E2818BF0E9629D118F8010F2A2891
-:100230000BD1D9F80000C9F8000008F1010850F806
-:10024000042BC9F800000E9219E02D280CBF18F8F5
-:10025000010B002000220E920BE040B90E9ABA4228
-:1002600005DA02EB820403EB4403303B0E9308F102
-:10027000010898F80030A3F130020A2AEDD3ADF856
-:100280004010129898F8001000F09CFF08B118F880
-:10029000010B8DF842009DF84200682804BF98F8D1
-:1002A0000010682903D162208DF8420008E06C2814
-:1002B00004BF98F800006C2804D171218DF8421019
-:1002C00008F1010813A806904A4618F8013B02A954
-:1002D000504600F067F838B913AA02A9504600F05A
-:1002E000C9F900287FF554AF30461BE02A2882D197
-:1002F000D9F80020C9F8002052F8040BC9F80020F2
-:1003000000280F9003D540420F9041F0040108F1FE
-:10031000010884E70000000000000000686A6C74B7
-:100320007A4C000023B0BDE8F08F622820D0682806
-:1003300011D06A2803D06C2827D0712825D10868ED
-:10034000C01D20F007000860D0E9002308300860D5
-:10035000194610467047002A0A680A60106803D0E0
-:10036000121D0A6000B217E0121D0A6080B217E089
-:10037000002A0A680A60106803D0121D0A6040B2A1
-:100380000AE0121D0A60C0B20AE0002A0A680A6088
-:10039000106803D0121D0A60C1177047121D0A6051
-:1003A000002170477CB50D4611461C462E69B4F1FC
-:1003B000250200F04D811C3A00F08680121F022AAF
-:1003C00040F282800E3A00F00781521F5AD0093A5B
-:1003D0007AD0921E16D0521E35D0521E022A73D9E0
-:1003E000121F30D0521F00F09A80521E4AD0521E67
-:1003F00000F0E480D21E00F0FD80921E42D0D21E9A
-:1004000040D02BE195F83A206C2A09D06869421C4B
-:100410006A610A680A6052F8043B0A60335427E1B3
-:100420000A680A6052F8043B0A60002100930191B7
-:100430004FF0FF322A6329466A4600F096F90028F9
-:1004400040F1168101E195F83A000122FFF76DFFB6
-:10045000C5E900010023994204DA6869411C696119
-:100460002D210DE0288F810704D56869411C696141
-:100470002B2105E0C00722D56869411C6961202154
-:1004800031541CE095F83A000022FFF74EFFC5E911
-:10049000000195F83800010711D5D5E900230020A7
-:1004A000834208BF82420AD044F02000782806D157
-:1004B000686930213154401C411C69613454214623
-:1004C00068693044E86083E00868C01D20F00700D8
-:1004D0000860D0E9002308300860C5E90023D5E9A9
-:1004E0000001C80F04D06869411C69612D210DE02D
-:1004F000288F810704D56869411C69612B2105E0BB
-:10050000C00704D56869411C6961202131546869BC
-:100510003044E8602146284600F032FAA8E005F1B0
-:100520003A02507820B14FF0FF340FF6243070E0DB
-:100530001078622808D0682824D06A2812D06C2845
-:100540002ED071280ED02BE00A680A6052F8040BF6
-:100550000A6020B94FF0FF340FF60C3059E0E96A19
-:10056000017085E00A680A6052F8040B0A6020B93D
-:100570004FF0FF340FF6F0204BE0EA6AD317C0E9E2
-:10058000002375E00A680A6052F8040B0A6020B97B
-:100590004FF0FF340FF6D0203BE0E96A018067E0BE
-:1005A0000A680A6052F8040B0A6020B94FF0FF3461
-:1005B0000FF6B4202DE0E96A016059E00A680A608C
-:1005C00052F8040B0A600021C5E90001EE607821B1
-:1005D000284600F029F94BE06C2285F83A200B6898
-:1005E0000B6053F8042B0B6052BB4FF0FF340FF637
-:1005F000AC200EE095F83A206C2AF0D0086808602C
-:1006000050F8044B0860EC603CB94FF0FF340FF633
-:10061000702000F0F1FD201A76BD2E6B002E04D55F
-:10062000204600F00BFE044608E03246002120463A
-:1006300000F020FE002814BF041B3446AC6117E014
-:10064000294600F092F8002812D54FF0FF3076BD11
-:100650006869411C69612521315409E06969481CB8
-:10066000686125227254210002D0411C6961345412
-:10067000002076BD2DE9F0410E460546716B70698C
-:10068000B46A091A306A091AB069091A706A091A33
-:10069000F069091A96F838000C1B410790460DD4F2
-:1006A000002C0BDD2746B0682021A8470028B06049
-:1006B00057D0F06A401C7F1EF062F4D17369424645
-:1006C0003146284600F0ACFC00284AD1376A002F9A
-:1006D0000ADDB0683021A8470028B06041D0F06A38
-:1006E000401C7F1EF062F4D1B369F268314628469F
-:1006F00000F096FCA8BB776A002F09DDB0683021B6
-:10070000A847B06068B3F06A401C7F1EF062F5D164
-:10071000F068B169F36942183146284600F080FC60
-:10072000F8B9B76A002F09DDB0683021A847B0607A
-:10073000B8B1F06A401C7F1EF062F5D196F838001F
-:1007400041070BD5002C09DDB0682021A847B06017
-:1007500038B1F06A401C641EF062F5D10020BDE89B
-:10076000F0814FF0FF30BDE8F0812DE9F8470D46EC
-:10077000A3B02F6B002F8146904648BF6FF0004713
-:1007800000F0A4FD696B40180FF62C118128D1E907
-:100790000023CDE9012328BF4FF0FF303ED20024D3
-:1007A000002F2FDDD8F8001001AA684600F000FDE8
-:1007B0000646002E35D4D8F8000008B9761E30D48D
-:1007C000B7421FDB6869301881280AD300206863AC
-:1007D00003AA29464846FFF74DFF040012D4002023
-:1007E000686103A8D5F814A032466946504400F069
-:1007F00073FDB244C5F814A058F8040B002818BFC4
-:10080000BF1BCDD12CB903AA29464846FFF732FFBA
-:10081000044614B9002068616863204624B0BDE82E
-:10082000F0874FF0FF34F8E72DE9FC4707468A468A
-:100830003E69BAF16F0F08BF082405D04AF02001C5
-:10084000782914BF0A2410243C25D7E90023BAF1E3
-:10085000640F18BFBAF1690F9046994606D100217E
-:100860008B4203DAD8F1000869EB49090020814581
-:1008700008BF80451FD1386BE8B9082C4CD197F8D8
-:100880003800010748D530203B2586F83B0043E07F
-:1008900000280ED597F8380000F01400102808D171
-:1008A0007A6B7869121A386A121A511A0029C8BF6D
-:1008B0003962BDE8F3878DF800A0404649462246DC
-:1008C000E31700F05DFD3032D0B26D1E3A2801957D
-:1008D00004DB9DF80000A0F151018A1872554046D2
-:1008E00049462246E31700F04BFD8046894600202A
-:1008F000814508BF804503D0F86871198842DCD370
-:10090000082C09D197F83800010705D5715D302909
-:1009100002D06D1E30207055C5F13C01B9617019CF
-:10092000F860386B8142B3DA411A39624FF6EF70E2
-:10093000398F01403987BDE8F3872DE9D04306465A
-:100940000F4614464FF00008DFF8389412E0E00735
-:1009500007D542464B463046394600F029FE06464A
-:100960000F464046494642464B4600F021FE641081
-:1009700080468946002CEAD130463946BDE8D0830E
-:100980002DE9F34F054641F020048DB0D5E90089EB
-:10099000612C02AE09D0286B002848BF062003D482
-:1009A00008BF672C01D101202863D5E90023580036
-:1009B0004015401C0ED119030CD00320A8619DF8EE
-:1009C000380061381A2802D20FF2F46111E00FF2F8
-:1009D000F4610EE058004015401C0FD119030DD1F1
-:1009E0000320A8619DF8380061381A2814D30FF24B
-:1009F000DC61E868032200F06FFCD3E1194621F0C6
-:100A00000043B3F5801F10460DD20027BB4208BF3C
-:100A1000BA42019703D111E00FF2AC61E9E701AAF4
-:100A200000F098FE0AE0DFF8607307EB1352DFF87E
-:100A30005C3301921940DFF858331943C5E90001CE
-:100A4000612C0ED1E86830210170811CE9609DF8AD
-:100A5000381061290CBF7821582141706869801CC9
-:100A60006861D5E900AB2BF0004300202AF00002BA
-:100A7000834204BF8242002300F05A81612C40F07F
-:100A8000A980286B00284CBF2120401C00904046C4
-:100A9000009F7F1C49460022002300F093FED946A8
-:100AA00001988DF8082038BF89F00049001F019097
-:100AB000002FD0460DF1090040F3498140F2FF714B
-:100AC000DFF8D0B20C91064640464946002200238A
-:100AD00000F090FE80F03A814800400D00F11C02C9
-:100AE00010D0002A0EDD0C98824205DB09F0004090
-:100AF00040EA0B01002013E0A448084040EA0251FC
-:100B000040460DE029F00043002028F00002834217
-:100B100008BF82420FBF40461C22404600F082FEC2
-:100B20008046894600F01CFFFF1F002F044609DDA8
-:100B300000F034FF02460B464046494600F040FFB5
-:100B400080468946F01D072104E004F00F0200F8FA
-:100B5000012D2411002C01DD491EF6D5491E5CBF74
-:100B6000002200F8012DF9D5ECE00020194602AA78
-:100B70000A4400E05B1E12F80149491E8442F9D084
-:100B80000F2804D10DF10900425C521C4254002987
-:100B900004D50198001D02AE5B1C0190591E12D4B1
-:100BA0009DF838007218147804F130085FFA88F460
-:100BB000392CC4BFA0F13A04A044491E02F80189AF
-:100BC000F1D58DF83800286B002840F1B080591E0F
-:100BD0002963ACE0404649460022002300F0F2FDC4
-:100BE000019938BF89F0004947F2975041436A4A5A
-:100BF00091FBF2F20192D2F1070204DD4046494630
-:100C0000FFF79BFE0AE0524200206449FFF795FE81
-:100C100002460B464046494600F044FF8046662C9B
-:100C2000286BDFF87CB106BF019F0A3706273F1803
-:100C3000142FC8BF142730208DF8080089460DF105
-:100C4000090000E03046002F34DD064640464946A4
-:100C500001F04CF801460A4606F1080304200A2672
-:100C6000B2FBF6F606EB860EA2EB4E02303203F82C
-:100C7000012C0A22B6FBF2F202EB820EA6EB4E0624
-:100C80003036401E03F8026DE9D1083F002F03F112
-:100C90000806D7DD084601F03DF802460B464046FF
-:100CA000494600F08DFE00225B4600F081FC804644
-:100CB0008946CBE70DF10901401A0DF1090604E060
-:100CC0000199491E401E0191761C31783029F7D0D8
-:100CD000662C02D10199491C03E0652C0CBF01214F
-:100CE00000212B6BCB189842B8BF431E002B1ED49B
-:100CF000834204DAF05C3528A8BF392000DA3020BE
-:100D00001946721E02EB010800E05B1E18F80199FB
-:100D1000491E8145F9D0392802D1705C401C7054BD
-:100D2000002904D50198401C16465B1C01900198CF
-:100D300000B200901BB29DF838103246284600F0F1
-:100D400034F82FE0C61D002F3FF7BEAE30460DF140
-:100D50000901401A009903468842C8BF0B46002B80
-:100D60000DF109063FF52FAF8342BFF6FEAE0DF140
-:100D70000900C05C07287FF7F8AE0F20F6E60000F8
-:100D8000CBCCCC0C0000244002FCFFFFFFFF0F8007
-:100D90000000E03F0000F07FA08601000000F03F6F
-:100DA00084D797410FB0BDE8F08F2DE9F84783B0A5
-:100DB00006468A461746984600F0FCF9B8F1000F3F
-:100DC000406A356B90F8009003DC4FF001080FF299
-:100DD0000037BDF930404AF02000662808BF641C87
-:100DE00015D0672840F0848014F1040FC0F286808B
-:100DF000AC4280F2838096F83800641C010702D46C
-:100E0000A845B8BF454620B22D1A48BF00250FFAA5
-:100E100084FAF068B169BAF1000F25DC4A1C30236E
-:100E20004354002D03DC96F83800010703D5F06821
-:100E300000F80290521C15EB0A0FB8BF6C4220B2AA
-:100E4000441941424445B8BFA046B26171620FFAED
-:100E500088F5F561F068B3692A463946184400F010
-:100E60003BFA641BB462C4E022B29045084417DA2E
-:100E70004246394600F030FAB0694044B061AAEB0E
-:100E80000801002D716203DC96F838100A0705D5B9
-:100E9000F16801F80090F069401CF061B562A8E0CB
-:100EA000394600F019FAB069002D5044A8EB040847
-:100EB00003DC96F838100A0703D5F16801F80090B2
-:100EC000401CB0610FFA88F08542F068B369B8BF82
-:100ED000A8460FFA88F207EB0A01184400F0FCF963
-:100EE000B0690FFA88F10844B061681A706280E056
-:100EF000BAF1610F14D14FF0700A16E0A84504DA78
-:100F000096F838100A0758BF45466D1E48BF0025A1
-:100F1000BAF1670F14BF4FF0450A4FF0650A04E0BD
-:100F2000BAF1410F08BF4FF0500AB169F368481C8D
-:100F3000B061002D17F8012B5A5403DC96F83810D5
-:100F40000A071BD5F168431CB36101F80090002D1E
-:100F500014DDA8F101080FFA88F08542F068B8BFE7
-:100F6000A8460FFA88F23946184400F0B5F9B0697E
-:100F70000FFA88F108446D1AB0617562F068B169C2
-:100F80000844002C80F800A003D42B214170811C60
-:100F900003E02D2141706442811C00206A460AE072
-:100FA00023460A2493FBF4F404EB8405A3EB4503E6
-:100FB00002F8013B401C24B2002CF1DC012806DCC5
-:100FC0004AF02002652A04BF302201F8012B48B9FB
-:100FD000302001F8010B07E0401E1DF800203032E0
-:100FE00001F8012B0028F7DCF068B2691044091AF7
-:100FF000F16196F8380000F0140010280DD17169E5
-:10100000B0694118706A4118F0694118B06A411816
-:10101000706B8142BCBF411A316204B0BDE8F087F9
-:10102000F8B505460E4617461C46002074B117F861
-:10103000011BB068A847B06030B1F06A401CF06294
-:101040000020641EF3D1F2BD4FF0FF30F2BD00006E
-:101050007072696E74665F733A20256E20646973DE
-:10106000616C6C6F776564007072696E74663A20AB
-:1010700062616420256E20617267756D656E740013
-:101080007072696E74665F733A20626164202573C2
-:1010900020617267756D656E740000007072696E14
-:1010A00074665F733A2062616420256C73206172FC
-:1010B00067756D656E7400000000000000000000A0
-:1010C0006E616E004E414E00696E6600494E4600EC
-:1010D0003000F0B40246106895681318506803EBAE
-:1010E0005004C00721D54D441FE0F0BC02F10C00B4
-:1010F000704713F8017B05F8017B491EF9D1A0B1B7
-:10110000B60813F8011B06F00306032E08BF13F8F8
-:10111000016B01EB06214942801C294405D011F8DE
-:10112000016B05F8016B401EF9D1A342DDD013F825
-:10113000016B16F0030104BF13F8011BC91C300931
-:101140000F28DAD113F8010B0F30D6E71B48704790
-:1011500030B45368D418042B09DA41B1057804F887
-:10116000015B10F8015B15B15B1C491EF3E753608E
-:1011700030BC704738B514461D4661B1FFF7E8FF33
-:1011800061686A6B204690476FF00102811A02D0B5
-:10119000491E03D005E06FF0010032BD4FF0FF3073
-:1011A00032BD0021616032BDDA6B1047034BE1E7CD
-:1011B000024BF9E70248704700000000D4100020FD
-:1011C0009C1000200278C9B28A421AB11CBF10F8E4
-:1011D000012FF9E718BF00207047B1F5807F02D3D7
-:1011E0004FF0FF3070470170012070470078401EBB
-:1011F0008041C043C00F704780B508B90FF21C0092
-:1012000005490B681BB122220021984701E000F03C
-:101210008EFD222002BD0000AC170020636F6E73AC
-:10122000747261696E742068616E646C65723A20D4
-:10123000626164206D6573736167650000F101038D
-:10124000810704D010F8011B89B18107FAD1026827
-:10125000B2F10131914311F0803F04BF50F8042FE7
-:10126000F6E710F8011B11B110F8011BFBE7C01ADB
-:1012700070470000C9B2830706D0521E22D310F86F
-:10128000013B9942F7D11FE0083A13D302F104025F
-:1012900041EA012141EA014150F8043B121F21BFFC
-:1012A0004B40A3F1013C2CEA030C1CF0803FF3D02F
-:1012B000C9B2001F083210F8013B521E28BF91EA44
-:1012C000030FF8D818BF0120401E704780B5FFF704
-:1012D0003DFF006C02BD000062B38B0708D0521EB8
-:1012E00011F8013B00F8013B00F024808B07F6D198
-:1012F000830740F0208000BF103A07D330B4B1E834
-:101300003810103AA0E83810F9D230BC530724BF87
-:10131000B1E80810A0E8081044BF51F8043B40F8B9
-:10132000043BD20724BF31F8022B20F8022B44BF24
-:101330000B7803707047121F17D35B0009D151F867
-:10134000043B20F8023B1B0C121F20F8023BF6D294
-:101350000BE051F8043B00F8013B1B0A20F8023B6C
-:101360001B0C121F00F8013BF3D238BF121D521E96
-:1013700024BF11F8013B00F8013BF8D8704700008A
-:10138000B3BBD9B1B2F5803F7DD2022A1ED98C46BB
-:10139000B1FBF2F102FB11C31B0443EA1043B3FBA0
-:1013A000F2FC02FB1C3380B240EA0343B3FBF2F0D1
-:1013B00002FB103240EA0C4000237047022A05D994
-:1013C0008446B0FBF2F002FB10C270474AB105D16F
-:1013D00000F0010249085FEA300070470022002354
-:1013E000704700F0A7BC0B000200002100207047EE
-:1013F000904271EB030CF6D3B3F5803F2FD2F0B5DA
-:10140000B3FA83F7B1FA81F4A7F10F0E3D1B5340F5
-:10141000CEF1200602FA0EF2F3415340B5F10F0768
-:1014200046D80F3C2C444140C4F12006A040F14175
-:101430004140B1FBF3F603FB1611A2FB0645001B6E
-:10144000A94102D2761E8018594180EA010221FA90
-:101450000EF362FA0EF200215A403046F0BD30B46D
-:10146000B1FBF3FC03FB1C11A2FB0C45001BA941C3
-:1014700003D2ACF1010C8018594130BC02460B4636
-:10148000604600217047B2F1807F65D3F0B5B2FAB3
-:1014900082F7B1FA81F4C7F10F063D1B22FA06F379
-:1014A00007F1110EF24120355A40B5F10F07B8D9B6
-:1014B0004140C4F12006A040F1414140B1FBF3FCA2
-:1014C00003FB1C11A2FB0C45001BA94103D2BCF17C
-:1014D000010C801859410F2F12D30F3FC90341EA65
-:1014E0005041B1FBF3F603FB1611A2FB0645D4EB0A
-:1014F000C030A94102D2761E8018594146EACC3C40
-:1015000007B34140C7F12006B840F1414140B1FB6B
-:10151000F3F603FB1611A2FB0645001BA94102D2FC
-:10152000761E8018594180EA010221FA0EF3C7F1B4
-:10153000200462FA0EF20CFA07F05A402CFA04F179
-:101540003043F0BD80EA010221FA0EF3002162FA75
-:101550000EF260465A40F0BD8C46B1FBF2F102FB40
-:1015600011C31B0243EA1063B3FBF2FC02FB1C3302
-:101570001B024CEA002043EA1063B3FBF2FC02FBBF
-:101580001C331B024CEA002043EA1063B3FBF2FC5D
-:1015900002FB1C331B024CEA002043EA1063B3FB3E
-:1015A000F2FC02FB1C324CEA0020002370470000D2
-:1015B000B0B581EA030C0CF0004C40F2FF7515EA5F
-:1015C00011541DBF15EA1357AC42AF4239E0E4197C
-:1015D00023EA455343F48013C90241F0004141EA34
-:1015E000505EC7021100A7FB020200284FF0000066
-:1015F000EEFB01204FF00001E3FB072118BF42F092
-:101600000102401800214941E3FB0E01A4F580646A
-:101610000F0302D252004041494154F101046CDDF4
-:10162000470872F1004250F1000051EB0451A1F55E
-:1016300080115CBF41EA0C01B0BD4CEA05510020AD
-:10164000B0BD05EA1357AC4214BFAF4241E050EAC7
-:10165000410E1CBF52EA430E02E061460020B0BDBD
-:1016600024423C441BD15FEA070EF6D0090302BFB7
-:1016700001460020AEF1140EB1FA81F7AEEB07047B
-:1016800001FA07FE0C37C7F1200100FA07F7C8403E
-:101690004EEA000E23EA455343F48013A2E733F0E9
-:1016A0000043B3FA83F704BFB2FA82FE77440B3FDC
-:1016B000E41BB7F1200E2FBF02FA0EF3BB40C7F1B7
-:1016C000200E22FA0EFE38BF43EA0E03BA40641C15
-:1016D00082E750EA410E14BF52EA430E6FF0000158
-:1016E0004FF4001717EB430F8ABF194617EB410F52
-:1016F000B5E74CEA05510020B0BDD4F10104B4F1C6
-:1017000020070FDAC4F12007520828BF42F0010277
-:1017100010FA07F501FA07F7E1BF2A43E040384322
-:10172000E1400FE0352C98DCC7F1200452EA40027A
-:1017300020FA07F218BF42F0010231FA07F0A14087
-:101740000A43002172F1004250F1000051EB0C01FC
-:10175000B0BD000010B5144600F002F8226010BDC4
-:10176000C1F30A5343B14A0012F5001F28D2A3F275
-:10177000FE32A1EB0251704750EA410C20D001F03B
-:10178000004C31EA0C01B1FA81F204BFB0FA80F3E7
-:10179000D2180B3AB2F120032CBF00FA03F19140AA
-:1017A00041EA0C013EBFC2F1200C20FA0CF31943B0
-:1017B0009040524240F2FD33D21A01EB0351704780
-:1017C000002270474FF4001C1CEB410F94BF1CEB30
-:1017D000430F09E041EA030C50EA4C0C52EA0C0CAE
-:1017E00003D2994208BF9042704714BF8B42824295
-:1017F000704700004FF4001C1CEB410F94BF1CEB22
-:10180000430F09E041EA030C50EA4C0C52EA0C0C7D
-:1018100003D28B4208BF8242704714BF9942904264
-:1018200070470000124254D440F2FF7C1CEA11536E
-:101830000FD0634531D09B1863453CBF01EB02518B
-:10184000704701F0004141EA0C510020AFF30080E5
-:10185000704750EA410320D001F0004C91EA0C019E
-:101860001CD0B1FA81F30B3B9A420DD9D21A9940A0
-:1018700051EA0C01C3F1200C20FA0CFC61449840A1
-:10188000531C40F2FF7CD7E7914041EA0C01C2F1C2
-:10189000200C20FA0CF3194390407047B0FA80F303
-:1018A0001533202BE0D3202AEED3203A203B9A4256
-:1018B00009D9D21A00FA03F141EA0C010020531CA5
-:1018C00040F2FF7CB8E700FA02F141EA0C01002087
-:1018D0007047524240F2FF7C1CEA11530DD0634521
-:1018E000DBD0B2EB030C3CBFA1EB025170470CF113
-:1018F000010221EA035141F4801150EA410CCCD09D
-:1019000001F0004C352A27DC30B481EA0C01B2F139
-:10191000200309DAC2F12003044601FA03F5D0409E
-:101920002843D1409C400CE0C3F12002450020FA3E
-:1019300003F418BF44F0010421FA03F091400C4372
-:10194000002174F1004550F1000051EB0C012442DC
-:1019500030BC7FF47BAF70476146002076E7000023
-:10196000C1F30A5340F2FE329B1A14DDD3F1200377
-:101970004FEAE17208DDC90241EA505141F00040EE
-:10198000D84080185040704703F2E13010B1D24384
-:1019900082F000407047002070470000C11768B116
-:1019A0004840401AB0FA80F29040D21CC907C2F5F4
-:1019B000846241EA025202EBD021400570470000E8
-:1019C00070B44FF0004591EA030F40F1B5816B40D0
-:1019D000841A71EB030603D2001BB1411219734143
-:1019E0004FF4001C1CEB410F34BF7CEB430442E07E
-:1019F0000C0DA4EB1356352E4FDC45EAC323DB0A4E
-:101A000045EAC121C912B6F120050DDD63FA05F6DC
-:101A1000EB4086EA0305124218BF45F00105C018E5
-:101A200051F100010CD213E062FA06F5F240554084
-:101A3000F3415A40B340F3405A408018594107D30C
-:101A400049085FEA30005FEA350528BF45F0010527
-:101A500001F58011420875F1004250F1000041EBA0
-:101A600004514E0016F5001F70BC38BF70470020AF
-:101A7000090D090570471CEB410F10D252EA4306CD
-:101A80000BD0BCEB410F05D80C0DAB43661E342EBA
-:101A9000B6DD02E0AB438018594170BC704770BCA2
-:101AA00070470000F0B540F2FF7581EA030C0CF0BE
-:101AB000004C15EA11541DBF15EA1357AC42AF4252
-:101AC000E5E0BC41C1F31301C3F31303801A99414C
-:101AD00043F4801304D2641E4000494180185941E8
-:101AE000C90241EA5051B1FBF3F603FB1611A2FB08
-:101AF0000675D7EBC020A94102D2761E8018594145
-:101B0000C90241EA5051B1FBF3FE03FB1E11A2FBD7
-:101B10000E75D7EBC020A94103D2AEF1010E80189B
-:101B20005941890241EA9051760546EA8E2EB1FB71
-:101B3000F3F603FB1611A2FB0675D7EB8020A94133
-:101B400002D2761E80185941C90241EA50514EEA2C
-:101B5000060EB1FBF3F603FB1611A2FB0675D7EBDD
-:101B6000C020A94102D2761E80185941C90241EA1B
-:101B70005051B1FBF3F703FB1711A2FB0735D3EB71
-:101B8000C020A94167F100070CBF004247F00107E0
-:101B900066F3D5274FEA1E31B80814F5806412DDCC
-:101BA000BD0775F1004250EB0E5051EB045111F599
-:101BB000801F5CBF41EA0C01F0BD4CF07F6141F039
-:101BC000E0410020F0BDBD076D0840EA0E5041F431
-:101BD0008011D4F10104B4F120060ADAC4F1200620
-:101BE0000200E04001FA06F3E1401843B240154319
-:101BF0000EE0342C13DCC6F1200445EA40056D08E4
-:101C000020FA06F2154321FA06F0A1400D43002107
-:101C100075F1004250F1000051EB0C01F0BD0020C5
-:101C20005FEA0C01F0BDCFB992185B41B3FA83F7BC
-:101C300004BFB2FA82F6BF190B3FB7F120062FBFDF
-:101C400002FA06F3BB40C7F1200622FA06F638BFB7
-:101C50003343BA401CB1E419641E33E77F4231F0CC
-:101C60000041B1FA81F404BFB0FA80F6A4190B3C2C
-:101C7000B4F120062FBF00FA06F1A140C4F12006FE
-:101C800020FA06F638BF3143A0403C1B1AE7AC42AD
-:101C90001ABF05EA1357AF4212E050EA41061CBFD3
-:101CA00052EA4306BFE750EA4107304661461CBF8F
-:101CB00041EA0551F0BD52EA430C08BFC143F0BDF3
-:101CC00000204FF4001616EB410F98BF16EB430FA0
-:101CD00008BF16EB410F24BFC14305E016EB430FCD
-:101CE0000CBF61464CEA0551F0BD0000400D49189B
-:101CF00040EA81200CD2490DA1F58061491C40F0D9
-:101D0000004005DBD1F11F0154BFC840C017704728
-:101D100000207047014648B1B0FA80F18840C91CE4
-:101D2000C1F58461090501EBD02140057047012010
-:101D300000F0B6B870470000841A71EB030604D2B5
-:101D40006E40001BB141121973414FF4001C1CEB93
-:101D5000410F34BF7CEB430682E00C0DA4EB13561D
-:101D6000362E7BDC012E45EAC32341DC43EA525385
-:101D700012BFD20292025B08240545EAC12141EA62
-:101D80005051D2EBC020994125D407D1B0FA80F64A
-:101D900010FA06F162D00020203608E0B1FA81F690
-:101DA000B140C6F1200220FA02F21143B0404FEADE
-:101DB000F474B4EB465434F001064FEA74040AD8C4
-:101DC000D6F50016760D04F00044F04061FA06F2F4
-:101DD0005040F1404840C00A40EA415021F00041E3
-:101DE00028BF5FEA500550F1000044EBD12135E0F7
-:101DF000DB0A45EAC121C90AB6F120050EDD42EA37
-:101E00000242120CC5F1200603FA06F6EB4042EA44
-:101E100006056D42984161F100010DE062FA06F598
-:101E2000F240554063FA06FC82EA0C02F3405A4045
-:101E30006D42904161EB030111F4801F05D1641ED6
-:101E4000620502D06D004041494121F480114308F0
-:101E500075F1004350F1000041EB045170BC704734
-:101E60001CEB410F15D223F0004352EA43060BD07E
-:101E70004FEA4C0CBCEB410F04D80C0D661E342EFF
-:101E8000B7DDEBE7801A994150EA410608BF00210F
-:101E9000E4E708BF1CEB430F28BF6FF00001DDE74C
-:101EA00080B5AFF30080024A11001820ABBEFBE7FB
-:101EB0002600020038B5040009D004F17C056868EA
-:101EC00008B900F01EF800F021F8012801D1012026
-:101ED00032BDA06A08B100F02AF800F00AF821F03B
-:101EE0002A01FFE7816000F01BF8BDE8324000F0F6
-:101EF00010BE2068416821F49041416020688168EB
-:101F0000704700212970204600F023BF242068601C
-:101F100020680168490849000160204600F02EB998
-:101F20002068016841F001010160204670472046A9
-:101F300000F08CBD70B5044604F17C05134668685A
-:101F4000202836D149B3180027D02878012830D06E
-:101F500001222A7004F15406216533807380002029
-:101F6000E86021206860306AC8B1DFF8F411C1620E
-:101F7000DFF8F001316A0863316ADFF8EC01486389
-:101F80000020316A88632068216D00F12802306AE0
-:101F900001F00DF818B100F00EF8012070BD2168B5
-:101FA00040200862002028702068816841F080018C
-:101FB00008E0022070BD1020E8600020287020207A
-:101FC000686070478160002070BD206881684A06A3
-:101FD000704770B504462568E9692A68AB6811F056
-:101FE0000F000CD1880602D5900601D4D80079D50F
-:101FF000E16E002975D02046BDE8704008475B4877
-:10200000034208BF12F4907F6CD0CE0709D5D605E5
-:1020100007D501262E62D4F8885045F00105C4F892
-:1020200088508D070AD5DD0708D526680225356258
-:10203000D4F8885045F00405C4F888504D070AD5F7
-:10204000DD0708D5266804253562D4F8885045F0A8
-:102050000205C4F888500D070CD5950601D403423B
-:1020600008D0256808202862D4F8880040F00800CD
-:10207000C4F88800D4F8880000286FD0890607D5F6
-:10208000900601D4D80003D5E16E09B120468847F7
-:10209000D4F8880021688A68510601D400071AD54F
-:1020A000204600F0A1FDFFF790FF0FD500F060F88B
-:1020B00060B1DFF888198163A06F00F0BBFF0028D2
-:1020C0004CD0A06F816BBDE8704008472046BDE84A
-:1020D000704001F09FB8204601F09CF80020C4F841
-:1020E000880070BDC80209D5580207D54FF480108A
-:1020F00028622046BDE8704001F014B9080609D5F1
-:10210000100601D4180205D5216F39B32046BDE869
-:102110007040084748060FD550060DD5286820F0B6
-:10212000400028602021C4F880100020206720464D
-:10213000BDE8704001F021B9080206D5500004D571
-:102140002046BDE8704001F035B9C80148BF002AFB
-:1021500004D52046BDE8704001F02DB970BD0000E7
-:102160004D2C00087B2C0008812C00080100001079
-:10217000816821F040018160A06F70472DE9F84F20
-:102180000446DFF8880A2768DFF884BA3968DFF880
-:1021900084AA0140A06801432069014360690143AA
-:1021A000E0690143606E0143396000267968E068A8
-:1021B00021F4405101437960B046A169DFF8580A23
-:1021C00087421CBF206A0143BA68DFF8500A024008
-:1021D0001143B9604FF48075F96A606A090940EAF1
-:1021E0000111F9625F454FF400404FF400714FF464
-:1021F00080624FF400634FF4805C4FF4005E4FF454
-:10220000804929D1DAF800B00BF0030BBBF1030FC2
-:102210003ED8DFE80BF00237343A4FF0010AD4F829
-:102220001CB05746BBF5004F4FF6F07A40F01183D3
-:10223000012F09D0022F00F05482042F00F08D826C
-:10224000082F00F0C282F5E201F08AFC0146606AC4
-:10225000002840F01B8242E2DFF8BCB95F4517D18D
-:10226000DAF800A01AF4406A27D0BAF5806F09D0D6
-:10227000BAF5006F03D0BAF5406F06D008E04FF012
-:10228000020A07E04FF0040A04E04FF0080A01E0F8
-:102290004FF0100ADFF880B95F45C0D1BAF1000FE6
-:1022A0000BD0BAF1020F49D0BAF1040F00F08280CE
-:1022B000BAF1080F00F0B080B3E301F049FC014629
-:1022C000606A58B3012808BF022028D0022808BF3E
-:1022D000042024D0032808BF062020D0042808BFEB
-:1022E00008201CD0052808BF0A2018D0062808BFDF
-:1022F0000C2014D0072808BF102010D0082808BFD1
-:1023000020200CD0092808BF402008D00A2808BF88
-:10231000802004D00B2808BF284600D00120B1FB44
-:10232000F0F0002800F07F83626802EB42018842EF
-:1023300003D31103814280F0A18072E3606AB0B3DD
-:10234000012808BFDFF8D808EED0022808BFDFF860
-:10235000D408E9D0032808BFDFF8CC08E4D004286B
-:1023600008BFDFF8C808DFD0052808BFDFF8C008BD
-:10237000DAD0062808BFDFF8BC08D5D0072808BF88
-:10238000DFF8B408D0D0082808BFDFF8B008CBD0F9
-:10239000092808BFDFF8A808C6D00A2808BFDFF858
-:1023A000A408C1D00B2808BF4FF22440BCD0DFF8EE
-:1023B0009808B9E701F082FB0146606A58B301282A
-:1023C00008BF0220ABD0022808BF0420A7D00328F2
-:1023D00008BF0620A3D0042808BF08209FD00528E6
-:1023E00008BF0A209BD0062808BF0C2097D00728DA
-:1023F00008BF102093D0082808BF20208FD00928BC
-:1024000008BF40208BD00A2808BF802087D00B2827
-:1024100008BF284683D081E7676A002F84D0012F48
-:1024200008BF4846FAD0022F08BF7046F6D0032FE7
-:1024300008BF41F25550F1D0042F08BF6046EDD0DF
-:10244000052F08BF40F6CC40E8D0062F08BF40F665
-:10245000AA2012D0072F08BF18460ED0082F08BF99
-:1024600010460AD0092F08BF084606D00A2F08BF19
-:10247000284602D00B2F00D1802055E7BAF1000F7B
-:102480000BD0BAF1020F38D0BAF1040F00F072800D
-:10249000BAF1080F00F0A780ECE001F059FB01460B
-:1024A000606A40B3012808BF02251ED0022808BF79
-:1024B00004251AD0032808BF062516D0042808BF13
-:1024C000082512D0052808BF0A250ED0062808BF07
-:1024D0000C250AD0072808BF102506D0082808BFF9
-:1024E000202502D0092808BF402572D00A280CBF39
-:1024F00080250B286DD001256BE0606A002836D05E
-:10250000012808BFDFF8D8672BD0022808BFDFF802
-:10251000D46726D0032808BFDFF8CC6721D0042871
-:1025200008BFDFF8C8671CD0052808BFDFF8C06700
-:1025300017D0062808BFDFF8BC6712D0072808BFED
-:10254000DFF8B4670DD0082808BFDFF8B06708D0FF
-:10255000092808BFDFF8A86703D00A2808BFDFF8FA
-:10256000A4677CD00B2808BFDFF8DC6677D0DFF8E3
-:10257000986774E001F0A2FA0146606A40B301284E
-:1025800008BF022525D0022808BF042521D0032832
-:1025900008BF06251DD0042808BF082519D0052826
-:1025A00008BF0A2515D0062808BF0C2511D007281A
-:1025B00008BF10250DD0082808BF202509D00928FC
-:1025C00008BF402505D00A280CBF80250B2800D065
-:1025D00001256268B1FBF5F65008002110EB0620DA
-:1025E00051EB166141E0606A002836D0012808BF2F
-:1025F0004FF4800633D0022808BF4FF400162ED0C7
-:10260000032808BFDFF8046729D0042808BF4FF467
-:10261000801624D0052808BFDFF8F4661FD00628EE
-:1026200008BFDFF8F0661AD0072808BF4FF400266D
-:1026300015D0082808BF4FF4802610D0092808BFFD
-:102640004FF400360BD00A2808BF4FF4803606D06E
-:102650000B2808BF4FF4004601D04FF40006C246D5
-:10266000002116EB52004AEB01010023FEF788FE21
-:10267000064601E04FF00108A6F54070DFF8981615
-:10268000884280F0CE812168CE60CCE1012808BF6D
-:1026900002251AD0022808BF042516D0032808BF37
-:1026A000062512D0042808BF08250ED0052808BF2B
-:1026B0000A250AD0062808BF0C2506D0072808BF1F
-:1026C000102502D0082808BF202575D0092808BF8A
-:1026D000402571D00A280CBF80250B286CD001251D
-:1026E0006AE0606AB0B3012808BFDFF85C0521D05A
-:1026F000022808BFDFF828051CD0032808BFDFF830
-:102700001C0617D0042808BFDFF8180512D00528CA
-:1027100008BFDFF80C060DD0062808BFDFF8080553
-:1027200008D0072808BFDFF8040503D0082808BF31
-:10273000DFF804057AD0092808BFDFF8000575D056
-:102740000A2808BFDFF8F80470D00B2808BFDFF8AC
-:10275000F4046BD0DFF8AC0568E001F0AFF9014696
-:10276000606A40B3012808BF022525D0022808BFAF
-:10277000042521D0032808BF06251DD0042808BF42
-:10278000082519D0052808BF0A2515D0062808BF36
-:102790000C2511D0072808BF10250DD0082808BF28
-:1027A000202509D0092808BF402505D00A280CBFDC
-:1027B00080250B2800D001256068B1FBF5F14208A7
-:1027C00002EB4102B2FBF0F632E0666A66B3012E1C
-:1027D0002CD0022E08BF484628D0032E08BF42F650
-:1027E000AA2023D0042E08BF70461FD0052E08BF94
-:1027F00041F698101AD0062E08BF41F2545015D059
-:10280000072E08BF604611D0082E08BF18460DD00D
-:10281000092E08BF104609D00A2E08BF084605D069
-:102820000B2E08BF284601D04FF4803000F008F985
-:10283000B6B201E04FF00108A6F11000504580F05B
-:10284000F0800AEA0601C6F3420001432068C16035
-:10285000E9E0012F07D0022F35D0042F6DD0082FCB
-:1028600000F0A280D4E001F07BF90146606A40B339
-:10287000012808BF022512D0022808BF04250ED067
-:10288000032808BF06250AD0042808BF082506D05B
-:10289000052808BF0A2502D0062808BF0C257BD0D2
-:1028A000072808BF102577D0082808BF202573D037
-:1028B000092808BF40256FD00A280CBF80250B28A7
-:1028C0006AD0012568E0606AA0B3012808BFDFF87C
-:1028D000501330D0022808BFDFF848132BD003284C
-:1028E00008BFDFF8441326D0042808BFDFF83C13E4
-:1028F00021D0052808BFDFF838131CD0062808BFF0
-:10290000DFF8301317D0072808BFDFF82C1312D0D8
-:10291000082808BFDFF824130DD0092808BFC849CC
-:1029200009D00A2808BFC74905D00B2808BF4FF2B5
-:10293000244100D0C449606831E001F0BFF801468D
-:10294000606A40B3012808BF022525D0022808BFCD
-:10295000042521D0032808BF06251DD0042808BF60
-:10296000082519D0052808BF0A2515D0062808BF54
-:102970000C2511D0072808BF10250DD0082808BF46
-:10298000202509D0092808BF402505D00A280CBFFA
-:1029900080250B2800D001256068B1FBF5F101EB23
-:1029A0005001B1FBF0F631E0666A6EB3012E08BF4C
-:1029B000484629D0022E08BF704625D0032E08BFF6
-:1029C00041F2555020D0042E08BF60461CD0052E81
-:1029D00008BF40F6CC4017D0062E08BF40F6AA200C
-:1029E00012D0072E08BF18460ED0082E08BF10467A
-:1029F0000AD0092E08BF084606D00A2E08BF28466E
-:102A000002D00B2E08BF802000F01AF8B6B201E009
-:102A10004FF00108A6F11000504502D22068C660B0
-:102A200001E04FF0010804F16800012141800180BC
-:102A30000021416081604046BDE8F28FCF2C000844
-:102A4000616800EB5100B0FBF1F6704790F8281078
-:102A5000CA0706D502685368C16A23F400330B43E2
-:102A6000536090F828108A0706D502685368016BF6
-:102A700023F480330B43536090F828104A0706D59F
-:102A800002685368416B23F480230B43536090F832
-:102A900028100A0706D502685368816B23F40043A7
-:102AA0000B43536090F82810CA0606D50268936855
-:102AB000C16B23F480530B43936090F828108A066F
-:102AC00006D502689368016C23F400530B439360AE
-:102AD00090F828104A0610D502685368416C23F418
-:102AE00080130B435360416CB1F5801F05D15368CF
-:102AF000816C23F4C0030B43536090F828100A063E
-:102B000006D501684A68C06C22F4002202434A607C
-:102B10007047F8B5044604F17C050020E8606FF0CA
-:102B20007E4701F0A9F80646206801680A0708D523
-:102B30000097334600224FF40011204600F016F8AB
-:102B400060B9206801684A070AD500973346002219
-:102B50004FF48001204600F009F808B10320F2BDCF
-:102B600020206860A86000202870F2BD2DE9F041A7
-:102B7000069C05460E4690461F462868C1693140AE
-:102B8000B1420CBF0120002040451CD114F1010FBF
-:102B9000F3D001F071F8C01B844201D3002CECD1BA
-:102BA0002868016821F4D0710160286881684908AB
-:102BB0004900816005F17C00202141608160002195
-:102BC0000170032000E00020BDE8F08101680A6880
-:102BD00022F0C0020A6001688A6822F400028A605A
-:102BE0002021C0F88010704701680A6822F49072B2
-:102BF0000A60DFF83011026893680B40936020216F
-:102C0000C0F884100021C16670470000F369FFCF4F
-:102C1000003801408800005800800040FFF4FF1198
-:102C200000127A0000093D00AAB0280080841E002E
-:102C3000006A18005558140040420F0020A10700F8
-:102C400090D0030048E801000024F400816A006885
-:102C50000268930644BF084600F08FBB0020A1F82D
-:102C600056000868826822F0800282600868FFE7E8
-:102C7000016841F0400101607047806A01F002B8CC
-:102C8000F8B5846A04F1800504F1560728686E6877
-:102C900021688A68110606D5212804D100203880D1
-:102CA0002046FFF793FF20688168480606D5222E4C
-:102CB00004D1002038812046FFF796FFA86840F035
-:102CC0001000A8602046BDE8F24000F0A3BA806A78
-:102CD00000F1560100220A810A8000F09BBA000030
-:102CE0000000127A0000093D00AAB0280080841E6E
-:102CF00000006A18005558140040420F0020A10738
-:102D00000090D0030048E801000024F400551500AD
-:102D100000CC0C0000AA0A0000FD0F005461510015
-:102D200000D43000FEFFFFEF614981B00A68024322
-:102D30000A600968084008E05E4881B0016841F413
-:102D400000210160006800F400200090009801B0AC
-:102D5000704738B586B004466846142100F094FFE9
-:102D60002068554A554990422ED10868544D40F08C
-:102D700001000860096801F0010105910598012032
-:102D8000FFF7D2FF0C200090022100200191029059
-:102D900003210820039100F05AF8402000F050F879
-:102DA000082000F054F847482860112000F055F83A
-:102DB00008B101F0B8F86567AC6200220021252057
-:102DC00001F0CEF8252037E03F4A904236D14868DE
-:102DD0003E4D40F480404860486800F480400590D3
-:102DE00005980120FFF7A0FF0220FFF79DFF4FF499
-:102DF000006000F025F8072000F029F8C0200090BE
-:102E000002210120019102900321072003910490E7
-:102E100069462F4801F002F92E4828600F2000F083
-:102E20001CF808B101F07FF86567AC620022002150
-:102E3000242001F095F8242001F0AFF807B030BD50
-:102E400000900221002002900390019170470490AD
-:102E500069464FF0904001F0E1B868601020A8602A
-:102E60000020E8608020286100206861A861E86196
-:102E70002862284600F034B810B504461649206888
-:102E8000884213D101F0AEF901F0ACF913480168A2
-:102E900021F4407141F480710160026842F4004203
-:102EA00002602046BDE8104001F0B0B910BD00003E
-:102EB0004C00005850000058008000405C00005852
-:102EC000501500204400024000380140B015002099
-:102ED00000040048440402400028004090000058CC
-:102EE00038B5040001D1012032BD2168DFF8FC02B1
-:102EF000814204F1240500F042F8022068700A685B
-:102F0000A0686FF30E120243E06802432069024397
-:102F100060690243A0690243E0690243206A0243F8
-:102F20000A60204600F039F9A068B0F5804F04BF70
-:102F300000216160696A207900F014F838B1052831
-:102F400005D2204600F043F900F012F803E000201B
-:102F500028636863A8630020A861012068700020CE
-:102F6000287032BD0860A96AE86A486060687047E6
-:102F7000296B00200860696BA86B486070470AD213
-:102F8000DFF86C0242181423B2FBF3F292002A62BB
-:102F9000DFF8600209E0DFF8600242181423B2FB98
-:102FA000F3F292002A62DFF85402E8617047F8B544
-:102FB000044604F1240600253078012801D10220BE
-:102FC000F2BD01273770707801282FD10227777062
-:102FD000B561206807687F087F000760204600F021
-:102FE000C0F82168F06820B10A6842F00E020A6059
-:102FF00008E0086820F0040008602068016841F0DB
-:103000000A010160706A0168CA0303D5026842F4CC
-:1030100080720260306B18B1016841F48071016008
-:103020002068026842F00102026001E0357002256A
-:103030002846F2BD38B500F1240200245178022957
-:1030400003D004209061012428E001680B6823F07C
-:103050000E030B6001680D686D086D000D60516A0C
-:103060000B6823F480730B60012192F82030D5693E
-:1030700003F01C0399406960936AD16A5960116B2F
-:1030800031B10B6823F480730B60536B916B596003
-:10309000012151701470516901B18847204632BD39
-:1030A000F8B500F124010423CA69146802681568A0
-:1030B00091F8206006F01C0603FA06F73C4210D097
-:1030C0006F070ED51468A50603D4156825F004050E
-:1030D000156000F03DF8C968002938D0BDE8F4401B
-:1030E0000847022303FA06F73C4213D0AF0711D575
-:1030F0001468A50605D4156825F00A051560012297
-:103100004A7000F025F800220A708968F9B1BDE81C
-:10311000F4400847082303FA06F6344217D02B0779
-:1031200015D5136823F00E031360012291F82030A7
-:10313000CC6903F01C039A40626001228A614A70E4
-:1031400000220A70096911B1BDE8F4400847F1BDD9
-:1031500091F82020CC6902F01C0293406360704714
-:10316000000078B5C56C046D6C60446D14B1846D5D
-:10317000C56D6560012590F84440066C04F01C04A0
-:10318000A5407560046863608068102802D1A26061
-:10319000E16071BDA160E26071BD416C0268134BDA
-:1031A00089089A4234BF164B164B03EB81018164A8
-:1031B00002F0FF02083A1421B2FBF1F1124AC26494
-:1031C00001F01C01012202FA01F101657047017949
-:1031D0000E4A02EB81024265491E0D4A826501F0EA
-:1031E000030101228A40C2657047000008040240C2
-:1031F000F8FFFDBF00000240F8FBFDBF00040240E5
-:10320000000802401C08024080080240FC080240FE
-:10321000400902407047000010B500F17C010A78B7
-:10322000012A01D1022010BD01230B7024224A6023
-:10323000026813681468640864001460002242661F
-:1032400023F00053006803602020486000200870CD
-:1032500010BD70B500F01EF801D1022070BD00F065
-:103260001FF822F0604209E070B500F013F801D1B8
-:10327000022070BD00F014F822F0606211438160FA
-:10328000204600F01AF820680660202068600020C0
-:10329000287070BD044604F17C0528780128704729
-:1032A00001222A702420686020680668026852089B
-:1032B00052000260206882687047FFB50FF2540226
-:1032C0000FF25806D2E9003402A9C1E90034D6E968
-:1032D0000071CDE90071416E11B90121012213E0A5
-:1032E00001688A688968520E02F00702490F02AC31
-:1032F000655CA45C1DF801101DF80220ED00E400DF
-:1033000095FBF1F194FBF2F2683041800280FFBD41
-:10331000000000000101010307010000080402048D
-:10332000080101017047000063601D481D4B704794
-:1033300023601D481D4B704770B51C4600230025B7
-:103340001B4E10B1022804D00AE03460FFF7F1FFF1
-:1033500002E07460FFF7E9FF0360FEF7EBFD034650
-:10336000012B05D007D3032B04D038BF022502E080
-:10337000012500E00325284670BD82B00068094A97
-:103380000B49904206D0094A904207D1086828B1FB
-:1033900002B00047486808B102B0004702B0704769
-:1033A0003813002000800040C41300200038014082
-:1033B0005C170020704770474FF0B040006800F085
-:1033C000F000B02888BFB02070472DE9F04104001C
-:1033D00066D0207881064FF0B04537D5A868E968F7
-:1033E00010F00C0001F0030104D00C2808BF0129E3
-:1033F00040F081802868800702D5E06900284FD01E
-:10340000FFF7DAFF616A884207D2084600F0B9FB8D
-:10341000002819D100F056FA10E0286820F0F000DA
-:10342000014329606968206A21F47F4141EA002153
-:103430006960606A00F0A5FB002805D100F026FF56
-:10344000002000F06DFD002840F086812078C10743
-:1034500011D5A868E96800F00C00082801F0030104
-:1034600003D00C2808BF032967D12868800302D540
-:103470006068002814D0217888071AD5A868E96800
-:1034800000F00C00042801F0030104D00C2808BF50
-:10349000022940F087802868400503D5E0680028AD
-:1034A00000F05A816968206921F0FE4141EA00611B
-:1034B00069602168DFF8646711F0180F00F0768109
-:1034C0006069002800F0A880C906706840F1958006
-:1034D000800707D4706840F0010000F00CFA07463E
-:1034E0007068800700F13A8100F0C6FBC01B03281A
-:1034F000F6D30320DFE1E06978B1296841F00101EA
-:1035000000F0D2FA06462868800700F1368100F004
-:10351000B3FB801B0328F6D3EBE728684008400084
-:1035200000F0E3F90646286800F0C8F98ED000F0F4
-:10353000A3FB801B0328F6D3DBE76068B0F5803F70
-:1035400006D0B0F5A02F296807D141F48021296069
-:10355000286840F48030286006E021F4803129603A
-:103560002A6822F480222A60606860B100F084FB3F
-:103570000646286880033FF57EAF00F07DFB801B88
-:103580006528F6D3B5E700F077FB06462868400CBF
-:1035900010F001003FF46FAF00F06EFB801B652858
-:1035A000F4D3A6E7E06878B1296841F4807100F0AF
-:1035B0007BFA06462868400500F1E28000F05CFBDB
-:1035C000801B0328F6D394E7286820F4807000F06D
-:1035D0008CF906462868800A10F001003FF469AFB4
-:1035E00000F04AFB801B0328F4D382E700F044FB81
-:1035F000C01B0328C0F0D6807BE740F0010000F03C
-:103600007AF907467068800700F1E78000F034FB24
-:10361000C01B0328F6D36CE7706820F0040000F0AC
-:103620006AF907467068C00810F0010000F0E480F5
-:1036300000F022FBC01B0428F4D35AE705283068A9
-:1036400006D140F004003060316841F0010105E02E
-:10365000400840003060316821F004013160A0680A
-:1036600041F2893768B100F007FB80463068800777
-:1036700000F1D78000F000FBA0EB0800B842F5D3C2
-:1036800037E700F0F9FA8046306800F017F900F0EB
-:10369000C88000F0F1FAA0EB0800B842F4D328E7A4
-:1036A00000F0EAFAC01B0328C0F0C98021E7B06827
-:1036B00040084000B06000F0DFFA0746B06800F054
-:1036C000FDF800F0C08000F0D7FAC01B0328F5D346
-:1036D0000FE700F0D1FA801B0328C0F0C68008E78E
-:1036E00000F0CAFA001B0328C0F0E08001E7E96897
-:1036F000DFF82C0589088900E960E9680140E96084
-:1037000000F0BAFA044600F0EBF823D000F0B4FA67
-:10371000001B0328F7D3ECE6E868226B00F00301F6
-:10372000914202BF00F07001626B914214D1A26B12
-:10373000C0F30621914202BF00F47811E26B91427E
-:103740000AD1226C00F06061914202BF00F060403B
-:10375000616C884200F0AE800120ACE0706840F0FF
-:10376000040000F0C8F807467068000710D400F0A5
-:1037700083FAC01B0428F7D3BBE600F0A3F865E684
-:103780006868216920F0FE4040EA0160686090E6C8
-:103790007068A16920F4706040EA0120706000F058
-:1037A000A7F8074600F089F87FF420AF207841079A
-:1037B00037D5DFF870743868C10529D400F012FDE0
-:1037C00000F05AFA80463868C10521D400F054FA56
-:1037D000A0EB08000328F6D38BE6706820F0040005
-:1037E00070607068C00810F00100DFD000F044FA8B
-:1037F000C01B0428F5D37CE600F07AF8074600F0F9
-:103800005CF8D3D000F038FAC01B0328F7D370E679
-:10381000A06801287FF412AF306840F001003060EA
-:103820001DE7217848060ED5A06A00283FF43FAF77
-:10383000B16841F00101B16000F01EFA0746B068BE
-:1038400080077FF52DAFE06AA0B3A96801F00C01F5
-:103850000C293FF461AF0228286820F080702860AE
-:103860007FF445AF00F008FA064600F039F87FF41F
-:1038700030AFE968DFF8B003A26B0140206B014371
-:10388000606B0143E06B41EA02210143206C01437C
-:10389000606C0143E960286840F080702860E96846
-:1038A00041F08051E96000F0E7F9044628688001A2
-:1038B0007FF516AF0020BDE8F0817068400810F079
-:1038C000010070472968606A21F0F0010143296016
-:1038D0006868216A20F47F4040EA012068607047F0
-:1038E0002868400E10F001007047286000F0C4B94D
-:1038F000706840084000706000F0BEB92DE9F843E0
-:103900000400884644D0DFF8246300F0C8F847D2AA
-:1039100000F0CDF8074600F0C2F841D000F0ACF955
-:10392000C01B0228F7D90320B7E000F0A5F9401B1F
-:10393000022843D9F7E700F09FF9A0EB090002281D
-:103940004CD9F0E700F098F9A0EB0900022854D90F
-:10395000E9E700F091F9401B02285DD9E3E700F0A8
-:103960008BF9401B022867D9DDE700F085F9401B81
-:10397000484577D3D7E7032802D13968890103E0A6
-:103980000028396802D1890762D401E049055FD473
-:10399000012082E000F070F9C01B022872D9C2E752
-:1039A000207881074FF0B0470BD5B968A06821F0A7
-:1039B000F0010143B96000F05FF90546B868C00343
-:1039C000B3D52078DFF8505281060AD5296860699E
-:1039D00021F0F001014300F067F881462868800378
-:1039E000A9D5207841060BD52968A06909090901E4
-:1039F00041EA101100F058F881462868C003A1D5AB
-:103A0000207841070BD5B968E06821F4E0610143F3
-:103A1000B96000F031F90546B868800399D520787F
-:103A200001070CD5B868216920F4605040EAC10054
-:103A3000B86000F021F90546B86840038FD52078BA
-:103A4000C10717D56068022895D1396889039FD5C9
-:103A5000B968890840EA8100B86041F2893900F00C
-:103A60000BF90546B868616800F00C00B0EB810FF7
-:103A70007FF47BAF306800F00700804505D200F08E
-:103A800016F8074600F00BF884D100F0FFFB00F0B9
-:103A90009FFCBDE8F24300F043BABDE8F283306812
-:103AA00000F0070040457047296000F0E5B8316834
-:103AB000C90848EAC101316000F0DEB838B54FF0FE
-:103AC000B0445C4DA16811F00C0106D1FFF774FC05
-:103AD000C0F3031055F8200032BD0429564A05D022
-:103AE0000829564804D12168C90222D5104632BDA2
-:103AF000E16801F00301022904D0032904D12168FF
-:103B0000C90207D5104605E0FFF756FCC0F30310C5
-:103B100055F82000E168E268E368C1F306214843F4
-:103B2000C2F30211491C5B0FB0FBF1F05B1CB0FB50
-:103B3000F3F032BD80B5FFF7C1FF3D49FFE7404AD2
-:103B40000968C1F3031152F82110B0FBF1F002BD76
-:103B500080B5FFF7EFFF00F010F8C1F3022106E097
-:103B600080B5FFF7E7FF00F008F8C1F3C22112F8B3
-:103B7000211001F01F01C84002BD2D49314A0968DA
-:103B8000704770B52B49B1282EBFCC6AC0F3031023
-:103B900051F820402048056800F02AFC28492A4AAC
-:103BA00005F00F0551F82510B4FBF1F10024B1FB2D
-:103BB000F2F1B0F5007F0FF2B002204609D10FF20A
-:103BC0008C0353F820508D4214D2401C0328F8D99E
-:103BD00012E00FF2880353F820508D420AD2401CA5
-:103BE0000328F8D308E000F047F8801B03280BD324
-:103BF000032070BD52F820400C4D2868C00844EAEC
-:103C0000C000FFF772FE0646296801F00701A142D5
-:103C1000E9D1002070BD0000080100589000005854
-:103C2000FFFFFEEE000400588C80C11100400058D8
-:103C300008000058684300080024F4000048E80128
-:103C400028430008887E000840420F001200000050
-:103C500024000000360000004000000006000000C4
-:103C60000C00000010000000000000000100000037
-:103C7000020000000400000001480068704700BF17
-:103C80007410002070470000002200F0B9BB000053
-:103C9000964900E0964981B00A6802430A600968C3
-:103CA00008400090009801B0704710B500F07CFB10
-:103CB000904C606840010ED56068C0000BD400F0E5
-:103CC00091FA00F08FFA206840F48030206021687B
-:103CD00021F48031216000F0E8F8002000F0AAFB18
-:103CE00040B180798449E160E16821F47C5141EA86
-:103CF0000021E16000F044F800F0B9F87F48804C02
-:103D0000016800220260026902F050020261012093
-:103D1000FFF7C0FF0220FFF7BDFF0420FFF7B8FF49
-:103D20000120FFF7B5FF0220FFF7B2FF00220F21AD
-:103D30000E2000F015F90E2000F02FF900220F21BF
-:103D40003A2000F00DF93A2000F027F900216D48E3
-:103D500041600F218160046047F6FF71C16000215E
-:103D600001618161C16100F077FBA068C008C000FB
-:103D7000A06000F015FC4FF0FF3000F0A3FCFAE764
-:103D800080B5AEB01CA84821FFF77EFF01A81C211A
-:103D9000FFF77AFF08A85021FFF776FF5A4801681D
-:103DA00021F4C06141F4007101600B21006800F44E
-:103DB000C06000904FF4803200981C914FF48070E6
-:103DC0001F90402120910520219000211D922791D4
-:103DD0001CA8FFF7FAFA6F2001900221002002913F
-:103DE00003900490059006900790012101A8FFF729
-:103DF00085FD43F60300089000210E910F914FF4CA
-:103E000000404FF4007119901891002002211B907E
-:103E10001A9108A800F040FD2FB000BD10B53B4C32
-:103E20003B4800F017F84FF40040E06100202062AA
-:103E30006062A0622046FEF73DF800212046FFF7B1
-:103E400008FA00212046FFF70FFA2046BDE810408F
-:103E5000FFF7E2B920604FF4E13060600020A0601D
-:103E6000E06020610C2060610020A061704729485B
-:103E7000816841F00101816081688907FCD5C168D2
-:103E800021F4404141F48041C160C16849084900C2
-:103E9000C160016941F00101016101698907FCD537
-:103EA000016821F04061016070471B4881B00168E2
-:103EB00041F4801101603F21006800F480100090FF
-:103EC0000098164841604161016841F47C1101602D
-:103ED000026942F47C120261016841F03F01016015
-:103EE000026942F03F02026101B070474800005889
-:103EF0004C00005890000058FECAFECA80080058C6
-:103F000000280040DC16002000040058C4130020E4
-:103F1000003801408800005850000058040C005838
-:103F200000207047704770470901020081B002D439
-:103F30003248815405E0324802F00F02104400F884
-:103F4000041C01B070472F4A13684FF6FF010002AE
-:103F50000B4000F4E06018432B49084310607047A1
-:103F600038B5284B1C68C4F30223C3F10704052CA1
-:103F700028BF04241D1D072D34BF0023DB1E01258F
-:103F800005FA04F4641E2140994005FA03F35B1E10
-:103F90001A401143BDE83440C6E7010007D40122AE
-:103FA00000F01F01194B8A40400943F82020704758
-:103FB00001000BD4012200F01F01154B8A4040097B
-:103FC00043F82020BFF34F8FBFF36F8F704701007E
-:103FD00007D4012200F01F010E4B8A40400943F82C
-:103FE00020207047010007D4012200F01F010A4B76
-:103FF0008A40400943F820207047000000E400E0B8
-:1040000018ED00E00CED00E00000FA0500E100E032
-:1040100080E100E000E200E080E200E02DE9F84FFE
-:104020004FF0000C674A684BDFF8A0814FF00F0992
-:1040300082460F4633E0664DAA4514BF0725042586
-:104040008D40254348F82E50C1431C6801EA040EF8
-:104050007C68E50348BF40EA0E0EC3F800E05C68E8
-:1040600001EA040E7C68A50348BF40EA0E0EC3F8BF
-:1040700004E0146801EA040E7C68E50248BF40EAE7
-:104080000E0EC2F800E0546801EA040E79688C0252
-:1040900048BF40EA0E0EC2F804E00CF1010C39688A
-:1040A00031FA0CF000F07C80012000FA0CFE1EEAD0
-:1040B0000100F2D07C68022C18BF122C4FEA8C0150
-:1040C00010D14FEADC040AEB840401F01C05266AD7
-:1040D00009FA05FB26EA0B06D7F810B00BFA05F52E
-:1040E000354325624FEA4C040325DAF8006097F85F
-:1040F00004B0A540ED430BF0030B2E400BFA04FB7C
-:104100004BEA0606CAF800607E68012E18BF022E30
-:1041100003D0112E18BF122E17D1DAF80860D7F885
-:104120000CB02E400BFA04FB4BEA0606CAF80860F6
-:10413000DAF8046026EA0E0E7E68C6F3001606FA68
-:104140000CF646EA0E06CAF80460DAF80C60354050
-:10415000BE6806FA04F42C43CAF80C407C68E400FC
-:104160009BD54FEA9C0E58F82E5001F00C0109FA2D
-:1041700001F425EA0404BAF1904F08BF00250ED0DF
-:10418000144DAA4508BF012509D0134DAA4508BF03
-:10419000022504D0114DAA457FF44DAF03254FE70A
-:1041A000BDE8F18F81B0002A14BF8161816201B046
-:1041B00070470B4A136803421CBF106000F074BACA
-:1041C00070470000000800588008005808000140AF
-:1041D000001000480004004800080048000C004897
-:1041E0000C0800580248016841F480710160704772
-:1041F000000400588A60FF2102685162012180F8A2
-:104200002110002180F820100020704790F8201025
-:10421000012901D102207047012280F820200221CB
-:1042200080F82110CA210268516253210368596243
-:1042300001688A6842F02002FFF7DCBF32490020A3
-:1042400008604FF4E0223148016841F470010160D8
-:104250004FF0B041086840F0010008608A602C48C7
-:104260000A6802402B480A60036823F005030360D4
-:10427000426852085200426000222748C860086124
-:10428000086820F4802008608A6170474FF0B041D0
-:104290000FF2D4000A68C2F3031250F822008A68B1
-:1042A00002F00C02042A04D0082A04D00C2A04D0FC
-:1042B0001CE01A481AE01A4818E0CA68CB68C3F331
-:1042C000021302F003025B1C022A08BF134802D04B
-:1042D000032A08BF1248B0FBF3F2C868CB68C0F3EA
-:1042E00006205B0F42435B1CB2FBF3F00D4A0FF25A
-:1042F0003803106088681168C0F3031053F8200079
-:10430000B1FBF0F01060704708ED00E088ED00E0D0
-:10431000FBFEF6FA94000058001004220024F4007A
-:104320000048E80198100020010000000300000090
-:104330000500000001000000010000000600000070
-:104340000A0000002000000002000000040000003D
-:104350000800000010000000400000008000000085
-:104360000001000000020000A0860100400D0300D3
-:10437000801A060000350C0040420F0080841E00A9
-:1043800000093D0000127A000024F40000366E019E
-:104390000048E801006CDC020000000000000000A2
-:1043A00000000000000000000E4810B5016841F454
-:1043B000807101600320FFF7C6FD0020FFF7B0FD0C
-:1043C0000024002814BF0124FEF7B6FC204610BDCF
-:1043D0000548406870470548FFE7016841F0010162
-:1043E000016070470040005874100020042004E071
-:1043F000DFF80800006800F4C0607047000400584F
-:1044000000B500BF130096469446103928BFA0E8B7
-:104410000C50FAD85FEA417C28BF0CC048BF40F876
-:10442000042BC90728BF20F8022B48BF00F8012B36
-:1044300000BD000001460648064AC3798B4218BFFA
-:10444000904218BF0838F8D18B4218BF002070473F
-:10445000F873FF1F0070FF1F38B5040044D094F8B4
-:10446000210028B9002184F820102046FEF704FD21
-:1044700000F049F8FF2510B100F03FF834E0216862
-:10448000DFF8B0008A6802408A6021688A68636841
-:1044900020690343A06903431A438A602168E068E6
-:1044A000086120680169A26841EA0241016120684F
-:1044B000C16821F08001C1602068C16C8908890051
-:1044C000C1642168CA6CE369606903431A43CA6422
-:1044D00020688168880609D400F020F830B120688F
-:1044E0004562042100F01FF8012032BD20684562BA
-:1044F000012184F82110002032BD2068456204218A
-:1045000084F821107047022084F82100CA20216815
-:104510004862532022685062204626E020460BE085
-:104520002068C0F8248084F82110002084F820003E
-:1045300070470000BFFF8FFF70B5044640F2E936B8
-:104540002068C16821F0A001C160FFF795FB054616
-:104550002068C168880606D4FFF78EFB401BB04276
-:10456000F6D3032070BD002070BD70B504462068EE
-:10457000C1684A0612D44FF0FF32C26040F2E936F9
-:10458000FFF77AFB05462068C168480606D4FFF7A6
-:1045900073FB401BB042F6D3032070BD002070BDFA
-:1045A00010B52A482A4C88B0016841F400410160E6
-:1045B00000F0D6FA2749002000F063FCFFF70BFF5C
-:1045C0002548016841F480310160026C42F4803278
-:1045D000026400F0B0FD0121012000F0C6FA0020C5
-:1045E00000F0F3FD012000F0F0FD022000F0EDFDF1
-:1045F000012000F012FE0121002000F022FE012126
-:10460000012000F01EFE00F073FE144A0021082075
-:1046100000F0BBF804F23C500FF24501009001910C
-:1046200069460FF2410000F04FFF04F2547002900F
-:1046300004F5C96140F23C5005900391049402A82E
-:1046400000F0D9FE00F052FE08B010BD080000587E
-:1046500020000320DC160020900800580B550008AD
-:104660007047000080B500F0FEFE00F0C7FFBDE817
-:1046700004400021012000F078BA70474FF0FF306D
-:1046800000F020B80021082000F08CB8022000F0D3
-:10469000ABB8022000F0B0B8FFF7C0BB13460A4623
-:1046A00001460020FEF748BE012805D0022805D0AB
-:1046B000102805D101F0D8B801F0D8B801F00DB933
-:1046C000704700002DE9FC47554CDFF85891A5696B
-:1046D0002840A0614FF0010A4FF0FF3830E0491C3C
-:1046E00054F831000642FAD004EBC107184079684B
-:1046F0001040014208BFC7F804807E68304000F0D7
-:1047000093F860620AFA00F086437E60EFF310814E
-:1047100072B6626A20690AFA02F2D243104020613E
-:10472000022004EBC00353F8086C1640401E43F807
-:10473000086CF6D181F31088606A59F82010884718
-:1047400063692069A2691840104207D0E069216AB4
-:10475000084203D1002103EA0206C1E701F010FD7F
-:10476000EFF3108972B6216960690140A0690142C6
-:1047700001BFE169206A0142FFF77FFF89F31088DA
-:1047800001F0FFFCA561BDE8F38738B51446EFF3EF
-:10479000108572B600F048F8224941F8204085F3B0
-:1047A000108831BD10B5EFF3108272B61C4B1C6936
-:1047B00004431C6153F83140204343F8310082F335
-:1047C000108810BDEFF3108172B6154A536923EAC1
-:1047D000000005E0EFF3108172B6114A53691843E7
-:1047E000506181F310887047EFF3108172B60C4A64
-:1047F000D3691843D061F4E770B5094C656A266A3D
-:104800002062012101FA05F502E02846FFF736FF94
-:10481000216AE0690842F8D088432662E06170BDF1
-:104820004C1000205014002002460020110C0904F6
-:1048300004BF1020120412F07F4F04BF0830120290
-:104840000FF2180112F0704F04BF001D1201120F79
-:10485000C0F11F00895C401A704700000403020287
-:10486000010101010000000000000000DFF8EC126F
-:104870000A68030903F47F2300019A4300F47F20B0
-:1048800000F068B9DFF8D4221368010C23EA014371
-:1048900043EA0043136070472DE9F84305460026BC
-:1048A0002878DFF8B8724106B0464FF0B0442DD5F5
-:1048B000286B70B1B0F5800F06D0B0F5000F18BFAF
-:1048C000B0F5400F17D01FE0E06840F48030E060A2
-:1048D000C5E0206820F080602060FFF7CDF98146B8
-:1048E0002068000140F1A880FFF7C6F9A0EB09009D
-:1048F0000228F5D90326AFE0FFF7BEF9A0EB0900C7
-:10490000022840F2A180F5E70126B046286801059B
-:1049100031D5B86800F44078286C80452AD0FFF77C
-:1049200061FCB8F1000FB96805D1286C21F4407121
-:104930000143B9601EE0B86840F48030B86021F4EB
-:104940004071B86820F48030B860286C0143B960C9
-:10495000B868C0070ED5FFF78FF9804641F2893954
-:10496000B868800706D4FFF787F9A0EB0800484530
-:10497000F6D30326B0462878C10705D53968A8695B
-:10498000890840EA810139602878810705D53968AE
-:10499000E86921F44061014339602878C10644BFC9
-:1049A000A86AFFF76FFF2878810644BFE86AFFF71F
-:1049B00069FF2878410744BF286AFFF757FF287826
-:1049C000010744BF686AFFF751FF2868C1055CD53D
-:1049D0003968686B21F0406101433960686BB0F160
-:1049E000006F03D1E16841F08071E160686BB0F164
-:1049F000806F4AD100F0A0F806462068000135D546
-:104A0000FFF73AF9801B0228F7D94FF003083CE082
-:104A1000FFF732F9801B022830D9F6E7FFF72CF9AF
-:104A2000801B022852D94FF0030861E0FFF724F9F8
-:104A3000801B022855D9F6E700F075F8A86821F424
-:104A4000781100F07FF88146206800017FF554AFAF
-:104A5000216968690143216130007FF456AF3968EC
-:104A6000286B21F44001014339604FE700F05BF807
-:104A7000E86821F0606100F065F8064620680001F2
-:104A8000C6D521696869014321612868810505D57A
-:104A90003968A86B21F0404101433960286841051D
-:104AA00026D53968E86B21F0405101433960E86B45
-:104AB000B0F1005F03D1E16841F48031E160E86B5F
-:104AC000B0F1805F14D100F037F80646206800018D
-:104AD000A4D400F028F8286921F0604100F032F8F1
-:104AE000064620680001A1D521696869014321615A
-:104AF0002868C10405D5F968686C21F44041014378
-:104B0000F960286881040BD5616AE86C21F03001F6
-:104B100001436162616AA86C890840EA81016162AF
-:104B20004046BDE8F2832069696820F4FE4040EA0F
-:104B30000120206121697047216821F08061216096
-:104B4000FFF79AB801432161206840F0806020603F
-:104B5000FFF792B8104308607047000088000058C3
-:104B60000C48002101604160704710B500F00CF85E
-:104B70005C6819B1012904D1204301E024EA000056
-:104B8000586082F3108810BDEFF3108272B6014BAB
-:104B90007047000064170020DFF83C150A6892B2E5
-:104BA00000E00246086880B28242FAD170472DE9DF
-:104BB000FC4104461825DFF82485DFF824656843A6
-:104BC00008EB00073078062808D13178717034700E
-:104BD00078754FF0FF307060002039E000F077F812
-:104BE000B9680918B96008F10803B96832786A43EE
-:104BF0009A589142327813D308F1150315FB02FC41
-:104C000013F80C30062B25D008F108066B43F35837
-:104C1000994222BF08F115036A439A5CEED219E06B
-:104C20001146337869439A420BD008F1140308F116
-:104C3000150C5B5C15FB03F50CF805407A753B75AC
-:104C400000E07A7508F114025454317871703470B0
-:104C5000BDE8F6811146694308F115035B5C062B3C
-:104C600004D008F1140615FB03F574557B753A75ED
-:104C700008F115025454EBE7F8B5DFF86434DFF8B7
-:104C80005C541E78182402466243B0422A4404D180
-:104C900018785870507D18700FE0167D507D92F88E
-:104CA00015C005F115076643062807F806C004D0AD
-:104CB000167D143514FB00F42E550120107318785E
-:104CC000062802BF00294FF0FF315960F1BD10B531
-:104CD000DFF80C44606810F1010F0FD0FFF75CFFA4
-:104CE0006168DFF80024814261683CBF5388C918BD
-:104CF000081A517848431178C84000E0002080B27B
-:104D000010BD2DE9F84FDFF8DC53DFF8DCB3D5F840
-:104D10000880D8F80000DBF800104A0500F090F990
-:104D2000DFF8BC63DFF8B4A321F4806181604FF049
-:104D3000180934780AF1080019FB04F14758FFF705
-:104D4000C6FF874217D200270121B170062C3DD043
-:104D500019FB04F40AF108010AF108020959814219
-:104D600023BF0AF108010959091A002111510AEB60
-:104D700004014C7DEAE7A9884118B94202D2AF8804
-:104D80000021E2E73F1ADFE7022802DA287801284B
-:104D900000D07F1ED8F80000C1684A07FAD500F09D
-:104DA00055F9DBF80C00000CBFB247EA0047CBF81E
-:104DB0000C70FFF7F1FE7060A8680068816841F42C
-:104DC00080618160AFF30080BDE8F18FB8B2002848
-:104DD000DAD1FFF7E1FE70600320BDE8F24FFFF784
-:104DE000F6B82DE9F843EFF3108872B6BD4DBB4B12
-:104DF000A8680168CA224A6253204862B84A886893
-:104E000020F48060886018201678374647431F4496
-:104E1000387B022826D13C68D7F810909078F0B102
-:104E20007A7B012A0AD101213046FFF725FF88F35A
-:104E300010887968304600F016F904E088F310888D
-:104E4000304600F0C1F8A8680068CA2141622246D5
-:104E5000532141624846314600F050F90BE0FFF71C
-:104E600050FF06E0C8684207FCD500F07EF89F4975
-:104E7000086088F31088FF21A86802685162BDE8C5
-:104E8000F183F8B5974CA160CA2209684A6253229F
-:104E90004A62954A136843F020031360136803F0D5
-:104EA0000703C3F10403237095682D0C05F07F05FB
-:104EB0006D1C6570EDB29268C2F30E02521C6280E6
-:104EC00092B2521E6A43A2F5A072DA404FF6FF7307
-:104ED0009A422CBFA380A280854A136843F4002322
-:104EE0001360844B1D6845F400251D6048BB7C4859
-:104EF0007A4E0123837018254FF0FF33436000235F
-:104F00005FFA83FC06F10C0715FB0CFC4FF0000E5A
-:104F100007F80CE05B1CDFB2062FF1DB0623037001
-:104F2000886820F48060886000F01FF8D06003205B
-:104F3000FFF758F8A1680868826842F480428260EE
-:104F400005E0C868410544BF0320FFF740F8A168A9
-:104F50000A68FF205062002203210320FFF700F8B7
-:104F6000BDE8F2400320FFF718B8C86800F08000E1
-:104F700060F49060C8604FF400207047F0B50446BC
-:104F80000025EFF3108672B61827DFF850C10CF138
-:104F90000C0007FB05FE10F80E0010B16D1C062D6D
-:104FA000F5DB062D0CD06F430CEB070001270773D0
-:104FB00086F310880461427303600D700020F0BD19
-:104FC00086F310880120F0BDF8B50746EFF3108492
-:104FD00072B60320FEF7ECFF424DAE683068CA217E
-:104FE00041623A4653214162182043494243895C59
-:104FF00002291BD100213846FFF73EFE38480178D0
-:1050000006290ED1306838490A68530500F018F8AF
-:1050100021F480618160C1684A07FCD500F016F870
-:1050200004E04078884218BFFFF76BFEA9680A6861
-:10503000FF2050620320FEF7B0FF84F31088F1BD1B
-:1050400002D5C1684A07FCD481687047C16801F085
-:10505000800161F49061C1604FF400202349086031
-:105060000320FEF7BFBF2DE9F04180460F464246C0
-:1050700018201A4942438C18207B022804BF40465E
-:10508000FFF7A2FFEFF3108572B60320FEF790FF43
-:10509000144EB0680068CA21416253214162022067
-:1050A0002073A76067604046FFF781FD0C490A78CE
-:1050B0004978914202D0FFF724FE02E0A168081A65
-:1050C000A060FF20B1680A6850620320FEF765FF08
-:1050D00085F31088BDE8F08128280040A812002040
-:1050E0009C17002044170020082800400C08005896
-:1050F0000008005880080058B41200201047000033
-:1051000038B5EFF3108472B6284D6946281D01F0BA
-:1051100052F96946281D01F0ABF938B184F31088C3
-:10512000BDF80010224AFFF7B9FA31BD01202870FE
-:1051300084F3108831BD80B5FFF7AEFA02210091EB
-:1051400000231A4800F124014FF48052001D01F0A1
-:1051500019F801BD00BFF8B514460026EFF310851D
-:1051600010F1010F1ED001281CBF02284FF0FF369E
-:1051700018D1BCB1264672B60C4F012392B2381D2D
-:1051800001F014F800281CBF3978002908D000224B
-:105190003A7085F31088A1B2054AFFF77FFA01E063
-:1051A00085F310883046F2BD000000002800002082
-:1051B00001510008444981B00A6802430A60096845
-:1051C00008400090009801B0704778B585B004465B
-:1051D00068461421FEF758FD0220FFF7EBFF00F0B0
-:1051E00010F8009501200190002102200390029107
-:1051F000694656F82400FEF711FF00F008F806B0E3
-:1052000070BD0FF2D400314E30F81450704756F88C
-:10521000240000222946FEF7C5BF0FF2BC012B4B2C
-:1052200031F8101053F820000122FEF7BBBF0FF237
-:10523000A801264B31F8101053F820000022FEF789
-:10524000B1BFF0B585B005460C4668461421FEF79F
-:105250001BFD0DB9042004E0012D18BF022D02D161
-:105260000820FFF7A7FF2000194E0FF274070DD199
-:1052700037F81500009000210191012002900221D1
-:10528000039100F01BF80120FEF74CFE012C13D116
-:1052900037F81500009001210E480190029100F0AE
-:1052A0000DF80FF24400445D00220F2160B2FEF7BA
-:1052B00057FE60B2FEF771FE05B0F0BD694656F8C4
-:1052C0002500FEF7ABBE00004C0000588010002007
-:1052D0008C100020000021102000010002000000BE
-:1052E00010000100020000000A06070001F07EB96C
-:1052F0006B486C49016001F12002426001F130020B
-:10530000826001F13C02C26001F14402026101F1DC
-:105310006002426101F1640282617031C16101F099
-:105320006DB938B50446604D05F1100001F0CAF9B9
-:105330005B494868A1680160E168C160456005F1AA
-:105340001001816001F076F958482DE080B554498C
-:105350004A6813680120187201F072F9002002BD3A
-:1053600038B5524C504D07E0694605F1100001F088
-:10537000D5F900982168884705F1100001F0A5F9DA
-:105380000028F1D031BD49484168084738B5044686
-:10539000474D284601F096F94148C068A168016070
-:1053A000456001F052F9434821680160616841603D
-:1053B000002032BD80B53A49CA68136810201872BF
-:1053C00001F049F9002002BD3549CA683949106821
-:1053D0000B68184738B5374C354D06E06946284606
-:1053E00001F09CF9009861688847284601F06DF942
-:1053F0000028F3D031BD38B504462F4D284601F0C2
-:1054000061F92E4801F05EF925480069A1688160C4
-:10541000E168C160056121680160616841602169DE
-:1054200041616169816131BD80B50146234801F068
-:105430005FF9BDE802400FF2090001F01CB900005D
-:1054400038B5174C1D4D08E06946284601F066F94D
-:1054500000992069006901F04BF9284601F035F9FF
-:105460000028F1D031BD10B5154C204601F02AF9C5
-:105470000B4841690C60BDE8104001F010B91CB543
-:105480000F4C06E06946204601F048F9009800F00C
-:1054900019F8204601F019F90028F3D013BD0000D7
-:1054A00000000320AC0903208008032074170020AB
-:1054B000980803207C170020240A03206C17002082
-:1054C0002C0A0320704700007FB50C46484D6168E8
-:1054D000484EE8612962284601F032F92468746078
-:1054E00006F1080001F0EEF8012000F05DF801205F
-:1054F0003070296841B10FF2D5000FF2D902009047
-:1055000001920294684688477FBD3EB5384C394DBC
-:1055100002E00098FFF788FF05F1080001F0D5F8D8
-:10552000D8B92878002818D0694605F1080001F09C
-:10553000F5F801202870E1690029EAD0009802906E
-:1055400001A888479DF8040028700028E1D100993F
-:1055500005F1080001F0C2F8DEE737BD2DE9F041A2
-:1055600005460E4690461C46002000F01DF8214FCF
-:105570007868A0F80950C672324641460C30FBF7F5
-:10558000ABFE1B4A136900210020984748F2E8004F
-:10559000FFF77FF879688A78D21C04F10800FBF7DE
-:1055A0009BFEBDE8F04101201CB51149124C096A6F
-:1055B00020B901B188470020207013BD0120207060
-:1055C00011B1BDE81C40084713BD00000020FFF7E3
-:1055D0005DB8000010B50146064C04F1080001F06A
-:1055E00087F804F10800BDE81040FFF74BB8000051
-:1055F00000170020341700205917002038B58EB04E
-:1056000002A80FF64C31DFF830453022FBF774FE6C
-:105610000FF289500190009469460FF26950DFF84B
-:105620001C4501F097F801210220FFF79EFADFF8F0
-:10563000102500210420FFF7A8F802A801F06AF95C
-:1056400000F04CF901F06EF9002084F8900004F1AC
-:1056500026054FF6FF70288000210FF2A14201209D
-:10566000FFF793F8062001F0E8F9DFF8D8040021ED
-:1056700001700121417001F076FA0FF2E54300223A
-:1056800004F191010020FFF779FC0FF2DD430022C5
-:1056900004F192010020FFF771FC00206880802156
-:1056A000DFF8A4040180A0214180012000F0BDF9B1
-:1056B0000FB030BDF8B50746DFF880447878DFF8E2
-:1056C0008C54052804F1900604D03E2812D0FF28FF
-:1056D0005FD0C7E0B888E18C884206D10020E08422
-:1056E00030700FF2CC4001F049FB012000F09DF931
-:1056F000012047E0F87801282BD0032802D00C289D
-:1057000003D0AFE00FF2D040A2E00FF2F84001F07A
-:1057100035FB387900280CBF0FF204500FF22850E7
-:1057200001F02CFBE08C6A460DF1010101F064FBF5
-:1057300060B90FF23C5001F021FB9DF800209DF86C
-:1057400001100FF2405001F019FB8BE00FF25050A6
-:105750007EE07078FFF738FCB7F805100FF25C5068
-:1057600001F00CFB307804280CBF062005203070B7
-:105770000021B7F80500E08468802970284601F010
-:10578000ECF900202870E08C6880284601F0E5F9EB
-:1057900068E0B7F80300001F5DD04FF47F71401A36
-:1057A00014D0401E45D0401E13D0401E18D0401EBD
-:1057B00019D0401E1AD0401E22D0401E46D0401E96
-:1057C0001ED0401E22D0401E1DD04BE00FF22050B4
-:1057D0003EE00FF2485001F0D1FA0FF2685037E086
-:1057E0000FF2805034E00FF2A85031E00FF2D050A9
-:1057F00001F0C4FAE08C01F07CFC0FF2E45027E0E9
-:105800000FF2F85024E00FF2186021E0D7F80710EB
-:105810000FF2386001F0B2FAD7F807100FF24060CB
-:1058200001F0ACFAE08C012101F0B1FC0FF2406014
-:105830000EE0F9790FF2786001F0A0FAF87900280B
-:1058400014BF0FF2D8600FF2C06001E00FF2E06009
-:1058500001F094FA06E00120FFF7DFFCB0780A219E
-:10586000FFF701FC0120F2BD01F097B91CB5B34C64
-:1058700094F89000012818BF00282DD0B148417835
-:10588000012929D1002201784270491C01EBD17213
-:105890005210A1EB42010170F7EE040A017800EB0F
-:1058A00081004FF4FA7190ED010AE08C0091C0EE96
-:1058B000200AFDEEE00A10EE902A92B20023114673
-:1058C00001F07FFCBDE8164000280CBF0FF2F87015
-:1058D0000FF6240001F052BA13BD704778B589B0B5
-:1058E0000020ADF81A0001F05DFA994D994E286834
-:1058F00010F1010F0ED069683074090A020A000C19
-:10590000B074727406F1100468683175F074090A95
-:10591000717506E00020FEF78DFD040008BF0FF64C
-:10592000000422460621002001F052F8607930720E
-:1059300007AA207970720621E078B072A078F07220
-:105940006078307320787D4C70734EF66E500890FE
-:10595000286807902E2001F03BF80FF2CC7210213E
-:10596000182001F035F80FF2D0721021082001F054
-:105970002FF81821012001F052F801F055FC0DF12B
-:10598000160006A90190009105AB07220021012015
-:1059900001F03CFB0FF2C050BDF818100090072337
-:1059A000BDF81400002201F0FFFC0DF11A00009078
-:1059B0000223BDF81610BDF81400002201F0F4FC1B
-:1059C00002220221002001F04AFA0020207001F09A
-:1059D000D1FA012060700020E0700820607510206E
-:1059E000A075012020755C48A0610120A0700020F6
-:1059F000C1B221440871401CC1B21029F8DB00205B
-:105A000004900023A069617803900022207D029019
-:105A1000A07D0190607D0090A07801F0C4FAA0788C
-:105A200008B101F04BFB0AB070BD2DE9F841044606
-:105A3000012C87B003D144480588478803E04FF420
-:105A4000C8654FF47A67DFF8F48008F19006707843
-:105A5000FFF7BAFA31780FF2085001F08FF9022CF3
-:105A600011D13078012818BF02280CD101F027FA93
-:105A7000010004D10FF2045001F080F903E00FF2AD
-:105A8000205001F07BF9347000200690059008F159
-:105A900029010491082298F828000FF2AC610390C4
-:105AA00002910192002300933A462946002001F01A
-:105AB00018FA28490E2001F0D9FA010013D1012C5F
-:105AC0000AD10FF2045001F059F97078234908B057
-:105AD000BDE8F041FFF7C7BA08B0BDE8F0410FF2EA
-:105AE000105001F04BB908B0012CBDE8F0410CBFDB
-:105AF0000FF228500FF2545001F040B910B50120B8
-:105B0000FFF795FB0D4C94F89000052812D001F09A
-:105B1000D6F9002184F8901030B90FF2645001F0EA
-:105B20002DF90FF2645001E00FF27850BDE81040FB
-:105B300001F024B910BD0000A008032014120020B9
-:105B4000936700081C000020B4170020A417002051
-:105B50008075FF1F0400002007B2010046E001002D
-:105B600000210120FEF71EBE0120FFF760BB0021CF
-:105B70000420FEF717BE0120FEF736BE0120FEF717
-:105B80003BBE000010B50446616801F1080000F05A
-:105B9000F4FE00B10120207010BD000010B10128FA
-:105BA00003D070470720FEF70DBE0720FEF712BE98
-:105BB0000D0A0D2A2A20444953434F4E4E45435463
-:105BC000494F4E204556454E54205749544820438E
-:105BD0004C49454E54200A000D0A0D2A2A20434FF5
-:105BE0004E4E454354494F4E205550444154452054
-:105BF0004556454E54205749544820434C49454E3C
-:105C000054200A004556545F5550444154455F5056
-:105C100048595F434F4D504C455445200A00000001
-:105C20004556545F5550444154455F5048595F4371
-:105C30004F4D504C4554452C20737461747573203E
-:105C40006F6B200A000000004556545F55504441D8
-:105C500054455F5048595F434F4D504C4554452C77
-:105C600020737461747573206E6F6B200A000000DE
-:105C7000526561645F50485920737563636573733F
-:105C8000200A000050485920506172616D20205454
-:105C9000583D2025642C2052583D202564200A00C0
-:105CA0005265616420636F6E66206E6F7420737539
-:105CB000636365657373200A000000004556545FF6
-:105CC0004C455F434F4E4E5F434F4D504C455445FE
-:105CD00020666F7220636F6E6E656374696F6E20ED
-:105CE00068616E646C6520307825780A00000000D9
-:105CF0000D0A0D2A2A204556545F424C55455F47F0
-:105D000041505F4C494D495445445F444953434FCA
-:105D100056455241424C45200A0000000D0A0D2A0A
-:105D20002A204556545F424C55455F4741505F50CD
-:105D30004153535F4B45595F52455155455354208C
-:105D40000A0000000D0A0D2A2A206163695F67615D
-:105D5000705F706173735F6B65795F7265737020DC
-:105D60000A0000000D0A0D2A2A204556545F424CB5
-:105D700055455F4741505F415554484F52495A413C
-:105D800054494F4E5F52455155455354200A000027
-:105D90000D0A0D2A2A204556545F424C55455F474F
-:105DA00041505F534C4156455F534543555249540A
-:105DB000595F494E49544941544544200A00000066
-:105DC0000D0A0D2A2A204556545F424C55455F471F
-:105DD00041505F424F4E445F4C4F5354200A0000E5
-:105DE0000D0A0D2A2A2053656E6420616C6C6F7752
-:105DF000207265626F6E64200A0000000D0A0D2A91
-:105E00002A204556545F424C55455F4741505F44F8
-:105E100045564943455F464F554E44200A00000011
-:105E20000D0A0D2A2A204556545F424C55455F47BE
-:105E300041505F4B455950524553535F4E4F544963
-:105E40004649434154494F4E200A00006E756D6526
-:105E50007269635F76616C7565203D2025640A0078
-:105E60004865785F76616C7565203D2025780A006D
-:105E70000D0A0D2A2A206163695F6761705F6E7584
-:105E80006D657269635F636F6D70617269736F6E68
-:105E90005F76616C75655F636F6E6669726D5F7961
-:105EA00065736E6F2D2D3E594553200A000000008A
-:105EB000424C455F4354524C5F4170705F4E6F746B
-:105EC000696669636174696F6E3A204556545F4232
-:105ED0004C55455F4741505F50414952494E475FDD
-:105EE000434D504C542C2070616972696E675F633A
-:105EF0006F6D706C6574652D3E537461747573209D
-:105F00003D2025640A0000000D0A0D2A2A20506158
-:105F10006972696E67204F4B200A00000D0A0D2A36
-:105F20002A2050616972696E67204B4F200A000079
-:105F30000D0A0D2A2A204556545F424C55455F47AD
-:105F400041505F50524F4345445552455F434F4D7A
-:105F5000504C455445200A0053544D3332574200AB
-:105F6000466972737420696E64657820696E2025B5
-:105F700064207374617465200A00000053756363C4
-:105F800065737366756C6C792053746F707065649B
-:105F9000204164766572746973696E670A00000057
-:105FA00053746F70204164766572746973696E67AB
-:105FB000204661696C6564202C20726573756C7471
-:105FC0003A202564200A0000537563636573736685
-:105FD000756C6C79205374617274204661737420FF
-:105FE0004164766572746973696E670A0000000027
-:105FF0005375636365737366756C6C792053746154
-:106000007274204C6F7720506F77657220416476F0
-:106010006572746973696E670A0000005374617277
-:106020007420466173742041647665727469736983
-:106030006E67204661696C6564202C2072657375FB
-:106040006C743A202564200A0000000053746172C9
-:1060500074204C6F7720506F7765722041647665AD
-:1060600072746973696E67204661696C6564202C7F
-:1060700020726573756C743A202564200A00000054
-:1060800020200D0A0D0000002A2A2053544F5020D2
-:106090004144564552544953494E47202A2A20200C
-:1060A0000D0A0D002A2A2053544F502041445645D2
-:1060B00052544953494E47202A2A20204661696C90
-:1060C0006564200D0A0D0000424C455F5356435F46
-:1060D0004C324341505F436F6E6E5F557064617424
-:1060E0006528292C205375636365737366756C6C22
-:1060F00079200D0A0D000000424C455F5356435F66
-:106100004C324341505F436F6E6E5F5570646174F3
-:106110006528292C204661696C6564200D0A0D00F4
-:106120006C7AD8AC57720000123456789ABCDEF004
-:10613000123456789ABCDEF0FEDCBA09876543213A
-:10614000FEDCBA098765432109503250535256315B
-:10615000000000000000000000000000000000003F
-:106160000000000044000800400508013A799C0046
-:10617000F4010001FFFFFFFF4801010000000000E3
-:106180007047704710B5029C016042600021C160F9
-:106190000161416181610381A107047704D5008910
-:1061A00010B14FF0FF3010BD002010BD2DE9F04FB1
-:1061B000064685B030890C460027BB460028716929
-:1061C000DC460CBF4FF00208D84681B168B930698F
-:1061D0007768451CBD4228BFED1B3768385C7D5D84
-:1061E00000EB0527BF1CBFB203E0074600E000B18B
-:1061F00002463069F568A84223BF7568281AC01B9B
-:106200000020154608EB050903FB09FE864532BF51
-:106210000020B0FBF9FA09FB1A00C0B2804509DA88
-:1062200096F81C905FEAC97A48BF84465FEA897095
-:1062300048BFC446100000F0B480706871446144E7
-:106240008842C0F0AE8008EB020080B20390D946CD
-:10625000100AADF802000294ADF80020049359E052
-:10626000800740D53089002840F09B803268D018E4
-:10627000A34600F8024C200A32681A4402F8010CC6
-:10628000224630681844FBF727F8706920187061BF
-:10629000B069019C401CB061200A31680C70316803
-:1062A00048701CE08CB3307FC207D9D5308940B923
-:1062B00031681944FF2001F8020C3168194401F8D3
-:1062C000010C4FF0000B7069241874612C46308962
-:1062D000002340B931680C70210A306841700223F4
-:1062E0007069801C706108EB04070021BFB2316146
-:1062F0005CB1DA44029800EB0A0130682246184487
-:10630000FAF7EAFF70692418746109F10109B069AC
-:10631000401CB061049A70683169914545D2791882
-:1063200081422CBF081A0846306103463089A0B963
-:106330003068BDF80010C1545B1C7068316883423E
-:1063400028BF1B1ABDF80200C8545B1C706883424A
-:1063500028BF1B1A7069801C706105FB09FA7468FC
-:10636000BDF80000E41A844288BF0446029800EB9E
-:106370000A01281BAC42019003D093D2307F002841
-:1063800090D137682246F818FAF7A6FF70692018EE
-:106390007061A346019C039F0023A9E73068404435
-:1063A00000E0002005B0BDE8F08F88448045F5D3BB
-:1063B000A8EB0008F2E778B5028900230B80002AD9
-:1063C00044690CBF02250025002C4FD0028952B928
-:1063D000C2684668531CB34228BF9B1B0668B25C68
-:1063E000F35C02EB03220A80027F02F00302012A1F
-:1063F00025D10B884FF6FF72934204BF0289002A11
-:1064000009D0C36802699A4219D20289BAB14668B2
-:10641000F31A934213D24368C268E41A1419002293
-:10642000C260446102894AB902681478012B94BFA2
-:10643000C3F101030123D25C04EB02220A80C46889
-:10644000426806682B19934228BF9B1A33440E8872
-:106450004169891B491B416105D034192D199542A9
-:1064600028BFAD1AC5608169491E8161184672BD99
-:10647000F8B5028900230B80002A42690CBF022470
-:106480000024002A3BD0C56802892B464AB94668D9
-:106490006A1CB24228BF921B0668775DB25C07EBAC
-:1064A00002220A80067F06F00306012E20D10F8803
-:1064B0004FF6FF72974204BF0289002A07D1426853
-:1064C0000023012A94BFC2F1010201220AE00269FD
-:1064D000AA420DD202895AB14668751B954207D26D
-:1064E000002304E005682E78AA5C06EB02220A80ED
-:1064F00041680068E4188C4228BF641A03191846E2
-:10650000F2BD0000C0680840884201D101207047F8
-:1065100000207047C0690840884201D101207047BF
-:106520000020704710B5614C02212046FFF7F2FFB2
-:1065300038B16068C043810703D5FEF74BFF0220E6
-:1065400018E001212046FFF7E5FF38B16068C0433D
-:10655000C10703D5FEF704FF01200BE00821204608
-:10656000FFF7D8FF38B16068C043010703D5FEF7D5
-:1065700086FF0820A06010BD10B54C4C00F033F829
-:1065800018B96068C043810306D400F02CF830B914
-:106590006068C043810302D5BDE8104064E0082173
-:1065A00000F022F870B96068C04301030AD5606842
-:1065B0003F4940F400206060086880474FF40020A5
-:1065C000A06010BD202100F00FF858B96068C043EA
-:1065D000810207D5606840F400106060BDE810409B
-:1065E000FEF7D1BE10BD022120468BE740BF20BF81
-:1065F0003048016841F400410160704780B52E4881
-:10660000016841F480110160006800F4801000907E
-:1066100000982648016841F001010160026842F4D7
-:10662000803202602C20FDF7B8FCBDE802402D202E
-:10663000FDF7B3BC21480168490849000160704773
-:106640001F494FF48030086070471C48016821F0F2
-:1066500002010160704719484FF400314160016840
-:1066600021F40031016070471448016841F40031A1
-:106670000160FEF7A9BE38B504460C4D0821284636
-:10668000FFF740FF30B10A480460686820F400203A
-:10669000686031BDA0474FF40021A96031BD0748B3
-:1066A000016821F00801016070470000000C0058EB
-:1066B000A81700200C04005850000058040C005883
-:1066C000080C0058006040607047EFF3108172B60C
-:1066D000026882420CBF012000201CE0EFF3108210
-:1066E00072B603680B60486001600868416023E08F
-:1066F000EFF3108272B6086043684B6041604868EF
-:10670000016019E0EFF3108172B6436802681A6005
-:1067100042680068426081F31088704710B5EFF35B
-:10672000108472B602680A600068FFE7FFF7EAFFAC
-:1067300084F3108810BD086082F310887047000051
-:106740000249016002490161704700BF8D53000892
-:10675000B55300087FB50C46684D6168684EE86126
-:106760002962284600F064FE246805F12400FFF742
-:10677000A9FF746006F10800FFF7A4FF0120307044
-:10678000296829B10FF241100090029468468847A9
-:106790007FBD3EB5594C5A4D02E00098FEF744FECD
-:1067A00005F10800FFF791FFD8B92878002818D024
-:1067B000694605F10800FFF7B1FF01202870E16983
-:1067C0000029EAD00098029001A888479DF80400AB
-:1067D00028700028E1D1009905F10800FFF77EFF3D
-:1067E000DEE737BD2DE9F8430646002000F05FF8EC
-:1067F00074883088B268DFF80481C4F3090444EA7D
-:106800008024F068A4B2C1B2204600F03CF8002712
-:1068100048F2E8094846FFF7B1F908E06888A04265
-:1068200002D1316928780870687800B1012708F131
-:106830002400FFF74AFFF0B9694608F12400FFF78A
-:106840006DFF009800F10B05407A0F28E6D0B5F8EF
-:106850000110A1420DD10098817AC81E7169C0B2A1
-:106860008842C8BF0846706102463069E91CFAF7E1
-:1068700033FD2878D9E73800CCD0012000F017F894
-:106880000020BDE8F28310B513461D4A5468A4F8F1
-:106890000900E1720A46194604F10C00FAF71CFDE2
-:1068A000164A1369BDE8104000210020184713491B
-:1068B000096A82B008B921B101E011B1012002B02A
-:1068C000084702B07047000010B50146487A0F280B
-:1068D00018BF0E2807D10B48FFF70AFFBDE810408C
-:1068E0000020FFF748B9064C04F10800FFF700FF4D
-:1068F00004F10800BDE81040FFF739B9B0160020D8
-:1069000024170020D4160020FEF728FE9DF80E0064
-:1069100005B000BDF8B500F10C026B4621214FF621
-:106920006640F1E780B5294800210171017200F04D
-:1069300089FD00F088FD00F087FD00F086FD00F085
-:1069400085FD00F084FD00F083FD00F082FD00F085
-:1069500081FD00F080FD00F0B5FD00F06DFE00F05F
-:106960006CFEBDE8014000F069BE18490A7941F8A3
-:1069700022000879401C0871704770B504466078A1
-:10698000FF2802BFB4F8031001F47F41B1F5406F56
-:1069900012D100260D4D00E0761C2979F0B2884214
-:1069A0000AD2F1B255F82110204688470100F3D0F1
-:1069B00002D0022805D006E02046BDE87040FEF770
-:1069C00079BE002070BD012070BD0000501700206E
-:1069D00018B50C46C7B0114600228DF800208DF87E
-:1069E0001C008DF81D4022460DF11E0000F027FE10
-:1069F00000F03BF83F200C21ADF80400ADF8061084
-:106A000007A8012103900691A41C049400F043F808
-:106A100000284CBFFF209DF8000048B010BD00B515
-:106A2000C7B000F01BF80F2000F02AF800284CBF78
-:106A3000FF209DF8000047B000BD00B5C7B00021A1
-:106A4000ADF81C0000F016F8182000F019F8002826
-:106A50004CBFFF209DF8000047B000BD00228DF81C
-:106A600000208DF81C008DF81D101822002101A8AF
-:106A700000F0EBBD8DF80010182201A800F0E5BD74
-:106A8000ADF8060007A9022004903F2201200391DF
-:106A90000690ADF80420CDF814D0002101A8FFF72E
-:106AA000A1BE000070B506464E4C30784CA520B112
-:106AB000012807D0032810D070BD012020700FF2EC
-:106AC000281003E0002121700FF2501000F056F959
-:106AD0002846BDE8704000F051B971680878C8B91F
-:106AE0004978012909D1FEF798FB0FF2641000F0F4
-:106AF00045F900F02FF80120A0707168487848B976
-:106B0000FEF795FB0FF2701000F038F900F022F854
-:106B10000020A0707068017801291AD140780128FE
-:106B20000AD10020FEF779FB0FF2741000F026F96D
-:106B300000F010F80120A0707168487848B9FEF79D
-:106B400076FB0FF2841000F019F900F003F8002032
-:106B5000A07070BD284600F011B90078012808BF68
-:106B600000F00DB8704780B50FF239020021022005
-:106B7000FDF70BFE1B4900220A70BDE8014080B5FD
-:106B80000020FEF754FB174801214170002181705D
-:106B90000121C1700021017101BD00210220FDF71A
-:106BA00001BE000010B50F4C2079401E8041C00F7F
-:106BB0002071207868B10FF2381000F0DFF808A0DB
-:106BC00000F0DCF8E11CBDE810404FF6426000F038
-:106BD00009BDBDE810400FF2581000F0CFB800001A
-:106BE000200A0D008C1700202D2D205032502041FE
-:106BF00050504C49434154494F4E205345525645FD
-:106C000052203A204E4F54494649434154494F4E31
-:106C100020454E41424C45440A0000002D2D205095
-:106C20003250204150504C49434154494F4E20531B
-:106C30004552564552203A204E4F54494649434109
-:106C400054494F4E2044495341424C45440A0000A8
-:106C50002D2D20503250204150504C494341544931
-:106C60004F4E2053455256455220203A204C454421
-:106C700031204F4E0A0000002D2D2050325020416F
-:106C800050504C49434154494F4E2053455256456C
-:106C90005220203A204C454431204F46460A0000FD
-:106CA0002D2D20503250204150504C4943415449E1
-:106CB0004F4E205345525645522031203A204C45E4
-:106CC0004431204F4E0A00002D2D205032502041DB
-:106CD00050504C49434154494F4E2053455256451C
-:106CE000522031203A204C454431204F46460A007C
-:106CF0002D2D20503250204150504C494341544991
-:106D00004F4E2053455256455220203A20494E4678
-:106D10004F524D20434C49454E5420425554544FF8
-:106D20004E203120505553484544200A2000000091
-:106D30002D2D20503250204150504C494341544950
-:106D40004F4E20534552564552203A2043414E273C
-:106D50005420494E464F524D20434C49454E5420F5
-:106D60002D20204E4F54494649434154494F4E200F
-:106D700044495341424C45440A2000000EB4C0B57A
-:106D8000024603A800210190009101AB01210448B3
-:106D900078440C30F9F7D2F906BC5DF810FB00BF5F
-:106DA0003F11000000B587B000F010F80120032269
-:106DB0000690ADF80420ADF8062000F07AF800281F
-:106DC0004CBFFF209DF8000007B000BD00208DF8EB
-:106DD00000001822002101A800F037BC0922002180
-:106DE000684600F032BC1822002102A800F02DBC39
-:106DF000182201A800F029BC70B5C8B006460C46A0
-:106E000015460522FFF7EBFFADF82060FFF7EBFF1B
-:106E1000302100F014F80521049000F019F8002842
-:106E200048BFFF2009D49DF8000030B99DF8030049
-:106E300020709DF804002870002048B070BDADF8A7
-:106E40000A1008200221ADF80800059108A8704733
-:106E50000791CDF818D0002102A8FFF7C3BC00B5F8
-:106E6000C7B000F00EF8FFF7C3FF312000F013F8B1
-:106E700000F01FF800284CBFFF209DF8000047B02D
-:106E800000BD00238DF81C008DF8003007A841706C
-:106E9000827000217047ADF8060007A90320049016
-:106EA0000822012003910690ADF80420704703905A
-:106EB0000691CDF814D0002101A8FFF793BC00B5CE
-:106EC00087B000F012F900F02EF9812000F008F9E7
-:106ED00000F036F900284CBFFF209DF8000007B0F5
-:106EE00000BD2DE9F84DC7B09446DDF840E1519A58
-:106EF000559D569EDDF84CA1ADF81D108DF81C0077
-:106F00004FF0000BADF81FC08DF821308DF822E056
-:106F100000F024F800F017F824F8095F668000F00C
-:106F200002F93F20832100F026F9574406910D37DE
-:106F3000049700F008F900284CBFFF209DF80000DE
-:106F400048B0BDE8F08D88F800A007AC5499E4196A
-:106F5000524608F10100544400F071BB8DF8232023
-:106F6000174652998DF800B00DF1240809A8B844CD
-:106F700000F065BB00B5C7B000F00CF8852000F04C
-:106F800090F800F0DDF800284CBFFF209DF80000CD
-:106F900047B000BD00218DF81C008DF800101822AC
-:106FA00001A800F052BB2DE9F841C7B04FF000082E
-:106FB00000F026F80DF12300DDF844E14E9F4F9ECE
-:106FC000509D529C8DF81F30C0F800E08DF8008075
-:106FD0008DF820708DF821608DF822508DF82740B3
-:106FE00000F0A1F88620ADF8060007A90C2000F0FB
-:106FF000A3F800284CBFFF209DF8000000F0D5B892
-:107000008DF81C0007A8417082707047F8B5C8B0B1
-:1070100005460E4617461C4600F023F808A84670A1
-:1070200087708DF8205000F0A1F88A21ADF80A1081
-:107030003F20032100F08DF8002848BFFF200ED428
-:107040009DF8000058B94F994E98BDF80120228054
-:10705000BDF803200280BDF805000880002049B07B
-:10706000F0BD07220021684600F0EFBA18B5C7B09E
-:10707000044600F03AF88DF81C40224600F083F8F0
-:1070800000F051F83F208E2100F092F8641C049427
-:1070900000F059F800284CBFFF209DF8000048B0D0
-:1070A00010BDADF8060007A901203F22039104900E
-:1070B0007047ADF8060007A90220704700B587B0F9
-:1070C00000F013F800F02FF8922000F009F800F01B
-:1070D00037F800284CBFFF209DF8000007B000BD26
-:1070E000ADF806003F220120704700208DF8000017
-:1070F000704700B5C7B00021ADF81C00FFF74DFF89
-:107100009520FFF7D6FF00F017F800284CBFFF20AE
-:107110009DF8000047B000BD00228DF80020ADF8BA
-:107120001C008DF81E101822002101A800F08DBA55
-:10713000ADF8060007A9032004903F220120039127
-:107140000690ADF80420CDF814D0002101A8FFF777
-:1071500049BBADF80800059108A8072104900791E4
-:10716000CDF818D0002102A8FFF73CBB182200215F
-:1071700002A800F06ABAADF80400ADF8061007A83E
-:107180000121039070470DF11D0000F058BA00B5C1
-:10719000C7B0FFF7C1FFA520FFF7CAFF00284CBF0B
-:1071A000FF209DF8000047B000BD48B0BDE8F08169
-:1071B000ADF80400ADF8061007A801210390069170
-:1071C000704730B5C7B00025ADF81C0007A84A9C31
-:1071D00041808280ADF8223004818DF8005000F0AB
-:1071E00016F80F21029140F281100A21ADF8060035
-:1071F000049107A801213F220390069100F00CF8AA
-:1072000000284CBFFF209DF8000047B030BD182279
-:10721000002101A800F019BAADF80420CDF814D06F
-:10722000002101A8FFF7DEBA00B587B000208DF875
-:10723000000000F0E0F840F20110ADF806003F2237
-:107240000120069000F0ECF800284CBFFF209DF8CC
-:10725000000007B000BD2DE9F84107460128C7B07E
-:10726000884615461E4608BF022003D002280CBFE0
-:10727000102000200DF11D010C1800F036F8012F30
-:107280008DF81C7002D0022F18D019E002273A4660
-:1072900041460DF11D0000F0D2F92570667000F036
-:1072A000AAF83F204FF4817100F016F8FF1C0497F4
-:1072B00000F0B8F8002805D5FF2009E01027E6E720
-:1072C000472005E09DF8000010B94E9800F067F8DF
-:1072D000FFE748B0BDE8F081ADF80400ADF8061056
-:1072E00007A80321039006917047032200216846F6
-:1072F00000F0ABB92DE9F64F0C460546012CC7B09E
-:107300009B4608BF022003D0022C0CBF1020002097
-:107310000DF11F010E18FFF7E8FF012CADF81C500E
-:107320008DF81E4002D0022C2CD02DE00227569C56
-:10733000559DDDF85091DDF84CA1DDF84881489964
-:107340003A4600F054F8A6F800B086F8028086F8B5
-:1073500003A086F804907571B47100F04CF83F20DA
-:10736000ADF804004FF4827107A8ADF80610039041
-:1073700003210A370497069100F054F8002805D538
-:10738000FF2009E01027D2E7472005E09DF8000024
-:1073900010B9579800F003F849B0BDE8F08FBDF878
-:1073A000011001800020704730B5C7B01C464A9BD1
-:1073B00000F026F800258DF800508DF82140224677
-:1073C00019460DF1220000F03AF900F014F83F20C0
-:1073D0004FF4837100F01BF8A41D049400F022F810
-:1073E00000284CBFFF209DF8000047B030BD0DF1D4
-:1073F0001F0000F024B91822002101A800F025B9CF
-:10740000ADF81C00ADF81E108DF820207047ADF8C7
-:107410000400ADF8061007A80121039006917047FB
-:10742000ADF80420CDF814D0002101A8FFF7DAB997
-:107430000249016002490161704700BF23530008FF
-:107440004D5300087047704770477047704770474A
-:10745000704770477047704738B5054684B0687804
-:107460000024FF2802BFB5F8031040F60140814216
-:1074700025D165498A88B5F80700921C904209D148
-:10748000687B0124C10752BF8DF8004000218DF8B0
-:10749000001011E04988491C884210D10FF2701089
-:1074A000FFF76CFC03208DF8000005F10D00B5F826
-:1074B0000B108DF8081001906846FFF7F3FA20468C
-:1074C00005B030BD10B58AB050484F4CFFF74DFAAB
-:1074D0008F218DF81810E520B3218DF819008DF853
-:1074E0001A10D5202E218DF81B008DF81C107F203E
-:1074F0004A218DF81D008DF81E1098202A218DF844
-:107500001F008DF8201048207A218DF821008DF879
-:107510002210CC2040218DF823008DF82410FE206D
-:1075200000218DF82500ADF82610009408230122D3
-:1075300006A90220FFF78FFE00F032F8412000F08C
-:1075400023F8A01C00F010F8062100F015F800F058
-:1075500027F8422000F018F8201D00F005F810214F
-:1075600000F00AF80AB010BD0590012104910291C3
-:1075700000200A2201907047039200910223208884
-:1075800006AA0221FFF7B6BE8E218DF824008DF8E1
-:1075900023100020FE21ADF826008DF8251070473D
-:1075A00019208DF81800ED2182208DF81A008DF831
-:1075B0001910ED20AE218DF81C008DF81B104C2009
-:1075C00021218DF81E008DF81D1041209D218DF880
-:1075D00020008DF81F10222045218DF822008DF803
-:1075E0002110704780B542224FF64263984208D17D
-:1075F000054800910223818800880022FFF7D4FE0D
-:107600000246104602BD000094170020597400087D
-:107610002D2D2047415454203A204C454420434FBF
-:107620004E46494755524154494F4E2052454345D5
-:10763000495645440A00000070477047704710B52E
-:107640000446F9F749FE204610BD10B50446104621
-:107650000A460146204600F003F8204610BD00000F
-:1076600062F30F2262F31F42401810F0030308D0A8
-:10767000C91A1FD3DB0748BF00F8012D28BF20F827
-:10768000022D130030B414461546103928BF20E9E6
-:107690003C00FAD8490728BF20E90C0048BF40F851
-:1076A000042D890028BF20F8022D48BF00F8012DC5
-:1076B00030BC7047C91818BF00F8012DCB0728BF90
-:1076C00000F8012D7047000010B50446AFF30080AC
-:1076D000204600F005F80446AFF30080204610BDB8
-:1076E0007CB500F10F06F608F600B04240D2082E35
-:1076F00004D2082602E0083000F047F8DFF8045111
-:107700002C68210005D1002007E00268B24221D296
-:10771000011D08680028F8D12068291D0A688242E6
-:1077200022D01368B34238BF111DF7D312E093196A
-:107730000B60801B54685C600B68186016600968F9
-:1077400000291DBF48680028081D0020286002F19C
-:10775000080076BD61B10A681068A0F10803B34261
-:10776000E5D250680860EAE700F04EF80028C2D180
-:10777000002076BD10B5040006D0AFF3008020468F
-:1077800000F003F8AFF3008010BD002800D170476F
-:1077900050B4A0F108021368072B2BD913F0070F80
-:1077A00028D1184C616809B18A4202D251606260E6
-:1077B00013E0486800B3904238BF0146F9D31BE09C
-:1077C000964203D11B180B600A4606E0486810B1C8
-:1077D000134498420ED350604A60506850B1136809
-:1077E000D118814206D1002121600168CB181360B5
-:1077F0004068506050BC704708680E18B242DFD233
-:1078000050BC7047841700200749086808B1002061
-:1078100070470648C008C00008600549C908C9008B
-:10782000091A0160704700BFB0170020BF27002071
-:10783000B82B00202DE9F04107468846387810F033
-:10784000030F16461D4633D0384600F099F878BB32
-:10785000B8F1000F1CBFD8E900018619012D2ED107
-:107860003888C10415D5396A07F14402384600F05A
-:10787000A3F83A6B044602B93A69F968384600F051
-:107880009BF8361B341A7A69F968384600F094F888
-:10789000261A1EB94DB916F1010F09D097F9030048
-:1078A0002A46314600F08EF8064616F1010F09D13E
-:1078B0002320AFF300804FF0FF30BDE8F081022DB0
-:1078C000E8D1EBE7388810F4405F0ED07868F860B4
-:1078D00038617861B8617868F86107F1440038620E
-:1078E00007F13000786200203863B8F1000F05D04E
-:1078F000D8E9020107F13402C2E9000139884CF6E7
-:10790000FF60014039800020BDE8F08170B5054678
-:10791000AFF300802888810415D56E680024EA68DA
-:1079200095F903003146914212D2521AFDF712FC2A
-:1079300010F1010F1CBF00283618F0D10FE04DF6F2
-:10794000FF70014029802846AFF30080002070BD01
-:1079500000220021FDF7FEFB10F1010F00D10124F0
-:107960006868E860A861E861002C2988E7D041F4E4
-:10797000007129802846AFF300804FF0FF3070BDC2
-:10798000F8B5A0B9AFF3008000250A4E08244FF0E7
-:10799000FF37306820B1FFF7B9FF002848BF3D46E8
-:1079A000361D641EF5D1AFF300802846F2BDBDE858
-:1079B000F240ABE7F4110020914234BF511A00218C
-:1079C000084670473EB504000D00012A02D100F0C0
-:1079D00063F807E0022A07D100940020019069466D
-:1079E0000C20ABBE2D1801E0002A0CD100940195AB
-:1079F00069460A20ABBE002805D1002221002800DC
-:107A000000F027F801E00020C04303B030BD0000C3
-:107A100010B4314A002113461C6884421EBF491C21
-:107A20009C6884421EBF491C1C69844209D09C6921
-:107A3000491C844205D0491C20331029ECD310BCCA
-:107A40007047002342F8313002EBC1014B6010BC9B
-:107A5000704778B4204C002325462E688E421EBF06
-:107A60005B1CAE688E421EBF5B1C2E698E4209D025
-:107A7000AE695B1C8E4205D05B1C2035102BECD30D
-:107A800072BC7047054604EBC303012A04BF596862
-:107A90004D195D6072BC704710B40F4A0021134647
-:107AA0001C6884421EBF491C9C6884421EBF491C3E
-:107AB0001C6984420AD09C69491C844206D0491C36
-:107AC00020331029ECD310BC0020704702EBC1001A
-:107AD000406810BC70470000D014002010B5044668
-:107AE000E068A169884251D3218849F202030B4022
-:107AF000022B08D008044CBF4FF400704FF48440B0
-:107B0000014321803BE001F4C042B2F5C04F06D1F1
-:107B1000A168884203D32046FFF732FF78BB208854
-:107B200010F4406F02BF606804F14401884217D12D
-:107B30004FF40070FFF7C8FD606030B904F14400F5
-:107B40006060E060401CA0600AE0218841F04001D4
-:107B50002180E060606100F500726068A260E06111
-:107B600060682061A068A061207841070AD50222E0
-:107B70000021204600F00CF810F1010F02D14FF067
-:107B8000FF3010BD208840F4C0402080002010BD90
-:107B900070B504460D461646AFF3008033462A46BC
-:107BA00000212046FFF746FE05462046AFF3008041
-:107BB000284670BD38B504000ED0207810F0030FB1
-:107BC00003D094F90300002809D5AFF300802046C4
-:107BD00000F030F8AFF300804FF0FF3032BD2046A8
-:107BE000FFF7CEFE0546AFF300802078410644BF84
-:107BF000606800F05DF80020606094F903000228DE
-:107C000004D900F057F808B14FF0FF35E06B48B1E8
-:107C100000F05CF808B14FF0FF35E06B00F048F879
-:107C20000020E063204600F005F8AFF3008028460E
-:107C300032BD000001780A0626D51C4A13680021CF
-:107C4000834203D1002342F821301BE05368012115
-:107C500083421EBF022193688342F3D0D36803217D
-:107C600083421EBF042113698342EBD0536905216F
-:107C700083421EBF0621936983421EBF0721D36939
-:107C80008342DFD000F014B8002101804FF0FF31B3
-:107C9000C17000F144014160C160016141618161D5
-:107CA000C161016200F1300141627047F4110020AE
-:107CB000FFF760BD1CB50200009269460220ABBE12
-:107CC00004001000FFF7A4FE200016BDE0B50090F0
-:107CD000F9F7B4FA019069460E20ABBE03B000BDBF
-:107CE0007047FEE7FEE7FEE7FEE770477047704724
-:107CF00000F020B80548FBF7D3B90548FAF769B991
-:107D00000448FAF766B90448FBF7CAB950150020D1
-:107D1000C413002038130020B01500201020FCF7F9
-:107D200048BA0120FCF745BAFDF75BB8FEF724BC62
-:107D3000FEF7F8BB02490A68886882180A60704733
-:107D40007410002038B50C46C5B22046AFF3008051
-:107D5000E068A169884204D32046FFF7BFFE0028EF
-:107D60000FD4E068401CE06000F8015D2088010548
-:107D700003D440050BD50A2D09D12046FFF700FE9C
-:107D800028B12046AFF300804FF0FF3032BD2046CF
-:107D9000AFF30080284632BD19E050F8042BD3071A
-:107DA00044BFA9F101039A18091F0023042942F8CE
-:107DB000043BF9D25FEA817C134604D54FF0000CF6
-:107DC000A2F800C09B1CC90744BF0021197050F8DD
-:107DD000041B0029E1D1704738B50D4D08242868EF
-:107DE00000281CBF017811F0030F05D090F9031093
-:107DF000002958BFFFF7DEFE2D1D641EEFD1BDE840
-:107E00003840002200214FF0FF30FDF7A3B900BF3A
-:107E1000F411002010B5074979441831064C7C4410
-:107E2000163404E00A68081D114488470146A1423F
-:107E3000F8D110BD2C000000500000004EF6885113
-:107E4000CEF20001086840F470000860BFF34F8F65
-:107E5000BFF36F8F4FF00070E1EE100A7047000023
-:107E600039FFFFFFA4050000141200208008000065
-:107E700020000320000000005B92FFFF8001000053
-:107E8000B20100000400002000000000000000001B
-:107E900000000000000000000100000002000000DF
-:107EA000030000000400000000F00DF8002801D0DD
-:107EB000FFF7B0FFAFF300800020AFF30080FBF7C7
-:107EC000F4FE00F002F80120704700F001B8000055
-:107ED0000746FFF781FF3846F9F7E2FFFBE738B5C1
-:107EE00004460D46284600F005F8A84218BF0024B5
-:107EF000204632BD0149FFF725BF00BF64110020B5
-:107F000001488047014800473D420008117F0008B2
-:107F1000AFF30080FFF792FFFFF7C6FF00002E00CF
-:107F20004300FFF7FEBFFFF7FEBFFFF7FEBFFFF7FF
+:10000000B8270020AD7E0008517C0008537C000812
+:10001000557C0008577C0008597C0008000000004F
+:100020000000000000000000000000005B7C0008F1
+:100030005D7C0008000000005F7C0008617C000817
+:10004000CF7E0008D37E0008D77E0008997C000888
+:10005000DB7E0008DF7E0008937C0008E37E00085A
+:10006000E77E0008EB7E00088D7C0008EF7E00082C
+:10007000F37E0008F77E0008657C0008FB7E000820
+:10008000FF7E0008037F0008077F00080B7F000841
+:100090000F7F0008137F0008177F00081B7F0008F0
+:1000A0001F7F0008237F0008277F00082B7F0008A0
+:1000B0002F7F0008337F0008377F00083B7F000850
+:1000C0003F7F0008437F0008477F00084B7F000800
+:1000D0006B7C0008717C00084F7F0008537F00088C
+:1000E000577F00085B7F00085F7F0008637F000880
+:1000F000A17C00089D7C0008677F00086B7F0008DA
+:100100006F7F0008737F0008777F00087B7F0008FF
+:100110007F7F0008837F0008877F00088B7F0008AF
+:100120008F7F0008937F0008777C0008977F000886
+:100130009B7F00089F7F0008A37F00082DE9F04FF8
+:100140000FF2A41CA1B0DCE90089CDE900892A9D49
+:10015000DFF8DC9B049100248DF843500D944FF0A0
+:10016000FF38824616461F460FE0B3462C461BF862
+:10017000011B0498D0470028049000F0A2800D983D
+:10018000401C641E0D90F2D176193078252808D1D4
+:10019000002100220791089209910A920B910C927A
+:1001A0000DE06A464146304600F0DAFF050001D115
+:1001B0000D98A1E0D9D50125E6E741F0010116F837
+:1001C000010F2028F9D023280CD02B2804D02D286B
+:1001D00005D0302809D076E041F00201EFE741F088
+:1001E0000401ECE741F00801E9E741F01001E6E71E
+:1001F0000F9209E00F98484505DA00EB800402EB06
+:100200004402303A0F92761C3278A2F130000A286C
+:10021000F0D330782E2818BFCDF8388022D116F8C8
+:10022000010F2A2807D138683860761C50F8042B53
+:1002300038600E9216E02D280CBF761C002000229C
+:100240000E920AE040B90E9A4A4505DA02EB8204A2
+:1002500003EB4403303B0E93761C3378A3F130025A
+:100260000A2AEFD3ADF8401021A0317800F082FFC8
+:1002700008B116F8010B8DF842009DF8420068287D
+:1002800004D1307868280AD1622105E06C2804BFC7
+:1002900030786C2803D171218DF84210761C12A899
+:1002A00006903A4616F8013B02A9504600F064F861
+:1002B00038B912AA02A9504600F0C8F900287FF503
+:1002C00064AF404618E02A2892D13A683A6052F862
+:1002D000040B3A6000280F9003D540420F9041F084
+:1002E0000401761C95E700000000000000000000FB
+:1002F000686A6C747A4C000021B0BDE8F08F622807
+:1003000020D0682811D06A2803D06C2827D0712803
+:1003100025D10868C01D20F007000860D0E900233F
+:1003200008300860194610467047002A0A680A60BB
+:10033000106803D0121D0A6000B217E0121D0A6097
+:1003400080B217E0002A0A680A60106803D0121D04
+:100350000A6040B20AE0121D0A60C0B20AE0002A38
+:100360000A680A60106803D0121D0A60C11770473E
+:10037000121D0A60002170477CB50D4611461C46CF
+:100380002E69B4F1250200F04F811C3A00F0848000
+:10039000121F022A40F280800E3A00F00981521F9B
+:1003A00059D0093A78D0921E16D0521E35D0521E1E
+:1003B000022A71D9121F30D0521F00F09880521EAD
+:1003C00049D0521E00F0E280D21E00F0FF80921E43
+:1003D00041D0D21E3FD02DE195F83A406C2C09D087
+:1003E0006869421C6A610A680A6052F8043B0A6044
+:1003F000335429E10A680A6052F8043B0A6000930A
+:10040000002201924FF0FF332B636A46294600F029
+:1004100098F9002840F1188103E195F83A0001228B
+:10042000FFF76DFFC5E90001002904D56869411C8B
+:1004300069612D220DE0288F810704D56869411C70
+:1004400069612B2205E0C00721D56869411C6961FB
+:10045000202232541BE095F83A000022FFF74FFFAC
+:10046000C5E9000195F83800010710D5D5E900234A
+:10047000002B08BF002A0AD044F02000782806D1BB
+:10048000686930213154401C421C6A613454214651
+:1004900068693044E86087E00868C01D20F0070004
+:1004A0000860D0E9002308300860C5E90023D5E9D9
+:1004B0000001C80F04D06869411C69612D220DE05C
+:1004C000288F810704D56869411C69612B2205E0EA
+:1004D000C00704D56869411C6961202232546869EB
+:1004E0003044E8602146284600F036FAACE005F1D9
+:1004F0003A02507820B14FF0FF340FF6043074E028
+:100500001078622808D0682824D06A2812D06C2875
+:100510002ED071280ED02BE00A680A6052F8040B26
+:100520000A6020B94FF0FF340FF6EC205DE0E96A75
+:10053000017089E00A680A6052F8040B0A6020B969
+:100540004FF0FF340FF6D0204FE0EA6AD317C0E92E
+:10055000002379E00A680A6052F8040B0A6020B9A7
+:100560004FF0FF340FF6B0203FE0E96A01806BE006
+:100570000A680A6052F8040B0A6020B94FF0FF3491
+:100580000FF6942031E0E96A01605DE00A680A60D4
+:1005900052F8040B0A60002120F0000221F0FF3322
+:1005A000C5E90023EE607821284600F02DF94BE0E4
+:1005B0006C2285F83A200B680B6053F8042B0B6013
+:1005C00052BB4FF0FF340FF684200EE095F83A202E
+:1005D0006C2AF0D00868086050F8044B0860EC60A2
+:1005E0003CB94FF0FF340FF6482000F0EBFD201A25
+:1005F00076BD2E6B002E04D5204600F003FE044687
+:1006000008E032460021204600F026FE002814BFF4
+:10061000041B3446AC6117E0294600F092F800282C
+:1006200012D54FF0FF3076BD6869411C6961252203
+:10063000325409E06969481C68612522725421001E
+:1006400002D0431C6B613454002076BD2DE9F0418B
+:100650000E4605469046726B7069316AB46A121A8A
+:10066000B069521A716A121AF069521A121A96F87F
+:100670003800141B41070DD4002C0BDD2746B06851
+:100680002021A8470028B06057D0F06A401C7F1E88
+:10069000F062F4D1736942463146284600F098FC76
+:1006A00000284AD1376A002F0ADDB0683021A847F8
+:1006B0000028B06041D0F06A401C7F1EF062F4D187
+:1006C000B369F2683146284600F082FCA8BB776A1D
+:1006D000002F09DDB0683021A847B06068B3F06A28
+:1006E000401C7F1EF062F5D1F068B169F3694218D1
+:1006F0003146284600F06CFCF8B9B76A002F09DDD6
+:10070000B0683021A847B060B8B1F06A401C7F1EC5
+:10071000F062F5D196F8380041070BD5002C09DDC1
+:10072000B0682021A847B06038B1F06A401C641E50
+:10073000F062F5D10020BDE8F0814FF0FF30BDE858
+:10074000F0812DE9F8470D46A3B02F6B002F064628
+:10075000904648BF6FF000470FF60C1400F0A8FD5C
+:10076000D4E90023696B4018CDE90123812828BF13
+:100770004FF0FF3042D20024002F33DDD8F80010B4
+:1007800001AA684600F0EEFC8146B9F1000F38D4AA
+:10079000D8F8000010B9B9F1010932D44F4521DB76
+:1007A0006869484481280AD30021696303AA29465D
+:1007B0003046FFF74BFF040014D40020686103AB00
+:1007C000D5F814A04A46694603EB0A0000F076FD0E
+:1007D000CA44C5F814A058F8040B002818BFA7EBAA
+:1007E0000907C9D14CB903AA29463046FFF72EFFA5
+:1007F000044614B9002068616863204624B0BDE84F
+:10080000F0874FF0FF34F8E72DE9FC4307466F29E6
+:100810003E6908BF082405D041F02000782814BFA5
+:100820000A2410243C25D7E90023642918BF69292C
+:100830009046994605D1002B03D5D8F1000869EB05
+:100840004909B9F1000F08BFB8F1000F1FD1386B8B
+:10085000E8B9082C4CD197F83800010748D530206A
+:100860003B2586F83B0043E000280ED597F838007A
+:1008700000F01400102808D17B6B7969386A5B1A84
+:100880001B1A9A1A002AC8BF3A62BDE8F3838DF892
+:100890000010404649462246E31700F01BFD303267
+:1008A000D0B26D1E3A28019504DB9DF80000A0F13E
+:1008B00051018A187255404649462246E31700F016
+:1008C00009FD80465FEA010908BFB8F1000F03D0B7
+:1008D000F86871198842DCD3082C09D197F83800E0
+:1008E000010705D5705D302802D06D1E302070558F
+:1008F000C5F13C02BA617119F960386B8242B3DA12
+:10090000821A3A624FF6EF70398F01403987BDE89D
+:10091000F3832DE9D04306460F4614464FF00008F6
+:10092000DFF8109412E0E00707D542464B46304608
+:10093000394600F053FD06460F46404649464246BA
+:100940004B4600F04BFD641080468946002CEAD1EE
+:1009500030463946BDE8D0832DE9F84F05468A4632
+:100960004AF020048EB0D5E90089612C02AE09D08E
+:10097000286B002848BF062003D408BF672C01D18C
+:1009800001202863D5E900014A005215521C0DD1FF
+:100990000B030BD0AAF1610103201A29A86102D22E
+:1009A0000FF2CC6110E00FF2CC610DE04A0052155D
+:1009B000521C0ED10B030CD1AAF1610103201A299C
+:1009C000A86116D30FF2B461E868032200F076FC48
+:1009D000C0E1CDE90C01DDE90C2323F00043B3F5C0
+:1009E000801F0DD20027002B08BF002A019703D1DA
+:1009F00011E00FF28461E7E701AA00F0C1FD0AE00F
+:100A0000CD48CE4900EB1350DDE90C2301900B409B
+:100A1000CB4910461943C5E90001612C0DD1E868A6
+:100A200030210170821CBAF1610FEA600CBF78219D
+:100A3000582141706869801C6861D5E90001CDE9E1
+:100A40000C01DDE90C2333F0004104BF0028002332
+:100A500000F04881612C40F0A080286B49460028B6
+:100A60004CBF4FF0210B00F1010B40460022002348
+:100A7000DDE90C8900F0BCFD01990BF1010738BFDD
+:100A800089F00049091F002F01918DF808200DF110
+:100A9000090040F33581A949009106464046494680
+:100AA0000022002300F0BCFD80F029814800400DA9
+:100AB00000F11C0211D0002A0FDD40F2FF739A42B0
+:100AC00005DBA04909F000400143002011E0009B34
+:100AD000194041EA025140460BE028F0000039F08D
+:100AE000004108BF00280FBF49461C22494600F0BC
+:100AF000AFFD8046894600F049FEFF1F002F0446E7
+:100B000009DD00F061FE02460B464046494600F012
+:100B10006DFE80468946F01D072104E004F00F02B7
+:100B200000F8012D2411002C01DD491EF6D5491EC7
+:100B30005CBF002200F8012DF9D5DCE00020194649
+:100B400002AA0A4400E05B1E12F80149491E8442D1
+:100B5000F9D00F2804D10DF10900425C521C425417
+:100B6000002904D50198001D02AE5B1C0190581E9F
+:100B70000CD43118AAF13A040A783032D7B23A2F9D
+:100B8000A8BFA218401E01F80129F5D5286B00283E
+:100B900040F1A780591E2963A3E001996A4A47F2F0
+:100BA0009750414391FBF2F2019229F00046D2F1B5
+:100BB000070204DD40463146FFF7ABFE0AE0524231
+:100BC00000206249FFF7A5FE02460B46404631462B
+:100BD00000F07EFE8046662C286B06BF019F0A3718
+:100BE00006273F18142FC8BF142730208DF808009F
+:100BF00089460DF1090000E03046002F34DD06463D
+:100C00004046494600F088FF01460A4606F10803BF
+:100C100004200A26B2FBF6F606EB860EA2EB4E0285
+:100C2000303203F8012C0A22B6FBF2F202EB820EFC
+:100C3000A6EB4E063036401E03F8026DE9D1083FA0
+:100C4000002F03F10806D7DD084600F079FF0246C1
+:100C50000B464046494600F0C9FD00223C4B00F0DF
+:100C6000BDFB80468946CBE70DF10901401A0DF125
+:100C7000090604E00199491E401E0191761C317855
+:100C80003029F7D0662C02D10199491C03E0652C6C
+:100C90000CBF012100212B6BCB189842B8BF431E1B
+:100CA000002B1ED4834204DAF05C3528A8BF39201B
+:100CB00000DA30201946721E02EB010800E05B1ECC
+:100CC00018F80199491E8145F9D0392802D1705C84
+:100CD000401C7054002904D50198401C16465B1C2A
+:100CE0000190019800B200901BB23246514628464E
+:100CF00000F034F82EE0C61D002F3FF7CFAE30468F
+:100D00000DF10901401A03465845C8BF5B46002B48
+:100D10000DF109063FF53AAF8342BFF60FAF0DF173
+:100D20000900C15C07297FF709AF0F2007E7000022
+:100D3000CBCCCC0C0000244002FCFFFFFFFF0F8057
+:100D40000000E03F0000F07FA08601000000F03FBF
+:100D500084D797410FB0BDE8F08F00002DE9F84728
+:100D600083B006468A461746984600F0FDF9B8F16A
+:100D7000000F406A356B90F8009002DC4FF00108DC
+:100D8000BFA74AF02000BDF93040662808BF641CA8
+:100D900015D0672840F0848014F1040FC0F28680DB
+:100DA000AC4280F2838096F83800641C010702D4BC
+:100DB000A845B8BF454620B22D1A48BF00250FFAF6
+:100DC00084FAF068B169BAF1000F25DC4A1C3023BF
+:100DD0004354002D03DC96F83800010703D5F06872
+:100DE00000F80290521C15EB0A0FB8BF6C4220B2FB
+:100DF000441941424445B8BFA046B26171620FFA3E
+:100E000088F5F561F068B3692A463946184400F060
+:100E100055FA641BB462C4E022B29045084417DA64
+:100E20004246394600F04AFAB0694044B061AAEB44
+:100E30000801002D716203DC96F838100A0705D509
+:100E4000F16801F80090F069401CF061B562A8E01B
+:100E5000394600F033FAB069002D5044A8EB04087D
+:100E600003DC96F838100A0703D5F16801F8009002
+:100E7000401CB0610FFA88F08542F368B069B8BFD2
+:100E8000A8460FFA88F207EB0A01184400F016FA98
+:100E9000B1690FFA88F00144B161281A706280E0EC
+:100EA000BAF1610F14D14FF0700A16E0A84504DAC8
+:100EB00096F838100A0758BF45466D1E48BF0025F2
+:100EC000BAF1670F14BF4FF0450A4FF0650A04E00E
+:100ED000BAF1410F08BF4FF0500AB169F368481CDE
+:100EE000B061002D17F8012B5A5403DC96F8381026
+:100EF0000A071BD5F168431CB36101F80090002D6F
+:100F000014DDA8F101080FFA88F039468542F76828
+:100F1000B8BFA8460FFA88F2F81800F0CFF9B06908
+:100F20000FFA88F108446D1AB0617562F068B16912
+:100F30000844002C80F800A003D42B224270811CAE
+:100F400003E02D2141706442811C00206A460AE0C2
+:100F500023460A2493FBF4F404EB8405A3EB450336
+:100F600002F8013B401C24B2002CF1DC012806DC15
+:100F70004AF02002652A04BF302201F8012B48B94B
+:100F8000302001F8010B07E0401E1DF8003030331F
+:100F900001F8013B0028F7DCF268B0691044091A37
+:100FA000F16196F8380000F0140010280DD1726934
+:100FB000B169706A8A18F1698218B06A8A18821851
+:100FC000706B8242BCBF821A326204B0BDE8F08707
+:100FD000F8B505460E4617461C46002074B117F8B2
+:100FE000011BB068A847B06030B1F06A401CF062E5
+:100FF0000020641EF3D1F2BD4FF0FF30F2BD0000BF
+:101000007072696E74665F733A20256E206469732E
+:10101000616C6C6F776564007072696E74663A20FB
+:1010200062616420256E20617267756D656E740063
+:101030007072696E74665F733A2062616420257312
+:1010400020617267756D656E740000007072696E64
+:1010500074665F733A2062616420256C732061724C
+:1010600067756D656E7400000000000000000000F0
+:101070006E616E004E414E00696E6600494E46003C
+:101080003000F0B40246106895681318506803EBFE
+:101090005004C0071DD54D441BE013F8017B05F833
+:1010A000017B491EF9D1A0B1B60813F8011B06F067
+:1010B0000306032E08BF13F8016B01EB062149421A
+:1010C000801C294405D011F8016B05F8016B401E06
+:1010D000F9D1A3420ED013F8016B16F0030104BF3F
+:1010E00013F8011BC91C30090F28DAD113F8010BC2
+:1010F0000F30D6E7F0BC02F10C0070471B48704778
+:1011000070B45368D418042B09DA41B1057804F897
+:10111000015B10F8016B16B15B1C491EF3E75360CD
+:1011200070BC704738B514461D4661B1FFF7E8FF43
+:1011300061686A6B204690476FF00102811A02D005
+:10114000491E01D001E003E005E00021616032BDED
+:101150006FF0010032BD4FF0FF3032BDDA6B104747
+:10116000024BDFE7014BF9E701487047D810002038
+:10117000A0100020C9B202788A421AB11CBF10F830
+:10118000012FF9E718BF0020704730B4002513E0A5
+:1011900050F8042BD30744BFA9F101039A18091F83
+:1011A000042942F8045BFAD213468C0744BF158029
+:1011B0009B1CC90748BF1D7050F8041B0029E7D1CC
+:1011C00030BC704780B500B906A005490B681BB15B
+:1011D00022220021984701E000F0BFFC222002BD3E
+:1011E000AC170020636F6E73747261696E7420684F
+:1011F000616E646C65723A20626164206D65737320
+:101200006167650000F10103810704D010F8011B3C
+:10121000820781B1FAD10268A2F10131914311F044
+:10122000803104BF50F8042FF6E709BAB1FA81F112
+:1012300000EBD100401CC01A7047B1F5807F02D38B
+:101240004FF0FF3070470170012070470078401E5A
+:101250008041C043C00F7047C9B2830706D0521EF9
+:1012600022D310F8013B9942F7D11FE0083A13D37B
+:1012700002F1040241EA012141EA014150F8043B34
+:10128000121F21BF4B40A3F1013C2CEA030C1CF0C0
+:10129000803FF3D0C9B2001F083210F8013B521E44
+:1012A00028BF91EA030FF8D818BF0120401E7047ED
+:1012B00080B5FFF723FF006C02BD00004AB10000BB
+:1012C00011F8013B521E00F8013B1CBF11F8013B15
+:1012D000F8E77047D3BBD9B1B2F5803F5BD2022AA1
+:1012E0001ED98C46B1FBF2F102FB11C31B0443EA89
+:1012F0001043B3FBF2FC02FB1C3380B240EA034311
+:10130000B3FBF2F002FB103240EA0C4000237047BE
+:10131000022A05D98446B0FBF2F002FB10C27047E6
+:101320004AB105D100F0010249085FEA3000704778
+:1013300000220023704700F013BC0B0002000021C4
+:1013400000207047F7D3002200237047904271EBD2
+:10135000030CF2D370B5B1FA81F4B3FA83F52C1B08
+:10136000A340C4F1200532FA05F63343A2405FF0F2
+:101370000046E64002E05B085FEA3202841A71EB45
+:10138000030524BF204629467641F4D302000B0012
+:101390003000002170BD70B5B1FA81F4B2FA82F567
+:1013A000C4F120046419B4F12006DAD3B2405FF02E
+:1013B0000044F440002502E052085FEA3303C61AF5
+:1013C00071EB020E24BF3046714664416D41F3D388
+:1013D00002000B002000290070BD0000B0B581EABA
+:1013E000030C0CF0004C40F2FF7515EA11541DBFC0
+:1013F00015EA1357AC42AF4239E0E41923EA4553EA
+:1014000043F48013C90241F0004141EA505EC70233
+:101410001100A7FB020200284FF00000EEFB0120A4
+:101420004FF00001E3FB072118BF42F00102401812
+:1014300000214941E3FB0E01A4F580640F0302D2B1
+:1014400052004041494154F101046CDD470872F1FA
+:10145000004250F1000051EB0451A1F580115CBF36
+:1014600041EA0C01B0BD4CEA05510020B0BD05EACF
+:101470001357AC4214BFAF4241E050EA410E1CBFCB
+:1014800052EA430E02E061460020B0BD24423C44D3
+:101490001BD15FEA070EF6D0090302BF0146002008
+:1014A000AEF1140EB1FA81F7AEEB070401FA07FEB4
+:1014B0000C37C7F1200100FA07F7C8404EEA000ECA
+:1014C00023EA455343F48013A2E733F00043B3FA11
+:1014D00083F704BFB2FA82FE77440B3FE41BB7F1F7
+:1014E000200E2FBF02FA0EF3BB40C7F1200E22FAE6
+:1014F0000EFE38BF43EA0E03BA40641C82E750EA8E
+:10150000410E14BF52EA430E6FF000014FF4001772
+:1015100017EB430F8ABF194617EB410FB5E74CEAAB
+:1015200005510020B0BDD4F10104B4F120070FDA59
+:10153000C4F12007520828BF42F0010210FA07F553
+:1015400001FA07F7E1BF2A43E0403843E1400FE0EA
+:10155000352C98DCC7F1200452EA400220FA07F249
+:1015600018BF42F0010231FA07F0A1400A430021FE
+:1015700072F1004250F1000051EB0C01B0BD0000CF
+:1015800010B5144600F002F8226010BDC1F30A53F2
+:1015900043B14A0012F5001F28D2A3F2FE32A1EB9C
+:1015A0000251704750EA410C20D001F0004C31EA62
+:1015B0000C01B1FA81F204BFB0FA80F3D2180B3AF1
+:1015C000B2F120032CBF00FA03F1914041EA0C0173
+:1015D0003EBFC2F1200C20FA0CF319439040524256
+:1015E00040F2FD33D21A01EB0351704700227047DD
+:1015F0004FF4001C1CEB410F94BF1CEB430F09E0A0
+:1016000041EA030C50EA4C0C52EA0C0C03D299420A
+:1016100008BF9042704714BF8B428242704700005F
+:101620004FF4001C1CEB410F94BF1CEB430F09E06F
+:1016300041EA030C50EA4C0C52EA0C0C03D28B42E8
+:1016400008BF8242704714BF994290427047000021
+:10165000124254D440F2FF7C1CEA11530FD0634570
+:1016600031D09B1863453CBF01EB0251704701F03C
+:10167000004141EA0C510020AFF30080704750EA6E
+:10168000410320D001F0004C91EA0C011CD0B1FACA
+:1016900081F30B3B9A420DD9D21A994051EA0C01C1
+:1016A000C3F1200C20FA0CFC61449840531C40F21A
+:1016B000FF7CD7E7914041EA0C01C2F1200C20FAEF
+:1016C0000CF3194390407047B0FA80F31533202B88
+:1016D000E0D3202AEED3203A203B9A4209D9D21AED
+:1016E00000FA03F141EA0C010020531C40F2FF7C98
+:1016F000B8E700FA02F141EA0C01002070475242BB
+:1017000040F2FF7C1CEA11530DD06345DBD0B2EBF5
+:10171000030C3CBFA1EB025170470CF1010221EA1E
+:10172000035141F4801150EA410CCCD001F0004C3F
+:10173000352A27DC30B481EA0C01B2F1200309DA42
+:10174000C2F12003044601FA03F5D0402843D140FA
+:101750009C400CE0C3F12002450020FA03F418BFBE
+:1017600044F0010421FA03F091400C43002174F18C
+:10177000004550F1000051EB0C01244230BC7FF4D5
+:101780007BAF70476146002076E70000C1F30A5343
+:1017900040F2FE329B1A14DDD3F120034FEAE172CE
+:1017A00008DDC90241EA505141F00040D84080189C
+:1017B0005040704703F2E13010B1D24382F0004054
+:1017C0007047002070470000C11768B14840401AB8
+:1017D000B0FA80F29040D21CC907C2F5846241EA97
+:1017E000025202EBD02140057047000070B44FF068
+:1017F000004591EA030F40F1B5816B40841A71EB0B
+:10180000030603D2001BB141121973414FF4001CAF
+:101810001CEB410F34BF7CEB430442E00C0DA4EB06
+:101820001356352E4FDC45EAC323DB0A45EAC121B6
+:10183000C912B6F120050DDD63FA05F6EB4086EA24
+:101840000305124218BF45F00105C01851F100010F
+:101850000CD213E062FA06F5F2405540F3415A40CB
+:10186000B340F3405A408018594107D349085FEA12
+:1018700030005FEA350528BF45F0010501F580110C
+:10188000420875F1004250F1000041EB04514E0056
+:1018900016F5001F70BC38BF70470020090D090500
+:1018A00070471CEB410F10D252EA43060BD0BCEB41
+:1018B000410F05D80C0DAB43661E342EB6DD02E099
+:1018C000AB438018594170BC704770BC7047000032
+:1018D000F0B540F2FF7581EA030C0CF0004C15EAFC
+:1018E00011541DBF15EA1357AC42AF42E5E0BC41AD
+:1018F000C1F31301C3F31303801A994143F4801316
+:1019000004D2641E4000494180185941C90241EA8D
+:101910005051B1FBF3F603FB1611A2FB0675D7EB92
+:10192000C020A94102D2761E80185941C90241EA5D
+:101930005051B1FBF3FE03FB1E11A2FB0E75D7EB5A
+:10194000C020A94103D2AEF1010E8018594189028D
+:1019500041EA9051760546EA8E2EB1FBF3F603FB81
+:101960001611A2FB0675D7EB8020A94102D2761E84
+:1019700080185941C90241EA50514EEA060EB1FBA6
+:10198000F3F603FB1611A2FB0675D7EBC020A941A5
+:1019900002D2761E80185941C90241EA5051B1FB6A
+:1019A000F3F703FB1711A2FB0735D3EBC020A941C6
+:1019B00067F100070CBF004247F0010766F3D52727
+:1019C0004FEA1E31B80814F5806412DDBD0775F1C9
+:1019D000004250EB0E5051EB045111F5801F5CBFDB
+:1019E00041EA0C01F0BD4CF07F6141F0E041002084
+:1019F000F0BDBD076D0840EA0E5041F48011D4F1EE
+:101A00000104B4F120060ADAC4F120060200E04025
+:101A100001FA06F3E1401843B24015430EE0342CBE
+:101A200013DCC6F1200445EA40056D0820FA06F2F1
+:101A3000154321FA06F0A1400D43002175F1004243
+:101A400050F1000051EB0C01F0BD00205FEA0C01E9
+:101A5000F0BDCFB992185B41B3FA83F704BFB2FA75
+:101A600082F6BF190B3FB7F120062FBF02FA06F32B
+:101A7000BB40C7F1200622FA06F638BF3343BA400E
+:101A80001CB1E419641E33E77F4231F00041B1FA22
+:101A900081F404BFB0FA80F6A4190B3CB4F120061F
+:101AA0002FBF00FA06F1A140C4F1200620FA06F685
+:101AB00038BF3143A0403C1B1AE7AC421ABF05EACD
+:101AC0001357AF4212E050EA41061CBF52EA4306E8
+:101AD000BFE750EA4107304661461CBF41EA055165
+:101AE000F0BD52EA430C08BFC143F0BD00204FF4E3
+:101AF000001616EB410F98BF16EB430F08BF16EB0D
+:101B0000410F24BFC14305E016EB430F0CBF6146F4
+:101B10004CEA0551F0BD0000400D491840EA812013
+:101B20000CD2490DA1F58061491C40F0004005DB55
+:101B3000D1F11F0154BFC840C01770470020704743
+:101B4000014648B1B0FA80F18840C91CC1F58461F2
+:101B5000090501EBD02140057047012000F0B8B81D
+:101B600070470000841A71EB030604D26E40001B1C
+:101B7000B141121973414FF4001C1CEB410F34BFEB
+:101B80007CEB430683E00C0DA4EB1356362E00F3DA
+:101B90007C80012E45EAC32341DC43EA525312BF45
+:101BA000D20292025B08240545EAC12141EA505164
+:101BB000D2EBC020994125D407D1B0FA80F610FAB3
+:101BC00006F162D00020203608E0B1FA81F6B1407B
+:101BD000C6F1200220FA02F21143B0404FEAF47439
+:101BE000B4EB465434F001064FEA74040AD8D6F533
+:101BF0000016760D04F00044F04061FA06F2504001
+:101C0000F1404840C00A40EA415021F0004128BF5D
+:101C10005FEA500550F1000044EBD12135E0DB0ACA
+:101C200045EAC121C90AB6F120050EDD42EA0242A9
+:101C3000120CC5F1200603FA06F6EB4042EA06054F
+:101C40006D42984161F100010DE062FA06F5F24043
+:101C5000554063FA06FC82EA0C02F3405A406D429A
+:101C6000904161EB030111F4801F05D1641E6205F0
+:101C700002D06D004041494121F48011430875F1C3
+:101C8000004350F1000041EB045170BC70471CEB65
+:101C9000410F15D223F0004352EA43060BD04FEA1E
+:101CA0004C0CBCEB410F04D80C0D661E342EB7DD76
+:101CB000EBE7801A994150EA410608BF0021E4E7AA
+:101CC00008BF1CEB430F28BF6FF00001DDE70000E9
+:101CD00080B5AFF30080024A11001820ABBEFBE7CD
+:101CE0002600020038B5040009D004F17C056968BB
+:101CF00009B900F01EF800F021F8012801D10120F7
+:101D000032BDA06A08B100F02AF800F00AF821F00C
+:101D10002A01FFE7816000F01BF8BDE8324000F0C7
+:101D20002EBE2068416821F490414160206881689E
+:101D3000704700202870204600F04FBF24216960C2
+:101D400020680268520852000260204600F040B944
+:101D50002068016841F0010101602046704720467B
+:101D600000F0AABD70B5044604F17C05134668680E
+:101D7000202836D149B3180027D02878012830D040
+:101D800001222A7004F154062165338073800020FB
+:101D9000E86021216960306AC8B1DFF82012C162B1
+:101DA000DFF81C02316A0863316ADFF81802486301
+:101DB0000020316A88632068216D00F12802306AB2
+:101DC00001F035F818B100F00EF8012070BD21685F
+:101DD0004020086200222A702068816841F080015A
+:101DE00008E0022070BD1020E86000212970202248
+:101DF0006A6070478160002070BD206881684A0673
+:101E00007047F8B5044640F60F002568E9692A686E
+:101E1000AB6808400DD1880602D5960602D4D800DA
+:101E200040F18980E16E00294FD02046BDE8F440A2
+:101E300008476548034204BF644E32427BD0CE0758
+:101E400009D5D70507D501262E62D4F8885045F06C
+:101E50000105C4F888508D070AD5DE0708D5276824
+:101E600002253D62D4F8885045F00405C4F8885036
+:101E70004D070AD5DE0708D5276804253D62D4F84A
+:101E8000885045F00205C4F888500D070CD5960619
+:101E900001D4034208D0256808202862D4F88800BD
+:101EA00040F00800C4F8880008050BD5550109D595
+:101EB00026684FF400603062D4F8880040F02000BB
+:101EC000C4F88800D4F88800002870D0880607D5A8
+:101ED000910601D4D80003D5E16E09B120468847A8
+:101EE000D4F8880021688A68510602D410F0280FBF
+:101EF0001AD0204600F0C5FDFFF77FFF0FD500F098
+:101F000057F860B1DFF890198163A06F00F0CEFF41
+:101F100000284CD0A06F816BBDE8F44008472046F4
+:101F2000BDE8F24001F0BAB8204601F0B7F8002051
+:101F3000C4F88800F1BDC80209D55E0207D54FF488
+:101F4000801028622046BDE8F24001F031B9080651
+:101F500009D5160601D4180205D5216F39B32046DC
+:101F6000BDE8F440084748060FD553060DD528684C
+:101F700020F0400028602021C4F880100020206755
+:101F80002046BDE8F24001F03EB9080206D55300F4
+:101F900004D52046BDE8F24001F050B9C80148BF61
+:101FA000002A04D52046BDE8F24001F048B9F1BD51
+:101FB000816821F040018160A06F7047D52A000838
+:101FC000032B0008092B0008010000102001000469
+:101FD0002DE9F84F0446DFF8C8182768DFF8C4B8C1
+:101FE0003A68A068DFF8C0A80A4021690243606926
+:101FF0000A43E1690243606E0A4302433A600026E5
+:102000007968E068DFF8942821F440510143796051
+:102010009742A1691CBF206A0143BA68DFF8840AAD
+:1020200002401143B960B046F96A606A090940EAA2
+:102030000111F9625F454FF400404FF480754FF491
+:1020400000714FF480624FF400634FF4805C4FF4F2
+:10205000005E4FF4804929D1DAF800B00BF0030B91
+:10206000BBF1030F3ED8DFE80BF00237343A4FF0F4
+:10207000010AD4F81CB05746BBF5004F4FF6F07A72
+:1020800040F01283012F09D0022F00F05582042F57
+:1020900000F08E82082F00F0C382F6E201F09DFC72
+:1020A0000146606A002840F01C8243E2DFF8ECB78A
+:1020B0005F4517D1DAF800A01AF4406A27D0BAF5C4
+:1020C000806F09D0BAF5006F03D0BAF5406F06D023
+:1020D00008E04FF0020A07E04FF0040A04E04FF076
+:1020E000080A01E04FF0100ADFF8B0B75F45C0D131
+:1020F000BAF1000F0BD0BAF1020F49D0BAF1040FB8
+:1021000000F08280BAF1080F00F0B180B7E301F06F
+:102110005CFC0146606A58B3012808BF022028D041
+:10212000022808BF042024D0032808BF062020D09E
+:10213000042808BF08201CD0052808BF0A2018D092
+:10214000062808BF0C2014D0072808BF102010D084
+:10215000082808BF20200CD0092808BF402008D03C
+:102160000A2808BF802004D00B2808BF284600D0CA
+:102170000120B1FBF0F0002800F08383626802EBDD
+:102180004201884203D31303834280F0A28076E3A6
+:10219000606AB0B3012808BFDFF80C09EED002284E
+:1021A00008BFDFF80809E9D0032808BFDFF80009F5
+:1021B000E4D0042808BFDFF8FC08DFD0052808BFFA
+:1021C000DFF8F408DAD0062808BFDFF8F008D5D029
+:1021D000072808BFDFF8E808D0D0082808BFDFF8D4
+:1021E000E408CBD0092808BFDFF8DC08C6D00A28ED
+:1021F00008BFDFF8D808C1D00B2808BF4FF2244031
+:10220000BCD0DFF8CC08B9E701F095FB0146606A65
+:102210000028ADD0012808BF0220AAD0022808BF9C
+:102220000420A6D0032808BF0620A2D0042808BF97
+:1022300008209ED0052808BF0A209AD0062808BF8B
+:102240000C2096D0072808BF102092D0082808BF7D
+:1022500020208ED0092808BF40208AD00A2808BF35
+:10226000802086D00B2808BF2846FAD080E7676A0E
+:10227000002FC8D0012F08BF484629D0022F08BF21
+:10228000704625D0032F08BF41F2555020D0042FAF
+:1022900008BF60461CD0052F08BF40F6CC4017D0C1
+:1022A000062F08BF40F6AA2012D0072F08BF1846F5
+:1022B0000ED0082F08BF10460AD0092F08BF0846C5
+:1022C00006D00A2F08BF284602D00B2F00D180204D
+:1022D00054E7BAF1000F0BD0BAF1020F38D0BAF1BF
+:1022E000040F00F07280BAF1080F00F0A780ECE054
+:1022F00001F06BFB0146606A40B3012808BF02256C
+:102300001ED0022808BF04251AD0032808BF0625BE
+:1023100016D0042808BF082512D0052808BF0A25B2
+:102320000ED0062808BF0C250AD0072808BF1025A4
+:1023300006D0082808BF202502D0092808BF40255C
+:1023400072D00A280CBF80250B286DD001256BE0C8
+:10235000606A002836D0012808BFDFF80C682BD04F
+:10236000022808BFDFF8046826D0032808BFDFF87A
+:10237000006821D0042808BFDFF8F8671CD00528C2
+:1023800008BFDFF8F46717D0062808BFDFF8EC674E
+:1023900012D0072808BFDFF8E8670DD0082808BF6B
+:1023A000DFF8E06708D0092808BFDFF8DC6703D052
+:1023B0000A2808BFDFF8D4677CD00B2808BFDFF8F5
+:1023C000106777D0DFF8C86774E001F0B4FA01460F
+:1023D000606A40B3012808BF022525D0022808BF43
+:1023E000042521D0032808BF06251DD0042808BFD6
+:1023F000082519D0052808BF0A2515D0062808BFCA
+:102400000C2511D0072808BF10250DD0082808BFBB
+:10241000202509D0092808BF402505D00A280CBF6F
+:1024200080250B2800D001256268B1FBF5F6500825
+:10243000002110EB062051EB166141E0606A002894
+:1024400036D0012808BF4FF4800633D0022808BFD9
+:102450004FF400162ED0032808BFDFF8386729D0C4
+:10246000042808BF4FF4801624D0052808BFDFF8E1
+:1024700028671FD0062808BFDFF820671AD0072872
+:1024800008BF4FF4002615D0082808BF4FF4802657
+:1024900010D0092808BF4FF400360BD00A2808BF17
+:1024A0004FF4803606D00B2808BF4FF4004601D009
+:1024B0004FF40006C246002116EB52004AEB010120
+:1024C0000023FEF707FF064601E04FF00108A6F5DE
+:1024D0004070DFF8CC16884280F0D1812268D66047
+:1024E000CFE1012808BF02251AD0022808BF042521
+:1024F00016D0032808BF062512D0042808BF0825D7
+:102500000ED0052808BF0A250AD0062808BF0C25CA
+:1025100006D0072808BF102502D0082808BF2025AC
+:1025200075D0092808BF402571D00A280CBF802526
+:102530000B286CD001256AE0606AB0B3012808BF9F
+:10254000DFF88C0521D0022808BFDFF85C051CD01D
+:10255000032808BFDFF84C0617D0042808BFDFF8AF
+:102560004C0512D0052808BFDFF83C060DD0062820
+:1025700008BFDFF83C0508D0072808BFDFF834059E
+:1025800003D0082808BFDFF838057AD0092808BF2B
+:10259000DFF8300575D00A2808BFDFF82C0570D0A9
+:1025A0000B2808BFDFF824056BD0DFF8E00568E0F2
+:1025B00001F0C1F90146606A40B3012808BF022555
+:1025C00025D0022808BF042521D0032808BF0625EE
+:1025D0001DD0042808BF082519D0052808BF0A25E2
+:1025E00015D0062808BF0C2511D0072808BF1025D4
+:1025F0000DD0082808BF202509D0092808BF40258C
+:1026000005D00A280CBF80250B2800D00125606862
+:10261000B1FBF5F1420802EB4102B2FBF0F632E009
+:10262000666A66B3012E2CD0022E08BF484628D019
+:10263000032E08BF42F6AA2023D0042E08BF7046FE
+:102640001FD0052E08BF41F698101AD0062E08BFDD
+:1026500041F2545015D0072E08BF604611D0082E05
+:1026600008BF18460DD0092E08BF104609D00A2E03
+:1026700008BF084605D00B2E08BF284601D04FF4EE
+:10268000803000F013F9B6B201E04FF00108A6F176
+:102690001000504580F0F3800AEA0601C6F34200BC
+:1026A00001432068C160ECE0012F07D0022F35D034
+:1026B000042F70D0082F00F0A580D7E001F08DF92D
+:1026C0000146606A40B3012808BF022516D00228DF
+:1026D00008BF042512D0032808BF06250ED0042801
+:1026E00008BF08250AD0052808BF0A2506D00628F5
+:1026F00008BF0C2502D0072808BF10257AD008286B
+:1027000008BF202576D0092808BF402572D00A28A6
+:102710000CBF80250B286DD001256BE0606AB0B33B
+:10272000012808BFDFF8801333D0022808BFDFF884
+:102730007C132ED0032808BFDFF8741329D0042897
+:1027400008BFDFF8701324D0052808BFDFF868132E
+:102750001FD0062808BFDFF864131AD0072808BF67
+:10276000DFF85C1315D0082808BFDFF8581310D025
+:10277000092808BFDFF850130BD00A2808BFDFF87C
+:102780004C1306D00B2808BF4FF2244101D0DFF8CC
+:102790004013606831E001F0CEF80146606A40B352
+:1027A000012808BF022525D0022808BF042521D012
+:1027B000032808BF06251DD0042808BF082519D006
+:1027C000052808BF0A2515D0062808BF0C2511D0FA
+:1027D000072808BF10250DD0082808BF202509D0DC
+:1027E000092808BF402505D00A280CBF80250B28E2
+:1027F00000D001256068B1FBF5F101EB5001B1FBA0
+:10280000F0F631E0666A6EB3012E08BF484629D063
+:10281000022E08BF704625D0032E08BF41F2555046
+:1028200020D0042E08BF60461CD0052E08BF40F6FD
+:10283000CC4017D0062E08BF40F6AA2012D0072E93
+:1028400008BF18460ED0082E08BF10460AD0092E21
+:1028500008BF084606D00A2E08BF284602D00B2E15
+:1028600008BF802000F022F8B6B201E04FF0010866
+:10287000A6F11000504502D22168CE6001E04FF071
+:10288000010804F1680001210023418001804360B8
+:1028900083604046BDE8F28F572B0008008000405F
+:1028A000F369FFCF0038014088000058616800EBF1
+:1028B0005100B0FBF1F6704790F82810CA0706D512
+:1028C00002685368C16A23F400330B43536090F8E5
+:1028D00028108A0706D502685368016B23F48033F9
+:1028E0000B43536090F828104A0706D502685368D6
+:1028F000416B23F480230B43536090F828100A07A0
+:1029000006D502685368816B23F400430B43536080
+:1029100090F82810CA0606D502689368C16B23F4A4
+:1029200080530B43936090F828108A0606D50268FE
+:102930009368016C23F400530B43936090F82810C4
+:102940004A0610D502685368416C23F480130B4388
+:102950005360436CB3F5801F05D15368816C23F439
+:10296000C0030B43536090F828100A0606D501688F
+:102970004A68C06C22F4002202434A607047F8B5EE
+:10298000044604F17C050020E8606FF07E4701F00A
+:10299000B1F80646206801680A0708D50097334653
+:1029A00000224FF40011204600F016F860B92068AC
+:1029B00001684A070AD50097334600224FF4800188
+:1029C000204600F009F808B10320F2BD202068601D
+:1029D000A86000202870F2BD2DE9F041069C054654
+:1029E0000E4690461F462868C1693140B1420CBF6F
+:1029F00001200020404528D114F1010FF3D001F04F
+:102A000079F8C01B844200D34CB92868016821F4CE
+:102A1000D071016000F01CF80021017013E02868FB
+:102A200001684A07DFD5C1690A05DCD54FF40061AA
+:102A300001622868026822F4D0720260002200F06D
+:102A400007F8C1600270032000E00020BDE8F081BB
+:102A50002868816849084900816005F17C002021CF
+:102A600041608160704701680A6822F0C0020A6014
+:102A700001688A6822F400028A602021C0F8801070
+:102A8000704701680A6822F490720A60DFF81C112E
+:102A9000026893680B4093602022C0F884200021D4
+:102AA000C1667047FFF4FF1100127A0000093D0073
+:102AB000AAB0280080841E00006A1800555814002F
+:102AC00040420F0020A1070090D0030048E8010019
+:102AD0000024F400816A00680268930644BF084637
+:102AE00000F091BB0020A1F856000868826822F02F
+:102AF000800282600868FFE7016841F040010160E0
+:102B00007047806A00F0FCBFF8B5846A04F1800564
+:102B100004F1560728686E6821688A68110606D590
+:102B2000212804D1002038802046FFF79CFF21682F
+:102B30008868410606D5222E04D10020388120461F
+:102B4000FFF79FFFA86840F01000A8602046BDE88E
+:102B5000F24000F0A3BA806A00F1560100220A8117
+:102B60000A8000F09BBA00000000127A0000093DC4
+:102B700000AAB0280080841E00006A18005558146E
+:102B80000040420F0020A1070090D0030048E80158
+:102B9000000024F40055150000CC0C0000AA0A0027
+:102BA00000FD0F005461510000D43000FEFFFFEF24
+:102BB000604981B00A6802430A600968084008E079
+:102BC0005D4881B0016841F400210160006800F4B3
+:102BD00000200090009801B0704738B586B00446D8
+:102BE0006846142100F08EFF2068544D5449A842D5
+:102BF00030D10868534D40F001000860096801F0C9
+:102C00000101059105980120FFF7D2FF02210191F2
+:102C1000002202920C2003210090039100F05AF848
+:102C2000002202920392402002210090019100F0C4
+:102C300051F845482860112100F053F808B101F01F
+:102C4000B3F86567AC6200220021252001F0C8F8C6
+:102C500025203BE03D4A90423AD148683C4D40F443
+:102C600080404860486800F4804005900598012045
+:102C7000FFF79EFF0220FFF79BFF002202920392C4
+:102C80004FF40060022100900191072200F023F828
+:102C90000221019101220292C020032100900391A0
+:102CA0000722049269462B4801F00EF92A48286051
+:102CB0000F2100F016F808B101F076F86567AC62F4
+:102CC00000220021242001F08BF8242001F0A5F837
+:102CD00007B030BD0822049269464FF0904001F0E1
+:102CE000F3B8696000201022E86080216861A86163
+:102CF000E8612862AA602961284600F033B810B55F
+:102D0000044616492068884213D101F0ABF901F05E
+:102D1000A9F91348016821F4407141F48071016000
+:102D2000026842F4004202602046BDE8104001F013
+:102D3000ACB910BD4C000058500000580080004055
+:102D40005C00005854150020440002400038014047
+:102D5000B41500200004004844040240002800404C
+:102D60009000005870B5040001D1012070BD2268A8
+:102D7000DFF800339A4204F124050BD2DFF8F802A1
+:102D800081181426B1FBF6F18900DFF8F0322962D0
+:102D9000EB610AE0DFF8E80281181423B1FBF3F1DC
+:102DA0008900DFF8E0022962E86102216970136896
+:102DB000A068E1686FF30E13034320690B43616958
+:102DC0000343A0690B43E1690343206A0B430343B8
+:102DD0001360204600F022F9A068B0F5804F04BFD0
+:102DE00000216160696A207900F01BF838B105287C
+:102DF00005D2204600F02FF900F00CF803E0002087
+:102E000028636863A8630021A961012068702970A4
+:102E1000002070BD296B00200860696BA86B4860BA
+:102E200070470860A96AE86A486060687047F8B54A
+:102E3000044604F1240600253078012801D102203F
+:102E4000F2BD012030707778012F2BD102207070F5
+:102E5000B561206807687F087F000760204600F0A2
+:102E6000C1F82168F06820B10A6842F00E020A60D9
+:102E700008E0086820F0040008602068016841F05C
+:102E80000A010160706A0168CA0301D500F044F8C4
+:102E9000306B08B100F040F82068016841F0010192
+:102EA000016001E0357002252846F2BD38B500F119
+:102EB000240200245178022903D0042090610124C7
+:102EC00028E001680B6823F00E030B6001680D68B1
+:102ED0006D086D000D60516A0B6823F480730B6000
+:102EE000012192F82030D56903F01C0399406960F4
+:102EF000936AD16A5960116B31B10B6823F4807306
+:102F00000B60536B916B59600121517014705169C2
+:102F100001B18847204632BD016841F480710160EB
+:102F20007047F8B500F124010423CA6914680268E7
+:102F3000156891F8206006F01C0603FA06F73C427B
+:102F400010D06F070ED51468A50603D4146824F0BA
+:102F50000404146000F03DF8C968002938D0BDE8C9
+:102F6000F4400847022303FA06F73C4213D0AF07A8
+:102F700011D51468A50605D4146824F00A04146059
+:102F800001224A7000F025F800220A708968F9B120
+:102F9000BDE8F4400847082303FA06F6344217D088
+:102FA0002B0715D5146824F00E041460012291F843
+:102FB0002030CC6903F01C039A40626001228A61D0
+:102FC0004A7000220A70096911B1BDE8F44008474F
+:102FD000F1BD91F82020CC6902F01C02934063609F
+:102FE0007047000070B5C56C046D6C60446D14B121
+:102FF000856DC46D6C60012490F84450066C05F03A
+:103000001C05AC407460046863608068102802D1BD
+:10301000A260E16070BDA160E26070BD10B5416C5E
+:103020000268144B89089A4239BF174C04EB81019E
+:10303000164B03EB8101816402F0FF02083A142170
+:10304000B2FBF1F1012301F01C01114AC26403FA41
+:1030500001F1016510BD01790E4A0F4B836502EB4A
+:1030600081024265491E012201F003018A40C265C6
+:103070007047000008040240F8FFFDBF0000024056
+:10308000F8FBFDBF00040240000802401C0802409B
+:1030900080080240FC0802404009024070470000DE
+:1030A00010B500F17C010A78012A01D1022010BD7F
+:1030B00001220A7024234B600268136814686408B4
+:1030C000640014600022426623F00053006803602D
+:1030D00020224A6000230B70002010BD70B500F064
+:1030E0001FF801D1022070BD00F020F822F06042EC
+:1030F00009E070B500F014F801D1022070BD00F0B5
+:1031000015F822F0606211438160204600F01CF83F
+:10311000206806602021696000222A70002070BDAE
+:10312000044604F17C0528780128704701202870A6
+:1031300024226A6020680668026852085200026011
+:103140002068826870470000FFB500BF14A200BF6E
+:1031500015A6D2E9003402A9C1E90034D6E900710C
+:10316000CDE90071416E11B90121012213E001681E
+:103170008A688968520E02F00702490F02AC655C4A
+:10318000A45C1DF801101DF80220ED00E40095FB81
+:10319000F1F194FBF2F2683041800280FFBD000043
+:1031A00001010103070100000804020408010101F4
+:1031B0007047000063601C481C4B704723601C482C
+:1031C0001C4B704770B51C46002300251A4E10B1E9
+:1031D000022804D00AE03460FFF7F1FF02E07460D7
+:1031E000FFF7E9FF0360FEF7BDFD0346012B05D0A5
+:1031F00007D3032B04D038BF022502E0012500E0ED
+:103200000325284670BD0068084A0B49904205D046
+:10321000084A904206D1086820B100474868002853
+:1032200018BF0047704700003C130020008000409A
+:10323000C813002000380140601700207047704715
+:103240004FF0B040006800F0F000B02888BFB02018
+:1032500070472DE9F041040062D0207881064FF0DC
+:10326000B04533D5A868E96810F00C0001F00301FF
+:1032700004D00C2808BF012940F07E80286881070F
+:1032800002D5E06900284BD0FFF7DAFF616A884277
+:1032900007D2084600F0B2FB002815D100F052FA20
+:1032A0000AE0286820F0F000014300F050FA606A5C
+:1032B00000F0A4FB002807D100F028FFDFF8D407B6
+:1032C000006800F073FF002840F08E812078C1076D
+:1032D00011D5A868E96800F00C00082801F0030186
+:1032E00003D00C2808BF032969D12868810302D5BF
+:1032F0006068002814D0217888071AD5A868E96882
+:1033000000F00C00042801F0030104D00C2808BFD1
+:10331000022940F08D802868410503D5E068002827
+:1033200000F062816868216920F0FE4040EA016097
+:1033300068602168DFF8606711F0180F00F076818F
+:103340006069002800F0AF80C806706840F19C807A
+:10335000800708D4716841F00101716000F0CAFB78
+:1033600007467068800700F1418100F0C3FBC01B75
+:103370000328F6D30320DEE1E06978B1296841F043
+:10338000010100F0CEFA06462868800700F13D8171
+:1033900000F0B0FB801B0328F6D3EBE72868400859
+:1033A0004000286000F0A6FB0646286800F0C6F939
+:1033B0008CD000F09FFB801B0328F6D3DAE760680F
+:1033C000B0F5803F04D1286840F48030286011E0D7
+:1033D000B0F5A02F286806D140F480202860296825
+:1033E00041F4803105E020F480302860296821F420
+:1033F00080212960606860B100F07CFB0646286887
+:1034000080033FF578AF00F075FB801B6528F6D38D
+:10341000B0E700F06FFB06462868400C10F0010092
+:103420003FF469AF00F066FB801B6528F4D3A1E789
+:10343000E06878B1296841F4807100F072FA0646BC
+:10344000286840053FF56EAF00F054FB801B032851
+:10345000F6D38FE7286820F48070286000F04AFBDC
+:1034600006462868800A10F001003FF462AF00F0C1
+:1034700041FB801B0328F4D37CE700F03BFBC01B1F
+:103480000328C0F0CF8075E740F0010000F070F92C
+:1034900007467068800700F1E08000F02BFBC01B3E
+:1034A0000328F6D366E7706820F0040000F060F9A6
+:1034B00007467068C00810F0010000F0DD8000F0E1
+:1034C00019FBC01B0428F4D354E70528306806D143
+:1034D00040F004003060316841F0010105E040082F
+:1034E00040003060316821F004013160A06841F291
+:1034F000893768B100F0FEFA80463068800700F135
+:10350000D08000F0F7FAA0EB0800B842F5D331E71D
+:1035100000F0F0FA8046306800F010F900F0C18049
+:1035200000F0E8FAA0EB0800B842F4D322E700F07C
+:10353000E1FAC01B0328C0F0C2801BE7400840002E
+:10354000B06000F0D7FA0746B06800F0F7F800F076
+:10355000BA8000F0CFFAC01B0328F5D30AE700F0C9
+:10356000C9FA801B0328C0F0C08003E700F0C2FA4C
+:10357000001B0328C0F0DA80FCE6E968DFF81C05D0
+:1035800089088900E960E9680140E96000F0B2FA61
+:10359000044600F0E5F825D000F0ACFA001B032843
+:1035A000F7D3E7E601281FD0E868226B00F003019B
+:1035B000914202BF00F07001626B914214D1A26B84
+:1035C000C0F30621914202BF00F47811E26B9142F0
+:1035D0000AD1226C00F06061914202BF00F06040AD
+:1035E000616C884200F0A6800120A4E0706840F081
+:1035F000040000F0BDF807467068000708D400F02A
+:1036000079FAC01B0428F7D3B4E600F09BF85DE616
+:103610007068A16920F4706040EA0120706000F0D9
+:10362000A4F8074600F089F87FF427AF2078410717
+:1036300037D5DFF86C743868C10529D400F012FD65
+:1036400000F058FA80463868C10521D400F052FADB
+:10365000A0EB08000328F6D38CE6706820F0040085
+:1036600070607068C00810F00100DFD000F042FA0E
+:10367000C01B0428F5D37DE600F077F8074600F07C
+:103680005CF8D3D000F036FAC01B0328F7D371E6FC
+:10369000A06801287FF419AF306840F00100306065
+:1036A00024E721784A060ED5A06A0028B0683FF4C6
+:1036B00045AF40F00100B06000F01CFA0746B0686A
+:1036C00080077FF534AFE06AA0B3A96801F00C0170
+:1036D0000C293FF467AF0228286820F0807028602A
+:1036E0007FF44BAF00F006FA064600F039F87FF49D
+:1036F00036AFEA68DFF8AC03216BA36B0240606B66
+:103700000A430243E16B206C42EA03220A43616CE4
+:1037100002430A43EA60286840F080702860E96844
+:1037200041F08051E96000F0E5F904462868800125
+:103730007FF51CAF0020BDE8F0817068400810F0F4
+:10374000010070472968606A21F0F0010143296097
+:103750006968206A21F47F4141EA0021696070476D
+:103760002868400E10F00100704770684008400063
+:10377000706000F0BFB92DE9F8430400884646D0D8
+:10378000DFF8246300F0C8F849D200F0CDF807460E
+:1037900000F0C2F843D000F0ADF9C01B0228F7D901
+:1037A0000320B7E000F0A6F9401B022845D9F7E74F
+:1037B00000F0A0F9A0EB090002284ED9F0E700F0D4
+:1037C00099F9A0EB0900022856D9E9E700F092F92F
+:1037D000401B02285FD9E3E700F08CF9401B022868
+:1037E00069D9DDE700F086F9401B41F28931884252
+:1037F00075D3D5E7032802D13968890103E0002891
+:10380000396802D1890762D401E049055FD40120FB
+:1038100080E000F06FF9C01B022870D9C0E7207863
+:1038200081074FF0B0470BD5BA68A06822F0F002CC
+:103830000243BA6000F05EF90546B868C003B1D52E
+:103840002178DFF84C5288060AD52968606921F092
+:10385000F001014300F065F8814628688003A7D590
+:10386000217848060BD52968A0690909090141EAB0
+:10387000101100F056F881462868C0039FD52178C2
+:1038800048070BD5B968E06821F4E0610143B960ED
+:1038900000F030F90546B868800397D5217808070D
+:1038A0000CD5B968206921F4605141EAC001B960C2
+:1038B00000F020F90546B86840038DD52178C80787
+:1038C00015D56068022895D1396889039FD5BA68F3
+:1038D000920840EA8200B86000F00CF90546B8682A
+:1038E000616800F00C00B0EB810F7FF47BAF3068B3
+:1038F00000F00700804505D200F016F8074600F0FA
+:103900000BF886D100F002FC00F086FCBDE8F24323
+:1039100000F04CBCBDE8F283306800F00700404581
+:103920007047296000F0E6B83168C90848EAC1016B
+:10393000316000F0DFB838B54FF0B0445C4DA1689D
+:1039400011F00C0106D1FFF77BFCC0F3031055F812
+:10395000200032BD0429574A05D00829564804D111
+:103960002168C90222D5104632BDE16801F0030189
+:10397000022904D0032904D12168C90207D51046C1
+:1039800005E0FFF75DFCC0F3031055F82000E16887
+:10399000E268E368C1F306214843C2F30211491CFF
+:1039A0005B0FB0FBF1F05B1CB0FBF3F032BD80B5F8
+:1039B000FFF7C1FF3D49FFE7404A0968C1F3031122
+:1039C00052F82110B0FBF1F002BD80B5FFF7EFFF18
+:1039D00000F010F8C1F3022106E080B5FFF7E7FF21
+:1039E00000F008F8C1F3C22112F8211001F01F0104
+:1039F000C84002BD2D49324A0968704770B52C494C
+:103A0000B1282EBFCC6AC0F3031051F820402048E3
+:103A1000056800F015FC294905F00F0551F825202F
+:103A20002849B4FBF2F20024B2FBF1F1B0F5007FBB
+:103A30002CA2204609D100BF23A353F820508D4269
+:103A400014D2401C0328F8D912E000BF22A353F877
+:103A500020508D420AD2401C0328F8D308E000F021
+:103A600049F8801B03280CD3032070BD52F8204076
+:103A70000D4D2868C00844EAC000286000F03AF8FC
+:103A80000646286800F00700A042E8D1002070BD7B
+:103A9000080100587C10002090000058FFFFFEEE47
+:103AA000000400588C80C1110040005808000058E4
+:103AB0000C7B00080024F4000048E801CC7A0008E0
+:103AC000347E000840420F00120000002400000075
+:103AD0003600000040000000060000000C0000005E
+:103AE00010000000000000000100000002000000C3
+:103AF0000400000001480068704700BF78100020F3
+:103B000070470000002200F0A3BB0000984900E0CD
+:103B1000984981B00A6802430A6009680840009029
+:103B2000009801B0704710B500F062FB924C6068DD
+:103B300040010ED56068C0000BD400F093FA00F08D
+:103B400091FA206840F480302060216821F48031AF
+:103B5000216000F0D3F8002000F094FB40B18079A0
+:103B60008649E160E26822F47C5242EA0022E26087
+:103B700000F048F88248834C016800220260036923
+:103B800003F0500303610120FFF7C2FF0220FFF79B
+:103B9000BFFF0420FFF7BAFF0120FFF7B7FF0220A5
+:103BA000FFF7B4FF00220F210E2000F019F90E20BC
+:103BB00000F033F900220F213A2000F011F93A20E9
+:103BC00000F02BF900210F226F484160826047F618
+:103BD000FF710022C16002618261C261046000F075
+:103BE00065FBCA20606253216162FF21A068C008A2
+:103BF000C000A060616200F0FFFB4FF0FF3000F0FA
+:103C00008DFCFAE710B5AEB0604C1CA821464822E6
+:103C1000FDF754FB01A81C21FFF774FF08A804F16D
+:103C200048015022FDF74AFB5348016821F0180172
+:103C300001604FF480335648026822F4C06242F4B7
+:103C4000007202600722006800F4C06000904FF428
+:103C5000807400991C9201211E91002240211D9325
+:103C6000209127921F941CA8FFF7F3FA6F200221DE
+:103C7000019002910022039204920592069207920B
+:103C8000012101A8FFF777FD43F603010022089107
+:103C90000E9200214FF4804202230F9119921A9341
+:103CA0001B91189408A800F01FFD2EB010BD10B590
+:103CB000384C394820604FF4E1310C20606100221B
+:103CC0004FF40040E06100F010F82046FEF70AF8DB
+:103CD00000212046FFF702FA00212046FFF709FAEB
+:103CE0002046BDE81040FFF7DBB96160A260E260EA
+:103CF0002261A26122626262A2627047274881B09B
+:103D0000016841F4801101603F21006800F48010D7
+:103D100000900098224841604161016841F47C11A3
+:103D20000160026942F47C120261016841F03F01C6
+:103D30000160026942F03F02026101B0704738B58C
+:103D40000446FFF7D7FE14F1010F054609D000F035
+:103D500066FA041905E01348016821F004010160C6
+:103D600030BFFFF7C7FE401BA042F4D331BD0000B7
+:103D7000480000584C00005890000058FECAFECA87
+:103D80008008005800280040E0160020187900083C
+:103D900000040058C81300200038014050000058AB
+:103DA000040C005810ED00E070470000090102000B
+:103DB00002D43C48815470473B4B02F00F021A4436
+:103DC00002F8041C7047394B19684FF6FF020002D5
+:103DD000114000F4E060084335490843186070471B
+:103DE00038B5324B1C68C4F30223C3F10704052C19
+:103DF00028BF04241D1D072D34BF0023DB1E012511
+:103E000005FA04F4641E2140994005FA03F35B1E91
+:103E10001A401143BDE83440C8E7010007D401222D
+:103E200000F01F01234B8A40400943F820207047CF
+:103E300001000BD4012200F01F011F4B8A404009F2
+:103E400043F82020BFF34F8FBFF36F8F704710B53B
+:103E5000401EB0F1807F01D3012010BD174C60607F
+:103E60000F214FF0FF30FFF7A1FF0021A1600720D5
+:103E70002060002010BD010007D4012200F01F01C6
+:103E80000F4B8A40400943F820207047010007D4B7
+:103E9000012200F01F010B4B8A40400943F820200B
+:103EA0007047000000E400E018ED00E00CED00E0D9
+:103EB0000000FA0500E100E080E100E010E000E031
+:103EC00000E200E080E200E02DE9F04106460A460B
+:103ED0004FF0000C4FF00F082CE05A4FBE4214BFB9
+:103EE0004FF0070E4FF0040E0EFA01F1294344F88B
+:103EF0002310C143544C236855680B40ED0348BF61
+:103F000003432360636855680B40AD0348BF034318
+:103F100063604E4C236855680B40ED0248BF034375
+:103F2000236063680B4051688D0248BF03436360A0
+:103F30000CF1010C106830FA0CF172D0012303FA75
+:103F40000CF31840F4D05468022C18BF122C4FEA1E
+:103F50008C010ED14FEADC0406EB840401F01C0E48
+:103F6000256A08FA0EF7BD43176907FA0EF73D43B5
+:103F700025624FEA4C0403253768A540ED4305EA66
+:103F8000070E177907F00307A74047EA0E073760C7
+:103F90005768012F18BF022F03D0112F18BF122FFF
+:103FA00011D1B76805EA070ED768A74047EA0E07A0
+:103FB000B760776827EA03035768C7F3001707FA63
+:103FC0000CF73B437360F3681D40936803FA04F4F5
+:103FD0002C43F4605468E300AAD51D4C4FEA9C03BF
+:103FE00054F8237001F00C0108FA01F5B6F1904F76
+:103FF00027EA050508BF4FF0000E11D0154FBE424D
+:1040000008BF4FF0010E0BD0134FBE4208BF4FF058
+:10401000020E05D0114FBE427FF45FAF4FF0030E8A
+:1040200062E7BDE8F0810AB1816170478162704743
+:104030000B4A136803421CBF106000F061BA70475E
+:1040400000000000001000488008005800080058D8
+:10405000080001400004004800080048000C004827
+:104060000C0800580248016841F4807101607047F3
+:10407000000400588A60FF210268516280F82130F4
+:10408000002180F820100020704790F820100129AE
+:1040900001D102207047012180F82010022280F80F
+:1040A0002120CA2103685962532201684A62012310
+:1040B00001688A6842F02002FFF7DCBF3249002025
+:1040C00008604FF0B0413148026842F4700202606B
+:1040D0004FF4E022086840F0010008608A600B6835
+:1040E0002B4803402B480B60026822F00502026057
+:1040F000002243685B085B0043602748C860086192
+:10410000086820F4802008608A61704710B54FF07D
+:10411000B04222491068C0F3031001EB8003186C11
+:10412000936803F00C03042B04D0082B04D00C2B51
+:1041300004D01CE01A481AE01A4818E0D368D46882
+:10414000C4F3021403F00303641C022B08BF1448D9
+:1041500002D0032B08BF1348B0FBF4F3D068D46837
+:10416000C0F30620640F4343641CB3FBF4F00E4B12
+:10417000186090681A68C0F3031051F82000B2FB71
+:10418000F0F0186010BD000008ED00E088ED00E0E0
+:10419000FBFEF6FA9400005800100422CC7A0008C6
+:1041A0000024F4000048E8019C10002070B50F4E78
+:1041B0000446B0680025A8B1FFF7F9FBB2684FF4D8
+:1041C0007A71B1FBF2F2B0FBF2F0FFF740FE48B9B2
+:1041D000102C07D2002221464FF0FF30FFF700FEDF
+:1041E000746000E00125284670BD00BF78100020F3
+:1041F000104810B5016841F4807101600320FFF799
+:10420000E2FD0020FFF7D2FF0024002814BF0124A4
+:10421000FEF7D6FC204610BD0748406870470648A8
+:10422000806870470548FFE7016841F001010160BF
+:10423000704700000040005878100020042004E07F
+:10424000DFF80800006800F4C06070470004005800
+:1042500000B500BF130096469446103928BFA0E869
+:104260000C50FAD85FEA417C28BF0CC048BF40F828
+:10427000042BC90728BF20F8022B48BF00F8012BE8
+:1042800000BD000020B501460648074DC2798A42AC
+:1042900018BFA84218BF0838F8D18A4218BF0020BA
+:1042A00020BD00BFF873FF1F0070FF1F70B5040032
+:1042B00049D094F8210028B9002184F82010204624
+:1042C000FEF71DFD00F04EF853202168486200F013
+:1042D00052F8FF2510B100F03FF834E02168DFF814
+:1042E000AC008A6802408A60226893686668216927
+:1042F000A0690E430643334393602068E16801617F
+:1043000020680169A26841EA024101612068C16830
+:1043100021F08001C1602068C16C89088900C164F6
+:104320002168CA6CE369606903431A43CA6421685F
+:104330008868810609D400F01CF830B12068456215
+:10434000042100F01DF8012070BD206845620121A4
+:1043500084F82110002070BD20684562042184F893
+:1043600021107047022084F82100CA21226851627E
+:10437000704720460CE0204623E02068C0F82480E7
+:1043800084F82110002084F820007047BFFF8FFFC1
+:1043900038B504462068C16821F0A001C160FFF76C
+:1043A000A9FB05462068C168880608D4FFF7A2FB70
+:1043B000401B40F2E9318842F4D3032032BD002093
+:1043C00032BD38B504462068C1684A0612D44FF0A1
+:1043D000FF31C160FFF78EFB05462068C1684806C3
+:1043E00008D4FFF787FB401B40F2E9318842F4D341
+:1043F000032032BD002032BD10B52A482A4C88B0B7
+:10440000016841F40041016000F0F2FA2749002000
+:1044100000F08BFCFFF706FF2548016841F480316E
+:104420000160026C42F48032026400F0D4FD01218C
+:10443000012000F0E2FA002000F016FE012000F05A
+:1044400013FE022000F010FE012000F031FE0121D9
+:10445000002000F047FE0121012000F043FE00F0A3
+:1044600099FE144A0021082000F0B8F804F23C51EB
+:10447000009169460FF241020FF24100019200F0F3
+:1044800077FF04F25471029104F5C96240F23C5185
+:1044900003920591049402A800F002FF00F078FE58
+:1044A00008B010BD0800005824000320E0160020CA
+:1044B00090080058B35300087047000080B500F022
+:1044C00026FF00F0F7FFBDE804400021012000F0C6
+:1044D00094BA70474FF0FF3000F020B80021082058
+:1044E00000F089B8022000F0A8B8022000F0ADB8B2
+:1044F000FFF7DDBB13460A4601460020FEF762BE09
+:10450000012805D0022805D0102805D101F011B9E5
+:1045100001F011B901F046B9704700002DE9F041F2
+:10452000544CDFF85481A5692840A06131E0491C52
+:1045300054F831000742FAD004EBC10718407968FB
+:104540001040014204BF4FF0FF327A607E68304075
+:1045500000F094F86062012101FA00F086437E6069
+:10456000EFF3108272B6606A23698140C9430B4041
+:104570002361022004EBC00353F8087C0F40401E67
+:1045800043F8087CF6D182F31088606A58F820104E
+:10459000884763692069A2691840104207D0E06922
+:1045A000216A084203D1002103EA0207C0E701F0B3
+:1045B00033FBEFF3108872B621696069A26901408C
+:1045C000114201BFE069216A0842FFF782FF88F3C8
+:1045D000108801F022FBA561BDE8F08138B51446D2
+:1045E000EFF3108572B600F049F8234941F82040F6
+:1045F00085F3108831BD30B5EFF3108272B61D4BD4
+:104600001C6904431C6153F83150284343F83100BE
+:1046100082F3108830BDEFF3108172B6154A5369EA
+:1046200023EA000005E0EFF3108172B6114A5369E6
+:104630001843506181F310887047EFF3108172B610
+:104640000C4AD3691843D061F4E770B5094C656A28
+:10465000266A2062012101FA05F502E02846FFF7EB
+:1046600039FF216AE0690842F8D088432662E06198
+:1046700070BD00005010002054140020024600209D
+:10468000110C090404BF1020120412F07F4F04BF64
+:104690000830120205A312F0704F04BF001D120172
+:1046A000120FC0F11F00995C401A70470403020208
+:1046B000010101010000000000000000DFF82C13E0
+:1046C0000A68030903F47F2300019A4300F47F2062
+:1046D00000F088B9DFF814231368010C23EA0143C2
+:1046E00043EA0043136070472DE9F8430546002470
+:1046F0002878DFF8F8624106A0464FF0B0472DD584
+:10470000286B70B1B0F5800F06D0B0F5000F18BF60
+:10471000B0F5400F17D01FE0F96841F48031F9601F
+:10472000F3E0386820F080603860FFF7E3F98146F5
+:104730003868000140F1D680FFF7DCF9A0EB0900F2
+:104740000228F5D90324DDE0FFF7D4F9A0EB090036
+:10475000022840F2CF80F5E70124A0462868010531
+:1047600031D5B06800F44078286C80452AD0FFF736
+:1047700079FCB8F1000FB16805D1286C21F44071C3
+:104780000143B1601EE0B06840F48030B06021F4B5
+:104790004071B06820F48030B060286C0143B16093
+:1047A000B068C0070ED5FFF7A5F98046B06880074E
+:1047B00008D4FFF79FF9A0EB080041F28931884245
+:1047C000F4D30324A0462878C10705D53268A86928
+:1047D000920840EA820232602978880705D531685C
+:1047E000E86921F44061014331602978C80644BF7B
+:1047F000A86AFFF76FFF2878810644BFE86AFFF7D1
+:1048000069FF2878410744BF286AFFF757FF2878D7
+:10481000010744BF686AFFF751FF2868C1051ED52C
+:104820003268686B22F0406202433260696BB1F11A
+:10483000006F00F0C9F8686BB0F1806F0FD1396874
+:1048400021F0806100F0CBF804463868000163D5A0
+:10485000FFF750F9001B0228F7D94FF0030870E06A
+:10486000FFF748F9001B022864D9F6E7316821F008
+:104870004041316020F08050326822F040621043A5
+:104880003060A86BB0F1C05F00F09EF82868410569
+:1048900076D53268E86B22F0405202433260E96B11
+:1048A000B1F1005F03D1F86840F48030F860E86B44
+:1048B000B0F1805F64D1396821F0806100F08FF839
+:1048C0000446386800014CD5FFF714F9001B022894
+:1048D000F7D94FF0030853E0FFF70CF9001B02284B
+:1048E00047D9F6E700F067F8A86821F4781100F0DE
+:1048F00071F88146386800017FF526AF396968692B
+:1049000001433961002C7FF428AF3168286B21F412
+:1049100040010143316021E73969686821F4FE41B3
+:1049200041EA002139613969E86821F0606100F0ED
+:1049300051F804463868000192D539696869014325
+:10494000396129688805A1D5A86BB0F1804F1CBFDB
+:10495000B0F1004F002889D1316821F0404108436F
+:104960008EE700F028F8286921F0604100F032F865
+:10497000044638680001AFD5396968690143396177
+:104980002968C80405D5F168686C21F440410143E9
+:10499000F160296888040BD5796AE86C21F0300150
+:1049A00001437962796AA86C890840EA81017962D9
+:1049B0004046BDE8F2833869696820F4FE4040EA69
+:1049C000012038613969704703D1F86840F0807080
+:1049D000F860704701433961396841F0806139609E
+:1049E000FFF788B81043086070470000880000583F
+:1049F0000C48002101604160704710B500F00CF8D0
+:104A00005C6819B1012904D1204301E024EA0000C7
+:104A1000586082F3108810BDEFF3108272B6014B1C
+:104A20007047000068170020DFF84C150A6892B242
+:104A300000E00246086880B28242FAD170472DE950
+:104A4000F041DFF83865DFF83885317804461825FD
+:104A50006843062908EB000708D13078707034707D
+:104A600079754FF0FF30706000203DE000F07BF87A
+:104A7000B9680918B96008F10803B96832786A435F
+:104A80009A589142327813D308F1150315FB02FCB2
+:104A900013F80C30062B29D008F108066B43F358A5
+:104AA000994222BF08F115036A439A5CECD21DE0DB
+:104AB0001146337869439A420FD008F1140C08F17B
+:104AC000150E1CF8013015FB03F50EF805407A753C
+:104AD0003B7508F11402545403E008F114037A758D
+:104AE0005C54317871703470BDE8F08111466943CF
+:104AF00008F115035B5C062B04D008F1140615FBC6
+:104B000003F574557B753A7508F115025454EBE7BB
+:104B1000F0B5DFF86834DFF868541E7818240246D0
+:104B20006243B0422A4404D118785870547D1C70F6
+:104B30000FE0167D507D92F815C005F1150766430C
+:104B4000062807F806C004D0167D143514FB00F4BF
+:104B50002E55012010731A78062A02BF00294FF043
+:104B6000FF305860F0BD10B5DFF81044606810F1F8
+:104B7000010F10D0FFF758FF6168DFF80824814269
+:104B80002FBF636861685388CB1851781278181A60
+:104B90004843D04000E0002080B210BD2DE9F84F1E
+:104BA000DFF8E053DFF8E0B3D5F80880D8F800006C
+:104BB000DBF800104A0500F0A2F9DFF8C063DFF867
+:104BC000C0A321F4806181604FF0180934780AF1A4
+:104BD000080019FB04F14758FFF7C5FF874211D2BF
+:104BE00000270121B170062C3FD019FB04F40AF113
+:104BF00008010A59824210D200230B510AEB04012A
+:104C00004C7DF0E7A9884118B94202D2AF88002153
+:104C1000E8E701223F1AB270E5E70A590AF10803F2
+:104C2000121A1A51EAE7022802DA2878012800D07D
+:104C30007F1ED8F80000C1684A07FAD500F052F983
+:104C4000DBF80C00000CBFB247EA0047CBF80C7051
+:104C5000FFF7EAFE7060A8680068816841F480612F
+:104C60008160AFF30080BDE8F18FB8B20028DAD1DF
+:104C7000FFF7DAFE70600320BDE8F24FFFF7FBB8E4
+:104C80002DE9F843EFF3108872B6BE4DBC4BA8680F
+:104C90000168CA224A625320486218208A6822F4B6
+:104CA00080628A60B54A1678374647431F44387B8E
+:104CB000022823D13C68D7F810909078D8B17A7B3D
+:104CC000012A0AD101213046FFF722FF88F310881C
+:104CD0007968304600F019F904E088F3108830460E
+:104CE00000F0C6F8A86800F01AF831462246484697
+:104CF00000F054F90DE0FFF751FF08E0C8684207E3
+:104D0000FCD500F086F84FF40020A049086088F335
+:104D10001088FF22A86801684A62BDE8F183006834
+:104D2000CA214162532242627047F8B5954CA16096
+:104D3000CA2209684A625323934A4B62156845F0B8
+:104D400020051560136803F00703C3F10403237003
+:104D500095682D0C05F07F056D1C6570EDB29268AD
+:104D6000C2F30E02521C628092B2521E6A43A2F536
+:104D7000A072DA404FF6FF739A422CBFA380A28044
+:104D8000834A136843F400231360824B1D6845F483
+:104D900000251D6048BB7948012383704FF0FF3523
+:104DA00045600023764D00260C355FFA83FC1827FA
+:104DB00017FB0CFC5B1CDFB205F80C60062FF4DB64
+:104DC00006230370886820F48060886000F021F872
+:104DD0004FF40021D1600320FFF758F8A068006865
+:104DE000816841F48041816005E0C868410544BFA5
+:104DF0000320FFF740F8A1680A68FF2050620022F4
+:104E000003210320FEF7ECFFBDE8F2400320FFF78B
+:104E100004B8C86800F0800060F49060C860704713
+:104E20002DE9F04104460025EFF3108672B61827ED
+:104E3000DFF84CC10CF10C0E07FB05F81EF808005A
+:104E400010B16D1C062DF5DB062D0CD06F430CEB5D
+:104E500007000127077386F310880461427303601B
+:104E60000D70002002E086F310880120BDE8F0817B
+:104E7000F8B50746EFF3108472B60320FEF7D8FFAB
+:104E8000404DAE683068FFF74BFF3B461820424963
+:104E90004343CA5C022A1BD100213846FFF738FE83
+:104EA0003648017806290ED1306837490A6853051B
+:104EB00000F025F821F480618160C1684A07FCD5C3
+:104EC00000F010F804E04078884218BFFFF766FE53
+:104ED000A9680A68FF2050620320FEF79EFF84F352
+:104EE0001088F1BDC16801F0800161F49061C1607A
+:104EF0004FF40020254908600320FEF7C7BF02D504
+:104F0000C1684A07FCD4816870472DE9F0418046AA
+:104F10000F46424618201A4942438C18237B022B25
+:104F200004BF4046FFF7A4FFEFF3108572B60320DD
+:104F3000FEF77EFF134EB068FFF7F1FE02202073EC
+:104F4000A76067604046FFF77AFD0C490A78497808
+:104F5000914202D0FFF722FE02E0A168081AA06089
+:104F6000FF20B1680A6850620320FEF756FF85F300
+:104F70001088BDE8F081000028280040A01700201C
+:104F8000AC12002048170020082800400C080058E8
+:104F90000008005880080058B81200201047000090
+:104FA00038B5EFF3108472B6274D6946281D00F01E
+:104FB00050FF6946281D00F0A6FF38B184F3108821
+:104FC000BDF80010214AFFF795FA31BD0120287085
+:104FD00084F3108831BD80B5FFF78AFA0221009171
+:104FE0000023194800F124014FF48052001D00F005
+:104FF00015FE01BD00BFF8B514460026EFF310857D
+:1050000010F1010F1ED001281CBF02284FF0FF36FF
+:1050100018D1BCB1264672B60B4F012392B2381D8F
+:1050200000F011FE00281CBF3978002908D00022AA
+:105030003A7085F31088A1B2044AFFF75BFA01E0E9
+:1050400085F310883046F2BD2C000020A14F0008E7
+:10505000464981B00A6802430A6009680840009026
+:10506000009801B07047000078B585B004466846E6
+:105070001421FEF747FD0220FFF7EAFF3FA13C4E57
+:1050800031F8145000950121019100220221029271
+:105090000391694656F82400FEF716FF00F002F867
+:1050A00006B070BD56F8240000222946FEF7BBBFAB
+:1050B00010B500F00FF8BDE810400122FEF7B3BFB5
+:1050C00010B500F007F8BDE810400022FEF7ABBFB6
+:1050D0000000000029A3264C33F8101054F82000DB
+:1050E0007047000030B585B004460D46684614216F
+:1050F000FEF708FD210008BF042004D0012C18BFD2
+:10510000022C02D10820FFF7A3FF2900DFF864205A
+:105110001CA00ED130F8141000910023019301213E
+:1051200002230291039300F01BF80120FEF707FE13
+:1051300014E0012D12D130F814000F4B00900295AD
+:10514000019300F00DF800BF10A0045D00220F21B4
+:1051500060B2FEF745FE60B2FEF75FFE05B030BDFF
+:10516000694652F82400FEF7AFBE00004C0000581C
+:105170008410002090100020000021102000010069
+:105180000200000010000100020000000A060700F3
+:1051900000F07ABF6C486D49016001F12002426065
+:1051A00001F13003836001F13C02026201F144032A
+:1051B000C36001F14C02026101F16803436101F136
+:1051C0006C0282617831C16100F066BF38B5044677
+:1051D0005F4D05F1100000F0C3FF5B494868A1680E
+:1051E000016005F11001E268C2608160456000F075
+:1051F0006FFF58482DE080B553494A681368012075
+:10520000187200F06BFF002002BD38B5514C504DB4
+:1052100007E0694605F1100000F0CEFF0098216814
+:10522000884705F1100000F09EFF0028F1D031BD45
+:1052300048484168084738B50446474D284600F0BD
+:105240008FFF4149C868A1680160456000F04BFFCD
+:1052500042482168016062684260002032BD80B52A
+:105260003949CA6813681020187200F042FF002004
+:1052700002BD3549CA68394910680B68184738B506
+:10528000364C354D06E06946284600F095FF0098FB
+:1052900061688847284600F066FF0028F3D031BDDA
+:1052A00038B504462E4D284600F05AFF2D4800F030
+:1052B00057FF25480069A1688160E268C260056106
+:1052C00021680160626842602169416162698261AE
+:1052D00031BD80B50146234800F058FFBDE80240CB
+:1052E0000FF2050000F015BF38B5174C1D4D08E052
+:1052F0006946284600F060FF00992069006900F0C7
+:1053000045FF284600F02FFF0028F1D031BD10B531
+:10531000154C204600F024FF0B4948690460BDE8A5
+:10532000104000F00ABF1CB50F4C06E0694620464D
+:1053300000F042FF009800F019F8204600F013FF3B
+:105340000028F3D013BD000000000320B0090320A3
+:1053500084080320781700209C0803208017002071
+:10536000340A0320701700203C0A03207047000015
+:105370007FB50C464C4D61684C4EE8612962284669
+:1053800000F02CFF2468746006F1080000F0E8FECD
+:10539000012000F065F801203070296841B10FF25A
+:1053A000E5020FF2E90300920193029468468847F0
+:1053B0007FBD1FB53D4C04F1080000F0D4FEE8B9F4
+:1053C0002078D8B1694604F1080000F0F5FE01200C
+:1053D00035492070C96941B10098029001A88847F9
+:1053E0009DF804102170080003D00098FFF771FFAA
+:1053F00004E0009904F1080000F0BEFE04F108008A
+:1054000000F0B1FE28B9207818B104F10800FFF7C8
+:1054100065F81FBD2DE9F04105460E4690461C4635
+:10542000002000F01DF8214F7868A0F80950C672DE
+:10543000324641460C30FBF741FF1B4A13690021FD
+:105440000020984748F2E800FFF74FF879688A781B
+:10545000D21C04F10800FBF731FFBDE8F041012048
+:1054600010B51149124C096A20B901B188470021D1
+:10547000217010BD0120207011B1BDE81040084717
+:1054800010BD00000020FFF72DB8000010B5014648
+:10549000064C04F1080000F079FE04F10800BDE8B4
+:1054A0001040FFF71BB80000041700203817002039
+:1054B0005D17002038B58EB002A8DFF84415DFF87C
+:1054C00044450FF2B1553022FBF7F8FE00940195E8
+:1054D00069460FF28950DFF8304500F089FE01215E
+:1054E0000220FFF78AFADFF8242500210420FFF7C5
+:1054F00075F802A800F060FF00F056F900F064FFB4
+:1055000004F1260500204FF6FF7184F890002980F1
+:1055100001200FF2B5420021FFF760F8062000F0ED
+:10552000DFFFDFF8EC04002101220170427001F07E
+:1055300075F80FF20553002204F191010020FFF7E6
+:105540006FFC0FF2FD43002204F192010020FFF7EF
+:1055500067FC002068808022DFF8B804A021028068
+:105560004180012000F0C6F90FB030BD2DE9FC41AB
+:105570000646DFF894447078DFF89454DFF8988496
+:10558000052804F1900704D03E2811D0FF285ED0F2
+:10559000CCE0B188E08C814205D10021E1843970F2
+:1055A000404601F07BF8012000F0A4F9012047E01B
+:1055B000F07801282BD0032802D00C2803D0B5E0C6
+:1055C00008F12800A8E00FF2C04001F067F8307938
+:1055D00000280CBF08F1540008F17C0001F05EF8CF
+:1055E000E08C6A460DF1010101F0A8F860B90FF2F4
+:1055F000B44001F053F89DF800209DF801100FF21F
+:10560000B84001F04BF891E00FF2C84084E07878A0
+:10561000FFF72EFCB6F8051008F1A40001F03EF8E3
+:10562000387804280CBF0620052038700021B6F811
+:105630000500E084E8802971281D00F0E9FF0020C2
+:105640002871281DE18CE98000F0E2FF6EE0B6F8D9
+:105650000300001F63D04FF47F71401A1AD0401E20
+:105660004BD0401E19D0401E1ED0401E1FD0401EE1
+:1056700020D0401E28D0401E4CD0401E24D0401EBA
+:1056800028D0401E23D040F2F631401A04BF01203A
+:1056900068704BE008F1D8003EE008F5827000F039
+:1056A000FDFF0FF24C4037E008F5967034E008F546
+:1056B000AC7031E00FF2584000F0F0FFE08C01F0E8
+:1056C000B4F90FF26C4027E008F5C47024E008F547
+:1056D000D67021E0D6F807100FF2704000F0DEFF20
+:1056E000D6F807100FF27C4000F0D8FFE08C0121C3
+:1056F00001F0E8F908F5EC700EE0F17908F50670B4
+:1057000000F0CCFFF079002814BF0FF280400FF2B8
+:10571000684001E008F51C7000F0C0FF06E00120C1
+:10572000FFF7C6FCB8780A21FFF7EFFB0120BDE8C0
+:10573000F68100F08BBF7CB5B34C94F89000012843
+:1057400018BF00282DD0B2484178012929D1002264
+:105750000178B24D4270491C01EBD1725210A1EB9D
+:1057600042010170F7EE040A017800EB81004FF46A
+:10577000FA7690ED020AE08C0096C0EE200AFDEE6B
+:10578000E00A10EE902A92B20023114601F0AEF921
+:1057900000280CBF284605F13000BDE8764000F037
+:1057A0007DBF73BD7047000078B589B00020ADF8AB
+:1057B0001A0000F087FF9A4D9A4E286810F1010FE9
+:1057C0000ED069683074090A020A000CB074727451
+:1057D00006F1100468683175F074090A717506E005
+:1057E0000020FEF74FFD040008BF0FF2FC342246F4
+:1057F0000621002000F045FE607930724EF66E52B0
+:1058000021797172E078B072A178F17260783073AA
+:1058100021787173089207AA28687B4C07900621AB
+:105820002E2000F02EFE0FF2C8321021182000F0BA
+:1058300028FE0FF2CC321021082000F022FE1821A1
+:10584000012000F03FFE01F084F90DF1160006A9D9
+:105850000190009105AB07220021012001F065F8BD
+:10586000CFA0BDF8181000900723BDF81400002247
+:1058700001F02CFA0DF11A0000900223BDF8161069
+:10588000BDF81400002201F021FA022202210020BA
+:1058900000F087FF0020207001F004F80120607004
+:1058A0000021E170082060751021A175012020758C
+:1058B000A07000205C49A161C1B221440871401C64
+:1058C000C1B21029F8DB002004900023A169207DDB
+:1058D000039102900122A17D607D01910090617889
+:1058E000A07800F0F3FFA07808B101F085F80AB0C5
+:1058F00070BD00002DE9F043012887B0044603D1B4
+:1059000044480588478803E04FF4C8654FF47A6738
+:10591000DFF8F490DFF8148109F190067078FFF752
+:10592000A7FA3178A0A000F0B9FE022C10D130788F
+:10593000012818BF02280BD100F050FF010003D14D
+:10594000404600F0ABFE03E008F1240000F0A6FEA4
+:1059500000200690059009F1290204925FF00802E8
+:1059600099F82800AAA103900291019200230093C4
+:1059700034703A462946002000F043FF29490E20A2
+:1059800001F002F8010013D1012C0AD108F14C00FA
+:1059900000F084FE7078264907B0BDE8F043FFF7B9
+:1059A000B4BA08F1740007B0BDE8F04300F076BE69
+:1059B000012C0CBF08F1A00008F1D00007B0BDE831
+:1059C000F04300F06BBE000010B50120FFF778FB3C
+:1059D0000D4C94F89000052811D000F0FFFE002136
+:1059E00084F8901030B900BF76A000F057FE00BFD9
+:1059F00076A000E00F48BDE8104000F04FBE10BD9B
+:105A0000447D0008A4080320181200202F6200081B
+:105A10001C000020B4170020886F0008F87B0008E5
+:105A20008075FF1F0400002007B201009474000875
+:105A300046E00100C47D000800210120FEF7DBBD27
+:105A40000120FFF73DBB00210420FEF7D4BD01205B
+:105A5000FEF7F3BD0120FEF7F8BD000010B50446C7
+:105A6000616801F1080000F0BDFC00B10120207068
+:105A700010BD000010B1012803D070470720FEF7C9
+:105A8000CABD0720FEF7CFBD4556545F555044416F
+:105A900054455F5048595F434F4D504C4554452045
+:105AA0000A000000526561645F50485920737563B5
+:105AB00063657373200A0000504859205061726179
+:105AC0006D202054583D2025642C2052583D20251F
+:105AD00064200A005265616420636F6E66206E6FF9
+:105AE00074207375636365657373200A000000009A
+:105AF0000D0A0D2A2A206163695F6761705F70611A
+:105B000073735F6B65795F72657370200A000000C4
+:105B10000D0A0D2A2A204556545F424C55455F47D1
+:105B200041505F424F4E445F4C4F5354200A000097
+:105B30000D0A0D2A2A2053656E6420616C6C6F7704
+:105B4000207265626F6E64200A0000006E756D65DC
+:105B50007269635F76616C7565203D20256C640A0F
+:105B6000000000004865785F76616C7565203D2017
+:105B7000256C780A000000000D0A0D2A2A205061C9
+:105B80006972696E67204F4B200A00000D0A0D2ACA
+:105B90002A2050616972696E67204B4F200A00000D
+:105BA00053544D3332574200466972737420696E04
+:105BB00064657820696E20256420737461746520A3
+:105BC0000A00000020200D0A0D0000002A2A2053A0
+:105BD000544F50204144564552544953494E472052
+:105BE0002A2A20200D0A0D006C7AD8AC57720000CA
+:105BF000123456789ABCDEF0123456789ABCDEF035
+:105C0000FEDCBA0987654321FEDCBA0987654321BA
+:105C100009503250535256317047704730B5039C8B
+:105C2000016000250021C16041610561A107856116
+:105C300042600381047704D5008910B14FF0FF3032
+:105C400030BD002030BD2DE9F84F064684B03089C4
+:105C50000C460025002700287169BC460CBF4FF098
+:105C60000208B84699B180B93069756800F1010B36
+:105C7000AB4528BFABEB050B3568285C15F80BB0BE
+:105C800000EB0B25AD1CADB203E0054600E000B112
+:105C900002463069D6F80CB05845934623BFD6F873
+:105CA00004E0AEEB0000401B002008EB0B0903FBF7
+:105CB00009FE864532BF0020B0FBF9FA09FB1A0045
+:105CC000C0B2804509DA96F81C905FEAC97A48BFED
+:105CD00084465FEA897048BFC446100000F0AF8078
+:105CE0007068714461448842C0F0A980B94602944A
+:105CF000ADF80020039357E082073CD53089002897
+:105D000040F09D8032681A44270A02F8024C22466D
+:105D1000D6F800C09C440CF8017C27463068184433
+:105D2000FBF7CCFA7169B06961187161401C019C84
+:105D3000B06117E09CB3307FC207DDD5308948B928
+:105D400030681844FF2100F8021CFF223168194412
+:105D500001F8012C00277069241874615C463089B1
+:105D6000002340B931680C70200A32685070022359
+:105D70007069801C706108EB04050020ADB23061D1
+:105D80006CB1BA440298D6F800C000EB0A01224672
+:105D90000CEB0300FBF792FA70692418746109F1A7
+:105DA0000109B069401CB061039A7068316991457E
+:105DB00049D2691881422CBF081A0846306103464F
+:105DC0003089A8B93168BDF80000C8545B1C706800
+:105DD0003168834228BF1B1ABDF80000000AC8546E
+:105DE0005B1C7068834228BF1B1A7069801C70613D
+:105DF0000BFB09FA7468BDF800000299E41A8442AA
+:105E000088BF0446ABEB04025C455144019203D0C9
+:105E100090D2307F00288DD137682246F818FBF7E2
+:105E20004DFA7069201870612746BDF80050019C3A
+:105E300045440023ADB2A3E73068404400E00020B1
+:105E400005B0BDE8F08F88448045F5D3A8EB000885
+:105E5000F2E770B5028900230B80002A44690CBF69
+:105E600002250025002C4CD0028952B9C268466830
+:105E7000531CB34228BF9B1B0668B25CF35C02EB69
+:105E8000032200F086F825D10A884FF6FF739A4264
+:105E900004BF0289002A09D0C36802699A4219D254
+:105EA0000289BAB14668F31A934213D24368C268B2
+:105EB000E41A1419446100240289C4604AB90268D2
+:105EC0001478012B94BFC3F101030123D25C04EBCE
+:105ED00002220A80C468426806682B19934228BFD0
+:105EE0009B1A33440E884169891B491B416105D0C7
+:105EF00034192D19954228BFAD1AC5608169491E14
+:105F00008161184670BDF0B5028900230B80002A1C
+:105F100042690CBF02240024002A38D0C5680289D7
+:105F20002B464AB946686A1CB24228BF921B0668D3
+:105F3000775DB25C07EB022200F02BF820D10A88D3
+:105F40004FF6FF76B24204BF0289002A07D14268A9
+:105F50000023012A94BFC2F1010201220AE0026972
+:105F6000AA420DD202895AB14668751B954207D2E2
+:105F7000002304E005682E78AA5C06EB02220A8062
+:105F800041680068E4188C4228BF641A0319184657
+:105F9000F0BD0A80027F02F00302012A7047000070
+:105FA000C0680840884201D1012070470020704736
+:105FB000C0690840884201D1012070470020704725
+:105FC00010B5614C02212046FFF7F2FF38B160683E
+:105FD000C043810703D5FFF752F9022018E00121E1
+:105FE0002046FFF7E5FF38B16068C043C10703D51D
+:105FF000FFF70BF901200BE008212046FFF7D8FF3F
+:1060000038B16068C043010703D5FFF78CF9082059
+:10601000A06010BD10B54C4C00F033F818B96068A2
+:10602000C043810306D400F02CF830B96068C04347
+:10603000810302D5BDE8104064E0082100F022F899
+:1060400070B96068C04301030AD560683F4940F4F5
+:1060500000206060086880474FF40022A26010BDF5
+:10606000202100F00FF858B96068C043810207D5BD
+:10607000606840F400106060BDE81040FFF7D8B8D9
+:1060800010BD022120468BE740BF20BF3048016889
+:1060900041F400410160704780B52E48016841F429
+:1060A00080110160006800F480100090009826487C
+:1060B000016841F001010160026842F4803202602F
+:1060C0002C20FDF7AAFEBDE802402D20FDF7A5BE5D
+:1060D0002148016849084900016070471F494FF491
+:1060E0008030086070471C48016821F0020101609F
+:1060F000704719484FF400314160026822F40032C1
+:10610000026070471448016841F400310160FFF7F4
+:10611000B0B838B504460C4D08212846FFF740FFBB
+:1061200030B10A480460696821F40021696031BD1A
+:10613000A0474FF40020A86031BD0748016821F056
+:106140000801016070470000000C0058A8170020EB
+:106150000C04005850000058040C0058080C00585B
+:10616000006040607047EFF3108172B602688242AF
+:106170000CBF012000201CE0EFF3108272B6036810
+:106180000B60486001600868416023E0EFF3108213
+:1061900072B6086043684B6041604868016019E06E
+:1061A000EFF3108172B6436802681A6042680068B3
+:1061B000426081F31088704710B5EFF3108472B617
+:1061C00002680A600068FFE7FFF7EAFF84F31088BF
+:1061D00010BD086082F31088704700000249034A2E
+:1061E00001600261704700BF375200085F5200082B
+:1061F0007FB50C466A4D61686A4EE861296228469F
+:1062000000F0B2FD246805F12400FFF7A9FF7460D7
+:1062100006F10800FFF7A4FF01203070296829B1BA
+:106220000FF2491200920294684688477FBD1FB55D
+:106230005C4C04F10800FFF796FFE8B92078D8B16C
+:10624000694604F10800FFF7B7FF012054492070A8
+:10625000C96941B10098029001A888479DF80410CF
+:106260002170080003D00098FFF733F804E000998C
+:1062700004F10800FFF780FF04F10800FFF773FF47
+:1062800028B9207818B104F10800FFF7DCFB1FBD26
+:106290002DE9FC410446002000F05EF86688208865
+:1062A000A268DFF8FC80C6F3090646EA8026E068AB
+:1062B000B6B2C1B2304600F03BF8002548F2E80023
+:1062C000FFF7C8FB08E07888B04202D1226939782C
+:1062D0001170787800B1012508F12400FFF743FF21
+:1062E000F0B9694608F12400FFF766FF00980146FF
+:1062F00000F10B07487A0F28E5D0B7F80100B0424B
+:106300000CD1887A6169C01EC0B28842C8BF0846F5
+:10631000606102462069F91CFAF7D0FF3878D9E7A6
+:106320002800CBD0012000F017F80020BDE8F6814E
+:1063300010B513461B4A5468A4F80900E1720A46D6
+:10634000194604F10C00FAF7B9FF154A1369BDE8C4
+:1063500010400021002018471149096A08B921B1ED
+:10636000084700291CBF01200847704710B50146A7
+:10637000487A0F2818BF0E2807D10B48FFF706FFF1
+:10638000BDE810400020FFF762BB064C04F1080096
+:10639000FFF7FCFE04F10800BDE81040FFF753BB17
+:1063A000B416002028170020D8160020FFF732F876
+:1063B0009DF80E0005B000BDF8B500F10C026B466B
+:1063C00021214FF66640F1E71B480021017101725F
+:1063D00000F034B818490A7941F822000879401CC5
+:1063E0000871704770B504466078FF2802BFB4F8A2
+:1063F000030000F47F40B0F5406F12D100260E4D2F
+:1064000000E0761C2979F0B288420AD2F1B255F840
+:106410002120204690470100F3D002D0022805D069
+:1064200006E02046BDE87040FFF7A0B8002070BD30
+:10643000012070BD000000005417002080B500F05E
+:106440009DFC00F09CFC00F09BFC00F09AFC00F02E
+:1064500099FC00F098FC00F097FC00F096FC00F02E
+:1064600095FC00F094FC00F093FC00F0C8FC00F0F8
+:106470006DFD00F06CFD00F06BFDBDE8014000F02B
+:1064800068BD18B50C46C7B0114600F04EF88DF83F
+:106490001D4022460DF11E0000F05CFD00F03AF8B0
+:1064A0003F21ADF804100C2200F039F8A41C06922C
+:1064B000049400F04BF800284CBFFF209DF800002A
+:1064C00048B010BD00B5C7B000F01DF80F2200F0B5
+:1064D00032F800284CBFFF209DF8000047B000BDF7
+:1064E00000B5C7B000228DF80020ADF81C0000F008
+:1064F00011F8182200F01FF800284CBFFF209DF86B
+:10650000000047B000BD00238DF81C008DF81D1061
+:106510008DF800301822002101A800F021BDADF84F
+:10652000062007A903910122704700228DF8002060
+:106530008DF81C007047ADF806203F21ADF804101F
+:106540000222049207A9039101220692CDF814D0E9
+:10655000002101A8FFF79CBEF8B507464B4C3978DF
+:106560004DA54B4E21B1012906D003290FD0F1BD15
+:1065700001202070304603E00020207006F1340036
+:1065800000F08CF82846BDE8F24000F087B8796842
+:106590000878D0B9487801280AD10020FEF788FD94
+:1065A00006F1680000F07AF800F02FF80120A070E2
+:1065B0007968487848B9FEF783FD06F1900000F04D
+:1065C0006DF800F022F80020A070786801780129A9
+:1065D0001AD1407801280AD10020FEF769FD06F1A2
+:1065E000B80000F05BF800F010F80120A0707968A6
+:1065F000487848B9FEF764FD06F1E00000F04EF877
+:1066000000F003F80020A070F1BD284600F046B865
+:106610000078012808BF00F00DB8704780B50FF270
+:10662000350200210220FDF7D9FF18480021017032
+:10663000BDE8014080B50020FEF742FD134801216E
+:10664000002241708270C170027101BD00210220E0
+:10665000FDF7D1BF10B50D4C20792178401E804147
+:10666000C00F20710B4859B100F018F80AA000F0D3
+:1066700015F8E11CBDE810404FF6426000F04FBC39
+:10668000BDE81040403000F009B80000901700202D
+:106690008C730008B0790008200A0D000EB4C0B554
+:1066A000024603A800210190009101AB012104489A
+:1066B00078440C30F9F742FD06BC5DF810FB00BFD2
+:1066C000CB17000000B587B000F013F800F020F8F9
+:1066D000032100F009F800F013F800284CBFFF2058
+:1066E0009DF8000007B000BDADF80410ADF806102D
+:1066F000704700208DF800007047049207A90391AD
+:1067000001220692CDF814D0002101A8FFF7C0BDE8
+:106710001822002101A800F023BCADF806200821B2
+:10672000ADF804100322704709220021684600F0EA
+:1067300017BC1822002102A800F012BC70B5C8B026
+:1067400006460C4615460522FFF7EFFFADF8206020
+:10675000FFF7EFFF302200F013F8052200F01AF8DF
+:10676000002848BFFF2009D49DF8000030B99DF8EB
+:106770000300207000209DF80410297048B070BDFF
+:10678000ADF80A200821ADF808100222059208A9E8
+:10679000049170470792CDF818D0002102A8FFF7A6
+:1067A00077BD18B5C7B000F00CF83122FFF7B5FF80
+:1067B000FFF7A3FF00284CBFFF209DF8000048B062
+:1067C00010BD00248DF81C008DF8004007A8417012
+:1067D00082700021182201A800F0C2BB00B587B06A
+:1067E00000208DF8000000F03DF9812200F017F93B
+:1067F00000F046F900284CBFFF209DF8000007B0CC
+:1068000000BD2DE9F84DC7B09446DDF840E1519A3E
+:10681000559D569EDDF84CA1ADF81D108DF81C005D
+:106820004FF0000BADF81FC08DF821308DF822E03D
+:1068300000F02CF800F01FF824F8095F668000F0E3
+:1068400011F93F20ADF8040083210120ADF80610B6
+:1068500000F00AF800F016F900284CBFFF209DF860
+:10686000000048B0BDE8F08D07AA57440690039297
+:106870000D370497704788F800A007AC5499E419C5
+:10688000524608F10100544400F064BB8DF8232007
+:10689000174652998DF800B00DF1240809A8B844A4
+:1068A00000F058BB00B5C7B000F08CF800F0DAF883
+:1068B00000F0CDF8852200F08BF800F0E2F8002817
+:1068C0004CBFFF209DF8000047B000BD2DE9F0430C
+:1068D000C7B0DDF838814F9E509D519F529C8DF876
+:1068E0001C004FF0000907A88DF8009041708270DD
+:1068F0000DF123018DF81F308DF820808DF8216077
+:106900008DF822500F608DF8274000F0ABF88622FA
+:1069100000F085F80C2200F0B0F800284CBFFF20F2
+:106920009DF8000047B0BDE8F083F8B5C8B0054653
+:106930000E4617461C4600F022F808A846708770DD
+:106940008DF8205000F0B5F88A2200F0A1F803225B
+:1069500000F0A4F8002848BFFF200ED49DF80000E6
+:1069600058B94F994E98BDF801202280BDF80330E8
+:106970000380BDF805000880002049B0F0BD072263
+:106980000021684600F0ECBA18B5C7B000230446F1
+:106990008DF800308DF81C40224600F08FF800F092
+:1069A00061F800F054F88E2200F09AF8641C069208
+:1069B000049400F067F800284CBFFF209DF8000009
+:1069C00048B010BD00228DF800208DF81C007047E3
+:1069D000ADF8062007A90391012204927047002216
+:1069E0008DF80020ADF81C007047ADF806203F215F
+:1069F000ADF804100222704700B587B000208DF872
+:106A0000000000F02FF8922200F009F800F038F8AA
+:106A100000284CBFFF209DF8000007B000BDADF876
+:106A200006203F21ADF80410704700B5C7B0FFF74E
+:106A3000D6FF00F017F89522FFF7D7FF00F01DF8FA
+:106A400000284CBFFF209DF8000047B000BD3F214B
+:106A5000ADF8041070470023ADF81C008DF81E102F
+:106A60008DF800301822002101A800F079BAADF8A5
+:106A700006203F21ADF804100322049207A90391D8
+:106A800001220692CDF814D0002101A8FFF700BC26
+:106A9000ADF80A203F21ADF808107047059208A90B
+:106AA000049107220792CDF818D0002102A8FFF721
+:106AB000EFBB1822002102A800F052BA0DF11D0010
+:106AC00000F048BA00B5C7B0FFF7C5FFA522FFF731
+:106AD000CEFF00284CBFFF209DF8000047B000BD4E
+:106AE000ADF8062007A90391012270475CB5C7B035
+:106AF0000026ADF81C0007A84C9C41808280ADF8B0
+:106B0000223004818DF8006000F018F83F21ADF8C4
+:106B1000041040F281120F210291ADF806200A21E3
+:106B2000049107AA01210691039200F00CF80028B5
+:106B30004CBFFF209DF8000049B050BD1822002135
+:106B400001A800F00DBACDF814D0002101A8FFF77C
+:106B50009FBB00B587B000208DF8000000F0E3F87F
+:106B600040F2011200F0F9F80122069200F0E2F87A
+:106B700000284CBFFF209DF8000007B000BD2DE9A4
+:106B8000F84104460128C7B0884616461F4608BF8C
+:106B9000022003D002280CBF102000200DF11D039D
+:106BA0001D1800F035F8012C8DF81C4002D0022C85
+:106BB0001AD01BE00224224641460DF11D0000F0D0
+:106BC000C9F92E706F7000F0AEF800F0A6F84FF41F
+:106BD000817200F017F8E41C0692049400F0AAF801
+:106BE000002805D5FF2009E01024E4E7472005E050
+:106BF0009DF8000010B94E9800F063F8FFE748B028
+:106C0000BDE8F081ADF8062007A903910322704783
+:106C100003220021684600F0A3B92DE9F64F0C4687
+:106C20000546012CC7B09B4608BF022003D0022CAA
+:106C30000CBF102000200DF11F031E18FFF7E8FF06
+:106C4000012CADF81C508DF81E4002D0022C2BD028
+:106C50002CE00227569C559DDDF85091DDF84CA1A3
+:106C6000DDF8488148993A4600F053F8A6F800B09C
+:106C700086F8028086F803A086F804907571B471D6
+:106C800000F051F800F049F84FF4827207A9ADF80E
+:106C9000062003910A3703220497069200F04AF86F
+:106CA000002805D5FF2009E01027D3E7472005E09D
+:106CB0009DF8000010B9579800F003F849B0BDE8FE
+:106CC000F08FBDF8011001800020704778B5C7B083
+:106CD0001D464C9B00F034F800268DF800608DF8BE
+:106CE00021502A4619460DF1220000F033F900F038
+:106CF0001AF800F012F84FF4837200F028F8AD1D76
+:106D000000F016F800284CBFFF209DF8000049B0A5
+:106D100060BD0DF11F0000F01DB93F21ADF804105A
+:106D200070478DF800301822002101A800F018B932
+:106D300006920495CDF814D0002101A8FFF7A8BA57
+:106D4000ADF81C00ADF81E108DF820207047ADF88E
+:106D5000062007A9039101227047ADF806203F21C4
+:106D6000ADF80410704700000249034A0160026157
+:106D7000704700BFCD510008F751000870477047B9
+:106D8000704770477047704770477047704770474B
+:106D90007047000038B5054684B068780024FF28A5
+:106DA00002BFB5F8030040F60141884224D164498E
+:106DB0008A88B5F80700921C904209D1687B0124AB
+:106DC000C10752BF8DF8004000228DF8002010E06E
+:106DD0004988491C88420FD15A48FFF75FFC0320BD
+:106DE0008DF8000005F10D02B5F80B108DF80810B4
+:106DF00001926846FFF7B0FB204605B030BD10B5E4
+:106E00008AB051484E4CFFF7E5FA8F218DF81810E3
+:106E1000E522B3218DF819208DF81A10D5222E21E4
+:106E20008DF81B208DF81C107F224A218DF81D2023
+:106E30008DF81E1098222A218DF81F208DF8201021
+:106E400048227A218DF821208DF82210CC22402171
+:106E50008DF823208DF82410FE2200218DF82520A6
+:106E6000ADF8261000940823012206A90220FFF79E
+:106E700086FE00F034F8412100F026F8A01C00F056
+:106E800018F8062100F00DF800F029F8422100F072
+:106E90001BF8201D00F00DF8102100F002F80AB0D8
+:106EA00010BD039200910223208806AA0221FFF759
+:106EB000B4BEFE22059001218DF825200491029197
+:106EC00000200A22019070478DF821208DF82410AF
+:106ED0008E2200218DF82320ADF82610704719214D
+:106EE0008DF81810ED2282218DF81A108DF81920D6
+:106EF000ED218DF81C10AE224C218DF81B208DF851
+:106F00001E10212241218DF81D208DF820109D2278
+:106F100022218DF81F208DF82210452270471CB5C4
+:106F200042224FF64264A04208D105480091022354
+:106F3000818800880022FFF7C9FE0246104616BD70
+:106F400098170020747D0008956D00087047704701
+:106F50007047704710B50446FAF7B0F9204610BDE7
+:106F600010B5044610460A460146204600F002F8D5
+:106F7000204610BD4018491C1CBFB1F1010100F8AA
+:106F8000012DF9D1704700000D0A0D2A2A2044492D
+:106F900053434F4E4E454354494F4E204556454E60
+:106FA00054205749544820434C49454E54200A0028
+:106FB0000D0A0D2A2A20434F4E4E454354494F4E49
+:106FC00020555044415445204556454E542057497C
+:106FD000544820434C49454E54200A004556545FBE
+:106FE0005550444154455F5048595F434F4D504CB4
+:106FF0004554452C20737461747573206F6B200A9F
+:10700000000000004556545F5550444154455F50C0
+:1070100048595F434F4D504C4554452C2073746183
+:10702000747573206E6F6B200A0000004556545F24
+:107030004C455F434F4E4E5F434F4D504C4554457A
+:1070400020666F7220636F6E6E656374696F6E2069
+:1070500068616E646C6520307825780A0000000055
+:107060000D0A0D2A2A204556545F424C55455F476C
+:1070700041505F4C494D495445445F444953434F47
+:1070800056455241424C45200A0000000D0A0D2A87
+:107090002A204556545F424C55455F4741505F504A
+:1070A0004153535F4B45595F524551554553542009
+:1070B0000A0000000D0A0D2A2A204556545F424C52
+:1070C00055455F4741505F415554484F52495A41D9
+:1070D00054494F4E5F52455155455354200A0000C4
+:1070E0000D0A0D2A2A204556545F424C55455F47EC
+:1070F00041505F534C4156455F53454355524954A7
+:10710000595F494E49544941544544200A00000002
+:107110000D0A0D2A2A204556545F424C55455F47BB
+:1071200041505F4445564943455F464F554E4420C4
+:107130000A0000000D0A0D2A2A204556545F424CD1
+:1071400055455F4741505F4B455950524553535F3A
+:107150004E4F54494649434154494F4E200A00007E
+:107160000D0A0D2A2A206163695F6761705F6E7581
+:107170006D657269635F636F6D70617269736F6E65
+:107180005F76616C75655F636F6E6669726D5F795E
+:1071900065736E6F2D2D3E594553200A0000000087
+:1071A000424C455F4354524C5F4170705F4E6F7468
+:1071B000696669636174696F6E3A204556545F422F
+:1071C0004C55455F4741505F50414952494E475FDA
+:1071D000434D504C542C2070616972696E675F6337
+:1071E0006F6D706C6574652D3E537461747573209A
+:1071F0003D2025640A0000000D0A0D2A2A2045566C
+:10720000545F424C55455F4741505F50524F434594
+:10721000445552455F434F4D504C455445200A005C
+:1072200010B50446AFF30080204600F005F8044690
+:10723000AFF30080204610BD70B500F10F06F608D0
+:10724000F600B04240D2082E04D2082602E00830F0
+:1072500000F047F8DFF804512C68210005D1002028
+:1072600007E00268B24221D2011D08680028F8D167
+:107270002068291D0A68824222D01368B34238BFB1
+:10728000111DF7D312E093190B60801B54685C60EA
+:107290000B6818601660096800291DBF486800283F
+:1072A000081D0020286002F1080070BD61B10A6865
+:1072B0001068A0F10803B342E5D250680860EAE71D
+:1072C00000F04EF80028C2D1002070BD10B50400B7
+:1072D00006D0AFF30080204600F003F8AFF3008043
+:1072E00010BD002800D1704770B4A0F108021368E7
+:1072F000072B2BD913F0070F28D1184C616809B15F
+:107300008A4202D25160626013E0486800B3904242
+:1073100038BF0146F9D31BE0964203D11B180B601E
+:107320000A4606E0486810B1134498420ED35060F4
+:107330004A60506850B11368D518854206D10026BE
+:1073400026600168CB1813604068506070BC7047BD
+:1073500008680E18B242DFD270BC70478817002050
+:107360000749086808B1002070470648C008C000F7
+:1073700008600549C908C900091A0160704700BFC3
+:10738000B0170020BF270020B82B00202D2D205043
+:107390003250204150504C49434154494F4E2053A4
+:1073A0004552564552203A204E4F54494649434192
+:1073B00054494F4E20454E41424C45440A0000007E
+:1073C0002D2D20503250204150504C4943415449BA
+:1073D0004F4E20534552564552203A204E4F544965
+:1073E0004649434154494F4E2044495341424C453C
+:1073F000440A00002D2D20503250204150504C495D
+:10740000434154494F4E2053455256455220203A4D
+:10741000204C454431204F4E0A0000002D2D2050B5
+:107420003250204150504C49434154494F4E205313
+:10743000455256455220203A204C454431204F4673
+:10744000460A00002D2D20503250204150504C490A
+:10745000434154494F4E2053455256455220312006
+:107460003A204C454431204F4E0A00002D2D20502B
+:107470003250204150504C49434154494F4E2053C3
+:1074800045525645522031203A204C454431204F38
+:1074900046460A005375636365737366756C6C7951
+:1074A0002053746F707065642041647665727469EE
+:1074B00073696E67200A000053746F702041647610
+:1074C0006572746973696E67204661696C656420D2
+:1074D0002C20726573756C743A202564200A0000B4
+:1074E0005375636365737366756C6C79205374614F
+:1074F0007274204661737420416476657274697396
+:10750000696E67200A0000005375636365737366D4
+:10751000756C6C79205374617274204C6F772050B5
+:107520006F776572204164766572746973696E67FE
+:10753000200A000053746172742046617374204104
+:1075400064766572746973696E67204661696C65FB
+:1075500064202C20726573756C743A202564200AAF
+:10756000000000005374617274204C6F7720506FDC
+:10757000776572204164766572746973696E6720FD
+:107580004661696C6564202C20726573756C743A71
+:10759000202564200A0000002DE9F04107468846B6
+:1075A000387810F0030F16461D4633D0384600F0E9
+:1075B00099F878BBB8F1000F1CBFD8E90001861913
+:1075C000012D2ED13888C10415D5396A07F144023E
+:1075D000384600F0A3F83A6B044602B93A69F968F4
+:1075E000384600F09BF8361B341A7A69F968384639
+:1075F00000F094F8261A1EB94DB916F1010F09D002
+:1076000097F903002A46314600F08EF8064616F137
+:10761000010F09D12320AFF300804FF0FF30BDE808
+:10762000F081022DE8D1EBE7388810F4405F0ED0EE
+:107630007868F86038617861B86107F1440178686A
+:10764000F861396207F13000002178623963B8F1DE
+:10765000000F05D0D8E9020107F13402C2E90001A8
+:107660003B884CF6FF6003403B800020BDE8F08182
+:1076700070B50546AFF300802888810415D56E6883
+:107680000024EA6895F903003146914212D2521A59
+:10769000FDF7B0FC10F1010F1CBF00283618F0D127
+:1076A0000FE04DF6FF70014029802846AFF30080BF
+:1076B000002070BD00220021FDF79CFC10F1010F9D
+:1076C00000D101246868E860A861E861002C29887D
+:1076D000E7D041F4007129802846AFF300804FF0D5
+:1076E000FF3070BDF8B5A0B9AFF3008000250A4E99
+:1076F00008244FF0FF37306820B1FFF7B9FF0028AA
+:1077000048BF3D46361D641EF5D1AFF300802846C4
+:10771000F2BDBDE8F240ABE7F8110020914234BF62
+:10772000511A0021084670473EB504000D00012A99
+:1077300002D100F063F807E0022A07D1009400208C
+:10774000019069460C20ABBE2D1801E0002A0CD137
+:107750000094019569460A20ABBE002805D100229D
+:107760002100280000F027F801E00020C04303B00A
+:1077700030BD000010B4314A002113461C68844219
+:107780001EBF491C9C6884421EBF491C1C69844260
+:1077900009D09C69491C844205D0491C203310291A
+:1077A000ECD310BC7047002342F8313002EBC1012A
+:1077B0004B6010BC704770B4204C002325462E68E7
+:1077C0008E421EBF5B1CAE688E421EBF5B1C2E69C4
+:1077D0008E4209D0AE695B1C8E4205D05B1C203501
+:1077E000102BECD370BC7047054604EBC303012A91
+:1077F00004BF59684D195D6070BC704710B40F4AE2
+:10780000002113461C6884421EBF491C9C688442A8
+:107810001EBF491C1C6984420AD09C69491C8442D1
+:1078200006D0491C20331029ECD310BC002070472F
+:1078300002EBC100406810BC70470000D414002067
+:1078400010B50446E068A169884251D3218849F205
+:1078500002030B40022B08D008044CBF4FF4007009
+:107860004FF48440014321803BE001F4C042B2F573
+:10787000C04F06D1A168884203D32046FFF732FFEC
+:1078800078BB208810F4406F02BF606804F14401A7
+:10789000884217D14FF40070FFF7C2FC606030B926
+:1078A00004F144006060E060401CA0600AE02188B0
+:1078B00041F040012180E060606100F50072606885
+:1078C000A260E0616068A1682061A1612078410741
+:1078D0000AD502220021204600F00CF810F1010F19
+:1078E00002D14FF0FF3010BD208840F4C04020800E
+:1078F000002010BD70B504460D461646AFF300805B
+:1079000033462A4600212046FFF746FE054620461C
+:10791000AFF30080284670BD0000000000000000AA
+:107920000000000000000000000000000000000057
+:107930000000000000000000000000000000000047
+:107940000000000000000000000000000000000037
+:107950000000000000000000000000000000000027
+:107960000000000000000000000000000000000017
+:107970000000000000000000000000000000000007
+:1079800000000000000000000000000000000000F7
+:1079900000000000000000000000000000000000E7
+:1079A00000000000000000000000000000000000D7
+:1079B0002D2D20503250204150504C4943415449C4
+:1079C0004F4E2053455256455220203A20494E46AC
+:1079D0004F524D20434C49454E5420425554544F2C
+:1079E0004E203120505553484544200A20000000C5
+:1079F0002D2D20503250204150504C494341544984
+:107A00004F4E20534552564552203A2043414E276F
+:107A10005420494E464F524D20434C49454E542028
+:107A20002D20204E4F54494649434154494F4E2042
+:107A300044495341424C45440A20000018B401789F
+:107A40000A0627D51F4A13680021834203D1002468
+:107A500042F821401BE05368012183421EBF0221EE
+:107A600093688342F3D0D368032183421EBF04216D
+:107A700013698342EBD05369052183421EBF06215F
+:107A8000936983421EBF0721D3698342DFD012BCB2
+:107A900000F01AB8002101804FF0FF3200F14401DC
+:107AA000C270C1604161C16100F1440300F1440250
+:107AB00000F130014360026182610262416211BCE7
+:107AC00070470000F8110020FFF700BC0100000023
+:107AD000030000000500000001000000010000009C
+:107AE000060000000A000000200000000200000064
+:107AF000040000000800000010000000400000002A
+:107B0000800000000001000000020000A0860100CB
+:107B1000400D0300801A060000350C0040420F00A3
+:107B200080841E0000093D0000127A000024F40049
+:107B300000366E010048E801006CDC020000000025
+:107B400000000000000000000000000038B5040044
+:107B50000ED0207810F0030F03D094F90300002812
+:107B600009D5AFF300802046FFF768FFAFF3008030
+:107B70004FF0FF3032BD2046FFF7B4FD0546AFF3AE
+:107B800000802078410644BF6068FFF79DFF002019
+:107B9000606094F90300022804D900F016F808B1D7
+:107BA0004FF0FF35E06B48B100F01BF808B14FF023
+:107BB000FF35E06BFFF788FF0020E0632046FFF70A
+:107BC0003DFFAFF30080284632BD1CB50200009295
+:107BD00069460220ABBE04001000FFF7CBFD200079
+:107BE00016BDE0B50090F9F70DFB019069460E2037
+:107BF000ABBE03B000BD0000424C455F5356435F2F
+:107C00004C324341505F436F6E6E5F5570646174D8
+:107C10006528292C205375636365737366756C6CD6
+:107C200079200D0A0D000000424C455F5356435F1A
+:107C30004C324341505F436F6E6E5F5570646174A8
+:107C40006528292C204661696C6564200D0A0D00A9
+:107C50007047FEE7FEE7FEE7FEE7704770477047B4
+:107C600000F020B80548FBF75CB90548FAF7C9B839
+:107C70000448FAF7C6B80448FBF753B95415002076
+:107C8000C81300203C130020B41500201020FCF77E
+:107C9000CFB90120FCF7CCB9FCF7F2BFFEF7BAB9B7
+:107CA000FEF78EB902490A68886882180A60704730
+:107CB0007810002038B50C46C5B22046AFF30080DE
+:107CC000E068A169884204D32046FFF7B9FD002887
+:107CD0000FD4E068401CE06000F8015D20880105D9
+:107CE00003D440050BD50A2D09D12046FFF7FAFC35
+:107CF00028B12046AFF300804FF0FF3032BD204660
+:107D0000AFF30080284632BD38B50D4D08242868F1
+:107D100000281CBF017811F0030F05D090F9031063
+:107D2000002958BFFFF712FF2D1D641EEFD1BDE8DB
+:107D30003840002200214FF0FF30FDF75BB900BF53
+:107D4000F81100200000000000000000000000000A
+:107D50000000000000000000440008004005080189
+:107D60003A799C00F4010000FFFFFFFF4801010089
+:107D7000000000002D2D2047415454203A204C454E
+:107D80004420434F4E46494755524154494F4E2097
+:107D900052454345495645440A00000010B507497D
+:107DA00079441831064C7C44163404E00A68081DF6
+:107DB000114488470146A142F8D110BD500000008F
+:107DC000740000002A2A2053544F50204144564545
+:107DD00052544953494E47202A2A20204661696C53
+:107DE0006564200D0A0D00004EF68851CEF20001A8
+:107DF000086840F470000860BFF34F8FBFF36F8FC7
+:107E00004FF00070E1EE100A704700007F93FFFF13
+:107E1000A0050000181200208008000024000320A4
+:107E2000000000005F92FFFF80010000B20100002F
+:107E3000040000200000000000000000000000001E
+:107E4000000000000100000002000000030000002C
+:107E50000400000000F00DF8002801D0FFF79EFF9D
+:107E6000AFF300800020AFF30080FBF75CFE00F072
+:107E700002F80120704700F001B800000746FFF744
+:107E800043FF3846F9F724FFFBE738B504460D46B3
+:107E9000284600F005F8A84218BF0024204632BD4D
+:107EA0000149FFF707BF00BF681100200148804764
+:107EB00001480047BD400008BD7E0008AFF30080C8
+:107EC000FFF792FFFFF7C6FF00002E004300FFF709
+:107ED000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7D6
+:107EE000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7C6
+:107EF000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7B6
+:107F0000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7A5
+:107F1000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF795
+:107F2000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF785
:107F3000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF775
:107F4000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF765
:107F5000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF755
@@ -2041,25 +2041,20 @@
:107F7000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF735
:107F8000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF725
:107F9000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF715
-:107FA000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF705
-:107FB000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7F5
-:107FC000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7E5
-:107FD000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7D5
-:107FE000FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7C5
-:107FF000FEBFFFF7FEBFFFF7FEBF0000F003080D56
-:10800000FF01830001F006FF484200007A440100AE
-:1080100001F1FF01F1FF01F1FF01F1FF01F1FF01AA
-:10802000F1FF01F1FF01F1FF01F1FF01F1FF01F1AA
-:10803000FF01F1FF01F1FF01F1FF01F1350152FFF5
-:1080400001ED3F101210113D54107001040048045E
-:10805000120804520C04F00507093D001C7F0008BB
-:10806000046158F2001E1410010000200C215CFC79
-:1080700002179C100020B71013ED117E110143DB95
-:10808000113C21011007010400006011002061046F
-:10809000526004211BA108F3114C11641007020463
-:1080A000010160160020B0045260043140510812F2
-:1080B000A844F213944850020802021040521004DF
-:1080C0002134610812F044F212DC48121C241264BC
-:0580D00004F206AC2CD7
-:0400000508007F115F
+:107FA000FEBFFFF7FEBF0000F0030C0DFF018300D2
+:107FB00001F006FF484200007A44010001F1FF0190
+:107FC000F1FF01F1FF01F1FF01F1FF01F1FF01F10B
+:107FD000FF01F1FF01F1FF01F1FF01F1FF01F1FFED
+:107FE00001F1FF01F1FF01F1350152FF01ED3F10F9
+:107FF0001210113D5410700104004804120804527C
+:108000000C04F00507093D00C87E0008046158F221
+:1080100000CA1410010000CC0C215CFC0217A01057
+:108020000020B710134D127E1101433B123C210179
+:10803000100701040000641100206504526404214B
+:108040001BA108F31150116410070204010164160A
+:108050000020B4045264043140510812AC44F213BD
+:108060009848500208020214405214042134610856
+:1080700012F444F212E048122024126804F206B00E
+:018080002CD3
+:0400000508007EBDB4
:00000001FF
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Inc/app_common.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Inc/app_common.h
index 2a1d61089..4defc5d7a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Inc/app_common.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Inc/app_common.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : app_common.h
- * Description : App Common application configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : App Common application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Inc/app_conf.h
index 2b5d45a96..1a0ea468e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Inc/app_conf.h
@@ -1,8 +1,9 @@
/**
******************************************************************************
* File Name : app_conf.h
- * Description : Application configuration file for BLE middleWare.
- ******************************************************************************
+ * Description : Application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
@@ -17,17 +18,18 @@
*/
/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef APP_CONFIG_H
-#define APP_CONFIG_H
+#ifndef APP_CONF_H
+#define APP_CONF_H
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Application Config
******************************************************************************/
-/**< generic parameters ********************************************************/
+/**< generic parameters ******************************************************/
/**
* Define Tx Power
@@ -92,6 +94,15 @@
*/
#define CFG_BLE_ERK {0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21,0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21}
+/* USER CODE BEGIN Generic_Parameters */
+/**
+ * SMPS supply
+ * SMPS not used when Set to 0
+ * SMPS used when Set to 1
+ */
+#define CFG_USE_SMPS 1
+/* USER CODE END Generic_Parameters */
+
/**< specific parameters */
/*****************************************************/
#define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI4_IRQHandler
@@ -112,15 +123,15 @@
#define CFG_DEV_ID_P2P_SERVER6 (0x8A)
#define CFG_DEV_ID_P2P_ROUTER (0x85)
-#define RADIO_ACTIVITY_EVENT 1 /* 1 for OOB Demo */
+#define RADIO_ACTIVITY_EVENT 1 /* 1 for OOB Demo */
/**
* AD Element - Group B Feature
*/
-/* LSB - Firt Byte */
+/* LSB - First Byte */
#define CFG_FEATURE_THREAD_SWITCH (0x40)
-/* LSB - Second Byte */
+/* LSB - Second Byte */
#define CFG_FEATURE_OTA_REBOOT (0x20)
#define CONN_L(x) ((int)((x)/0.625f))
@@ -213,7 +224,7 @@
* 1 : internal RO
* 0 : external crystal ( no calibration )
*/
-#define CFG_BLE_LSE_SOURCE 1
+#define CFG_BLE_LSE_SOURCE 0
/**
* Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
@@ -420,11 +431,6 @@ typedef enum
#define CFG_DEBUGGER_SUPPORTED 1
#endif
-/* USER CODE BEGIN Defines */
-#define CFG_LED_SUPPORTED 1
-#define CFG_BUTTON_SUPPORTED 1
-/* USER CODE END Defines */
-
/**
* When CFG_DEBUG_TRACE_FULL is set to 1, the trace are output with the API name, the file name and the line number
* When CFG_DEBUG_TRACE_LIGHT is set to 1, only the debug message is output
@@ -461,6 +467,11 @@ typedef enum
#define DBG_TRACE_MSG_QUEUE_SIZE 4096
#define MAX_DBG_TRACE_MSG_SIZE 1024
+/* USER CODE BEGIN Defines */
+#define CFG_LED_SUPPORTED 1
+#define CFG_BUTTON_SUPPORTED 1
+/* USER CODE END Defines */
+
/******************************************************************************
* Scheduler
******************************************************************************/
@@ -525,7 +536,10 @@ typedef enum
typedef enum
{
CFG_LPM_APP,
- CFG_LPM_APP_BLE
+ CFG_LPM_APP_BLE,
+ /* USER CODE BEGIN CFG_LPM_Id_t */
+
+ /* USER CODE END CFG_LPM_Id_t */
} CFG_LPM_Id_t;
/******************************************************************************
@@ -535,6 +549,6 @@ typedef enum
#define CFG_OTP_END_ADRESS OTP_AREA_END_ADDR
-#endif /*APP_CONFIG_H */
+#endif /*APP_CONF_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Inc/stm32_lpm_if.h
index 38e326512..d8e67947f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Inc/stm32_lpm_if.h
@@ -1,46 +1,22 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file stm32_lpm_if.h
-* @brief Header for stm32_lpm_f.c module (device specific LP management)
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
******************************************************************************
* @attention
*
-* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics International N.V.
+* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted, provided that the following conditions are met:
-*
-* 1. Redistribution of source code must retain the above copyright notice,
-* this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following disclaimer in the documentation
-* and/or other materials provided with the distribution.
-* 3. Neither the name of STMicroelectronics nor the names of other
-* contributors to this software may be used to endorse or promote products
-* derived from this software without specific written permission.
-* 4. This software, including modifications and/or derivative works of this
-* software, must execute solely and exclusively on microcontroller or
-* microprocessor devices manufactured by or for STMicroelectronics.
-* 5. Redistribution and use of this software other than as permitted under
-* this license is void and will automatically terminate your rights under
-* this license.
-*
-* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
-* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
-* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+* This software component is licensed by ST under BSD 3-Clause license,
+* the "License"; You may not use this file except in compliance with the
+* License. You may obtain a copy of the License at:
+* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32_LPM_IF_H
@@ -89,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Inc/stm32wbxx_hal_conf.h
index 5c703f75d..31d63e37a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Inc/stm32wbxx_hal_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Inc/stm32wbxx_hal_conf.h
@@ -58,6 +58,7 @@
#define HAL_UART_MODULE_ENABLED
/*#define HAL_USART_MODULE_ENABLED */
/*#define HAL_WWDG_MODULE_ENABLED */
+#define HAL_EXTI_MODULE_ENABLED
#define HAL_CORTEX_MODULE_ENABLED
#define HAL_DMA_MODULE_ENABLED
#define HAL_FLASH_MODULE_ENABLED
@@ -221,6 +222,10 @@
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32wbxx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32wbxx_hal_flash.h"
@@ -333,9 +338,9 @@
* If expr is true, it returns no value.
* @retval None
*/
-#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
+ #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
/* Exported functions ------------------------------------------------------- */
-void assert_failed(uint8_t* file, uint32_t line);
+ void assert_failed(uint8_t* file, uint32_t line);
#else
#define assert_param(expr) ((void)0U)
#endif /* USE_FULL_ASSERT */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Inc/utilities_conf.h
index c98d97ba1..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Inc/utilities_conf.h
@@ -1,3 +1,4 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* File Name : utilities_conf.h
@@ -9,13 +10,14 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef UTILITIES_CONF_H
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/app_entry.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/app_entry.c
index 961d037e9..37c4b3b21 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/app_entry.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/app_entry.c
@@ -69,8 +69,8 @@ static void SystemPower_Config( void );
static void Init_Debug( void );
static void appe_Tl_Init( void );
static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status );
-
static void APPE_SysUserEvtRx( void * pPayload );
+
#if (CFG_HW_LPUART1_ENABLED == 1)
extern void MX_LPUART1_UART_Init(void);
#endif
@@ -107,7 +107,7 @@ void APPE_Init( void )
/**
* From now, the application is waiting for the ready event ( VS_HCI_C2_Ready )
- * received on the system channel before starting the BLE Stack
+ * received on the system channel before starting the Stack
* This system event is received with APPE_SysUserEvtRx()
*/
/* USER CODE BEGIN APPE_Init_2 */
@@ -220,8 +220,6 @@ static void appe_Tl_Init( void )
return;
}
-
-
static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status )
{
UNUSED(status);
@@ -235,7 +233,7 @@ static void APPE_SysUserEvtRx( void * pPayload )
TL_TRACES_Init( );
APP_BLE_Init( );
- UTIL_LPM_SetOffMode(1 << CFG_LPM_APP, UTIL_LPM_ENABLE);
+ UTIL_LPM_SetOffMode(1U << CFG_LPM_APP, UTIL_LPM_ENABLE);
return;
}
@@ -286,7 +284,6 @@ void UTIL_SEQ_Idle( void )
return;
}
-
/**
* @brief This function is called by the scheduler each time an event
* is pending.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/hw_timerserver.c
index 52a1bfa0d..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/hw_timerserver.c
@@ -1,22 +1,21 @@
/**
******************************************************************************
- * File Name : hw_timerserver.c
- * Description : Hardware timerserver source file for BLE
- * middleWare.
+ * File Name : hw_timerserver.c
+ * Description : Hardware timerserver source file for STM32WPAN Middleware.
+ *
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/hw_uart.c
index 52e9e2b3a..9a553610d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/hw_uart.c
@@ -1,7 +1,7 @@
/**
******************************************************************************
* File Name : Src/hw_uart.c
- * Description : HW UART source file for BLE middleWare.
+ * Description : HW UART source file for STM32WPAN Middleware.
*
******************************************************************************
* @attention
@@ -48,7 +48,7 @@ extern UART_HandleTypeDef huart1;
hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
} while(0)
- /* Variables ------------------------------------------------------------------*/
+/* Variables -----------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
@@ -65,73 +65,73 @@ extern UART_HandleTypeDef huart1;
void (*HW_hlpuart1TxCb)(void);
#endif
- void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_RX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_RX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_RX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_RX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ return;
+}
+
+void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
{
- HAL_StatusTypeDef hal_status = HAL_OK;
- hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
+ default:
+ break;
}
switch (hal_status)
@@ -161,8 +161,8 @@ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t
hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
{
-HAL_StatusTypeDef hal_status = HAL_OK;
-hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
@@ -250,33 +250,33 @@ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
switch ((uint32_t)huart->Instance)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1RxCb)
- {
- HW_huart1RxCb();
- }
- break;
+ if(HW_huart1RxCb)
+ {
+ HW_huart1RxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1RxCb)
- {
- HW_hlpuart1RxCb();
- }
- break;
+ if(HW_hlpuart1RxCb)
+ {
+ HW_hlpuart1RxCb();
+ }
+ break;
#endif
default:
@@ -292,20 +292,20 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1TxCb)
- {
- HW_huart1TxCb();
- }
- break;
+ if(HW_huart1TxCb)
+ {
+ HW_huart1TxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1TxCb)
- {
- HW_hlpuart1TxCb();
- }
- break;
+ if(HW_hlpuart1TxCb)
+ {
+ HW_hlpuart1TxCb();
+ }
+ break;
#endif
default:
@@ -315,4 +315,4 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
return;
}
- /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/main.c
index 3e30e0b1e..4741fe7f1 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/main.c
@@ -41,10 +41,10 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "app_entry.h"
+#include "app_common.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
-#include "app_common.h"
#include "stm32_lpm.h"
#include "stm32_seq.h"
#include "dbg_trace.h"
@@ -110,6 +110,7 @@ int main(void)
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
+
/* MCU Configuration--------------------------------------------------------*/
@@ -137,6 +138,8 @@ int main(void)
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
+
+ /* Init code for STM32_WPAN */
APPE_Init();
/* Infinite loop */
@@ -161,17 +164,20 @@ void SystemClock_Config(void)
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
+ /** Configure LSE Drive Capability
+ */
+ __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
/** Configure the main internal regulator output voltage
*/
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
/** Initializes the CPU, AHB and APB busses clocks
*/
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSI1
- |RCC_OSCILLATORTYPE_HSE;
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE
+ |RCC_OSCILLATORTYPE_LSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ RCC_OscInitStruct.LSEState = RCC_LSE_ON;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
- RCC_OscInitStruct.LSIState = RCC_LSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
@@ -200,8 +206,8 @@ void SystemClock_Config(void)
|RCC_PERIPHCLK_LPUART1;
PeriphClkInitStruct.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2;
PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1;
- PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI;
- PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSI;
+ PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
+ PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSE;
PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSE;
PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE0;
@@ -357,7 +363,13 @@ static void MX_RTC_Init(void)
Error_Handler();
}
/* USER CODE BEGIN RTC_Init 2 */
- MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* Disable RTC registers write protection */
+ LL_RTC_DisableWriteProtection(RTC);
+
+ LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER);
+
+ /* Enable RTC registers write protection */
+ LL_RTC_EnableWriteProtection(RTC);
/* USER CODE END RTC_Init 2 */
}
@@ -367,6 +379,7 @@ static void MX_RTC_Init(void)
*/
static void MX_DMA_Init(void)
{
+
/* DMA controller clock enable */
__HAL_RCC_DMAMUX1_CLK_ENABLE();
__HAL_RCC_DMA1_CLK_ENABLE();
@@ -404,7 +417,13 @@ void PeriphClock_Config(void)
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
- LL_RCC_HSI48_Enable();
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
+ LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -437,30 +456,6 @@ void PeriphClock_Config(void)
HAL_RCCEx_CRSConfig(&RCC_CRSInitStruct);
#endif
- /**
- * Select LSE clock
- */
- LL_RCC_LSE_Enable();
- while(!LL_RCC_LSE_IsReady());
-
- /**
- * Select wakeup source of BLE RF
- */
- LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
-
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
/*************************************************************
@@ -567,21 +562,33 @@ static void Init_Exti( void )
* WRAP FUNCTIONS
*
*************************************************************/
-
-/**
- * This function is empty to avoid starting the SysTick Timer
- */
-HAL_StatusTypeDef HAL_InitTick( uint32_t TickPriority )
+void HAL_Delay(uint32_t Delay)
{
- return (HAL_OK);
-}
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
-/**
- * This function is empty as the SysTick Timer is not used
- */
-void HAL_Delay(__IO uint32_t Delay)
-{
- return;
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
}
/* USER CODE END 4 */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/stm32wbxx_hal_msp.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/stm32wbxx_hal_msp.c
index c6a106fa7..87614ca60 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/stm32wbxx_hal_msp.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/stm32wbxx_hal_msp.c
@@ -5,45 +5,15 @@
* Description : This file provides code for the MSP Initialization
* and de-Initialization codes.
******************************************************************************
- * This notice applies to any and all portions of this file
- * that are not between comment pairs USER CODE BEGIN and
- * USER CODE END. Other portions of this file, whether
- * inserted by the user or by software development tools
- * are owned by their respective copyright owners.
+ * @attention
*
- * Copyright (c) 2019 STMicroelectronics International N.V.
- * All rights reserved.
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted, provided that the following conditions are met:
- *
- * 1. Redistribution of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of other
- * contributors to this software may be used to endorse or promote products
- * derived from this software without specific written permission.
- * 4. This software, including modifications and/or derivative works of this
- * software, must execute solely and exclusively on microcontroller or
- * microprocessor devices manufactured by or for STMicroelectronics.
- * 5. Redistribution and use of this software other than as permitted under
- * this license is void and will automatically terminate your rights under
- * this license.
- *
- * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
- * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
- * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
*
******************************************************************************
*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/stm32wbxx_it.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/stm32wbxx_it.c
index 562675143..2a345be14 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/stm32wbxx_it.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/Core/Src/stm32wbxx_it.c
@@ -60,21 +60,10 @@
/* USER CODE END 0 */
/* External variables --------------------------------------------------------*/
-
-
-
extern DMA_HandleTypeDef hdma_lpuart1_tx;
-
-
extern DMA_HandleTypeDef hdma_usart1_tx;
-
-
extern UART_HandleTypeDef hlpuart1;
-
-
extern UART_HandleTypeDef huart1;
-
-
/* USER CODE BEGIN EV */
/* USER CODE END EV */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/STM32_WPAN/App/app_ble.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/STM32_WPAN/App/app_ble.c
index 2d03e0714..cd27fff1b 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/STM32_WPAN/App/app_ble.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/STM32_WPAN/App/app_ble.c
@@ -230,7 +230,7 @@ P2PS_APP_ConnHandle_Not_evt_t handleNotification;
#if L2CAP_REQUEST_NEW_CONN_PARAM != 0
#define SIZE_TAB_CONN_INT 2
-float tab_conn_interval[SIZE_TAB_CONN_INT] = { 50, 1000} ; /* in ms */
+float tab_conn_interval[SIZE_TAB_CONN_INT] = {50, 1000} ; /* ms */
uint8_t index_con_int, mutex;
#endif
@@ -353,6 +353,7 @@ uint8_t manuf_data[14] = {
0x00, /* BLE MAC stop */
};
#endif
+
/* USER CODE BEGIN PV */
/* USER CODE END PV */
@@ -447,7 +448,7 @@ void APP_BLE_Init( void )
* Initialization of ADV - Ad Manufacturer Element - Support OTA Bit Mask
*/
#if(BLE_CFG_OTA_REBOOT_CHAR != 0)
- manuf_data[sizeof(manuf_data)-8] = CFG_FEATURE_OTA_REBOOT;
+ manuf_data[sizeof(manuf_data)-8] = CFG_FEATURE_OTA_REBOOT;
#endif
#if(RADIO_ACTIVITY_EVENT != 0)
aci_hal_set_radio_activity_mask(0x0006);
@@ -522,11 +523,14 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
/*
* SPECIFIC to P2P Server APP
*/
- handleNotification.P2P_Evt_Opcode = PEER_DISCON_HANDLE_EVT;
- handleNotification.ConnectionHandle = BleApplicationContext.BleApplicationContext_legacy.connectionHandle;
- P2PS_APP_Notification(&handleNotification);
+ handleNotification.P2P_Evt_Opcode = PEER_DISCON_HANDLE_EVT;
+ handleNotification.ConnectionHandle = BleApplicationContext.BleApplicationContext_legacy.connectionHandle;
+ P2PS_APP_Notification(&handleNotification);
-}
+ /* USER CODE BEGIN EVT_DISCONN_COMPLETE */
+
+ /* USER CODE END EVT_DISCONN_COMPLETE */
+ }
break; /* EVT_DISCONN_COMPLETE */
@@ -556,24 +560,27 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
{
APP_DBG_MSG("EVT_UPDATE_PHY_COMPLETE, status nok \n");
}
- ret = hci_le_read_phy(BleApplicationContext.BleApplicationContext_legacy.connectionHandle,&TX_PHY,&RX_PHY);
- if (ret == BLE_STATUS_SUCCESS)
- {
- APP_DBG_MSG("Read_PHY success \n");
- if ((TX_PHY == TX_2M) && (RX_PHY == RX_2M))
- {
- APP_DBG_MSG("PHY Param TX= %d, RX= %d \n", TX_PHY, RX_PHY);
- }
- else
- {
- APP_DBG_MSG("PHY Param TX= %d, RX= %d \n", TX_PHY, RX_PHY);
- }
- }
- else
- {
- APP_DBG_MSG("Read conf not succeess \n");
- }
- break;
+ ret = hci_le_read_phy(BleApplicationContext.BleApplicationContext_legacy.connectionHandle,&TX_PHY,&RX_PHY);
+ if (ret == BLE_STATUS_SUCCESS)
+ {
+ APP_DBG_MSG("Read_PHY success \n");
+ if ((TX_PHY == TX_2M) && (RX_PHY == RX_2M))
+ {
+ APP_DBG_MSG("PHY Param TX= %d, RX= %d \n", TX_PHY, RX_PHY);
+ }
+ else
+ {
+ APP_DBG_MSG("PHY Param TX= %d, RX= %d \n", TX_PHY, RX_PHY);
+ }
+ }
+ else
+ {
+ APP_DBG_MSG("Read conf not succeess \n");
+ }
+ /* USER CODE BEGIN EVT_LE_PHY_UPDATE_COMPLETE */
+
+ /* USER CODE END EVT_LE_PHY_UPDATE_COMPLETE */
+ break;
case EVT_LE_CONN_COMPLETE:
{
hci_le_connection_complete_event_rp0 *connection_complete_event;
@@ -692,6 +699,17 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
}
break;
/* USER CODE END ecode */
+/*
+* SPECIFIC to P2P Server APP
+*/
+ case EVT_BLUE_L2CAP_CONNECTION_UPDATE_RESP:
+#if (L2CAP_REQUEST_NEW_CONN_PARAM != 0 )
+ mutex = 1;
+#endif
+ /* USER CODE BEGIN EVT_BLUE_L2CAP_CONNECTION_UPDATE_RESP */
+
+ /* USER CODE END EVT_BLUE_L2CAP_CONNECTION_UPDATE_RESP */
+ break;
case EVT_BLUE_GAP_PROCEDURE_COMPLETE:
APP_DBG_MSG("\r\n\r** EVT_BLUE_GAP_PROCEDURE_COMPLETE \n");
/* USER CODE BEGIN EVT_BLUE_GAP_PROCEDURE_COMPLETE */
@@ -887,7 +905,7 @@ static void Ble_Tl_Init( void )
aci_gap_set_authentication_requirement(BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.bonding_mode,
BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.mitm_mode,
- 0,
+ 1,
0,
BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMin,
BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMax,
@@ -927,10 +945,7 @@ static void Adv_Request(APP_BLE_ConnStatus_t New_Status)
*/
HW_TS_Stop(BleApplicationContext.Advertising_mgr_timer_Id);
-#if(CFG_DEBUG_APP_TRACE != 0)
- APP_DBG_MSG("First index in %d state \n",
- BleApplicationContext.Device_Connection_Status);
-#endif
+ APP_DBG_MSG("First index in %d state \n", BleApplicationContext.Device_Connection_Status);
if ((New_Status == APP_BLE_LP_ADV)
&& ((BleApplicationContext.Device_Connection_Status == APP_BLE_FAST_ADV)
|| (BleApplicationContext.Device_Connection_Status == APP_BLE_LP_ADV)))
@@ -939,16 +954,12 @@ static void Adv_Request(APP_BLE_ConnStatus_t New_Status)
ret = aci_gap_set_non_discoverable();
if (ret == BLE_STATUS_SUCCESS)
{
-#if(CFG_DEBUG_APP_TRACE != 0)
- APP_DBG_MSG("Successfully Stopped Advertising\n");
-#endif
+ APP_DBG_MSG("Successfully Stopped Advertising \n");
}
else
{
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("Stop Advertising Failed , result: %d \n", ret);
-#endif
- }
+ }
}
BleApplicationContext.Device_Connection_Status = New_Status;
@@ -972,30 +983,24 @@ static void Adv_Request(APP_BLE_ConnStatus_t New_Status)
{
if (New_Status == APP_BLE_FAST_ADV)
{
- APP_DBG_MSG("Successfully Start Fast Advertising\n" );
+ APP_DBG_MSG("Successfully Start Fast Advertising \n" );
/* Start Timer to STOP ADV - TIMEOUT */
HW_TS_Start(BleApplicationContext.Advertising_mgr_timer_Id, INITIAL_ADV_TIMEOUT);
}
else
{
-#if(CFG_DEBUG_APP_TRACE != 0)
- APP_DBG_MSG("Successfully Start Low Power Advertising\n");
-#endif
+ APP_DBG_MSG("Successfully Start Low Power Advertising \n");
}
}
else
{
if (New_Status == APP_BLE_FAST_ADV)
{
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("Start Fast Advertising Failed , result: %d \n", ret);
-#endif
}
else
{
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("Start Low Power Advertising Failed , result: %d \n", ret);
-#endif
}
}
@@ -1069,15 +1074,11 @@ static void Adv_Cancel( void )
BleApplicationContext.Device_Connection_Status = APP_BLE_IDLE;
if (result == BLE_STATUS_SUCCESS)
{
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG(" \r\n\r");APP_DBG_MSG("** STOP ADVERTISING ** \r\n\r");
-#endif
}
else
{
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("** STOP ADVERTISING ** Failed \r\n\r");
-#endif
}
}
@@ -1126,15 +1127,11 @@ void BLE_SVC_L2CAP_Conn_Update(uint16_t Connection_Handle)
slave_latency, timeout_multiplier);
if( result == BLE_STATUS_SUCCESS )
{
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("BLE_SVC_L2CAP_Conn_Update(), Successfully \r\n\r");
-#endif
}
else
{
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("BLE_SVC_L2CAP_Conn_Update(), Failed \r\n\r");
-#endif
}
}
/* USER CODE BEGIN BLE_SVC_L2CAP_Conn_Update_2 */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/STM32_WPAN/App/ble_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/STM32_WPAN/App/ble_conf.h
index 79216f945..538713f85 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/STM32_WPAN/App/ble_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/STM32_WPAN/App/ble_conf.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : App/ble_conf.h
- * Description : Configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : Configuration file for BLE Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/STM32_WPAN/App/ble_dbg_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/STM32_WPAN/App/ble_dbg_conf.h
index a047ad0b9..bec936bbe 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/STM32_WPAN/App/ble_dbg_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/STM32_WPAN/App/ble_dbg_conf.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : App/ble_dbg_conf.h
- * Description : Debug configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : Debug configuration file for BLE Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Binary/BLE_p2pServer_ota_reference.bin b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Binary/BLE_p2pServer_ota_reference.bin
index 1f4a66296..c1a65ff03 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Binary/BLE_p2pServer_ota_reference.bin
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Binary/BLE_p2pServer_ota_reference.bin
Binary files differ
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Inc/app_common.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Inc/app_common.h
index 2a1d61089..4defc5d7a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Inc/app_common.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Inc/app_common.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : app_common.h
- * Description : App Common application configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : App Common application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Inc/app_conf.h
index 2b5d45a96..37d63c350 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Inc/app_conf.h
@@ -1,8 +1,9 @@
/**
******************************************************************************
* File Name : app_conf.h
- * Description : Application configuration file for BLE middleWare.
- ******************************************************************************
+ * Description : Application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
@@ -17,17 +18,18 @@
*/
/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef APP_CONFIG_H
-#define APP_CONFIG_H
+#ifndef APP_CONF_H
+#define APP_CONF_H
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Application Config
******************************************************************************/
-/**< generic parameters ********************************************************/
+/**< generic parameters ******************************************************/
/**
* Define Tx Power
@@ -92,6 +94,15 @@
*/
#define CFG_BLE_ERK {0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21,0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21}
+/* USER CODE BEGIN Generic_Parameters */
+/**
+ * SMPS supply
+ * SMPS not used when Set to 0
+ * SMPS used when Set to 1
+ */
+#define CFG_USE_SMPS 1
+/* USER CODE END Generic_Parameters */
+
/**< specific parameters */
/*****************************************************/
#define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI4_IRQHandler
@@ -112,15 +123,15 @@
#define CFG_DEV_ID_P2P_SERVER6 (0x8A)
#define CFG_DEV_ID_P2P_ROUTER (0x85)
-#define RADIO_ACTIVITY_EVENT 1 /* 1 for OOB Demo */
+#define RADIO_ACTIVITY_EVENT 1 /* 1 for OOB Demo */
/**
* AD Element - Group B Feature
*/
-/* LSB - Firt Byte */
+/* LSB - First Byte */
#define CFG_FEATURE_THREAD_SWITCH (0x40)
-/* LSB - Second Byte */
+/* LSB - Second Byte */
#define CFG_FEATURE_OTA_REBOOT (0x20)
#define CONN_L(x) ((int)((x)/0.625f))
@@ -213,7 +224,7 @@
* 1 : internal RO
* 0 : external crystal ( no calibration )
*/
-#define CFG_BLE_LSE_SOURCE 1
+#define CFG_BLE_LSE_SOURCE 0
/**
* Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
@@ -525,7 +536,10 @@ typedef enum
typedef enum
{
CFG_LPM_APP,
- CFG_LPM_APP_BLE
+ CFG_LPM_APP_BLE,
+ /* USER CODE BEGIN CFG_LPM_Id_t */
+
+ /* USER CODE END CFG_LPM_Id_t */
} CFG_LPM_Id_t;
/******************************************************************************
@@ -535,6 +549,6 @@ typedef enum
#define CFG_OTP_END_ADRESS OTP_AREA_END_ADDR
-#endif /*APP_CONFIG_H */
+#endif /*APP_CONF_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Inc/stm32_lpm_if.h
index 38e326512..d8e67947f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Inc/stm32_lpm_if.h
@@ -1,46 +1,22 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file stm32_lpm_if.h
-* @brief Header for stm32_lpm_f.c module (device specific LP management)
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
******************************************************************************
* @attention
*
-* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics International N.V.
+* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted, provided that the following conditions are met:
-*
-* 1. Redistribution of source code must retain the above copyright notice,
-* this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following disclaimer in the documentation
-* and/or other materials provided with the distribution.
-* 3. Neither the name of STMicroelectronics nor the names of other
-* contributors to this software may be used to endorse or promote products
-* derived from this software without specific written permission.
-* 4. This software, including modifications and/or derivative works of this
-* software, must execute solely and exclusively on microcontroller or
-* microprocessor devices manufactured by or for STMicroelectronics.
-* 5. Redistribution and use of this software other than as permitted under
-* this license is void and will automatically terminate your rights under
-* this license.
-*
-* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
-* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
-* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+* This software component is licensed by ST under BSD 3-Clause license,
+* the "License"; You may not use this file except in compliance with the
+* License. You may obtain a copy of the License at:
+* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32_LPM_IF_H
@@ -89,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Inc/stm32wbxx_hal_conf.h
index 5c703f75d..31d63e37a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Inc/stm32wbxx_hal_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Inc/stm32wbxx_hal_conf.h
@@ -58,6 +58,7 @@
#define HAL_UART_MODULE_ENABLED
/*#define HAL_USART_MODULE_ENABLED */
/*#define HAL_WWDG_MODULE_ENABLED */
+#define HAL_EXTI_MODULE_ENABLED
#define HAL_CORTEX_MODULE_ENABLED
#define HAL_DMA_MODULE_ENABLED
#define HAL_FLASH_MODULE_ENABLED
@@ -221,6 +222,10 @@
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32wbxx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32wbxx_hal_flash.h"
@@ -333,9 +338,9 @@
* If expr is true, it returns no value.
* @retval None
*/
-#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
+ #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
/* Exported functions ------------------------------------------------------- */
-void assert_failed(uint8_t* file, uint32_t line);
+ void assert_failed(uint8_t* file, uint32_t line);
#else
#define assert_param(expr) ((void)0U)
#endif /* USE_FULL_ASSERT */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Inc/utilities_conf.h
index c98d97ba1..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Inc/utilities_conf.h
@@ -1,3 +1,4 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* File Name : utilities_conf.h
@@ -9,13 +10,14 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef UTILITIES_CONF_H
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/app_entry.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/app_entry.c
index 961d037e9..37c4b3b21 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/app_entry.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/app_entry.c
@@ -69,8 +69,8 @@ static void SystemPower_Config( void );
static void Init_Debug( void );
static void appe_Tl_Init( void );
static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status );
-
static void APPE_SysUserEvtRx( void * pPayload );
+
#if (CFG_HW_LPUART1_ENABLED == 1)
extern void MX_LPUART1_UART_Init(void);
#endif
@@ -107,7 +107,7 @@ void APPE_Init( void )
/**
* From now, the application is waiting for the ready event ( VS_HCI_C2_Ready )
- * received on the system channel before starting the BLE Stack
+ * received on the system channel before starting the Stack
* This system event is received with APPE_SysUserEvtRx()
*/
/* USER CODE BEGIN APPE_Init_2 */
@@ -220,8 +220,6 @@ static void appe_Tl_Init( void )
return;
}
-
-
static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status )
{
UNUSED(status);
@@ -235,7 +233,7 @@ static void APPE_SysUserEvtRx( void * pPayload )
TL_TRACES_Init( );
APP_BLE_Init( );
- UTIL_LPM_SetOffMode(1 << CFG_LPM_APP, UTIL_LPM_ENABLE);
+ UTIL_LPM_SetOffMode(1U << CFG_LPM_APP, UTIL_LPM_ENABLE);
return;
}
@@ -286,7 +284,6 @@ void UTIL_SEQ_Idle( void )
return;
}
-
/**
* @brief This function is called by the scheduler each time an event
* is pending.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/hw_timerserver.c
index 52a1bfa0d..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/hw_timerserver.c
@@ -1,22 +1,21 @@
/**
******************************************************************************
- * File Name : hw_timerserver.c
- * Description : Hardware timerserver source file for BLE
- * middleWare.
+ * File Name : hw_timerserver.c
+ * Description : Hardware timerserver source file for STM32WPAN Middleware.
+ *
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/hw_uart.c
index 52e9e2b3a..9a553610d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/hw_uart.c
@@ -1,7 +1,7 @@
/**
******************************************************************************
* File Name : Src/hw_uart.c
- * Description : HW UART source file for BLE middleWare.
+ * Description : HW UART source file for STM32WPAN Middleware.
*
******************************************************************************
* @attention
@@ -48,7 +48,7 @@ extern UART_HandleTypeDef huart1;
hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
} while(0)
- /* Variables ------------------------------------------------------------------*/
+/* Variables -----------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
@@ -65,73 +65,73 @@ extern UART_HandleTypeDef huart1;
void (*HW_hlpuart1TxCb)(void);
#endif
- void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_RX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_RX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_RX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_RX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ return;
+}
+
+void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
{
- HAL_StatusTypeDef hal_status = HAL_OK;
- hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
+ default:
+ break;
}
switch (hal_status)
@@ -161,8 +161,8 @@ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t
hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
{
-HAL_StatusTypeDef hal_status = HAL_OK;
-hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
@@ -250,33 +250,33 @@ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
switch ((uint32_t)huart->Instance)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1RxCb)
- {
- HW_huart1RxCb();
- }
- break;
+ if(HW_huart1RxCb)
+ {
+ HW_huart1RxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1RxCb)
- {
- HW_hlpuart1RxCb();
- }
- break;
+ if(HW_hlpuart1RxCb)
+ {
+ HW_hlpuart1RxCb();
+ }
+ break;
#endif
default:
@@ -292,20 +292,20 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1TxCb)
- {
- HW_huart1TxCb();
- }
- break;
+ if(HW_huart1TxCb)
+ {
+ HW_huart1TxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1TxCb)
- {
- HW_hlpuart1TxCb();
- }
- break;
+ if(HW_hlpuart1TxCb)
+ {
+ HW_hlpuart1TxCb();
+ }
+ break;
#endif
default:
@@ -315,4 +315,4 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
return;
}
- /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/main.c
index 3e30e0b1e..4741fe7f1 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/main.c
@@ -41,10 +41,10 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "app_entry.h"
+#include "app_common.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
-#include "app_common.h"
#include "stm32_lpm.h"
#include "stm32_seq.h"
#include "dbg_trace.h"
@@ -110,6 +110,7 @@ int main(void)
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
+
/* MCU Configuration--------------------------------------------------------*/
@@ -137,6 +138,8 @@ int main(void)
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
+
+ /* Init code for STM32_WPAN */
APPE_Init();
/* Infinite loop */
@@ -161,17 +164,20 @@ void SystemClock_Config(void)
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
+ /** Configure LSE Drive Capability
+ */
+ __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
/** Configure the main internal regulator output voltage
*/
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
/** Initializes the CPU, AHB and APB busses clocks
*/
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSI1
- |RCC_OSCILLATORTYPE_HSE;
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE
+ |RCC_OSCILLATORTYPE_LSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ RCC_OscInitStruct.LSEState = RCC_LSE_ON;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
- RCC_OscInitStruct.LSIState = RCC_LSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
@@ -200,8 +206,8 @@ void SystemClock_Config(void)
|RCC_PERIPHCLK_LPUART1;
PeriphClkInitStruct.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2;
PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1;
- PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI;
- PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSI;
+ PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
+ PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSE;
PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSE;
PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE0;
@@ -357,7 +363,13 @@ static void MX_RTC_Init(void)
Error_Handler();
}
/* USER CODE BEGIN RTC_Init 2 */
- MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* Disable RTC registers write protection */
+ LL_RTC_DisableWriteProtection(RTC);
+
+ LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER);
+
+ /* Enable RTC registers write protection */
+ LL_RTC_EnableWriteProtection(RTC);
/* USER CODE END RTC_Init 2 */
}
@@ -367,6 +379,7 @@ static void MX_RTC_Init(void)
*/
static void MX_DMA_Init(void)
{
+
/* DMA controller clock enable */
__HAL_RCC_DMAMUX1_CLK_ENABLE();
__HAL_RCC_DMA1_CLK_ENABLE();
@@ -404,7 +417,13 @@ void PeriphClock_Config(void)
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
- LL_RCC_HSI48_Enable();
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
+ LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -437,30 +456,6 @@ void PeriphClock_Config(void)
HAL_RCCEx_CRSConfig(&RCC_CRSInitStruct);
#endif
- /**
- * Select LSE clock
- */
- LL_RCC_LSE_Enable();
- while(!LL_RCC_LSE_IsReady());
-
- /**
- * Select wakeup source of BLE RF
- */
- LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
-
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
/*************************************************************
@@ -567,21 +562,33 @@ static void Init_Exti( void )
* WRAP FUNCTIONS
*
*************************************************************/
-
-/**
- * This function is empty to avoid starting the SysTick Timer
- */
-HAL_StatusTypeDef HAL_InitTick( uint32_t TickPriority )
+void HAL_Delay(uint32_t Delay)
{
- return (HAL_OK);
-}
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
-/**
- * This function is empty as the SysTick Timer is not used
- */
-void HAL_Delay(__IO uint32_t Delay)
-{
- return;
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
}
/* USER CODE END 4 */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/stm32wbxx_hal_msp.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/stm32wbxx_hal_msp.c
index c6a106fa7..87614ca60 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/stm32wbxx_hal_msp.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/stm32wbxx_hal_msp.c
@@ -5,45 +5,15 @@
* Description : This file provides code for the MSP Initialization
* and de-Initialization codes.
******************************************************************************
- * This notice applies to any and all portions of this file
- * that are not between comment pairs USER CODE BEGIN and
- * USER CODE END. Other portions of this file, whether
- * inserted by the user or by software development tools
- * are owned by their respective copyright owners.
+ * @attention
*
- * Copyright (c) 2019 STMicroelectronics International N.V.
- * All rights reserved.
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted, provided that the following conditions are met:
- *
- * 1. Redistribution of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of other
- * contributors to this software may be used to endorse or promote products
- * derived from this software without specific written permission.
- * 4. This software, including modifications and/or derivative works of this
- * software, must execute solely and exclusively on microcontroller or
- * microprocessor devices manufactured by or for STMicroelectronics.
- * 5. Redistribution and use of this software other than as permitted under
- * this license is void and will automatically terminate your rights under
- * this license.
- *
- * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
- * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
- * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
*
******************************************************************************
*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/stm32wbxx_it.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/stm32wbxx_it.c
index 562675143..2a345be14 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/stm32wbxx_it.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/Core/Src/stm32wbxx_it.c
@@ -60,21 +60,10 @@
/* USER CODE END 0 */
/* External variables --------------------------------------------------------*/
-
-
-
extern DMA_HandleTypeDef hdma_lpuart1_tx;
-
-
extern DMA_HandleTypeDef hdma_usart1_tx;
-
-
extern UART_HandleTypeDef hlpuart1;
-
-
extern UART_HandleTypeDef huart1;
-
-
/* USER CODE BEGIN EV */
/* USER CODE END EV */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/MDK-ARM/BLE_p2pServer_ota.uvoptx b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/MDK-ARM/BLE_p2pServer_ota.uvoptx
index e34a3993a..498901fec 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/MDK-ARM/BLE_p2pServer_ota.uvoptx
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/MDK-ARM/BLE_p2pServer_ota.uvoptx
@@ -77,7 +77,7 @@
<tvExpOptDlg>0</tvExpOptDlg>
<IsCurrentTarget>1</IsCurrentTarget>
</OPTFL>
- <CpuCode>0</CpuCode>
+ <CpuCode>18</CpuCode>
<DebugOpt>
<uSim>0</uSim>
<uTrg>1</uTrg>
@@ -175,21 +175,13 @@
</Target>
<Group>
- <GroupName>::CMSIS</GroupName>
- <tvExp>0</tvExp>
- <tvExpOptDlg>0</tvExpOptDlg>
- <cbSel>0</cbSel>
- <RteFlg>1</RteFlg>
- </Group>
-
- <Group>
<GroupName>Application/MDK-ARM</GroupName>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
- <GroupNumber>2</GroupNumber>
+ <GroupNumber>1</GroupNumber>
<FileNumber>1</FileNumber>
<FileType>2</FileType>
<tvExp>0</tvExp>
@@ -209,7 +201,7 @@
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
- <GroupNumber>3</GroupNumber>
+ <GroupNumber>2</GroupNumber>
<FileNumber>2</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -221,7 +213,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>3</GroupNumber>
+ <GroupNumber>2</GroupNumber>
<FileNumber>3</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -233,7 +225,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>3</GroupNumber>
+ <GroupNumber>2</GroupNumber>
<FileNumber>4</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -245,7 +237,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>3</GroupNumber>
+ <GroupNumber>2</GroupNumber>
<FileNumber>5</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -257,7 +249,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>3</GroupNumber>
+ <GroupNumber>2</GroupNumber>
<FileNumber>6</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -269,7 +261,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>3</GroupNumber>
+ <GroupNumber>2</GroupNumber>
<FileNumber>7</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -281,7 +273,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>3</GroupNumber>
+ <GroupNumber>2</GroupNumber>
<FileNumber>8</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -301,7 +293,7 @@
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
- <GroupNumber>4</GroupNumber>
+ <GroupNumber>3</GroupNumber>
<FileNumber>9</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -313,7 +305,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>4</GroupNumber>
+ <GroupNumber>3</GroupNumber>
<FileNumber>10</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -333,7 +325,7 @@
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
- <GroupNumber>5</GroupNumber>
+ <GroupNumber>4</GroupNumber>
<FileNumber>11</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -353,7 +345,7 @@
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
- <GroupNumber>6</GroupNumber>
+ <GroupNumber>5</GroupNumber>
<FileNumber>12</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
@@ -373,7 +365,7 @@
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
- <GroupNumber>7</GroupNumber>
+ <GroupNumber>6</GroupNumber>
<FileNumber>13</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -393,7 +385,7 @@
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
- <GroupNumber>8</GroupNumber>
+ <GroupNumber>7</GroupNumber>
<FileNumber>14</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -413,7 +405,7 @@
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
- <GroupNumber>9</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>15</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -425,7 +417,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>9</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>16</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -437,7 +429,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>9</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>17</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -449,7 +441,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>9</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>18</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -461,7 +453,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>9</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>19</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -473,7 +465,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>9</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>20</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -485,7 +477,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>9</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>21</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -497,7 +489,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>9</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>22</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -509,7 +501,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>9</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>23</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -521,7 +513,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>9</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>24</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -533,7 +525,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>9</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>25</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -545,7 +537,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>9</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>26</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -557,7 +549,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>9</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>27</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -569,7 +561,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>9</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>28</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -581,7 +573,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>9</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>29</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -593,7 +585,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>9</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>30</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -605,7 +597,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>9</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>31</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -617,7 +609,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>9</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>32</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -629,7 +621,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>9</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>33</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -649,7 +641,7 @@
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
- <GroupNumber>10</GroupNumber>
+ <GroupNumber>9</GroupNumber>
<FileNumber>34</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -661,7 +653,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>10</GroupNumber>
+ <GroupNumber>9</GroupNumber>
<FileNumber>35</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -673,7 +665,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>10</GroupNumber>
+ <GroupNumber>9</GroupNumber>
<FileNumber>36</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -685,7 +677,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>10</GroupNumber>
+ <GroupNumber>9</GroupNumber>
<FileNumber>37</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -697,7 +689,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>10</GroupNumber>
+ <GroupNumber>9</GroupNumber>
<FileNumber>38</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -709,7 +701,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>10</GroupNumber>
+ <GroupNumber>9</GroupNumber>
<FileNumber>39</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -721,7 +713,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>10</GroupNumber>
+ <GroupNumber>9</GroupNumber>
<FileNumber>40</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -733,7 +725,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>10</GroupNumber>
+ <GroupNumber>9</GroupNumber>
<FileNumber>41</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -745,7 +737,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>10</GroupNumber>
+ <GroupNumber>9</GroupNumber>
<FileNumber>42</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -757,7 +749,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>10</GroupNumber>
+ <GroupNumber>9</GroupNumber>
<FileNumber>43</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -769,7 +761,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>10</GroupNumber>
+ <GroupNumber>9</GroupNumber>
<FileNumber>44</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -781,7 +773,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>10</GroupNumber>
+ <GroupNumber>9</GroupNumber>
<FileNumber>45</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -793,7 +785,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>10</GroupNumber>
+ <GroupNumber>9</GroupNumber>
<FileNumber>46</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -805,7 +797,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>10</GroupNumber>
+ <GroupNumber>9</GroupNumber>
<FileNumber>47</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -817,7 +809,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>10</GroupNumber>
+ <GroupNumber>9</GroupNumber>
<FileNumber>48</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -829,7 +821,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>10</GroupNumber>
+ <GroupNumber>9</GroupNumber>
<FileNumber>49</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -841,7 +833,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>10</GroupNumber>
+ <GroupNumber>9</GroupNumber>
<FileNumber>50</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -853,7 +845,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>10</GroupNumber>
+ <GroupNumber>9</GroupNumber>
<FileNumber>51</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -873,7 +865,7 @@
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
- <GroupNumber>11</GroupNumber>
+ <GroupNumber>10</GroupNumber>
<FileNumber>52</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -885,7 +877,7 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>11</GroupNumber>
+ <GroupNumber>10</GroupNumber>
<FileNumber>53</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -898,4 +890,12 @@
</File>
</Group>
+ <Group>
+ <GroupName>::CMSIS</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>1</RteFlg>
+ </Group>
+
</ProjectOpt>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/MDK-ARM/BLE_p2pServer_ota.uvprojx b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/MDK-ARM/BLE_p2pServer_ota.uvprojx
index 6a586e671..8b2bc4371 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/MDK-ARM/BLE_p2pServer_ota.uvprojx
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/MDK-ARM/BLE_p2pServer_ota.uvprojx
@@ -16,7 +16,7 @@
<TargetCommonOption>
<Device>STM32WB55RGVx</Device>
<Vendor>STMicroelectronics</Vendor>
- <PackID>Keil.STM32WBxx.0.0.7</PackID>
+ <PackID>Keil.STM32WBxx.0.0.6</PackID>
<PackURL>http://www.keil.com/pack</PackURL>
<Cpu>IROM(0x08007000-0x807FFFF) IRAM(0x20000004-0x2002FC03) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4")</Cpu>
<FlashUtilSpec></FlashUtilSpec>
@@ -82,7 +82,7 @@
<AfterMake>
<RunUserProg1>1</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
- <UserProg1Name>fromelf #L --bin --output=$L@L.bin</UserProg1Name>
+ <UserProg1Name>fromelf #L --bincombined --output=$L@L.bin</UserProg1Name>
<UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
@@ -380,9 +380,6 @@
</TargetOption>
<Groups>
<Group>
- <GroupName>::CMSIS</GroupName>
- </Group>
- <Group>
<GroupName>Application/MDK-ARM</GroupName>
<Files>
<File>
@@ -697,6 +694,9 @@
</File>
</Files>
</Group>
+ <Group>
+ <GroupName>::CMSIS</GroupName>
+ </Group>
</Groups>
</Target>
</Targets>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/STM32_WPAN/App/app_ble.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/STM32_WPAN/App/app_ble.c
index a23874290..27a3dcc39 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/STM32_WPAN/App/app_ble.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/STM32_WPAN/App/app_ble.c
@@ -230,7 +230,7 @@ P2PS_APP_ConnHandle_Not_evt_t handleNotification;
#if L2CAP_REQUEST_NEW_CONN_PARAM != 0
#define SIZE_TAB_CONN_INT 2
-float tab_conn_interval[SIZE_TAB_CONN_INT] = { 50, 1000} ; /* in ms */
+float tab_conn_interval[SIZE_TAB_CONN_INT] = {50, 1000} ; /* ms */
uint8_t index_con_int, mutex;
#endif
@@ -353,6 +353,7 @@ uint8_t manuf_data[14] = {
0x00, /* BLE MAC stop */
};
#endif
+
/* USER CODE BEGIN PV */
/* USER CODE END PV */
@@ -496,6 +497,9 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
hci_event_pckt *event_pckt;
evt_le_meta_event *meta_evt;
evt_blue_aci *blue_evt;
+ hci_le_phy_update_complete_event_rp0 *evt_le_phy_update_complete;
+ uint8_t TX_PHY, RX_PHY;
+ tBleStatus ret = BLE_STATUS_INVALID_PARAMS;
event_pckt = (hci_event_pckt*) ((hci_uart_pckt *) pckt)->data;
@@ -510,9 +514,8 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
{
BleApplicationContext.BleApplicationContext_legacy.connectionHandle = 0;
BleApplicationContext.Device_Connection_Status = APP_BLE_IDLE;
-#if(CFG_DEBUG_APP_TRACE != 0)
+
APP_DBG_MSG("\r\n\r** DISCONNECTION EVENT WITH CLIENT \n");
-#endif
}
/* restart advertising */
@@ -520,11 +523,14 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
/*
* SPECIFIC to P2P Server APP
*/
- handleNotification.P2P_Evt_Opcode = PEER_DISCON_HANDLE_EVT;
- handleNotification.ConnectionHandle = BleApplicationContext.BleApplicationContext_legacy.connectionHandle;
- P2PS_APP_Notification(&handleNotification);
+ handleNotification.P2P_Evt_Opcode = PEER_DISCON_HANDLE_EVT;
+ handleNotification.ConnectionHandle = BleApplicationContext.BleApplicationContext_legacy.connectionHandle;
+ P2PS_APP_Notification(&handleNotification);
-}
+ /* USER CODE BEGIN EVT_DISCONN_COMPLETE */
+
+ /* USER CODE END EVT_DISCONN_COMPLETE */
+ }
break; /* EVT_DISCONN_COMPLETE */
@@ -537,13 +543,44 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
switch (meta_evt->subevent)
{
case EVT_LE_CONN_UPDATE_COMPLETE:
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("\r\n\r** CONNECTION UPDATE EVENT WITH CLIENT \n");
-#endif
+
/* USER CODE BEGIN EVT_LE_CONN_UPDATE_COMPLETE */
/* USER CODE END EVT_LE_CONN_UPDATE_COMPLETE */
break;
+ case EVT_LE_PHY_UPDATE_COMPLETE:
+ APP_DBG_MSG("EVT_UPDATE_PHY_COMPLETE \n");
+ evt_le_phy_update_complete = (hci_le_phy_update_complete_event_rp0*)meta_evt->data;
+ if (evt_le_phy_update_complete->Status == 0)
+ {
+ APP_DBG_MSG("EVT_UPDATE_PHY_COMPLETE, status ok \n");
+ }
+ else
+ {
+ APP_DBG_MSG("EVT_UPDATE_PHY_COMPLETE, status nok \n");
+ }
+ ret = hci_le_read_phy(BleApplicationContext.BleApplicationContext_legacy.connectionHandle,&TX_PHY,&RX_PHY);
+ if (ret == BLE_STATUS_SUCCESS)
+ {
+ APP_DBG_MSG("Read_PHY success \n");
+ if ((TX_PHY == TX_2M) && (RX_PHY == RX_2M))
+ {
+ APP_DBG_MSG("PHY Param TX= %d, RX= %d \n", TX_PHY, RX_PHY);
+ }
+ else
+ {
+ APP_DBG_MSG("PHY Param TX= %d, RX= %d \n", TX_PHY, RX_PHY);
+ }
+ }
+ else
+ {
+ APP_DBG_MSG("Read conf not succeess \n");
+ }
+ /* USER CODE BEGIN EVT_LE_PHY_UPDATE_COMPLETE */
+
+ /* USER CODE END EVT_LE_PHY_UPDATE_COMPLETE */
+ break;
case EVT_LE_CONN_COMPLETE:
{
hci_le_connection_complete_event_rp0 *connection_complete_event;
@@ -555,10 +592,8 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
HW_TS_Stop(BleApplicationContext.Advertising_mgr_timer_Id);
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("EVT_LE_CONN_COMPLETE for connection handle 0x%x\n",
connection_complete_event->Connection_Handle);
-#endif
if (BleApplicationContext.Device_Connection_Status == APP_BLE_LP_CONNECTING)
{
/* Connection as client */
@@ -606,7 +641,63 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
switch (blue_evt->ecode)
{
/* USER CODE BEGIN ecode */
+ aci_gap_pairing_complete_event_rp0 *pairing_complete;
+ case EVT_BLUE_GAP_LIMITED_DISCOVERABLE:
+ APP_DBG_MSG("\r\n\r** EVT_BLUE_GAP_LIMITED_DISCOVERABLE \n");
+ break; /* EVT_BLUE_GAP_LIMITED_DISCOVERABLE */
+ case EVT_BLUE_GAP_PASS_KEY_REQUEST:
+ APP_DBG_MSG("\r\n\r** EVT_BLUE_GAP_PASS_KEY_REQUEST \n");
+/*
+ aci_gap_pass_key_resp(BleApplicationContext.BleApplicationContext_legacy.connectionHandle,123456);
+*/
+ APP_DBG_MSG("\r\n\r** aci_gap_pass_key_resp \n");
+ break; /* EVT_BLUE_GAP_PASS_KEY_REQUEST */
+ case EVT_BLUE_GAP_AUTHORIZATION_REQUEST:
+ APP_DBG_MSG("\r\n\r** EVT_BLUE_GAP_AUTHORIZATION_REQUEST \n");
+ break; /* EVT_BLUE_GAP_AUTHORIZATION_REQUEST */
+ case EVT_BLUE_GAP_SLAVE_SECURITY_INITIATED:
+ APP_DBG_MSG("\r\n\r** EVT_BLUE_GAP_SLAVE_SECURITY_INITIATED \n");
+ break; /* EVT_BLUE_GAP_SLAVE_SECURITY_INITIATED */
+ case EVT_BLUE_GAP_BOND_LOST:
+ APP_DBG_MSG("\r\n\r** EVT_BLUE_GAP_BOND_LOST \n");
+ aci_gap_allow_rebond(BleApplicationContext.BleApplicationContext_legacy.connectionHandle);
+ APP_DBG_MSG("\r\n\r** Send allow rebond \n");
+ break; /* EVT_BLUE_GAP_BOND_LOST */
+ case EVT_BLUE_GAP_DEVICE_FOUND:
+ APP_DBG_MSG("\r\n\r** EVT_BLUE_GAP_DEVICE_FOUND \n");
+ break; /* EVT_BLUE_GAP_DEVICE_FOUND */
+ case EVT_BLUE_GAP_ADDR_NOT_RESOLVED:
+ APP_DBG_MSG("\r\n\r** EVT_BLUE_GAP_DEVICE_FOUND \n");
+ break; /* EVT_BLUE_GAP_DEVICE_FOUND */
+ case (EVT_BLUE_GAP_KEYPRESS_NOTIFICATION):
+ APP_DBG_MSG("\r\n\r** EVT_BLUE_GAP_KEYPRESS_NOTIFICATION \n");
+ break; /* EVT_BLUE_GAP_KEY_PRESS_NOTIFICATION */
+ case (EVT_BLUE_GAP_NUMERIC_COMPARISON_VALUE):
+ APP_DBG_MSG("numeric_value = %ld\n",
+ ((aci_gap_numeric_comparison_value_event_rp0 *)(blue_evt->data))->Numeric_Value);
+
+ APP_DBG_MSG("Hex_value = %lx\n",
+ ((aci_gap_numeric_comparison_value_event_rp0 *)(blue_evt->data))->Numeric_Value);
+
+ aci_gap_numeric_comparison_value_confirm_yesno(BleApplicationContext.BleApplicationContext_legacy.connectionHandle, 1); /* CONFIRM_YES = 1 */
+
+ APP_DBG_MSG("\r\n\r** aci_gap_numeric_comparison_value_confirm_yesno-->YES \n");
+ break;
+ case (EVT_BLUE_GAP_PAIRING_CMPLT):
+ {
+ pairing_complete = (aci_gap_pairing_complete_event_rp0*)blue_evt->data;
+ APP_DBG_MSG("BLE_CTRL_App_Notification: EVT_BLUE_GAP_PAIRING_CMPLT, pairing_complete->Status = %d\n",pairing_complete->Status);
+ if (pairing_complete->Status == 0)
+ {
+ APP_DBG_MSG("\r\n\r** Pairing OK \n");
+ }
+ else
+ {
+ APP_DBG_MSG("\r\n\r** Pairing KO \n");
+ }
+ }
+ break;
/* USER CODE END ecode */
/*
* SPECIFIC to P2P Server APP
@@ -620,9 +711,7 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
/* USER CODE END EVT_BLUE_L2CAP_CONNECTION_UPDATE_RESP */
break;
case EVT_BLUE_GAP_PROCEDURE_COMPLETE:
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("\r\n\r** EVT_BLUE_GAP_PROCEDURE_COMPLETE \n");
-#endif
/* USER CODE BEGIN EVT_BLUE_GAP_PROCEDURE_COMPLETE */
/* USER CODE END EVT_BLUE_GAP_PROCEDURE_COMPLETE */
@@ -816,7 +905,7 @@ static void Ble_Tl_Init( void )
aci_gap_set_authentication_requirement(BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.bonding_mode,
BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.mitm_mode,
- 0,
+ 1,
0,
BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMin,
BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMax,
@@ -856,10 +945,7 @@ static void Adv_Request(APP_BLE_ConnStatus_t New_Status)
*/
HW_TS_Stop(BleApplicationContext.Advertising_mgr_timer_Id);
-#if(CFG_DEBUG_APP_TRACE != 0)
- APP_DBG_MSG("First index in %d state \n",
- BleApplicationContext.Device_Connection_Status);
-#endif
+ APP_DBG_MSG("First index in %d state \n", BleApplicationContext.Device_Connection_Status);
if ((New_Status == APP_BLE_LP_ADV)
&& ((BleApplicationContext.Device_Connection_Status == APP_BLE_FAST_ADV)
|| (BleApplicationContext.Device_Connection_Status == APP_BLE_LP_ADV)))
@@ -868,16 +954,12 @@ static void Adv_Request(APP_BLE_ConnStatus_t New_Status)
ret = aci_gap_set_non_discoverable();
if (ret == BLE_STATUS_SUCCESS)
{
-#if(CFG_DEBUG_APP_TRACE != 0)
- APP_DBG_MSG("Successfully Stopped Advertising\n");
-#endif
+ APP_DBG_MSG("Successfully Stopped Advertising \n");
}
else
{
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("Stop Advertising Failed , result: %d \n", ret);
-#endif
- }
+ }
}
BleApplicationContext.Device_Connection_Status = New_Status;
@@ -901,30 +983,24 @@ static void Adv_Request(APP_BLE_ConnStatus_t New_Status)
{
if (New_Status == APP_BLE_FAST_ADV)
{
- APP_DBG_MSG("Successfully Start Fast Advertising\n" );
+ APP_DBG_MSG("Successfully Start Fast Advertising \n" );
/* Start Timer to STOP ADV - TIMEOUT */
HW_TS_Start(BleApplicationContext.Advertising_mgr_timer_Id, INITIAL_ADV_TIMEOUT);
}
else
{
-#if(CFG_DEBUG_APP_TRACE != 0)
- APP_DBG_MSG("Successfully Start Low Power Advertising\n");
-#endif
+ APP_DBG_MSG("Successfully Start Low Power Advertising \n");
}
}
else
{
if (New_Status == APP_BLE_FAST_ADV)
{
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("Start Fast Advertising Failed , result: %d \n", ret);
-#endif
}
else
{
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("Start Low Power Advertising Failed , result: %d \n", ret);
-#endif
}
}
@@ -998,15 +1074,11 @@ static void Adv_Cancel( void )
BleApplicationContext.Device_Connection_Status = APP_BLE_IDLE;
if (result == BLE_STATUS_SUCCESS)
{
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG(" \r\n\r");APP_DBG_MSG("** STOP ADVERTISING ** \r\n\r");
-#endif
}
else
{
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("** STOP ADVERTISING ** Failed \r\n\r");
-#endif
}
}
@@ -1055,15 +1127,11 @@ void BLE_SVC_L2CAP_Conn_Update(uint16_t Connection_Handle)
slave_latency, timeout_multiplier);
if( result == BLE_STATUS_SUCCESS )
{
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("BLE_SVC_L2CAP_Conn_Update(), Successfully \r\n\r");
-#endif
}
else
{
-#if(CFG_DEBUG_APP_TRACE != 0)
APP_DBG_MSG("BLE_SVC_L2CAP_Conn_Update(), Failed \r\n\r");
-#endif
}
}
/* USER CODE BEGIN BLE_SVC_L2CAP_Conn_Update_2 */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/STM32_WPAN/App/ble_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/STM32_WPAN/App/ble_conf.h
index 429c305c7..f6e04686e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/STM32_WPAN/App/ble_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/STM32_WPAN/App/ble_conf.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : App/ble_conf.h
- * Description : Configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : Configuration file for BLE Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/STM32_WPAN/App/ble_dbg_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/STM32_WPAN/App/ble_dbg_conf.h
index a047ad0b9..bec936bbe 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/STM32_WPAN/App/ble_dbg_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer_ota/STM32_WPAN/App/ble_dbg_conf.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : App/ble_dbg_conf.h
- * Description : Debug configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : Debug configuration file for BLE Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Inc/app_conf.h
index 1ce26c5e9..8cddfadcf 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Inc/app_conf.h
@@ -23,6 +23,7 @@
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Application Config
@@ -94,8 +95,20 @@
*/
#define CFG_BLE_ERK {0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21,0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21}
+/* USER CODE BEGIN Generic_Parameters */
+/**
+ * SMPS supply
+ * SMPS not used when Set to 0
+ * SMPS used when Set to 1
+ */
+#define CFG_USE_SMPS 1
+/* USER CODE END Generic_Parameters */
+
/**< specific parameters */
/*****************************************************/
+#define CFG_LED_SUPPORTED 1
+#define CFG_BUTTON_SUPPORTED 1
+
#define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI4_IRQHandler
#define PUSH_BUTTON_SW2_EXTI_IRQHandler EXTI0_IRQHandler
#define PUSH_BUTTON_SW3_EXTI_IRQHandler EXTI1_IRQHandler
@@ -116,15 +129,15 @@
#define CFG_DEV_ID_P2P_SERVER6 (0x8A)
#define CFG_DEV_ID_P2P_ROUTER (0x85)
-#define RADIO_ACTIVITY_EVENT 1 /* 1 for OOB Demo */
+#define RADIO_ACTIVITY_EVENT 1 /* 1 for OOB Demo */
/**
* AD Element - Group B Feature
*/
-/* LSB - Firt Byte */
+/* LSB - First Byte */
#define CFG_FEATURE_THREAD_SWITCH (0x40)
-/* LSB - Second Byte */
+/* LSB - Second Byte */
#define CFG_FEATURE_OTA_REBOOT (0x20)
#define CONN_L(x) ((int)((x)/0.625f))
@@ -217,7 +230,7 @@
* 1 : internal RO
* 0 : external crystal ( no calibration )
*/
-#define CFG_BLE_LSE_SOURCE 1
+#define CFG_BLE_LSE_SOURCE 0
/**
* Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
@@ -425,11 +438,6 @@ typedef enum
#define CFG_DEBUGGER_SUPPORTED 1
#endif
-/* USER CODE BEGIN Defines */
-#define CFG_LED_SUPPORTED 1
-#define CFG_BUTTON_SUPPORTED 1
-/* USER CODE END Defines */
-
/**
* When CFG_DEBUG_TRACE_FULL is set to 1, the trace are output with the API name, the file name and the line number
* When CFG_DEBUG_TRACE_LIGHT is set to 1, only the debug message is output
@@ -553,7 +561,10 @@ typedef enum
typedef enum
{
CFG_LPM_APP,
- CFG_LPM_APP_BLE
+ CFG_LPM_APP_BLE
+ /* USER CODE BEGIN CFG_LPM_Id_t */
+
+ /* USER CODE END CFG_LPM_Id_t */
} CFG_LPM_Id_t;
/******************************************************************************
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Inc/stm32_lpm_if.h
index 38e326512..d8e67947f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Inc/stm32_lpm_if.h
@@ -1,46 +1,22 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file stm32_lpm_if.h
-* @brief Header for stm32_lpm_f.c module (device specific LP management)
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
******************************************************************************
* @attention
*
-* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics International N.V.
+* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted, provided that the following conditions are met:
-*
-* 1. Redistribution of source code must retain the above copyright notice,
-* this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following disclaimer in the documentation
-* and/or other materials provided with the distribution.
-* 3. Neither the name of STMicroelectronics nor the names of other
-* contributors to this software may be used to endorse or promote products
-* derived from this software without specific written permission.
-* 4. This software, including modifications and/or derivative works of this
-* software, must execute solely and exclusively on microcontroller or
-* microprocessor devices manufactured by or for STMicroelectronics.
-* 5. Redistribution and use of this software other than as permitted under
-* this license is void and will automatically terminate your rights under
-* this license.
-*
-* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
-* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
-* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+* This software component is licensed by ST under BSD 3-Clause license,
+* the "License"; You may not use this file except in compliance with the
+* License. You may obtain a copy of the License at:
+* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32_LPM_IF_H
@@ -89,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Inc/stm32wbxx_hal_conf.h
index d32474616..f37437884 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Inc/stm32wbxx_hal_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Inc/stm32wbxx_hal_conf.h
@@ -218,6 +218,10 @@
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32wbxx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32wbxx_hal_flash.h"
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Inc/utilities_conf.h
index c98d97ba1..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Inc/utilities_conf.h
@@ -1,3 +1,4 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* File Name : utilities_conf.h
@@ -9,13 +10,14 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef UTILITIES_CONF_H
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Src/app_entry.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Src/app_entry.c
index 1a403a289..2f36d772b 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Src/app_entry.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Src/app_entry.c
@@ -70,7 +70,6 @@ size_t DbgTraceWrite(int handle, const unsigned char * buf, size_t bufSize);
static void SystemPower_Config( void );
static void Init_Debug( void );
static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status );
-
static void APPE_SysUserEvtRx( void * pPayload );
static void appe_Tl_Init( void );
@@ -273,8 +272,6 @@ static void appe_Tl_Init( void )
return;
}
-
-
static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status )
{
UNUSED(status);
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Src/hw_timerserver.c
index 17c9af0a4..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Src/hw_timerserver.c
@@ -4,19 +4,18 @@
* Description : Hardware timerserver source file for STM32WPAN Middleware.
*
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Src/hw_uart.c
index 3a76b98ed..7d28f9582 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Src/hw_uart.c
@@ -1,12 +1,12 @@
/**
- ******************************************************************************
- * @file hw_uart.c
- * @author MCD Application Team
- * @brief hardware access
- ******************************************************************************
- * @attention
+ ******************************************************************************
+ * @file hw_uart.c
+ * @author MCD Application Team
+ * @brief hardware access
+ ******************************************************************************
+ * @attention
*
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under Ultimate Liberty license
@@ -23,136 +23,131 @@
#include "hw_conf.h"
/* Macros --------------------------------------------------------------------*/
-#define HW_UART_INIT(__HANDLE__, __USART_BASE__) \
- do{ \
- (__HANDLE__).Instance = (__USART_BASE__); \
- (__HANDLE__).Init.BaudRate = CFG_HW_##__USART_BASE__##_BAUDRATE; \
- (__HANDLE__).Init.WordLength = CFG_HW_##__USART_BASE__##_WORDLENGTH; \
- (__HANDLE__).Init.StopBits = CFG_HW_##__USART_BASE__##_STOPBITS; \
- (__HANDLE__).Init.Parity = CFG_HW_##__USART_BASE__##_PARITY; \
- (__HANDLE__).Init.HwFlowCtl = CFG_HW_##__USART_BASE__##_HWFLOWCTL; \
- (__HANDLE__).Init.Mode = CFG_HW_##__USART_BASE__##_MODE; \
- (__HANDLE__).Init.OverSampling = CFG_HW_##__USART_BASE__##_OVERSAMPLING; \
- (__HANDLE__).AdvancedInit.AdvFeatureInit = CFG_HW_##__USART_BASE__##_ADVFEATUREINIT; \
- HAL_UART_Init(&(__HANDLE__)); \
- } while(0)
-
-#define HW_UART_RX_IT(__HANDLE__, __USART_BASE__) \
- do{ \
- HW_##__HANDLE__##RxCb = cb; \
- (__HANDLE__).Instance = (__USART_BASE__); \
- HAL_UART_Receive_IT(&(__HANDLE__), p_data, size); \
- } while(0)
-
-#define HW_UART_TX_IT(__HANDLE__, __USART_BASE__) \
- do{ \
- HW_##__HANDLE__##TxCb = cb; \
- (__HANDLE__).Instance = (__USART_BASE__); \
- HAL_UART_Transmit_IT(&(__HANDLE__), p_data, size); \
- } while(0)
-
-#define HW_UART_TX(__HANDLE__, __USART_BASE__) \
- do{ \
- (__HANDLE__).Instance = (__USART_BASE__); \
- hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
- } while(0)
-
-#define HW_UART_MSP_UART_INIT(__HANDLE__, __USART_BASE__) \
- do{ \
- \
- /* Configure Tx Pin */ \
- CFG_HW_##__USART_BASE__##_TX_PORT_CLK_ENABLE(); \
- \
- GPIO_InitStruct.Pin = CFG_HW_##__USART_BASE__##_TX_PIN ; \
- GPIO_InitStruct.Mode = CFG_HW_##__USART_BASE__##_TX_MODE; \
- GPIO_InitStruct.Pull = CFG_HW_##__USART_BASE__##_TX_PULL; \
- GPIO_InitStruct.Speed = CFG_HW_##__USART_BASE__##_TX_SPEED; \
- GPIO_InitStruct.Alternate = CFG_HW_##__USART_BASE__##_TX_ALTERNATE; \
- HAL_GPIO_Init(CFG_HW_##__USART_BASE__##_TX_PORT, &GPIO_InitStruct); \
- \
- \
- /* Configure Rx Pin */ \
- CFG_HW_##__USART_BASE__##_RX_PORT_CLK_ENABLE(); \
- \
- GPIO_InitStruct.Pin = CFG_HW_##__USART_BASE__##_RX_PIN; \
- GPIO_InitStruct.Mode = CFG_HW_##__USART_BASE__##_RX_MODE; \
- GPIO_InitStruct.Pull = CFG_HW_##__USART_BASE__##_RX_PULL; \
- GPIO_InitStruct.Speed = CFG_HW_##__USART_BASE__##_RX_SPEED; \
- GPIO_InitStruct.Alternate = CFG_HW_##__USART_BASE__##_RX_ALTERNATE; \
- HAL_GPIO_Init(CFG_HW_##__USART_BASE__##_RX_PORT, &GPIO_InitStruct); \
- \
- \
- /* Configure CTS Pin */ \
- CFG_HW_##__USART_BASE__##_CTS_PORT_CLK_ENABLE(); \
- \
- GPIO_InitStruct.Pin = CFG_HW_##__USART_BASE__##_CTS_PIN; \
- GPIO_InitStruct.Mode = CFG_HW_##__USART_BASE__##_CTS_MODE; \
- GPIO_InitStruct.Pull = CFG_HW_##__USART_BASE__##_CTS_PULL; \
- GPIO_InitStruct.Speed = CFG_HW_##__USART_BASE__##_CTS_SPEED; \
- GPIO_InitStruct.Alternate = CFG_HW_##__USART_BASE__##_CTS_ALTERNATE; \
- HAL_GPIO_Init(CFG_HW_##__USART_BASE__##_CTS_PORT, &GPIO_InitStruct); \
- \
- /* Set USART source clock */ \
- __HAL_RCC_##__USART_BASE__##_CONFIG(CFG_HW_##__USART_BASE__##_SOURCE_CLOCK); \
- \
- /* Enable USART clock */ \
- __HAL_RCC_##__USART_BASE__##_CLK_ENABLE(); \
- \
- HAL_NVIC_SetPriority(__USART_BASE__##_IRQn, CFG_HW_##__USART_BASE__##_PREEMPTPRIORITY, CFG_HW_##__USART_BASE__##_SUBPRIORITY); \
- HAL_NVIC_EnableIRQ(__USART_BASE__##_IRQn); \
- } while(0)
-
-#define HW_UART_MSP_TX_DMA_INIT(__HANDLE__, __USART_BASE__) \
- do{ \
- /* Configure the DMA handler for Transmission process */ \
- /* Enable DMA clock */ \
- CFG_HW_##__USART_BASE__##_DMA_CLK_ENABLE(); \
- /* Enable DMA MUX clock */ \
- CFG_HW_##__USART_BASE__##_DMAMUX_CLK_ENABLE(); \
- \
- HW_hdma_##__HANDLE__##_tx.Instance = CFG_HW_##__USART_BASE__##_TX_DMA_CHANNEL; \
- HW_hdma_##__HANDLE__##_tx.Init.Request = CFG_HW_##__USART_BASE__##_TX_DMA_REQ; \
- HW_hdma_##__HANDLE__##_tx.Init.Direction = DMA_MEMORY_TO_PERIPH; \
- HW_hdma_##__HANDLE__##_tx.Init.PeriphInc = DMA_PINC_DISABLE; \
- HW_hdma_##__HANDLE__##_tx.Init.MemInc = DMA_MINC_ENABLE; \
- HW_hdma_##__HANDLE__##_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; \
- HW_hdma_##__HANDLE__##_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; \
- HW_hdma_##__HANDLE__##_tx.Init.Mode = DMA_NORMAL; \
- HW_hdma_##__HANDLE__##_tx.Init.Priority = DMA_PRIORITY_LOW; \
- \
- HAL_DMA_Init(&HW_hdma_##__HANDLE__##_tx); \
- \
- /* Associate the initialized DMA handle to the UART handle */ \
- __HAL_LINKDMA(huart, hdmatx, HW_hdma_##__HANDLE__##_tx); \
- \
- /* NVIC configuration for DMA transfer complete interrupt */ \
- HAL_NVIC_SetPriority(CFG_HW_##__USART_BASE__##_TX_DMA_IRQn, CFG_HW_##__USART_BASE__##_DMA_TX_PREEMPTPRIORITY, CFG_HW_##__USART_BASE__##_DMA_TX_SUBPRIORITY); \
- HAL_NVIC_EnableIRQ(CFG_HW_##__USART_BASE__##_TX_DMA_IRQn); \
- } while(0)
-
- /* Variables ------------------------------------------------------------------*/
+#define HW_UART_INIT(__HANDLE__, __USART_BASE__) \
+ do{ \
+ (__HANDLE__).Instance = (__USART_BASE__); \
+ (__HANDLE__).Init.BaudRate = CFG_HW_##__USART_BASE__##_BAUDRATE; \
+ (__HANDLE__).Init.WordLength = CFG_HW_##__USART_BASE__##_WORDLENGTH; \
+ (__HANDLE__).Init.StopBits = CFG_HW_##__USART_BASE__##_STOPBITS; \
+ (__HANDLE__).Init.Parity = CFG_HW_##__USART_BASE__##_PARITY; \
+ (__HANDLE__).Init.HwFlowCtl = CFG_HW_##__USART_BASE__##_HWFLOWCTL; \
+ (__HANDLE__).Init.Mode = CFG_HW_##__USART_BASE__##_MODE; \
+ (__HANDLE__).Init.OverSampling = CFG_HW_##__USART_BASE__##_OVERSAMPLING; \
+ (__HANDLE__).AdvancedInit.AdvFeatureInit = CFG_HW_##__USART_BASE__##_ADVFEATUREINIT; \
+ HAL_UART_Init(&(__HANDLE__)); \
+ } while(0)
+
+#define HW_UART_RX_IT(__HANDLE__, __USART_BASE__) \
+ do{ \
+ HW_##__HANDLE__##RxCb = cb; \
+ (__HANDLE__).Instance = (__USART_BASE__); \
+ HAL_UART_Receive_IT(&(__HANDLE__), p_data, size); \
+ } while(0)
+
+#define HW_UART_TX_IT(__HANDLE__, __USART_BASE__) \
+ do{ \
+ HW_##__HANDLE__##TxCb = cb; \
+ (__HANDLE__).Instance = (__USART_BASE__); \
+ HAL_UART_Transmit_IT(&(__HANDLE__), p_data, size); \
+ } while(0)
+
+#define HW_UART_TX(__HANDLE__, __USART_BASE__) \
+ do{ \
+ (__HANDLE__).Instance = (__USART_BASE__); \
+ hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
+ } while(0)
+
+#define HW_UART_MSP_UART_INIT(__HANDLE__, __USART_BASE__) \
+ do{ \
+ /* Enable GPIO clock */ \
+ CFG_HW_##__USART_BASE__##_TX_PORT_CLK_ENABLE(); \
+ \
+ /* Enable USART clock */ \
+ __HAL_RCC_##__USART_BASE__##_CLK_ENABLE(); \
+ \
+ GPIO_InitStruct.Pin = CFG_HW_##__USART_BASE__##_TX_PIN ; \
+ GPIO_InitStruct.Mode = CFG_HW_##__USART_BASE__##_TX_MODE; \
+ GPIO_InitStruct.Pull = CFG_HW_##__USART_BASE__##_TX_PULL; \
+ GPIO_InitStruct.Speed = CFG_HW_##__USART_BASE__##_TX_SPEED; \
+ GPIO_InitStruct.Alternate = CFG_HW_##__USART_BASE__##_TX_ALTERNATE; \
+ \
+ HAL_GPIO_Init(CFG_HW_##__USART_BASE__##_TX_PORT, &GPIO_InitStruct); \
+ \
+ CFG_HW_##__USART_BASE__##_RX_PORT_CLK_ENABLE(); \
+ \
+ GPIO_InitStruct.Pin = CFG_HW_##__USART_BASE__##_RX_PIN; \
+ GPIO_InitStruct.Mode = CFG_HW_##__USART_BASE__##_RX_MODE; \
+ GPIO_InitStruct.Pull = CFG_HW_##__USART_BASE__##_RX_PULL; \
+ GPIO_InitStruct.Speed = CFG_HW_##__USART_BASE__##_RX_SPEED; \
+ GPIO_InitStruct.Alternate = CFG_HW_##__USART_BASE__##_RX_ALTERNATE; \
+ \
+ HAL_GPIO_Init(CFG_HW_##__USART_BASE__##_RX_PORT, &GPIO_InitStruct); \
+ \
+ CFG_HW_##__USART_BASE__##_CTS_PORT_CLK_ENABLE(); \
+ \
+ GPIO_InitStruct.Pin = CFG_HW_##__USART_BASE__##_CTS_PIN; \
+ GPIO_InitStruct.Mode = CFG_HW_##__USART_BASE__##_CTS_MODE; \
+ GPIO_InitStruct.Pull = CFG_HW_##__USART_BASE__##_CTS_PULL; \
+ GPIO_InitStruct.Speed = CFG_HW_##__USART_BASE__##_CTS_SPEED; \
+ GPIO_InitStruct.Alternate = CFG_HW_##__USART_BASE__##_CTS_ALTERNATE; \
+ \
+ HAL_GPIO_Init(CFG_HW_##__USART_BASE__##_CTS_PORT, &GPIO_InitStruct); \
+ \
+ HAL_NVIC_SetPriority(__USART_BASE__##_IRQn, CFG_HW_##__USART_BASE__##_PREEMPTPRIORITY, CFG_HW_##__USART_BASE__##_SUBPRIORITY); \
+ HAL_NVIC_EnableIRQ(__USART_BASE__##_IRQn); \
+ } while(0)
+
+#define HW_UART_MSP_TX_DMA_INIT(__HANDLE__, __USART_BASE__) \
+ do{ \
+ /* Configure the DMA handler for Transmission process */ \
+ /* Enable DMA clock */ \
+ CFG_HW_##__USART_BASE__##_DMA_CLK_ENABLE(); \
+ /* Enable DMA MUX clock */ \
+ CFG_HW_##__USART_BASE__##_DMAMUX_CLK_ENABLE(); \
+ \
+ HW_hdma_##__HANDLE__##_tx.Instance = CFG_HW_##__USART_BASE__##_TX_DMA_CHANNEL; \
+ HW_hdma_##__HANDLE__##_tx.Init.Request = CFG_HW_##__USART_BASE__##_TX_DMA_REQ; \
+ HW_hdma_##__HANDLE__##_tx.Init.Direction = DMA_MEMORY_TO_PERIPH; \
+ HW_hdma_##__HANDLE__##_tx.Init.PeriphInc = DMA_PINC_DISABLE; \
+ HW_hdma_##__HANDLE__##_tx.Init.MemInc = DMA_MINC_ENABLE; \
+ HW_hdma_##__HANDLE__##_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; \
+ HW_hdma_##__HANDLE__##_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; \
+ HW_hdma_##__HANDLE__##_tx.Init.Mode = DMA_NORMAL; \
+ HW_hdma_##__HANDLE__##_tx.Init.Priority = DMA_PRIORITY_LOW; \
+ \
+ HAL_DMA_Init(&HW_hdma_##__HANDLE__##_tx); \
+ \
+ /* Associate the initialized DMA handle to the UART handle */ \
+ __HAL_LINKDMA(huart, hdmatx, HW_hdma_##__HANDLE__##_tx); \
+ \
+ /* NVIC configuration for DMA transfer complete interrupt */ \
+ HAL_NVIC_SetPriority(CFG_HW_##__USART_BASE__##_TX_DMA_IRQn, CFG_HW_##__USART_BASE__##_DMA_TX_PREEMPTPRIORITY, CFG_HW_##__USART_BASE__##_DMA_TX_SUBPRIORITY); \
+ HAL_NVIC_EnableIRQ(CFG_HW_##__USART_BASE__##_TX_DMA_IRQn); \
+ } while(0)
+
+/* Variables ------------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
- UART_HandleTypeDef huart1 = {0};
+UART_HandleTypeDef huart1 = {0};
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
- DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
+DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
#endif
- void (*HW_huart1RxCb)(void);
- void (*HW_huart1TxCb)(void);
+void (*HW_huart1RxCb)(void);
+void (*HW_huart1TxCb)(void);
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- UART_HandleTypeDef lpuart1 = {0};
+UART_HandleTypeDef lpuart1 = {0};
#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
- DMA_HandleTypeDef HW_hdma_lpuart1_tx ={0};
+DMA_HandleTypeDef HW_hdma_lpuart1_tx ={0};
#endif
- void (*HW_lpuart1RxCb)(void);
- void (*HW_lpuart1TxCb)(void);
+void (*HW_lpuart1RxCb)(void);
+void (*HW_lpuart1TxCb)(void);
#endif
- void HW_UART_Init(hw_uart_id_t hw_uart_id)
+void HW_UART_Init(hw_uart_id_t hw_uart_id)
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
case hw_uart1:
HW_UART_INIT(huart1, USART1);
@@ -167,15 +162,15 @@
default:
break;
- }
-
- return;
}
- void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ return;
+}
+
+void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
case hw_uart1:
HW_UART_RX_IT(huart1, USART1);
@@ -190,15 +185,15 @@
default:
break;
- }
-
- return;
}
- void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ return;
+}
+
+void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
case hw_uart1:
HW_UART_TX_IT(huart1, USART1);
@@ -213,18 +208,18 @@
default:
break;
- }
-
- return;
}
- hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
- {
- HAL_StatusTypeDef hal_status = HAL_OK;
- hw_status_t hw_status = hw_uart_ok;
+ return;
+}
+
+hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
+{
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
- switch (hw_uart_id)
- {
+ switch (hw_uart_id)
+ {
#if (CFG_HW_USART1_ENABLED == 1)
case hw_uart1:
HW_UART_TX(huart1, USART1);
@@ -239,10 +234,10 @@
default:
break;
- }
+ }
- switch (hal_status)
- {
+ switch (hal_status)
+ {
case HAL_OK:
hw_status = hw_uart_ok;
break;
@@ -261,18 +256,18 @@
default:
break;
- }
-
- return hw_status;
}
- hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
- {
+ return hw_status;
+}
+
+hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
HAL_StatusTypeDef hal_status = HAL_OK;
hw_status_t hw_status = hw_uart_ok;
- switch (hw_uart_id)
- {
+ switch (hw_uart_id)
+ {
#if (CFG_HW_USART1_ENABLED == 1)
case hw_uart1:
HW_huart1TxCb = cb;
@@ -299,10 +294,10 @@
default:
break;
- }
+ }
- switch (hal_status)
- {
+ switch (hal_status)
+ {
case HAL_OK:
hw_status = hw_uart_ok;
break;
@@ -321,15 +316,15 @@
default:
break;
- }
-
- return hw_status;
}
- void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id)
+ return hw_status;
+}
+
+void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id)
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
case hw_uart1:
HAL_UART_IRQHandler(&huart1);
@@ -344,15 +339,15 @@
default:
break;
- }
-
- return;
}
- void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
+ return;
+}
+
+void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
case hw_uart1:
HAL_DMA_IRQHandler(huart1.hdmatx);
@@ -373,98 +368,98 @@
default:
break;
- }
-
- return;
}
- void HAL_UART_MspInit(UART_HandleTypeDef *huart)
- {
- GPIO_InitTypeDef GPIO_InitStruct = {0};
+ return;
+}
- switch ((uint32_t)huart->Instance)
- {
+void HAL_UART_MspInit(UART_HandleTypeDef *huart)
+{
+ GPIO_InitTypeDef GPIO_InitStruct = {0};
+
+ switch ((uint32_t)huart->Instance)
+ {
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- HW_UART_MSP_UART_INIT( huart1, USART1 );
+ HW_UART_MSP_UART_INIT( huart1, USART1 );
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
- HW_UART_MSP_TX_DMA_INIT( huart1, USART1 );
+ HW_UART_MSP_TX_DMA_INIT( huart1, USART1 );
#endif
break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- HW_UART_MSP_UART_INIT( lpuart1, LPUART1 );
+ HW_UART_MSP_UART_INIT( lpuart1, LPUART1 );
#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
- HW_UART_MSP_TX_DMA_INIT( lpuart1, LPUART1 );
+ HW_UART_MSP_TX_DMA_INIT( lpuart1, LPUART1 );
#endif
break;
#endif
default:
break;
- }
-
- return;
}
- void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
+ return;
+}
+
+void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
+{
+ switch ((uint32_t)huart->Instance)
{
- switch ((uint32_t)huart->Instance)
- {
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1RxCb)
- {
- HW_huart1RxCb();
- }
+ if(HW_huart1RxCb)
+ {
+ HW_huart1RxCb();
+ }
break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_lpuart1RxCb)
- {
- HW_lpuart1RxCb();
- }
+ if(HW_lpuart1RxCb)
+ {
+ HW_lpuart1RxCb();
+ }
break;
#endif
default:
break;
- }
-
- return;
}
- void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
+ return;
+}
+
+void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
+{
+ switch ((uint32_t)huart->Instance)
{
- switch ((uint32_t)huart->Instance)
- {
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1TxCb)
- {
- HW_huart1TxCb();
- }
+ if(HW_huart1TxCb)
+ {
+ HW_huart1TxCb();
+ }
break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_lpuart1TxCb)
- {
- HW_lpuart1TxCb();
- }
+ if(HW_lpuart1TxCb)
+ {
+ HW_lpuart1TxCb();
+ }
break;
#endif
default:
break;
- }
-
- return;
}
- /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+ return;
+}
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Src/main.c
index 0041d3bef..021c1c150 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Src/main.c
@@ -195,7 +195,13 @@ static void Init_RTC( void )
hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
HAL_RTC_Init(&hrtc);
- MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* Disable RTC registers write protection */
+ LL_RTC_DisableWriteProtection(RTC);
+
+ LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER);
+
+ /* Enable RTC registers write protection */
+ LL_RTC_EnableWriteProtection(RTC);
return;
}
@@ -218,7 +224,13 @@ void SystemClock_Config( void )
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
- LL_RCC_HSI48_Enable();
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
+ LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -268,19 +280,6 @@ void SystemClock_Config( void )
*/
LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
@@ -289,20 +288,32 @@ void SystemClock_Config( void )
* WRAP FUNCTIONS
*
*************************************************************/
-
-void HAL_Delay(uint32_t delay)
+void HAL_Delay(uint32_t Delay)
{
uint32_t tickstart = HAL_GetTick();
- uint32_t wait = delay;
+ uint32_t wait = Delay;
+ /* Add a freq to guarantee minimum wait */
if (wait < HAL_MAX_DELAY)
{
- wait ++;
+ wait += HAL_GetTickFreq();
}
while ((HAL_GetTick() - tickstart) < wait)
{
- UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
}
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/STM32_WPAN/App/app_ble.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/STM32_WPAN/App/app_ble.c
index 22ab55dcd..4fdd25ba5 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/STM32_WPAN/App/app_ble.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/STM32_WPAN/App/app_ble.c
@@ -219,7 +219,7 @@ P2PS_APP_ConnHandle_Not_evt_t handleNotification;
#if L2CAP_REQUEST_NEW_CONN_PARAM != 0
#define SIZE_TAB_CONN_INT 2
-float tab_conn_interval[SIZE_TAB_CONN_INT] = { 50, 1000} ; /* in ms */
+float tab_conn_interval[SIZE_TAB_CONN_INT] = {50, 1000} ; /* ms */
uint8_t index_con_int, mutex;
#endif
@@ -342,6 +342,7 @@ uint8_t manuf_data[14] = {
0x00, /* BLE MAC stop */
};
#endif
+
/* USER CODE BEGIN PV */
/* USER CODE END PV */
@@ -510,7 +511,10 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
handleNotification.ConnectionHandle = BleApplicationContext.BleApplicationContext_legacy.connectionHandle;
P2PS_APP_Notification(&handleNotification);
-}
+ /* USER CODE BEGIN EVT_DISCONN_COMPLETE */
+
+ /* USER CODE END EVT_DISCONN_COMPLETE */
+ }
break; /* EVT_DISCONN_COMPLETE */
@@ -887,13 +891,13 @@ static void Adv_Request(APP_BLE_ConnStatus_t New_Status)
{
if (New_Status == APP_BLE_FAST_ADV)
{
- APP_DBG_MSG("Successfully Start Fast Advertising\n" );
+ APP_DBG_MSG("Successfully Start Fast Advertising \n" );
/* Start Timer to STOP ADV - TIMEOUT */
HW_TS_Start(BleApplicationContext.Advertising_mgr_timer_Id, INITIAL_ADV_TIMEOUT);
}
else
{
- APP_DBG_MSG("Successfully Start Low Power Advertising\n");
+ APP_DBG_MSG("Successfully Start Low Power Advertising \n");
}
}
else
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/STM32_WPAN/App/ble_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/STM32_WPAN/App/ble_conf.h
index 79216f945..538713f85 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/STM32_WPAN/App/ble_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/STM32_WPAN/App/ble_conf.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : App/ble_conf.h
- * Description : Configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : Configuration file for BLE Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/STM32_WPAN/App/ble_dbg_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/STM32_WPAN/App/ble_dbg_conf.h
index a047ad0b9..bec936bbe 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/STM32_WPAN/App/ble_dbg_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/STM32_WPAN/App/ble_dbg_conf.h
@@ -1,9 +1,9 @@
/**
******************************************************************************
* File Name : App/ble_dbg_conf.h
- * Description : Debug configuration file for BLE
- * middleWare.
- ******************************************************************************
+ * Description : Debug configuration file for BLE Middleware.
+ *
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/SW4STM32/no_ota/.cproject b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/SW4STM32/no_ota/.cproject
index 0c4852a83..db5e38f21 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/SW4STM32/no_ota/.cproject
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE_Thread/Ble_Thread_Static/SW4STM32/no_ota/.cproject
@@ -17,16 +17,16 @@
<configuration artifactExtension="elf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.1838892659" name="Debug" parent="fr.ac6.managedbuild.config.gnu.cross.exe.debug" postannouncebuildStep="Generating binary and Printing size information:" postbuildStep="arm-none-eabi-objcopy -O ihex &quot;${BuildArtifactFileBaseName}.elf&quot; &quot;${BuildArtifactFileBaseName}.hex&quot; &amp;&amp; arm-none-eabi-size &quot;${BuildArtifactFileName}&quot;">
<folderInfo id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.1838892659." name="/" resourcePath="">
<toolChain id="fr.ac6.managedbuild.toolchain.gnu.cross.exe.debug.432709963" name="Ac6 STM32 MCU GCC" superClass="fr.ac6.managedbuild.toolchain.gnu.cross.exe.debug">
- <option id="fr.ac6.managedbuild.option.gnu.cross.prefix.986397892" name="Prefix" superClass="fr.ac6.managedbuild.option.gnu.cross.prefix" useByScannerDiscovery="false" value="arm-none-eabi-" valueType="string"/>
- <option id="fr.ac6.managedbuild.option.gnu.cross.mcu.143620198" name="Mcu" superClass="fr.ac6.managedbuild.option.gnu.cross.mcu" useByScannerDiscovery="false" value="STM32WB55RGVx" valueType="string"/>
- <option id="fr.ac6.managedbuild.option.gnu.cross.board.1341531510" name="Board" superClass="fr.ac6.managedbuild.option.gnu.cross.board" useByScannerDiscovery="false" value="P-NUCLEO-WB55.NUCLEO" valueType="string"/>
- <option id="fr.ac6.managedbuild.option.gnu.cross.core.1083960614" name="Core" superClass="fr.ac6.managedbuild.option.gnu.cross.core" useByScannerDiscovery="false" valueType="stringList">
+ <option id="fr.ac6.managedbuild.option.gnu.cross.prefix.986397892" name="Prefix" superClass="fr.ac6.managedbuild.option.gnu.cross.prefix" value="arm-none-eabi-" valueType="string"/>
+ <option id="fr.ac6.managedbuild.option.gnu.cross.mcu.143620198" name="Mcu" superClass="fr.ac6.managedbuild.option.gnu.cross.mcu" value="STM32WB55RGVx" valueType="string"/>
+ <option id="fr.ac6.managedbuild.option.gnu.cross.board.1341531510" name="Board" superClass="fr.ac6.managedbuild.option.gnu.cross.board" value="P-NUCLEO-WB55.NUCLEO" valueType="string"/>
+ <option id="fr.ac6.managedbuild.option.gnu.cross.core.1083960614" name="Core" superClass="fr.ac6.managedbuild.option.gnu.cross.core" valueType="stringList">
<listOptionValue builtIn="false" value="ARM Cortex-M4"/>
<listOptionValue builtIn="false" value="CM4"/>
</option>
- <option id="fr.ac6.managedbuild.option.gnu.cross.instructionSet.530120310" name="Instruction Set" superClass="fr.ac6.managedbuild.option.gnu.cross.instructionSet" useByScannerDiscovery="false" value="fr.ac6.managedbuild.option.gnu.cross.instructionSet.thumbII" valueType="enumerated"/>
- <option id="fr.ac6.managedbuild.option.gnu.cross.fpu.1121934064" name="Floating point hardware" superClass="fr.ac6.managedbuild.option.gnu.cross.fpu" useByScannerDiscovery="false" value="fr.ac6.managedbuild.option.gnu.cross.fpu.fpv4-sp-d16" valueType="enumerated"/>
- <option id="fr.ac6.managedbuild.option.gnu.cross.floatabi.634028129" name="Floating-point ABI" superClass="fr.ac6.managedbuild.option.gnu.cross.floatabi" useByScannerDiscovery="false" value="fr.ac6.managedbuild.option.gnu.cross.floatabi.hard" valueType="enumerated"/>
+ <option id="fr.ac6.managedbuild.option.gnu.cross.instructionSet.530120310" name="Instruction Set" superClass="fr.ac6.managedbuild.option.gnu.cross.instructionSet" value="fr.ac6.managedbuild.option.gnu.cross.instructionSet.thumbII" valueType="enumerated"/>
+ <option id="fr.ac6.managedbuild.option.gnu.cross.fpu.1121934064" name="Floating point hardware" superClass="fr.ac6.managedbuild.option.gnu.cross.fpu" value="fr.ac6.managedbuild.option.gnu.cross.fpu.fpv4-sp-d16" valueType="enumerated"/>
+ <option id="fr.ac6.managedbuild.option.gnu.cross.floatabi.634028129" name="Floating-point ABI" superClass="fr.ac6.managedbuild.option.gnu.cross.floatabi" value="fr.ac6.managedbuild.option.gnu.cross.floatabi.hard" valueType="enumerated"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="fr.ac6.managedbuild.targetPlatform.gnu.cross.1728893958" isAbstract="false" osList="all" superClass="fr.ac6.managedbuild.targetPlatform.gnu.cross"/>
<builder buildPath="${workspace_loc:/no_ota}/Debug" id="fr.ac6.managedbuild.builder.gnu.cross.1053055272" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="fr.ac6.managedbuild.builder.gnu.cross">
<outputEntries>
@@ -83,7 +83,7 @@
<listOptionValue builtIn="false" value="../../../../../../../../Drivers/CMSIS/Device/ST/STM32WBxx/Include"/>
<listOptionValue builtIn="false" value="../../../../../../../../Drivers/BSP/P-NUCLEO-WB55.Nucleo"/>
<listOptionValue builtIn="false" value="../../../Core/Inc"/>
- <listOptionValue builtIn="false" value="../../../STM32_WPAN/app"/>
+ <listOptionValue builtIn="false" value="../../../STM32_WPAN/App"/>
<listOptionValue builtIn="false" value="../../../STM32_WPAN/Target"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble/core/template"/>
@@ -127,10 +127,10 @@
</inputType>
</tool>
<tool id="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.1970634467" name="MCU G++ Linker" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker">
- <option id="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.script.438111686" name="Linker Script (-T)" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.script" useByScannerDiscovery="false" value="../stm32wb55xx_flash_cm4.ld" valueType="string"/>
- <option id="gnu.cpp.link.option.libs.131435560" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" useByScannerDiscovery="false"/>
- <option id="gnu.cpp.link.option.paths.546562982" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" useByScannerDiscovery="false"/>
- <option id="gnu.cpp.link.option.flags.2051124891" name="Linker flags" superClass="gnu.cpp.link.option.flags" useByScannerDiscovery="false" value="-specs=nosys.specs -specs=nano.specs" valueType="string"/>
+ <option id="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.script.438111686" name="Linker Script (-T)" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.script" value="../stm32wb55xx_flash_cm4.ld" valueType="string"/>
+ <option id="gnu.cpp.link.option.libs.131435560" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs"/>
+ <option id="gnu.cpp.link.option.paths.546562982" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths"/>
+ <option id="gnu.cpp.link.option.flags.2051124891" name="Linker flags" superClass="gnu.cpp.link.option.flags" value="-specs=nosys.specs -specs=nano.specs" valueType="string"/>
<option id="gnu.cpp.link.option.other.255388538" name="Other options (-Xlinker [option])" superClass="gnu.cpp.link.option.other" useByScannerDiscovery="false"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.263705119" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
@@ -139,7 +139,7 @@
</tool>
<tool id="fr.ac6.managedbuild.tool.gnu.archiver.1235518403" name="MCU GCC Archiver" superClass="fr.ac6.managedbuild.tool.gnu.archiver"/>
<tool id="fr.ac6.managedbuild.tool.gnu.cross.assembler.291698197" name="MCU GCC Assembler" superClass="fr.ac6.managedbuild.tool.gnu.cross.assembler">
- <option id="gnu.both.asm.option.include.paths.944944773" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" useByScannerDiscovery="false"/>
+ <option id="gnu.both.asm.option.include.paths.944944773" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths"/>
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1200874109" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
<inputType id="fr.ac6.managedbuild.tool.gnu.cross.assembler.input.1228557113" superClass="fr.ac6.managedbuild.tool.gnu.cross.assembler.input"/>
</tool>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/CKS/CKS_Crypt/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/CKS/CKS_Crypt/Core/Inc/app_conf.h
index 604df6667..3c52a988b 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/CKS/CKS_Crypt/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/CKS/CKS_Crypt/Core/Inc/app_conf.h
@@ -22,6 +22,7 @@
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Application Config
@@ -181,7 +182,7 @@
* 1 : internal RO
* 0 : external crystal ( no calibration )
*/
-#define CFG_BLE_LSE_SOURCE 1
+#define CFG_BLE_LSE_SOURCE 0
/**
* Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
@@ -502,7 +503,11 @@ typedef enum
typedef enum
{
CFG_LPM_APP,
+ CFG_LPM_HAL_DELAY,
CFG_LPM_APP_BLE
+ /* USER CODE BEGIN CFG_LPM_Id_t */
+
+ /* USER CODE END CFG_LPM_Id_t */
} CFG_LPM_Id_t;
/******************************************************************************
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/CKS/CKS_Crypt/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/CKS/CKS_Crypt/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/CKS/CKS_Crypt/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/CKS/CKS_Crypt/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/CKS/CKS_Crypt/Core/Inc/utilities_conf.h
index 815cca2c6..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/CKS/CKS_Crypt/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/CKS/CKS_Crypt/Core/Inc/utilities_conf.h
@@ -1,26 +1,27 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
- * @file utilities_conf.h
- * @author MCD Application Team
- * @brief Configuration file to utilities
+ * File Name : utilities_conf.h
+ * Description : Configuration file for STM32 Utilities.
+ *
******************************************************************************
* @attention
*
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
- * the "License"; You may not use this file except in compliance with the
+ * the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
- */
-
+ */
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __UTILITIES_CONF_H
-#define __UTILITIES_CONF_H
+#ifndef UTILITIES_CONF_H
+#define UTILITIES_CONF_H
#ifdef __cplusplus
extern "C" {
@@ -47,7 +48,6 @@ extern "C" {
#define UTIL_LPM_ENTER_CRITICAL_SECTION( ) UTILS_ENTER_CRITICAL_SECTION( )
#define UTIL_LPM_EXIT_CRITICAL_SECTION( ) UTILS_EXIT_CRITICAL_SECTION( )
-
/******************************************************************************
* sequencer
* (any macro that does not need to be modified can be removed)
@@ -63,6 +63,6 @@ extern "C" {
}
#endif
-#endif /*__UTILITIES_CONF_H */
+#endif /*UTILITIES_CONF_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/CKS/CKS_Crypt/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/CKS/CKS_Crypt/Core/Src/main.c
index 3876ae689..d6cb75a33 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/CKS/CKS_Crypt/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/CKS/CKS_Crypt/Core/Src/main.c
@@ -146,11 +146,13 @@ static void SystemClock_Config(void)
/** Initializes the CPU, AHB and APB busses clocks
*/
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSI1
- |RCC_OSCILLATORTYPE_HSE;
+ |RCC_OSCILLATORTYPE_HSE|RCC_OSCILLATORTYPE_LSE|RCC_OSCILLATORTYPE_HSI48;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
- RCC_OscInitStruct.LSIState = RCC_LSI_ON;
+ RCC_OscInitStruct.LSIState = RCC_LSI_OFF;
+ RCC_OscInitStruct.LSEState = RCC_LSE_ON;
+ RCC_OscInitStruct.HSI48State = RCC_HSI48_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FatFs/FatFs_uSD_Standalone/SW4STM32/FatFs_uSD_Standalone/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FatFs/FatFs_uSD_Standalone/SW4STM32/FatFs_uSD_Standalone/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FatFs/FatFs_uSD_Standalone/SW4STM32/FatFs_uSD_Standalone/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FatFs/FatFs_uSD_Standalone/SW4STM32/FatFs_uSD_Standalone/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FatFs/FatFs_uSD_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FatFs/FatFs_uSD_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FatFs/FatFs_uSD_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FatFs/FatFs_uSD_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Mail/SW4STM32/FreeRTOS_Mail/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Mail/SW4STM32/FreeRTOS_Mail/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Mail/SW4STM32/FreeRTOS_Mail/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Mail/SW4STM32/FreeRTOS_Mail/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Mail/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Mail/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Mail/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Mail/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Mutexes/SW4STM32/FreeRTOS_Mutexes/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Mutexes/SW4STM32/FreeRTOS_Mutexes/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Mutexes/SW4STM32/FreeRTOS_Mutexes/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Mutexes/SW4STM32/FreeRTOS_Mutexes/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Mutexes/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Mutexes/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Mutexes/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Mutexes/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Queues/SW4STM32/FreeRTOS_Queues/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Queues/SW4STM32/FreeRTOS_Queues/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Queues/SW4STM32/FreeRTOS_Queues/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Queues/SW4STM32/FreeRTOS_Queues/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Queues/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Queues/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Queues/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Queues/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Semaphore/SW4STM32/FreeRTOS_Semaphore/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Semaphore/SW4STM32/FreeRTOS_Semaphore/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Semaphore/SW4STM32/FreeRTOS_Semaphore/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Semaphore/SW4STM32/FreeRTOS_Semaphore/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Semaphore/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Semaphore/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Semaphore/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Semaphore/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_SemaphoreFromISR/SW4STM32/FreeRTOS_SemaphoreFromISR/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_SemaphoreFromISR/SW4STM32/FreeRTOS_SemaphoreFromISR/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_SemaphoreFromISR/SW4STM32/FreeRTOS_SemaphoreFromISR/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_SemaphoreFromISR/SW4STM32/FreeRTOS_SemaphoreFromISR/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_SemaphoreFromISR/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_SemaphoreFromISR/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_SemaphoreFromISR/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_SemaphoreFromISR/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Signal/SW4STM32/FreeRTOS_Signal/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Signal/SW4STM32/FreeRTOS_Signal/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Signal/SW4STM32/FreeRTOS_Signal/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Signal/SW4STM32/FreeRTOS_Signal/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Signal/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Signal/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Signal/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Signal/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_SignalFromISR/SW4STM32/FreeRTOS_SignalFromISR/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_SignalFromISR/SW4STM32/FreeRTOS_SignalFromISR/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_SignalFromISR/SW4STM32/FreeRTOS_SignalFromISR/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_SignalFromISR/SW4STM32/FreeRTOS_SignalFromISR/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_SignalFromISR/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_SignalFromISR/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_SignalFromISR/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_SignalFromISR/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_ThreadCreation/SW4STM32/FreeRTOS_ThreadCreation/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_ThreadCreation/SW4STM32/FreeRTOS_ThreadCreation/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_ThreadCreation/SW4STM32/FreeRTOS_ThreadCreation/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_ThreadCreation/SW4STM32/FreeRTOS_ThreadCreation/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_ThreadCreation/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_ThreadCreation/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_ThreadCreation/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_ThreadCreation/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Timers/SW4STM32/FreeRTOS_Timers/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Timers/SW4STM32/FreeRTOS_Timers/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Timers/SW4STM32/FreeRTOS_Timers/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Timers/SW4STM32/FreeRTOS_Timers/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Timers/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Timers/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Timers/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/FreeRTOS/FreeRTOS_Timers/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Inc/app_conf.h
index c55af2961..1c88219ba 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Inc/app_conf.h
@@ -25,6 +25,7 @@
/* Includes ------------------------------------------------------------------*/
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Debug
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Inc/stm32_lpm_if.h
index 38e326512..70abecaa9 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Inc/stm32_lpm_if.h
@@ -1,46 +1,22 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file stm32_lpm_if.h
-* @brief Header for stm32_lpm_f.c module (device specific LP management)
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
******************************************************************************
* @attention
*
-* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics International N.V.
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted, provided that the following conditions are met:
-*
-* 1. Redistribution of source code must retain the above copyright notice,
-* this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following disclaimer in the documentation
-* and/or other materials provided with the distribution.
-* 3. Neither the name of STMicroelectronics nor the names of other
-* contributors to this software may be used to endorse or promote products
-* derived from this software without specific written permission.
-* 4. This software, including modifications and/or derivative works of this
-* software, must execute solely and exclusively on microcontroller or
-* microprocessor devices manufactured by or for STMicroelectronics.
-* 5. Redistribution and use of this software other than as permitted under
-* this license is void and will automatically terminate your rights under
-* this license.
-*
-* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
-* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
-* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32_LPM_IF_H
@@ -89,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Inc/stm32wbxx_hal_conf.h
index 2105136c7..2114081a5 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Inc/stm32wbxx_hal_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Inc/stm32wbxx_hal_conf.h
@@ -220,6 +220,10 @@
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32wbxx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32wbxx_hal_flash.h"
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Inc/utilities_conf.h
index c98d97ba1..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Inc/utilities_conf.h
@@ -1,3 +1,4 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* File Name : utilities_conf.h
@@ -9,13 +10,14 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef UTILITIES_CONF_H
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Src/main.c
index d327a9686..945f6512e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Src/main.c
@@ -218,18 +218,6 @@ static void SystemClock_Config( void )
*/
LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/EWARM/Mac_802_15_4_FFD_Demo.ewd b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/EWARM/Mac_802_15_4_FFD_Demo.ewd
index 126cedd9c..3f7c8db42 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/EWARM/Mac_802_15_4_FFD_Demo.ewd
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/EWARM/Mac_802_15_4_FFD_Demo.ewd
@@ -2,7 +2,7 @@
<project>
<fileVersion>3</fileVersion>
<configuration>
- <name>STM32WBxx_Nucleo_Mac_802_15_4_FFD_Demo</name>
+ <name>P-NUCLEO-WB55.Nucleo_Mac_802_15_4_FFD_Demo</name>
<toolchain>
<name>ARM</name>
</toolchain>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/STM32_WPAN/App/app_ffd_mac_802_15_4.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/STM32_WPAN/App/app_ffd_mac_802_15_4.c
index 417be8e68..96fd2d1b9 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/STM32_WPAN/App/app_ffd_mac_802_15_4.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/STM32_WPAN/App/app_ffd_mac_802_15_4.c
@@ -250,11 +250,11 @@ void APP_FFD_MAC_802_15_4_SetupTask(void)
}
/**
- * @brief Trace the error or the warning reported.
- * @param ErrId :
- * @param ErrCode
- * @retval None
- */
+ * @brief Trace the error or the warning reported.
+ * @param ErrId :
+ * @param ErrCode
+ * @retval None
+ */
void APP_FFD_MAC_802_15_4_Error(uint32_t ErrId, uint32_t ErrCode)
{
@@ -314,13 +314,13 @@ static void APP_FFD_MAC_802_15_4_Config()
}
/**
- * @brief Warn the user that an error has occurred.In this case,
- * the LEDs on the Board will start blinking.
- *
- * @param pMess : Message associated to the error.
- * @param ErrCode: Error code associated to the module (OpenThread or other module if any)
- * @retval None
- */
+ * @brief Warn the user that an error has occurred.In this case,
+ * the LEDs on the Board will start blinking.
+ *
+ * @param pMess : Message associated to the error.
+ * @param ErrCode: Error code associated to the module (OpenThread or other module if any)
+ * @retval None
+ */
static void APP_FFD_MAC_802_15_4_TraceError(char * pMess, uint32_t ErrCode)
{
APP_DBG(pMess);
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/STM32_WPAN/App/app_ffd_mac_802_15_4_process.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/STM32_WPAN/App/app_ffd_mac_802_15_4_process.c
index 9031473b9..e7505cddd 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/STM32_WPAN/App/app_ffd_mac_802_15_4_process.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_FFD/STM32_WPAN/App/app_ffd_mac_802_15_4_process.c
@@ -51,6 +51,8 @@
/* Private function prototypes -----------------------------------------------*/
+uint8_t checkMsgXorSignature(const char * pMessage, uint8_t message_len,
+ uint8_t sign, uint8_t expectedRes);
/* Public variables ----------------------------------------------------------*/
extern MAC_associateInd_t g_MAC_associateInd;
@@ -177,34 +179,41 @@ MAC_Status_t APP_MAC_mlmeStartCnfCb( const MAC_startCnf_t * pStartCnf )
}
-
MAC_Status_t APP_MAC_mcpsDataIndCb( const MAC_dataInd_t * pDataInd )
{
-
memcpy(&g_DataInd,pDataInd,sizeof(MAC_dataInd_t));
- APP_DBG("FFD MAC APP - RECEIVE DATA : %s", (char const *) pDataInd->msduPtr);
- BSP_LED_On(LED3);
- HAL_Delay(300);
- BSP_LED_Off(LED3);
+ // Check validity of the received Message extracting associated
+ // simple xor signature
+ if (!checkMsgXorSignature((char const *)(pDataInd->msduPtr),
+ pDataInd->msdu_length-1,
+ pDataInd->msduPtr[pDataInd->msdu_length-1],
+ 0x00))
+ {
+ APP_DBG("FFD MAC APP - ERROR : CORRUPTED RECEIVED DATA ");
+ }
+ else
+ {
+ pDataInd->msduPtr[pDataInd->msdu_length-1] = '\0';//erase signature with EOS
+ APP_DBG("FFD MAC APP - RECEIVE DATA : %s", (char const *) pDataInd->msduPtr);
+ BSP_LED_On(LED3);
+ HAL_Delay(300);
+ BSP_LED_Off(LED3);
+ }
return MAC_SUCCESS;
-
}
-
MAC_Status_t APP_MAC_mcpsDataCnfCb( const MAC_dataCnf_t * pDataCnf )
{
UTIL_SEQ_SetEvt( EVENT_DATA_CNF );
return MAC_SUCCESS;
}
-
MAC_Status_t APP_MAC_mcpsPurgeCnfCb( const MAC_purgeCnf_t * pPurgeCnf )
{
return MAC_NOT_IMPLEMENTED_STATUS;
}
-
MAC_Status_t APP_MAC_mlmeSyncLossIndCb( const MAC_syncLoss_t * syncLossPtr )
{
return MAC_NOT_IMPLEMENTED_STATUS;
@@ -246,11 +255,23 @@ MAC_Status_t APP_MAC_mlmeGtsIndCb( const MAC_GtsInd_t * pGtsInd )
return MAC_NOT_IMPLEMENTED_STATUS;
}
+// APP_MAC_mlmePollIndCbPtr mlmePollIndCb;
MAC_Status_t APP_MAC_mlmePollIndCb( const MAC_pollInd_t * pPollInd )
{
return MAC_NOT_IMPLEMENTED_STATUS;
}
+/* Private function Definition -----------------------------------------------*/
+
+uint8_t checkMsgXorSignature(const char * pMessage, uint8_t message_len,
+ uint8_t sign, uint8_t expectedRes)
+{
+ uint8_t seed = sign;
+ for (uint8_t i=0x00;i<message_len;i++)
+ seed = (uint8_t)pMessage[i]^seed;
+ return (seed==expectedRes);
+}
+
/******************************************************************************/
//@} \\END CLI Commands
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Inc/app_conf.h
index b83d18c5c..98d0ae83d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Inc/app_conf.h
@@ -24,6 +24,7 @@
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Debug
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Inc/stm32_lpm_if.h
index 38e326512..70abecaa9 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Inc/stm32_lpm_if.h
@@ -1,46 +1,22 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file stm32_lpm_if.h
-* @brief Header for stm32_lpm_f.c module (device specific LP management)
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
******************************************************************************
* @attention
*
-* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics International N.V.
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted, provided that the following conditions are met:
-*
-* 1. Redistribution of source code must retain the above copyright notice,
-* this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following disclaimer in the documentation
-* and/or other materials provided with the distribution.
-* 3. Neither the name of STMicroelectronics nor the names of other
-* contributors to this software may be used to endorse or promote products
-* derived from this software without specific written permission.
-* 4. This software, including modifications and/or derivative works of this
-* software, must execute solely and exclusively on microcontroller or
-* microprocessor devices manufactured by or for STMicroelectronics.
-* 5. Redistribution and use of this software other than as permitted under
-* this license is void and will automatically terminate your rights under
-* this license.
-*
-* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
-* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
-* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32_LPM_IF_H
@@ -89,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Inc/stm32wbxx_hal_conf.h
index 2105136c7..2114081a5 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Inc/stm32wbxx_hal_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Inc/stm32wbxx_hal_conf.h
@@ -220,6 +220,10 @@
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32wbxx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32wbxx_hal_flash.h"
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Inc/utilities_conf.h
index c98d97ba1..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Inc/utilities_conf.h
@@ -1,3 +1,4 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* File Name : utilities_conf.h
@@ -9,13 +10,14 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef UTILITIES_CONF_H
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Src/main.c
index 95c79862b..f9ba13337 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Src/main.c
@@ -216,18 +216,6 @@ static void SystemClock_Config( void )
*/
LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/EWARM/Mac_802_15_4_RFD_Demo.ewd b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/EWARM/Mac_802_15_4_RFD_Demo.ewd
index 888ecbc6d..a0fd89918 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/EWARM/Mac_802_15_4_RFD_Demo.ewd
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/EWARM/Mac_802_15_4_RFD_Demo.ewd
@@ -2,7 +2,7 @@
<project>
<fileVersion>3</fileVersion>
<configuration>
- <name>STM32WBxx_Nucleo_Mac_802_15_4_RFD_Demo</name>
+ <name>P-NUCLEO-WB55.Nucleo_Mac_802_15_4_RFD_Demo</name>
<toolchain>
<name>ARM</name>
</toolchain>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/STM32_WPAN/App/app_rfd_mac_802_15_4.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/STM32_WPAN/App/app_rfd_mac_802_15_4.c
index 2877eb8eb..9af2a069f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/STM32_WPAN/App/app_rfd_mac_802_15_4.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/STM32_WPAN/App/app_rfd_mac_802_15_4.c
@@ -41,6 +41,11 @@
#define DATA "HELLO COORDINATOR\0"
/* Private function prototypes -----------------------------------------------*/
+
+
+uint8_t xorSign( const char * pmessage, uint8_t message_len);
+
+
static void APP_RFD_MAC_802_15_4_TraceError(char * pMess, uint32_t ErrCode);
static void APP_RFD_MAC_802_15_4_Config(void);
@@ -207,10 +212,10 @@ void APP_RFD_MAC_802_15_4_SendData(const char * data)
DataReq.ack_Tx =0x00;
DataReq.GTS_Tx = FALSE;
memcpy(&rfBuffer,data,strlen(data));
+ rfBuffer[strlen(data)] = xorSign(data,strlen(data));
DataReq.msduPtr = (uint8_t*) rfBuffer;
- DataReq.msdu_length = strlen(data);
+ DataReq.msdu_length = strlen(data)+1;
DataReq.security_level = 0x00;
-
MacStatus = MAC_MCPSDataReq( &DataReq );
if ( MAC_SUCCESS != MacStatus ) {
APP_DBG("RFD MAC - Data Req Fails\0");
@@ -221,11 +226,11 @@ void APP_RFD_MAC_802_15_4_SendData(const char * data)
APP_DBG("RFD MAC APP - DATA CNF Received\0");
}
/**
- * @brief Trace the error or the warning reported.
- * @param ErrId :
- * @param ErrCode
- * @retval None
- */
+ * @brief Trace the error or the warning reported.
+ * @param ErrId :
+ * @param ErrCode
+ * @retval None
+ */
void APP_RFD_MAC_802_15_4_Error(uint32_t ErrId, uint32_t ErrCode)
{
@@ -285,13 +290,13 @@ static void APP_RFD_MAC_802_15_4_Config()
}
/**
- * @brief Warn the user that an error has occurred.In this case,
- * the LEDs on the Board will start blinking.
- *
- * @param pMess : Message associated to the error.
- * @param ErrCode: Error code associated to the module (OpenThread or other module if any)
- * @retval None
- */
+ * @brief Warn the user that an error has occurred.In this case,
+ * the LEDs on the Board will start blinking.
+ *
+ * @param pMess : Message associated to the error.
+ * @param ErrCode: Error code associated to the module (OpenThread or other module if any)
+ * @retval None
+ */
static void APP_RFD_MAC_802_15_4_TraceError(char * pMess, uint32_t ErrCode)
{
APP_DBG(pMess);
@@ -333,6 +338,22 @@ static void APP_RFD_MAC_802_15_4_TraceError(char * pMess, uint32_t ErrCode)
/**
+ * @brief comptue simple xor signature of the data to transmit
+ *
+ * @param pmessage : Message to sign.
+ * @param message_len: Message Len
+ * @retval Message Signature
+ */
+
+uint8_t xorSign( const char * pmessage, uint8_t message_len)
+{
+ uint8_t seed = 0x00;
+ for (uint8_t i=0x00;i<message_len;i++)
+ seed = (uint8_t)pmessage[i]^seed;
+ return seed;
+}
+
+/**
* @}
*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/STM32_WPAN/App/app_rfd_mac_802_15_4_process.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/STM32_WPAN/App/app_rfd_mac_802_15_4_process.c
index ebcc7a94a..19721841f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/STM32_WPAN/App/app_rfd_mac_802_15_4_process.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Mac_802_15_4/Mac_802_15_4_RFD/STM32_WPAN/App/app_rfd_mac_802_15_4_process.c
@@ -221,6 +221,7 @@ MAC_Status_t APP_MAC_mlmeGtsIndCb( const MAC_GtsInd_t * pGtsInd )
return MAC_NOT_IMPLEMENTED_STATUS;
}
+// APP_MAC_mlmePollIndCbPtr mlmePollIndCb;
MAC_Status_t APP_MAC_mlmePollIndCb( const MAC_pollInd_t * pPollInd )
{
return MAC_NOT_IMPLEMENTED_STATUS;
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Inc/app_conf.h
index 965dd7662..21b44469f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Inc/app_conf.h
@@ -23,6 +23,7 @@
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Application Config
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Inc/stm32_lpm_if.h
index 45db98456..70abecaa9 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Inc/stm32_lpm_if.h
@@ -1,21 +1,21 @@
/* USER CODE BEGIN Header */
/**
- ******************************************************************************
- * File Name : stm32_lpm_if.h
- * Description : Header for stm32_lpm_f.c module (device specific LP management).
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
+******************************************************************************
+* @file stm32_lpm_if.h
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
+******************************************************************************
+* @attention
+*
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+* All rights reserved.</center></h2>
+*
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+*
+******************************************************************************
+*/
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
@@ -65,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Inc/stm32wbxx_it.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Inc/stm32wbxx_it.h
index 5b5006195..fcd806873 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Inc/stm32wbxx_it.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Inc/stm32wbxx_it.h
@@ -28,7 +28,7 @@
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
-
+#include "app_common.h"
/* USER CODE END Includes */
/* Exported types ------------------------------------------------------------*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Inc/utilities_conf.h
index 2c5384639..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Inc/utilities_conf.h
@@ -10,10 +10,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Src/hw_uart.c
index ac245a96f..9a553610d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Src/hw_uart.c
@@ -48,9 +48,8 @@ extern UART_HandleTypeDef huart1;
hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
} while(0)
- /* Variables ------------------------------------------------------------------*/
+/* Variables -----------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
-
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
#endif
@@ -59,7 +58,6 @@ extern UART_HandleTypeDef huart1;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
-
#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_hlpuart1_tx ={0};
#endif
@@ -67,73 +65,73 @@ extern UART_HandleTypeDef huart1;
void (*HW_hlpuart1TxCb)(void);
#endif
- void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_RX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_RX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_RX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_RX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ return;
+}
+
+void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
{
- HAL_StatusTypeDef hal_status = HAL_OK;
- hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
+ default:
+ break;
}
switch (hal_status)
@@ -163,8 +161,8 @@ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t
hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
{
-HAL_StatusTypeDef hal_status = HAL_OK;
-hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
@@ -252,33 +250,33 @@ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
switch ((uint32_t)huart->Instance)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1RxCb)
- {
- HW_huart1RxCb();
- }
- break;
+ if(HW_huart1RxCb)
+ {
+ HW_huart1RxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1RxCb)
- {
- HW_hlpuart1RxCb();
- }
- break;
+ if(HW_hlpuart1RxCb)
+ {
+ HW_hlpuart1RxCb();
+ }
+ break;
#endif
default:
@@ -294,20 +292,20 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1TxCb)
- {
- HW_huart1TxCb();
- }
- break;
+ if(HW_huart1TxCb)
+ {
+ HW_huart1TxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1TxCb)
- {
- HW_hlpuart1TxCb();
- }
- break;
+ if(HW_hlpuart1TxCb)
+ {
+ HW_hlpuart1TxCb();
+ }
+ break;
#endif
default:
@@ -317,4 +315,4 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
return;
}
- /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Src/main.c
index 98d1570a0..00e011ffa 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Src/main.c
@@ -164,17 +164,20 @@ void SystemClock_Config(void)
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
+ /** Configure LSE Drive Capability
+ */
+ __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
/** Configure the main internal regulator output voltage
*/
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
/** Initializes the CPU, AHB and APB busses clocks
*/
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSI1
- |RCC_OSCILLATORTYPE_HSE;
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE
+ |RCC_OSCILLATORTYPE_LSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ RCC_OscInitStruct.LSEState = RCC_LSE_ON;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
- RCC_OscInitStruct.LSIState = RCC_LSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
@@ -203,8 +206,8 @@ void SystemClock_Config(void)
|RCC_PERIPHCLK_LPUART1;
PeriphClkInitStruct.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2;
PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1;
- PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI;
- PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSI;
+ PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
+ PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSE;
PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSE;
PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE0;
@@ -351,7 +354,7 @@ static void MX_RTC_Init(void)
hrtc.Instance = RTC;
hrtc.Init.HourFormat = RTC_HOURFORMAT_24;
hrtc.Init.AsynchPrediv = CFG_RTC_ASYNCH_PRESCALER;
- hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER ;
+ hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
hrtc.Init.OutPut = RTC_OUTPUT_DISABLE;
hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH;
hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;
@@ -394,6 +397,7 @@ static void MX_GPIO_Init(void)
{
/* GPIO Ports Clock Enable */
+ __HAL_RCC_GPIOC_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
@@ -406,6 +410,12 @@ void PeriphClock_Config(void)
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -439,30 +449,6 @@ void PeriphClock_Config(void)
HAL_RCCEx_CRSConfig(&RCC_CRSInitStruct);
#endif
- /**
- * Select LSE clock
- */
- LL_RCC_LSE_Enable();
- while(!LL_RCC_LSE_IsReady());
-
- /**
- * Select wakeup source of BLE RF
- */
- LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
-
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
/*************************************************************
@@ -555,6 +541,7 @@ static void Reset_BackupDomain( void )
return;
}
+
static void Init_Exti( void )
{
/**< Disable all wakeup interrupt on CPU1 except IPCC(36), HSEM(38) */
@@ -563,6 +550,40 @@ static void Init_Exti( void )
return;
}
+
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+void HAL_Delay(uint32_t Delay)
+{
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
+
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
+}
/* USER CODE END 4 */
/**
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Src/stm32wbxx_hal_msp.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Src/stm32wbxx_hal_msp.c
index af092b564..8712c64d7 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Src/stm32wbxx_hal_msp.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Core/Src/stm32wbxx_hal_msp.c
@@ -97,8 +97,6 @@ void HAL_MspInit(void)
HAL_NVIC_SetPriority(FPU_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(FPU_IRQn);
- /* Disable the internal Pull-Up in Dead Battery pins of UCPD peripheral */
-
/* USER CODE BEGIN MspInit 1 */
/* USER CODE END MspInit 1 */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/STM32_WPAN/App/app_thread.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/STM32_WPAN/App/app_thread.c
index a038149c5..3ff5c866d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/STM32_WPAN/App/app_thread.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/STM32_WPAN/App/app_thread.c
@@ -16,7 +16,7 @@
*
******************************************************************************
*/
- /* USER CODE END Header */
+/* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -63,8 +63,9 @@ static void APP_THREAD_CheckWirelessFirmwareInfo(void);
static void APP_THREAD_DeviceConfig(void);
static void APP_THREAD_StateNotif(uint32_t NotifFlags, void *pContext);
static void APP_THREAD_TraceError(const char * pMess, uint32_t ErrCode);
-
+#if (CFG_FULL_LOW_POWER == 0)
static void Send_CLI_To_M0(void);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
static void Send_CLI_Ack_For_OT(void);
static void HostTxCb( void );
static void Wait_Getting_Ack_From_M0(void);
@@ -79,10 +80,12 @@ extern void MX_USART1_UART_Init(void);
#if (CFG_USB_INTERFACE_ENABLE != 0)
static uint32_t ProcessCmdString(uint8_t* buf , uint32_t len);
#else
+#if (CFG_FULL_LOW_POWER == 0)
static void RxCpltCallback(void);
-#endif
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
- /* USER CODE BEGIN PFP */
+/* USER CODE BEGIN PFP */
/* USER CODE END PFP */
@@ -92,10 +95,14 @@ static uint8_t TmpString[C_SIZE_CMD_STRING];
static uint8_t VcpRxBuffer[sizeof(TL_CmdSerial_t)]; /* Received Data over USB are stored in this buffer */
static uint8_t VcpTxBuffer[sizeof(TL_EvtPacket_t) + 254U]; /* Transmit buffer over USB */
#else
+#if (CFG_FULL_LOW_POWER == 0)
static uint8_t aRxBuffer[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+#if (CFG_FULL_LOW_POWER == 0)
static uint8_t CommandString[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
static __IO uint16_t indexReceiveChar = 0;
static __IO uint16_t CptReceiveCmdFromUser = 0;
@@ -437,7 +444,7 @@ void TL_THREAD_NotReceived( TL_EvtPacket_t * Notbuffer )
*/
void Pre_OtCmdProcessing(void)
{
- UTIL_SEQ_WaitEvt( EVENT_SYNCHRO_BYPASS_IDLE);
+ UTIL_SEQ_WaitEvt(EVENT_SYNCHRO_BYPASS_IDLE);
}
/**
@@ -477,6 +484,7 @@ static void Receive_Notification_From_M0(void)
#if (CFG_USB_INTERFACE_ENABLE != 0)
#else
+#if (CFG_FULL_LOW_POWER == 0)
static void RxCpltCallback(void)
{
/* Filling buffer and wait for '\r' char */
@@ -495,6 +503,7 @@ static void RxCpltCallback(void)
/* Once a character has been sent, put back the device in reception mode */
HW_UART_Receive_IT(CFG_CLI_UART, aRxBuffer, 1U, RxCpltCallback);
}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
#if (CFG_USB_INTERFACE_ENABLE != 0)
@@ -537,6 +546,7 @@ static uint32_t ProcessCmdString( uint8_t* buf , uint32_t len )
}
#endif/* (CFG_USB_INTERFACE_ENABLE != 0) */
+#if (CFG_FULL_LOW_POWER == 0)
/**
* @brief Process sends receive CLI command to M0.
* @param None
@@ -556,6 +566,7 @@ static void Send_CLI_To_M0(void)
TL_CLI_SendCmd();
}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
/**
* @brief Send notification for CLI TL Channel.
@@ -576,11 +587,16 @@ static void Send_CLI_Ack_For_OT(void)
*/
void APP_THREAD_Init_UART_CLI(void)
{
+#if (CFG_FULL_LOW_POWER == 0)
UTIL_SEQ_RegTask( 1<<CFG_TASK_SEND_CLI_TO_M0, UTIL_SEQ_RFU,Send_CLI_To_M0);
- #if (CFG_USB_INTERFACE_ENABLE != 0)
- #else
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+#else
+#if (CFG_FULL_LOW_POWER == 0)
MX_USART1_UART_Init();
HW_UART_Receive_IT(CFG_CLI_UART, aRxBuffer, 1, RxCpltCallback);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Thread_Cli_Cmd.ioc b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Thread_Cli_Cmd.ioc
index 397b29348..e1e68fbcc 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Thread_Cli_Cmd.ioc
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Cli_Cmd/Thread_Cli_Cmd.ioc
@@ -57,26 +57,28 @@ Mcu.IP9=SYS
Mcu.IPNb=12
Mcu.Name=STM32WB55RGVx
Mcu.Package=VFQFPN68
-Mcu.Pin0=PA2
-Mcu.Pin1=PA3
-Mcu.Pin10=VP_SEQUENCER_VS_SEQUENCER
-Mcu.Pin11=VP_STM32_WPAN_VS_THREAD
-Mcu.Pin12=VP_SYS_VS_Systick
-Mcu.Pin13=VP_TINY_LPM_VS_TINY_LPM
-Mcu.Pin2=RF1
-Mcu.Pin3=OSC_OUT
-Mcu.Pin4=OSC_IN
-Mcu.Pin5=PA11
-Mcu.Pin6=PB6
-Mcu.Pin7=PB7
-Mcu.Pin8=VP_HSEM_VS_HSEM
-Mcu.Pin9=VP_RTC_VS_RTC_Activate
-Mcu.PinsNb=14
+Mcu.Pin0=PC14-OSC32_IN
+Mcu.Pin1=PC15-OSC32_OUT
+Mcu.Pin10=VP_HSEM_VS_HSEM
+Mcu.Pin11=VP_RTC_VS_RTC_Activate
+Mcu.Pin12=VP_SEQUENCER_VS_SEQUENCER
+Mcu.Pin13=VP_STM32_WPAN_VS_THREAD
+Mcu.Pin14=VP_SYS_VS_Systick
+Mcu.Pin15=VP_TINY_LPM_VS_TINY_LPM
+Mcu.Pin2=PA2
+Mcu.Pin3=PA3
+Mcu.Pin4=RF1
+Mcu.Pin5=OSC_OUT
+Mcu.Pin6=OSC_IN
+Mcu.Pin7=PA11
+Mcu.Pin8=PB6
+Mcu.Pin9=PB7
+Mcu.PinsNb=16
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32WB55RGVx
-MxCube.Version=5.3.0
-MxDb.Version=DB.5.0.30
+MxCube.Version=5.4.0
+MxDb.Version=DB.5.0.40
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false
NVIC.C2SEV_PWR_C2H_IRQn=true\:0\:0\:false\:false\:true\:true\:false
NVIC.DMA1_Channel1_IRQn=true\:0\:0\:false\:false\:true\:false\:true
@@ -114,6 +116,10 @@ PB6.Signal=USART1_TX
PB7.Locked=true
PB7.Mode=Asynchronous
PB7.Signal=USART1_RX
+PC14-OSC32_IN.Mode=LSE-External-Oscillator
+PC14-OSC32_IN.Signal=RCC_OSC32_IN
+PC15-OSC32_OUT.Mode=LSE-External-Oscillator
+PC15-OSC32_OUT.Signal=RCC_OSC32_OUT
PCC.Ble.ConnectionInterval=1000.0
PCC.Ble.DataLength=6
PCC.Ble.Mode=Advertising
@@ -172,12 +178,12 @@ RCC.HSI48_VALUE=48000000
RCC.HSI_VALUE=16000000
RCC.I2C1Freq_Value=32000000
RCC.I2C3Freq_Value=32000000
-RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSE_VALUE,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1N,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PWRFreq_Value,RNGFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SMPSCLockSelectionVirtual,SMPSFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LCDFreq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1N,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PWRFreq_Value,RFWKPClockSelection,RFWKPFreq_Value,RNGFreq_Value,RTCClockSelection,RTCFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SMPSCLockSelectionVirtual,SMPSFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.LCDFreq_Value=32768
RCC.LPTIM1Freq_Value=32000000
RCC.LPTIM2Freq_Value=32000000
RCC.LPUART1Freq_Value=32000000
RCC.LSCOPinFreq_Value=32000
-RCC.LSE_VALUE=32768
RCC.LSI_VALUE=32000
RCC.MCO1PinFreq_Value=32000000
RCC.PLLPoutputFreq_Value=16000000
@@ -188,7 +194,11 @@ RCC.PLLSAI1PoutputFreq_Value=48000000
RCC.PLLSAI1QoutputFreq_Value=48000000
RCC.PLLSAI1RoutputFreq_Value=48000000
RCC.PWRFreq_Value=32000000
+RCC.RFWKPClockSelection=RCC_RFWKPCLKSOURCE_LSE
+RCC.RFWKPFreq_Value=32768
RCC.RNGFreq_Value=32000
+RCC.RTCClockSelection=RCC_RTCCLKSOURCE_LSE
+RCC.RTCFreq_Value=32768
RCC.SAI1Freq_Value=48000000
RCC.SMPS1Freq_Value=16000000
RCC.SMPSCLockSelectionVirtual=RCC_SMPSCLKSOURCE_HSE
@@ -204,7 +214,7 @@ RF1.Mode=RF1_Activate
RF1.Signal=RF_RF1
RTC.AsynchPrediv=CFG_RTC_ASYNCH_PRESCALER
RTC.IPParameters=AsynchPrediv,SynchPrediv
-RTC.SynchPrediv=CFG_RTC_SYNCH_PRESCALER
+RTC.SynchPrediv=CFG_RTC_SYNCH_PRESCALER
STM32_WPAN.APP_DBG_EN=1
STM32_WPAN.CFG_CLI_UART=hw_uart1
STM32_WPAN.CFG_DBG_TRACE_UART=hw_lpuart1
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/app_conf.h
index 997cb5153..9f22d0c08 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/app_conf.h
@@ -23,6 +23,7 @@
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Application Config
@@ -298,8 +299,8 @@ typedef enum
/* USER CODE BEGIN DEFINE_TASK */
#define TASK_SEND_BUFFER (1U << CFG_TASK_SEND_BUFFER)
#define TASK_PROVISIONING (1U << CFG_TASK_PROVISIONING)
-/* USER CODE END DEFINE_TASK */
-
+/* USER CODE END DEFINE_TASK */
+
/**
* This is the list of priority required by the application
* Each Id shall be in the range 0..31
@@ -311,18 +312,17 @@ typedef enum
CFG_PRIO_NBR,
} CFG_SCH_Prio_Id_t;
-
-/**
-* This is a bit mapping over 32bits listing all events id supported in the application
-*/
+ /**
+ * This is a bit mapping over 32bits listing all events id supported in the application
+ */
typedef enum
{
CFG_EVT_SYSTEM_HCI_CMD_EVT_RESP,
CFG_EVT_ACK_FROM_M0_EVT,
CFG_EVT_SYNCHRO_BYPASS_IDLE,
-/* USER CODE BEGIN CFG_IdleEvt_Id_t */
+ /* USER CODE BEGIN CFG_IdleEvt_Id_t */
CFG_EVT_RESPONSE_ACK,
-/* USER CODE END CFG_IdleEvt_Id_t */
+ /* USER CODE END CFG_IdleEvt_Id_t */
} CFG_IdleEvt_Id_t;
#define EVENT_ACK_FROM_M0_EVT (1U << CFG_EVT_ACK_FROM_M0_EVT)
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/stm32_lpm_if.h
index 45db98456..70abecaa9 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/stm32_lpm_if.h
@@ -1,21 +1,21 @@
/* USER CODE BEGIN Header */
/**
- ******************************************************************************
- * File Name : stm32_lpm_if.h
- * Description : Header for stm32_lpm_f.c module (device specific LP management).
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
+******************************************************************************
+* @file stm32_lpm_if.h
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
+******************************************************************************
+* @attention
+*
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+* All rights reserved.</center></h2>
+*
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+*
+******************************************************************************
+*/
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
@@ -65,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/stm32wbxx_it.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/stm32wbxx_it.h
index 9b30fc262..a3a535f13 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/stm32wbxx_it.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/stm32wbxx_it.h
@@ -28,7 +28,7 @@
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
-
+#include "app_common.h"
/* USER CODE END Includes */
/* Exported types ------------------------------------------------------------*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/utilities_conf.h
index 2c5384639..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/utilities_conf.h
@@ -10,10 +10,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/hw_timerserver.c
index 17c9af0a4..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/hw_timerserver.c
@@ -4,19 +4,18 @@
* Description : Hardware timerserver source file for STM32WPAN Middleware.
*
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/hw_uart.c
index ac245a96f..9a553610d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/hw_uart.c
@@ -48,9 +48,8 @@ extern UART_HandleTypeDef huart1;
hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
} while(0)
- /* Variables ------------------------------------------------------------------*/
+/* Variables -----------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
-
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
#endif
@@ -59,7 +58,6 @@ extern UART_HandleTypeDef huart1;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
-
#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_hlpuart1_tx ={0};
#endif
@@ -67,73 +65,73 @@ extern UART_HandleTypeDef huart1;
void (*HW_hlpuart1TxCb)(void);
#endif
- void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_RX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_RX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_RX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_RX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ return;
+}
+
+void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
{
- HAL_StatusTypeDef hal_status = HAL_OK;
- hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
+ default:
+ break;
}
switch (hal_status)
@@ -163,8 +161,8 @@ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t
hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
{
-HAL_StatusTypeDef hal_status = HAL_OK;
-hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
@@ -252,33 +250,33 @@ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
switch ((uint32_t)huart->Instance)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1RxCb)
- {
- HW_huart1RxCb();
- }
- break;
+ if(HW_huart1RxCb)
+ {
+ HW_huart1RxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1RxCb)
- {
- HW_hlpuart1RxCb();
- }
- break;
+ if(HW_hlpuart1RxCb)
+ {
+ HW_hlpuart1RxCb();
+ }
+ break;
#endif
default:
@@ -294,20 +292,20 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1TxCb)
- {
- HW_huart1TxCb();
- }
- break;
+ if(HW_huart1TxCb)
+ {
+ HW_huart1TxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1TxCb)
- {
- HW_hlpuart1TxCb();
- }
- break;
+ if(HW_hlpuart1TxCb)
+ {
+ HW_hlpuart1TxCb();
+ }
+ break;
#endif
default:
@@ -317,4 +315,4 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
return;
}
- /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/main.c
index 98d1570a0..00e011ffa 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/main.c
@@ -164,17 +164,20 @@ void SystemClock_Config(void)
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
+ /** Configure LSE Drive Capability
+ */
+ __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
/** Configure the main internal regulator output voltage
*/
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
/** Initializes the CPU, AHB and APB busses clocks
*/
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSI1
- |RCC_OSCILLATORTYPE_HSE;
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE
+ |RCC_OSCILLATORTYPE_LSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ RCC_OscInitStruct.LSEState = RCC_LSE_ON;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
- RCC_OscInitStruct.LSIState = RCC_LSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
@@ -203,8 +206,8 @@ void SystemClock_Config(void)
|RCC_PERIPHCLK_LPUART1;
PeriphClkInitStruct.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2;
PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1;
- PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI;
- PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSI;
+ PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
+ PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSE;
PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSE;
PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE0;
@@ -351,7 +354,7 @@ static void MX_RTC_Init(void)
hrtc.Instance = RTC;
hrtc.Init.HourFormat = RTC_HOURFORMAT_24;
hrtc.Init.AsynchPrediv = CFG_RTC_ASYNCH_PRESCALER;
- hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER ;
+ hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
hrtc.Init.OutPut = RTC_OUTPUT_DISABLE;
hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH;
hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;
@@ -394,6 +397,7 @@ static void MX_GPIO_Init(void)
{
/* GPIO Ports Clock Enable */
+ __HAL_RCC_GPIOC_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
@@ -406,6 +410,12 @@ void PeriphClock_Config(void)
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -439,30 +449,6 @@ void PeriphClock_Config(void)
HAL_RCCEx_CRSConfig(&RCC_CRSInitStruct);
#endif
- /**
- * Select LSE clock
- */
- LL_RCC_LSE_Enable();
- while(!LL_RCC_LSE_IsReady());
-
- /**
- * Select wakeup source of BLE RF
- */
- LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
-
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
/*************************************************************
@@ -555,6 +541,7 @@ static void Reset_BackupDomain( void )
return;
}
+
static void Init_Exti( void )
{
/**< Disable all wakeup interrupt on CPU1 except IPCC(36), HSEM(38) */
@@ -563,6 +550,40 @@ static void Init_Exti( void )
return;
}
+
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+void HAL_Delay(uint32_t Delay)
+{
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
+
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
+}
/* USER CODE END 4 */
/**
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/stm32wbxx_hal_msp.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/stm32wbxx_hal_msp.c
index ce0ff57da..9c338486d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/stm32wbxx_hal_msp.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/stm32wbxx_hal_msp.c
@@ -97,8 +97,6 @@ void HAL_MspInit(void)
HAL_NVIC_SetPriority(FPU_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(FPU_IRQn);
- /* Disable the internal Pull-Up in Dead Battery pins of UCPD peripheral */
-
/* USER CODE BEGIN MspInit 1 */
/* USER CODE END MspInit 1 */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/STM32_WPAN/App/app_thread.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/STM32_WPAN/App/app_thread.c
index f13715c70..47286a330 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/STM32_WPAN/App/app_thread.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/STM32_WPAN/App/app_thread.c
@@ -45,10 +45,11 @@
/* USER CODE BEGIN PTD */
/* USER CODE END PTD */
+
/* Private defines -----------------------------------------------------------*/
-#define C_SIZE_CMD_STRING 256U
-#define C_PANID 0x2226U
-#define C_CHANNEL_NB 19U
+#define C_SIZE_CMD_STRING 256U
+#define C_PANID 0x2226U
+#define C_CHANNEL_NB 19U
/* USER CODE BEGIN PD */
#define C_RESSOURCE_DATA_TRANSFER "dataTransfer"
@@ -65,8 +66,9 @@ static void APP_THREAD_CheckWirelessFirmwareInfo(void);
static void APP_THREAD_DeviceConfig(void);
static void APP_THREAD_StateNotif(uint32_t NotifFlags, void *pContext);
static void APP_THREAD_TraceError(const char * pMess, uint32_t ErrCode);
-
+#if (CFG_FULL_LOW_POWER == 0)
static void Send_CLI_To_M0(void);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
static void Send_CLI_Ack_For_OT(void);
static void HostTxCb( void );
static void Wait_Getting_Ack_From_M0(void);
@@ -81,8 +83,10 @@ extern void MX_USART1_UART_Init(void);
#if (CFG_USB_INTERFACE_ENABLE != 0)
static uint32_t ProcessCmdString(uint8_t* buf , uint32_t len);
#else
+#if (CFG_FULL_LOW_POWER == 0)
static void RxCpltCallback(void);
-#endif
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
/* USER CODE BEGIN PFP */
static void APP_THREAD_CheckMsgValidity(void);
@@ -121,14 +125,18 @@ static void APP_THREAD_AskProvisioning(void);
/* Private variables -----------------------------------------------*/
#if (CFG_USB_INTERFACE_ENABLE != 0)
- static uint8_t TmpString[C_SIZE_CMD_STRING];
+static uint8_t TmpString[C_SIZE_CMD_STRING];
static uint8_t VcpRxBuffer[sizeof(TL_CmdSerial_t)]; /* Received Data over USB are stored in this buffer */
static uint8_t VcpTxBuffer[sizeof(TL_EvtPacket_t) + 254U]; /* Transmit buffer over USB */
#else
+#if (CFG_FULL_LOW_POWER == 0)
static uint8_t aRxBuffer[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+#if (CFG_FULL_LOW_POWER == 0)
static uint8_t CommandString[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
static __IO uint16_t indexReceiveChar = 0;
static __IO uint16_t CptReceiveCmdFromUser = 0;
@@ -163,7 +171,7 @@ void APP_THREAD_Init( void )
/* USER CODE END APP_THREAD_INIT_1 */
SHCI_CmdStatus_t ThreadInitStatus;
-
+
/* Check the compatibility with the Coprocessor Wireless Firmware loaded */
APP_THREAD_CheckWirelessFirmwareInfo();
@@ -187,14 +195,14 @@ void APP_THREAD_Init( void )
/* Send Thread start system cmd to M0 */
ThreadInitStatus = SHCI_C2_THREAD_Init();
-
+
/* Prevent unused argument(s) compilation warning */
UNUSED(ThreadInitStatus);
/* Register task */
/* Create the different tasks */
UTIL_SEQ_RegTask( 1<<(uint32_t)CFG_TASK_MSG_FROM_M0_TO_M4, UTIL_SEQ_RFU, APP_THREAD_ProcessMsgM0ToM4);
-
+
/* USER CODE BEGIN INIT TASKS */
UTIL_SEQ_RegTask( 1<<(uint32_t)CFG_TASK_SEND_BUFFER, UTIL_SEQ_RFU, APP_THREAD_SendNextBuffer);
UTIL_SEQ_RegTask( 1<<(uint32_t)CFG_TASK_PROVISIONING, UTIL_SEQ_RFU, APP_THREAD_AskProvisioning);
@@ -208,11 +216,11 @@ void APP_THREAD_Init( void )
}
/**
- * @brief Trace the error or the warning reported.
- * @param ErrId :
- * @param ErrCode
- * @retval None
- */
+ * @brief Trace the error or the warning reported.
+ * @param ErrId :
+ * @param ErrCode
+ * @retval None
+ */
void APP_THREAD_Error(uint32_t ErrId, uint32_t ErrCode)
{
/* USER CODE BEGIN APP_THREAD_Error_1 */
@@ -303,7 +311,6 @@ void APP_THREAD_Error(uint32_t ErrId, uint32_t ErrCode)
}
}
-
/*************************************************************
*
* LOCAL FUNCTIONS
@@ -373,11 +380,10 @@ static void APP_THREAD_DeviceConfig(void)
/* USER CODE END DEVICECONFIG */
}
-
/**
* @brief Thread notification when the state changes.
* @param aFlags : Define the item that has been modified
- * aContext: Context
+ * aContext: Context
*
* @retval None
*/
@@ -416,7 +422,7 @@ static void APP_THREAD_StateNotif(uint32_t NotifFlags, void *pContext)
UTIL_SEQ_SetTask(TASK_PROVISIONING, CFG_SCH_PRIO_1);
}
provisioning = 1U;
- /* USER CODE END OT_DEVICE_ROLE_CHILD */
+ /* USER CODE END OT_DEVICE_ROLE_CHILD */
break;
case OT_DEVICE_ROLE_ROUTER :
/* USER CODE BEGIN OT_DEVICE_ROLE_ROUTER */
@@ -441,13 +447,13 @@ static void APP_THREAD_StateNotif(uint32_t NotifFlags, void *pContext)
}
/**
- * @brief Warn the user that an error has occurred.In this case,
- * the LEDs on the Board will start blinking.
- *
- * @param pMess : Message associated to the error.
- * @param ErrCode: Error code associated to the module (OpenThread or other module if any)
- * @retval None
- */
+ * @brief Warn the user that an error has occurred.In this case,
+ * the LEDs on the Board will start blinking.
+ *
+ * @param pMess : Message associated to the error.
+ * @param ErrCode: Error code associated to the module (OpenThread or other module if any)
+ * @retval None
+ */
static void APP_THREAD_TraceError(const char * pMess, uint32_t ErrCode)
{
/* USER CODE BEGIN TRACE_ERROR */
@@ -505,7 +511,6 @@ static void APP_THREAD_CheckWirelessFirmwareInfo(void)
APP_DBG("**********************************************************");
}
}
-
/* USER CODE BEGIN FD_LOCAL_FUNCTIONS */
/**
* @brief This function is used to compare the message received versus
@@ -944,7 +949,6 @@ void APP_THREAD_RegisterCmdBuffer(TL_CmdPacket_t* p_buffer)
p_thread_otcmdbuffer = p_buffer;
}
-
Thread_OT_Cmd_Request_t* THREAD_Get_OTCmdPayloadBuffer(void)
{
return (Thread_OT_Cmd_Request_t*)p_thread_otcmdbuffer->cmdserial.cmd.payload;
@@ -1010,47 +1014,47 @@ void TL_THREAD_NotReceived( TL_EvtPacket_t * Notbuffer )
}
/**
- * @brief This function is called before sending any ot command to the M0
- * core. The purpose of this function is to be able to check if
- * there are no notifications coming from the M0 core which are
- * pending before sending a new ot command.
- * @param None
- * @retval None
- */
+ * @brief This function is called before sending any ot command to the M0
+ * core. The purpose of this function is to be able to check if
+ * there are no notifications coming from the M0 core which are
+ * pending before sending a new ot command.
+ * @param None
+ * @retval None
+ */
void Pre_OtCmdProcessing(void)
{
- UTIL_SEQ_WaitEvt( EVENT_SYNCHRO_BYPASS_IDLE);
+ UTIL_SEQ_WaitEvt(EVENT_SYNCHRO_BYPASS_IDLE);
}
/**
- * @brief This function waits for getting an acknowledgment from the M0.
- *
- * @param None
- * @retval None
- */
+ * @brief This function waits for getting an acknowledgment from the M0.
+ *
+ * @param None
+ * @retval None
+ */
static void Wait_Getting_Ack_From_M0(void)
{
UTIL_SEQ_WaitEvt(EVENT_ACK_FROM_M0_EVT);
}
/**
- * @brief Receive an acknowledgment from the M0+ core.
- * Each command send by the M4 to the M0 are acknowledged.
- * This function is called under interrupt.
- * @param None
- * @retval None
- */
+ * @brief Receive an acknowledgment from the M0+ core.
+ * Each command send by the M4 to the M0 are acknowledged.
+ * This function is called under interrupt.
+ * @param None
+ * @retval None
+ */
static void Receive_Ack_From_M0(void)
{
UTIL_SEQ_SetEvt(EVENT_ACK_FROM_M0_EVT);
}
/**
- * @brief Receive a notification from the M0+ through the IPCC.
- * This function is called under interrupt.
- * @param None
- * @retval None
- */
+ * @brief Receive a notification from the M0+ through the IPCC.
+ * This function is called under interrupt.
+ * @param None
+ * @retval None
+ */
static void Receive_Notification_From_M0(void)
{
CptReceiveMsgFromM0++;
@@ -1059,6 +1063,7 @@ static void Receive_Notification_From_M0(void)
#if (CFG_USB_INTERFACE_ENABLE != 0)
#else
+#if (CFG_FULL_LOW_POWER == 0)
static void RxCpltCallback(void)
{
/* Filling buffer and wait for '\r' char */
@@ -1077,6 +1082,7 @@ static void RxCpltCallback(void)
/* Once a character has been sent, put back the device in reception mode */
HW_UART_Receive_IT(CFG_CLI_UART, aRxBuffer, 1U, RxCpltCallback);
}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
#if (CFG_USB_INTERFACE_ENABLE != 0)
@@ -1119,6 +1125,7 @@ static uint32_t ProcessCmdString( uint8_t* buf , uint32_t len )
}
#endif/* (CFG_USB_INTERFACE_ENABLE != 0) */
+#if (CFG_FULL_LOW_POWER == 0)
/**
* @brief Process sends receive CLI command to M0.
* @param None
@@ -1138,6 +1145,7 @@ static void Send_CLI_To_M0(void)
TL_CLI_SendCmd();
}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
/**
* @brief Send notification for CLI TL Channel.
@@ -1158,11 +1166,16 @@ static void Send_CLI_Ack_For_OT(void)
*/
void APP_THREAD_Init_UART_CLI(void)
{
+#if (CFG_FULL_LOW_POWER == 0)
UTIL_SEQ_RegTask( 1<<CFG_TASK_SEND_CLI_TO_M0, UTIL_SEQ_RFU,Send_CLI_To_M0);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+
#if (CFG_USB_INTERFACE_ENABLE != 0)
#else
+#if (CFG_FULL_LOW_POWER == 0)
MX_USART1_UART_Init();
HW_UART_Receive_IT(CFG_CLI_UART, aRxBuffer, 1, RxCpltCallback);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Thread_Coap_DataTransfer.ioc b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Thread_Coap_DataTransfer.ioc
index 80ccd101e..0eec34e3d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Thread_Coap_DataTransfer.ioc
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_DataTransfer/Thread_Coap_DataTransfer.ioc
@@ -57,26 +57,28 @@ Mcu.IP9=SYS
Mcu.IPNb=12
Mcu.Name=STM32WB55RGVx
Mcu.Package=VFQFPN68
-Mcu.Pin0=PA2
-Mcu.Pin1=PA3
-Mcu.Pin10=VP_SEQUENCER_VS_SEQUENCER
-Mcu.Pin11=VP_STM32_WPAN_VS_THREAD
-Mcu.Pin12=VP_SYS_VS_Systick
-Mcu.Pin13=VP_TINY_LPM_VS_TINY_LPM
-Mcu.Pin2=RF1
-Mcu.Pin3=OSC_OUT
-Mcu.Pin4=OSC_IN
-Mcu.Pin5=PA11
-Mcu.Pin6=PB6
-Mcu.Pin7=PB7
-Mcu.Pin8=VP_HSEM_VS_HSEM
-Mcu.Pin9=VP_RTC_VS_RTC_Activate
-Mcu.PinsNb=14
+Mcu.Pin0=PC14-OSC32_IN
+Mcu.Pin1=PC15-OSC32_OUT
+Mcu.Pin10=VP_HSEM_VS_HSEM
+Mcu.Pin11=VP_RTC_VS_RTC_Activate
+Mcu.Pin12=VP_SEQUENCER_VS_SEQUENCER
+Mcu.Pin13=VP_STM32_WPAN_VS_THREAD
+Mcu.Pin14=VP_SYS_VS_Systick
+Mcu.Pin15=VP_TINY_LPM_VS_TINY_LPM
+Mcu.Pin2=PA2
+Mcu.Pin3=PA3
+Mcu.Pin4=RF1
+Mcu.Pin5=OSC_OUT
+Mcu.Pin6=OSC_IN
+Mcu.Pin7=PA11
+Mcu.Pin8=PB6
+Mcu.Pin9=PB7
+Mcu.PinsNb=16
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32WB55RGVx
-MxCube.Version=5.3.0
-MxDb.Version=DB.5.0.30
+MxCube.Version=5.4.0
+MxDb.Version=DB.5.0.40
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false
NVIC.C2SEV_PWR_C2H_IRQn=true\:0\:0\:false\:false\:true\:true\:false
NVIC.DMA1_Channel1_IRQn=true\:0\:0\:false\:false\:true\:false\:true
@@ -114,6 +116,10 @@ PB6.Signal=USART1_TX
PB7.Locked=true
PB7.Mode=Asynchronous
PB7.Signal=USART1_RX
+PC14-OSC32_IN.Mode=LSE-External-Oscillator
+PC14-OSC32_IN.Signal=RCC_OSC32_IN
+PC15-OSC32_OUT.Mode=LSE-External-Oscillator
+PC15-OSC32_OUT.Signal=RCC_OSC32_OUT
PCC.Ble.ConnectionInterval=1000.0
PCC.Ble.DataLength=6
PCC.Ble.Mode=Advertising
@@ -172,12 +178,12 @@ RCC.HSI48_VALUE=48000000
RCC.HSI_VALUE=16000000
RCC.I2C1Freq_Value=32000000
RCC.I2C3Freq_Value=32000000
-RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSE_VALUE,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1N,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PWRFreq_Value,RNGFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SMPSCLockSelectionVirtual,SMPSFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LCDFreq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1N,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PWRFreq_Value,RFWKPClockSelection,RFWKPFreq_Value,RNGFreq_Value,RTCClockSelection,RTCFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SMPSCLockSelectionVirtual,SMPSFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.LCDFreq_Value=32768
RCC.LPTIM1Freq_Value=32000000
RCC.LPTIM2Freq_Value=32000000
RCC.LPUART1Freq_Value=32000000
RCC.LSCOPinFreq_Value=32000
-RCC.LSE_VALUE=32768
RCC.LSI_VALUE=32000
RCC.MCO1PinFreq_Value=32000000
RCC.PLLPoutputFreq_Value=16000000
@@ -188,7 +194,11 @@ RCC.PLLSAI1PoutputFreq_Value=48000000
RCC.PLLSAI1QoutputFreq_Value=48000000
RCC.PLLSAI1RoutputFreq_Value=48000000
RCC.PWRFreq_Value=32000000
+RCC.RFWKPClockSelection=RCC_RFWKPCLKSOURCE_LSE
+RCC.RFWKPFreq_Value=32768
RCC.RNGFreq_Value=32000
+RCC.RTCClockSelection=RCC_RTCCLKSOURCE_LSE
+RCC.RTCFreq_Value=32768
RCC.SAI1Freq_Value=48000000
RCC.SMPS1Freq_Value=16000000
RCC.SMPSCLockSelectionVirtual=RCC_SMPSCLKSOURCE_HSE
@@ -204,7 +214,7 @@ RF1.Mode=RF1_Activate
RF1.Signal=RF_RF1
RTC.AsynchPrediv=CFG_RTC_ASYNCH_PRESCALER
RTC.IPParameters=AsynchPrediv,SynchPrediv
-RTC.SynchPrediv=CFG_RTC_SYNCH_PRESCALER
+RTC.SynchPrediv=CFG_RTC_SYNCH_PRESCALER
STM32_WPAN.APP_DBG_EN=1
STM32_WPAN.CFG_CLI_UART=hw_uart1
STM32_WPAN.CFG_DBG_TRACE_UART=hw_lpuart1
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Inc/app_conf.h
index 67f99c4c4..1bcd9e327 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Inc/app_conf.h
@@ -23,6 +23,7 @@
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Application Config
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Inc/stm32_lpm_if.h
index 45db98456..70abecaa9 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Inc/stm32_lpm_if.h
@@ -1,21 +1,21 @@
/* USER CODE BEGIN Header */
/**
- ******************************************************************************
- * File Name : stm32_lpm_if.h
- * Description : Header for stm32_lpm_f.c module (device specific LP management).
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
+******************************************************************************
+* @file stm32_lpm_if.h
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
+******************************************************************************
+* @attention
+*
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+* All rights reserved.</center></h2>
+*
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+*
+******************************************************************************
+*/
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
@@ -65,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Inc/stm32wbxx_it.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Inc/stm32wbxx_it.h
index 9b30fc262..a3a535f13 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Inc/stm32wbxx_it.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Inc/stm32wbxx_it.h
@@ -28,7 +28,7 @@
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
-
+#include "app_common.h"
/* USER CODE END Includes */
/* Exported types ------------------------------------------------------------*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Inc/utilities_conf.h
index 2c5384639..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Inc/utilities_conf.h
@@ -10,10 +10,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Src/hw_timerserver.c
index 17c9af0a4..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Src/hw_timerserver.c
@@ -4,19 +4,18 @@
* Description : Hardware timerserver source file for STM32WPAN Middleware.
*
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Src/hw_uart.c
index ac245a96f..9a553610d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Src/hw_uart.c
@@ -48,9 +48,8 @@ extern UART_HandleTypeDef huart1;
hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
} while(0)
- /* Variables ------------------------------------------------------------------*/
+/* Variables -----------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
-
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
#endif
@@ -59,7 +58,6 @@ extern UART_HandleTypeDef huart1;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
-
#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_hlpuart1_tx ={0};
#endif
@@ -67,73 +65,73 @@ extern UART_HandleTypeDef huart1;
void (*HW_hlpuart1TxCb)(void);
#endif
- void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_RX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_RX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_RX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_RX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ return;
+}
+
+void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
{
- HAL_StatusTypeDef hal_status = HAL_OK;
- hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
+ default:
+ break;
}
switch (hal_status)
@@ -163,8 +161,8 @@ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t
hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
{
-HAL_StatusTypeDef hal_status = HAL_OK;
-hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
@@ -252,33 +250,33 @@ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
switch ((uint32_t)huart->Instance)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1RxCb)
- {
- HW_huart1RxCb();
- }
- break;
+ if(HW_huart1RxCb)
+ {
+ HW_huart1RxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1RxCb)
- {
- HW_hlpuart1RxCb();
- }
- break;
+ if(HW_hlpuart1RxCb)
+ {
+ HW_hlpuart1RxCb();
+ }
+ break;
#endif
default:
@@ -294,20 +292,20 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1TxCb)
- {
- HW_huart1TxCb();
- }
- break;
+ if(HW_huart1TxCb)
+ {
+ HW_huart1TxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1TxCb)
- {
- HW_hlpuart1TxCb();
- }
- break;
+ if(HW_hlpuart1TxCb)
+ {
+ HW_hlpuart1TxCb();
+ }
+ break;
#endif
default:
@@ -317,4 +315,4 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
return;
}
- /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Src/main.c
index 98d1570a0..00e011ffa 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Src/main.c
@@ -164,17 +164,20 @@ void SystemClock_Config(void)
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
+ /** Configure LSE Drive Capability
+ */
+ __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
/** Configure the main internal regulator output voltage
*/
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
/** Initializes the CPU, AHB and APB busses clocks
*/
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSI1
- |RCC_OSCILLATORTYPE_HSE;
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE
+ |RCC_OSCILLATORTYPE_LSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ RCC_OscInitStruct.LSEState = RCC_LSE_ON;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
- RCC_OscInitStruct.LSIState = RCC_LSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
@@ -203,8 +206,8 @@ void SystemClock_Config(void)
|RCC_PERIPHCLK_LPUART1;
PeriphClkInitStruct.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2;
PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1;
- PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI;
- PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSI;
+ PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
+ PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSE;
PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSE;
PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE0;
@@ -351,7 +354,7 @@ static void MX_RTC_Init(void)
hrtc.Instance = RTC;
hrtc.Init.HourFormat = RTC_HOURFORMAT_24;
hrtc.Init.AsynchPrediv = CFG_RTC_ASYNCH_PRESCALER;
- hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER ;
+ hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
hrtc.Init.OutPut = RTC_OUTPUT_DISABLE;
hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH;
hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;
@@ -394,6 +397,7 @@ static void MX_GPIO_Init(void)
{
/* GPIO Ports Clock Enable */
+ __HAL_RCC_GPIOC_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
@@ -406,6 +410,12 @@ void PeriphClock_Config(void)
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -439,30 +449,6 @@ void PeriphClock_Config(void)
HAL_RCCEx_CRSConfig(&RCC_CRSInitStruct);
#endif
- /**
- * Select LSE clock
- */
- LL_RCC_LSE_Enable();
- while(!LL_RCC_LSE_IsReady());
-
- /**
- * Select wakeup source of BLE RF
- */
- LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
-
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
/*************************************************************
@@ -555,6 +541,7 @@ static void Reset_BackupDomain( void )
return;
}
+
static void Init_Exti( void )
{
/**< Disable all wakeup interrupt on CPU1 except IPCC(36), HSEM(38) */
@@ -563,6 +550,40 @@ static void Init_Exti( void )
return;
}
+
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+void HAL_Delay(uint32_t Delay)
+{
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
+
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
+}
/* USER CODE END 4 */
/**
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Src/stm32wbxx_hal_msp.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Src/stm32wbxx_hal_msp.c
index ce0ff57da..9c338486d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Src/stm32wbxx_hal_msp.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Core/Src/stm32wbxx_hal_msp.c
@@ -97,8 +97,6 @@ void HAL_MspInit(void)
HAL_NVIC_SetPriority(FPU_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(FPU_IRQn);
- /* Disable the internal Pull-Up in Dead Battery pins of UCPD peripheral */
-
/* USER CODE BEGIN MspInit 1 */
/* USER CODE END MspInit 1 */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/STM32_WPAN/App/app_thread.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/STM32_WPAN/App/app_thread.c
index 8735b2f96..50b291e6f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/STM32_WPAN/App/app_thread.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/STM32_WPAN/App/app_thread.c
@@ -67,8 +67,9 @@ static void APP_THREAD_CheckWirelessFirmwareInfo(void);
static void APP_THREAD_DeviceConfig(void);
static void APP_THREAD_StateNotif(uint32_t NotifFlags, void *pContext);
static void APP_THREAD_TraceError(const char * pMess, uint32_t ErrCode);
-
+#if (CFG_FULL_LOW_POWER == 0)
static void Send_CLI_To_M0(void);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
static void Send_CLI_Ack_For_OT(void);
static void HostTxCb( void );
static void Wait_Getting_Ack_From_M0(void);
@@ -83,8 +84,10 @@ extern void MX_USART1_UART_Init(void);
#if (CFG_USB_INTERFACE_ENABLE != 0)
static uint32_t ProcessCmdString(uint8_t* buf , uint32_t len);
#else
+#if (CFG_FULL_LOW_POWER == 0)
static void RxCpltCallback(void);
-#endif
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
/* USER CODE BEGIN PFP */
static void APP_THREAD_CoapSendRequest(otCoapResource* pCoapRessource, otCoapType CoapType, otCoapCode CoapCode, const char *Address, uint8_t* Payload, uint16_t Size);
@@ -119,10 +122,14 @@ static uint8_t TmpString[C_SIZE_CMD_STRING];
static uint8_t VcpRxBuffer[sizeof(TL_CmdSerial_t)]; /* Received Data over USB are stored in this buffer */
static uint8_t VcpTxBuffer[sizeof(TL_EvtPacket_t) + 254U]; /* Transmit buffer over USB */
#else
+#if (CFG_FULL_LOW_POWER == 0)
static uint8_t aRxBuffer[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+#if (CFG_FULL_LOW_POWER == 0)
static uint8_t CommandString[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
static __IO uint16_t indexReceiveChar = 0;
static __IO uint16_t CptReceiveCmdFromUser = 0;
@@ -154,7 +161,7 @@ void APP_THREAD_Init( void )
/* USER CODE END APP_THREAD_INIT_1 */
SHCI_CmdStatus_t ThreadInitStatus;
-
+
/* Check the compatibility with the Coprocessor Wireless Firmware loaded */
APP_THREAD_CheckWirelessFirmwareInfo();
@@ -178,7 +185,7 @@ void APP_THREAD_Init( void )
/* Send Thread start system cmd to M0 */
ThreadInitStatus = SHCI_C2_THREAD_Init();
-
+
/* Prevent unused argument(s) compilation warning */
UNUSED(ThreadInitStatus);
@@ -201,11 +208,11 @@ void APP_THREAD_Init( void )
}
/**
- * @brief Trace the error or the warning reported.
- * @param ErrId :
- * @param ErrCode
- * @retval None
- */
+ * @brief Trace the error or the warning reported.
+ * @param ErrId :
+ * @param ErrCode
+ * @retval None
+ */
void APP_THREAD_Error(uint32_t ErrId, uint32_t ErrCode)
{
/* USER CODE BEGIN APP_THREAD_Error_1 */
@@ -390,13 +397,13 @@ static void APP_THREAD_StateNotif(uint32_t NotifFlags, void *pContext)
}
/**
- * @brief Warn the user that an error has occurred.In this case,
- * the LEDs on the Board will start blinking.
- *
- * @param pMess : Message associated to the error.
- * @param ErrCode: Error code associated to the module (OpenThread or other module if any)
- * @retval None
- */
+ * @brief Warn the user that an error has occurred.In this case,
+ * the LEDs on the Board will start blinking.
+ *
+ * @param pMess : Message associated to the error.
+ * @param ErrCode: Error code associated to the module (OpenThread or other module if any)
+ * @retval None
+ */
static void APP_THREAD_TraceError(const char * pMess, uint32_t ErrCode)
{
/* USER CODE BEGIN TRACE_ERROR */
@@ -454,7 +461,6 @@ static void APP_THREAD_CheckWirelessFirmwareInfo(void)
APP_DBG("**********************************************************");
}
}
-
/* USER CODE BEGIN FD_LOCAL_FUNCTIONS */
/**
* @brief Send a CoAP request with defined parameters.
@@ -806,47 +812,47 @@ void TL_THREAD_NotReceived( TL_EvtPacket_t * Notbuffer )
}
/**
- * @brief This function is called before sending any ot command to the M0
- * core. The purpose of this function is to be able to check if
- * there are no notifications coming from the M0 core which are
- * pending before sending a new ot command.
- * @param None
- * @retval None
- */
+ * @brief This function is called before sending any ot command to the M0
+ * core. The purpose of this function is to be able to check if
+ * there are no notifications coming from the M0 core which are
+ * pending before sending a new ot command.
+ * @param None
+ * @retval None
+ */
void Pre_OtCmdProcessing(void)
{
- UTIL_SEQ_WaitEvt( EVENT_SYNCHRO_BYPASS_IDLE);
+ UTIL_SEQ_WaitEvt(EVENT_SYNCHRO_BYPASS_IDLE);
}
/**
- * @brief This function waits for getting an acknowledgment from the M0.
- *
- * @param None
- * @retval None
- */
+ * @brief This function waits for getting an acknowledgment from the M0.
+ *
+ * @param None
+ * @retval None
+ */
static void Wait_Getting_Ack_From_M0(void)
{
UTIL_SEQ_WaitEvt(EVENT_ACK_FROM_M0_EVT);
}
/**
- * @brief Receive an acknowledgment from the M0+ core.
- * Each command send by the M4 to the M0 are acknowledged.
- * This function is called under interrupt.
- * @param None
- * @retval None
- */
+ * @brief Receive an acknowledgment from the M0+ core.
+ * Each command send by the M4 to the M0 are acknowledged.
+ * This function is called under interrupt.
+ * @param None
+ * @retval None
+ */
static void Receive_Ack_From_M0(void)
{
UTIL_SEQ_SetEvt(EVENT_ACK_FROM_M0_EVT);
}
/**
- * @brief Receive a notification from the M0+ through the IPCC.
- * This function is called under interrupt.
- * @param None
- * @retval None
- */
+ * @brief Receive a notification from the M0+ through the IPCC.
+ * This function is called under interrupt.
+ * @param None
+ * @retval None
+ */
static void Receive_Notification_From_M0(void)
{
CptReceiveMsgFromM0++;
@@ -855,6 +861,7 @@ static void Receive_Notification_From_M0(void)
#if (CFG_USB_INTERFACE_ENABLE != 0)
#else
+#if (CFG_FULL_LOW_POWER == 0)
static void RxCpltCallback(void)
{
/* Filling buffer and wait for '\r' char */
@@ -873,6 +880,7 @@ static void RxCpltCallback(void)
/* Once a character has been sent, put back the device in reception mode */
HW_UART_Receive_IT(CFG_CLI_UART, aRxBuffer, 1U, RxCpltCallback);
}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
#if (CFG_USB_INTERFACE_ENABLE != 0)
@@ -915,6 +923,7 @@ static uint32_t ProcessCmdString( uint8_t* buf , uint32_t len )
}
#endif/* (CFG_USB_INTERFACE_ENABLE != 0) */
+#if (CFG_FULL_LOW_POWER == 0)
/**
* @brief Process sends receive CLI command to M0.
* @param None
@@ -934,6 +943,7 @@ static void Send_CLI_To_M0(void)
TL_CLI_SendCmd();
}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
/**
* @brief Send notification for CLI TL Channel.
@@ -954,11 +964,16 @@ static void Send_CLI_Ack_For_OT(void)
*/
void APP_THREAD_Init_UART_CLI(void)
{
+#if (CFG_FULL_LOW_POWER == 0)
UTIL_SEQ_RegTask( 1<<CFG_TASK_SEND_CLI_TO_M0, UTIL_SEQ_RFU,Send_CLI_To_M0);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+
#if (CFG_USB_INTERFACE_ENABLE != 0)
#else
+#if (CFG_FULL_LOW_POWER == 0)
MX_USART1_UART_Init();
HW_UART_Receive_IT(CFG_CLI_UART, aRxBuffer, 1, RxCpltCallback);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Thread_Coap_Generic.ioc b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Thread_Coap_Generic.ioc
index eb0cffdec..0610d91de 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Thread_Coap_Generic.ioc
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic/Thread_Coap_Generic.ioc
@@ -57,26 +57,28 @@ Mcu.IP9=SYS
Mcu.IPNb=12
Mcu.Name=STM32WB55RGVx
Mcu.Package=VFQFPN68
-Mcu.Pin0=PA2
-Mcu.Pin1=PA3
-Mcu.Pin10=VP_SEQUENCER_VS_SEQUENCER
-Mcu.Pin11=VP_STM32_WPAN_VS_THREAD
-Mcu.Pin12=VP_SYS_VS_Systick
-Mcu.Pin13=VP_TINY_LPM_VS_TINY_LPM
-Mcu.Pin2=RF1
-Mcu.Pin3=OSC_OUT
-Mcu.Pin4=OSC_IN
-Mcu.Pin5=PA11
-Mcu.Pin6=PB6
-Mcu.Pin7=PB7
-Mcu.Pin8=VP_HSEM_VS_HSEM
-Mcu.Pin9=VP_RTC_VS_RTC_Activate
-Mcu.PinsNb=14
+Mcu.Pin0=PC14-OSC32_IN
+Mcu.Pin1=PC15-OSC32_OUT
+Mcu.Pin10=VP_HSEM_VS_HSEM
+Mcu.Pin11=VP_RTC_VS_RTC_Activate
+Mcu.Pin12=VP_SEQUENCER_VS_SEQUENCER
+Mcu.Pin13=VP_STM32_WPAN_VS_THREAD
+Mcu.Pin14=VP_SYS_VS_Systick
+Mcu.Pin15=VP_TINY_LPM_VS_TINY_LPM
+Mcu.Pin2=PA2
+Mcu.Pin3=PA3
+Mcu.Pin4=RF1
+Mcu.Pin5=OSC_OUT
+Mcu.Pin6=OSC_IN
+Mcu.Pin7=PA11
+Mcu.Pin8=PB6
+Mcu.Pin9=PB7
+Mcu.PinsNb=16
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32WB55RGVx
-MxCube.Version=5.3.0
-MxDb.Version=DB.5.0.30
+MxCube.Version=5.4.0
+MxDb.Version=DB.5.0.40
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false
NVIC.C2SEV_PWR_C2H_IRQn=true\:0\:0\:false\:false\:true\:true\:false
NVIC.DMA1_Channel1_IRQn=true\:0\:0\:false\:false\:true\:false\:true
@@ -114,6 +116,10 @@ PB6.Signal=USART1_TX
PB7.Locked=true
PB7.Mode=Asynchronous
PB7.Signal=USART1_RX
+PC14-OSC32_IN.Mode=LSE-External-Oscillator
+PC14-OSC32_IN.Signal=RCC_OSC32_IN
+PC15-OSC32_OUT.Mode=LSE-External-Oscillator
+PC15-OSC32_OUT.Signal=RCC_OSC32_OUT
PCC.Ble.ConnectionInterval=1000.0
PCC.Ble.DataLength=6
PCC.Ble.Mode=Advertising
@@ -172,12 +178,12 @@ RCC.HSI48_VALUE=48000000
RCC.HSI_VALUE=16000000
RCC.I2C1Freq_Value=32000000
RCC.I2C3Freq_Value=32000000
-RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSE_VALUE,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1N,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PWRFreq_Value,RNGFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SMPSCLockSelectionVirtual,SMPSFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LCDFreq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1N,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PWRFreq_Value,RFWKPClockSelection,RFWKPFreq_Value,RNGFreq_Value,RTCClockSelection,RTCFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SMPSCLockSelectionVirtual,SMPSFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.LCDFreq_Value=32768
RCC.LPTIM1Freq_Value=32000000
RCC.LPTIM2Freq_Value=32000000
RCC.LPUART1Freq_Value=32000000
RCC.LSCOPinFreq_Value=32000
-RCC.LSE_VALUE=32768
RCC.LSI_VALUE=32000
RCC.MCO1PinFreq_Value=32000000
RCC.PLLPoutputFreq_Value=16000000
@@ -188,7 +194,11 @@ RCC.PLLSAI1PoutputFreq_Value=48000000
RCC.PLLSAI1QoutputFreq_Value=48000000
RCC.PLLSAI1RoutputFreq_Value=48000000
RCC.PWRFreq_Value=32000000
+RCC.RFWKPClockSelection=RCC_RFWKPCLKSOURCE_LSE
+RCC.RFWKPFreq_Value=32768
RCC.RNGFreq_Value=32000
+RCC.RTCClockSelection=RCC_RTCCLKSOURCE_LSE
+RCC.RTCFreq_Value=32768
RCC.SAI1Freq_Value=48000000
RCC.SMPS1Freq_Value=16000000
RCC.SMPSCLockSelectionVirtual=RCC_SMPSCLKSOURCE_HSE
@@ -204,7 +214,7 @@ RF1.Mode=RF1_Activate
RF1.Signal=RF_RF1
RTC.AsynchPrediv=CFG_RTC_ASYNCH_PRESCALER
RTC.IPParameters=AsynchPrediv,SynchPrediv
-RTC.SynchPrediv=CFG_RTC_SYNCH_PRESCALER
+RTC.SynchPrediv=CFG_RTC_SYNCH_PRESCALER
STM32_WPAN.APP_DBG_EN=1
STM32_WPAN.CFG_CLI_UART=hw_uart1
STM32_WPAN.CFG_DBG_TRACE_UART=hw_lpuart1
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/app_common.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/app_common.h
new file mode 100644
index 000000000..47b2867f1
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/app_common.h
@@ -0,0 +1,113 @@
+/**
+ ******************************************************************************
+ * File Name : app_common.h
+ * Description : App Common application configuration file for STM32WPAN Middleware.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_COMMON_H
+#define APP_COMMON_H
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+#include <stdint.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+
+#include "app_conf.h"
+
+ /* -------------------------------- *
+ * Basic definitions *
+ * -------------------------------- */
+
+#undef NULL
+#define NULL 0
+
+#undef FALSE
+#define FALSE 0
+
+#undef TRUE
+#define TRUE (!0)
+
+ /* -------------------------------- *
+ * Critical Section definition *
+ * -------------------------------- */
+#define BACKUP_PRIMASK() uint32_t primask_bit= __get_PRIMASK()
+#define DISABLE_IRQ() __disable_irq()
+#define RESTORE_PRIMASK() __set_PRIMASK(primask_bit)
+
+ /* -------------------------------- *
+ * Macro delimiters *
+ * -------------------------------- */
+
+#define M_BEGIN do {
+
+#define M_END } while(0)
+
+ /* -------------------------------- *
+ * Some useful macro definitions *
+ * -------------------------------- */
+
+#define MAX( x, y ) (((x)>(y))?(x):(y))
+
+#define MIN( x, y ) (((x)<(y))?(x):(y))
+
+#define MODINC( a, m ) M_BEGIN (a)++; if ((a)>=(m)) (a)=0; M_END
+
+#define MODDEC( a, m ) M_BEGIN if ((a)==0) (a)=(m); (a)--; M_END
+
+#define MODADD( a, b, m ) M_BEGIN (a)+=(b); if ((a)>=(m)) (a)-=(m); M_END
+
+#define MODSUB( a, b, m ) MODADD( a, (m)-(b), m )
+
+#define PAUSE( t ) M_BEGIN \
+ __IO int _i; \
+ for ( _i = t; _i > 0; _i -- ); \
+ M_END
+
+#define DIVF( x, y ) ((x)/(y))
+
+#define DIVC( x, y ) (((x)+(y)-1)/(y))
+
+#define DIVR( x, y ) (((x)+((y)/2))/(y))
+
+#define SHRR( x, n ) ((((x)>>((n)-1))+1)>>1)
+
+#define BITN( w, n ) (((w)[(n)/32] >> ((n)%32)) & 1)
+
+#define BITNSET( w, n, b ) M_BEGIN (w)[(n)/32] |= ((U32)(b))<<((n)%32); M_END
+
+ /* -------------------------------- *
+ * Compiler *
+ * -------------------------------- */
+#define PLACE_IN_SECTION( __x__ ) __attribute__((section (__x__)))
+
+#ifdef WIN32
+#define ALIGN(n)
+#else
+#define ALIGN(n) __attribute__((aligned(n)))
+#endif
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /*APP_COMMON_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/app_conf.h
new file mode 100644
index 000000000..4fabbe72b
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/app_conf.h
@@ -0,0 +1,370 @@
+/**
+ ******************************************************************************
+ * File Name : app_conf.h
+ * Description : Application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_CONF_H
+#define APP_CONF_H
+
+#include "hw.h"
+#include "hw_conf.h"
+#include "hw_if.h"
+
+/******************************************************************************
+ * Application Config
+ ******************************************************************************/
+/******************************************************************************
+ * Transport Layer
+ ******************************************************************************/
+/**
+ * Queue length of BLE Event
+ * This parameter defines the number of asynchronous events that can be stored in the HCI layer before
+ * being reported to the application. When a command is sent to the BLE core coprocessor, the HCI layer
+ * is waiting for the event with the Num_HCI_Command_Packets set to 1. The receive queue shall be large
+ * enough to store all asynchronous events received in between.
+ * When CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE is set to 27, this allow to store three 255 bytes long asynchronous events
+ * between the HCI command and its event.
+ * This parameter depends on the value given to CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE. When the queue size is to small,
+ * the system may hang if the queue is full with asynchronous events and the HCI layer is still waiting
+ * for a CC/CS event, In that case, the notification TL_BLE_HCI_ToNot() is called to indicate
+ * to the application a HCI command did not receive its command event within 30s (Default HCI Timeout).
+ */
+#define CFG_TL_EVT_QUEUE_LENGTH 5
+/**
+ * This parameter should be set to fit most events received by the HCI layer. It defines the buffer size of each element
+ * allocated in the queue of received events and can be used to optimize the amount of RAM allocated by the Memory Manager.
+ * It should not exceed 255 which is the maximum HCI packet payload size (a greater value is a lost of memory as it will
+ * never be used)
+ * It shall be at least 4 to receive the command status event in one frame.
+ * The default value is set to 27 to allow receiving an event of MTU size in a single buffer. This value maybe reduced
+ * further depending on the application.
+ *
+ */
+#define CFG_TL_MOST_EVENT_PAYLOAD_SIZE 255 /**< Set to 255 with the memory manager and the mailbox */
+
+#define TL_EVENT_FRAME_SIZE ( TL_EVT_HDR_SIZE + CFG_TL_MOST_EVENT_PAYLOAD_SIZE )
+/******************************************************************************
+ * UART interfaces
+ ******************************************************************************/
+
+/**
+ * Select UART interfaces
+ */
+#define CFG_DEBUG_TRACE_UART hw_lpuart1
+#define CFG_CONSOLE_MENU
+#define CFG_CLI_UART hw_uart1
+/******************************************************************************
+ * USB interface
+ ******************************************************************************/
+
+/**
+ * Enable/Disable USB interface
+ */
+#define CFG_USB_INTERFACE_ENABLE 0
+
+/******************************************************************************
+ * Low Power
+ *
+ * When CFG_FULL_LOW_POWER is set to 1, the system is configured in full
+ * low power mode. It means that all what can have an impact on the consumptions
+ * are powered down.(For instance LED, Access to Debugger, Etc.)
+ *
+ * When CFG_FULL_LOW_POWER is set to 0, the low power mode is not activated
+ *
+ ******************************************************************************/
+
+#define CFG_FULL_LOW_POWER 0
+
+#if (CFG_FULL_LOW_POWER == 1)
+#undef CFG_LPM_SUPPORTED
+#define CFG_LPM_SUPPORTED 1
+#endif /* CFG_FULL_LOW_POWER */
+
+/******************************************************************************
+ * Timer Server
+ ******************************************************************************/
+/**
+ * CFG_RTC_WUCKSEL_DIVIDER: This sets the RTCCLK divider to the wakeup timer.
+ * The higher is the value, the better is the power consumption and the accuracy of the timerserver
+ * The lower is the value, the finest is the granularity
+ *
+ * CFG_RTC_ASYNCH_PRESCALER: This sets the asynchronous prescaler of the RTC. It should as high as possible ( to ouput
+ * clock as low as possible) but the output clock should be equal or higher frequency compare to the clock feeding
+ * the wakeup timer. A lower clock speed would impact the accuracy of the timer server.
+ *
+ * CFG_RTC_SYNCH_PRESCALER: This sets the synchronous prescaler of the RTC.
+ * When the 1Hz calendar clock is required, it shall be sets according to other settings
+ * When the 1Hz calendar clock is not needed, CFG_RTC_SYNCH_PRESCALER should be set to 0x7FFF (MAX VALUE)
+ *
+ * CFG_RTCCLK_DIVIDER_CONF:
+ * Shall be set to either 0,2,4,8,16
+ * When set to either 2,4,8,16, the 1Hhz calendar is supported
+ * When set to 0, the user sets its own configuration
+ *
+ * The following settings are computed with LSI as input to the RTC
+ */
+#define CFG_RTCCLK_DIVIDER_CONF 0
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 0)
+/**
+ * Custom configuration
+ * It does not support 1Hz calendar
+ * It divides the RTC CLK by 16
+ */
+#define CFG_RTCCLK_DIV (16)
+#define CFG_RTC_WUCKSEL_DIVIDER (0)
+#define CFG_RTC_ASYNCH_PRESCALER (CFG_RTCCLK_DIV - 1)
+#define CFG_RTC_SYNCH_PRESCALER (0x7FFF)
+
+#else
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 2)
+/**
+ * It divides the RTC CLK by 2
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (3)
+#endif
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 4)
+/**
+ * It divides the RTC CLK by 4
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (2)
+#endif
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 8)
+/**
+ * It divides the RTC CLK by 8
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (1)
+#endif
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 16)
+/**
+ * It divides the RTC CLK by 16
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (0)
+#endif
+
+#define CFG_RTCCLK_DIV CFG_RTCCLK_DIVIDER_CONF
+#define CFG_RTC_ASYNCH_PRESCALER (CFG_RTCCLK_DIV - 1)
+#define CFG_RTC_SYNCH_PRESCALER (DIVR( LSE_VALUE, (CFG_RTC_ASYNCH_PRESCALER+1) ) - 1 )
+
+#endif
+
+/** tick timer value in us */
+#define CFG_TS_TICK_VAL DIVR( (CFG_RTCCLK_DIV * 1000000), LSE_VALUE )
+
+typedef enum
+{
+ CFG_TIM_PROC_ID_ISR,
+} CFG_TimProcID_t;
+
+/******************************************************************************
+ * Debug
+ ******************************************************************************/
+/**
+ * When set, this resets some hw resources to set the device in the same state than the power up
+ * The FW resets only register that may prevent the FW to run properly
+ *
+ * This shall be set to 0 in a final product
+ *
+ */
+#define CFG_HW_RESET_BY_FW 1
+
+/**
+ * keep debugger enabled while in any low power mode when set to 1
+ * should be set to 0 in production
+ */
+#define CFG_DEBUGGER_SUPPORTED 1
+
+#if (CFG_FULL_LOW_POWER == 1)
+#undef CFG_DEBUGGER_SUPPORTED
+#define CFG_DEBUGGER_SUPPORTED 0
+#endif /* CFG_FULL_LOW_POWER */
+
+/*****************************************************************************
+ * Traces
+ * Enable or Disable traces in application
+ * When CFG_DEBUG_TRACE is set, traces are activated
+ *
+ * Note : Refer to utilities_conf.h file in order to details
+ * the level of traces : CFG_DEBUG_TRACE_FULL or CFG_DEBUG_TRACE_LIGHT
+ *****************************************************************************/
+#define CFG_DEBUG_TRACE 1
+
+#if (CFG_FULL_LOW_POWER == 1)
+#undef CFG_DEBUG_TRACE
+#define CFG_DEBUG_TRACE 0
+#endif /* CFG_FULL_LOW_POWER */
+
+/**
+ * When CFG_DEBUG_TRACE_FULL is set to 1, the trace are output with the API name, the file name and the line number
+ * When CFG_DEBUG_TRACE_LIGHT is set to 1, only the debug message is output
+ *
+ * When both are set to 0, no trace are output
+ * When both are set to 1, CFG_DEBUG_TRACE_FULL is selected
+ */
+#define CFG_DEBUG_TRACE_LIGHT 1
+#define CFG_DEBUG_TRACE_FULL 0
+
+#if (( CFG_DEBUG_TRACE != 0 ) && ( CFG_DEBUG_TRACE_LIGHT == 0 ) && (CFG_DEBUG_TRACE_FULL == 0))
+#undef CFG_DEBUG_TRACE_FULL
+#undef CFG_DEBUG_TRACE_LIGHT
+#define CFG_DEBUG_TRACE_FULL 0
+#define CFG_DEBUG_TRACE_LIGHT 1
+#endif
+
+#if ( CFG_DEBUG_TRACE == 0 )
+#undef CFG_DEBUG_TRACE_FULL
+#undef CFG_DEBUG_TRACE_LIGHT
+#define CFG_DEBUG_TRACE_FULL 0
+#define CFG_DEBUG_TRACE_LIGHT 0
+#endif
+
+/**
+ * When not set, the traces is looping on sending the trace over UART
+ */
+#define DBG_TRACE_USE_CIRCULAR_QUEUE 1
+
+/**
+ * max buffer Size to queue data traces and max data trace allowed.
+ * Only Used if DBG_TRACE_USE_CIRCULAR_QUEUE is defined
+ */
+#define DBG_TRACE_MSG_QUEUE_SIZE 4096
+#define MAX_DBG_TRACE_MSG_SIZE 1024
+
+/******************************************************************************
+ * Configure Log level for Application
+ ******************************************************************************/
+#define APPLI_CONFIG_LOG_LEVEL LOG_LEVEL_INFO
+#define APPLI_PRINT_FILE_FUNC_LINE 0
+
+/* USER CODE BEGIN Defines */
+/******************************************************************************
+ * User interaction
+ * When CFG_LED_SUPPORTED is set, LEDS are activated if requested
+ * When CFG_BUTTON_SUPPORTED is set, the push button are activated if requested
+ ******************************************************************************/
+#if (CFG_FULL_LOW_POWER == 1)
+#define CFG_LED_SUPPORTED 0
+#define CFG_BUTTON_SUPPORTED 0
+#else
+#define CFG_LED_SUPPORTED 1
+#define CFG_BUTTON_SUPPORTED 1
+#endif /* CFG_FULL_LOW_POWER */
+/* USER CODE END Defines */
+
+/******************************************************************************
+ * Scheduler
+ ******************************************************************************/
+ /**
+ * This is the list of task id required by the application
+ * Each Id shall be in the range 0..31
+ */
+
+typedef enum
+{
+ CFG_TASK_MSG_FROM_M0_TO_M4,
+ CFG_TASK_SEND_CLI_TO_M0,
+ CFG_TASK_SYSTEM_HCI_ASYNCH_EVT,
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+ CFG_TASK_VCP_SEND_DATA,
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+ /* USER CODE BEGIN CFG_IdleTask_Id_t */
+ CFG_TASK_COAP_MSG_BUTTON,
+ CFG_TASK_FUOTA_REBOOT,
+ /* USER CODE END CFG_IdleTask_Id_t */
+ CFG_TASK_NBR /**< Shall be last in the list */
+} CFG_IdleTask_Id_t;
+
+/* Scheduler types and defines */
+/*------------------------------------*/
+#define TASK_MSG_FROM_M0_TO_M4 (1U << CFG_TASK_MSG_FROM_M0_TO_M4)
+/* USER CODE BEGIN DEFINE_TASK */
+#define TASK_COAP_MSG_BUTTON (1U << CFG_TASK_COAP_MSG_BUTTON)
+#define TASK_FUOTA_REBOOT (1U << CFG_TASK_FUOTA_REBOOT)
+/* USER CODE END DEFINE_TASK */
+
+
+/**
+ * This is the list of priority required by the application
+ * Each Id shall be in the range 0..31
+ */
+typedef enum
+{
+ CFG_SCH_PRIO_0,
+ CFG_SCH_PRIO_1,
+ CFG_PRIO_NBR,
+} CFG_SCH_Prio_Id_t;
+
+ /**
+ * This is a bit mapping over 32bits listing all events id supported in the application
+ */
+typedef enum
+{
+ CFG_EVT_SYSTEM_HCI_CMD_EVT_RESP,
+ CFG_EVT_ACK_FROM_M0_EVT,
+ CFG_EVT_SYNCHRO_BYPASS_IDLE,
+ /* USER CODE BEGIN CFG_IdleEvt_Id_t */
+ CFG_EVT_TIMER,
+ /* USER CODE END CFG_IdleEvt_Id_t */
+} CFG_IdleEvt_Id_t;
+
+#define EVENT_ACK_FROM_M0_EVT (1U << CFG_EVT_ACK_FROM_M0_EVT)
+#define EVENT_SYNCHRO_BYPASS_IDLE (1U << CFG_EVT_SYNCHRO_BYPASS_IDLE)
+/* USER CODE BEGIN DEFINE_EVENT */
+#define EVENT_TIMER (1U << CFG_EVT_TIMER)
+/* USER CODE END DEFINE_EVENT */
+
+/******************************************************************************
+ * LOW POWER
+ ******************************************************************************/
+/**
+ * Supported requester to the MCU Low Power Manager - can be increased up to 32
+ * It lits a bit mapping of all user of the Low Power Manager
+ */
+typedef enum
+{
+ CFG_LPM_APP,
+ CFG_LPM_APP_THREAD,
+ /* USER CODE BEGIN CFG_LPM_Id_t */
+
+ /* USER CODE END CFG_LPM_Id_t */
+} CFG_LPM_Id_t;
+
+/******************************************************************************
+ * OTP manager
+ ******************************************************************************/
+#define CFG_OTP_BASE_ADDRESS OTP_AREA_BASE
+
+#define CFG_OTP_END_ADRESS OTP_AREA_END_ADDR
+
+/******************************************************************************
+ * FUOTA
+ ******************************************************************************/
+/**
+ * Define list of reboot reason
+ */
+#define CFG_REBOOT_ON_FW_APP (0x00)
+#define CFG_REBOOT_ON_THREAD_OTA_APP (0x01)
+#define CFG_REBOOT_ON_CPU2_UPGRADE (0x02)
+
+#endif /*APP_CONF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/app_entry.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/app_entry.h
new file mode 100644
index 000000000..48c467aaa
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/app_entry.h
@@ -0,0 +1,68 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : app_entry.h
+ * Description : App entry configuration file for STM32WPAN Middleware.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_ENTRY_H
+#define APP_ENTRY_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /* Exported types ------------------------------------------------------------*/
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* Exported variables --------------------------------------------------------*/
+/* USER CODE BEGIN EV */
+
+/* USER CODE END EV */
+
+/* Exported macros ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions ---------------------------------------------*/
+ void APPE_Init( void );
+/* USER CODE BEGIN EF */
+
+/* USER CODE END EF */
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /*APP_ENTRY_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/hw_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/hw_conf.h
new file mode 100644
index 000000000..8409edd16
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/hw_conf.h
@@ -0,0 +1,219 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : hw_conf.h
+ * Description : Hardware configuration file for STM32WPAN Middleware.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_CONF_H
+#define HW_CONF_H
+
+/******************************************************************************
+ * Semaphores
+ * THIS SHALL NO BE CHANGED AS THESE SEMAPHORES ARE USED AS WELL ON THE CM0+
+ *****************************************************************************/
+/* Index of the semaphore used to manage the entry Stop Mode procedure */
+#define CFG_HW_ENTRY_STOP_MODE_SEMID 4
+
+/* Index of the semaphore used to access the RCC */
+#define CFG_HW_RCC_SEMID 3
+
+/* Index of the semaphore used to access the FLASH */
+#define CFG_HW_FLASH_SEMID 2
+
+/* Index of the semaphore used to access the PKA */
+#define CFG_HW_PKA_SEMID 1
+
+/* Index of the semaphore used to access the RNG */
+#define CFG_HW_RNG_SEMID 0
+
+/******************************************************************************
+ * HW TIMER SERVER
+ *****************************************************************************/
+/**
+ * The user may define the maximum number of virtual timers supported.
+ * It shall not exceed 255
+ */
+#define CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER 6
+
+/**
+ * The user may define the priority in the NVIC of the RTC_WKUP interrupt handler that is used to manage the
+ * wakeup timer.
+ * This setting is the preemptpriority part of the NVIC.
+ */
+#define CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO 3
+
+/**
+ * The user may define the priority in the NVIC of the RTC_WKUP interrupt handler that is used to manage the
+ * wakeup timer.
+ * This setting is the subpriority part of the NVIC. It does not exist on all processors. When it is not supported
+ * on the CPU, the setting is ignored
+ */
+#define CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO 0
+
+/**
+ * Define a critical section in the Timer server
+ * The Timer server does not support the API to be nested
+ * The Application shall either:
+ * a) Ensure this will never happen
+ * b) Define the critical section
+ * The default implementations is masking all interrupts using the PRIMASK bit
+ * The TimerServer driver uses critical sections to avoid context corruption. This is achieved with the macro
+ * TIMER_ENTER_CRITICAL_SECTION and TIMER_EXIT_CRITICAL_SECTION. When CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION is set
+ * to 1, all STM32 interrupts are masked with the PRIMASK bit of the CortexM CPU. It is possible to use the BASEPRI
+ * register of the CortexM CPU to keep allowed some interrupts with high priority. In that case, the user shall
+ * re-implement TIMER_ENTER_CRITICAL_SECTION and TIMER_EXIT_CRITICAL_SECTION and shall make sure that no TimerServer
+ * API are called when the TIMER critical section is entered
+ */
+#define CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION 1
+
+/**
+ * This value shall reflect the maximum delay there could be in the application between the time the RTC interrupt
+ * is generated by the Hardware and the time when the RTC interrupt handler is called. This time is measured in
+ * number of RTCCLK ticks.
+ * A relaxed timing would be 10ms
+ * When the value is too short, the timerserver will not be able to count properly and all timeout may be random.
+ * When the value is too long, the device may wake up more often than the most optimal configuration. However, the
+ * impact on power consumption would be marginal (unless the value selected is extremely too long). It is strongly
+ * recommended to select a value large enough to make sure it is not too short to ensure reliability of the system
+ * as this will have marginal impact on low power mode
+ */
+#define CFG_HW_TS_RTC_HANDLER_MAX_DELAY ( 10 * (LSI_VALUE/1000) )
+
+ /**
+ * Interrupt ID in the NVIC of the RTC Wakeup interrupt handler
+ * It shall be type of IRQn_Type
+ */
+#define CFG_HW_TS_RTC_WAKEUP_HANDLER_ID RTC_WKUP_IRQn
+
+/******************************************************************************
+ * HW UART
+ *****************************************************************************/
+
+#define CFG_HW_LPUART1_ENABLED 1
+#define CFG_HW_LPUART1_DMA_TX_SUPPORTED 1
+
+#define CFG_HW_USART1_ENABLED 1
+#define CFG_HW_USART1_DMA_TX_SUPPORTED 1
+
+/**
+ * LPUART1
+ */
+#define CFG_HW_LPUART1_PREEMPTPRIORITY 0x0F
+#define CFG_HW_LPUART1_SUBPRIORITY 0
+
+/** < The application shall check the selected source clock is enable */
+#define CFG_HW_LPUART1_SOURCE_CLOCK RCC_LPUART1CLKSOURCE_SYSCLK
+
+#define CFG_HW_LPUART1_BAUDRATE 115200
+#define CFG_HW_LPUART1_WORDLENGTH UART_WORDLENGTH_8B
+#define CFG_HW_LPUART1_STOPBITS UART_STOPBITS_1
+#define CFG_HW_LPUART1_PARITY UART_PARITY_NONE
+#define CFG_HW_LPUART1_HWFLOWCTL UART_HWCONTROL_NONE
+#define CFG_HW_LPUART1_MODE UART_MODE_TX_RX
+#define CFG_HW_LPUART1_ADVFEATUREINIT UART_ADVFEATURE_NO_INIT
+#define CFG_HW_LPUART1_OVERSAMPLING UART_OVERSAMPLING_8
+
+#define CFG_HW_LPUART1_TX_PORT_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE
+#define CFG_HW_LPUART1_TX_PORT GPIOA
+#define CFG_HW_LPUART1_TX_PIN GPIO_PIN_2
+#define CFG_HW_LPUART1_TX_MODE GPIO_MODE_AF_PP
+#define CFG_HW_LPUART1_TX_PULL GPIO_NOPULL
+#define CFG_HW_LPUART1_TX_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_LPUART1_TX_ALTERNATE GPIO_AF8_LPUART1
+
+#define CFG_HW_LPUART1_RX_PORT_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE
+#define CFG_HW_LPUART1_RX_PORT GPIOA
+#define CFG_HW_LPUART1_RX_PIN GPIO_PIN_3
+#define CFG_HW_LPUART1_RX_MODE GPIO_MODE_AF_PP
+#define CFG_HW_LPUART1_RX_PULL GPIO_NOPULL
+#define CFG_HW_LPUART1_RX_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_LPUART1_RX_ALTERNATE GPIO_AF8_LPUART1
+
+#define CFG_HW_LPUART1_CTS_PORT_CLK_ENABLE __HAL_RCC_GPIOvalueNotSetted_CLK_ENABLE
+#define CFG_HW_LPUART1_CTS_PORT GPIOvalueNotSetted
+#define CFG_HW_LPUART1_CTS_PIN GPIO_PIN_valueNotSetted
+#define CFG_HW_LPUART1_CTS_MODE GPIO_MODE_AF_PP
+#define CFG_HW_LPUART1_CTS_PULL GPIO_PULLDOWN
+#define CFG_HW_LPUART1_CTS_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_LPUART1_CTS_ALTERNATE GPIO_AFvalueNotSetted_LPUART1
+
+#define CFG_HW_LPUART1_DMA_TX_PREEMPTPRIORITY 0x0F
+#define CFG_HW_LPUART1_DMA_TX_SUBPRIORITY 0
+
+#define CFG_HW_LPUART1_DMAMUX_CLK_ENABLE __HAL_RCC_DMAMUX1_CLK_ENABLE
+#define CFG_HW_LPUART1_DMA_CLK_ENABLE __HAL_RCC_DMA1_CLK_ENABLE
+#define CFG_HW_LPUART1_TX_DMA_REQ DMA_REQUEST_LPUART1_TX
+#define CFG_HW_LPUART1_TX_DMA_CHANNEL DMA1_CHANNEL_1
+#define CFG_HW_LPUART1_TX_DMA_IRQn DMA1_CHANNEL_1_IRQn
+#define CFG_HW_LPUART1_DMA_TX_IRQHandler DMA1_CHANNEL_1_IRQHandler
+
+/**
+ * UART1
+ */
+#define CFG_HW_USART1_PREEMPTPRIORITY 0x0F
+#define CFG_HW_USART1_SUBPRIORITY 0
+
+/** < The application shall check the selected source clock is enable */
+#define CFG_HW_USART1_SOURCE_CLOCK RCC_USART1CLKSOURCE_SYSCLK
+
+#define CFG_HW_USART1_BAUDRATE 115200
+#define CFG_HW_USART1_WORDLENGTH UART_WORDLENGTH_8B
+#define CFG_HW_USART1_STOPBITS UART_STOPBITS_1
+#define CFG_HW_USART1_PARITY UART_PARITY_NONE
+#define CFG_HW_USART1_HWFLOWCTL UART_HWCONTROL_NONE
+#define CFG_HW_USART1_MODE UART_MODE_TX_RX
+#define CFG_HW_USART1_ADVFEATUREINIT UART_ADVFEATURE_NO_INIT
+#define CFG_HW_USART1_OVERSAMPLING UART_OVERSAMPLING_8
+
+#define CFG_HW_USART1_TX_PORT_CLK_ENABLE __HAL_RCC_GPIOB_CLK_ENABLE
+#define CFG_HW_USART1_TX_PORT GPIOB
+#define CFG_HW_USART1_TX_PIN GPIO_PIN_6
+#define CFG_HW_USART1_TX_MODE GPIO_MODE_AF_PP
+#define CFG_HW_USART1_TX_PULL GPIO_NOPULL
+#define CFG_HW_USART1_TX_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_USART1_TX_ALTERNATE GPIO_AF7_USART1
+
+#define CFG_HW_USART1_RX_PORT_CLK_ENABLE __HAL_RCC_GPIOB_CLK_ENABLE
+#define CFG_HW_USART1_RX_PORT GPIOB
+#define CFG_HW_USART1_RX_PIN GPIO_PIN_7
+#define CFG_HW_USART1_RX_MODE GPIO_MODE_AF_PP
+#define CFG_HW_USART1_RX_PULL GPIO_NOPULL
+#define CFG_HW_USART1_RX_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_USART1_RX_ALTERNATE GPIO_AF7_USART1
+
+#define CFG_HW_USART1_CTS_PORT_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE
+#define CFG_HW_USART1_CTS_PORT GPIOA
+#define CFG_HW_USART1_CTS_PIN GPIO_PIN_11
+#define CFG_HW_USART1_CTS_MODE GPIO_MODE_AF_PP
+#define CFG_HW_USART1_CTS_PULL GPIO_PULLDOWN
+#define CFG_HW_USART1_CTS_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_USART1_CTS_ALTERNATE GPIO_AF7_USART1
+
+#define CFG_HW_USART1_DMA_TX_PREEMPTPRIORITY 0x0F
+#define CFG_HW_USART1_DMA_TX_SUBPRIORITY 0
+
+#define CFG_HW_USART1_DMAMUX_CLK_ENABLE __HAL_RCC_DMAMUX1_CLK_ENABLE
+#define CFG_HW_USART1_DMA_CLK_ENABLE __HAL_RCC_DMA1_CLK_ENABLE
+#define CFG_HW_USART1_TX_DMA_REQ DMA_REQUEST_USART1_TX
+#define CFG_HW_USART1_TX_DMA_CHANNEL DMA1_CHANNEL_2
+#define CFG_HW_USART1_TX_DMA_IRQn DMA1_CHANNEL_2_IRQn
+#define CFG_HW_USART1_DMA_TX_IRQHandler DMA1_CHANNEL_2_IRQHandler
+
+#endif /*HW_CONF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/main.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/main.h
new file mode 100644
index 000000000..68182bc5a
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/main.h
@@ -0,0 +1,71 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file : main.h
+ * @brief : Header for main.c file.
+ * This file contains the common defines of the application.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __MAIN_H
+#define __MAIN_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx_hal.h"
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Exported types ------------------------------------------------------------*/
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* Exported macro ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions prototypes ---------------------------------------------*/
+void Error_Handler(void);
+
+/* USER CODE BEGIN EFP */
+
+/* USER CODE END EFP */
+
+/* Private defines -----------------------------------------------------------*/
+/* USER CODE BEGIN Private defines */
+
+/* USER CODE END Private defines */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MAIN_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/stm32_lpm_if.h
new file mode 100644
index 000000000..70abecaa9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/stm32_lpm_if.h
@@ -0,0 +1,81 @@
+/* USER CODE BEGIN Header */
+/**
+******************************************************************************
+* @file stm32_lpm_if.h
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
+******************************************************************************
+* @attention
+*
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+* All rights reserved.</center></h2>
+*
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+*
+******************************************************************************
+*/
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32_LPM_IF_H
+#define __STM32_LPM_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+
+/**
+ * @brief Enters Low Power Off Mode
+ * @param none
+ * @retval none
+ */
+void PWR_EnterOffMode( void );
+/**
+ * @brief Exits Low Power Off Mode
+ * @param none
+ * @retval none
+ */
+void PWR_ExitOffMode( void );
+
+/**
+ * @brief Enters Low Power Stop Mode
+ * @note ARM exists the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_EnterStopMode( void );
+/**
+ * @brief Exits Low Power Stop Mode
+ * @note Enable the pll at 32MHz
+ * @param none
+ * @retval none
+ */
+void PWR_ExitStopMode( void );
+
+/**
+ * @brief Enters Low Power Sleep Mode
+ * @note ARM exits the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_EnterSleepMode( void );
+
+/**
+ * @brief Exits Low Power Sleep Mode
+ * @note ARM exits the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_ExitSleepMode( void );
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*__STM32_LPM_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/stm32wbxx_hal_conf.h
new file mode 100644
index 000000000..ea9aa40d0
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/stm32wbxx_hal_conf.h
@@ -0,0 +1,353 @@
+/**
+ ******************************************************************************
+ * @file stm32wbxx_hal_conf.h
+ * @author MCD Application Team
+ * @brief HAL configuration file.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32WBxx_HAL_CONF_H
+#define __STM32WBxx_HAL_CONF_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/* Exported types ------------------------------------------------------------*/
+/* Exported constants --------------------------------------------------------*/
+
+/* ########################## Module Selection ############################## */
+/**
+ * @brief This is the list of modules to be used in the HAL driver
+ */
+#define HAL_MODULE_ENABLED
+/*#define HAL_ADC_MODULE_ENABLED */
+/*#define HAL_CRYP_MODULE_ENABLED */
+/*#define HAL_COMP_MODULE_ENABLED */
+/*#define HAL_CRC_MODULE_ENABLED */
+#define HAL_HSEM_MODULE_ENABLED
+/*#define HAL_I2C_MODULE_ENABLED */
+/*#define HAL_IPCC_MODULE_ENABLED */
+/*#define HAL_IRDA_MODULE_ENABLED */
+/*#define HAL_IWDG_MODULE_ENABLED */
+/*#define HAL_LCD_MODULE_ENABLED */
+/*#define HAL_LPTIM_MODULE_ENABLED */
+/*#define HAL_PCD_MODULE_ENABLED */
+/*#define HAL_PKA_MODULE_ENABLED */
+/*#define HAL_QSPI_MODULE_ENABLED */
+/*#define HAL_RNG_MODULE_ENABLED */
+#define HAL_RTC_MODULE_ENABLED
+/*#define HAL_SAI_MODULE_ENABLED */
+/*#define HAL_SMBUS_MODULE_ENABLED */
+/*#define HAL_SMARTCARD_MODULE_ENABLED */
+/*#define HAL_SPI_MODULE_ENABLED */
+/*#define HAL_TIM_MODULE_ENABLED */
+/*#define HAL_TSC_MODULE_ENABLED */
+#define HAL_UART_MODULE_ENABLED
+/*#define HAL_USART_MODULE_ENABLED */
+/*#define HAL_WWDG_MODULE_ENABLED */
+#define HAL_EXTI_MODULE_ENABLED
+#define HAL_CORTEX_MODULE_ENABLED
+#define HAL_DMA_MODULE_ENABLED
+#define HAL_FLASH_MODULE_ENABLED
+#define HAL_GPIO_MODULE_ENABLED
+#define HAL_PWR_MODULE_ENABLED
+#define HAL_RCC_MODULE_ENABLED
+
+#define USE_HAL_ADC_REGISTER_CALLBACKS 0u
+#define USE_HAL_COMP_REGISTER_CALLBACKS 0u
+#define USE_HAL_CRYP_REGISTER_CALLBACKS 0u
+#define USE_HAL_I2C_REGISTER_CALLBACKS 0u
+#define USE_HAL_IRDA_REGISTER_CALLBACKS 0u
+#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0u
+#define USE_HAL_PCD_REGISTER_CALLBACKS 0u
+#define USE_HAL_PKA_REGISTER_CALLBACKS 0u
+#define USE_HAL_QSPI_REGISTER_CALLBACKS 0u
+#define USE_HAL_RNG_REGISTER_CALLBACKS 0u
+#define USE_HAL_RTC_REGISTER_CALLBACKS 0u
+#define USE_HAL_SAI_REGISTER_CALLBACKS 0u
+#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0u
+#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0u
+#define USE_HAL_SPI_REGISTER_CALLBACKS 0u
+#define USE_HAL_TIM_REGISTER_CALLBACKS 0u
+#define USE_HAL_TSC_REGISTER_CALLBACKS 0u
+#define USE_HAL_UART_REGISTER_CALLBACKS 0u
+#define USE_HAL_USART_REGISTER_CALLBACKS 0u
+#define USE_HAL_WWDG_REGISTER_CALLBACKS 0u
+
+/* ########################## Oscillator Values adaptation ####################*/
+/**
+ * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
+ * This value is used by the RCC HAL module to compute the system frequency
+ * (when HSE is used as system clock source, directly or through the PLL).
+ */
+#if !defined (HSE_VALUE)
+#define HSE_VALUE 32000000U /*!< Value of the External oscillator in Hz */
+#endif /* HSE_VALUE */
+
+#if !defined (HSE_STARTUP_TIMEOUT)
+ #define HSE_STARTUP_TIMEOUT ((uint32_t)100) /*!< Time out for HSE start up, in ms */
+#endif /* HSE_STARTUP_TIMEOUT */
+
+/**
+ * @brief Internal Multiple Speed oscillator (MSI) default value.
+ * This value is the default MSI range value after Reset.
+ */
+#if !defined (MSI_VALUE)
+ #define MSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/
+#endif /* MSI_VALUE */
+
+/**
+ * @brief Internal High Speed oscillator (HSI) value.
+ * This value is used by the RCC HAL module to compute the system frequency
+ * (when HSI is used as system clock source, directly or through the PLL).
+ */
+#if !defined (HSI_VALUE)
+#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/
+#endif /* HSI_VALUE */
+
+/**
+ * @brief Internal Low Speed oscillator (LSI1) value.
+ */
+#if !defined (LSI1_VALUE)
+ #define LSI1_VALUE ((uint32_t)32000) /*!< LSI1 Typical Value in Hz*/
+#endif /* LSI1_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
+ The real value may vary depending on the variations
+ in voltage and temperature.*/
+/**
+ * @brief Internal Low Speed oscillator (LSI2) value.
+ */
+#if !defined (LSI2_VALUE)
+ #define LSI2_VALUE ((uint32_t)32000) /*!< LSI2 Typical Value in Hz*/
+#endif /* LSI2_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
+ The real value may vary depending on the variations
+ in voltage and temperature.*/
+
+/**
+ * @brief External Low Speed oscillator (LSE) value.
+ * This value is used by the UART, RTC HAL module to compute the system frequency
+ */
+#if !defined (LSE_VALUE)
+#define LSE_VALUE 32768U /*!< Value of the External oscillator in Hz*/
+#endif /* LSE_VALUE */
+
+/**
+ * @brief Internal Multiple Speed oscillator (HSI48) default value.
+ * This value is the default HSI48 range value after Reset.
+ */
+#if !defined (HSI48_VALUE)
+ #define HSI48_VALUE ((uint32_t)48000000) /*!< Value of the Internal oscillator in Hz*/
+#endif /* HSI48_VALUE */
+
+#if !defined (LSE_STARTUP_TIMEOUT)
+#define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */
+#endif /* HSE_STARTUP_TIMEOUT */
+
+/**
+ * @brief External clock source for SAI1 peripheral
+ * This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source
+ * frequency.
+ */
+#if !defined (EXTERNAL_SAI1_CLOCK_VALUE)
+ #define EXTERNAL_SAI1_CLOCK_VALUE ((uint32_t)2097000) /*!< Value of the SAI1 External clock source in Hz*/
+#endif /* EXTERNAL_SAI1_CLOCK_VALUE */
+
+/* Tip: To avoid modifying this file each time you need to use different HSE,
+ === you can define the HSE value in your toolchain compiler preprocessor. */
+
+/* ########################### System Configuration ######################### */
+/**
+ * @brief This is the HAL system configuration section
+ */
+
+#define VDD_VALUE 3300U /*!< Value of VDD in mv */
+#define TICK_INT_PRIORITY 0U /*!< tick interrupt priority */
+#define USE_RTOS 0U
+#define PREFETCH_ENABLE 1U
+#define INSTRUCTION_CACHE_ENABLE 1U
+#define DATA_CACHE_ENABLE 1U
+
+/* ########################## Assert Selection ############################## */
+/**
+ * @brief Uncomment the line below to expanse the "assert_param" macro in the
+ * HAL drivers code
+ */
+/* #define USE_FULL_ASSERT 1U */
+
+/* ################## SPI peripheral configuration ########################## */
+
+/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
+ * Activated: CRC code is present inside driver
+ * Deactivated: CRC code cleaned from driver
+ */
+
+#define USE_SPI_CRC 0U
+
+/* Includes ------------------------------------------------------------------*/
+/**
+ * @brief Include module's header file
+ */
+#ifdef HAL_DMA_MODULE_ENABLED
+ #include "stm32wbxx_hal_dma.h"
+#endif /* HAL_DMA_MODULE_ENABLED */
+
+#ifdef HAL_ADC_MODULE_ENABLED
+ #include "stm32wbxx_hal_adc.h"
+#endif /* HAL_ADC_MODULE_ENABLED */
+
+#ifdef HAL_COMP_MODULE_ENABLED
+ #include "stm32wbxx_hal_comp.h"
+#endif /* HAL_COMP_MODULE_ENABLED */
+
+#ifdef HAL_CORTEX_MODULE_ENABLED
+ #include "stm32wbxx_hal_cortex.h"
+#endif /* HAL_CORTEX_MODULE_ENABLED */
+
+#ifdef HAL_CRC_MODULE_ENABLED
+ #include "stm32wbxx_hal_crc.h"
+#endif /* HAL_CRC_MODULE_ENABLED */
+
+#ifdef HAL_CRYP_MODULE_ENABLED
+ #include "stm32wbxx_hal_cryp.h"
+#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
+
+#ifdef HAL_FLASH_MODULE_ENABLED
+ #include "stm32wbxx_hal_flash.h"
+#endif /* HAL_FLASH_MODULE_ENABLED */
+
+#ifdef HAL_GPIO_MODULE_ENABLED
+ #include "stm32wbxx_hal_gpio.h"
+#endif /* HAL_GPIO_MODULE_ENABLED */
+
+#ifdef HAL_HSEM_MODULE_ENABLED
+ #include "stm32wbxx_hal_hsem.h"
+#endif /* HAL_HSEM_MODULE_ENABLED */
+
+#ifdef HAL_I2C_MODULE_ENABLED
+ #include "stm32wbxx_hal_i2c.h"
+#endif /* HAL_I2C_MODULE_ENABLED */
+
+#ifdef HAL_IPCC_MODULE_ENABLED
+ #include "stm32wbxx_hal_ipcc.h"
+#endif /* HAL_IPCC_MODULE_ENABLED */
+
+#ifdef HAL_IRDA_MODULE_ENABLED
+ #include "stm32wbxx_hal_irda.h"
+#endif /* HAL_IRDA_MODULE_ENABLED */
+
+#ifdef HAL_IWDG_MODULE_ENABLED
+ #include "stm32wbxx_hal_iwdg.h"
+#endif /* HAL_IWDG_MODULE_ENABLED */
+
+#ifdef HAL_LCD_MODULE_ENABLED
+ #include "stm32wbxx_hal_lcd.h"
+#endif /* HAL_LCD_MODULE_ENABLED */
+
+#ifdef HAL_LPTIM_MODULE_ENABLED
+ #include "stm32wbxx_hal_lptim.h"
+#endif /* HAL_LPTIM_MODULE_ENABLED */
+
+#ifdef HAL_PCD_MODULE_ENABLED
+ #include "stm32wbxx_hal_pcd.h"
+#endif /* HAL_PCD_MODULE_ENABLED */
+
+#ifdef HAL_PKA_MODULE_ENABLED
+ #include "stm32wbxx_hal_pka.h"
+#endif /* HAL_PKA_MODULE_ENABLED */
+
+#ifdef HAL_PWR_MODULE_ENABLED
+ #include "stm32wbxx_hal_pwr.h"
+#endif /* HAL_PWR_MODULE_ENABLED */
+
+#ifdef HAL_QSPI_MODULE_ENABLED
+ #include "stm32wbxx_hal_qspi.h"
+#endif /* HAL_QSPI_MODULE_ENABLED */
+
+#ifdef HAL_RCC_MODULE_ENABLED
+ #include "stm32wbxx_hal_rcc.h"
+#endif /* HAL_RCC_MODULE_ENABLED */
+
+#ifdef HAL_RNG_MODULE_ENABLED
+ #include "stm32wbxx_hal_rng.h"
+#endif /* HAL_RNG_MODULE_ENABLED */
+
+#ifdef HAL_RTC_MODULE_ENABLED
+ #include "stm32wbxx_hal_rtc.h"
+#endif /* HAL_RTC_MODULE_ENABLED */
+
+#ifdef HAL_SAI_MODULE_ENABLED
+ #include "stm32wbxx_hal_sai.h"
+#endif /* HAL_SAI_MODULE_ENABLED */
+
+#ifdef HAL_SMARTCARD_MODULE_ENABLED
+ #include "stm32wbxx_hal_smartcard.h"
+#endif /* HAL_SMARTCARD_MODULE_ENABLED */
+
+#ifdef HAL_SMBUS_MODULE_ENABLED
+ #include "stm32wbxx_hal_smbus.h"
+#endif /* HAL_SMBUS_MODULE_ENABLED */
+
+#ifdef HAL_SPI_MODULE_ENABLED
+ #include "stm32wbxx_hal_spi.h"
+#endif /* HAL_SPI_MODULE_ENABLED */
+
+#ifdef HAL_TIM_MODULE_ENABLED
+ #include "stm32wbxx_hal_tim.h"
+#endif /* HAL_TIM_MODULE_ENABLED */
+
+#ifdef HAL_TSC_MODULE_ENABLED
+ #include "stm32wbxx_hal_tsc.h"
+#endif /* HAL_TSC_MODULE_ENABLED */
+
+#ifdef HAL_UART_MODULE_ENABLED
+ #include "stm32wbxx_hal_uart.h"
+#endif /* HAL_UART_MODULE_ENABLED */
+
+#ifdef HAL_USART_MODULE_ENABLED
+ #include "stm32wbxx_hal_usart.h"
+#endif /* HAL_USART_MODULE_ENABLED */
+
+#ifdef HAL_WWDG_MODULE_ENABLED
+ #include "stm32wbxx_hal_wwdg.h"
+#endif /* HAL_WWDG_MODULE_ENABLED */
+
+/* Exported macro ------------------------------------------------------------*/
+#ifdef USE_FULL_ASSERT
+/**
+ * @brief The assert_param macro is used for function's parameters check.
+ * @param expr If expr is false, it calls assert_failed function
+ * which reports the name of the source file and the source
+ * line number of the call that failed.
+ * If expr is true, it returns no value.
+ * @retval None
+ */
+ #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
+/* Exported functions ------------------------------------------------------- */
+ void assert_failed(uint8_t* file, uint32_t line);
+#else
+ #define assert_param(expr) ((void)0U)
+#endif /* USE_FULL_ASSERT */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __STM32WBxx_HAL_CONF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/stm32wbxx_it.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/stm32wbxx_it.h
new file mode 100644
index 000000000..a3a535f13
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/stm32wbxx_it.h
@@ -0,0 +1,83 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file stm32wbxx_it.h
+ * @brief This file contains the headers of the interrupt handlers.
+ *******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32WBxx_IT_H
+#define __STM32WBxx_IT_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+#include "app_common.h"
+/* USER CODE END Includes */
+
+/* Exported types ------------------------------------------------------------*/
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* Exported macro ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions prototypes ---------------------------------------------*/
+void NMI_Handler(void);
+void HardFault_Handler(void);
+void MemManage_Handler(void);
+void BusFault_Handler(void);
+void UsageFault_Handler(void);
+void SVC_Handler(void);
+void DebugMon_Handler(void);
+void PendSV_Handler(void);
+void SysTick_Handler(void);
+void PVD_PVM_IRQHandler(void);
+void FLASH_IRQHandler(void);
+void RCC_IRQHandler(void);
+void DMA1_Channel1_IRQHandler(void);
+void DMA1_Channel2_IRQHandler(void);
+void C2SEV_PWR_C2H_IRQHandler(void);
+void USART1_IRQHandler(void);
+void LPUART1_IRQHandler(void);
+void PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler(void);
+void HSEM_IRQHandler(void);
+void FPU_IRQHandler(void);
+/* USER CODE BEGIN EFP */
+void RTC_WKUP_IRQHandler(void);
+void EXTI4_IRQHandler(void);
+void IPCC_C1_TX_IRQHandler(void);
+void IPCC_C1_RX_IRQHandler(void);
+/* USER CODE END EFP */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __STM32WBxx_IT_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/stm_logging.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/stm_logging.h
new file mode 100644
index 000000000..75bacdffe
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/stm_logging.h
@@ -0,0 +1,59 @@
+/**
+ ******************************************************************************
+ * File Name : stm_logging.h
+ * Description : Application header file for logging
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+#ifndef STM_LOGGING_H_
+#define STM_LOGGING_H_
+
+#define LOG_LEVEL_NONE 0 /* None */
+#define LOG_LEVEL_CRIT 1U /* Critical */
+#define LOG_LEVEL_WARN 2U /* Warning */
+#define LOG_LEVEL_INFO 3U /* Info */
+#define LOG_LEVEL_DEBG 4U /* Debug */
+
+#define APP_DBG_FULL(level, region, ...) \
+ if (APPLI_PRINT_FILE_FUNC_LINE == 1U) \
+ { \
+ printf("\r\n[%s][%s][%d] ", DbgTraceGetFileName(__FILE__),__FUNCTION__,__LINE__); \
+ } \
+ logApplication(level, region, __VA_ARGS__);
+
+#define APP_DBG(...) \
+ if (APPLI_PRINT_FILE_FUNC_LINE == 1U) \
+ { \
+ printf("\r\n[%s][%s][%d] ", DbgTraceGetFileName(__FILE__),__FUNCTION__,__LINE__); \
+ } \
+ logApplication(LOG_LEVEL_NONE, APPLI_LOG_REGION_GENERAL, __VA_ARGS__);
+
+/**
+ * This enumeration represents log regions.
+ *
+ */
+typedef enum
+{
+ APPLI_LOG_REGION_GENERAL = 1U, /* General */
+ APPLI_LOG_REGION_OPENTHREAD_API = 2U, /* OpenThread API */
+ APPLI_LOG_REGION_OT_API_LINK = 3U, /* OpenThread Link API */
+ APPLI_LOG_REGION_OT_API_INSTANCE = 4U, /* OpenThread Instance API */
+ APPLI_LOG_REGION_OT_API_MESSAGE = 5U /* OpenThread Message API */
+} appliLogRegion_t;
+
+typedef uint8_t appliLogLevel_t;
+
+void logApplication(appliLogLevel_t aLogLevel, appliLogRegion_t aLogRegion, const char *aFormat, ...);
+
+#endif /* STM_LOGGING_H_ */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/utilities_conf.h
new file mode 100644
index 000000000..4dde3509a
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Inc/utilities_conf.h
@@ -0,0 +1,68 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : utilities_conf.h
+ * Description : Configuration file for STM32 Utilities.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef UTILITIES_CONF_H
+#define UTILITIES_CONF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "cmsis_compiler.h"
+#include "string.h"
+
+/******************************************************************************
+ * common
+ ******************************************************************************/
+#define UTILS_ENTER_CRITICAL_SECTION( ) uint32_t primask_bit = __get_PRIMASK( );\
+ __disable_irq( )
+
+#define UTILS_EXIT_CRITICAL_SECTION( ) __set_PRIMASK( primask_bit )
+
+#define UTILS_MEMSET8( dest, value, size ) memset( dest, value, size);
+
+/******************************************************************************
+ * tiny low power manager
+ * (any macro that does not need to be modified can be removed)
+ ******************************************************************************/
+#define UTIL_LPM_INIT_CRITICAL_SECTION( )
+#define UTIL_LPM_ENTER_CRITICAL_SECTION( ) UTILS_ENTER_CRITICAL_SECTION( )
+#define UTIL_LPM_EXIT_CRITICAL_SECTION( ) UTILS_EXIT_CRITICAL_SECTION( )
+
+/******************************************************************************
+ * sequencer
+ * (any macro that does not need to be modified can be removed)
+ ******************************************************************************/
+#define UTIL_SEQ_INIT_CRITICAL_SECTION( )
+#define UTIL_SEQ_ENTER_CRITICAL_SECTION( ) UTILS_ENTER_CRITICAL_SECTION( )
+#define UTIL_SEQ_EXIT_CRITICAL_SECTION( ) UTILS_EXIT_CRITICAL_SECTION( )
+#define UTIL_SEQ_CONF_TASK_NBR (32)
+#define UTIL_SEQ_CONF_PRIO_NBR (2)
+#define UTIL_SEQ_MEMSET8( dest, value, size ) UTILS_MEMSET8( dest, value, size )
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*UTILITIES_CONF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/app_entry.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/app_entry.c
new file mode 100644
index 000000000..83d04ef83
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/app_entry.c
@@ -0,0 +1,449 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : app_entry.c
+ * Description : Entry application source file for STM32WPAN Middleware.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "main.h"
+#include "app_entry.h"
+#include "app_thread.h"
+#include "app_conf.h"
+#include "hw_conf.h"
+#include "stm32_seq.h"
+#include "stm_logging.h"
+#include "shci_tl.h"
+#include "stm32_lpm.h"
+#include "dbg_trace.h"
+#include "shci.h"
+
+/* Private includes -----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+extern RTC_HandleTypeDef hrtc;
+/* USER CODE BEGIN PTD */
+
+/* USER CODE END PTD */
+
+/* Private defines -----------------------------------------------------------*/
+/* POOL_SIZE = 2(TL_PacketHeader_t) + 258 (3(TL_EVT_HDR_SIZE) + 255(Payload size)) */
+#define POOL_SIZE (CFG_TL_EVT_QUEUE_LENGTH * 4U * DIVC(( sizeof(TL_PacketHeader_t) + TL_EVENT_FRAME_SIZE ), 4U))
+
+/* USER CODE BEGIN PD */
+#define CFG_LED_SUPPORTED 1
+#define CFG_BUTTON_SUPPORTED 1
+/* USER CODE END PD */
+
+/* Private macros ------------------------------------------------------------*/
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private variables ---------------------------------------------------------*/
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t EvtPool[POOL_SIZE];
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static TL_CmdPacket_t SystemCmdBuffer;
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t SystemSpareEvtBuffer[sizeof(TL_PacketHeader_t) + TL_EVT_HDR_SIZE + 255U];
+
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Global function prototypes -----------------------------------------------*/
+size_t DbgTraceWrite(int handle, const unsigned char * buf, size_t bufSize);
+
+/* USER CODE BEGIN GFP */
+
+/* USER CODE END GFP */
+
+/* Private functions prototypes-----------------------------------------------*/
+static void SystemPower_Config( void );
+static void Init_Debug( void );
+static void appe_Tl_Init( void );
+static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status );
+static void APPE_SysUserEvtRx( void * pPayload );
+static void APPE_SysEvtReadyProcessing( void );
+static void APPE_SysEvtError( SCHI_SystemErrCode_t ErrorCode);
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+extern void MX_LPUART1_UART_Init(void);
+#endif
+#if (CFG_HW_USART1_ENABLED == 1)
+extern void MX_USART1_UART_Init(void);
+#endif
+
+/* USER CODE BEGIN PFP */
+static void Led_Init( void );
+static void Button_Init( void );
+/* USER CODE END PFP */
+
+/* Functions Definition ------------------------------------------------------*/
+void APPE_Init( void )
+{
+ SystemPower_Config(); /**< Configure the system Power Mode */
+
+ HW_TS_Init(hw_ts_InitMode_Full, &hrtc); /**< Initialize the TimerServer */
+
+/* USER CODE BEGIN APPE_Init_1 */
+ Init_Debug();
+
+ UTIL_LPM_SetOffMode(1 << CFG_LPM_APP, UTIL_LPM_DISABLE);
+ Led_Init();
+ Button_Init();
+/* USER CODE END APPE_Init_1 */
+ appe_Tl_Init(); /* Initialize all transport layers */
+
+ /**
+ * From now, the application is waiting for the ready event ( VS_HCI_C2_Ready )
+ * received on the system channel before starting the Stack
+ * This system event is received with APPE_SysUserEvtRx()
+ */
+/* USER CODE BEGIN APPE_Init_2 */
+
+/* USER CODE END APPE_Init_2 */
+ return;
+}
+/* USER CODE BEGIN FD */
+
+/* USER CODE END FD */
+
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+static void Init_Debug( void )
+{
+#if (CFG_DEBUGGER_SUPPORTED == 1)
+ /**
+ * Keep debugger enabled while in any low power mode
+ */
+ HAL_DBGMCU_EnableDBGSleepMode();
+
+ /***************** ENABLE DEBUGGER *************************************/
+ LL_EXTI_EnableIT_32_63(LL_EXTI_LINE_48);
+ LL_C2_EXTI_EnableIT_32_63(LL_EXTI_LINE_48);
+
+#else
+
+ GPIO_InitTypeDef gpio_config = {0};
+
+ gpio_config.Pull = GPIO_NOPULL;
+ gpio_config.Mode = GPIO_MODE_ANALOG;
+
+ gpio_config.Pin = GPIO_PIN_15 | GPIO_PIN_14 | GPIO_PIN_13;
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ HAL_GPIO_Init(GPIOA, &gpio_config);
+ __HAL_RCC_GPIOA_CLK_DISABLE();
+
+ gpio_config.Pin = GPIO_PIN_4 | GPIO_PIN_3;
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+ HAL_GPIO_Init(GPIOB, &gpio_config);
+ __HAL_RCC_GPIOB_CLK_DISABLE();
+
+ HAL_DBGMCU_DisableDBGSleepMode();
+ HAL_DBGMCU_DisableDBGStopMode();
+ HAL_DBGMCU_DisableDBGStandbyMode();
+
+#endif /* (CFG_DEBUGGER_SUPPORTED == 1) */
+
+#if(CFG_DEBUG_TRACE != 0)
+ DbgTraceInit();
+#endif
+
+ return;
+}
+
+/**
+ * @brief Configure the system for power optimization
+ *
+ * @note This API configures the system to be ready for low power mode
+ *
+ * @param None
+ * @retval None
+ */
+static void SystemPower_Config( void )
+{
+
+ /**
+ * Select HSI as system clock source after Wake Up from Stop mode
+ */
+ LL_RCC_SetClkAfterWakeFromStop(LL_RCC_STOP_WAKEUPCLOCK_HSI);
+
+ /* Initialize low power manager */
+ UTIL_LPM_Init( );
+
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+ /**
+ * Enable USB power
+ */
+ HAL_PWREx_EnableVddUSB();
+#endif
+
+ return;
+}
+
+static void appe_Tl_Init( void )
+{
+ TL_MM_Config_t tl_mm_config;
+ SHCI_TL_HciInitConf_t SHci_Tl_Init_Conf;
+ /**< Reference table initialization */
+ TL_Init();
+
+ /**< System channel initialization */
+ UTIL_SEQ_RegTask( 1<< CFG_TASK_SYSTEM_HCI_ASYNCH_EVT, UTIL_SEQ_RFU, shci_user_evt_proc );
+ SHci_Tl_Init_Conf.p_cmdbuffer = (uint8_t*)&SystemCmdBuffer;
+ SHci_Tl_Init_Conf.StatusNotCallBack = APPE_SysStatusNot;
+ shci_init(APPE_SysUserEvtRx, (void*) &SHci_Tl_Init_Conf);
+
+ /**< Memory Manager channel initialization */
+ tl_mm_config.p_BleSpareEvtBuffer = 0;
+ tl_mm_config.p_SystemSpareEvtBuffer = SystemSpareEvtBuffer;
+ tl_mm_config.p_AsynchEvtPool = EvtPool;
+ tl_mm_config.AsynchEvtPoolSize = POOL_SIZE;
+ TL_MM_Init( &tl_mm_config );
+
+ TL_Enable();
+
+ return;
+}
+
+static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status )
+{
+ UNUSED(status);
+ return;
+}
+
+/**
+ * @brief Trap a notification coming from the M0 firmware
+ * @param pPayload : payload associated to the notification
+ *
+ * @retval None
+ */
+
+static void APPE_SysUserEvtRx( void * pPayload )
+{
+ TL_AsynchEvt_t *p_sys_event;
+ p_sys_event = (TL_AsynchEvt_t*)(((tSHCI_UserEvtRxParam*)pPayload)->pckt->evtserial.evt.payload);
+
+ switch(p_sys_event->subevtcode)
+ {
+ case SHCI_SUB_EVT_CODE_READY:
+ APPE_SysEvtReadyProcessing();
+ break;
+ case SHCI_SUB_EVT_ERROR_NOTIF:
+ APPE_SysEvtError((SCHI_SystemErrCode_t) (p_sys_event->payload[0]));
+ break;
+ default:
+ break;
+ }
+ return;
+}
+
+/**
+ * @brief Notify a system error coming from the M0 firmware
+ * @param ErrorCode : errorCode detected by the M0 firmware
+ *
+ * @retval None
+ */
+static void APPE_SysEvtError( SCHI_SystemErrCode_t ErrorCode)
+{
+ switch(ErrorCode)
+ {
+ case ERR_THREAD_LLD_FATAL_ERROR:
+ APP_DBG("** ERR_THREAD : LLD_FATAL_ERROR \n");
+ break;
+ case ERR_THREAD_UNKNOWN_CMD:
+ APP_DBG("** ERR_THREAD : UNKNOWN_CMD \n");
+ break;
+ default:
+ APP_DBG("** ERR_THREAD : ErroCode=%d \n",ErrorCode);
+ break;
+ }
+ return;
+}
+
+static void APPE_SysEvtReadyProcessing( void )
+{
+ /* Traces channel initialization */
+ TL_TRACES_Init( );
+
+ APP_THREAD_Init();
+ UTIL_LPM_SetOffMode(1U << CFG_LPM_APP, UTIL_LPM_ENABLE);
+ return;
+}
+
+/* USER CODE BEGIN FD_LOCAL_FUNCTIONS */
+static void Led_Init( void )
+{
+#if (CFG_LED_SUPPORTED == 1U)
+ /**
+ * Leds Initialization
+ */
+
+ BSP_LED_Init(LED_BLUE);
+ BSP_LED_Init(LED_GREEN);
+ BSP_LED_Init(LED_RED);
+
+#endif
+
+ return;
+}
+
+static void Button_Init( void )
+{
+#if (CFG_BUTTON_SUPPORTED == 1U)
+ /**
+ * Button Initialization
+ */
+
+ BSP_PB_Init(BUTTON_SW1, BUTTON_MODE_EXTI);
+ BSP_PB_Init(BUTTON_SW3, BUTTON_MODE_EXTI);
+#endif
+
+ return;
+}
+/* USER CODE END FD_LOCAL_FUNCTIONS */
+
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+
+void UTIL_SEQ_Idle( void )
+{
+#if ( CFG_LPM_SUPPORTED == 1)
+ UTIL_LPM_EnterLowPower( );
+#endif
+ return;
+}
+
+/**
+ * @brief This function is called by the scheduler each time an event
+ * is pending.
+ *
+ * @param evt_waited_bm : Event pending.
+ * @retval None
+ */
+void UTIL_SEQ_EvtIdle( UTIL_SEQ_bm_t task_id_bm, UTIL_SEQ_bm_t evt_waited_bm )
+{
+ switch(evt_waited_bm)
+ {
+ case EVENT_ACK_FROM_M0_EVT:
+ /* Does not allow other tasks when waiting for OT Cmd response */
+ UTIL_SEQ_Run(0);
+ break;
+ case EVENT_SYNCHRO_BYPASS_IDLE:
+ UTIL_SEQ_SetEvt(EVENT_SYNCHRO_BYPASS_IDLE);
+ /* Run only the task CFG_TASK_MSG_FROM_M0_TO_M4 */
+ UTIL_SEQ_Run(TASK_MSG_FROM_M0_TO_M4);
+ break;
+ default :
+ /* default case */
+ UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
+ break;
+ }
+}
+
+void shci_notify_asynch_evt(void* pdata)
+{
+ UNUSED(pdata);
+ UTIL_SEQ_SetTask(1U << CFG_TASK_SYSTEM_HCI_ASYNCH_EVT, CFG_SCH_PRIO_0);
+ return;
+}
+
+void shci_cmd_resp_release(uint32_t flag)
+{
+ UNUSED(flag);
+ UTIL_SEQ_SetEvt(1U << CFG_EVT_SYSTEM_HCI_CMD_EVT_RESP);
+ return;
+}
+
+void shci_cmd_resp_wait(uint32_t timeout)
+{
+ UNUSED(timeout);
+ UTIL_SEQ_WaitEvt(1U << CFG_EVT_SYSTEM_HCI_CMD_EVT_RESP);
+ return;
+}
+
+/* Received trace buffer from M0 */
+void TL_TRACES_EvtReceived( TL_EvtPacket_t * hcievt )
+{
+#if(CFG_DEBUG_TRACE != 0)
+ /* Call write/print function using DMA from dbg_trace */
+ /* - Cast to TL_AsynchEvt_t* to get "real" payload (without Sub Evt code 2bytes),
+ - (-2) to size to remove Sub Evt Code */
+ DbgTraceWrite(1U, (const unsigned char *) ((TL_AsynchEvt_t *)(hcievt->evtserial.evt.payload))->payload, hcievt->evtserial.evt.plen - 2U);
+#endif /* CFG_DEBUG_TRACE */
+ /* Release buffer */
+ TL_MM_EvtDone( hcievt );
+}
+/**
+ * @brief Initialisation of the trace mechanism
+ * @param None
+ * @retval None
+ */
+#if(CFG_DEBUG_TRACE != 0)
+void DbgOutputInit( void )
+{
+ MX_LPUART1_UART_Init();
+
+ return;
+}
+
+/**
+ * @brief Management of the traces
+ * @param p_data : data
+ * @param size : size
+ * @param call-back :
+ * @retval None
+ */
+void DbgOutputTraces( uint8_t *p_data, uint16_t size, void (*cb)(void) )
+{
+ HW_UART_Transmit_DMA(CFG_DEBUG_TRACE_UART, p_data, size, cb);
+
+ return;
+}
+#endif
+
+/* USER CODE BEGIN FD_WRAP_FUNCTIONS */
+/**
+ * @brief This function manage the Push button action
+ * @param GPIO_Pin : GPIO pin which has been activated
+ * @retval None
+ */
+void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
+{
+ APP_DBG("*** HAL_GPIO_EXTI_Callback GPIO_Pin = %d ****", GPIO_Pin);
+ switch(GPIO_Pin)
+ {
+ case BUTTON_SW1_PIN:
+ UTIL_SEQ_SetTask(TASK_COAP_MSG_BUTTON,CFG_SCH_PRIO_1);
+ break;
+ case BUTTON_SW3_PIN:
+ UTIL_SEQ_SetTask(TASK_FUOTA_REBOOT,CFG_SCH_PRIO_1);
+ break;
+ default:
+ break;
+ }
+}
+/* USER CODE END FD_WRAP_FUNCTIONS */
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/hw_timerserver.c
new file mode 100644
index 000000000..c842ba55e
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/hw_timerserver.c
@@ -0,0 +1,893 @@
+/**
+ ******************************************************************************
+ * File Name : hw_timerserver.c
+ * Description : Hardware timerserver source file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "hw_conf.h"
+
+/* Private typedef -----------------------------------------------------------*/
+typedef enum
+{
+ TimerID_Free,
+ TimerID_Created,
+ TimerID_Running
+}TimerIDStatus_t;
+
+typedef enum
+{
+ SSR_Read_Requested,
+ SSR_Read_Not_Requested
+}RequestReadSSR_t;
+
+typedef enum
+{
+ WakeupTimerValue_Overpassed,
+ WakeupTimerValue_LargeEnough
+}WakeupTimerLimitation_Status_t;
+
+typedef struct
+{
+ HW_TS_pTimerCb_t pTimerCallBack;
+ uint32_t CounterInit;
+ uint32_t CountLeft;
+ TimerIDStatus_t TimerIDStatus;
+ HW_TS_Mode_t TimerMode;
+ uint32_t TimerProcessID;
+ uint8_t PreviousID;
+ uint8_t NextID;
+}TimerContext_t;
+
+/* Private defines -----------------------------------------------------------*/
+#define SSR_FORBIDDEN_VALUE 0xFFFFFFFF
+#define TIMER_LIST_EMPTY 0xFFFF
+
+/* Private macros ------------------------------------------------------------*/
+/* Private variables ---------------------------------------------------------*/
+
+/**
+ * START of Section TIMERSERVER_CONTEXT
+ */
+
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile TimerContext_t aTimerContext[CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER];
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile uint8_t CurrentRunningTimerID;
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile uint8_t PreviousRunningTimerID;
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile uint32_t SSRValueOnLastSetup;
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile WakeupTimerLimitation_Status_t WakeupTimerLimitation;
+
+/**
+ * END of Section TIMERSERVER_CONTEXT
+ */
+
+static RTC_HandleTypeDef *phrtc; /**< RTC handle */
+static uint8_t WakeupTimerDivider;
+static uint8_t AsynchPrescalerUserConfig;
+static uint16_t SynchPrescalerUserConfig;
+static volatile uint16_t MaxWakeupTimerSetup;
+
+/* Global variables ----------------------------------------------------------*/
+/* Private function prototypes -----------------------------------------------*/
+static void RestartWakeupCounter(uint16_t Value);
+static uint16_t ReturnTimeElapsed(void);
+static void RescheduleTimerList(void);
+static void UnlinkTimer(uint8_t TimerID, RequestReadSSR_t RequestReadSSR);
+static void LinkTimerBefore(uint8_t TimerID, uint8_t RefTimerID);
+static void LinkTimerAfter(uint8_t TimerID, uint8_t RefTimerID);
+static uint16_t linkTimer(uint8_t TimerID);
+static uint32_t ReadRtcSsrValue(void);
+
+__weak void HW_TS_RTC_CountUpdated_AppNot(void);
+
+/* Functions Definition ------------------------------------------------------*/
+
+/**
+ * @brief Read the RTC_SSR value
+ * As described in the reference manual, the RTC_SSR shall be read twice to ensure
+ * reliability of the value
+ * @param None
+ * @retval SSR value read
+ */
+static uint32_t ReadRtcSsrValue(void)
+{
+ uint32_t first_read;
+ uint32_t second_read;
+
+ first_read = (uint32_t)(READ_BIT(RTC->SSR, RTC_SSR_SS));
+
+ second_read = (uint32_t)(READ_BIT(RTC->SSR, RTC_SSR_SS));
+
+ while(first_read != second_read)
+ {
+ first_read = second_read;
+
+ second_read = (uint32_t)(READ_BIT(RTC->SSR, RTC_SSR_SS));
+ }
+
+ return second_read;
+}
+
+/**
+ * @brief Insert a Timer in the list after the Timer ID specified
+ * @param TimerID: The ID of the Timer
+ * @param RefTimerID: The ID of the Timer to be linked after
+ * @retval None
+ */
+static void LinkTimerAfter(uint8_t TimerID, uint8_t RefTimerID)
+{
+ uint8_t next_id;
+
+ next_id = aTimerContext[RefTimerID].NextID;
+
+ if(next_id != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ aTimerContext[next_id].PreviousID = TimerID;
+ }
+ aTimerContext[TimerID].NextID = next_id;
+ aTimerContext[TimerID].PreviousID = RefTimerID ;
+ aTimerContext[RefTimerID].NextID = TimerID;
+
+ return;
+}
+
+/**
+ * @brief Insert a Timer in the list before the ID specified
+ * @param TimerID: The ID of the Timer
+ * @param RefTimerID: The ID of the Timer to be linked before
+ * @retval None
+ */
+static void LinkTimerBefore(uint8_t TimerID, uint8_t RefTimerID)
+{
+ uint8_t previous_id;
+
+ if(RefTimerID != CurrentRunningTimerID)
+ {
+ previous_id = aTimerContext[RefTimerID].PreviousID;
+
+ aTimerContext[previous_id].NextID = TimerID;
+ aTimerContext[TimerID].NextID = RefTimerID;
+ aTimerContext[TimerID].PreviousID = previous_id ;
+ aTimerContext[RefTimerID].PreviousID = TimerID;
+ }
+ else
+ {
+ aTimerContext[TimerID].NextID = RefTimerID;
+ aTimerContext[RefTimerID].PreviousID = TimerID;
+ }
+
+ return;
+}
+
+/**
+ * @brief Insert a Timer in the list
+ * @param TimerID: The ID of the Timer
+ * @retval None
+ */
+static uint16_t linkTimer(uint8_t TimerID)
+{
+ uint32_t time_left;
+ uint16_t time_elapsed;
+ uint8_t timer_id_lookup;
+ uint8_t next_id;
+
+ if(CurrentRunningTimerID == CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ /**
+ * No timer in the list
+ */
+ PreviousRunningTimerID = CurrentRunningTimerID;
+ CurrentRunningTimerID = TimerID;
+ aTimerContext[TimerID].NextID = CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER;
+
+ SSRValueOnLastSetup = SSR_FORBIDDEN_VALUE;
+ time_elapsed = 0;
+ }
+ else
+ {
+ time_elapsed = ReturnTimeElapsed();
+
+ /**
+ * update count of the timer to be linked
+ */
+ aTimerContext[TimerID].CountLeft += time_elapsed;
+ time_left = aTimerContext[TimerID].CountLeft;
+
+ /**
+ * Search for index where the new timer shall be linked
+ */
+ if(aTimerContext[CurrentRunningTimerID].CountLeft <= time_left)
+ {
+ /**
+ * Search for the ID after the first one
+ */
+ timer_id_lookup = CurrentRunningTimerID;
+ next_id = aTimerContext[timer_id_lookup].NextID;
+ while((next_id != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) && (aTimerContext[next_id].CountLeft <= time_left))
+ {
+ timer_id_lookup = aTimerContext[timer_id_lookup].NextID;
+ next_id = aTimerContext[timer_id_lookup].NextID;
+ }
+
+ /**
+ * Link after the ID
+ */
+ LinkTimerAfter(TimerID, timer_id_lookup);
+ }
+ else
+ {
+ /**
+ * Link before the first ID
+ */
+ LinkTimerBefore(TimerID, CurrentRunningTimerID);
+ PreviousRunningTimerID = CurrentRunningTimerID;
+ CurrentRunningTimerID = TimerID;
+ }
+ }
+
+ return time_elapsed;
+}
+
+/**
+ * @brief Remove a Timer from the list
+ * @param TimerID: The ID of the Timer
+ * @param RequestReadSSR: Request to read the SSR register or not
+ * @retval None
+ */
+static void UnlinkTimer(uint8_t TimerID, RequestReadSSR_t RequestReadSSR)
+{
+ uint8_t previous_id;
+ uint8_t next_id;
+
+ if(TimerID == CurrentRunningTimerID)
+ {
+ PreviousRunningTimerID = CurrentRunningTimerID;
+ CurrentRunningTimerID = aTimerContext[TimerID].NextID;
+ }
+ else
+ {
+ previous_id = aTimerContext[TimerID].PreviousID;
+ next_id = aTimerContext[TimerID].NextID;
+
+ aTimerContext[previous_id].NextID = aTimerContext[TimerID].NextID;
+ if(next_id != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ aTimerContext[next_id].PreviousID = aTimerContext[TimerID].PreviousID;
+ }
+ }
+
+ /**
+ * Timer is out of the list
+ */
+ aTimerContext[TimerID].TimerIDStatus = TimerID_Created;
+
+ if((CurrentRunningTimerID == CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) && (RequestReadSSR == SSR_Read_Requested))
+ {
+ SSRValueOnLastSetup = SSR_FORBIDDEN_VALUE;
+ }
+
+ return;
+}
+
+/**
+ * @brief Return the number of ticks counted by the wakeuptimer since it has been started
+ * @note The API is reading the SSR register to get how many ticks have been counted
+ * since the time the timer has been started
+ * @param None
+ * @retval Time expired in Ticks
+ */
+static uint16_t ReturnTimeElapsed(void)
+{
+ uint32_t return_value;
+ uint32_t wrap_counter;
+
+ if(SSRValueOnLastSetup != SSR_FORBIDDEN_VALUE)
+ {
+ return_value = ReadRtcSsrValue(); /**< Read SSR register first */
+
+ if (SSRValueOnLastSetup >= return_value)
+ {
+ return_value = SSRValueOnLastSetup - return_value;
+ }
+ else
+ {
+ wrap_counter = SynchPrescalerUserConfig - return_value;
+ return_value = SSRValueOnLastSetup + wrap_counter;
+ }
+
+ /**
+ * At this stage, ReturnValue holds the number of ticks counted by SSR
+ * Need to translate in number of ticks counted by the Wakeuptimer
+ */
+ return_value = return_value*AsynchPrescalerUserConfig;
+ return_value = return_value >> WakeupTimerDivider;
+ }
+ else
+ {
+ return_value = 0;
+ }
+
+ return (uint16_t)return_value;
+}
+
+/**
+ * @brief Set the wakeup counter
+ * @note The API is writing the counter value so that the value is decreased by one to cope with the fact
+ * the interrupt is generated with 1 extra clock cycle (See RefManuel)
+ * It assumes all condition are met to be allowed to write the wakeup counter
+ * @param Value: Value to be written in the counter
+ * @retval None
+ */
+static void RestartWakeupCounter(uint16_t Value)
+{
+ /**
+ * The wakeuptimer has been disabled in the calling function to reduce the time to poll the WUTWF
+ * FLAG when the new value will have to be written
+ * __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc);
+ */
+
+ if(Value == 0)
+ {
+ SSRValueOnLastSetup = ReadRtcSsrValue();
+
+ /**
+ * Simulate that the Timer expired
+ */
+ HAL_NVIC_SetPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID);
+ }
+ else
+ {
+ if((Value > 1) ||(WakeupTimerDivider != 1))
+ {
+ Value -= 1;
+ }
+
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == RESET);
+
+ /**
+ * make sure to clear the flags after checking the WUTWF.
+ * It takes 2 RTCCLK between the time the WUTE bit is disabled and the
+ * time the timer is disabled. The WUTWF bit somehow guarantee the system is stable
+ * Otherwise, when the timer is periodic with 1 Tick, it may generate an extra interrupt in between
+ * due to the autoreload feature
+ */
+ __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */
+ __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */
+ HAL_NVIC_ClearPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Clear pending bit in NVIC */
+
+ MODIFY_REG(RTC->WUTR, RTC_WUTR_WUT, Value);
+
+ /**
+ * Update the value here after the WUTWF polling that may take some time
+ */
+ SSRValueOnLastSetup = ReadRtcSsrValue();
+
+ __HAL_RTC_WAKEUPTIMER_ENABLE(phrtc); /**< Enable the Wakeup Timer */
+
+ HW_TS_RTC_CountUpdated_AppNot();
+ }
+
+ return ;
+}
+
+/**
+ * @brief Reschedule the list of timer
+ * @note 1) Update the count left for each timer in the list
+ * 2) Setup the wakeuptimer
+ * @param None
+ * @retval None
+ */
+static void RescheduleTimerList(void)
+{
+ uint8_t localTimerID;
+ uint32_t timecountleft;
+ uint16_t wakeup_timer_value;
+ uint16_t time_elapsed;
+
+ /**
+ * The wakeuptimer is disabled now to reduce the time to poll the WUTWF
+ * FLAG when the new value will have to be written
+ */
+ if((READ_BIT(RTC->CR, RTC_CR_WUTE) == (RTC_CR_WUTE)) == SET)
+ {
+ /**
+ * Wait for the flag to be back to 0 when the wakeup timer is enabled
+ */
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == SET);
+ }
+ __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc); /**< Disable the Wakeup Timer */
+
+ localTimerID = CurrentRunningTimerID;
+
+ /**
+ * Calculate what will be the value to write in the wakeuptimer
+ */
+ timecountleft = aTimerContext[localTimerID].CountLeft;
+
+ /**
+ * Read how much has been counted
+ */
+ time_elapsed = ReturnTimeElapsed();
+
+ if(timecountleft < time_elapsed )
+ {
+ /**
+ * There is no tick left to count
+ */
+ wakeup_timer_value = 0;
+ WakeupTimerLimitation = WakeupTimerValue_LargeEnough;
+ }
+ else
+ {
+ if(timecountleft > (time_elapsed + MaxWakeupTimerSetup))
+ {
+ /**
+ * The number of tick left is greater than the Wakeuptimer maximum value
+ */
+ wakeup_timer_value = MaxWakeupTimerSetup;
+
+ WakeupTimerLimitation = WakeupTimerValue_Overpassed;
+ }
+ else
+ {
+ wakeup_timer_value = timecountleft - time_elapsed;
+ WakeupTimerLimitation = WakeupTimerValue_LargeEnough;
+ }
+
+ }
+
+ /**
+ * update ticks left to be counted for each timer
+ */
+ while(localTimerID != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ if (aTimerContext[localTimerID].CountLeft < time_elapsed)
+ {
+ aTimerContext[localTimerID].CountLeft = 0;
+ }
+ else
+ {
+ aTimerContext[localTimerID].CountLeft -= time_elapsed;
+ }
+ localTimerID = aTimerContext[localTimerID].NextID;
+ }
+
+ /**
+ * Write next count
+ */
+ RestartWakeupCounter(wakeup_timer_value);
+
+ return ;
+}
+
+/* Public functions ----------------------------------------------------------*/
+
+/**
+ * For all public interface except that may need write access to the RTC, the RTC
+ * shall be unlock at the beginning and locked at the output
+ * In order to ease maintainability, the unlock is done at the top and the lock at then end
+ * in case some new implementation is coming in the future
+ */
+
+void HW_TS_RTC_Wakeup_Handler(void)
+{
+ HW_TS_pTimerCb_t ptimer_callback;
+ uint32_t timer_process_id;
+ uint8_t local_current_running_timer_id;
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ uint32_t primask_bit;
+#endif
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+#endif
+
+/* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+
+ /**
+ * Disable the Wakeup Timer
+ * This may speed up a bit the processing to wait the timer to be disabled
+ * The timer is still counting 2 RTCCLK
+ */
+ __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc);
+
+ local_current_running_timer_id = CurrentRunningTimerID;
+
+ if(aTimerContext[local_current_running_timer_id].TimerIDStatus == TimerID_Running)
+ {
+ ptimer_callback = aTimerContext[local_current_running_timer_id].pTimerCallBack;
+ timer_process_id = aTimerContext[local_current_running_timer_id].TimerProcessID;
+
+ /**
+ * It should be good to check whether the TimeElapsed is greater or not than the tick left to be counted
+ * However, due to the inaccuracy of the reading of the time elapsed, it may return there is 1 tick
+ * to be left whereas the count is over
+ * A more secure implementation has been done with a flag to state whereas the full count has been written
+ * in the wakeuptimer or not
+ */
+ if(WakeupTimerLimitation != WakeupTimerValue_Overpassed)
+ {
+ if(aTimerContext[local_current_running_timer_id].TimerMode == hw_ts_Repeated)
+ {
+ UnlinkTimer(local_current_running_timer_id, SSR_Read_Not_Requested);
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+ HW_TS_Start(local_current_running_timer_id, aTimerContext[local_current_running_timer_id].CounterInit);
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+ }
+ else
+ {
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+ HW_TS_Stop(local_current_running_timer_id);
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+ }
+
+ HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
+ }
+ else
+ {
+ RescheduleTimerList();
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+ }
+ }
+ else
+ {
+ /**
+ * We should never end up in this case
+ * However, if due to any bug in the timer server this is the case, the mistake may not impact the user.
+ * We could just clean the interrupt flag and get out from this unexpected interrupt
+ */
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == RESET);
+
+ /**
+ * make sure to clear the flags after checking the WUTWF.
+ * It takes 2 RTCCLK between the time the WUTE bit is disabled and the
+ * time the timer is disabled. The WUTWF bit somehow guarantee the system is stable
+ * Otherwise, when the timer is periodic with 1 Tick, it may generate an extra interrupt in between
+ * due to the autoreload feature
+ */
+ __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */
+ __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+ }
+
+ /* Enable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_ENABLE( phrtc );
+
+ return;
+}
+
+void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
+{
+ uint8_t loop;
+ uint32_t localmaxwakeuptimersetup;
+
+ /**
+ * Get RTC handler
+ */
+ phrtc = hrtc;
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+
+ SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
+
+ /**
+ * Readout the user config
+ */
+ WakeupTimerDivider = (4 - ((uint32_t)(READ_BIT(RTC->CR, RTC_CR_WUCKSEL))));
+
+ AsynchPrescalerUserConfig = (uint8_t)(READ_BIT(RTC->PRER, RTC_PRER_PREDIV_A) >> (uint32_t)POSITION_VAL(RTC_PRER_PREDIV_A)) + 1;
+
+ SynchPrescalerUserConfig = (uint16_t)(READ_BIT(RTC->PRER, RTC_PRER_PREDIV_S)) + 1;
+
+ /**
+ * Margin is taken to avoid wrong calculation when the wrap around is there and some
+ * application interrupts may have delayed the reading
+ */
+ localmaxwakeuptimersetup = ((((SynchPrescalerUserConfig - 1)*AsynchPrescalerUserConfig) - CFG_HW_TS_RTC_HANDLER_MAX_DELAY) >> WakeupTimerDivider);
+
+ if(localmaxwakeuptimersetup >= 0xFFFF)
+ {
+ MaxWakeupTimerSetup = 0xFFFF;
+ }
+ else
+ {
+ MaxWakeupTimerSetup = (uint16_t)localmaxwakeuptimersetup;
+ }
+
+ /**
+ * Configure EXTI module
+ */
+ LL_EXTI_EnableRisingTrig_0_31(RTC_EXTI_LINE_WAKEUPTIMER_EVENT);
+ LL_EXTI_EnableIT_0_31(RTC_EXTI_LINE_WAKEUPTIMER_EVENT);
+
+ if(TimerInitMode == hw_ts_InitMode_Full)
+ {
+ WakeupTimerLimitation = WakeupTimerValue_LargeEnough;
+ SSRValueOnLastSetup = SSR_FORBIDDEN_VALUE;
+
+ /**
+ * Initialize the timer server
+ */
+ for(loop = 0; loop < CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER; loop++)
+ {
+ aTimerContext[loop].TimerIDStatus = TimerID_Free;
+ }
+
+ CurrentRunningTimerID = CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER; /**< Set ID to non valid value */
+
+ __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc); /**< Disable the Wakeup Timer */
+ __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */
+ __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */
+ HAL_NVIC_ClearPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Clear pending bit in NVIC */
+ __HAL_RTC_WAKEUPTIMER_ENABLE_IT(phrtc, RTC_IT_WUT); /**< Enable interrupt in RTC module */
+ }
+ else
+ {
+ if(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTF) != RESET)
+ {
+ /**
+ * Simulate that the Timer expired
+ */
+ HAL_NVIC_SetPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID);
+ }
+ }
+
+ /* Enable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_ENABLE( phrtc );
+
+ HAL_NVIC_SetPriority(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID, CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO, CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO); /**< Set NVIC priority */
+ HAL_NVIC_EnableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Enable NVIC */
+
+ return;
+}
+
+HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pftimeout_handler)
+{
+ HW_TS_ReturnStatus_t localreturnstatus;
+ uint8_t loop = 0;
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ uint32_t primask_bit;
+#endif
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+#endif
+
+ while((loop < CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) && (aTimerContext[loop].TimerIDStatus != TimerID_Free))
+ {
+ loop++;
+ }
+
+ if(loop != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ aTimerContext[loop].TimerIDStatus = TimerID_Created;
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+
+ aTimerContext[loop].TimerProcessID = TimerProcessID;
+ aTimerContext[loop].TimerMode = TimerMode;
+ aTimerContext[loop].pTimerCallBack = pftimeout_handler;
+ *pTimerId = loop;
+
+ localreturnstatus = hw_ts_Successful;
+ }
+ else
+ {
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+
+ localreturnstatus = hw_ts_Failed;
+ }
+
+ return(localreturnstatus);
+}
+
+void HW_TS_Delete(uint8_t timer_id)
+{
+ HW_TS_Stop(timer_id);
+
+ aTimerContext[timer_id].TimerIDStatus = TimerID_Free; /**< release ID */
+
+ return;
+}
+
+void HW_TS_Stop(uint8_t timer_id)
+{
+ uint8_t localcurrentrunningtimerid;
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ uint32_t primask_bit;
+#endif
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+#endif
+
+ HAL_NVIC_DisableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Disable NVIC */
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+
+ if(aTimerContext[timer_id].TimerIDStatus == TimerID_Running)
+ {
+ UnlinkTimer(timer_id, SSR_Read_Requested);
+ localcurrentrunningtimerid = CurrentRunningTimerID;
+
+ if(localcurrentrunningtimerid == CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ /**
+ * List is empty
+ */
+
+ /**
+ * Disable the timer
+ */
+ if((READ_BIT(RTC->CR, RTC_CR_WUTE) == (RTC_CR_WUTE)) == SET)
+ {
+ /**
+ * Wait for the flag to be back to 0 when the wakeup timer is enabled
+ */
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == SET);
+ }
+ __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc); /**< Disable the Wakeup Timer */
+
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == RESET);
+
+ /**
+ * make sure to clear the flags after checking the WUTWF.
+ * It takes 2 RTCCLK between the time the WUTE bit is disabled and the
+ * time the timer is disabled. The WUTWF bit somehow guarantee the system is stable
+ * Otherwise, when the timer is periodic with 1 Tick, it may generate an extra interrupt in between
+ * due to the autoreload feature
+ */
+ __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */
+ __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */
+ HAL_NVIC_ClearPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Clear pending bit in NVIC */
+ }
+ else if(PreviousRunningTimerID != localcurrentrunningtimerid)
+ {
+ RescheduleTimerList();
+ }
+ }
+
+ /* Enable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_ENABLE( phrtc );
+
+ HAL_NVIC_EnableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Enable NVIC */
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+
+ return;
+}
+
+void HW_TS_Start(uint8_t timer_id, uint32_t timeout_ticks)
+{
+ uint16_t time_elapsed;
+ uint8_t localcurrentrunningtimerid;
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ uint32_t primask_bit;
+#endif
+
+ if(aTimerContext[timer_id].TimerIDStatus == TimerID_Running)
+ {
+ HW_TS_Stop( timer_id );
+ }
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+#endif
+
+ HAL_NVIC_DisableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Disable NVIC */
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+
+ aTimerContext[timer_id].TimerIDStatus = TimerID_Running;
+
+ aTimerContext[timer_id].CountLeft = timeout_ticks;
+ aTimerContext[timer_id].CounterInit = timeout_ticks;
+
+ time_elapsed = linkTimer(timer_id);
+
+ localcurrentrunningtimerid = CurrentRunningTimerID;
+
+ if(PreviousRunningTimerID != localcurrentrunningtimerid)
+ {
+ RescheduleTimerList();
+ }
+ else
+ {
+ aTimerContext[timer_id].CountLeft -= time_elapsed;
+ }
+
+ /* Enable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_ENABLE( phrtc );
+
+ HAL_NVIC_EnableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Enable NVIC */
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+
+ return;
+}
+
+uint16_t HW_TS_RTC_ReadLeftTicksToCount(void)
+{
+ uint32_t primask_bit;
+ uint16_t return_value, auro_reload_value, elapsed_time_value;
+
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+
+ if((READ_BIT(RTC->CR, RTC_CR_WUTE) == (RTC_CR_WUTE)) == SET)
+ {
+ auro_reload_value = (uint32_t)(READ_BIT(RTC->WUTR, RTC_WUTR_WUT));
+
+ elapsed_time_value = ReturnTimeElapsed();
+
+ if(auro_reload_value > elapsed_time_value)
+ {
+ return_value = auro_reload_value - elapsed_time_value;
+ }
+ else
+ {
+ return_value = 0;
+ }
+ }
+ else
+ {
+ return_value = TIMER_LIST_EMPTY;
+ }
+
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+
+ return (return_value);
+}
+
+__weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack)
+{
+ pTimerCallBack();
+
+ return;
+}
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/hw_uart.c
new file mode 100644
index 000000000..9a553610d
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/hw_uart.c
@@ -0,0 +1,318 @@
+/**
+ ******************************************************************************
+ * File Name : Src/hw_uart.c
+ * Description : HW UART source file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "hw_conf.h"
+#if (CFG_HW_LPUART1_ENABLED == 1)
+extern UART_HandleTypeDef hlpuart1;
+#endif
+#if (CFG_HW_USART1_ENABLED == 1)
+extern UART_HandleTypeDef huart1;
+#endif
+
+/* Macros --------------------------------------------------------------------*/
+#define HW_UART_RX_IT(__HANDLE__, __USART_BASE__) \
+ do{ \
+ HW_##__HANDLE__##RxCb = cb; \
+ (__HANDLE__).Instance = (__USART_BASE__); \
+ HAL_UART_Receive_IT(&(__HANDLE__), p_data, size); \
+ } while(0)
+
+#define HW_UART_TX_IT(__HANDLE__, __USART_BASE__) \
+ do{ \
+ HW_##__HANDLE__##TxCb = cb; \
+ (__HANDLE__).Instance = (__USART_BASE__); \
+ HAL_UART_Transmit_IT(&(__HANDLE__), p_data, size); \
+ } while(0)
+
+#define HW_UART_TX(__HANDLE__, __USART_BASE__) \
+ do{ \
+ (__HANDLE__).Instance = (__USART_BASE__); \
+ hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
+ } while(0)
+
+/* Variables -----------------------------------------------------------------*/
+#if (CFG_HW_USART1_ENABLED == 1)
+#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
+ DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
+#endif
+ void (*HW_huart1RxCb)(void);
+ void (*HW_huart1TxCb)(void);
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
+ DMA_HandleTypeDef HW_hdma_hlpuart1_tx ={0};
+#endif
+ void (*HW_hlpuart1RxCb)(void);
+ void (*HW_hlpuart1TxCb)(void);
+#endif
+
+void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HW_UART_RX_IT(huart1, USART1);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HW_UART_RX_IT(hlpuart1, LPUART1);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HW_UART_TX_IT(huart1, USART1);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HW_UART_TX_IT(hlpuart1, LPUART1);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
+{
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
+
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HW_UART_TX(huart1, USART1);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HW_UART_TX(hlpuart1, LPUART1);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ switch (hal_status)
+ {
+ case HAL_OK:
+ hw_status = hw_uart_ok;
+ break;
+
+ case HAL_ERROR:
+ hw_status = hw_uart_error;
+ break;
+
+ case HAL_BUSY:
+ hw_status = hw_uart_busy;
+ break;
+
+ case HAL_TIMEOUT:
+ hw_status = hw_uart_to;
+ break;
+
+ default:
+ break;
+ }
+
+ return hw_status;
+}
+
+hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
+
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HW_huart1TxCb = cb;
+ huart1.Instance = USART1;
+ hal_status = HAL_UART_Transmit_DMA(&huart1, p_data, size);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HW_hlpuart1TxCb = cb;
+ hlpuart1.Instance = LPUART1;
+ hal_status = HAL_UART_Transmit_DMA(&hlpuart1, p_data, size);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ switch (hal_status)
+ {
+ case HAL_OK:
+ hw_status = hw_uart_ok;
+ break;
+
+ case HAL_ERROR:
+ hw_status = hw_uart_error;
+ break;
+
+ case HAL_BUSY:
+ hw_status = hw_uart_busy;
+ break;
+
+ case HAL_TIMEOUT:
+ hw_status = hw_uart_to;
+ break;
+
+ default:
+ break;
+ }
+
+ return hw_status;
+}
+
+void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id)
+{
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HAL_UART_IRQHandler(&huart1);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HAL_UART_IRQHandler(&hlpuart1);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
+{
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
+ case hw_uart1:
+ HAL_DMA_IRQHandler(huart1.hdmatx);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
+ case hw_lpuart1:
+ HAL_DMA_IRQHandler(hlpuart1.hdmatx);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
+{
+ switch ((uint32_t)huart->Instance)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case (uint32_t)USART1:
+ if(HW_huart1RxCb)
+ {
+ HW_huart1RxCb();
+ }
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case (uint32_t)LPUART1:
+ if(HW_hlpuart1RxCb)
+ {
+ HW_hlpuart1RxCb();
+ }
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
+{
+ switch ((uint32_t)huart->Instance)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case (uint32_t)USART1:
+ if(HW_huart1TxCb)
+ {
+ HW_huart1TxCb();
+ }
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case (uint32_t)LPUART1:
+ if(HW_hlpuart1TxCb)
+ {
+ HW_hlpuart1TxCb();
+ }
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/main.c
new file mode 100644
index 000000000..00e011ffa
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/main.c
@@ -0,0 +1,618 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file : main.c
+ * @brief : Main program body
+ *
+ @verbatim
+ ==============================================================================
+ ##### IMPORTANT NOTE #####
+ ==============================================================================
+
+ This application requests having the stm32wb5x_Thread_FTD_fw.bin binary
+ flashed on the Wireless Coprocessor.
+ If it is not the case, you need to use STM32CubeProgrammer to load the appropriate
+ binary.
+
+ All available binaries are located under following directory:
+ /Projects/STM32_Copro_Wireless_Binaries
+
+ Refer to UM2237 to learn how to use/install STM32CubeProgrammer.
+ Refer to /Projects/STM32_Copro_Wireless_Binaries/ReleaseNote.html for the
+ detailed procedure to change the Wireless Coprocessor binary.
+
+ @endverbatim
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+#include "app_entry.h"
+#include "app_common.h"
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+#include "stm32_lpm.h"
+#include "stm32_seq.h"
+#include "dbg_trace.h"
+#include "hw_conf.h"
+#include "otp.h"
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN PTD */
+
+/* USER CODE END PTD */
+
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN PD */
+
+/* USER CODE END PD */
+
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private variables ---------------------------------------------------------*/
+UART_HandleTypeDef hlpuart1;
+UART_HandleTypeDef huart1;
+DMA_HandleTypeDef hdma_lpuart1_tx;
+DMA_HandleTypeDef hdma_usart1_tx;
+
+RTC_HandleTypeDef hrtc;
+
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+void SystemClock_Config(void);
+static void MX_GPIO_Init(void);
+static void MX_DMA_Init(void);
+void MX_LPUART1_UART_Init(void);
+void MX_USART1_UART_Init(void);
+static void MX_RF_Init(void);
+static void MX_RTC_Init(void);
+/* USER CODE BEGIN PFP */
+void PeriphClock_Config(void);
+static void Reset_Device( void );
+static void Reset_IPCC( void );
+static void Reset_BackupDomain( void );
+static void Init_Exti( void );
+static void Config_HSE(void);
+/* USER CODE END PFP */
+
+/* Private user code ---------------------------------------------------------*/
+/* USER CODE BEGIN 0 */
+
+/* USER CODE END 0 */
+
+/**
+ * @brief The application entry point.
+ * @retval int
+ */
+int main(void)
+{
+ /* USER CODE BEGIN 1 */
+
+ /* USER CODE END 1 */
+
+
+ /* MCU Configuration--------------------------------------------------------*/
+
+ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
+ HAL_Init();
+
+ /* USER CODE BEGIN Init */
+ Reset_Device();
+ Config_HSE();
+ /* USER CODE END Init */
+
+ /* Configure the system clock */
+ SystemClock_Config();
+
+ /* USER CODE BEGIN SysInit */
+ PeriphClock_Config();
+ Init_Exti(); /**< Configure the system Power Mode */
+ /* USER CODE END SysInit */
+
+ /* Initialize all configured peripherals */
+ MX_GPIO_Init();
+ MX_DMA_Init();
+ MX_RF_Init();
+ MX_RTC_Init();
+ /* USER CODE BEGIN 2 */
+
+ /* USER CODE END 2 */
+
+ /* Init code for STM32_WPAN */
+ APPE_Init();
+
+ /* Infinite loop */
+ /* USER CODE BEGIN WHILE */
+ while (1)
+ {
+ UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
+ /* USER CODE END WHILE */
+
+ /* USER CODE BEGIN 3 */
+ }
+ /* USER CODE END 3 */
+}
+
+/**
+ * @brief System Clock Configuration
+ * @retval None
+ */
+void SystemClock_Config(void)
+{
+ RCC_OscInitTypeDef RCC_OscInitStruct = {0};
+ RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
+ RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
+
+ /** Configure LSE Drive Capability
+ */
+ __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
+ /** Configure the main internal regulator output voltage
+ */
+ __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
+ /** Initializes the CPU, AHB and APB busses clocks
+ */
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE
+ |RCC_OSCILLATORTYPE_LSE;
+ RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ RCC_OscInitStruct.LSEState = RCC_LSE_ON;
+ RCC_OscInitStruct.HSIState = RCC_HSI_ON;
+ RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
+ RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
+ if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /** Configure the SYSCLKSource, HCLK, PCLK1 and PCLK2 clocks dividers
+ */
+ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK4|RCC_CLOCKTYPE_HCLK2
+ |RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
+ |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
+ RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSE;
+ RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
+ RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
+ RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
+ RCC_ClkInitStruct.AHBCLK2Divider = RCC_SYSCLK_DIV1;
+ RCC_ClkInitStruct.AHBCLK4Divider = RCC_SYSCLK_DIV1;
+
+ if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /** Initializes the peripherals clocks
+ */
+ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_SMPS|RCC_PERIPHCLK_RFWAKEUP
+ |RCC_PERIPHCLK_RTC|RCC_PERIPHCLK_USART1
+ |RCC_PERIPHCLK_LPUART1;
+ PeriphClkInitStruct.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2;
+ PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1;
+ PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
+ PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSE;
+ PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSE;
+ PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE0;
+
+ if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
+ {
+ Error_Handler();
+ }
+}
+
+/**
+ * @brief LPUART1 Initialization Function
+ * @param None
+ * @retval None
+ */
+void MX_LPUART1_UART_Init(void)
+{
+
+ /* USER CODE BEGIN LPUART1_Init 0 */
+
+ /* USER CODE END LPUART1_Init 0 */
+
+ /* USER CODE BEGIN LPUART1_Init 1 */
+
+ /* USER CODE END LPUART1_Init 1 */
+ hlpuart1.Instance = LPUART1;
+ hlpuart1.Init.BaudRate = 115200;
+ hlpuart1.Init.WordLength = UART_WORDLENGTH_8B;
+ hlpuart1.Init.StopBits = UART_STOPBITS_1;
+ hlpuart1.Init.Parity = UART_PARITY_NONE;
+ hlpuart1.Init.Mode = UART_MODE_TX_RX;
+ hlpuart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
+ hlpuart1.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
+ hlpuart1.Init.ClockPrescaler = UART_PRESCALER_DIV1;
+ hlpuart1.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
+ hlpuart1.FifoMode = UART_FIFOMODE_DISABLE;
+ if (HAL_UART_Init(&hlpuart1) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_SetTxFifoThreshold(&hlpuart1, UART_TXFIFO_THRESHOLD_1_8) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_SetRxFifoThreshold(&hlpuart1, UART_RXFIFO_THRESHOLD_1_8) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_DisableFifoMode(&hlpuart1) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /* USER CODE BEGIN LPUART1_Init 2 */
+
+ /* USER CODE END LPUART1_Init 2 */
+
+}
+
+/**
+ * @brief USART1 Initialization Function
+ * @param None
+ * @retval None
+ */
+void MX_USART1_UART_Init(void)
+{
+
+ /* USER CODE BEGIN USART1_Init 0 */
+
+ /* USER CODE END USART1_Init 0 */
+
+ /* USER CODE BEGIN USART1_Init 1 */
+
+ /* USER CODE END USART1_Init 1 */
+ huart1.Instance = USART1;
+ huart1.Init.BaudRate = 115200;
+ huart1.Init.WordLength = UART_WORDLENGTH_8B;
+ huart1.Init.StopBits = UART_STOPBITS_1;
+ huart1.Init.Parity = UART_PARITY_NONE;
+ huart1.Init.Mode = UART_MODE_TX_RX;
+ huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
+ huart1.Init.OverSampling = UART_OVERSAMPLING_8;
+ huart1.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
+ huart1.Init.ClockPrescaler = UART_PRESCALER_DIV1;
+ huart1.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
+ if (HAL_UART_Init(&huart1) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_SetTxFifoThreshold(&huart1, UART_TXFIFO_THRESHOLD_1_8) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_SetRxFifoThreshold(&huart1, UART_RXFIFO_THRESHOLD_1_8) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_DisableFifoMode(&huart1) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /* USER CODE BEGIN USART1_Init 2 */
+
+ /* USER CODE END USART1_Init 2 */
+
+}
+
+/**
+ * @brief RF Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_RF_Init(void)
+{
+
+ /* USER CODE BEGIN RF_Init 0 */
+
+ /* USER CODE END RF_Init 0 */
+
+ /* USER CODE BEGIN RF_Init 1 */
+
+ /* USER CODE END RF_Init 1 */
+ /* USER CODE BEGIN RF_Init 2 */
+
+ /* USER CODE END RF_Init 2 */
+
+}
+
+/**
+ * @brief RTC Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_RTC_Init(void)
+{
+
+ /* USER CODE BEGIN RTC_Init 0 */
+
+ /* USER CODE END RTC_Init 0 */
+
+ /* USER CODE BEGIN RTC_Init 1 */
+
+ /* USER CODE END RTC_Init 1 */
+ /** Initialize RTC Only
+ */
+ hrtc.Instance = RTC;
+ hrtc.Init.HourFormat = RTC_HOURFORMAT_24;
+ hrtc.Init.AsynchPrediv = CFG_RTC_ASYNCH_PRESCALER;
+ hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
+ hrtc.Init.OutPut = RTC_OUTPUT_DISABLE;
+ hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH;
+ hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;
+ if (HAL_RTC_Init(&hrtc) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /* USER CODE BEGIN RTC_Init 2 */
+
+ /* USER CODE END RTC_Init 2 */
+
+}
+
+/**
+ * Enable DMA controller clock
+ */
+static void MX_DMA_Init(void)
+{
+
+ /* DMA controller clock enable */
+ __HAL_RCC_DMAMUX1_CLK_ENABLE();
+ __HAL_RCC_DMA1_CLK_ENABLE();
+
+ /* DMA interrupt init */
+ /* DMA1_Channel1_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(DMA1_Channel1_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(DMA1_Channel1_IRQn);
+ /* DMA1_Channel2_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(DMA1_Channel2_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(DMA1_Channel2_IRQn);
+
+}
+
+/**
+ * @brief GPIO Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_GPIO_Init(void)
+{
+
+ /* GPIO Ports Clock Enable */
+ __HAL_RCC_GPIOC_CLK_ENABLE();
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+
+}
+
+/* USER CODE BEGIN 4 */
+void PeriphClock_Config(void)
+{
+ #if (CFG_USB_INTERFACE_ENABLE != 0)
+ RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
+ RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
+ LL_RCC_HSI48_Enable();
+
+ while(!LL_RCC_HSI48_IsReady());
+
+ /* Select HSI48 as USB clock source */
+ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB;
+ PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_HSI48;
+ HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
+
+ /*Configure the clock recovery system (CRS)**********************************/
+
+ /* Enable CRS Clock */
+ __HAL_RCC_CRS_CLK_ENABLE();
+
+ /* Default Synchro Signal division factor (not divided) */
+ RCC_CRSInitStruct.Prescaler = RCC_CRS_SYNC_DIV1;
+
+ /* Set the SYNCSRC[1:0] bits according to CRS_Source value */
+ RCC_CRSInitStruct.Source = RCC_CRS_SYNC_SOURCE_USB;
+
+ /* HSI48 is synchronized with USB SOF at 1KHz rate */
+ RCC_CRSInitStruct.ReloadValue = RCC_CRS_RELOADVALUE_DEFAULT;
+ RCC_CRSInitStruct.ErrorLimitValue = RCC_CRS_ERRORLIMIT_DEFAULT;
+
+ RCC_CRSInitStruct.Polarity = RCC_CRS_SYNC_POLARITY_RISING;
+
+ /* Set the TRIM[5:0] to the default value*/
+ RCC_CRSInitStruct.HSI48CalibrationValue = RCC_CRS_HSI48CALIBRATION_DEFAULT;
+
+ /* Start automatic synchronization */
+ HAL_RCCEx_CRSConfig(&RCC_CRSInitStruct);
+#endif
+
+ return;
+}
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+
+static void Config_HSE(void)
+{
+ OTP_ID0_t * p_otp;
+
+ /**
+ * Read HSE_Tuning from OTP
+ */
+ p_otp = (OTP_ID0_t *) OTP_Read(0);
+ if (p_otp)
+ {
+ LL_RCC_HSE_SetCapacitorTuning(p_otp->hse_tuning);
+ }
+
+ return;
+}
+
+
+static void Reset_Device( void )
+{
+#if ( CFG_HW_RESET_BY_FW == 1 )
+ Reset_BackupDomain();
+
+ Reset_IPCC();
+#endif
+
+ return;
+}
+
+static void Reset_IPCC( void )
+{
+ LL_AHB3_GRP1_EnableClock(LL_AHB3_GRP1_PERIPH_IPCC);
+
+ LL_C1_IPCC_ClearFlag_CHx(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C2_IPCC_ClearFlag_CHx(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C1_IPCC_DisableTransmitChannel(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C2_IPCC_DisableTransmitChannel(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C1_IPCC_DisableReceiveChannel(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C2_IPCC_DisableReceiveChannel(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ return;
+}
+
+static void Reset_BackupDomain( void )
+{
+ if ((LL_RCC_IsActiveFlag_PINRST() != FALSE) && (LL_RCC_IsActiveFlag_SFTRST() == FALSE))
+ {
+ HAL_PWR_EnableBkUpAccess(); /**< Enable access to the RTC registers */
+
+ /**
+ * Write twice the value to flush the APB-AHB bridge
+ * This bit shall be written in the register before writing the next one
+ */
+ HAL_PWR_EnableBkUpAccess();
+
+ __HAL_RCC_BACKUPRESET_FORCE();
+ __HAL_RCC_BACKUPRESET_RELEASE();
+ }
+
+ return;
+}
+
+
+static void Init_Exti( void )
+{
+ /**< Disable all wakeup interrupt on CPU1 except IPCC(36), HSEM(38) */
+ LL_EXTI_DisableIT_0_31(~0);
+ LL_EXTI_DisableIT_32_63( (~0) & (~(LL_EXTI_LINE_36 | LL_EXTI_LINE_38)) );
+
+ return;
+}
+
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+void HAL_Delay(uint32_t Delay)
+{
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
+
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
+}
+/* USER CODE END 4 */
+
+/**
+ * @brief This function is executed in case of error occurrence.
+ * @retval None
+ */
+void Error_Handler(void)
+{
+ /* USER CODE BEGIN Error_Handler_Debug */
+ /* User can add his own implementation to report the HAL error return state */
+
+ /* USER CODE END Error_Handler_Debug */
+}
+
+#ifdef USE_FULL_ASSERT
+/**
+ * @brief Reports the name of the source file and the source line number
+ * where the assert_param error has occurred.
+ * @param file: pointer to the source file name
+ * @param line: assert_param error line source number
+ * @retval None
+ */
+void assert_failed(uint8_t *file, uint32_t line)
+{
+ /* USER CODE BEGIN 6 */
+ /* User can add his own implementation to report the file name and line number,
+ tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
+ /* USER CODE END 6 */
+}
+#endif /* USE_FULL_ASSERT */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/stm32_lpm_if.c
new file mode 100644
index 000000000..f024b61e3
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/stm32_lpm_if.c
@@ -0,0 +1,275 @@
+/* USER CODE BEGIN Header */
+/**
+ ***************************************************************************************
+ * File Name : stm32_lpm_if.c
+ * Description : Low layer function to enter/exit low power modes (stop, sleep).
+ ***************************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "stm32_lpm_if.h"
+#include "stm32_lpm.h"
+#include "app_conf.h"
+/* USER CODE BEGIN include */
+
+/* USER CODE END include */
+
+/* Exported variables --------------------------------------------------------*/
+const struct UTIL_LPM_Driver_s UTIL_PowerDriver =
+{
+ PWR_EnterSleepMode,
+ PWR_ExitSleepMode,
+
+ PWR_EnterStopMode,
+ PWR_ExitStopMode,
+
+ PWR_EnterOffMode,
+ PWR_ExitOffMode,
+};
+
+/* Private function prototypes -----------------------------------------------*/
+static void Switch_On_HSI( void );
+/* USER CODE BEGIN Private_Function_Prototypes */
+
+/* USER CODE END Private_Function_Prototypes */
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN Private_Typedef */
+
+/* USER CODE END Private_Typedef */
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN Private_Define */
+
+/* USER CODE END Private_Define */
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN Private_Macro */
+
+/* USER CODE END Private_Macro */
+/* Private variables ---------------------------------------------------------*/
+/* USER CODE BEGIN Private_Variables */
+
+/* USER CODE END Private_Variables */
+
+/* Functions Definition ------------------------------------------------------*/
+/**
+ * @brief Enters Low Power Off Mode
+ * @param none
+ * @retval none
+ */
+void PWR_EnterOffMode( void )
+{
+/* USER CODE BEGIN PWR_EnterOffMode */
+ /************************************************************************************
+ * ENTER OFF MODE
+ ***********************************************************************************/
+ /*
+ * There is no risk to clear all the WUF here because in the current implementation, this API is called
+ * in critical section. If an interrupt occurs while in that critical section before that point,
+ * the flag is set and will be cleared here but the system will not enter Off Mode
+ * because an interrupt is pending in the NVIC. The ISR will be executed when moving out
+ * of this critical section
+ */
+ LL_PWR_ClearFlag_WU( );
+
+ LL_PWR_SetPowerMode( LL_PWR_MODE_STANDBY );
+
+ LL_LPM_EnableDeepSleep( ); /**< Set SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+#if defined ( __CC_ARM)
+ __force_stores( );
+#endif
+
+ __WFI( );
+/* USER CODE END PWR_EnterOffMode */
+}
+
+/**
+ * @brief Exits Low Power Off Mode
+ * @param none
+ * @retval none
+ */
+void PWR_ExitOffMode( void )
+{
+/* USER CODE BEGIN PWR_ExitOffMode */
+
+/* USER CODE END PWR_ExitOffMode */
+}
+
+/**
+ * @brief Enters Low Power Stop Mode
+ * @note ARM exists the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_EnterStopMode( void )
+{
+/* USER CODE BEGIN PWR_EnterStopMode */
+ /**
+ * This function is called from CRITICAL SECTION
+ */
+ while( LL_HSEM_1StepLock( HSEM, CFG_HW_RCC_SEMID ) );
+
+ if ( ! LL_HSEM_1StepLock( HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID ) )
+ {
+ if( LL_PWR_IsActiveFlag_C2DS( ) )
+ {
+ /* Release ENTRY_STOP_MODE semaphore */
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID, 0 );
+
+ /**
+ * The switch on HSI before entering Stop Mode is required on Cut2.0
+ * It is useless from Cut2.1
+ */
+ Switch_On_HSI( );
+ }
+ }
+ else
+ {
+ /**
+ * The switch on HSI before entering Stop Mode is required on Cut2.0
+ * It is useless from Cut2.1
+ */
+ Switch_On_HSI( );
+ }
+
+ /* Release RCC semaphore */
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_RCC_SEMID, 0 );
+
+ /************************************************************************************
+ * ENTER STOP MODE
+ ***********************************************************************************/
+ LL_PWR_SetPowerMode( LL_PWR_MODE_STOP2 );
+
+ LL_LPM_EnableDeepSleep( ); /**< Set SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+#if defined ( __CC_ARM)
+ __force_stores( );
+#endif
+
+ __WFI();
+/* USER CODE END PWR_EnterStopMode */
+}
+
+/**
+ * @brief Exits Low Power Stop Mode
+ * @note Enable the pll at 32MHz
+ * @param none
+ * @retval none
+ */
+void PWR_ExitStopMode( void )
+{
+/* USER CODE BEGIN PWR_ExitStopMode */
+ /**
+ * This function is called from CRITICAL SECTION
+ */
+
+ /* Release ENTRY_STOP_MODE semaphore */
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID, 0 );
+
+ while( LL_HSEM_1StepLock( HSEM, CFG_HW_RCC_SEMID ) );
+
+ if(LL_RCC_GetSysClkSource( ) == LL_RCC_SYS_CLKSOURCE_STATUS_HSI)
+ {
+ LL_RCC_HSE_Enable( );
+ while(!LL_RCC_HSE_IsReady( ));
+ LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_HSE);
+ while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSE);
+ }
+ else
+ {
+ /**
+ * As long as the current application is fine with HSE as system clock source,
+ * there is nothing to do here
+ */
+ }
+
+ /* Release RCC semaphore */
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_RCC_SEMID, 0 );
+/* USER CODE END PWR_ExitStopMode */
+}
+
+/**
+ * @brief Enters Low Power Sleep Mode
+ * @note ARM exits the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_EnterSleepMode( void )
+{
+/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+#if defined ( __CC_ARM)
+ __force_stores();
+#endif
+
+ __WFI( );
+/* USER CODE END PWR_EnterSleepMode */
+}
+
+/**
+ * @brief Exits Low Power Sleep Mode
+ * @note ARM exits the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_ExitSleepMode( void )
+{
+/* USER CODE BEGIN PWR_ExitSleepMode */
+
+ HAL_ResumeTick();
+
+/* USER CODE END PWR_ExitSleepMode */
+}
+
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+/**
+ * @brief Switch the system clock on HSI
+ * @param none
+ * @retval none
+ */
+static void Switch_On_HSI( void )
+{
+ LL_RCC_HSI_Enable( );
+ while(!LL_RCC_HSI_IsReady( ));
+ LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
+ while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
+}
+
+/* USER CODE BEGIN Private_Functions */
+
+/* USER CODE END Private_Functions */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/stm32wbxx_hal_msp.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/stm32wbxx_hal_msp.c
new file mode 100644
index 000000000..9c338486d
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/stm32wbxx_hal_msp.c
@@ -0,0 +1,334 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : stm32wbxx_hal_msp.c
+ * Description : This file provides code for the MSP Initialization
+ * and de-Initialization codes.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+/* USER CODE BEGIN Includes */
+#include "app_conf.h"
+/* USER CODE END Includes */
+extern DMA_HandleTypeDef hdma_lpuart1_tx;
+
+extern DMA_HandleTypeDef hdma_usart1_tx;
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN TD */
+
+/* USER CODE END TD */
+
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN Define */
+
+/* USER CODE END Define */
+
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN Macro */
+
+/* USER CODE END Macro */
+
+/* Private variables ---------------------------------------------------------*/
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+/* USER CODE BEGIN PFP */
+
+/* USER CODE END PFP */
+
+/* External functions --------------------------------------------------------*/
+/* USER CODE BEGIN ExternalFunctions */
+
+/* USER CODE END ExternalFunctions */
+
+/* USER CODE BEGIN 0 */
+
+/* USER CODE END 0 */
+/**
+ * Initializes the Global MSP.
+ */
+void HAL_MspInit(void)
+{
+ /* USER CODE BEGIN MspInit 0 */
+
+ /* USER CODE END MspInit 0 */
+
+ __HAL_RCC_HSEM_CLK_ENABLE();
+
+ /* System interrupt init*/
+
+ /* Peripheral interrupt init */
+ /* PVD_PVM_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(PVD_PVM_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(PVD_PVM_IRQn);
+ /* FLASH_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(FLASH_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(FLASH_IRQn);
+ /* RCC_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(RCC_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(RCC_IRQn);
+ /* C2SEV_PWR_C2H_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(C2SEV_PWR_C2H_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(C2SEV_PWR_C2H_IRQn);
+ /* PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn);
+ /* HSEM_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(HSEM_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(HSEM_IRQn);
+ /* FPU_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(FPU_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(FPU_IRQn);
+
+ /* USER CODE BEGIN MspInit 1 */
+
+ /* USER CODE END MspInit 1 */
+}
+
+/**
+* @brief UART MSP Initialization
+* This function configures the hardware resources used in this example
+* @param huart: UART handle pointer
+* @retval None
+*/
+void HAL_UART_MspInit(UART_HandleTypeDef* huart)
+{
+ GPIO_InitTypeDef GPIO_InitStruct = {0};
+ if(huart->Instance==LPUART1)
+ {
+ /* USER CODE BEGIN LPUART1_MspInit 0 */
+
+ /* USER CODE END LPUART1_MspInit 0 */
+ /* Peripheral clock enable */
+ __HAL_RCC_LPUART1_CLK_ENABLE();
+
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ /**LPUART1 GPIO Configuration
+ PA2 ------> LPUART1_TX
+ PA3 ------> LPUART1_RX
+ */
+ GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_3;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ GPIO_InitStruct.Alternate = GPIO_AF8_LPUART1;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+
+ /* LPUART1 DMA Init */
+ /* LPUART1_TX Init */
+ hdma_lpuart1_tx.Instance = DMA1_Channel1;
+ hdma_lpuart1_tx.Init.Request = DMA_REQUEST_LPUART1_TX;
+ hdma_lpuart1_tx.Init.Direction = DMA_MEMORY_TO_PERIPH;
+ hdma_lpuart1_tx.Init.PeriphInc = DMA_PINC_DISABLE;
+ hdma_lpuart1_tx.Init.MemInc = DMA_MINC_ENABLE;
+ hdma_lpuart1_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
+ hdma_lpuart1_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
+ hdma_lpuart1_tx.Init.Mode = DMA_NORMAL;
+ hdma_lpuart1_tx.Init.Priority = DMA_PRIORITY_LOW;
+ if (HAL_DMA_Init(&hdma_lpuart1_tx) != HAL_OK)
+ {
+ Error_Handler();
+ }
+
+ __HAL_LINKDMA(huart,hdmatx,hdma_lpuart1_tx);
+
+ /* LPUART1 interrupt Init */
+ HAL_NVIC_SetPriority(LPUART1_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(LPUART1_IRQn);
+ /* USER CODE BEGIN LPUART1_MspInit 1 */
+
+ /* USER CODE END LPUART1_MspInit 1 */
+ }
+ else if(huart->Instance==USART1)
+ {
+ /* USER CODE BEGIN USART1_MspInit 0 */
+
+ /* USER CODE END USART1_MspInit 0 */
+ /* Peripheral clock enable */
+ __HAL_RCC_USART1_CLK_ENABLE();
+
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+ /**USART1 GPIO Configuration
+ PA11 ------> USART1_CTS
+ PB6 ------> USART1_TX
+ PB7 ------> USART1_RX
+ */
+ GPIO_InitStruct.Pin = GPIO_PIN_11;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+
+ GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
+ HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
+
+ /* USART1 DMA Init */
+ /* USART1_TX Init */
+ hdma_usart1_tx.Instance = DMA1_Channel2;
+ hdma_usart1_tx.Init.Request = DMA_REQUEST_USART1_TX;
+ hdma_usart1_tx.Init.Direction = DMA_MEMORY_TO_PERIPH;
+ hdma_usart1_tx.Init.PeriphInc = DMA_PINC_DISABLE;
+ hdma_usart1_tx.Init.MemInc = DMA_MINC_ENABLE;
+ hdma_usart1_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
+ hdma_usart1_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
+ hdma_usart1_tx.Init.Mode = DMA_NORMAL;
+ hdma_usart1_tx.Init.Priority = DMA_PRIORITY_LOW;
+ if (HAL_DMA_Init(&hdma_usart1_tx) != HAL_OK)
+ {
+ Error_Handler();
+ }
+
+ __HAL_LINKDMA(huart,hdmatx,hdma_usart1_tx);
+
+ /* USART1 interrupt Init */
+ HAL_NVIC_SetPriority(USART1_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(USART1_IRQn);
+ /* USER CODE BEGIN USART1_MspInit 1 */
+
+ /* USER CODE END USART1_MspInit 1 */
+ }
+
+}
+
+/**
+* @brief UART MSP De-Initialization
+* This function freeze the hardware resources used in this example
+* @param huart: UART handle pointer
+* @retval None
+*/
+void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
+{
+ if(huart->Instance==LPUART1)
+ {
+ /* USER CODE BEGIN LPUART1_MspDeInit 0 */
+
+ /* USER CODE END LPUART1_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_LPUART1_CLK_DISABLE();
+
+ /**LPUART1 GPIO Configuration
+ PA2 ------> LPUART1_TX
+ PA3 ------> LPUART1_RX
+ */
+ HAL_GPIO_DeInit(GPIOA, GPIO_PIN_2|GPIO_PIN_3);
+
+ /* LPUART1 DMA DeInit */
+ HAL_DMA_DeInit(huart->hdmatx);
+
+ /* LPUART1 interrupt DeInit */
+ HAL_NVIC_DisableIRQ(LPUART1_IRQn);
+ /* USER CODE BEGIN LPUART1_MspDeInit 1 */
+
+ /* USER CODE END LPUART1_MspDeInit 1 */
+ }
+ else if(huart->Instance==USART1)
+ {
+ /* USER CODE BEGIN USART1_MspDeInit 0 */
+
+ /* USER CODE END USART1_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_USART1_CLK_DISABLE();
+
+ /**USART1 GPIO Configuration
+ PA11 ------> USART1_CTS
+ PB6 ------> USART1_TX
+ PB7 ------> USART1_RX
+ */
+ HAL_GPIO_DeInit(GPIOA, GPIO_PIN_11);
+
+ HAL_GPIO_DeInit(GPIOB, GPIO_PIN_6|GPIO_PIN_7);
+
+ /* USART1 DMA DeInit */
+ HAL_DMA_DeInit(huart->hdmatx);
+
+ /* USART1 interrupt DeInit */
+ HAL_NVIC_DisableIRQ(USART1_IRQn);
+ /* USER CODE BEGIN USART1_MspDeInit 1 */
+
+ /* USER CODE END USART1_MspDeInit 1 */
+ }
+
+}
+
+/**
+* @brief RTC MSP Initialization
+* This function configures the hardware resources used in this example
+* @param hrtc: RTC handle pointer
+* @retval None
+*/
+void HAL_RTC_MspInit(RTC_HandleTypeDef* hrtc)
+{
+ if(hrtc->Instance==RTC)
+ {
+ /* USER CODE BEGIN RTC_MspInit 0 */
+ HAL_PWR_EnableBkUpAccess(); /**< Enable access to the RTC registers */
+
+ /**
+ * Write twice the value to flush the APB-AHB bridge
+ * This bit shall be written in the register before writing the next one
+ */
+ HAL_PWR_EnableBkUpAccess();
+
+ __HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSE); /**< Select LSE as RTC Input */
+
+ /* USER CODE END RTC_MspInit 0 */
+ /* Peripheral clock enable */
+ __HAL_RCC_RTC_ENABLE();
+ /* USER CODE BEGIN RTC_MspInit 1 */
+
+ MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* USER CODE END RTC_MspInit 1 */
+ }
+
+}
+
+/**
+* @brief RTC MSP De-Initialization
+* This function freeze the hardware resources used in this example
+* @param hrtc: RTC handle pointer
+* @retval None
+*/
+void HAL_RTC_MspDeInit(RTC_HandleTypeDef* hrtc)
+{
+ if(hrtc->Instance==RTC)
+ {
+ /* USER CODE BEGIN RTC_MspDeInit 0 */
+
+ /* USER CODE END RTC_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_RTC_DISABLE();
+ /* USER CODE BEGIN RTC_MspDeInit 1 */
+
+ /* USER CODE END RTC_MspDeInit 1 */
+ }
+
+}
+
+/* USER CODE BEGIN 1 */
+
+/* USER CODE END 1 */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/stm32wbxx_it.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/stm32wbxx_it.c
new file mode 100644
index 000000000..b0026e595
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/stm32wbxx_it.c
@@ -0,0 +1,382 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file stm32wbxx_it.c
+ * @brief Interrupt Service Routines.
+ *******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+#include "stm32wbxx_it.h"
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+#include "hw.h"
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN TD */
+
+/* USER CODE END TD */
+
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN PD */
+
+/* USER CODE END PD */
+
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private variables ---------------------------------------------------------*/
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+/* USER CODE BEGIN PFP */
+
+/* USER CODE END PFP */
+
+/* Private user code ---------------------------------------------------------*/
+/* USER CODE BEGIN 0 */
+
+/* USER CODE END 0 */
+
+/* External variables --------------------------------------------------------*/
+extern DMA_HandleTypeDef hdma_lpuart1_tx;
+extern DMA_HandleTypeDef hdma_usart1_tx;
+extern UART_HandleTypeDef hlpuart1;
+extern UART_HandleTypeDef huart1;
+/* USER CODE BEGIN EV */
+
+/* USER CODE END EV */
+
+/******************************************************************************/
+/* Cortex Processor Interruption and Exception Handlers */
+/******************************************************************************/
+/**
+ * @brief This function handles Non maskable interrupt.
+ */
+void NMI_Handler(void)
+{
+ /* USER CODE BEGIN NonMaskableInt_IRQn 0 */
+
+ /* USER CODE END NonMaskableInt_IRQn 0 */
+ /* USER CODE BEGIN NonMaskableInt_IRQn 1 */
+
+ /* USER CODE END NonMaskableInt_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Hard fault interrupt.
+ */
+void HardFault_Handler(void)
+{
+ /* USER CODE BEGIN HardFault_IRQn 0 */
+
+ /* USER CODE END HardFault_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_HardFault_IRQn 0 */
+ /* USER CODE END W1_HardFault_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles Memory management fault.
+ */
+void MemManage_Handler(void)
+{
+ /* USER CODE BEGIN MemoryManagement_IRQn 0 */
+
+ /* USER CODE END MemoryManagement_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */
+ /* USER CODE END W1_MemoryManagement_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles Prefetch fault, memory access fault.
+ */
+void BusFault_Handler(void)
+{
+ /* USER CODE BEGIN BusFault_IRQn 0 */
+
+ /* USER CODE END BusFault_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_BusFault_IRQn 0 */
+ /* USER CODE END W1_BusFault_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles Undefined instruction or illegal state.
+ */
+void UsageFault_Handler(void)
+{
+ /* USER CODE BEGIN UsageFault_IRQn 0 */
+
+ /* USER CODE END UsageFault_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_UsageFault_IRQn 0 */
+ /* USER CODE END W1_UsageFault_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles System service call via SWI instruction.
+ */
+void SVC_Handler(void)
+{
+ /* USER CODE BEGIN SVCall_IRQn 0 */
+
+ /* USER CODE END SVCall_IRQn 0 */
+ /* USER CODE BEGIN SVCall_IRQn 1 */
+
+ /* USER CODE END SVCall_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Debug monitor.
+ */
+void DebugMon_Handler(void)
+{
+ /* USER CODE BEGIN DebugMonitor_IRQn 0 */
+
+ /* USER CODE END DebugMonitor_IRQn 0 */
+ /* USER CODE BEGIN DebugMonitor_IRQn 1 */
+
+ /* USER CODE END DebugMonitor_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Pendable request for system service.
+ */
+void PendSV_Handler(void)
+{
+ /* USER CODE BEGIN PendSV_IRQn 0 */
+
+ /* USER CODE END PendSV_IRQn 0 */
+ /* USER CODE BEGIN PendSV_IRQn 1 */
+
+ /* USER CODE END PendSV_IRQn 1 */
+}
+
+/**
+ * @brief This function handles System tick timer.
+ */
+void SysTick_Handler(void)
+{
+ /* USER CODE BEGIN SysTick_IRQn 0 */
+
+ /* USER CODE END SysTick_IRQn 0 */
+ HAL_IncTick();
+ /* USER CODE BEGIN SysTick_IRQn 1 */
+
+ /* USER CODE END SysTick_IRQn 1 */
+}
+
+/******************************************************************************/
+/* STM32WBxx Peripheral Interrupt Handlers */
+/* Add here the Interrupt Handlers for the used peripherals. */
+/* For the available peripheral interrupt handler names, */
+/* please refer to the startup file (startup_stm32wbxx.s). */
+/******************************************************************************/
+
+/**
+ * @brief This function handles PVD/PVM0/PVM2 interrupts through EXTI lines 16/31/33.
+ */
+void PVD_PVM_IRQHandler(void)
+{
+ /* USER CODE BEGIN PVD_PVM_IRQn 0 */
+
+ /* USER CODE END PVD_PVM_IRQn 0 */
+ HAL_PWREx_PVD_PVM_IRQHandler();
+ /* USER CODE BEGIN PVD_PVM_IRQn 1 */
+
+ /* USER CODE END PVD_PVM_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Flash global interrupt.
+ */
+void FLASH_IRQHandler(void)
+{
+ /* USER CODE BEGIN FLASH_IRQn 0 */
+
+ /* USER CODE END FLASH_IRQn 0 */
+ HAL_FLASH_IRQHandler();
+ /* USER CODE BEGIN FLASH_IRQn 1 */
+
+ /* USER CODE END FLASH_IRQn 1 */
+}
+
+/**
+ * @brief This function handles RCC global interrupt.
+ */
+void RCC_IRQHandler(void)
+{
+ /* USER CODE BEGIN RCC_IRQn 0 */
+
+ /* USER CODE END RCC_IRQn 0 */
+ /* USER CODE BEGIN RCC_IRQn 1 */
+
+ /* USER CODE END RCC_IRQn 1 */
+}
+
+/**
+ * @brief This function handles DMA1 channel1 global interrupt.
+ */
+void DMA1_Channel1_IRQHandler(void)
+{
+ /* USER CODE BEGIN DMA1_Channel1_IRQn 0 */
+
+ /* USER CODE END DMA1_Channel1_IRQn 0 */
+ HAL_DMA_IRQHandler(&hdma_lpuart1_tx);
+ /* USER CODE BEGIN DMA1_Channel1_IRQn 1 */
+
+ /* USER CODE END DMA1_Channel1_IRQn 1 */
+}
+
+/**
+ * @brief This function handles DMA1 channel2 global interrupt.
+ */
+void DMA1_Channel2_IRQHandler(void)
+{
+ /* USER CODE BEGIN DMA1_Channel2_IRQn 0 */
+
+ /* USER CODE END DMA1_Channel2_IRQn 0 */
+ HAL_DMA_IRQHandler(&hdma_usart1_tx);
+ /* USER CODE BEGIN DMA1_Channel2_IRQn 1 */
+
+ /* USER CODE END DMA1_Channel2_IRQn 1 */
+}
+
+/**
+ * @brief This function handles CPU2 SEV interrupt through EXTI line 40 and PWR CPU2 HOLD wake-up interrupt.
+ */
+void C2SEV_PWR_C2H_IRQHandler(void)
+{
+ /* USER CODE BEGIN C2SEV_PWR_C2H_IRQn 0 */
+
+ /* USER CODE END C2SEV_PWR_C2H_IRQn 0 */
+ /* USER CODE BEGIN C2SEV_PWR_C2H_IRQn 1 */
+
+ /* USER CODE END C2SEV_PWR_C2H_IRQn 1 */
+}
+
+/**
+ * @brief This function handles USART1 global interrupt.
+ */
+void USART1_IRQHandler(void)
+{
+ /* USER CODE BEGIN USART1_IRQn 0 */
+
+ /* USER CODE END USART1_IRQn 0 */
+ HAL_UART_IRQHandler(&huart1);
+ /* USER CODE BEGIN USART1_IRQn 1 */
+
+ /* USER CODE END USART1_IRQn 1 */
+}
+
+/**
+ * @brief This function handles LPUART1 global interrupt.
+ */
+void LPUART1_IRQHandler(void)
+{
+ /* USER CODE BEGIN LPUART1_IRQn 0 */
+
+ /* USER CODE END LPUART1_IRQn 0 */
+ HAL_UART_IRQHandler(&hlpuart1);
+ /* USER CODE BEGIN LPUART1_IRQn 1 */
+
+ /* USER CODE END LPUART1_IRQn 1 */
+}
+
+/**
+ * @brief This function handles PWR switching on the fly, end of BLE activity, end of 802.15.4 activity, end of critical radio phase interrupt.
+ */
+void PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler(void)
+{
+ /* USER CODE BEGIN PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn 0 */
+
+ /* USER CODE END PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn 0 */
+ /* USER CODE BEGIN PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn 1 */
+
+ /* USER CODE END PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn 1 */
+}
+
+/**
+ * @brief This function handles HSEM global interrupt.
+ */
+void HSEM_IRQHandler(void)
+{
+ /* USER CODE BEGIN HSEM_IRQn 0 */
+
+ /* USER CODE END HSEM_IRQn 0 */
+ HAL_HSEM_IRQHandler();
+ /* USER CODE BEGIN HSEM_IRQn 1 */
+
+ /* USER CODE END HSEM_IRQn 1 */
+}
+
+/**
+ * @brief This function handles FPU global interrupt.
+ */
+void FPU_IRQHandler(void)
+{
+ /* USER CODE BEGIN FPU_IRQn 0 */
+
+ /* USER CODE END FPU_IRQn 0 */
+ /* USER CODE BEGIN FPU_IRQn 1 */
+
+ /* USER CODE END FPU_IRQn 1 */
+}
+
+/* USER CODE BEGIN 1 */
+void RTC_WKUP_IRQHandler(void)
+{
+ HW_TS_RTC_Wakeup_Handler();
+}
+
+/**
+ * @brief This function handles EXTI4_IRQ Handler.
+ * @param None
+ * @retval None
+ */
+void EXTI4_IRQHandler(void)
+{
+ HAL_GPIO_EXTI_IRQHandler(BUTTON_SW1_PIN);
+}
+
+void IPCC_C1_TX_IRQHandler(void)
+{
+ HW_IPCC_Tx_Handler();
+
+ return;
+}
+void IPCC_C1_RX_IRQHandler(void)
+{
+ HW_IPCC_Rx_Handler();
+ return;
+}
+/* USER CODE END 1 */
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/stm_logging.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/stm_logging.c
new file mode 100644
index 000000000..47a43a019
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/stm_logging.c
@@ -0,0 +1,215 @@
+/**
+ ******************************************************************************
+ * File Name : stm_logging.c
+ * Description : This file contains all the defines and functions used
+ * for logging on Application examples.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/**
+ * @file
+ * This file implements logging functions to be used in Application examples.
+ *
+ */
+
+#include <ctype.h>
+#include <inttypes.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <string.h>
+
+#include "app_conf.h"
+#include "stm_logging.h"
+
+#define LOG_PARSE_BUFFER_SIZE 256U
+
+#define LOG_TIMESTAMP_ENABLE 0
+#define LOG_REGION_ENABLE 1U
+#define LOG_RTT_COLOR_ENABLE 1U
+
+#if (LOG_RTT_COLOR_ENABLE == 1U)
+#define RTT_COLOR_CODE_DEFAULT "\x1b[0m"
+#define RTT_COLOR_CODE_RED "\x1b[0;91m"
+#define RTT_COLOR_CODE_GREEN "\x1b[0;92m"
+#define RTT_COLOR_CODE_YELLOW "\x1b[0;93m"
+#define RTT_COLOR_CODE_CYAN "\x1b[0;96m"
+
+#else /* LOG_RTT_COLOR_ENABLE == 1 */
+#define RTT_COLOR_CODE_DEFAULT ""
+#define RTT_COLOR_CODE_RED ""
+#define RTT_COLOR_CODE_GREEN ""
+#define RTT_COLOR_CODE_YELLOW ""
+#define RTT_COLOR_CODE_CYAN ""
+#endif /* LOG_RTT_COLOR_ENABLE == 1 */
+
+
+#if (CFG_DEBUG_TRACE != 0)
+/**
+ * Function for outputting code region string.
+ *
+ * @param[inout] aLogString Pointer to log buffer.
+ * @param[in] aMaxSize Maximum size of log buffer.
+ * @param[in] otLogRegion The region ID.
+ *
+ * @returns String with a log level color value.
+ */
+static inline uint16_t logRegion(char *aLogString, uint16_t aMaxSize,
+ appliLogRegion_t aLogRegion)
+{
+ char logRegionString[30U];
+
+ switch (aLogRegion)
+ {
+ case APPLI_LOG_REGION_GENERAL:
+ strcpy(logRegionString, "[M4 APPLICATION]");
+ break;
+ case APPLI_LOG_REGION_OPENTHREAD_API:
+ strcpy(logRegionString, "[M4 OPENTHREAD API]");
+ break;
+ case APPLI_LOG_REGION_OT_API_LINK:
+ strcpy(logRegionString, "[M4 LINK API]");
+ break;
+ case APPLI_LOG_REGION_OT_API_INSTANCE:
+ strcpy(logRegionString, "[M4 INSTANCE API]");
+ break;
+ case APPLI_LOG_REGION_OT_API_MESSAGE:
+ strcpy(logRegionString, "[M4 MESSAGE API]");
+ break;
+ default:
+ strcpy(logRegionString, "[M4]");
+ break;
+ }
+
+ return snprintf(aLogString, aMaxSize, "%s ", logRegionString);
+}
+#endif /* CFG_DEBUG_TRACE */
+
+#if (LOG_RTT_COLOR_ENABLE == 1U)
+#if (CFG_DEBUG_TRACE != 0)
+/**
+ * Function for getting color of a given level log.
+ *
+ * @param[in] aLogLevel The log level.
+ *
+ * @returns String with a log level color value.
+ */
+static inline const char *levelToString(appliLogLevel_t aLogLevel)
+{
+ switch (aLogLevel)
+ {
+ case LOG_LEVEL_CRIT:
+ return RTT_COLOR_CODE_RED;
+
+ case LOG_LEVEL_WARN:
+ return RTT_COLOR_CODE_YELLOW;
+
+ case LOG_LEVEL_INFO:
+ return RTT_COLOR_CODE_GREEN;
+
+ case LOG_LEVEL_DEBG:
+ default:
+ return RTT_COLOR_CODE_DEFAULT;
+ }
+}
+#endif /* CFG_DEBUG_TRACE */
+
+#if (CFG_DEBUG_TRACE != 0)
+/**
+ * Function for printing log level.
+ *
+ * @param[inout] aLogString Pointer to log buffer.
+ * @param[in] aMaxSize Maximum size of log buffer.
+ * @param[in] aLogLevel Log level.
+ *
+ * @returns Number of bytes successfully written to the log buffer.
+ */
+static inline uint16_t logLevel(char *aLogString, uint16_t aMaxSize,
+ appliLogLevel_t aLogLevel)
+{
+ return snprintf(aLogString, aMaxSize, "%s", levelToString(aLogLevel));
+}
+#endif /* CFG_DEBUG_TRACE */
+#endif /* LOG_RTT_COLOR_ENABLE */
+
+#if (LOG_TIMESTAMP_ENABLE == 1U)
+/**
+ * Function for printing actual timestamp.
+ *
+ * @param[inout] aLogString Pointer to the log buffer.
+ * @param[in] aMaxSize Maximum size of the log buffer.
+ *
+ * @returns Number of bytes successfully written to the log buffer.
+ */
+static inline uint16_t logTimestamp(char *aLogString, uint16_t aMaxSize)
+{
+ return snprintf(aLogString, aMaxSize, "%s[%010ld]", RTT_COLOR_CODE_DEFAULT,
+ otPlatAlarmMilliGetNow());
+}
+#endif /* LOG_TIMESTAMP_ENABLE */
+
+
+/**
+ * Function for printing application log
+ *
+ * @param[in] aLogLevel Log level.
+ * @param[in] aLogRegion The region ID.
+ * @param[in] aFormat User string format.
+ *
+ * @returns Number of bytes successfully written to the log buffer.
+ */
+void logApplication(appliLogLevel_t aLogLevel, appliLogRegion_t aLogRegion, const char *aFormat, ...)
+{
+#if (CFG_DEBUG_TRACE != 0) /* Since the traces are disabled, there is nothing to print */
+ uint16_t length = 0;
+ char logString[LOG_PARSE_BUFFER_SIZE + 1U];
+
+#if (LOG_TIMESTAMP_ENABLE == 1U)
+ length += logTimestamp(logString, LOG_PARSE_BUFFER_SIZE);
+#endif
+
+#if (LOG_RTT_COLOR_ENABLE == 1U)
+ /* Add level information */
+ length += logLevel(&logString[length], (LOG_PARSE_BUFFER_SIZE - length),
+ aLogLevel);
+#endif
+
+#if (LOG_REGION_ENABLE == 1U)
+ /* Add Region information */
+ length += logRegion(&logString[length], (LOG_PARSE_BUFFER_SIZE - length),
+ aLogRegion);
+#endif
+
+ /* Parse user string */
+ va_list paramList;
+ va_start(paramList, aFormat);
+ length += vsnprintf(&logString[length], (LOG_PARSE_BUFFER_SIZE - length),
+ aFormat, paramList);
+ logString[length++] = '\r';
+ logString[length++] = '\n';
+ logString[length++] = 0;
+ va_end(paramList);
+
+ if (aLogLevel <= APPLI_CONFIG_LOG_LEVEL)
+ {
+ printf("%s", logString);
+ }else
+ {
+ /* Print nothing */
+ }
+#endif /* CFG_DEBUG_TRACE */
+}
+
+
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/system_stm32wbxx.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/system_stm32wbxx.c
new file mode 100644
index 000000000..79f9bbb64
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/Core/Src/system_stm32wbxx.c
@@ -0,0 +1,352 @@
+/**
+ ******************************************************************************
+ * @file system_stm32wbxx.c
+ * @author MCD Application Team
+ * @brief CMSIS Cortex Device Peripheral Access Layer System Source File
+ *
+ * This file provides two functions and one global variable to be called from
+ * user application:
+ * - SystemInit(): This function is called at startup just after reset and
+ * before branch to main program. This call is made inside
+ * the "startup_stm32wbxx.s" file.
+ *
+ * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used
+ * by the user application to setup the SysTick
+ * timer or configure other parameters.
+ *
+ * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must
+ * be called whenever the core clock is changed
+ * during program execution.
+ *
+ * After each device reset the MSI (4 MHz) is used as system clock source.
+ * Then SystemInit() function is called, in "startup_stm32wbxx.s" file, to
+ * configure the system clock before to branch to main program.
+ *
+ * This file configures the system clock as follows:
+ *=============================================================================
+ *-----------------------------------------------------------------------------
+ * System Clock source | MSI
+ *-----------------------------------------------------------------------------
+ * SYSCLK(Hz) | 4000000
+ *-----------------------------------------------------------------------------
+ * HCLK(Hz) | 4000000
+ *-----------------------------------------------------------------------------
+ * AHB Prescaler | 1
+ *-----------------------------------------------------------------------------
+ * APB1 Prescaler | 1
+ *-----------------------------------------------------------------------------
+ * APB2 Prescaler | 1
+ *-----------------------------------------------------------------------------
+ * PLL_M | 1
+ *-----------------------------------------------------------------------------
+ * PLL_N | 8
+ *-----------------------------------------------------------------------------
+ * PLL_P | 7
+ *-----------------------------------------------------------------------------
+ * PLL_Q | 2
+ *-----------------------------------------------------------------------------
+ * PLL_R | 2
+ *-----------------------------------------------------------------------------
+ * PLLSAI1_P | NA
+ *-----------------------------------------------------------------------------
+ * PLLSAI1_Q | NA
+ *-----------------------------------------------------------------------------
+ * PLLSAI1_R | NA
+ *-----------------------------------------------------------------------------
+ * Require 48MHz for USB OTG FS, | Disabled
+ * SDIO and RNG clock |
+ *-----------------------------------------------------------------------------
+ *=============================================================================
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+
+/** @addtogroup CMSIS
+ * @{
+ */
+
+/** @addtogroup stm32WBxx_system
+ * @{
+ */
+
+/** @addtogroup stm32WBxx_System_Private_Includes
+ * @{
+ */
+
+#include "stm32wbxx.h"
+
+#if !defined (HSE_VALUE)
+ #define HSE_VALUE (32000000UL) /*!< Value of the External oscillator in Hz */
+#endif /* HSE_VALUE */
+
+#if !defined (MSI_VALUE)
+ #define MSI_VALUE (4000000UL) /*!< Value of the Internal oscillator in Hz*/
+#endif /* MSI_VALUE */
+
+#if !defined (HSI_VALUE)
+ #define HSI_VALUE (16000000UL) /*!< Value of the Internal oscillator in Hz*/
+#endif /* HSI_VALUE */
+
+#if !defined (LSI_VALUE)
+ #define LSI_VALUE (32000UL) /*!< Value of LSI in Hz*/
+#endif /* LSI_VALUE */
+
+#if !defined (LSE_VALUE)
+ #define LSE_VALUE (32768UL) /*!< Value of LSE in Hz*/
+#endif /* LSE_VALUE */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_TypesDefinitions
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_Defines
+ * @{
+ */
+
+/*!< Uncomment the following line if you need to relocate your vector Table in
+ Internal SRAM. */
+/* #define VECT_TAB_SRAM */
+#define VECT_TAB_OFFSET 0x0U /*!< Vector Table base offset field.
+ This value must be a multiple of 0x200. */
+
+#define VECT_TAB_BASE_ADDRESS SRAM1_BASE /*!< Vector Table base offset field.
+ This value must be a multiple of 0x200. */
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_Macros
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_Variables
+ * @{
+ */
+ /* The SystemCoreClock variable is updated in three ways:
+ 1) by calling CMSIS function SystemCoreClockUpdate()
+ 2) by calling HAL API function HAL_RCC_GetHCLKFreq()
+ 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
+ Note: If you use this function to configure the system clock; then there
+ is no need to call the 2 first functions listed above, since SystemCoreClock
+ variable is updated automatically.
+ */
+ uint32_t SystemCoreClock = 4000000UL ; /*CPU1: M4 on MSI clock after startup (4MHz)*/
+
+ const uint32_t AHBPrescTable[16UL] = {1UL, 3UL, 5UL, 1UL, 1UL, 6UL, 10UL, 32UL, 2UL, 4UL, 8UL, 16UL, 64UL, 128UL, 256UL, 512UL};
+
+ const uint32_t APBPrescTable[8UL] = {0UL, 0UL, 0UL, 0UL, 1UL, 2UL, 3UL, 4UL};
+
+ const uint32_t MSIRangeTable[16UL] = {100000UL, 200000UL, 400000UL, 800000UL, 1000000UL, 2000000UL, \
+ 4000000UL, 8000000UL, 16000000UL, 24000000UL, 32000000UL, 48000000UL, 0UL, 0UL, 0UL, 0UL}; /* 0UL values are incorrect cases */
+
+ const uint32_t SmpsPrescalerTable[4UL][6UL]={{1UL,3UL,2UL,2UL,1UL,2UL}, \
+ {2UL,6UL,4UL,3UL,2UL,4UL}, \
+ {4UL,12UL,8UL,6UL,4UL,8UL}, \
+ {4UL,12UL,8UL,6UL,4UL,8UL}};
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_FunctionPrototypes
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_Functions
+ * @{
+ */
+
+/**
+ * @brief Setup the microcontroller system.
+ * @param None
+ * @retval None
+ */
+void SystemInit(void)
+{
+ /* Configure the Vector Table location add offset address ------------------*/
+ /**
+ * When the application is expected to be downloaded by OTA, the SCB->VTOR shall not be modified
+ * as it has already been set to the correct value by the BLE_Ota application before jumping
+ * to the current application
+ */
+
+ /* FPU settings ------------------------------------------------------------*/
+ #if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
+ SCB->CPACR |= ((3UL << (10UL*2UL))|(3UL << (11UL*2UL))); /* set CP10 and CP11 Full Access */
+ #endif
+
+ /* Reset the RCC clock configuration to the default reset state ------------*/
+ /* Set MSION bit */
+ RCC->CR |= RCC_CR_MSION;
+
+ /* Reset CFGR register */
+ RCC->CFGR = 0x00070000U;
+
+ /* Reset PLLSAI1ON, PLLON, HSECSSON, HSEON, HSION, and MSIPLLON bits */
+ RCC->CR &= (uint32_t)0xFAF6FEFBU;
+
+ /*!< Reset LSI1 and LSI2 bits */
+ RCC->CSR &= (uint32_t)0xFFFFFFFAU;
+
+ /*!< Reset HSI48ON bit */
+ RCC->CRRCR &= (uint32_t)0xFFFFFFFEU;
+
+ /* Reset PLLCFGR register */
+ RCC->PLLCFGR = 0x22041000U;
+
+ /* Reset PLLSAI1CFGR register */
+ RCC->PLLSAI1CFGR = 0x22041000U;
+
+ /* Reset HSEBYP bit */
+ RCC->CR &= 0xFFFBFFFFU;
+
+ /* Disable all interrupts */
+ RCC->CIER = 0x00000000;
+}
+
+/**
+ * @brief Update SystemCoreClock variable according to Clock Register Values.
+ * The SystemCoreClock variable contains the core clock (HCLK), it can
+ * be used by the user application to setup the SysTick timer or configure
+ * other parameters.
+ *
+ * @note Each time the core clock (HCLK) changes, this function must be called
+ * to update SystemCoreClock variable value. Otherwise, any configuration
+ * based on this variable will be incorrect.
+ *
+ * @note - The system frequency computed by this function is not the real
+ * frequency in the chip. It is calculated based on the predefined
+ * constant and the selected clock source:
+ *
+ * - If SYSCLK source is MSI, SystemCoreClock will contain the MSI_VALUE(*)
+ *
+ * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(**)
+ *
+ * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(***)
+ *
+ * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(***)
+ * or HSI_VALUE(*) or MSI_VALUE(*) multiplied/divided by the PLL factors.
+ *
+ * (*) MSI_VALUE is a constant defined in stm32wbxx_hal.h file (default value
+ * 4 MHz) but the real value may vary depending on the variations
+ * in voltage and temperature.
+ *
+ * (**) HSI_VALUE is a constant defined in stm32wbxx_hal_conf.h file (default value
+ * 16 MHz) but the real value may vary depending on the variations
+ * in voltage and temperature.
+ *
+ * (***) HSE_VALUE is a constant defined in stm32wbxx_hal_conf.h file (default value
+ * 32 MHz), user has to ensure that HSE_VALUE is same as the real
+ * frequency of the crystal used. Otherwise, this function may
+ * have wrong result.
+ *
+ * - The result of this function could be not correct when using fractional
+ * value for HSE crystal.
+ *
+ * @param None
+ * @retval None
+ */
+void SystemCoreClockUpdate(void)
+{
+ uint32_t tmp, msirange, pllvco, pllr, pllsource , pllm;
+
+ /* Get MSI Range frequency--------------------------------------------------*/
+
+ /*MSI frequency range in Hz*/
+ msirange = MSIRangeTable[(RCC->CR & RCC_CR_MSIRANGE) >> RCC_CR_MSIRANGE_Pos];
+
+ /* Get SYSCLK source -------------------------------------------------------*/
+ switch (RCC->CFGR & RCC_CFGR_SWS)
+ {
+ case 0x00: /* MSI used as system clock source */
+ SystemCoreClock = msirange;
+ break;
+
+ case 0x04: /* HSI used as system clock source */
+ /* HSI used as system clock source */
+ SystemCoreClock = HSI_VALUE;
+ break;
+
+ case 0x08: /* HSE used as system clock source */
+ SystemCoreClock = HSE_VALUE;
+ break;
+
+ case 0x0C: /* PLL used as system clock source */
+ /* PLL_VCO = (HSE_VALUE or HSI_VALUE or MSI_VALUE/ PLLM) * PLLN
+ SYSCLK = PLL_VCO / PLLR
+ */
+ pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC);
+ pllm = ((RCC->PLLCFGR & RCC_PLLCFGR_PLLM) >> RCC_PLLCFGR_PLLM_Pos) + 1UL ;
+
+ if(pllsource == 0x02UL) /* HSI used as PLL clock source */
+ {
+ pllvco = (HSI_VALUE / pllm);
+ }
+ else if(pllsource == 0x03UL) /* HSE used as PLL clock source */
+ {
+ pllvco = (HSE_VALUE / pllm);
+ }
+ else /* MSI used as PLL clock source */
+ {
+ pllvco = (msirange / pllm);
+ }
+
+ pllvco = pllvco * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> RCC_PLLCFGR_PLLN_Pos);
+ pllr = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLR) >> RCC_PLLCFGR_PLLR_Pos) + 1UL);
+
+ SystemCoreClock = pllvco/pllr;
+ break;
+
+ default:
+ SystemCoreClock = msirange;
+ break;
+ }
+
+ /* Compute HCLK clock frequency --------------------------------------------*/
+ /* Get HCLK1 prescaler */
+ tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> RCC_CFGR_HPRE_Pos)];
+ /* HCLK clock frequency */
+ SystemCoreClock = SystemCoreClock / tmp;
+
+}
+
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/EWARM/Project.eww b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/EWARM/Project.eww
new file mode 100644
index 000000000..098e07df7
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/EWARM/Project.eww
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workspace>
+ <project>
+ <path>$WS_DIR$\Thread_Coap_Generic_Ota.ewp</path>
+ </project>
+ <batchBuild />
+</workspace>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/EWARM/Thread_Coap_Generic_Ota.ewd b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/EWARM/Thread_Coap_Generic_Ota.ewd
new file mode 100644
index 000000000..9eda7395e
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/EWARM/Thread_Coap_Generic_Ota.ewd
@@ -0,0 +1,1419 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <fileVersion>3</fileVersion>
+ <configuration>
+ <name>Thread_Coap_Generic_Ota</name>
+ <toolchain>
+ <name>ARM</name>
+ </toolchain>
+ <debug>1</debug>
+ <settings>
+ <name>C-SPY</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>29</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CInput</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CEndian</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCVariant</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacFile</name>
+ <state />
+ </option>
+ <option>
+ <name>MemOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MemFile</name>
+ <state />
+ </option>
+ <option>
+ <name>RunToEnable</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RunToName</name>
+ <state>main</state>
+ </option>
+ <option>
+ <name>CExtraOptionsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CExtraOptions</name>
+ <state />
+ </option>
+ <option>
+ <name>CFpuProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCDDFArgumentProducer</name>
+ <state />
+ </option>
+ <option>
+ <name>OCDownloadSuppressDownload</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCDownloadVerifyAll</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCProductVersion</name>
+ <state>7.10.3.6927</state>
+ </option>
+ <option>
+ <name>OCDynDriverList</name>
+ <state>STLINK_ID</state>
+ </option>
+ <option>
+ <name>OCLastSavedByProductVersion</name>
+ <state>8.20.1.14181</state>
+ </option>
+ <option>
+ <name>UseFlashLoader</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CLowLevel</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCBE8Slave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>MacFile2</name>
+ <state />
+ </option>
+ <option>
+ <name>CDevice</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>FlashLoadersV3</name>
+ <state />
+ </option>
+ <option>
+ <name>OCImagesSuppressCheck1</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesPath1</name>
+ <state />
+ </option>
+ <option>
+ <name>OCImagesSuppressCheck2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesPath2</name>
+ <state />
+ </option>
+ <option>
+ <name>OCImagesSuppressCheck3</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesPath3</name>
+ <state />
+ </option>
+ <option>
+ <name>OverrideDefFlashBoard</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesOffset1</name>
+ <state />
+ </option>
+ <option>
+ <name>OCImagesOffset2</name>
+ <state />
+ </option>
+ <option>
+ <name>OCImagesOffset3</name>
+ <state />
+ </option>
+ <option>
+ <name>OCImagesUse1</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesUse2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesUse3</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCDeviceConfigMacroFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCDebuggerExtraOption</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCAllMTBOptions</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCMulticoreNrOfCores</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCMulticoreMaster</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCMulticorePort</name>
+ <state>53461</state>
+ </option>
+ <option>
+ <name>OCMulticoreWorkspace</name>
+ <state />
+ </option>
+ <option>
+ <name>OCMulticoreSlaveProject</name>
+ <state />
+ </option>
+ <option>
+ <name>OCMulticoreSlaveConfiguration</name>
+ <state />
+ </option>
+ <option>
+ <name>OCDownloadExtraImage</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCAttachSlave</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MassEraseBeforeFlashing</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>ARMSIM_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>1</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCSimDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCSimEnablePSP</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCSimPspOverrideConfig</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCSimPspConfigFile</name>
+ <state />
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>CADI_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CCadiMemory</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>Fast Model</name>
+ <state />
+ </option>
+ <option>
+ <name>CCADILogFileCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCADILogFileEditB</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>CMSISDAP_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>4</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CatchSFERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCIarProbeScriptFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CMSISDAPResetList</name>
+ <version>1</version>
+ <state>10</state>
+ </option>
+ <option>
+ <name>CMSISDAPHWResetDuration</name>
+ <state>300</state>
+ </option>
+ <option>
+ <name>CMSISDAPHWResetDelay</name>
+ <state>200</state>
+ </option>
+ <option>
+ <name>CMSISDAPDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CMSISDAPInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPMultiTargetEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPMultiTarget</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPJtagSpeedList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPBreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPRestoreBreakpointsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPUpdateBreakpointsEdit</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>RDICatchReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchUndef</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchSWI</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchData</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchPrefetch</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchIRQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchFIQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CatchMMERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchNOCPERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchCHKERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchSTATERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchBUSERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchINTERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchHARDERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPMultiCPUEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPMultiCPUNumber</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCProbeCfgOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCProbeConfig</name>
+ <state />
+ </option>
+ <option>
+ <name>CMSISDAPProbeConfigRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPSelectedCPUBehaviour</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ICpuName</name>
+ <state />
+ </option>
+ <option>
+ <name>OCJetEmuParams</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCCMSISDAPUsbSerialNo</name>
+ <state />
+ </option>
+ <option>
+ <name>CCCMSISDAPUsbSerialNoSelect</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>GDBSERVER_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>TCPIP</name>
+ <state>aaa.bbb.ccc.ddd</state>
+ </option>
+ <option>
+ <name>DoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>LogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCJTagBreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJTagDoUpdateBreakpoints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJTagUpdateBreakpoints</name>
+ <state>_call_main</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>IJET_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>8</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CatchSFERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCIarProbeScriptFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IjetResetList</name>
+ <version>1</version>
+ <state>10</state>
+ </option>
+ <option>
+ <name>IjetHWResetDuration</name>
+ <state>300</state>
+ </option>
+ <option>
+ <name>IjetHWResetDelay</name>
+ <state>200</state>
+ </option>
+ <option>
+ <name>IjetPowerFromProbe</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IjetPowerRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>IjetInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetMultiTargetEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetMultiTarget</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetScanChainNonARMDevices</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetIRLength</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetJtagSpeedList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetProtocolRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetSwoPin</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetCpuClockEdit</name>
+ <state>72.0</state>
+ </option>
+ <option>
+ <name>IjetSwoPrescalerList</name>
+ <version>1</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetBreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetRestoreBreakpointsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetUpdateBreakpointsEdit</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>RDICatchReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchUndef</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchSWI</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchData</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchPrefetch</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchIRQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchFIQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CatchMMERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchNOCPERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchCHKERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchSTATERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchBUSERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchINTERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchHARDERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCProbeCfgOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCProbeConfig</name>
+ <state />
+ </option>
+ <option>
+ <name>IjetProbeConfigRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetMultiCPUEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetMultiCPUNumber</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetSelectedCPUBehaviour</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ICpuName</name>
+ <state />
+ </option>
+ <option>
+ <name>OCJetEmuParams</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IjetPreferETB</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IjetTraceSettingsList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetTraceSizeList</name>
+ <version>0</version>
+ <state>4</state>
+ </option>
+ <option>
+ <name>FlashBoardPathSlave</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCIjetUsbSerialNo</name>
+ <state />
+ </option>
+ <option>
+ <name>CCIjetUsbSerialNoSelect</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>JLINK_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>16</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CCCatchSFERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>JLinkSpeed</name>
+ <state>1000</state>
+ </option>
+ <option>
+ <name>CCJLinkDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCJLinkHWResetDelay</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>JLinkInitialSpeed</name>
+ <state>1000</state>
+ </option>
+ <option>
+ <name>CCDoJlinkMultiTarget</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCScanChainNonARMDevices</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkMultiTarget</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkIRLength</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkCommRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkTCPIP</name>
+ <state>aaa.bbb.ccc.ddd</state>
+ </option>
+ <option>
+ <name>CCJLinkSpeedRadioV2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCUSBDevice</name>
+ <version>1</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCRDICatchReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchUndef</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchSWI</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchData</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchPrefetch</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchIRQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchFIQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkBreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkDoUpdateBreakpoints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkUpdateBreakpoints</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>CCJLinkInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkResetList</name>
+ <version>6</version>
+ <state>7</state>
+ </option>
+ <option>
+ <name>CCJLinkInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchMMERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchNOCPERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchCHRERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchSTATERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchBUSERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchINTERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchHARDERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCJLinkScriptFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCJLinkUsbSerialNo</name>
+ <state />
+ </option>
+ <option>
+ <name>CCTcpIpAlt</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkTcpIpSerialNo</name>
+ <state />
+ </option>
+ <option>
+ <name>CCCpuClockEdit</name>
+ <state>72.0</state>
+ </option>
+ <option>
+ <name>CCSwoClockAuto</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSwoClockEdit</name>
+ <state>2000</state>
+ </option>
+ <option>
+ <name>OCJLinkTraceSource</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCJLinkTraceSourceDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCJLinkDeviceName</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>LMIFTDI_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>2</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>LmiftdiSpeed</name>
+ <state>500</state>
+ </option>
+ <option>
+ <name>CCLmiftdiDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCLmiftdiLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCLmiFtdiInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCLmiFtdiInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>PEMICRO_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>3</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCJPEMicroShowSettings</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>DoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>LogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>STLINK_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>4</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCSTLinkInterfaceRadio</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCSTLinkInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkResetList</name>
+ <version>3</version>
+ <state>4</state>
+ </option>
+ <option>
+ <name>CCCpuClockEdit</name>
+ <state>32.0</state>
+ </option>
+ <option>
+ <name>CCSwoClockAuto</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSwoClockEdit</name>
+ <state>2000</state>
+ </option>
+ <option>
+ <name>DoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>LogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCSTLinkDoUpdateBreakpoints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkUpdateBreakpoints</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchMMERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchNOCPERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchCHRERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchSTATERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchBUSERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchINTERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchSFERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchHARDERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkUsbSerialNo</name>
+ <state />
+ </option>
+ <option>
+ <name>CCSTLinkUsbSerialNoSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkJtagSpeedList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkDAPNumber</name>
+ <state />
+ </option>
+ <option>
+ <name>CCSTLinkDebugAccessPortRadio</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>THIRDPARTY_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CThirdPartyDriverDll</name>
+ <state>###Uninitialized###</state>
+ </option>
+ <option>
+ <name>CThirdPartyLogFileCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CThirdPartyLogFileEditB</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>TIFET_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>1</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCMSPFetResetList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetTargetVccTypeDefault</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetTargetVoltage</name>
+ <state>###Uninitialized###</state>
+ </option>
+ <option>
+ <name>CCMSPFetVCCDefault</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCMSPFetTargetSettlingtime</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetRadioJtagSpeedType</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCMSPFetConnection</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetUsbComPort</name>
+ <state>Automatic</state>
+ </option>
+ <option>
+ <name>CCMSPFetAllowAccessToBSL</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCMSPFetRadioEraseFlash</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>XDS100_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>6</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>TIPackageOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>TIPackage</name>
+ <state />
+ </option>
+ <option>
+ <name>BoardFile</name>
+ <state />
+ </option>
+ <option>
+ <name>DoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>LogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCXds100BreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100DoUpdateBreakpoints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100UpdateBreakpoints</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>CCXds100CatchReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchUndef</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchSWI</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchData</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchPrefetch</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchIRQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchFIQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchMMERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchNOCPERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchCHRERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchSTATERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchBUSERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchINTERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchSFERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchHARDERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CpuClockEdit</name>
+ <state />
+ </option>
+ <option>
+ <name>CCXds100SwoClockAuto</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100SwoClockEdit</name>
+ <state>1000</state>
+ </option>
+ <option>
+ <name>CCXds100HWResetDelay</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100ResetList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100UsbSerialNo</name>
+ <state />
+ </option>
+ <option>
+ <name>CCXds100UsbSerialNoSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100JtagSpeedList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100InterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100InterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100ProbeList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100SWOPortRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100SWOPort</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <debuggerPlugins>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\Mbed\MbedArmPlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin</file>
+ <loadFlag>1</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\TargetAccessServer\TargetAccessServer.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ </debuggerPlugins>
+ </configuration>
+</project>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/EWARM/Thread_Coap_Generic_Ota.ewp b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/EWARM/Thread_Coap_Generic_Ota.ewp
new file mode 100644
index 000000000..1734bbc70
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/EWARM/Thread_Coap_Generic_Ota.ewp
@@ -0,0 +1,1304 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <fileVersion>3</fileVersion>
+ <configuration>
+ <name>Thread_Coap_Generic_Ota</name>
+ <toolchain>
+ <name>ARM</name>
+ </toolchain>
+ <debug>1</debug>
+ <settings>
+ <name>General</name>
+ <archiveVersion>3</archiveVersion>
+ <data>
+ <version>30</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>ExePath</name>
+ <state>Thread_Coap_Generic_Ota/Exe</state>
+ </option>
+ <option>
+ <name>ObjPath</name>
+ <state>Thread_Coap_Generic_Ota/Obj</state>
+ </option>
+ <option>
+ <name>ListPath</name>
+ <state>Thread_Coap_Generic_Ota/List</state>
+ </option>
+ <option>
+ <name>GEndianMode</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>Input description</name>
+ <state>Full formatting, with multibyte support.</state>
+ </option>
+ <option>
+ <name>Output description</name>
+ <state>Full formatting, with multibyte support.</state>
+ </option>
+ <option>
+ <name>GOutputBinary</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGCoreOrChip</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>GRuntimeLibSelect</name>
+ <version>0</version>
+ <state>2</state>
+ </option>
+ <option>
+ <name>GRuntimeLibSelectSlave</name>
+ <version>0</version>
+ <state>2</state>
+ </option>
+ <option>
+ <name>RTDescription</name>
+ <state>Use the full configuration of the C/C++ runtime library. Full locale interface, C locale, file descriptor support, multibytes in printf and scanf, and hex floats in strtod.</state>
+ </option>
+ <option>
+ <name>OGProductVersion</name>
+ <state>4.41A</state>
+ </option>
+ <option>
+ <name>OGLastSavedByProductVersion</name>
+ <state>8.20.2.14834</state>
+ </option>
+ <option>
+ <name>GeneralEnableMisra</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GeneralMisraVerbose</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGChipSelectEditMenu</name>
+ <state>STM32WB55RG ST STM32WB55RG</state>
+ </option>
+ <option>
+ <name>GenLowLevelInterface</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>GEndianModeBE</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OGBufferedTerminalOutput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GenStdoutInterface</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GeneralMisraRules98</name>
+ <version>0</version>
+ <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
+ </option>
+ <option>
+ <name>GeneralMisraVer</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GeneralMisraRules04</name>
+ <version>0</version>
+ <state>011111111111111110111111111111011111111111111011110100111111111111111111111111111111111111111111101111111111111011111111111111111111111111111</state>
+ </option>
+ <option>
+ <name>RTConfigPath2</name>
+ <state>$TOOLKIT_DIR$\INC\c\DLib_Config_Full.h</state>
+ </option>
+ <option>
+ <name>GBECoreSlave</name>
+ <version>26</version>
+ <state>39</state>
+ </option>
+ <option>
+ <name>OGUseCmsis</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGUseCmsisDspLib</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GRuntimeLibThreads</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CoreVariant</name>
+ <version>26</version>
+ <state>39</state>
+ </option>
+ <option>
+ <name>GFPUDeviceSlave</name>
+ <state>STM32WB55RG ST STM32WB55RG</state>
+ </option>
+ <option>
+ <name>FPU2</name>
+ <version>0</version>
+ <state>4</state>
+ </option>
+ <option>
+ <name>NrRegs</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>NEON</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GFPUCoreSlave2</name>
+ <version>26</version>
+ <state>39</state>
+ </option>
+ <option>
+ <name>OGCMSISPackSelectDevice</name>
+ </option>
+ <option>
+ <name>OgLibHeap</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGLibAdditionalLocale</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGPrintfVariant</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OGPrintfMultibyteSupport</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OGScanfVariant</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OGScanfMultibyteSupport</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>GenLocaleTags</name>
+ <state></state>
+ </option>
+ <option>
+ <name>GenLocaleDisplayOnly</name>
+ <state></state>
+ </option>
+ <option>
+ <name>DSPExtension</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>TrustZone</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>ICCARM</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>34</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CCOptimizationNoSizeConstraints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCDefines</name>
+ <state>OPENTHREAD_CONFIG_FILE=&lt;openthread_api_config_ftd.h&gt;</state>
+ <state>USE_HAL_DRIVER</state>
+ <state>STM32WB55xx</state>
+ <state>USE_STM32WBXX_NUCLEO</state>
+ <state>THREAD_WB</state>
+ </option>
+ <option>
+ <name>CCPreprocFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPreprocComments</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPreprocLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListCFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListCMnemonics</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListCMessages</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListAssFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListAssSource</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCEnableRemarks</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCDiagSuppress</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCDiagRemark</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCDiagWarning</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCDiagError</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCObjPrefix</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCAllowList</name>
+ <version>1</version>
+ <state>11111110</state>
+ </option>
+ <option>
+ <name>CCDebugInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IEndianMode</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IExtraOptionsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IExtraOptions</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCLangConformance</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSignedPlainChar</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCRequirePrototypes</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCDiagWarnAreErr</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCompilerRuntimeInfo</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IFpuProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OutputFile</name>
+ <state>$FILE_BNAME$.o</state>
+ </option>
+ <option>
+ <name>CCLibConfigHeader</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>PreInclude</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CompilerMisraOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCIncludePath2</name>
+ <state>$PROJ_DIR$/../Core/Inc</state>
+ <state>$PROJ_DIR$/../STM32_WPAN/App</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/BSP/P-NUCLEO-WB55.Nucleo</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/STM32WBxx_HAL_Driver/Inc</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/STM32WBxx_HAL_Driver/Inc/Legacy</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/utilities</state>
+ <state>$PROJ_DIR$/../../../../../../Utilities/lpm/tiny_lpm</state>
+ <state>$PROJ_DIR$/../../../../../../Utilities/sequencer</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/CMSIS/Device/ST/STM32WBxx/Include</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/thread/openthread/core/openthread_api</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/thread/openthread/stack/include</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/thread/openthread/stack/include/openthread</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/thread/openthread/stack/include/openthread/platform</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/CMSIS/Include</state>
+ </option>
+ <option>
+ <name>CCStdIncCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCodeSection</name>
+ <state>.text</state>
+ </option>
+ <option>
+ <name>IProcessorMode2</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCOptLevel</name>
+ <state>3</state>
+ </option>
+ <option>
+ <name>CCOptStrategy</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCOptLevelSlave</name>
+ <state>3</state>
+ </option>
+ <option>
+ <name>CompilerMisraRules98</name>
+ <version>0</version>
+ <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
+ </option>
+ <option>
+ <name>CompilerMisraRules04</name>
+ <version>0</version>
+ <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
+ </option>
+ <option>
+ <name>CCPosIndRopi</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPosIndRwpi</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPosIndNoDynInit</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccLang</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccCDialect</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IccAllowVLA</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccStaticDestr</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccCppInlineSemantics</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccCmsis</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IccFloatSemantics</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCNoLiteralPool</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCOptStrategySlave</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCGuardCalls</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCEncSource</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCEncOutput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCEncOutputBom</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCEncInput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccExceptions2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccRTTI2</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>AARM</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>10</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>AObjPrefix</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AEndian</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>ACaseSensitivity</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>MacroChars</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AWarnEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AWarnWhat</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AWarnOne</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AWarnRange1</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AWarnRange2</name>
+ <state></state>
+ </option>
+ <option>
+ <name>ADebug</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AltRegisterNames</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ADefines</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AList</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AListHeader</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AListing</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>Includes</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacDefs</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacExps</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>MacExec</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OnlyAssed</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MultiLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>PageLengthCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>PageLength</name>
+ <state>80</state>
+ </option>
+ <option>
+ <name>TabSpacing</name>
+ <state>8</state>
+ </option>
+ <option>
+ <name>AXRef</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AXRefDefines</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AXRefInternal</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AXRefDual</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AFpuProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AOutputFile</name>
+ <state>$FILE_BNAME$.o</state>
+ </option>
+ <option>
+ <name>ALimitErrorsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ALimitErrorsEdit</name>
+ <state>100</state>
+ </option>
+ <option>
+ <name>AIgnoreStdInclude</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AUserIncludes</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AExtraOptionsCheckV2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AExtraOptionsV2</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AsmNoLiteralPool</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>OBJCOPY</name>
+ <archiveVersion>0</archiveVersion>
+ <data>
+ <version>1</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OOCOutputFormat</name>
+ <version>3</version>
+ <state>3</state>
+ </option>
+ <option>
+ <name>OCOutputOverride</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OOCOutputFile</name>
+ <state>Thread_Coap_Generic_Ota.bin</state>
+ </option>
+ <option>
+ <name>OOCCommandLineProducer</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OOCObjCopyEnable</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>CUSTOM</name>
+ <archiveVersion>3</archiveVersion>
+ <data>
+ <extensions></extensions>
+ <cmdline></cmdline>
+ <hasPrio>0</hasPrio>
+ </data>
+ </settings>
+ <settings>
+ <name>BICOMP</name>
+ <archiveVersion>0</archiveVersion>
+ <data />
+ </settings>
+ <settings>
+ <name>BUILDACTION</name>
+ <archiveVersion>1</archiveVersion>
+ <data>
+ <prebuild></prebuild>
+ <postbuild></postbuild>
+ </data>
+ </settings>
+ <settings>
+ <name>ILINK</name>
+ <archiveVersion>0</archiveVersion>
+ <data>
+ <version>20</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>IlinkLibIOConfig</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>XLinkMisraHandler</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkInputFileSlave</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkOutputFile</name>
+ <state>Thread_Coap_Generic_Ota.out</state>
+ </option>
+ <option>
+ <name>IlinkDebugInfoEnable</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkKeepSymbols</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinaryFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinarySymbol</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinarySegment</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinaryAlign</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkDefines</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkConfigDefines</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkMapFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkLogFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogInitialization</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogModule</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogSection</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogVeneer</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkIcfOverride</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkIcfFile</name>
+ <state>$PROJ_DIR$\stm32wb55xx_flash_cm4_ota.icf</state>
+ </option>
+ <option>
+ <name>IlinkIcfFileSlave</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkEnableRemarks</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkSuppressDiags</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkTreatAsRem</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkTreatAsWarn</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkTreatAsErr</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkWarningsAreErrors</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkUseExtraOptions</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkExtraOptions</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkLowLevelInterfaceSlave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkAutoLibEnable</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkAdditionalLibs</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkOverrideProgramEntryLabel</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkProgramEntryLabelSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkProgramEntryLabel</name>
+ <state>__iar_program_start</state>
+ </option>
+ <option>
+ <name>DoFill</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>FillerByte</name>
+ <state>0xFF</state>
+ </option>
+ <option>
+ <name>FillerStart</name>
+ <state>0x0</state>
+ </option>
+ <option>
+ <name>FillerEnd</name>
+ <state>0x0</state>
+ </option>
+ <option>
+ <name>CrcSize</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcAlign</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcPoly</name>
+ <state>0x11021</state>
+ </option>
+ <option>
+ <name>CrcCompl</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CrcBitOrder</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CrcInitialValue</name>
+ <state>0x0</state>
+ </option>
+ <option>
+ <name>DoCrc</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkBE8Slave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkBufferedTerminalOutput</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkStdoutInterfaceSlave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcFullSize</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkIElfToolPostProcess</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogAutoLibSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogRedirSymbols</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogUnusedFragments</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkCrcReverseByteOrder</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkCrcUseAsInput</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptInline</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkOptExceptionsAllow</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptExceptionsForce</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkCmsis</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptMergeDuplSections</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkOptUseVfe</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptForceVfe</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkStackAnalysisEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkStackControlFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkStackCallGraphFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CrcAlgorithm</name>
+ <version>1</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcUnitSize</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkThreadsSlave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkLogCallGraph</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkIcfFile_AltDefault</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkEncInput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkEncOutput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkEncOutputBom</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkHeapSelect</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkLocaleSelect</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>IARCHIVE</name>
+ <archiveVersion>0</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>IarchiveInputs</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IarchiveOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IarchiveOutput</name>
+ <state>###Unitialized###</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>BILINK</name>
+ <archiveVersion>0</archiveVersion>
+ <data />
+ </settings>
+ </configuration>
+ <group>
+ <name>Application</name>
+ <group>
+ <name>EWARM</name>
+ <file>
+ <name>$PROJ_DIR$\startup_stm32wb55xx_cm4.s</name>
+ </file>
+ </group>
+ <group>
+ <name>User</name>
+ <group>
+ <name>Core</name>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\app_entry.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\stm32_lpm_if.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\hw_timerserver.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\hw_uart.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\main.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\stm32wbxx_hal_msp.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\stm32wbxx_it.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\stm_logging.c</name>
+ </file>
+ </group>
+ <group>
+ <name>STM32_WPAN</name>
+ <group>
+ <name>App</name>
+ <file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\App\app_thread.c</name>
+ </file>
+ </group>
+ <group>
+ <name>Target</name>
+ <file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\Target\hw_ipcc.c</name>
+ </file>
+ </group>
+ </group>
+ </group>
+ </group>
+ <group>
+ <name>Drivers</name>
+ <group>
+ <name>BSP</name>
+ <group>
+ <name>P-NUCLEO-WB55.Nucleo</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\BSP\P-NUCLEO-WB55.Nucleo\stm32wbxx_nucleo.c</name>
+ </file>
+ </group>
+ </group>
+ <group>
+ <name>CMSIS</name>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\system_stm32wbxx.c</name>
+ </file>
+ </group>
+ <group>
+ <name>STM32WBxx_HAL_Driver</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_cortex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_dma.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_dma_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_exti.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_flash.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_flash_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_gpio.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_hsem.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_pwr.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_pwr_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rcc.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rcc_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rtc.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rtc_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_tim.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_tim_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_uart.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_uart_ex.c</name>
+ </file>
+ </group>
+ </group>
+ <group>
+ <name>Middlewares</name>
+ <group>
+ <name>STM32_WPAN</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\channel_manager.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\channel_monitor.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\child_supervision.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\coap.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\commissioner.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\crypto.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\dataset.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\dataset_ftd.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\utilities\dbg_trace.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\dhcp6_client.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\dhcp6_server.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\diag.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\dns.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\icmp6.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\instance.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\ip6.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\jam_detection.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\joiner.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\link.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\link_raw.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\message.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\netdata.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\openthread.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\openthread_api_wb.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\utilities\otp.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\radio.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\server.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\shci\shci.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\shci_tl.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\utilities\stm_list.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\utilities\stm_queue.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\tasklet.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\thread.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\thread_ftd.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\shci_tl_if.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\tl_mbox.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\tl_thread_hci.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\udp.c</name>
+ </file>
+ </group>
+ </group>
+ <group>
+ <name>Utilities</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Utilities\lpm\tiny_lpm\stm32_lpm.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Utilities\sequencer\stm32_seq.c</name>
+ </file>
+ </group>
+</project>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/EWARM/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/EWARM/startup_stm32wb55xx_cm4.s
new file mode 100644
index 000000000..1f886ff59
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/EWARM/startup_stm32wb55xx_cm4.s
@@ -0,0 +1,517 @@
+;******************************************************************************
+;* File Name : startup_stm32wb55xx_cm4.s
+;* Author : MCD Application Team
+;* Description : M4 core vector table of the STM32WB55xx devices for the
+;* IAR (EWARM) toolchain.
+;*
+;* This module performs:
+;* - Set the initial SP
+;* - Set the initial PC == _iar_program_start,
+;* - Set the vector table entries with the exceptions ISR
+;* address.
+;* - Branches to main in the C library (which eventually
+;* calls main()).
+;* After Reset the Cortex-M4 processor is in Thread mode,
+;* priority is Privileged, and the Stack is set to Main.
+;******************************************************************************
+;* @attention
+;*
+;* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+;* All rights reserved.</center></h2>
+;*
+;* This software component is licensed by ST under BSD 3-Clause license,
+;* the "License"; You may not use this file except in compliance with the
+;* License. You may obtain a copy of the License at:
+;* opensource.org/licenses/BSD-3-Clause
+;*
+;******************************************************************************
+;
+;
+; The modules in this file are included in the libraries, and may be replaced
+; by any user-defined modules that define the PUBLIC symbol _program_start or
+; a user defined start symbol.
+; To override the cstartup defined in the library, simply add your modified
+; version to the workbench project.
+;
+; The vector table is normally located at address 0.
+; When debugging in RAM, it can be located in RAM, aligned to at least 2^6.
+; The name "__vector_table" has special meaning for C-SPY:
+; it is where the SP start value is found, and the NVIC vector
+; table register (VTOR) is initialized to this address if != 0.
+;
+; Cortex-M version
+;
+
+ MODULE ?cstartup
+
+ ;; Forward declaration of sections.
+ SECTION CSTACK:DATA:NOROOT(3)
+
+ SECTION .intvec:CODE:NOROOT(2)
+
+ EXTERN __iar_program_start
+ EXTERN SystemInit
+ PUBLIC __vector_table
+
+ DATA
+__vector_table
+ DCD sfe(CSTACK)
+ DCD Reset_Handler ; Reset Handler
+
+ DCD NMI_Handler ; NMI Handler
+ DCD HardFault_Handler ; Hard Fault Handler
+ DCD MemManage_Handler ; MPU Fault Handler
+ DCD BusFault_Handler ; Bus Fault Handler
+ DCD UsageFault_Handler ; Usage Fault Handler
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD SVC_Handler ; SVCall Handler
+ DCD DebugMon_Handler ; Debug Monitor Handler
+ DCD 0 ; Reserved
+ DCD PendSV_Handler ; PendSV Handler
+ DCD SysTick_Handler ; SysTick Handler
+
+ ; External Interrupts
+ DCD WWDG_IRQHandler ; Window WatchDog
+ DCD PVD_PVM_IRQHandler ; PVD and PVM Interrupt
+ DCD TAMP_STAMP_LSECSS_IRQHandler ; RTC Tamper, TimeStamp Interrupts and LSECSS Interrupts
+ DCD RTC_WKUP_IRQHandler ; RTC Wakeup Interrupt
+ DCD FLASH_IRQHandler ; FLASH global Interrupt
+ DCD RCC_IRQHandler ; RCC Interrupt
+ DCD EXTI0_IRQHandler ; EXTI Line 0 Interrupt
+ DCD EXTI1_IRQHandler ; EXTI Line 1 Interrupt
+ DCD EXTI2_IRQHandler ; EXTI Line 2 Interrupt
+ DCD EXTI3_IRQHandler ; EXTI Line 3 Interrup
+ DCD EXTI4_IRQHandler ; EXTI Line 4 Interrupt
+ DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 Interrupt
+ DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2 Interrupt
+ DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3 Interrupt
+ DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4 Interrupt
+ DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5 Interrupt
+ DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6 Interrupt
+ DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7 Interrupt
+ DCD ADC1_IRQHandler ; ADC1 Interrupt
+ DCD USB_HP_IRQHandler ; USB High Priority Interrupt
+ DCD USB_LP_IRQHandler ; USB Low Priority Interrupt
+ DCD C2SEV_PWR_C2H_IRQHandler ; CPU M0+ SEV Interrupt
+ DCD COMP_IRQHandler ; COMP1 and COMP2 Interrupts
+ DCD EXTI9_5_IRQHandler ; EXTI Lines [9:5] Interrupt
+ DCD TIM1_BRK_IRQHandler ; TIM1 Break Interrupt
+ DCD TIM1_UP_TIM16_IRQHandler ; TIM1 Update and TIM16 global Interrupts
+ DCD TIM1_TRG_COM_TIM17_IRQHandler ; TIM1 Trigger and Communication and TIM17 global Interrupts
+ DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare Interrupt
+ DCD TIM2_IRQHandler ; TIM2 Global Interrupt
+ DCD PKA_IRQHandler ; PKA Interrupt
+ DCD I2C1_EV_IRQHandler ; I2C1 Event Interrupt
+ DCD I2C1_ER_IRQHandler ; I2C1 Error Interrupt
+ DCD I2C3_EV_IRQHandler ; I2C3 Event Interrupt
+ DCD I2C3_ER_IRQHandler ; I2C3 Error Interrupt
+ DCD SPI1_IRQHandler ; SPI1 Interrupt
+ DCD SPI2_IRQHandler ; SPI2 Interrupt
+ DCD USART1_IRQHandler ; USART1 Interrupt
+ DCD LPUART1_IRQHandler ; LPUART1 Interrupt
+ DCD SAI1_IRQHandler ; SAI Interrupt
+ DCD TSC_IRQHandler ; TSC Interrupt
+ DCD EXTI15_10_IRQHandler ; EXTI Lines1[15:10 ]Interrupts
+ DCD RTC_Alarm_IRQHandler ; RTC Alarms (A and B) Interrupt
+ DCD CRS_IRQHandler ; CRS interrupt
+ DCD PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler ; WKUP Interrupt from PWR
+ DCD IPCC_C1_RX_IRQHandler ; IPCC CPU1 RX occupied interrupt
+ DCD IPCC_C1_TX_IRQHandler ; IPCC CPU1 RX free interrupt
+ DCD HSEM_IRQHandler ; HSEM0 Interrupt
+ DCD LPTIM1_IRQHandler ; LPTIM1 Interrupt
+ DCD LPTIM2_IRQHandler ; LPTIM2 Interrupt
+ DCD LCD_IRQHandler ; LCD Interrupt
+ DCD QUADSPI_IRQHandler ; QUADSPI Interrupt
+ DCD AES1_IRQHandler ; AES1 Interrupt
+ DCD AES2_IRQHandler ; AES2 Interrupt
+ DCD RNG_IRQHandler ; RNG1 Interrupt
+ DCD FPU_IRQHandler ; FPU Interrupt
+ DCD DMA2_Channel1_IRQHandler ; DMA2 Channel 1 Interrupt
+ DCD DMA2_Channel2_IRQHandler ; DMA2 Channel 2 Interrupt
+ DCD DMA2_Channel3_IRQHandler ; DMA2 Channel 3 Interrupt
+ DCD DMA2_Channel4_IRQHandler ; DMA2 Channel 4 Interrupt
+ DCD DMA2_Channel5_IRQHandler ; DMA2 Channel 5 Interrupt
+ DCD DMA2_Channel6_IRQHandler ; DMA2 Channel 6 Interrupt
+ DCD DMA2_Channel7_IRQHandler ; DMA2 Channel 7 Interrupt
+ DCD DMAMUX1_OVR_IRQHandler ; DMAMUX overrun Interrupt
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Default interrupt handlers.
+;;
+ THUMB
+
+ PUBWEAK Reset_Handler
+ SECTION .text:CODE:NOROOT:REORDER(2)
+Reset_Handler
+ LDR R0, =SystemInit
+ BLX R0
+ LDR R0, =__iar_program_start
+ BX R0
+
+ PUBWEAK NMI_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+NMI_Handler
+ B NMI_Handler
+
+ PUBWEAK HardFault_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+HardFault_Handler
+ B HardFault_Handler
+
+ PUBWEAK MemManage_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+MemManage_Handler
+ B MemManage_Handler
+
+ PUBWEAK BusFault_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+BusFault_Handler
+ B BusFault_Handler
+
+ PUBWEAK UsageFault_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+UsageFault_Handler
+ B UsageFault_Handler
+
+ PUBWEAK SVC_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SVC_Handler
+ B SVC_Handler
+
+ PUBWEAK DebugMon_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DebugMon_Handler
+ B DebugMon_Handler
+
+ PUBWEAK PendSV_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+PendSV_Handler
+ B PendSV_Handler
+
+ PUBWEAK SysTick_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SysTick_Handler
+ B SysTick_Handler
+
+ PUBWEAK WWDG_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+WWDG_IRQHandler
+ B WWDG_IRQHandler
+
+ PUBWEAK PVD_PVM_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+PVD_PVM_IRQHandler
+ B PVD_PVM_IRQHandler
+
+ PUBWEAK TAMP_STAMP_LSECSS_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TAMP_STAMP_LSECSS_IRQHandler
+ B TAMP_STAMP_LSECSS_IRQHandler
+
+ PUBWEAK RTC_WKUP_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+RTC_WKUP_IRQHandler
+ B RTC_WKUP_IRQHandler
+
+ PUBWEAK FLASH_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+FLASH_IRQHandler
+ B FLASH_IRQHandler
+
+ PUBWEAK RCC_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+RCC_IRQHandler
+ B RCC_IRQHandler
+
+ PUBWEAK EXTI0_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI0_IRQHandler
+ B EXTI0_IRQHandler
+
+ PUBWEAK EXTI1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI1_IRQHandler
+ B EXTI1_IRQHandler
+
+ PUBWEAK EXTI2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI2_IRQHandler
+ B EXTI2_IRQHandler
+
+ PUBWEAK EXTI3_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI3_IRQHandler
+ B EXTI3_IRQHandler
+
+ PUBWEAK EXTI4_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI4_IRQHandler
+ B EXTI4_IRQHandler
+
+ PUBWEAK DMA1_Channel1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel1_IRQHandler
+ B DMA1_Channel1_IRQHandler
+
+ PUBWEAK DMA1_Channel2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel2_IRQHandler
+ B DMA1_Channel2_IRQHandler
+
+ PUBWEAK DMA1_Channel3_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel3_IRQHandler
+ B DMA1_Channel3_IRQHandler
+
+ PUBWEAK DMA1_Channel4_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel4_IRQHandler
+ B DMA1_Channel4_IRQHandler
+
+ PUBWEAK DMA1_Channel5_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel5_IRQHandler
+ B DMA1_Channel5_IRQHandler
+
+ PUBWEAK DMA1_Channel6_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel6_IRQHandler
+ B DMA1_Channel6_IRQHandler
+
+ PUBWEAK DMA1_Channel7_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel7_IRQHandler
+ B DMA1_Channel7_IRQHandler
+
+ PUBWEAK ADC1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+ADC1_IRQHandler
+ B ADC1_IRQHandler
+
+ PUBWEAK USB_HP_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+USB_HP_IRQHandler
+ B USB_HP_IRQHandler
+
+ PUBWEAK USB_LP_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+USB_LP_IRQHandler
+ B USB_LP_IRQHandler
+
+ PUBWEAK C2SEV_PWR_C2H_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+C2SEV_PWR_C2H_IRQHandler
+ B C2SEV_PWR_C2H_IRQHandler
+
+ PUBWEAK COMP_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+COMP_IRQHandler
+ B COMP_IRQHandler
+
+ PUBWEAK EXTI9_5_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI9_5_IRQHandler
+ B EXTI9_5_IRQHandler
+
+ PUBWEAK TIM1_BRK_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM1_BRK_IRQHandler
+ B TIM1_BRK_IRQHandler
+
+ PUBWEAK TIM1_UP_TIM16_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM1_UP_TIM16_IRQHandler
+ B TIM1_UP_TIM16_IRQHandler
+
+ PUBWEAK TIM1_TRG_COM_TIM17_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM1_TRG_COM_TIM17_IRQHandler
+ B TIM1_TRG_COM_TIM17_IRQHandler
+
+ PUBWEAK TIM1_CC_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM1_CC_IRQHandler
+ B TIM1_CC_IRQHandler
+
+ PUBWEAK TIM2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM2_IRQHandler
+ B TIM2_IRQHandler
+
+ PUBWEAK PKA_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+PKA_IRQHandler
+ B PKA_IRQHandler
+
+ PUBWEAK I2C1_EV_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+I2C1_EV_IRQHandler
+ B I2C1_EV_IRQHandler
+
+ PUBWEAK I2C1_ER_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+I2C1_ER_IRQHandler
+ B I2C1_ER_IRQHandler
+
+ PUBWEAK I2C3_EV_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+I2C3_EV_IRQHandler
+ B I2C3_EV_IRQHandler
+
+ PUBWEAK I2C3_ER_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+I2C3_ER_IRQHandler
+ B I2C3_ER_IRQHandler
+
+ PUBWEAK SPI1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SPI1_IRQHandler
+ B SPI1_IRQHandler
+
+ PUBWEAK SPI2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SPI2_IRQHandler
+ B SPI2_IRQHandler
+
+ PUBWEAK USART1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+USART1_IRQHandler
+ B USART1_IRQHandler
+
+ PUBWEAK LPUART1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+LPUART1_IRQHandler
+ B LPUART1_IRQHandler
+
+ PUBWEAK SAI1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SAI1_IRQHandler
+ B SAI1_IRQHandler
+
+ PUBWEAK TSC_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TSC_IRQHandler
+ B TSC_IRQHandler
+
+ PUBWEAK EXTI15_10_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI15_10_IRQHandler
+ B EXTI15_10_IRQHandler
+
+ PUBWEAK RTC_Alarm_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+RTC_Alarm_IRQHandler
+ B RTC_Alarm_IRQHandler
+
+ PUBWEAK CRS_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+CRS_IRQHandler
+ B CRS_IRQHandler
+
+ PUBWEAK PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler
+ B PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler
+
+ PUBWEAK IPCC_C1_RX_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+IPCC_C1_RX_IRQHandler
+ B IPCC_C1_RX_IRQHandler
+
+ PUBWEAK IPCC_C1_TX_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+IPCC_C1_TX_IRQHandler
+ B IPCC_C1_TX_IRQHandler
+
+ PUBWEAK HSEM_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+HSEM_IRQHandler
+ B HSEM_IRQHandler
+
+ PUBWEAK LPTIM1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+LPTIM1_IRQHandler
+ B LPTIM1_IRQHandler
+
+ PUBWEAK LPTIM2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+LPTIM2_IRQHandler
+ B LPTIM2_IRQHandler
+
+ PUBWEAK LCD_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+LCD_IRQHandler
+ B LCD_IRQHandler
+
+ PUBWEAK QUADSPI_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+QUADSPI_IRQHandler
+ B QUADSPI_IRQHandler
+
+ PUBWEAK AES1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+AES1_IRQHandler
+ B AES1_IRQHandler
+
+ PUBWEAK AES2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+AES2_IRQHandler
+ B AES2_IRQHandler
+
+ PUBWEAK RNG_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+RNG_IRQHandler
+ B RNG_IRQHandler
+
+ PUBWEAK FPU_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+FPU_IRQHandler
+ B FPU_IRQHandler
+
+ PUBWEAK DMA2_Channel1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel1_IRQHandler
+ B DMA2_Channel1_IRQHandler
+
+ PUBWEAK DMA2_Channel2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel2_IRQHandler
+ B DMA2_Channel2_IRQHandler
+
+ PUBWEAK DMA2_Channel3_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel3_IRQHandler
+ B DMA2_Channel3_IRQHandler
+
+ PUBWEAK DMA2_Channel4_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel4_IRQHandler
+ B DMA2_Channel4_IRQHandler
+
+ PUBWEAK DMA2_Channel5_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel5_IRQHandler
+ B DMA2_Channel5_IRQHandler
+
+ PUBWEAK DMA2_Channel6_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel6_IRQHandler
+ B DMA2_Channel6_IRQHandler
+
+ PUBWEAK DMA2_Channel7_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel7_IRQHandler
+ B DMA2_Channel7_IRQHandler
+
+ PUBWEAK DMAMUX1_OVR_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMAMUX1_OVR_IRQHandler
+ B DMAMUX1_OVR_IRQHandler
+
+ END
+
+;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE*****
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/EWARM/stm32wb55xx_flash_cm4_ota.icf b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/EWARM/stm32wb55xx_flash_cm4_ota.icf
new file mode 100644
index 000000000..fdbeccb5b
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/EWARM/stm32wb55xx_flash_cm4_ota.icf
@@ -0,0 +1,44 @@
+/*###ICF### Section handled by ICF editor, don't touch! ****/
+/*-Editor annotation file-*/
+/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
+/*-Specials-*/
+define symbol __ICFEDIT_intvec_start__ = 0x08010000;
+/*-Memory Regions-*/
+/***** FLASH Part dedicated to M4 *****/
+define symbol __ICFEDIT_region_ROM_start__ = 0x08010000;
+define symbol __ICFEDIT_region_ROM_end__ = 0x0807FFFF;
+define symbol __ICFEDIT_region_RAM_start__ = 0x20000004;
+define symbol __ICFEDIT_region_RAM_end__ = 0x2002FFFF;
+/*-Sizes-*/
+define symbol __ICFEDIT_size_cstack__ = 0x1000;
+define symbol __ICFEDIT_size_heap__ = 0x400;
+/**** End of ICF editor section. ###ICF###*/
+
+define symbol __ICFEDIT_region_RAM_SHARED_start__ = 0x20030000;
+define symbol __ICFEDIT_region_RAM_SHARED_end__ = 0x200327FF;
+
+define memory mem with size = 4G;
+define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
+define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
+define region RAM_SHARED_region = mem:[from __ICFEDIT_region_RAM_SHARED_start__ to __ICFEDIT_region_RAM_SHARED_end__];
+define region OTA_TAG_region = mem:[from (__ICFEDIT_region_ROM_start__ + 0x140) to (__ICFEDIT_region_ROM_start__ + 0x140 + 4)];
+
+define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
+define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
+
+/* MB_MEM1 and MB_MEM2 are sections reserved to mailbox communication. It is placed in the shared memory */
+initialize by copy { readwrite };
+do not initialize { section .noinit,
+ section MAPPING_TABLE,
+ section MB_MEM1 };
+
+place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
+
+keep { section TAG_OTA_START};
+keep { section TAG_OTA_END };
+place in OTA_TAG_region { section TAG_OTA_START };
+place in ROM_region { readonly, last section TAG_OTA_END };
+place in RAM_region { readwrite,block CSTACK, block HEAP };
+place in RAM_SHARED_region { first section MAPPING_TABLE};
+place in RAM_SHARED_region { section MB_MEM1};
+place in RAM_SHARED_region { section MB_MEM2};
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/STM32_WPAN/App/app_thread.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/STM32_WPAN/App/app_thread.c
new file mode 100644
index 000000000..5d2877e72
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/STM32_WPAN/App/app_thread.c
@@ -0,0 +1,1171 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : App/app_thread.c
+ * Description : Thread Application.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "utilities_common.h"
+#include "app_entry.h"
+#include "dbg_trace.h"
+#include "app_thread.h"
+#include "stm32wbxx_core_interface_def.h"
+#include "openthread_api_wb.h"
+#include "shci.h"
+#include "stm_logging.h"
+#include "app_conf.h"
+#include "stm32_lpm.h"
+#include "stm32_seq.h"
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+#include "vcp.h"
+#include "vcp_conf.h"
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+
+/* Private includes -----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN PTD */
+
+/* USER CODE END PTD */
+
+/* Private defines -----------------------------------------------------------*/
+#define C_SIZE_CMD_STRING 256U
+#define C_PANID 0x1111U
+#define C_CHANNEL_NB 14U
+
+/* USER CODE BEGIN PD */
+#define FUOTA_MAGIC_KEYWORD 0x94448A29
+/**
+ * These are the two tags used to manage a power failure during OTA
+ * The MagicKeywordAddress shall be mapped @0x140 from start of the binary image
+ * The MagicKeywordValue is checked in the thread_ota application
+ */
+PLACE_IN_SECTION("TAG_OTA_END") const uint32_t MagicKeywordValue = FUOTA_MAGIC_KEYWORD ;
+PLACE_IN_SECTION("TAG_OTA_START") const uint32_t MagicKeywordAddress = (uint32_t)&MagicKeywordValue;
+
+#define C_RESSOURCE "light"
+
+/* Following CoAP ressource is requested to reboot on Thread_Ota application */
+#define C_RESSOURCE_FUOTA_REBOOT "FUOTA_REBOOT"
+
+#define COAP_PAYLOAD_LENGTH 2
+#define WAIT_TIMEOUT (5*1000*1000/CFG_TS_TICK_VAL) /**< 5s */
+/* USER CODE END PD */
+
+/* Private macros ------------------------------------------------------------*/
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private function prototypes -----------------------------------------------*/
+static void APP_THREAD_CheckWirelessFirmwareInfo(void);
+static void APP_THREAD_DeviceConfig(void);
+static void APP_THREAD_StateNotif(uint32_t NotifFlags, void *pContext);
+static void APP_THREAD_TraceError(const char * pMess, uint32_t ErrCode);
+#if (CFG_FULL_LOW_POWER == 0)
+static void Send_CLI_To_M0(void);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+static void Send_CLI_Ack_For_OT(void);
+static void HostTxCb( void );
+static void Wait_Getting_Ack_From_M0(void);
+static void Receive_Ack_From_M0(void);
+static void Receive_Notification_From_M0(void);
+#if (CFG_HW_LPUART1_ENABLED == 1)
+extern void MX_LPUART1_UART_Init(void);
+#endif
+#if (CFG_HW_USART1_ENABLED == 1)
+extern void MX_USART1_UART_Init(void);
+#endif
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+static uint32_t ProcessCmdString(uint8_t* buf , uint32_t len);
+#else
+#if (CFG_FULL_LOW_POWER == 0)
+static void RxCpltCallback(void);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+
+/* USER CODE BEGIN PFP */
+static void APP_THREAD_CoapSendRequest(otCoapResource* pCoapRessource, otCoapType CoapType, otCoapCode CoapCode, const char *Address, uint8_t* Payload, uint16_t Size);
+static void APP_THREAD_DummyReqHandler(void * p_context,
+ otCoapHeader * pHeader,
+ otMessage * pMessage,
+ const otMessageInfo * pMessageInfo);
+static void APP_THREAD_CoapRequestHandler(otCoapHeader * pHeader,
+ otMessage * pMessage,
+ const otMessageInfo * pMessageInfo);
+static void APP_THREAD_CoapSendDataResponse(otCoapHeader * pRequestHeader,
+ const otMessageInfo * pMessageInfo);
+static void APP_THREAD_CoapDataRespHandler(otCoapHeader * pHeader,
+ otMessage * pMessage,
+ const otMessageInfo * pMessageInfo,
+ otError Result);
+static void APP_THREAD_CoapDummyRespHandler(void * p_context,
+ otCoapHeader * pHeader,
+ otMessage * pMessage,
+ const otMessageInfo * pMessageInfo,
+ otError Result);
+
+static void APP_THREAD_CoapRequestHandlerFuotaReboot(otCoapHeader * pHeader,
+ otMessage * pMessage,
+ const otMessageInfo * pMessageInfo);
+
+static void APP_THREAD_InitPayloadWrite(void);
+static void APP_THREAD_SendCoapMsg(void);
+static void APP_THREAD_TimingElapsed(void);
+static bool APP_THREAD_CheckMsgValidity(void);
+static void APP_THREAD_FuotaReboot(void);
+/* USER CODE END PFP */
+
+/* Private variables -----------------------------------------------*/
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+static uint8_t TmpString[C_SIZE_CMD_STRING];
+static uint8_t VcpRxBuffer[sizeof(TL_CmdSerial_t)]; /* Received Data over USB are stored in this buffer */
+static uint8_t VcpTxBuffer[sizeof(TL_EvtPacket_t) + 254U]; /* Transmit buffer over USB */
+#else
+#if (CFG_FULL_LOW_POWER == 0)
+static uint8_t aRxBuffer[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+
+#if (CFG_FULL_LOW_POWER == 0)
+static uint8_t CommandString[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+static __IO uint16_t indexReceiveChar = 0;
+static __IO uint16_t CptReceiveCmdFromUser = 0;
+
+static TL_CmdPacket_t *p_thread_otcmdbuffer;
+static TL_EvtPacket_t *p_thread_notif_M0_to_M4;
+static __IO uint32_t CptReceiveMsgFromM0 = 0;
+PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static TL_TH_Config_t ThreadConfigBuffer;
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static TL_CmdPacket_t ThreadOtCmdBuffer;
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t ThreadNotifRspEvtBuffer[sizeof(TL_PacketHeader_t) + TL_EVT_HDR_SIZE + 255U];
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static TL_CmdPacket_t ThreadCliCmdBuffer;
+
+/* USER CODE BEGIN PV */
+static otCoapResource OT_Ressource = {C_RESSOURCE, APP_THREAD_DummyReqHandler, (void*)APP_THREAD_CoapRequestHandler, NULL};
+static otCoapResource OT_Ressource_FuotaReboot = {C_RESSOURCE_FUOTA_REBOOT, APP_THREAD_DummyReqHandler, (void*)APP_THREAD_CoapRequestHandlerFuotaReboot, NULL};
+
+static otMessageInfo OT_MessageInfo = {0};
+static otCoapHeader OT_Header = {0};
+static otMessage* pOT_Message = NULL;
+
+static uint8_t PayloadWrite[COAP_PAYLOAD_LENGTH]= {0};
+static uint8_t PayloadRead[COAP_PAYLOAD_LENGTH]= {0};
+static uint8_t TimerID;
+/* USER CODE END PV */
+
+/* Functions Definition ------------------------------------------------------*/
+
+void APP_THREAD_Init( void )
+{
+ /* USER CODE BEGIN APP_THREAD_INIT_1 */
+
+ /* USER CODE END APP_THREAD_INIT_1 */
+
+ SHCI_CmdStatus_t ThreadInitStatus;
+
+ /* Check the compatibility with the Coprocessor Wireless Firmware loaded */
+ APP_THREAD_CheckWirelessFirmwareInfo();
+
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+ VCP_Init(&VcpTxBuffer[0], &VcpRxBuffer[0]);
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+
+ /* Register cmdbuffer */
+ APP_THREAD_RegisterCmdBuffer(&ThreadOtCmdBuffer);
+
+ /**
+ * Do not allow standby in the application
+ */
+ UTIL_LPM_SetOffMode(1 << CFG_LPM_APP_THREAD, UTIL_LPM_DISABLE);
+
+ /* Init config buffer and call TL_THREAD_Init */
+ APP_THREAD_TL_THREAD_INIT();
+
+ /* Configure UART for sending CLI command from M4 */
+ APP_THREAD_Init_UART_CLI();
+
+ /* Send Thread start system cmd to M0 */
+ ThreadInitStatus = SHCI_C2_THREAD_Init();
+
+ /* Prevent unused argument(s) compilation warning */
+ UNUSED(ThreadInitStatus);
+
+ /* Register task */
+ /* Create the different tasks */
+ UTIL_SEQ_RegTask( 1<<(uint32_t)CFG_TASK_MSG_FROM_M0_TO_M4, UTIL_SEQ_RFU, APP_THREAD_ProcessMsgM0ToM4);
+
+ /* USER CODE BEGIN INIT TASKS */
+ UTIL_SEQ_RegTask( 1<<(uint32_t)CFG_TASK_COAP_MSG_BUTTON, UTIL_SEQ_RFU, APP_THREAD_SendCoapMsg);
+ UTIL_SEQ_RegTask( 1<<(uint32_t)CFG_TASK_FUOTA_REBOOT, UTIL_SEQ_RFU, APP_THREAD_FuotaReboot);
+ /* USER CODE END INIT TASKS */
+
+ /* Initialize and configure the Thread device*/
+ APP_THREAD_DeviceConfig();
+
+ /* USER CODE BEGIN APP_THREAD_INIT_2 */
+ HW_TS_Create(CFG_TIM_PROC_ID_ISR, &TimerID, hw_ts_SingleShot, APP_THREAD_TimingElapsed);
+
+ APP_THREAD_InitPayloadWrite();
+
+ APP_DBG("+++++++++++++++++++++++++++++++++++++++++++++++++++++");
+ APP_DBG("Thread_Coap_Generic_Ota Example with REBOOT RESSOURCE: FUOTA_REBOOT");
+ APP_DBG("+++++++++++++++++++++++++++++++++++++++++++++++++++++");
+
+ /* USER CODE END APP_THREAD_INIT_2 */
+}
+
+/**
+ * @brief Trace the error or the warning reported.
+ * @param ErrId :
+ * @param ErrCode
+ * @retval None
+ */
+void APP_THREAD_Error(uint32_t ErrId, uint32_t ErrCode)
+{
+ /* USER CODE BEGIN APP_THREAD_Error_1 */
+
+ /* USER CODE END APP_THREAD_Error_1 */
+ switch(ErrId)
+ {
+ case ERR_REC_MULTI_MSG_FROM_M0 :
+ APP_THREAD_TraceError("ERROR : ERR_REC_MULTI_MSG_FROM_M0 ", ErrCode);
+ break;
+ case ERR_THREAD_SET_STATE_CB :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_SET_STATE_CB ",ErrCode);
+ break;
+ case ERR_THREAD_SET_CHANNEL :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_SET_CHANNEL ",ErrCode);
+ break;
+ case ERR_THREAD_SET_PANID :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_SET_PANID ",ErrCode);
+ break;
+ case ERR_THREAD_IPV6_ENABLE :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_IPV6_ENABLE ",ErrCode);
+ break;
+ case ERR_THREAD_START :
+ APP_THREAD_TraceError("ERROR: ERR_THREAD_START ", ErrCode);
+ break;
+ case ERR_THREAD_ERASE_PERSISTENT_INFO :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_ERASE_PERSISTENT_INFO ",ErrCode);
+ break;
+ case ERR_THREAD_CHECK_WIRELESS :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_CHECK_WIRELESS ",ErrCode);
+ break;
+ /* USER CODE BEGIN APP_THREAD_Error_2 */
+ case ERR_THREAD_COAP_START :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_COAP_START ",ErrCode);
+ break;
+ case ERR_THREAD_COAP_ADD_RESSOURCE :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_COAP_ADD_RESSOURCE ",ErrCode);
+ break;
+ case ERR_THREAD_MESSAGE_READ :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_MESSAGE_READ ",ErrCode);
+ break;
+ case ERR_THREAD_COAP_SEND_RESPONSE :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_COAP_SEND_RESPONSE ",ErrCode);
+ break;
+ case ERR_THREAD_COAP_APPEND :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_COAP_APPEND ",ErrCode);
+ break;
+ case ERR_THREAD_COAP_SEND_REQUEST :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_COAP_SEND_REQUEST ",ErrCode);
+ break;
+ case ERR_THREAD_MSG_COMPARE_FAILED:
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_MSG_COMPARE_FAILED ",ErrCode);
+ break;
+ /* USER CODE END APP_THREAD_Error_2 */
+ default :
+ APP_THREAD_TraceError("ERROR Unknown ", 0);
+ break;
+ }
+}
+
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+
+/**
+ * @brief Thread initialization.
+ * @param None
+ * @retval None
+ */
+static void APP_THREAD_DeviceConfig(void)
+{
+ otError error;
+ error = otInstanceErasePersistentInfo(NULL);
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_ERASE_PERSISTENT_INFO,error);
+ }
+ otInstanceFinalize(NULL);
+ otInstanceInitSingle();
+ error = otSetStateChangedCallback(NULL, APP_THREAD_StateNotif, NULL);
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_SET_STATE_CB,error);
+ }
+ error = otLinkSetChannel(NULL, C_CHANNEL_NB);
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_SET_CHANNEL,error);
+ }
+ error = otLinkSetPanId(NULL, C_PANID);
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_SET_PANID,error);
+ }
+ error = otIp6SetEnabled(NULL, true);
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_IPV6_ENABLE,error);
+ }
+ error = otThreadSetEnabled(NULL, true);
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_START,error);
+ }
+
+ /* USER CODE BEGIN DEVICECONFIG */
+ /* Start the COAP server */
+ error = otCoapStart(NULL, OT_DEFAULT_COAP_PORT);
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_COAP_START,error);
+ }
+ /* Add COAP resources */
+ error = otCoapAddResource(NULL, &OT_Ressource);
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_COAP_ADD_RESSOURCE,error);
+ }
+ error = otCoapAddResource(NULL, &OT_Ressource_FuotaReboot);
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_COAP_ADD_RESSOURCE,error);
+ }
+ /* USER CODE END DEVICECONFIG */
+}
+
+/**
+ * @brief Thread notification when the state changes.
+ * @param aFlags : Define the item that has been modified
+ * aContext: Context
+ *
+ * @retval None
+ */
+static void APP_THREAD_StateNotif(uint32_t NotifFlags, void *pContext)
+{
+ /* Prevent unused argument(s) compilation warning */
+ UNUSED(pContext);
+
+ /* USER CODE BEGIN APP_THREAD_STATENOTIF */
+
+ /* USER CODE END APP_THREAD_STATENOTIF */
+
+ if ((NotifFlags & (uint32_t)OT_CHANGED_THREAD_ROLE) == (uint32_t)OT_CHANGED_THREAD_ROLE)
+ {
+ switch (otThreadGetDeviceRole(NULL))
+ {
+ case OT_DEVICE_ROLE_DISABLED:
+ /* USER CODE BEGIN OT_DEVICE_ROLE_DISABLED */
+ BSP_LED_Off(LED2);
+ BSP_LED_Off(LED3);
+ /* USER CODE END OT_DEVICE_ROLE_DISABLED */
+ break;
+ case OT_DEVICE_ROLE_DETACHED:
+ /* USER CODE BEGIN OT_DEVICE_ROLE_DETACHED */
+ BSP_LED_Off(LED2);
+ BSP_LED_Off(LED3);
+ /* USER CODE END OT_DEVICE_ROLE_DETACHED */
+ break;
+ case OT_DEVICE_ROLE_CHILD:
+ /* USER CODE BEGIN OT_DEVICE_ROLE_CHILD */
+ BSP_LED_Off(LED2);
+ BSP_LED_On(LED3);
+ /* USER CODE END OT_DEVICE_ROLE_CHILD */
+ break;
+ case OT_DEVICE_ROLE_ROUTER :
+ /* USER CODE BEGIN OT_DEVICE_ROLE_ROUTER */
+ BSP_LED_Off(LED2);
+ BSP_LED_On(LED3);
+ /* USER CODE END OT_DEVICE_ROLE_ROUTER */
+ break;
+ case OT_DEVICE_ROLE_LEADER :
+ /* USER CODE BEGIN OT_DEVICE_ROLE_LEADER */
+ BSP_LED_On(LED2);
+ BSP_LED_Off(LED3);
+ /* USER CODE END OT_DEVICE_ROLE_LEADER */
+ break;
+ default:
+ /* USER CODE BEGIN DEFAULT */
+ BSP_LED_Off(LED2);
+ BSP_LED_Off(LED3);
+ /* USER CODE END DEFAULT */
+ break;
+ }
+ }
+}
+
+/**
+ * @brief Warn the user that an error has occurred.In this case,
+ * the LEDs on the Board will start blinking.
+ *
+ * @param pMess : Message associated to the error.
+ * @param ErrCode: Error code associated to the module (OpenThread or other module if any)
+ * @retval None
+ */
+static void APP_THREAD_TraceError(const char * pMess, uint32_t ErrCode)
+{
+ /* USER CODE BEGIN TRACE_ERROR */
+ APP_DBG("**** Fatal error = %s (Err = %d)", pMess, ErrCode);
+ while(1U == 1U)
+ {
+ BSP_LED_Toggle(LED1);
+ HAL_Delay(500U);
+ BSP_LED_Toggle(LED2);
+ HAL_Delay(500U);
+ BSP_LED_Toggle(LED3);
+ HAL_Delay(500U);
+ }
+ /* USER CODE END TRACE_ERROR */
+}
+
+/**
+ * @brief Check if the Coprocessor Wireless Firmware loaded supports Thread
+ * and display associated informations
+ * @param None
+ * @retval None
+ */
+static void APP_THREAD_CheckWirelessFirmwareInfo(void)
+{
+ WirelessFwInfo_t wireless_info_instance;
+ WirelessFwInfo_t* p_wireless_info = &wireless_info_instance;
+
+ if (SHCI_GetWirelessFwInfo(p_wireless_info) != SHCI_Success)
+ {
+ APP_THREAD_Error((uint32_t)ERR_THREAD_CHECK_WIRELESS, (uint32_t)ERR_INTERFACE_FATAL);
+ }
+ else
+ {
+ APP_DBG("**********************************************************");
+ APP_DBG("WIRELESS COPROCESSOR FW:");
+ /* Print version */
+ APP_DBG("VERSION ID = %d.%d.%d", p_wireless_info->VersionMajor, p_wireless_info->VersionMinor, p_wireless_info->VersionSub);
+
+ switch(p_wireless_info->StackType)
+ {
+ case INFO_STACK_TYPE_THREAD_FTD :
+ APP_DBG("FW Type : Thread FTD");
+ break;
+ case INFO_STACK_TYPE_THREAD_MTD :
+ APP_DBG("FW Type : Thread MTD");
+ break;
+ case INFO_STACK_TYPE_BLE_THREAD_FTD_STATIC :
+ APP_DBG("FW Type : Static Concurrent Mode BLE/Thread");
+ break;
+ default :
+ /* No Thread device supported ! */
+ APP_THREAD_Error((uint32_t)ERR_THREAD_CHECK_WIRELESS, (uint32_t)ERR_INTERFACE_FATAL);
+ break;
+ }
+ APP_DBG("**********************************************************");
+ }
+}
+/* USER CODE BEGIN FD_LOCAL_FUNCTIONS */
+/**
+ * @brief Send a CoAP request with defined parameters.
+ *
+ * @param[in] pCoapRessource A pointer to a otCoapResource.
+ * @param[in] CoapType otCoapType.
+ * @param[in] otCoapCode otCoapCode.
+ * @param[in] Address A pointer to a NULL-terminated string representing the address. Example: "FF03::1" for Multicast.
+ * @param[in] Payload A pointer to payload.
+ *
+ * @retval none.
+ */
+static void APP_THREAD_CoapSendRequest(otCoapResource* pCoapRessource,
+ otCoapType CoapType,
+ otCoapCode CoapCode,
+ const char *Address,
+ uint8_t* Payload,
+ uint16_t Size)
+{
+ otError error = OT_ERROR_NONE;
+
+ do{
+ otCoapHeaderInit(&OT_Header, CoapType, CoapCode);
+ otCoapHeaderAppendUriPathOptions(&OT_Header, pCoapRessource->mUriPath);
+ otCoapHeaderSetPayloadMarker(&OT_Header);
+
+ pOT_Message = otCoapNewMessage(NULL, &OT_Header);
+ if (pOT_Message == NULL)
+ {
+ APP_THREAD_Error(ERR_THREAD_COAP_NEW_MSG,error);
+ break;
+ }
+
+ error = otMessageAppend(pOT_Message, Payload, Size);
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_COAP_APPEND,error);
+ break;
+ }
+
+ memset(&OT_MessageInfo, 0, sizeof(OT_MessageInfo));
+ OT_MessageInfo.mInterfaceId = OT_NETIF_INTERFACE_ID_THREAD;
+ OT_MessageInfo.mPeerPort = OT_DEFAULT_COAP_PORT;
+ otIp6AddressFromString(Address, &OT_MessageInfo.mPeerAddr);
+
+ APP_DBG(" otCoapSendRequest, Payload = 0x%x ", Payload[0]);
+ if(CoapType == OT_COAP_TYPE_NON_CONFIRMABLE)
+ {
+ APP_DBG("CoapType == OT_COAP_TYPE_NON_CONFIRMABLE");
+ error = otCoapSendRequest(NULL,
+ pOT_Message,
+ &OT_MessageInfo,
+ NULL,
+ NULL);
+ }
+ if(CoapType == OT_COAP_TYPE_CONFIRMABLE)
+ {
+ APP_DBG("CoapType == OT_COAP_TYPE_CONFIRMABLE");
+ error = otCoapSendRequest(NULL,
+ pOT_Message,
+ &OT_MessageInfo,
+ &APP_THREAD_CoapDummyRespHandler,
+ (void*)&APP_THREAD_CoapDataRespHandler);
+ }
+
+ }while(false);
+ if (error != OT_ERROR_NONE && pOT_Message != NULL)
+ {
+ otMessageFree(pOT_Message);
+ APP_THREAD_Error(ERR_THREAD_COAP_SEND_REQUEST,error);
+ }
+}
+
+/**
+ * @brief Dummy request handler
+ *
+ * @param None
+ * @retval None
+ */
+static void APP_THREAD_DummyReqHandler(void * p_context,
+ otCoapHeader * pHeader,
+ otMessage * pMessage,
+ const otMessageInfo * pMessageInfo)
+{
+}
+
+/**
+ * @brief Handler called when the server receives a COAP request.
+ *
+ * @param pHeader : Header
+ * @param pMessage : Message
+ * @param pMessageInfo : Message information
+ * @retval None
+ */
+static void APP_THREAD_CoapRequestHandler(otCoapHeader * pHeader,
+ otMessage * pMessage,
+ const otMessageInfo * pMessageInfo)
+{
+ APP_DBG(" Received CoAP request");
+ /* USER CODE BEGIN APP_THREAD_CoapRequestHandler */
+ if (otMessageRead(pMessage, otMessageGetOffset(pMessage), &PayloadRead, sizeof(PayloadRead)) != sizeof(PayloadRead))
+ {
+ APP_THREAD_Error(ERR_THREAD_MESSAGE_READ, 0);
+ }
+
+ if (APP_THREAD_CheckMsgValidity() == true){
+ BSP_LED_Toggle(LED1);
+ }
+ /* USER CODE END APP_THREAD_CoapRequestHandler */
+
+ /* If Message is Confirmable, send response */
+ if (otCoapHeaderGetType(pHeader) == OT_COAP_TYPE_CONFIRMABLE)
+ {
+ APP_THREAD_CoapSendDataResponse(pHeader, pMessageInfo);
+ }
+}
+
+/**
+ * @brief This function acknowledges the data reception by sending an ACK
+ * back to the sender.
+ * @param pRequestHeader coap header
+ * @param pMessageInfo message info pointer
+ * @retval None
+ */
+static void APP_THREAD_CoapSendDataResponse(otCoapHeader * pRequestHeader,
+ const otMessageInfo * pMessageInfo)
+{
+ otError error = OT_ERROR_NONE;
+
+ do{
+ APP_DBG(" ********* APP_THREAD_CoapSendDataResponse ********* ");
+ otCoapHeaderInit(&OT_Header, OT_COAP_TYPE_ACKNOWLEDGMENT, OT_COAP_CODE_CHANGED);
+ otCoapHeaderSetMessageId(&OT_Header, otCoapHeaderGetMessageId(pRequestHeader));
+ otCoapHeaderSetToken(&OT_Header,
+ otCoapHeaderGetToken(pRequestHeader),
+ otCoapHeaderGetTokenLength(pRequestHeader));
+
+ pOT_Message = otCoapNewMessage(NULL, &OT_Header);
+ if (pOT_Message == NULL)
+ {
+ APP_DBG("WARNING : pOT_Message = NULL ! -> exit now");
+ break;
+ }
+ error = otCoapSendResponse(NULL, pOT_Message, pMessageInfo);
+ if (error != OT_ERROR_NONE && pOT_Message != NULL)
+ {
+ otMessageFree(pOT_Message);
+ APP_THREAD_Error(ERR_THREAD_COAP_DATA_RESPONSE,error);
+ }
+ }while(false);
+}
+
+/**
+ * @brief This function manages the data response handler.
+ *
+ * @param pHeader header
+ * @param pMessage message pointer
+ * @param pMessageInfo message info pointer
+ * @param Result error code
+ * @retval None
+ */
+static void APP_THREAD_CoapDataRespHandler(otCoapHeader * pHeader,
+ otMessage * pMessage,
+ const otMessageInfo * pMessageInfo,
+ otError Result)
+{
+ /* Prevent unused argument(s) compilation warning */
+ UNUSED(pHeader);
+ UNUSED(pMessage);
+ UNUSED(pMessageInfo);
+
+ if (Result == OT_ERROR_NONE)
+ {
+ APP_DBG("APP_THREAD_CoapDataRespHandler : NO ERROR");
+ }
+ else
+ {
+ APP_DBG("APP_THREAD_CoapDataRespHandler : WARNING Result");
+ }
+}
+
+/**
+ * @brief This function is used to handle a dummy response handler
+ *
+ * @param p_context context
+ * @param pHeader coap header
+ * @param pMessage message
+ * @paramp pMessageInfo otMessage information
+ * @param Result error status
+ * @retval None
+ */
+static void APP_THREAD_CoapDummyRespHandler(void * p_context,
+ otCoapHeader * pHeader,
+ otMessage * pMessage,
+ const otMessageInfo * pMessageInfo,
+ otError Result)
+{
+ /* Prevent unused argument(s) compilation warning */
+ UNUSED(p_context);
+ UNUSED(pHeader);
+ UNUSED(pMessage);
+ UNUSED(pMessageInfo);
+ UNUSED(Result);
+}
+
+/**
+ * @brief Initialize CoAP write buffer.
+ * @param None
+ * @retval None
+ */
+static void APP_THREAD_InitPayloadWrite(void)
+{
+ uint8_t i;
+ for(i = 0; i < COAP_PAYLOAD_LENGTH; i++)
+ {
+ PayloadWrite[i] = 0xFF;
+ }
+}
+
+/**
+ * @brief Task associated to the push button.
+ * @param None
+ * @retval None
+ */
+static void APP_THREAD_SendCoapMsg(void)
+{
+ APP_DBG("********* STEP 1: Send a CoAP NON-CONFIRMABLE PUT Request *********");
+ /* Send a NON-CONFIRMABLE PUT Request */
+ APP_THREAD_CoapSendRequest(&OT_Ressource, OT_COAP_TYPE_NON_CONFIRMABLE, OT_COAP_CODE_PUT, MULICAST_FTD_MED, PayloadWrite, sizeof(PayloadWrite));
+
+ /* Insert Delay here using Hw timer server */
+ /* Start the timer */
+ HW_TS_Start(TimerID, (uint32_t)WAIT_TIMEOUT);
+ UTIL_SEQ_WaitEvt(EVENT_TIMER);
+
+ APP_DBG("********* STEP 2: Send a CoAP CONFIRMABLE PUT Request *********");
+ /* Send a CONFIRMABLE PUT Request */
+ APP_THREAD_CoapSendRequest(&OT_Ressource, OT_COAP_TYPE_CONFIRMABLE, OT_COAP_CODE_PUT, MULICAST_FTD_MED, PayloadWrite, sizeof(PayloadWrite));
+}
+
+static void APP_THREAD_TimingElapsed(void)
+{
+ APP_DBG("--- APP_THREAD_TimingElapsed ---");
+ UTIL_SEQ_SetEvt(EVENT_TIMER);
+}
+
+/**
+ * @brief Compare the message received versus the original message.
+ * @param None
+ * @retval None
+ */
+static bool APP_THREAD_CheckMsgValidity(void)
+{
+ bool valid = true;
+ uint32_t i;
+
+ for(i = 0; i < COAP_PAYLOAD_LENGTH; i++)
+ {
+ if(PayloadRead[i] != PayloadWrite[i])
+ {
+ valid = false;
+ }
+ }
+
+ if(valid == true)
+ {
+ APP_DBG("PAYLOAD Comparison OK!");
+ }else
+ {
+ APP_THREAD_Error(ERR_THREAD_MSG_COMPARE_FAILED, 0);
+ }
+ return valid;
+}
+
+/**
+ * @brief Handler called when the server receives a COAP request.
+ *
+ * @param pHeader : Header
+ * @param pMessage : Message
+ * @param pMessageInfo : Message information
+ * @retval None
+ */
+static void APP_THREAD_CoapRequestHandlerFuotaReboot(otCoapHeader * pHeader,
+ otMessage * pMessage,
+ const otMessageInfo * pMessageInfo)
+{
+ uint32_t l_data = 0;
+ APP_DBG(" Received CoAP request on %s", C_RESSOURCE_FUOTA_REBOOT);
+ /* USER CODE BEGIN APP_THREAD_CoapRequestHandler */
+ if (otMessageRead(pMessage, otMessageGetOffset(pMessage), &l_data, sizeof(l_data)) != sizeof(l_data))
+ {
+ APP_THREAD_Error(ERR_THREAD_MESSAGE_READ, 0);
+ }
+
+ /* If Message is Confirmable, send response */
+ if (otCoapHeaderGetType(pHeader) == OT_COAP_TYPE_CONFIRMABLE)
+ {
+ APP_THREAD_CoapSendDataResponse(pHeader, pMessageInfo);
+ }
+
+ /* Set Task to Reboot on Thread_Ota application */
+ UTIL_SEQ_SetTask(TASK_FUOTA_REBOOT, CFG_SCH_PRIO_0);
+}
+
+static void APP_THREAD_FuotaReboot(void)
+{
+ APP_DBG("REBOOT on Thread_Ota");
+ /**
+ * Reboot on OTA Application
+ */
+ *(uint8_t*)SRAM1_BASE = CFG_REBOOT_ON_THREAD_OTA_APP;
+ NVIC_SystemReset();
+}
+
+/* USER CODE END FD_LOCAL_FUNCTIONS */
+
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+
+void APP_THREAD_RegisterCmdBuffer(TL_CmdPacket_t* p_buffer)
+{
+ p_thread_otcmdbuffer = p_buffer;
+}
+
+Thread_OT_Cmd_Request_t* THREAD_Get_OTCmdPayloadBuffer(void)
+{
+ return (Thread_OT_Cmd_Request_t*)p_thread_otcmdbuffer->cmdserial.cmd.payload;
+}
+
+Thread_OT_Cmd_Request_t* THREAD_Get_OTCmdRspPayloadBuffer(void)
+{
+ return (Thread_OT_Cmd_Request_t*)((TL_EvtPacket_t *)p_thread_otcmdbuffer)->evtserial.evt.payload;
+}
+
+Thread_OT_Cmd_Request_t* THREAD_Get_NotificationPayloadBuffer(void)
+{
+ return (Thread_OT_Cmd_Request_t*)(p_thread_notif_M0_to_M4)->evtserial.evt.payload;
+}
+
+/**
+ * @brief This function is used to transfer the Ot commands from the
+ * M4 to the M0.
+ *
+ * @param None
+ * @return None
+ */
+void Ot_Cmd_Transfer(void)
+{
+ /* OpenThread OT command cmdcode range 0x280 .. 0x3DF = 352 */
+ p_thread_otcmdbuffer->cmdserial.cmd.cmdcode = 0x280U;
+ /* Size = otCmdBuffer->Size (Number of OT cmd arguments : 1 arg = 32bits so multiply by 4 to get size in bytes)
+ * + ID (4 bytes) + Size (4 bytes) */
+ uint32_t l_size = ((Thread_OT_Cmd_Request_t*)(p_thread_otcmdbuffer->cmdserial.cmd.payload))->Size * 4U + 8U;
+ p_thread_otcmdbuffer->cmdserial.cmd.plen = l_size;
+
+ TL_OT_SendCmd();
+
+ /* Wait completion of cmd */
+ Wait_Getting_Ack_From_M0();
+}
+
+/**
+ * @brief This function is called when acknowledge from OT command is received from the M0+.
+ *
+ * @param Otbuffer : a pointer to TL_EvtPacket_t
+ * @return None
+ */
+void TL_OT_CmdEvtReceived( TL_EvtPacket_t * Otbuffer )
+{
+ /* Prevent unused argument(s) compilation warning */
+ UNUSED(Otbuffer);
+
+ Receive_Ack_From_M0();
+}
+
+/**
+ * @brief This function is called when notification from M0+ is received.
+ *
+ * @param Notbuffer : a pointer to TL_EvtPacket_t
+ * @return None
+ */
+void TL_THREAD_NotReceived( TL_EvtPacket_t * Notbuffer )
+{
+ p_thread_notif_M0_to_M4 = Notbuffer;
+
+ Receive_Notification_From_M0();
+}
+
+/**
+ * @brief This function is called before sending any ot command to the M0
+ * core. The purpose of this function is to be able to check if
+ * there are no notifications coming from the M0 core which are
+ * pending before sending a new ot command.
+ * @param None
+ * @retval None
+ */
+void Pre_OtCmdProcessing(void)
+{
+ UTIL_SEQ_WaitEvt(EVENT_SYNCHRO_BYPASS_IDLE);
+}
+
+/**
+ * @brief This function waits for getting an acknowledgment from the M0.
+ *
+ * @param None
+ * @retval None
+ */
+static void Wait_Getting_Ack_From_M0(void)
+{
+ UTIL_SEQ_WaitEvt(EVENT_ACK_FROM_M0_EVT);
+}
+
+/**
+ * @brief Receive an acknowledgment from the M0+ core.
+ * Each command send by the M4 to the M0 are acknowledged.
+ * This function is called under interrupt.
+ * @param None
+ * @retval None
+ */
+static void Receive_Ack_From_M0(void)
+{
+ UTIL_SEQ_SetEvt(EVENT_ACK_FROM_M0_EVT);
+}
+
+/**
+ * @brief Receive a notification from the M0+ through the IPCC.
+ * This function is called under interrupt.
+ * @param None
+ * @retval None
+ */
+static void Receive_Notification_From_M0(void)
+{
+ CptReceiveMsgFromM0++;
+ UTIL_SEQ_SetTask(TASK_MSG_FROM_M0_TO_M4,CFG_SCH_PRIO_0);
+}
+
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+#else
+#if (CFG_FULL_LOW_POWER == 0)
+static void RxCpltCallback(void)
+{
+ /* Filling buffer and wait for '\r' char */
+ if (indexReceiveChar < C_SIZE_CMD_STRING)
+ {
+ CommandString[indexReceiveChar++] = aRxBuffer[0];
+ if (aRxBuffer[0] == '\r')
+ {
+ CptReceiveCmdFromUser = 1U;
+
+ /* UART task scheduling*/
+ UTIL_SEQ_SetTask(1U << CFG_TASK_SEND_CLI_TO_M0, CFG_SCH_PRIO_0);
+ }
+ }
+
+ /* Once a character has been sent, put back the device in reception mode */
+ HW_UART_Receive_IT(CFG_CLI_UART, aRxBuffer, 1U, RxCpltCallback);
+}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+/**
+ * @brief Process the command strings.
+ * As soon as a complete command string has been received, the task
+ * in charge of sending the command to the M0 is scheduled
+ * @param None
+ * @retval None
+ */
+static uint32_t ProcessCmdString( uint8_t* buf , uint32_t len )
+{
+ uint32_t i,j,tmp_start;
+ tmp_start = 0;
+ uint32_t res = 0;
+
+ i= 0;
+ while ((buf[i] != '\r') && (i < len))
+ {
+ i++;
+ }
+
+ if (i != len)
+ {
+ memcpy(CommandString, buf,(i+1));
+ indexReceiveChar = i + 1U; /* Length of the buffer containing the command string */
+ UTIL_SEQ_SetTask(1U << CFG_TASK_SEND_CLI_TO_M0, CFG_SCH_PRIO_0);
+ tmp_start = i;
+ for (j = 0; j < (len - tmp_start - 1U) ; j++)
+ {
+ buf[j] = buf[tmp_start + j + 1U];
+ }
+ res = len - tmp_start - 1U;
+ }
+ else
+ {
+ res = len;
+ }
+ return res; /* Remaining characters in the temporary buffer */
+}
+#endif/* (CFG_USB_INTERFACE_ENABLE != 0) */
+
+#if (CFG_FULL_LOW_POWER == 0)
+/**
+ * @brief Process sends receive CLI command to M0.
+ * @param None
+ * @retval None
+ */
+static void Send_CLI_To_M0(void)
+{
+ memset(ThreadCliCmdBuffer.cmdserial.cmd.payload, 0x0U, 255U);
+ memcpy(ThreadCliCmdBuffer.cmdserial.cmd.payload, CommandString, indexReceiveChar);
+ ThreadCliCmdBuffer.cmdserial.cmd.plen = indexReceiveChar;
+ ThreadCliCmdBuffer.cmdserial.cmd.cmdcode = 0x0;
+
+ /* Clear receive buffer, character counter and command complete */
+ CptReceiveCmdFromUser = 0;
+ indexReceiveChar = 0;
+ memset(CommandString, 0, C_SIZE_CMD_STRING);
+
+ TL_CLI_SendCmd();
+}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+
+/**
+ * @brief Send notification for CLI TL Channel.
+ * @param None
+ * @retval None
+ */
+static void Send_CLI_Ack_For_OT(void)
+{
+
+ /* Notify M0 that characters have been sent to UART */
+ TL_THREAD_CliSendAck();
+}
+
+/**
+ * @brief Perform initialization of CLI UART interface.
+ * @param None
+ * @retval None
+ */
+void APP_THREAD_Init_UART_CLI(void)
+{
+#if (CFG_FULL_LOW_POWER == 0)
+ UTIL_SEQ_RegTask( 1<<CFG_TASK_SEND_CLI_TO_M0, UTIL_SEQ_RFU,Send_CLI_To_M0);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+#else
+#if (CFG_FULL_LOW_POWER == 0)
+ MX_USART1_UART_Init();
+ HW_UART_Receive_IT(CFG_CLI_UART, aRxBuffer, 1, RxCpltCallback);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+}
+
+/**
+ * @brief Perform initialization of TL for THREAD.
+ * @param None
+ * @retval None
+ */
+void APP_THREAD_TL_THREAD_INIT(void)
+{
+ ThreadConfigBuffer.p_ThreadOtCmdRspBuffer = (uint8_t*)&ThreadOtCmdBuffer;
+ ThreadConfigBuffer.p_ThreadNotAckBuffer = (uint8_t*)ThreadNotifRspEvtBuffer;
+ ThreadConfigBuffer.p_ThreadCliRspBuffer = (uint8_t*)&ThreadCliCmdBuffer;
+
+ TL_THREAD_Init( &ThreadConfigBuffer );
+}
+
+/**
+ * @brief This function is called when notification on CLI TL Channel from M0+ is received.
+ *
+ * @param Notbuffer : a pointer to TL_EvtPacket_t
+ * @return None
+ */
+void TL_THREAD_CliNotReceived( TL_EvtPacket_t * Notbuffer )
+{
+ TL_CmdPacket_t* l_CliBuffer = (TL_CmdPacket_t*)Notbuffer;
+ uint8_t l_size = l_CliBuffer->cmdserial.cmd.plen;
+
+ /* WORKAROUND: if string to output is "> " then respond directly to M0 and do not output it */
+ if (strcmp((const char *)l_CliBuffer->cmdserial.cmd.payload, "> ") != 0)
+ {
+ /* Write to CLI UART */
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+ VCP_SendData( l_CliBuffer->cmdserial.cmd.payload, l_size, HostTxCb);
+#else
+ HW_UART_Transmit_IT(CFG_CLI_UART, l_CliBuffer->cmdserial.cmd.payload, l_size, HostTxCb);
+#endif /*USAGE_OF_VCP */
+ }
+ else
+ {
+ Send_CLI_Ack_For_OT();
+ }
+}
+
+/**
+ * @brief End of transfer callback for CLI UART sending.
+ *
+ * @param Notbuffer : a pointer to TL_EvtPacket_t
+ * @return None
+ */
+void HostTxCb(void)
+{
+ Send_CLI_Ack_For_OT();
+}
+
+/**
+ * @brief Process the messages coming from the M0.
+ * @param None
+ * @retval None
+ */
+void APP_THREAD_ProcessMsgM0ToM4(void)
+{
+ if (CptReceiveMsgFromM0 != 0)
+ {
+ /* If CptReceiveMsgFromM0 is > 1. it means that we did not serve all the events from the radio */
+ if (CptReceiveMsgFromM0 > 1U)
+ {
+ APP_THREAD_Error(ERR_REC_MULTI_MSG_FROM_M0, 0);
+ }
+ else
+ {
+ OpenThread_CallBack_Processing();
+ }
+ /* Reset counter */
+ CptReceiveMsgFromM0 = 0;
+ }
+}
+
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+/**
+ * @brief This function is called when thereare some data coming
+ * from the Hyperterminal via the USB port
+ * Data received over USB OUT endpoint are sent over CDC interface
+ * through this function.
+ * @param Buf: Buffer of data received
+ * @param Len: Number of data received (in bytes)
+ * @retval Number of characters remaining in the buffer and not yet processed
+ */
+void VCP_DataReceived(uint8_t* Buf , uint32_t *Len)
+{
+ uint32_t i,flag_continue_checking = TRUE;
+ uint32_t char_remaining = 0;
+ static uint32_t len_total = 0;
+
+ /* Copy the characteres in the temporary buffer */
+ for (i = 0; i < *Len; i++)
+ {
+ TmpString[len_total++] = Buf[i];
+ }
+
+ /* Process the buffer commands one by one */
+ /* A command is limited by a \r caracaters */
+ while (flag_continue_checking == TRUE)
+ {
+ char_remaining = ProcessCmdString(TmpString,len_total);
+ /* If char_remaining is equal to len_total, it means that the command string is not yet
+ * completed.
+ * If char_remaining is equal to 0, it means that the command string has
+ * been entirely processed.
+ */
+ if ((char_remaining == 0) || (char_remaining == len_total))
+ {
+ flag_continue_checking = FALSE;
+ }
+ len_total = char_remaining;
+ }
+}
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+
+/* USER CODE BEGIN FD_WRAP_FUNCTIONS */
+
+/* USER CODE END FD_WRAP_FUNCTIONS */
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/STM32_WPAN/App/app_thread.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/STM32_WPAN/App/app_thread.h
new file mode 100644
index 000000000..6aab0ffec
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/STM32_WPAN/App/app_thread.h
@@ -0,0 +1,129 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : App/app_thread.h
+ * Description : Header for Thread Application.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_THREAD_H
+#define APP_THREAD_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+/* Private includes ----------------------------------------------------------*/
+#include "tl.h"
+#include "stm32wbxx_core_interface_def.h"
+#include "tl_thread_hci.h"
+
+/* OpenThread Library */
+#include OPENTHREAD_CONFIG_FILE
+
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Exported types ------------------------------------------------------------*/
+
+/* Thread application generic defines */
+/*------------------------------------*/
+typedef enum
+{
+ APP_THREAD_LIMITED,
+ APP_THREAD_FULL,
+} APP_THREAD_InitMode_t;
+
+/* ipv6-addressing defines */
+/*------------------------------------*/
+/* Key Point: A major difference between FTDs and MTDs are that FTDs subscribe to the ff03::2 multicast address.
+ * MTDs do not. */
+
+#define MULICAST_FTD_MED "ff03::1"
+#define MULICAST_FTD_BORDER_ROUTER "ff03::2"
+
+/* Application errors */
+/*------------------------------------*/
+
+/*
+ * List of all errors tracked by the Thread application
+ * running on M4. Some of these errors may be fatal
+ * or just warnings
+ */
+typedef enum
+{
+ ERR_REC_MULTI_MSG_FROM_M0,
+ ERR_THREAD_SET_STATE_CB,
+ ERR_THREAD_SET_CHANNEL,
+ ERR_THREAD_SET_PANID,
+ ERR_THREAD_IPV6_ENABLE,
+ ERR_THREAD_START,
+ ERR_THREAD_ERASE_PERSISTENT_INFO,
+/* USER CODE BEGIN ERROR_APPLI_ENUM */
+ ERR_THREAD_COAP_START,
+ ERR_THREAD_COAP_ADD_RESSOURCE,
+ ERR_THREAD_MESSAGE_READ,
+ ERR_THREAD_COAP_SEND_RESPONSE,
+ ERR_THREAD_COAP_NEW_MSG,
+ ERR_THREAD_COAP_APPEND,
+ ERR_THREAD_COAP_SEND_REQUEST,
+ ERR_THREAD_COAP_DATA_RESPONSE,
+ ERR_THREAD_SETUP,
+ ERR_THREAD_LINK_MODE,
+ ERR_TIMER_INIT,
+ ERR_TIMER_START,
+ ERR_THREAD_MSG_COMPARE_FAILED,
+/* USER CODE END ERROR_APPLI_ENUM */
+ ERR_THREAD_CHECK_WIRELESS
+ } ErrAppliIdEnum_t;
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* External variables --------------------------------------------------------*/
+/* USER CODE BEGIN EV */
+
+/* USER CODE END EV */
+
+/* Exported macros ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions ------------------------------------------------------- */
+void APP_THREAD_Init( void );
+void APP_THREAD_Error(uint32_t ErrId, uint32_t ErrCode);
+void APP_THREAD_RegisterCmdBuffer(TL_CmdPacket_t* p_buffer);
+void APP_THREAD_ProcessMsgM0ToM4(void);
+void APP_THREAD_Init_UART_CLI(void);
+void APP_THREAD_TL_THREAD_INIT(void);
+/* USER CODE BEGIN EF */
+
+/* USER CODE END EF */
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* APP_THREAD_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/STM32_WPAN/Target/hw_ipcc.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/STM32_WPAN/Target/hw_ipcc.c
new file mode 100644
index 000000000..e46eeb94b
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/STM32_WPAN/Target/hw_ipcc.c
@@ -0,0 +1,517 @@
+/**
+ ******************************************************************************
+ * File Name : Target/hw_ipcc.c
+ * Description : Hardware IPCC source file for BLE
+ * Middleware.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "mbox_def.h"
+
+/* Global variables ---------------------------------------------------------*/
+/* Private defines -----------------------------------------------------------*/
+#define HW_IPCC_TX_PENDING( channel ) ( !(LL_C1_IPCC_IsActiveFlag_CHx( IPCC, channel )) ) && (((~(IPCC->C1MR)) & (channel << 16U)))
+#define HW_IPCC_RX_PENDING( channel ) (LL_C2_IPCC_IsActiveFlag_CHx( IPCC, channel )) && (((~(IPCC->C1MR)) & (channel << 0U)))
+
+/* Private macros ------------------------------------------------------------*/
+/* Private typedef -----------------------------------------------------------*/
+/* Private variables ---------------------------------------------------------*/
+static void (*FreeBufCb)( void );
+
+/* Private function prototypes -----------------------------------------------*/
+static void HW_IPCC_BLE_EvtHandler( void );
+static void HW_IPCC_BLE_AclDataEvtHandler( void );
+static void HW_IPCC_MM_FreeBufHandler( void );
+static void HW_IPCC_SYS_CmdEvtHandler( void );
+static void HW_IPCC_SYS_EvtHandler( void );
+static void HW_IPCC_TRACES_EvtHandler( void );
+
+#ifdef THREAD_WB
+static void HW_IPCC_OT_CmdEvtHandler( void );
+static void HW_IPCC_THREAD_NotEvtHandler( void );
+static void HW_IPCC_THREAD_CliNotEvtHandler( void );
+#endif
+
+#ifdef MAC_802_15_4_WB
+static void HW_IPCC_MAC_802_15_4_CmdEvtHandler( void );
+static void HW_IPCC_MAC_802_15_4_NotEvtHandler( void );
+#endif
+
+#ifdef ZIGBEE_WB
+static void HW_IPCC_ZIGBEE_CmdEvtHandler( void );
+static void HW_IPCC_ZIGBEE_StackNotifEvtHandler( void );
+static void HW_IPCC_ZIGBEE_CliNotifEvtHandler( void );
+#endif
+
+/* Public function definition -----------------------------------------------*/
+
+/******************************************************************************
+ * INTERRUPT HANDLER
+ ******************************************************************************/
+void HW_IPCC_Rx_Handler( void )
+{
+ if (HW_IPCC_RX_PENDING( HW_IPCC_SYSTEM_EVENT_CHANNEL ))
+ {
+ HW_IPCC_SYS_EvtHandler();
+ }
+#ifdef MAC_802_15_4_WB
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL ))
+ {
+ HW_IPCC_MAC_802_15_4_NotEvtHandler();
+ }
+#endif /* MAC_802_15_4_WB */
+#ifdef THREAD_WB
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL ))
+ {
+ HW_IPCC_THREAD_NotEvtHandler();
+ }
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL ))
+ {
+ HW_IPCC_THREAD_CliNotEvtHandler();
+ }
+#endif /* THREAD_WB */
+#ifdef ZIGBEE_WB
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL ))
+ {
+ HW_IPCC_ZIGBEE_StackNotifEvtHandler();
+ }
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL ))
+ {
+ HW_IPCC_ZIGBEE_CliNotifEvtHandler();
+ }
+#endif /* ZIGBEE_WB */
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_BLE_EVENT_CHANNEL ))
+ {
+ HW_IPCC_BLE_EvtHandler();
+ }
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_TRACES_CHANNEL ))
+ {
+ HW_IPCC_TRACES_EvtHandler();
+ }
+
+ return;
+}
+
+void HW_IPCC_Tx_Handler( void )
+{
+ if (HW_IPCC_TX_PENDING( HW_IPCC_SYSTEM_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_SYS_CmdEvtHandler();
+ }
+#ifdef MAC_802_15_4_WB
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_MAC_802_15_4_CmdEvtHandler();
+ }
+#endif /* MAC_802_15_4_WB */
+#ifdef THREAD_WB
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_OT_CmdEvtHandler();
+ }
+#endif /* THREAD_WB */
+#ifdef ZIGBEE_WB
+ if (HW_IPCC_TX_PENDING( HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_ZIGBEE_CmdEvtHandler();
+ }
+#endif /* ZIGBEE_WB */
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_SYSTEM_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_SYS_CmdEvtHandler();
+ }
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_MM_RELEASE_BUFFER_CHANNEL ))
+ {
+ HW_IPCC_MM_FreeBufHandler();
+ }
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_HCI_ACL_DATA_CHANNEL ))
+ {
+ HW_IPCC_BLE_AclDataEvtHandler();
+ }
+
+ return;
+}
+/******************************************************************************
+ * GENERAL
+ ******************************************************************************/
+void HW_IPCC_Enable( void )
+{
+ /**
+ * In case the SBSFU is implemented, it may have already set the C2BOOT bit to startup the CPU2.
+ * In that case, to keep the mechanism transparent to the user application, it shall call the system command
+ * SHCI_C2_Reinit( ) before jumping to the application.
+ * When the CPU2 receives that command, it waits for its event input to be set to restart the CPU2 firmware.
+ * This is required because once C2BOOT has been set once, a clear/set on C2BOOT has no effect.
+ * When SHCI_C2_Reinit( ) is not called, generating an event to the CPU2 does not have any effect
+ * So, by default, the application shall both set the event flag and set the C2BOOT bit.
+ */
+ __SEV( ); /* Set the internal event flag and send an event to the CPU2 */
+ __WFE( ); /* Clear the internal event flag */
+ LL_PWR_EnableBootC2( );
+
+ return;
+}
+
+void HW_IPCC_Init( void )
+{
+ LL_AHB3_GRP1_EnableClock( LL_AHB3_GRP1_PERIPH_IPCC );
+
+ LL_C1_IPCC_EnableIT_RXO( IPCC );
+ LL_C1_IPCC_EnableIT_TXF( IPCC );
+
+ HAL_NVIC_EnableIRQ(IPCC_C1_RX_IRQn);
+ HAL_NVIC_EnableIRQ(IPCC_C1_TX_IRQn);
+
+ return;
+}
+
+/******************************************************************************
+ * BLE
+ ******************************************************************************/
+void HW_IPCC_BLE_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_BLE_EVENT_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_BLE_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_BLE_CMD_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_BLE_EvtHandler( void )
+{
+ HW_IPCC_BLE_RxEvtNot();
+
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_BLE_EVENT_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_BLE_SendAclData( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_HCI_ACL_DATA_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_HCI_ACL_DATA_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_BLE_AclDataEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_HCI_ACL_DATA_CHANNEL );
+
+ HW_IPCC_BLE_AclDataAckNot();
+
+ return;
+}
+
+__weak void HW_IPCC_BLE_AclDataAckNot( void ){};
+__weak void HW_IPCC_BLE_RxEvtNot( void ){};
+
+/******************************************************************************
+ * SYSTEM
+ ******************************************************************************/
+void HW_IPCC_SYS_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_SYSTEM_EVENT_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_SYS_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_SYSTEM_CMD_RSP_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_SYSTEM_CMD_RSP_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_SYS_CmdEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_SYSTEM_CMD_RSP_CHANNEL );
+
+ HW_IPCC_SYS_CmdEvtNot();
+
+ return;
+}
+
+static void HW_IPCC_SYS_EvtHandler( void )
+{
+ HW_IPCC_SYS_EvtNot();
+
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_SYSTEM_EVENT_CHANNEL );
+
+ return;
+}
+
+__weak void HW_IPCC_SYS_CmdEvtNot( void ){};
+__weak void HW_IPCC_SYS_EvtNot( void ){};
+
+/******************************************************************************
+ * MAC 802.15.4
+ ******************************************************************************/
+#ifdef MAC_802_15_4_WB
+void HW_IPCC_MAC_802_15_4_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_MAC_802_15_4_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_MAC_802_15_4_SendAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_MAC_802_15_4_CmdEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL );
+
+ HW_IPCC_MAC_802_15_4_CmdEvtNot();
+
+ return;
+}
+
+static void HW_IPCC_MAC_802_15_4_NotEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_MAC_802_15_4_EvtNot();
+
+ return;
+}
+__weak void HW_IPCC_MAC_802_15_4_CmdEvtNot( void ){};
+__weak void HW_IPCC_MAC_802_15_4_EvtNot( void ){};
+#endif
+
+/******************************************************************************
+ * THREAD
+ ******************************************************************************/
+#ifdef THREAD_WB
+void HW_IPCC_THREAD_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_OT_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_CLI_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_THREAD_CLI_CMD_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_THREAD_SendAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_THREAD_CliSendAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_OT_CmdEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+
+ HW_IPCC_OT_CmdEvtNot();
+
+ return;
+}
+
+static void HW_IPCC_THREAD_NotEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_THREAD_EvtNot();
+
+ return;
+}
+
+static void HW_IPCC_THREAD_CliNotEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_THREAD_CliEvtNot();
+
+ return;
+}
+
+__weak void HW_IPCC_OT_CmdEvtNot( void ){};
+__weak void HW_IPCC_CLI_CmdEvtNot( void ){};
+__weak void HW_IPCC_THREAD_EvtNot( void ){};
+
+#endif /* THREAD_WB */
+
+/******************************************************************************
+ * ZIGBEE
+ ******************************************************************************/
+#ifdef ZIGBEE_WB
+void HW_IPCC_ZIGBEE_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_ZIGBEE_SendAppliCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_ZIGBEE_SendCliCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_THREAD_CLI_CMD_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_ZIGBEE_SendAppliCmdAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_ZIGBEE_SendCliCmdAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_ZIGBEE_CmdEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+
+ HW_IPCC_ZIGBEE_AppliCmdNotification();
+
+ return;
+}
+
+static void HW_IPCC_ZIGBEE_StackNotifEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_ZIGBEE_AppliAsyncEvtNotification();
+
+ return;
+}
+
+static void HW_IPCC_ZIGBEE_CliNotifEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_ZIGBEE_CliEvtNotification();
+
+ return;
+}
+
+__weak void HW_IPCC_ZIGBEE_AppliCmdNotification( void ){};
+__weak void HW_IPCC_ZIGBEE_AppliAsyncEvtNotification( void ){};
+__weak void HW_IPCC_ZIGBEE_CliEvtNotification( void ){};
+#endif /* ZIGBEE_WB */
+
+/******************************************************************************
+ * MEMORY MANAGER
+ ******************************************************************************/
+void HW_IPCC_MM_SendFreeBuf( void (*cb)( void ) )
+{
+ if ( LL_C1_IPCC_IsActiveFlag_CHx( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL ) )
+ {
+ FreeBufCb = cb;
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+ }
+ else
+ {
+ cb();
+
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+ }
+
+ return;
+}
+
+static void HW_IPCC_MM_FreeBufHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+
+ FreeBufCb();
+
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+
+ return;
+}
+
+/******************************************************************************
+ * TRACES
+ ******************************************************************************/
+void HW_IPCC_TRACES_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_TRACES_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_TRACES_EvtHandler( void )
+{
+ HW_IPCC_TRACES_EvtNot();
+
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_TRACES_CHANNEL );
+
+ return;
+}
+
+__weak void HW_IPCC_TRACES_EvtNot( void ){};
+
+/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/readme.txt b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/readme.txt
new file mode 100644
index 000000000..0883181bb
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_Generic_Ota/readme.txt
@@ -0,0 +1,175 @@
+/**
+ @page Thread_Coap_Generic_Ota application
+
+ @verbatim
+ ******************************************************************************
+ * @file Thread/Thread_Coap_Generic_Ota/readme.txt
+ * @author MCD Application Team
+ * @brief Description of Coap Generic Application
+ ******************************************************************************
+ *
+ * Copyright (c) 2019 STMicroelectronics. All rights reserved.
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ @endverbatim
+
+@par Application Description
+
+How to build Thread application based on Coap messages.
+
+This application requires two STM32WB55xx boards.
+
+@note This application is not supported by CubeMx but has been copied from the project Thread_Coap_Generic generated
+ by CubeMx with some modifications in order to be able to download it with the Thread_Ota application.
+ The steps to be done to move from the Thread_Coap_Generic application to the Thread_Coap_Generic_Ota application are :
+ - Copy the full folder Thread_Coap_Generic.
+ - Replace the linker file stm32wb55xx_flash_cm4.icf by stm32wb55xx_flash_cm4_ota.icf ( this adds the placement
+ of the two sections TAG_OTA_START and TAG_OTA_END ).
+ - Remove the update of SCB->VTOR in the file system_stm32wbxx.c ( The VTOR is already set by the Thread_Ota application
+ and shall not be changed to a different value).
+ - SW3 is mapped. When pushed forces a reboot on Thread_Ota application (so that a new FW OTA update can be done).
+
+In a Thread network, nodes are split into two forwarding roles: Router or End Device.
+The Thread Leader is a Router that is responsible for managing the set of Routers in a
+Thread network. An End Device (or child) communicates primarily with a single Router.
+
+In our Application which uses two devices, one device will act as a Leader (Router)
+and the other one will act as an End Device(mode child)
+
+After the reset of the 2 boards, one board will be in Leader mode (Green LED2 ON)
+The other one will be in Child mode (Red LED3 ON)
+
+Let's name indifferently one board A and one board B.
+To send a COAP command from board A to board B, press the SW1 Push-Button on board A.
+The board B will receive the COAP command to light on its blue LED1.
+Pressing again same push-button will light off the blue LED1. And so-on.
+Same COAP commands can be sent from board B to board A.
+
+ ___________________________ ___________________________
+ | Device 1 | | Device 2 |
+ |_________________________| |_________________________|
+ | | | |
+ | | | |
+ | Push Button SW1 --> |======> COAP =========>| BLUE LED TOGGLE (ON/OFF)|
+ | | Resource "light" | |
+ | | Mode: Multicast | |
+ | | Type: Non-Confirmable | |
+ | | Code: Put | |
+ | | | |
+ | | | |
+ *************** WAIT 5 Seconds (configurable with WAIT_TIMEOUT) *************
+ | | | |
+ | | | |
+ | |=====> COAP ==========>|--------> |
+ | | Resource "light" | | |
+ | | Mode: Multicast | CoapRequestHandler() |
+ | | Type: Confirmable | | |
+ | | Code: Put | | |
+ | | | v |
+ | | | CoapSendDataResponse() |
+ | | | | |
+ | | | v |
+ | CoapDataRespHandler()<--|<===== COAP <==========| <------- |
+ | | | |
+ | | | |
+ --------------------------- ---------------------------
+ | Role : Child | | Role : Leader |
+ | | | |
+ | LED : Red | | LED : Green |
+ | | | |
+ |_________________________| |_________________________|
+
+
+@par Keywords
+
+COAP,Thread
+
+@par Directory contents
+
+ - Thread/Thread_Coap_Generic_Ota/Core/Inc/app_common.h Header for all modules with common definition
+ - Thread/Thread_Coap_Generic_Ota/Core/Inc/app_conf.h Parameters configuration file of the application
+ - Thread/Thread_Coap_Generic_Ota/Core/Inc/app_entry.h Parameters configuration file of the application
+ - Thread/Thread_Coap_Generic_Ota/STM32_WPAN/App/app_thread.h Header for app_thread.c module
+ - Thread/Thread_Coap_Generic_Ota/Core/Inc/hw_conf.h Configuration file of the HW
+ - Thread/Thread_Coap_Generic_Ota/Core/Inc/main.h Header for main.c module
+ - Thread/Thread_Coap_Generic_Ota/Core/Inc/stm_logging.h Header for stm_logging.c module
+ - Thread/Thread_Coap_Generic_Ota/Core/Inc/stm32wbxx_hal_conf.h HAL configuration file
+ - Thread/Thread_Coap_Generic_Ota/Core/Src/stm32wbxx_it.h Interrupt header file
+ - Thread/Thread_Coap_Generic_Ota/Core/Inc/utilities_conf.h Configuration file of the utilities
+ - Thread/Thread_Coap_Generic_Ota/Core/Src/app_entry.c Initialization of the application
+ - Thread/Thread_Coap_Generic_Ota/STM32_WPAN/App/app_thread.c Thread application implementation
+ - Thread/Thread_Coap_Generic_Ota/STM32_WPAN/Target/hw_ipcc.c IPCC Driver
+ - Thread/Thread_Coap_Generic_Ota/Core/Src/stm32_lpm_if.c Low Power Manager Interface
+ - Thread/Thread_Coap_Generic_Ota/Core/Src/hw_timerserver.c Timer Server Driver
+ - Thread/Thread_Coap_Generic_Ota/Core/Src/hw_uart.c UART driver
+ - Thread/Thread_Coap_Generic_Ota/Core/Src/main.c Main program
+ - Thread/Thread_Coap_Generic_Ota/Core/Src/stm_logging.c Logging module for traces
+ - Thread/Thread_Coap_Generic_Ota/Core/Src/stm32xx_it.c Interrupt handlers
+ - Thread/Thread_Coap_Generic_Ota/Core/Src/system_stm32wbxx.c stm32wbxx system source file
+
+
+@par Hardware and Software environment
+
+ - This example runs on STM32WB55xx devices (Nucleo board and dongle)
+
+ - This example has been tested with an STMicroelectronics STM32WB55xx_Nucleo
+ board and can be easily tailored to any other supported device
+ and development board.
+
+ - On STM32WB55RG_Nucleo, the jumpers must be configured as described
+ in this section. Starting from the top left position up to the bottom
+ right position, the jumpers on the Board must be set as follows:
+
+ CN11: GND [OFF]
+ JP4: VDDRF [ON]
+ JP6: VC0 [ON]
+ JP2: +3V3 [ON]
+ JP1: USB_STL [ON] All others [OFF]
+ CN12: GND [OFF]
+ CN7: <All> [OFF]
+ JP3: VDD_MCU [ON]
+ JP5: GND [OFF] All others [ON]
+ CN10: <All> [OFF]
+
+
+@par How to use it ?
+
+This application requests having the stm32wb5x_Thread_FTD_fw.bin binary flashed on the Wireless Coprocessor.
+If it is not the case, you need to use STM32CubeProgrammer to load the appropriate binary.
+All available binaries are located under /Projects/STM32_Copro_Wireless_Binaries directory.
+Refer to UM2237 to learn how to use/install STM32CubeProgrammer.
+Refer to /Projects/STM32_Copro_Wireless_Binaries/ReleaseNote.html for the detailed procedure to change the
+Wireless Coprocessor binary.
+
+
+In order to make the program work, you must do the following:
+ - Connect 2 STM32WB55xx_Nucleo boards to your PC
+ - Open your preferred toolchain
+ - Rebuild all files and load your image into target memory
+ - Run the application
+
+ If you want to control this application, you can directly send and
+ retrieve Cli commands connecting an HyperTerminal with the ST_Link cable.
+ (Refer to the Thread_Cli_Cmd application for more details)
+
+ if you want to get the traces in real time, you can connect an HyperTerminal
+ via an UART RS232 cable using the following connections:
+ RXD: CN10(Pin35)
+ TXD: CN10(Pin37)
+
+
+ For the Cli control and for the traces, the UART must be configured as follows:
+ - BaudRate = 115200 baud
+ - Word Length = 8 Bits
+ - Stop Bit = 1 bit
+ - Parity = none
+ - Flow control = none
+
+ * <h3><center>&copy; COPYRIGHT STMicroelectronics</center></h3>
+ */
+ \ No newline at end of file
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Inc/app_conf.h
index d179142de..4a7816a43 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Inc/app_conf.h
@@ -23,6 +23,7 @@
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Application Config
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Inc/stm32_lpm_if.h
index 45db98456..70abecaa9 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Inc/stm32_lpm_if.h
@@ -1,21 +1,21 @@
/* USER CODE BEGIN Header */
/**
- ******************************************************************************
- * File Name : stm32_lpm_if.h
- * Description : Header for stm32_lpm_f.c module (device specific LP management).
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
+******************************************************************************
+* @file stm32_lpm_if.h
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
+******************************************************************************
+* @attention
+*
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+* All rights reserved.</center></h2>
+*
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+*
+******************************************************************************
+*/
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
@@ -65,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Inc/stm32wbxx_it.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Inc/stm32wbxx_it.h
index fb879095f..5e32492ba 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Inc/stm32wbxx_it.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Inc/stm32wbxx_it.h
@@ -28,7 +28,7 @@
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
-
+#include "app_common.h"
/* USER CODE END Includes */
/* Exported types ------------------------------------------------------------*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Inc/utilities_conf.h
index 2c5384639..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Inc/utilities_conf.h
@@ -10,10 +10,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Src/hw_timerserver.c
index 17c9af0a4..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Src/hw_timerserver.c
@@ -4,19 +4,18 @@
* Description : Hardware timerserver source file for STM32WPAN Middleware.
*
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Src/hw_uart.c
index ac245a96f..9a553610d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Src/hw_uart.c
@@ -48,9 +48,8 @@ extern UART_HandleTypeDef huart1;
hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
} while(0)
- /* Variables ------------------------------------------------------------------*/
+/* Variables -----------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
-
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
#endif
@@ -59,7 +58,6 @@ extern UART_HandleTypeDef huart1;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
-
#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_hlpuart1_tx ={0};
#endif
@@ -67,73 +65,73 @@ extern UART_HandleTypeDef huart1;
void (*HW_hlpuart1TxCb)(void);
#endif
- void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_RX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_RX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_RX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_RX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ return;
+}
+
+void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
{
- HAL_StatusTypeDef hal_status = HAL_OK;
- hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
+ default:
+ break;
}
switch (hal_status)
@@ -163,8 +161,8 @@ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t
hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
{
-HAL_StatusTypeDef hal_status = HAL_OK;
-hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
@@ -252,33 +250,33 @@ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
switch ((uint32_t)huart->Instance)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1RxCb)
- {
- HW_huart1RxCb();
- }
- break;
+ if(HW_huart1RxCb)
+ {
+ HW_huart1RxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1RxCb)
- {
- HW_hlpuart1RxCb();
- }
- break;
+ if(HW_hlpuart1RxCb)
+ {
+ HW_hlpuart1RxCb();
+ }
+ break;
#endif
default:
@@ -294,20 +292,20 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1TxCb)
- {
- HW_huart1TxCb();
- }
- break;
+ if(HW_huart1TxCb)
+ {
+ HW_huart1TxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1TxCb)
- {
- HW_hlpuart1TxCb();
- }
- break;
+ if(HW_hlpuart1TxCb)
+ {
+ HW_hlpuart1TxCb();
+ }
+ break;
#endif
default:
@@ -317,4 +315,4 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
return;
}
- /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Src/main.c
index 98d1570a0..00e011ffa 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Src/main.c
@@ -164,17 +164,20 @@ void SystemClock_Config(void)
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
+ /** Configure LSE Drive Capability
+ */
+ __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
/** Configure the main internal regulator output voltage
*/
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
/** Initializes the CPU, AHB and APB busses clocks
*/
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSI1
- |RCC_OSCILLATORTYPE_HSE;
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE
+ |RCC_OSCILLATORTYPE_LSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ RCC_OscInitStruct.LSEState = RCC_LSE_ON;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
- RCC_OscInitStruct.LSIState = RCC_LSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
@@ -203,8 +206,8 @@ void SystemClock_Config(void)
|RCC_PERIPHCLK_LPUART1;
PeriphClkInitStruct.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2;
PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1;
- PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI;
- PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSI;
+ PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
+ PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSE;
PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSE;
PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE0;
@@ -351,7 +354,7 @@ static void MX_RTC_Init(void)
hrtc.Instance = RTC;
hrtc.Init.HourFormat = RTC_HOURFORMAT_24;
hrtc.Init.AsynchPrediv = CFG_RTC_ASYNCH_PRESCALER;
- hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER ;
+ hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
hrtc.Init.OutPut = RTC_OUTPUT_DISABLE;
hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH;
hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;
@@ -394,6 +397,7 @@ static void MX_GPIO_Init(void)
{
/* GPIO Ports Clock Enable */
+ __HAL_RCC_GPIOC_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
@@ -406,6 +410,12 @@ void PeriphClock_Config(void)
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -439,30 +449,6 @@ void PeriphClock_Config(void)
HAL_RCCEx_CRSConfig(&RCC_CRSInitStruct);
#endif
- /**
- * Select LSE clock
- */
- LL_RCC_LSE_Enable();
- while(!LL_RCC_LSE_IsReady());
-
- /**
- * Select wakeup source of BLE RF
- */
- LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
-
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
/*************************************************************
@@ -555,6 +541,7 @@ static void Reset_BackupDomain( void )
return;
}
+
static void Init_Exti( void )
{
/**< Disable all wakeup interrupt on CPU1 except IPCC(36), HSEM(38) */
@@ -563,6 +550,40 @@ static void Init_Exti( void )
return;
}
+
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+void HAL_Delay(uint32_t Delay)
+{
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
+
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
+}
/* USER CODE END 4 */
/**
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Src/stm32wbxx_hal_msp.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Src/stm32wbxx_hal_msp.c
index ce0ff57da..9c338486d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Src/stm32wbxx_hal_msp.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Core/Src/stm32wbxx_hal_msp.c
@@ -97,8 +97,6 @@ void HAL_MspInit(void)
HAL_NVIC_SetPriority(FPU_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(FPU_IRQn);
- /* Disable the internal Pull-Up in Dead Battery pins of UCPD peripheral */
-
/* USER CODE BEGIN MspInit 1 */
/* USER CODE END MspInit 1 */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/STM32_WPAN/App/app_thread.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/STM32_WPAN/App/app_thread.c
index 8c0ce162c..1902f7a48 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/STM32_WPAN/App/app_thread.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/STM32_WPAN/App/app_thread.c
@@ -67,8 +67,9 @@ static void APP_THREAD_CheckWirelessFirmwareInfo(void);
static void APP_THREAD_DeviceConfig(void);
static void APP_THREAD_StateNotif(uint32_t NotifFlags, void *pContext);
static void APP_THREAD_TraceError(const char * pMess, uint32_t ErrCode);
-
+#if (CFG_FULL_LOW_POWER == 0)
static void Send_CLI_To_M0(void);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
static void Send_CLI_Ack_For_OT(void);
static void HostTxCb( void );
static void Wait_Getting_Ack_From_M0(void);
@@ -83,8 +84,10 @@ extern void MX_USART1_UART_Init(void);
#if (CFG_USB_INTERFACE_ENABLE != 0)
static uint32_t ProcessCmdString(uint8_t* buf , uint32_t len);
#else
+#if (CFG_FULL_LOW_POWER == 0)
static void RxCpltCallback(void);
-#endif
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
/* USER CODE BEGIN PFP */
static void APP_THREAD_DummyReqHandler(void * p_context,
@@ -119,10 +122,14 @@ static uint8_t TmpString[C_SIZE_CMD_STRING];
static uint8_t VcpRxBuffer[sizeof(TL_CmdSerial_t)]; /* Received Data over USB are stored in this buffer */
static uint8_t VcpTxBuffer[sizeof(TL_EvtPacket_t) + 254U]; /* Transmit buffer over USB */
#else
+#if (CFG_FULL_LOW_POWER == 0)
static uint8_t aRxBuffer[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+#if (CFG_FULL_LOW_POWER == 0)
static uint8_t CommandString[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
static __IO uint16_t indexReceiveChar = 0;
static __IO uint16_t CptReceiveCmdFromUser = 0;
@@ -160,7 +167,7 @@ void APP_THREAD_Init( void )
/* USER CODE END APP_THREAD_INIT_1 */
SHCI_CmdStatus_t ThreadInitStatus;
-
+
/* Check the compatibility with the Coprocessor Wireless Firmware loaded */
APP_THREAD_CheckWirelessFirmwareInfo();
@@ -184,7 +191,7 @@ void APP_THREAD_Init( void )
/* Send Thread start system cmd to M0 */
ThreadInitStatus = SHCI_C2_THREAD_Init();
-
+
/* Prevent unused argument(s) compilation warning */
UNUSED(ThreadInitStatus);
@@ -201,16 +208,17 @@ void APP_THREAD_Init( void )
/* Initialize and configure the Thread device*/
APP_THREAD_DeviceConfig();
+
/* USER CODE BEGIN APP_THREAD_INIT_2 */
/* USER CODE END APP_THREAD_INIT_2 */
}
/**
- * @brief Trace the error or the warning reported.
- * @param ErrId :
- * @param ErrCode
- * @retval None
- */
+ * @brief Trace the error or the warning reported.
+ * @param ErrId :
+ * @param ErrCode
+ * @retval None
+ */
void APP_THREAD_Error(uint32_t ErrId, uint32_t ErrCode)
{
/* USER CODE BEGIN APP_THREAD_Error_1 */
@@ -382,22 +390,20 @@ static void APP_THREAD_StateNotif(uint32_t NotifFlags, void *pContext)
/* USER CODE BEGIN DEFAULT */
BSP_LED_Off(LED2);
BSP_LED_Off(LED3);
- /* USER CODE END DEFAULT */
- break;
+ /* USER CODE END DEFAULT */
+ break;
}
}
}
-
-
/**
- * @brief Warn the user that an error has occurred.In this case,
- * the LEDs on the Board will start blinking.
- *
- * @param pMess : Message associated to the error.
- * @param ErrCode: Error code associated to the module (OpenThread or other module if any)
- * @retval None
- */
+ * @brief Warn the user that an error has occurred.In this case,
+ * the LEDs on the Board will start blinking.
+ *
+ * @param pMess : Message associated to the error.
+ * @param ErrCode: Error code associated to the module (OpenThread or other module if any)
+ * @retval None
+ */
static void APP_THREAD_TraceError(const char * pMess, uint32_t ErrCode)
{
/* USER CODE BEGIN TRACE_ERROR */
@@ -792,7 +798,6 @@ void APP_THREAD_RegisterCmdBuffer(TL_CmdPacket_t* p_buffer)
p_thread_otcmdbuffer = p_buffer;
}
-
Thread_OT_Cmd_Request_t* THREAD_Get_OTCmdPayloadBuffer(void)
{
return (Thread_OT_Cmd_Request_t*)p_thread_otcmdbuffer->cmdserial.cmd.payload;
@@ -858,47 +863,47 @@ void TL_THREAD_NotReceived( TL_EvtPacket_t * Notbuffer )
}
/**
- * @brief This function is called before sending any ot command to the M0
- * core. The purpose of this function is to be able to check if
- * there are no notifications coming from the M0 core which are
- * pending before sending a new ot command.
- * @param None
- * @retval None
- */
+ * @brief This function is called before sending any ot command to the M0
+ * core. The purpose of this function is to be able to check if
+ * there are no notifications coming from the M0 core which are
+ * pending before sending a new ot command.
+ * @param None
+ * @retval None
+ */
void Pre_OtCmdProcessing(void)
{
- UTIL_SEQ_WaitEvt( EVENT_SYNCHRO_BYPASS_IDLE);
+ UTIL_SEQ_WaitEvt(EVENT_SYNCHRO_BYPASS_IDLE);
}
/**
- * @brief This function waits for getting an acknowledgment from the M0.
- *
- * @param None
- * @retval None
- */
+ * @brief This function waits for getting an acknowledgment from the M0.
+ *
+ * @param None
+ * @retval None
+ */
static void Wait_Getting_Ack_From_M0(void)
{
UTIL_SEQ_WaitEvt(EVENT_ACK_FROM_M0_EVT);
}
/**
- * @brief Receive an acknowledgment from the M0+ core.
- * Each command send by the M4 to the M0 are acknowledged.
- * This function is called under interrupt.
- * @param None
- * @retval None
- */
+ * @brief Receive an acknowledgment from the M0+ core.
+ * Each command send by the M4 to the M0 are acknowledged.
+ * This function is called under interrupt.
+ * @param None
+ * @retval None
+ */
static void Receive_Ack_From_M0(void)
{
UTIL_SEQ_SetEvt(EVENT_ACK_FROM_M0_EVT);
}
/**
- * @brief Receive a notification from the M0+ through the IPCC.
- * This function is called under interrupt.
- * @param None
- * @retval None
- */
+ * @brief Receive a notification from the M0+ through the IPCC.
+ * This function is called under interrupt.
+ * @param None
+ * @retval None
+ */
static void Receive_Notification_From_M0(void)
{
CptReceiveMsgFromM0++;
@@ -907,6 +912,7 @@ static void Receive_Notification_From_M0(void)
#if (CFG_USB_INTERFACE_ENABLE != 0)
#else
+#if (CFG_FULL_LOW_POWER == 0)
static void RxCpltCallback(void)
{
/* Filling buffer and wait for '\r' char */
@@ -925,6 +931,7 @@ static void RxCpltCallback(void)
/* Once a character has been sent, put back the device in reception mode */
HW_UART_Receive_IT(CFG_CLI_UART, aRxBuffer, 1U, RxCpltCallback);
}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
#if (CFG_USB_INTERFACE_ENABLE != 0)
@@ -967,6 +974,7 @@ static uint32_t ProcessCmdString( uint8_t* buf , uint32_t len )
}
#endif/* (CFG_USB_INTERFACE_ENABLE != 0) */
+#if (CFG_FULL_LOW_POWER == 0)
/**
* @brief Process sends receive CLI command to M0.
* @param None
@@ -986,6 +994,7 @@ static void Send_CLI_To_M0(void)
TL_CLI_SendCmd();
}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
/**
* @brief Send notification for CLI TL Channel.
@@ -1006,11 +1015,16 @@ static void Send_CLI_Ack_For_OT(void)
*/
void APP_THREAD_Init_UART_CLI(void)
{
+#if (CFG_FULL_LOW_POWER == 0)
UTIL_SEQ_RegTask( 1<<CFG_TASK_SEND_CLI_TO_M0, UTIL_SEQ_RFU,Send_CLI_To_M0);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+
#if (CFG_USB_INTERFACE_ENABLE != 0)
#else
+#if (CFG_FULL_LOW_POWER == 0)
MX_USART1_UART_Init();
HW_UART_Receive_IT(CFG_CLI_UART, aRxBuffer, 1, RxCpltCallback);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Thread_Coap_Multiboard.ioc b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Thread_Coap_Multiboard.ioc
index d9203d05d..a562fcfad 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Thread_Coap_Multiboard.ioc
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Coap_MultiBoard/Thread_Coap_Multiboard.ioc
@@ -57,26 +57,28 @@ Mcu.IP9=SYS
Mcu.IPNb=12
Mcu.Name=STM32WB55RGVx
Mcu.Package=VFQFPN68
-Mcu.Pin0=PA2
-Mcu.Pin1=PA3
-Mcu.Pin10=VP_SEQUENCER_VS_SEQUENCER
-Mcu.Pin11=VP_STM32_WPAN_VS_THREAD
-Mcu.Pin12=VP_SYS_VS_Systick
-Mcu.Pin13=VP_TINY_LPM_VS_TINY_LPM
-Mcu.Pin2=RF1
-Mcu.Pin3=OSC_OUT
-Mcu.Pin4=OSC_IN
-Mcu.Pin5=PA11
-Mcu.Pin6=PB6
-Mcu.Pin7=PB7
-Mcu.Pin8=VP_HSEM_VS_HSEM
-Mcu.Pin9=VP_RTC_VS_RTC_Activate
-Mcu.PinsNb=14
+Mcu.Pin0=PC14-OSC32_IN
+Mcu.Pin1=PC15-OSC32_OUT
+Mcu.Pin10=VP_HSEM_VS_HSEM
+Mcu.Pin11=VP_RTC_VS_RTC_Activate
+Mcu.Pin12=VP_SEQUENCER_VS_SEQUENCER
+Mcu.Pin13=VP_STM32_WPAN_VS_THREAD
+Mcu.Pin14=VP_SYS_VS_Systick
+Mcu.Pin15=VP_TINY_LPM_VS_TINY_LPM
+Mcu.Pin2=PA2
+Mcu.Pin3=PA3
+Mcu.Pin4=RF1
+Mcu.Pin5=OSC_OUT
+Mcu.Pin6=OSC_IN
+Mcu.Pin7=PA11
+Mcu.Pin8=PB6
+Mcu.Pin9=PB7
+Mcu.PinsNb=16
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32WB55RGVx
-MxCube.Version=5.3.0
-MxDb.Version=DB.5.0.30
+MxCube.Version=5.4.0
+MxDb.Version=DB.5.0.40
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false
NVIC.C2SEV_PWR_C2H_IRQn=true\:0\:0\:false\:false\:true\:true\:false
NVIC.DMA1_Channel1_IRQn=true\:0\:0\:false\:false\:true\:false\:true
@@ -114,6 +116,10 @@ PB6.Signal=USART1_TX
PB7.Locked=true
PB7.Mode=Asynchronous
PB7.Signal=USART1_RX
+PC14-OSC32_IN.Mode=LSE-External-Oscillator
+PC14-OSC32_IN.Signal=RCC_OSC32_IN
+PC15-OSC32_OUT.Mode=LSE-External-Oscillator
+PC15-OSC32_OUT.Signal=RCC_OSC32_OUT
PCC.Ble.ConnectionInterval=1000.0
PCC.Ble.DataLength=6
PCC.Ble.Mode=Advertising
@@ -172,12 +178,12 @@ RCC.HSI48_VALUE=48000000
RCC.HSI_VALUE=16000000
RCC.I2C1Freq_Value=32000000
RCC.I2C3Freq_Value=32000000
-RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSE_VALUE,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1N,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PWRFreq_Value,RNGFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SMPSCLockSelectionVirtual,SMPSFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LCDFreq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1N,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PWRFreq_Value,RFWKPClockSelection,RFWKPFreq_Value,RNGFreq_Value,RTCClockSelection,RTCFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SMPSCLockSelectionVirtual,SMPSFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.LCDFreq_Value=32768
RCC.LPTIM1Freq_Value=32000000
RCC.LPTIM2Freq_Value=32000000
RCC.LPUART1Freq_Value=32000000
RCC.LSCOPinFreq_Value=32000
-RCC.LSE_VALUE=32768
RCC.LSI_VALUE=32000
RCC.MCO1PinFreq_Value=32000000
RCC.PLLPoutputFreq_Value=16000000
@@ -188,7 +194,11 @@ RCC.PLLSAI1PoutputFreq_Value=48000000
RCC.PLLSAI1QoutputFreq_Value=48000000
RCC.PLLSAI1RoutputFreq_Value=48000000
RCC.PWRFreq_Value=32000000
+RCC.RFWKPClockSelection=RCC_RFWKPCLKSOURCE_LSE
+RCC.RFWKPFreq_Value=32768
RCC.RNGFreq_Value=32000
+RCC.RTCClockSelection=RCC_RTCCLKSOURCE_LSE
+RCC.RTCFreq_Value=32768
RCC.SAI1Freq_Value=48000000
RCC.SMPS1Freq_Value=16000000
RCC.SMPSCLockSelectionVirtual=RCC_SMPSCLKSOURCE_HSE
@@ -204,7 +214,7 @@ RF1.Mode=RF1_Activate
RF1.Signal=RF_RF1
RTC.AsynchPrediv=CFG_RTC_ASYNCH_PRESCALER
RTC.IPParameters=AsynchPrediv,SynchPrediv
-RTC.SynchPrediv=CFG_RTC_SYNCH_PRESCALER
+RTC.SynchPrediv=CFG_RTC_SYNCH_PRESCALER
STM32_WPAN.APP_DBG_EN=1
STM32_WPAN.CFG_CLI_UART=hw_uart1
STM32_WPAN.CFG_DBG_TRACE_UART=hw_lpuart1
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Inc/app_conf.h
index d1d052ee0..0e7e91751 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Inc/app_conf.h
@@ -23,6 +23,7 @@
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Application Config
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Inc/stm32_lpm_if.h
index 45db98456..70abecaa9 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Inc/stm32_lpm_if.h
@@ -1,21 +1,21 @@
/* USER CODE BEGIN Header */
/**
- ******************************************************************************
- * File Name : stm32_lpm_if.h
- * Description : Header for stm32_lpm_f.c module (device specific LP management).
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
+******************************************************************************
+* @file stm32_lpm_if.h
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
+******************************************************************************
+* @attention
+*
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+* All rights reserved.</center></h2>
+*
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+*
+******************************************************************************
+*/
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
@@ -65,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Inc/stm32wbxx_it.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Inc/stm32wbxx_it.h
index fb879095f..5e32492ba 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Inc/stm32wbxx_it.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Inc/stm32wbxx_it.h
@@ -28,7 +28,7 @@
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
-
+#include "app_common.h"
/* USER CODE END Includes */
/* Exported types ------------------------------------------------------------*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Inc/utilities_conf.h
index 2c5384639..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Inc/utilities_conf.h
@@ -10,10 +10,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Src/hw_timerserver.c
index 17c9af0a4..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Src/hw_timerserver.c
@@ -4,19 +4,18 @@
* Description : Hardware timerserver source file for STM32WPAN Middleware.
*
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Src/hw_uart.c
index ac245a96f..9a553610d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Src/hw_uart.c
@@ -48,9 +48,8 @@ extern UART_HandleTypeDef huart1;
hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
} while(0)
- /* Variables ------------------------------------------------------------------*/
+/* Variables -----------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
-
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
#endif
@@ -59,7 +58,6 @@ extern UART_HandleTypeDef huart1;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
-
#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_hlpuart1_tx ={0};
#endif
@@ -67,73 +65,73 @@ extern UART_HandleTypeDef huart1;
void (*HW_hlpuart1TxCb)(void);
#endif
- void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_RX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_RX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_RX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_RX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ return;
+}
+
+void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
{
- HAL_StatusTypeDef hal_status = HAL_OK;
- hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
+ default:
+ break;
}
switch (hal_status)
@@ -163,8 +161,8 @@ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t
hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
{
-HAL_StatusTypeDef hal_status = HAL_OK;
-hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
@@ -252,33 +250,33 @@ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
switch ((uint32_t)huart->Instance)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1RxCb)
- {
- HW_huart1RxCb();
- }
- break;
+ if(HW_huart1RxCb)
+ {
+ HW_huart1RxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1RxCb)
- {
- HW_hlpuart1RxCb();
- }
- break;
+ if(HW_hlpuart1RxCb)
+ {
+ HW_hlpuart1RxCb();
+ }
+ break;
#endif
default:
@@ -294,20 +292,20 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1TxCb)
- {
- HW_huart1TxCb();
- }
- break;
+ if(HW_huart1TxCb)
+ {
+ HW_huart1TxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1TxCb)
- {
- HW_hlpuart1TxCb();
- }
- break;
+ if(HW_hlpuart1TxCb)
+ {
+ HW_hlpuart1TxCb();
+ }
+ break;
#endif
default:
@@ -317,4 +315,4 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
return;
}
- /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Src/main.c
index 98d1570a0..00e011ffa 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Src/main.c
@@ -164,17 +164,20 @@ void SystemClock_Config(void)
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
+ /** Configure LSE Drive Capability
+ */
+ __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
/** Configure the main internal regulator output voltage
*/
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
/** Initializes the CPU, AHB and APB busses clocks
*/
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSI1
- |RCC_OSCILLATORTYPE_HSE;
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE
+ |RCC_OSCILLATORTYPE_LSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ RCC_OscInitStruct.LSEState = RCC_LSE_ON;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
- RCC_OscInitStruct.LSIState = RCC_LSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
@@ -203,8 +206,8 @@ void SystemClock_Config(void)
|RCC_PERIPHCLK_LPUART1;
PeriphClkInitStruct.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2;
PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1;
- PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI;
- PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSI;
+ PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
+ PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSE;
PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSE;
PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE0;
@@ -351,7 +354,7 @@ static void MX_RTC_Init(void)
hrtc.Instance = RTC;
hrtc.Init.HourFormat = RTC_HOURFORMAT_24;
hrtc.Init.AsynchPrediv = CFG_RTC_ASYNCH_PRESCALER;
- hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER ;
+ hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
hrtc.Init.OutPut = RTC_OUTPUT_DISABLE;
hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH;
hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;
@@ -394,6 +397,7 @@ static void MX_GPIO_Init(void)
{
/* GPIO Ports Clock Enable */
+ __HAL_RCC_GPIOC_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
@@ -406,6 +410,12 @@ void PeriphClock_Config(void)
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -439,30 +449,6 @@ void PeriphClock_Config(void)
HAL_RCCEx_CRSConfig(&RCC_CRSInitStruct);
#endif
- /**
- * Select LSE clock
- */
- LL_RCC_LSE_Enable();
- while(!LL_RCC_LSE_IsReady());
-
- /**
- * Select wakeup source of BLE RF
- */
- LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
-
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
/*************************************************************
@@ -555,6 +541,7 @@ static void Reset_BackupDomain( void )
return;
}
+
static void Init_Exti( void )
{
/**< Disable all wakeup interrupt on CPU1 except IPCC(36), HSEM(38) */
@@ -563,6 +550,40 @@ static void Init_Exti( void )
return;
}
+
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+void HAL_Delay(uint32_t Delay)
+{
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
+
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
+}
/* USER CODE END 4 */
/**
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Src/stm32wbxx_hal_msp.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Src/stm32wbxx_hal_msp.c
index ce0ff57da..9c338486d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Src/stm32wbxx_hal_msp.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Core/Src/stm32wbxx_hal_msp.c
@@ -97,8 +97,6 @@ void HAL_MspInit(void)
HAL_NVIC_SetPriority(FPU_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(FPU_IRQn);
- /* Disable the internal Pull-Up in Dead Battery pins of UCPD peripheral */
-
/* USER CODE BEGIN MspInit 1 */
/* USER CODE END MspInit 1 */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/STM32_WPAN/App/app_thread.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/STM32_WPAN/App/app_thread.c
index c8827e05e..04317db1a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/STM32_WPAN/App/app_thread.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/STM32_WPAN/App/app_thread.c
@@ -16,7 +16,7 @@
*
******************************************************************************
*/
- /* USER CODE END Header */
+/* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -71,8 +71,9 @@ static void APP_THREAD_CheckWirelessFirmwareInfo(void);
static void APP_THREAD_DeviceConfig(void);
static void APP_THREAD_StateNotif(uint32_t NotifFlags, void *pContext);
static void APP_THREAD_TraceError(const char * pMess, uint32_t ErrCode);
-
+#if (CFG_FULL_LOW_POWER == 0)
static void Send_CLI_To_M0(void);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
static void Send_CLI_Ack_For_OT(void);
static void HostTxCb( void );
static void Wait_Getting_Ack_From_M0(void);
@@ -87,10 +88,12 @@ extern void MX_USART1_UART_Init(void);
#if (CFG_USB_INTERFACE_ENABLE != 0)
static uint32_t ProcessCmdString(uint8_t* buf , uint32_t len);
#else
+#if (CFG_FULL_LOW_POWER == 0)
static void RxCpltCallback(void);
-#endif
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
- /* USER CODE BEGIN PFP */
+/* USER CODE BEGIN PFP */
static void APP_THREAD_JoinerHandler(otError OtError, void *pContext);
static void APP_THREAD_ConfigJoiner(void);
static void APP_THREAD_ConfigLeaderDevice(void);
@@ -104,10 +107,14 @@ static uint8_t TmpString[C_SIZE_CMD_STRING];
static uint8_t VcpRxBuffer[sizeof(TL_CmdSerial_t)]; /* Received Data over USB are stored in this buffer */
static uint8_t VcpTxBuffer[sizeof(TL_EvtPacket_t) + 254U]; /* Transmit buffer over USB */
#else
+#if (CFG_FULL_LOW_POWER == 0)
static uint8_t aRxBuffer[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+#if (CFG_FULL_LOW_POWER == 0)
static uint8_t CommandString[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
static __IO uint16_t indexReceiveChar = 0;
static __IO uint16_t CptReceiveCmdFromUser = 0;
@@ -134,7 +141,7 @@ void APP_THREAD_Init( void )
/* USER CODE END APP_THREAD_INIT_1 */
SHCI_CmdStatus_t ThreadInitStatus;
-
+
/* Check the compatibility with the Coprocessor Wireless Firmware loaded */
APP_THREAD_CheckWirelessFirmwareInfo();
@@ -158,7 +165,7 @@ void APP_THREAD_Init( void )
/* Send Thread start system cmd to M0 */
ThreadInitStatus = SHCI_C2_THREAD_Init();
-
+
/* Prevent unused argument(s) compilation warning */
UNUSED(ThreadInitStatus);
@@ -325,7 +332,7 @@ static void APP_THREAD_StateNotif(uint32_t NotifFlags, void *pContext)
}
ToggleBlueLedMode = NO_TOGGLING;
BSP_LED_On(LED1);
- /* USER CODE END OT_DEVICE_ROLE_LEADER */
+ /* USER CODE END OT_DEVICE_ROLE_LEADER */
break;
default:
/* USER CODE BEGIN DEFAULT */
@@ -555,7 +562,6 @@ void APP_THREAD_RegisterCmdBuffer(TL_CmdPacket_t* p_buffer)
p_thread_otcmdbuffer = p_buffer;
}
-
Thread_OT_Cmd_Request_t* THREAD_Get_OTCmdPayloadBuffer(void)
{
return (Thread_OT_Cmd_Request_t*)p_thread_otcmdbuffer->cmdserial.cmd.payload;
@@ -630,7 +636,7 @@ void TL_THREAD_NotReceived( TL_EvtPacket_t * Notbuffer )
*/
void Pre_OtCmdProcessing(void)
{
- UTIL_SEQ_WaitEvt( EVENT_SYNCHRO_BYPASS_IDLE);
+ UTIL_SEQ_WaitEvt(EVENT_SYNCHRO_BYPASS_IDLE);
}
/**
@@ -670,6 +676,7 @@ static void Receive_Notification_From_M0(void)
#if (CFG_USB_INTERFACE_ENABLE != 0)
#else
+#if (CFG_FULL_LOW_POWER == 0)
static void RxCpltCallback(void)
{
/* Filling buffer and wait for '\r' char */
@@ -688,6 +695,7 @@ static void RxCpltCallback(void)
/* Once a character has been sent, put back the device in reception mode */
HW_UART_Receive_IT(CFG_CLI_UART, aRxBuffer, 1U, RxCpltCallback);
}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
#if (CFG_USB_INTERFACE_ENABLE != 0)
@@ -730,6 +738,7 @@ static uint32_t ProcessCmdString( uint8_t* buf , uint32_t len )
}
#endif/* (CFG_USB_INTERFACE_ENABLE != 0) */
+#if (CFG_FULL_LOW_POWER == 0)
/**
* @brief Process sends receive CLI command to M0.
* @param None
@@ -749,6 +758,7 @@ static void Send_CLI_To_M0(void)
TL_CLI_SendCmd();
}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
/**
* @brief Send notification for CLI TL Channel.
@@ -769,11 +779,16 @@ static void Send_CLI_Ack_For_OT(void)
*/
void APP_THREAD_Init_UART_CLI(void)
{
+#if (CFG_FULL_LOW_POWER == 0)
UTIL_SEQ_RegTask( 1<<CFG_TASK_SEND_CLI_TO_M0, UTIL_SEQ_RFU,Send_CLI_To_M0);
- #if (CFG_USB_INTERFACE_ENABLE != 0)
- #else
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+#else
+#if (CFG_FULL_LOW_POWER == 0)
MX_USART1_UART_Init();
HW_UART_Receive_IT(CFG_CLI_UART, aRxBuffer, 1, RxCpltCallback);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Thread_Commissioning.ioc b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Thread_Commissioning.ioc
index f1138a380..b6cfd601f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Thread_Commissioning.ioc
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Commissioning/Thread_Commissioning.ioc
@@ -57,26 +57,28 @@ Mcu.IP9=SYS
Mcu.IPNb=12
Mcu.Name=STM32WB55RGVx
Mcu.Package=VFQFPN68
-Mcu.Pin0=PA2
-Mcu.Pin1=PA3
-Mcu.Pin10=VP_SEQUENCER_VS_SEQUENCER
-Mcu.Pin11=VP_STM32_WPAN_VS_THREAD
-Mcu.Pin12=VP_SYS_VS_Systick
-Mcu.Pin13=VP_TINY_LPM_VS_TINY_LPM
-Mcu.Pin2=RF1
-Mcu.Pin3=OSC_OUT
-Mcu.Pin4=OSC_IN
-Mcu.Pin5=PA11
-Mcu.Pin6=PB6
-Mcu.Pin7=PB7
-Mcu.Pin8=VP_HSEM_VS_HSEM
-Mcu.Pin9=VP_RTC_VS_RTC_Activate
-Mcu.PinsNb=14
+Mcu.Pin0=PC14-OSC32_IN
+Mcu.Pin1=PC15-OSC32_OUT
+Mcu.Pin10=VP_HSEM_VS_HSEM
+Mcu.Pin11=VP_RTC_VS_RTC_Activate
+Mcu.Pin12=VP_SEQUENCER_VS_SEQUENCER
+Mcu.Pin13=VP_STM32_WPAN_VS_THREAD
+Mcu.Pin14=VP_SYS_VS_Systick
+Mcu.Pin15=VP_TINY_LPM_VS_TINY_LPM
+Mcu.Pin2=PA2
+Mcu.Pin3=PA3
+Mcu.Pin4=RF1
+Mcu.Pin5=OSC_OUT
+Mcu.Pin6=OSC_IN
+Mcu.Pin7=PA11
+Mcu.Pin8=PB6
+Mcu.Pin9=PB7
+Mcu.PinsNb=16
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32WB55RGVx
-MxCube.Version=5.3.0
-MxDb.Version=DB.5.0.30
+MxCube.Version=5.4.0
+MxDb.Version=DB.5.0.40
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false
NVIC.C2SEV_PWR_C2H_IRQn=true\:0\:0\:false\:false\:true\:true\:false
NVIC.DMA1_Channel1_IRQn=true\:0\:0\:false\:false\:true\:false\:true
@@ -114,6 +116,10 @@ PB6.Signal=USART1_TX
PB7.Locked=true
PB7.Mode=Asynchronous
PB7.Signal=USART1_RX
+PC14-OSC32_IN.Mode=LSE-External-Oscillator
+PC14-OSC32_IN.Signal=RCC_OSC32_IN
+PC15-OSC32_OUT.Mode=LSE-External-Oscillator
+PC15-OSC32_OUT.Signal=RCC_OSC32_OUT
PCC.Ble.ConnectionInterval=1000.0
PCC.Ble.DataLength=6
PCC.Ble.Mode=Advertising
@@ -172,12 +178,12 @@ RCC.HSI48_VALUE=48000000
RCC.HSI_VALUE=16000000
RCC.I2C1Freq_Value=32000000
RCC.I2C3Freq_Value=32000000
-RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSE_VALUE,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1N,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PWRFreq_Value,RNGFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SMPSCLockSelectionVirtual,SMPSFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LCDFreq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1N,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PWRFreq_Value,RFWKPClockSelection,RFWKPFreq_Value,RNGFreq_Value,RTCClockSelection,RTCFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SMPSCLockSelectionVirtual,SMPSFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.LCDFreq_Value=32768
RCC.LPTIM1Freq_Value=32000000
RCC.LPTIM2Freq_Value=32000000
RCC.LPUART1Freq_Value=32000000
RCC.LSCOPinFreq_Value=32000
-RCC.LSE_VALUE=32768
RCC.LSI_VALUE=32000
RCC.MCO1PinFreq_Value=32000000
RCC.PLLPoutputFreq_Value=16000000
@@ -188,7 +194,11 @@ RCC.PLLSAI1PoutputFreq_Value=48000000
RCC.PLLSAI1QoutputFreq_Value=48000000
RCC.PLLSAI1RoutputFreq_Value=48000000
RCC.PWRFreq_Value=32000000
+RCC.RFWKPClockSelection=RCC_RFWKPCLKSOURCE_LSE
+RCC.RFWKPFreq_Value=32768
RCC.RNGFreq_Value=32000
+RCC.RTCClockSelection=RCC_RTCCLKSOURCE_LSE
+RCC.RTCFreq_Value=32768
RCC.SAI1Freq_Value=48000000
RCC.SMPS1Freq_Value=16000000
RCC.SMPSCLockSelectionVirtual=RCC_SMPSCLKSOURCE_HSE
@@ -204,7 +214,7 @@ RF1.Mode=RF1_Activate
RF1.Signal=RF_RF1
RTC.AsynchPrediv=CFG_RTC_ASYNCH_PRESCALER
RTC.IPParameters=AsynchPrediv,SynchPrediv
-RTC.SynchPrediv=CFG_RTC_SYNCH_PRESCALER
+RTC.SynchPrediv=CFG_RTC_SYNCH_PRESCALER
STM32_WPAN.APP_DBG_EN=1
STM32_WPAN.CFG_CLI_UART=hw_uart1
STM32_WPAN.CFG_DBG_TRACE_UART=hw_lpuart1
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/app_conf.h
index 763f49913..97b483d45 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/app_conf.h
@@ -23,6 +23,7 @@
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Application Config
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/stm32_lpm_if.h
index 45db98456..70abecaa9 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/stm32_lpm_if.h
@@ -1,21 +1,21 @@
/* USER CODE BEGIN Header */
/**
- ******************************************************************************
- * File Name : stm32_lpm_if.h
- * Description : Header for stm32_lpm_f.c module (device specific LP management).
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
+******************************************************************************
+* @file stm32_lpm_if.h
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
+******************************************************************************
+* @attention
+*
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+* All rights reserved.</center></h2>
+*
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+*
+******************************************************************************
+*/
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
@@ -65,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/stm32wbxx_it.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/stm32wbxx_it.h
index 9b30fc262..a3a535f13 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/stm32wbxx_it.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/stm32wbxx_it.h
@@ -28,7 +28,7 @@
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
-
+#include "app_common.h"
/* USER CODE END Includes */
/* Exported types ------------------------------------------------------------*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/utilities_conf.h
index 2c5384639..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/utilities_conf.h
@@ -10,10 +10,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/hw_timerserver.c
index 17c9af0a4..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/hw_timerserver.c
@@ -4,19 +4,18 @@
* Description : Hardware timerserver source file for STM32WPAN Middleware.
*
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/hw_uart.c
index ac245a96f..9a553610d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/hw_uart.c
@@ -48,9 +48,8 @@ extern UART_HandleTypeDef huart1;
hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
} while(0)
- /* Variables ------------------------------------------------------------------*/
+/* Variables -----------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
-
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
#endif
@@ -59,7 +58,6 @@ extern UART_HandleTypeDef huart1;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
-
#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_hlpuart1_tx ={0};
#endif
@@ -67,73 +65,73 @@ extern UART_HandleTypeDef huart1;
void (*HW_hlpuart1TxCb)(void);
#endif
- void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_RX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_RX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_RX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_RX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ return;
+}
+
+void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
{
- HAL_StatusTypeDef hal_status = HAL_OK;
- hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
+ default:
+ break;
}
switch (hal_status)
@@ -163,8 +161,8 @@ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t
hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
{
-HAL_StatusTypeDef hal_status = HAL_OK;
-hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
@@ -252,33 +250,33 @@ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
switch ((uint32_t)huart->Instance)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1RxCb)
- {
- HW_huart1RxCb();
- }
- break;
+ if(HW_huart1RxCb)
+ {
+ HW_huart1RxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1RxCb)
- {
- HW_hlpuart1RxCb();
- }
- break;
+ if(HW_hlpuart1RxCb)
+ {
+ HW_hlpuart1RxCb();
+ }
+ break;
#endif
default:
@@ -294,20 +292,20 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1TxCb)
- {
- HW_huart1TxCb();
- }
- break;
+ if(HW_huart1TxCb)
+ {
+ HW_huart1TxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1TxCb)
- {
- HW_hlpuart1TxCb();
- }
- break;
+ if(HW_hlpuart1TxCb)
+ {
+ HW_hlpuart1TxCb();
+ }
+ break;
#endif
default:
@@ -317,4 +315,4 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
return;
}
- /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/main.c
index 98d1570a0..00e011ffa 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/main.c
@@ -164,17 +164,20 @@ void SystemClock_Config(void)
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
+ /** Configure LSE Drive Capability
+ */
+ __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
/** Configure the main internal regulator output voltage
*/
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
/** Initializes the CPU, AHB and APB busses clocks
*/
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSI1
- |RCC_OSCILLATORTYPE_HSE;
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE
+ |RCC_OSCILLATORTYPE_LSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ RCC_OscInitStruct.LSEState = RCC_LSE_ON;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
- RCC_OscInitStruct.LSIState = RCC_LSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
@@ -203,8 +206,8 @@ void SystemClock_Config(void)
|RCC_PERIPHCLK_LPUART1;
PeriphClkInitStruct.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2;
PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1;
- PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI;
- PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSI;
+ PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
+ PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSE;
PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSE;
PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE0;
@@ -351,7 +354,7 @@ static void MX_RTC_Init(void)
hrtc.Instance = RTC;
hrtc.Init.HourFormat = RTC_HOURFORMAT_24;
hrtc.Init.AsynchPrediv = CFG_RTC_ASYNCH_PRESCALER;
- hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER ;
+ hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
hrtc.Init.OutPut = RTC_OUTPUT_DISABLE;
hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH;
hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;
@@ -394,6 +397,7 @@ static void MX_GPIO_Init(void)
{
/* GPIO Ports Clock Enable */
+ __HAL_RCC_GPIOC_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
@@ -406,6 +410,12 @@ void PeriphClock_Config(void)
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -439,30 +449,6 @@ void PeriphClock_Config(void)
HAL_RCCEx_CRSConfig(&RCC_CRSInitStruct);
#endif
- /**
- * Select LSE clock
- */
- LL_RCC_LSE_Enable();
- while(!LL_RCC_LSE_IsReady());
-
- /**
- * Select wakeup source of BLE RF
- */
- LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
-
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
/*************************************************************
@@ -555,6 +541,7 @@ static void Reset_BackupDomain( void )
return;
}
+
static void Init_Exti( void )
{
/**< Disable all wakeup interrupt on CPU1 except IPCC(36), HSEM(38) */
@@ -563,6 +550,40 @@ static void Init_Exti( void )
return;
}
+
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+void HAL_Delay(uint32_t Delay)
+{
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
+
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
+}
/* USER CODE END 4 */
/**
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/stm32wbxx_hal_msp.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/stm32wbxx_hal_msp.c
index ce0ff57da..9c338486d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/stm32wbxx_hal_msp.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/stm32wbxx_hal_msp.c
@@ -97,8 +97,6 @@ void HAL_MspInit(void)
HAL_NVIC_SetPriority(FPU_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(FPU_IRQn);
- /* Disable the internal Pull-Up in Dead Battery pins of UCPD peripheral */
-
/* USER CODE BEGIN MspInit 1 */
/* USER CODE END MspInit 1 */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/STM32_WPAN/App/app_thread.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/STM32_WPAN/App/app_thread.c
index 6fcfc85eb..10ada7d8d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/STM32_WPAN/App/app_thread.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/STM32_WPAN/App/app_thread.c
@@ -50,6 +50,7 @@
#define C_SIZE_CMD_STRING 256U
#define C_PANID 0x2222U
#define C_CHANNEL_NB 12U
+
/* USER CODE BEGIN PD */
#define C_RESSOURCE "light"
/* USER CODE END PD */
@@ -64,8 +65,9 @@ static void APP_THREAD_CheckWirelessFirmwareInfo(void);
static void APP_THREAD_DeviceConfig(void);
static void APP_THREAD_StateNotif(uint32_t NotifFlags, void *pContext);
static void APP_THREAD_TraceError(const char * pMess, uint32_t ErrCode);
-
+#if (CFG_FULL_LOW_POWER == 0)
static void Send_CLI_To_M0(void);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
static void Send_CLI_Ack_For_OT(void);
static void HostTxCb( void );
static void Wait_Getting_Ack_From_M0(void);
@@ -80,8 +82,10 @@ extern void MX_USART1_UART_Init(void);
#if (CFG_USB_INTERFACE_ENABLE != 0)
static uint32_t ProcessCmdString(uint8_t* buf , uint32_t len);
#else
+#if (CFG_FULL_LOW_POWER == 0)
static void RxCpltCallback(void);
-#endif
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
/* USER CODE BEGIN PFP */
static void APP_THREAD_SendCoapMulticastRequest(uint8_t command);
@@ -101,10 +105,14 @@ static uint8_t TmpString[C_SIZE_CMD_STRING];
static uint8_t VcpRxBuffer[sizeof(TL_CmdSerial_t)]; /* Received Data over USB are stored in this buffer */
static uint8_t VcpTxBuffer[sizeof(TL_EvtPacket_t) + 254U]; /* Transmit buffer over USB */
#else
+#if (CFG_FULL_LOW_POWER == 0)
static uint8_t aRxBuffer[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+#if (CFG_FULL_LOW_POWER == 0)
static uint8_t CommandString[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
static __IO uint16_t indexReceiveChar = 0;
static __IO uint16_t CptReceiveCmdFromUser = 0;
@@ -135,7 +143,7 @@ void APP_THREAD_Init( void )
/* USER CODE END APP_THREAD_INIT_1 */
SHCI_CmdStatus_t ThreadInitStatus;
-
+
/* Check the compatibility with the Coprocessor Wireless Firmware loaded */
APP_THREAD_CheckWirelessFirmwareInfo();
@@ -159,7 +167,7 @@ void APP_THREAD_Init( void )
/* Send Thread start system cmd to M0 */
ThreadInitStatus = SHCI_C2_THREAD_Init();
-
+
/* Prevent unused argument(s) compilation warning */
UNUSED(ThreadInitStatus);
@@ -173,17 +181,18 @@ void APP_THREAD_Init( void )
/* Initialize and configure the Thread device*/
APP_THREAD_DeviceConfig();
+
/* USER CODE BEGIN APP_THREAD_INIT_2 */
/* USER CODE END APP_THREAD_INIT_2 */
}
/**
- * @brief Trace the error or the warning reported.
- * @param ErrId :
- * @param ErrCode
- * @retval None
- */
+ * @brief Trace the error or the warning reported.
+ * @param ErrId :
+ * @param ErrCode
+ * @retval None
+ */
void APP_THREAD_Error(uint32_t ErrId, uint32_t ErrCode)
{
/* USER CODE BEGIN APP_THREAD_Error_1 */
@@ -362,13 +371,13 @@ static void APP_THREAD_StateNotif(uint32_t NotifFlags, void *pContext)
}
/**
- * @brief Warn the user that an error has occurred.In this case,
- * the LEDs on the Board will start blinking.
- *
- * @param pMess : Message associated to the error.
- * @param ErrCode: Error code associated to the module (OpenThread or other module if any)
- * @retval None
- */
+ * @brief Warn the user that an error has occurred.In this case,
+ * the LEDs on the Board will start blinking.
+ *
+ * @param pMess : Message associated to the error.
+ * @param ErrCode: Error code associated to the module (OpenThread or other module if any)
+ * @retval None
+ */
static void APP_THREAD_TraceError(const char * pMess, uint32_t ErrCode)
{
/* USER CODE BEGIN TRACE_ERROR */
@@ -426,7 +435,6 @@ static void APP_THREAD_CheckWirelessFirmwareInfo(void)
APP_DBG("**********************************************************");
}
}
-
/* USER CODE BEGIN FD_LOCAL_FUNCTIONS */
/**
* @brief Dummy request handler
@@ -611,47 +619,47 @@ void TL_THREAD_NotReceived( TL_EvtPacket_t * Notbuffer )
}
/**
- * @brief This function is called before sending any ot command to the M0
- * core. The purpose of this function is to be able to check if
- * there are no notifications coming from the M0 core which are
- * pending before sending a new ot command.
- * @param None
- * @retval None
- */
+ * @brief This function is called before sending any ot command to the M0
+ * core. The purpose of this function is to be able to check if
+ * there are no notifications coming from the M0 core which are
+ * pending before sending a new ot command.
+ * @param None
+ * @retval None
+ */
void Pre_OtCmdProcessing(void)
{
- UTIL_SEQ_WaitEvt( EVENT_SYNCHRO_BYPASS_IDLE);
+ UTIL_SEQ_WaitEvt(EVENT_SYNCHRO_BYPASS_IDLE);
}
/**
- * @brief This function waits for getting an acknowledgment from the M0.
- *
- * @param None
- * @retval None
- */
+ * @brief This function waits for getting an acknowledgment from the M0.
+ *
+ * @param None
+ * @retval None
+ */
static void Wait_Getting_Ack_From_M0(void)
{
UTIL_SEQ_WaitEvt(EVENT_ACK_FROM_M0_EVT);
}
/**
- * @brief Receive an acknowledgment from the M0+ core.
- * Each command send by the M4 to the M0 are acknowledged.
- * This function is called under interrupt.
- * @param None
- * @retval None
- */
+ * @brief Receive an acknowledgment from the M0+ core.
+ * Each command send by the M4 to the M0 are acknowledged.
+ * This function is called under interrupt.
+ * @param None
+ * @retval None
+ */
static void Receive_Ack_From_M0(void)
{
UTIL_SEQ_SetEvt(EVENT_ACK_FROM_M0_EVT);
}
/**
- * @brief Receive a notification from the M0+ through the IPCC.
- * This function is called under interrupt.
- * @param None
- * @retval None
- */
+ * @brief Receive a notification from the M0+ through the IPCC.
+ * This function is called under interrupt.
+ * @param None
+ * @retval None
+ */
static void Receive_Notification_From_M0(void)
{
CptReceiveMsgFromM0++;
@@ -660,6 +668,7 @@ static void Receive_Notification_From_M0(void)
#if (CFG_USB_INTERFACE_ENABLE != 0)
#else
+#if (CFG_FULL_LOW_POWER == 0)
static void RxCpltCallback(void)
{
/* Filling buffer and wait for '\r' char */
@@ -678,6 +687,7 @@ static void RxCpltCallback(void)
/* Once a character has been sent, put back the device in reception mode */
HW_UART_Receive_IT(CFG_CLI_UART, aRxBuffer, 1U, RxCpltCallback);
}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
#if (CFG_USB_INTERFACE_ENABLE != 0)
@@ -720,6 +730,7 @@ static uint32_t ProcessCmdString( uint8_t* buf , uint32_t len )
}
#endif/* (CFG_USB_INTERFACE_ENABLE != 0) */
+#if (CFG_FULL_LOW_POWER == 0)
/**
* @brief Process sends receive CLI command to M0.
* @param None
@@ -739,6 +750,7 @@ static void Send_CLI_To_M0(void)
TL_CLI_SendCmd();
}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
/**
* @brief Send notification for CLI TL Channel.
@@ -759,11 +771,16 @@ static void Send_CLI_Ack_For_OT(void)
*/
void APP_THREAD_Init_UART_CLI(void)
{
+#if (CFG_FULL_LOW_POWER == 0)
UTIL_SEQ_RegTask( 1<<CFG_TASK_SEND_CLI_TO_M0, UTIL_SEQ_RFU,Send_CLI_To_M0);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+
#if (CFG_USB_INTERFACE_ENABLE != 0)
#else
+#if (CFG_FULL_LOW_POWER == 0)
MX_USART1_UART_Init();
HW_UART_Receive_IT(CFG_CLI_UART, aRxBuffer, 1, RxCpltCallback);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Thread_FTD_Coap_Multicast.ioc b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Thread_FTD_Coap_Multicast.ioc
index 4d82b30e7..8bd006920 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Thread_FTD_Coap_Multicast.ioc
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_FTD_Coap_Multicast/Thread_FTD_Coap_Multicast.ioc
@@ -57,26 +57,28 @@ Mcu.IP9=SYS
Mcu.IPNb=12
Mcu.Name=STM32WB55RGVx
Mcu.Package=VFQFPN68
-Mcu.Pin0=PA2
-Mcu.Pin1=PA3
-Mcu.Pin10=VP_SEQUENCER_VS_SEQUENCER
-Mcu.Pin11=VP_STM32_WPAN_VS_THREAD
-Mcu.Pin12=VP_SYS_VS_Systick
-Mcu.Pin13=VP_TINY_LPM_VS_TINY_LPM
-Mcu.Pin2=RF1
-Mcu.Pin3=OSC_OUT
-Mcu.Pin4=OSC_IN
-Mcu.Pin5=PA11
-Mcu.Pin6=PB6
-Mcu.Pin7=PB7
-Mcu.Pin8=VP_HSEM_VS_HSEM
-Mcu.Pin9=VP_RTC_VS_RTC_Activate
-Mcu.PinsNb=14
+Mcu.Pin0=PC14-OSC32_IN
+Mcu.Pin1=PC15-OSC32_OUT
+Mcu.Pin10=VP_HSEM_VS_HSEM
+Mcu.Pin11=VP_RTC_VS_RTC_Activate
+Mcu.Pin12=VP_SEQUENCER_VS_SEQUENCER
+Mcu.Pin13=VP_STM32_WPAN_VS_THREAD
+Mcu.Pin14=VP_SYS_VS_Systick
+Mcu.Pin15=VP_TINY_LPM_VS_TINY_LPM
+Mcu.Pin2=PA2
+Mcu.Pin3=PA3
+Mcu.Pin4=RF1
+Mcu.Pin5=OSC_OUT
+Mcu.Pin6=OSC_IN
+Mcu.Pin7=PA11
+Mcu.Pin8=PB6
+Mcu.Pin9=PB7
+Mcu.PinsNb=16
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32WB55RGVx
-MxCube.Version=5.3.0
-MxDb.Version=DB.5.0.30
+MxCube.Version=5.4.0
+MxDb.Version=DB.5.0.40
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false
NVIC.C2SEV_PWR_C2H_IRQn=true\:0\:0\:false\:false\:true\:true\:false
NVIC.DMA1_Channel1_IRQn=true\:0\:0\:false\:false\:true\:false\:true
@@ -114,6 +116,10 @@ PB6.Signal=USART1_TX
PB7.Locked=true
PB7.Mode=Asynchronous
PB7.Signal=USART1_RX
+PC14-OSC32_IN.Mode=LSE-External-Oscillator
+PC14-OSC32_IN.Signal=RCC_OSC32_IN
+PC15-OSC32_OUT.Mode=LSE-External-Oscillator
+PC15-OSC32_OUT.Signal=RCC_OSC32_OUT
PCC.Ble.ConnectionInterval=1000.0
PCC.Ble.DataLength=6
PCC.Ble.Mode=Advertising
@@ -172,12 +178,12 @@ RCC.HSI48_VALUE=48000000
RCC.HSI_VALUE=16000000
RCC.I2C1Freq_Value=32000000
RCC.I2C3Freq_Value=32000000
-RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSE_VALUE,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1N,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PWRFreq_Value,RNGFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SMPSCLockSelectionVirtual,SMPSFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LCDFreq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1N,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PWRFreq_Value,RFWKPClockSelection,RFWKPFreq_Value,RNGFreq_Value,RTCClockSelection,RTCFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SMPSCLockSelectionVirtual,SMPSFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.LCDFreq_Value=32768
RCC.LPTIM1Freq_Value=32000000
RCC.LPTIM2Freq_Value=32000000
RCC.LPUART1Freq_Value=32000000
RCC.LSCOPinFreq_Value=32000
-RCC.LSE_VALUE=32768
RCC.LSI_VALUE=32000
RCC.MCO1PinFreq_Value=32000000
RCC.PLLPoutputFreq_Value=16000000
@@ -188,7 +194,11 @@ RCC.PLLSAI1PoutputFreq_Value=48000000
RCC.PLLSAI1QoutputFreq_Value=48000000
RCC.PLLSAI1RoutputFreq_Value=48000000
RCC.PWRFreq_Value=32000000
+RCC.RFWKPClockSelection=RCC_RFWKPCLKSOURCE_LSE
+RCC.RFWKPFreq_Value=32768
RCC.RNGFreq_Value=32000
+RCC.RTCClockSelection=RCC_RTCCLKSOURCE_LSE
+RCC.RTCFreq_Value=32768
RCC.SAI1Freq_Value=48000000
RCC.SMPS1Freq_Value=16000000
RCC.SMPSCLockSelectionVirtual=RCC_SMPSCLKSOURCE_HSE
@@ -204,7 +214,7 @@ RF1.Mode=RF1_Activate
RF1.Signal=RF_RF1
RTC.AsynchPrediv=CFG_RTC_ASYNCH_PRESCALER
RTC.IPParameters=AsynchPrediv,SynchPrediv
-RTC.SynchPrediv=CFG_RTC_SYNCH_PRESCALER
+RTC.SynchPrediv=CFG_RTC_SYNCH_PRESCALER
STM32_WPAN.APP_DBG_EN=1
STM32_WPAN.CFG_CLI_UART=hw_uart1
STM32_WPAN.CFG_DBG_TRACE_UART=hw_lpuart1
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/app_common.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/app_common.h
new file mode 100644
index 000000000..47b2867f1
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/app_common.h
@@ -0,0 +1,113 @@
+/**
+ ******************************************************************************
+ * File Name : app_common.h
+ * Description : App Common application configuration file for STM32WPAN Middleware.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_COMMON_H
+#define APP_COMMON_H
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+#include <stdint.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+
+#include "app_conf.h"
+
+ /* -------------------------------- *
+ * Basic definitions *
+ * -------------------------------- */
+
+#undef NULL
+#define NULL 0
+
+#undef FALSE
+#define FALSE 0
+
+#undef TRUE
+#define TRUE (!0)
+
+ /* -------------------------------- *
+ * Critical Section definition *
+ * -------------------------------- */
+#define BACKUP_PRIMASK() uint32_t primask_bit= __get_PRIMASK()
+#define DISABLE_IRQ() __disable_irq()
+#define RESTORE_PRIMASK() __set_PRIMASK(primask_bit)
+
+ /* -------------------------------- *
+ * Macro delimiters *
+ * -------------------------------- */
+
+#define M_BEGIN do {
+
+#define M_END } while(0)
+
+ /* -------------------------------- *
+ * Some useful macro definitions *
+ * -------------------------------- */
+
+#define MAX( x, y ) (((x)>(y))?(x):(y))
+
+#define MIN( x, y ) (((x)<(y))?(x):(y))
+
+#define MODINC( a, m ) M_BEGIN (a)++; if ((a)>=(m)) (a)=0; M_END
+
+#define MODDEC( a, m ) M_BEGIN if ((a)==0) (a)=(m); (a)--; M_END
+
+#define MODADD( a, b, m ) M_BEGIN (a)+=(b); if ((a)>=(m)) (a)-=(m); M_END
+
+#define MODSUB( a, b, m ) MODADD( a, (m)-(b), m )
+
+#define PAUSE( t ) M_BEGIN \
+ __IO int _i; \
+ for ( _i = t; _i > 0; _i -- ); \
+ M_END
+
+#define DIVF( x, y ) ((x)/(y))
+
+#define DIVC( x, y ) (((x)+(y)-1)/(y))
+
+#define DIVR( x, y ) (((x)+((y)/2))/(y))
+
+#define SHRR( x, n ) ((((x)>>((n)-1))+1)>>1)
+
+#define BITN( w, n ) (((w)[(n)/32] >> ((n)%32)) & 1)
+
+#define BITNSET( w, n, b ) M_BEGIN (w)[(n)/32] |= ((U32)(b))<<((n)%32); M_END
+
+ /* -------------------------------- *
+ * Compiler *
+ * -------------------------------- */
+#define PLACE_IN_SECTION( __x__ ) __attribute__((section (__x__)))
+
+#ifdef WIN32
+#define ALIGN(n)
+#else
+#define ALIGN(n) __attribute__((aligned(n)))
+#endif
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /*APP_COMMON_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/app_conf.h
new file mode 100644
index 000000000..c83553cbf
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/app_conf.h
@@ -0,0 +1,375 @@
+/**
+ ******************************************************************************
+ * File Name : app_conf.h
+ * Description : Application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_CONF_H
+#define APP_CONF_H
+
+#include "hw.h"
+#include "hw_conf.h"
+#include "hw_if.h"
+
+/******************************************************************************
+ * Application Config
+ ******************************************************************************/
+/******************************************************************************
+ * Transport Layer
+ ******************************************************************************/
+/**
+ * Queue length of BLE Event
+ * This parameter defines the number of asynchronous events that can be stored in the HCI layer before
+ * being reported to the application. When a command is sent to the BLE core coprocessor, the HCI layer
+ * is waiting for the event with the Num_HCI_Command_Packets set to 1. The receive queue shall be large
+ * enough to store all asynchronous events received in between.
+ * When CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE is set to 27, this allow to store three 255 bytes long asynchronous events
+ * between the HCI command and its event.
+ * This parameter depends on the value given to CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE. When the queue size is to small,
+ * the system may hang if the queue is full with asynchronous events and the HCI layer is still waiting
+ * for a CC/CS event, In that case, the notification TL_BLE_HCI_ToNot() is called to indicate
+ * to the application a HCI command did not receive its command event within 30s (Default HCI Timeout).
+ */
+#define CFG_TL_EVT_QUEUE_LENGTH 5
+/**
+ * This parameter should be set to fit most events received by the HCI layer. It defines the buffer size of each element
+ * allocated in the queue of received events and can be used to optimize the amount of RAM allocated by the Memory Manager.
+ * It should not exceed 255 which is the maximum HCI packet payload size (a greater value is a lost of memory as it will
+ * never be used)
+ * It shall be at least 4 to receive the command status event in one frame.
+ * The default value is set to 27 to allow receiving an event of MTU size in a single buffer. This value maybe reduced
+ * further depending on the application.
+ *
+ */
+#define CFG_TL_MOST_EVENT_PAYLOAD_SIZE 255 /**< Set to 255 with the memory manager and the mailbox */
+
+#define TL_EVENT_FRAME_SIZE ( TL_EVT_HDR_SIZE + CFG_TL_MOST_EVENT_PAYLOAD_SIZE )
+/******************************************************************************
+ * UART interfaces
+ ******************************************************************************/
+
+/**
+ * Select UART interfaces
+ */
+#define CFG_DEBUG_TRACE_UART hw_lpuart1
+#define CFG_CONSOLE_MENU
+#define CFG_CLI_UART hw_uart1
+/******************************************************************************
+ * USB interface
+ ******************************************************************************/
+
+/**
+ * Enable/Disable USB interface
+ */
+#define CFG_USB_INTERFACE_ENABLE 0
+
+/******************************************************************************
+ * Low Power
+ *
+ * When CFG_FULL_LOW_POWER is set to 1, the system is configured in full
+ * low power mode. It means that all what can have an impact on the consumptions
+ * are powered down.(For instance LED, Access to Debugger, Etc.)
+ *
+ * When CFG_FULL_LOW_POWER is set to 0, the low power mode is not activated
+ *
+ ******************************************************************************/
+
+#define CFG_FULL_LOW_POWER 0
+
+#if (CFG_FULL_LOW_POWER == 1)
+#undef CFG_LPM_SUPPORTED
+#define CFG_LPM_SUPPORTED 1
+#endif /* CFG_FULL_LOW_POWER */
+
+/******************************************************************************
+ * Timer Server
+ ******************************************************************************/
+/**
+ * CFG_RTC_WUCKSEL_DIVIDER: This sets the RTCCLK divider to the wakeup timer.
+ * The higher is the value, the better is the power consumption and the accuracy of the timerserver
+ * The lower is the value, the finest is the granularity
+ *
+ * CFG_RTC_ASYNCH_PRESCALER: This sets the asynchronous prescaler of the RTC. It should as high as possible ( to ouput
+ * clock as low as possible) but the output clock should be equal or higher frequency compare to the clock feeding
+ * the wakeup timer. A lower clock speed would impact the accuracy of the timer server.
+ *
+ * CFG_RTC_SYNCH_PRESCALER: This sets the synchronous prescaler of the RTC.
+ * When the 1Hz calendar clock is required, it shall be sets according to other settings
+ * When the 1Hz calendar clock is not needed, CFG_RTC_SYNCH_PRESCALER should be set to 0x7FFF (MAX VALUE)
+ *
+ * CFG_RTCCLK_DIVIDER_CONF:
+ * Shall be set to either 0,2,4,8,16
+ * When set to either 2,4,8,16, the 1Hhz calendar is supported
+ * When set to 0, the user sets its own configuration
+ *
+ * The following settings are computed with LSI as input to the RTC
+ */
+#define CFG_RTCCLK_DIVIDER_CONF 0
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 0)
+/**
+ * Custom configuration
+ * It does not support 1Hz calendar
+ * It divides the RTC CLK by 16
+ */
+#define CFG_RTCCLK_DIV (16)
+#define CFG_RTC_WUCKSEL_DIVIDER (0)
+#define CFG_RTC_ASYNCH_PRESCALER (CFG_RTCCLK_DIV - 1)
+#define CFG_RTC_SYNCH_PRESCALER (0x7FFF)
+
+#else
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 2)
+/**
+ * It divides the RTC CLK by 2
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (3)
+#endif
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 4)
+/**
+ * It divides the RTC CLK by 4
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (2)
+#endif
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 8)
+/**
+ * It divides the RTC CLK by 8
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (1)
+#endif
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 16)
+/**
+ * It divides the RTC CLK by 16
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (0)
+#endif
+
+#define CFG_RTCCLK_DIV CFG_RTCCLK_DIVIDER_CONF
+#define CFG_RTC_ASYNCH_PRESCALER (CFG_RTCCLK_DIV - 1)
+#define CFG_RTC_SYNCH_PRESCALER (DIVR( LSE_VALUE, (CFG_RTC_ASYNCH_PRESCALER+1) ) - 1 )
+
+#endif
+
+/** tick timer value in us */
+#define CFG_TS_TICK_VAL DIVR( (CFG_RTCCLK_DIV * 1000000), LSE_VALUE )
+
+typedef enum
+{
+ CFG_TIM_PROC_ID_ISR,
+} CFG_TimProcID_t;
+
+/******************************************************************************
+ * Debug
+ ******************************************************************************/
+/**
+ * When set, this resets some hw resources to set the device in the same state than the power up
+ * The FW resets only register that may prevent the FW to run properly
+ *
+ * This shall be set to 0 in a final product
+ *
+ */
+#define CFG_HW_RESET_BY_FW 1
+
+/**
+ * keep debugger enabled while in any low power mode when set to 1
+ * should be set to 0 in production
+ */
+#define CFG_DEBUGGER_SUPPORTED 1
+
+#if (CFG_FULL_LOW_POWER == 1)
+#undef CFG_DEBUGGER_SUPPORTED
+#define CFG_DEBUGGER_SUPPORTED 0
+#endif /* CFG_FULL_LOW_POWER */
+
+/*****************************************************************************
+ * Traces
+ * Enable or Disable traces in application
+ * When CFG_DEBUG_TRACE is set, traces are activated
+ *
+ * Note : Refer to utilities_conf.h file in order to details
+ * the level of traces : CFG_DEBUG_TRACE_FULL or CFG_DEBUG_TRACE_LIGHT
+ *****************************************************************************/
+#define CFG_DEBUG_TRACE 1
+
+#if (CFG_FULL_LOW_POWER == 1)
+#undef CFG_DEBUG_TRACE
+#define CFG_DEBUG_TRACE 0
+#endif /* CFG_FULL_LOW_POWER */
+
+/**
+ * When CFG_DEBUG_TRACE_FULL is set to 1, the trace are output with the API name, the file name and the line number
+ * When CFG_DEBUG_TRACE_LIGHT is set to 1, only the debug message is output
+ *
+ * When both are set to 0, no trace are output
+ * When both are set to 1, CFG_DEBUG_TRACE_FULL is selected
+ */
+#define CFG_DEBUG_TRACE_LIGHT 1
+#define CFG_DEBUG_TRACE_FULL 0
+
+#if (( CFG_DEBUG_TRACE != 0 ) && ( CFG_DEBUG_TRACE_LIGHT == 0 ) && (CFG_DEBUG_TRACE_FULL == 0))
+#undef CFG_DEBUG_TRACE_FULL
+#undef CFG_DEBUG_TRACE_LIGHT
+#define CFG_DEBUG_TRACE_FULL 0
+#define CFG_DEBUG_TRACE_LIGHT 1
+#endif
+
+#if ( CFG_DEBUG_TRACE == 0 )
+#undef CFG_DEBUG_TRACE_FULL
+#undef CFG_DEBUG_TRACE_LIGHT
+#define CFG_DEBUG_TRACE_FULL 0
+#define CFG_DEBUG_TRACE_LIGHT 0
+#endif
+
+/**
+ * When not set, the traces is looping on sending the trace over UART
+ */
+#define DBG_TRACE_USE_CIRCULAR_QUEUE 1
+
+/**
+ * max buffer Size to queue data traces and max data trace allowed.
+ * Only Used if DBG_TRACE_USE_CIRCULAR_QUEUE is defined
+ */
+#define DBG_TRACE_MSG_QUEUE_SIZE 4096
+#define MAX_DBG_TRACE_MSG_SIZE 1024
+
+/******************************************************************************
+ * Configure Log level for Application
+ ******************************************************************************/
+#define APPLI_CONFIG_LOG_LEVEL LOG_LEVEL_INFO
+#define APPLI_PRINT_FILE_FUNC_LINE 0
+
+/* USER CODE BEGIN Defines */
+/******************************************************************************
+ * User interaction
+ * When CFG_LED_SUPPORTED is set, LEDS are activated if requested
+ * When CFG_BUTTON_SUPPORTED is set, the push button are activated if requested
+ ******************************************************************************/
+#if (CFG_FULL_LOW_POWER == 1)
+#define CFG_LED_SUPPORTED 0
+#define CFG_BUTTON_SUPPORTED 0
+#else
+#define CFG_LED_SUPPORTED 1
+#define CFG_BUTTON_SUPPORTED 1
+#endif /* CFG_FULL_LOW_POWER */
+/* USER CODE END Defines */
+
+/******************************************************************************
+ * Scheduler
+ ******************************************************************************/
+ /**
+ * This is the list of task id required by the application
+ * Each Id shall be in the range 0..31
+ */
+
+typedef enum
+{
+ CFG_TASK_MSG_FROM_M0_TO_M4,
+ CFG_TASK_SEND_CLI_TO_M0,
+ CFG_TASK_SYSTEM_HCI_ASYNCH_EVT,
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+ CFG_TASK_VCP_SEND_DATA,
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+ /* USER CODE BEGIN CFG_IdleTask_Id_t */
+ CFG_TASK_FUOTA_RESET,
+ /* USER CODE END CFG_IdleTask_Id_t */
+ CFG_TASK_NBR /**< Shall be last in the list */
+} CFG_IdleTask_Id_t;
+
+/* Scheduler types and defines */
+/*------------------------------------*/
+#define TASK_MSG_FROM_M0_TO_M4 (1U << CFG_TASK_MSG_FROM_M0_TO_M4)
+/* USER CODE BEGIN DEFINE_TASK */
+#define TASK_FUOTA_RESET (1U << CFG_TASK_FUOTA_RESET)
+/* USER CODE END DEFINE_TASK */
+
+
+/**
+ * This is the list of priority required by the application
+ * Each Id shall be in the range 0..31
+ */
+typedef enum
+{
+ CFG_SCH_PRIO_0,
+ CFG_SCH_PRIO_1,
+ CFG_PRIO_NBR,
+} CFG_SCH_Prio_Id_t;
+
+ /**
+ * This is a bit mapping over 32bits listing all events id supported in the application
+ */
+typedef enum
+{
+ CFG_EVT_SYSTEM_HCI_CMD_EVT_RESP,
+ CFG_EVT_ACK_FROM_M0_EVT,
+ CFG_EVT_SYNCHRO_BYPASS_IDLE,
+ /* USER CODE BEGIN CFG_IdleEvt_Id_t */
+ CFG_EVT_TIMER,
+ /* USER CODE END CFG_IdleEvt_Id_t */
+} CFG_IdleEvt_Id_t;
+
+#define EVENT_ACK_FROM_M0_EVT (1U << CFG_EVT_ACK_FROM_M0_EVT)
+#define EVENT_SYNCHRO_BYPASS_IDLE (1U << CFG_EVT_SYNCHRO_BYPASS_IDLE)
+/* USER CODE BEGIN DEFINE_EVENT */
+#define EVENT_TIMER (1U << CFG_EVT_TIMER)
+/* USER CODE END DEFINE_EVENT */
+
+/******************************************************************************
+ * LOW POWER
+ ******************************************************************************/
+/**
+ * Supported requester to the MCU Low Power Manager - can be increased up to 32
+ * It lits a bit mapping of all user of the Low Power Manager
+ */
+typedef enum
+{
+ CFG_LPM_APP,
+ CFG_LPM_APP_THREAD,
+ /* USER CODE BEGIN CFG_LPM_Id_t */
+
+ /* USER CODE END CFG_LPM_Id_t */
+} CFG_LPM_Id_t;
+
+/******************************************************************************
+ * OTP manager
+ ******************************************************************************/
+#define CFG_OTP_BASE_ADDRESS OTP_AREA_BASE
+
+#define CFG_OTP_END_ADRESS OTP_AREA_END_ADDR
+
+
+/******************************************************************************
+ * FUOTA
+ ******************************************************************************/
+
+/**
+ * Define the start address where the application shall be located
+ */
+#define CFG_APP_START_SECTOR_INDEX (0x10)
+
+/**
+ * Define list of reboot reason
+ */
+#define CFG_REBOOT_ON_FW_APP (0x00)
+#define CFG_REBOOT_ON_THREAD_OTA_APP (0x01)
+#define CFG_REBOOT_ON_CPU2_UPGRADE (0x02)
+
+#endif /*APP_CONF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/app_entry.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/app_entry.h
new file mode 100644
index 000000000..48c467aaa
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/app_entry.h
@@ -0,0 +1,68 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : app_entry.h
+ * Description : App entry configuration file for STM32WPAN Middleware.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_ENTRY_H
+#define APP_ENTRY_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /* Exported types ------------------------------------------------------------*/
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* Exported variables --------------------------------------------------------*/
+/* USER CODE BEGIN EV */
+
+/* USER CODE END EV */
+
+/* Exported macros ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions ---------------------------------------------*/
+ void APPE_Init( void );
+/* USER CODE BEGIN EF */
+
+/* USER CODE END EF */
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /*APP_ENTRY_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/hw_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/hw_conf.h
new file mode 100644
index 000000000..8409edd16
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/hw_conf.h
@@ -0,0 +1,219 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : hw_conf.h
+ * Description : Hardware configuration file for STM32WPAN Middleware.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_CONF_H
+#define HW_CONF_H
+
+/******************************************************************************
+ * Semaphores
+ * THIS SHALL NO BE CHANGED AS THESE SEMAPHORES ARE USED AS WELL ON THE CM0+
+ *****************************************************************************/
+/* Index of the semaphore used to manage the entry Stop Mode procedure */
+#define CFG_HW_ENTRY_STOP_MODE_SEMID 4
+
+/* Index of the semaphore used to access the RCC */
+#define CFG_HW_RCC_SEMID 3
+
+/* Index of the semaphore used to access the FLASH */
+#define CFG_HW_FLASH_SEMID 2
+
+/* Index of the semaphore used to access the PKA */
+#define CFG_HW_PKA_SEMID 1
+
+/* Index of the semaphore used to access the RNG */
+#define CFG_HW_RNG_SEMID 0
+
+/******************************************************************************
+ * HW TIMER SERVER
+ *****************************************************************************/
+/**
+ * The user may define the maximum number of virtual timers supported.
+ * It shall not exceed 255
+ */
+#define CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER 6
+
+/**
+ * The user may define the priority in the NVIC of the RTC_WKUP interrupt handler that is used to manage the
+ * wakeup timer.
+ * This setting is the preemptpriority part of the NVIC.
+ */
+#define CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO 3
+
+/**
+ * The user may define the priority in the NVIC of the RTC_WKUP interrupt handler that is used to manage the
+ * wakeup timer.
+ * This setting is the subpriority part of the NVIC. It does not exist on all processors. When it is not supported
+ * on the CPU, the setting is ignored
+ */
+#define CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO 0
+
+/**
+ * Define a critical section in the Timer server
+ * The Timer server does not support the API to be nested
+ * The Application shall either:
+ * a) Ensure this will never happen
+ * b) Define the critical section
+ * The default implementations is masking all interrupts using the PRIMASK bit
+ * The TimerServer driver uses critical sections to avoid context corruption. This is achieved with the macro
+ * TIMER_ENTER_CRITICAL_SECTION and TIMER_EXIT_CRITICAL_SECTION. When CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION is set
+ * to 1, all STM32 interrupts are masked with the PRIMASK bit of the CortexM CPU. It is possible to use the BASEPRI
+ * register of the CortexM CPU to keep allowed some interrupts with high priority. In that case, the user shall
+ * re-implement TIMER_ENTER_CRITICAL_SECTION and TIMER_EXIT_CRITICAL_SECTION and shall make sure that no TimerServer
+ * API are called when the TIMER critical section is entered
+ */
+#define CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION 1
+
+/**
+ * This value shall reflect the maximum delay there could be in the application between the time the RTC interrupt
+ * is generated by the Hardware and the time when the RTC interrupt handler is called. This time is measured in
+ * number of RTCCLK ticks.
+ * A relaxed timing would be 10ms
+ * When the value is too short, the timerserver will not be able to count properly and all timeout may be random.
+ * When the value is too long, the device may wake up more often than the most optimal configuration. However, the
+ * impact on power consumption would be marginal (unless the value selected is extremely too long). It is strongly
+ * recommended to select a value large enough to make sure it is not too short to ensure reliability of the system
+ * as this will have marginal impact on low power mode
+ */
+#define CFG_HW_TS_RTC_HANDLER_MAX_DELAY ( 10 * (LSI_VALUE/1000) )
+
+ /**
+ * Interrupt ID in the NVIC of the RTC Wakeup interrupt handler
+ * It shall be type of IRQn_Type
+ */
+#define CFG_HW_TS_RTC_WAKEUP_HANDLER_ID RTC_WKUP_IRQn
+
+/******************************************************************************
+ * HW UART
+ *****************************************************************************/
+
+#define CFG_HW_LPUART1_ENABLED 1
+#define CFG_HW_LPUART1_DMA_TX_SUPPORTED 1
+
+#define CFG_HW_USART1_ENABLED 1
+#define CFG_HW_USART1_DMA_TX_SUPPORTED 1
+
+/**
+ * LPUART1
+ */
+#define CFG_HW_LPUART1_PREEMPTPRIORITY 0x0F
+#define CFG_HW_LPUART1_SUBPRIORITY 0
+
+/** < The application shall check the selected source clock is enable */
+#define CFG_HW_LPUART1_SOURCE_CLOCK RCC_LPUART1CLKSOURCE_SYSCLK
+
+#define CFG_HW_LPUART1_BAUDRATE 115200
+#define CFG_HW_LPUART1_WORDLENGTH UART_WORDLENGTH_8B
+#define CFG_HW_LPUART1_STOPBITS UART_STOPBITS_1
+#define CFG_HW_LPUART1_PARITY UART_PARITY_NONE
+#define CFG_HW_LPUART1_HWFLOWCTL UART_HWCONTROL_NONE
+#define CFG_HW_LPUART1_MODE UART_MODE_TX_RX
+#define CFG_HW_LPUART1_ADVFEATUREINIT UART_ADVFEATURE_NO_INIT
+#define CFG_HW_LPUART1_OVERSAMPLING UART_OVERSAMPLING_8
+
+#define CFG_HW_LPUART1_TX_PORT_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE
+#define CFG_HW_LPUART1_TX_PORT GPIOA
+#define CFG_HW_LPUART1_TX_PIN GPIO_PIN_2
+#define CFG_HW_LPUART1_TX_MODE GPIO_MODE_AF_PP
+#define CFG_HW_LPUART1_TX_PULL GPIO_NOPULL
+#define CFG_HW_LPUART1_TX_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_LPUART1_TX_ALTERNATE GPIO_AF8_LPUART1
+
+#define CFG_HW_LPUART1_RX_PORT_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE
+#define CFG_HW_LPUART1_RX_PORT GPIOA
+#define CFG_HW_LPUART1_RX_PIN GPIO_PIN_3
+#define CFG_HW_LPUART1_RX_MODE GPIO_MODE_AF_PP
+#define CFG_HW_LPUART1_RX_PULL GPIO_NOPULL
+#define CFG_HW_LPUART1_RX_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_LPUART1_RX_ALTERNATE GPIO_AF8_LPUART1
+
+#define CFG_HW_LPUART1_CTS_PORT_CLK_ENABLE __HAL_RCC_GPIOvalueNotSetted_CLK_ENABLE
+#define CFG_HW_LPUART1_CTS_PORT GPIOvalueNotSetted
+#define CFG_HW_LPUART1_CTS_PIN GPIO_PIN_valueNotSetted
+#define CFG_HW_LPUART1_CTS_MODE GPIO_MODE_AF_PP
+#define CFG_HW_LPUART1_CTS_PULL GPIO_PULLDOWN
+#define CFG_HW_LPUART1_CTS_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_LPUART1_CTS_ALTERNATE GPIO_AFvalueNotSetted_LPUART1
+
+#define CFG_HW_LPUART1_DMA_TX_PREEMPTPRIORITY 0x0F
+#define CFG_HW_LPUART1_DMA_TX_SUBPRIORITY 0
+
+#define CFG_HW_LPUART1_DMAMUX_CLK_ENABLE __HAL_RCC_DMAMUX1_CLK_ENABLE
+#define CFG_HW_LPUART1_DMA_CLK_ENABLE __HAL_RCC_DMA1_CLK_ENABLE
+#define CFG_HW_LPUART1_TX_DMA_REQ DMA_REQUEST_LPUART1_TX
+#define CFG_HW_LPUART1_TX_DMA_CHANNEL DMA1_CHANNEL_1
+#define CFG_HW_LPUART1_TX_DMA_IRQn DMA1_CHANNEL_1_IRQn
+#define CFG_HW_LPUART1_DMA_TX_IRQHandler DMA1_CHANNEL_1_IRQHandler
+
+/**
+ * UART1
+ */
+#define CFG_HW_USART1_PREEMPTPRIORITY 0x0F
+#define CFG_HW_USART1_SUBPRIORITY 0
+
+/** < The application shall check the selected source clock is enable */
+#define CFG_HW_USART1_SOURCE_CLOCK RCC_USART1CLKSOURCE_SYSCLK
+
+#define CFG_HW_USART1_BAUDRATE 115200
+#define CFG_HW_USART1_WORDLENGTH UART_WORDLENGTH_8B
+#define CFG_HW_USART1_STOPBITS UART_STOPBITS_1
+#define CFG_HW_USART1_PARITY UART_PARITY_NONE
+#define CFG_HW_USART1_HWFLOWCTL UART_HWCONTROL_NONE
+#define CFG_HW_USART1_MODE UART_MODE_TX_RX
+#define CFG_HW_USART1_ADVFEATUREINIT UART_ADVFEATURE_NO_INIT
+#define CFG_HW_USART1_OVERSAMPLING UART_OVERSAMPLING_8
+
+#define CFG_HW_USART1_TX_PORT_CLK_ENABLE __HAL_RCC_GPIOB_CLK_ENABLE
+#define CFG_HW_USART1_TX_PORT GPIOB
+#define CFG_HW_USART1_TX_PIN GPIO_PIN_6
+#define CFG_HW_USART1_TX_MODE GPIO_MODE_AF_PP
+#define CFG_HW_USART1_TX_PULL GPIO_NOPULL
+#define CFG_HW_USART1_TX_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_USART1_TX_ALTERNATE GPIO_AF7_USART1
+
+#define CFG_HW_USART1_RX_PORT_CLK_ENABLE __HAL_RCC_GPIOB_CLK_ENABLE
+#define CFG_HW_USART1_RX_PORT GPIOB
+#define CFG_HW_USART1_RX_PIN GPIO_PIN_7
+#define CFG_HW_USART1_RX_MODE GPIO_MODE_AF_PP
+#define CFG_HW_USART1_RX_PULL GPIO_NOPULL
+#define CFG_HW_USART1_RX_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_USART1_RX_ALTERNATE GPIO_AF7_USART1
+
+#define CFG_HW_USART1_CTS_PORT_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE
+#define CFG_HW_USART1_CTS_PORT GPIOA
+#define CFG_HW_USART1_CTS_PIN GPIO_PIN_11
+#define CFG_HW_USART1_CTS_MODE GPIO_MODE_AF_PP
+#define CFG_HW_USART1_CTS_PULL GPIO_PULLDOWN
+#define CFG_HW_USART1_CTS_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_USART1_CTS_ALTERNATE GPIO_AF7_USART1
+
+#define CFG_HW_USART1_DMA_TX_PREEMPTPRIORITY 0x0F
+#define CFG_HW_USART1_DMA_TX_SUBPRIORITY 0
+
+#define CFG_HW_USART1_DMAMUX_CLK_ENABLE __HAL_RCC_DMAMUX1_CLK_ENABLE
+#define CFG_HW_USART1_DMA_CLK_ENABLE __HAL_RCC_DMA1_CLK_ENABLE
+#define CFG_HW_USART1_TX_DMA_REQ DMA_REQUEST_USART1_TX
+#define CFG_HW_USART1_TX_DMA_CHANNEL DMA1_CHANNEL_2
+#define CFG_HW_USART1_TX_DMA_IRQn DMA1_CHANNEL_2_IRQn
+#define CFG_HW_USART1_DMA_TX_IRQHandler DMA1_CHANNEL_2_IRQHandler
+
+#endif /*HW_CONF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/main.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/main.h
new file mode 100644
index 000000000..68182bc5a
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/main.h
@@ -0,0 +1,71 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file : main.h
+ * @brief : Header for main.c file.
+ * This file contains the common defines of the application.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __MAIN_H
+#define __MAIN_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx_hal.h"
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Exported types ------------------------------------------------------------*/
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* Exported macro ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions prototypes ---------------------------------------------*/
+void Error_Handler(void);
+
+/* USER CODE BEGIN EFP */
+
+/* USER CODE END EFP */
+
+/* Private defines -----------------------------------------------------------*/
+/* USER CODE BEGIN Private defines */
+
+/* USER CODE END Private defines */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MAIN_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/stm32_lpm_if.h
new file mode 100644
index 000000000..70abecaa9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/stm32_lpm_if.h
@@ -0,0 +1,81 @@
+/* USER CODE BEGIN Header */
+/**
+******************************************************************************
+* @file stm32_lpm_if.h
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
+******************************************************************************
+* @attention
+*
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+* All rights reserved.</center></h2>
+*
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+*
+******************************************************************************
+*/
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32_LPM_IF_H
+#define __STM32_LPM_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+
+/**
+ * @brief Enters Low Power Off Mode
+ * @param none
+ * @retval none
+ */
+void PWR_EnterOffMode( void );
+/**
+ * @brief Exits Low Power Off Mode
+ * @param none
+ * @retval none
+ */
+void PWR_ExitOffMode( void );
+
+/**
+ * @brief Enters Low Power Stop Mode
+ * @note ARM exists the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_EnterStopMode( void );
+/**
+ * @brief Exits Low Power Stop Mode
+ * @note Enable the pll at 32MHz
+ * @param none
+ * @retval none
+ */
+void PWR_ExitStopMode( void );
+
+/**
+ * @brief Enters Low Power Sleep Mode
+ * @note ARM exits the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_EnterSleepMode( void );
+
+/**
+ * @brief Exits Low Power Sleep Mode
+ * @note ARM exits the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_ExitSleepMode( void );
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*__STM32_LPM_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/stm32wbxx_hal_conf.h
new file mode 100644
index 000000000..ea9aa40d0
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/stm32wbxx_hal_conf.h
@@ -0,0 +1,353 @@
+/**
+ ******************************************************************************
+ * @file stm32wbxx_hal_conf.h
+ * @author MCD Application Team
+ * @brief HAL configuration file.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32WBxx_HAL_CONF_H
+#define __STM32WBxx_HAL_CONF_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/* Exported types ------------------------------------------------------------*/
+/* Exported constants --------------------------------------------------------*/
+
+/* ########################## Module Selection ############################## */
+/**
+ * @brief This is the list of modules to be used in the HAL driver
+ */
+#define HAL_MODULE_ENABLED
+/*#define HAL_ADC_MODULE_ENABLED */
+/*#define HAL_CRYP_MODULE_ENABLED */
+/*#define HAL_COMP_MODULE_ENABLED */
+/*#define HAL_CRC_MODULE_ENABLED */
+#define HAL_HSEM_MODULE_ENABLED
+/*#define HAL_I2C_MODULE_ENABLED */
+/*#define HAL_IPCC_MODULE_ENABLED */
+/*#define HAL_IRDA_MODULE_ENABLED */
+/*#define HAL_IWDG_MODULE_ENABLED */
+/*#define HAL_LCD_MODULE_ENABLED */
+/*#define HAL_LPTIM_MODULE_ENABLED */
+/*#define HAL_PCD_MODULE_ENABLED */
+/*#define HAL_PKA_MODULE_ENABLED */
+/*#define HAL_QSPI_MODULE_ENABLED */
+/*#define HAL_RNG_MODULE_ENABLED */
+#define HAL_RTC_MODULE_ENABLED
+/*#define HAL_SAI_MODULE_ENABLED */
+/*#define HAL_SMBUS_MODULE_ENABLED */
+/*#define HAL_SMARTCARD_MODULE_ENABLED */
+/*#define HAL_SPI_MODULE_ENABLED */
+/*#define HAL_TIM_MODULE_ENABLED */
+/*#define HAL_TSC_MODULE_ENABLED */
+#define HAL_UART_MODULE_ENABLED
+/*#define HAL_USART_MODULE_ENABLED */
+/*#define HAL_WWDG_MODULE_ENABLED */
+#define HAL_EXTI_MODULE_ENABLED
+#define HAL_CORTEX_MODULE_ENABLED
+#define HAL_DMA_MODULE_ENABLED
+#define HAL_FLASH_MODULE_ENABLED
+#define HAL_GPIO_MODULE_ENABLED
+#define HAL_PWR_MODULE_ENABLED
+#define HAL_RCC_MODULE_ENABLED
+
+#define USE_HAL_ADC_REGISTER_CALLBACKS 0u
+#define USE_HAL_COMP_REGISTER_CALLBACKS 0u
+#define USE_HAL_CRYP_REGISTER_CALLBACKS 0u
+#define USE_HAL_I2C_REGISTER_CALLBACKS 0u
+#define USE_HAL_IRDA_REGISTER_CALLBACKS 0u
+#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0u
+#define USE_HAL_PCD_REGISTER_CALLBACKS 0u
+#define USE_HAL_PKA_REGISTER_CALLBACKS 0u
+#define USE_HAL_QSPI_REGISTER_CALLBACKS 0u
+#define USE_HAL_RNG_REGISTER_CALLBACKS 0u
+#define USE_HAL_RTC_REGISTER_CALLBACKS 0u
+#define USE_HAL_SAI_REGISTER_CALLBACKS 0u
+#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0u
+#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0u
+#define USE_HAL_SPI_REGISTER_CALLBACKS 0u
+#define USE_HAL_TIM_REGISTER_CALLBACKS 0u
+#define USE_HAL_TSC_REGISTER_CALLBACKS 0u
+#define USE_HAL_UART_REGISTER_CALLBACKS 0u
+#define USE_HAL_USART_REGISTER_CALLBACKS 0u
+#define USE_HAL_WWDG_REGISTER_CALLBACKS 0u
+
+/* ########################## Oscillator Values adaptation ####################*/
+/**
+ * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
+ * This value is used by the RCC HAL module to compute the system frequency
+ * (when HSE is used as system clock source, directly or through the PLL).
+ */
+#if !defined (HSE_VALUE)
+#define HSE_VALUE 32000000U /*!< Value of the External oscillator in Hz */
+#endif /* HSE_VALUE */
+
+#if !defined (HSE_STARTUP_TIMEOUT)
+ #define HSE_STARTUP_TIMEOUT ((uint32_t)100) /*!< Time out for HSE start up, in ms */
+#endif /* HSE_STARTUP_TIMEOUT */
+
+/**
+ * @brief Internal Multiple Speed oscillator (MSI) default value.
+ * This value is the default MSI range value after Reset.
+ */
+#if !defined (MSI_VALUE)
+ #define MSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/
+#endif /* MSI_VALUE */
+
+/**
+ * @brief Internal High Speed oscillator (HSI) value.
+ * This value is used by the RCC HAL module to compute the system frequency
+ * (when HSI is used as system clock source, directly or through the PLL).
+ */
+#if !defined (HSI_VALUE)
+#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/
+#endif /* HSI_VALUE */
+
+/**
+ * @brief Internal Low Speed oscillator (LSI1) value.
+ */
+#if !defined (LSI1_VALUE)
+ #define LSI1_VALUE ((uint32_t)32000) /*!< LSI1 Typical Value in Hz*/
+#endif /* LSI1_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
+ The real value may vary depending on the variations
+ in voltage and temperature.*/
+/**
+ * @brief Internal Low Speed oscillator (LSI2) value.
+ */
+#if !defined (LSI2_VALUE)
+ #define LSI2_VALUE ((uint32_t)32000) /*!< LSI2 Typical Value in Hz*/
+#endif /* LSI2_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
+ The real value may vary depending on the variations
+ in voltage and temperature.*/
+
+/**
+ * @brief External Low Speed oscillator (LSE) value.
+ * This value is used by the UART, RTC HAL module to compute the system frequency
+ */
+#if !defined (LSE_VALUE)
+#define LSE_VALUE 32768U /*!< Value of the External oscillator in Hz*/
+#endif /* LSE_VALUE */
+
+/**
+ * @brief Internal Multiple Speed oscillator (HSI48) default value.
+ * This value is the default HSI48 range value after Reset.
+ */
+#if !defined (HSI48_VALUE)
+ #define HSI48_VALUE ((uint32_t)48000000) /*!< Value of the Internal oscillator in Hz*/
+#endif /* HSI48_VALUE */
+
+#if !defined (LSE_STARTUP_TIMEOUT)
+#define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */
+#endif /* HSE_STARTUP_TIMEOUT */
+
+/**
+ * @brief External clock source for SAI1 peripheral
+ * This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source
+ * frequency.
+ */
+#if !defined (EXTERNAL_SAI1_CLOCK_VALUE)
+ #define EXTERNAL_SAI1_CLOCK_VALUE ((uint32_t)2097000) /*!< Value of the SAI1 External clock source in Hz*/
+#endif /* EXTERNAL_SAI1_CLOCK_VALUE */
+
+/* Tip: To avoid modifying this file each time you need to use different HSE,
+ === you can define the HSE value in your toolchain compiler preprocessor. */
+
+/* ########################### System Configuration ######################### */
+/**
+ * @brief This is the HAL system configuration section
+ */
+
+#define VDD_VALUE 3300U /*!< Value of VDD in mv */
+#define TICK_INT_PRIORITY 0U /*!< tick interrupt priority */
+#define USE_RTOS 0U
+#define PREFETCH_ENABLE 1U
+#define INSTRUCTION_CACHE_ENABLE 1U
+#define DATA_CACHE_ENABLE 1U
+
+/* ########################## Assert Selection ############################## */
+/**
+ * @brief Uncomment the line below to expanse the "assert_param" macro in the
+ * HAL drivers code
+ */
+/* #define USE_FULL_ASSERT 1U */
+
+/* ################## SPI peripheral configuration ########################## */
+
+/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
+ * Activated: CRC code is present inside driver
+ * Deactivated: CRC code cleaned from driver
+ */
+
+#define USE_SPI_CRC 0U
+
+/* Includes ------------------------------------------------------------------*/
+/**
+ * @brief Include module's header file
+ */
+#ifdef HAL_DMA_MODULE_ENABLED
+ #include "stm32wbxx_hal_dma.h"
+#endif /* HAL_DMA_MODULE_ENABLED */
+
+#ifdef HAL_ADC_MODULE_ENABLED
+ #include "stm32wbxx_hal_adc.h"
+#endif /* HAL_ADC_MODULE_ENABLED */
+
+#ifdef HAL_COMP_MODULE_ENABLED
+ #include "stm32wbxx_hal_comp.h"
+#endif /* HAL_COMP_MODULE_ENABLED */
+
+#ifdef HAL_CORTEX_MODULE_ENABLED
+ #include "stm32wbxx_hal_cortex.h"
+#endif /* HAL_CORTEX_MODULE_ENABLED */
+
+#ifdef HAL_CRC_MODULE_ENABLED
+ #include "stm32wbxx_hal_crc.h"
+#endif /* HAL_CRC_MODULE_ENABLED */
+
+#ifdef HAL_CRYP_MODULE_ENABLED
+ #include "stm32wbxx_hal_cryp.h"
+#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
+
+#ifdef HAL_FLASH_MODULE_ENABLED
+ #include "stm32wbxx_hal_flash.h"
+#endif /* HAL_FLASH_MODULE_ENABLED */
+
+#ifdef HAL_GPIO_MODULE_ENABLED
+ #include "stm32wbxx_hal_gpio.h"
+#endif /* HAL_GPIO_MODULE_ENABLED */
+
+#ifdef HAL_HSEM_MODULE_ENABLED
+ #include "stm32wbxx_hal_hsem.h"
+#endif /* HAL_HSEM_MODULE_ENABLED */
+
+#ifdef HAL_I2C_MODULE_ENABLED
+ #include "stm32wbxx_hal_i2c.h"
+#endif /* HAL_I2C_MODULE_ENABLED */
+
+#ifdef HAL_IPCC_MODULE_ENABLED
+ #include "stm32wbxx_hal_ipcc.h"
+#endif /* HAL_IPCC_MODULE_ENABLED */
+
+#ifdef HAL_IRDA_MODULE_ENABLED
+ #include "stm32wbxx_hal_irda.h"
+#endif /* HAL_IRDA_MODULE_ENABLED */
+
+#ifdef HAL_IWDG_MODULE_ENABLED
+ #include "stm32wbxx_hal_iwdg.h"
+#endif /* HAL_IWDG_MODULE_ENABLED */
+
+#ifdef HAL_LCD_MODULE_ENABLED
+ #include "stm32wbxx_hal_lcd.h"
+#endif /* HAL_LCD_MODULE_ENABLED */
+
+#ifdef HAL_LPTIM_MODULE_ENABLED
+ #include "stm32wbxx_hal_lptim.h"
+#endif /* HAL_LPTIM_MODULE_ENABLED */
+
+#ifdef HAL_PCD_MODULE_ENABLED
+ #include "stm32wbxx_hal_pcd.h"
+#endif /* HAL_PCD_MODULE_ENABLED */
+
+#ifdef HAL_PKA_MODULE_ENABLED
+ #include "stm32wbxx_hal_pka.h"
+#endif /* HAL_PKA_MODULE_ENABLED */
+
+#ifdef HAL_PWR_MODULE_ENABLED
+ #include "stm32wbxx_hal_pwr.h"
+#endif /* HAL_PWR_MODULE_ENABLED */
+
+#ifdef HAL_QSPI_MODULE_ENABLED
+ #include "stm32wbxx_hal_qspi.h"
+#endif /* HAL_QSPI_MODULE_ENABLED */
+
+#ifdef HAL_RCC_MODULE_ENABLED
+ #include "stm32wbxx_hal_rcc.h"
+#endif /* HAL_RCC_MODULE_ENABLED */
+
+#ifdef HAL_RNG_MODULE_ENABLED
+ #include "stm32wbxx_hal_rng.h"
+#endif /* HAL_RNG_MODULE_ENABLED */
+
+#ifdef HAL_RTC_MODULE_ENABLED
+ #include "stm32wbxx_hal_rtc.h"
+#endif /* HAL_RTC_MODULE_ENABLED */
+
+#ifdef HAL_SAI_MODULE_ENABLED
+ #include "stm32wbxx_hal_sai.h"
+#endif /* HAL_SAI_MODULE_ENABLED */
+
+#ifdef HAL_SMARTCARD_MODULE_ENABLED
+ #include "stm32wbxx_hal_smartcard.h"
+#endif /* HAL_SMARTCARD_MODULE_ENABLED */
+
+#ifdef HAL_SMBUS_MODULE_ENABLED
+ #include "stm32wbxx_hal_smbus.h"
+#endif /* HAL_SMBUS_MODULE_ENABLED */
+
+#ifdef HAL_SPI_MODULE_ENABLED
+ #include "stm32wbxx_hal_spi.h"
+#endif /* HAL_SPI_MODULE_ENABLED */
+
+#ifdef HAL_TIM_MODULE_ENABLED
+ #include "stm32wbxx_hal_tim.h"
+#endif /* HAL_TIM_MODULE_ENABLED */
+
+#ifdef HAL_TSC_MODULE_ENABLED
+ #include "stm32wbxx_hal_tsc.h"
+#endif /* HAL_TSC_MODULE_ENABLED */
+
+#ifdef HAL_UART_MODULE_ENABLED
+ #include "stm32wbxx_hal_uart.h"
+#endif /* HAL_UART_MODULE_ENABLED */
+
+#ifdef HAL_USART_MODULE_ENABLED
+ #include "stm32wbxx_hal_usart.h"
+#endif /* HAL_USART_MODULE_ENABLED */
+
+#ifdef HAL_WWDG_MODULE_ENABLED
+ #include "stm32wbxx_hal_wwdg.h"
+#endif /* HAL_WWDG_MODULE_ENABLED */
+
+/* Exported macro ------------------------------------------------------------*/
+#ifdef USE_FULL_ASSERT
+/**
+ * @brief The assert_param macro is used for function's parameters check.
+ * @param expr If expr is false, it calls assert_failed function
+ * which reports the name of the source file and the source
+ * line number of the call that failed.
+ * If expr is true, it returns no value.
+ * @retval None
+ */
+ #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
+/* Exported functions ------------------------------------------------------- */
+ void assert_failed(uint8_t* file, uint32_t line);
+#else
+ #define assert_param(expr) ((void)0U)
+#endif /* USE_FULL_ASSERT */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __STM32WBxx_HAL_CONF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/stm32wbxx_it.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/stm32wbxx_it.h
new file mode 100644
index 000000000..a3a535f13
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/stm32wbxx_it.h
@@ -0,0 +1,83 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file stm32wbxx_it.h
+ * @brief This file contains the headers of the interrupt handlers.
+ *******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32WBxx_IT_H
+#define __STM32WBxx_IT_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+#include "app_common.h"
+/* USER CODE END Includes */
+
+/* Exported types ------------------------------------------------------------*/
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* Exported macro ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions prototypes ---------------------------------------------*/
+void NMI_Handler(void);
+void HardFault_Handler(void);
+void MemManage_Handler(void);
+void BusFault_Handler(void);
+void UsageFault_Handler(void);
+void SVC_Handler(void);
+void DebugMon_Handler(void);
+void PendSV_Handler(void);
+void SysTick_Handler(void);
+void PVD_PVM_IRQHandler(void);
+void FLASH_IRQHandler(void);
+void RCC_IRQHandler(void);
+void DMA1_Channel1_IRQHandler(void);
+void DMA1_Channel2_IRQHandler(void);
+void C2SEV_PWR_C2H_IRQHandler(void);
+void USART1_IRQHandler(void);
+void LPUART1_IRQHandler(void);
+void PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler(void);
+void HSEM_IRQHandler(void);
+void FPU_IRQHandler(void);
+/* USER CODE BEGIN EFP */
+void RTC_WKUP_IRQHandler(void);
+void EXTI4_IRQHandler(void);
+void IPCC_C1_TX_IRQHandler(void);
+void IPCC_C1_RX_IRQHandler(void);
+/* USER CODE END EFP */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __STM32WBxx_IT_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/stm_logging.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/stm_logging.h
new file mode 100644
index 000000000..75bacdffe
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/stm_logging.h
@@ -0,0 +1,59 @@
+/**
+ ******************************************************************************
+ * File Name : stm_logging.h
+ * Description : Application header file for logging
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+#ifndef STM_LOGGING_H_
+#define STM_LOGGING_H_
+
+#define LOG_LEVEL_NONE 0 /* None */
+#define LOG_LEVEL_CRIT 1U /* Critical */
+#define LOG_LEVEL_WARN 2U /* Warning */
+#define LOG_LEVEL_INFO 3U /* Info */
+#define LOG_LEVEL_DEBG 4U /* Debug */
+
+#define APP_DBG_FULL(level, region, ...) \
+ if (APPLI_PRINT_FILE_FUNC_LINE == 1U) \
+ { \
+ printf("\r\n[%s][%s][%d] ", DbgTraceGetFileName(__FILE__),__FUNCTION__,__LINE__); \
+ } \
+ logApplication(level, region, __VA_ARGS__);
+
+#define APP_DBG(...) \
+ if (APPLI_PRINT_FILE_FUNC_LINE == 1U) \
+ { \
+ printf("\r\n[%s][%s][%d] ", DbgTraceGetFileName(__FILE__),__FUNCTION__,__LINE__); \
+ } \
+ logApplication(LOG_LEVEL_NONE, APPLI_LOG_REGION_GENERAL, __VA_ARGS__);
+
+/**
+ * This enumeration represents log regions.
+ *
+ */
+typedef enum
+{
+ APPLI_LOG_REGION_GENERAL = 1U, /* General */
+ APPLI_LOG_REGION_OPENTHREAD_API = 2U, /* OpenThread API */
+ APPLI_LOG_REGION_OT_API_LINK = 3U, /* OpenThread Link API */
+ APPLI_LOG_REGION_OT_API_INSTANCE = 4U, /* OpenThread Instance API */
+ APPLI_LOG_REGION_OT_API_MESSAGE = 5U /* OpenThread Message API */
+} appliLogRegion_t;
+
+typedef uint8_t appliLogLevel_t;
+
+void logApplication(appliLogLevel_t aLogLevel, appliLogRegion_t aLogRegion, const char *aFormat, ...);
+
+#endif /* STM_LOGGING_H_ */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/utilities_conf.h
new file mode 100644
index 000000000..4dde3509a
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Inc/utilities_conf.h
@@ -0,0 +1,68 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : utilities_conf.h
+ * Description : Configuration file for STM32 Utilities.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef UTILITIES_CONF_H
+#define UTILITIES_CONF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "cmsis_compiler.h"
+#include "string.h"
+
+/******************************************************************************
+ * common
+ ******************************************************************************/
+#define UTILS_ENTER_CRITICAL_SECTION( ) uint32_t primask_bit = __get_PRIMASK( );\
+ __disable_irq( )
+
+#define UTILS_EXIT_CRITICAL_SECTION( ) __set_PRIMASK( primask_bit )
+
+#define UTILS_MEMSET8( dest, value, size ) memset( dest, value, size);
+
+/******************************************************************************
+ * tiny low power manager
+ * (any macro that does not need to be modified can be removed)
+ ******************************************************************************/
+#define UTIL_LPM_INIT_CRITICAL_SECTION( )
+#define UTIL_LPM_ENTER_CRITICAL_SECTION( ) UTILS_ENTER_CRITICAL_SECTION( )
+#define UTIL_LPM_EXIT_CRITICAL_SECTION( ) UTILS_EXIT_CRITICAL_SECTION( )
+
+/******************************************************************************
+ * sequencer
+ * (any macro that does not need to be modified can be removed)
+ ******************************************************************************/
+#define UTIL_SEQ_INIT_CRITICAL_SECTION( )
+#define UTIL_SEQ_ENTER_CRITICAL_SECTION( ) UTILS_ENTER_CRITICAL_SECTION( )
+#define UTIL_SEQ_EXIT_CRITICAL_SECTION( ) UTILS_EXIT_CRITICAL_SECTION( )
+#define UTIL_SEQ_CONF_TASK_NBR (32)
+#define UTIL_SEQ_CONF_PRIO_NBR (2)
+#define UTIL_SEQ_MEMSET8( dest, value, size ) UTILS_MEMSET8( dest, value, size )
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*UTILITIES_CONF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/app_entry.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/app_entry.c
new file mode 100644
index 000000000..aa38a896b
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/app_entry.c
@@ -0,0 +1,555 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : app_entry.c
+ * Description : Entry application source file for STM32WPAN Middleware.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "main.h"
+#include "app_entry.h"
+#include "app_thread.h"
+#include "app_conf.h"
+#include "hw_conf.h"
+#include "stm32_seq.h"
+#include "stm_logging.h"
+#include "shci_tl.h"
+#include "stm32_lpm.h"
+#include "dbg_trace.h"
+#include "shci.h"
+
+/* Private includes -----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+extern RTC_HandleTypeDef hrtc;
+/* USER CODE BEGIN PTD */
+
+/* USER CODE END PTD */
+
+/* Private defines -----------------------------------------------------------*/
+/* POOL_SIZE = 2(TL_PacketHeader_t) + 258 (3(TL_EVT_HDR_SIZE) + 255(Payload size)) */
+#define POOL_SIZE (CFG_TL_EVT_QUEUE_LENGTH * 4U * DIVC(( sizeof(TL_PacketHeader_t) + TL_EVENT_FRAME_SIZE ), 4U))
+
+/* USER CODE BEGIN PD */
+
+/* USER CODE END PD */
+
+/* Private macros ------------------------------------------------------------*/
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private variables ---------------------------------------------------------*/
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t EvtPool[POOL_SIZE];
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static TL_CmdPacket_t SystemCmdBuffer;
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t SystemSpareEvtBuffer[sizeof(TL_PacketHeader_t) + TL_EVT_HDR_SIZE + 255U];
+
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Global function prototypes -----------------------------------------------*/
+size_t DbgTraceWrite(int handle, const unsigned char * buf, size_t bufSize);
+
+/* USER CODE BEGIN GFP */
+
+/* USER CODE END GFP */
+
+/* Private functions prototypes-----------------------------------------------*/
+static void SystemPower_Config( void );
+static void Init_Debug( void );
+static void appe_Tl_Init( void );
+static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status );
+static void APPE_SysUserEvtRx( void * pPayload );
+static void APPE_SysEvtReadyProcessing(SHCI_C2_Ready_Evt_t *pReadyEvt);
+static void APPE_SysEvtError( SCHI_SystemErrCode_t ErrorCode);
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+extern void MX_LPUART1_UART_Init(void);
+#endif
+#if (CFG_HW_USART1_ENABLED == 1)
+extern void MX_USART1_UART_Init(void);
+#endif
+
+/* USER CODE BEGIN PFP */
+static void Led_Init( void );
+static void Button_Init( void );
+/* USER CODE END PFP */
+
+/* Functions Definition ------------------------------------------------------*/
+void APPE_Init( void )
+{
+ SystemPower_Config(); /**< Configure the system Power Mode */
+
+ HW_TS_Init(hw_ts_InitMode_Full, &hrtc); /**< Initialize the TimerServer */
+
+/* USER CODE BEGIN APPE_Init_1 */
+ Init_Debug();
+
+ UTIL_LPM_SetOffMode(1 << CFG_LPM_APP, UTIL_LPM_DISABLE);
+ Led_Init();
+ Button_Init();
+/* USER CODE END APPE_Init_1 */
+ appe_Tl_Init(); /* Initialize all transport layers */
+
+ /**
+ * From now, the application is waiting for the ready event ( VS_HCI_C2_Ready )
+ * received on the system channel before starting the Stack
+ * This system event is received with APPE_SysUserEvtRx()
+ */
+/* USER CODE BEGIN APPE_Init_2 */
+
+/* USER CODE END APPE_Init_2 */
+ return;
+}
+/* USER CODE BEGIN FD */
+
+/* USER CODE END FD */
+
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+static void Init_Debug( void )
+{
+#if (CFG_DEBUGGER_SUPPORTED == 1)
+ /**
+ * Keep debugger enabled while in any low power mode
+ */
+ HAL_DBGMCU_EnableDBGSleepMode();
+
+ /***************** ENABLE DEBUGGER *************************************/
+ LL_EXTI_EnableIT_32_63(LL_EXTI_LINE_48);
+ LL_C2_EXTI_EnableIT_32_63(LL_EXTI_LINE_48);
+
+#else
+
+ GPIO_InitTypeDef gpio_config = {0};
+
+ gpio_config.Pull = GPIO_NOPULL;
+ gpio_config.Mode = GPIO_MODE_ANALOG;
+
+ gpio_config.Pin = GPIO_PIN_15 | GPIO_PIN_14 | GPIO_PIN_13;
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ HAL_GPIO_Init(GPIOA, &gpio_config);
+ __HAL_RCC_GPIOA_CLK_DISABLE();
+
+ gpio_config.Pin = GPIO_PIN_4 | GPIO_PIN_3;
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+ HAL_GPIO_Init(GPIOB, &gpio_config);
+ __HAL_RCC_GPIOB_CLK_DISABLE();
+
+ HAL_DBGMCU_DisableDBGSleepMode();
+ HAL_DBGMCU_DisableDBGStopMode();
+ HAL_DBGMCU_DisableDBGStandbyMode();
+
+#endif /* (CFG_DEBUGGER_SUPPORTED == 1) */
+
+#if(CFG_DEBUG_TRACE != 0)
+ DbgTraceInit();
+#endif
+
+ return;
+}
+
+/**
+ * @brief Configure the system for power optimization
+ *
+ * @note This API configures the system to be ready for low power mode
+ *
+ * @param None
+ * @retval None
+ */
+static void SystemPower_Config( void )
+{
+
+ /**
+ * Select HSI as system clock source after Wake Up from Stop mode
+ */
+ LL_RCC_SetClkAfterWakeFromStop(LL_RCC_STOP_WAKEUPCLOCK_HSI);
+
+ /* Initialize low power manager */
+ UTIL_LPM_Init( );
+
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+ /**
+ * Enable USB power
+ */
+ HAL_PWREx_EnableVddUSB();
+#endif
+
+ return;
+}
+
+static void appe_Tl_Init( void )
+{
+ TL_MM_Config_t tl_mm_config;
+ SHCI_TL_HciInitConf_t SHci_Tl_Init_Conf;
+ /**< Reference table initialization */
+ TL_Init();
+
+ /**< System channel initialization */
+ UTIL_SEQ_RegTask( 1<< CFG_TASK_SYSTEM_HCI_ASYNCH_EVT, UTIL_SEQ_RFU, shci_user_evt_proc );
+ SHci_Tl_Init_Conf.p_cmdbuffer = (uint8_t*)&SystemCmdBuffer;
+ SHci_Tl_Init_Conf.StatusNotCallBack = APPE_SysStatusNot;
+ shci_init(APPE_SysUserEvtRx, (void*) &SHci_Tl_Init_Conf);
+
+ /**< Memory Manager channel initialization */
+ tl_mm_config.p_BleSpareEvtBuffer = 0;
+ tl_mm_config.p_SystemSpareEvtBuffer = SystemSpareEvtBuffer;
+ tl_mm_config.p_AsynchEvtPool = EvtPool;
+ tl_mm_config.AsynchEvtPoolSize = POOL_SIZE;
+ TL_MM_Init( &tl_mm_config );
+
+ TL_Enable();
+
+ return;
+}
+
+static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status )
+{
+ UNUSED(status);
+ return;
+}
+
+/**
+ * @brief Trap a notification coming from the M0 firmware
+ * @param pPayload : payload associated to the notification
+ *
+ * @retval None
+ */
+
+static void APPE_SysUserEvtRx( void * pPayload )
+{
+ TL_AsynchEvt_t *p_sys_event;
+ p_sys_event = (TL_AsynchEvt_t*)(((tSHCI_UserEvtRxParam*)pPayload)->pckt->evtserial.evt.payload);
+
+ switch(p_sys_event->subevtcode)
+ {
+ case SHCI_SUB_EVT_CODE_READY:
+ APPE_SysEvtReadyProcessing( (SHCI_C2_Ready_Evt_t*)p_sys_event->payload );;
+ break;
+ case SHCI_SUB_EVT_ERROR_NOTIF:
+ APPE_SysEvtError((SCHI_SystemErrCode_t) (p_sys_event->payload[0]));
+ break;
+ default:
+ break;
+ }
+ return;
+}
+
+/**
+ * @brief Notify a system error coming from the M0 firmware
+ * @param ErrorCode : errorCode detected by the M0 firmware
+ *
+ * @retval None
+ */
+static void APPE_SysEvtError( SCHI_SystemErrCode_t ErrorCode)
+{
+ switch(ErrorCode)
+ {
+ case ERR_THREAD_LLD_FATAL_ERROR:
+ APP_DBG("** ERR_THREAD : LLD_FATAL_ERROR \n");
+ break;
+ case ERR_THREAD_UNKNOWN_CMD:
+ APP_DBG("** ERR_THREAD : UNKNOWN_CMD \n");
+ break;
+ default:
+ APP_DBG("** ERR_THREAD : ErroCode=%d \n",ErrorCode);
+ break;
+ }
+ return;
+}
+
+static void APPE_SysEvtReadyProcessing( SHCI_C2_Ready_Evt_t *pReadyEvt )
+{
+ uint8_t fus_state_value;
+
+#if ( CFG_LED_SUPPORTED != 0)
+ BSP_LED_Off(LED_BLUE);
+#endif
+
+ if(pReadyEvt->sysevt_ready_rsp == WIRELESS_FW_RUNNING)
+ {
+ if((*(uint8_t*)SRAM1_BASE) == CFG_REBOOT_ON_CPU2_UPGRADE)
+ {
+ /**
+ * The wireless stack update has been completed
+ * Reboot on the firmware application
+ */
+ *(uint8_t*)SRAM1_BASE = CFG_REBOOT_ON_FW_APP;
+ NVIC_SystemReset();
+ }
+ else
+ {
+ /**
+ * Run the Application
+ */
+
+ /* Traces channel initialization */
+ TL_TRACES_Init( );
+
+ APP_THREAD_Init();
+ UTIL_LPM_SetOffMode(1U << CFG_LPM_APP, UTIL_LPM_ENABLE);
+ }
+ }
+ else
+ {
+ /**
+ * FUS is running on CPU2
+ */
+
+ /**
+ * The CPU2 firmware update procedure is starting from now
+ * There may be several device reset during CPU2 firmware upgrade
+ * The key word at the beginning of SRAM1 shall be changed CFG_REBOOT_ON_CPU2_UPGRADE
+ *
+ * Wireless Firmware upgrade:
+ * Once the upgrade is over, the CPU2 will run the wireless stack
+ * When the wireless stack is running, the SRAM1 is checked and when equal to CFG_REBOOT_ON_CPU2_UPGRADE,
+ * it means we may restart on the firmware application.
+ *
+ * FUS Firmware Upgrade:
+ * Once the upgrade is over, the CPU2 will run FUS and the FUS return the Idle state
+ * The SRAM1 is checked and when equal to CFG_REBOOT_ON_CPU2_UPGRADE,
+ * it means we may restart on the firmware application.
+ */
+ fus_state_value = SHCI_C2_FUS_GetState( NULL );
+
+ if( fus_state_value == 0xFF)
+ {
+ /**
+ * This is the first time in the life of the product the FUS is involved. After this command, it will be properly initialized
+ * Request the device to reboot to install the wireless firmware
+ */
+ NVIC_SystemReset();
+ }
+ else if( fus_state_value != 0)
+ {
+ /**
+ * An upgrade is on going
+ * Wait to reboot on the wireless stack
+ */
+#if ( CFG_LED_SUPPORTED != 0)
+ BSP_LED_On(LED_BLUE);
+#endif
+ while(1)
+ {
+ HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFI);
+ }
+ }
+ else
+ {
+ /**
+ * FUS is idle
+ * Request an upgrade and wait to reboot on the wireless stack
+ * The first two parameters are currently not supported by the FUS
+ */
+ if((*(uint8_t*)SRAM1_BASE) == CFG_REBOOT_ON_CPU2_UPGRADE)
+ {
+ /**
+ * The FUS update has been completed
+ * Reboot the CPU2 on the firmware application
+ */
+ *(uint8_t*)SRAM1_BASE = CFG_REBOOT_ON_FW_APP;
+ SHCI_C2_FUS_StartWs( );
+ #if ( CFG_LED_SUPPORTED != 0)
+ BSP_LED_On(LED_BLUE);
+ #endif
+ while(1)
+ {
+ HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFI);
+ }
+ }
+ else
+ {
+ *(uint8_t*)SRAM1_BASE = CFG_REBOOT_ON_CPU2_UPGRADE;
+ /**
+ * Note:
+ * If a reset occurs now, on the next reboot the FUS will be idle and a CPU2 reboot on the
+ * wireless stack will be requested because SRAM1 is set to CFG_REBOOT_ON_CPU2_UPGRADE
+ * The device is still operational but no CPU2 update has been done.
+ */
+ SHCI_C2_FUS_FwUpgrade(0,0);
+ #if ( CFG_LED_SUPPORTED != 0)
+ BSP_LED_On(LED_BLUE);
+ #endif
+ while(1)
+ {
+ HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFI);
+ }
+ }
+ }
+ }
+
+ return;
+}
+
+/* USER CODE BEGIN FD_LOCAL_FUNCTIONS */
+static void Led_Init( void )
+{
+#if (CFG_LED_SUPPORTED == 1U)
+ /**
+ * Leds Initialization
+ */
+
+ BSP_LED_Init(LED_BLUE);
+ BSP_LED_Init(LED_GREEN);
+ BSP_LED_Init(LED_RED);
+
+#endif
+
+ return;
+}
+
+static void Button_Init( void )
+{
+#if (CFG_BUTTON_SUPPORTED == 1U)
+ /**
+ * Button Initialization
+ */
+
+ BSP_PB_Init(BUTTON_SW1, BUTTON_MODE_EXTI);
+#endif
+
+ return;
+}
+/* USER CODE END FD_LOCAL_FUNCTIONS */
+
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+
+void UTIL_SEQ_Idle( void )
+{
+#if ( CFG_LPM_SUPPORTED == 1)
+ UTIL_LPM_EnterLowPower( );
+#endif
+ return;
+}
+
+/**
+ * @brief This function is called by the scheduler each time an event
+ * is pending.
+ *
+ * @param evt_waited_bm : Event pending.
+ * @retval None
+ */
+void UTIL_SEQ_EvtIdle( UTIL_SEQ_bm_t task_id_bm, UTIL_SEQ_bm_t evt_waited_bm )
+{
+ switch(evt_waited_bm)
+ {
+ case EVENT_ACK_FROM_M0_EVT:
+ /* Does not allow other tasks when waiting for OT Cmd response */
+ UTIL_SEQ_Run(0);
+ break;
+ case EVENT_SYNCHRO_BYPASS_IDLE:
+ UTIL_SEQ_SetEvt(EVENT_SYNCHRO_BYPASS_IDLE);
+ /* Run only the task CFG_TASK_MSG_FROM_M0_TO_M4 */
+ UTIL_SEQ_Run(TASK_MSG_FROM_M0_TO_M4);
+ break;
+ default :
+ /* default case */
+ UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
+ break;
+ }
+}
+
+void shci_notify_asynch_evt(void* pdata)
+{
+ UNUSED(pdata);
+ UTIL_SEQ_SetTask(1U << CFG_TASK_SYSTEM_HCI_ASYNCH_EVT, CFG_SCH_PRIO_0);
+ return;
+}
+
+void shci_cmd_resp_release(uint32_t flag)
+{
+ UNUSED(flag);
+ UTIL_SEQ_SetEvt(1U << CFG_EVT_SYSTEM_HCI_CMD_EVT_RESP);
+ return;
+}
+
+void shci_cmd_resp_wait(uint32_t timeout)
+{
+ UNUSED(timeout);
+ UTIL_SEQ_WaitEvt(1U << CFG_EVT_SYSTEM_HCI_CMD_EVT_RESP);
+ return;
+}
+
+/* Received trace buffer from M0 */
+void TL_TRACES_EvtReceived( TL_EvtPacket_t * hcievt )
+{
+#if(CFG_DEBUG_TRACE != 0)
+ /* Call write/print function using DMA from dbg_trace */
+ /* - Cast to TL_AsynchEvt_t* to get "real" payload (without Sub Evt code 2bytes),
+ - (-2) to size to remove Sub Evt Code */
+// DbgTraceWrite(1U, (const unsigned char *) ((TL_AsynchEvt_t *)(hcievt->evtserial.evt.payload))->payload, hcievt->evtserial.evt.plen - 2U);
+#endif /* CFG_DEBUG_TRACE */
+ /* Release buffer */
+ TL_MM_EvtDone( hcievt );
+}
+/**
+ * @brief Initialisation of the trace mechanism
+ * @param None
+ * @retval None
+ */
+#if(CFG_DEBUG_TRACE != 0)
+void DbgOutputInit( void )
+{
+ MX_LPUART1_UART_Init();
+
+ return;
+}
+
+/**
+ * @brief Management of the traces
+ * @param p_data : data
+ * @param size : size
+ * @param call-back :
+ * @retval None
+ */
+void DbgOutputTraces( uint8_t *p_data, uint16_t size, void (*cb)(void) )
+{
+ HW_UART_Transmit_DMA(CFG_DEBUG_TRACE_UART, p_data, size, cb);
+
+ return;
+}
+#endif
+
+/* USER CODE BEGIN FD_WRAP_FUNCTIONS */
+/**
+ * @brief This function manage the Push button action
+ * @param GPIO_Pin : GPIO pin which has been activated
+ * @retval None
+ */
+void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
+{
+ APP_DBG("*** HAL_GPIO_EXTI_Callback GPIO_Pin = %d ****", GPIO_Pin);
+ switch(GPIO_Pin)
+ {
+ default:
+ break;
+ }
+}
+/* USER CODE END FD_WRAP_FUNCTIONS */
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/hw_timerserver.c
new file mode 100644
index 000000000..c842ba55e
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/hw_timerserver.c
@@ -0,0 +1,893 @@
+/**
+ ******************************************************************************
+ * File Name : hw_timerserver.c
+ * Description : Hardware timerserver source file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "hw_conf.h"
+
+/* Private typedef -----------------------------------------------------------*/
+typedef enum
+{
+ TimerID_Free,
+ TimerID_Created,
+ TimerID_Running
+}TimerIDStatus_t;
+
+typedef enum
+{
+ SSR_Read_Requested,
+ SSR_Read_Not_Requested
+}RequestReadSSR_t;
+
+typedef enum
+{
+ WakeupTimerValue_Overpassed,
+ WakeupTimerValue_LargeEnough
+}WakeupTimerLimitation_Status_t;
+
+typedef struct
+{
+ HW_TS_pTimerCb_t pTimerCallBack;
+ uint32_t CounterInit;
+ uint32_t CountLeft;
+ TimerIDStatus_t TimerIDStatus;
+ HW_TS_Mode_t TimerMode;
+ uint32_t TimerProcessID;
+ uint8_t PreviousID;
+ uint8_t NextID;
+}TimerContext_t;
+
+/* Private defines -----------------------------------------------------------*/
+#define SSR_FORBIDDEN_VALUE 0xFFFFFFFF
+#define TIMER_LIST_EMPTY 0xFFFF
+
+/* Private macros ------------------------------------------------------------*/
+/* Private variables ---------------------------------------------------------*/
+
+/**
+ * START of Section TIMERSERVER_CONTEXT
+ */
+
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile TimerContext_t aTimerContext[CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER];
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile uint8_t CurrentRunningTimerID;
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile uint8_t PreviousRunningTimerID;
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile uint32_t SSRValueOnLastSetup;
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile WakeupTimerLimitation_Status_t WakeupTimerLimitation;
+
+/**
+ * END of Section TIMERSERVER_CONTEXT
+ */
+
+static RTC_HandleTypeDef *phrtc; /**< RTC handle */
+static uint8_t WakeupTimerDivider;
+static uint8_t AsynchPrescalerUserConfig;
+static uint16_t SynchPrescalerUserConfig;
+static volatile uint16_t MaxWakeupTimerSetup;
+
+/* Global variables ----------------------------------------------------------*/
+/* Private function prototypes -----------------------------------------------*/
+static void RestartWakeupCounter(uint16_t Value);
+static uint16_t ReturnTimeElapsed(void);
+static void RescheduleTimerList(void);
+static void UnlinkTimer(uint8_t TimerID, RequestReadSSR_t RequestReadSSR);
+static void LinkTimerBefore(uint8_t TimerID, uint8_t RefTimerID);
+static void LinkTimerAfter(uint8_t TimerID, uint8_t RefTimerID);
+static uint16_t linkTimer(uint8_t TimerID);
+static uint32_t ReadRtcSsrValue(void);
+
+__weak void HW_TS_RTC_CountUpdated_AppNot(void);
+
+/* Functions Definition ------------------------------------------------------*/
+
+/**
+ * @brief Read the RTC_SSR value
+ * As described in the reference manual, the RTC_SSR shall be read twice to ensure
+ * reliability of the value
+ * @param None
+ * @retval SSR value read
+ */
+static uint32_t ReadRtcSsrValue(void)
+{
+ uint32_t first_read;
+ uint32_t second_read;
+
+ first_read = (uint32_t)(READ_BIT(RTC->SSR, RTC_SSR_SS));
+
+ second_read = (uint32_t)(READ_BIT(RTC->SSR, RTC_SSR_SS));
+
+ while(first_read != second_read)
+ {
+ first_read = second_read;
+
+ second_read = (uint32_t)(READ_BIT(RTC->SSR, RTC_SSR_SS));
+ }
+
+ return second_read;
+}
+
+/**
+ * @brief Insert a Timer in the list after the Timer ID specified
+ * @param TimerID: The ID of the Timer
+ * @param RefTimerID: The ID of the Timer to be linked after
+ * @retval None
+ */
+static void LinkTimerAfter(uint8_t TimerID, uint8_t RefTimerID)
+{
+ uint8_t next_id;
+
+ next_id = aTimerContext[RefTimerID].NextID;
+
+ if(next_id != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ aTimerContext[next_id].PreviousID = TimerID;
+ }
+ aTimerContext[TimerID].NextID = next_id;
+ aTimerContext[TimerID].PreviousID = RefTimerID ;
+ aTimerContext[RefTimerID].NextID = TimerID;
+
+ return;
+}
+
+/**
+ * @brief Insert a Timer in the list before the ID specified
+ * @param TimerID: The ID of the Timer
+ * @param RefTimerID: The ID of the Timer to be linked before
+ * @retval None
+ */
+static void LinkTimerBefore(uint8_t TimerID, uint8_t RefTimerID)
+{
+ uint8_t previous_id;
+
+ if(RefTimerID != CurrentRunningTimerID)
+ {
+ previous_id = aTimerContext[RefTimerID].PreviousID;
+
+ aTimerContext[previous_id].NextID = TimerID;
+ aTimerContext[TimerID].NextID = RefTimerID;
+ aTimerContext[TimerID].PreviousID = previous_id ;
+ aTimerContext[RefTimerID].PreviousID = TimerID;
+ }
+ else
+ {
+ aTimerContext[TimerID].NextID = RefTimerID;
+ aTimerContext[RefTimerID].PreviousID = TimerID;
+ }
+
+ return;
+}
+
+/**
+ * @brief Insert a Timer in the list
+ * @param TimerID: The ID of the Timer
+ * @retval None
+ */
+static uint16_t linkTimer(uint8_t TimerID)
+{
+ uint32_t time_left;
+ uint16_t time_elapsed;
+ uint8_t timer_id_lookup;
+ uint8_t next_id;
+
+ if(CurrentRunningTimerID == CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ /**
+ * No timer in the list
+ */
+ PreviousRunningTimerID = CurrentRunningTimerID;
+ CurrentRunningTimerID = TimerID;
+ aTimerContext[TimerID].NextID = CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER;
+
+ SSRValueOnLastSetup = SSR_FORBIDDEN_VALUE;
+ time_elapsed = 0;
+ }
+ else
+ {
+ time_elapsed = ReturnTimeElapsed();
+
+ /**
+ * update count of the timer to be linked
+ */
+ aTimerContext[TimerID].CountLeft += time_elapsed;
+ time_left = aTimerContext[TimerID].CountLeft;
+
+ /**
+ * Search for index where the new timer shall be linked
+ */
+ if(aTimerContext[CurrentRunningTimerID].CountLeft <= time_left)
+ {
+ /**
+ * Search for the ID after the first one
+ */
+ timer_id_lookup = CurrentRunningTimerID;
+ next_id = aTimerContext[timer_id_lookup].NextID;
+ while((next_id != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) && (aTimerContext[next_id].CountLeft <= time_left))
+ {
+ timer_id_lookup = aTimerContext[timer_id_lookup].NextID;
+ next_id = aTimerContext[timer_id_lookup].NextID;
+ }
+
+ /**
+ * Link after the ID
+ */
+ LinkTimerAfter(TimerID, timer_id_lookup);
+ }
+ else
+ {
+ /**
+ * Link before the first ID
+ */
+ LinkTimerBefore(TimerID, CurrentRunningTimerID);
+ PreviousRunningTimerID = CurrentRunningTimerID;
+ CurrentRunningTimerID = TimerID;
+ }
+ }
+
+ return time_elapsed;
+}
+
+/**
+ * @brief Remove a Timer from the list
+ * @param TimerID: The ID of the Timer
+ * @param RequestReadSSR: Request to read the SSR register or not
+ * @retval None
+ */
+static void UnlinkTimer(uint8_t TimerID, RequestReadSSR_t RequestReadSSR)
+{
+ uint8_t previous_id;
+ uint8_t next_id;
+
+ if(TimerID == CurrentRunningTimerID)
+ {
+ PreviousRunningTimerID = CurrentRunningTimerID;
+ CurrentRunningTimerID = aTimerContext[TimerID].NextID;
+ }
+ else
+ {
+ previous_id = aTimerContext[TimerID].PreviousID;
+ next_id = aTimerContext[TimerID].NextID;
+
+ aTimerContext[previous_id].NextID = aTimerContext[TimerID].NextID;
+ if(next_id != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ aTimerContext[next_id].PreviousID = aTimerContext[TimerID].PreviousID;
+ }
+ }
+
+ /**
+ * Timer is out of the list
+ */
+ aTimerContext[TimerID].TimerIDStatus = TimerID_Created;
+
+ if((CurrentRunningTimerID == CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) && (RequestReadSSR == SSR_Read_Requested))
+ {
+ SSRValueOnLastSetup = SSR_FORBIDDEN_VALUE;
+ }
+
+ return;
+}
+
+/**
+ * @brief Return the number of ticks counted by the wakeuptimer since it has been started
+ * @note The API is reading the SSR register to get how many ticks have been counted
+ * since the time the timer has been started
+ * @param None
+ * @retval Time expired in Ticks
+ */
+static uint16_t ReturnTimeElapsed(void)
+{
+ uint32_t return_value;
+ uint32_t wrap_counter;
+
+ if(SSRValueOnLastSetup != SSR_FORBIDDEN_VALUE)
+ {
+ return_value = ReadRtcSsrValue(); /**< Read SSR register first */
+
+ if (SSRValueOnLastSetup >= return_value)
+ {
+ return_value = SSRValueOnLastSetup - return_value;
+ }
+ else
+ {
+ wrap_counter = SynchPrescalerUserConfig - return_value;
+ return_value = SSRValueOnLastSetup + wrap_counter;
+ }
+
+ /**
+ * At this stage, ReturnValue holds the number of ticks counted by SSR
+ * Need to translate in number of ticks counted by the Wakeuptimer
+ */
+ return_value = return_value*AsynchPrescalerUserConfig;
+ return_value = return_value >> WakeupTimerDivider;
+ }
+ else
+ {
+ return_value = 0;
+ }
+
+ return (uint16_t)return_value;
+}
+
+/**
+ * @brief Set the wakeup counter
+ * @note The API is writing the counter value so that the value is decreased by one to cope with the fact
+ * the interrupt is generated with 1 extra clock cycle (See RefManuel)
+ * It assumes all condition are met to be allowed to write the wakeup counter
+ * @param Value: Value to be written in the counter
+ * @retval None
+ */
+static void RestartWakeupCounter(uint16_t Value)
+{
+ /**
+ * The wakeuptimer has been disabled in the calling function to reduce the time to poll the WUTWF
+ * FLAG when the new value will have to be written
+ * __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc);
+ */
+
+ if(Value == 0)
+ {
+ SSRValueOnLastSetup = ReadRtcSsrValue();
+
+ /**
+ * Simulate that the Timer expired
+ */
+ HAL_NVIC_SetPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID);
+ }
+ else
+ {
+ if((Value > 1) ||(WakeupTimerDivider != 1))
+ {
+ Value -= 1;
+ }
+
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == RESET);
+
+ /**
+ * make sure to clear the flags after checking the WUTWF.
+ * It takes 2 RTCCLK between the time the WUTE bit is disabled and the
+ * time the timer is disabled. The WUTWF bit somehow guarantee the system is stable
+ * Otherwise, when the timer is periodic with 1 Tick, it may generate an extra interrupt in between
+ * due to the autoreload feature
+ */
+ __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */
+ __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */
+ HAL_NVIC_ClearPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Clear pending bit in NVIC */
+
+ MODIFY_REG(RTC->WUTR, RTC_WUTR_WUT, Value);
+
+ /**
+ * Update the value here after the WUTWF polling that may take some time
+ */
+ SSRValueOnLastSetup = ReadRtcSsrValue();
+
+ __HAL_RTC_WAKEUPTIMER_ENABLE(phrtc); /**< Enable the Wakeup Timer */
+
+ HW_TS_RTC_CountUpdated_AppNot();
+ }
+
+ return ;
+}
+
+/**
+ * @brief Reschedule the list of timer
+ * @note 1) Update the count left for each timer in the list
+ * 2) Setup the wakeuptimer
+ * @param None
+ * @retval None
+ */
+static void RescheduleTimerList(void)
+{
+ uint8_t localTimerID;
+ uint32_t timecountleft;
+ uint16_t wakeup_timer_value;
+ uint16_t time_elapsed;
+
+ /**
+ * The wakeuptimer is disabled now to reduce the time to poll the WUTWF
+ * FLAG when the new value will have to be written
+ */
+ if((READ_BIT(RTC->CR, RTC_CR_WUTE) == (RTC_CR_WUTE)) == SET)
+ {
+ /**
+ * Wait for the flag to be back to 0 when the wakeup timer is enabled
+ */
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == SET);
+ }
+ __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc); /**< Disable the Wakeup Timer */
+
+ localTimerID = CurrentRunningTimerID;
+
+ /**
+ * Calculate what will be the value to write in the wakeuptimer
+ */
+ timecountleft = aTimerContext[localTimerID].CountLeft;
+
+ /**
+ * Read how much has been counted
+ */
+ time_elapsed = ReturnTimeElapsed();
+
+ if(timecountleft < time_elapsed )
+ {
+ /**
+ * There is no tick left to count
+ */
+ wakeup_timer_value = 0;
+ WakeupTimerLimitation = WakeupTimerValue_LargeEnough;
+ }
+ else
+ {
+ if(timecountleft > (time_elapsed + MaxWakeupTimerSetup))
+ {
+ /**
+ * The number of tick left is greater than the Wakeuptimer maximum value
+ */
+ wakeup_timer_value = MaxWakeupTimerSetup;
+
+ WakeupTimerLimitation = WakeupTimerValue_Overpassed;
+ }
+ else
+ {
+ wakeup_timer_value = timecountleft - time_elapsed;
+ WakeupTimerLimitation = WakeupTimerValue_LargeEnough;
+ }
+
+ }
+
+ /**
+ * update ticks left to be counted for each timer
+ */
+ while(localTimerID != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ if (aTimerContext[localTimerID].CountLeft < time_elapsed)
+ {
+ aTimerContext[localTimerID].CountLeft = 0;
+ }
+ else
+ {
+ aTimerContext[localTimerID].CountLeft -= time_elapsed;
+ }
+ localTimerID = aTimerContext[localTimerID].NextID;
+ }
+
+ /**
+ * Write next count
+ */
+ RestartWakeupCounter(wakeup_timer_value);
+
+ return ;
+}
+
+/* Public functions ----------------------------------------------------------*/
+
+/**
+ * For all public interface except that may need write access to the RTC, the RTC
+ * shall be unlock at the beginning and locked at the output
+ * In order to ease maintainability, the unlock is done at the top and the lock at then end
+ * in case some new implementation is coming in the future
+ */
+
+void HW_TS_RTC_Wakeup_Handler(void)
+{
+ HW_TS_pTimerCb_t ptimer_callback;
+ uint32_t timer_process_id;
+ uint8_t local_current_running_timer_id;
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ uint32_t primask_bit;
+#endif
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+#endif
+
+/* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+
+ /**
+ * Disable the Wakeup Timer
+ * This may speed up a bit the processing to wait the timer to be disabled
+ * The timer is still counting 2 RTCCLK
+ */
+ __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc);
+
+ local_current_running_timer_id = CurrentRunningTimerID;
+
+ if(aTimerContext[local_current_running_timer_id].TimerIDStatus == TimerID_Running)
+ {
+ ptimer_callback = aTimerContext[local_current_running_timer_id].pTimerCallBack;
+ timer_process_id = aTimerContext[local_current_running_timer_id].TimerProcessID;
+
+ /**
+ * It should be good to check whether the TimeElapsed is greater or not than the tick left to be counted
+ * However, due to the inaccuracy of the reading of the time elapsed, it may return there is 1 tick
+ * to be left whereas the count is over
+ * A more secure implementation has been done with a flag to state whereas the full count has been written
+ * in the wakeuptimer or not
+ */
+ if(WakeupTimerLimitation != WakeupTimerValue_Overpassed)
+ {
+ if(aTimerContext[local_current_running_timer_id].TimerMode == hw_ts_Repeated)
+ {
+ UnlinkTimer(local_current_running_timer_id, SSR_Read_Not_Requested);
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+ HW_TS_Start(local_current_running_timer_id, aTimerContext[local_current_running_timer_id].CounterInit);
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+ }
+ else
+ {
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+ HW_TS_Stop(local_current_running_timer_id);
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+ }
+
+ HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
+ }
+ else
+ {
+ RescheduleTimerList();
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+ }
+ }
+ else
+ {
+ /**
+ * We should never end up in this case
+ * However, if due to any bug in the timer server this is the case, the mistake may not impact the user.
+ * We could just clean the interrupt flag and get out from this unexpected interrupt
+ */
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == RESET);
+
+ /**
+ * make sure to clear the flags after checking the WUTWF.
+ * It takes 2 RTCCLK between the time the WUTE bit is disabled and the
+ * time the timer is disabled. The WUTWF bit somehow guarantee the system is stable
+ * Otherwise, when the timer is periodic with 1 Tick, it may generate an extra interrupt in between
+ * due to the autoreload feature
+ */
+ __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */
+ __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+ }
+
+ /* Enable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_ENABLE( phrtc );
+
+ return;
+}
+
+void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
+{
+ uint8_t loop;
+ uint32_t localmaxwakeuptimersetup;
+
+ /**
+ * Get RTC handler
+ */
+ phrtc = hrtc;
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+
+ SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
+
+ /**
+ * Readout the user config
+ */
+ WakeupTimerDivider = (4 - ((uint32_t)(READ_BIT(RTC->CR, RTC_CR_WUCKSEL))));
+
+ AsynchPrescalerUserConfig = (uint8_t)(READ_BIT(RTC->PRER, RTC_PRER_PREDIV_A) >> (uint32_t)POSITION_VAL(RTC_PRER_PREDIV_A)) + 1;
+
+ SynchPrescalerUserConfig = (uint16_t)(READ_BIT(RTC->PRER, RTC_PRER_PREDIV_S)) + 1;
+
+ /**
+ * Margin is taken to avoid wrong calculation when the wrap around is there and some
+ * application interrupts may have delayed the reading
+ */
+ localmaxwakeuptimersetup = ((((SynchPrescalerUserConfig - 1)*AsynchPrescalerUserConfig) - CFG_HW_TS_RTC_HANDLER_MAX_DELAY) >> WakeupTimerDivider);
+
+ if(localmaxwakeuptimersetup >= 0xFFFF)
+ {
+ MaxWakeupTimerSetup = 0xFFFF;
+ }
+ else
+ {
+ MaxWakeupTimerSetup = (uint16_t)localmaxwakeuptimersetup;
+ }
+
+ /**
+ * Configure EXTI module
+ */
+ LL_EXTI_EnableRisingTrig_0_31(RTC_EXTI_LINE_WAKEUPTIMER_EVENT);
+ LL_EXTI_EnableIT_0_31(RTC_EXTI_LINE_WAKEUPTIMER_EVENT);
+
+ if(TimerInitMode == hw_ts_InitMode_Full)
+ {
+ WakeupTimerLimitation = WakeupTimerValue_LargeEnough;
+ SSRValueOnLastSetup = SSR_FORBIDDEN_VALUE;
+
+ /**
+ * Initialize the timer server
+ */
+ for(loop = 0; loop < CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER; loop++)
+ {
+ aTimerContext[loop].TimerIDStatus = TimerID_Free;
+ }
+
+ CurrentRunningTimerID = CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER; /**< Set ID to non valid value */
+
+ __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc); /**< Disable the Wakeup Timer */
+ __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */
+ __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */
+ HAL_NVIC_ClearPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Clear pending bit in NVIC */
+ __HAL_RTC_WAKEUPTIMER_ENABLE_IT(phrtc, RTC_IT_WUT); /**< Enable interrupt in RTC module */
+ }
+ else
+ {
+ if(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTF) != RESET)
+ {
+ /**
+ * Simulate that the Timer expired
+ */
+ HAL_NVIC_SetPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID);
+ }
+ }
+
+ /* Enable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_ENABLE( phrtc );
+
+ HAL_NVIC_SetPriority(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID, CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO, CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO); /**< Set NVIC priority */
+ HAL_NVIC_EnableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Enable NVIC */
+
+ return;
+}
+
+HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pftimeout_handler)
+{
+ HW_TS_ReturnStatus_t localreturnstatus;
+ uint8_t loop = 0;
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ uint32_t primask_bit;
+#endif
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+#endif
+
+ while((loop < CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) && (aTimerContext[loop].TimerIDStatus != TimerID_Free))
+ {
+ loop++;
+ }
+
+ if(loop != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ aTimerContext[loop].TimerIDStatus = TimerID_Created;
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+
+ aTimerContext[loop].TimerProcessID = TimerProcessID;
+ aTimerContext[loop].TimerMode = TimerMode;
+ aTimerContext[loop].pTimerCallBack = pftimeout_handler;
+ *pTimerId = loop;
+
+ localreturnstatus = hw_ts_Successful;
+ }
+ else
+ {
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+
+ localreturnstatus = hw_ts_Failed;
+ }
+
+ return(localreturnstatus);
+}
+
+void HW_TS_Delete(uint8_t timer_id)
+{
+ HW_TS_Stop(timer_id);
+
+ aTimerContext[timer_id].TimerIDStatus = TimerID_Free; /**< release ID */
+
+ return;
+}
+
+void HW_TS_Stop(uint8_t timer_id)
+{
+ uint8_t localcurrentrunningtimerid;
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ uint32_t primask_bit;
+#endif
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+#endif
+
+ HAL_NVIC_DisableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Disable NVIC */
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+
+ if(aTimerContext[timer_id].TimerIDStatus == TimerID_Running)
+ {
+ UnlinkTimer(timer_id, SSR_Read_Requested);
+ localcurrentrunningtimerid = CurrentRunningTimerID;
+
+ if(localcurrentrunningtimerid == CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ /**
+ * List is empty
+ */
+
+ /**
+ * Disable the timer
+ */
+ if((READ_BIT(RTC->CR, RTC_CR_WUTE) == (RTC_CR_WUTE)) == SET)
+ {
+ /**
+ * Wait for the flag to be back to 0 when the wakeup timer is enabled
+ */
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == SET);
+ }
+ __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc); /**< Disable the Wakeup Timer */
+
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == RESET);
+
+ /**
+ * make sure to clear the flags after checking the WUTWF.
+ * It takes 2 RTCCLK between the time the WUTE bit is disabled and the
+ * time the timer is disabled. The WUTWF bit somehow guarantee the system is stable
+ * Otherwise, when the timer is periodic with 1 Tick, it may generate an extra interrupt in between
+ * due to the autoreload feature
+ */
+ __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */
+ __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */
+ HAL_NVIC_ClearPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Clear pending bit in NVIC */
+ }
+ else if(PreviousRunningTimerID != localcurrentrunningtimerid)
+ {
+ RescheduleTimerList();
+ }
+ }
+
+ /* Enable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_ENABLE( phrtc );
+
+ HAL_NVIC_EnableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Enable NVIC */
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+
+ return;
+}
+
+void HW_TS_Start(uint8_t timer_id, uint32_t timeout_ticks)
+{
+ uint16_t time_elapsed;
+ uint8_t localcurrentrunningtimerid;
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ uint32_t primask_bit;
+#endif
+
+ if(aTimerContext[timer_id].TimerIDStatus == TimerID_Running)
+ {
+ HW_TS_Stop( timer_id );
+ }
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+#endif
+
+ HAL_NVIC_DisableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Disable NVIC */
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+
+ aTimerContext[timer_id].TimerIDStatus = TimerID_Running;
+
+ aTimerContext[timer_id].CountLeft = timeout_ticks;
+ aTimerContext[timer_id].CounterInit = timeout_ticks;
+
+ time_elapsed = linkTimer(timer_id);
+
+ localcurrentrunningtimerid = CurrentRunningTimerID;
+
+ if(PreviousRunningTimerID != localcurrentrunningtimerid)
+ {
+ RescheduleTimerList();
+ }
+ else
+ {
+ aTimerContext[timer_id].CountLeft -= time_elapsed;
+ }
+
+ /* Enable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_ENABLE( phrtc );
+
+ HAL_NVIC_EnableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Enable NVIC */
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+
+ return;
+}
+
+uint16_t HW_TS_RTC_ReadLeftTicksToCount(void)
+{
+ uint32_t primask_bit;
+ uint16_t return_value, auro_reload_value, elapsed_time_value;
+
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+
+ if((READ_BIT(RTC->CR, RTC_CR_WUTE) == (RTC_CR_WUTE)) == SET)
+ {
+ auro_reload_value = (uint32_t)(READ_BIT(RTC->WUTR, RTC_WUTR_WUT));
+
+ elapsed_time_value = ReturnTimeElapsed();
+
+ if(auro_reload_value > elapsed_time_value)
+ {
+ return_value = auro_reload_value - elapsed_time_value;
+ }
+ else
+ {
+ return_value = 0;
+ }
+ }
+ else
+ {
+ return_value = TIMER_LIST_EMPTY;
+ }
+
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+
+ return (return_value);
+}
+
+__weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack)
+{
+ pTimerCallBack();
+
+ return;
+}
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/hw_uart.c
new file mode 100644
index 000000000..9a553610d
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/hw_uart.c
@@ -0,0 +1,318 @@
+/**
+ ******************************************************************************
+ * File Name : Src/hw_uart.c
+ * Description : HW UART source file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "hw_conf.h"
+#if (CFG_HW_LPUART1_ENABLED == 1)
+extern UART_HandleTypeDef hlpuart1;
+#endif
+#if (CFG_HW_USART1_ENABLED == 1)
+extern UART_HandleTypeDef huart1;
+#endif
+
+/* Macros --------------------------------------------------------------------*/
+#define HW_UART_RX_IT(__HANDLE__, __USART_BASE__) \
+ do{ \
+ HW_##__HANDLE__##RxCb = cb; \
+ (__HANDLE__).Instance = (__USART_BASE__); \
+ HAL_UART_Receive_IT(&(__HANDLE__), p_data, size); \
+ } while(0)
+
+#define HW_UART_TX_IT(__HANDLE__, __USART_BASE__) \
+ do{ \
+ HW_##__HANDLE__##TxCb = cb; \
+ (__HANDLE__).Instance = (__USART_BASE__); \
+ HAL_UART_Transmit_IT(&(__HANDLE__), p_data, size); \
+ } while(0)
+
+#define HW_UART_TX(__HANDLE__, __USART_BASE__) \
+ do{ \
+ (__HANDLE__).Instance = (__USART_BASE__); \
+ hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
+ } while(0)
+
+/* Variables -----------------------------------------------------------------*/
+#if (CFG_HW_USART1_ENABLED == 1)
+#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
+ DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
+#endif
+ void (*HW_huart1RxCb)(void);
+ void (*HW_huart1TxCb)(void);
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
+ DMA_HandleTypeDef HW_hdma_hlpuart1_tx ={0};
+#endif
+ void (*HW_hlpuart1RxCb)(void);
+ void (*HW_hlpuart1TxCb)(void);
+#endif
+
+void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HW_UART_RX_IT(huart1, USART1);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HW_UART_RX_IT(hlpuart1, LPUART1);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HW_UART_TX_IT(huart1, USART1);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HW_UART_TX_IT(hlpuart1, LPUART1);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
+{
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
+
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HW_UART_TX(huart1, USART1);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HW_UART_TX(hlpuart1, LPUART1);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ switch (hal_status)
+ {
+ case HAL_OK:
+ hw_status = hw_uart_ok;
+ break;
+
+ case HAL_ERROR:
+ hw_status = hw_uart_error;
+ break;
+
+ case HAL_BUSY:
+ hw_status = hw_uart_busy;
+ break;
+
+ case HAL_TIMEOUT:
+ hw_status = hw_uart_to;
+ break;
+
+ default:
+ break;
+ }
+
+ return hw_status;
+}
+
+hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
+
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HW_huart1TxCb = cb;
+ huart1.Instance = USART1;
+ hal_status = HAL_UART_Transmit_DMA(&huart1, p_data, size);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HW_hlpuart1TxCb = cb;
+ hlpuart1.Instance = LPUART1;
+ hal_status = HAL_UART_Transmit_DMA(&hlpuart1, p_data, size);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ switch (hal_status)
+ {
+ case HAL_OK:
+ hw_status = hw_uart_ok;
+ break;
+
+ case HAL_ERROR:
+ hw_status = hw_uart_error;
+ break;
+
+ case HAL_BUSY:
+ hw_status = hw_uart_busy;
+ break;
+
+ case HAL_TIMEOUT:
+ hw_status = hw_uart_to;
+ break;
+
+ default:
+ break;
+ }
+
+ return hw_status;
+}
+
+void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id)
+{
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HAL_UART_IRQHandler(&huart1);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HAL_UART_IRQHandler(&hlpuart1);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
+{
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
+ case hw_uart1:
+ HAL_DMA_IRQHandler(huart1.hdmatx);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
+ case hw_lpuart1:
+ HAL_DMA_IRQHandler(hlpuart1.hdmatx);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
+{
+ switch ((uint32_t)huart->Instance)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case (uint32_t)USART1:
+ if(HW_huart1RxCb)
+ {
+ HW_huart1RxCb();
+ }
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case (uint32_t)LPUART1:
+ if(HW_hlpuart1RxCb)
+ {
+ HW_hlpuart1RxCb();
+ }
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
+{
+ switch ((uint32_t)huart->Instance)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case (uint32_t)USART1:
+ if(HW_huart1TxCb)
+ {
+ HW_huart1TxCb();
+ }
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case (uint32_t)LPUART1:
+ if(HW_hlpuart1TxCb)
+ {
+ HW_hlpuart1TxCb();
+ }
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/main.c
new file mode 100644
index 000000000..00e011ffa
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/main.c
@@ -0,0 +1,618 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file : main.c
+ * @brief : Main program body
+ *
+ @verbatim
+ ==============================================================================
+ ##### IMPORTANT NOTE #####
+ ==============================================================================
+
+ This application requests having the stm32wb5x_Thread_FTD_fw.bin binary
+ flashed on the Wireless Coprocessor.
+ If it is not the case, you need to use STM32CubeProgrammer to load the appropriate
+ binary.
+
+ All available binaries are located under following directory:
+ /Projects/STM32_Copro_Wireless_Binaries
+
+ Refer to UM2237 to learn how to use/install STM32CubeProgrammer.
+ Refer to /Projects/STM32_Copro_Wireless_Binaries/ReleaseNote.html for the
+ detailed procedure to change the Wireless Coprocessor binary.
+
+ @endverbatim
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+#include "app_entry.h"
+#include "app_common.h"
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+#include "stm32_lpm.h"
+#include "stm32_seq.h"
+#include "dbg_trace.h"
+#include "hw_conf.h"
+#include "otp.h"
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN PTD */
+
+/* USER CODE END PTD */
+
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN PD */
+
+/* USER CODE END PD */
+
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private variables ---------------------------------------------------------*/
+UART_HandleTypeDef hlpuart1;
+UART_HandleTypeDef huart1;
+DMA_HandleTypeDef hdma_lpuart1_tx;
+DMA_HandleTypeDef hdma_usart1_tx;
+
+RTC_HandleTypeDef hrtc;
+
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+void SystemClock_Config(void);
+static void MX_GPIO_Init(void);
+static void MX_DMA_Init(void);
+void MX_LPUART1_UART_Init(void);
+void MX_USART1_UART_Init(void);
+static void MX_RF_Init(void);
+static void MX_RTC_Init(void);
+/* USER CODE BEGIN PFP */
+void PeriphClock_Config(void);
+static void Reset_Device( void );
+static void Reset_IPCC( void );
+static void Reset_BackupDomain( void );
+static void Init_Exti( void );
+static void Config_HSE(void);
+/* USER CODE END PFP */
+
+/* Private user code ---------------------------------------------------------*/
+/* USER CODE BEGIN 0 */
+
+/* USER CODE END 0 */
+
+/**
+ * @brief The application entry point.
+ * @retval int
+ */
+int main(void)
+{
+ /* USER CODE BEGIN 1 */
+
+ /* USER CODE END 1 */
+
+
+ /* MCU Configuration--------------------------------------------------------*/
+
+ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
+ HAL_Init();
+
+ /* USER CODE BEGIN Init */
+ Reset_Device();
+ Config_HSE();
+ /* USER CODE END Init */
+
+ /* Configure the system clock */
+ SystemClock_Config();
+
+ /* USER CODE BEGIN SysInit */
+ PeriphClock_Config();
+ Init_Exti(); /**< Configure the system Power Mode */
+ /* USER CODE END SysInit */
+
+ /* Initialize all configured peripherals */
+ MX_GPIO_Init();
+ MX_DMA_Init();
+ MX_RF_Init();
+ MX_RTC_Init();
+ /* USER CODE BEGIN 2 */
+
+ /* USER CODE END 2 */
+
+ /* Init code for STM32_WPAN */
+ APPE_Init();
+
+ /* Infinite loop */
+ /* USER CODE BEGIN WHILE */
+ while (1)
+ {
+ UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
+ /* USER CODE END WHILE */
+
+ /* USER CODE BEGIN 3 */
+ }
+ /* USER CODE END 3 */
+}
+
+/**
+ * @brief System Clock Configuration
+ * @retval None
+ */
+void SystemClock_Config(void)
+{
+ RCC_OscInitTypeDef RCC_OscInitStruct = {0};
+ RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
+ RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
+
+ /** Configure LSE Drive Capability
+ */
+ __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
+ /** Configure the main internal regulator output voltage
+ */
+ __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
+ /** Initializes the CPU, AHB and APB busses clocks
+ */
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE
+ |RCC_OSCILLATORTYPE_LSE;
+ RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ RCC_OscInitStruct.LSEState = RCC_LSE_ON;
+ RCC_OscInitStruct.HSIState = RCC_HSI_ON;
+ RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
+ RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
+ if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /** Configure the SYSCLKSource, HCLK, PCLK1 and PCLK2 clocks dividers
+ */
+ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK4|RCC_CLOCKTYPE_HCLK2
+ |RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
+ |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
+ RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSE;
+ RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
+ RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
+ RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
+ RCC_ClkInitStruct.AHBCLK2Divider = RCC_SYSCLK_DIV1;
+ RCC_ClkInitStruct.AHBCLK4Divider = RCC_SYSCLK_DIV1;
+
+ if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /** Initializes the peripherals clocks
+ */
+ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_SMPS|RCC_PERIPHCLK_RFWAKEUP
+ |RCC_PERIPHCLK_RTC|RCC_PERIPHCLK_USART1
+ |RCC_PERIPHCLK_LPUART1;
+ PeriphClkInitStruct.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2;
+ PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1;
+ PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
+ PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSE;
+ PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSE;
+ PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE0;
+
+ if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
+ {
+ Error_Handler();
+ }
+}
+
+/**
+ * @brief LPUART1 Initialization Function
+ * @param None
+ * @retval None
+ */
+void MX_LPUART1_UART_Init(void)
+{
+
+ /* USER CODE BEGIN LPUART1_Init 0 */
+
+ /* USER CODE END LPUART1_Init 0 */
+
+ /* USER CODE BEGIN LPUART1_Init 1 */
+
+ /* USER CODE END LPUART1_Init 1 */
+ hlpuart1.Instance = LPUART1;
+ hlpuart1.Init.BaudRate = 115200;
+ hlpuart1.Init.WordLength = UART_WORDLENGTH_8B;
+ hlpuart1.Init.StopBits = UART_STOPBITS_1;
+ hlpuart1.Init.Parity = UART_PARITY_NONE;
+ hlpuart1.Init.Mode = UART_MODE_TX_RX;
+ hlpuart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
+ hlpuart1.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
+ hlpuart1.Init.ClockPrescaler = UART_PRESCALER_DIV1;
+ hlpuart1.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
+ hlpuart1.FifoMode = UART_FIFOMODE_DISABLE;
+ if (HAL_UART_Init(&hlpuart1) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_SetTxFifoThreshold(&hlpuart1, UART_TXFIFO_THRESHOLD_1_8) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_SetRxFifoThreshold(&hlpuart1, UART_RXFIFO_THRESHOLD_1_8) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_DisableFifoMode(&hlpuart1) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /* USER CODE BEGIN LPUART1_Init 2 */
+
+ /* USER CODE END LPUART1_Init 2 */
+
+}
+
+/**
+ * @brief USART1 Initialization Function
+ * @param None
+ * @retval None
+ */
+void MX_USART1_UART_Init(void)
+{
+
+ /* USER CODE BEGIN USART1_Init 0 */
+
+ /* USER CODE END USART1_Init 0 */
+
+ /* USER CODE BEGIN USART1_Init 1 */
+
+ /* USER CODE END USART1_Init 1 */
+ huart1.Instance = USART1;
+ huart1.Init.BaudRate = 115200;
+ huart1.Init.WordLength = UART_WORDLENGTH_8B;
+ huart1.Init.StopBits = UART_STOPBITS_1;
+ huart1.Init.Parity = UART_PARITY_NONE;
+ huart1.Init.Mode = UART_MODE_TX_RX;
+ huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
+ huart1.Init.OverSampling = UART_OVERSAMPLING_8;
+ huart1.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
+ huart1.Init.ClockPrescaler = UART_PRESCALER_DIV1;
+ huart1.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
+ if (HAL_UART_Init(&huart1) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_SetTxFifoThreshold(&huart1, UART_TXFIFO_THRESHOLD_1_8) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_SetRxFifoThreshold(&huart1, UART_RXFIFO_THRESHOLD_1_8) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_DisableFifoMode(&huart1) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /* USER CODE BEGIN USART1_Init 2 */
+
+ /* USER CODE END USART1_Init 2 */
+
+}
+
+/**
+ * @brief RF Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_RF_Init(void)
+{
+
+ /* USER CODE BEGIN RF_Init 0 */
+
+ /* USER CODE END RF_Init 0 */
+
+ /* USER CODE BEGIN RF_Init 1 */
+
+ /* USER CODE END RF_Init 1 */
+ /* USER CODE BEGIN RF_Init 2 */
+
+ /* USER CODE END RF_Init 2 */
+
+}
+
+/**
+ * @brief RTC Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_RTC_Init(void)
+{
+
+ /* USER CODE BEGIN RTC_Init 0 */
+
+ /* USER CODE END RTC_Init 0 */
+
+ /* USER CODE BEGIN RTC_Init 1 */
+
+ /* USER CODE END RTC_Init 1 */
+ /** Initialize RTC Only
+ */
+ hrtc.Instance = RTC;
+ hrtc.Init.HourFormat = RTC_HOURFORMAT_24;
+ hrtc.Init.AsynchPrediv = CFG_RTC_ASYNCH_PRESCALER;
+ hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
+ hrtc.Init.OutPut = RTC_OUTPUT_DISABLE;
+ hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH;
+ hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;
+ if (HAL_RTC_Init(&hrtc) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /* USER CODE BEGIN RTC_Init 2 */
+
+ /* USER CODE END RTC_Init 2 */
+
+}
+
+/**
+ * Enable DMA controller clock
+ */
+static void MX_DMA_Init(void)
+{
+
+ /* DMA controller clock enable */
+ __HAL_RCC_DMAMUX1_CLK_ENABLE();
+ __HAL_RCC_DMA1_CLK_ENABLE();
+
+ /* DMA interrupt init */
+ /* DMA1_Channel1_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(DMA1_Channel1_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(DMA1_Channel1_IRQn);
+ /* DMA1_Channel2_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(DMA1_Channel2_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(DMA1_Channel2_IRQn);
+
+}
+
+/**
+ * @brief GPIO Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_GPIO_Init(void)
+{
+
+ /* GPIO Ports Clock Enable */
+ __HAL_RCC_GPIOC_CLK_ENABLE();
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+
+}
+
+/* USER CODE BEGIN 4 */
+void PeriphClock_Config(void)
+{
+ #if (CFG_USB_INTERFACE_ENABLE != 0)
+ RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
+ RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
+ LL_RCC_HSI48_Enable();
+
+ while(!LL_RCC_HSI48_IsReady());
+
+ /* Select HSI48 as USB clock source */
+ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB;
+ PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_HSI48;
+ HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
+
+ /*Configure the clock recovery system (CRS)**********************************/
+
+ /* Enable CRS Clock */
+ __HAL_RCC_CRS_CLK_ENABLE();
+
+ /* Default Synchro Signal division factor (not divided) */
+ RCC_CRSInitStruct.Prescaler = RCC_CRS_SYNC_DIV1;
+
+ /* Set the SYNCSRC[1:0] bits according to CRS_Source value */
+ RCC_CRSInitStruct.Source = RCC_CRS_SYNC_SOURCE_USB;
+
+ /* HSI48 is synchronized with USB SOF at 1KHz rate */
+ RCC_CRSInitStruct.ReloadValue = RCC_CRS_RELOADVALUE_DEFAULT;
+ RCC_CRSInitStruct.ErrorLimitValue = RCC_CRS_ERRORLIMIT_DEFAULT;
+
+ RCC_CRSInitStruct.Polarity = RCC_CRS_SYNC_POLARITY_RISING;
+
+ /* Set the TRIM[5:0] to the default value*/
+ RCC_CRSInitStruct.HSI48CalibrationValue = RCC_CRS_HSI48CALIBRATION_DEFAULT;
+
+ /* Start automatic synchronization */
+ HAL_RCCEx_CRSConfig(&RCC_CRSInitStruct);
+#endif
+
+ return;
+}
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+
+static void Config_HSE(void)
+{
+ OTP_ID0_t * p_otp;
+
+ /**
+ * Read HSE_Tuning from OTP
+ */
+ p_otp = (OTP_ID0_t *) OTP_Read(0);
+ if (p_otp)
+ {
+ LL_RCC_HSE_SetCapacitorTuning(p_otp->hse_tuning);
+ }
+
+ return;
+}
+
+
+static void Reset_Device( void )
+{
+#if ( CFG_HW_RESET_BY_FW == 1 )
+ Reset_BackupDomain();
+
+ Reset_IPCC();
+#endif
+
+ return;
+}
+
+static void Reset_IPCC( void )
+{
+ LL_AHB3_GRP1_EnableClock(LL_AHB3_GRP1_PERIPH_IPCC);
+
+ LL_C1_IPCC_ClearFlag_CHx(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C2_IPCC_ClearFlag_CHx(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C1_IPCC_DisableTransmitChannel(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C2_IPCC_DisableTransmitChannel(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C1_IPCC_DisableReceiveChannel(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C2_IPCC_DisableReceiveChannel(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ return;
+}
+
+static void Reset_BackupDomain( void )
+{
+ if ((LL_RCC_IsActiveFlag_PINRST() != FALSE) && (LL_RCC_IsActiveFlag_SFTRST() == FALSE))
+ {
+ HAL_PWR_EnableBkUpAccess(); /**< Enable access to the RTC registers */
+
+ /**
+ * Write twice the value to flush the APB-AHB bridge
+ * This bit shall be written in the register before writing the next one
+ */
+ HAL_PWR_EnableBkUpAccess();
+
+ __HAL_RCC_BACKUPRESET_FORCE();
+ __HAL_RCC_BACKUPRESET_RELEASE();
+ }
+
+ return;
+}
+
+
+static void Init_Exti( void )
+{
+ /**< Disable all wakeup interrupt on CPU1 except IPCC(36), HSEM(38) */
+ LL_EXTI_DisableIT_0_31(~0);
+ LL_EXTI_DisableIT_32_63( (~0) & (~(LL_EXTI_LINE_36 | LL_EXTI_LINE_38)) );
+
+ return;
+}
+
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+void HAL_Delay(uint32_t Delay)
+{
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
+
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
+}
+/* USER CODE END 4 */
+
+/**
+ * @brief This function is executed in case of error occurrence.
+ * @retval None
+ */
+void Error_Handler(void)
+{
+ /* USER CODE BEGIN Error_Handler_Debug */
+ /* User can add his own implementation to report the HAL error return state */
+
+ /* USER CODE END Error_Handler_Debug */
+}
+
+#ifdef USE_FULL_ASSERT
+/**
+ * @brief Reports the name of the source file and the source line number
+ * where the assert_param error has occurred.
+ * @param file: pointer to the source file name
+ * @param line: assert_param error line source number
+ * @retval None
+ */
+void assert_failed(uint8_t *file, uint32_t line)
+{
+ /* USER CODE BEGIN 6 */
+ /* User can add his own implementation to report the file name and line number,
+ tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
+ /* USER CODE END 6 */
+}
+#endif /* USE_FULL_ASSERT */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/stm32_lpm_if.c
new file mode 100644
index 000000000..f024b61e3
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/stm32_lpm_if.c
@@ -0,0 +1,275 @@
+/* USER CODE BEGIN Header */
+/**
+ ***************************************************************************************
+ * File Name : stm32_lpm_if.c
+ * Description : Low layer function to enter/exit low power modes (stop, sleep).
+ ***************************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "stm32_lpm_if.h"
+#include "stm32_lpm.h"
+#include "app_conf.h"
+/* USER CODE BEGIN include */
+
+/* USER CODE END include */
+
+/* Exported variables --------------------------------------------------------*/
+const struct UTIL_LPM_Driver_s UTIL_PowerDriver =
+{
+ PWR_EnterSleepMode,
+ PWR_ExitSleepMode,
+
+ PWR_EnterStopMode,
+ PWR_ExitStopMode,
+
+ PWR_EnterOffMode,
+ PWR_ExitOffMode,
+};
+
+/* Private function prototypes -----------------------------------------------*/
+static void Switch_On_HSI( void );
+/* USER CODE BEGIN Private_Function_Prototypes */
+
+/* USER CODE END Private_Function_Prototypes */
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN Private_Typedef */
+
+/* USER CODE END Private_Typedef */
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN Private_Define */
+
+/* USER CODE END Private_Define */
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN Private_Macro */
+
+/* USER CODE END Private_Macro */
+/* Private variables ---------------------------------------------------------*/
+/* USER CODE BEGIN Private_Variables */
+
+/* USER CODE END Private_Variables */
+
+/* Functions Definition ------------------------------------------------------*/
+/**
+ * @brief Enters Low Power Off Mode
+ * @param none
+ * @retval none
+ */
+void PWR_EnterOffMode( void )
+{
+/* USER CODE BEGIN PWR_EnterOffMode */
+ /************************************************************************************
+ * ENTER OFF MODE
+ ***********************************************************************************/
+ /*
+ * There is no risk to clear all the WUF here because in the current implementation, this API is called
+ * in critical section. If an interrupt occurs while in that critical section before that point,
+ * the flag is set and will be cleared here but the system will not enter Off Mode
+ * because an interrupt is pending in the NVIC. The ISR will be executed when moving out
+ * of this critical section
+ */
+ LL_PWR_ClearFlag_WU( );
+
+ LL_PWR_SetPowerMode( LL_PWR_MODE_STANDBY );
+
+ LL_LPM_EnableDeepSleep( ); /**< Set SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+#if defined ( __CC_ARM)
+ __force_stores( );
+#endif
+
+ __WFI( );
+/* USER CODE END PWR_EnterOffMode */
+}
+
+/**
+ * @brief Exits Low Power Off Mode
+ * @param none
+ * @retval none
+ */
+void PWR_ExitOffMode( void )
+{
+/* USER CODE BEGIN PWR_ExitOffMode */
+
+/* USER CODE END PWR_ExitOffMode */
+}
+
+/**
+ * @brief Enters Low Power Stop Mode
+ * @note ARM exists the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_EnterStopMode( void )
+{
+/* USER CODE BEGIN PWR_EnterStopMode */
+ /**
+ * This function is called from CRITICAL SECTION
+ */
+ while( LL_HSEM_1StepLock( HSEM, CFG_HW_RCC_SEMID ) );
+
+ if ( ! LL_HSEM_1StepLock( HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID ) )
+ {
+ if( LL_PWR_IsActiveFlag_C2DS( ) )
+ {
+ /* Release ENTRY_STOP_MODE semaphore */
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID, 0 );
+
+ /**
+ * The switch on HSI before entering Stop Mode is required on Cut2.0
+ * It is useless from Cut2.1
+ */
+ Switch_On_HSI( );
+ }
+ }
+ else
+ {
+ /**
+ * The switch on HSI before entering Stop Mode is required on Cut2.0
+ * It is useless from Cut2.1
+ */
+ Switch_On_HSI( );
+ }
+
+ /* Release RCC semaphore */
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_RCC_SEMID, 0 );
+
+ /************************************************************************************
+ * ENTER STOP MODE
+ ***********************************************************************************/
+ LL_PWR_SetPowerMode( LL_PWR_MODE_STOP2 );
+
+ LL_LPM_EnableDeepSleep( ); /**< Set SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+#if defined ( __CC_ARM)
+ __force_stores( );
+#endif
+
+ __WFI();
+/* USER CODE END PWR_EnterStopMode */
+}
+
+/**
+ * @brief Exits Low Power Stop Mode
+ * @note Enable the pll at 32MHz
+ * @param none
+ * @retval none
+ */
+void PWR_ExitStopMode( void )
+{
+/* USER CODE BEGIN PWR_ExitStopMode */
+ /**
+ * This function is called from CRITICAL SECTION
+ */
+
+ /* Release ENTRY_STOP_MODE semaphore */
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID, 0 );
+
+ while( LL_HSEM_1StepLock( HSEM, CFG_HW_RCC_SEMID ) );
+
+ if(LL_RCC_GetSysClkSource( ) == LL_RCC_SYS_CLKSOURCE_STATUS_HSI)
+ {
+ LL_RCC_HSE_Enable( );
+ while(!LL_RCC_HSE_IsReady( ));
+ LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_HSE);
+ while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSE);
+ }
+ else
+ {
+ /**
+ * As long as the current application is fine with HSE as system clock source,
+ * there is nothing to do here
+ */
+ }
+
+ /* Release RCC semaphore */
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_RCC_SEMID, 0 );
+/* USER CODE END PWR_ExitStopMode */
+}
+
+/**
+ * @brief Enters Low Power Sleep Mode
+ * @note ARM exits the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_EnterSleepMode( void )
+{
+/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+#if defined ( __CC_ARM)
+ __force_stores();
+#endif
+
+ __WFI( );
+/* USER CODE END PWR_EnterSleepMode */
+}
+
+/**
+ * @brief Exits Low Power Sleep Mode
+ * @note ARM exits the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_ExitSleepMode( void )
+{
+/* USER CODE BEGIN PWR_ExitSleepMode */
+
+ HAL_ResumeTick();
+
+/* USER CODE END PWR_ExitSleepMode */
+}
+
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+/**
+ * @brief Switch the system clock on HSI
+ * @param none
+ * @retval none
+ */
+static void Switch_On_HSI( void )
+{
+ LL_RCC_HSI_Enable( );
+ while(!LL_RCC_HSI_IsReady( ));
+ LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
+ while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
+}
+
+/* USER CODE BEGIN Private_Functions */
+
+/* USER CODE END Private_Functions */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/stm32wbxx_hal_msp.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/stm32wbxx_hal_msp.c
new file mode 100644
index 000000000..9c338486d
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/stm32wbxx_hal_msp.c
@@ -0,0 +1,334 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : stm32wbxx_hal_msp.c
+ * Description : This file provides code for the MSP Initialization
+ * and de-Initialization codes.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+/* USER CODE BEGIN Includes */
+#include "app_conf.h"
+/* USER CODE END Includes */
+extern DMA_HandleTypeDef hdma_lpuart1_tx;
+
+extern DMA_HandleTypeDef hdma_usart1_tx;
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN TD */
+
+/* USER CODE END TD */
+
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN Define */
+
+/* USER CODE END Define */
+
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN Macro */
+
+/* USER CODE END Macro */
+
+/* Private variables ---------------------------------------------------------*/
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+/* USER CODE BEGIN PFP */
+
+/* USER CODE END PFP */
+
+/* External functions --------------------------------------------------------*/
+/* USER CODE BEGIN ExternalFunctions */
+
+/* USER CODE END ExternalFunctions */
+
+/* USER CODE BEGIN 0 */
+
+/* USER CODE END 0 */
+/**
+ * Initializes the Global MSP.
+ */
+void HAL_MspInit(void)
+{
+ /* USER CODE BEGIN MspInit 0 */
+
+ /* USER CODE END MspInit 0 */
+
+ __HAL_RCC_HSEM_CLK_ENABLE();
+
+ /* System interrupt init*/
+
+ /* Peripheral interrupt init */
+ /* PVD_PVM_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(PVD_PVM_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(PVD_PVM_IRQn);
+ /* FLASH_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(FLASH_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(FLASH_IRQn);
+ /* RCC_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(RCC_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(RCC_IRQn);
+ /* C2SEV_PWR_C2H_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(C2SEV_PWR_C2H_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(C2SEV_PWR_C2H_IRQn);
+ /* PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn);
+ /* HSEM_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(HSEM_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(HSEM_IRQn);
+ /* FPU_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(FPU_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(FPU_IRQn);
+
+ /* USER CODE BEGIN MspInit 1 */
+
+ /* USER CODE END MspInit 1 */
+}
+
+/**
+* @brief UART MSP Initialization
+* This function configures the hardware resources used in this example
+* @param huart: UART handle pointer
+* @retval None
+*/
+void HAL_UART_MspInit(UART_HandleTypeDef* huart)
+{
+ GPIO_InitTypeDef GPIO_InitStruct = {0};
+ if(huart->Instance==LPUART1)
+ {
+ /* USER CODE BEGIN LPUART1_MspInit 0 */
+
+ /* USER CODE END LPUART1_MspInit 0 */
+ /* Peripheral clock enable */
+ __HAL_RCC_LPUART1_CLK_ENABLE();
+
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ /**LPUART1 GPIO Configuration
+ PA2 ------> LPUART1_TX
+ PA3 ------> LPUART1_RX
+ */
+ GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_3;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ GPIO_InitStruct.Alternate = GPIO_AF8_LPUART1;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+
+ /* LPUART1 DMA Init */
+ /* LPUART1_TX Init */
+ hdma_lpuart1_tx.Instance = DMA1_Channel1;
+ hdma_lpuart1_tx.Init.Request = DMA_REQUEST_LPUART1_TX;
+ hdma_lpuart1_tx.Init.Direction = DMA_MEMORY_TO_PERIPH;
+ hdma_lpuart1_tx.Init.PeriphInc = DMA_PINC_DISABLE;
+ hdma_lpuart1_tx.Init.MemInc = DMA_MINC_ENABLE;
+ hdma_lpuart1_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
+ hdma_lpuart1_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
+ hdma_lpuart1_tx.Init.Mode = DMA_NORMAL;
+ hdma_lpuart1_tx.Init.Priority = DMA_PRIORITY_LOW;
+ if (HAL_DMA_Init(&hdma_lpuart1_tx) != HAL_OK)
+ {
+ Error_Handler();
+ }
+
+ __HAL_LINKDMA(huart,hdmatx,hdma_lpuart1_tx);
+
+ /* LPUART1 interrupt Init */
+ HAL_NVIC_SetPriority(LPUART1_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(LPUART1_IRQn);
+ /* USER CODE BEGIN LPUART1_MspInit 1 */
+
+ /* USER CODE END LPUART1_MspInit 1 */
+ }
+ else if(huart->Instance==USART1)
+ {
+ /* USER CODE BEGIN USART1_MspInit 0 */
+
+ /* USER CODE END USART1_MspInit 0 */
+ /* Peripheral clock enable */
+ __HAL_RCC_USART1_CLK_ENABLE();
+
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+ /**USART1 GPIO Configuration
+ PA11 ------> USART1_CTS
+ PB6 ------> USART1_TX
+ PB7 ------> USART1_RX
+ */
+ GPIO_InitStruct.Pin = GPIO_PIN_11;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+
+ GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
+ HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
+
+ /* USART1 DMA Init */
+ /* USART1_TX Init */
+ hdma_usart1_tx.Instance = DMA1_Channel2;
+ hdma_usart1_tx.Init.Request = DMA_REQUEST_USART1_TX;
+ hdma_usart1_tx.Init.Direction = DMA_MEMORY_TO_PERIPH;
+ hdma_usart1_tx.Init.PeriphInc = DMA_PINC_DISABLE;
+ hdma_usart1_tx.Init.MemInc = DMA_MINC_ENABLE;
+ hdma_usart1_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
+ hdma_usart1_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
+ hdma_usart1_tx.Init.Mode = DMA_NORMAL;
+ hdma_usart1_tx.Init.Priority = DMA_PRIORITY_LOW;
+ if (HAL_DMA_Init(&hdma_usart1_tx) != HAL_OK)
+ {
+ Error_Handler();
+ }
+
+ __HAL_LINKDMA(huart,hdmatx,hdma_usart1_tx);
+
+ /* USART1 interrupt Init */
+ HAL_NVIC_SetPriority(USART1_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(USART1_IRQn);
+ /* USER CODE BEGIN USART1_MspInit 1 */
+
+ /* USER CODE END USART1_MspInit 1 */
+ }
+
+}
+
+/**
+* @brief UART MSP De-Initialization
+* This function freeze the hardware resources used in this example
+* @param huart: UART handle pointer
+* @retval None
+*/
+void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
+{
+ if(huart->Instance==LPUART1)
+ {
+ /* USER CODE BEGIN LPUART1_MspDeInit 0 */
+
+ /* USER CODE END LPUART1_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_LPUART1_CLK_DISABLE();
+
+ /**LPUART1 GPIO Configuration
+ PA2 ------> LPUART1_TX
+ PA3 ------> LPUART1_RX
+ */
+ HAL_GPIO_DeInit(GPIOA, GPIO_PIN_2|GPIO_PIN_3);
+
+ /* LPUART1 DMA DeInit */
+ HAL_DMA_DeInit(huart->hdmatx);
+
+ /* LPUART1 interrupt DeInit */
+ HAL_NVIC_DisableIRQ(LPUART1_IRQn);
+ /* USER CODE BEGIN LPUART1_MspDeInit 1 */
+
+ /* USER CODE END LPUART1_MspDeInit 1 */
+ }
+ else if(huart->Instance==USART1)
+ {
+ /* USER CODE BEGIN USART1_MspDeInit 0 */
+
+ /* USER CODE END USART1_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_USART1_CLK_DISABLE();
+
+ /**USART1 GPIO Configuration
+ PA11 ------> USART1_CTS
+ PB6 ------> USART1_TX
+ PB7 ------> USART1_RX
+ */
+ HAL_GPIO_DeInit(GPIOA, GPIO_PIN_11);
+
+ HAL_GPIO_DeInit(GPIOB, GPIO_PIN_6|GPIO_PIN_7);
+
+ /* USART1 DMA DeInit */
+ HAL_DMA_DeInit(huart->hdmatx);
+
+ /* USART1 interrupt DeInit */
+ HAL_NVIC_DisableIRQ(USART1_IRQn);
+ /* USER CODE BEGIN USART1_MspDeInit 1 */
+
+ /* USER CODE END USART1_MspDeInit 1 */
+ }
+
+}
+
+/**
+* @brief RTC MSP Initialization
+* This function configures the hardware resources used in this example
+* @param hrtc: RTC handle pointer
+* @retval None
+*/
+void HAL_RTC_MspInit(RTC_HandleTypeDef* hrtc)
+{
+ if(hrtc->Instance==RTC)
+ {
+ /* USER CODE BEGIN RTC_MspInit 0 */
+ HAL_PWR_EnableBkUpAccess(); /**< Enable access to the RTC registers */
+
+ /**
+ * Write twice the value to flush the APB-AHB bridge
+ * This bit shall be written in the register before writing the next one
+ */
+ HAL_PWR_EnableBkUpAccess();
+
+ __HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSE); /**< Select LSE as RTC Input */
+
+ /* USER CODE END RTC_MspInit 0 */
+ /* Peripheral clock enable */
+ __HAL_RCC_RTC_ENABLE();
+ /* USER CODE BEGIN RTC_MspInit 1 */
+
+ MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* USER CODE END RTC_MspInit 1 */
+ }
+
+}
+
+/**
+* @brief RTC MSP De-Initialization
+* This function freeze the hardware resources used in this example
+* @param hrtc: RTC handle pointer
+* @retval None
+*/
+void HAL_RTC_MspDeInit(RTC_HandleTypeDef* hrtc)
+{
+ if(hrtc->Instance==RTC)
+ {
+ /* USER CODE BEGIN RTC_MspDeInit 0 */
+
+ /* USER CODE END RTC_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_RTC_DISABLE();
+ /* USER CODE BEGIN RTC_MspDeInit 1 */
+
+ /* USER CODE END RTC_MspDeInit 1 */
+ }
+
+}
+
+/* USER CODE BEGIN 1 */
+
+/* USER CODE END 1 */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/stm32wbxx_it.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/stm32wbxx_it.c
new file mode 100644
index 000000000..b0026e595
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/stm32wbxx_it.c
@@ -0,0 +1,382 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file stm32wbxx_it.c
+ * @brief Interrupt Service Routines.
+ *******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+#include "stm32wbxx_it.h"
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+#include "hw.h"
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN TD */
+
+/* USER CODE END TD */
+
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN PD */
+
+/* USER CODE END PD */
+
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private variables ---------------------------------------------------------*/
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+/* USER CODE BEGIN PFP */
+
+/* USER CODE END PFP */
+
+/* Private user code ---------------------------------------------------------*/
+/* USER CODE BEGIN 0 */
+
+/* USER CODE END 0 */
+
+/* External variables --------------------------------------------------------*/
+extern DMA_HandleTypeDef hdma_lpuart1_tx;
+extern DMA_HandleTypeDef hdma_usart1_tx;
+extern UART_HandleTypeDef hlpuart1;
+extern UART_HandleTypeDef huart1;
+/* USER CODE BEGIN EV */
+
+/* USER CODE END EV */
+
+/******************************************************************************/
+/* Cortex Processor Interruption and Exception Handlers */
+/******************************************************************************/
+/**
+ * @brief This function handles Non maskable interrupt.
+ */
+void NMI_Handler(void)
+{
+ /* USER CODE BEGIN NonMaskableInt_IRQn 0 */
+
+ /* USER CODE END NonMaskableInt_IRQn 0 */
+ /* USER CODE BEGIN NonMaskableInt_IRQn 1 */
+
+ /* USER CODE END NonMaskableInt_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Hard fault interrupt.
+ */
+void HardFault_Handler(void)
+{
+ /* USER CODE BEGIN HardFault_IRQn 0 */
+
+ /* USER CODE END HardFault_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_HardFault_IRQn 0 */
+ /* USER CODE END W1_HardFault_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles Memory management fault.
+ */
+void MemManage_Handler(void)
+{
+ /* USER CODE BEGIN MemoryManagement_IRQn 0 */
+
+ /* USER CODE END MemoryManagement_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */
+ /* USER CODE END W1_MemoryManagement_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles Prefetch fault, memory access fault.
+ */
+void BusFault_Handler(void)
+{
+ /* USER CODE BEGIN BusFault_IRQn 0 */
+
+ /* USER CODE END BusFault_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_BusFault_IRQn 0 */
+ /* USER CODE END W1_BusFault_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles Undefined instruction or illegal state.
+ */
+void UsageFault_Handler(void)
+{
+ /* USER CODE BEGIN UsageFault_IRQn 0 */
+
+ /* USER CODE END UsageFault_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_UsageFault_IRQn 0 */
+ /* USER CODE END W1_UsageFault_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles System service call via SWI instruction.
+ */
+void SVC_Handler(void)
+{
+ /* USER CODE BEGIN SVCall_IRQn 0 */
+
+ /* USER CODE END SVCall_IRQn 0 */
+ /* USER CODE BEGIN SVCall_IRQn 1 */
+
+ /* USER CODE END SVCall_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Debug monitor.
+ */
+void DebugMon_Handler(void)
+{
+ /* USER CODE BEGIN DebugMonitor_IRQn 0 */
+
+ /* USER CODE END DebugMonitor_IRQn 0 */
+ /* USER CODE BEGIN DebugMonitor_IRQn 1 */
+
+ /* USER CODE END DebugMonitor_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Pendable request for system service.
+ */
+void PendSV_Handler(void)
+{
+ /* USER CODE BEGIN PendSV_IRQn 0 */
+
+ /* USER CODE END PendSV_IRQn 0 */
+ /* USER CODE BEGIN PendSV_IRQn 1 */
+
+ /* USER CODE END PendSV_IRQn 1 */
+}
+
+/**
+ * @brief This function handles System tick timer.
+ */
+void SysTick_Handler(void)
+{
+ /* USER CODE BEGIN SysTick_IRQn 0 */
+
+ /* USER CODE END SysTick_IRQn 0 */
+ HAL_IncTick();
+ /* USER CODE BEGIN SysTick_IRQn 1 */
+
+ /* USER CODE END SysTick_IRQn 1 */
+}
+
+/******************************************************************************/
+/* STM32WBxx Peripheral Interrupt Handlers */
+/* Add here the Interrupt Handlers for the used peripherals. */
+/* For the available peripheral interrupt handler names, */
+/* please refer to the startup file (startup_stm32wbxx.s). */
+/******************************************************************************/
+
+/**
+ * @brief This function handles PVD/PVM0/PVM2 interrupts through EXTI lines 16/31/33.
+ */
+void PVD_PVM_IRQHandler(void)
+{
+ /* USER CODE BEGIN PVD_PVM_IRQn 0 */
+
+ /* USER CODE END PVD_PVM_IRQn 0 */
+ HAL_PWREx_PVD_PVM_IRQHandler();
+ /* USER CODE BEGIN PVD_PVM_IRQn 1 */
+
+ /* USER CODE END PVD_PVM_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Flash global interrupt.
+ */
+void FLASH_IRQHandler(void)
+{
+ /* USER CODE BEGIN FLASH_IRQn 0 */
+
+ /* USER CODE END FLASH_IRQn 0 */
+ HAL_FLASH_IRQHandler();
+ /* USER CODE BEGIN FLASH_IRQn 1 */
+
+ /* USER CODE END FLASH_IRQn 1 */
+}
+
+/**
+ * @brief This function handles RCC global interrupt.
+ */
+void RCC_IRQHandler(void)
+{
+ /* USER CODE BEGIN RCC_IRQn 0 */
+
+ /* USER CODE END RCC_IRQn 0 */
+ /* USER CODE BEGIN RCC_IRQn 1 */
+
+ /* USER CODE END RCC_IRQn 1 */
+}
+
+/**
+ * @brief This function handles DMA1 channel1 global interrupt.
+ */
+void DMA1_Channel1_IRQHandler(void)
+{
+ /* USER CODE BEGIN DMA1_Channel1_IRQn 0 */
+
+ /* USER CODE END DMA1_Channel1_IRQn 0 */
+ HAL_DMA_IRQHandler(&hdma_lpuart1_tx);
+ /* USER CODE BEGIN DMA1_Channel1_IRQn 1 */
+
+ /* USER CODE END DMA1_Channel1_IRQn 1 */
+}
+
+/**
+ * @brief This function handles DMA1 channel2 global interrupt.
+ */
+void DMA1_Channel2_IRQHandler(void)
+{
+ /* USER CODE BEGIN DMA1_Channel2_IRQn 0 */
+
+ /* USER CODE END DMA1_Channel2_IRQn 0 */
+ HAL_DMA_IRQHandler(&hdma_usart1_tx);
+ /* USER CODE BEGIN DMA1_Channel2_IRQn 1 */
+
+ /* USER CODE END DMA1_Channel2_IRQn 1 */
+}
+
+/**
+ * @brief This function handles CPU2 SEV interrupt through EXTI line 40 and PWR CPU2 HOLD wake-up interrupt.
+ */
+void C2SEV_PWR_C2H_IRQHandler(void)
+{
+ /* USER CODE BEGIN C2SEV_PWR_C2H_IRQn 0 */
+
+ /* USER CODE END C2SEV_PWR_C2H_IRQn 0 */
+ /* USER CODE BEGIN C2SEV_PWR_C2H_IRQn 1 */
+
+ /* USER CODE END C2SEV_PWR_C2H_IRQn 1 */
+}
+
+/**
+ * @brief This function handles USART1 global interrupt.
+ */
+void USART1_IRQHandler(void)
+{
+ /* USER CODE BEGIN USART1_IRQn 0 */
+
+ /* USER CODE END USART1_IRQn 0 */
+ HAL_UART_IRQHandler(&huart1);
+ /* USER CODE BEGIN USART1_IRQn 1 */
+
+ /* USER CODE END USART1_IRQn 1 */
+}
+
+/**
+ * @brief This function handles LPUART1 global interrupt.
+ */
+void LPUART1_IRQHandler(void)
+{
+ /* USER CODE BEGIN LPUART1_IRQn 0 */
+
+ /* USER CODE END LPUART1_IRQn 0 */
+ HAL_UART_IRQHandler(&hlpuart1);
+ /* USER CODE BEGIN LPUART1_IRQn 1 */
+
+ /* USER CODE END LPUART1_IRQn 1 */
+}
+
+/**
+ * @brief This function handles PWR switching on the fly, end of BLE activity, end of 802.15.4 activity, end of critical radio phase interrupt.
+ */
+void PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler(void)
+{
+ /* USER CODE BEGIN PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn 0 */
+
+ /* USER CODE END PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn 0 */
+ /* USER CODE BEGIN PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn 1 */
+
+ /* USER CODE END PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn 1 */
+}
+
+/**
+ * @brief This function handles HSEM global interrupt.
+ */
+void HSEM_IRQHandler(void)
+{
+ /* USER CODE BEGIN HSEM_IRQn 0 */
+
+ /* USER CODE END HSEM_IRQn 0 */
+ HAL_HSEM_IRQHandler();
+ /* USER CODE BEGIN HSEM_IRQn 1 */
+
+ /* USER CODE END HSEM_IRQn 1 */
+}
+
+/**
+ * @brief This function handles FPU global interrupt.
+ */
+void FPU_IRQHandler(void)
+{
+ /* USER CODE BEGIN FPU_IRQn 0 */
+
+ /* USER CODE END FPU_IRQn 0 */
+ /* USER CODE BEGIN FPU_IRQn 1 */
+
+ /* USER CODE END FPU_IRQn 1 */
+}
+
+/* USER CODE BEGIN 1 */
+void RTC_WKUP_IRQHandler(void)
+{
+ HW_TS_RTC_Wakeup_Handler();
+}
+
+/**
+ * @brief This function handles EXTI4_IRQ Handler.
+ * @param None
+ * @retval None
+ */
+void EXTI4_IRQHandler(void)
+{
+ HAL_GPIO_EXTI_IRQHandler(BUTTON_SW1_PIN);
+}
+
+void IPCC_C1_TX_IRQHandler(void)
+{
+ HW_IPCC_Tx_Handler();
+
+ return;
+}
+void IPCC_C1_RX_IRQHandler(void)
+{
+ HW_IPCC_Rx_Handler();
+ return;
+}
+/* USER CODE END 1 */
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/stm_logging.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/stm_logging.c
new file mode 100644
index 000000000..47a43a019
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/stm_logging.c
@@ -0,0 +1,215 @@
+/**
+ ******************************************************************************
+ * File Name : stm_logging.c
+ * Description : This file contains all the defines and functions used
+ * for logging on Application examples.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/**
+ * @file
+ * This file implements logging functions to be used in Application examples.
+ *
+ */
+
+#include <ctype.h>
+#include <inttypes.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <string.h>
+
+#include "app_conf.h"
+#include "stm_logging.h"
+
+#define LOG_PARSE_BUFFER_SIZE 256U
+
+#define LOG_TIMESTAMP_ENABLE 0
+#define LOG_REGION_ENABLE 1U
+#define LOG_RTT_COLOR_ENABLE 1U
+
+#if (LOG_RTT_COLOR_ENABLE == 1U)
+#define RTT_COLOR_CODE_DEFAULT "\x1b[0m"
+#define RTT_COLOR_CODE_RED "\x1b[0;91m"
+#define RTT_COLOR_CODE_GREEN "\x1b[0;92m"
+#define RTT_COLOR_CODE_YELLOW "\x1b[0;93m"
+#define RTT_COLOR_CODE_CYAN "\x1b[0;96m"
+
+#else /* LOG_RTT_COLOR_ENABLE == 1 */
+#define RTT_COLOR_CODE_DEFAULT ""
+#define RTT_COLOR_CODE_RED ""
+#define RTT_COLOR_CODE_GREEN ""
+#define RTT_COLOR_CODE_YELLOW ""
+#define RTT_COLOR_CODE_CYAN ""
+#endif /* LOG_RTT_COLOR_ENABLE == 1 */
+
+
+#if (CFG_DEBUG_TRACE != 0)
+/**
+ * Function for outputting code region string.
+ *
+ * @param[inout] aLogString Pointer to log buffer.
+ * @param[in] aMaxSize Maximum size of log buffer.
+ * @param[in] otLogRegion The region ID.
+ *
+ * @returns String with a log level color value.
+ */
+static inline uint16_t logRegion(char *aLogString, uint16_t aMaxSize,
+ appliLogRegion_t aLogRegion)
+{
+ char logRegionString[30U];
+
+ switch (aLogRegion)
+ {
+ case APPLI_LOG_REGION_GENERAL:
+ strcpy(logRegionString, "[M4 APPLICATION]");
+ break;
+ case APPLI_LOG_REGION_OPENTHREAD_API:
+ strcpy(logRegionString, "[M4 OPENTHREAD API]");
+ break;
+ case APPLI_LOG_REGION_OT_API_LINK:
+ strcpy(logRegionString, "[M4 LINK API]");
+ break;
+ case APPLI_LOG_REGION_OT_API_INSTANCE:
+ strcpy(logRegionString, "[M4 INSTANCE API]");
+ break;
+ case APPLI_LOG_REGION_OT_API_MESSAGE:
+ strcpy(logRegionString, "[M4 MESSAGE API]");
+ break;
+ default:
+ strcpy(logRegionString, "[M4]");
+ break;
+ }
+
+ return snprintf(aLogString, aMaxSize, "%s ", logRegionString);
+}
+#endif /* CFG_DEBUG_TRACE */
+
+#if (LOG_RTT_COLOR_ENABLE == 1U)
+#if (CFG_DEBUG_TRACE != 0)
+/**
+ * Function for getting color of a given level log.
+ *
+ * @param[in] aLogLevel The log level.
+ *
+ * @returns String with a log level color value.
+ */
+static inline const char *levelToString(appliLogLevel_t aLogLevel)
+{
+ switch (aLogLevel)
+ {
+ case LOG_LEVEL_CRIT:
+ return RTT_COLOR_CODE_RED;
+
+ case LOG_LEVEL_WARN:
+ return RTT_COLOR_CODE_YELLOW;
+
+ case LOG_LEVEL_INFO:
+ return RTT_COLOR_CODE_GREEN;
+
+ case LOG_LEVEL_DEBG:
+ default:
+ return RTT_COLOR_CODE_DEFAULT;
+ }
+}
+#endif /* CFG_DEBUG_TRACE */
+
+#if (CFG_DEBUG_TRACE != 0)
+/**
+ * Function for printing log level.
+ *
+ * @param[inout] aLogString Pointer to log buffer.
+ * @param[in] aMaxSize Maximum size of log buffer.
+ * @param[in] aLogLevel Log level.
+ *
+ * @returns Number of bytes successfully written to the log buffer.
+ */
+static inline uint16_t logLevel(char *aLogString, uint16_t aMaxSize,
+ appliLogLevel_t aLogLevel)
+{
+ return snprintf(aLogString, aMaxSize, "%s", levelToString(aLogLevel));
+}
+#endif /* CFG_DEBUG_TRACE */
+#endif /* LOG_RTT_COLOR_ENABLE */
+
+#if (LOG_TIMESTAMP_ENABLE == 1U)
+/**
+ * Function for printing actual timestamp.
+ *
+ * @param[inout] aLogString Pointer to the log buffer.
+ * @param[in] aMaxSize Maximum size of the log buffer.
+ *
+ * @returns Number of bytes successfully written to the log buffer.
+ */
+static inline uint16_t logTimestamp(char *aLogString, uint16_t aMaxSize)
+{
+ return snprintf(aLogString, aMaxSize, "%s[%010ld]", RTT_COLOR_CODE_DEFAULT,
+ otPlatAlarmMilliGetNow());
+}
+#endif /* LOG_TIMESTAMP_ENABLE */
+
+
+/**
+ * Function for printing application log
+ *
+ * @param[in] aLogLevel Log level.
+ * @param[in] aLogRegion The region ID.
+ * @param[in] aFormat User string format.
+ *
+ * @returns Number of bytes successfully written to the log buffer.
+ */
+void logApplication(appliLogLevel_t aLogLevel, appliLogRegion_t aLogRegion, const char *aFormat, ...)
+{
+#if (CFG_DEBUG_TRACE != 0) /* Since the traces are disabled, there is nothing to print */
+ uint16_t length = 0;
+ char logString[LOG_PARSE_BUFFER_SIZE + 1U];
+
+#if (LOG_TIMESTAMP_ENABLE == 1U)
+ length += logTimestamp(logString, LOG_PARSE_BUFFER_SIZE);
+#endif
+
+#if (LOG_RTT_COLOR_ENABLE == 1U)
+ /* Add level information */
+ length += logLevel(&logString[length], (LOG_PARSE_BUFFER_SIZE - length),
+ aLogLevel);
+#endif
+
+#if (LOG_REGION_ENABLE == 1U)
+ /* Add Region information */
+ length += logRegion(&logString[length], (LOG_PARSE_BUFFER_SIZE - length),
+ aLogRegion);
+#endif
+
+ /* Parse user string */
+ va_list paramList;
+ va_start(paramList, aFormat);
+ length += vsnprintf(&logString[length], (LOG_PARSE_BUFFER_SIZE - length),
+ aFormat, paramList);
+ logString[length++] = '\r';
+ logString[length++] = '\n';
+ logString[length++] = 0;
+ va_end(paramList);
+
+ if (aLogLevel <= APPLI_CONFIG_LOG_LEVEL)
+ {
+ printf("%s", logString);
+ }else
+ {
+ /* Print nothing */
+ }
+#endif /* CFG_DEBUG_TRACE */
+}
+
+
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/system_stm32wbxx.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/system_stm32wbxx.c
new file mode 100644
index 000000000..d8ef8b03b
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/Core/Src/system_stm32wbxx.c
@@ -0,0 +1,534 @@
+/**
+ ******************************************************************************
+ * @file system_stm32wbxx.c
+ * @author MCD Application Team
+ * @brief CMSIS Cortex Device Peripheral Access Layer System Source File
+ *
+ * This file provides two functions and one global variable to be called from
+ * user application:
+ * - SystemInit(): This function is called at startup just after reset and
+ * before branch to main program. This call is made inside
+ * the "startup_stm32wbxx.s" file.
+ *
+ * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used
+ * by the user application to setup the SysTick
+ * timer or configure other parameters.
+ *
+ * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must
+ * be called whenever the core clock is changed
+ * during program execution.
+ *
+ * After each device reset the MSI (4 MHz) is used as system clock source.
+ * Then SystemInit() function is called, in "startup_stm32wbxx.s" file, to
+ * configure the system clock before to branch to main program.
+ *
+ * This file configures the system clock as follows:
+ *=============================================================================
+ *-----------------------------------------------------------------------------
+ * System Clock source | MSI
+ *-----------------------------------------------------------------------------
+ * SYSCLK(Hz) | 4000000
+ *-----------------------------------------------------------------------------
+ * HCLK(Hz) | 4000000
+ *-----------------------------------------------------------------------------
+ * AHB Prescaler | 1
+ *-----------------------------------------------------------------------------
+ * APB1 Prescaler | 1
+ *-----------------------------------------------------------------------------
+ * APB2 Prescaler | 1
+ *-----------------------------------------------------------------------------
+ * PLL_M | 1
+ *-----------------------------------------------------------------------------
+ * PLL_N | 8
+ *-----------------------------------------------------------------------------
+ * PLL_P | 7
+ *-----------------------------------------------------------------------------
+ * PLL_Q | 2
+ *-----------------------------------------------------------------------------
+ * PLL_R | 2
+ *-----------------------------------------------------------------------------
+ * PLLSAI1_P | NA
+ *-----------------------------------------------------------------------------
+ * PLLSAI1_Q | NA
+ *-----------------------------------------------------------------------------
+ * PLLSAI1_R | NA
+ *-----------------------------------------------------------------------------
+ * Require 48MHz for USB OTG FS, | Disabled
+ * SDIO and RNG clock |
+ *-----------------------------------------------------------------------------
+ *=============================================================================
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+
+/** @addtogroup CMSIS
+ * @{
+ */
+
+/** @addtogroup stm32WBxx_system
+ * @{
+ */
+
+/** @addtogroup stm32WBxx_System_Private_Includes
+ * @{
+ */
+
+#include "app_common.h"
+
+#if !defined (HSE_VALUE)
+ #define HSE_VALUE (32000000UL) /*!< Value of the External oscillator in Hz */
+#endif /* HSE_VALUE */
+
+#if !defined (MSI_VALUE)
+ #define MSI_VALUE (4000000UL) /*!< Value of the Internal oscillator in Hz*/
+#endif /* MSI_VALUE */
+
+#if !defined (HSI_VALUE)
+ #define HSI_VALUE (16000000UL) /*!< Value of the Internal oscillator in Hz*/
+#endif /* HSI_VALUE */
+
+#if !defined (LSI_VALUE)
+ #define LSI_VALUE (32000UL) /*!< Value of LSI in Hz*/
+#endif /* LSI_VALUE */
+
+#if !defined (LSE_VALUE)
+ #define LSE_VALUE (32768UL) /*!< Value of LSE in Hz*/
+#endif /* LSE_VALUE */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_TypesDefinitions
+ * @{
+ */
+typedef void (*fct_t)(void);
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_Defines
+ * @{
+ */
+
+/*!< Uncomment the following line if you need to relocate your vector Table in
+ Internal SRAM. */
+/* #define VECT_TAB_SRAM */
+#define VECT_TAB_OFFSET 0x0U /*!< Vector Table base offset field.
+ This value must be a multiple of 0x200. */
+
+#define VECT_TAB_BASE_ADDRESS SRAM1_BASE /*!< Vector Table base offset field.
+ This value must be a multiple of 0x200. */
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_Macros
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_Variables
+ * @{
+ */
+ /* The SystemCoreClock variable is updated in three ways:
+ 1) by calling CMSIS function SystemCoreClockUpdate()
+ 2) by calling HAL API function HAL_RCC_GetHCLKFreq()
+ 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
+ Note: If you use this function to configure the system clock; then there
+ is no need to call the 2 first functions listed above, since SystemCoreClock
+ variable is updated automatically.
+ */
+ uint32_t SystemCoreClock = 4000000UL ; /*CPU1: M4 on MSI clock after startup (4MHz)*/
+
+ const uint32_t AHBPrescTable[16UL] = {1UL, 3UL, 5UL, 1UL, 1UL, 6UL, 10UL, 32UL, 2UL, 4UL, 8UL, 16UL, 64UL, 128UL, 256UL, 512UL};
+
+ const uint32_t APBPrescTable[8UL] = {0UL, 0UL, 0UL, 0UL, 1UL, 2UL, 3UL, 4UL};
+
+ const uint32_t MSIRangeTable[16UL] = {100000UL, 200000UL, 400000UL, 800000UL, 1000000UL, 2000000UL, \
+ 4000000UL, 8000000UL, 16000000UL, 24000000UL, 32000000UL, 48000000UL, 0UL, 0UL, 0UL, 0UL}; /* 0UL values are incorrect cases */
+
+ const uint32_t SmpsPrescalerTable[4UL][6UL]={{1UL,3UL,2UL,2UL,1UL,2UL}, \
+ {2UL,6UL,4UL,3UL,2UL,4UL}, \
+ {4UL,12UL,8UL,6UL,4UL,8UL}, \
+ {4UL,12UL,8UL,6UL,4UL,8UL}};
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_FunctionPrototypes
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_Functions
+ * @{
+ */
+static void JumpFwApp( void );
+static void BootModeCheck( void );
+static void JumpSelectionOnPowerUp( void );
+static uint8_t CheckFwAppValidity( void );
+
+/**
+ * Check the Boot mode request
+ * Depending on the result, the CPU may either jump to an existing application in the user flash
+ * or keep on running the code to start the OTA loader
+ */
+static void BootModeCheck( void )
+{
+ if(LL_RCC_IsActiveFlag_SFTRST( ) || LL_RCC_IsActiveFlag_OBLRST( ))
+ {
+ /**
+ * The SRAM1 content is kept on Software Reset.
+ * In the Thread_Ota application, the first address of the SRAM1 indicates which kind of action has been requested
+ */
+
+ /**
+ * Check Boot Mode from SRAM1
+ */
+ if(((*(uint8_t*)SRAM1_BASE) == CFG_REBOOT_ON_FW_APP) && (CheckFwAppValidity( ) != 0))
+ {
+ /**
+ * The user has requested to start on the firmware application and it has been checked
+ * a valid application is ready
+ * Jump now on the application
+ */
+ JumpFwApp();
+ }
+ else if(((*(uint8_t*)SRAM1_BASE) == CFG_REBOOT_ON_FW_APP) && (CheckFwAppValidity( ) == 0))
+ {
+ /**
+ * The user has requested to start on the firmware application but there is no valid application
+ * Erase all sectors specified by byte1 and byte1 in SRAM1 to download a new App.
+ */
+ *(uint8_t*)SRAM1_BASE = CFG_REBOOT_ON_THREAD_OTA_APP; /* Request to reboot on Thread_Ota application */
+ *((uint8_t*)SRAM1_BASE+1) = CFG_APP_START_SECTOR_INDEX;
+ *((uint8_t*)SRAM1_BASE+2) = 0xFF;
+ }
+ else if((*(uint8_t*)SRAM1_BASE) == CFG_REBOOT_ON_THREAD_OTA_APP)
+ {
+ /**
+ * It has been requested to reboot on Thread_Ota application to download data
+ */
+ }
+ else if((*(uint8_t*)SRAM1_BASE) == CFG_REBOOT_ON_CPU2_UPGRADE)
+ {
+ /**
+ * It has been requested to reboot on Thread_Ota application to keep running the firmware upgrade process
+ *
+ */
+ }
+ else
+ {
+ /**
+ * There should be no use case to be there because the device already starts from power up
+ * and the SRAM1 is then filled with the value define by the user
+ * However, it could be that a reset occurs just after a power up and in that case, the Thread_Ota
+ * will be running but the sectors to download a new App may not be erased
+ */
+ JumpSelectionOnPowerUp( );
+ }
+ }
+ else
+ {
+ /**
+ * On Power up, the content of SRAM1 is random
+ * The only thing that could be done is to jump on either the firmware application
+ * or the Thread_Ota application
+ */
+ JumpSelectionOnPowerUp( );
+ }
+
+ /**
+ * Return to the startup file and run the Thread_Ota application
+ */
+ return;
+}
+
+static void JumpSelectionOnPowerUp( void )
+{
+ /**
+ * Check if there is a FW App
+ */
+ if(CheckFwAppValidity( ) != 0)
+ {
+ /**
+ * The SRAM1 is random
+ * Initialize SRAM1 to indicate we requested to reboot of firmware application
+ */
+ *(uint8_t*)SRAM1_BASE = CFG_REBOOT_ON_FW_APP;
+
+ /**
+ * A valid application is available
+ * Jump now on the application
+ */
+ JumpFwApp();
+ }
+ else
+ {
+ /**
+ * The SRAM1 is random
+ * Initialize SRAM1 to indicate we requested to reboot of Thread_Ota application
+ */
+ *(uint8_t*)SRAM1_BASE = CFG_REBOOT_ON_THREAD_OTA_APP;
+
+ /**
+ * There is no valid application available
+ * Erase all sectors specified by byte1 and byte1 in SRAM1 to download a new App.
+ */
+ *((uint8_t*)SRAM1_BASE+1) = CFG_APP_START_SECTOR_INDEX;
+ *((uint8_t*)SRAM1_BASE+2) = 0xFF;
+ }
+ return;
+}
+
+/**
+ * Jump to existing FW App in flash
+ * It never returns
+ */
+static void JumpFwApp( void )
+{
+ fct_t app_reset_handler;
+
+ SCB->VTOR = FLASH_BASE + (CFG_APP_START_SECTOR_INDEX * 0x1000);
+ __set_MSP(*(uint32_t*)(FLASH_BASE + (CFG_APP_START_SECTOR_INDEX * 0x1000)));
+ app_reset_handler = (fct_t)(*(uint32_t*)(FLASH_BASE + (CFG_APP_START_SECTOR_INDEX * 0x1000) + 4));
+ app_reset_handler();
+
+ /**
+ * app_reset_handler() never returns.
+ * However, if for any reason a PUSH instruction is added at the entry of JumpFwApp(),
+ * we need to make sure the POP instruction is not there before app_reset_handler() is called
+ * The way to ensure this is to add a dummy code after app_reset_handler() is called
+ * This prevents app_reset_handler() to be the last code in the function.
+ */
+ __WFI();
+
+
+ return;
+}
+
+static uint8_t CheckFwAppValidity( void )
+{
+ uint8_t status;
+ uint32_t magic_keyword_address;
+ uint32_t last_user_flash_address;
+
+ magic_keyword_address = *(uint32_t*)(FLASH_BASE + (CFG_APP_START_SECTOR_INDEX * 0x1000 + 0x140));
+ last_user_flash_address = (((READ_BIT(FLASH->SFR, FLASH_SFR_SFSA) >> FLASH_SFR_SFSA_Pos) << 12) + FLASH_BASE) - 4;
+ if( (magic_keyword_address < FLASH_BASE) || (magic_keyword_address > last_user_flash_address) )
+ {
+ /**
+ * The address is not valid
+ */
+ status = 0;
+ }
+ else
+ {
+ if( (*(uint32_t*)magic_keyword_address) != 0x94448A29 )
+ {
+ /**
+ * A firmware update procedure did not complete
+ */
+ status = 0;
+ }
+ else
+ {
+ /**
+ * The firmware application is available
+ */
+ status = 1;
+ }
+ }
+
+ return status;
+}
+
+/**
+ * @brief Setup the microcontroller system.
+ * @param None
+ * @retval None
+ */
+void SystemInit(void)
+{
+ BootModeCheck();
+
+ /* Configure the Vector Table location add offset address ------------------*/
+#if defined(VECT_TAB_SRAM) && defined(VECT_TAB_BASE_ADDRESS)
+ /* program in SRAMx */
+ SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAMx for CPU1 */
+#else /* program in FLASH */
+ SCB->VTOR = VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
+#endif
+
+ /* FPU settings ------------------------------------------------------------*/
+ #if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
+ SCB->CPACR |= ((3UL << (10UL*2UL))|(3UL << (11UL*2UL))); /* set CP10 and CP11 Full Access */
+ #endif
+
+ /* Reset the RCC clock configuration to the default reset state ------------*/
+ /* Set MSION bit */
+ RCC->CR |= RCC_CR_MSION;
+
+ /* Reset CFGR register */
+ RCC->CFGR = 0x00070000U;
+
+ /* Reset PLLSAI1ON, PLLON, HSECSSON, HSEON, HSION, and MSIPLLON bits */
+ RCC->CR &= (uint32_t)0xFAF6FEFBU;
+
+ /*!< Reset LSI1 and LSI2 bits */
+ RCC->CSR &= (uint32_t)0xFFFFFFFAU;
+
+ /*!< Reset HSI48ON bit */
+ RCC->CRRCR &= (uint32_t)0xFFFFFFFEU;
+
+ /* Reset PLLCFGR register */
+ RCC->PLLCFGR = 0x22041000U;
+
+ /* Reset PLLSAI1CFGR register */
+ RCC->PLLSAI1CFGR = 0x22041000U;
+
+ /* Reset HSEBYP bit */
+ RCC->CR &= 0xFFFBFFFFU;
+
+ /* Disable all interrupts */
+ RCC->CIER = 0x00000000;
+}
+
+/**
+ * @brief Update SystemCoreClock variable according to Clock Register Values.
+ * The SystemCoreClock variable contains the core clock (HCLK), it can
+ * be used by the user application to setup the SysTick timer or configure
+ * other parameters.
+ *
+ * @note Each time the core clock (HCLK) changes, this function must be called
+ * to update SystemCoreClock variable value. Otherwise, any configuration
+ * based on this variable will be incorrect.
+ *
+ * @note - The system frequency computed by this function is not the real
+ * frequency in the chip. It is calculated based on the predefined
+ * constant and the selected clock source:
+ *
+ * - If SYSCLK source is MSI, SystemCoreClock will contain the MSI_VALUE(*)
+ *
+ * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(**)
+ *
+ * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(***)
+ *
+ * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(***)
+ * or HSI_VALUE(*) or MSI_VALUE(*) multiplied/divided by the PLL factors.
+ *
+ * (*) MSI_VALUE is a constant defined in stm32wbxx_hal.h file (default value
+ * 4 MHz) but the real value may vary depending on the variations
+ * in voltage and temperature.
+ *
+ * (**) HSI_VALUE is a constant defined in stm32wbxx_hal_conf.h file (default value
+ * 16 MHz) but the real value may vary depending on the variations
+ * in voltage and temperature.
+ *
+ * (***) HSE_VALUE is a constant defined in stm32wbxx_hal_conf.h file (default value
+ * 32 MHz), user has to ensure that HSE_VALUE is same as the real
+ * frequency of the crystal used. Otherwise, this function may
+ * have wrong result.
+ *
+ * - The result of this function could be not correct when using fractional
+ * value for HSE crystal.
+ *
+ * @param None
+ * @retval None
+ */
+void SystemCoreClockUpdate(void)
+{
+ uint32_t tmp, msirange, pllvco, pllr, pllsource , pllm;
+
+ /* Get MSI Range frequency--------------------------------------------------*/
+
+ /*MSI frequency range in Hz*/
+ msirange = MSIRangeTable[(RCC->CR & RCC_CR_MSIRANGE) >> RCC_CR_MSIRANGE_Pos];
+
+ /* Get SYSCLK source -------------------------------------------------------*/
+ switch (RCC->CFGR & RCC_CFGR_SWS)
+ {
+ case 0x00: /* MSI used as system clock source */
+ SystemCoreClock = msirange;
+ break;
+
+ case 0x04: /* HSI used as system clock source */
+ /* HSI used as system clock source */
+ SystemCoreClock = HSI_VALUE;
+ break;
+
+ case 0x08: /* HSE used as system clock source */
+ SystemCoreClock = HSE_VALUE;
+ break;
+
+ case 0x0C: /* PLL used as system clock source */
+ /* PLL_VCO = (HSE_VALUE or HSI_VALUE or MSI_VALUE/ PLLM) * PLLN
+ SYSCLK = PLL_VCO / PLLR
+ */
+ pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC);
+ pllm = ((RCC->PLLCFGR & RCC_PLLCFGR_PLLM) >> RCC_PLLCFGR_PLLM_Pos) + 1UL ;
+
+ if(pllsource == 0x02UL) /* HSI used as PLL clock source */
+ {
+ pllvco = (HSI_VALUE / pllm);
+ }
+ else if(pllsource == 0x03UL) /* HSE used as PLL clock source */
+ {
+ pllvco = (HSE_VALUE / pllm);
+ }
+ else /* MSI used as PLL clock source */
+ {
+ pllvco = (msirange / pllm);
+ }
+
+ pllvco = pllvco * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> RCC_PLLCFGR_PLLN_Pos);
+ pllr = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLR) >> RCC_PLLCFGR_PLLR_Pos) + 1UL);
+
+ SystemCoreClock = pllvco/pllr;
+ break;
+
+ default:
+ SystemCoreClock = msirange;
+ break;
+ }
+
+ /* Compute HCLK clock frequency --------------------------------------------*/
+ /* Get HCLK1 prescaler */
+ tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> RCC_CFGR_HPRE_Pos)];
+ /* HCLK clock frequency */
+ SystemCoreClock = SystemCoreClock / tmp;
+
+}
+
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/EWARM/Project.eww b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/EWARM/Project.eww
new file mode 100644
index 000000000..285aaedee
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/EWARM/Project.eww
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workspace>
+ <project>
+ <path>$WS_DIR$\Thread_Ota.ewp</path>
+ </project>
+ <batchBuild />
+</workspace>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/EWARM/Thread_Ota.ewd b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/EWARM/Thread_Ota.ewd
new file mode 100644
index 000000000..1e47526e9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/EWARM/Thread_Ota.ewd
@@ -0,0 +1,1419 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <fileVersion>3</fileVersion>
+ <configuration>
+ <name>Thread_Ota</name>
+ <toolchain>
+ <name>ARM</name>
+ </toolchain>
+ <debug>1</debug>
+ <settings>
+ <name>C-SPY</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>29</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CInput</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CEndian</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCVariant</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacFile</name>
+ <state />
+ </option>
+ <option>
+ <name>MemOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MemFile</name>
+ <state />
+ </option>
+ <option>
+ <name>RunToEnable</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RunToName</name>
+ <state>main</state>
+ </option>
+ <option>
+ <name>CExtraOptionsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CExtraOptions</name>
+ <state />
+ </option>
+ <option>
+ <name>CFpuProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCDDFArgumentProducer</name>
+ <state />
+ </option>
+ <option>
+ <name>OCDownloadSuppressDownload</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCDownloadVerifyAll</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCProductVersion</name>
+ <state>7.10.3.6927</state>
+ </option>
+ <option>
+ <name>OCDynDriverList</name>
+ <state>STLINK_ID</state>
+ </option>
+ <option>
+ <name>OCLastSavedByProductVersion</name>
+ <state>8.20.1.14181</state>
+ </option>
+ <option>
+ <name>UseFlashLoader</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CLowLevel</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCBE8Slave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>MacFile2</name>
+ <state />
+ </option>
+ <option>
+ <name>CDevice</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>FlashLoadersV3</name>
+ <state />
+ </option>
+ <option>
+ <name>OCImagesSuppressCheck1</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesPath1</name>
+ <state />
+ </option>
+ <option>
+ <name>OCImagesSuppressCheck2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesPath2</name>
+ <state />
+ </option>
+ <option>
+ <name>OCImagesSuppressCheck3</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesPath3</name>
+ <state />
+ </option>
+ <option>
+ <name>OverrideDefFlashBoard</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesOffset1</name>
+ <state />
+ </option>
+ <option>
+ <name>OCImagesOffset2</name>
+ <state />
+ </option>
+ <option>
+ <name>OCImagesOffset3</name>
+ <state />
+ </option>
+ <option>
+ <name>OCImagesUse1</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesUse2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesUse3</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCDeviceConfigMacroFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCDebuggerExtraOption</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCAllMTBOptions</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCMulticoreNrOfCores</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCMulticoreMaster</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCMulticorePort</name>
+ <state>53461</state>
+ </option>
+ <option>
+ <name>OCMulticoreWorkspace</name>
+ <state />
+ </option>
+ <option>
+ <name>OCMulticoreSlaveProject</name>
+ <state />
+ </option>
+ <option>
+ <name>OCMulticoreSlaveConfiguration</name>
+ <state />
+ </option>
+ <option>
+ <name>OCDownloadExtraImage</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCAttachSlave</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MassEraseBeforeFlashing</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>ARMSIM_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>1</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCSimDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCSimEnablePSP</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCSimPspOverrideConfig</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCSimPspConfigFile</name>
+ <state />
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>CADI_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CCadiMemory</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>Fast Model</name>
+ <state />
+ </option>
+ <option>
+ <name>CCADILogFileCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCADILogFileEditB</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>CMSISDAP_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>4</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CatchSFERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCIarProbeScriptFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CMSISDAPResetList</name>
+ <version>1</version>
+ <state>10</state>
+ </option>
+ <option>
+ <name>CMSISDAPHWResetDuration</name>
+ <state>300</state>
+ </option>
+ <option>
+ <name>CMSISDAPHWResetDelay</name>
+ <state>200</state>
+ </option>
+ <option>
+ <name>CMSISDAPDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CMSISDAPInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPMultiTargetEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPMultiTarget</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPJtagSpeedList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPBreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPRestoreBreakpointsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPUpdateBreakpointsEdit</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>RDICatchReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchUndef</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchSWI</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchData</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchPrefetch</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchIRQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchFIQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CatchMMERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchNOCPERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchCHKERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchSTATERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchBUSERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchINTERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchHARDERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPMultiCPUEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPMultiCPUNumber</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCProbeCfgOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCProbeConfig</name>
+ <state />
+ </option>
+ <option>
+ <name>CMSISDAPProbeConfigRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPSelectedCPUBehaviour</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ICpuName</name>
+ <state />
+ </option>
+ <option>
+ <name>OCJetEmuParams</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCCMSISDAPUsbSerialNo</name>
+ <state />
+ </option>
+ <option>
+ <name>CCCMSISDAPUsbSerialNoSelect</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>GDBSERVER_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>TCPIP</name>
+ <state>aaa.bbb.ccc.ddd</state>
+ </option>
+ <option>
+ <name>DoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>LogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCJTagBreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJTagDoUpdateBreakpoints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJTagUpdateBreakpoints</name>
+ <state>_call_main</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>IJET_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>8</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CatchSFERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCIarProbeScriptFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IjetResetList</name>
+ <version>1</version>
+ <state>10</state>
+ </option>
+ <option>
+ <name>IjetHWResetDuration</name>
+ <state>300</state>
+ </option>
+ <option>
+ <name>IjetHWResetDelay</name>
+ <state>200</state>
+ </option>
+ <option>
+ <name>IjetPowerFromProbe</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IjetPowerRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>IjetInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetMultiTargetEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetMultiTarget</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetScanChainNonARMDevices</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetIRLength</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetJtagSpeedList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetProtocolRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetSwoPin</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetCpuClockEdit</name>
+ <state>72.0</state>
+ </option>
+ <option>
+ <name>IjetSwoPrescalerList</name>
+ <version>1</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetBreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetRestoreBreakpointsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetUpdateBreakpointsEdit</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>RDICatchReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchUndef</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchSWI</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchData</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchPrefetch</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchIRQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchFIQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CatchMMERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchNOCPERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchCHKERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchSTATERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchBUSERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchINTERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchHARDERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCProbeCfgOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCProbeConfig</name>
+ <state />
+ </option>
+ <option>
+ <name>IjetProbeConfigRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetMultiCPUEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetMultiCPUNumber</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetSelectedCPUBehaviour</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ICpuName</name>
+ <state />
+ </option>
+ <option>
+ <name>OCJetEmuParams</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IjetPreferETB</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IjetTraceSettingsList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetTraceSizeList</name>
+ <version>0</version>
+ <state>4</state>
+ </option>
+ <option>
+ <name>FlashBoardPathSlave</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCIjetUsbSerialNo</name>
+ <state />
+ </option>
+ <option>
+ <name>CCIjetUsbSerialNoSelect</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>JLINK_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>16</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CCCatchSFERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>JLinkSpeed</name>
+ <state>1000</state>
+ </option>
+ <option>
+ <name>CCJLinkDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCJLinkHWResetDelay</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>JLinkInitialSpeed</name>
+ <state>1000</state>
+ </option>
+ <option>
+ <name>CCDoJlinkMultiTarget</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCScanChainNonARMDevices</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkMultiTarget</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkIRLength</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkCommRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkTCPIP</name>
+ <state>aaa.bbb.ccc.ddd</state>
+ </option>
+ <option>
+ <name>CCJLinkSpeedRadioV2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCUSBDevice</name>
+ <version>1</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCRDICatchReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchUndef</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchSWI</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchData</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchPrefetch</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchIRQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchFIQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkBreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkDoUpdateBreakpoints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkUpdateBreakpoints</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>CCJLinkInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkResetList</name>
+ <version>6</version>
+ <state>7</state>
+ </option>
+ <option>
+ <name>CCJLinkInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchMMERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchNOCPERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchCHRERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchSTATERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchBUSERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchINTERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchHARDERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCJLinkScriptFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCJLinkUsbSerialNo</name>
+ <state />
+ </option>
+ <option>
+ <name>CCTcpIpAlt</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkTcpIpSerialNo</name>
+ <state />
+ </option>
+ <option>
+ <name>CCCpuClockEdit</name>
+ <state>72.0</state>
+ </option>
+ <option>
+ <name>CCSwoClockAuto</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSwoClockEdit</name>
+ <state>2000</state>
+ </option>
+ <option>
+ <name>OCJLinkTraceSource</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCJLinkTraceSourceDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCJLinkDeviceName</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>LMIFTDI_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>2</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>LmiftdiSpeed</name>
+ <state>500</state>
+ </option>
+ <option>
+ <name>CCLmiftdiDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCLmiftdiLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCLmiFtdiInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCLmiFtdiInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>PEMICRO_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>3</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCJPEMicroShowSettings</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>DoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>LogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>STLINK_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>4</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCSTLinkInterfaceRadio</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCSTLinkInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkResetList</name>
+ <version>3</version>
+ <state>4</state>
+ </option>
+ <option>
+ <name>CCCpuClockEdit</name>
+ <state>32.0</state>
+ </option>
+ <option>
+ <name>CCSwoClockAuto</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSwoClockEdit</name>
+ <state>2000</state>
+ </option>
+ <option>
+ <name>DoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>LogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCSTLinkDoUpdateBreakpoints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkUpdateBreakpoints</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchMMERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchNOCPERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchCHRERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchSTATERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchBUSERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchINTERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchSFERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchHARDERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkUsbSerialNo</name>
+ <state />
+ </option>
+ <option>
+ <name>CCSTLinkUsbSerialNoSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkJtagSpeedList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkDAPNumber</name>
+ <state />
+ </option>
+ <option>
+ <name>CCSTLinkDebugAccessPortRadio</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>THIRDPARTY_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CThirdPartyDriverDll</name>
+ <state>###Uninitialized###</state>
+ </option>
+ <option>
+ <name>CThirdPartyLogFileCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CThirdPartyLogFileEditB</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>TIFET_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>1</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCMSPFetResetList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetTargetVccTypeDefault</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetTargetVoltage</name>
+ <state>###Uninitialized###</state>
+ </option>
+ <option>
+ <name>CCMSPFetVCCDefault</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCMSPFetTargetSettlingtime</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetRadioJtagSpeedType</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCMSPFetConnection</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetUsbComPort</name>
+ <state>Automatic</state>
+ </option>
+ <option>
+ <name>CCMSPFetAllowAccessToBSL</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCMSPFetRadioEraseFlash</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>XDS100_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>6</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>TIPackageOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>TIPackage</name>
+ <state />
+ </option>
+ <option>
+ <name>BoardFile</name>
+ <state />
+ </option>
+ <option>
+ <name>DoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>LogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCXds100BreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100DoUpdateBreakpoints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100UpdateBreakpoints</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>CCXds100CatchReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchUndef</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchSWI</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchData</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchPrefetch</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchIRQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchFIQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchMMERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchNOCPERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchCHRERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchSTATERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchBUSERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchINTERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchSFERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchHARDERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CpuClockEdit</name>
+ <state />
+ </option>
+ <option>
+ <name>CCXds100SwoClockAuto</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100SwoClockEdit</name>
+ <state>1000</state>
+ </option>
+ <option>
+ <name>CCXds100HWResetDelay</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100ResetList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100UsbSerialNo</name>
+ <state />
+ </option>
+ <option>
+ <name>CCXds100UsbSerialNoSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100JtagSpeedList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100InterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100InterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100ProbeList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100SWOPortRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100SWOPort</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <debuggerPlugins>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\Mbed\MbedArmPlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin</file>
+ <loadFlag>1</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\TargetAccessServer\TargetAccessServer.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ </debuggerPlugins>
+ </configuration>
+</project>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/EWARM/Thread_Ota.ewp b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/EWARM/Thread_Ota.ewp
new file mode 100644
index 000000000..7fa9df11b
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/EWARM/Thread_Ota.ewp
@@ -0,0 +1,1304 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <fileVersion>3</fileVersion>
+ <configuration>
+ <name>Thread_Ota</name>
+ <toolchain>
+ <name>ARM</name>
+ </toolchain>
+ <debug>1</debug>
+ <settings>
+ <name>General</name>
+ <archiveVersion>3</archiveVersion>
+ <data>
+ <version>30</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>ExePath</name>
+ <state>Thread_Ota/Exe</state>
+ </option>
+ <option>
+ <name>ObjPath</name>
+ <state>Thread_Ota/Obj</state>
+ </option>
+ <option>
+ <name>ListPath</name>
+ <state>Thread_Ota/List</state>
+ </option>
+ <option>
+ <name>GEndianMode</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>Input description</name>
+ <state>Full formatting, with multibyte support.</state>
+ </option>
+ <option>
+ <name>Output description</name>
+ <state>Full formatting, with multibyte support.</state>
+ </option>
+ <option>
+ <name>GOutputBinary</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGCoreOrChip</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>GRuntimeLibSelect</name>
+ <version>0</version>
+ <state>2</state>
+ </option>
+ <option>
+ <name>GRuntimeLibSelectSlave</name>
+ <version>0</version>
+ <state>2</state>
+ </option>
+ <option>
+ <name>RTDescription</name>
+ <state>Use the full configuration of the C/C++ runtime library. Full locale interface, C locale, file descriptor support, multibytes in printf and scanf, and hex floats in strtod.</state>
+ </option>
+ <option>
+ <name>OGProductVersion</name>
+ <state>4.41A</state>
+ </option>
+ <option>
+ <name>OGLastSavedByProductVersion</name>
+ <state>8.20.2.14834</state>
+ </option>
+ <option>
+ <name>GeneralEnableMisra</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GeneralMisraVerbose</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGChipSelectEditMenu</name>
+ <state>STM32WB55RG ST STM32WB55RG</state>
+ </option>
+ <option>
+ <name>GenLowLevelInterface</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>GEndianModeBE</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OGBufferedTerminalOutput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GenStdoutInterface</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GeneralMisraRules98</name>
+ <version>0</version>
+ <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
+ </option>
+ <option>
+ <name>GeneralMisraVer</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GeneralMisraRules04</name>
+ <version>0</version>
+ <state>011111111111111110111111111111011111111111111011110100111111111111111111111111111111111111111111101111111111111011111111111111111111111111111</state>
+ </option>
+ <option>
+ <name>RTConfigPath2</name>
+ <state>$TOOLKIT_DIR$\INC\c\DLib_Config_Full.h</state>
+ </option>
+ <option>
+ <name>GBECoreSlave</name>
+ <version>26</version>
+ <state>39</state>
+ </option>
+ <option>
+ <name>OGUseCmsis</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGUseCmsisDspLib</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GRuntimeLibThreads</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CoreVariant</name>
+ <version>26</version>
+ <state>39</state>
+ </option>
+ <option>
+ <name>GFPUDeviceSlave</name>
+ <state>STM32WB55RG ST STM32WB55RG</state>
+ </option>
+ <option>
+ <name>FPU2</name>
+ <version>0</version>
+ <state>4</state>
+ </option>
+ <option>
+ <name>NrRegs</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>NEON</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GFPUCoreSlave2</name>
+ <version>26</version>
+ <state>39</state>
+ </option>
+ <option>
+ <name>OGCMSISPackSelectDevice</name>
+ </option>
+ <option>
+ <name>OgLibHeap</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGLibAdditionalLocale</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGPrintfVariant</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OGPrintfMultibyteSupport</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OGScanfVariant</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OGScanfMultibyteSupport</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>GenLocaleTags</name>
+ <state></state>
+ </option>
+ <option>
+ <name>GenLocaleDisplayOnly</name>
+ <state></state>
+ </option>
+ <option>
+ <name>DSPExtension</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>TrustZone</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>ICCARM</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>34</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CCOptimizationNoSizeConstraints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCDefines</name>
+ <state>OPENTHREAD_CONFIG_FILE=&lt;openthread_api_config_ftd.h&gt;</state>
+ <state>USE_HAL_DRIVER</state>
+ <state>STM32WB55xx</state>
+ <state>USE_STM32WBXX_NUCLEO</state>
+ <state>THREAD_WB</state>
+ </option>
+ <option>
+ <name>CCPreprocFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPreprocComments</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPreprocLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListCFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListCMnemonics</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListCMessages</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListAssFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListAssSource</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCEnableRemarks</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCDiagSuppress</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCDiagRemark</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCDiagWarning</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCDiagError</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCObjPrefix</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCAllowList</name>
+ <version>1</version>
+ <state>11111110</state>
+ </option>
+ <option>
+ <name>CCDebugInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IEndianMode</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IExtraOptionsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IExtraOptions</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCLangConformance</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSignedPlainChar</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCRequirePrototypes</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCDiagWarnAreErr</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCompilerRuntimeInfo</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IFpuProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OutputFile</name>
+ <state>$FILE_BNAME$.o</state>
+ </option>
+ <option>
+ <name>CCLibConfigHeader</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>PreInclude</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CompilerMisraOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCIncludePath2</name>
+ <state>$PROJ_DIR$/../Core/Inc</state>
+ <state>$PROJ_DIR$/../STM32_WPAN/App</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/BSP/P-NUCLEO-WB55.Nucleo</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/STM32WBxx_HAL_Driver/Inc</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/STM32WBxx_HAL_Driver/Inc/Legacy</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/utilities</state>
+ <state>$PROJ_DIR$/../../../../../../Utilities/lpm/tiny_lpm</state>
+ <state>$PROJ_DIR$/../../../../../../Utilities/sequencer</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/CMSIS/Device/ST/STM32WBxx/Include</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/thread/openthread/core/openthread_api</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/thread/openthread/stack/include</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/thread/openthread/stack/include/openthread</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/thread/openthread/stack/include/openthread/platform</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/CMSIS/Include</state>
+ </option>
+ <option>
+ <name>CCStdIncCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCodeSection</name>
+ <state>.text</state>
+ </option>
+ <option>
+ <name>IProcessorMode2</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCOptLevel</name>
+ <state>3</state>
+ </option>
+ <option>
+ <name>CCOptStrategy</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCOptLevelSlave</name>
+ <state>3</state>
+ </option>
+ <option>
+ <name>CompilerMisraRules98</name>
+ <version>0</version>
+ <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
+ </option>
+ <option>
+ <name>CompilerMisraRules04</name>
+ <version>0</version>
+ <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
+ </option>
+ <option>
+ <name>CCPosIndRopi</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPosIndRwpi</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPosIndNoDynInit</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccLang</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccCDialect</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IccAllowVLA</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccStaticDestr</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccCppInlineSemantics</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccCmsis</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IccFloatSemantics</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCNoLiteralPool</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCOptStrategySlave</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCGuardCalls</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCEncSource</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCEncOutput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCEncOutputBom</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCEncInput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccExceptions2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccRTTI2</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>AARM</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>10</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>AObjPrefix</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AEndian</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>ACaseSensitivity</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>MacroChars</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AWarnEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AWarnWhat</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AWarnOne</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AWarnRange1</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AWarnRange2</name>
+ <state></state>
+ </option>
+ <option>
+ <name>ADebug</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AltRegisterNames</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ADefines</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AList</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AListHeader</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AListing</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>Includes</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacDefs</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacExps</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>MacExec</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OnlyAssed</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MultiLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>PageLengthCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>PageLength</name>
+ <state>80</state>
+ </option>
+ <option>
+ <name>TabSpacing</name>
+ <state>8</state>
+ </option>
+ <option>
+ <name>AXRef</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AXRefDefines</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AXRefInternal</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AXRefDual</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AFpuProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AOutputFile</name>
+ <state>$FILE_BNAME$.o</state>
+ </option>
+ <option>
+ <name>ALimitErrorsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ALimitErrorsEdit</name>
+ <state>100</state>
+ </option>
+ <option>
+ <name>AIgnoreStdInclude</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AUserIncludes</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AExtraOptionsCheckV2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AExtraOptionsV2</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AsmNoLiteralPool</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>OBJCOPY</name>
+ <archiveVersion>0</archiveVersion>
+ <data>
+ <version>1</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OOCOutputFormat</name>
+ <version>3</version>
+ <state>3</state>
+ </option>
+ <option>
+ <name>OCOutputOverride</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OOCOutputFile</name>
+ <state>Thread_Ota.bin</state>
+ </option>
+ <option>
+ <name>OOCCommandLineProducer</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OOCObjCopyEnable</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>CUSTOM</name>
+ <archiveVersion>3</archiveVersion>
+ <data>
+ <extensions></extensions>
+ <cmdline></cmdline>
+ <hasPrio>0</hasPrio>
+ </data>
+ </settings>
+ <settings>
+ <name>BICOMP</name>
+ <archiveVersion>0</archiveVersion>
+ <data />
+ </settings>
+ <settings>
+ <name>BUILDACTION</name>
+ <archiveVersion>1</archiveVersion>
+ <data>
+ <prebuild></prebuild>
+ <postbuild></postbuild>
+ </data>
+ </settings>
+ <settings>
+ <name>ILINK</name>
+ <archiveVersion>0</archiveVersion>
+ <data>
+ <version>20</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>IlinkLibIOConfig</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>XLinkMisraHandler</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkInputFileSlave</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkOutputFile</name>
+ <state>Thread_Ota.out</state>
+ </option>
+ <option>
+ <name>IlinkDebugInfoEnable</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkKeepSymbols</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinaryFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinarySymbol</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinarySegment</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinaryAlign</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkDefines</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkConfigDefines</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkMapFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkLogFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogInitialization</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogModule</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogSection</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogVeneer</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkIcfOverride</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkIcfFile</name>
+ <state>$PROJ_DIR$\stm32wb55xx_flash_cm4.icf</state>
+ </option>
+ <option>
+ <name>IlinkIcfFileSlave</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkEnableRemarks</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkSuppressDiags</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkTreatAsRem</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkTreatAsWarn</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkTreatAsErr</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkWarningsAreErrors</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkUseExtraOptions</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkExtraOptions</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkLowLevelInterfaceSlave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkAutoLibEnable</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkAdditionalLibs</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkOverrideProgramEntryLabel</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkProgramEntryLabelSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkProgramEntryLabel</name>
+ <state>__iar_program_start</state>
+ </option>
+ <option>
+ <name>DoFill</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>FillerByte</name>
+ <state>0xFF</state>
+ </option>
+ <option>
+ <name>FillerStart</name>
+ <state>0x0</state>
+ </option>
+ <option>
+ <name>FillerEnd</name>
+ <state>0x0</state>
+ </option>
+ <option>
+ <name>CrcSize</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcAlign</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcPoly</name>
+ <state>0x11021</state>
+ </option>
+ <option>
+ <name>CrcCompl</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CrcBitOrder</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CrcInitialValue</name>
+ <state>0x0</state>
+ </option>
+ <option>
+ <name>DoCrc</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkBE8Slave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkBufferedTerminalOutput</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkStdoutInterfaceSlave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcFullSize</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkIElfToolPostProcess</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogAutoLibSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogRedirSymbols</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogUnusedFragments</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkCrcReverseByteOrder</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkCrcUseAsInput</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptInline</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkOptExceptionsAllow</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptExceptionsForce</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkCmsis</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptMergeDuplSections</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkOptUseVfe</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptForceVfe</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkStackAnalysisEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkStackControlFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkStackCallGraphFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CrcAlgorithm</name>
+ <version>1</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcUnitSize</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkThreadsSlave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkLogCallGraph</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkIcfFile_AltDefault</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkEncInput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkEncOutput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkEncOutputBom</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkHeapSelect</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkLocaleSelect</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>IARCHIVE</name>
+ <archiveVersion>0</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>IarchiveInputs</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IarchiveOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IarchiveOutput</name>
+ <state>###Unitialized###</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>BILINK</name>
+ <archiveVersion>0</archiveVersion>
+ <data />
+ </settings>
+ </configuration>
+ <group>
+ <name>Application</name>
+ <group>
+ <name>EWARM</name>
+ <file>
+ <name>$PROJ_DIR$\startup_stm32wb55xx_cm4.s</name>
+ </file>
+ </group>
+ <group>
+ <name>User</name>
+ <group>
+ <name>Core</name>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\app_entry.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\hw_timerserver.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\hw_uart.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\main.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\stm32_lpm_if.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\stm32wbxx_hal_msp.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\stm32wbxx_it.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\stm_logging.c</name>
+ </file>
+ </group>
+ <group>
+ <name>STM32_WPAN</name>
+ <group>
+ <name>App</name>
+ <file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\App\app_thread.c</name>
+ </file>
+ </group>
+ <group>
+ <name>Target</name>
+ <file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\Target\hw_ipcc.c</name>
+ </file>
+ </group>
+ </group>
+ </group>
+ </group>
+ <group>
+ <name>Drivers</name>
+ <group>
+ <name>BSP</name>
+ <group>
+ <name>P-NUCLEO-WB55.Nucleo</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\BSP\P-NUCLEO-WB55.Nucleo\stm32wbxx_nucleo.c</name>
+ </file>
+ </group>
+ </group>
+ <group>
+ <name>CMSIS</name>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\system_stm32wbxx.c</name>
+ </file>
+ </group>
+ <group>
+ <name>STM32WBxx_HAL_Driver</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_cortex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_dma.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_dma_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_exti.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_flash.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_flash_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_gpio.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_hsem.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_pwr.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_pwr_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rcc.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rcc_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rtc.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rtc_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_tim.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_tim_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_uart.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_uart_ex.c</name>
+ </file>
+ </group>
+ </group>
+ <group>
+ <name>Middlewares</name>
+ <group>
+ <name>STM32_WPAN</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\channel_manager.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\channel_monitor.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\child_supervision.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\coap.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\commissioner.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\crypto.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\dataset.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\dataset_ftd.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\utilities\dbg_trace.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\dhcp6_client.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\dhcp6_server.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\diag.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\dns.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\icmp6.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\instance.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\ip6.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\jam_detection.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\joiner.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\link.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\link_raw.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\message.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\netdata.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\openthread.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\openthread_api_wb.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\utilities\otp.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\radio.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\server.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\shci\shci.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\shci_tl.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\shci_tl_if.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\utilities\stm_list.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\utilities\stm_queue.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\tasklet.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\thread.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\thread_ftd.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\tl_mbox.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\tl_thread_hci.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\udp.c</name>
+ </file>
+ </group>
+ </group>
+ <group>
+ <name>Utilities</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Utilities\lpm\tiny_lpm\stm32_lpm.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Utilities\sequencer\stm32_seq.c</name>
+ </file>
+ </group>
+</project>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/EWARM/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/EWARM/startup_stm32wb55xx_cm4.s
new file mode 100644
index 000000000..1f886ff59
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/EWARM/startup_stm32wb55xx_cm4.s
@@ -0,0 +1,517 @@
+;******************************************************************************
+;* File Name : startup_stm32wb55xx_cm4.s
+;* Author : MCD Application Team
+;* Description : M4 core vector table of the STM32WB55xx devices for the
+;* IAR (EWARM) toolchain.
+;*
+;* This module performs:
+;* - Set the initial SP
+;* - Set the initial PC == _iar_program_start,
+;* - Set the vector table entries with the exceptions ISR
+;* address.
+;* - Branches to main in the C library (which eventually
+;* calls main()).
+;* After Reset the Cortex-M4 processor is in Thread mode,
+;* priority is Privileged, and the Stack is set to Main.
+;******************************************************************************
+;* @attention
+;*
+;* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+;* All rights reserved.</center></h2>
+;*
+;* This software component is licensed by ST under BSD 3-Clause license,
+;* the "License"; You may not use this file except in compliance with the
+;* License. You may obtain a copy of the License at:
+;* opensource.org/licenses/BSD-3-Clause
+;*
+;******************************************************************************
+;
+;
+; The modules in this file are included in the libraries, and may be replaced
+; by any user-defined modules that define the PUBLIC symbol _program_start or
+; a user defined start symbol.
+; To override the cstartup defined in the library, simply add your modified
+; version to the workbench project.
+;
+; The vector table is normally located at address 0.
+; When debugging in RAM, it can be located in RAM, aligned to at least 2^6.
+; The name "__vector_table" has special meaning for C-SPY:
+; it is where the SP start value is found, and the NVIC vector
+; table register (VTOR) is initialized to this address if != 0.
+;
+; Cortex-M version
+;
+
+ MODULE ?cstartup
+
+ ;; Forward declaration of sections.
+ SECTION CSTACK:DATA:NOROOT(3)
+
+ SECTION .intvec:CODE:NOROOT(2)
+
+ EXTERN __iar_program_start
+ EXTERN SystemInit
+ PUBLIC __vector_table
+
+ DATA
+__vector_table
+ DCD sfe(CSTACK)
+ DCD Reset_Handler ; Reset Handler
+
+ DCD NMI_Handler ; NMI Handler
+ DCD HardFault_Handler ; Hard Fault Handler
+ DCD MemManage_Handler ; MPU Fault Handler
+ DCD BusFault_Handler ; Bus Fault Handler
+ DCD UsageFault_Handler ; Usage Fault Handler
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD SVC_Handler ; SVCall Handler
+ DCD DebugMon_Handler ; Debug Monitor Handler
+ DCD 0 ; Reserved
+ DCD PendSV_Handler ; PendSV Handler
+ DCD SysTick_Handler ; SysTick Handler
+
+ ; External Interrupts
+ DCD WWDG_IRQHandler ; Window WatchDog
+ DCD PVD_PVM_IRQHandler ; PVD and PVM Interrupt
+ DCD TAMP_STAMP_LSECSS_IRQHandler ; RTC Tamper, TimeStamp Interrupts and LSECSS Interrupts
+ DCD RTC_WKUP_IRQHandler ; RTC Wakeup Interrupt
+ DCD FLASH_IRQHandler ; FLASH global Interrupt
+ DCD RCC_IRQHandler ; RCC Interrupt
+ DCD EXTI0_IRQHandler ; EXTI Line 0 Interrupt
+ DCD EXTI1_IRQHandler ; EXTI Line 1 Interrupt
+ DCD EXTI2_IRQHandler ; EXTI Line 2 Interrupt
+ DCD EXTI3_IRQHandler ; EXTI Line 3 Interrup
+ DCD EXTI4_IRQHandler ; EXTI Line 4 Interrupt
+ DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 Interrupt
+ DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2 Interrupt
+ DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3 Interrupt
+ DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4 Interrupt
+ DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5 Interrupt
+ DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6 Interrupt
+ DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7 Interrupt
+ DCD ADC1_IRQHandler ; ADC1 Interrupt
+ DCD USB_HP_IRQHandler ; USB High Priority Interrupt
+ DCD USB_LP_IRQHandler ; USB Low Priority Interrupt
+ DCD C2SEV_PWR_C2H_IRQHandler ; CPU M0+ SEV Interrupt
+ DCD COMP_IRQHandler ; COMP1 and COMP2 Interrupts
+ DCD EXTI9_5_IRQHandler ; EXTI Lines [9:5] Interrupt
+ DCD TIM1_BRK_IRQHandler ; TIM1 Break Interrupt
+ DCD TIM1_UP_TIM16_IRQHandler ; TIM1 Update and TIM16 global Interrupts
+ DCD TIM1_TRG_COM_TIM17_IRQHandler ; TIM1 Trigger and Communication and TIM17 global Interrupts
+ DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare Interrupt
+ DCD TIM2_IRQHandler ; TIM2 Global Interrupt
+ DCD PKA_IRQHandler ; PKA Interrupt
+ DCD I2C1_EV_IRQHandler ; I2C1 Event Interrupt
+ DCD I2C1_ER_IRQHandler ; I2C1 Error Interrupt
+ DCD I2C3_EV_IRQHandler ; I2C3 Event Interrupt
+ DCD I2C3_ER_IRQHandler ; I2C3 Error Interrupt
+ DCD SPI1_IRQHandler ; SPI1 Interrupt
+ DCD SPI2_IRQHandler ; SPI2 Interrupt
+ DCD USART1_IRQHandler ; USART1 Interrupt
+ DCD LPUART1_IRQHandler ; LPUART1 Interrupt
+ DCD SAI1_IRQHandler ; SAI Interrupt
+ DCD TSC_IRQHandler ; TSC Interrupt
+ DCD EXTI15_10_IRQHandler ; EXTI Lines1[15:10 ]Interrupts
+ DCD RTC_Alarm_IRQHandler ; RTC Alarms (A and B) Interrupt
+ DCD CRS_IRQHandler ; CRS interrupt
+ DCD PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler ; WKUP Interrupt from PWR
+ DCD IPCC_C1_RX_IRQHandler ; IPCC CPU1 RX occupied interrupt
+ DCD IPCC_C1_TX_IRQHandler ; IPCC CPU1 RX free interrupt
+ DCD HSEM_IRQHandler ; HSEM0 Interrupt
+ DCD LPTIM1_IRQHandler ; LPTIM1 Interrupt
+ DCD LPTIM2_IRQHandler ; LPTIM2 Interrupt
+ DCD LCD_IRQHandler ; LCD Interrupt
+ DCD QUADSPI_IRQHandler ; QUADSPI Interrupt
+ DCD AES1_IRQHandler ; AES1 Interrupt
+ DCD AES2_IRQHandler ; AES2 Interrupt
+ DCD RNG_IRQHandler ; RNG1 Interrupt
+ DCD FPU_IRQHandler ; FPU Interrupt
+ DCD DMA2_Channel1_IRQHandler ; DMA2 Channel 1 Interrupt
+ DCD DMA2_Channel2_IRQHandler ; DMA2 Channel 2 Interrupt
+ DCD DMA2_Channel3_IRQHandler ; DMA2 Channel 3 Interrupt
+ DCD DMA2_Channel4_IRQHandler ; DMA2 Channel 4 Interrupt
+ DCD DMA2_Channel5_IRQHandler ; DMA2 Channel 5 Interrupt
+ DCD DMA2_Channel6_IRQHandler ; DMA2 Channel 6 Interrupt
+ DCD DMA2_Channel7_IRQHandler ; DMA2 Channel 7 Interrupt
+ DCD DMAMUX1_OVR_IRQHandler ; DMAMUX overrun Interrupt
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Default interrupt handlers.
+;;
+ THUMB
+
+ PUBWEAK Reset_Handler
+ SECTION .text:CODE:NOROOT:REORDER(2)
+Reset_Handler
+ LDR R0, =SystemInit
+ BLX R0
+ LDR R0, =__iar_program_start
+ BX R0
+
+ PUBWEAK NMI_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+NMI_Handler
+ B NMI_Handler
+
+ PUBWEAK HardFault_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+HardFault_Handler
+ B HardFault_Handler
+
+ PUBWEAK MemManage_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+MemManage_Handler
+ B MemManage_Handler
+
+ PUBWEAK BusFault_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+BusFault_Handler
+ B BusFault_Handler
+
+ PUBWEAK UsageFault_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+UsageFault_Handler
+ B UsageFault_Handler
+
+ PUBWEAK SVC_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SVC_Handler
+ B SVC_Handler
+
+ PUBWEAK DebugMon_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DebugMon_Handler
+ B DebugMon_Handler
+
+ PUBWEAK PendSV_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+PendSV_Handler
+ B PendSV_Handler
+
+ PUBWEAK SysTick_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SysTick_Handler
+ B SysTick_Handler
+
+ PUBWEAK WWDG_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+WWDG_IRQHandler
+ B WWDG_IRQHandler
+
+ PUBWEAK PVD_PVM_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+PVD_PVM_IRQHandler
+ B PVD_PVM_IRQHandler
+
+ PUBWEAK TAMP_STAMP_LSECSS_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TAMP_STAMP_LSECSS_IRQHandler
+ B TAMP_STAMP_LSECSS_IRQHandler
+
+ PUBWEAK RTC_WKUP_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+RTC_WKUP_IRQHandler
+ B RTC_WKUP_IRQHandler
+
+ PUBWEAK FLASH_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+FLASH_IRQHandler
+ B FLASH_IRQHandler
+
+ PUBWEAK RCC_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+RCC_IRQHandler
+ B RCC_IRQHandler
+
+ PUBWEAK EXTI0_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI0_IRQHandler
+ B EXTI0_IRQHandler
+
+ PUBWEAK EXTI1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI1_IRQHandler
+ B EXTI1_IRQHandler
+
+ PUBWEAK EXTI2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI2_IRQHandler
+ B EXTI2_IRQHandler
+
+ PUBWEAK EXTI3_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI3_IRQHandler
+ B EXTI3_IRQHandler
+
+ PUBWEAK EXTI4_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI4_IRQHandler
+ B EXTI4_IRQHandler
+
+ PUBWEAK DMA1_Channel1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel1_IRQHandler
+ B DMA1_Channel1_IRQHandler
+
+ PUBWEAK DMA1_Channel2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel2_IRQHandler
+ B DMA1_Channel2_IRQHandler
+
+ PUBWEAK DMA1_Channel3_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel3_IRQHandler
+ B DMA1_Channel3_IRQHandler
+
+ PUBWEAK DMA1_Channel4_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel4_IRQHandler
+ B DMA1_Channel4_IRQHandler
+
+ PUBWEAK DMA1_Channel5_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel5_IRQHandler
+ B DMA1_Channel5_IRQHandler
+
+ PUBWEAK DMA1_Channel6_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel6_IRQHandler
+ B DMA1_Channel6_IRQHandler
+
+ PUBWEAK DMA1_Channel7_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel7_IRQHandler
+ B DMA1_Channel7_IRQHandler
+
+ PUBWEAK ADC1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+ADC1_IRQHandler
+ B ADC1_IRQHandler
+
+ PUBWEAK USB_HP_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+USB_HP_IRQHandler
+ B USB_HP_IRQHandler
+
+ PUBWEAK USB_LP_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+USB_LP_IRQHandler
+ B USB_LP_IRQHandler
+
+ PUBWEAK C2SEV_PWR_C2H_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+C2SEV_PWR_C2H_IRQHandler
+ B C2SEV_PWR_C2H_IRQHandler
+
+ PUBWEAK COMP_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+COMP_IRQHandler
+ B COMP_IRQHandler
+
+ PUBWEAK EXTI9_5_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI9_5_IRQHandler
+ B EXTI9_5_IRQHandler
+
+ PUBWEAK TIM1_BRK_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM1_BRK_IRQHandler
+ B TIM1_BRK_IRQHandler
+
+ PUBWEAK TIM1_UP_TIM16_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM1_UP_TIM16_IRQHandler
+ B TIM1_UP_TIM16_IRQHandler
+
+ PUBWEAK TIM1_TRG_COM_TIM17_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM1_TRG_COM_TIM17_IRQHandler
+ B TIM1_TRG_COM_TIM17_IRQHandler
+
+ PUBWEAK TIM1_CC_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM1_CC_IRQHandler
+ B TIM1_CC_IRQHandler
+
+ PUBWEAK TIM2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM2_IRQHandler
+ B TIM2_IRQHandler
+
+ PUBWEAK PKA_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+PKA_IRQHandler
+ B PKA_IRQHandler
+
+ PUBWEAK I2C1_EV_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+I2C1_EV_IRQHandler
+ B I2C1_EV_IRQHandler
+
+ PUBWEAK I2C1_ER_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+I2C1_ER_IRQHandler
+ B I2C1_ER_IRQHandler
+
+ PUBWEAK I2C3_EV_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+I2C3_EV_IRQHandler
+ B I2C3_EV_IRQHandler
+
+ PUBWEAK I2C3_ER_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+I2C3_ER_IRQHandler
+ B I2C3_ER_IRQHandler
+
+ PUBWEAK SPI1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SPI1_IRQHandler
+ B SPI1_IRQHandler
+
+ PUBWEAK SPI2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SPI2_IRQHandler
+ B SPI2_IRQHandler
+
+ PUBWEAK USART1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+USART1_IRQHandler
+ B USART1_IRQHandler
+
+ PUBWEAK LPUART1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+LPUART1_IRQHandler
+ B LPUART1_IRQHandler
+
+ PUBWEAK SAI1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SAI1_IRQHandler
+ B SAI1_IRQHandler
+
+ PUBWEAK TSC_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TSC_IRQHandler
+ B TSC_IRQHandler
+
+ PUBWEAK EXTI15_10_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI15_10_IRQHandler
+ B EXTI15_10_IRQHandler
+
+ PUBWEAK RTC_Alarm_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+RTC_Alarm_IRQHandler
+ B RTC_Alarm_IRQHandler
+
+ PUBWEAK CRS_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+CRS_IRQHandler
+ B CRS_IRQHandler
+
+ PUBWEAK PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler
+ B PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler
+
+ PUBWEAK IPCC_C1_RX_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+IPCC_C1_RX_IRQHandler
+ B IPCC_C1_RX_IRQHandler
+
+ PUBWEAK IPCC_C1_TX_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+IPCC_C1_TX_IRQHandler
+ B IPCC_C1_TX_IRQHandler
+
+ PUBWEAK HSEM_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+HSEM_IRQHandler
+ B HSEM_IRQHandler
+
+ PUBWEAK LPTIM1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+LPTIM1_IRQHandler
+ B LPTIM1_IRQHandler
+
+ PUBWEAK LPTIM2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+LPTIM2_IRQHandler
+ B LPTIM2_IRQHandler
+
+ PUBWEAK LCD_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+LCD_IRQHandler
+ B LCD_IRQHandler
+
+ PUBWEAK QUADSPI_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+QUADSPI_IRQHandler
+ B QUADSPI_IRQHandler
+
+ PUBWEAK AES1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+AES1_IRQHandler
+ B AES1_IRQHandler
+
+ PUBWEAK AES2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+AES2_IRQHandler
+ B AES2_IRQHandler
+
+ PUBWEAK RNG_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+RNG_IRQHandler
+ B RNG_IRQHandler
+
+ PUBWEAK FPU_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+FPU_IRQHandler
+ B FPU_IRQHandler
+
+ PUBWEAK DMA2_Channel1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel1_IRQHandler
+ B DMA2_Channel1_IRQHandler
+
+ PUBWEAK DMA2_Channel2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel2_IRQHandler
+ B DMA2_Channel2_IRQHandler
+
+ PUBWEAK DMA2_Channel3_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel3_IRQHandler
+ B DMA2_Channel3_IRQHandler
+
+ PUBWEAK DMA2_Channel4_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel4_IRQHandler
+ B DMA2_Channel4_IRQHandler
+
+ PUBWEAK DMA2_Channel5_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel5_IRQHandler
+ B DMA2_Channel5_IRQHandler
+
+ PUBWEAK DMA2_Channel6_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel6_IRQHandler
+ B DMA2_Channel6_IRQHandler
+
+ PUBWEAK DMA2_Channel7_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel7_IRQHandler
+ B DMA2_Channel7_IRQHandler
+
+ PUBWEAK DMAMUX1_OVR_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMAMUX1_OVR_IRQHandler
+ B DMAMUX1_OVR_IRQHandler
+
+ END
+
+;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE*****
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/EWARM/stm32wb55xx_flash_cm4.icf b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/EWARM/stm32wb55xx_flash_cm4.icf
new file mode 100644
index 000000000..5f36da686
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/EWARM/stm32wb55xx_flash_cm4.icf
@@ -0,0 +1,40 @@
+/*###ICF### Section handled by ICF editor, don't touch! ****/
+/*-Editor annotation file-*/
+/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
+/*-Specials-*/
+define symbol __ICFEDIT_intvec_start__ = 0x08000000;
+/*-Memory Regions-*/
+/***** FLASH Part dedicated to M4 *****/
+define symbol __ICFEDIT_region_ROM_start__ = 0x08000000;
+define symbol __ICFEDIT_region_ROM_end__ = 0x0807FFFF;
+define symbol __ICFEDIT_region_RAM_start__ = 0x20000004;
+define symbol __ICFEDIT_region_RAM_end__ = 0x2002FFFF;
+/*-Sizes-*/
+define symbol __ICFEDIT_size_cstack__ = 0x1000;
+define symbol __ICFEDIT_size_heap__ = 0x400;
+/**** End of ICF editor section. ###ICF###*/
+
+define symbol __ICFEDIT_region_RAM_SHARED_start__ = 0x20030000;
+define symbol __ICFEDIT_region_RAM_SHARED_end__ = 0x200327FF;
+
+define memory mem with size = 4G;
+define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
+define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
+define region RAM_SHARED_region = mem:[from __ICFEDIT_region_RAM_SHARED_start__ to __ICFEDIT_region_RAM_SHARED_end__];
+
+define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
+define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
+
+/* MB_MEM1 and MB_MEM2 are sections reserved to mailbox communication. It is placed in the shared memory */
+initialize by copy { readwrite };
+do not initialize { section .noinit,
+ section MAPPING_TABLE,
+ section MB_MEM1 };
+
+place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
+
+place in ROM_region { readonly };
+place in RAM_region { readwrite,block CSTACK, block HEAP };
+place in RAM_SHARED_region { first section MAPPING_TABLE};
+place in RAM_SHARED_region { section MB_MEM1};
+place in RAM_SHARED_region { section MB_MEM2};
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/EWARM/stm32wb55xx_sram_cm4.icf b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/EWARM/stm32wb55xx_sram_cm4.icf
new file mode 100644
index 000000000..36cf3e51a
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/EWARM/stm32wb55xx_sram_cm4.icf
@@ -0,0 +1,39 @@
+/*###ICF### Section handled by ICF editor, don't touch! ****/
+/*-Editor annotation file-*/
+/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
+/*-Specials-*/
+define symbol __ICFEDIT_intvec_start__ = 0x20000000;
+/*-Memory Regions-*/
+/***** RAM dedicated to M4 *****/
+define symbol __ICFEDIT_region_ROM_start__ = 0x20000000;
+define symbol __ICFEDIT_region_ROM_end__ = 0x20017FFF;
+
+define symbol __ICFEDIT_region_RAM_start__ = 0x20018000 ;
+define symbol __ICFEDIT_region_RAM_end__ = 0x2002FFFF ;
+
+/***** RAM2a *****/
+define symbol __ICFEDIT_region_RAM_SHARED_start__ = 0x20030000 ;
+define symbol __ICFEDIT_region_RAM_SHARED_end__ = 0x20037FFF ;
+
+/*-Sizes-*/
+define symbol __ICFEDIT_size_cstack__ = 0x1000;
+define symbol __ICFEDIT_size_heap__ = 0x400;
+/**** End of ICF editor section. ###ICF###*/
+
+
+define memory mem with size = 4G;
+define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
+define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
+
+
+define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
+define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
+
+initialize by copy { readwrite };
+do not initialize { section .noinit };
+
+place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
+
+place in ROM_region { readonly };
+place in RAM_region { readwrite,
+ block CSTACK, block HEAP };
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/STM32_WPAN/App/app_thread.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/STM32_WPAN/App/app_thread.c
new file mode 100644
index 000000000..d5afa89f0
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/STM32_WPAN/App/app_thread.c
@@ -0,0 +1,1314 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : App/app_thread.c
+ * Description : Thread Application.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "utilities_common.h"
+#include "app_entry.h"
+#include "dbg_trace.h"
+#include "app_thread.h"
+#include "stm32wbxx_core_interface_def.h"
+#include "openthread_api_wb.h"
+#include "shci.h"
+#include "stm_logging.h"
+#include "app_conf.h"
+#include "stm32_lpm.h"
+#include "stm32_seq.h"
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+#include "vcp.h"
+#include "vcp_conf.h"
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+
+/* Private includes -----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN PTD */
+/**
+ * @brief APP_THREAD Status structures definition
+ */
+typedef enum
+{
+ APP_THREAD_OK = 0x00,
+ APP_THREAD_ERROR = 0x01,
+} APP_THREAD_StatusTypeDef;
+/* USER CODE END PTD */
+
+/* Private defines -----------------------------------------------------------*/
+#define C_SIZE_CMD_STRING 256U
+#define C_PANID 0x1111U
+#define C_CHANNEL_NB 15U
+
+/* USER CODE BEGIN PD */
+#define C_RESSOURCE_FUOTA_PROVISIONING "FUOTA_PROVISIONING"
+#define C_RESSOURCE_FUOTA_PARAMETERS "FUOTA_PARAMETERS"
+#define C_RESSOURCE_FUOTA_SEND "FUOTA_SEND"
+
+#define FUOTA_NUMBER_WORDS_64BITS 50
+#define FUOTA_PAYLOAD_SIZE FUOTA_NUMBER_WORDS_64BITS * 8
+
+#define LED_TOGGLE_TIMING (0.1*1000*1000/CFG_TS_TICK_VAL) /**< 0.5s */
+
+typedef void (*CoapRespHandlerCallback) (otCoapHeader * pHeader, otMessage * pMessage,const otMessageInfo * pMessageInfo,otError Result);
+/* USER CODE END PD */
+
+/* Private macros ------------------------------------------------------------*/
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private function prototypes -----------------------------------------------*/
+static void APP_THREAD_CheckWirelessFirmwareInfo(void);
+static void APP_THREAD_DeviceConfig(void);
+static void APP_THREAD_StateNotif(uint32_t NotifFlags, void *pContext);
+static void APP_THREAD_TraceError(const char * pMess, uint32_t ErrCode);
+#if (CFG_FULL_LOW_POWER == 0)
+static void Send_CLI_To_M0(void);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+static void Send_CLI_Ack_For_OT(void);
+static void HostTxCb( void );
+static void Wait_Getting_Ack_From_M0(void);
+static void Receive_Ack_From_M0(void);
+static void Receive_Notification_From_M0(void);
+#if (CFG_HW_LPUART1_ENABLED == 1)
+extern void MX_LPUART1_UART_Init(void);
+#endif
+#if (CFG_HW_USART1_ENABLED == 1)
+extern void MX_USART1_UART_Init(void);
+#endif
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+static uint32_t ProcessCmdString(uint8_t* buf , uint32_t len);
+#else
+#if (CFG_FULL_LOW_POWER == 0)
+static void RxCpltCallback(void);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+
+/* USER CODE BEGIN PFP */
+static void Delete_Sectors( void );
+
+static void APP_THREAD_DummyReqHandler(void * p_context,
+ otCoapHeader * pHeader,
+ otMessage * pMessage,
+ const otMessageInfo * pMessageInfo);
+
+static void APP_THREAD_CoapReqHandlerFuotaProvisioning(otCoapHeader * pHeader,
+ otMessage * pMessage,
+ const otMessageInfo * pMessageInfo);
+static void APP_THREAD_ProvisioningRespSend(otCoapHeader * pRequestHeader,
+ const otMessageInfo * pMessageInfo);
+
+static void APP_THREAD_CoapReqHandlerFuota(otCoapHeader * pHeader,
+ otMessage * pMessage,
+ const otMessageInfo * pMessageInfo);
+static void APP_THREAD_CoapSendDataResponseFuota(otCoapHeader * pRequestHeader,
+ const otMessageInfo * pMessageInfo);
+
+static void APP_THREAD_CoapReqHandlerFuotaParameters(otCoapHeader * pHeader,
+ otMessage * pMessage,
+ const otMessageInfo * pMessageInfo);
+static void APP_THREAD_CoapSendRespFuotaParameters(otCoapHeader * pRequestHeader,
+ const otMessageInfo * pMessageInfo,
+ uint8_t * pData);
+static void APP_THREAD_PerformReset(void);
+static void APP_THREAD_TimingElapsed(void);
+static APP_THREAD_StatusTypeDef APP_THREAD_CheckDeviceCapabilities(void);
+/* USER CODE END PFP */
+
+/* Private variables -----------------------------------------------*/
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+static uint8_t TmpString[C_SIZE_CMD_STRING];
+static uint8_t VcpRxBuffer[sizeof(TL_CmdSerial_t)]; /* Received Data over USB are stored in this buffer */
+static uint8_t VcpTxBuffer[sizeof(TL_EvtPacket_t) + 254U]; /* Transmit buffer over USB */
+#else
+#if (CFG_FULL_LOW_POWER == 0)
+static uint8_t aRxBuffer[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+
+#if (CFG_FULL_LOW_POWER == 0)
+static uint8_t CommandString[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+static __IO uint16_t indexReceiveChar = 0;
+static __IO uint16_t CptReceiveCmdFromUser = 0;
+
+static TL_CmdPacket_t *p_thread_otcmdbuffer;
+static TL_EvtPacket_t *p_thread_notif_M0_to_M4;
+static __IO uint32_t CptReceiveMsgFromM0 = 0;
+PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static TL_TH_Config_t ThreadConfigBuffer;
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static TL_CmdPacket_t ThreadOtCmdBuffer;
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t ThreadNotifRspEvtBuffer[sizeof(TL_PacketHeader_t) + TL_EVT_HDR_SIZE + 255U];
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static TL_CmdPacket_t ThreadCliCmdBuffer;
+
+/* USER CODE BEGIN PV */
+static otCoapResource OT_RessourceFuotaProvisioning = {C_RESSOURCE_FUOTA_PROVISIONING, APP_THREAD_DummyReqHandler, (void*)APP_THREAD_CoapReqHandlerFuotaProvisioning, NULL};
+static otCoapResource OT_RessourceFuotaParameters = {C_RESSOURCE_FUOTA_PARAMETERS, APP_THREAD_DummyReqHandler, (void*)APP_THREAD_CoapReqHandlerFuotaParameters, NULL};
+static otCoapResource OT_RessourceFuotaSend = {C_RESSOURCE_FUOTA_SEND, APP_THREAD_DummyReqHandler, (void*)APP_THREAD_CoapReqHandlerFuota, NULL};
+
+static uint8_t OT_Command = 0;
+static otMessageInfo OT_MessageInfo = {0};
+static otCoapHeader OT_Header = {0};
+static otMessage* pOT_Message = NULL;
+
+static uint8_t TimerID;
+static uint32_t FuotaBinData_index = 0;
+static uint64_t FuotaTransferArray[FUOTA_NUMBER_WORDS_64BITS] = {0};
+static APP_THREAD_OtaContext_t OtaContext;
+static uint32_t flash_current_offset = 0;
+/* USER CODE END PV */
+
+/* Functions Definition ------------------------------------------------------*/
+
+void APP_THREAD_Init( void )
+{
+ /* USER CODE BEGIN APP_THREAD_INIT_1 */
+ APP_DBG("Thread_Ota Application");
+
+ /**
+ * This is a safe clear in case the engi bytes are not all written
+ * The error flag should be cleared before moving forward
+ */
+ __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_OPTVERR);
+
+ APP_DBG("Delete_Sectors");
+ Delete_Sectors();
+ /* USER CODE END APP_THREAD_INIT_1 */
+
+ SHCI_CmdStatus_t ThreadInitStatus;
+
+ /* Check the compatibility with the Coprocessor Wireless Firmware loaded */
+ APP_THREAD_CheckWirelessFirmwareInfo();
+
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+ VCP_Init(&VcpTxBuffer[0], &VcpRxBuffer[0]);
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+
+ /* Register cmdbuffer */
+ APP_THREAD_RegisterCmdBuffer(&ThreadOtCmdBuffer);
+
+ /**
+ * Do not allow standby in the application
+ */
+ UTIL_LPM_SetOffMode(1 << CFG_LPM_APP_THREAD, UTIL_LPM_DISABLE);
+
+ /* Init config buffer and call TL_THREAD_Init */
+ APP_THREAD_TL_THREAD_INIT();
+
+ /* Configure UART for sending CLI command from M4 */
+ APP_THREAD_Init_UART_CLI();
+
+ /* Send Thread start system cmd to M0 */
+ ThreadInitStatus = SHCI_C2_THREAD_Init();
+
+ /* Prevent unused argument(s) compilation warning */
+ UNUSED(ThreadInitStatus);
+
+ /* Register task */
+ /* Create the different tasks */
+ UTIL_SEQ_RegTask( 1<<(uint32_t)CFG_TASK_MSG_FROM_M0_TO_M4, UTIL_SEQ_RFU, APP_THREAD_ProcessMsgM0ToM4);
+
+ /* USER CODE BEGIN INIT TASKS */
+ UTIL_SEQ_RegTask( 1<<(uint32_t)CFG_TASK_FUOTA_RESET, UTIL_SEQ_RFU, APP_THREAD_PerformReset);
+ HW_TS_Create(CFG_TIM_PROC_ID_ISR, &TimerID, hw_ts_Repeated, APP_THREAD_TimingElapsed);
+ /* USER CODE END INIT TASKS */
+
+ /* Initialize and configure the Thread device*/
+ APP_THREAD_DeviceConfig();
+
+ /* USER CODE BEGIN APP_THREAD_INIT_2 */
+
+ /* USER CODE END APP_THREAD_INIT_2 */
+}
+
+/**
+ * @brief Trace the error or the warning reported.
+ * @param ErrId :
+ * @param ErrCode
+ * @retval None
+ */
+void APP_THREAD_Error(uint32_t ErrId, uint32_t ErrCode)
+{
+ /* USER CODE BEGIN APP_THREAD_Error_1 */
+
+ /* USER CODE END APP_THREAD_Error_1 */
+ switch(ErrId)
+ {
+ case ERR_REC_MULTI_MSG_FROM_M0 :
+ APP_THREAD_TraceError("ERROR : ERR_REC_MULTI_MSG_FROM_M0 ", ErrCode);
+ break;
+ case ERR_THREAD_SET_STATE_CB :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_SET_STATE_CB ",ErrCode);
+ break;
+ case ERR_THREAD_SET_CHANNEL :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_SET_CHANNEL ",ErrCode);
+ break;
+ case ERR_THREAD_SET_PANID :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_SET_PANID ",ErrCode);
+ break;
+ case ERR_THREAD_IPV6_ENABLE :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_IPV6_ENABLE ",ErrCode);
+ break;
+ case ERR_THREAD_START :
+ APP_THREAD_TraceError("ERROR: ERR_THREAD_START ", ErrCode);
+ break;
+ case ERR_THREAD_ERASE_PERSISTENT_INFO :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_ERASE_PERSISTENT_INFO ",ErrCode);
+ break;
+ case ERR_THREAD_CHECK_WIRELESS :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_CHECK_WIRELESS ",ErrCode);
+ break;
+ /* USER CODE BEGIN APP_THREAD_Error_2 */
+ case ERR_THREAD_COAP_START :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_COAP_START ",ErrCode);
+ break;
+ case ERR_THREAD_COAP_ADD_RESSOURCE :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_COAP_ADD_RESSOURCE ",ErrCode);
+ break;
+ case ERR_THREAD_MESSAGE_READ :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_MESSAGE_READ ",ErrCode);
+ break;
+ case ERR_THREAD_COAP_SEND_RESPONSE :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_COAP_SEND_RESPONSE ",ErrCode);
+ break;
+ case ERR_THREAD_COAP_APPEND :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_COAP_APPEND ",ErrCode);
+ break;
+ case ERR_THREAD_COAP_SEND_REQUEST :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_COAP_SEND_REQUEST ",ErrCode);
+ break;
+ case ERR_THREAD_MSG_COMPARE_FAILED:
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_MSG_COMPARE_FAILED ",ErrCode);
+ break;
+ /* USER CODE END APP_THREAD_Error_2 */
+ default :
+ APP_THREAD_TraceError("ERROR Unknown ", 0);
+ break;
+ }
+}
+
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+
+/**
+ * @brief Thread initialization.
+ * @param None
+ * @retval None
+ */
+static void APP_THREAD_DeviceConfig(void)
+{
+ otError error;
+ error = otInstanceErasePersistentInfo(NULL);
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_ERASE_PERSISTENT_INFO,error);
+ }
+ otInstanceFinalize(NULL);
+ otInstanceInitSingle();
+ error = otSetStateChangedCallback(NULL, APP_THREAD_StateNotif, NULL);
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_SET_STATE_CB,error);
+ }
+ error = otLinkSetChannel(NULL, C_CHANNEL_NB);
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_SET_CHANNEL,error);
+ }
+ error = otLinkSetPanId(NULL, C_PANID);
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_SET_PANID,error);
+ }
+ error = otIp6SetEnabled(NULL, true);
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_IPV6_ENABLE,error);
+ }
+ error = otThreadSetEnabled(NULL, true);
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_START,error);
+ }
+
+ /* USER CODE BEGIN DEVICECONFIG */
+ /* Start the COAP server */
+ error = otCoapStart(NULL, OT_DEFAULT_COAP_PORT);
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_COAP_START,error);
+ }
+ /* Add COAP resources */
+ error = otCoapAddResource(NULL, &OT_RessourceFuotaProvisioning);
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_COAP_ADD_RESSOURCE,error);
+ }
+ error = otCoapAddResource(NULL, &OT_RessourceFuotaParameters);
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_COAP_ADD_RESSOURCE,error);
+ }
+ error = otCoapAddResource(NULL, &OT_RessourceFuotaSend);
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_COAP_ADD_RESSOURCE,error);
+ }
+ /* USER CODE END DEVICECONFIG */
+}
+
+/**
+ * @brief Thread notification when the state changes.
+ * @param aFlags : Define the item that has been modified
+ * aContext: Context
+ *
+ * @retval None
+ */
+static void APP_THREAD_StateNotif(uint32_t NotifFlags, void *pContext)
+{
+ /* Prevent unused argument(s) compilation warning */
+ UNUSED(pContext);
+
+ /* USER CODE BEGIN APP_THREAD_STATENOTIF */
+
+ /* USER CODE END APP_THREAD_STATENOTIF */
+
+ if ((NotifFlags & (uint32_t)OT_CHANGED_THREAD_ROLE) == (uint32_t)OT_CHANGED_THREAD_ROLE)
+ {
+ switch (otThreadGetDeviceRole(NULL))
+ {
+ case OT_DEVICE_ROLE_DISABLED:
+ /* USER CODE BEGIN OT_DEVICE_ROLE_DISABLED */
+ BSP_LED_Off(LED2);
+ BSP_LED_Off(LED3);
+ /* USER CODE END OT_DEVICE_ROLE_DISABLED */
+ break;
+ case OT_DEVICE_ROLE_DETACHED:
+ /* USER CODE BEGIN OT_DEVICE_ROLE_DETACHED */
+ BSP_LED_Off(LED2);
+ BSP_LED_Off(LED3);
+ /* USER CODE END OT_DEVICE_ROLE_DETACHED */
+ break;
+ case OT_DEVICE_ROLE_CHILD:
+ /* USER CODE BEGIN OT_DEVICE_ROLE_CHILD */
+ BSP_LED_Off(LED2);
+ BSP_LED_On(LED3);
+ /* USER CODE END OT_DEVICE_ROLE_CHILD */
+ break;
+ case OT_DEVICE_ROLE_ROUTER :
+ /* USER CODE BEGIN OT_DEVICE_ROLE_ROUTER */
+ BSP_LED_Off(LED2);
+ BSP_LED_On(LED3);
+ /* USER CODE END OT_DEVICE_ROLE_ROUTER */
+ break;
+ case OT_DEVICE_ROLE_LEADER :
+ /* USER CODE BEGIN OT_DEVICE_ROLE_LEADER */
+ BSP_LED_On(LED2);
+ BSP_LED_Off(LED3);
+ /* USER CODE END OT_DEVICE_ROLE_LEADER */
+ break;
+ default:
+ /* USER CODE BEGIN DEFAULT */
+ BSP_LED_Off(LED2);
+ BSP_LED_Off(LED3);
+ /* USER CODE END DEFAULT */
+ break;
+ }
+ }
+}
+
+/**
+ * @brief Warn the user that an error has occurred.In this case,
+ * the LEDs on the Board will start blinking.
+ *
+ * @param pMess : Message associated to the error.
+ * @param ErrCode: Error code associated to the module (OpenThread or other module if any)
+ * @retval None
+ */
+static void APP_THREAD_TraceError(const char * pMess, uint32_t ErrCode)
+{
+ /* USER CODE BEGIN TRACE_ERROR */
+ APP_DBG("**** Fatal error = %s (Err = %d)", pMess, ErrCode);
+ while(1U == 1U)
+ {
+ BSP_LED_Toggle(LED1);
+ HAL_Delay(500U);
+ BSP_LED_Toggle(LED2);
+ HAL_Delay(500U);
+ BSP_LED_Toggle(LED3);
+ HAL_Delay(500U);
+ }
+ /* USER CODE END TRACE_ERROR */
+}
+
+/**
+ * @brief Check if the Coprocessor Wireless Firmware loaded supports Thread
+ * and display associated informations
+ * @param None
+ * @retval None
+ */
+static void APP_THREAD_CheckWirelessFirmwareInfo(void)
+{
+ WirelessFwInfo_t wireless_info_instance;
+ WirelessFwInfo_t* p_wireless_info = &wireless_info_instance;
+
+ if (SHCI_GetWirelessFwInfo(p_wireless_info) != SHCI_Success)
+ {
+ APP_THREAD_Error((uint32_t)ERR_THREAD_CHECK_WIRELESS, (uint32_t)ERR_INTERFACE_FATAL);
+ }
+ else
+ {
+ APP_DBG("**********************************************************");
+ APP_DBG("WIRELESS COPROCESSOR FW:");
+ /* Print version */
+ APP_DBG("VERSION ID = %d.%d.%d", p_wireless_info->VersionMajor, p_wireless_info->VersionMinor, p_wireless_info->VersionSub);
+
+ switch(p_wireless_info->StackType)
+ {
+ case INFO_STACK_TYPE_THREAD_FTD :
+ APP_DBG("FW Type : Thread FTD");
+ break;
+ case INFO_STACK_TYPE_THREAD_MTD :
+ APP_DBG("FW Type : Thread MTD");
+ break;
+ case INFO_STACK_TYPE_BLE_THREAD_FTD_STATIC :
+ APP_DBG("FW Type : Static Concurrent Mode BLE/Thread");
+ break;
+ default :
+ /* No Thread device supported ! */
+ APP_THREAD_Error((uint32_t)ERR_THREAD_CHECK_WIRELESS, (uint32_t)ERR_INTERFACE_FATAL);
+ break;
+ }
+ APP_DBG("**********************************************************");
+ }
+}
+/* USER CODE BEGIN FD_LOCAL_FUNCTIONS */
+static void Delete_Sectors( void )
+{
+ /**
+ * The number of sectors to erase is read from SRAM1.
+ * It shall be checked whether the number of sectors to erase does not overlap on the secured Flash
+ * The limit can be read from the SFSA option byte which provides the first secured sector address.
+ */
+
+ uint32_t page_error;
+ FLASH_EraseInitTypeDef p_erase_init;
+ uint32_t first_secure_sector_idx;
+
+ first_secure_sector_idx = (READ_BIT(FLASH->SFR, FLASH_SFR_SFSA) >> FLASH_SFR_SFSA_Pos);
+
+ p_erase_init.TypeErase = FLASH_TYPEERASE_PAGES;
+ p_erase_init.Page = *((uint8_t*) SRAM1_BASE + 1);
+ if(p_erase_init.Page < (CFG_APP_START_SECTOR_INDEX - 1))
+ {
+ /**
+ * Something has been wrong as there is no case we should delete the BLE_Ota application
+ * Reboot on the firmware application
+ */
+ *(uint8_t*)SRAM1_BASE = CFG_REBOOT_ON_FW_APP;
+ NVIC_SystemReset();
+ }
+ p_erase_init.NbPages = *((uint8_t*) SRAM1_BASE + 2);
+
+ if ((p_erase_init.Page + p_erase_init.NbPages) > first_secure_sector_idx)
+ {
+ p_erase_init.NbPages = first_secure_sector_idx - p_erase_init.Page;
+ }
+
+ APP_DBG("SFSA Option Bytes set to sector = %d (0x080%x)", first_secure_sector_idx, first_secure_sector_idx*4096);
+ APP_DBG("Erase FLASH Memory from sector %d (0x080%x) to sector %d (0x080%x)", p_erase_init.Page, p_erase_init.Page*4096, p_erase_init.NbPages+p_erase_init.Page, (p_erase_init.NbPages+p_erase_init.Page)*4096);
+
+ HAL_FLASH_Unlock();
+
+ HAL_FLASHEx_Erase(&p_erase_init, &page_error);
+
+ HAL_FLASH_Lock();
+
+ return;
+}
+
+/**
+ * @brief Dummy request handler
+ *
+ * @param None
+ * @retval None
+ */
+static void APP_THREAD_DummyReqHandler(void * p_context,
+ otCoapHeader * pHeader,
+ otMessage * pMessage,
+ const otMessageInfo * pMessageInfo)
+{
+}
+
+/**
+ * @brief Handler called when the server receives a COAP request.
+ *
+ * @param pHeader : Header
+ * @param pMessage : Message
+ * @param pMessageInfo : Message information
+ * @retval None
+ */
+static void APP_THREAD_CoapReqHandlerFuotaProvisioning(otCoapHeader * pHeader,
+ otMessage * pMessage,
+ const otMessageInfo * pMessageInfo)
+{
+ APP_DBG(" Received CoAP request on FUOTA_PROVISIONING ressource");
+
+ if (otCoapHeaderGetType(pHeader) == OT_COAP_TYPE_NON_CONFIRMABLE &&
+ otCoapHeaderGetCode(pHeader) == OT_COAP_CODE_GET)
+ {
+ OT_MessageInfo = *pMessageInfo;
+ memset(&OT_MessageInfo.mSockAddr, 0, sizeof(OT_MessageInfo.mSockAddr));
+ APP_THREAD_ProvisioningRespSend(pHeader, pMessageInfo);
+ }
+}
+
+/**
+ * @brief This function acknowledges the data reception by sending an ACK
+ * back to the sender.
+ * @param pRequestHeader coap header
+ * @param pMessageInfo message info pointer
+ * @retval None
+ */
+static void APP_THREAD_ProvisioningRespSend(otCoapHeader * pRequestHeader,
+ const otMessageInfo * pMessageInfo)
+{
+ otError error = OT_ERROR_NONE;
+
+ do{
+ APP_DBG("Provisiong: Send CoAP response");
+ otCoapHeaderInit(&OT_Header, OT_COAP_TYPE_NON_CONFIRMABLE, OT_COAP_CODE_CONTENT);
+ otCoapHeaderSetToken(&OT_Header,
+ otCoapHeaderGetToken(pRequestHeader),
+ otCoapHeaderGetTokenLength(pRequestHeader));
+ otCoapHeaderSetPayloadMarker(&OT_Header);
+
+ pOT_Message = otCoapNewMessage(NULL, &OT_Header);
+ if (pOT_Message == NULL)
+ {
+ APP_THREAD_Error(ERR_THREAD_COAP_APPEND_MSG, error);
+ break;
+ }
+
+ error = otMessageAppend(pOT_Message, &OT_Command, sizeof(OT_Command));
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_COAP_APPEND_MSG, error);
+ }
+
+ error = otMessageAppend(pOT_Message, otThreadGetMeshLocalEid(NULL), sizeof(otIp6Address));
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_COAP_ALLOC_MSG, error);
+ break;
+ }
+
+ error = otCoapSendResponse(NULL, pOT_Message, pMessageInfo);
+ if (error != OT_ERROR_NONE && pOT_Message != NULL)
+ {
+ otMessageFree(pOT_Message);
+ APP_THREAD_Error(ERR_THREAD_COAP_DATA_RESPONSE,error);
+ }
+ }while(false);
+}
+
+/**
+ * @brief Handler called when the server receives a COAP request.
+ *
+ * @param pHeader : Header
+ * @param pMessage : Message
+ * @param pMessageInfo : Message information
+ * @retval None
+ */
+static void APP_THREAD_CoapReqHandlerFuotaParameters(otCoapHeader * pHeader,
+ otMessage * pMessage,
+ const otMessageInfo * pMessageInfo)
+{
+ if (otMessageRead(pMessage, otMessageGetOffset(pMessage), &OtaContext, sizeof(OtaContext)) != sizeof(OtaContext))
+ {
+ APP_THREAD_Error(ERR_THREAD_MESSAGE_READ, 0);
+ }
+
+ /* Display Ota_Context values */
+ if(OtaContext.file_type == APP_THREAD_OTA_FILE_TYPE_FW_APP)
+ {
+ APP_DBG("FUOTA_PARAMETERS: File Type set to : FW_APP");
+ }
+ else if (OtaContext.file_type == APP_THREAD_OTA_FILE_TYPE_FW_COPRO_WIRELESS)
+ {
+ APP_DBG("FUOTA_PARAMETERS: File Type set to : FW_COPRO_WIRELESS");
+ }
+ else
+ {
+ APP_DBG("FUOTA_PARAMETERS: File Type not recognized");
+ APP_THREAD_Error(ERR_THREAD_FUOTA_FILE_TYPE_NOT_RECOGNIZED, 0);
+ }
+
+ APP_DBG("FUOTA_PARAMETERS: Binary Size = 0x%x", OtaContext.binary_size);
+ APP_DBG("FUOTA_PARAMETERS: Address = 0x%x", OtaContext.base_address);
+ APP_DBG("FUOTA_PARAMETERS: Magic Keyword = 0x%x", OtaContext.magic_keyword);
+
+ /* Check if Device can be updated with Fuota Server request */
+ if (APP_THREAD_CheckDeviceCapabilities() == APP_THREAD_OK)
+ {
+ OT_Command = APP_THREAD_OK;
+ HW_TS_Start(TimerID, (uint32_t)LED_TOGGLE_TIMING);
+ }
+ else
+ {
+ OT_Command = APP_THREAD_ERROR;
+ APP_DBG("WARNING: Current Device capabilities cannot handle FUOTA. Check memory size available!");
+ }
+ /* If Message is Confirmable, send response */
+ if (otCoapHeaderGetType(pHeader) == OT_COAP_TYPE_CONFIRMABLE)
+ {
+ APP_THREAD_CoapSendRespFuotaParameters(pHeader, pMessageInfo, &OT_Command);
+ }
+}
+
+static APP_THREAD_StatusTypeDef APP_THREAD_CheckDeviceCapabilities(void)
+{
+ APP_THREAD_StatusTypeDef status = APP_THREAD_OK;
+
+ /* Get Flash memory size available to copy binary from Server */
+ uint32_t first_sector_idx;
+ uint32_t first_secure_sector_idx;
+ uint32_t free_sectors;
+ uint32_t free_size;
+
+ APP_DBG("Check Device capabilities");
+
+ first_secure_sector_idx = (READ_BIT(FLASH->SFR, FLASH_SFR_SFSA) >> FLASH_SFR_SFSA_Pos);
+ APP_DBG("SFSA Option Bytes set to sector = %d (0x080%x)", first_secure_sector_idx, first_secure_sector_idx*4096);
+
+ first_sector_idx = *((uint8_t*) SRAM1_BASE + 1);
+ if (first_sector_idx == 0)
+ {
+ APP_DBG("ERROR : SRAM1_BASE + 1 == 0");
+ first_sector_idx = CFG_APP_START_SECTOR_INDEX;
+ }
+ APP_DBG("First available sector = %d (0x080%x)", first_sector_idx, first_sector_idx*4096);
+
+ free_sectors = first_secure_sector_idx - first_sector_idx;
+ free_size = free_sectors*4096;
+
+ APP_DBG("free_sectors = %d , -> %d bytes of FLASH Free", free_sectors, free_size);
+
+ APP_DBG("Server requests : %d bytes", OtaContext.binary_size);
+ APP_DBG("Client Free memory : %d bytes", free_size);
+
+ if (free_size < OtaContext.binary_size)
+ {
+ status = APP_THREAD_ERROR;
+ APP_DBG("WARNING: Not enough Free Flash Memory available to download binary from Server!");
+ }
+ else
+ {
+ APP_DBG("Device contains enough Flash Memory to download binary");
+ }
+
+ return status;
+}
+
+/**
+ * @brief Handler called when the server receives a COAP request.
+ *
+ * @param pHeader : Header
+ * @param pMessage : Message
+ * @param pMessageInfo : Message information
+ * @retval None
+ */
+static void APP_THREAD_CoapReqHandlerFuota(otCoapHeader * pHeader,
+ otMessage * pMessage,
+ const otMessageInfo * pMessageInfo)
+{
+ bool l_end_full_bin_transfer = FALSE;
+ uint32_t flash_index = 0;
+ uint64_t l_read64 = 0;
+
+ if (otMessageRead(pMessage, otMessageGetOffset(pMessage), &FuotaTransferArray, FUOTA_PAYLOAD_SIZE) != FUOTA_PAYLOAD_SIZE)
+ {
+ APP_THREAD_Error(ERR_THREAD_MESSAGE_READ, 0);
+ }
+
+ /* Test if magic Keyword is in FuotaBinData */
+ for (int index = 0; index < FUOTA_NUMBER_WORDS_64BITS; ++index) {
+ if((FuotaTransferArray[index] & 0x00000000FFFFFFFF) == OtaContext.magic_keyword)
+ {
+ APP_DBG("1 - FUOTA_MAGIC_KEYWORD found at flash_current_offset = %d", (FuotaBinData_index + index)*8);
+ l_end_full_bin_transfer = TRUE;
+ }
+ else
+ if (((FuotaTransferArray[index] & 0xFFFFFFFF00000000) >> 32) == OtaContext.magic_keyword)
+ {
+ APP_DBG("2 - FUOTA_MAGIC_KEYWORD found at flash_current_offset = %d", (FuotaBinData_index + index)*8);
+ l_end_full_bin_transfer = TRUE;
+ }
+ }
+
+ FuotaBinData_index += FUOTA_NUMBER_WORDS_64BITS;
+
+ /* Write to Flash Memory */
+ for(flash_index = 0; flash_index < FUOTA_NUMBER_WORDS_64BITS; flash_index++)
+ {
+ while( LL_HSEM_1StepLock( HSEM, CFG_HW_FLASH_SEMID ) );
+ HAL_FLASH_Unlock();
+ while(LL_FLASH_IsActiveFlag_OperationSuspended());
+
+ if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLEWORD,
+ OtaContext.base_address + flash_current_offset,
+ FuotaTransferArray[flash_index]) == HAL_OK)
+ {
+ /* Read back value for verification */
+ l_read64 = *(uint64_t*)(OtaContext.base_address + flash_current_offset);
+ if(l_read64 != FuotaTransferArray[flash_index])
+ {
+ APP_DBG("FLASH: Comparison failed l_read64 = 0x%jx / ram_array = 0x%jx", l_read64, FuotaTransferArray[flash_index])
+ APP_THREAD_Error(ERR_THREAD_MSG_COMPARE_FAILED,0);
+ }
+ }
+ else
+ {
+ APP_DBG("HAL_FLASH_Program FAILED at flash_index = %d", flash_index)
+ APP_THREAD_Error(ERR_THREAD_FLASH_PROGRAM,0);
+ }
+
+ HAL_FLASH_Lock();
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_FLASH_SEMID, 0 );
+
+ flash_current_offset += 8;
+ }
+
+ /* If Message is Confirmable, send response */
+ if (otCoapHeaderGetType(pHeader) == OT_COAP_TYPE_CONFIRMABLE)
+ {
+ APP_THREAD_CoapSendDataResponseFuota(pHeader, pMessageInfo);
+ }
+
+ if(l_end_full_bin_transfer == TRUE)
+ {
+ UTIL_SEQ_SetTask(TASK_FUOTA_RESET, CFG_SCH_PRIO_0);
+ }
+}
+
+/**
+ * @brief This function acknowledges the data reception by sending an ACK
+ * back to the sender.
+ * @param pRequestHeader coap header
+ * @param pMessageInfo message info pointer
+ * @retval None
+ */
+static void APP_THREAD_CoapSendDataResponseFuota(otCoapHeader * pRequestHeader,
+ const otMessageInfo * pMessageInfo)
+{
+ otError error = OT_ERROR_NONE;
+ static otCoapHeader OT_Header = {0};
+
+ do{
+ otCoapHeaderInit(&OT_Header, OT_COAP_TYPE_ACKNOWLEDGMENT, OT_COAP_CODE_CHANGED);
+ otCoapHeaderSetMessageId(&OT_Header, otCoapHeaderGetMessageId(pRequestHeader));
+ otCoapHeaderSetToken(&OT_Header,
+ otCoapHeaderGetToken(pRequestHeader),
+ otCoapHeaderGetTokenLength(pRequestHeader));
+
+ pOT_Message = otCoapNewMessage(NULL, &OT_Header);
+ if (pOT_Message == NULL)
+ {
+ APP_THREAD_Error(ERR_THREAD_COAP_APPEND_MSG, error);
+ break;
+ }
+
+ error = otCoapSendResponse(NULL, pOT_Message, pMessageInfo);
+ if (error != OT_ERROR_NONE && pOT_Message != NULL)
+ {
+ otMessageFree(pOT_Message);
+ APP_THREAD_Error(ERR_THREAD_COAP_DATA_RESPONSE,error);
+ }
+ }while(false);
+}
+
+/**
+ * @brief This function acknowledges the data reception by sending an ACK
+ * back to the sender.
+ * @param pRequestHeader coap header
+ * @param pMessageInfo message info pointer
+ * @param pMessage message pointer
+ * @retval None
+ */
+static void APP_THREAD_CoapSendRespFuotaParameters(otCoapHeader * pRequestHeader,
+ const otMessageInfo * pMessageInfo,
+ uint8_t * pData)
+{
+ otError error = OT_ERROR_NONE;
+ static otCoapHeader OT_Header = {0};
+ uint8_t data = *pData;
+ APP_DBG("APP_THREAD_CoapSendRespFuotaParameters data = %d", data);
+
+ do{
+ APP_DBG("FUOTA: Send CoAP response for Fuota Parameters");
+ otCoapHeaderInit(&OT_Header, OT_COAP_TYPE_NON_CONFIRMABLE, OT_COAP_CODE_CONTENT);
+ otCoapHeaderSetToken(&OT_Header,
+ otCoapHeaderGetToken(pRequestHeader),
+ otCoapHeaderGetTokenLength(pRequestHeader));
+ otCoapHeaderSetPayloadMarker(&OT_Header);
+
+ pOT_Message = otCoapNewMessage(NULL, &OT_Header);
+ if (pOT_Message == NULL)
+ {
+ APP_THREAD_Error(ERR_THREAD_COAP_APPEND_MSG, error);
+ break;
+ }
+
+ error = otMessageAppend(pOT_Message, &data, sizeof(data));
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_COAP_APPEND_MSG, error);
+ }
+
+ error = otCoapSendResponse(NULL, pOT_Message, pMessageInfo);
+ if (error != OT_ERROR_NONE && pOT_Message != NULL)
+ {
+ otMessageFree(pOT_Message);
+ APP_THREAD_Error(ERR_THREAD_COAP_DATA_RESPONSE,error);
+ }
+ }while(false);
+}
+
+/**
+ * @brief Task responsible for the reset at the end of OTA transfer.
+ * @param None
+ * @retval None
+ */
+static void APP_THREAD_PerformReset(void)
+{
+ APP_DBG("*******************************************************");
+ APP_DBG(" FUOTA_CLIENT : END OF TRANSFER COMPLETED");
+ /* Stop Toggling of the LED */
+ HW_TS_Stop(TimerID);
+ BSP_LED_On(LED1);
+
+ /* Insert delay to make sure CoAP response has been sent */
+ HAL_Delay(200);
+
+ if(OtaContext.file_type == APP_THREAD_OTA_FILE_TYPE_FW_APP)
+ {
+ APP_DBG(" --> Request to reboot on FW Application");
+ APP_DBG("*******************************************************");
+ /**
+ * Reboot on FW Application
+ */
+ *(uint8_t*)SRAM1_BASE = CFG_REBOOT_ON_FW_APP;
+ NVIC_SystemReset();
+ }
+ else if(OtaContext.file_type == APP_THREAD_OTA_FILE_TYPE_FW_COPRO_WIRELESS)
+ {
+ APP_DBG(" --> Request to reboot on FUS");
+ APP_DBG("*******************************************************");
+ /**
+ * Wireless firmware update is requested
+ * Request CPU2 to reboot on FUS by sending two FUS command
+ */
+ SHCI_C2_FUS_GetState( NULL );
+ SHCI_C2_FUS_GetState( NULL );
+ while(1)
+ {
+ HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFI);
+ }
+ }
+ else
+ {
+ APP_DBG("APP_THREAD_PerformReset: OtaContext.file_type not recognized");
+ APP_THREAD_Error(ERR_THREAD_FUOTA_FILE_TYPE_NOT_RECOGNIZED,0);
+ }
+
+}
+
+static void APP_THREAD_TimingElapsed(void)
+{
+ BSP_LED_Toggle(LED1);
+}
+
+/* USER CODE END FD_LOCAL_FUNCTIONS */
+
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+
+void APP_THREAD_RegisterCmdBuffer(TL_CmdPacket_t* p_buffer)
+{
+ p_thread_otcmdbuffer = p_buffer;
+}
+
+Thread_OT_Cmd_Request_t* THREAD_Get_OTCmdPayloadBuffer(void)
+{
+ return (Thread_OT_Cmd_Request_t*)p_thread_otcmdbuffer->cmdserial.cmd.payload;
+}
+
+Thread_OT_Cmd_Request_t* THREAD_Get_OTCmdRspPayloadBuffer(void)
+{
+ return (Thread_OT_Cmd_Request_t*)((TL_EvtPacket_t *)p_thread_otcmdbuffer)->evtserial.evt.payload;
+}
+
+Thread_OT_Cmd_Request_t* THREAD_Get_NotificationPayloadBuffer(void)
+{
+ return (Thread_OT_Cmd_Request_t*)(p_thread_notif_M0_to_M4)->evtserial.evt.payload;
+}
+
+/**
+ * @brief This function is used to transfer the Ot commands from the
+ * M4 to the M0.
+ *
+ * @param None
+ * @return None
+ */
+void Ot_Cmd_Transfer(void)
+{
+ /* OpenThread OT command cmdcode range 0x280 .. 0x3DF = 352 */
+ p_thread_otcmdbuffer->cmdserial.cmd.cmdcode = 0x280U;
+ /* Size = otCmdBuffer->Size (Number of OT cmd arguments : 1 arg = 32bits so multiply by 4 to get size in bytes)
+ * + ID (4 bytes) + Size (4 bytes) */
+ uint32_t l_size = ((Thread_OT_Cmd_Request_t*)(p_thread_otcmdbuffer->cmdserial.cmd.payload))->Size * 4U + 8U;
+ p_thread_otcmdbuffer->cmdserial.cmd.plen = l_size;
+
+ TL_OT_SendCmd();
+
+ /* Wait completion of cmd */
+ Wait_Getting_Ack_From_M0();
+}
+
+/**
+ * @brief This function is called when acknowledge from OT command is received from the M0+.
+ *
+ * @param Otbuffer : a pointer to TL_EvtPacket_t
+ * @return None
+ */
+void TL_OT_CmdEvtReceived( TL_EvtPacket_t * Otbuffer )
+{
+ /* Prevent unused argument(s) compilation warning */
+ UNUSED(Otbuffer);
+
+ Receive_Ack_From_M0();
+}
+
+/**
+ * @brief This function is called when notification from M0+ is received.
+ *
+ * @param Notbuffer : a pointer to TL_EvtPacket_t
+ * @return None
+ */
+void TL_THREAD_NotReceived( TL_EvtPacket_t * Notbuffer )
+{
+ p_thread_notif_M0_to_M4 = Notbuffer;
+
+ Receive_Notification_From_M0();
+}
+
+/**
+ * @brief This function is called before sending any ot command to the M0
+ * core. The purpose of this function is to be able to check if
+ * there are no notifications coming from the M0 core which are
+ * pending before sending a new ot command.
+ * @param None
+ * @retval None
+ */
+void Pre_OtCmdProcessing(void)
+{
+ UTIL_SEQ_WaitEvt(EVENT_SYNCHRO_BYPASS_IDLE);
+}
+
+/**
+ * @brief This function waits for getting an acknowledgment from the M0.
+ *
+ * @param None
+ * @retval None
+ */
+static void Wait_Getting_Ack_From_M0(void)
+{
+ UTIL_SEQ_WaitEvt(EVENT_ACK_FROM_M0_EVT);
+}
+
+/**
+ * @brief Receive an acknowledgment from the M0+ core.
+ * Each command send by the M4 to the M0 are acknowledged.
+ * This function is called under interrupt.
+ * @param None
+ * @retval None
+ */
+static void Receive_Ack_From_M0(void)
+{
+ UTIL_SEQ_SetEvt(EVENT_ACK_FROM_M0_EVT);
+}
+
+/**
+ * @brief Receive a notification from the M0+ through the IPCC.
+ * This function is called under interrupt.
+ * @param None
+ * @retval None
+ */
+static void Receive_Notification_From_M0(void)
+{
+ CptReceiveMsgFromM0++;
+ UTIL_SEQ_SetTask(TASK_MSG_FROM_M0_TO_M4,CFG_SCH_PRIO_0);
+}
+
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+#else
+#if (CFG_FULL_LOW_POWER == 0)
+static void RxCpltCallback(void)
+{
+ /* Filling buffer and wait for '\r' char */
+ if (indexReceiveChar < C_SIZE_CMD_STRING)
+ {
+ CommandString[indexReceiveChar++] = aRxBuffer[0];
+ if (aRxBuffer[0] == '\r')
+ {
+ CptReceiveCmdFromUser = 1U;
+
+ /* UART task scheduling*/
+ UTIL_SEQ_SetTask(1U << CFG_TASK_SEND_CLI_TO_M0, CFG_SCH_PRIO_0);
+ }
+ }
+
+ /* Once a character has been sent, put back the device in reception mode */
+ HW_UART_Receive_IT(CFG_CLI_UART, aRxBuffer, 1U, RxCpltCallback);
+}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+/**
+ * @brief Process the command strings.
+ * As soon as a complete command string has been received, the task
+ * in charge of sending the command to the M0 is scheduled
+ * @param None
+ * @retval None
+ */
+static uint32_t ProcessCmdString( uint8_t* buf , uint32_t len )
+{
+ uint32_t i,j,tmp_start;
+ tmp_start = 0;
+ uint32_t res = 0;
+
+ i= 0;
+ while ((buf[i] != '\r') && (i < len))
+ {
+ i++;
+ }
+
+ if (i != len)
+ {
+ memcpy(CommandString, buf,(i+1));
+ indexReceiveChar = i + 1U; /* Length of the buffer containing the command string */
+ UTIL_SEQ_SetTask(1U << CFG_TASK_SEND_CLI_TO_M0, CFG_SCH_PRIO_0);
+ tmp_start = i;
+ for (j = 0; j < (len - tmp_start - 1U) ; j++)
+ {
+ buf[j] = buf[tmp_start + j + 1U];
+ }
+ res = len - tmp_start - 1U;
+ }
+ else
+ {
+ res = len;
+ }
+ return res; /* Remaining characters in the temporary buffer */
+}
+#endif/* (CFG_USB_INTERFACE_ENABLE != 0) */
+
+#if (CFG_FULL_LOW_POWER == 0)
+/**
+ * @brief Process sends receive CLI command to M0.
+ * @param None
+ * @retval None
+ */
+static void Send_CLI_To_M0(void)
+{
+ memset(ThreadCliCmdBuffer.cmdserial.cmd.payload, 0x0U, 255U);
+ memcpy(ThreadCliCmdBuffer.cmdserial.cmd.payload, CommandString, indexReceiveChar);
+ ThreadCliCmdBuffer.cmdserial.cmd.plen = indexReceiveChar;
+ ThreadCliCmdBuffer.cmdserial.cmd.cmdcode = 0x0;
+
+ /* Clear receive buffer, character counter and command complete */
+ CptReceiveCmdFromUser = 0;
+ indexReceiveChar = 0;
+ memset(CommandString, 0, C_SIZE_CMD_STRING);
+
+ TL_CLI_SendCmd();
+}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+
+/**
+ * @brief Send notification for CLI TL Channel.
+ * @param None
+ * @retval None
+ */
+static void Send_CLI_Ack_For_OT(void)
+{
+
+ /* Notify M0 that characters have been sent to UART */
+ TL_THREAD_CliSendAck();
+}
+
+/**
+ * @brief Perform initialization of CLI UART interface.
+ * @param None
+ * @retval None
+ */
+void APP_THREAD_Init_UART_CLI(void)
+{
+#if (CFG_FULL_LOW_POWER == 0)
+ UTIL_SEQ_RegTask( 1<<CFG_TASK_SEND_CLI_TO_M0, UTIL_SEQ_RFU,Send_CLI_To_M0);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+#else
+#if (CFG_FULL_LOW_POWER == 0)
+ MX_USART1_UART_Init();
+ HW_UART_Receive_IT(CFG_CLI_UART, aRxBuffer, 1, RxCpltCallback);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+}
+
+/**
+ * @brief Perform initialization of TL for THREAD.
+ * @param None
+ * @retval None
+ */
+void APP_THREAD_TL_THREAD_INIT(void)
+{
+ ThreadConfigBuffer.p_ThreadOtCmdRspBuffer = (uint8_t*)&ThreadOtCmdBuffer;
+ ThreadConfigBuffer.p_ThreadNotAckBuffer = (uint8_t*)ThreadNotifRspEvtBuffer;
+ ThreadConfigBuffer.p_ThreadCliRspBuffer = (uint8_t*)&ThreadCliCmdBuffer;
+
+ TL_THREAD_Init( &ThreadConfigBuffer );
+}
+
+/**
+ * @brief This function is called when notification on CLI TL Channel from M0+ is received.
+ *
+ * @param Notbuffer : a pointer to TL_EvtPacket_t
+ * @return None
+ */
+void TL_THREAD_CliNotReceived( TL_EvtPacket_t * Notbuffer )
+{
+ TL_CmdPacket_t* l_CliBuffer = (TL_CmdPacket_t*)Notbuffer;
+ uint8_t l_size = l_CliBuffer->cmdserial.cmd.plen;
+
+ /* WORKAROUND: if string to output is "> " then respond directly to M0 and do not output it */
+ if (strcmp((const char *)l_CliBuffer->cmdserial.cmd.payload, "> ") != 0)
+ {
+ /* Write to CLI UART */
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+ VCP_SendData( l_CliBuffer->cmdserial.cmd.payload, l_size, HostTxCb);
+#else
+ HW_UART_Transmit_IT(CFG_CLI_UART, l_CliBuffer->cmdserial.cmd.payload, l_size, HostTxCb);
+#endif /*USAGE_OF_VCP */
+ }
+ else
+ {
+ Send_CLI_Ack_For_OT();
+ }
+}
+
+/**
+ * @brief End of transfer callback for CLI UART sending.
+ *
+ * @param Notbuffer : a pointer to TL_EvtPacket_t
+ * @return None
+ */
+void HostTxCb(void)
+{
+ Send_CLI_Ack_For_OT();
+}
+
+/**
+ * @brief Process the messages coming from the M0.
+ * @param None
+ * @retval None
+ */
+void APP_THREAD_ProcessMsgM0ToM4(void)
+{
+ if (CptReceiveMsgFromM0 != 0)
+ {
+ /* If CptReceiveMsgFromM0 is > 1. it means that we did not serve all the events from the radio */
+ if (CptReceiveMsgFromM0 > 1U)
+ {
+ APP_THREAD_Error(ERR_REC_MULTI_MSG_FROM_M0, 0);
+ }
+ else
+ {
+ OpenThread_CallBack_Processing();
+ }
+ /* Reset counter */
+ CptReceiveMsgFromM0 = 0;
+ }
+}
+
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+/**
+ * @brief This function is called when thereare some data coming
+ * from the Hyperterminal via the USB port
+ * Data received over USB OUT endpoint are sent over CDC interface
+ * through this function.
+ * @param Buf: Buffer of data received
+ * @param Len: Number of data received (in bytes)
+ * @retval Number of characters remaining in the buffer and not yet processed
+ */
+void VCP_DataReceived(uint8_t* Buf , uint32_t *Len)
+{
+ uint32_t i,flag_continue_checking = TRUE;
+ uint32_t char_remaining = 0;
+ static uint32_t len_total = 0;
+
+ /* Copy the characteres in the temporary buffer */
+ for (i = 0; i < *Len; i++)
+ {
+ TmpString[len_total++] = Buf[i];
+ }
+
+ /* Process the buffer commands one by one */
+ /* A command is limited by a \r caracaters */
+ while (flag_continue_checking == TRUE)
+ {
+ char_remaining = ProcessCmdString(TmpString,len_total);
+ /* If char_remaining is equal to len_total, it means that the command string is not yet
+ * completed.
+ * If char_remaining is equal to 0, it means that the command string has
+ * been entirely processed.
+ */
+ if ((char_remaining == 0) || (char_remaining == len_total))
+ {
+ flag_continue_checking = FALSE;
+ }
+ len_total = char_remaining;
+ }
+}
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+
+/* USER CODE BEGIN FD_WRAP_FUNCTIONS */
+
+/* USER CODE END FD_WRAP_FUNCTIONS */
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/STM32_WPAN/App/app_thread.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/STM32_WPAN/App/app_thread.h
new file mode 100644
index 000000000..65b2568a6
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/STM32_WPAN/App/app_thread.h
@@ -0,0 +1,154 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : App/app_thread.h
+ * Description : Header for Thread Application.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_THREAD_H
+#define APP_THREAD_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+/* Private includes ----------------------------------------------------------*/
+#include "tl.h"
+#include "stm32wbxx_core_interface_def.h"
+#include "tl_thread_hci.h"
+
+/* OpenThread Library */
+#include OPENTHREAD_CONFIG_FILE
+
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Exported types ------------------------------------------------------------*/
+
+/* Thread application generic defines */
+/*------------------------------------*/
+typedef enum
+{
+ APP_THREAD_LIMITED,
+ APP_THREAD_FULL,
+} APP_THREAD_InitMode_t;
+
+/* ipv6-addressing defines */
+/*------------------------------------*/
+/* Key Point: A major difference between FTDs and MTDs are that FTDs subscribe to the ff03::2 multicast address.
+ * MTDs do not. */
+
+#define MULICAST_FTD_MED "ff03::1"
+#define MULICAST_FTD_BORDER_ROUTER "ff03::2"
+
+/* Application errors */
+/*------------------------------------*/
+
+/*
+ * List of all errors tracked by the Thread application
+ * running on M4. Some of these errors may be fatal
+ * or just warnings
+ */
+typedef enum
+{
+ ERR_REC_MULTI_MSG_FROM_M0,
+ ERR_THREAD_SET_STATE_CB,
+ ERR_THREAD_SET_CHANNEL,
+ ERR_THREAD_SET_PANID,
+ ERR_THREAD_IPV6_ENABLE,
+ ERR_THREAD_START,
+ ERR_THREAD_ERASE_PERSISTENT_INFO,
+/* USER CODE BEGIN ERROR_APPLI_ENUM */
+ ERR_THREAD_COAP_START,
+ ERR_THREAD_COAP_ADD_RESSOURCE,
+ ERR_THREAD_MESSAGE_READ,
+ ERR_THREAD_COAP_SEND_RESPONSE,
+ ERR_THREAD_COAP_NEW_MSG,
+ ERR_THREAD_COAP_APPEND,
+ ERR_THREAD_COAP_SEND_REQUEST,
+ ERR_THREAD_COAP_DATA_RESPONSE,
+ ERR_THREAD_SETUP,
+ ERR_THREAD_LINK_MODE,
+ ERR_TIMER_INIT,
+ ERR_TIMER_START,
+ ERR_THREAD_MSG_COMPARE_FAILED,
+ ERR_THREAD_COAP_APPEND_MSG,
+ ERR_THREAD_COAP_ALLOC_MSG,
+ ERR_THREAD_BAD_ADDRESS_TYPE,
+ ERR_THREAD_FLASH_PROGRAM,
+ ERR_THREAD_FUOTA_FILE_TYPE_NOT_RECOGNIZED,
+ ERR_THREAD_FUOTA_WRONG_ADDRESS,
+/* USER CODE END ERROR_APPLI_ENUM */
+ ERR_THREAD_CHECK_WIRELESS
+ } ErrAppliIdEnum_t;
+/* USER CODE BEGIN ET */
+typedef enum
+{
+ APP_THREAD_COAP_IP6_ADDRESS,
+ APP_THREAD_COAP_STRING_ADDRESS,
+} APP_THREAD_CoapAddressTypeDef_t;
+
+typedef enum
+{
+ APP_THREAD_OTA_FILE_TYPE_FW_APP,
+ APP_THREAD_OTA_FILE_TYPE_FW_COPRO_WIRELESS,
+} APP_THREAD_OtaFileTypeDef_t;
+
+typedef struct
+{
+ APP_THREAD_OtaFileTypeDef_t file_type;
+ uint32_t binary_size;
+ uint32_t base_address;
+ uint32_t magic_keyword;
+} APP_THREAD_OtaContext_t;
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* External variables --------------------------------------------------------*/
+/* USER CODE BEGIN EV */
+
+/* USER CODE END EV */
+
+/* Exported macros ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions ------------------------------------------------------- */
+void APP_THREAD_Init( void );
+void APP_THREAD_Error(uint32_t ErrId, uint32_t ErrCode);
+void APP_THREAD_RegisterCmdBuffer(TL_CmdPacket_t* p_buffer);
+void APP_THREAD_ProcessMsgM0ToM4(void);
+void APP_THREAD_Init_UART_CLI(void);
+void APP_THREAD_TL_THREAD_INIT(void);
+/* USER CODE BEGIN EF */
+
+/* USER CODE END EF */
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* APP_THREAD_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/STM32_WPAN/Target/hw_ipcc.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/STM32_WPAN/Target/hw_ipcc.c
new file mode 100644
index 000000000..e46eeb94b
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/STM32_WPAN/Target/hw_ipcc.c
@@ -0,0 +1,517 @@
+/**
+ ******************************************************************************
+ * File Name : Target/hw_ipcc.c
+ * Description : Hardware IPCC source file for BLE
+ * Middleware.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "mbox_def.h"
+
+/* Global variables ---------------------------------------------------------*/
+/* Private defines -----------------------------------------------------------*/
+#define HW_IPCC_TX_PENDING( channel ) ( !(LL_C1_IPCC_IsActiveFlag_CHx( IPCC, channel )) ) && (((~(IPCC->C1MR)) & (channel << 16U)))
+#define HW_IPCC_RX_PENDING( channel ) (LL_C2_IPCC_IsActiveFlag_CHx( IPCC, channel )) && (((~(IPCC->C1MR)) & (channel << 0U)))
+
+/* Private macros ------------------------------------------------------------*/
+/* Private typedef -----------------------------------------------------------*/
+/* Private variables ---------------------------------------------------------*/
+static void (*FreeBufCb)( void );
+
+/* Private function prototypes -----------------------------------------------*/
+static void HW_IPCC_BLE_EvtHandler( void );
+static void HW_IPCC_BLE_AclDataEvtHandler( void );
+static void HW_IPCC_MM_FreeBufHandler( void );
+static void HW_IPCC_SYS_CmdEvtHandler( void );
+static void HW_IPCC_SYS_EvtHandler( void );
+static void HW_IPCC_TRACES_EvtHandler( void );
+
+#ifdef THREAD_WB
+static void HW_IPCC_OT_CmdEvtHandler( void );
+static void HW_IPCC_THREAD_NotEvtHandler( void );
+static void HW_IPCC_THREAD_CliNotEvtHandler( void );
+#endif
+
+#ifdef MAC_802_15_4_WB
+static void HW_IPCC_MAC_802_15_4_CmdEvtHandler( void );
+static void HW_IPCC_MAC_802_15_4_NotEvtHandler( void );
+#endif
+
+#ifdef ZIGBEE_WB
+static void HW_IPCC_ZIGBEE_CmdEvtHandler( void );
+static void HW_IPCC_ZIGBEE_StackNotifEvtHandler( void );
+static void HW_IPCC_ZIGBEE_CliNotifEvtHandler( void );
+#endif
+
+/* Public function definition -----------------------------------------------*/
+
+/******************************************************************************
+ * INTERRUPT HANDLER
+ ******************************************************************************/
+void HW_IPCC_Rx_Handler( void )
+{
+ if (HW_IPCC_RX_PENDING( HW_IPCC_SYSTEM_EVENT_CHANNEL ))
+ {
+ HW_IPCC_SYS_EvtHandler();
+ }
+#ifdef MAC_802_15_4_WB
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL ))
+ {
+ HW_IPCC_MAC_802_15_4_NotEvtHandler();
+ }
+#endif /* MAC_802_15_4_WB */
+#ifdef THREAD_WB
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL ))
+ {
+ HW_IPCC_THREAD_NotEvtHandler();
+ }
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL ))
+ {
+ HW_IPCC_THREAD_CliNotEvtHandler();
+ }
+#endif /* THREAD_WB */
+#ifdef ZIGBEE_WB
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL ))
+ {
+ HW_IPCC_ZIGBEE_StackNotifEvtHandler();
+ }
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL ))
+ {
+ HW_IPCC_ZIGBEE_CliNotifEvtHandler();
+ }
+#endif /* ZIGBEE_WB */
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_BLE_EVENT_CHANNEL ))
+ {
+ HW_IPCC_BLE_EvtHandler();
+ }
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_TRACES_CHANNEL ))
+ {
+ HW_IPCC_TRACES_EvtHandler();
+ }
+
+ return;
+}
+
+void HW_IPCC_Tx_Handler( void )
+{
+ if (HW_IPCC_TX_PENDING( HW_IPCC_SYSTEM_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_SYS_CmdEvtHandler();
+ }
+#ifdef MAC_802_15_4_WB
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_MAC_802_15_4_CmdEvtHandler();
+ }
+#endif /* MAC_802_15_4_WB */
+#ifdef THREAD_WB
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_OT_CmdEvtHandler();
+ }
+#endif /* THREAD_WB */
+#ifdef ZIGBEE_WB
+ if (HW_IPCC_TX_PENDING( HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_ZIGBEE_CmdEvtHandler();
+ }
+#endif /* ZIGBEE_WB */
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_SYSTEM_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_SYS_CmdEvtHandler();
+ }
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_MM_RELEASE_BUFFER_CHANNEL ))
+ {
+ HW_IPCC_MM_FreeBufHandler();
+ }
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_HCI_ACL_DATA_CHANNEL ))
+ {
+ HW_IPCC_BLE_AclDataEvtHandler();
+ }
+
+ return;
+}
+/******************************************************************************
+ * GENERAL
+ ******************************************************************************/
+void HW_IPCC_Enable( void )
+{
+ /**
+ * In case the SBSFU is implemented, it may have already set the C2BOOT bit to startup the CPU2.
+ * In that case, to keep the mechanism transparent to the user application, it shall call the system command
+ * SHCI_C2_Reinit( ) before jumping to the application.
+ * When the CPU2 receives that command, it waits for its event input to be set to restart the CPU2 firmware.
+ * This is required because once C2BOOT has been set once, a clear/set on C2BOOT has no effect.
+ * When SHCI_C2_Reinit( ) is not called, generating an event to the CPU2 does not have any effect
+ * So, by default, the application shall both set the event flag and set the C2BOOT bit.
+ */
+ __SEV( ); /* Set the internal event flag and send an event to the CPU2 */
+ __WFE( ); /* Clear the internal event flag */
+ LL_PWR_EnableBootC2( );
+
+ return;
+}
+
+void HW_IPCC_Init( void )
+{
+ LL_AHB3_GRP1_EnableClock( LL_AHB3_GRP1_PERIPH_IPCC );
+
+ LL_C1_IPCC_EnableIT_RXO( IPCC );
+ LL_C1_IPCC_EnableIT_TXF( IPCC );
+
+ HAL_NVIC_EnableIRQ(IPCC_C1_RX_IRQn);
+ HAL_NVIC_EnableIRQ(IPCC_C1_TX_IRQn);
+
+ return;
+}
+
+/******************************************************************************
+ * BLE
+ ******************************************************************************/
+void HW_IPCC_BLE_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_BLE_EVENT_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_BLE_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_BLE_CMD_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_BLE_EvtHandler( void )
+{
+ HW_IPCC_BLE_RxEvtNot();
+
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_BLE_EVENT_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_BLE_SendAclData( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_HCI_ACL_DATA_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_HCI_ACL_DATA_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_BLE_AclDataEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_HCI_ACL_DATA_CHANNEL );
+
+ HW_IPCC_BLE_AclDataAckNot();
+
+ return;
+}
+
+__weak void HW_IPCC_BLE_AclDataAckNot( void ){};
+__weak void HW_IPCC_BLE_RxEvtNot( void ){};
+
+/******************************************************************************
+ * SYSTEM
+ ******************************************************************************/
+void HW_IPCC_SYS_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_SYSTEM_EVENT_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_SYS_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_SYSTEM_CMD_RSP_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_SYSTEM_CMD_RSP_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_SYS_CmdEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_SYSTEM_CMD_RSP_CHANNEL );
+
+ HW_IPCC_SYS_CmdEvtNot();
+
+ return;
+}
+
+static void HW_IPCC_SYS_EvtHandler( void )
+{
+ HW_IPCC_SYS_EvtNot();
+
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_SYSTEM_EVENT_CHANNEL );
+
+ return;
+}
+
+__weak void HW_IPCC_SYS_CmdEvtNot( void ){};
+__weak void HW_IPCC_SYS_EvtNot( void ){};
+
+/******************************************************************************
+ * MAC 802.15.4
+ ******************************************************************************/
+#ifdef MAC_802_15_4_WB
+void HW_IPCC_MAC_802_15_4_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_MAC_802_15_4_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_MAC_802_15_4_SendAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_MAC_802_15_4_CmdEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL );
+
+ HW_IPCC_MAC_802_15_4_CmdEvtNot();
+
+ return;
+}
+
+static void HW_IPCC_MAC_802_15_4_NotEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_MAC_802_15_4_EvtNot();
+
+ return;
+}
+__weak void HW_IPCC_MAC_802_15_4_CmdEvtNot( void ){};
+__weak void HW_IPCC_MAC_802_15_4_EvtNot( void ){};
+#endif
+
+/******************************************************************************
+ * THREAD
+ ******************************************************************************/
+#ifdef THREAD_WB
+void HW_IPCC_THREAD_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_OT_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_CLI_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_THREAD_CLI_CMD_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_THREAD_SendAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_THREAD_CliSendAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_OT_CmdEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+
+ HW_IPCC_OT_CmdEvtNot();
+
+ return;
+}
+
+static void HW_IPCC_THREAD_NotEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_THREAD_EvtNot();
+
+ return;
+}
+
+static void HW_IPCC_THREAD_CliNotEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_THREAD_CliEvtNot();
+
+ return;
+}
+
+__weak void HW_IPCC_OT_CmdEvtNot( void ){};
+__weak void HW_IPCC_CLI_CmdEvtNot( void ){};
+__weak void HW_IPCC_THREAD_EvtNot( void ){};
+
+#endif /* THREAD_WB */
+
+/******************************************************************************
+ * ZIGBEE
+ ******************************************************************************/
+#ifdef ZIGBEE_WB
+void HW_IPCC_ZIGBEE_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_ZIGBEE_SendAppliCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_ZIGBEE_SendCliCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_THREAD_CLI_CMD_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_ZIGBEE_SendAppliCmdAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_ZIGBEE_SendCliCmdAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_ZIGBEE_CmdEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+
+ HW_IPCC_ZIGBEE_AppliCmdNotification();
+
+ return;
+}
+
+static void HW_IPCC_ZIGBEE_StackNotifEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_ZIGBEE_AppliAsyncEvtNotification();
+
+ return;
+}
+
+static void HW_IPCC_ZIGBEE_CliNotifEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_ZIGBEE_CliEvtNotification();
+
+ return;
+}
+
+__weak void HW_IPCC_ZIGBEE_AppliCmdNotification( void ){};
+__weak void HW_IPCC_ZIGBEE_AppliAsyncEvtNotification( void ){};
+__weak void HW_IPCC_ZIGBEE_CliEvtNotification( void ){};
+#endif /* ZIGBEE_WB */
+
+/******************************************************************************
+ * MEMORY MANAGER
+ ******************************************************************************/
+void HW_IPCC_MM_SendFreeBuf( void (*cb)( void ) )
+{
+ if ( LL_C1_IPCC_IsActiveFlag_CHx( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL ) )
+ {
+ FreeBufCb = cb;
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+ }
+ else
+ {
+ cb();
+
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+ }
+
+ return;
+}
+
+static void HW_IPCC_MM_FreeBufHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+
+ FreeBufCb();
+
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+
+ return;
+}
+
+/******************************************************************************
+ * TRACES
+ ******************************************************************************/
+void HW_IPCC_TRACES_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_TRACES_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_TRACES_EvtHandler( void )
+{
+ HW_IPCC_TRACES_EvtNot();
+
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_TRACES_CHANNEL );
+
+ return;
+}
+
+__weak void HW_IPCC_TRACES_EvtNot( void ){};
+
+/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/readme.txt b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/readme.txt
new file mode 100644
index 000000000..f8e2b7820
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota/readme.txt
@@ -0,0 +1,228 @@
+/**
+ @page Thread_Ota application
+
+ @verbatim
+ ******************************************************************************
+ * @file Thread/Thread_Ota/readme.txt
+ * @author MCD Application Team
+ * @brief Description of Thread Ota Application
+ ******************************************************************************
+ *
+ * Copyright (c) 2019 STMicroelectronics. All rights reserved.
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ @endverbatim
+
+@par Application Description
+
+How to update Over The Air (OTA) FW application and Copro Wireless binary using Thread.
+
+This application requires two STM32WB55xx boards.
+
+In a Thread network, nodes are split into two forwarding roles: Router or End Device.
+The Thread Leader is a Router that is responsible for managing the set of Routers in a
+Thread network. An End Device (or child) communicates primarily with a single Router.
+
+In our Application which uses two devices, one device will act as a Leader (Router)
+and the other one will act as an End Device(mode child)
+
+After the reset of the 2 boards, one board will be in Leader mode (Green LED2 ON)
+The other one will be in Child mode (Red LED3 ON)
+
+This Thread application provides implementation example for Updating FW on Application
+side and on Copro Wireless side.
+Thread_Ota_Server can communicate only with Thread_Ota application.
+
+IMPORTANT PREREQUISITES:
+On Thread_Ota_Server a binary image has to be loaded at @0x08010000 before starting the process.
+It can be FW application example (compatible with Ota settings, see Thread_Coap_Generic_Ota for details)
+or encrypted Copro Wireless binary.
+
+
+Following diagram describes the Update procedure:
+ ____________________________________ ______________________________________
+ | Device 1 | | Device 2 |
+ | Thread_Ota_Server | | Thread_Ota |
+ |___________________________________| |_____________________________________|
+ | | | |
+ | Before starting FW for update | | At startup, application performs |
+ | must be written at following | | a delete of FLASH memory sectors |
+ | @ = 0x08010000 | | starting from @ = 0x08010000 |
+ | | | to SFSA (Option Byte) limit |
+ | | | |
+ | Get Mesh-Local EID | | |
+ | (Endpoint Identifier) of | | |
+ | Thread_Ota device | | |
+ | | | |
+ | Push Button -----> | | |
+ | - SW1 (OTA for APP Update) | | |
+ | - SW3 (OTA for Copro Update) | | |
+ | | ====== COAP REQUEST =========> | |
+ | | Resource: "FUOTA_PROVISIONING" | |
+ | | Mode: Multicast | |
+ | | Type: Confirmable | returns Mesh-Local EID |
+ | | Code: Get | |
+ | | Payload : OtaContext | | |
+ | | | |
+ |Thread_Ota Mesh-Local EID received | <=====COAP CONFIRMATION ====== | |
+ | | | |
+ | | | |
+ | | | |
+ | Send FUOTA parameters: | ============> COAP =========> | |
+ | - File Type (App or Corpro) | Resource: "FUOTA_PARAMETERS" | |
+ | - Base address for the download | Mode: Unicast | Saves FUOTA parameters |
+ | - Magic Keyword | Type: Confirmable | and confirms |
+ | | Code: Put | |
+ | | | |
+ | Waits for confirmation | <=====COAP CONFIRMATION ====== | |
+ | | | |
+ | Once confirmation received | | |
+ | ->Starts FUOTA data transfer | | |
+ | | | |
+ | | | |
+ |--> Data Transfer | ============> COAP =========> | BLUE LED TOGGLING |
+ || (400 bytes Payload) | Resource: "FUOTA_SEND" | |
+ || | Mode: Unicast | |
+ || | Type: Confirmable | Each time data buffer is received |
+ || | Code: Put | writes it to FLASH memory |
+ || | Payload : Buffer[] | |
+ || | | |
+ || Ack received | <=====COAP CONFIRMATION ====== | |
+ || | | | |
+ || V | | |
+ || /\ | | |
+ || / \ | | |
+ || / \ | | |
+ || / \ | | |
+ || / \ | | |
+ || NO / END OF \ | | |
+ | --------- / TRASNFER? \ | | |
+ | \ (MAGIC / | | |
+ | \ KEYWORD / | | |
+ | \ FOUND) / | | |
+ | \ / | | |
+ | \ / | | |
+ | \ / | | |
+ | \/ | | |
+ | YES | | | |
+ | | | | |
+ | V | | |
+ | Display FUOTA Transfer details: | | At the end of data transfer |
+ | - Payload size used | | - BLUE LED OFF |
+ | - Transfer Time | | - Reboot the application |
+ | - Average Throughput | | |
+ | | | |
+ | | | On Reboot: |
+ | | | -if File_Type is FW_APP, boot on |
+ | | | Thread_Coap_Generic_Ota or any |
+ | | | appilcation supporting Ota at |
+ | | | @ 0x10000 |
+ | | | (see Thread_Coap_Generic_Ota) |
+ | | | |
+ | | | -if File_Type is FW_COPRO_WIRELESS |
+ | | | boot on FUS. |
+ | | | FUS will then install encrypted |
+ | | | binary on Copro Wireless side. |
+ | | | |
+ | | | |
+ | | | |
+ -------------------------------- - --------------------------------------
+ | Role : Leader | | Role : Child |
+ | | | |
+ | LED : Green | | LED : Red |
+ | | | |
+ |___________________________________| |_____________________________________|
+
+
+@par Keywords
+
+COAP,Thread
+
+@par Directory contents
+
+ - Thread/Thread_Ota/Core/Inc/app_common.h Header for all modules with common definition
+ - Thread/Thread_Ota/Core/Inc/app_conf.h Parameters configuration file of the application
+ - Thread/Thread_Ota/Core/Inc/app_entry.h Parameters configuration file of the application
+ - Thread/Thread_Ota/STM32_WPAN/App/app_thread.h Header for app_thread.c module
+ - Thread/Thread_Ota/Core/Inc/hw_conf.h Configuration file of the HW
+ - Thread/Thread_Ota/Core/Inc/main.h Header for main.c module
+ - Thread/Thread_Ota/Core/Inc/stm_logging.h Header for stm_logging.c module
+ - Thread/Thread_Ota/Core/Inc/stm32wbxx_hal_conf.h HAL configuration file
+ - Thread/Thread_Ota/Core/Src/stm32wbxx_it.h Interrupt header file
+ - Thread/Thread_Ota/Core/Inc/utilities_conf.h Configuration file of the utilities
+ - Thread/Thread_Ota/Core/Src/app_entry.c Initialization of the application
+ - Thread/Thread_Ota/STM32_WPAN/App/app_thread.c Thread application implementation
+ - Thread/Thread_Ota/STM32_WPAN/Target/hw_ipcc.c IPCC Driver
+ - Thread/Thread_Ota/Core/Src/stm32_lpm_if.c Low Power Manager Interface
+ - Thread/Thread_Ota/Core/Src/hw_timerserver.c Timer Server Driver
+ - Thread/Thread_Ota/Core/Src/hw_uart.c UART driver
+ - Thread/Thread_Ota/Core/Src/main.c Main program
+ - Thread/Thread_Ota/Core/Src/stm_logging.c Logging module for traces
+ - Thread/Thread_Ota/Core/Src/stm32xx_it.c Interrupt handlers
+ - Thread/Thread_Ota/Core/Src/system_stm32wbxx.c stm32wbxx system source file
+
+
+@par Hardware and Software environment
+
+ - This example runs on STM32WB55xx devices (Nucleo board and dongle)
+
+ - This example has been tested with an STMicroelectronics STM32WB55xx_Nucleo
+ board and can be easily tailored to any other supported device
+ and development board.
+
+ - On STM32WB55RG_Nucleo, the jumpers must be configured as described
+ in this section. Starting from the top left position up to the bottom
+ right position, the jumpers on the Board must be set as follows:
+
+ CN11: GND [OFF]
+ JP4: VDDRF [ON]
+ JP6: VC0 [ON]
+ JP2: +3V3 [ON]
+ JP1: USB_STL [ON] All others [OFF]
+ CN12: GND [OFF]
+ CN7: <All> [OFF]
+ JP3: VDD_MCU [ON]
+ JP5: GND [OFF] All others [ON]
+ CN10: <All> [OFF]
+
+
+@par How to use it ?
+
+This application requests having the stm32wb5x_Thread_FTD_fw.bin binary flashed on the Wireless Coprocessor.
+If it is not the case, you need to use STM32CubeProgrammer to load the appropriate binary.
+All available binaries are located under /Projects/STM32_Copro_Wireless_Binaries directory.
+Refer to UM2237 to learn how to use/install STM32CubeProgrammer.
+Refer to /Projects/STM32_Copro_Wireless_Binaries/ReleaseNote.html for the detailed procedure to change the
+Wireless Coprocessor binary.
+
+
+In order to make the program work, you must do the following:
+ - Connect 2 STM32WB55xx_Nucleo boards to your PC
+ - Open your preferred toolchain
+ - Rebuild all files and load your image into target memory
+ - Run the application
+
+
+For more details refer to the Application Note:
+ AN5289 - Building a Wireless application
+
+ if you want to get the traces in real time, you can connect an HyperTerminal
+ via an UART RS232 cable using the following connections:
+ RXD: CN10(Pin35)
+ TXD: CN10(Pin37)
+
+ For the Cli control and for the traces, the UART must be configured as follows:
+ - BaudRate = 115200 baud
+ - Word Length = 8 Bits
+ - Stop Bit = 1 bit
+ - Parity = none
+ - Flow control = none
+
+ * <h3><center>&copy; COPYRIGHT STMicroelectronics</center></h3>
+ */
+ \ No newline at end of file
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/app_common.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/app_common.h
new file mode 100644
index 000000000..47b2867f1
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/app_common.h
@@ -0,0 +1,113 @@
+/**
+ ******************************************************************************
+ * File Name : app_common.h
+ * Description : App Common application configuration file for STM32WPAN Middleware.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_COMMON_H
+#define APP_COMMON_H
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+#include <stdint.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+
+#include "app_conf.h"
+
+ /* -------------------------------- *
+ * Basic definitions *
+ * -------------------------------- */
+
+#undef NULL
+#define NULL 0
+
+#undef FALSE
+#define FALSE 0
+
+#undef TRUE
+#define TRUE (!0)
+
+ /* -------------------------------- *
+ * Critical Section definition *
+ * -------------------------------- */
+#define BACKUP_PRIMASK() uint32_t primask_bit= __get_PRIMASK()
+#define DISABLE_IRQ() __disable_irq()
+#define RESTORE_PRIMASK() __set_PRIMASK(primask_bit)
+
+ /* -------------------------------- *
+ * Macro delimiters *
+ * -------------------------------- */
+
+#define M_BEGIN do {
+
+#define M_END } while(0)
+
+ /* -------------------------------- *
+ * Some useful macro definitions *
+ * -------------------------------- */
+
+#define MAX( x, y ) (((x)>(y))?(x):(y))
+
+#define MIN( x, y ) (((x)<(y))?(x):(y))
+
+#define MODINC( a, m ) M_BEGIN (a)++; if ((a)>=(m)) (a)=0; M_END
+
+#define MODDEC( a, m ) M_BEGIN if ((a)==0) (a)=(m); (a)--; M_END
+
+#define MODADD( a, b, m ) M_BEGIN (a)+=(b); if ((a)>=(m)) (a)-=(m); M_END
+
+#define MODSUB( a, b, m ) MODADD( a, (m)-(b), m )
+
+#define PAUSE( t ) M_BEGIN \
+ __IO int _i; \
+ for ( _i = t; _i > 0; _i -- ); \
+ M_END
+
+#define DIVF( x, y ) ((x)/(y))
+
+#define DIVC( x, y ) (((x)+(y)-1)/(y))
+
+#define DIVR( x, y ) (((x)+((y)/2))/(y))
+
+#define SHRR( x, n ) ((((x)>>((n)-1))+1)>>1)
+
+#define BITN( w, n ) (((w)[(n)/32] >> ((n)%32)) & 1)
+
+#define BITNSET( w, n, b ) M_BEGIN (w)[(n)/32] |= ((U32)(b))<<((n)%32); M_END
+
+ /* -------------------------------- *
+ * Compiler *
+ * -------------------------------- */
+#define PLACE_IN_SECTION( __x__ ) __attribute__((section (__x__)))
+
+#ifdef WIN32
+#define ALIGN(n)
+#else
+#define ALIGN(n) __attribute__((aligned(n)))
+#endif
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /*APP_COMMON_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/app_conf.h
new file mode 100644
index 000000000..86d863947
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/app_conf.h
@@ -0,0 +1,388 @@
+/**
+ ******************************************************************************
+ * File Name : app_conf.h
+ * Description : Application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_CONF_H
+#define APP_CONF_H
+
+#include "hw.h"
+#include "hw_conf.h"
+#include "hw_if.h"
+
+/******************************************************************************
+ * Application Config
+ ******************************************************************************/
+/******************************************************************************
+ * Transport Layer
+ ******************************************************************************/
+/**
+ * Queue length of BLE Event
+ * This parameter defines the number of asynchronous events that can be stored in the HCI layer before
+ * being reported to the application. When a command is sent to the BLE core coprocessor, the HCI layer
+ * is waiting for the event with the Num_HCI_Command_Packets set to 1. The receive queue shall be large
+ * enough to store all asynchronous events received in between.
+ * When CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE is set to 27, this allow to store three 255 bytes long asynchronous events
+ * between the HCI command and its event.
+ * This parameter depends on the value given to CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE. When the queue size is to small,
+ * the system may hang if the queue is full with asynchronous events and the HCI layer is still waiting
+ * for a CC/CS event, In that case, the notification TL_BLE_HCI_ToNot() is called to indicate
+ * to the application a HCI command did not receive its command event within 30s (Default HCI Timeout).
+ */
+#define CFG_TL_EVT_QUEUE_LENGTH 5
+/**
+ * This parameter should be set to fit most events received by the HCI layer. It defines the buffer size of each element
+ * allocated in the queue of received events and can be used to optimize the amount of RAM allocated by the Memory Manager.
+ * It should not exceed 255 which is the maximum HCI packet payload size (a greater value is a lost of memory as it will
+ * never be used)
+ * It shall be at least 4 to receive the command status event in one frame.
+ * The default value is set to 27 to allow receiving an event of MTU size in a single buffer. This value maybe reduced
+ * further depending on the application.
+ *
+ */
+#define CFG_TL_MOST_EVENT_PAYLOAD_SIZE 255 /**< Set to 255 with the memory manager and the mailbox */
+
+#define TL_EVENT_FRAME_SIZE ( TL_EVT_HDR_SIZE + CFG_TL_MOST_EVENT_PAYLOAD_SIZE )
+/******************************************************************************
+ * UART interfaces
+ ******************************************************************************/
+
+/**
+ * Select UART interfaces
+ */
+#define CFG_DEBUG_TRACE_UART hw_lpuart1
+#define CFG_CONSOLE_MENU
+#define CFG_CLI_UART hw_uart1
+/******************************************************************************
+ * USB interface
+ ******************************************************************************/
+
+/**
+ * Enable/Disable USB interface
+ */
+#define CFG_USB_INTERFACE_ENABLE 0
+
+/******************************************************************************
+ * Low Power
+ *
+ * When CFG_FULL_LOW_POWER is set to 1, the system is configured in full
+ * low power mode. It means that all what can have an impact on the consumptions
+ * are powered down.(For instance LED, Access to Debugger, Etc.)
+ *
+ * When CFG_FULL_LOW_POWER is set to 0, the low power mode is not activated
+ *
+ ******************************************************************************/
+
+#define CFG_FULL_LOW_POWER 0
+
+#if (CFG_FULL_LOW_POWER == 1)
+#undef CFG_LPM_SUPPORTED
+#define CFG_LPM_SUPPORTED 1
+#endif /* CFG_FULL_LOW_POWER */
+
+/******************************************************************************
+ * Timer Server
+ ******************************************************************************/
+/**
+ * CFG_RTC_WUCKSEL_DIVIDER: This sets the RTCCLK divider to the wakeup timer.
+ * The higher is the value, the better is the power consumption and the accuracy of the timerserver
+ * The lower is the value, the finest is the granularity
+ *
+ * CFG_RTC_ASYNCH_PRESCALER: This sets the asynchronous prescaler of the RTC. It should as high as possible ( to ouput
+ * clock as low as possible) but the output clock should be equal or higher frequency compare to the clock feeding
+ * the wakeup timer. A lower clock speed would impact the accuracy of the timer server.
+ *
+ * CFG_RTC_SYNCH_PRESCALER: This sets the synchronous prescaler of the RTC.
+ * When the 1Hz calendar clock is required, it shall be sets according to other settings
+ * When the 1Hz calendar clock is not needed, CFG_RTC_SYNCH_PRESCALER should be set to 0x7FFF (MAX VALUE)
+ *
+ * CFG_RTCCLK_DIVIDER_CONF:
+ * Shall be set to either 0,2,4,8,16
+ * When set to either 2,4,8,16, the 1Hhz calendar is supported
+ * When set to 0, the user sets its own configuration
+ *
+ * The following settings are computed with LSI as input to the RTC
+ */
+#define CFG_RTCCLK_DIVIDER_CONF 0
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 0)
+/**
+ * Custom configuration
+ * It does not support 1Hz calendar
+ * It divides the RTC CLK by 16
+ */
+#define CFG_RTCCLK_DIV (16)
+#define CFG_RTC_WUCKSEL_DIVIDER (0)
+#define CFG_RTC_ASYNCH_PRESCALER (CFG_RTCCLK_DIV - 1)
+#define CFG_RTC_SYNCH_PRESCALER (0x7FFF)
+
+#else
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 2)
+/**
+ * It divides the RTC CLK by 2
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (3)
+#endif
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 4)
+/**
+ * It divides the RTC CLK by 4
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (2)
+#endif
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 8)
+/**
+ * It divides the RTC CLK by 8
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (1)
+#endif
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 16)
+/**
+ * It divides the RTC CLK by 16
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (0)
+#endif
+
+#define CFG_RTCCLK_DIV CFG_RTCCLK_DIVIDER_CONF
+#define CFG_RTC_ASYNCH_PRESCALER (CFG_RTCCLK_DIV - 1)
+#define CFG_RTC_SYNCH_PRESCALER (DIVR( LSE_VALUE, (CFG_RTC_ASYNCH_PRESCALER+1) ) - 1 )
+
+#endif
+
+/** tick timer value in us */
+#define CFG_TS_TICK_VAL DIVR( (CFG_RTCCLK_DIV * 1000000), LSE_VALUE )
+
+typedef enum
+{
+ CFG_TIM_PROC_ID_ISR,
+} CFG_TimProcID_t;
+
+/******************************************************************************
+ * Debug
+ ******************************************************************************/
+/**
+ * When set, this resets some hw resources to set the device in the same state than the power up
+ * The FW resets only register that may prevent the FW to run properly
+ *
+ * This shall be set to 0 in a final product
+ *
+ */
+#define CFG_HW_RESET_BY_FW 1
+
+/**
+ * keep debugger enabled while in any low power mode when set to 1
+ * should be set to 0 in production
+ */
+#define CFG_DEBUGGER_SUPPORTED 1
+
+#if (CFG_FULL_LOW_POWER == 1)
+#undef CFG_DEBUGGER_SUPPORTED
+#define CFG_DEBUGGER_SUPPORTED 0
+#endif /* CFG_FULL_LOW_POWER */
+
+/*****************************************************************************
+ * Traces
+ * Enable or Disable traces in application
+ * When CFG_DEBUG_TRACE is set, traces are activated
+ *
+ * Note : Refer to utilities_conf.h file in order to details
+ * the level of traces : CFG_DEBUG_TRACE_FULL or CFG_DEBUG_TRACE_LIGHT
+ *****************************************************************************/
+#define CFG_DEBUG_TRACE 1
+
+#if (CFG_FULL_LOW_POWER == 1)
+#undef CFG_DEBUG_TRACE
+#define CFG_DEBUG_TRACE 0
+#endif /* CFG_FULL_LOW_POWER */
+
+/**
+ * When CFG_DEBUG_TRACE_FULL is set to 1, the trace are output with the API name, the file name and the line number
+ * When CFG_DEBUG_TRACE_LIGHT is set to 1, only the debug message is output
+ *
+ * When both are set to 0, no trace are output
+ * When both are set to 1, CFG_DEBUG_TRACE_FULL is selected
+ */
+#define CFG_DEBUG_TRACE_LIGHT 1
+#define CFG_DEBUG_TRACE_FULL 0
+
+#if (( CFG_DEBUG_TRACE != 0 ) && ( CFG_DEBUG_TRACE_LIGHT == 0 ) && (CFG_DEBUG_TRACE_FULL == 0))
+#undef CFG_DEBUG_TRACE_FULL
+#undef CFG_DEBUG_TRACE_LIGHT
+#define CFG_DEBUG_TRACE_FULL 0
+#define CFG_DEBUG_TRACE_LIGHT 1
+#endif
+
+#if ( CFG_DEBUG_TRACE == 0 )
+#undef CFG_DEBUG_TRACE_FULL
+#undef CFG_DEBUG_TRACE_LIGHT
+#define CFG_DEBUG_TRACE_FULL 0
+#define CFG_DEBUG_TRACE_LIGHT 0
+#endif
+
+/**
+ * When not set, the traces is looping on sending the trace over UART
+ */
+#define DBG_TRACE_USE_CIRCULAR_QUEUE 1
+
+/**
+ * max buffer Size to queue data traces and max data trace allowed.
+ * Only Used if DBG_TRACE_USE_CIRCULAR_QUEUE is defined
+ */
+#define DBG_TRACE_MSG_QUEUE_SIZE 4096
+#define MAX_DBG_TRACE_MSG_SIZE 1024
+
+/******************************************************************************
+ * Configure Log level for Application
+ ******************************************************************************/
+#define APPLI_CONFIG_LOG_LEVEL LOG_LEVEL_INFO
+#define APPLI_PRINT_FILE_FUNC_LINE 0
+
+/* USER CODE BEGIN Defines */
+/******************************************************************************
+ * User interaction
+ * When CFG_LED_SUPPORTED is set, LEDS are activated if requested
+ * When CFG_BUTTON_SUPPORTED is set, the push button are activated if requested
+ ******************************************************************************/
+#if (CFG_FULL_LOW_POWER == 1)
+#define CFG_LED_SUPPORTED 0
+#define CFG_BUTTON_SUPPORTED 0
+#else
+#define CFG_LED_SUPPORTED 1
+#define CFG_BUTTON_SUPPORTED 1
+#endif /* CFG_FULL_LOW_POWER */
+/* USER CODE END Defines */
+
+/******************************************************************************
+ * Scheduler
+ ******************************************************************************/
+ /**
+ * This is the list of task id required by the application
+ * Each Id shall be in the range 0..31
+ */
+
+typedef enum
+{
+ CFG_TASK_MSG_FROM_M0_TO_M4,
+ CFG_TASK_SEND_CLI_TO_M0,
+ CFG_TASK_SYSTEM_HCI_ASYNCH_EVT,
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+ CFG_TASK_VCP_SEND_DATA,
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+ /* USER CODE BEGIN CFG_IdleTask_Id_t */
+ CFG_TASK_BUTTON_SW1,
+ CFG_TASK_BUTTON_SW3,
+ CFG_TASK_FUOTA_SEND,
+ CFG_TASK_FUOTA_PARAMETERS,
+ CFG_TASK_FUOTA_REBOOT,
+ /* USER CODE END CFG_IdleTask_Id_t */
+ CFG_TASK_NBR /**< Shall be last in the list */
+} CFG_IdleTask_Id_t;
+
+/* Scheduler types and defines */
+/*------------------------------------*/
+#define TASK_MSG_FROM_M0_TO_M4 (1U << CFG_TASK_MSG_FROM_M0_TO_M4)
+/* USER CODE BEGIN DEFINE_TASK */
+#define TASK_BUTTON_SW1 (1U << CFG_TASK_BUTTON_SW1)
+#define TASK_BUTTON_SW3 (1U << CFG_TASK_BUTTON_SW3)
+#define TASK_FUOTA_SEND (1U << CFG_TASK_FUOTA_SEND)
+#define TASK_FUOTA_PARAMETERS (1U << CFG_TASK_FUOTA_PARAMETERS)
+#define TASK_FUOTA_REBOOT (1U << CFG_TASK_FUOTA_REBOOT)
+/* USER CODE END DEFINE_TASK */
+
+
+/**
+ * This is the list of priority required by the application
+ * Each Id shall be in the range 0..31
+ */
+typedef enum
+{
+ CFG_SCH_PRIO_0,
+ CFG_SCH_PRIO_1,
+ CFG_PRIO_NBR,
+} CFG_SCH_Prio_Id_t;
+
+ /**
+ * This is a bit mapping over 32bits listing all events id supported in the application
+ */
+typedef enum
+{
+ CFG_EVT_SYSTEM_HCI_CMD_EVT_RESP,
+ CFG_EVT_ACK_FROM_M0_EVT,
+ CFG_EVT_SYNCHRO_BYPASS_IDLE,
+ /* USER CODE BEGIN CFG_IdleEvt_Id_t */
+ CFG_EVT_TIMER,
+ CFG_EVT_PROVISONING_DONE,
+ CFG_EVT_TRANSFER_64BITS_DONE,
+ CFG_EVT_FUOTA_REBOOT_RESP_DONE,
+ /* USER CODE END CFG_IdleEvt_Id_t */
+} CFG_IdleEvt_Id_t;
+
+#define EVENT_ACK_FROM_M0_EVT (1U << CFG_EVT_ACK_FROM_M0_EVT)
+#define EVENT_SYNCHRO_BYPASS_IDLE (1U << CFG_EVT_SYNCHRO_BYPASS_IDLE)
+/* USER CODE BEGIN DEFINE_EVENT */
+#define EVENT_TIMER (1U << CFG_EVT_TIMER)
+#define EVENT_PROVISIONING_DONE (1U << CFG_EVT_PROVISONING_DONE)
+#define EVENT_TRANSFER_64BITS_DONE (1U << CFG_EVT_TRANSFER_64BITS_DONE)
+#define EVENT_FUOTA_REBOOT_RESP_DONE (1U << CFG_EVT_FUOTA_REBOOT_RESP_DONE)
+/* USER CODE END DEFINE_EVENT */
+
+/******************************************************************************
+ * LOW POWER
+ ******************************************************************************/
+/**
+ * Supported requester to the MCU Low Power Manager - can be increased up to 32
+ * It lits a bit mapping of all user of the Low Power Manager
+ */
+typedef enum
+{
+ CFG_LPM_APP,
+ CFG_LPM_APP_THREAD,
+ /* USER CODE BEGIN CFG_LPM_Id_t */
+
+ /* USER CODE END CFG_LPM_Id_t */
+} CFG_LPM_Id_t;
+
+/******************************************************************************
+ * OTP manager
+ ******************************************************************************/
+#define CFG_OTP_BASE_ADDRESS OTP_AREA_BASE
+
+#define CFG_OTP_END_ADRESS OTP_AREA_END_ADDR
+
+/******************************************************************************
+ * FUOTA
+ ******************************************************************************/
+
+/**
+ * Define the start address where the application shall be located
+ */
+#define CFG_APP_START_SECTOR_INDEX (0x10)
+
+/**
+ * Define list of reboot reason
+ */
+#define CFG_REBOOT_ON_FW_APP (0x00)
+#define CFG_REBOOT_ON_THREAD_OTA_APP (0x01)
+#define CFG_REBOOT_ON_CPU2_UPGRADE (0x02)
+
+#endif /*APP_CONF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/app_entry.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/app_entry.h
new file mode 100644
index 000000000..48c467aaa
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/app_entry.h
@@ -0,0 +1,68 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : app_entry.h
+ * Description : App entry configuration file for STM32WPAN Middleware.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_ENTRY_H
+#define APP_ENTRY_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /* Exported types ------------------------------------------------------------*/
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* Exported variables --------------------------------------------------------*/
+/* USER CODE BEGIN EV */
+
+/* USER CODE END EV */
+
+/* Exported macros ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions ---------------------------------------------*/
+ void APPE_Init( void );
+/* USER CODE BEGIN EF */
+
+/* USER CODE END EF */
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /*APP_ENTRY_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/hw_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/hw_conf.h
new file mode 100644
index 000000000..8409edd16
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/hw_conf.h
@@ -0,0 +1,219 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : hw_conf.h
+ * Description : Hardware configuration file for STM32WPAN Middleware.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_CONF_H
+#define HW_CONF_H
+
+/******************************************************************************
+ * Semaphores
+ * THIS SHALL NO BE CHANGED AS THESE SEMAPHORES ARE USED AS WELL ON THE CM0+
+ *****************************************************************************/
+/* Index of the semaphore used to manage the entry Stop Mode procedure */
+#define CFG_HW_ENTRY_STOP_MODE_SEMID 4
+
+/* Index of the semaphore used to access the RCC */
+#define CFG_HW_RCC_SEMID 3
+
+/* Index of the semaphore used to access the FLASH */
+#define CFG_HW_FLASH_SEMID 2
+
+/* Index of the semaphore used to access the PKA */
+#define CFG_HW_PKA_SEMID 1
+
+/* Index of the semaphore used to access the RNG */
+#define CFG_HW_RNG_SEMID 0
+
+/******************************************************************************
+ * HW TIMER SERVER
+ *****************************************************************************/
+/**
+ * The user may define the maximum number of virtual timers supported.
+ * It shall not exceed 255
+ */
+#define CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER 6
+
+/**
+ * The user may define the priority in the NVIC of the RTC_WKUP interrupt handler that is used to manage the
+ * wakeup timer.
+ * This setting is the preemptpriority part of the NVIC.
+ */
+#define CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO 3
+
+/**
+ * The user may define the priority in the NVIC of the RTC_WKUP interrupt handler that is used to manage the
+ * wakeup timer.
+ * This setting is the subpriority part of the NVIC. It does not exist on all processors. When it is not supported
+ * on the CPU, the setting is ignored
+ */
+#define CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO 0
+
+/**
+ * Define a critical section in the Timer server
+ * The Timer server does not support the API to be nested
+ * The Application shall either:
+ * a) Ensure this will never happen
+ * b) Define the critical section
+ * The default implementations is masking all interrupts using the PRIMASK bit
+ * The TimerServer driver uses critical sections to avoid context corruption. This is achieved with the macro
+ * TIMER_ENTER_CRITICAL_SECTION and TIMER_EXIT_CRITICAL_SECTION. When CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION is set
+ * to 1, all STM32 interrupts are masked with the PRIMASK bit of the CortexM CPU. It is possible to use the BASEPRI
+ * register of the CortexM CPU to keep allowed some interrupts with high priority. In that case, the user shall
+ * re-implement TIMER_ENTER_CRITICAL_SECTION and TIMER_EXIT_CRITICAL_SECTION and shall make sure that no TimerServer
+ * API are called when the TIMER critical section is entered
+ */
+#define CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION 1
+
+/**
+ * This value shall reflect the maximum delay there could be in the application between the time the RTC interrupt
+ * is generated by the Hardware and the time when the RTC interrupt handler is called. This time is measured in
+ * number of RTCCLK ticks.
+ * A relaxed timing would be 10ms
+ * When the value is too short, the timerserver will not be able to count properly and all timeout may be random.
+ * When the value is too long, the device may wake up more often than the most optimal configuration. However, the
+ * impact on power consumption would be marginal (unless the value selected is extremely too long). It is strongly
+ * recommended to select a value large enough to make sure it is not too short to ensure reliability of the system
+ * as this will have marginal impact on low power mode
+ */
+#define CFG_HW_TS_RTC_HANDLER_MAX_DELAY ( 10 * (LSI_VALUE/1000) )
+
+ /**
+ * Interrupt ID in the NVIC of the RTC Wakeup interrupt handler
+ * It shall be type of IRQn_Type
+ */
+#define CFG_HW_TS_RTC_WAKEUP_HANDLER_ID RTC_WKUP_IRQn
+
+/******************************************************************************
+ * HW UART
+ *****************************************************************************/
+
+#define CFG_HW_LPUART1_ENABLED 1
+#define CFG_HW_LPUART1_DMA_TX_SUPPORTED 1
+
+#define CFG_HW_USART1_ENABLED 1
+#define CFG_HW_USART1_DMA_TX_SUPPORTED 1
+
+/**
+ * LPUART1
+ */
+#define CFG_HW_LPUART1_PREEMPTPRIORITY 0x0F
+#define CFG_HW_LPUART1_SUBPRIORITY 0
+
+/** < The application shall check the selected source clock is enable */
+#define CFG_HW_LPUART1_SOURCE_CLOCK RCC_LPUART1CLKSOURCE_SYSCLK
+
+#define CFG_HW_LPUART1_BAUDRATE 115200
+#define CFG_HW_LPUART1_WORDLENGTH UART_WORDLENGTH_8B
+#define CFG_HW_LPUART1_STOPBITS UART_STOPBITS_1
+#define CFG_HW_LPUART1_PARITY UART_PARITY_NONE
+#define CFG_HW_LPUART1_HWFLOWCTL UART_HWCONTROL_NONE
+#define CFG_HW_LPUART1_MODE UART_MODE_TX_RX
+#define CFG_HW_LPUART1_ADVFEATUREINIT UART_ADVFEATURE_NO_INIT
+#define CFG_HW_LPUART1_OVERSAMPLING UART_OVERSAMPLING_8
+
+#define CFG_HW_LPUART1_TX_PORT_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE
+#define CFG_HW_LPUART1_TX_PORT GPIOA
+#define CFG_HW_LPUART1_TX_PIN GPIO_PIN_2
+#define CFG_HW_LPUART1_TX_MODE GPIO_MODE_AF_PP
+#define CFG_HW_LPUART1_TX_PULL GPIO_NOPULL
+#define CFG_HW_LPUART1_TX_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_LPUART1_TX_ALTERNATE GPIO_AF8_LPUART1
+
+#define CFG_HW_LPUART1_RX_PORT_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE
+#define CFG_HW_LPUART1_RX_PORT GPIOA
+#define CFG_HW_LPUART1_RX_PIN GPIO_PIN_3
+#define CFG_HW_LPUART1_RX_MODE GPIO_MODE_AF_PP
+#define CFG_HW_LPUART1_RX_PULL GPIO_NOPULL
+#define CFG_HW_LPUART1_RX_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_LPUART1_RX_ALTERNATE GPIO_AF8_LPUART1
+
+#define CFG_HW_LPUART1_CTS_PORT_CLK_ENABLE __HAL_RCC_GPIOvalueNotSetted_CLK_ENABLE
+#define CFG_HW_LPUART1_CTS_PORT GPIOvalueNotSetted
+#define CFG_HW_LPUART1_CTS_PIN GPIO_PIN_valueNotSetted
+#define CFG_HW_LPUART1_CTS_MODE GPIO_MODE_AF_PP
+#define CFG_HW_LPUART1_CTS_PULL GPIO_PULLDOWN
+#define CFG_HW_LPUART1_CTS_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_LPUART1_CTS_ALTERNATE GPIO_AFvalueNotSetted_LPUART1
+
+#define CFG_HW_LPUART1_DMA_TX_PREEMPTPRIORITY 0x0F
+#define CFG_HW_LPUART1_DMA_TX_SUBPRIORITY 0
+
+#define CFG_HW_LPUART1_DMAMUX_CLK_ENABLE __HAL_RCC_DMAMUX1_CLK_ENABLE
+#define CFG_HW_LPUART1_DMA_CLK_ENABLE __HAL_RCC_DMA1_CLK_ENABLE
+#define CFG_HW_LPUART1_TX_DMA_REQ DMA_REQUEST_LPUART1_TX
+#define CFG_HW_LPUART1_TX_DMA_CHANNEL DMA1_CHANNEL_1
+#define CFG_HW_LPUART1_TX_DMA_IRQn DMA1_CHANNEL_1_IRQn
+#define CFG_HW_LPUART1_DMA_TX_IRQHandler DMA1_CHANNEL_1_IRQHandler
+
+/**
+ * UART1
+ */
+#define CFG_HW_USART1_PREEMPTPRIORITY 0x0F
+#define CFG_HW_USART1_SUBPRIORITY 0
+
+/** < The application shall check the selected source clock is enable */
+#define CFG_HW_USART1_SOURCE_CLOCK RCC_USART1CLKSOURCE_SYSCLK
+
+#define CFG_HW_USART1_BAUDRATE 115200
+#define CFG_HW_USART1_WORDLENGTH UART_WORDLENGTH_8B
+#define CFG_HW_USART1_STOPBITS UART_STOPBITS_1
+#define CFG_HW_USART1_PARITY UART_PARITY_NONE
+#define CFG_HW_USART1_HWFLOWCTL UART_HWCONTROL_NONE
+#define CFG_HW_USART1_MODE UART_MODE_TX_RX
+#define CFG_HW_USART1_ADVFEATUREINIT UART_ADVFEATURE_NO_INIT
+#define CFG_HW_USART1_OVERSAMPLING UART_OVERSAMPLING_8
+
+#define CFG_HW_USART1_TX_PORT_CLK_ENABLE __HAL_RCC_GPIOB_CLK_ENABLE
+#define CFG_HW_USART1_TX_PORT GPIOB
+#define CFG_HW_USART1_TX_PIN GPIO_PIN_6
+#define CFG_HW_USART1_TX_MODE GPIO_MODE_AF_PP
+#define CFG_HW_USART1_TX_PULL GPIO_NOPULL
+#define CFG_HW_USART1_TX_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_USART1_TX_ALTERNATE GPIO_AF7_USART1
+
+#define CFG_HW_USART1_RX_PORT_CLK_ENABLE __HAL_RCC_GPIOB_CLK_ENABLE
+#define CFG_HW_USART1_RX_PORT GPIOB
+#define CFG_HW_USART1_RX_PIN GPIO_PIN_7
+#define CFG_HW_USART1_RX_MODE GPIO_MODE_AF_PP
+#define CFG_HW_USART1_RX_PULL GPIO_NOPULL
+#define CFG_HW_USART1_RX_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_USART1_RX_ALTERNATE GPIO_AF7_USART1
+
+#define CFG_HW_USART1_CTS_PORT_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE
+#define CFG_HW_USART1_CTS_PORT GPIOA
+#define CFG_HW_USART1_CTS_PIN GPIO_PIN_11
+#define CFG_HW_USART1_CTS_MODE GPIO_MODE_AF_PP
+#define CFG_HW_USART1_CTS_PULL GPIO_PULLDOWN
+#define CFG_HW_USART1_CTS_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_USART1_CTS_ALTERNATE GPIO_AF7_USART1
+
+#define CFG_HW_USART1_DMA_TX_PREEMPTPRIORITY 0x0F
+#define CFG_HW_USART1_DMA_TX_SUBPRIORITY 0
+
+#define CFG_HW_USART1_DMAMUX_CLK_ENABLE __HAL_RCC_DMAMUX1_CLK_ENABLE
+#define CFG_HW_USART1_DMA_CLK_ENABLE __HAL_RCC_DMA1_CLK_ENABLE
+#define CFG_HW_USART1_TX_DMA_REQ DMA_REQUEST_USART1_TX
+#define CFG_HW_USART1_TX_DMA_CHANNEL DMA1_CHANNEL_2
+#define CFG_HW_USART1_TX_DMA_IRQn DMA1_CHANNEL_2_IRQn
+#define CFG_HW_USART1_DMA_TX_IRQHandler DMA1_CHANNEL_2_IRQHandler
+
+#endif /*HW_CONF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/main.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/main.h
new file mode 100644
index 000000000..68182bc5a
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/main.h
@@ -0,0 +1,71 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file : main.h
+ * @brief : Header for main.c file.
+ * This file contains the common defines of the application.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __MAIN_H
+#define __MAIN_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx_hal.h"
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Exported types ------------------------------------------------------------*/
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* Exported macro ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions prototypes ---------------------------------------------*/
+void Error_Handler(void);
+
+/* USER CODE BEGIN EFP */
+
+/* USER CODE END EFP */
+
+/* Private defines -----------------------------------------------------------*/
+/* USER CODE BEGIN Private defines */
+
+/* USER CODE END Private defines */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MAIN_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/stm32_lpm_if.h
new file mode 100644
index 000000000..70abecaa9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/stm32_lpm_if.h
@@ -0,0 +1,81 @@
+/* USER CODE BEGIN Header */
+/**
+******************************************************************************
+* @file stm32_lpm_if.h
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
+******************************************************************************
+* @attention
+*
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+* All rights reserved.</center></h2>
+*
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+*
+******************************************************************************
+*/
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32_LPM_IF_H
+#define __STM32_LPM_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+
+/**
+ * @brief Enters Low Power Off Mode
+ * @param none
+ * @retval none
+ */
+void PWR_EnterOffMode( void );
+/**
+ * @brief Exits Low Power Off Mode
+ * @param none
+ * @retval none
+ */
+void PWR_ExitOffMode( void );
+
+/**
+ * @brief Enters Low Power Stop Mode
+ * @note ARM exists the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_EnterStopMode( void );
+/**
+ * @brief Exits Low Power Stop Mode
+ * @note Enable the pll at 32MHz
+ * @param none
+ * @retval none
+ */
+void PWR_ExitStopMode( void );
+
+/**
+ * @brief Enters Low Power Sleep Mode
+ * @note ARM exits the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_EnterSleepMode( void );
+
+/**
+ * @brief Exits Low Power Sleep Mode
+ * @note ARM exits the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_ExitSleepMode( void );
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*__STM32_LPM_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/stm32wbxx_hal_conf.h
new file mode 100644
index 000000000..ea9aa40d0
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/stm32wbxx_hal_conf.h
@@ -0,0 +1,353 @@
+/**
+ ******************************************************************************
+ * @file stm32wbxx_hal_conf.h
+ * @author MCD Application Team
+ * @brief HAL configuration file.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32WBxx_HAL_CONF_H
+#define __STM32WBxx_HAL_CONF_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/* Exported types ------------------------------------------------------------*/
+/* Exported constants --------------------------------------------------------*/
+
+/* ########################## Module Selection ############################## */
+/**
+ * @brief This is the list of modules to be used in the HAL driver
+ */
+#define HAL_MODULE_ENABLED
+/*#define HAL_ADC_MODULE_ENABLED */
+/*#define HAL_CRYP_MODULE_ENABLED */
+/*#define HAL_COMP_MODULE_ENABLED */
+/*#define HAL_CRC_MODULE_ENABLED */
+#define HAL_HSEM_MODULE_ENABLED
+/*#define HAL_I2C_MODULE_ENABLED */
+/*#define HAL_IPCC_MODULE_ENABLED */
+/*#define HAL_IRDA_MODULE_ENABLED */
+/*#define HAL_IWDG_MODULE_ENABLED */
+/*#define HAL_LCD_MODULE_ENABLED */
+/*#define HAL_LPTIM_MODULE_ENABLED */
+/*#define HAL_PCD_MODULE_ENABLED */
+/*#define HAL_PKA_MODULE_ENABLED */
+/*#define HAL_QSPI_MODULE_ENABLED */
+/*#define HAL_RNG_MODULE_ENABLED */
+#define HAL_RTC_MODULE_ENABLED
+/*#define HAL_SAI_MODULE_ENABLED */
+/*#define HAL_SMBUS_MODULE_ENABLED */
+/*#define HAL_SMARTCARD_MODULE_ENABLED */
+/*#define HAL_SPI_MODULE_ENABLED */
+/*#define HAL_TIM_MODULE_ENABLED */
+/*#define HAL_TSC_MODULE_ENABLED */
+#define HAL_UART_MODULE_ENABLED
+/*#define HAL_USART_MODULE_ENABLED */
+/*#define HAL_WWDG_MODULE_ENABLED */
+#define HAL_EXTI_MODULE_ENABLED
+#define HAL_CORTEX_MODULE_ENABLED
+#define HAL_DMA_MODULE_ENABLED
+#define HAL_FLASH_MODULE_ENABLED
+#define HAL_GPIO_MODULE_ENABLED
+#define HAL_PWR_MODULE_ENABLED
+#define HAL_RCC_MODULE_ENABLED
+
+#define USE_HAL_ADC_REGISTER_CALLBACKS 0u
+#define USE_HAL_COMP_REGISTER_CALLBACKS 0u
+#define USE_HAL_CRYP_REGISTER_CALLBACKS 0u
+#define USE_HAL_I2C_REGISTER_CALLBACKS 0u
+#define USE_HAL_IRDA_REGISTER_CALLBACKS 0u
+#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0u
+#define USE_HAL_PCD_REGISTER_CALLBACKS 0u
+#define USE_HAL_PKA_REGISTER_CALLBACKS 0u
+#define USE_HAL_QSPI_REGISTER_CALLBACKS 0u
+#define USE_HAL_RNG_REGISTER_CALLBACKS 0u
+#define USE_HAL_RTC_REGISTER_CALLBACKS 0u
+#define USE_HAL_SAI_REGISTER_CALLBACKS 0u
+#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0u
+#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0u
+#define USE_HAL_SPI_REGISTER_CALLBACKS 0u
+#define USE_HAL_TIM_REGISTER_CALLBACKS 0u
+#define USE_HAL_TSC_REGISTER_CALLBACKS 0u
+#define USE_HAL_UART_REGISTER_CALLBACKS 0u
+#define USE_HAL_USART_REGISTER_CALLBACKS 0u
+#define USE_HAL_WWDG_REGISTER_CALLBACKS 0u
+
+/* ########################## Oscillator Values adaptation ####################*/
+/**
+ * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
+ * This value is used by the RCC HAL module to compute the system frequency
+ * (when HSE is used as system clock source, directly or through the PLL).
+ */
+#if !defined (HSE_VALUE)
+#define HSE_VALUE 32000000U /*!< Value of the External oscillator in Hz */
+#endif /* HSE_VALUE */
+
+#if !defined (HSE_STARTUP_TIMEOUT)
+ #define HSE_STARTUP_TIMEOUT ((uint32_t)100) /*!< Time out for HSE start up, in ms */
+#endif /* HSE_STARTUP_TIMEOUT */
+
+/**
+ * @brief Internal Multiple Speed oscillator (MSI) default value.
+ * This value is the default MSI range value after Reset.
+ */
+#if !defined (MSI_VALUE)
+ #define MSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/
+#endif /* MSI_VALUE */
+
+/**
+ * @brief Internal High Speed oscillator (HSI) value.
+ * This value is used by the RCC HAL module to compute the system frequency
+ * (when HSI is used as system clock source, directly or through the PLL).
+ */
+#if !defined (HSI_VALUE)
+#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/
+#endif /* HSI_VALUE */
+
+/**
+ * @brief Internal Low Speed oscillator (LSI1) value.
+ */
+#if !defined (LSI1_VALUE)
+ #define LSI1_VALUE ((uint32_t)32000) /*!< LSI1 Typical Value in Hz*/
+#endif /* LSI1_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
+ The real value may vary depending on the variations
+ in voltage and temperature.*/
+/**
+ * @brief Internal Low Speed oscillator (LSI2) value.
+ */
+#if !defined (LSI2_VALUE)
+ #define LSI2_VALUE ((uint32_t)32000) /*!< LSI2 Typical Value in Hz*/
+#endif /* LSI2_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
+ The real value may vary depending on the variations
+ in voltage and temperature.*/
+
+/**
+ * @brief External Low Speed oscillator (LSE) value.
+ * This value is used by the UART, RTC HAL module to compute the system frequency
+ */
+#if !defined (LSE_VALUE)
+#define LSE_VALUE 32768U /*!< Value of the External oscillator in Hz*/
+#endif /* LSE_VALUE */
+
+/**
+ * @brief Internal Multiple Speed oscillator (HSI48) default value.
+ * This value is the default HSI48 range value after Reset.
+ */
+#if !defined (HSI48_VALUE)
+ #define HSI48_VALUE ((uint32_t)48000000) /*!< Value of the Internal oscillator in Hz*/
+#endif /* HSI48_VALUE */
+
+#if !defined (LSE_STARTUP_TIMEOUT)
+#define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */
+#endif /* HSE_STARTUP_TIMEOUT */
+
+/**
+ * @brief External clock source for SAI1 peripheral
+ * This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source
+ * frequency.
+ */
+#if !defined (EXTERNAL_SAI1_CLOCK_VALUE)
+ #define EXTERNAL_SAI1_CLOCK_VALUE ((uint32_t)2097000) /*!< Value of the SAI1 External clock source in Hz*/
+#endif /* EXTERNAL_SAI1_CLOCK_VALUE */
+
+/* Tip: To avoid modifying this file each time you need to use different HSE,
+ === you can define the HSE value in your toolchain compiler preprocessor. */
+
+/* ########################### System Configuration ######################### */
+/**
+ * @brief This is the HAL system configuration section
+ */
+
+#define VDD_VALUE 3300U /*!< Value of VDD in mv */
+#define TICK_INT_PRIORITY 0U /*!< tick interrupt priority */
+#define USE_RTOS 0U
+#define PREFETCH_ENABLE 1U
+#define INSTRUCTION_CACHE_ENABLE 1U
+#define DATA_CACHE_ENABLE 1U
+
+/* ########################## Assert Selection ############################## */
+/**
+ * @brief Uncomment the line below to expanse the "assert_param" macro in the
+ * HAL drivers code
+ */
+/* #define USE_FULL_ASSERT 1U */
+
+/* ################## SPI peripheral configuration ########################## */
+
+/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
+ * Activated: CRC code is present inside driver
+ * Deactivated: CRC code cleaned from driver
+ */
+
+#define USE_SPI_CRC 0U
+
+/* Includes ------------------------------------------------------------------*/
+/**
+ * @brief Include module's header file
+ */
+#ifdef HAL_DMA_MODULE_ENABLED
+ #include "stm32wbxx_hal_dma.h"
+#endif /* HAL_DMA_MODULE_ENABLED */
+
+#ifdef HAL_ADC_MODULE_ENABLED
+ #include "stm32wbxx_hal_adc.h"
+#endif /* HAL_ADC_MODULE_ENABLED */
+
+#ifdef HAL_COMP_MODULE_ENABLED
+ #include "stm32wbxx_hal_comp.h"
+#endif /* HAL_COMP_MODULE_ENABLED */
+
+#ifdef HAL_CORTEX_MODULE_ENABLED
+ #include "stm32wbxx_hal_cortex.h"
+#endif /* HAL_CORTEX_MODULE_ENABLED */
+
+#ifdef HAL_CRC_MODULE_ENABLED
+ #include "stm32wbxx_hal_crc.h"
+#endif /* HAL_CRC_MODULE_ENABLED */
+
+#ifdef HAL_CRYP_MODULE_ENABLED
+ #include "stm32wbxx_hal_cryp.h"
+#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
+
+#ifdef HAL_FLASH_MODULE_ENABLED
+ #include "stm32wbxx_hal_flash.h"
+#endif /* HAL_FLASH_MODULE_ENABLED */
+
+#ifdef HAL_GPIO_MODULE_ENABLED
+ #include "stm32wbxx_hal_gpio.h"
+#endif /* HAL_GPIO_MODULE_ENABLED */
+
+#ifdef HAL_HSEM_MODULE_ENABLED
+ #include "stm32wbxx_hal_hsem.h"
+#endif /* HAL_HSEM_MODULE_ENABLED */
+
+#ifdef HAL_I2C_MODULE_ENABLED
+ #include "stm32wbxx_hal_i2c.h"
+#endif /* HAL_I2C_MODULE_ENABLED */
+
+#ifdef HAL_IPCC_MODULE_ENABLED
+ #include "stm32wbxx_hal_ipcc.h"
+#endif /* HAL_IPCC_MODULE_ENABLED */
+
+#ifdef HAL_IRDA_MODULE_ENABLED
+ #include "stm32wbxx_hal_irda.h"
+#endif /* HAL_IRDA_MODULE_ENABLED */
+
+#ifdef HAL_IWDG_MODULE_ENABLED
+ #include "stm32wbxx_hal_iwdg.h"
+#endif /* HAL_IWDG_MODULE_ENABLED */
+
+#ifdef HAL_LCD_MODULE_ENABLED
+ #include "stm32wbxx_hal_lcd.h"
+#endif /* HAL_LCD_MODULE_ENABLED */
+
+#ifdef HAL_LPTIM_MODULE_ENABLED
+ #include "stm32wbxx_hal_lptim.h"
+#endif /* HAL_LPTIM_MODULE_ENABLED */
+
+#ifdef HAL_PCD_MODULE_ENABLED
+ #include "stm32wbxx_hal_pcd.h"
+#endif /* HAL_PCD_MODULE_ENABLED */
+
+#ifdef HAL_PKA_MODULE_ENABLED
+ #include "stm32wbxx_hal_pka.h"
+#endif /* HAL_PKA_MODULE_ENABLED */
+
+#ifdef HAL_PWR_MODULE_ENABLED
+ #include "stm32wbxx_hal_pwr.h"
+#endif /* HAL_PWR_MODULE_ENABLED */
+
+#ifdef HAL_QSPI_MODULE_ENABLED
+ #include "stm32wbxx_hal_qspi.h"
+#endif /* HAL_QSPI_MODULE_ENABLED */
+
+#ifdef HAL_RCC_MODULE_ENABLED
+ #include "stm32wbxx_hal_rcc.h"
+#endif /* HAL_RCC_MODULE_ENABLED */
+
+#ifdef HAL_RNG_MODULE_ENABLED
+ #include "stm32wbxx_hal_rng.h"
+#endif /* HAL_RNG_MODULE_ENABLED */
+
+#ifdef HAL_RTC_MODULE_ENABLED
+ #include "stm32wbxx_hal_rtc.h"
+#endif /* HAL_RTC_MODULE_ENABLED */
+
+#ifdef HAL_SAI_MODULE_ENABLED
+ #include "stm32wbxx_hal_sai.h"
+#endif /* HAL_SAI_MODULE_ENABLED */
+
+#ifdef HAL_SMARTCARD_MODULE_ENABLED
+ #include "stm32wbxx_hal_smartcard.h"
+#endif /* HAL_SMARTCARD_MODULE_ENABLED */
+
+#ifdef HAL_SMBUS_MODULE_ENABLED
+ #include "stm32wbxx_hal_smbus.h"
+#endif /* HAL_SMBUS_MODULE_ENABLED */
+
+#ifdef HAL_SPI_MODULE_ENABLED
+ #include "stm32wbxx_hal_spi.h"
+#endif /* HAL_SPI_MODULE_ENABLED */
+
+#ifdef HAL_TIM_MODULE_ENABLED
+ #include "stm32wbxx_hal_tim.h"
+#endif /* HAL_TIM_MODULE_ENABLED */
+
+#ifdef HAL_TSC_MODULE_ENABLED
+ #include "stm32wbxx_hal_tsc.h"
+#endif /* HAL_TSC_MODULE_ENABLED */
+
+#ifdef HAL_UART_MODULE_ENABLED
+ #include "stm32wbxx_hal_uart.h"
+#endif /* HAL_UART_MODULE_ENABLED */
+
+#ifdef HAL_USART_MODULE_ENABLED
+ #include "stm32wbxx_hal_usart.h"
+#endif /* HAL_USART_MODULE_ENABLED */
+
+#ifdef HAL_WWDG_MODULE_ENABLED
+ #include "stm32wbxx_hal_wwdg.h"
+#endif /* HAL_WWDG_MODULE_ENABLED */
+
+/* Exported macro ------------------------------------------------------------*/
+#ifdef USE_FULL_ASSERT
+/**
+ * @brief The assert_param macro is used for function's parameters check.
+ * @param expr If expr is false, it calls assert_failed function
+ * which reports the name of the source file and the source
+ * line number of the call that failed.
+ * If expr is true, it returns no value.
+ * @retval None
+ */
+ #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
+/* Exported functions ------------------------------------------------------- */
+ void assert_failed(uint8_t* file, uint32_t line);
+#else
+ #define assert_param(expr) ((void)0U)
+#endif /* USE_FULL_ASSERT */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __STM32WBxx_HAL_CONF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/stm32wbxx_it.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/stm32wbxx_it.h
new file mode 100644
index 000000000..e80726d02
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/stm32wbxx_it.h
@@ -0,0 +1,85 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file stm32wbxx_it.h
+ * @brief This file contains the headers of the interrupt handlers.
+ *******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32WBxx_IT_H
+#define __STM32WBxx_IT_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+#include "app_common.h"
+/* USER CODE END Includes */
+
+/* Exported types ------------------------------------------------------------*/
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* Exported macro ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions prototypes ---------------------------------------------*/
+void NMI_Handler(void);
+void HardFault_Handler(void);
+void MemManage_Handler(void);
+void BusFault_Handler(void);
+void UsageFault_Handler(void);
+void SVC_Handler(void);
+void DebugMon_Handler(void);
+void PendSV_Handler(void);
+void SysTick_Handler(void);
+void PVD_PVM_IRQHandler(void);
+void FLASH_IRQHandler(void);
+void RCC_IRQHandler(void);
+void DMA1_Channel1_IRQHandler(void);
+void DMA1_Channel2_IRQHandler(void);
+void C2SEV_PWR_C2H_IRQHandler(void);
+void USART1_IRQHandler(void);
+void LPUART1_IRQHandler(void);
+void PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler(void);
+void HSEM_IRQHandler(void);
+void FPU_IRQHandler(void);
+/* USER CODE BEGIN EFP */
+void RTC_WKUP_IRQHandler(void);
+void EXTI0_IRQHandler(void);
+void EXTI1_IRQHandler(void);
+void EXTI4_IRQHandler(void);
+void IPCC_C1_TX_IRQHandler(void);
+void IPCC_C1_RX_IRQHandler(void);
+/* USER CODE END EFP */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __STM32WBxx_IT_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/stm_logging.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/stm_logging.h
new file mode 100644
index 000000000..75bacdffe
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/stm_logging.h
@@ -0,0 +1,59 @@
+/**
+ ******************************************************************************
+ * File Name : stm_logging.h
+ * Description : Application header file for logging
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+#ifndef STM_LOGGING_H_
+#define STM_LOGGING_H_
+
+#define LOG_LEVEL_NONE 0 /* None */
+#define LOG_LEVEL_CRIT 1U /* Critical */
+#define LOG_LEVEL_WARN 2U /* Warning */
+#define LOG_LEVEL_INFO 3U /* Info */
+#define LOG_LEVEL_DEBG 4U /* Debug */
+
+#define APP_DBG_FULL(level, region, ...) \
+ if (APPLI_PRINT_FILE_FUNC_LINE == 1U) \
+ { \
+ printf("\r\n[%s][%s][%d] ", DbgTraceGetFileName(__FILE__),__FUNCTION__,__LINE__); \
+ } \
+ logApplication(level, region, __VA_ARGS__);
+
+#define APP_DBG(...) \
+ if (APPLI_PRINT_FILE_FUNC_LINE == 1U) \
+ { \
+ printf("\r\n[%s][%s][%d] ", DbgTraceGetFileName(__FILE__),__FUNCTION__,__LINE__); \
+ } \
+ logApplication(LOG_LEVEL_NONE, APPLI_LOG_REGION_GENERAL, __VA_ARGS__);
+
+/**
+ * This enumeration represents log regions.
+ *
+ */
+typedef enum
+{
+ APPLI_LOG_REGION_GENERAL = 1U, /* General */
+ APPLI_LOG_REGION_OPENTHREAD_API = 2U, /* OpenThread API */
+ APPLI_LOG_REGION_OT_API_LINK = 3U, /* OpenThread Link API */
+ APPLI_LOG_REGION_OT_API_INSTANCE = 4U, /* OpenThread Instance API */
+ APPLI_LOG_REGION_OT_API_MESSAGE = 5U /* OpenThread Message API */
+} appliLogRegion_t;
+
+typedef uint8_t appliLogLevel_t;
+
+void logApplication(appliLogLevel_t aLogLevel, appliLogRegion_t aLogRegion, const char *aFormat, ...);
+
+#endif /* STM_LOGGING_H_ */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/utilities_conf.h
new file mode 100644
index 000000000..4dde3509a
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Inc/utilities_conf.h
@@ -0,0 +1,68 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : utilities_conf.h
+ * Description : Configuration file for STM32 Utilities.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef UTILITIES_CONF_H
+#define UTILITIES_CONF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "cmsis_compiler.h"
+#include "string.h"
+
+/******************************************************************************
+ * common
+ ******************************************************************************/
+#define UTILS_ENTER_CRITICAL_SECTION( ) uint32_t primask_bit = __get_PRIMASK( );\
+ __disable_irq( )
+
+#define UTILS_EXIT_CRITICAL_SECTION( ) __set_PRIMASK( primask_bit )
+
+#define UTILS_MEMSET8( dest, value, size ) memset( dest, value, size);
+
+/******************************************************************************
+ * tiny low power manager
+ * (any macro that does not need to be modified can be removed)
+ ******************************************************************************/
+#define UTIL_LPM_INIT_CRITICAL_SECTION( )
+#define UTIL_LPM_ENTER_CRITICAL_SECTION( ) UTILS_ENTER_CRITICAL_SECTION( )
+#define UTIL_LPM_EXIT_CRITICAL_SECTION( ) UTILS_EXIT_CRITICAL_SECTION( )
+
+/******************************************************************************
+ * sequencer
+ * (any macro that does not need to be modified can be removed)
+ ******************************************************************************/
+#define UTIL_SEQ_INIT_CRITICAL_SECTION( )
+#define UTIL_SEQ_ENTER_CRITICAL_SECTION( ) UTILS_ENTER_CRITICAL_SECTION( )
+#define UTIL_SEQ_EXIT_CRITICAL_SECTION( ) UTILS_EXIT_CRITICAL_SECTION( )
+#define UTIL_SEQ_CONF_TASK_NBR (32)
+#define UTIL_SEQ_CONF_PRIO_NBR (2)
+#define UTIL_SEQ_MEMSET8( dest, value, size ) UTILS_MEMSET8( dest, value, size )
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*UTILITIES_CONF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/app_entry.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/app_entry.c
new file mode 100644
index 000000000..fd9cdecf9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/app_entry.c
@@ -0,0 +1,448 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : app_entry.c
+ * Description : Entry application source file for STM32WPAN Middleware.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "main.h"
+#include "app_entry.h"
+#include "app_thread.h"
+#include "app_conf.h"
+#include "hw_conf.h"
+#include "stm32_seq.h"
+#include "stm_logging.h"
+#include "shci_tl.h"
+#include "stm32_lpm.h"
+#include "dbg_trace.h"
+#include "shci.h"
+
+/* Private includes -----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+extern RTC_HandleTypeDef hrtc;
+/* USER CODE BEGIN PTD */
+
+/* USER CODE END PTD */
+
+/* Private defines -----------------------------------------------------------*/
+/* POOL_SIZE = 2(TL_PacketHeader_t) + 258 (3(TL_EVT_HDR_SIZE) + 255(Payload size)) */
+#define POOL_SIZE (CFG_TL_EVT_QUEUE_LENGTH * 4U * DIVC(( sizeof(TL_PacketHeader_t) + TL_EVENT_FRAME_SIZE ), 4U))
+
+/* USER CODE BEGIN PD */
+
+/* USER CODE END PD */
+
+/* Private macros ------------------------------------------------------------*/
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private variables ---------------------------------------------------------*/
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t EvtPool[POOL_SIZE];
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static TL_CmdPacket_t SystemCmdBuffer;
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t SystemSpareEvtBuffer[sizeof(TL_PacketHeader_t) + TL_EVT_HDR_SIZE + 255U];
+
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Global function prototypes -----------------------------------------------*/
+size_t DbgTraceWrite(int handle, const unsigned char * buf, size_t bufSize);
+
+/* USER CODE BEGIN GFP */
+
+/* USER CODE END GFP */
+
+/* Private functions prototypes-----------------------------------------------*/
+static void SystemPower_Config( void );
+static void Init_Debug( void );
+static void appe_Tl_Init( void );
+static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status );
+static void APPE_SysUserEvtRx( void * pPayload );
+static void APPE_SysEvtReadyProcessing( void );
+static void APPE_SysEvtError( SCHI_SystemErrCode_t ErrorCode);
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+extern void MX_LPUART1_UART_Init(void);
+#endif
+#if (CFG_HW_USART1_ENABLED == 1)
+extern void MX_USART1_UART_Init(void);
+#endif
+
+/* USER CODE BEGIN PFP */
+static void Led_Init( void );
+static void Button_Init( void );
+/* USER CODE END PFP */
+
+/* Functions Definition ------------------------------------------------------*/
+void APPE_Init( void )
+{
+ SystemPower_Config(); /**< Configure the system Power Mode */
+
+ HW_TS_Init(hw_ts_InitMode_Full, &hrtc); /**< Initialize the TimerServer */
+
+/* USER CODE BEGIN APPE_Init_1 */
+ Init_Debug();
+
+ UTIL_LPM_SetOffMode(1 << CFG_LPM_APP, UTIL_LPM_DISABLE);
+ Led_Init();
+ Button_Init();
+/* USER CODE END APPE_Init_1 */
+ appe_Tl_Init(); /* Initialize all transport layers */
+
+ /**
+ * From now, the application is waiting for the ready event ( VS_HCI_C2_Ready )
+ * received on the system channel before starting the Stack
+ * This system event is received with APPE_SysUserEvtRx()
+ */
+/* USER CODE BEGIN APPE_Init_2 */
+
+/* USER CODE END APPE_Init_2 */
+ return;
+}
+/* USER CODE BEGIN FD */
+
+/* USER CODE END FD */
+
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+static void Init_Debug( void )
+{
+#if (CFG_DEBUGGER_SUPPORTED == 1)
+ /**
+ * Keep debugger enabled while in any low power mode
+ */
+ HAL_DBGMCU_EnableDBGSleepMode();
+
+ /***************** ENABLE DEBUGGER *************************************/
+ LL_EXTI_EnableIT_32_63(LL_EXTI_LINE_48);
+ LL_C2_EXTI_EnableIT_32_63(LL_EXTI_LINE_48);
+
+#else
+
+ GPIO_InitTypeDef gpio_config = {0};
+
+ gpio_config.Pull = GPIO_NOPULL;
+ gpio_config.Mode = GPIO_MODE_ANALOG;
+
+ gpio_config.Pin = GPIO_PIN_15 | GPIO_PIN_14 | GPIO_PIN_13;
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ HAL_GPIO_Init(GPIOA, &gpio_config);
+ __HAL_RCC_GPIOA_CLK_DISABLE();
+
+ gpio_config.Pin = GPIO_PIN_4 | GPIO_PIN_3;
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+ HAL_GPIO_Init(GPIOB, &gpio_config);
+ __HAL_RCC_GPIOB_CLK_DISABLE();
+
+ HAL_DBGMCU_DisableDBGSleepMode();
+ HAL_DBGMCU_DisableDBGStopMode();
+ HAL_DBGMCU_DisableDBGStandbyMode();
+
+#endif /* (CFG_DEBUGGER_SUPPORTED == 1) */
+
+#if(CFG_DEBUG_TRACE != 0)
+ DbgTraceInit();
+#endif
+
+ return;
+}
+
+/**
+ * @brief Configure the system for power optimization
+ *
+ * @note This API configures the system to be ready for low power mode
+ *
+ * @param None
+ * @retval None
+ */
+static void SystemPower_Config( void )
+{
+
+ /**
+ * Select HSI as system clock source after Wake Up from Stop mode
+ */
+ LL_RCC_SetClkAfterWakeFromStop(LL_RCC_STOP_WAKEUPCLOCK_HSI);
+
+ /* Initialize low power manager */
+ UTIL_LPM_Init( );
+
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+ /**
+ * Enable USB power
+ */
+ HAL_PWREx_EnableVddUSB();
+#endif
+
+ return;
+}
+
+static void appe_Tl_Init( void )
+{
+ TL_MM_Config_t tl_mm_config;
+ SHCI_TL_HciInitConf_t SHci_Tl_Init_Conf;
+ /**< Reference table initialization */
+ TL_Init();
+
+ /**< System channel initialization */
+ UTIL_SEQ_RegTask( 1<< CFG_TASK_SYSTEM_HCI_ASYNCH_EVT, UTIL_SEQ_RFU, shci_user_evt_proc );
+ SHci_Tl_Init_Conf.p_cmdbuffer = (uint8_t*)&SystemCmdBuffer;
+ SHci_Tl_Init_Conf.StatusNotCallBack = APPE_SysStatusNot;
+ shci_init(APPE_SysUserEvtRx, (void*) &SHci_Tl_Init_Conf);
+
+ /**< Memory Manager channel initialization */
+ tl_mm_config.p_BleSpareEvtBuffer = 0;
+ tl_mm_config.p_SystemSpareEvtBuffer = SystemSpareEvtBuffer;
+ tl_mm_config.p_AsynchEvtPool = EvtPool;
+ tl_mm_config.AsynchEvtPoolSize = POOL_SIZE;
+ TL_MM_Init( &tl_mm_config );
+
+ TL_Enable();
+
+ return;
+}
+
+static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status )
+{
+ UNUSED(status);
+ return;
+}
+
+/**
+ * @brief Trap a notification coming from the M0 firmware
+ * @param pPayload : payload associated to the notification
+ *
+ * @retval None
+ */
+
+static void APPE_SysUserEvtRx( void * pPayload )
+{
+ TL_AsynchEvt_t *p_sys_event;
+ p_sys_event = (TL_AsynchEvt_t*)(((tSHCI_UserEvtRxParam*)pPayload)->pckt->evtserial.evt.payload);
+
+ switch(p_sys_event->subevtcode)
+ {
+ case SHCI_SUB_EVT_CODE_READY:
+ APPE_SysEvtReadyProcessing();
+ break;
+ case SHCI_SUB_EVT_ERROR_NOTIF:
+ APPE_SysEvtError((SCHI_SystemErrCode_t) (p_sys_event->payload[0]));
+ break;
+ default:
+ break;
+ }
+ return;
+}
+
+/**
+ * @brief Notify a system error coming from the M0 firmware
+ * @param ErrorCode : errorCode detected by the M0 firmware
+ *
+ * @retval None
+ */
+static void APPE_SysEvtError( SCHI_SystemErrCode_t ErrorCode)
+{
+ switch(ErrorCode)
+ {
+ case ERR_THREAD_LLD_FATAL_ERROR:
+ APP_DBG("** ERR_THREAD : LLD_FATAL_ERROR \n");
+ break;
+ case ERR_THREAD_UNKNOWN_CMD:
+ APP_DBG("** ERR_THREAD : UNKNOWN_CMD \n");
+ break;
+ default:
+ APP_DBG("** ERR_THREAD : ErroCode=%d \n",ErrorCode);
+ break;
+ }
+ return;
+}
+
+static void APPE_SysEvtReadyProcessing( void )
+{
+ /* Traces channel initialization */
+ TL_TRACES_Init( );
+
+ APP_THREAD_Init();
+ UTIL_LPM_SetOffMode(1U << CFG_LPM_APP, UTIL_LPM_ENABLE);
+ return;
+}
+
+/* USER CODE BEGIN FD_LOCAL_FUNCTIONS */
+static void Led_Init( void )
+{
+#if (CFG_LED_SUPPORTED == 1U)
+ /**
+ * Leds Initialization
+ */
+
+ BSP_LED_Init(LED_BLUE);
+ BSP_LED_Init(LED_GREEN);
+ BSP_LED_Init(LED_RED);
+
+#endif
+
+ return;
+}
+
+static void Button_Init( void )
+{
+#if (CFG_BUTTON_SUPPORTED == 1U)
+ /**
+ * Button Initialization
+ */
+
+ BSP_PB_Init(BUTTON_SW1, BUTTON_MODE_EXTI);
+ BSP_PB_Init(BUTTON_SW3, BUTTON_MODE_EXTI);
+#endif
+
+ return;
+}
+/* USER CODE END FD_LOCAL_FUNCTIONS */
+
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+
+void UTIL_SEQ_Idle( void )
+{
+#if ( CFG_LPM_SUPPORTED == 1)
+ UTIL_LPM_EnterLowPower( );
+#endif
+ return;
+}
+
+/**
+ * @brief This function is called by the scheduler each time an event
+ * is pending.
+ *
+ * @param evt_waited_bm : Event pending.
+ * @retval None
+ */
+void UTIL_SEQ_EvtIdle( UTIL_SEQ_bm_t task_id_bm, UTIL_SEQ_bm_t evt_waited_bm )
+{
+ switch(evt_waited_bm)
+ {
+ case EVENT_ACK_FROM_M0_EVT:
+ /* Does not allow other tasks when waiting for OT Cmd response */
+ UTIL_SEQ_Run(0);
+ break;
+ case EVENT_SYNCHRO_BYPASS_IDLE:
+ UTIL_SEQ_SetEvt(EVENT_SYNCHRO_BYPASS_IDLE);
+ /* Run only the task CFG_TASK_MSG_FROM_M0_TO_M4 */
+ UTIL_SEQ_Run(TASK_MSG_FROM_M0_TO_M4);
+ break;
+ default :
+ /* default case */
+ UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
+ break;
+ }
+}
+
+void shci_notify_asynch_evt(void* pdata)
+{
+ UNUSED(pdata);
+ UTIL_SEQ_SetTask(1U << CFG_TASK_SYSTEM_HCI_ASYNCH_EVT, CFG_SCH_PRIO_0);
+ return;
+}
+
+void shci_cmd_resp_release(uint32_t flag)
+{
+ UNUSED(flag);
+ UTIL_SEQ_SetEvt(1U << CFG_EVT_SYSTEM_HCI_CMD_EVT_RESP);
+ return;
+}
+
+void shci_cmd_resp_wait(uint32_t timeout)
+{
+ UNUSED(timeout);
+ UTIL_SEQ_WaitEvt(1U << CFG_EVT_SYSTEM_HCI_CMD_EVT_RESP);
+ return;
+}
+
+/* Received trace buffer from M0 */
+void TL_TRACES_EvtReceived( TL_EvtPacket_t * hcievt )
+{
+#if(CFG_DEBUG_TRACE != 0)
+ /* Call write/print function using DMA from dbg_trace */
+ /* - Cast to TL_AsynchEvt_t* to get "real" payload (without Sub Evt code 2bytes),
+ - (-2) to size to remove Sub Evt Code */
+// DbgTraceWrite(1U, (const unsigned char *) ((TL_AsynchEvt_t *)(hcievt->evtserial.evt.payload))->payload, hcievt->evtserial.evt.plen - 2U);
+#endif /* CFG_DEBUG_TRACE */
+ /* Release buffer */
+ TL_MM_EvtDone( hcievt );
+}
+/**
+ * @brief Initialisation of the trace mechanism
+ * @param None
+ * @retval None
+ */
+#if(CFG_DEBUG_TRACE != 0)
+void DbgOutputInit( void )
+{
+ MX_LPUART1_UART_Init();
+
+ return;
+}
+
+/**
+ * @brief Management of the traces
+ * @param p_data : data
+ * @param size : size
+ * @param call-back :
+ * @retval None
+ */
+void DbgOutputTraces( uint8_t *p_data, uint16_t size, void (*cb)(void) )
+{
+ HW_UART_Transmit_DMA(CFG_DEBUG_TRACE_UART, p_data, size, cb);
+
+ return;
+}
+#endif
+
+/* USER CODE BEGIN FD_WRAP_FUNCTIONS */
+/**
+ * @brief This function manage the Push button action
+ * @param GPIO_Pin : GPIO pin which has been activated
+ * @retval None
+ */
+void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
+{
+ APP_DBG("*** HAL_GPIO_EXTI_Callback GPIO_Pin = %d ****", GPIO_Pin);
+ switch(GPIO_Pin)
+ {
+ case BUTTON_SW1_PIN:
+ UTIL_SEQ_SetTask(TASK_BUTTON_SW1,CFG_SCH_PRIO_1);
+ break;
+ case BUTTON_SW3_PIN:
+ UTIL_SEQ_SetTask(TASK_BUTTON_SW3,CFG_SCH_PRIO_1);
+ break;
+ default:
+ break;
+ }
+}
+/* USER CODE END FD_WRAP_FUNCTIONS */
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/hw_timerserver.c
new file mode 100644
index 000000000..c842ba55e
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/hw_timerserver.c
@@ -0,0 +1,893 @@
+/**
+ ******************************************************************************
+ * File Name : hw_timerserver.c
+ * Description : Hardware timerserver source file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "hw_conf.h"
+
+/* Private typedef -----------------------------------------------------------*/
+typedef enum
+{
+ TimerID_Free,
+ TimerID_Created,
+ TimerID_Running
+}TimerIDStatus_t;
+
+typedef enum
+{
+ SSR_Read_Requested,
+ SSR_Read_Not_Requested
+}RequestReadSSR_t;
+
+typedef enum
+{
+ WakeupTimerValue_Overpassed,
+ WakeupTimerValue_LargeEnough
+}WakeupTimerLimitation_Status_t;
+
+typedef struct
+{
+ HW_TS_pTimerCb_t pTimerCallBack;
+ uint32_t CounterInit;
+ uint32_t CountLeft;
+ TimerIDStatus_t TimerIDStatus;
+ HW_TS_Mode_t TimerMode;
+ uint32_t TimerProcessID;
+ uint8_t PreviousID;
+ uint8_t NextID;
+}TimerContext_t;
+
+/* Private defines -----------------------------------------------------------*/
+#define SSR_FORBIDDEN_VALUE 0xFFFFFFFF
+#define TIMER_LIST_EMPTY 0xFFFF
+
+/* Private macros ------------------------------------------------------------*/
+/* Private variables ---------------------------------------------------------*/
+
+/**
+ * START of Section TIMERSERVER_CONTEXT
+ */
+
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile TimerContext_t aTimerContext[CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER];
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile uint8_t CurrentRunningTimerID;
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile uint8_t PreviousRunningTimerID;
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile uint32_t SSRValueOnLastSetup;
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile WakeupTimerLimitation_Status_t WakeupTimerLimitation;
+
+/**
+ * END of Section TIMERSERVER_CONTEXT
+ */
+
+static RTC_HandleTypeDef *phrtc; /**< RTC handle */
+static uint8_t WakeupTimerDivider;
+static uint8_t AsynchPrescalerUserConfig;
+static uint16_t SynchPrescalerUserConfig;
+static volatile uint16_t MaxWakeupTimerSetup;
+
+/* Global variables ----------------------------------------------------------*/
+/* Private function prototypes -----------------------------------------------*/
+static void RestartWakeupCounter(uint16_t Value);
+static uint16_t ReturnTimeElapsed(void);
+static void RescheduleTimerList(void);
+static void UnlinkTimer(uint8_t TimerID, RequestReadSSR_t RequestReadSSR);
+static void LinkTimerBefore(uint8_t TimerID, uint8_t RefTimerID);
+static void LinkTimerAfter(uint8_t TimerID, uint8_t RefTimerID);
+static uint16_t linkTimer(uint8_t TimerID);
+static uint32_t ReadRtcSsrValue(void);
+
+__weak void HW_TS_RTC_CountUpdated_AppNot(void);
+
+/* Functions Definition ------------------------------------------------------*/
+
+/**
+ * @brief Read the RTC_SSR value
+ * As described in the reference manual, the RTC_SSR shall be read twice to ensure
+ * reliability of the value
+ * @param None
+ * @retval SSR value read
+ */
+static uint32_t ReadRtcSsrValue(void)
+{
+ uint32_t first_read;
+ uint32_t second_read;
+
+ first_read = (uint32_t)(READ_BIT(RTC->SSR, RTC_SSR_SS));
+
+ second_read = (uint32_t)(READ_BIT(RTC->SSR, RTC_SSR_SS));
+
+ while(first_read != second_read)
+ {
+ first_read = second_read;
+
+ second_read = (uint32_t)(READ_BIT(RTC->SSR, RTC_SSR_SS));
+ }
+
+ return second_read;
+}
+
+/**
+ * @brief Insert a Timer in the list after the Timer ID specified
+ * @param TimerID: The ID of the Timer
+ * @param RefTimerID: The ID of the Timer to be linked after
+ * @retval None
+ */
+static void LinkTimerAfter(uint8_t TimerID, uint8_t RefTimerID)
+{
+ uint8_t next_id;
+
+ next_id = aTimerContext[RefTimerID].NextID;
+
+ if(next_id != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ aTimerContext[next_id].PreviousID = TimerID;
+ }
+ aTimerContext[TimerID].NextID = next_id;
+ aTimerContext[TimerID].PreviousID = RefTimerID ;
+ aTimerContext[RefTimerID].NextID = TimerID;
+
+ return;
+}
+
+/**
+ * @brief Insert a Timer in the list before the ID specified
+ * @param TimerID: The ID of the Timer
+ * @param RefTimerID: The ID of the Timer to be linked before
+ * @retval None
+ */
+static void LinkTimerBefore(uint8_t TimerID, uint8_t RefTimerID)
+{
+ uint8_t previous_id;
+
+ if(RefTimerID != CurrentRunningTimerID)
+ {
+ previous_id = aTimerContext[RefTimerID].PreviousID;
+
+ aTimerContext[previous_id].NextID = TimerID;
+ aTimerContext[TimerID].NextID = RefTimerID;
+ aTimerContext[TimerID].PreviousID = previous_id ;
+ aTimerContext[RefTimerID].PreviousID = TimerID;
+ }
+ else
+ {
+ aTimerContext[TimerID].NextID = RefTimerID;
+ aTimerContext[RefTimerID].PreviousID = TimerID;
+ }
+
+ return;
+}
+
+/**
+ * @brief Insert a Timer in the list
+ * @param TimerID: The ID of the Timer
+ * @retval None
+ */
+static uint16_t linkTimer(uint8_t TimerID)
+{
+ uint32_t time_left;
+ uint16_t time_elapsed;
+ uint8_t timer_id_lookup;
+ uint8_t next_id;
+
+ if(CurrentRunningTimerID == CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ /**
+ * No timer in the list
+ */
+ PreviousRunningTimerID = CurrentRunningTimerID;
+ CurrentRunningTimerID = TimerID;
+ aTimerContext[TimerID].NextID = CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER;
+
+ SSRValueOnLastSetup = SSR_FORBIDDEN_VALUE;
+ time_elapsed = 0;
+ }
+ else
+ {
+ time_elapsed = ReturnTimeElapsed();
+
+ /**
+ * update count of the timer to be linked
+ */
+ aTimerContext[TimerID].CountLeft += time_elapsed;
+ time_left = aTimerContext[TimerID].CountLeft;
+
+ /**
+ * Search for index where the new timer shall be linked
+ */
+ if(aTimerContext[CurrentRunningTimerID].CountLeft <= time_left)
+ {
+ /**
+ * Search for the ID after the first one
+ */
+ timer_id_lookup = CurrentRunningTimerID;
+ next_id = aTimerContext[timer_id_lookup].NextID;
+ while((next_id != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) && (aTimerContext[next_id].CountLeft <= time_left))
+ {
+ timer_id_lookup = aTimerContext[timer_id_lookup].NextID;
+ next_id = aTimerContext[timer_id_lookup].NextID;
+ }
+
+ /**
+ * Link after the ID
+ */
+ LinkTimerAfter(TimerID, timer_id_lookup);
+ }
+ else
+ {
+ /**
+ * Link before the first ID
+ */
+ LinkTimerBefore(TimerID, CurrentRunningTimerID);
+ PreviousRunningTimerID = CurrentRunningTimerID;
+ CurrentRunningTimerID = TimerID;
+ }
+ }
+
+ return time_elapsed;
+}
+
+/**
+ * @brief Remove a Timer from the list
+ * @param TimerID: The ID of the Timer
+ * @param RequestReadSSR: Request to read the SSR register or not
+ * @retval None
+ */
+static void UnlinkTimer(uint8_t TimerID, RequestReadSSR_t RequestReadSSR)
+{
+ uint8_t previous_id;
+ uint8_t next_id;
+
+ if(TimerID == CurrentRunningTimerID)
+ {
+ PreviousRunningTimerID = CurrentRunningTimerID;
+ CurrentRunningTimerID = aTimerContext[TimerID].NextID;
+ }
+ else
+ {
+ previous_id = aTimerContext[TimerID].PreviousID;
+ next_id = aTimerContext[TimerID].NextID;
+
+ aTimerContext[previous_id].NextID = aTimerContext[TimerID].NextID;
+ if(next_id != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ aTimerContext[next_id].PreviousID = aTimerContext[TimerID].PreviousID;
+ }
+ }
+
+ /**
+ * Timer is out of the list
+ */
+ aTimerContext[TimerID].TimerIDStatus = TimerID_Created;
+
+ if((CurrentRunningTimerID == CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) && (RequestReadSSR == SSR_Read_Requested))
+ {
+ SSRValueOnLastSetup = SSR_FORBIDDEN_VALUE;
+ }
+
+ return;
+}
+
+/**
+ * @brief Return the number of ticks counted by the wakeuptimer since it has been started
+ * @note The API is reading the SSR register to get how many ticks have been counted
+ * since the time the timer has been started
+ * @param None
+ * @retval Time expired in Ticks
+ */
+static uint16_t ReturnTimeElapsed(void)
+{
+ uint32_t return_value;
+ uint32_t wrap_counter;
+
+ if(SSRValueOnLastSetup != SSR_FORBIDDEN_VALUE)
+ {
+ return_value = ReadRtcSsrValue(); /**< Read SSR register first */
+
+ if (SSRValueOnLastSetup >= return_value)
+ {
+ return_value = SSRValueOnLastSetup - return_value;
+ }
+ else
+ {
+ wrap_counter = SynchPrescalerUserConfig - return_value;
+ return_value = SSRValueOnLastSetup + wrap_counter;
+ }
+
+ /**
+ * At this stage, ReturnValue holds the number of ticks counted by SSR
+ * Need to translate in number of ticks counted by the Wakeuptimer
+ */
+ return_value = return_value*AsynchPrescalerUserConfig;
+ return_value = return_value >> WakeupTimerDivider;
+ }
+ else
+ {
+ return_value = 0;
+ }
+
+ return (uint16_t)return_value;
+}
+
+/**
+ * @brief Set the wakeup counter
+ * @note The API is writing the counter value so that the value is decreased by one to cope with the fact
+ * the interrupt is generated with 1 extra clock cycle (See RefManuel)
+ * It assumes all condition are met to be allowed to write the wakeup counter
+ * @param Value: Value to be written in the counter
+ * @retval None
+ */
+static void RestartWakeupCounter(uint16_t Value)
+{
+ /**
+ * The wakeuptimer has been disabled in the calling function to reduce the time to poll the WUTWF
+ * FLAG when the new value will have to be written
+ * __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc);
+ */
+
+ if(Value == 0)
+ {
+ SSRValueOnLastSetup = ReadRtcSsrValue();
+
+ /**
+ * Simulate that the Timer expired
+ */
+ HAL_NVIC_SetPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID);
+ }
+ else
+ {
+ if((Value > 1) ||(WakeupTimerDivider != 1))
+ {
+ Value -= 1;
+ }
+
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == RESET);
+
+ /**
+ * make sure to clear the flags after checking the WUTWF.
+ * It takes 2 RTCCLK between the time the WUTE bit is disabled and the
+ * time the timer is disabled. The WUTWF bit somehow guarantee the system is stable
+ * Otherwise, when the timer is periodic with 1 Tick, it may generate an extra interrupt in between
+ * due to the autoreload feature
+ */
+ __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */
+ __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */
+ HAL_NVIC_ClearPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Clear pending bit in NVIC */
+
+ MODIFY_REG(RTC->WUTR, RTC_WUTR_WUT, Value);
+
+ /**
+ * Update the value here after the WUTWF polling that may take some time
+ */
+ SSRValueOnLastSetup = ReadRtcSsrValue();
+
+ __HAL_RTC_WAKEUPTIMER_ENABLE(phrtc); /**< Enable the Wakeup Timer */
+
+ HW_TS_RTC_CountUpdated_AppNot();
+ }
+
+ return ;
+}
+
+/**
+ * @brief Reschedule the list of timer
+ * @note 1) Update the count left for each timer in the list
+ * 2) Setup the wakeuptimer
+ * @param None
+ * @retval None
+ */
+static void RescheduleTimerList(void)
+{
+ uint8_t localTimerID;
+ uint32_t timecountleft;
+ uint16_t wakeup_timer_value;
+ uint16_t time_elapsed;
+
+ /**
+ * The wakeuptimer is disabled now to reduce the time to poll the WUTWF
+ * FLAG when the new value will have to be written
+ */
+ if((READ_BIT(RTC->CR, RTC_CR_WUTE) == (RTC_CR_WUTE)) == SET)
+ {
+ /**
+ * Wait for the flag to be back to 0 when the wakeup timer is enabled
+ */
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == SET);
+ }
+ __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc); /**< Disable the Wakeup Timer */
+
+ localTimerID = CurrentRunningTimerID;
+
+ /**
+ * Calculate what will be the value to write in the wakeuptimer
+ */
+ timecountleft = aTimerContext[localTimerID].CountLeft;
+
+ /**
+ * Read how much has been counted
+ */
+ time_elapsed = ReturnTimeElapsed();
+
+ if(timecountleft < time_elapsed )
+ {
+ /**
+ * There is no tick left to count
+ */
+ wakeup_timer_value = 0;
+ WakeupTimerLimitation = WakeupTimerValue_LargeEnough;
+ }
+ else
+ {
+ if(timecountleft > (time_elapsed + MaxWakeupTimerSetup))
+ {
+ /**
+ * The number of tick left is greater than the Wakeuptimer maximum value
+ */
+ wakeup_timer_value = MaxWakeupTimerSetup;
+
+ WakeupTimerLimitation = WakeupTimerValue_Overpassed;
+ }
+ else
+ {
+ wakeup_timer_value = timecountleft - time_elapsed;
+ WakeupTimerLimitation = WakeupTimerValue_LargeEnough;
+ }
+
+ }
+
+ /**
+ * update ticks left to be counted for each timer
+ */
+ while(localTimerID != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ if (aTimerContext[localTimerID].CountLeft < time_elapsed)
+ {
+ aTimerContext[localTimerID].CountLeft = 0;
+ }
+ else
+ {
+ aTimerContext[localTimerID].CountLeft -= time_elapsed;
+ }
+ localTimerID = aTimerContext[localTimerID].NextID;
+ }
+
+ /**
+ * Write next count
+ */
+ RestartWakeupCounter(wakeup_timer_value);
+
+ return ;
+}
+
+/* Public functions ----------------------------------------------------------*/
+
+/**
+ * For all public interface except that may need write access to the RTC, the RTC
+ * shall be unlock at the beginning and locked at the output
+ * In order to ease maintainability, the unlock is done at the top and the lock at then end
+ * in case some new implementation is coming in the future
+ */
+
+void HW_TS_RTC_Wakeup_Handler(void)
+{
+ HW_TS_pTimerCb_t ptimer_callback;
+ uint32_t timer_process_id;
+ uint8_t local_current_running_timer_id;
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ uint32_t primask_bit;
+#endif
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+#endif
+
+/* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+
+ /**
+ * Disable the Wakeup Timer
+ * This may speed up a bit the processing to wait the timer to be disabled
+ * The timer is still counting 2 RTCCLK
+ */
+ __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc);
+
+ local_current_running_timer_id = CurrentRunningTimerID;
+
+ if(aTimerContext[local_current_running_timer_id].TimerIDStatus == TimerID_Running)
+ {
+ ptimer_callback = aTimerContext[local_current_running_timer_id].pTimerCallBack;
+ timer_process_id = aTimerContext[local_current_running_timer_id].TimerProcessID;
+
+ /**
+ * It should be good to check whether the TimeElapsed is greater or not than the tick left to be counted
+ * However, due to the inaccuracy of the reading of the time elapsed, it may return there is 1 tick
+ * to be left whereas the count is over
+ * A more secure implementation has been done with a flag to state whereas the full count has been written
+ * in the wakeuptimer or not
+ */
+ if(WakeupTimerLimitation != WakeupTimerValue_Overpassed)
+ {
+ if(aTimerContext[local_current_running_timer_id].TimerMode == hw_ts_Repeated)
+ {
+ UnlinkTimer(local_current_running_timer_id, SSR_Read_Not_Requested);
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+ HW_TS_Start(local_current_running_timer_id, aTimerContext[local_current_running_timer_id].CounterInit);
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+ }
+ else
+ {
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+ HW_TS_Stop(local_current_running_timer_id);
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+ }
+
+ HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
+ }
+ else
+ {
+ RescheduleTimerList();
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+ }
+ }
+ else
+ {
+ /**
+ * We should never end up in this case
+ * However, if due to any bug in the timer server this is the case, the mistake may not impact the user.
+ * We could just clean the interrupt flag and get out from this unexpected interrupt
+ */
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == RESET);
+
+ /**
+ * make sure to clear the flags after checking the WUTWF.
+ * It takes 2 RTCCLK between the time the WUTE bit is disabled and the
+ * time the timer is disabled. The WUTWF bit somehow guarantee the system is stable
+ * Otherwise, when the timer is periodic with 1 Tick, it may generate an extra interrupt in between
+ * due to the autoreload feature
+ */
+ __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */
+ __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+ }
+
+ /* Enable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_ENABLE( phrtc );
+
+ return;
+}
+
+void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
+{
+ uint8_t loop;
+ uint32_t localmaxwakeuptimersetup;
+
+ /**
+ * Get RTC handler
+ */
+ phrtc = hrtc;
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+
+ SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
+
+ /**
+ * Readout the user config
+ */
+ WakeupTimerDivider = (4 - ((uint32_t)(READ_BIT(RTC->CR, RTC_CR_WUCKSEL))));
+
+ AsynchPrescalerUserConfig = (uint8_t)(READ_BIT(RTC->PRER, RTC_PRER_PREDIV_A) >> (uint32_t)POSITION_VAL(RTC_PRER_PREDIV_A)) + 1;
+
+ SynchPrescalerUserConfig = (uint16_t)(READ_BIT(RTC->PRER, RTC_PRER_PREDIV_S)) + 1;
+
+ /**
+ * Margin is taken to avoid wrong calculation when the wrap around is there and some
+ * application interrupts may have delayed the reading
+ */
+ localmaxwakeuptimersetup = ((((SynchPrescalerUserConfig - 1)*AsynchPrescalerUserConfig) - CFG_HW_TS_RTC_HANDLER_MAX_DELAY) >> WakeupTimerDivider);
+
+ if(localmaxwakeuptimersetup >= 0xFFFF)
+ {
+ MaxWakeupTimerSetup = 0xFFFF;
+ }
+ else
+ {
+ MaxWakeupTimerSetup = (uint16_t)localmaxwakeuptimersetup;
+ }
+
+ /**
+ * Configure EXTI module
+ */
+ LL_EXTI_EnableRisingTrig_0_31(RTC_EXTI_LINE_WAKEUPTIMER_EVENT);
+ LL_EXTI_EnableIT_0_31(RTC_EXTI_LINE_WAKEUPTIMER_EVENT);
+
+ if(TimerInitMode == hw_ts_InitMode_Full)
+ {
+ WakeupTimerLimitation = WakeupTimerValue_LargeEnough;
+ SSRValueOnLastSetup = SSR_FORBIDDEN_VALUE;
+
+ /**
+ * Initialize the timer server
+ */
+ for(loop = 0; loop < CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER; loop++)
+ {
+ aTimerContext[loop].TimerIDStatus = TimerID_Free;
+ }
+
+ CurrentRunningTimerID = CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER; /**< Set ID to non valid value */
+
+ __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc); /**< Disable the Wakeup Timer */
+ __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */
+ __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */
+ HAL_NVIC_ClearPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Clear pending bit in NVIC */
+ __HAL_RTC_WAKEUPTIMER_ENABLE_IT(phrtc, RTC_IT_WUT); /**< Enable interrupt in RTC module */
+ }
+ else
+ {
+ if(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTF) != RESET)
+ {
+ /**
+ * Simulate that the Timer expired
+ */
+ HAL_NVIC_SetPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID);
+ }
+ }
+
+ /* Enable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_ENABLE( phrtc );
+
+ HAL_NVIC_SetPriority(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID, CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO, CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO); /**< Set NVIC priority */
+ HAL_NVIC_EnableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Enable NVIC */
+
+ return;
+}
+
+HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pftimeout_handler)
+{
+ HW_TS_ReturnStatus_t localreturnstatus;
+ uint8_t loop = 0;
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ uint32_t primask_bit;
+#endif
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+#endif
+
+ while((loop < CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) && (aTimerContext[loop].TimerIDStatus != TimerID_Free))
+ {
+ loop++;
+ }
+
+ if(loop != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ aTimerContext[loop].TimerIDStatus = TimerID_Created;
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+
+ aTimerContext[loop].TimerProcessID = TimerProcessID;
+ aTimerContext[loop].TimerMode = TimerMode;
+ aTimerContext[loop].pTimerCallBack = pftimeout_handler;
+ *pTimerId = loop;
+
+ localreturnstatus = hw_ts_Successful;
+ }
+ else
+ {
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+
+ localreturnstatus = hw_ts_Failed;
+ }
+
+ return(localreturnstatus);
+}
+
+void HW_TS_Delete(uint8_t timer_id)
+{
+ HW_TS_Stop(timer_id);
+
+ aTimerContext[timer_id].TimerIDStatus = TimerID_Free; /**< release ID */
+
+ return;
+}
+
+void HW_TS_Stop(uint8_t timer_id)
+{
+ uint8_t localcurrentrunningtimerid;
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ uint32_t primask_bit;
+#endif
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+#endif
+
+ HAL_NVIC_DisableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Disable NVIC */
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+
+ if(aTimerContext[timer_id].TimerIDStatus == TimerID_Running)
+ {
+ UnlinkTimer(timer_id, SSR_Read_Requested);
+ localcurrentrunningtimerid = CurrentRunningTimerID;
+
+ if(localcurrentrunningtimerid == CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ /**
+ * List is empty
+ */
+
+ /**
+ * Disable the timer
+ */
+ if((READ_BIT(RTC->CR, RTC_CR_WUTE) == (RTC_CR_WUTE)) == SET)
+ {
+ /**
+ * Wait for the flag to be back to 0 when the wakeup timer is enabled
+ */
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == SET);
+ }
+ __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc); /**< Disable the Wakeup Timer */
+
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == RESET);
+
+ /**
+ * make sure to clear the flags after checking the WUTWF.
+ * It takes 2 RTCCLK between the time the WUTE bit is disabled and the
+ * time the timer is disabled. The WUTWF bit somehow guarantee the system is stable
+ * Otherwise, when the timer is periodic with 1 Tick, it may generate an extra interrupt in between
+ * due to the autoreload feature
+ */
+ __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */
+ __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */
+ HAL_NVIC_ClearPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Clear pending bit in NVIC */
+ }
+ else if(PreviousRunningTimerID != localcurrentrunningtimerid)
+ {
+ RescheduleTimerList();
+ }
+ }
+
+ /* Enable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_ENABLE( phrtc );
+
+ HAL_NVIC_EnableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Enable NVIC */
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+
+ return;
+}
+
+void HW_TS_Start(uint8_t timer_id, uint32_t timeout_ticks)
+{
+ uint16_t time_elapsed;
+ uint8_t localcurrentrunningtimerid;
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ uint32_t primask_bit;
+#endif
+
+ if(aTimerContext[timer_id].TimerIDStatus == TimerID_Running)
+ {
+ HW_TS_Stop( timer_id );
+ }
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+#endif
+
+ HAL_NVIC_DisableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Disable NVIC */
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+
+ aTimerContext[timer_id].TimerIDStatus = TimerID_Running;
+
+ aTimerContext[timer_id].CountLeft = timeout_ticks;
+ aTimerContext[timer_id].CounterInit = timeout_ticks;
+
+ time_elapsed = linkTimer(timer_id);
+
+ localcurrentrunningtimerid = CurrentRunningTimerID;
+
+ if(PreviousRunningTimerID != localcurrentrunningtimerid)
+ {
+ RescheduleTimerList();
+ }
+ else
+ {
+ aTimerContext[timer_id].CountLeft -= time_elapsed;
+ }
+
+ /* Enable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_ENABLE( phrtc );
+
+ HAL_NVIC_EnableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Enable NVIC */
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+
+ return;
+}
+
+uint16_t HW_TS_RTC_ReadLeftTicksToCount(void)
+{
+ uint32_t primask_bit;
+ uint16_t return_value, auro_reload_value, elapsed_time_value;
+
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+
+ if((READ_BIT(RTC->CR, RTC_CR_WUTE) == (RTC_CR_WUTE)) == SET)
+ {
+ auro_reload_value = (uint32_t)(READ_BIT(RTC->WUTR, RTC_WUTR_WUT));
+
+ elapsed_time_value = ReturnTimeElapsed();
+
+ if(auro_reload_value > elapsed_time_value)
+ {
+ return_value = auro_reload_value - elapsed_time_value;
+ }
+ else
+ {
+ return_value = 0;
+ }
+ }
+ else
+ {
+ return_value = TIMER_LIST_EMPTY;
+ }
+
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+
+ return (return_value);
+}
+
+__weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack)
+{
+ pTimerCallBack();
+
+ return;
+}
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/hw_uart.c
new file mode 100644
index 000000000..9a553610d
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/hw_uart.c
@@ -0,0 +1,318 @@
+/**
+ ******************************************************************************
+ * File Name : Src/hw_uart.c
+ * Description : HW UART source file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "hw_conf.h"
+#if (CFG_HW_LPUART1_ENABLED == 1)
+extern UART_HandleTypeDef hlpuart1;
+#endif
+#if (CFG_HW_USART1_ENABLED == 1)
+extern UART_HandleTypeDef huart1;
+#endif
+
+/* Macros --------------------------------------------------------------------*/
+#define HW_UART_RX_IT(__HANDLE__, __USART_BASE__) \
+ do{ \
+ HW_##__HANDLE__##RxCb = cb; \
+ (__HANDLE__).Instance = (__USART_BASE__); \
+ HAL_UART_Receive_IT(&(__HANDLE__), p_data, size); \
+ } while(0)
+
+#define HW_UART_TX_IT(__HANDLE__, __USART_BASE__) \
+ do{ \
+ HW_##__HANDLE__##TxCb = cb; \
+ (__HANDLE__).Instance = (__USART_BASE__); \
+ HAL_UART_Transmit_IT(&(__HANDLE__), p_data, size); \
+ } while(0)
+
+#define HW_UART_TX(__HANDLE__, __USART_BASE__) \
+ do{ \
+ (__HANDLE__).Instance = (__USART_BASE__); \
+ hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
+ } while(0)
+
+/* Variables -----------------------------------------------------------------*/
+#if (CFG_HW_USART1_ENABLED == 1)
+#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
+ DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
+#endif
+ void (*HW_huart1RxCb)(void);
+ void (*HW_huart1TxCb)(void);
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
+ DMA_HandleTypeDef HW_hdma_hlpuart1_tx ={0};
+#endif
+ void (*HW_hlpuart1RxCb)(void);
+ void (*HW_hlpuart1TxCb)(void);
+#endif
+
+void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HW_UART_RX_IT(huart1, USART1);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HW_UART_RX_IT(hlpuart1, LPUART1);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HW_UART_TX_IT(huart1, USART1);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HW_UART_TX_IT(hlpuart1, LPUART1);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
+{
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
+
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HW_UART_TX(huart1, USART1);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HW_UART_TX(hlpuart1, LPUART1);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ switch (hal_status)
+ {
+ case HAL_OK:
+ hw_status = hw_uart_ok;
+ break;
+
+ case HAL_ERROR:
+ hw_status = hw_uart_error;
+ break;
+
+ case HAL_BUSY:
+ hw_status = hw_uart_busy;
+ break;
+
+ case HAL_TIMEOUT:
+ hw_status = hw_uart_to;
+ break;
+
+ default:
+ break;
+ }
+
+ return hw_status;
+}
+
+hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
+
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HW_huart1TxCb = cb;
+ huart1.Instance = USART1;
+ hal_status = HAL_UART_Transmit_DMA(&huart1, p_data, size);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HW_hlpuart1TxCb = cb;
+ hlpuart1.Instance = LPUART1;
+ hal_status = HAL_UART_Transmit_DMA(&hlpuart1, p_data, size);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ switch (hal_status)
+ {
+ case HAL_OK:
+ hw_status = hw_uart_ok;
+ break;
+
+ case HAL_ERROR:
+ hw_status = hw_uart_error;
+ break;
+
+ case HAL_BUSY:
+ hw_status = hw_uart_busy;
+ break;
+
+ case HAL_TIMEOUT:
+ hw_status = hw_uart_to;
+ break;
+
+ default:
+ break;
+ }
+
+ return hw_status;
+}
+
+void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id)
+{
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HAL_UART_IRQHandler(&huart1);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HAL_UART_IRQHandler(&hlpuart1);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
+{
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
+ case hw_uart1:
+ HAL_DMA_IRQHandler(huart1.hdmatx);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
+ case hw_lpuart1:
+ HAL_DMA_IRQHandler(hlpuart1.hdmatx);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
+{
+ switch ((uint32_t)huart->Instance)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case (uint32_t)USART1:
+ if(HW_huart1RxCb)
+ {
+ HW_huart1RxCb();
+ }
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case (uint32_t)LPUART1:
+ if(HW_hlpuart1RxCb)
+ {
+ HW_hlpuart1RxCb();
+ }
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
+{
+ switch ((uint32_t)huart->Instance)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case (uint32_t)USART1:
+ if(HW_huart1TxCb)
+ {
+ HW_huart1TxCb();
+ }
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case (uint32_t)LPUART1:
+ if(HW_hlpuart1TxCb)
+ {
+ HW_hlpuart1TxCb();
+ }
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/main.c
new file mode 100644
index 000000000..00e011ffa
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/main.c
@@ -0,0 +1,618 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file : main.c
+ * @brief : Main program body
+ *
+ @verbatim
+ ==============================================================================
+ ##### IMPORTANT NOTE #####
+ ==============================================================================
+
+ This application requests having the stm32wb5x_Thread_FTD_fw.bin binary
+ flashed on the Wireless Coprocessor.
+ If it is not the case, you need to use STM32CubeProgrammer to load the appropriate
+ binary.
+
+ All available binaries are located under following directory:
+ /Projects/STM32_Copro_Wireless_Binaries
+
+ Refer to UM2237 to learn how to use/install STM32CubeProgrammer.
+ Refer to /Projects/STM32_Copro_Wireless_Binaries/ReleaseNote.html for the
+ detailed procedure to change the Wireless Coprocessor binary.
+
+ @endverbatim
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+#include "app_entry.h"
+#include "app_common.h"
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+#include "stm32_lpm.h"
+#include "stm32_seq.h"
+#include "dbg_trace.h"
+#include "hw_conf.h"
+#include "otp.h"
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN PTD */
+
+/* USER CODE END PTD */
+
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN PD */
+
+/* USER CODE END PD */
+
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private variables ---------------------------------------------------------*/
+UART_HandleTypeDef hlpuart1;
+UART_HandleTypeDef huart1;
+DMA_HandleTypeDef hdma_lpuart1_tx;
+DMA_HandleTypeDef hdma_usart1_tx;
+
+RTC_HandleTypeDef hrtc;
+
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+void SystemClock_Config(void);
+static void MX_GPIO_Init(void);
+static void MX_DMA_Init(void);
+void MX_LPUART1_UART_Init(void);
+void MX_USART1_UART_Init(void);
+static void MX_RF_Init(void);
+static void MX_RTC_Init(void);
+/* USER CODE BEGIN PFP */
+void PeriphClock_Config(void);
+static void Reset_Device( void );
+static void Reset_IPCC( void );
+static void Reset_BackupDomain( void );
+static void Init_Exti( void );
+static void Config_HSE(void);
+/* USER CODE END PFP */
+
+/* Private user code ---------------------------------------------------------*/
+/* USER CODE BEGIN 0 */
+
+/* USER CODE END 0 */
+
+/**
+ * @brief The application entry point.
+ * @retval int
+ */
+int main(void)
+{
+ /* USER CODE BEGIN 1 */
+
+ /* USER CODE END 1 */
+
+
+ /* MCU Configuration--------------------------------------------------------*/
+
+ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
+ HAL_Init();
+
+ /* USER CODE BEGIN Init */
+ Reset_Device();
+ Config_HSE();
+ /* USER CODE END Init */
+
+ /* Configure the system clock */
+ SystemClock_Config();
+
+ /* USER CODE BEGIN SysInit */
+ PeriphClock_Config();
+ Init_Exti(); /**< Configure the system Power Mode */
+ /* USER CODE END SysInit */
+
+ /* Initialize all configured peripherals */
+ MX_GPIO_Init();
+ MX_DMA_Init();
+ MX_RF_Init();
+ MX_RTC_Init();
+ /* USER CODE BEGIN 2 */
+
+ /* USER CODE END 2 */
+
+ /* Init code for STM32_WPAN */
+ APPE_Init();
+
+ /* Infinite loop */
+ /* USER CODE BEGIN WHILE */
+ while (1)
+ {
+ UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
+ /* USER CODE END WHILE */
+
+ /* USER CODE BEGIN 3 */
+ }
+ /* USER CODE END 3 */
+}
+
+/**
+ * @brief System Clock Configuration
+ * @retval None
+ */
+void SystemClock_Config(void)
+{
+ RCC_OscInitTypeDef RCC_OscInitStruct = {0};
+ RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
+ RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
+
+ /** Configure LSE Drive Capability
+ */
+ __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
+ /** Configure the main internal regulator output voltage
+ */
+ __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
+ /** Initializes the CPU, AHB and APB busses clocks
+ */
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE
+ |RCC_OSCILLATORTYPE_LSE;
+ RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ RCC_OscInitStruct.LSEState = RCC_LSE_ON;
+ RCC_OscInitStruct.HSIState = RCC_HSI_ON;
+ RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
+ RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
+ if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /** Configure the SYSCLKSource, HCLK, PCLK1 and PCLK2 clocks dividers
+ */
+ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK4|RCC_CLOCKTYPE_HCLK2
+ |RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
+ |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
+ RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSE;
+ RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
+ RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
+ RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
+ RCC_ClkInitStruct.AHBCLK2Divider = RCC_SYSCLK_DIV1;
+ RCC_ClkInitStruct.AHBCLK4Divider = RCC_SYSCLK_DIV1;
+
+ if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /** Initializes the peripherals clocks
+ */
+ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_SMPS|RCC_PERIPHCLK_RFWAKEUP
+ |RCC_PERIPHCLK_RTC|RCC_PERIPHCLK_USART1
+ |RCC_PERIPHCLK_LPUART1;
+ PeriphClkInitStruct.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2;
+ PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1;
+ PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
+ PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSE;
+ PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSE;
+ PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE0;
+
+ if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
+ {
+ Error_Handler();
+ }
+}
+
+/**
+ * @brief LPUART1 Initialization Function
+ * @param None
+ * @retval None
+ */
+void MX_LPUART1_UART_Init(void)
+{
+
+ /* USER CODE BEGIN LPUART1_Init 0 */
+
+ /* USER CODE END LPUART1_Init 0 */
+
+ /* USER CODE BEGIN LPUART1_Init 1 */
+
+ /* USER CODE END LPUART1_Init 1 */
+ hlpuart1.Instance = LPUART1;
+ hlpuart1.Init.BaudRate = 115200;
+ hlpuart1.Init.WordLength = UART_WORDLENGTH_8B;
+ hlpuart1.Init.StopBits = UART_STOPBITS_1;
+ hlpuart1.Init.Parity = UART_PARITY_NONE;
+ hlpuart1.Init.Mode = UART_MODE_TX_RX;
+ hlpuart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
+ hlpuart1.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
+ hlpuart1.Init.ClockPrescaler = UART_PRESCALER_DIV1;
+ hlpuart1.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
+ hlpuart1.FifoMode = UART_FIFOMODE_DISABLE;
+ if (HAL_UART_Init(&hlpuart1) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_SetTxFifoThreshold(&hlpuart1, UART_TXFIFO_THRESHOLD_1_8) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_SetRxFifoThreshold(&hlpuart1, UART_RXFIFO_THRESHOLD_1_8) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_DisableFifoMode(&hlpuart1) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /* USER CODE BEGIN LPUART1_Init 2 */
+
+ /* USER CODE END LPUART1_Init 2 */
+
+}
+
+/**
+ * @brief USART1 Initialization Function
+ * @param None
+ * @retval None
+ */
+void MX_USART1_UART_Init(void)
+{
+
+ /* USER CODE BEGIN USART1_Init 0 */
+
+ /* USER CODE END USART1_Init 0 */
+
+ /* USER CODE BEGIN USART1_Init 1 */
+
+ /* USER CODE END USART1_Init 1 */
+ huart1.Instance = USART1;
+ huart1.Init.BaudRate = 115200;
+ huart1.Init.WordLength = UART_WORDLENGTH_8B;
+ huart1.Init.StopBits = UART_STOPBITS_1;
+ huart1.Init.Parity = UART_PARITY_NONE;
+ huart1.Init.Mode = UART_MODE_TX_RX;
+ huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
+ huart1.Init.OverSampling = UART_OVERSAMPLING_8;
+ huart1.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
+ huart1.Init.ClockPrescaler = UART_PRESCALER_DIV1;
+ huart1.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
+ if (HAL_UART_Init(&huart1) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_SetTxFifoThreshold(&huart1, UART_TXFIFO_THRESHOLD_1_8) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_SetRxFifoThreshold(&huart1, UART_RXFIFO_THRESHOLD_1_8) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_DisableFifoMode(&huart1) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /* USER CODE BEGIN USART1_Init 2 */
+
+ /* USER CODE END USART1_Init 2 */
+
+}
+
+/**
+ * @brief RF Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_RF_Init(void)
+{
+
+ /* USER CODE BEGIN RF_Init 0 */
+
+ /* USER CODE END RF_Init 0 */
+
+ /* USER CODE BEGIN RF_Init 1 */
+
+ /* USER CODE END RF_Init 1 */
+ /* USER CODE BEGIN RF_Init 2 */
+
+ /* USER CODE END RF_Init 2 */
+
+}
+
+/**
+ * @brief RTC Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_RTC_Init(void)
+{
+
+ /* USER CODE BEGIN RTC_Init 0 */
+
+ /* USER CODE END RTC_Init 0 */
+
+ /* USER CODE BEGIN RTC_Init 1 */
+
+ /* USER CODE END RTC_Init 1 */
+ /** Initialize RTC Only
+ */
+ hrtc.Instance = RTC;
+ hrtc.Init.HourFormat = RTC_HOURFORMAT_24;
+ hrtc.Init.AsynchPrediv = CFG_RTC_ASYNCH_PRESCALER;
+ hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
+ hrtc.Init.OutPut = RTC_OUTPUT_DISABLE;
+ hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH;
+ hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;
+ if (HAL_RTC_Init(&hrtc) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /* USER CODE BEGIN RTC_Init 2 */
+
+ /* USER CODE END RTC_Init 2 */
+
+}
+
+/**
+ * Enable DMA controller clock
+ */
+static void MX_DMA_Init(void)
+{
+
+ /* DMA controller clock enable */
+ __HAL_RCC_DMAMUX1_CLK_ENABLE();
+ __HAL_RCC_DMA1_CLK_ENABLE();
+
+ /* DMA interrupt init */
+ /* DMA1_Channel1_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(DMA1_Channel1_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(DMA1_Channel1_IRQn);
+ /* DMA1_Channel2_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(DMA1_Channel2_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(DMA1_Channel2_IRQn);
+
+}
+
+/**
+ * @brief GPIO Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_GPIO_Init(void)
+{
+
+ /* GPIO Ports Clock Enable */
+ __HAL_RCC_GPIOC_CLK_ENABLE();
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+
+}
+
+/* USER CODE BEGIN 4 */
+void PeriphClock_Config(void)
+{
+ #if (CFG_USB_INTERFACE_ENABLE != 0)
+ RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
+ RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
+ LL_RCC_HSI48_Enable();
+
+ while(!LL_RCC_HSI48_IsReady());
+
+ /* Select HSI48 as USB clock source */
+ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB;
+ PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_HSI48;
+ HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
+
+ /*Configure the clock recovery system (CRS)**********************************/
+
+ /* Enable CRS Clock */
+ __HAL_RCC_CRS_CLK_ENABLE();
+
+ /* Default Synchro Signal division factor (not divided) */
+ RCC_CRSInitStruct.Prescaler = RCC_CRS_SYNC_DIV1;
+
+ /* Set the SYNCSRC[1:0] bits according to CRS_Source value */
+ RCC_CRSInitStruct.Source = RCC_CRS_SYNC_SOURCE_USB;
+
+ /* HSI48 is synchronized with USB SOF at 1KHz rate */
+ RCC_CRSInitStruct.ReloadValue = RCC_CRS_RELOADVALUE_DEFAULT;
+ RCC_CRSInitStruct.ErrorLimitValue = RCC_CRS_ERRORLIMIT_DEFAULT;
+
+ RCC_CRSInitStruct.Polarity = RCC_CRS_SYNC_POLARITY_RISING;
+
+ /* Set the TRIM[5:0] to the default value*/
+ RCC_CRSInitStruct.HSI48CalibrationValue = RCC_CRS_HSI48CALIBRATION_DEFAULT;
+
+ /* Start automatic synchronization */
+ HAL_RCCEx_CRSConfig(&RCC_CRSInitStruct);
+#endif
+
+ return;
+}
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+
+static void Config_HSE(void)
+{
+ OTP_ID0_t * p_otp;
+
+ /**
+ * Read HSE_Tuning from OTP
+ */
+ p_otp = (OTP_ID0_t *) OTP_Read(0);
+ if (p_otp)
+ {
+ LL_RCC_HSE_SetCapacitorTuning(p_otp->hse_tuning);
+ }
+
+ return;
+}
+
+
+static void Reset_Device( void )
+{
+#if ( CFG_HW_RESET_BY_FW == 1 )
+ Reset_BackupDomain();
+
+ Reset_IPCC();
+#endif
+
+ return;
+}
+
+static void Reset_IPCC( void )
+{
+ LL_AHB3_GRP1_EnableClock(LL_AHB3_GRP1_PERIPH_IPCC);
+
+ LL_C1_IPCC_ClearFlag_CHx(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C2_IPCC_ClearFlag_CHx(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C1_IPCC_DisableTransmitChannel(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C2_IPCC_DisableTransmitChannel(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C1_IPCC_DisableReceiveChannel(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C2_IPCC_DisableReceiveChannel(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ return;
+}
+
+static void Reset_BackupDomain( void )
+{
+ if ((LL_RCC_IsActiveFlag_PINRST() != FALSE) && (LL_RCC_IsActiveFlag_SFTRST() == FALSE))
+ {
+ HAL_PWR_EnableBkUpAccess(); /**< Enable access to the RTC registers */
+
+ /**
+ * Write twice the value to flush the APB-AHB bridge
+ * This bit shall be written in the register before writing the next one
+ */
+ HAL_PWR_EnableBkUpAccess();
+
+ __HAL_RCC_BACKUPRESET_FORCE();
+ __HAL_RCC_BACKUPRESET_RELEASE();
+ }
+
+ return;
+}
+
+
+static void Init_Exti( void )
+{
+ /**< Disable all wakeup interrupt on CPU1 except IPCC(36), HSEM(38) */
+ LL_EXTI_DisableIT_0_31(~0);
+ LL_EXTI_DisableIT_32_63( (~0) & (~(LL_EXTI_LINE_36 | LL_EXTI_LINE_38)) );
+
+ return;
+}
+
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+void HAL_Delay(uint32_t Delay)
+{
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
+
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
+}
+/* USER CODE END 4 */
+
+/**
+ * @brief This function is executed in case of error occurrence.
+ * @retval None
+ */
+void Error_Handler(void)
+{
+ /* USER CODE BEGIN Error_Handler_Debug */
+ /* User can add his own implementation to report the HAL error return state */
+
+ /* USER CODE END Error_Handler_Debug */
+}
+
+#ifdef USE_FULL_ASSERT
+/**
+ * @brief Reports the name of the source file and the source line number
+ * where the assert_param error has occurred.
+ * @param file: pointer to the source file name
+ * @param line: assert_param error line source number
+ * @retval None
+ */
+void assert_failed(uint8_t *file, uint32_t line)
+{
+ /* USER CODE BEGIN 6 */
+ /* User can add his own implementation to report the file name and line number,
+ tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
+ /* USER CODE END 6 */
+}
+#endif /* USE_FULL_ASSERT */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/stm32_lpm_if.c
new file mode 100644
index 000000000..f024b61e3
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/stm32_lpm_if.c
@@ -0,0 +1,275 @@
+/* USER CODE BEGIN Header */
+/**
+ ***************************************************************************************
+ * File Name : stm32_lpm_if.c
+ * Description : Low layer function to enter/exit low power modes (stop, sleep).
+ ***************************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "stm32_lpm_if.h"
+#include "stm32_lpm.h"
+#include "app_conf.h"
+/* USER CODE BEGIN include */
+
+/* USER CODE END include */
+
+/* Exported variables --------------------------------------------------------*/
+const struct UTIL_LPM_Driver_s UTIL_PowerDriver =
+{
+ PWR_EnterSleepMode,
+ PWR_ExitSleepMode,
+
+ PWR_EnterStopMode,
+ PWR_ExitStopMode,
+
+ PWR_EnterOffMode,
+ PWR_ExitOffMode,
+};
+
+/* Private function prototypes -----------------------------------------------*/
+static void Switch_On_HSI( void );
+/* USER CODE BEGIN Private_Function_Prototypes */
+
+/* USER CODE END Private_Function_Prototypes */
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN Private_Typedef */
+
+/* USER CODE END Private_Typedef */
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN Private_Define */
+
+/* USER CODE END Private_Define */
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN Private_Macro */
+
+/* USER CODE END Private_Macro */
+/* Private variables ---------------------------------------------------------*/
+/* USER CODE BEGIN Private_Variables */
+
+/* USER CODE END Private_Variables */
+
+/* Functions Definition ------------------------------------------------------*/
+/**
+ * @brief Enters Low Power Off Mode
+ * @param none
+ * @retval none
+ */
+void PWR_EnterOffMode( void )
+{
+/* USER CODE BEGIN PWR_EnterOffMode */
+ /************************************************************************************
+ * ENTER OFF MODE
+ ***********************************************************************************/
+ /*
+ * There is no risk to clear all the WUF here because in the current implementation, this API is called
+ * in critical section. If an interrupt occurs while in that critical section before that point,
+ * the flag is set and will be cleared here but the system will not enter Off Mode
+ * because an interrupt is pending in the NVIC. The ISR will be executed when moving out
+ * of this critical section
+ */
+ LL_PWR_ClearFlag_WU( );
+
+ LL_PWR_SetPowerMode( LL_PWR_MODE_STANDBY );
+
+ LL_LPM_EnableDeepSleep( ); /**< Set SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+#if defined ( __CC_ARM)
+ __force_stores( );
+#endif
+
+ __WFI( );
+/* USER CODE END PWR_EnterOffMode */
+}
+
+/**
+ * @brief Exits Low Power Off Mode
+ * @param none
+ * @retval none
+ */
+void PWR_ExitOffMode( void )
+{
+/* USER CODE BEGIN PWR_ExitOffMode */
+
+/* USER CODE END PWR_ExitOffMode */
+}
+
+/**
+ * @brief Enters Low Power Stop Mode
+ * @note ARM exists the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_EnterStopMode( void )
+{
+/* USER CODE BEGIN PWR_EnterStopMode */
+ /**
+ * This function is called from CRITICAL SECTION
+ */
+ while( LL_HSEM_1StepLock( HSEM, CFG_HW_RCC_SEMID ) );
+
+ if ( ! LL_HSEM_1StepLock( HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID ) )
+ {
+ if( LL_PWR_IsActiveFlag_C2DS( ) )
+ {
+ /* Release ENTRY_STOP_MODE semaphore */
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID, 0 );
+
+ /**
+ * The switch on HSI before entering Stop Mode is required on Cut2.0
+ * It is useless from Cut2.1
+ */
+ Switch_On_HSI( );
+ }
+ }
+ else
+ {
+ /**
+ * The switch on HSI before entering Stop Mode is required on Cut2.0
+ * It is useless from Cut2.1
+ */
+ Switch_On_HSI( );
+ }
+
+ /* Release RCC semaphore */
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_RCC_SEMID, 0 );
+
+ /************************************************************************************
+ * ENTER STOP MODE
+ ***********************************************************************************/
+ LL_PWR_SetPowerMode( LL_PWR_MODE_STOP2 );
+
+ LL_LPM_EnableDeepSleep( ); /**< Set SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+#if defined ( __CC_ARM)
+ __force_stores( );
+#endif
+
+ __WFI();
+/* USER CODE END PWR_EnterStopMode */
+}
+
+/**
+ * @brief Exits Low Power Stop Mode
+ * @note Enable the pll at 32MHz
+ * @param none
+ * @retval none
+ */
+void PWR_ExitStopMode( void )
+{
+/* USER CODE BEGIN PWR_ExitStopMode */
+ /**
+ * This function is called from CRITICAL SECTION
+ */
+
+ /* Release ENTRY_STOP_MODE semaphore */
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID, 0 );
+
+ while( LL_HSEM_1StepLock( HSEM, CFG_HW_RCC_SEMID ) );
+
+ if(LL_RCC_GetSysClkSource( ) == LL_RCC_SYS_CLKSOURCE_STATUS_HSI)
+ {
+ LL_RCC_HSE_Enable( );
+ while(!LL_RCC_HSE_IsReady( ));
+ LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_HSE);
+ while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSE);
+ }
+ else
+ {
+ /**
+ * As long as the current application is fine with HSE as system clock source,
+ * there is nothing to do here
+ */
+ }
+
+ /* Release RCC semaphore */
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_RCC_SEMID, 0 );
+/* USER CODE END PWR_ExitStopMode */
+}
+
+/**
+ * @brief Enters Low Power Sleep Mode
+ * @note ARM exits the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_EnterSleepMode( void )
+{
+/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+#if defined ( __CC_ARM)
+ __force_stores();
+#endif
+
+ __WFI( );
+/* USER CODE END PWR_EnterSleepMode */
+}
+
+/**
+ * @brief Exits Low Power Sleep Mode
+ * @note ARM exits the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_ExitSleepMode( void )
+{
+/* USER CODE BEGIN PWR_ExitSleepMode */
+
+ HAL_ResumeTick();
+
+/* USER CODE END PWR_ExitSleepMode */
+}
+
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+/**
+ * @brief Switch the system clock on HSI
+ * @param none
+ * @retval none
+ */
+static void Switch_On_HSI( void )
+{
+ LL_RCC_HSI_Enable( );
+ while(!LL_RCC_HSI_IsReady( ));
+ LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
+ while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
+}
+
+/* USER CODE BEGIN Private_Functions */
+
+/* USER CODE END Private_Functions */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/stm32wbxx_hal_msp.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/stm32wbxx_hal_msp.c
new file mode 100644
index 000000000..9c338486d
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/stm32wbxx_hal_msp.c
@@ -0,0 +1,334 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : stm32wbxx_hal_msp.c
+ * Description : This file provides code for the MSP Initialization
+ * and de-Initialization codes.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+/* USER CODE BEGIN Includes */
+#include "app_conf.h"
+/* USER CODE END Includes */
+extern DMA_HandleTypeDef hdma_lpuart1_tx;
+
+extern DMA_HandleTypeDef hdma_usart1_tx;
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN TD */
+
+/* USER CODE END TD */
+
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN Define */
+
+/* USER CODE END Define */
+
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN Macro */
+
+/* USER CODE END Macro */
+
+/* Private variables ---------------------------------------------------------*/
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+/* USER CODE BEGIN PFP */
+
+/* USER CODE END PFP */
+
+/* External functions --------------------------------------------------------*/
+/* USER CODE BEGIN ExternalFunctions */
+
+/* USER CODE END ExternalFunctions */
+
+/* USER CODE BEGIN 0 */
+
+/* USER CODE END 0 */
+/**
+ * Initializes the Global MSP.
+ */
+void HAL_MspInit(void)
+{
+ /* USER CODE BEGIN MspInit 0 */
+
+ /* USER CODE END MspInit 0 */
+
+ __HAL_RCC_HSEM_CLK_ENABLE();
+
+ /* System interrupt init*/
+
+ /* Peripheral interrupt init */
+ /* PVD_PVM_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(PVD_PVM_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(PVD_PVM_IRQn);
+ /* FLASH_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(FLASH_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(FLASH_IRQn);
+ /* RCC_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(RCC_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(RCC_IRQn);
+ /* C2SEV_PWR_C2H_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(C2SEV_PWR_C2H_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(C2SEV_PWR_C2H_IRQn);
+ /* PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn);
+ /* HSEM_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(HSEM_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(HSEM_IRQn);
+ /* FPU_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(FPU_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(FPU_IRQn);
+
+ /* USER CODE BEGIN MspInit 1 */
+
+ /* USER CODE END MspInit 1 */
+}
+
+/**
+* @brief UART MSP Initialization
+* This function configures the hardware resources used in this example
+* @param huart: UART handle pointer
+* @retval None
+*/
+void HAL_UART_MspInit(UART_HandleTypeDef* huart)
+{
+ GPIO_InitTypeDef GPIO_InitStruct = {0};
+ if(huart->Instance==LPUART1)
+ {
+ /* USER CODE BEGIN LPUART1_MspInit 0 */
+
+ /* USER CODE END LPUART1_MspInit 0 */
+ /* Peripheral clock enable */
+ __HAL_RCC_LPUART1_CLK_ENABLE();
+
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ /**LPUART1 GPIO Configuration
+ PA2 ------> LPUART1_TX
+ PA3 ------> LPUART1_RX
+ */
+ GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_3;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ GPIO_InitStruct.Alternate = GPIO_AF8_LPUART1;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+
+ /* LPUART1 DMA Init */
+ /* LPUART1_TX Init */
+ hdma_lpuart1_tx.Instance = DMA1_Channel1;
+ hdma_lpuart1_tx.Init.Request = DMA_REQUEST_LPUART1_TX;
+ hdma_lpuart1_tx.Init.Direction = DMA_MEMORY_TO_PERIPH;
+ hdma_lpuart1_tx.Init.PeriphInc = DMA_PINC_DISABLE;
+ hdma_lpuart1_tx.Init.MemInc = DMA_MINC_ENABLE;
+ hdma_lpuart1_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
+ hdma_lpuart1_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
+ hdma_lpuart1_tx.Init.Mode = DMA_NORMAL;
+ hdma_lpuart1_tx.Init.Priority = DMA_PRIORITY_LOW;
+ if (HAL_DMA_Init(&hdma_lpuart1_tx) != HAL_OK)
+ {
+ Error_Handler();
+ }
+
+ __HAL_LINKDMA(huart,hdmatx,hdma_lpuart1_tx);
+
+ /* LPUART1 interrupt Init */
+ HAL_NVIC_SetPriority(LPUART1_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(LPUART1_IRQn);
+ /* USER CODE BEGIN LPUART1_MspInit 1 */
+
+ /* USER CODE END LPUART1_MspInit 1 */
+ }
+ else if(huart->Instance==USART1)
+ {
+ /* USER CODE BEGIN USART1_MspInit 0 */
+
+ /* USER CODE END USART1_MspInit 0 */
+ /* Peripheral clock enable */
+ __HAL_RCC_USART1_CLK_ENABLE();
+
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+ /**USART1 GPIO Configuration
+ PA11 ------> USART1_CTS
+ PB6 ------> USART1_TX
+ PB7 ------> USART1_RX
+ */
+ GPIO_InitStruct.Pin = GPIO_PIN_11;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+
+ GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
+ HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
+
+ /* USART1 DMA Init */
+ /* USART1_TX Init */
+ hdma_usart1_tx.Instance = DMA1_Channel2;
+ hdma_usart1_tx.Init.Request = DMA_REQUEST_USART1_TX;
+ hdma_usart1_tx.Init.Direction = DMA_MEMORY_TO_PERIPH;
+ hdma_usart1_tx.Init.PeriphInc = DMA_PINC_DISABLE;
+ hdma_usart1_tx.Init.MemInc = DMA_MINC_ENABLE;
+ hdma_usart1_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
+ hdma_usart1_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
+ hdma_usart1_tx.Init.Mode = DMA_NORMAL;
+ hdma_usart1_tx.Init.Priority = DMA_PRIORITY_LOW;
+ if (HAL_DMA_Init(&hdma_usart1_tx) != HAL_OK)
+ {
+ Error_Handler();
+ }
+
+ __HAL_LINKDMA(huart,hdmatx,hdma_usart1_tx);
+
+ /* USART1 interrupt Init */
+ HAL_NVIC_SetPriority(USART1_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(USART1_IRQn);
+ /* USER CODE BEGIN USART1_MspInit 1 */
+
+ /* USER CODE END USART1_MspInit 1 */
+ }
+
+}
+
+/**
+* @brief UART MSP De-Initialization
+* This function freeze the hardware resources used in this example
+* @param huart: UART handle pointer
+* @retval None
+*/
+void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
+{
+ if(huart->Instance==LPUART1)
+ {
+ /* USER CODE BEGIN LPUART1_MspDeInit 0 */
+
+ /* USER CODE END LPUART1_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_LPUART1_CLK_DISABLE();
+
+ /**LPUART1 GPIO Configuration
+ PA2 ------> LPUART1_TX
+ PA3 ------> LPUART1_RX
+ */
+ HAL_GPIO_DeInit(GPIOA, GPIO_PIN_2|GPIO_PIN_3);
+
+ /* LPUART1 DMA DeInit */
+ HAL_DMA_DeInit(huart->hdmatx);
+
+ /* LPUART1 interrupt DeInit */
+ HAL_NVIC_DisableIRQ(LPUART1_IRQn);
+ /* USER CODE BEGIN LPUART1_MspDeInit 1 */
+
+ /* USER CODE END LPUART1_MspDeInit 1 */
+ }
+ else if(huart->Instance==USART1)
+ {
+ /* USER CODE BEGIN USART1_MspDeInit 0 */
+
+ /* USER CODE END USART1_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_USART1_CLK_DISABLE();
+
+ /**USART1 GPIO Configuration
+ PA11 ------> USART1_CTS
+ PB6 ------> USART1_TX
+ PB7 ------> USART1_RX
+ */
+ HAL_GPIO_DeInit(GPIOA, GPIO_PIN_11);
+
+ HAL_GPIO_DeInit(GPIOB, GPIO_PIN_6|GPIO_PIN_7);
+
+ /* USART1 DMA DeInit */
+ HAL_DMA_DeInit(huart->hdmatx);
+
+ /* USART1 interrupt DeInit */
+ HAL_NVIC_DisableIRQ(USART1_IRQn);
+ /* USER CODE BEGIN USART1_MspDeInit 1 */
+
+ /* USER CODE END USART1_MspDeInit 1 */
+ }
+
+}
+
+/**
+* @brief RTC MSP Initialization
+* This function configures the hardware resources used in this example
+* @param hrtc: RTC handle pointer
+* @retval None
+*/
+void HAL_RTC_MspInit(RTC_HandleTypeDef* hrtc)
+{
+ if(hrtc->Instance==RTC)
+ {
+ /* USER CODE BEGIN RTC_MspInit 0 */
+ HAL_PWR_EnableBkUpAccess(); /**< Enable access to the RTC registers */
+
+ /**
+ * Write twice the value to flush the APB-AHB bridge
+ * This bit shall be written in the register before writing the next one
+ */
+ HAL_PWR_EnableBkUpAccess();
+
+ __HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSE); /**< Select LSE as RTC Input */
+
+ /* USER CODE END RTC_MspInit 0 */
+ /* Peripheral clock enable */
+ __HAL_RCC_RTC_ENABLE();
+ /* USER CODE BEGIN RTC_MspInit 1 */
+
+ MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* USER CODE END RTC_MspInit 1 */
+ }
+
+}
+
+/**
+* @brief RTC MSP De-Initialization
+* This function freeze the hardware resources used in this example
+* @param hrtc: RTC handle pointer
+* @retval None
+*/
+void HAL_RTC_MspDeInit(RTC_HandleTypeDef* hrtc)
+{
+ if(hrtc->Instance==RTC)
+ {
+ /* USER CODE BEGIN RTC_MspDeInit 0 */
+
+ /* USER CODE END RTC_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_RTC_DISABLE();
+ /* USER CODE BEGIN RTC_MspDeInit 1 */
+
+ /* USER CODE END RTC_MspDeInit 1 */
+ }
+
+}
+
+/* USER CODE BEGIN 1 */
+
+/* USER CODE END 1 */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/stm32wbxx_it.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/stm32wbxx_it.c
new file mode 100644
index 000000000..150f4e248
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/stm32wbxx_it.c
@@ -0,0 +1,403 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file stm32wbxx_it.c
+ * @brief Interrupt Service Routines.
+ *******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+#include "stm32wbxx_it.h"
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+#include "hw.h"
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN TD */
+
+/* USER CODE END TD */
+
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN PD */
+
+/* USER CODE END PD */
+
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private variables ---------------------------------------------------------*/
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+/* USER CODE BEGIN PFP */
+
+/* USER CODE END PFP */
+
+/* Private user code ---------------------------------------------------------*/
+/* USER CODE BEGIN 0 */
+
+/* USER CODE END 0 */
+
+/* External variables --------------------------------------------------------*/
+extern DMA_HandleTypeDef hdma_lpuart1_tx;
+extern DMA_HandleTypeDef hdma_usart1_tx;
+extern UART_HandleTypeDef hlpuart1;
+extern UART_HandleTypeDef huart1;
+/* USER CODE BEGIN EV */
+
+/* USER CODE END EV */
+
+/******************************************************************************/
+/* Cortex Processor Interruption and Exception Handlers */
+/******************************************************************************/
+/**
+ * @brief This function handles Non maskable interrupt.
+ */
+void NMI_Handler(void)
+{
+ /* USER CODE BEGIN NonMaskableInt_IRQn 0 */
+
+ /* USER CODE END NonMaskableInt_IRQn 0 */
+ /* USER CODE BEGIN NonMaskableInt_IRQn 1 */
+
+ /* USER CODE END NonMaskableInt_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Hard fault interrupt.
+ */
+void HardFault_Handler(void)
+{
+ /* USER CODE BEGIN HardFault_IRQn 0 */
+
+ /* USER CODE END HardFault_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_HardFault_IRQn 0 */
+ /* USER CODE END W1_HardFault_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles Memory management fault.
+ */
+void MemManage_Handler(void)
+{
+ /* USER CODE BEGIN MemoryManagement_IRQn 0 */
+
+ /* USER CODE END MemoryManagement_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */
+ /* USER CODE END W1_MemoryManagement_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles Prefetch fault, memory access fault.
+ */
+void BusFault_Handler(void)
+{
+ /* USER CODE BEGIN BusFault_IRQn 0 */
+
+ /* USER CODE END BusFault_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_BusFault_IRQn 0 */
+ /* USER CODE END W1_BusFault_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles Undefined instruction or illegal state.
+ */
+void UsageFault_Handler(void)
+{
+ /* USER CODE BEGIN UsageFault_IRQn 0 */
+
+ /* USER CODE END UsageFault_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_UsageFault_IRQn 0 */
+ /* USER CODE END W1_UsageFault_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles System service call via SWI instruction.
+ */
+void SVC_Handler(void)
+{
+ /* USER CODE BEGIN SVCall_IRQn 0 */
+
+ /* USER CODE END SVCall_IRQn 0 */
+ /* USER CODE BEGIN SVCall_IRQn 1 */
+
+ /* USER CODE END SVCall_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Debug monitor.
+ */
+void DebugMon_Handler(void)
+{
+ /* USER CODE BEGIN DebugMonitor_IRQn 0 */
+
+ /* USER CODE END DebugMonitor_IRQn 0 */
+ /* USER CODE BEGIN DebugMonitor_IRQn 1 */
+
+ /* USER CODE END DebugMonitor_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Pendable request for system service.
+ */
+void PendSV_Handler(void)
+{
+ /* USER CODE BEGIN PendSV_IRQn 0 */
+
+ /* USER CODE END PendSV_IRQn 0 */
+ /* USER CODE BEGIN PendSV_IRQn 1 */
+
+ /* USER CODE END PendSV_IRQn 1 */
+}
+
+/**
+ * @brief This function handles System tick timer.
+ */
+void SysTick_Handler(void)
+{
+ /* USER CODE BEGIN SysTick_IRQn 0 */
+
+ /* USER CODE END SysTick_IRQn 0 */
+ HAL_IncTick();
+ /* USER CODE BEGIN SysTick_IRQn 1 */
+
+ /* USER CODE END SysTick_IRQn 1 */
+}
+
+/******************************************************************************/
+/* STM32WBxx Peripheral Interrupt Handlers */
+/* Add here the Interrupt Handlers for the used peripherals. */
+/* For the available peripheral interrupt handler names, */
+/* please refer to the startup file (startup_stm32wbxx.s). */
+/******************************************************************************/
+
+/**
+ * @brief This function handles PVD/PVM0/PVM2 interrupts through EXTI lines 16/31/33.
+ */
+void PVD_PVM_IRQHandler(void)
+{
+ /* USER CODE BEGIN PVD_PVM_IRQn 0 */
+
+ /* USER CODE END PVD_PVM_IRQn 0 */
+ HAL_PWREx_PVD_PVM_IRQHandler();
+ /* USER CODE BEGIN PVD_PVM_IRQn 1 */
+
+ /* USER CODE END PVD_PVM_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Flash global interrupt.
+ */
+void FLASH_IRQHandler(void)
+{
+ /* USER CODE BEGIN FLASH_IRQn 0 */
+
+ /* USER CODE END FLASH_IRQn 0 */
+ HAL_FLASH_IRQHandler();
+ /* USER CODE BEGIN FLASH_IRQn 1 */
+
+ /* USER CODE END FLASH_IRQn 1 */
+}
+
+/**
+ * @brief This function handles RCC global interrupt.
+ */
+void RCC_IRQHandler(void)
+{
+ /* USER CODE BEGIN RCC_IRQn 0 */
+
+ /* USER CODE END RCC_IRQn 0 */
+ /* USER CODE BEGIN RCC_IRQn 1 */
+
+ /* USER CODE END RCC_IRQn 1 */
+}
+
+/**
+ * @brief This function handles DMA1 channel1 global interrupt.
+ */
+void DMA1_Channel1_IRQHandler(void)
+{
+ /* USER CODE BEGIN DMA1_Channel1_IRQn 0 */
+
+ /* USER CODE END DMA1_Channel1_IRQn 0 */
+ HAL_DMA_IRQHandler(&hdma_lpuart1_tx);
+ /* USER CODE BEGIN DMA1_Channel1_IRQn 1 */
+
+ /* USER CODE END DMA1_Channel1_IRQn 1 */
+}
+
+/**
+ * @brief This function handles DMA1 channel2 global interrupt.
+ */
+void DMA1_Channel2_IRQHandler(void)
+{
+ /* USER CODE BEGIN DMA1_Channel2_IRQn 0 */
+
+ /* USER CODE END DMA1_Channel2_IRQn 0 */
+ HAL_DMA_IRQHandler(&hdma_usart1_tx);
+ /* USER CODE BEGIN DMA1_Channel2_IRQn 1 */
+
+ /* USER CODE END DMA1_Channel2_IRQn 1 */
+}
+
+/**
+ * @brief This function handles CPU2 SEV interrupt through EXTI line 40 and PWR CPU2 HOLD wake-up interrupt.
+ */
+void C2SEV_PWR_C2H_IRQHandler(void)
+{
+ /* USER CODE BEGIN C2SEV_PWR_C2H_IRQn 0 */
+
+ /* USER CODE END C2SEV_PWR_C2H_IRQn 0 */
+ /* USER CODE BEGIN C2SEV_PWR_C2H_IRQn 1 */
+
+ /* USER CODE END C2SEV_PWR_C2H_IRQn 1 */
+}
+
+/**
+ * @brief This function handles USART1 global interrupt.
+ */
+void USART1_IRQHandler(void)
+{
+ /* USER CODE BEGIN USART1_IRQn 0 */
+
+ /* USER CODE END USART1_IRQn 0 */
+ HAL_UART_IRQHandler(&huart1);
+ /* USER CODE BEGIN USART1_IRQn 1 */
+
+ /* USER CODE END USART1_IRQn 1 */
+}
+
+/**
+ * @brief This function handles LPUART1 global interrupt.
+ */
+void LPUART1_IRQHandler(void)
+{
+ /* USER CODE BEGIN LPUART1_IRQn 0 */
+
+ /* USER CODE END LPUART1_IRQn 0 */
+ HAL_UART_IRQHandler(&hlpuart1);
+ /* USER CODE BEGIN LPUART1_IRQn 1 */
+
+ /* USER CODE END LPUART1_IRQn 1 */
+}
+
+/**
+ * @brief This function handles PWR switching on the fly, end of BLE activity, end of 802.15.4 activity, end of critical radio phase interrupt.
+ */
+void PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler(void)
+{
+ /* USER CODE BEGIN PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn 0 */
+
+ /* USER CODE END PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn 0 */
+ /* USER CODE BEGIN PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn 1 */
+
+ /* USER CODE END PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn 1 */
+}
+
+/**
+ * @brief This function handles HSEM global interrupt.
+ */
+void HSEM_IRQHandler(void)
+{
+ /* USER CODE BEGIN HSEM_IRQn 0 */
+
+ /* USER CODE END HSEM_IRQn 0 */
+ HAL_HSEM_IRQHandler();
+ /* USER CODE BEGIN HSEM_IRQn 1 */
+
+ /* USER CODE END HSEM_IRQn 1 */
+}
+
+/**
+ * @brief This function handles FPU global interrupt.
+ */
+void FPU_IRQHandler(void)
+{
+ /* USER CODE BEGIN FPU_IRQn 0 */
+
+ /* USER CODE END FPU_IRQn 0 */
+ /* USER CODE BEGIN FPU_IRQn 1 */
+
+ /* USER CODE END FPU_IRQn 1 */
+}
+
+/* USER CODE BEGIN 1 */
+void RTC_WKUP_IRQHandler(void)
+{
+ HW_TS_RTC_Wakeup_Handler();
+}
+
+/**
+ * @brief This function handles EXTI4_IRQ Handler.
+ * @param None
+ * @retval None
+ */
+void EXTI4_IRQHandler(void)
+{
+ HAL_GPIO_EXTI_IRQHandler(BUTTON_SW1_PIN);
+}
+
+/**
+ * @brief This function handles EXTI0_IRQ Handler.
+ * @param None
+ * @retval None
+ */
+void EXTI0_IRQHandler(void)
+{
+ HAL_GPIO_EXTI_IRQHandler(BUTTON_SW2_PIN);
+}
+
+/**
+ * @brief This function handles EXTI1_IRQ Handler.
+ * @param None
+ * @retval None
+ */
+void EXTI1_IRQHandler(void)
+{
+ HAL_GPIO_EXTI_IRQHandler(BUTTON_SW3_PIN);
+}
+
+
+void IPCC_C1_TX_IRQHandler(void)
+{
+ HW_IPCC_Tx_Handler();
+
+ return;
+}
+void IPCC_C1_RX_IRQHandler(void)
+{
+ HW_IPCC_Rx_Handler();
+ return;
+}
+/* USER CODE END 1 */
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/stm_logging.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/stm_logging.c
new file mode 100644
index 000000000..47a43a019
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/stm_logging.c
@@ -0,0 +1,215 @@
+/**
+ ******************************************************************************
+ * File Name : stm_logging.c
+ * Description : This file contains all the defines and functions used
+ * for logging on Application examples.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/**
+ * @file
+ * This file implements logging functions to be used in Application examples.
+ *
+ */
+
+#include <ctype.h>
+#include <inttypes.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <string.h>
+
+#include "app_conf.h"
+#include "stm_logging.h"
+
+#define LOG_PARSE_BUFFER_SIZE 256U
+
+#define LOG_TIMESTAMP_ENABLE 0
+#define LOG_REGION_ENABLE 1U
+#define LOG_RTT_COLOR_ENABLE 1U
+
+#if (LOG_RTT_COLOR_ENABLE == 1U)
+#define RTT_COLOR_CODE_DEFAULT "\x1b[0m"
+#define RTT_COLOR_CODE_RED "\x1b[0;91m"
+#define RTT_COLOR_CODE_GREEN "\x1b[0;92m"
+#define RTT_COLOR_CODE_YELLOW "\x1b[0;93m"
+#define RTT_COLOR_CODE_CYAN "\x1b[0;96m"
+
+#else /* LOG_RTT_COLOR_ENABLE == 1 */
+#define RTT_COLOR_CODE_DEFAULT ""
+#define RTT_COLOR_CODE_RED ""
+#define RTT_COLOR_CODE_GREEN ""
+#define RTT_COLOR_CODE_YELLOW ""
+#define RTT_COLOR_CODE_CYAN ""
+#endif /* LOG_RTT_COLOR_ENABLE == 1 */
+
+
+#if (CFG_DEBUG_TRACE != 0)
+/**
+ * Function for outputting code region string.
+ *
+ * @param[inout] aLogString Pointer to log buffer.
+ * @param[in] aMaxSize Maximum size of log buffer.
+ * @param[in] otLogRegion The region ID.
+ *
+ * @returns String with a log level color value.
+ */
+static inline uint16_t logRegion(char *aLogString, uint16_t aMaxSize,
+ appliLogRegion_t aLogRegion)
+{
+ char logRegionString[30U];
+
+ switch (aLogRegion)
+ {
+ case APPLI_LOG_REGION_GENERAL:
+ strcpy(logRegionString, "[M4 APPLICATION]");
+ break;
+ case APPLI_LOG_REGION_OPENTHREAD_API:
+ strcpy(logRegionString, "[M4 OPENTHREAD API]");
+ break;
+ case APPLI_LOG_REGION_OT_API_LINK:
+ strcpy(logRegionString, "[M4 LINK API]");
+ break;
+ case APPLI_LOG_REGION_OT_API_INSTANCE:
+ strcpy(logRegionString, "[M4 INSTANCE API]");
+ break;
+ case APPLI_LOG_REGION_OT_API_MESSAGE:
+ strcpy(logRegionString, "[M4 MESSAGE API]");
+ break;
+ default:
+ strcpy(logRegionString, "[M4]");
+ break;
+ }
+
+ return snprintf(aLogString, aMaxSize, "%s ", logRegionString);
+}
+#endif /* CFG_DEBUG_TRACE */
+
+#if (LOG_RTT_COLOR_ENABLE == 1U)
+#if (CFG_DEBUG_TRACE != 0)
+/**
+ * Function for getting color of a given level log.
+ *
+ * @param[in] aLogLevel The log level.
+ *
+ * @returns String with a log level color value.
+ */
+static inline const char *levelToString(appliLogLevel_t aLogLevel)
+{
+ switch (aLogLevel)
+ {
+ case LOG_LEVEL_CRIT:
+ return RTT_COLOR_CODE_RED;
+
+ case LOG_LEVEL_WARN:
+ return RTT_COLOR_CODE_YELLOW;
+
+ case LOG_LEVEL_INFO:
+ return RTT_COLOR_CODE_GREEN;
+
+ case LOG_LEVEL_DEBG:
+ default:
+ return RTT_COLOR_CODE_DEFAULT;
+ }
+}
+#endif /* CFG_DEBUG_TRACE */
+
+#if (CFG_DEBUG_TRACE != 0)
+/**
+ * Function for printing log level.
+ *
+ * @param[inout] aLogString Pointer to log buffer.
+ * @param[in] aMaxSize Maximum size of log buffer.
+ * @param[in] aLogLevel Log level.
+ *
+ * @returns Number of bytes successfully written to the log buffer.
+ */
+static inline uint16_t logLevel(char *aLogString, uint16_t aMaxSize,
+ appliLogLevel_t aLogLevel)
+{
+ return snprintf(aLogString, aMaxSize, "%s", levelToString(aLogLevel));
+}
+#endif /* CFG_DEBUG_TRACE */
+#endif /* LOG_RTT_COLOR_ENABLE */
+
+#if (LOG_TIMESTAMP_ENABLE == 1U)
+/**
+ * Function for printing actual timestamp.
+ *
+ * @param[inout] aLogString Pointer to the log buffer.
+ * @param[in] aMaxSize Maximum size of the log buffer.
+ *
+ * @returns Number of bytes successfully written to the log buffer.
+ */
+static inline uint16_t logTimestamp(char *aLogString, uint16_t aMaxSize)
+{
+ return snprintf(aLogString, aMaxSize, "%s[%010ld]", RTT_COLOR_CODE_DEFAULT,
+ otPlatAlarmMilliGetNow());
+}
+#endif /* LOG_TIMESTAMP_ENABLE */
+
+
+/**
+ * Function for printing application log
+ *
+ * @param[in] aLogLevel Log level.
+ * @param[in] aLogRegion The region ID.
+ * @param[in] aFormat User string format.
+ *
+ * @returns Number of bytes successfully written to the log buffer.
+ */
+void logApplication(appliLogLevel_t aLogLevel, appliLogRegion_t aLogRegion, const char *aFormat, ...)
+{
+#if (CFG_DEBUG_TRACE != 0) /* Since the traces are disabled, there is nothing to print */
+ uint16_t length = 0;
+ char logString[LOG_PARSE_BUFFER_SIZE + 1U];
+
+#if (LOG_TIMESTAMP_ENABLE == 1U)
+ length += logTimestamp(logString, LOG_PARSE_BUFFER_SIZE);
+#endif
+
+#if (LOG_RTT_COLOR_ENABLE == 1U)
+ /* Add level information */
+ length += logLevel(&logString[length], (LOG_PARSE_BUFFER_SIZE - length),
+ aLogLevel);
+#endif
+
+#if (LOG_REGION_ENABLE == 1U)
+ /* Add Region information */
+ length += logRegion(&logString[length], (LOG_PARSE_BUFFER_SIZE - length),
+ aLogRegion);
+#endif
+
+ /* Parse user string */
+ va_list paramList;
+ va_start(paramList, aFormat);
+ length += vsnprintf(&logString[length], (LOG_PARSE_BUFFER_SIZE - length),
+ aFormat, paramList);
+ logString[length++] = '\r';
+ logString[length++] = '\n';
+ logString[length++] = 0;
+ va_end(paramList);
+
+ if (aLogLevel <= APPLI_CONFIG_LOG_LEVEL)
+ {
+ printf("%s", logString);
+ }else
+ {
+ /* Print nothing */
+ }
+#endif /* CFG_DEBUG_TRACE */
+}
+
+
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/system_stm32wbxx.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/system_stm32wbxx.c
new file mode 100644
index 000000000..d4653a0ce
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/Core/Src/system_stm32wbxx.c
@@ -0,0 +1,353 @@
+/**
+ ******************************************************************************
+ * @file system_stm32wbxx.c
+ * @author MCD Application Team
+ * @brief CMSIS Cortex Device Peripheral Access Layer System Source File
+ *
+ * This file provides two functions and one global variable to be called from
+ * user application:
+ * - SystemInit(): This function is called at startup just after reset and
+ * before branch to main program. This call is made inside
+ * the "startup_stm32wbxx.s" file.
+ *
+ * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used
+ * by the user application to setup the SysTick
+ * timer or configure other parameters.
+ *
+ * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must
+ * be called whenever the core clock is changed
+ * during program execution.
+ *
+ * After each device reset the MSI (4 MHz) is used as system clock source.
+ * Then SystemInit() function is called, in "startup_stm32wbxx.s" file, to
+ * configure the system clock before to branch to main program.
+ *
+ * This file configures the system clock as follows:
+ *=============================================================================
+ *-----------------------------------------------------------------------------
+ * System Clock source | MSI
+ *-----------------------------------------------------------------------------
+ * SYSCLK(Hz) | 4000000
+ *-----------------------------------------------------------------------------
+ * HCLK(Hz) | 4000000
+ *-----------------------------------------------------------------------------
+ * AHB Prescaler | 1
+ *-----------------------------------------------------------------------------
+ * APB1 Prescaler | 1
+ *-----------------------------------------------------------------------------
+ * APB2 Prescaler | 1
+ *-----------------------------------------------------------------------------
+ * PLL_M | 1
+ *-----------------------------------------------------------------------------
+ * PLL_N | 8
+ *-----------------------------------------------------------------------------
+ * PLL_P | 7
+ *-----------------------------------------------------------------------------
+ * PLL_Q | 2
+ *-----------------------------------------------------------------------------
+ * PLL_R | 2
+ *-----------------------------------------------------------------------------
+ * PLLSAI1_P | NA
+ *-----------------------------------------------------------------------------
+ * PLLSAI1_Q | NA
+ *-----------------------------------------------------------------------------
+ * PLLSAI1_R | NA
+ *-----------------------------------------------------------------------------
+ * Require 48MHz for USB OTG FS, | Disabled
+ * SDIO and RNG clock |
+ *-----------------------------------------------------------------------------
+ *=============================================================================
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+
+/** @addtogroup CMSIS
+ * @{
+ */
+
+/** @addtogroup stm32WBxx_system
+ * @{
+ */
+
+/** @addtogroup stm32WBxx_System_Private_Includes
+ * @{
+ */
+
+#include "stm32wbxx.h"
+
+#if !defined (HSE_VALUE)
+ #define HSE_VALUE (32000000UL) /*!< Value of the External oscillator in Hz */
+#endif /* HSE_VALUE */
+
+#if !defined (MSI_VALUE)
+ #define MSI_VALUE (4000000UL) /*!< Value of the Internal oscillator in Hz*/
+#endif /* MSI_VALUE */
+
+#if !defined (HSI_VALUE)
+ #define HSI_VALUE (16000000UL) /*!< Value of the Internal oscillator in Hz*/
+#endif /* HSI_VALUE */
+
+#if !defined (LSI_VALUE)
+ #define LSI_VALUE (32000UL) /*!< Value of LSI in Hz*/
+#endif /* LSI_VALUE */
+
+#if !defined (LSE_VALUE)
+ #define LSE_VALUE (32768UL) /*!< Value of LSE in Hz*/
+#endif /* LSE_VALUE */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_TypesDefinitions
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_Defines
+ * @{
+ */
+
+/*!< Uncomment the following line if you need to relocate your vector Table in
+ Internal SRAM. */
+/* #define VECT_TAB_SRAM */
+#define VECT_TAB_OFFSET 0x0U /*!< Vector Table base offset field.
+ This value must be a multiple of 0x200. */
+
+#define VECT_TAB_BASE_ADDRESS SRAM1_BASE /*!< Vector Table base offset field.
+ This value must be a multiple of 0x200. */
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_Macros
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_Variables
+ * @{
+ */
+ /* The SystemCoreClock variable is updated in three ways:
+ 1) by calling CMSIS function SystemCoreClockUpdate()
+ 2) by calling HAL API function HAL_RCC_GetHCLKFreq()
+ 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
+ Note: If you use this function to configure the system clock; then there
+ is no need to call the 2 first functions listed above, since SystemCoreClock
+ variable is updated automatically.
+ */
+ uint32_t SystemCoreClock = 4000000UL ; /*CPU1: M4 on MSI clock after startup (4MHz)*/
+
+ const uint32_t AHBPrescTable[16UL] = {1UL, 3UL, 5UL, 1UL, 1UL, 6UL, 10UL, 32UL, 2UL, 4UL, 8UL, 16UL, 64UL, 128UL, 256UL, 512UL};
+
+ const uint32_t APBPrescTable[8UL] = {0UL, 0UL, 0UL, 0UL, 1UL, 2UL, 3UL, 4UL};
+
+ const uint32_t MSIRangeTable[16UL] = {100000UL, 200000UL, 400000UL, 800000UL, 1000000UL, 2000000UL, \
+ 4000000UL, 8000000UL, 16000000UL, 24000000UL, 32000000UL, 48000000UL, 0UL, 0UL, 0UL, 0UL}; /* 0UL values are incorrect cases */
+
+ const uint32_t SmpsPrescalerTable[4UL][6UL]={{1UL,3UL,2UL,2UL,1UL,2UL}, \
+ {2UL,6UL,4UL,3UL,2UL,4UL}, \
+ {4UL,12UL,8UL,6UL,4UL,8UL}, \
+ {4UL,12UL,8UL,6UL,4UL,8UL}};
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_FunctionPrototypes
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_Functions
+ * @{
+ */
+
+/**
+ * @brief Setup the microcontroller system.
+ * @param None
+ * @retval None
+ */
+void SystemInit(void)
+{
+ /* Configure the Vector Table location add offset address ------------------*/
+#if defined(VECT_TAB_SRAM) && defined(VECT_TAB_BASE_ADDRESS)
+ /* program in SRAMx */
+ SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAMx for CPU1 */
+#else /* program in FLASH */
+ SCB->VTOR = VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
+#endif
+
+ /* FPU settings ------------------------------------------------------------*/
+ #if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
+ SCB->CPACR |= ((3UL << (10UL*2UL))|(3UL << (11UL*2UL))); /* set CP10 and CP11 Full Access */
+ #endif
+
+ /* Reset the RCC clock configuration to the default reset state ------------*/
+ /* Set MSION bit */
+ RCC->CR |= RCC_CR_MSION;
+
+ /* Reset CFGR register */
+ RCC->CFGR = 0x00070000U;
+
+ /* Reset PLLSAI1ON, PLLON, HSECSSON, HSEON, HSION, and MSIPLLON bits */
+ RCC->CR &= (uint32_t)0xFAF6FEFBU;
+
+ /*!< Reset LSI1 and LSI2 bits */
+ RCC->CSR &= (uint32_t)0xFFFFFFFAU;
+
+ /*!< Reset HSI48ON bit */
+ RCC->CRRCR &= (uint32_t)0xFFFFFFFEU;
+
+ /* Reset PLLCFGR register */
+ RCC->PLLCFGR = 0x22041000U;
+
+ /* Reset PLLSAI1CFGR register */
+ RCC->PLLSAI1CFGR = 0x22041000U;
+
+ /* Reset HSEBYP bit */
+ RCC->CR &= 0xFFFBFFFFU;
+
+ /* Disable all interrupts */
+ RCC->CIER = 0x00000000;
+}
+
+/**
+ * @brief Update SystemCoreClock variable according to Clock Register Values.
+ * The SystemCoreClock variable contains the core clock (HCLK), it can
+ * be used by the user application to setup the SysTick timer or configure
+ * other parameters.
+ *
+ * @note Each time the core clock (HCLK) changes, this function must be called
+ * to update SystemCoreClock variable value. Otherwise, any configuration
+ * based on this variable will be incorrect.
+ *
+ * @note - The system frequency computed by this function is not the real
+ * frequency in the chip. It is calculated based on the predefined
+ * constant and the selected clock source:
+ *
+ * - If SYSCLK source is MSI, SystemCoreClock will contain the MSI_VALUE(*)
+ *
+ * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(**)
+ *
+ * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(***)
+ *
+ * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(***)
+ * or HSI_VALUE(*) or MSI_VALUE(*) multiplied/divided by the PLL factors.
+ *
+ * (*) MSI_VALUE is a constant defined in stm32wbxx_hal.h file (default value
+ * 4 MHz) but the real value may vary depending on the variations
+ * in voltage and temperature.
+ *
+ * (**) HSI_VALUE is a constant defined in stm32wbxx_hal_conf.h file (default value
+ * 16 MHz) but the real value may vary depending on the variations
+ * in voltage and temperature.
+ *
+ * (***) HSE_VALUE is a constant defined in stm32wbxx_hal_conf.h file (default value
+ * 32 MHz), user has to ensure that HSE_VALUE is same as the real
+ * frequency of the crystal used. Otherwise, this function may
+ * have wrong result.
+ *
+ * - The result of this function could be not correct when using fractional
+ * value for HSE crystal.
+ *
+ * @param None
+ * @retval None
+ */
+void SystemCoreClockUpdate(void)
+{
+ uint32_t tmp, msirange, pllvco, pllr, pllsource , pllm;
+
+ /* Get MSI Range frequency--------------------------------------------------*/
+
+ /*MSI frequency range in Hz*/
+ msirange = MSIRangeTable[(RCC->CR & RCC_CR_MSIRANGE) >> RCC_CR_MSIRANGE_Pos];
+
+ /* Get SYSCLK source -------------------------------------------------------*/
+ switch (RCC->CFGR & RCC_CFGR_SWS)
+ {
+ case 0x00: /* MSI used as system clock source */
+ SystemCoreClock = msirange;
+ break;
+
+ case 0x04: /* HSI used as system clock source */
+ /* HSI used as system clock source */
+ SystemCoreClock = HSI_VALUE;
+ break;
+
+ case 0x08: /* HSE used as system clock source */
+ SystemCoreClock = HSE_VALUE;
+ break;
+
+ case 0x0C: /* PLL used as system clock source */
+ /* PLL_VCO = (HSE_VALUE or HSI_VALUE or MSI_VALUE/ PLLM) * PLLN
+ SYSCLK = PLL_VCO / PLLR
+ */
+ pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC);
+ pllm = ((RCC->PLLCFGR & RCC_PLLCFGR_PLLM) >> RCC_PLLCFGR_PLLM_Pos) + 1UL ;
+
+ if(pllsource == 0x02UL) /* HSI used as PLL clock source */
+ {
+ pllvco = (HSI_VALUE / pllm);
+ }
+ else if(pllsource == 0x03UL) /* HSE used as PLL clock source */
+ {
+ pllvco = (HSE_VALUE / pllm);
+ }
+ else /* MSI used as PLL clock source */
+ {
+ pllvco = (msirange / pllm);
+ }
+
+ pllvco = pllvco * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> RCC_PLLCFGR_PLLN_Pos);
+ pllr = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLR) >> RCC_PLLCFGR_PLLR_Pos) + 1UL);
+
+ SystemCoreClock = pllvco/pllr;
+ break;
+
+ default:
+ SystemCoreClock = msirange;
+ break;
+ }
+
+ /* Compute HCLK clock frequency --------------------------------------------*/
+ /* Get HCLK1 prescaler */
+ tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> RCC_CFGR_HPRE_Pos)];
+ /* HCLK clock frequency */
+ SystemCoreClock = SystemCoreClock / tmp;
+
+}
+
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/EWARM/Project.eww b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/EWARM/Project.eww
new file mode 100644
index 000000000..d39a1bdbe
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/EWARM/Project.eww
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workspace>
+ <project>
+ <path>$WS_DIR$\Thread_Ota_Server.ewp</path>
+ </project>
+ <batchBuild />
+</workspace>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/EWARM/Thread_Ota_Server.ewd b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/EWARM/Thread_Ota_Server.ewd
new file mode 100644
index 000000000..c278227af
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/EWARM/Thread_Ota_Server.ewd
@@ -0,0 +1,1419 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <fileVersion>3</fileVersion>
+ <configuration>
+ <name>Thread_Ota_Server</name>
+ <toolchain>
+ <name>ARM</name>
+ </toolchain>
+ <debug>1</debug>
+ <settings>
+ <name>C-SPY</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>29</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CInput</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CEndian</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCVariant</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacFile</name>
+ <state />
+ </option>
+ <option>
+ <name>MemOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MemFile</name>
+ <state />
+ </option>
+ <option>
+ <name>RunToEnable</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RunToName</name>
+ <state>main</state>
+ </option>
+ <option>
+ <name>CExtraOptionsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CExtraOptions</name>
+ <state />
+ </option>
+ <option>
+ <name>CFpuProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCDDFArgumentProducer</name>
+ <state />
+ </option>
+ <option>
+ <name>OCDownloadSuppressDownload</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCDownloadVerifyAll</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCProductVersion</name>
+ <state>7.10.3.6927</state>
+ </option>
+ <option>
+ <name>OCDynDriverList</name>
+ <state>STLINK_ID</state>
+ </option>
+ <option>
+ <name>OCLastSavedByProductVersion</name>
+ <state>8.20.1.14181</state>
+ </option>
+ <option>
+ <name>UseFlashLoader</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CLowLevel</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCBE8Slave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>MacFile2</name>
+ <state />
+ </option>
+ <option>
+ <name>CDevice</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>FlashLoadersV3</name>
+ <state />
+ </option>
+ <option>
+ <name>OCImagesSuppressCheck1</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesPath1</name>
+ <state />
+ </option>
+ <option>
+ <name>OCImagesSuppressCheck2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesPath2</name>
+ <state />
+ </option>
+ <option>
+ <name>OCImagesSuppressCheck3</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesPath3</name>
+ <state />
+ </option>
+ <option>
+ <name>OverrideDefFlashBoard</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesOffset1</name>
+ <state />
+ </option>
+ <option>
+ <name>OCImagesOffset2</name>
+ <state />
+ </option>
+ <option>
+ <name>OCImagesOffset3</name>
+ <state />
+ </option>
+ <option>
+ <name>OCImagesUse1</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesUse2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesUse3</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCDeviceConfigMacroFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCDebuggerExtraOption</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCAllMTBOptions</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCMulticoreNrOfCores</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCMulticoreMaster</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCMulticorePort</name>
+ <state>53461</state>
+ </option>
+ <option>
+ <name>OCMulticoreWorkspace</name>
+ <state />
+ </option>
+ <option>
+ <name>OCMulticoreSlaveProject</name>
+ <state />
+ </option>
+ <option>
+ <name>OCMulticoreSlaveConfiguration</name>
+ <state />
+ </option>
+ <option>
+ <name>OCDownloadExtraImage</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCAttachSlave</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MassEraseBeforeFlashing</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>ARMSIM_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>1</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCSimDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCSimEnablePSP</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCSimPspOverrideConfig</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCSimPspConfigFile</name>
+ <state />
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>CADI_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CCadiMemory</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>Fast Model</name>
+ <state />
+ </option>
+ <option>
+ <name>CCADILogFileCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCADILogFileEditB</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>CMSISDAP_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>4</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CatchSFERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCIarProbeScriptFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CMSISDAPResetList</name>
+ <version>1</version>
+ <state>10</state>
+ </option>
+ <option>
+ <name>CMSISDAPHWResetDuration</name>
+ <state>300</state>
+ </option>
+ <option>
+ <name>CMSISDAPHWResetDelay</name>
+ <state>200</state>
+ </option>
+ <option>
+ <name>CMSISDAPDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CMSISDAPInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPMultiTargetEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPMultiTarget</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPJtagSpeedList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPBreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPRestoreBreakpointsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPUpdateBreakpointsEdit</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>RDICatchReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchUndef</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchSWI</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchData</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchPrefetch</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchIRQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchFIQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CatchMMERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchNOCPERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchCHKERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchSTATERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchBUSERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchINTERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchHARDERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPMultiCPUEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPMultiCPUNumber</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCProbeCfgOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCProbeConfig</name>
+ <state />
+ </option>
+ <option>
+ <name>CMSISDAPProbeConfigRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPSelectedCPUBehaviour</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ICpuName</name>
+ <state />
+ </option>
+ <option>
+ <name>OCJetEmuParams</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCCMSISDAPUsbSerialNo</name>
+ <state />
+ </option>
+ <option>
+ <name>CCCMSISDAPUsbSerialNoSelect</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>GDBSERVER_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>TCPIP</name>
+ <state>aaa.bbb.ccc.ddd</state>
+ </option>
+ <option>
+ <name>DoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>LogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCJTagBreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJTagDoUpdateBreakpoints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJTagUpdateBreakpoints</name>
+ <state>_call_main</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>IJET_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>8</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CatchSFERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCIarProbeScriptFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IjetResetList</name>
+ <version>1</version>
+ <state>10</state>
+ </option>
+ <option>
+ <name>IjetHWResetDuration</name>
+ <state>300</state>
+ </option>
+ <option>
+ <name>IjetHWResetDelay</name>
+ <state>200</state>
+ </option>
+ <option>
+ <name>IjetPowerFromProbe</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IjetPowerRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>IjetInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetMultiTargetEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetMultiTarget</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetScanChainNonARMDevices</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetIRLength</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetJtagSpeedList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetProtocolRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetSwoPin</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetCpuClockEdit</name>
+ <state>72.0</state>
+ </option>
+ <option>
+ <name>IjetSwoPrescalerList</name>
+ <version>1</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetBreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetRestoreBreakpointsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetUpdateBreakpointsEdit</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>RDICatchReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchUndef</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchSWI</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchData</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchPrefetch</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchIRQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchFIQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CatchMMERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchNOCPERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchCHKERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchSTATERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchBUSERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchINTERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchHARDERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCProbeCfgOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCProbeConfig</name>
+ <state />
+ </option>
+ <option>
+ <name>IjetProbeConfigRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetMultiCPUEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetMultiCPUNumber</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetSelectedCPUBehaviour</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ICpuName</name>
+ <state />
+ </option>
+ <option>
+ <name>OCJetEmuParams</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IjetPreferETB</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IjetTraceSettingsList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetTraceSizeList</name>
+ <version>0</version>
+ <state>4</state>
+ </option>
+ <option>
+ <name>FlashBoardPathSlave</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCIjetUsbSerialNo</name>
+ <state />
+ </option>
+ <option>
+ <name>CCIjetUsbSerialNoSelect</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>JLINK_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>16</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CCCatchSFERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>JLinkSpeed</name>
+ <state>1000</state>
+ </option>
+ <option>
+ <name>CCJLinkDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCJLinkHWResetDelay</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>JLinkInitialSpeed</name>
+ <state>1000</state>
+ </option>
+ <option>
+ <name>CCDoJlinkMultiTarget</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCScanChainNonARMDevices</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkMultiTarget</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkIRLength</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkCommRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkTCPIP</name>
+ <state>aaa.bbb.ccc.ddd</state>
+ </option>
+ <option>
+ <name>CCJLinkSpeedRadioV2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCUSBDevice</name>
+ <version>1</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCRDICatchReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchUndef</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchSWI</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchData</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchPrefetch</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchIRQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchFIQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkBreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkDoUpdateBreakpoints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkUpdateBreakpoints</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>CCJLinkInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkResetList</name>
+ <version>6</version>
+ <state>7</state>
+ </option>
+ <option>
+ <name>CCJLinkInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchMMERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchNOCPERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchCHRERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchSTATERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchBUSERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchINTERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchHARDERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCJLinkScriptFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCJLinkUsbSerialNo</name>
+ <state />
+ </option>
+ <option>
+ <name>CCTcpIpAlt</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkTcpIpSerialNo</name>
+ <state />
+ </option>
+ <option>
+ <name>CCCpuClockEdit</name>
+ <state>72.0</state>
+ </option>
+ <option>
+ <name>CCSwoClockAuto</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSwoClockEdit</name>
+ <state>2000</state>
+ </option>
+ <option>
+ <name>OCJLinkTraceSource</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCJLinkTraceSourceDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCJLinkDeviceName</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>LMIFTDI_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>2</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>LmiftdiSpeed</name>
+ <state>500</state>
+ </option>
+ <option>
+ <name>CCLmiftdiDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCLmiftdiLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCLmiFtdiInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCLmiFtdiInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>PEMICRO_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>3</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCJPEMicroShowSettings</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>DoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>LogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>STLINK_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>4</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCSTLinkInterfaceRadio</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCSTLinkInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkResetList</name>
+ <version>3</version>
+ <state>4</state>
+ </option>
+ <option>
+ <name>CCCpuClockEdit</name>
+ <state>32.0</state>
+ </option>
+ <option>
+ <name>CCSwoClockAuto</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSwoClockEdit</name>
+ <state>2000</state>
+ </option>
+ <option>
+ <name>DoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>LogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCSTLinkDoUpdateBreakpoints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkUpdateBreakpoints</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchMMERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchNOCPERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchCHRERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchSTATERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchBUSERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchINTERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchSFERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchHARDERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkUsbSerialNo</name>
+ <state />
+ </option>
+ <option>
+ <name>CCSTLinkUsbSerialNoSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkJtagSpeedList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkDAPNumber</name>
+ <state />
+ </option>
+ <option>
+ <name>CCSTLinkDebugAccessPortRadio</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>THIRDPARTY_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CThirdPartyDriverDll</name>
+ <state>###Uninitialized###</state>
+ </option>
+ <option>
+ <name>CThirdPartyLogFileCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CThirdPartyLogFileEditB</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>TIFET_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>1</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCMSPFetResetList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetTargetVccTypeDefault</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetTargetVoltage</name>
+ <state>###Uninitialized###</state>
+ </option>
+ <option>
+ <name>CCMSPFetVCCDefault</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCMSPFetTargetSettlingtime</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetRadioJtagSpeedType</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCMSPFetConnection</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetUsbComPort</name>
+ <state>Automatic</state>
+ </option>
+ <option>
+ <name>CCMSPFetAllowAccessToBSL</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCMSPFetRadioEraseFlash</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>XDS100_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>6</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>TIPackageOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>TIPackage</name>
+ <state />
+ </option>
+ <option>
+ <name>BoardFile</name>
+ <state />
+ </option>
+ <option>
+ <name>DoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>LogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCXds100BreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100DoUpdateBreakpoints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100UpdateBreakpoints</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>CCXds100CatchReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchUndef</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchSWI</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchData</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchPrefetch</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchIRQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchFIQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchMMERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchNOCPERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchCHRERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchSTATERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchBUSERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchINTERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchSFERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchHARDERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CpuClockEdit</name>
+ <state />
+ </option>
+ <option>
+ <name>CCXds100SwoClockAuto</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100SwoClockEdit</name>
+ <state>1000</state>
+ </option>
+ <option>
+ <name>CCXds100HWResetDelay</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100ResetList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100UsbSerialNo</name>
+ <state />
+ </option>
+ <option>
+ <name>CCXds100UsbSerialNoSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100JtagSpeedList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100InterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100InterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100ProbeList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100SWOPortRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100SWOPort</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <debuggerPlugins>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\Mbed\MbedArmPlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin</file>
+ <loadFlag>1</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\TargetAccessServer\TargetAccessServer.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ </debuggerPlugins>
+ </configuration>
+</project>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/EWARM/Thread_Ota_Server.ewp b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/EWARM/Thread_Ota_Server.ewp
new file mode 100644
index 000000000..9ab643a6f
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/EWARM/Thread_Ota_Server.ewp
@@ -0,0 +1,1304 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <fileVersion>3</fileVersion>
+ <configuration>
+ <name>Thread_Ota_Server</name>
+ <toolchain>
+ <name>ARM</name>
+ </toolchain>
+ <debug>1</debug>
+ <settings>
+ <name>General</name>
+ <archiveVersion>3</archiveVersion>
+ <data>
+ <version>30</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>ExePath</name>
+ <state>Thread_Ota_Server/Exe</state>
+ </option>
+ <option>
+ <name>ObjPath</name>
+ <state>Thread_Ota_Server/Obj</state>
+ </option>
+ <option>
+ <name>ListPath</name>
+ <state>Thread_Ota_Server/List</state>
+ </option>
+ <option>
+ <name>GEndianMode</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>Input description</name>
+ <state>Full formatting, with multibyte support.</state>
+ </option>
+ <option>
+ <name>Output description</name>
+ <state>Full formatting, with multibyte support.</state>
+ </option>
+ <option>
+ <name>GOutputBinary</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGCoreOrChip</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>GRuntimeLibSelect</name>
+ <version>0</version>
+ <state>2</state>
+ </option>
+ <option>
+ <name>GRuntimeLibSelectSlave</name>
+ <version>0</version>
+ <state>2</state>
+ </option>
+ <option>
+ <name>RTDescription</name>
+ <state>Use the full configuration of the C/C++ runtime library. Full locale interface, C locale, file descriptor support, multibytes in printf and scanf, and hex floats in strtod.</state>
+ </option>
+ <option>
+ <name>OGProductVersion</name>
+ <state>4.41A</state>
+ </option>
+ <option>
+ <name>OGLastSavedByProductVersion</name>
+ <state>8.20.2.14834</state>
+ </option>
+ <option>
+ <name>GeneralEnableMisra</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GeneralMisraVerbose</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGChipSelectEditMenu</name>
+ <state>STM32WB55RG ST STM32WB55RG</state>
+ </option>
+ <option>
+ <name>GenLowLevelInterface</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>GEndianModeBE</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OGBufferedTerminalOutput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GenStdoutInterface</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GeneralMisraRules98</name>
+ <version>0</version>
+ <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
+ </option>
+ <option>
+ <name>GeneralMisraVer</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GeneralMisraRules04</name>
+ <version>0</version>
+ <state>011111111111111110111111111111011111111111111011110100111111111111111111111111111111111111111111101111111111111011111111111111111111111111111</state>
+ </option>
+ <option>
+ <name>RTConfigPath2</name>
+ <state>$TOOLKIT_DIR$\INC\c\DLib_Config_Full.h</state>
+ </option>
+ <option>
+ <name>GBECoreSlave</name>
+ <version>26</version>
+ <state>39</state>
+ </option>
+ <option>
+ <name>OGUseCmsis</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGUseCmsisDspLib</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GRuntimeLibThreads</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CoreVariant</name>
+ <version>26</version>
+ <state>39</state>
+ </option>
+ <option>
+ <name>GFPUDeviceSlave</name>
+ <state>STM32WB55RG ST STM32WB55RG</state>
+ </option>
+ <option>
+ <name>FPU2</name>
+ <version>0</version>
+ <state>4</state>
+ </option>
+ <option>
+ <name>NrRegs</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>NEON</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GFPUCoreSlave2</name>
+ <version>26</version>
+ <state>39</state>
+ </option>
+ <option>
+ <name>OGCMSISPackSelectDevice</name>
+ </option>
+ <option>
+ <name>OgLibHeap</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGLibAdditionalLocale</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGPrintfVariant</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OGPrintfMultibyteSupport</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OGScanfVariant</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OGScanfMultibyteSupport</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>GenLocaleTags</name>
+ <state></state>
+ </option>
+ <option>
+ <name>GenLocaleDisplayOnly</name>
+ <state></state>
+ </option>
+ <option>
+ <name>DSPExtension</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>TrustZone</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>ICCARM</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>34</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CCOptimizationNoSizeConstraints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCDefines</name>
+ <state>OPENTHREAD_CONFIG_FILE=&lt;openthread_api_config_ftd.h&gt;</state>
+ <state>USE_HAL_DRIVER</state>
+ <state>STM32WB55xx</state>
+ <state>USE_STM32WBXX_NUCLEO</state>
+ <state>THREAD_WB</state>
+ </option>
+ <option>
+ <name>CCPreprocFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPreprocComments</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPreprocLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListCFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListCMnemonics</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListCMessages</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListAssFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListAssSource</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCEnableRemarks</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCDiagSuppress</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCDiagRemark</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCDiagWarning</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCDiagError</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCObjPrefix</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCAllowList</name>
+ <version>1</version>
+ <state>11111110</state>
+ </option>
+ <option>
+ <name>CCDebugInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IEndianMode</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IExtraOptionsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IExtraOptions</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCLangConformance</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSignedPlainChar</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCRequirePrototypes</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCDiagWarnAreErr</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCompilerRuntimeInfo</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IFpuProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OutputFile</name>
+ <state>$FILE_BNAME$.o</state>
+ </option>
+ <option>
+ <name>CCLibConfigHeader</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>PreInclude</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CompilerMisraOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCIncludePath2</name>
+ <state>$PROJ_DIR$/../Core/Inc</state>
+ <state>$PROJ_DIR$/../STM32_WPAN/App</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/BSP/P-NUCLEO-WB55.Nucleo</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/STM32WBxx_HAL_Driver/Inc</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/STM32WBxx_HAL_Driver/Inc/Legacy</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/utilities</state>
+ <state>$PROJ_DIR$/../../../../../../Utilities/lpm/tiny_lpm</state>
+ <state>$PROJ_DIR$/../../../../../../Utilities/sequencer</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/CMSIS/Device/ST/STM32WBxx/Include</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/thread/openthread/core/openthread_api</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/thread/openthread/stack/include</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/thread/openthread/stack/include/openthread</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/thread/openthread/stack/include/openthread/platform</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/CMSIS/Include</state>
+ </option>
+ <option>
+ <name>CCStdIncCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCodeSection</name>
+ <state>.text</state>
+ </option>
+ <option>
+ <name>IProcessorMode2</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCOptLevel</name>
+ <state>3</state>
+ </option>
+ <option>
+ <name>CCOptStrategy</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCOptLevelSlave</name>
+ <state>3</state>
+ </option>
+ <option>
+ <name>CompilerMisraRules98</name>
+ <version>0</version>
+ <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
+ </option>
+ <option>
+ <name>CompilerMisraRules04</name>
+ <version>0</version>
+ <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
+ </option>
+ <option>
+ <name>CCPosIndRopi</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPosIndRwpi</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPosIndNoDynInit</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccLang</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccCDialect</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IccAllowVLA</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccStaticDestr</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccCppInlineSemantics</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccCmsis</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IccFloatSemantics</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCNoLiteralPool</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCOptStrategySlave</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCGuardCalls</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCEncSource</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCEncOutput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCEncOutputBom</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCEncInput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccExceptions2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccRTTI2</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>AARM</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>10</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>AObjPrefix</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AEndian</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>ACaseSensitivity</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>MacroChars</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AWarnEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AWarnWhat</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AWarnOne</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AWarnRange1</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AWarnRange2</name>
+ <state></state>
+ </option>
+ <option>
+ <name>ADebug</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AltRegisterNames</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ADefines</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AList</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AListHeader</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AListing</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>Includes</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacDefs</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacExps</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>MacExec</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OnlyAssed</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MultiLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>PageLengthCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>PageLength</name>
+ <state>80</state>
+ </option>
+ <option>
+ <name>TabSpacing</name>
+ <state>8</state>
+ </option>
+ <option>
+ <name>AXRef</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AXRefDefines</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AXRefInternal</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AXRefDual</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AFpuProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AOutputFile</name>
+ <state>$FILE_BNAME$.o</state>
+ </option>
+ <option>
+ <name>ALimitErrorsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ALimitErrorsEdit</name>
+ <state>100</state>
+ </option>
+ <option>
+ <name>AIgnoreStdInclude</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AUserIncludes</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AExtraOptionsCheckV2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AExtraOptionsV2</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AsmNoLiteralPool</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>OBJCOPY</name>
+ <archiveVersion>0</archiveVersion>
+ <data>
+ <version>1</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OOCOutputFormat</name>
+ <version>3</version>
+ <state>3</state>
+ </option>
+ <option>
+ <name>OCOutputOverride</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OOCOutputFile</name>
+ <state>Thread_Ota_Server.bin</state>
+ </option>
+ <option>
+ <name>OOCCommandLineProducer</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OOCObjCopyEnable</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>CUSTOM</name>
+ <archiveVersion>3</archiveVersion>
+ <data>
+ <extensions></extensions>
+ <cmdline></cmdline>
+ <hasPrio>0</hasPrio>
+ </data>
+ </settings>
+ <settings>
+ <name>BICOMP</name>
+ <archiveVersion>0</archiveVersion>
+ <data />
+ </settings>
+ <settings>
+ <name>BUILDACTION</name>
+ <archiveVersion>1</archiveVersion>
+ <data>
+ <prebuild></prebuild>
+ <postbuild></postbuild>
+ </data>
+ </settings>
+ <settings>
+ <name>ILINK</name>
+ <archiveVersion>0</archiveVersion>
+ <data>
+ <version>20</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>IlinkLibIOConfig</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>XLinkMisraHandler</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkInputFileSlave</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkOutputFile</name>
+ <state>Thread_Ota_Server.out</state>
+ </option>
+ <option>
+ <name>IlinkDebugInfoEnable</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkKeepSymbols</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinaryFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinarySymbol</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinarySegment</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinaryAlign</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkDefines</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkConfigDefines</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkMapFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkLogFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogInitialization</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogModule</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogSection</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogVeneer</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkIcfOverride</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkIcfFile</name>
+ <state>$PROJ_DIR$\stm32wb55xx_flash_cm4.icf</state>
+ </option>
+ <option>
+ <name>IlinkIcfFileSlave</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkEnableRemarks</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkSuppressDiags</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkTreatAsRem</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkTreatAsWarn</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkTreatAsErr</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkWarningsAreErrors</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkUseExtraOptions</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkExtraOptions</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkLowLevelInterfaceSlave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkAutoLibEnable</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkAdditionalLibs</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkOverrideProgramEntryLabel</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkProgramEntryLabelSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkProgramEntryLabel</name>
+ <state>__iar_program_start</state>
+ </option>
+ <option>
+ <name>DoFill</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>FillerByte</name>
+ <state>0xFF</state>
+ </option>
+ <option>
+ <name>FillerStart</name>
+ <state>0x0</state>
+ </option>
+ <option>
+ <name>FillerEnd</name>
+ <state>0x0</state>
+ </option>
+ <option>
+ <name>CrcSize</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcAlign</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcPoly</name>
+ <state>0x11021</state>
+ </option>
+ <option>
+ <name>CrcCompl</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CrcBitOrder</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CrcInitialValue</name>
+ <state>0x0</state>
+ </option>
+ <option>
+ <name>DoCrc</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkBE8Slave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkBufferedTerminalOutput</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkStdoutInterfaceSlave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcFullSize</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkIElfToolPostProcess</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogAutoLibSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogRedirSymbols</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogUnusedFragments</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkCrcReverseByteOrder</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkCrcUseAsInput</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptInline</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkOptExceptionsAllow</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptExceptionsForce</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkCmsis</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptMergeDuplSections</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkOptUseVfe</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptForceVfe</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkStackAnalysisEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkStackControlFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkStackCallGraphFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CrcAlgorithm</name>
+ <version>1</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcUnitSize</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkThreadsSlave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkLogCallGraph</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkIcfFile_AltDefault</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkEncInput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkEncOutput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkEncOutputBom</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkHeapSelect</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkLocaleSelect</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>IARCHIVE</name>
+ <archiveVersion>0</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>IarchiveInputs</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IarchiveOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IarchiveOutput</name>
+ <state>###Unitialized###</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>BILINK</name>
+ <archiveVersion>0</archiveVersion>
+ <data />
+ </settings>
+ </configuration>
+ <group>
+ <name>Application</name>
+ <group>
+ <name>EWARM</name>
+ <file>
+ <name>$PROJ_DIR$\startup_stm32wb55xx_cm4.s</name>
+ </file>
+ </group>
+ <group>
+ <name>User</name>
+ <group>
+ <name>Core</name>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\app_entry.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\hw_timerserver.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\hw_uart.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\main.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\stm32_lpm_if.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\stm32wbxx_hal_msp.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\stm32wbxx_it.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\stm_logging.c</name>
+ </file>
+ </group>
+ <group>
+ <name>STM32_WPAN</name>
+ <group>
+ <name>App</name>
+ <file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\App\app_thread.c</name>
+ </file>
+ </group>
+ <group>
+ <name>Target</name>
+ <file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\Target\hw_ipcc.c</name>
+ </file>
+ </group>
+ </group>
+ </group>
+ </group>
+ <group>
+ <name>Drivers</name>
+ <group>
+ <name>BSP</name>
+ <group>
+ <name>P-NUCLEO-WB55.Nucleo</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\BSP\P-NUCLEO-WB55.Nucleo\stm32wbxx_nucleo.c</name>
+ </file>
+ </group>
+ </group>
+ <group>
+ <name>CMSIS</name>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\system_stm32wbxx.c</name>
+ </file>
+ </group>
+ <group>
+ <name>STM32WBxx_HAL_Driver</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_cortex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_dma.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_dma_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_exti.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_flash.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_flash_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_gpio.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_hsem.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_pwr.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_pwr_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rcc.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rcc_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rtc.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rtc_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_tim.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_tim_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_uart.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_uart_ex.c</name>
+ </file>
+ </group>
+ </group>
+ <group>
+ <name>Middlewares</name>
+ <group>
+ <name>STM32_WPAN</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\channel_manager.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\channel_monitor.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\child_supervision.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\coap.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\commissioner.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\crypto.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\dataset.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\dataset_ftd.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\utilities\dbg_trace.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\dhcp6_client.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\dhcp6_server.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\diag.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\dns.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\icmp6.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\instance.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\ip6.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\jam_detection.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\joiner.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\link.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\link_raw.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\message.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\netdata.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\openthread.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\openthread_api_wb.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\utilities\otp.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\radio.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\server.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\shci\shci.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\shci_tl.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\shci_tl_if.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\utilities\stm_list.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\utilities\stm_queue.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\tasklet.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\thread.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\thread_ftd.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\tl_mbox.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\tl_thread_hci.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\thread\openthread\core\openthread_api\udp.c</name>
+ </file>
+ </group>
+ </group>
+ <group>
+ <name>Utilities</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Utilities\lpm\tiny_lpm\stm32_lpm.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Utilities\sequencer\stm32_seq.c</name>
+ </file>
+ </group>
+</project>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/EWARM/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/EWARM/startup_stm32wb55xx_cm4.s
new file mode 100644
index 000000000..1f886ff59
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/EWARM/startup_stm32wb55xx_cm4.s
@@ -0,0 +1,517 @@
+;******************************************************************************
+;* File Name : startup_stm32wb55xx_cm4.s
+;* Author : MCD Application Team
+;* Description : M4 core vector table of the STM32WB55xx devices for the
+;* IAR (EWARM) toolchain.
+;*
+;* This module performs:
+;* - Set the initial SP
+;* - Set the initial PC == _iar_program_start,
+;* - Set the vector table entries with the exceptions ISR
+;* address.
+;* - Branches to main in the C library (which eventually
+;* calls main()).
+;* After Reset the Cortex-M4 processor is in Thread mode,
+;* priority is Privileged, and the Stack is set to Main.
+;******************************************************************************
+;* @attention
+;*
+;* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+;* All rights reserved.</center></h2>
+;*
+;* This software component is licensed by ST under BSD 3-Clause license,
+;* the "License"; You may not use this file except in compliance with the
+;* License. You may obtain a copy of the License at:
+;* opensource.org/licenses/BSD-3-Clause
+;*
+;******************************************************************************
+;
+;
+; The modules in this file are included in the libraries, and may be replaced
+; by any user-defined modules that define the PUBLIC symbol _program_start or
+; a user defined start symbol.
+; To override the cstartup defined in the library, simply add your modified
+; version to the workbench project.
+;
+; The vector table is normally located at address 0.
+; When debugging in RAM, it can be located in RAM, aligned to at least 2^6.
+; The name "__vector_table" has special meaning for C-SPY:
+; it is where the SP start value is found, and the NVIC vector
+; table register (VTOR) is initialized to this address if != 0.
+;
+; Cortex-M version
+;
+
+ MODULE ?cstartup
+
+ ;; Forward declaration of sections.
+ SECTION CSTACK:DATA:NOROOT(3)
+
+ SECTION .intvec:CODE:NOROOT(2)
+
+ EXTERN __iar_program_start
+ EXTERN SystemInit
+ PUBLIC __vector_table
+
+ DATA
+__vector_table
+ DCD sfe(CSTACK)
+ DCD Reset_Handler ; Reset Handler
+
+ DCD NMI_Handler ; NMI Handler
+ DCD HardFault_Handler ; Hard Fault Handler
+ DCD MemManage_Handler ; MPU Fault Handler
+ DCD BusFault_Handler ; Bus Fault Handler
+ DCD UsageFault_Handler ; Usage Fault Handler
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD SVC_Handler ; SVCall Handler
+ DCD DebugMon_Handler ; Debug Monitor Handler
+ DCD 0 ; Reserved
+ DCD PendSV_Handler ; PendSV Handler
+ DCD SysTick_Handler ; SysTick Handler
+
+ ; External Interrupts
+ DCD WWDG_IRQHandler ; Window WatchDog
+ DCD PVD_PVM_IRQHandler ; PVD and PVM Interrupt
+ DCD TAMP_STAMP_LSECSS_IRQHandler ; RTC Tamper, TimeStamp Interrupts and LSECSS Interrupts
+ DCD RTC_WKUP_IRQHandler ; RTC Wakeup Interrupt
+ DCD FLASH_IRQHandler ; FLASH global Interrupt
+ DCD RCC_IRQHandler ; RCC Interrupt
+ DCD EXTI0_IRQHandler ; EXTI Line 0 Interrupt
+ DCD EXTI1_IRQHandler ; EXTI Line 1 Interrupt
+ DCD EXTI2_IRQHandler ; EXTI Line 2 Interrupt
+ DCD EXTI3_IRQHandler ; EXTI Line 3 Interrup
+ DCD EXTI4_IRQHandler ; EXTI Line 4 Interrupt
+ DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 Interrupt
+ DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2 Interrupt
+ DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3 Interrupt
+ DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4 Interrupt
+ DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5 Interrupt
+ DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6 Interrupt
+ DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7 Interrupt
+ DCD ADC1_IRQHandler ; ADC1 Interrupt
+ DCD USB_HP_IRQHandler ; USB High Priority Interrupt
+ DCD USB_LP_IRQHandler ; USB Low Priority Interrupt
+ DCD C2SEV_PWR_C2H_IRQHandler ; CPU M0+ SEV Interrupt
+ DCD COMP_IRQHandler ; COMP1 and COMP2 Interrupts
+ DCD EXTI9_5_IRQHandler ; EXTI Lines [9:5] Interrupt
+ DCD TIM1_BRK_IRQHandler ; TIM1 Break Interrupt
+ DCD TIM1_UP_TIM16_IRQHandler ; TIM1 Update and TIM16 global Interrupts
+ DCD TIM1_TRG_COM_TIM17_IRQHandler ; TIM1 Trigger and Communication and TIM17 global Interrupts
+ DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare Interrupt
+ DCD TIM2_IRQHandler ; TIM2 Global Interrupt
+ DCD PKA_IRQHandler ; PKA Interrupt
+ DCD I2C1_EV_IRQHandler ; I2C1 Event Interrupt
+ DCD I2C1_ER_IRQHandler ; I2C1 Error Interrupt
+ DCD I2C3_EV_IRQHandler ; I2C3 Event Interrupt
+ DCD I2C3_ER_IRQHandler ; I2C3 Error Interrupt
+ DCD SPI1_IRQHandler ; SPI1 Interrupt
+ DCD SPI2_IRQHandler ; SPI2 Interrupt
+ DCD USART1_IRQHandler ; USART1 Interrupt
+ DCD LPUART1_IRQHandler ; LPUART1 Interrupt
+ DCD SAI1_IRQHandler ; SAI Interrupt
+ DCD TSC_IRQHandler ; TSC Interrupt
+ DCD EXTI15_10_IRQHandler ; EXTI Lines1[15:10 ]Interrupts
+ DCD RTC_Alarm_IRQHandler ; RTC Alarms (A and B) Interrupt
+ DCD CRS_IRQHandler ; CRS interrupt
+ DCD PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler ; WKUP Interrupt from PWR
+ DCD IPCC_C1_RX_IRQHandler ; IPCC CPU1 RX occupied interrupt
+ DCD IPCC_C1_TX_IRQHandler ; IPCC CPU1 RX free interrupt
+ DCD HSEM_IRQHandler ; HSEM0 Interrupt
+ DCD LPTIM1_IRQHandler ; LPTIM1 Interrupt
+ DCD LPTIM2_IRQHandler ; LPTIM2 Interrupt
+ DCD LCD_IRQHandler ; LCD Interrupt
+ DCD QUADSPI_IRQHandler ; QUADSPI Interrupt
+ DCD AES1_IRQHandler ; AES1 Interrupt
+ DCD AES2_IRQHandler ; AES2 Interrupt
+ DCD RNG_IRQHandler ; RNG1 Interrupt
+ DCD FPU_IRQHandler ; FPU Interrupt
+ DCD DMA2_Channel1_IRQHandler ; DMA2 Channel 1 Interrupt
+ DCD DMA2_Channel2_IRQHandler ; DMA2 Channel 2 Interrupt
+ DCD DMA2_Channel3_IRQHandler ; DMA2 Channel 3 Interrupt
+ DCD DMA2_Channel4_IRQHandler ; DMA2 Channel 4 Interrupt
+ DCD DMA2_Channel5_IRQHandler ; DMA2 Channel 5 Interrupt
+ DCD DMA2_Channel6_IRQHandler ; DMA2 Channel 6 Interrupt
+ DCD DMA2_Channel7_IRQHandler ; DMA2 Channel 7 Interrupt
+ DCD DMAMUX1_OVR_IRQHandler ; DMAMUX overrun Interrupt
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Default interrupt handlers.
+;;
+ THUMB
+
+ PUBWEAK Reset_Handler
+ SECTION .text:CODE:NOROOT:REORDER(2)
+Reset_Handler
+ LDR R0, =SystemInit
+ BLX R0
+ LDR R0, =__iar_program_start
+ BX R0
+
+ PUBWEAK NMI_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+NMI_Handler
+ B NMI_Handler
+
+ PUBWEAK HardFault_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+HardFault_Handler
+ B HardFault_Handler
+
+ PUBWEAK MemManage_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+MemManage_Handler
+ B MemManage_Handler
+
+ PUBWEAK BusFault_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+BusFault_Handler
+ B BusFault_Handler
+
+ PUBWEAK UsageFault_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+UsageFault_Handler
+ B UsageFault_Handler
+
+ PUBWEAK SVC_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SVC_Handler
+ B SVC_Handler
+
+ PUBWEAK DebugMon_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DebugMon_Handler
+ B DebugMon_Handler
+
+ PUBWEAK PendSV_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+PendSV_Handler
+ B PendSV_Handler
+
+ PUBWEAK SysTick_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SysTick_Handler
+ B SysTick_Handler
+
+ PUBWEAK WWDG_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+WWDG_IRQHandler
+ B WWDG_IRQHandler
+
+ PUBWEAK PVD_PVM_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+PVD_PVM_IRQHandler
+ B PVD_PVM_IRQHandler
+
+ PUBWEAK TAMP_STAMP_LSECSS_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TAMP_STAMP_LSECSS_IRQHandler
+ B TAMP_STAMP_LSECSS_IRQHandler
+
+ PUBWEAK RTC_WKUP_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+RTC_WKUP_IRQHandler
+ B RTC_WKUP_IRQHandler
+
+ PUBWEAK FLASH_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+FLASH_IRQHandler
+ B FLASH_IRQHandler
+
+ PUBWEAK RCC_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+RCC_IRQHandler
+ B RCC_IRQHandler
+
+ PUBWEAK EXTI0_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI0_IRQHandler
+ B EXTI0_IRQHandler
+
+ PUBWEAK EXTI1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI1_IRQHandler
+ B EXTI1_IRQHandler
+
+ PUBWEAK EXTI2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI2_IRQHandler
+ B EXTI2_IRQHandler
+
+ PUBWEAK EXTI3_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI3_IRQHandler
+ B EXTI3_IRQHandler
+
+ PUBWEAK EXTI4_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI4_IRQHandler
+ B EXTI4_IRQHandler
+
+ PUBWEAK DMA1_Channel1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel1_IRQHandler
+ B DMA1_Channel1_IRQHandler
+
+ PUBWEAK DMA1_Channel2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel2_IRQHandler
+ B DMA1_Channel2_IRQHandler
+
+ PUBWEAK DMA1_Channel3_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel3_IRQHandler
+ B DMA1_Channel3_IRQHandler
+
+ PUBWEAK DMA1_Channel4_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel4_IRQHandler
+ B DMA1_Channel4_IRQHandler
+
+ PUBWEAK DMA1_Channel5_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel5_IRQHandler
+ B DMA1_Channel5_IRQHandler
+
+ PUBWEAK DMA1_Channel6_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel6_IRQHandler
+ B DMA1_Channel6_IRQHandler
+
+ PUBWEAK DMA1_Channel7_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel7_IRQHandler
+ B DMA1_Channel7_IRQHandler
+
+ PUBWEAK ADC1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+ADC1_IRQHandler
+ B ADC1_IRQHandler
+
+ PUBWEAK USB_HP_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+USB_HP_IRQHandler
+ B USB_HP_IRQHandler
+
+ PUBWEAK USB_LP_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+USB_LP_IRQHandler
+ B USB_LP_IRQHandler
+
+ PUBWEAK C2SEV_PWR_C2H_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+C2SEV_PWR_C2H_IRQHandler
+ B C2SEV_PWR_C2H_IRQHandler
+
+ PUBWEAK COMP_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+COMP_IRQHandler
+ B COMP_IRQHandler
+
+ PUBWEAK EXTI9_5_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI9_5_IRQHandler
+ B EXTI9_5_IRQHandler
+
+ PUBWEAK TIM1_BRK_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM1_BRK_IRQHandler
+ B TIM1_BRK_IRQHandler
+
+ PUBWEAK TIM1_UP_TIM16_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM1_UP_TIM16_IRQHandler
+ B TIM1_UP_TIM16_IRQHandler
+
+ PUBWEAK TIM1_TRG_COM_TIM17_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM1_TRG_COM_TIM17_IRQHandler
+ B TIM1_TRG_COM_TIM17_IRQHandler
+
+ PUBWEAK TIM1_CC_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM1_CC_IRQHandler
+ B TIM1_CC_IRQHandler
+
+ PUBWEAK TIM2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM2_IRQHandler
+ B TIM2_IRQHandler
+
+ PUBWEAK PKA_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+PKA_IRQHandler
+ B PKA_IRQHandler
+
+ PUBWEAK I2C1_EV_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+I2C1_EV_IRQHandler
+ B I2C1_EV_IRQHandler
+
+ PUBWEAK I2C1_ER_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+I2C1_ER_IRQHandler
+ B I2C1_ER_IRQHandler
+
+ PUBWEAK I2C3_EV_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+I2C3_EV_IRQHandler
+ B I2C3_EV_IRQHandler
+
+ PUBWEAK I2C3_ER_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+I2C3_ER_IRQHandler
+ B I2C3_ER_IRQHandler
+
+ PUBWEAK SPI1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SPI1_IRQHandler
+ B SPI1_IRQHandler
+
+ PUBWEAK SPI2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SPI2_IRQHandler
+ B SPI2_IRQHandler
+
+ PUBWEAK USART1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+USART1_IRQHandler
+ B USART1_IRQHandler
+
+ PUBWEAK LPUART1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+LPUART1_IRQHandler
+ B LPUART1_IRQHandler
+
+ PUBWEAK SAI1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SAI1_IRQHandler
+ B SAI1_IRQHandler
+
+ PUBWEAK TSC_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TSC_IRQHandler
+ B TSC_IRQHandler
+
+ PUBWEAK EXTI15_10_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI15_10_IRQHandler
+ B EXTI15_10_IRQHandler
+
+ PUBWEAK RTC_Alarm_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+RTC_Alarm_IRQHandler
+ B RTC_Alarm_IRQHandler
+
+ PUBWEAK CRS_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+CRS_IRQHandler
+ B CRS_IRQHandler
+
+ PUBWEAK PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler
+ B PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler
+
+ PUBWEAK IPCC_C1_RX_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+IPCC_C1_RX_IRQHandler
+ B IPCC_C1_RX_IRQHandler
+
+ PUBWEAK IPCC_C1_TX_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+IPCC_C1_TX_IRQHandler
+ B IPCC_C1_TX_IRQHandler
+
+ PUBWEAK HSEM_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+HSEM_IRQHandler
+ B HSEM_IRQHandler
+
+ PUBWEAK LPTIM1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+LPTIM1_IRQHandler
+ B LPTIM1_IRQHandler
+
+ PUBWEAK LPTIM2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+LPTIM2_IRQHandler
+ B LPTIM2_IRQHandler
+
+ PUBWEAK LCD_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+LCD_IRQHandler
+ B LCD_IRQHandler
+
+ PUBWEAK QUADSPI_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+QUADSPI_IRQHandler
+ B QUADSPI_IRQHandler
+
+ PUBWEAK AES1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+AES1_IRQHandler
+ B AES1_IRQHandler
+
+ PUBWEAK AES2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+AES2_IRQHandler
+ B AES2_IRQHandler
+
+ PUBWEAK RNG_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+RNG_IRQHandler
+ B RNG_IRQHandler
+
+ PUBWEAK FPU_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+FPU_IRQHandler
+ B FPU_IRQHandler
+
+ PUBWEAK DMA2_Channel1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel1_IRQHandler
+ B DMA2_Channel1_IRQHandler
+
+ PUBWEAK DMA2_Channel2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel2_IRQHandler
+ B DMA2_Channel2_IRQHandler
+
+ PUBWEAK DMA2_Channel3_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel3_IRQHandler
+ B DMA2_Channel3_IRQHandler
+
+ PUBWEAK DMA2_Channel4_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel4_IRQHandler
+ B DMA2_Channel4_IRQHandler
+
+ PUBWEAK DMA2_Channel5_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel5_IRQHandler
+ B DMA2_Channel5_IRQHandler
+
+ PUBWEAK DMA2_Channel6_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel6_IRQHandler
+ B DMA2_Channel6_IRQHandler
+
+ PUBWEAK DMA2_Channel7_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel7_IRQHandler
+ B DMA2_Channel7_IRQHandler
+
+ PUBWEAK DMAMUX1_OVR_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMAMUX1_OVR_IRQHandler
+ B DMAMUX1_OVR_IRQHandler
+
+ END
+
+;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE*****
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/EWARM/stm32wb55xx_flash_cm4.icf b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/EWARM/stm32wb55xx_flash_cm4.icf
new file mode 100644
index 000000000..5f36da686
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/EWARM/stm32wb55xx_flash_cm4.icf
@@ -0,0 +1,40 @@
+/*###ICF### Section handled by ICF editor, don't touch! ****/
+/*-Editor annotation file-*/
+/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
+/*-Specials-*/
+define symbol __ICFEDIT_intvec_start__ = 0x08000000;
+/*-Memory Regions-*/
+/***** FLASH Part dedicated to M4 *****/
+define symbol __ICFEDIT_region_ROM_start__ = 0x08000000;
+define symbol __ICFEDIT_region_ROM_end__ = 0x0807FFFF;
+define symbol __ICFEDIT_region_RAM_start__ = 0x20000004;
+define symbol __ICFEDIT_region_RAM_end__ = 0x2002FFFF;
+/*-Sizes-*/
+define symbol __ICFEDIT_size_cstack__ = 0x1000;
+define symbol __ICFEDIT_size_heap__ = 0x400;
+/**** End of ICF editor section. ###ICF###*/
+
+define symbol __ICFEDIT_region_RAM_SHARED_start__ = 0x20030000;
+define symbol __ICFEDIT_region_RAM_SHARED_end__ = 0x200327FF;
+
+define memory mem with size = 4G;
+define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
+define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
+define region RAM_SHARED_region = mem:[from __ICFEDIT_region_RAM_SHARED_start__ to __ICFEDIT_region_RAM_SHARED_end__];
+
+define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
+define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
+
+/* MB_MEM1 and MB_MEM2 are sections reserved to mailbox communication. It is placed in the shared memory */
+initialize by copy { readwrite };
+do not initialize { section .noinit,
+ section MAPPING_TABLE,
+ section MB_MEM1 };
+
+place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
+
+place in ROM_region { readonly };
+place in RAM_region { readwrite,block CSTACK, block HEAP };
+place in RAM_SHARED_region { first section MAPPING_TABLE};
+place in RAM_SHARED_region { section MB_MEM1};
+place in RAM_SHARED_region { section MB_MEM2};
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/EWARM/stm32wb55xx_sram_cm4.icf b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/EWARM/stm32wb55xx_sram_cm4.icf
new file mode 100644
index 000000000..36cf3e51a
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/EWARM/stm32wb55xx_sram_cm4.icf
@@ -0,0 +1,39 @@
+/*###ICF### Section handled by ICF editor, don't touch! ****/
+/*-Editor annotation file-*/
+/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
+/*-Specials-*/
+define symbol __ICFEDIT_intvec_start__ = 0x20000000;
+/*-Memory Regions-*/
+/***** RAM dedicated to M4 *****/
+define symbol __ICFEDIT_region_ROM_start__ = 0x20000000;
+define symbol __ICFEDIT_region_ROM_end__ = 0x20017FFF;
+
+define symbol __ICFEDIT_region_RAM_start__ = 0x20018000 ;
+define symbol __ICFEDIT_region_RAM_end__ = 0x2002FFFF ;
+
+/***** RAM2a *****/
+define symbol __ICFEDIT_region_RAM_SHARED_start__ = 0x20030000 ;
+define symbol __ICFEDIT_region_RAM_SHARED_end__ = 0x20037FFF ;
+
+/*-Sizes-*/
+define symbol __ICFEDIT_size_cstack__ = 0x1000;
+define symbol __ICFEDIT_size_heap__ = 0x400;
+/**** End of ICF editor section. ###ICF###*/
+
+
+define memory mem with size = 4G;
+define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
+define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
+
+
+define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
+define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
+
+initialize by copy { readwrite };
+do not initialize { section .noinit };
+
+place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
+
+place in ROM_region { readonly };
+place in RAM_region { readwrite,
+ block CSTACK, block HEAP };
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/STM32_WPAN/App/app_thread.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/STM32_WPAN/App/app_thread.c
new file mode 100644
index 000000000..c183ab869
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/STM32_WPAN/App/app_thread.c
@@ -0,0 +1,1473 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : App/app_thread.c
+ * Description : Thread Application.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "utilities_common.h"
+#include "app_entry.h"
+#include "dbg_trace.h"
+#include "app_thread.h"
+#include "stm32wbxx_core_interface_def.h"
+#include "openthread_api_wb.h"
+#include "shci.h"
+#include "stm_logging.h"
+#include "app_conf.h"
+#include "stm32_lpm.h"
+#include "stm32_seq.h"
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+#include "vcp.h"
+#include "vcp_conf.h"
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+
+/* Private includes -----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN PTD */
+/**
+ * @brief APP_THREAD Status structures definition
+ */
+typedef enum
+{
+ APP_THREAD_OK = 0x00,
+ APP_THREAD_ERROR = 0x01,
+} APP_THREAD_StatusTypeDef;
+/* USER CODE END PTD */
+
+/* Private defines -----------------------------------------------------------*/
+#define C_SIZE_CMD_STRING 256U
+#define C_PANID 0x1111U
+#define C_CHANNEL_NB 15U
+
+/* USER CODE BEGIN PD */
+#define C_RESSOURCE_FUOTA_PROVISIONING "FUOTA_PROVISIONING"
+#define C_RESSOURCE_FUOTA_PARAMETERS "FUOTA_PARAMETERS"
+#define C_RESSOURCE_FUOTA_SEND "FUOTA_SEND"
+
+/* Following CoAP ressource is requested to reboot on Thread_Ota application */
+#define C_RESSOURCE_FUOTA_REBOOT "FUOTA_REBOOT"
+
+/* Keyword found at the end of Thread Ota compatible application binaries */
+#define FUOTA_MAGIC_KEYWORD_APP 0x94448A29
+
+/* Keyword found at the end of encrypted Copro Wireless binaries */
+#define FUOTA_MAGIC_KEYWORD_COPRO_WIRELESS 0xD3A12C5E
+
+/* Define Address for Application FW Update */
+#define FUOTA_APP_FW_BINARY_ADDRESS (FLASH_BASE + CFG_APP_START_SECTOR_INDEX*0x1000)
+
+/* Define Address for Copro Wireless FW Update */
+#define FUOTA_COPRO_FW_BINARY_ADDRESS (FLASH_BASE + CFG_APP_START_SECTOR_INDEX*0x1000)
+
+#define FUOTA_NUMBER_WORDS_64BITS 50
+#define FUOTA_PAYLOAD_SIZE (FUOTA_NUMBER_WORDS_64BITS * 8)
+
+typedef void (*CoapRespHandlerCallback) (otCoapHeader * pHeader, otMessage * pMessage,const otMessageInfo * pMessageInfo,otError Result);
+/* USER CODE END PD */
+
+/* Private macros ------------------------------------------------------------*/
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private function prototypes -----------------------------------------------*/
+static void APP_THREAD_CheckWirelessFirmwareInfo(void);
+static void APP_THREAD_DeviceConfig(void);
+static void APP_THREAD_StateNotif(uint32_t NotifFlags, void *pContext);
+static void APP_THREAD_TraceError(const char * pMess, uint32_t ErrCode);
+#if (CFG_FULL_LOW_POWER == 0)
+static void Send_CLI_To_M0(void);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+static void Send_CLI_Ack_For_OT(void);
+static void HostTxCb( void );
+static void Wait_Getting_Ack_From_M0(void);
+static void Receive_Ack_From_M0(void);
+static void Receive_Notification_From_M0(void);
+#if (CFG_HW_LPUART1_ENABLED == 1)
+extern void MX_LPUART1_UART_Init(void);
+#endif
+#if (CFG_HW_USART1_ENABLED == 1)
+extern void MX_USART1_UART_Init(void);
+#endif
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+static uint32_t ProcessCmdString(uint8_t* buf , uint32_t len);
+#else
+#if (CFG_FULL_LOW_POWER == 0)
+static void RxCpltCallback(void);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+
+/* USER CODE BEGIN PFP */
+static void APP_THREAD_CoapSendRequest(otCoapResource* pCoapRessource,
+ otCoapType CoapType,
+ otCoapCode CoapCode,
+ otIp6Address* Ip6Address,
+ const char* StringAddress,
+ APP_THREAD_CoapAddressTypeDef_t CoapAddressType,
+ uint8_t* Payload,
+ uint16_t Size,
+ CoapRespHandlerCallback RespHandlerCb);
+
+static void APP_THREAD_DummyReqHandler(void * p_context,
+ otCoapHeader * pHeader,
+ otMessage * pMessage,
+ const otMessageInfo * pMessageInfo);
+static void APP_THREAD_ProvisioningRespHandler(otCoapHeader * pHeader,
+ otMessage * pMessage,
+ const otMessageInfo * pMessageInfo,
+ otError Result);
+static void APP_THREAD_CoapDummyRespHandler(void * p_context,
+ otCoapHeader * pHeader,
+ otMessage * pMessage,
+ const otMessageInfo * pMessageInfo,
+ otError Result);
+
+static void APP_THREAD_CoapRespHandlerFuotaSend(otCoapHeader * pHeader,
+ otMessage * pMessage,
+ const otMessageInfo * pMessageInfo,
+ otError Result);
+static void APP_THREAD_CoapRespHandlerFuotaReboot(otCoapHeader * pHeader,
+ otMessage * pMessage,
+ const otMessageInfo * pMessageInfo,
+ otError Result);
+static void APP_THREAD_CoapRespHandlerFuotaParameters(otCoapHeader * pHeader,
+ otMessage * pMessage,
+ const otMessageInfo * pMessageInfo,
+ otError Result);
+
+static void APP_THREAD_FuotaSetParamApp(void);
+static void APP_THREAD_FuotaSetParamCoproWireless(void);
+static APP_THREAD_StatusTypeDef APP_THREAD_SetOtaContext(APP_THREAD_OtaFileTypeDef_t file_type);
+static void APP_THREAD_FuotaProvisioning(void);
+static void APP_THREAD_FuotaSend(void);
+static uint32_t APP_THREAD_GetBinSize(void);
+static void APP_THREAD_FuotaParameters(void);
+static void APP_THREAD_FuotaReboot(void);
+
+/* USER CODE END PFP */
+
+/* Private variables -----------------------------------------------*/
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+static uint8_t TmpString[C_SIZE_CMD_STRING];
+static uint8_t VcpRxBuffer[sizeof(TL_CmdSerial_t)]; /* Received Data over USB are stored in this buffer */
+static uint8_t VcpTxBuffer[sizeof(TL_EvtPacket_t) + 254U]; /* Transmit buffer over USB */
+#else
+#if (CFG_FULL_LOW_POWER == 0)
+static uint8_t aRxBuffer[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+
+#if (CFG_FULL_LOW_POWER == 0)
+static uint8_t CommandString[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+static __IO uint16_t indexReceiveChar = 0;
+static __IO uint16_t CptReceiveCmdFromUser = 0;
+
+static TL_CmdPacket_t *p_thread_otcmdbuffer;
+static TL_EvtPacket_t *p_thread_notif_M0_to_M4;
+static __IO uint32_t CptReceiveMsgFromM0 = 0;
+PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static TL_TH_Config_t ThreadConfigBuffer;
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static TL_CmdPacket_t ThreadOtCmdBuffer;
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t ThreadNotifRspEvtBuffer[sizeof(TL_PacketHeader_t) + TL_EVT_HDR_SIZE + 255U];
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static TL_CmdPacket_t ThreadCliCmdBuffer;
+
+/* USER CODE BEGIN PV */
+static otCoapResource OT_RessourceFuotaProvisioning = {C_RESSOURCE_FUOTA_PROVISIONING, APP_THREAD_DummyReqHandler, NULL, NULL};
+static otCoapResource OT_RessourceFuotaParameters = {C_RESSOURCE_FUOTA_PARAMETERS, APP_THREAD_DummyReqHandler, NULL, NULL};
+static otCoapResource OT_RessourceFuotaSend = {C_RESSOURCE_FUOTA_SEND, APP_THREAD_DummyReqHandler, NULL, NULL};
+static otCoapResource OT_RessourceFuotaReboot = {C_RESSOURCE_FUOTA_REBOOT, APP_THREAD_DummyReqHandler, NULL, NULL};
+
+static uint8_t OT_Command = 0;
+static otMessageInfo OT_MessageInfo = {0};
+static otCoapHeader OT_Header = {0};
+static otMessage* pOT_Message = NULL;
+static uint16_t OT_BufferIdSend = 1U;
+
+static otIp6Address OT_PeerAddress = { .mFields.m8 = { 0 } };
+
+static uint64_t FuotaTransferArray[FUOTA_NUMBER_WORDS_64BITS] = {0};
+
+static APP_THREAD_OtaContext_t OtaContext;
+/* USER CODE END PV */
+
+/* Functions Definition ------------------------------------------------------*/
+
+void APP_THREAD_Init( void )
+{
+ /* USER CODE BEGIN APP_THREAD_INIT_1 */
+ APP_DBG("Thread_Ota_Server Application");
+ /* USER CODE END APP_THREAD_INIT_1 */
+
+ SHCI_CmdStatus_t ThreadInitStatus;
+
+ /* Check the compatibility with the Coprocessor Wireless Firmware loaded */
+ APP_THREAD_CheckWirelessFirmwareInfo();
+
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+ VCP_Init(&VcpTxBuffer[0], &VcpRxBuffer[0]);
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+
+ /* Register cmdbuffer */
+ APP_THREAD_RegisterCmdBuffer(&ThreadOtCmdBuffer);
+
+ /**
+ * Do not allow standby in the application
+ */
+ UTIL_LPM_SetOffMode(1 << CFG_LPM_APP_THREAD, UTIL_LPM_DISABLE);
+
+ /* Init config buffer and call TL_THREAD_Init */
+ APP_THREAD_TL_THREAD_INIT();
+
+ /* Configure UART for sending CLI command from M4 */
+ APP_THREAD_Init_UART_CLI();
+
+ /* Send Thread start system cmd to M0 */
+ ThreadInitStatus = SHCI_C2_THREAD_Init();
+
+ /* Prevent unused argument(s) compilation warning */
+ UNUSED(ThreadInitStatus);
+
+ /* Register task */
+ /* Create the different tasks */
+ UTIL_SEQ_RegTask( 1<<(uint32_t)CFG_TASK_MSG_FROM_M0_TO_M4, UTIL_SEQ_RFU, APP_THREAD_ProcessMsgM0ToM4);
+
+ /* USER CODE BEGIN INIT TASKS */
+ UTIL_SEQ_RegTask( 1<<(uint32_t)CFG_TASK_BUTTON_SW1, UTIL_SEQ_RFU, APP_THREAD_FuotaSetParamApp);
+ UTIL_SEQ_RegTask( 1<<(uint32_t)CFG_TASK_BUTTON_SW3, UTIL_SEQ_RFU, APP_THREAD_FuotaSetParamCoproWireless);
+ UTIL_SEQ_RegTask( 1<<(uint32_t)CFG_TASK_FUOTA_SEND, UTIL_SEQ_RFU, APP_THREAD_FuotaSend);
+ UTIL_SEQ_RegTask( 1<<(uint32_t)CFG_TASK_FUOTA_PARAMETERS, UTIL_SEQ_RFU, APP_THREAD_FuotaParameters);
+ UTIL_SEQ_RegTask( 1<<(uint32_t)CFG_TASK_FUOTA_REBOOT, UTIL_SEQ_RFU, APP_THREAD_FuotaReboot);
+ /* USER CODE END INIT TASKS */
+
+ /* Initialize and configure the Thread device*/
+ APP_THREAD_DeviceConfig();
+
+ /* USER CODE BEGIN APP_THREAD_INIT_2 */
+
+ /* USER CODE END APP_THREAD_INIT_2 */
+}
+
+/**
+ * @brief Trace the error or the warning reported.
+ * @param ErrId :
+ * @param ErrCode
+ * @retval None
+ */
+void APP_THREAD_Error(uint32_t ErrId, uint32_t ErrCode)
+{
+ /* USER CODE BEGIN APP_THREAD_Error_1 */
+
+ /* USER CODE END APP_THREAD_Error_1 */
+ switch(ErrId)
+ {
+ case ERR_REC_MULTI_MSG_FROM_M0 :
+ APP_THREAD_TraceError("ERROR : ERR_REC_MULTI_MSG_FROM_M0 ", ErrCode);
+ break;
+ case ERR_THREAD_SET_STATE_CB :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_SET_STATE_CB ",ErrCode);
+ break;
+ case ERR_THREAD_SET_CHANNEL :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_SET_CHANNEL ",ErrCode);
+ break;
+ case ERR_THREAD_SET_PANID :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_SET_PANID ",ErrCode);
+ break;
+ case ERR_THREAD_IPV6_ENABLE :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_IPV6_ENABLE ",ErrCode);
+ break;
+ case ERR_THREAD_START :
+ APP_THREAD_TraceError("ERROR: ERR_THREAD_START ", ErrCode);
+ break;
+ case ERR_THREAD_ERASE_PERSISTENT_INFO :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_ERASE_PERSISTENT_INFO ",ErrCode);
+ break;
+ case ERR_THREAD_CHECK_WIRELESS :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_CHECK_WIRELESS ",ErrCode);
+ break;
+ /* USER CODE BEGIN APP_THREAD_Error_2 */
+ case ERR_THREAD_COAP_START :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_COAP_START ",ErrCode);
+ break;
+ case ERR_THREAD_COAP_ADD_RESSOURCE :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_COAP_ADD_RESSOURCE ",ErrCode);
+ break;
+ case ERR_THREAD_MESSAGE_READ :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_MESSAGE_READ ",ErrCode);
+ break;
+ case ERR_THREAD_COAP_SEND_RESPONSE :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_COAP_SEND_RESPONSE ",ErrCode);
+ break;
+ case ERR_THREAD_COAP_APPEND :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_COAP_APPEND ",ErrCode);
+ break;
+ case ERR_THREAD_COAP_SEND_REQUEST :
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_COAP_SEND_REQUEST ",ErrCode);
+ break;
+ case ERR_THREAD_MSG_COMPARE_FAILED:
+ APP_THREAD_TraceError("ERROR : ERR_THREAD_MSG_COMPARE_FAILED ",ErrCode);
+ break;
+ /* USER CODE END APP_THREAD_Error_2 */
+ default :
+ APP_THREAD_TraceError("ERROR Unknown ", 0);
+ break;
+ }
+}
+
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+
+/**
+ * @brief Thread initialization.
+ * @param None
+ * @retval None
+ */
+static void APP_THREAD_DeviceConfig(void)
+{
+ otError error;
+ error = otInstanceErasePersistentInfo(NULL);
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_ERASE_PERSISTENT_INFO,error);
+ }
+ otInstanceFinalize(NULL);
+ otInstanceInitSingle();
+ error = otSetStateChangedCallback(NULL, APP_THREAD_StateNotif, NULL);
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_SET_STATE_CB,error);
+ }
+ error = otLinkSetChannel(NULL, C_CHANNEL_NB);
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_SET_CHANNEL,error);
+ }
+ error = otLinkSetPanId(NULL, C_PANID);
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_SET_PANID,error);
+ }
+ error = otIp6SetEnabled(NULL, true);
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_IPV6_ENABLE,error);
+ }
+ error = otThreadSetEnabled(NULL, true);
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_START,error);
+ }
+
+ /* USER CODE BEGIN DEVICECONFIG */
+ /* Start the COAP server */
+ error = otCoapStart(NULL, OT_DEFAULT_COAP_PORT);
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_COAP_START,error);
+ }
+ /* Add COAP resources */
+ error = otCoapAddResource(NULL, &OT_RessourceFuotaProvisioning);
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_COAP_ADD_RESSOURCE,error);
+ }
+ error = otCoapAddResource(NULL, &OT_RessourceFuotaSend);
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_COAP_ADD_RESSOURCE,error);
+ }
+ /* USER CODE END DEVICECONFIG */
+}
+
+/**
+ * @brief Thread notification when the state changes.
+ * @param aFlags : Define the item that has been modified
+ * aContext: Context
+ *
+ * @retval None
+ */
+static void APP_THREAD_StateNotif(uint32_t NotifFlags, void *pContext)
+{
+ /* Prevent unused argument(s) compilation warning */
+ UNUSED(pContext);
+
+ /* USER CODE BEGIN APP_THREAD_STATENOTIF */
+
+ /* USER CODE END APP_THREAD_STATENOTIF */
+
+ if ((NotifFlags & (uint32_t)OT_CHANGED_THREAD_ROLE) == (uint32_t)OT_CHANGED_THREAD_ROLE)
+ {
+ switch (otThreadGetDeviceRole(NULL))
+ {
+ case OT_DEVICE_ROLE_DISABLED:
+ /* USER CODE BEGIN OT_DEVICE_ROLE_DISABLED */
+ BSP_LED_Off(LED2);
+ BSP_LED_Off(LED3);
+ /* USER CODE END OT_DEVICE_ROLE_DISABLED */
+ break;
+ case OT_DEVICE_ROLE_DETACHED:
+ /* USER CODE BEGIN OT_DEVICE_ROLE_DETACHED */
+ BSP_LED_Off(LED2);
+ BSP_LED_Off(LED3);
+ /* USER CODE END OT_DEVICE_ROLE_DETACHED */
+ break;
+ case OT_DEVICE_ROLE_CHILD:
+ /* USER CODE BEGIN OT_DEVICE_ROLE_CHILD */
+ BSP_LED_Off(LED2);
+ BSP_LED_On(LED3);
+ /* USER CODE END OT_DEVICE_ROLE_CHILD */
+ break;
+ case OT_DEVICE_ROLE_ROUTER :
+ /* USER CODE BEGIN OT_DEVICE_ROLE_ROUTER */
+ BSP_LED_Off(LED2);
+ BSP_LED_On(LED3);
+ /* USER CODE END OT_DEVICE_ROLE_ROUTER */
+ break;
+ case OT_DEVICE_ROLE_LEADER :
+ /* USER CODE BEGIN OT_DEVICE_ROLE_LEADER */
+ BSP_LED_On(LED2);
+ BSP_LED_Off(LED3);
+ /* USER CODE END OT_DEVICE_ROLE_LEADER */
+ break;
+ default:
+ /* USER CODE BEGIN DEFAULT */
+ BSP_LED_Off(LED2);
+ BSP_LED_Off(LED3);
+ /* USER CODE END DEFAULT */
+ break;
+ }
+ }
+}
+
+/**
+ * @brief Warn the user that an error has occurred.In this case,
+ * the LEDs on the Board will start blinking.
+ *
+ * @param pMess : Message associated to the error.
+ * @param ErrCode: Error code associated to the module (OpenThread or other module if any)
+ * @retval None
+ */
+static void APP_THREAD_TraceError(const char * pMess, uint32_t ErrCode)
+{
+ /* USER CODE BEGIN TRACE_ERROR */
+ APP_DBG("**** Fatal error = %s (Err = %d)", pMess, ErrCode);
+ while(1U == 1U)
+ {
+ BSP_LED_Toggle(LED1);
+ HAL_Delay(500U);
+ BSP_LED_Toggle(LED2);
+ HAL_Delay(500U);
+ BSP_LED_Toggle(LED3);
+ HAL_Delay(500U);
+ }
+ /* USER CODE END TRACE_ERROR */
+}
+
+/**
+ * @brief Check if the Coprocessor Wireless Firmware loaded supports Thread
+ * and display associated informations
+ * @param None
+ * @retval None
+ */
+static void APP_THREAD_CheckWirelessFirmwareInfo(void)
+{
+ WirelessFwInfo_t wireless_info_instance;
+ WirelessFwInfo_t* p_wireless_info = &wireless_info_instance;
+
+ if (SHCI_GetWirelessFwInfo(p_wireless_info) != SHCI_Success)
+ {
+ APP_THREAD_Error((uint32_t)ERR_THREAD_CHECK_WIRELESS, (uint32_t)ERR_INTERFACE_FATAL);
+ }
+ else
+ {
+ APP_DBG("**********************************************************");
+ APP_DBG("WIRELESS COPROCESSOR FW:");
+ /* Print version */
+ APP_DBG("VERSION ID = %d.%d.%d", p_wireless_info->VersionMajor, p_wireless_info->VersionMinor, p_wireless_info->VersionSub);
+
+ switch(p_wireless_info->StackType)
+ {
+ case INFO_STACK_TYPE_THREAD_FTD :
+ APP_DBG("FW Type : Thread FTD");
+ break;
+ case INFO_STACK_TYPE_THREAD_MTD :
+ APP_DBG("FW Type : Thread MTD");
+ break;
+ case INFO_STACK_TYPE_BLE_THREAD_FTD_STATIC :
+ APP_DBG("FW Type : Static Concurrent Mode BLE/Thread");
+ break;
+ default :
+ /* No Thread device supported ! */
+ APP_THREAD_Error((uint32_t)ERR_THREAD_CHECK_WIRELESS, (uint32_t)ERR_INTERFACE_FATAL);
+ break;
+ }
+ APP_DBG("**********************************************************");
+ }
+}
+/* USER CODE BEGIN FD_LOCAL_FUNCTIONS */
+/**
+ * @brief Send a CoAP request with defined parameters.
+ *
+ * @param[in] pCoapRessource A pointer to a otCoapResource.
+ * @param[in] CoapType otCoapType.
+ * @param[in] otCoapCode otCoapCode.
+ * @param[in] Ip6Address A pointer to otIp6Address.
+ * @param[in] StringAddress A pointer to a NULL-terminated string representing the address. Example: "FF03::1" for Multicast.
+ * @param[in] CoapAddressType Decide to use IP6Address or StringAddress.
+ * @param[in] Payload A pointer to payload.
+ * @param[in] Size Size of the transfer in bytes.
+ * @param[in] RespHandlerCb Callback function called in case of confirmable message.
+ *
+ * @retval none.
+ */
+static void APP_THREAD_CoapSendRequest(otCoapResource* pCoapRessource,
+ otCoapType CoapType,
+ otCoapCode CoapCode,
+ otIp6Address* Ip6Address,
+ const char* StringAddress,
+ APP_THREAD_CoapAddressTypeDef_t CoapAddressType,
+ uint8_t* Payload,
+ uint16_t Size,
+ CoapRespHandlerCallback RespHandlerCb)
+{
+ otError error = OT_ERROR_NONE;
+ OT_BufferIdSend = 0;
+
+ do{
+ otCoapHeaderInit(&OT_Header, CoapType, CoapCode);
+ otCoapHeaderSetMessageId(&OT_Header,OT_BufferIdSend);
+ otCoapHeaderGenerateToken(&OT_Header, 2U);
+
+ error = otCoapHeaderAppendUriPathOptions(&OT_Header, pCoapRessource->mUriPath);
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_COAP_APEND_URI,error);
+ }
+
+ if(CoapCode != OT_COAP_CODE_GET)
+ {
+ otCoapHeaderSetPayloadMarker(&OT_Header);
+ }
+
+ pOT_Message = otCoapNewMessage(NULL, &OT_Header);
+ if (pOT_Message == NULL)
+ {
+ APP_THREAD_Error(ERR_THREAD_COAP_NEW_MSG,error);
+ break;
+ }
+
+ if(CoapCode != OT_COAP_CODE_GET)
+ {
+ error = otMessageAppend(pOT_Message, Payload, Size);
+ if (error != OT_ERROR_NONE)
+ {
+ APP_THREAD_Error(ERR_THREAD_COAP_APPEND,error);
+ break;
+ }
+ }
+
+ memset(&OT_MessageInfo, 0, sizeof(OT_MessageInfo));
+ OT_MessageInfo.mInterfaceId = OT_NETIF_INTERFACE_ID_THREAD;
+ OT_MessageInfo.mPeerPort = OT_DEFAULT_COAP_PORT;
+
+ if(CoapAddressType == APP_THREAD_COAP_STRING_ADDRESS)
+ {
+ otIp6AddressFromString(StringAddress, &OT_MessageInfo.mPeerAddr);
+ }
+ else if (CoapAddressType == APP_THREAD_COAP_IP6_ADDRESS)
+ {
+ memcpy(&OT_MessageInfo.mPeerAddr, Ip6Address, sizeof(OT_MessageInfo.mPeerAddr));
+ }
+ else
+ {
+ /* ERROR : should never be in a not defined address type */
+ APP_THREAD_Error(ERR_THREAD_BAD_ADDRESS_TYPE, 0);
+ }
+
+ error = otCoapSendRequest(NULL,
+ pOT_Message,
+ &OT_MessageInfo,
+ &APP_THREAD_CoapDummyRespHandler,
+ (void*)RespHandlerCb);
+
+ }while(false);
+ if (error != OT_ERROR_NONE && pOT_Message != NULL)
+ {
+ otMessageFree(pOT_Message);
+ APP_THREAD_Error(ERR_THREAD_COAP_SEND_REQUEST,error);
+ }
+}
+
+/**
+ * @brief Dummy request handler
+ *
+ * @param None
+ * @retval None
+ */
+static void APP_THREAD_DummyReqHandler(void * p_context,
+ otCoapHeader * pHeader,
+ otMessage * pMessage,
+ const otMessageInfo * pMessageInfo)
+{
+}
+
+/**
+ * @brief This function manages the response handler for provisioning.
+ *
+ * @param pHeader header
+ * @param pMessage message pointer
+ * @param pMessageInfo message info pointer
+ * @param Result error code
+ * @retval None
+ */
+static void APP_THREAD_ProvisioningRespHandler(otCoapHeader * pHeader,
+ otMessage * pMessage,
+ const otMessageInfo * pMessageInfo,
+ otError Result)
+{
+ if (Result == OT_ERROR_NONE)
+ {
+ if ((otMessageRead(pMessage, otMessageGetOffset(pMessage), &OT_Command, sizeof(OT_Command)) == sizeof(OT_Command)))
+ {
+ /* Retrieve the Message */
+ if (otMessageRead(pMessage,
+ otMessageGetOffset(pMessage) + sizeof(OT_Command),
+ &OT_PeerAddress,
+ sizeof(OT_PeerAddress)) != sizeof(OT_PeerAddress))
+ {
+ APP_THREAD_Error(ERR_THREAD_MESSAGE_READ, 0);
+ }
+ APP_DBG("\r -> Succesfully retrieved Remote device address \n");
+
+ /* Notify provisioning OK */
+ UTIL_SEQ_SetTask(TASK_FUOTA_PARAMETERS, CFG_SCH_PRIO_1);
+ }
+ }
+ else
+ {
+ APP_DBG("WARNING: APP_THREAD_CoapDataRespHandler fail with ERROR code = %d",Result);
+ }
+}
+
+/**
+ * @brief This function manages the response handler for FUOTA binary datas.
+ *
+ * @param pHeader header
+ * @param pMessage message pointer
+ * @param pMessageInfo message info pointer
+ * @param Result error code
+ * @retval None
+ */
+static void APP_THREAD_CoapRespHandlerFuotaSend(otCoapHeader * pHeader,
+ otMessage * pMessage,
+ const otMessageInfo * pMessageInfo,
+ otError Result)
+{
+ if (Result == OT_ERROR_NONE)
+ {
+ UTIL_SEQ_SetEvt(EVENT_TRANSFER_64BITS_DONE);
+ }
+ else
+ {
+ APP_DBG("APP_THREAD_CoapRespHandlerFuotaSend : WARNING Result %d", Result);
+ }
+}
+
+/**
+ * @brief This function is used to handle a dummy response handler
+ *
+ * @param p_context context
+ * @param pHeader coap header
+ * @param pMessage message
+ * @paramp pMessageInfo otMessage information
+ * @param Result error status
+ * @retval None
+ */
+static void APP_THREAD_CoapDummyRespHandler(void * p_context,
+ otCoapHeader * pHeader,
+ otMessage * pMessage,
+ const otMessageInfo * pMessageInfo,
+ otError Result)
+{
+ /* Prevent unused argument(s) compilation warning */
+ UNUSED(p_context);
+ UNUSED(pHeader);
+ UNUSED(pMessage);
+ UNUSED(pMessageInfo);
+ UNUSED(Result);
+}
+
+/**
+ * @brief Set FUOTA parameters for APP FW.
+ * @param None
+ * @retval None
+ */
+static void APP_THREAD_FuotaSetParamApp(void)
+{
+ APP_THREAD_StatusTypeDef status;
+
+ status = APP_THREAD_SetOtaContext(APP_THREAD_OTA_FILE_TYPE_FW_APP);
+
+ if (status == APP_THREAD_OK)
+ {
+ APP_THREAD_FuotaProvisioning();
+ }
+ else
+ {
+ APP_DBG("WARNING: Setting Ota Context failed, do not send FUOTA PROVISIONING");
+ }
+}
+
+/**
+ * @brief Set FUOTA parameters for Copro Wireless FW.
+ * @param None
+ * @retval None
+ */
+static void APP_THREAD_FuotaSetParamCoproWireless(void)
+{
+ APP_THREAD_StatusTypeDef status;
+
+ status = APP_THREAD_SetOtaContext(APP_THREAD_OTA_FILE_TYPE_FW_COPRO_WIRELESS);
+
+ if (status == APP_THREAD_OK)
+ {
+ APP_THREAD_FuotaProvisioning();
+ }
+ else
+ {
+ APP_DBG("WARNING: Setting Ota Context failed, do not send FUOTA PROVISIONING");
+ }
+}
+
+/**
+ * @brief Set Ota Context.
+ * @param None
+ * @retval None
+ */
+static APP_THREAD_StatusTypeDef APP_THREAD_SetOtaContext(APP_THREAD_OtaFileTypeDef_t file_type)
+{
+ if (file_type == APP_THREAD_OTA_FILE_TYPE_FW_APP)
+ {
+ OtaContext.file_type = APP_THREAD_OTA_FILE_TYPE_FW_APP;
+ /* Set base address for FUOTA download */
+ OtaContext.base_address = FUOTA_APP_FW_BINARY_ADDRESS;
+ OtaContext.magic_keyword = FUOTA_MAGIC_KEYWORD_APP;
+ }
+ else if (file_type == APP_THREAD_OTA_FILE_TYPE_FW_COPRO_WIRELESS)
+ {
+ OtaContext.file_type = APP_THREAD_OTA_FILE_TYPE_FW_COPRO_WIRELESS;
+ /* Set base address for FUOTA download */
+ OtaContext.base_address = FUOTA_COPRO_FW_BINARY_ADDRESS;
+ OtaContext.magic_keyword = FUOTA_MAGIC_KEYWORD_COPRO_WIRELESS;
+ }
+ else
+ {
+ APP_DBG("WARNING: Unrecognized file_type = %d", file_type);
+ return APP_THREAD_ERROR;
+ }
+
+ /* Set binary size */
+ OtaContext.binary_size = APP_THREAD_GetBinSize();
+
+ /* Return the function status */
+ return APP_THREAD_OK;
+}
+
+/**
+ * @brief Sends Provisioning request.
+ * @param None
+ * @retval None
+ */
+static void APP_THREAD_FuotaProvisioning(void)
+{
+ APP_DBG("Send FUOTA PROVISONING request");
+
+ uint8_t l_provisioning_data = 0x1;
+
+ /* Send a MULTICAST CONFIRMABLE GET Request */
+ APP_THREAD_CoapSendRequest(&OT_RessourceFuotaProvisioning,
+ OT_COAP_TYPE_NON_CONFIRMABLE,
+ OT_COAP_CODE_GET,
+ NULL,
+ MULICAST_FTD_MED,
+ APP_THREAD_COAP_STRING_ADDRESS,
+ &l_provisioning_data,
+ sizeof(l_provisioning_data),
+ &APP_THREAD_ProvisioningRespHandler);
+}
+
+static uint32_t APP_THREAD_GetBinSize(void)
+{
+ uint32_t flash_current_offset = 0;
+ uint64_t read64 = 0;
+ bool binary_parsing_on_going = TRUE;
+ bool error_keyword_or_size = FALSE;
+ uint32_t first_secure_sector_idx;
+ uint32_t maximum_reachable_offset;
+ uint32_t fuota_bin_size = 0;
+
+ first_secure_sector_idx = (READ_BIT(FLASH->SFR, FLASH_SFR_SFSA) >> FLASH_SFR_SFSA_Pos);
+ APP_DBG("SFSA set to %dth sector", first_secure_sector_idx);
+
+ /* Compute Maximum reachable address */
+ maximum_reachable_offset = (first_secure_sector_idx * 0x1000) - 1;
+ APP_DBG("maximum_reachable_offset = 0x%x", maximum_reachable_offset);
+
+ while(binary_parsing_on_going == TRUE){
+ read64 = *(uint64_t*)(OtaContext.base_address + flash_current_offset);
+
+ /* Test if current word contains magic keyword */
+ if((read64 & 0x00000000FFFFFFFF) == OtaContext.magic_keyword)
+ {
+ binary_parsing_on_going = FALSE;
+ }
+ else if (((read64 & 0xFFFFFFFF00000000) >> 32) == OtaContext.magic_keyword)
+ {
+ binary_parsing_on_going = FALSE;
+ }
+
+ flash_current_offset += 8;
+
+ /* Test current offset is still below SFSA (Non-Secure Memory Address) */
+ if(flash_current_offset > maximum_reachable_offset)
+ {
+ error_keyword_or_size = TRUE;
+ binary_parsing_on_going = FALSE;
+ }
+ }
+
+ if(error_keyword_or_size == TRUE)
+ {
+ APP_DBG("Error: FUOTA Keyword not found in FLASH memory, aborting!");
+ APP_THREAD_Error(ERR_THREAD_FUOTA_NO_KEYWORD, 0);
+ }
+ else
+ {
+ fuota_bin_size = flash_current_offset;
+ }
+
+ return fuota_bin_size;
+}
+
+/**
+ * @brief Task associated to FUOTA parameters to be sent.
+ * @param None
+ * @retval None
+ */
+static void APP_THREAD_FuotaParameters(void)
+{
+ APP_DBG("FUOTA PROVISIONING OK, Set FUOTA PARAMETERS");
+
+ if(OtaContext.file_type == APP_THREAD_OTA_FILE_TYPE_FW_APP)
+ {
+ APP_DBG("\r File type = FW_APP");
+ }
+ else if (OtaContext.file_type == APP_THREAD_OTA_FILE_TYPE_FW_COPRO_WIRELESS)
+ {
+ APP_DBG("\r File type = FW_COPRO_WIRELESS");
+ }
+ else
+ {
+ APP_DBG("FUOTA_PARAMETERS: File Type not recognized");
+ APP_THREAD_Error(ERR_THREAD_FUOTA_FILE_TYPE_NOT_RECOGNIZED, 0);
+ }
+
+ APP_DBG("\r Binary size = %d bytes", OtaContext.binary_size);
+ APP_DBG("\r Magic keyword = 0x%x", OtaContext.magic_keyword);
+ APP_DBG("\r Base address = 0x%x", OtaContext.base_address);
+
+ /* Send a CONFIRMABLE PUT Request */
+ APP_THREAD_CoapSendRequest(&OT_RessourceFuotaParameters,
+ OT_COAP_TYPE_CONFIRMABLE,
+ OT_COAP_CODE_PUT,
+ &OT_PeerAddress,
+ NULL,
+ APP_THREAD_COAP_IP6_ADDRESS,
+ (uint8_t*)&OtaContext,
+ sizeof(OtaContext),
+ &APP_THREAD_CoapRespHandlerFuotaParameters);
+}
+
+/**
+ * @brief Task associated to FUOTA binary data sending.
+ * @param None
+ * @retval None
+ */
+static void APP_THREAD_FuotaSend(void)
+{
+ uint32_t flash_current_offset = 0x0;
+ bool binary_transfer_on_going = TRUE;
+ uint32_t l_debug_count = 0;
+ uint32_t l_current_index_progress = 0;
+ uint32_t FuotaProgressArray[100] = {0};
+ uint32_t FuotaTransferArraySize = 0;
+ uint32_t l_start_transfer_time = 0;
+ uint32_t l_end_transfer_time = 0;
+ double l_transfer_time = 0;
+ double l_transfer_throughput = 0;
+ uint8_t l_Fuota_progress_multiplied = 0;
+
+ APP_DBG("FUOTA PARAMETERS SET, START FUOTA BINARY TRANSFER");
+
+ /* Number of elements in OtaContext.binary_size */
+ FuotaTransferArraySize = OtaContext.binary_size / FUOTA_PAYLOAD_SIZE;
+ APP_DBG("\r -> %d elements of %d bytes to be transferred", FuotaTransferArraySize, FUOTA_PAYLOAD_SIZE);
+ if(FuotaTransferArraySize < 100)
+ {
+ l_Fuota_progress_multiplied = 1;
+ FuotaTransferArraySize = FuotaTransferArraySize * 10;
+ }
+ for (int index = 1; index < 100; index++)
+ {
+ FuotaProgressArray[index] = (FuotaTransferArraySize / 100) * index;
+ }
+
+ l_start_transfer_time = HAL_GetTick();
+
+ while(binary_transfer_on_going == TRUE){
+
+ /* Get data to be sent */
+ /* Read data from flash memory */
+ memcpy(FuotaTransferArray, (uint8_t*)(OtaContext.base_address + flash_current_offset), FUOTA_PAYLOAD_SIZE);
+
+ /* Send a CONFIRMABLE PUT Request */
+ APP_THREAD_CoapSendRequest(&OT_RessourceFuotaSend,
+ OT_COAP_TYPE_CONFIRMABLE,
+ OT_COAP_CODE_PUT,
+ &OT_PeerAddress,
+ NULL,
+ APP_THREAD_COAP_IP6_ADDRESS,
+ (uint8_t*)&FuotaTransferArray,
+ FUOTA_PAYLOAD_SIZE,
+ &APP_THREAD_CoapRespHandlerFuotaSend);
+
+ UTIL_SEQ_WaitEvt(EVENT_TRANSFER_64BITS_DONE);
+
+ /* Test if magic Keyword is in FuotaTransferArray */
+ for (int index = 0; index < FUOTA_NUMBER_WORDS_64BITS; ++index) {
+ if((FuotaTransferArray[index] & 0x00000000FFFFFFFF) == OtaContext.magic_keyword)
+ {
+ APP_DBG("1 - FUOTA_MAGIC_KEYWORD found at flash_current_offset = %d", (flash_current_offset + (index*8)));
+ binary_transfer_on_going = FALSE;
+ }
+ else
+ if (((FuotaTransferArray[index] & 0xFFFFFFFF00000000) >> 32) == OtaContext.magic_keyword)
+ {
+ APP_DBG("2 - FUOTA_MAGIC_KEYWORD found at flash_current_offset = %d", (flash_current_offset + (index*8)));
+ binary_transfer_on_going = FALSE;
+ }
+ }
+
+ flash_current_offset += FUOTA_PAYLOAD_SIZE;
+
+ /* Display Transfer Progress */
+ if(l_debug_count == FuotaProgressArray[l_current_index_progress+1])
+ {
+ l_current_index_progress += 1;
+ if(l_Fuota_progress_multiplied == 1)
+ {
+ APP_DBG("FUOTA Transfer %d%...", l_current_index_progress*10);
+ }
+ else
+ {
+ APP_DBG("FUOTA Transfer %d%...", l_current_index_progress);
+ }
+ }
+
+ l_debug_count++;
+ }
+
+ l_end_transfer_time = HAL_GetTick();
+ l_transfer_time = (double)(l_end_transfer_time - l_start_transfer_time) / 1000;
+ l_transfer_throughput = (((double)OtaContext.binary_size/l_transfer_time) / 1000) * 8;
+
+ APP_DBG("**************************************************************");
+ APP_DBG(" FUOTA_SERVER : END OF TRANSFER COMPLETED");
+ APP_DBG(" - Payload size = %d bytes", FUOTA_PAYLOAD_SIZE);
+ APP_DBG(" - Transfer time = %.2f seconds", l_transfer_time);
+ APP_DBG(" - Average throughput = %.2f kbit/s", l_transfer_throughput);
+ APP_DBG("**************************************************************");
+
+ /* Notify end of transfer to Thread_Ota ? */
+}
+
+/**
+ * @brief Task associated to the push button.
+ * @param None
+ * @retval None
+ */
+static void APP_THREAD_FuotaReboot(void)
+{
+ uint32_t l_data = 0x1;
+ APP_DBG("Send a request to current OTA application to reboot on Thread_Ota");
+
+ /* Send a CONFIRMABLE PUT Request */
+ APP_THREAD_CoapSendRequest(&OT_RessourceFuotaReboot,
+ OT_COAP_TYPE_CONFIRMABLE,
+ OT_COAP_CODE_PUT,
+ NULL,
+ MULICAST_FTD_MED,
+ APP_THREAD_COAP_STRING_ADDRESS,
+ (uint8_t*)&l_data,
+ sizeof(l_data),
+ &APP_THREAD_CoapRespHandlerFuotaReboot);
+
+ UTIL_SEQ_WaitEvt(EVENT_FUOTA_REBOOT_RESP_DONE);
+
+ APP_DBG("Reboot request ACK from OTA application");
+}
+
+/**
+ * @brief This function manages the response handler for the request of reboot on Thread_Ota.
+ *
+ * @param pHeader header
+ * @param pMessage message pointer
+ * @param pMessageInfo message info pointer
+ * @param Result error code
+ * @retval None
+ */
+static void APP_THREAD_CoapRespHandlerFuotaReboot(otCoapHeader * pHeader,
+ otMessage * pMessage,
+ const otMessageInfo * pMessageInfo,
+ otError Result)
+{
+ if (Result == OT_ERROR_NONE)
+ {
+ UTIL_SEQ_SetEvt(EVENT_FUOTA_REBOOT_RESP_DONE);
+ }
+ else
+ {
+ APP_DBG("APP_THREAD_CoapRespHandlerFuotaReboot : WARNING Result %d", Result);
+ }
+}
+
+/**
+ * @brief This function manages the response handler for the request of reboot on Thread_Ota.
+ *
+ * @param pHeader header
+ * @param pMessage message pointer
+ * @param pMessageInfo message info pointer
+ * @param Result error code
+ * @retval None
+ */
+static void APP_THREAD_CoapRespHandlerFuotaParameters(otCoapHeader * pHeader,
+ otMessage * pMessage,
+ const otMessageInfo * pMessageInfo,
+ otError Result)
+{
+ if (Result == OT_ERROR_NONE)
+ {
+ /* Read Message */
+ if (otMessageRead(pMessage, otMessageGetOffset(pMessage), &OT_Command, sizeof(OT_Command)) == sizeof(OT_Command))
+ {
+ if (OT_Command == APP_THREAD_OK)
+ {
+ APP_DBG("FUOTA PARAMETERS: Correct ACK received");
+ UTIL_SEQ_SetTask(TASK_FUOTA_SEND, CFG_SCH_PRIO_0);
+ }
+ else if (OT_Command == APP_THREAD_ERROR)
+ {
+ APP_DBG("FUOTA PARAMETERS: Bad ACK received");
+ APP_DBG("\r -> STOP FUOTA process!");
+ }
+ else
+ {
+ APP_DBG("FUOTA PARAMETERS: Unrecognized ACK received");
+ APP_DBG("\r -> STOP FUOTA process!");
+ }
+ }
+ else
+ {
+ APP_DBG("WARNING : APP_THREAD_CoapRespHandlerFuotaParameters otMessageRead failed!");
+ }
+ }
+ else
+ {
+ APP_DBG("APP_THREAD_CoapRespHandlerFuotaReboot : WARNING Result %d", Result);
+ }
+}
+
+/* USER CODE END FD_LOCAL_FUNCTIONS */
+
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+
+void APP_THREAD_RegisterCmdBuffer(TL_CmdPacket_t* p_buffer)
+{
+ p_thread_otcmdbuffer = p_buffer;
+}
+
+Thread_OT_Cmd_Request_t* THREAD_Get_OTCmdPayloadBuffer(void)
+{
+ return (Thread_OT_Cmd_Request_t*)p_thread_otcmdbuffer->cmdserial.cmd.payload;
+}
+
+Thread_OT_Cmd_Request_t* THREAD_Get_OTCmdRspPayloadBuffer(void)
+{
+ return (Thread_OT_Cmd_Request_t*)((TL_EvtPacket_t *)p_thread_otcmdbuffer)->evtserial.evt.payload;
+}
+
+Thread_OT_Cmd_Request_t* THREAD_Get_NotificationPayloadBuffer(void)
+{
+ return (Thread_OT_Cmd_Request_t*)(p_thread_notif_M0_to_M4)->evtserial.evt.payload;
+}
+
+/**
+ * @brief This function is used to transfer the Ot commands from the
+ * M4 to the M0.
+ *
+ * @param None
+ * @return None
+ */
+void Ot_Cmd_Transfer(void)
+{
+ /* OpenThread OT command cmdcode range 0x280 .. 0x3DF = 352 */
+ p_thread_otcmdbuffer->cmdserial.cmd.cmdcode = 0x280U;
+ /* Size = otCmdBuffer->Size (Number of OT cmd arguments : 1 arg = 32bits so multiply by 4 to get size in bytes)
+ * + ID (4 bytes) + Size (4 bytes) */
+ uint32_t l_size = ((Thread_OT_Cmd_Request_t*)(p_thread_otcmdbuffer->cmdserial.cmd.payload))->Size * 4U + 8U;
+ p_thread_otcmdbuffer->cmdserial.cmd.plen = l_size;
+
+ TL_OT_SendCmd();
+
+ /* Wait completion of cmd */
+ Wait_Getting_Ack_From_M0();
+}
+
+/**
+ * @brief This function is called when acknowledge from OT command is received from the M0+.
+ *
+ * @param Otbuffer : a pointer to TL_EvtPacket_t
+ * @return None
+ */
+void TL_OT_CmdEvtReceived( TL_EvtPacket_t * Otbuffer )
+{
+ /* Prevent unused argument(s) compilation warning */
+ UNUSED(Otbuffer);
+
+ Receive_Ack_From_M0();
+}
+
+/**
+ * @brief This function is called when notification from M0+ is received.
+ *
+ * @param Notbuffer : a pointer to TL_EvtPacket_t
+ * @return None
+ */
+void TL_THREAD_NotReceived( TL_EvtPacket_t * Notbuffer )
+{
+ p_thread_notif_M0_to_M4 = Notbuffer;
+
+ Receive_Notification_From_M0();
+}
+
+/**
+ * @brief This function is called before sending any ot command to the M0
+ * core. The purpose of this function is to be able to check if
+ * there are no notifications coming from the M0 core which are
+ * pending before sending a new ot command.
+ * @param None
+ * @retval None
+ */
+void Pre_OtCmdProcessing(void)
+{
+ UTIL_SEQ_WaitEvt(EVENT_SYNCHRO_BYPASS_IDLE);
+}
+
+/**
+ * @brief This function waits for getting an acknowledgment from the M0.
+ *
+ * @param None
+ * @retval None
+ */
+static void Wait_Getting_Ack_From_M0(void)
+{
+ UTIL_SEQ_WaitEvt(EVENT_ACK_FROM_M0_EVT);
+}
+
+/**
+ * @brief Receive an acknowledgment from the M0+ core.
+ * Each command send by the M4 to the M0 are acknowledged.
+ * This function is called under interrupt.
+ * @param None
+ * @retval None
+ */
+static void Receive_Ack_From_M0(void)
+{
+ UTIL_SEQ_SetEvt(EVENT_ACK_FROM_M0_EVT);
+}
+
+/**
+ * @brief Receive a notification from the M0+ through the IPCC.
+ * This function is called under interrupt.
+ * @param None
+ * @retval None
+ */
+static void Receive_Notification_From_M0(void)
+{
+ CptReceiveMsgFromM0++;
+ UTIL_SEQ_SetTask(TASK_MSG_FROM_M0_TO_M4,CFG_SCH_PRIO_0);
+}
+
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+#else
+#if (CFG_FULL_LOW_POWER == 0)
+static void RxCpltCallback(void)
+{
+ /* Filling buffer and wait for '\r' char */
+ if (indexReceiveChar < C_SIZE_CMD_STRING)
+ {
+ CommandString[indexReceiveChar++] = aRxBuffer[0];
+ if (aRxBuffer[0] == '\r')
+ {
+ CptReceiveCmdFromUser = 1U;
+
+ /* UART task scheduling*/
+ UTIL_SEQ_SetTask(1U << CFG_TASK_SEND_CLI_TO_M0, CFG_SCH_PRIO_0);
+ }
+ }
+
+ /* Once a character has been sent, put back the device in reception mode */
+ HW_UART_Receive_IT(CFG_CLI_UART, aRxBuffer, 1U, RxCpltCallback);
+}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+/**
+ * @brief Process the command strings.
+ * As soon as a complete command string has been received, the task
+ * in charge of sending the command to the M0 is scheduled
+ * @param None
+ * @retval None
+ */
+static uint32_t ProcessCmdString( uint8_t* buf , uint32_t len )
+{
+ uint32_t i,j,tmp_start;
+ tmp_start = 0;
+ uint32_t res = 0;
+
+ i= 0;
+ while ((buf[i] != '\r') && (i < len))
+ {
+ i++;
+ }
+
+ if (i != len)
+ {
+ memcpy(CommandString, buf,(i+1));
+ indexReceiveChar = i + 1U; /* Length of the buffer containing the command string */
+ UTIL_SEQ_SetTask(1U << CFG_TASK_SEND_CLI_TO_M0, CFG_SCH_PRIO_0);
+ tmp_start = i;
+ for (j = 0; j < (len - tmp_start - 1U) ; j++)
+ {
+ buf[j] = buf[tmp_start + j + 1U];
+ }
+ res = len - tmp_start - 1U;
+ }
+ else
+ {
+ res = len;
+ }
+ return res; /* Remaining characters in the temporary buffer */
+}
+#endif/* (CFG_USB_INTERFACE_ENABLE != 0) */
+
+#if (CFG_FULL_LOW_POWER == 0)
+/**
+ * @brief Process sends receive CLI command to M0.
+ * @param None
+ * @retval None
+ */
+static void Send_CLI_To_M0(void)
+{
+ memset(ThreadCliCmdBuffer.cmdserial.cmd.payload, 0x0U, 255U);
+ memcpy(ThreadCliCmdBuffer.cmdserial.cmd.payload, CommandString, indexReceiveChar);
+ ThreadCliCmdBuffer.cmdserial.cmd.plen = indexReceiveChar;
+ ThreadCliCmdBuffer.cmdserial.cmd.cmdcode = 0x0;
+
+ /* Clear receive buffer, character counter and command complete */
+ CptReceiveCmdFromUser = 0;
+ indexReceiveChar = 0;
+ memset(CommandString, 0, C_SIZE_CMD_STRING);
+
+ TL_CLI_SendCmd();
+}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+
+/**
+ * @brief Send notification for CLI TL Channel.
+ * @param None
+ * @retval None
+ */
+static void Send_CLI_Ack_For_OT(void)
+{
+
+ /* Notify M0 that characters have been sent to UART */
+ TL_THREAD_CliSendAck();
+}
+
+/**
+ * @brief Perform initialization of CLI UART interface.
+ * @param None
+ * @retval None
+ */
+void APP_THREAD_Init_UART_CLI(void)
+{
+#if (CFG_FULL_LOW_POWER == 0)
+ UTIL_SEQ_RegTask( 1<<CFG_TASK_SEND_CLI_TO_M0, UTIL_SEQ_RFU,Send_CLI_To_M0);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+#else
+#if (CFG_FULL_LOW_POWER == 0)
+ MX_USART1_UART_Init();
+ HW_UART_Receive_IT(CFG_CLI_UART, aRxBuffer, 1, RxCpltCallback);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+}
+
+/**
+ * @brief Perform initialization of TL for THREAD.
+ * @param None
+ * @retval None
+ */
+void APP_THREAD_TL_THREAD_INIT(void)
+{
+ ThreadConfigBuffer.p_ThreadOtCmdRspBuffer = (uint8_t*)&ThreadOtCmdBuffer;
+ ThreadConfigBuffer.p_ThreadNotAckBuffer = (uint8_t*)ThreadNotifRspEvtBuffer;
+ ThreadConfigBuffer.p_ThreadCliRspBuffer = (uint8_t*)&ThreadCliCmdBuffer;
+
+ TL_THREAD_Init( &ThreadConfigBuffer );
+}
+
+/**
+ * @brief This function is called when notification on CLI TL Channel from M0+ is received.
+ *
+ * @param Notbuffer : a pointer to TL_EvtPacket_t
+ * @return None
+ */
+void TL_THREAD_CliNotReceived( TL_EvtPacket_t * Notbuffer )
+{
+ TL_CmdPacket_t* l_CliBuffer = (TL_CmdPacket_t*)Notbuffer;
+ uint8_t l_size = l_CliBuffer->cmdserial.cmd.plen;
+
+ /* WORKAROUND: if string to output is "> " then respond directly to M0 and do not output it */
+ if (strcmp((const char *)l_CliBuffer->cmdserial.cmd.payload, "> ") != 0)
+ {
+ /* Write to CLI UART */
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+ VCP_SendData( l_CliBuffer->cmdserial.cmd.payload, l_size, HostTxCb);
+#else
+ HW_UART_Transmit_IT(CFG_CLI_UART, l_CliBuffer->cmdserial.cmd.payload, l_size, HostTxCb);
+#endif /*USAGE_OF_VCP */
+ }
+ else
+ {
+ Send_CLI_Ack_For_OT();
+ }
+}
+
+/**
+ * @brief End of transfer callback for CLI UART sending.
+ *
+ * @param Notbuffer : a pointer to TL_EvtPacket_t
+ * @return None
+ */
+void HostTxCb(void)
+{
+ Send_CLI_Ack_For_OT();
+}
+
+/**
+ * @brief Process the messages coming from the M0.
+ * @param None
+ * @retval None
+ */
+void APP_THREAD_ProcessMsgM0ToM4(void)
+{
+ if (CptReceiveMsgFromM0 != 0)
+ {
+ /* If CptReceiveMsgFromM0 is > 1. it means that we did not serve all the events from the radio */
+ if (CptReceiveMsgFromM0 > 1U)
+ {
+ APP_THREAD_Error(ERR_REC_MULTI_MSG_FROM_M0, 0);
+ }
+ else
+ {
+ OpenThread_CallBack_Processing();
+ }
+ /* Reset counter */
+ CptReceiveMsgFromM0 = 0;
+ }
+}
+
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+/**
+ * @brief This function is called when thereare some data coming
+ * from the Hyperterminal via the USB port
+ * Data received over USB OUT endpoint are sent over CDC interface
+ * through this function.
+ * @param Buf: Buffer of data received
+ * @param Len: Number of data received (in bytes)
+ * @retval Number of characters remaining in the buffer and not yet processed
+ */
+void VCP_DataReceived(uint8_t* Buf , uint32_t *Len)
+{
+ uint32_t i,flag_continue_checking = TRUE;
+ uint32_t char_remaining = 0;
+ static uint32_t len_total = 0;
+
+ /* Copy the characteres in the temporary buffer */
+ for (i = 0; i < *Len; i++)
+ {
+ TmpString[len_total++] = Buf[i];
+ }
+
+ /* Process the buffer commands one by one */
+ /* A command is limited by a \r caracaters */
+ while (flag_continue_checking == TRUE)
+ {
+ char_remaining = ProcessCmdString(TmpString,len_total);
+ /* If char_remaining is equal to len_total, it means that the command string is not yet
+ * completed.
+ * If char_remaining is equal to 0, it means that the command string has
+ * been entirely processed.
+ */
+ if ((char_remaining == 0) || (char_remaining == len_total))
+ {
+ flag_continue_checking = FALSE;
+ }
+ len_total = char_remaining;
+ }
+}
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+
+/* USER CODE BEGIN FD_WRAP_FUNCTIONS */
+
+/* USER CODE END FD_WRAP_FUNCTIONS */
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/STM32_WPAN/App/app_thread.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/STM32_WPAN/App/app_thread.h
new file mode 100644
index 000000000..372303430
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/STM32_WPAN/App/app_thread.h
@@ -0,0 +1,152 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : App/app_thread.h
+ * Description : Header for Thread Application.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_THREAD_H
+#define APP_THREAD_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+/* Private includes ----------------------------------------------------------*/
+#include "tl.h"
+#include "stm32wbxx_core_interface_def.h"
+#include "tl_thread_hci.h"
+
+/* OpenThread Library */
+#include OPENTHREAD_CONFIG_FILE
+
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Exported types ------------------------------------------------------------*/
+
+/* Thread application generic defines */
+/*------------------------------------*/
+typedef enum
+{
+ APP_THREAD_LIMITED,
+ APP_THREAD_FULL,
+} APP_THREAD_InitMode_t;
+
+/* ipv6-addressing defines */
+/*------------------------------------*/
+/* Key Point: A major difference between FTDs and MTDs are that FTDs subscribe to the ff03::2 multicast address.
+ * MTDs do not. */
+
+#define MULICAST_FTD_MED "ff03::1"
+#define MULICAST_FTD_BORDER_ROUTER "ff03::2"
+
+/* Application errors */
+/*------------------------------------*/
+
+/*
+ * List of all errors tracked by the Thread application
+ * running on M4. Some of these errors may be fatal
+ * or just warnings
+ */
+typedef enum
+{
+ ERR_REC_MULTI_MSG_FROM_M0,
+ ERR_THREAD_SET_STATE_CB,
+ ERR_THREAD_SET_CHANNEL,
+ ERR_THREAD_SET_PANID,
+ ERR_THREAD_IPV6_ENABLE,
+ ERR_THREAD_START,
+ ERR_THREAD_ERASE_PERSISTENT_INFO,
+/* USER CODE BEGIN ERROR_APPLI_ENUM */
+ ERR_THREAD_COAP_START,
+ ERR_THREAD_COAP_ADD_RESSOURCE,
+ ERR_THREAD_MESSAGE_READ,
+ ERR_THREAD_COAP_SEND_RESPONSE,
+ ERR_THREAD_COAP_NEW_MSG,
+ ERR_THREAD_COAP_APPEND,
+ ERR_THREAD_COAP_SEND_REQUEST,
+ ERR_THREAD_COAP_DATA_RESPONSE,
+ ERR_THREAD_SETUP,
+ ERR_THREAD_LINK_MODE,
+ ERR_TIMER_INIT,
+ ERR_TIMER_START,
+ ERR_THREAD_MSG_COMPARE_FAILED,
+ ERR_THREAD_BAD_ADDRESS_TYPE,
+ ERR_THREAD_COAP_APEND_URI,
+ ERR_THREAD_FUOTA_NO_KEYWORD,
+ ERR_THREAD_FUOTA_FILE_TYPE_NOT_RECOGNIZED,
+/* USER CODE END ERROR_APPLI_ENUM */
+ ERR_THREAD_CHECK_WIRELESS
+ } ErrAppliIdEnum_t;
+/* USER CODE BEGIN ET */
+typedef enum
+{
+ APP_THREAD_COAP_IP6_ADDRESS,
+ APP_THREAD_COAP_STRING_ADDRESS,
+} APP_THREAD_CoapAddressTypeDef_t;
+
+typedef enum
+{
+ APP_THREAD_OTA_FILE_TYPE_FW_APP,
+ APP_THREAD_OTA_FILE_TYPE_FW_COPRO_WIRELESS,
+} APP_THREAD_OtaFileTypeDef_t;
+
+typedef struct
+{
+ APP_THREAD_OtaFileTypeDef_t file_type;
+ uint32_t binary_size;
+ uint32_t base_address;
+ uint32_t magic_keyword;
+} APP_THREAD_OtaContext_t;
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* External variables --------------------------------------------------------*/
+/* USER CODE BEGIN EV */
+
+/* USER CODE END EV */
+
+/* Exported macros ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions ------------------------------------------------------- */
+void APP_THREAD_Init( void );
+void APP_THREAD_Error(uint32_t ErrId, uint32_t ErrCode);
+void APP_THREAD_RegisterCmdBuffer(TL_CmdPacket_t* p_buffer);
+void APP_THREAD_ProcessMsgM0ToM4(void);
+void APP_THREAD_Init_UART_CLI(void);
+void APP_THREAD_TL_THREAD_INIT(void);
+/* USER CODE BEGIN EF */
+
+/* USER CODE END EF */
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* APP_THREAD_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/STM32_WPAN/Target/hw_ipcc.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/STM32_WPAN/Target/hw_ipcc.c
new file mode 100644
index 000000000..e46eeb94b
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/STM32_WPAN/Target/hw_ipcc.c
@@ -0,0 +1,517 @@
+/**
+ ******************************************************************************
+ * File Name : Target/hw_ipcc.c
+ * Description : Hardware IPCC source file for BLE
+ * Middleware.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "mbox_def.h"
+
+/* Global variables ---------------------------------------------------------*/
+/* Private defines -----------------------------------------------------------*/
+#define HW_IPCC_TX_PENDING( channel ) ( !(LL_C1_IPCC_IsActiveFlag_CHx( IPCC, channel )) ) && (((~(IPCC->C1MR)) & (channel << 16U)))
+#define HW_IPCC_RX_PENDING( channel ) (LL_C2_IPCC_IsActiveFlag_CHx( IPCC, channel )) && (((~(IPCC->C1MR)) & (channel << 0U)))
+
+/* Private macros ------------------------------------------------------------*/
+/* Private typedef -----------------------------------------------------------*/
+/* Private variables ---------------------------------------------------------*/
+static void (*FreeBufCb)( void );
+
+/* Private function prototypes -----------------------------------------------*/
+static void HW_IPCC_BLE_EvtHandler( void );
+static void HW_IPCC_BLE_AclDataEvtHandler( void );
+static void HW_IPCC_MM_FreeBufHandler( void );
+static void HW_IPCC_SYS_CmdEvtHandler( void );
+static void HW_IPCC_SYS_EvtHandler( void );
+static void HW_IPCC_TRACES_EvtHandler( void );
+
+#ifdef THREAD_WB
+static void HW_IPCC_OT_CmdEvtHandler( void );
+static void HW_IPCC_THREAD_NotEvtHandler( void );
+static void HW_IPCC_THREAD_CliNotEvtHandler( void );
+#endif
+
+#ifdef MAC_802_15_4_WB
+static void HW_IPCC_MAC_802_15_4_CmdEvtHandler( void );
+static void HW_IPCC_MAC_802_15_4_NotEvtHandler( void );
+#endif
+
+#ifdef ZIGBEE_WB
+static void HW_IPCC_ZIGBEE_CmdEvtHandler( void );
+static void HW_IPCC_ZIGBEE_StackNotifEvtHandler( void );
+static void HW_IPCC_ZIGBEE_CliNotifEvtHandler( void );
+#endif
+
+/* Public function definition -----------------------------------------------*/
+
+/******************************************************************************
+ * INTERRUPT HANDLER
+ ******************************************************************************/
+void HW_IPCC_Rx_Handler( void )
+{
+ if (HW_IPCC_RX_PENDING( HW_IPCC_SYSTEM_EVENT_CHANNEL ))
+ {
+ HW_IPCC_SYS_EvtHandler();
+ }
+#ifdef MAC_802_15_4_WB
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL ))
+ {
+ HW_IPCC_MAC_802_15_4_NotEvtHandler();
+ }
+#endif /* MAC_802_15_4_WB */
+#ifdef THREAD_WB
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL ))
+ {
+ HW_IPCC_THREAD_NotEvtHandler();
+ }
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL ))
+ {
+ HW_IPCC_THREAD_CliNotEvtHandler();
+ }
+#endif /* THREAD_WB */
+#ifdef ZIGBEE_WB
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL ))
+ {
+ HW_IPCC_ZIGBEE_StackNotifEvtHandler();
+ }
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL ))
+ {
+ HW_IPCC_ZIGBEE_CliNotifEvtHandler();
+ }
+#endif /* ZIGBEE_WB */
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_BLE_EVENT_CHANNEL ))
+ {
+ HW_IPCC_BLE_EvtHandler();
+ }
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_TRACES_CHANNEL ))
+ {
+ HW_IPCC_TRACES_EvtHandler();
+ }
+
+ return;
+}
+
+void HW_IPCC_Tx_Handler( void )
+{
+ if (HW_IPCC_TX_PENDING( HW_IPCC_SYSTEM_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_SYS_CmdEvtHandler();
+ }
+#ifdef MAC_802_15_4_WB
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_MAC_802_15_4_CmdEvtHandler();
+ }
+#endif /* MAC_802_15_4_WB */
+#ifdef THREAD_WB
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_OT_CmdEvtHandler();
+ }
+#endif /* THREAD_WB */
+#ifdef ZIGBEE_WB
+ if (HW_IPCC_TX_PENDING( HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_ZIGBEE_CmdEvtHandler();
+ }
+#endif /* ZIGBEE_WB */
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_SYSTEM_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_SYS_CmdEvtHandler();
+ }
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_MM_RELEASE_BUFFER_CHANNEL ))
+ {
+ HW_IPCC_MM_FreeBufHandler();
+ }
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_HCI_ACL_DATA_CHANNEL ))
+ {
+ HW_IPCC_BLE_AclDataEvtHandler();
+ }
+
+ return;
+}
+/******************************************************************************
+ * GENERAL
+ ******************************************************************************/
+void HW_IPCC_Enable( void )
+{
+ /**
+ * In case the SBSFU is implemented, it may have already set the C2BOOT bit to startup the CPU2.
+ * In that case, to keep the mechanism transparent to the user application, it shall call the system command
+ * SHCI_C2_Reinit( ) before jumping to the application.
+ * When the CPU2 receives that command, it waits for its event input to be set to restart the CPU2 firmware.
+ * This is required because once C2BOOT has been set once, a clear/set on C2BOOT has no effect.
+ * When SHCI_C2_Reinit( ) is not called, generating an event to the CPU2 does not have any effect
+ * So, by default, the application shall both set the event flag and set the C2BOOT bit.
+ */
+ __SEV( ); /* Set the internal event flag and send an event to the CPU2 */
+ __WFE( ); /* Clear the internal event flag */
+ LL_PWR_EnableBootC2( );
+
+ return;
+}
+
+void HW_IPCC_Init( void )
+{
+ LL_AHB3_GRP1_EnableClock( LL_AHB3_GRP1_PERIPH_IPCC );
+
+ LL_C1_IPCC_EnableIT_RXO( IPCC );
+ LL_C1_IPCC_EnableIT_TXF( IPCC );
+
+ HAL_NVIC_EnableIRQ(IPCC_C1_RX_IRQn);
+ HAL_NVIC_EnableIRQ(IPCC_C1_TX_IRQn);
+
+ return;
+}
+
+/******************************************************************************
+ * BLE
+ ******************************************************************************/
+void HW_IPCC_BLE_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_BLE_EVENT_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_BLE_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_BLE_CMD_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_BLE_EvtHandler( void )
+{
+ HW_IPCC_BLE_RxEvtNot();
+
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_BLE_EVENT_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_BLE_SendAclData( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_HCI_ACL_DATA_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_HCI_ACL_DATA_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_BLE_AclDataEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_HCI_ACL_DATA_CHANNEL );
+
+ HW_IPCC_BLE_AclDataAckNot();
+
+ return;
+}
+
+__weak void HW_IPCC_BLE_AclDataAckNot( void ){};
+__weak void HW_IPCC_BLE_RxEvtNot( void ){};
+
+/******************************************************************************
+ * SYSTEM
+ ******************************************************************************/
+void HW_IPCC_SYS_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_SYSTEM_EVENT_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_SYS_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_SYSTEM_CMD_RSP_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_SYSTEM_CMD_RSP_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_SYS_CmdEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_SYSTEM_CMD_RSP_CHANNEL );
+
+ HW_IPCC_SYS_CmdEvtNot();
+
+ return;
+}
+
+static void HW_IPCC_SYS_EvtHandler( void )
+{
+ HW_IPCC_SYS_EvtNot();
+
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_SYSTEM_EVENT_CHANNEL );
+
+ return;
+}
+
+__weak void HW_IPCC_SYS_CmdEvtNot( void ){};
+__weak void HW_IPCC_SYS_EvtNot( void ){};
+
+/******************************************************************************
+ * MAC 802.15.4
+ ******************************************************************************/
+#ifdef MAC_802_15_4_WB
+void HW_IPCC_MAC_802_15_4_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_MAC_802_15_4_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_MAC_802_15_4_SendAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_MAC_802_15_4_CmdEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL );
+
+ HW_IPCC_MAC_802_15_4_CmdEvtNot();
+
+ return;
+}
+
+static void HW_IPCC_MAC_802_15_4_NotEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_MAC_802_15_4_EvtNot();
+
+ return;
+}
+__weak void HW_IPCC_MAC_802_15_4_CmdEvtNot( void ){};
+__weak void HW_IPCC_MAC_802_15_4_EvtNot( void ){};
+#endif
+
+/******************************************************************************
+ * THREAD
+ ******************************************************************************/
+#ifdef THREAD_WB
+void HW_IPCC_THREAD_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_OT_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_CLI_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_THREAD_CLI_CMD_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_THREAD_SendAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_THREAD_CliSendAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_OT_CmdEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+
+ HW_IPCC_OT_CmdEvtNot();
+
+ return;
+}
+
+static void HW_IPCC_THREAD_NotEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_THREAD_EvtNot();
+
+ return;
+}
+
+static void HW_IPCC_THREAD_CliNotEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_THREAD_CliEvtNot();
+
+ return;
+}
+
+__weak void HW_IPCC_OT_CmdEvtNot( void ){};
+__weak void HW_IPCC_CLI_CmdEvtNot( void ){};
+__weak void HW_IPCC_THREAD_EvtNot( void ){};
+
+#endif /* THREAD_WB */
+
+/******************************************************************************
+ * ZIGBEE
+ ******************************************************************************/
+#ifdef ZIGBEE_WB
+void HW_IPCC_ZIGBEE_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_ZIGBEE_SendAppliCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_ZIGBEE_SendCliCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_THREAD_CLI_CMD_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_ZIGBEE_SendAppliCmdAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_ZIGBEE_SendCliCmdAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_ZIGBEE_CmdEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+
+ HW_IPCC_ZIGBEE_AppliCmdNotification();
+
+ return;
+}
+
+static void HW_IPCC_ZIGBEE_StackNotifEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_ZIGBEE_AppliAsyncEvtNotification();
+
+ return;
+}
+
+static void HW_IPCC_ZIGBEE_CliNotifEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_ZIGBEE_CliEvtNotification();
+
+ return;
+}
+
+__weak void HW_IPCC_ZIGBEE_AppliCmdNotification( void ){};
+__weak void HW_IPCC_ZIGBEE_AppliAsyncEvtNotification( void ){};
+__weak void HW_IPCC_ZIGBEE_CliEvtNotification( void ){};
+#endif /* ZIGBEE_WB */
+
+/******************************************************************************
+ * MEMORY MANAGER
+ ******************************************************************************/
+void HW_IPCC_MM_SendFreeBuf( void (*cb)( void ) )
+{
+ if ( LL_C1_IPCC_IsActiveFlag_CHx( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL ) )
+ {
+ FreeBufCb = cb;
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+ }
+ else
+ {
+ cb();
+
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+ }
+
+ return;
+}
+
+static void HW_IPCC_MM_FreeBufHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+
+ FreeBufCb();
+
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+
+ return;
+}
+
+/******************************************************************************
+ * TRACES
+ ******************************************************************************/
+void HW_IPCC_TRACES_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_TRACES_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_TRACES_EvtHandler( void )
+{
+ HW_IPCC_TRACES_EvtNot();
+
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_TRACES_CHANNEL );
+
+ return;
+}
+
+__weak void HW_IPCC_TRACES_EvtNot( void ){};
+
+/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/readme.txt b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/readme.txt
new file mode 100644
index 000000000..19fbdcf05
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_Ota_Server/readme.txt
@@ -0,0 +1,228 @@
+/**
+ @page Thread_Ota_Server application
+
+ @verbatim
+ ******************************************************************************
+ * @file Thread/Thread_Ota_Server/readme.txt
+ * @author MCD Application Team
+ * @brief Description of Thread Ota Server Application
+ ******************************************************************************
+ *
+ * Copyright (c) 2019 STMicroelectronics. All rights reserved.
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ @endverbatim
+
+@par Application Description
+
+How to update Over The Air (OTA) FW application and Copro Wireless binary using Thread.
+
+This application requires two STM32WB55xx boards.
+
+In a Thread network, nodes are split into two forwarding roles: Router or End Device.
+The Thread Leader is a Router that is responsible for managing the set of Routers in a
+Thread network. An End Device (or child) communicates primarily with a single Router.
+
+In our Application which uses two devices, one device will act as a Leader (Router)
+and the other one will act as an End Device(mode child)
+
+After the reset of the 2 boards, one board will be in Leader mode (Green LED2 ON)
+The other one will be in Child mode (Red LED3 ON)
+
+This Thread application provides implementation example for Updating FW on Application
+side and on Copro Wireless side.
+Thread_Ota_Server can communicate only with Thread_Ota application.
+
+IMPORTANT PREREQUISITES:
+On Thread_Ota_Server a binary image has to be loaded at @0x08010000 before starting the process.
+It can be FW application example (compatible with Ota settings, see Thread_Coap_Generic_Ota for details)
+or encrypted Copro Wireless binary.
+
+
+Following diagram describes the Update procedure:
+ ____________________________________ ______________________________________
+ | Device 1 | | Device 2 |
+ | Thread_Ota_Server | | Thread_Ota |
+ |___________________________________| |_____________________________________|
+ | | | |
+ | Before starting FW for update | | At startup, application performs |
+ | must be written at following | | a delete of FLASH memory sectors |
+ | @ = 0x08010000 | | starting from @ = 0x08010000 |
+ | | | to SFSA (Option Byte) limit |
+ | | | |
+ | Get Mesh-Local EID | | |
+ | (Endpoint Identifier) of | | |
+ | Thread_Ota device | | |
+ | | | |
+ | Push Button -----> | | |
+ | - SW1 (OTA for APP Update) | | |
+ | - SW3 (OTA for Copro Update) | | |
+ | | ====== COAP REQUEST =========> | |
+ | | Resource: "FUOTA_PROVISIONING" | |
+ | | Mode: Multicast | |
+ | | Type: Confirmable | returns Mesh-Local EID |
+ | | Code: Get | |
+ | | Payload : OtaContext | | |
+ | | | |
+ |Thread_Ota Mesh-Local EID received | <=====COAP CONFIRMATION ====== | |
+ | | | |
+ | | | |
+ | | | |
+ | Send FUOTA parameters: | ============> COAP =========> | |
+ | - File Type (App or Corpro) | Resource: "FUOTA_PARAMETERS" | |
+ | - Base address for the download | Mode: Unicast | Saves FUOTA parameters |
+ | - Magic Keyword | Type: Confirmable | and confirms |
+ | | Code: Put | |
+ | | | |
+ | Waits for confirmation | <=====COAP CONFIRMATION ====== | |
+ | | | |
+ | Once confirmation received | | |
+ | ->Starts FUOTA data transfer | | |
+ | | | |
+ | | | |
+ |--> Data Transfer | ============> COAP =========> | BLUE LED TOGGLING |
+ || (400 bytes Payload) | Resource: "FUOTA_SEND" | |
+ || | Mode: Unicast | |
+ || | Type: Confirmable | Each time data buffer is received |
+ || | Code: Put | writes it to FLASH memory |
+ || | Payload : Buffer[] | |
+ || | | |
+ || Ack received | <=====COAP CONFIRMATION ====== | |
+ || | | | |
+ || V | | |
+ || /\ | | |
+ || / \ | | |
+ || / \ | | |
+ || / \ | | |
+ || / \ | | |
+ || NO / END OF \ | | |
+ | --------- / TRASNFER? \ | | |
+ | \ (MAGIC / | | |
+ | \ KEYWORD / | | |
+ | \ FOUND) / | | |
+ | \ / | | |
+ | \ / | | |
+ | \ / | | |
+ | \/ | | |
+ | YES | | | |
+ | | | | |
+ | V | | |
+ | Display FUOTA Transfer details: | | At the end of data transfer |
+ | - Payload size used | | - BLUE LED OFF |
+ | - Transfer Time | | - Reboot the application |
+ | - Average Throughput | | |
+ | | | |
+ | | | On Reboot: |
+ | | | -if File_Type is FW_APP, boot on |
+ | | | Thread_Coap_Generic_Ota or any |
+ | | | appilcation supporting Ota at |
+ | | | @ 0x10000 |
+ | | | (see Thread_Coap_Generic_Ota) |
+ | | | |
+ | | | -if File_Type is FW_COPRO_WIRELESS |
+ | | | boot on FUS. |
+ | | | FUS will then install encrypted |
+ | | | binary on Copro Wireless side. |
+ | | | |
+ | | | |
+ | | | |
+ -------------------------------- - --------------------------------------
+ | Role : Leader | | Role : Child |
+ | | | |
+ | LED : Green | | LED : Red |
+ | | | |
+ |___________________________________| |_____________________________________|
+
+
+@par Keywords
+
+COAP,Thread
+
+@par Directory contents
+
+ - Thread/Thread_Ota_Server/Core/Inc/app_common.h Header for all modules with common definition
+ - Thread/Thread_Ota_Server/Core/Inc/app_conf.h Parameters configuration file of the application
+ - Thread/Thread_Ota_Server/Core/Inc/app_entry.h Parameters configuration file of the application
+ - Thread/Thread_Ota_Server/STM32_WPAN/App/app_thread.h Header for app_thread.c module
+ - Thread/Thread_Ota_Server/Core/Inc/hw_conf.h Configuration file of the HW
+ - Thread/Thread_Ota_Server/Core/Inc/main.h Header for main.c module
+ - Thread/Thread_Ota_Server/Core/Inc/stm_logging.h Header for stm_logging.c module
+ - Thread/Thread_Ota_Server/Core/Inc/stm32wbxx_hal_conf.h HAL configuration file
+ - Thread/Thread_Ota_Server/Core/Src/stm32wbxx_it.h Interrupt header file
+ - Thread/Thread_Ota_Server/Core/Inc/utilities_conf.h Configuration file of the utilities
+ - Thread/Thread_Ota_Server/Core/Src/app_entry.c Initialization of the application
+ - Thread/Thread_Ota_Server/STM32_WPAN/App/app_thread.c Thread application implementation
+ - Thread/Thread_Ota_Server/STM32_WPAN/Target/hw_ipcc.c IPCC Driver
+ - Thread/Thread_Ota_Server/Core/Src/stm32_lpm_if.c Low Power Manager Interface
+ - Thread/Thread_Ota_Server/Core/Src/hw_timerserver.c Timer Server Driver
+ - Thread/Thread_Ota_Server/Core/Src/hw_uart.c UART driver
+ - Thread/Thread_Ota_Server/Core/Src/main.c Main program
+ - Thread/Thread_Ota_Server/Core/Src/stm_logging.c Logging module for traces
+ - Thread/Thread_Ota_Server/Core/Src/stm32xx_it.c Interrupt handlers
+ - Thread/Thread_Ota_Server/Core/Src/system_stm32wbxx.c stm32wbxx system source file
+
+
+@par Hardware and Software environment
+
+ - This example runs on STM32WB55xx devices (Nucleo board and dongle)
+
+ - This example has been tested with an STMicroelectronics STM32WB55xx_Nucleo
+ board and can be easily tailored to any other supported device
+ and development board.
+
+ - On STM32WB55RG_Nucleo, the jumpers must be configured as described
+ in this section. Starting from the top left position up to the bottom
+ right position, the jumpers on the Board must be set as follows:
+
+ CN11: GND [OFF]
+ JP4: VDDRF [ON]
+ JP6: VC0 [ON]
+ JP2: +3V3 [ON]
+ JP1: USB_STL [ON] All others [OFF]
+ CN12: GND [OFF]
+ CN7: <All> [OFF]
+ JP3: VDD_MCU [ON]
+ JP5: GND [OFF] All others [ON]
+ CN10: <All> [OFF]
+
+
+@par How to use it ?
+
+This application requests having the stm32wb5x_Thread_FTD_fw.bin binary flashed on the Wireless Coprocessor.
+If it is not the case, you need to use STM32CubeProgrammer to load the appropriate binary.
+All available binaries are located under /Projects/STM32_Copro_Wireless_Binaries directory.
+Refer to UM2237 to learn how to use/install STM32CubeProgrammer.
+Refer to /Projects/STM32_Copro_Wireless_Binaries/ReleaseNote.html for the detailed procedure to change the
+Wireless Coprocessor binary.
+
+
+In order to make the program work, you must do the following:
+ - Connect 2 STM32WB55xx_Nucleo boards to your PC
+ - Open your preferred toolchain
+ - Rebuild all files and load your image into target memory
+ - Run the application
+
+
+For more details refer to the Application Note:
+ AN5289 - Building a Wireless application
+
+ if you want to get the traces in real time, you can connect an HyperTerminal
+ via an UART RS232 cable using the following connections:
+ RXD: CN10(Pin35)
+ TXD: CN10(Pin37)
+
+ For the Cli control and for the traces, the UART must be configured as follows:
+ - BaudRate = 115200 baud
+ - Word Length = 8 Bits
+ - Stop Bit = 1 bit
+ - Parity = none
+ - Flow control = none
+
+ * <h3><center>&copy; COPYRIGHT STMicroelectronics</center></h3>
+ */
+ \ No newline at end of file
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Inc/app_conf.h
index b06b33a13..a995d5c28 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Inc/app_conf.h
@@ -23,6 +23,7 @@
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Application Config
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Inc/stm32_lpm_if.h
index 45db98456..70abecaa9 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Inc/stm32_lpm_if.h
@@ -1,21 +1,21 @@
/* USER CODE BEGIN Header */
/**
- ******************************************************************************
- * File Name : stm32_lpm_if.h
- * Description : Header for stm32_lpm_f.c module (device specific LP management).
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
+******************************************************************************
+* @file stm32_lpm_if.h
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
+******************************************************************************
+* @attention
+*
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+* All rights reserved.</center></h2>
+*
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+*
+******************************************************************************
+*/
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
@@ -65,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Inc/stm32wbxx_it.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Inc/stm32wbxx_it.h
index cd908565d..06fb5e173 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Inc/stm32wbxx_it.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Inc/stm32wbxx_it.h
@@ -28,7 +28,7 @@
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
-
+#include "app_common.h"
/* USER CODE END Includes */
/* Exported types ------------------------------------------------------------*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Inc/utilities_conf.h
index 2c5384639..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Inc/utilities_conf.h
@@ -10,10 +10,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Src/hw_timerserver.c
index 17c9af0a4..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Src/hw_timerserver.c
@@ -4,19 +4,18 @@
* Description : Hardware timerserver source file for STM32WPAN Middleware.
*
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Src/hw_uart.c
index ac245a96f..9a553610d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Src/hw_uart.c
@@ -48,9 +48,8 @@ extern UART_HandleTypeDef huart1;
hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
} while(0)
- /* Variables ------------------------------------------------------------------*/
+/* Variables -----------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
-
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
#endif
@@ -59,7 +58,6 @@ extern UART_HandleTypeDef huart1;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
-
#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_hlpuart1_tx ={0};
#endif
@@ -67,73 +65,73 @@ extern UART_HandleTypeDef huart1;
void (*HW_hlpuart1TxCb)(void);
#endif
- void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_RX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_RX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_RX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_RX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ return;
+}
+
+void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
{
- HAL_StatusTypeDef hal_status = HAL_OK;
- hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
+ default:
+ break;
}
switch (hal_status)
@@ -163,8 +161,8 @@ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t
hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
{
-HAL_StatusTypeDef hal_status = HAL_OK;
-hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
@@ -252,33 +250,33 @@ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
switch ((uint32_t)huart->Instance)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1RxCb)
- {
- HW_huart1RxCb();
- }
- break;
+ if(HW_huart1RxCb)
+ {
+ HW_huart1RxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1RxCb)
- {
- HW_hlpuart1RxCb();
- }
- break;
+ if(HW_hlpuart1RxCb)
+ {
+ HW_hlpuart1RxCb();
+ }
+ break;
#endif
default:
@@ -294,20 +292,20 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1TxCb)
- {
- HW_huart1TxCb();
- }
- break;
+ if(HW_huart1TxCb)
+ {
+ HW_huart1TxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1TxCb)
- {
- HW_hlpuart1TxCb();
- }
- break;
+ if(HW_hlpuart1TxCb)
+ {
+ HW_hlpuart1TxCb();
+ }
+ break;
#endif
default:
@@ -317,4 +315,4 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
return;
}
- /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Src/main.c
index cdd8d69f7..47f1afdcb 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Src/main.c
@@ -202,17 +202,20 @@ void SystemClock_Config(void)
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
+ /** Configure LSE Drive Capability
+ */
+ __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
/** Configure the main internal regulator output voltage
*/
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
/** Initializes the CPU, AHB and APB busses clocks
*/
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSI1
- |RCC_OSCILLATORTYPE_HSE;
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE
+ |RCC_OSCILLATORTYPE_LSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ RCC_OscInitStruct.LSEState = RCC_LSE_ON;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
- RCC_OscInitStruct.LSIState = RCC_LSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
@@ -241,8 +244,8 @@ void SystemClock_Config(void)
|RCC_PERIPHCLK_LPUART1;
PeriphClkInitStruct.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2;
PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1;
- PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI;
- PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSI;
+ PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
+ PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSE;
PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSE;
PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE0;
@@ -432,6 +435,7 @@ static void MX_GPIO_Init(void)
{
/* GPIO Ports Clock Enable */
+ __HAL_RCC_GPIOC_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
@@ -444,6 +448,12 @@ void PeriphClock_Config(void)
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -477,30 +487,6 @@ void PeriphClock_Config(void)
HAL_RCCEx_CRSConfig(&RCC_CRSInitStruct);
#endif
- /**
- * Select LSE clock
- */
- LL_RCC_LSE_Enable();
- while(!LL_RCC_LSE_IsReady());
-
- /**
- * Select wakeup source of BLE RF
- */
- LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
-
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
/*************************************************************
@@ -593,6 +579,7 @@ static void Reset_BackupDomain( void )
return;
}
+
static void Init_Exti( void )
{
/**< Disable all wakeup interrupt on CPU1 except IPCC(36), HSEM(38) */
@@ -601,6 +588,40 @@ static void Init_Exti( void )
return;
}
+
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+void HAL_Delay(uint32_t Delay)
+{
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
+
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
+}
/* USER CODE END 4 */
/* USER CODE BEGIN Header_StartDefaultTask */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Src/stm32_lpm_if.c
index 4a9724ef2..68153652a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -266,6 +266,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Src/stm32wbxx_hal_msp.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Src/stm32wbxx_hal_msp.c
index 1274d67d5..b1680097d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Src/stm32wbxx_hal_msp.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Core/Src/stm32wbxx_hal_msp.c
@@ -99,8 +99,6 @@ void HAL_MspInit(void)
HAL_NVIC_SetPriority(FPU_IRQn, 5, 0);
HAL_NVIC_EnableIRQ(FPU_IRQn);
- /* Disable the internal Pull-Up in Dead Battery pins of UCPD peripheral */
-
/* USER CODE BEGIN MspInit 1 */
HAL_NVIC_SetPriority(IPCC_C1_RX_IRQn , 15, 0);
HAL_NVIC_SetPriority(IPCC_C1_TX_IRQn , 15, 0);
@@ -169,20 +167,11 @@ void HAL_UART_MspInit(UART_HandleTypeDef* huart)
/* Peripheral clock enable */
__HAL_RCC_USART1_CLK_ENABLE();
- __HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
/**USART1 GPIO Configuration
- PA11 ------> USART1_CTS
PB6 ------> USART1_TX
PB7 ------> USART1_RX
*/
- GPIO_InitStruct.Pin = GPIO_PIN_11;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
- GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
@@ -258,12 +247,9 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
__HAL_RCC_USART1_CLK_DISABLE();
/**USART1 GPIO Configuration
- PA11 ------> USART1_CTS
PB6 ------> USART1_TX
PB7 ------> USART1_RX
*/
- HAL_GPIO_DeInit(GPIOA, GPIO_PIN_11);
-
HAL_GPIO_DeInit(GPIOB, GPIO_PIN_6|GPIO_PIN_7);
/* USART1 DMA DeInit */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/STM32_WPAN/App/app_thread.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/STM32_WPAN/App/app_thread.c
index d279fea72..d9b977353 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/STM32_WPAN/App/app_thread.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/STM32_WPAN/App/app_thread.c
@@ -47,9 +47,9 @@
/* USER CODE END PTD */
/* Private defines -----------------------------------------------------------*/
-#define C_SIZE_CMD_STRING 256U
-#define C_PANID 0x2222U
-#define C_CHANNEL_NB 12U
+#define C_SIZE_CMD_STRING 256U
+#define C_PANID 0x2222U
+#define C_CHANNEL_NB 12U
/* FreeRtos stacks attributes */
const osThreadAttr_t ThreadMsgM0ToM4Process_attr = {
@@ -109,7 +109,9 @@ static void APP_THREAD_CheckWirelessFirmwareInfo(void);
static void APP_THREAD_DeviceConfig(void);
static void APP_THREAD_StateNotif(uint32_t NotifFlags, void *pContext);
static void APP_THREAD_TraceError(const char * pMess, uint32_t ErrCode);
+#if (CFG_FULL_LOW_POWER == 0)
static void Send_CLI_To_M0(void);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
static void Send_CLI_Ack_For_OT(void);
static void HostTxCb( void );
static void Wait_Getting_Ack_From_M0(void);
@@ -124,12 +126,16 @@ extern void MX_USART1_UART_Init(void);
#if (CFG_USB_INTERFACE_ENABLE != 0)
static uint32_t ProcessCmdString(uint8_t* buf , uint32_t len);
#else
+#if (CFG_FULL_LOW_POWER == 0)
static void RxCpltCallback(void);
-#endif
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
/* FreeRTos wrapper functions */
static void APP_THREAD_FreeRTOSProcessMsgM0ToM4Task(void *argument);
+#if (CFG_FULL_LOW_POWER == 0)
static void APP_THREAD_FreeRTOSSendCLIToM0Task(void *argument);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
/* USER CODE BEGIN PFP */
static void APP_THREAD_SendCoapMsg(void);
@@ -157,9 +163,14 @@ static uint8_t TmpString[C_SIZE_CMD_STRING];
static uint8_t VcpRxBuffer[sizeof(TL_CmdSerial_t)]; /* Received Data over USB are stored in this buffer */
static uint8_t VcpTxBuffer[sizeof(TL_EvtPacket_t) + 254U]; /* Transmit buffer over USB */
#else
+#if (CFG_FULL_LOW_POWER == 0)
static uint8_t aRxBuffer[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+
+#if (CFG_FULL_LOW_POWER == 0)
static uint8_t CommandString[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
static __IO uint16_t indexReceiveChar = 0;
static __IO uint16_t CptReceiveCmdFromUser = 0;
@@ -174,7 +185,9 @@ PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t ThreadNotifRspEvtBuffer[size
PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static TL_CmdPacket_t ThreadCliCmdBuffer;
static osThreadId_t OsTaskMsgM0ToM4Id; /* Task managing the M0 to M4 messaging */
+#if (CFG_FULL_LOW_POWER == 0)
static osThreadId_t OsTaskCliId; /* Task used to manage CLI comamnd */
+#endif /* (CFG_FULL_LOW_POWER == 0) */
/* USER CODE BEGIN PV */
static otCoapResource OT_Ressource = {C_RESSOURCE, APP_THREAD_DummyReqHandler, (void*)APP_THREAD_CoapRequestHandler, NULL};
@@ -187,8 +200,6 @@ static otLinkModeConfig OT_LinkMode = {0};
static uint32_t sleepyEndDeviceFlag = FALSE;
static osThreadId_t OsTaskSendCoapMsgId; /* Task managing the COAP transfer */
static osThreadId_t OsTaskSetSedModeId; /* Task managing the switch to Thread SED mode */
-/*static osThreadId_t OsTaskCliCmdToM0Id;*/ /* Task managing the Cli commands */
-
/*--Debug counters--------------------------------*/
static uint32_t DebugCoapCpt = 0;
@@ -205,7 +216,7 @@ void APP_THREAD_Init( void )
/* USER CODE END APP_THREAD_INIT_1 */
SHCI_CmdStatus_t ThreadInitStatus;
-
+
/* Check the compatibility with the Coprocessor Wireless Firmware loaded */
APP_THREAD_CheckWirelessFirmwareInfo();
@@ -262,11 +273,11 @@ void APP_THREAD_Init( void )
}
/**
- * @brief Trace the error or the warning reported.
- * @param ErrId :
- * @param ErrCode
- * @retval None
- */
+ * @brief Trace the error or the warning reported.
+ * @param ErrId :
+ * @param ErrCode
+ * @retval None
+ */
void APP_THREAD_Error(uint32_t ErrId, uint32_t ErrCode)
{
/* USER CODE BEGIN APP_THREAD_Error_1 */
@@ -275,7 +286,7 @@ void APP_THREAD_Error(uint32_t ErrId, uint32_t ErrCode)
switch(ErrId)
{
case ERR_REC_MULTI_MSG_FROM_M0 :
- APP_THREAD_TraceError("ERROR : ERR_REC_MULTI_MSG_FROM_M0 ",ErrCode);
+ APP_THREAD_TraceError("ERROR : ERR_REC_MULTI_MSG_FROM_M0 ", ErrCode);
break;
case ERR_THREAD_SET_STATE_CB :
APP_THREAD_TraceError("ERROR : ERR_THREAD_SET_STATE_CB ",ErrCode);
@@ -460,13 +471,13 @@ static void APP_THREAD_StateNotif(uint32_t NotifFlags, void *pContext)
}
/**
- * @brief Warn the user that an error has occurred.In this case,
- * the LEDs on the Board will start blinking.
- *
- * @param pMess : Message associated to the error.
- * @param ErrCode: Error code associated to the module (OpenThread or other module if any)
- * @retval None
- */
+ * @brief Warn the user that an error has occurred.In this case,
+ * the LEDs on the Board will start blinking.
+ *
+ * @param pMess : Message associated to the error.
+ * @param ErrCode: Error code associated to the module (OpenThread or other module if any)
+ * @retval None
+ */
static void APP_THREAD_TraceError(const char * pMess, uint32_t ErrCode)
{
/* USER CODE BEGIN TRACE_ERROR */
@@ -544,6 +555,7 @@ static void APP_THREAD_FreeRTOSProcessMsgM0ToM4Task(void *argument)
}
}
+#if (CFG_FULL_LOW_POWER == 0)
static void APP_THREAD_FreeRTOSSendCLIToM0Task(void *argument)
{
UNUSED(argument);
@@ -559,6 +571,7 @@ static void APP_THREAD_FreeRTOSSendCLIToM0Task(void *argument)
/* USER END END APP_THREAD_FREERTOS_SEND_CLI_TO_M0_2 */
}
}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
/* USER CODE BEGIN FREERTOS_WRAPPER_FUNCTIONS */
static void APP_THREAD_FreeRTOSSetModeTask(void *argument)
@@ -801,7 +814,6 @@ void APP_THREAD_RegisterCmdBuffer(TL_CmdPacket_t* p_buffer)
p_thread_otcmdbuffer = p_buffer;
}
-
Thread_OT_Cmd_Request_t* THREAD_Get_OTCmdPayloadBuffer(void)
{
return (Thread_OT_Cmd_Request_t*)p_thread_otcmdbuffer->cmdserial.cmd.payload;
@@ -887,10 +899,10 @@ void Pre_OtCmdProcessing(void)
*/
static void Wait_Getting_Ack_From_M0(void)
{
- while (FlagReceiveAckFromM0 == 0)
- {
- }
- FlagReceiveAckFromM0 = 0;
+ while (FlagReceiveAckFromM0 == 0)
+ {
+ }
+ FlagReceiveAckFromM0 = 0;
}
/**
@@ -902,7 +914,7 @@ static void Wait_Getting_Ack_From_M0(void)
*/
static void Receive_Ack_From_M0(void)
{
- FlagReceiveAckFromM0 = 1;
+ FlagReceiveAckFromM0 = 1;
}
/**
@@ -919,6 +931,7 @@ static void Receive_Notification_From_M0(void)
#if (CFG_USB_INTERFACE_ENABLE != 0)
#else
+#if (CFG_FULL_LOW_POWER == 0)
static void RxCpltCallback(void)
{
/* Filling buffer and wait for '\r' char */
@@ -937,6 +950,7 @@ static void RxCpltCallback(void)
/* Once a character has been sent, put back the device in reception mode */
HW_UART_Receive_IT(CFG_CLI_UART, aRxBuffer, 1U, RxCpltCallback);
}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
#if (CFG_USB_INTERFACE_ENABLE != 0)
@@ -979,6 +993,8 @@ static uint32_t ProcessCmdString( uint8_t* buf , uint32_t len )
}
#endif/* (CFG_USB_INTERFACE_ENABLE != 0) */
+#if (CFG_FULL_LOW_POWER == 0)
+#if (CFG_FULL_LOW_POWER == 0)
/**
* @brief Process sends receive CLI command to M0.
* @param None
@@ -998,6 +1014,8 @@ static void Send_CLI_To_M0(void)
TL_CLI_SendCmd();
}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+#endif /* (CFG_FULL_LOW_POWER == 0) */
/**
* @brief Send notification for CLI TL Channel.
@@ -1018,13 +1036,16 @@ static void Send_CLI_Ack_For_OT(void)
*/
void APP_THREAD_Init_UART_CLI(void)
{
-
+#if (CFG_FULL_LOW_POWER == 0)
OsTaskCliId = osThreadNew(APP_THREAD_FreeRTOSSendCLIToM0Task, NULL,&ThreadCliProcess_attr);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#if (CFG_USB_INTERFACE_ENABLE != 0)
#else
+#if (CFG_FULL_LOW_POWER == 0)
MX_USART1_UART_Init();
HW_UART_Receive_IT(CFG_CLI_UART, aRxBuffer, 1, RxCpltCallback);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Thread_SED_Coap_FreeRTOS.ioc b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Thread_SED_Coap_FreeRTOS.ioc
index 522c72043..1a3cb2331 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Thread_SED_Coap_FreeRTOS.ioc
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_FreeRTOS/Thread_SED_Coap_FreeRTOS.ioc
@@ -63,26 +63,27 @@ Mcu.IP9=SYS
Mcu.IPNb=12
Mcu.Name=STM32WB55RGVx
Mcu.Package=VFQFPN68
-Mcu.Pin0=PA2
-Mcu.Pin1=PA3
-Mcu.Pin10=VP_RTC_VS_RTC_Activate
-Mcu.Pin11=VP_STM32_WPAN_VS_THREAD
-Mcu.Pin12=VP_SYS_VS_tim17
-Mcu.Pin13=VP_TINY_LPM_VS_TINY_LPM
-Mcu.Pin2=RF1
-Mcu.Pin3=OSC_OUT
-Mcu.Pin4=OSC_IN
-Mcu.Pin5=PA11
-Mcu.Pin6=PB6
-Mcu.Pin7=PB7
-Mcu.Pin8=VP_FREERTOS_VS_CMSIS_V2
-Mcu.Pin9=VP_HSEM_VS_HSEM
-Mcu.PinsNb=14
+Mcu.Pin0=PC14-OSC32_IN
+Mcu.Pin1=PC15-OSC32_OUT
+Mcu.Pin10=VP_HSEM_VS_HSEM
+Mcu.Pin11=VP_RTC_VS_RTC_Activate
+Mcu.Pin12=VP_STM32_WPAN_VS_THREAD
+Mcu.Pin13=VP_SYS_VS_tim17
+Mcu.Pin14=VP_TINY_LPM_VS_TINY_LPM
+Mcu.Pin2=PA2
+Mcu.Pin3=PA3
+Mcu.Pin4=RF1
+Mcu.Pin5=OSC_OUT
+Mcu.Pin6=OSC_IN
+Mcu.Pin7=PB6
+Mcu.Pin8=PB7
+Mcu.Pin9=VP_FREERTOS_VS_CMSIS_V2
+Mcu.PinsNb=15
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32WB55RGVx
-MxCube.Version=5.3.0
-MxDb.Version=DB.5.0.30
+MxCube.Version=5.4.0
+MxDb.Version=DB.5.0.40
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.C2SEV_PWR_C2H_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:false
NVIC.DMA1_Channel1_IRQn=true\:5\:0\:false\:false\:true\:true\:false\:true
@@ -111,8 +112,6 @@ OSC_IN.Mode=HSE-External-Oscillator
OSC_IN.Signal=RCC_OSC_IN
OSC_OUT.Mode=HSE-External-Oscillator
OSC_OUT.Signal=RCC_OSC_OUT
-PA11.Locked=true
-PA11.Signal=USART1_CTS
PA2.Mode=Asynchronous
PA2.Signal=LPUART1_TX
PA3.Mode=Asynchronous
@@ -123,6 +122,10 @@ PB6.Signal=USART1_TX
PB7.Locked=true
PB7.Mode=Asynchronous
PB7.Signal=USART1_RX
+PC14-OSC32_IN.Mode=LSE-External-Oscillator
+PC14-OSC32_IN.Signal=RCC_OSC32_IN
+PC15-OSC32_OUT.Mode=LSE-External-Oscillator
+PC15-OSC32_OUT.Signal=RCC_OSC32_OUT
PCC.Ble.ConnectionInterval=1000.0
PCC.Ble.DataLength=6
PCC.Ble.Mode=Advertising
@@ -181,12 +184,12 @@ RCC.HSI48_VALUE=48000000
RCC.HSI_VALUE=16000000
RCC.I2C1Freq_Value=32000000
RCC.I2C3Freq_Value=32000000
-RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSE_VALUE,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1N,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PWRFreq_Value,RNGFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SMPSCLockSelectionVirtual,SMPSFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LCDFreq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1N,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PWRFreq_Value,RFWKPClockSelection,RFWKPFreq_Value,RNGFreq_Value,RTCClockSelection,RTCFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SMPSCLockSelectionVirtual,SMPSFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.LCDFreq_Value=32768
RCC.LPTIM1Freq_Value=32000000
RCC.LPTIM2Freq_Value=32000000
RCC.LPUART1Freq_Value=32000000
RCC.LSCOPinFreq_Value=32000
-RCC.LSE_VALUE=32768
RCC.LSI_VALUE=32000
RCC.MCO1PinFreq_Value=32000000
RCC.PLLPoutputFreq_Value=16000000
@@ -197,7 +200,11 @@ RCC.PLLSAI1PoutputFreq_Value=48000000
RCC.PLLSAI1QoutputFreq_Value=48000000
RCC.PLLSAI1RoutputFreq_Value=48000000
RCC.PWRFreq_Value=32000000
+RCC.RFWKPClockSelection=RCC_RFWKPCLKSOURCE_LSE
+RCC.RFWKPFreq_Value=32768
RCC.RNGFreq_Value=32000
+RCC.RTCClockSelection=RCC_RTCCLKSOURCE_LSE
+RCC.RTCFreq_Value=32768
RCC.SAI1Freq_Value=48000000
RCC.SMPS1Freq_Value=16000000
RCC.SMPSCLockSelectionVirtual=RCC_SMPSCLKSOURCE_HSE
@@ -213,11 +220,11 @@ RF1.Mode=RF1_Activate
RF1.Signal=RF_RF1
RTC.AsynchPrediv=CFG_RTC_ASYNCH_PRESCALER
RTC.IPParameters=AsynchPrediv,SynchPrediv
-RTC.SynchPrediv=CFG_RTC_SYNCH_PRESCALER
+RTC.SynchPrediv=CFG_RTC_SYNCH_PRESCALER
STM32_WPAN.APP_DBG_EN=1
STM32_WPAN.CFG_CLI_UART=hw_uart1
STM32_WPAN.CFG_DBG_TRACE_UART=hw_lpuart1
-STM32_WPAN.CFG_DEBUG_TRACE_LIGHT=0
+STM32_WPAN.CFG_DEBUG_TRACE_LIGHT=1
STM32_WPAN.CFG_DEBUG_TRACE_LIGTH=1
STM32_WPAN.CFG_DEBUG_TRACE_UART=hw_lpuart1
STM32_WPAN.CFG_FAST_CONN_ADV_INTERVAL_MAX_HEXA=0x0
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/app_conf.h
index 533338ff3..bcff70d0a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/app_conf.h
@@ -23,6 +23,7 @@
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Application Config
@@ -87,7 +88,7 @@
*
******************************************************************************/
-#define CFG_FULL_LOW_POWER 0
+#define CFG_FULL_LOW_POWER 1
#if (CFG_FULL_LOW_POWER == 1)
#undef CFG_LPM_SUPPORTED
@@ -190,7 +191,7 @@ typedef enum
* keep debugger enabled while in any low power mode when set to 1
* should be set to 0 in production
*/
-#define CFG_DEBUGGER_SUPPORTED 1
+#define CFG_DEBUGGER_SUPPORTED 0
#if (CFG_FULL_LOW_POWER == 1)
#undef CFG_DEBUGGER_SUPPORTED
@@ -205,7 +206,7 @@ typedef enum
* Note : Refer to utilities_conf.h file in order to details
* the level of traces : CFG_DEBUG_TRACE_FULL or CFG_DEBUG_TRACE_LIGHT
*****************************************************************************/
-#define CFG_DEBUG_TRACE 1
+#define CFG_DEBUG_TRACE 0
#if (CFG_FULL_LOW_POWER == 1)
#undef CFG_DEBUG_TRACE
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/hw_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/hw_conf.h
index 8409edd16..a5c0ac5eb 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/hw_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/hw_conf.h
@@ -196,13 +196,13 @@
#define CFG_HW_USART1_RX_SPEED GPIO_SPEED_FREQ_VERY_HIGH
#define CFG_HW_USART1_RX_ALTERNATE GPIO_AF7_USART1
-#define CFG_HW_USART1_CTS_PORT_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE
-#define CFG_HW_USART1_CTS_PORT GPIOA
-#define CFG_HW_USART1_CTS_PIN GPIO_PIN_11
+#define CFG_HW_USART1_CTS_PORT_CLK_ENABLE __HAL_RCC_GPIOvalueNotSetted_CLK_ENABLE
+#define CFG_HW_USART1_CTS_PORT GPIOvalueNotSetted
+#define CFG_HW_USART1_CTS_PIN GPIO_PIN_valueNotSetted
#define CFG_HW_USART1_CTS_MODE GPIO_MODE_AF_PP
#define CFG_HW_USART1_CTS_PULL GPIO_PULLDOWN
#define CFG_HW_USART1_CTS_SPEED GPIO_SPEED_FREQ_VERY_HIGH
-#define CFG_HW_USART1_CTS_ALTERNATE GPIO_AF7_USART1
+#define CFG_HW_USART1_CTS_ALTERNATE GPIO_AFvalueNotSetted_USART1
#define CFG_HW_USART1_DMA_TX_PREEMPTPRIORITY 0x0F
#define CFG_HW_USART1_DMA_TX_SUBPRIORITY 0
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/stm32_lpm_if.h
index 45db98456..70abecaa9 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/stm32_lpm_if.h
@@ -1,21 +1,21 @@
/* USER CODE BEGIN Header */
/**
- ******************************************************************************
- * File Name : stm32_lpm_if.h
- * Description : Header for stm32_lpm_f.c module (device specific LP management).
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
+******************************************************************************
+* @file stm32_lpm_if.h
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
+******************************************************************************
+* @attention
+*
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+* All rights reserved.</center></h2>
+*
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+*
+******************************************************************************
+*/
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
@@ -65,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/stm32wbxx_it.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/stm32wbxx_it.h
index 14583c73a..4bc74a5a2 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/stm32wbxx_it.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/stm32wbxx_it.h
@@ -28,7 +28,7 @@
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
-
+#include "app_common.h"
/* USER CODE END Includes */
/* Exported types ------------------------------------------------------------*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/utilities_conf.h
index 2c5384639..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/utilities_conf.h
@@ -10,10 +10,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/hw_timerserver.c
index 17c9af0a4..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/hw_timerserver.c
@@ -4,19 +4,18 @@
* Description : Hardware timerserver source file for STM32WPAN Middleware.
*
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/hw_uart.c
index ac245a96f..9a553610d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/hw_uart.c
@@ -48,9 +48,8 @@ extern UART_HandleTypeDef huart1;
hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
} while(0)
- /* Variables ------------------------------------------------------------------*/
+/* Variables -----------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
-
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
#endif
@@ -59,7 +58,6 @@ extern UART_HandleTypeDef huart1;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
-
#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_hlpuart1_tx ={0};
#endif
@@ -67,73 +65,73 @@ extern UART_HandleTypeDef huart1;
void (*HW_hlpuart1TxCb)(void);
#endif
- void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_RX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_RX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_RX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_RX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ return;
+}
+
+void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX_IT(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
{
- HAL_StatusTypeDef hal_status = HAL_OK;
- hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX(hlpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
+ default:
+ break;
}
switch (hal_status)
@@ -163,8 +161,8 @@ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t
hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
{
-HAL_StatusTypeDef hal_status = HAL_OK;
-hw_status_t hw_status = hw_uart_ok;
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
switch (hw_uart_id)
{
@@ -252,33 +250,33 @@ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
+ return;
+}
+
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
switch ((uint32_t)huart->Instance)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1RxCb)
- {
- HW_huart1RxCb();
- }
- break;
+ if(HW_huart1RxCb)
+ {
+ HW_huart1RxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1RxCb)
- {
- HW_hlpuart1RxCb();
- }
- break;
+ if(HW_hlpuart1RxCb)
+ {
+ HW_hlpuart1RxCb();
+ }
+ break;
#endif
default:
@@ -294,20 +292,20 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
{
#if (CFG_HW_USART1_ENABLED == 1)
case (uint32_t)USART1:
- if(HW_huart1TxCb)
- {
- HW_huart1TxCb();
- }
- break;
+ if(HW_huart1TxCb)
+ {
+ HW_huart1TxCb();
+ }
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
case (uint32_t)LPUART1:
- if(HW_hlpuart1TxCb)
- {
- HW_hlpuart1TxCb();
- }
- break;
+ if(HW_hlpuart1TxCb)
+ {
+ HW_hlpuart1TxCb();
+ }
+ break;
#endif
default:
@@ -317,4 +315,4 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
return;
}
- /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/main.c
index 98d1570a0..00e011ffa 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/main.c
@@ -164,17 +164,20 @@ void SystemClock_Config(void)
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
+ /** Configure LSE Drive Capability
+ */
+ __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
/** Configure the main internal regulator output voltage
*/
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
/** Initializes the CPU, AHB and APB busses clocks
*/
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSI1
- |RCC_OSCILLATORTYPE_HSE;
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE
+ |RCC_OSCILLATORTYPE_LSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ RCC_OscInitStruct.LSEState = RCC_LSE_ON;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
- RCC_OscInitStruct.LSIState = RCC_LSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
@@ -203,8 +206,8 @@ void SystemClock_Config(void)
|RCC_PERIPHCLK_LPUART1;
PeriphClkInitStruct.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2;
PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1;
- PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI;
- PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSI;
+ PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
+ PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSE;
PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSE;
PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE0;
@@ -351,7 +354,7 @@ static void MX_RTC_Init(void)
hrtc.Instance = RTC;
hrtc.Init.HourFormat = RTC_HOURFORMAT_24;
hrtc.Init.AsynchPrediv = CFG_RTC_ASYNCH_PRESCALER;
- hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER ;
+ hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
hrtc.Init.OutPut = RTC_OUTPUT_DISABLE;
hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH;
hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;
@@ -394,6 +397,7 @@ static void MX_GPIO_Init(void)
{
/* GPIO Ports Clock Enable */
+ __HAL_RCC_GPIOC_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
@@ -406,6 +410,12 @@ void PeriphClock_Config(void)
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -439,30 +449,6 @@ void PeriphClock_Config(void)
HAL_RCCEx_CRSConfig(&RCC_CRSInitStruct);
#endif
- /**
- * Select LSE clock
- */
- LL_RCC_LSE_Enable();
- while(!LL_RCC_LSE_IsReady());
-
- /**
- * Select wakeup source of BLE RF
- */
- LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
-
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
/*************************************************************
@@ -555,6 +541,7 @@ static void Reset_BackupDomain( void )
return;
}
+
static void Init_Exti( void )
{
/**< Disable all wakeup interrupt on CPU1 except IPCC(36), HSEM(38) */
@@ -563,6 +550,40 @@ static void Init_Exti( void )
return;
}
+
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+void HAL_Delay(uint32_t Delay)
+{
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
+
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
+}
/* USER CODE END 4 */
/**
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/stm32wbxx_hal_msp.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/stm32wbxx_hal_msp.c
index ce0ff57da..4f49493f9 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/stm32wbxx_hal_msp.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/stm32wbxx_hal_msp.c
@@ -97,8 +97,6 @@ void HAL_MspInit(void)
HAL_NVIC_SetPriority(FPU_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(FPU_IRQn);
- /* Disable the internal Pull-Up in Dead Battery pins of UCPD peripheral */
-
/* USER CODE BEGIN MspInit 1 */
/* USER CODE END MspInit 1 */
@@ -166,20 +164,11 @@ void HAL_UART_MspInit(UART_HandleTypeDef* huart)
/* Peripheral clock enable */
__HAL_RCC_USART1_CLK_ENABLE();
- __HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
/**USART1 GPIO Configuration
- PA11 ------> USART1_CTS
PB6 ------> USART1_TX
PB7 ------> USART1_RX
*/
- GPIO_InitStruct.Pin = GPIO_PIN_11;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
- GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
@@ -255,12 +244,9 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
__HAL_RCC_USART1_CLK_DISABLE();
/**USART1 GPIO Configuration
- PA11 ------> USART1_CTS
PB6 ------> USART1_TX
PB7 ------> USART1_RX
*/
- HAL_GPIO_DeInit(GPIOA, GPIO_PIN_11);
-
HAL_GPIO_DeInit(GPIOB, GPIO_PIN_6|GPIO_PIN_7);
/* USART1 DMA DeInit */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/STM32_WPAN/App/app_thread.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/STM32_WPAN/App/app_thread.c
index 2a392e913..9978be9ff 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/STM32_WPAN/App/app_thread.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/STM32_WPAN/App/app_thread.c
@@ -47,9 +47,10 @@
/* USER CODE END PTD */
/* Private defines -----------------------------------------------------------*/
-#define C_SIZE_CMD_STRING 256U
-#define C_PANID 0x2222U
-#define C_CHANNEL_NB 12U
+#define C_SIZE_CMD_STRING 256U
+#define C_PANID 0x2222U
+#define C_CHANNEL_NB 12U
+
/* USER CODE BEGIN PD */
#define C_RESSOURCE "light"
#define COAP_SEND_TIMEOUT (1*1000*1000/CFG_TS_TICK_VAL) /**< 1s */
@@ -66,7 +67,9 @@ static void APP_THREAD_CheckWirelessFirmwareInfo(void);
static void APP_THREAD_DeviceConfig(void);
static void APP_THREAD_StateNotif(uint32_t NotifFlags, void *pContext);
static void APP_THREAD_TraceError(const char * pMess, uint32_t ErrCode);
+#if (CFG_FULL_LOW_POWER == 0)
static void Send_CLI_To_M0(void);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
static void Send_CLI_Ack_For_OT(void);
static void HostTxCb( void );
static void Wait_Getting_Ack_From_M0(void);
@@ -81,8 +84,10 @@ extern void MX_USART1_UART_Init(void);
#if (CFG_USB_INTERFACE_ENABLE != 0)
static uint32_t ProcessCmdString(uint8_t* buf , uint32_t len);
#else
+#if (CFG_FULL_LOW_POWER == 0)
static void RxCpltCallback(void);
-#endif
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
/* USER CODE BEGIN PFP */
static void APP_THREAD_SendCoapMsg(void);
@@ -106,10 +111,14 @@ static uint8_t TmpString[C_SIZE_CMD_STRING];
static uint8_t VcpRxBuffer[sizeof(TL_CmdSerial_t)]; /* Received Data over USB are stored in this buffer */
static uint8_t VcpTxBuffer[sizeof(TL_EvtPacket_t) + 254U]; /* Transmit buffer over USB */
#else
+#if (CFG_FULL_LOW_POWER == 0)
static uint8_t aRxBuffer[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+#if (CFG_FULL_LOW_POWER == 0)
static uint8_t CommandString[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
static __IO uint16_t indexReceiveChar = 0;
static __IO uint16_t CptReceiveCmdFromUser = 0;
@@ -146,7 +155,7 @@ void APP_THREAD_Init( void )
/* USER CODE END APP_THREAD_INIT_1 */
SHCI_CmdStatus_t ThreadInitStatus;
-
+
/* Check the compatibility with the Coprocessor Wireless Firmware loaded */
APP_THREAD_CheckWirelessFirmwareInfo();
@@ -170,18 +179,19 @@ void APP_THREAD_Init( void )
/* Send Thread start system cmd to M0 */
ThreadInitStatus = SHCI_C2_THREAD_Init();
-
+
/* Prevent unused argument(s) compilation warning */
UNUSED(ThreadInitStatus);
/* Register task */
/* Create the different tasks */
UTIL_SEQ_RegTask( 1<<(uint32_t)CFG_TASK_MSG_FROM_M0_TO_M4, UTIL_SEQ_RFU, APP_THREAD_ProcessMsgM0ToM4);
+
/* USER CODE BEGIN INIT TASKS */
UTIL_SEQ_RegTask( 1<<(uint32_t)CFG_TASK_COAP_SEND_MSG, UTIL_SEQ_RFU,APP_THREAD_SendCoapMsg);
UTIL_SEQ_RegTask( 1<<(uint32_t)CFG_TASK_SET_THREAD_MODE, UTIL_SEQ_RFU,APP_THREAD_SetSleepyEndDeviceMode);
/* USER CODE END INIT TASKS */
-
+
/* Initialize and configure the Thread device*/
APP_THREAD_DeviceConfig();
@@ -199,11 +209,11 @@ void APP_THREAD_Init( void )
}
/**
- * @brief Trace the error or the warning reported.
- * @param ErrId :
- * @param ErrCode
- * @retval None
- */
+ * @brief Trace the error or the warning reported.
+ * @param ErrId :
+ * @param ErrCode
+ * @retval None
+ */
void APP_THREAD_Error(uint32_t ErrId, uint32_t ErrCode)
{
/* USER CODE BEGIN APP_THREAD_Error_1 */
@@ -212,7 +222,7 @@ void APP_THREAD_Error(uint32_t ErrId, uint32_t ErrCode)
switch(ErrId)
{
case ERR_REC_MULTI_MSG_FROM_M0 :
- APP_THREAD_TraceError("ERROR : ERR_REC_MULTI_MSG_FROM_M0 ",ErrCode);
+ APP_THREAD_TraceError("ERROR : ERR_REC_MULTI_MSG_FROM_M0 ", ErrCode);
break;
case ERR_THREAD_SET_STATE_CB :
APP_THREAD_TraceError("ERROR : ERR_THREAD_SET_STATE_CB ",ErrCode);
@@ -267,9 +277,6 @@ void APP_THREAD_Error(uint32_t ErrId, uint32_t ErrCode)
}
}
-
-
-
/*************************************************************
*
* LOCAL FUNCTIONS
@@ -400,13 +407,13 @@ static void APP_THREAD_StateNotif(uint32_t NotifFlags, void *pContext)
}
/**
- * @brief Warn the user that an error has occurred.In this case,
- * the LEDs on the Board will start blinking.
- *
- * @param pMess : Message associated to the error.
- * @param ErrCode: Error code associated to the module (OpenThread or other module if any)
- * @retval None
- */
+ * @brief Warn the user that an error has occurred.In this case,
+ * the LEDs on the Board will start blinking.
+ *
+ * @param pMess : Message associated to the error.
+ * @param ErrCode: Error code associated to the module (OpenThread or other module if any)
+ * @retval None
+ */
static void APP_THREAD_TraceError(const char * pMess, uint32_t ErrCode)
{
/* USER CODE BEGIN TRACE_ERROR */
@@ -462,7 +469,6 @@ static void APP_THREAD_CheckWirelessFirmwareInfo(void)
APP_DBG("**********************************************************");
}
}
-
/* USER CODE BEGIN FD_LOCAL_FUNCTIONS */
/**
@@ -745,47 +751,47 @@ void TL_THREAD_NotReceived( TL_EvtPacket_t * Notbuffer )
}
/**
- * @brief This function is called before sending any ot command to the M0
- * core. The purpose of this function is to be able to check if
- * there are no notifications coming from the M0 core which are
- * pending before sending a new ot command.
- * @param None
- * @retval None
- */
+ * @brief This function is called before sending any ot command to the M0
+ * core. The purpose of this function is to be able to check if
+ * there are no notifications coming from the M0 core which are
+ * pending before sending a new ot command.
+ * @param None
+ * @retval None
+ */
void Pre_OtCmdProcessing(void)
{
- UTIL_SEQ_WaitEvt( EVENT_SYNCHRO_BYPASS_IDLE);
+ UTIL_SEQ_WaitEvt(EVENT_SYNCHRO_BYPASS_IDLE);
}
/**
- * @brief This function waits for getting an acknowledgment from the M0.
- *
- * @param None
- * @retval None
- */
+ * @brief This function waits for getting an acknowledgment from the M0.
+ *
+ * @param None
+ * @retval None
+ */
static void Wait_Getting_Ack_From_M0(void)
{
UTIL_SEQ_WaitEvt(EVENT_ACK_FROM_M0_EVT);
}
/**
- * @brief Receive an acknowledgment from the M0+ core.
- * Each command send by the M4 to the M0 are acknowledged.
- * This function is called under interrupt.
- * @param None
- * @retval None
- */
+ * @brief Receive an acknowledgment from the M0+ core.
+ * Each command send by the M4 to the M0 are acknowledged.
+ * This function is called under interrupt.
+ * @param None
+ * @retval None
+ */
static void Receive_Ack_From_M0(void)
{
UTIL_SEQ_SetEvt(EVENT_ACK_FROM_M0_EVT);
}
/**
- * @brief Receive a notification from the M0+ through the IPCC.
- * This function is called under interrupt.
- * @param None
- * @retval None
- */
+ * @brief Receive a notification from the M0+ through the IPCC.
+ * This function is called under interrupt.
+ * @param None
+ * @retval None
+ */
static void Receive_Notification_From_M0(void)
{
CptReceiveMsgFromM0++;
@@ -794,6 +800,7 @@ static void Receive_Notification_From_M0(void)
#if (CFG_USB_INTERFACE_ENABLE != 0)
#else
+#if (CFG_FULL_LOW_POWER == 0)
static void RxCpltCallback(void)
{
/* Filling buffer and wait for '\r' char */
@@ -812,6 +819,7 @@ static void RxCpltCallback(void)
/* Once a character has been sent, put back the device in reception mode */
HW_UART_Receive_IT(CFG_CLI_UART, aRxBuffer, 1U, RxCpltCallback);
}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
#if (CFG_USB_INTERFACE_ENABLE != 0)
@@ -854,6 +862,7 @@ static uint32_t ProcessCmdString( uint8_t* buf , uint32_t len )
}
#endif/* (CFG_USB_INTERFACE_ENABLE != 0) */
+#if (CFG_FULL_LOW_POWER == 0)
/**
* @brief Process sends receive CLI command to M0.
* @param None
@@ -873,6 +882,7 @@ static void Send_CLI_To_M0(void)
TL_CLI_SendCmd();
}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
/**
* @brief Send notification for CLI TL Channel.
@@ -893,11 +903,16 @@ static void Send_CLI_Ack_For_OT(void)
*/
void APP_THREAD_Init_UART_CLI(void)
{
+#if (CFG_FULL_LOW_POWER == 0)
UTIL_SEQ_RegTask( 1<<CFG_TASK_SEND_CLI_TO_M0, UTIL_SEQ_RFU,Send_CLI_To_M0);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+
#if (CFG_USB_INTERFACE_ENABLE != 0)
#else
+#if (CFG_FULL_LOW_POWER == 0)
MX_USART1_UART_Init();
HW_UART_Receive_IT(CFG_CLI_UART, aRxBuffer, 1, RxCpltCallback);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Thread_SED_Coap_Multicast.ioc b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Thread_SED_Coap_Multicast.ioc
index 756cc7e3f..38c0cdbed 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Thread_SED_Coap_Multicast.ioc
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Thread/Thread_SED_Coap_Multicast/Thread_SED_Coap_Multicast.ioc
@@ -57,26 +57,27 @@ Mcu.IP9=SYS
Mcu.IPNb=12
Mcu.Name=STM32WB55RGVx
Mcu.Package=VFQFPN68
-Mcu.Pin0=PA2
-Mcu.Pin1=PA3
-Mcu.Pin10=VP_SEQUENCER_VS_SEQUENCER
-Mcu.Pin11=VP_STM32_WPAN_VS_THREAD
-Mcu.Pin12=VP_SYS_VS_Systick
-Mcu.Pin13=VP_TINY_LPM_VS_TINY_LPM
-Mcu.Pin2=RF1
-Mcu.Pin3=OSC_OUT
-Mcu.Pin4=OSC_IN
-Mcu.Pin5=PA11
-Mcu.Pin6=PB6
-Mcu.Pin7=PB7
-Mcu.Pin8=VP_HSEM_VS_HSEM
-Mcu.Pin9=VP_RTC_VS_RTC_Activate
-Mcu.PinsNb=14
+Mcu.Pin0=PC14-OSC32_IN
+Mcu.Pin1=PC15-OSC32_OUT
+Mcu.Pin10=VP_RTC_VS_RTC_Activate
+Mcu.Pin11=VP_SEQUENCER_VS_SEQUENCER
+Mcu.Pin12=VP_STM32_WPAN_VS_THREAD
+Mcu.Pin13=VP_SYS_VS_Systick
+Mcu.Pin14=VP_TINY_LPM_VS_TINY_LPM
+Mcu.Pin2=PA2
+Mcu.Pin3=PA3
+Mcu.Pin4=RF1
+Mcu.Pin5=OSC_OUT
+Mcu.Pin6=OSC_IN
+Mcu.Pin7=PB6
+Mcu.Pin8=PB7
+Mcu.Pin9=VP_HSEM_VS_HSEM
+Mcu.PinsNb=15
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32WB55RGVx
-MxCube.Version=5.3.0
-MxDb.Version=DB.5.0.30
+MxCube.Version=5.4.0
+MxDb.Version=DB.5.0.40
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false
NVIC.C2SEV_PWR_C2H_IRQn=true\:0\:0\:false\:false\:true\:true\:false
NVIC.DMA1_Channel1_IRQn=true\:0\:0\:false\:false\:true\:false\:true
@@ -102,8 +103,6 @@ OSC_IN.Mode=HSE-External-Oscillator
OSC_IN.Signal=RCC_OSC_IN
OSC_OUT.Mode=HSE-External-Oscillator
OSC_OUT.Signal=RCC_OSC_OUT
-PA11.Locked=true
-PA11.Signal=USART1_CTS
PA2.Mode=Asynchronous
PA2.Signal=LPUART1_TX
PA3.Mode=Asynchronous
@@ -114,6 +113,10 @@ PB6.Signal=USART1_TX
PB7.Locked=true
PB7.Mode=Asynchronous
PB7.Signal=USART1_RX
+PC14-OSC32_IN.Mode=LSE-External-Oscillator
+PC14-OSC32_IN.Signal=RCC_OSC32_IN
+PC15-OSC32_OUT.Mode=LSE-External-Oscillator
+PC15-OSC32_OUT.Signal=RCC_OSC32_OUT
PCC.Ble.ConnectionInterval=1000.0
PCC.Ble.DataLength=6
PCC.Ble.Mode=Advertising
@@ -150,7 +153,7 @@ ProjectManager.StackSize=0x1000
ProjectManager.TargetToolchain=EWARM V8
ProjectManager.ToolChainLocation=
ProjectManager.UnderRoot=false
-ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-SystemClock_Config-RCC-false-HAL-false,4-MX_LPUART1_UART_Init-LPUART1-true-HAL-false,5-MX_USART1_UART_Init-USART1-true-HAL-false,6-MX_RF_Init-RF-false-HAL-true,7-MX_RTC_Init-RTC-false-HAL-true,8-APPE_Init-STM32_WPAN-false-HAL-true
+ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-SystemClock_Config-RCC-false-HAL-false,4-MX_LPUART1_UART_Init-LPUART1-true-HAL-false,5-MX_USART1_UART_Init-USART1-true-HAL-false,6-MX_RF_Init-RF-false-HAL-true,7-MX_RTC_Init-RTC-false-HAL-true,8-APPE_Init-STM32_WPAN-false-HAL-false
RCC.ADCFreq_Value=48000000
RCC.AHBFreq_Value=32000000
RCC.APB1Freq_Value=32000000
@@ -172,12 +175,12 @@ RCC.HSI48_VALUE=48000000
RCC.HSI_VALUE=16000000
RCC.I2C1Freq_Value=32000000
RCC.I2C3Freq_Value=32000000
-RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSE_VALUE,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1N,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PWRFreq_Value,RNGFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SMPSCLockSelectionVirtual,SMPSFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,APB3Freq_Value,Cortex2Freq_Value,CortexFreq_Value,FCLK2Freq_Value,FCLKCortexFreq_Value,FamilyName,HCLK2Freq_Value,HCLK3Freq_Value,HCLKFreq_Value,HCLKRFFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LCDFreq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSI_VALUE,MCO1PinFreq_Value,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1N,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PWRFreq_Value,RFWKPClockSelection,RFWKPFreq_Value,RNGFreq_Value,RTCClockSelection,RTCFreq_Value,SAI1Freq_Value,SMPS1Freq_Value,SMPSCLockSelectionVirtual,SMPSFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value
+RCC.LCDFreq_Value=32768
RCC.LPTIM1Freq_Value=32000000
RCC.LPTIM2Freq_Value=32000000
RCC.LPUART1Freq_Value=32000000
RCC.LSCOPinFreq_Value=32000
-RCC.LSE_VALUE=32768
RCC.LSI_VALUE=32000
RCC.MCO1PinFreq_Value=32000000
RCC.PLLPoutputFreq_Value=16000000
@@ -188,7 +191,11 @@ RCC.PLLSAI1PoutputFreq_Value=48000000
RCC.PLLSAI1QoutputFreq_Value=48000000
RCC.PLLSAI1RoutputFreq_Value=48000000
RCC.PWRFreq_Value=32000000
+RCC.RFWKPClockSelection=RCC_RFWKPCLKSOURCE_LSE
+RCC.RFWKPFreq_Value=32768
RCC.RNGFreq_Value=32000
+RCC.RTCClockSelection=RCC_RTCCLKSOURCE_LSE
+RCC.RTCFreq_Value=32768
RCC.SAI1Freq_Value=48000000
RCC.SMPS1Freq_Value=16000000
RCC.SMPSCLockSelectionVirtual=RCC_SMPSCLKSOURCE_HSE
@@ -204,7 +211,7 @@ RF1.Mode=RF1_Activate
RF1.Signal=RF_RF1
RTC.AsynchPrediv=CFG_RTC_ASYNCH_PRESCALER
RTC.IPParameters=AsynchPrediv,SynchPrediv
-RTC.SynchPrediv=CFG_RTC_SYNCH_PRESCALER
+RTC.SynchPrediv=CFG_RTC_SYNCH_PRESCALER
STM32_WPAN.APP_DBG_EN=1
STM32_WPAN.CFG_CLI_UART=hw_uart1
STM32_WPAN.CFG_DBG_TRACE_UART=hw_lpuart1
@@ -213,13 +220,14 @@ STM32_WPAN.CFG_DEBUG_TRACE_LIGTH=1
STM32_WPAN.CFG_DEBUG_TRACE_UART=hw_lpuart1
STM32_WPAN.CFG_FAST_CONN_ADV_INTERVAL_MAX_HEXA=0x0
STM32_WPAN.CFG_FAST_CONN_ADV_INTERVAL_MIN_HEXA=0x0
+STM32_WPAN.CFG_FULL_LOW_POWER=1
STM32_WPAN.CFG_HW_LPUART1_ENABLED=1
STM32_WPAN.CFG_HW_USART1_ENABLED=1
STM32_WPAN.CFG_LP_CONN_ADV_INTERVAL_MAX_HEXA=0x0
STM32_WPAN.CFG_LP_CONN_ADV_INTERVAL_MIN_HEXA=0x0
STM32_WPAN.CHANNEL=12
STM32_WPAN.DBG_TRACE_UART_CFG=hw_lpuart1
-STM32_WPAN.IPParameters=UART_CLI,CFG_FAST_CONN_ADV_INTERVAL_MIN_HEXA,CFG_FAST_CONN_ADV_INTERVAL_MAX_HEXA,CFG_LP_CONN_ADV_INTERVAL_MIN_HEXA,CFG_LP_CONN_ADV_INTERVAL_MAX_HEXA,CFG_HW_LPUART1_ENABLED,DBG_TRACE_UART_CFG,CFG_DEBUG_TRACE_LIGTH,LOCAL_NAME_FORMATTED,APP_DBG_EN,CFG_HW_USART1_ENABLED,THREAD_APPLICATION,PANID,CHANNEL,CFG_CLI_UART,CFG_DBG_TRACE_UART,CFG_DEBUG_TRACE_LIGHT,CFG_DEBUG_TRACE_UART
+STM32_WPAN.IPParameters=UART_CLI,CFG_FAST_CONN_ADV_INTERVAL_MIN_HEXA,CFG_FAST_CONN_ADV_INTERVAL_MAX_HEXA,CFG_LP_CONN_ADV_INTERVAL_MIN_HEXA,CFG_LP_CONN_ADV_INTERVAL_MAX_HEXA,CFG_HW_LPUART1_ENABLED,DBG_TRACE_UART_CFG,CFG_DEBUG_TRACE_LIGTH,LOCAL_NAME_FORMATTED,APP_DBG_EN,CFG_HW_USART1_ENABLED,THREAD_APPLICATION,PANID,CHANNEL,CFG_CLI_UART,CFG_DBG_TRACE_UART,CFG_DEBUG_TRACE_LIGHT,CFG_DEBUG_TRACE_UART,CFG_FULL_LOW_POWER
STM32_WPAN.LOCAL_NAME_FORMATTED=,'0'
STM32_WPAN.PANID=2222
STM32_WPAN.THREAD_APPLICATION=MTD
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/CDC_Standalone/SW4STM32/CDC_Standalone/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/CDC_Standalone/SW4STM32/CDC_Standalone/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/CDC_Standalone/SW4STM32/CDC_Standalone/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/CDC_Standalone/SW4STM32/CDC_Standalone/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/CDC_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/CDC_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/CDC_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/CDC_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/DFU_Standalone/SW4STM32/DFU_Standalone/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/DFU_Standalone/SW4STM32/DFU_Standalone/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/DFU_Standalone/SW4STM32/DFU_Standalone/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/DFU_Standalone/SW4STM32/DFU_Standalone/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/DFU_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/DFU_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/DFU_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/DFU_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/HID_Standalone/SW4STM32/HID_Standalone/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/HID_Standalone/SW4STM32/HID_Standalone/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/HID_Standalone/SW4STM32/HID_Standalone/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/HID_Standalone/SW4STM32/HID_Standalone/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/HID_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/HID_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/HID_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/HID_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/MSC_Standalone/SW4STM32/MSC_Standalone/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/MSC_Standalone/SW4STM32/MSC_Standalone/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/MSC_Standalone/SW4STM32/MSC_Standalone/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/MSC_Standalone/SW4STM32/MSC_Standalone/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/MSC_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/MSC_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/MSC_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/USB_Device/MSC_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/app_common.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/app_common.h
new file mode 100644
index 000000000..4defc5d7a
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/app_common.h
@@ -0,0 +1,114 @@
+/**
+ ******************************************************************************
+ * File Name : app_common.h
+ * Description : App Common application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_COMMON_H
+#define APP_COMMON_H
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+#include <stdint.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+
+#include "app_conf.h"
+
+ /* -------------------------------- *
+ * Basic definitions *
+ * -------------------------------- */
+
+#undef NULL
+#define NULL 0
+
+#undef FALSE
+#define FALSE 0
+
+#undef TRUE
+#define TRUE (!0)
+
+ /* -------------------------------- *
+ * Critical Section definition *
+ * -------------------------------- */
+#define BACKUP_PRIMASK() uint32_t primask_bit= __get_PRIMASK()
+#define DISABLE_IRQ() __disable_irq()
+#define RESTORE_PRIMASK() __set_PRIMASK(primask_bit)
+
+ /* -------------------------------- *
+ * Macro delimiters *
+ * -------------------------------- */
+
+#define M_BEGIN do {
+
+#define M_END } while(0)
+
+ /* -------------------------------- *
+ * Some useful macro definitions *
+ * -------------------------------- */
+
+#define MAX( x, y ) (((x)>(y))?(x):(y))
+
+#define MIN( x, y ) (((x)<(y))?(x):(y))
+
+#define MODINC( a, m ) M_BEGIN (a)++; if ((a)>=(m)) (a)=0; M_END
+
+#define MODDEC( a, m ) M_BEGIN if ((a)==0) (a)=(m); (a)--; M_END
+
+#define MODADD( a, b, m ) M_BEGIN (a)+=(b); if ((a)>=(m)) (a)-=(m); M_END
+
+#define MODSUB( a, b, m ) MODADD( a, (m)-(b), m )
+
+#define PAUSE( t ) M_BEGIN \
+ __IO int _i; \
+ for ( _i = t; _i > 0; _i -- ); \
+ M_END
+
+#define DIVF( x, y ) ((x)/(y))
+
+#define DIVC( x, y ) (((x)+(y)-1)/(y))
+
+#define DIVR( x, y ) (((x)+((y)/2))/(y))
+
+#define SHRR( x, n ) ((((x)>>((n)-1))+1)>>1)
+
+#define BITN( w, n ) (((w)[(n)/32] >> ((n)%32)) & 1)
+
+#define BITNSET( w, n, b ) M_BEGIN (w)[(n)/32] |= ((U32)(b))<<((n)%32); M_END
+
+ /* -------------------------------- *
+ * Compiler *
+ * -------------------------------- */
+#define PLACE_IN_SECTION( __x__ ) __attribute__((section (__x__)))
+
+#ifdef WIN32
+#define ALIGN(n)
+#else
+#define ALIGN(n) __attribute__((aligned(n)))
+#endif
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /*APP_COMMON_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/app_conf.h
new file mode 100644
index 000000000..6d9144c46
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/app_conf.h
@@ -0,0 +1,347 @@
+/**
+ ******************************************************************************
+ * File Name : app_conf.h
+ * Description : Application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_CONF_H
+#define APP_CONF_H
+
+#include "hw.h"
+#include "hw_conf.h"
+#include "hw_if.h"
+
+/******************************************************************************
+ * Application Config
+ ******************************************************************************/
+/******************************************************************************
+ * Transport Layer
+ ******************************************************************************/
+/**
+ * Queue length of BLE Event
+ * This parameter defines the number of asynchronous events that can be stored in the HCI layer before
+ * being reported to the application. When a command is sent to the BLE core coprocessor, the HCI layer
+ * is waiting for the event with the Num_HCI_Command_Packets set to 1. The receive queue shall be large
+ * enough to store all asynchronous events received in between.
+ * When CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE is set to 27, this allow to store three 255 bytes long asynchronous events
+ * between the HCI command and its event.
+ * This parameter depends on the value given to CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE. When the queue size is to small,
+ * the system may hang if the queue is full with asynchronous events and the HCI layer is still waiting
+ * for a CC/CS event, In that case, the notification TL_BLE_HCI_ToNot() is called to indicate
+ * to the application a HCI command did not receive its command event within 30s (Default HCI Timeout).
+ */
+#define CFG_TL_EVT_QUEUE_LENGTH 5
+/**
+ * This parameter should be set to fit most events received by the HCI layer. It defines the buffer size of each element
+ * allocated in the queue of received events and can be used to optimize the amount of RAM allocated by the Memory Manager.
+ * It should not exceed 255 which is the maximum HCI packet payload size (a greater value is a lost of memory as it will
+ * never be used)
+ * It shall be at least 4 to receive the command status event in one frame.
+ * The default value is set to 27 to allow receiving an event of MTU size in a single buffer. This value maybe reduced
+ * further depending on the application.
+ *
+ */
+#define CFG_TL_MOST_EVENT_PAYLOAD_SIZE 255 /**< Set to 255 with the memory manager and the mailbox */
+
+#define TL_EVENT_FRAME_SIZE ( TL_EVT_HDR_SIZE + CFG_TL_MOST_EVENT_PAYLOAD_SIZE )
+/******************************************************************************
+ * UART interfaces
+ ******************************************************************************/
+
+/**
+ * Select UART interfaces
+ */
+#define CFG_DEBUG_TRACE_UART hw_uart1
+#define CFG_CONSOLE_MENU
+#define CFG_CLI_UART hw_lpuart1
+/******************************************************************************
+ * USB interface
+ ******************************************************************************/
+
+/**
+ * Enable/Disable USB interface
+ */
+#define CFG_USB_INTERFACE_ENABLE 0
+
+/******************************************************************************
+ * Low Power
+ *
+ * When CFG_FULL_LOW_POWER is set to 1, the system is configured in full
+ * low power mode. It means that all what can have an impact on the consumptions
+ * are powered down.(For instance LED, Access to Debugger, Etc.)
+ *
+ * When CFG_FULL_LOW_POWER is set to 0, the low power mode is not activated
+ *
+ ******************************************************************************/
+
+#define CFG_FULL_LOW_POWER 0
+
+#if (CFG_FULL_LOW_POWER == 1)
+#undef CFG_LPM_SUPPORTED
+#define CFG_LPM_SUPPORTED 1
+#endif /* CFG_FULL_LOW_POWER */
+
+/******************************************************************************
+ * Timer Server
+ ******************************************************************************/
+/**
+ * CFG_RTC_WUCKSEL_DIVIDER: This sets the RTCCLK divider to the wakeup timer.
+ * The higher is the value, the better is the power consumption and the accuracy of the timerserver
+ * The lower is the value, the finest is the granularity
+ *
+ * CFG_RTC_ASYNCH_PRESCALER: This sets the asynchronous prescaler of the RTC. It should as high as possible ( to ouput
+ * clock as low as possible) but the output clock should be equal or higher frequency compare to the clock feeding
+ * the wakeup timer. A lower clock speed would impact the accuracy of the timer server.
+ *
+ * CFG_RTC_SYNCH_PRESCALER: This sets the synchronous prescaler of the RTC.
+ * When the 1Hz calendar clock is required, it shall be sets according to other settings
+ * When the 1Hz calendar clock is not needed, CFG_RTC_SYNCH_PRESCALER should be set to 0x7FFF (MAX VALUE)
+ *
+ * CFG_RTCCLK_DIVIDER_CONF:
+ * Shall be set to either 0,2,4,8,16
+ * When set to either 2,4,8,16, the 1Hhz calendar is supported
+ * When set to 0, the user sets its own configuration
+ *
+ * The following settings are computed with LSI as input to the RTC
+ */
+#define CFG_RTCCLK_DIVIDER_CONF 0
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 0)
+/**
+ * Custom configuration
+ * It does not support 1Hz calendar
+ * It divides the RTC CLK by 16
+ */
+#define CFG_RTCCLK_DIV (16)
+#define CFG_RTC_WUCKSEL_DIVIDER (0)
+#define CFG_RTC_ASYNCH_PRESCALER (CFG_RTCCLK_DIV - 1)
+#define CFG_RTC_SYNCH_PRESCALER (0x7FFF)
+
+#else
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 2)
+/**
+ * It divides the RTC CLK by 2
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (3)
+#endif
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 4)
+/**
+ * It divides the RTC CLK by 4
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (2)
+#endif
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 8)
+/**
+ * It divides the RTC CLK by 8
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (1)
+#endif
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 16)
+/**
+ * It divides the RTC CLK by 16
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (0)
+#endif
+
+#define CFG_RTCCLK_DIV CFG_RTCCLK_DIVIDER_CONF
+#define CFG_RTC_ASYNCH_PRESCALER (CFG_RTCCLK_DIV - 1)
+#define CFG_RTC_SYNCH_PRESCALER (DIVR( LSE_VALUE, (CFG_RTC_ASYNCH_PRESCALER+1) ) - 1 )
+
+#endif
+
+/** tick timer value in us */
+#define CFG_TS_TICK_VAL DIVR( (CFG_RTCCLK_DIV * 1000000), LSE_VALUE )
+
+typedef enum
+{
+ CFG_TIM_PROC_ID_ISR,
+} CFG_TimProcID_t;
+
+/******************************************************************************
+ * Debug
+ ******************************************************************************/
+/**
+ * When set, this resets some hw resources to set the device in the same state than the power up
+ * The FW resets only register that may prevent the FW to run properly
+ *
+ * This shall be set to 0 in a final product
+ *
+ */
+#define CFG_HW_RESET_BY_FW 1
+
+/**
+ * keep debugger enabled while in any low power mode when set to 1
+ * should be set to 0 in production
+ */
+#define CFG_DEBUGGER_SUPPORTED 1
+
+#if (CFG_FULL_LOW_POWER == 1)
+#undef CFG_DEBUGGER_SUPPORTED
+#define CFG_DEBUGGER_SUPPORTED 0
+#endif /* CFG_FULL_LOW_POWER */
+
+/*****************************************************************************
+ * Traces
+ * Enable or Disable traces in application
+ * When CFG_DEBUG_TRACE is set, traces are activated
+ *
+ * Note : Refer to utilities_conf.h file in order to details
+ * the level of traces : CFG_DEBUG_TRACE_FULL or CFG_DEBUG_TRACE_LIGHT
+ *****************************************************************************/
+#define CFG_DEBUG_TRACE 1
+
+#if (CFG_FULL_LOW_POWER == 1)
+#undef CFG_DEBUG_TRACE
+#define CFG_DEBUG_TRACE 0
+#endif /* CFG_FULL_LOW_POWER */
+
+/**
+ * When CFG_DEBUG_TRACE_FULL is set to 1, the trace are output with the API name, the file name and the line number
+ * When CFG_DEBUG_TRACE_LIGHT is set to 1, only the debug message is output
+ *
+ * When both are set to 0, no trace are output
+ * When both are set to 1, CFG_DEBUG_TRACE_FULL is selected
+ */
+#define CFG_DEBUG_TRACE_LIGHT 1
+#define CFG_DEBUG_TRACE_FULL 0
+
+#if (( CFG_DEBUG_TRACE != 0 ) && ( CFG_DEBUG_TRACE_LIGHT == 0 ) && (CFG_DEBUG_TRACE_FULL == 0))
+#undef CFG_DEBUG_TRACE_FULL
+#undef CFG_DEBUG_TRACE_LIGHT
+#define CFG_DEBUG_TRACE_FULL 0
+#define CFG_DEBUG_TRACE_LIGHT 1
+#endif
+
+#if ( CFG_DEBUG_TRACE == 0 )
+#undef CFG_DEBUG_TRACE_FULL
+#undef CFG_DEBUG_TRACE_LIGHT
+#define CFG_DEBUG_TRACE_FULL 0
+#define CFG_DEBUG_TRACE_LIGHT 0
+#endif
+
+/**
+ * When not set, the traces is looping on sending the trace over UART
+ */
+#define DBG_TRACE_USE_CIRCULAR_QUEUE 1
+
+/**
+ * max buffer Size to queue data traces and max data trace allowed.
+ * Only Used if DBG_TRACE_USE_CIRCULAR_QUEUE is defined
+ */
+#define DBG_TRACE_MSG_QUEUE_SIZE 4096
+#define MAX_DBG_TRACE_MSG_SIZE 1024
+
+/******************************************************************************
+ * Configure Log level for Application
+ ******************************************************************************/
+#define APPLI_CONFIG_LOG_LEVEL LOG_LEVEL_INFO
+#define APPLI_PRINT_FILE_FUNC_LINE 0
+
+/* USER CODE BEGIN Defines */
+/******************************************************************************
+ * User interaction
+ * When CFG_LED_SUPPORTED is set, LEDS are activated if requested
+ * When CFG_BUTTON_SUPPORTED is set, the push button are activated if requested
+ ******************************************************************************/
+#if (CFG_FULL_LOW_POWER == 1)
+#define CFG_LED_SUPPORTED 0
+#define CFG_BUTTON_SUPPORTED 0
+#else
+#define CFG_LED_SUPPORTED 1
+#define CFG_BUTTON_SUPPORTED 1
+#endif /* CFG_FULL_LOW_POWER */
+/* USER CODE END Defines */
+
+/******************************************************************************
+ * Scheduler
+ ******************************************************************************/
+/**
+ * This is the list of task id required by the application
+ * Each Id shall be in the range 0..31
+ */
+
+typedef enum {
+ CFG_TASK_MSG_FROM_M0_TO_M4,
+ CFG_TASK_ZIGBEE_APP,
+ CFG_TASK_SYSTEM_HCI_ASYNCH_EVT,
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+ CFG_TASK_VCP_SEND_DATA,
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+ CFG_TASK_NBR /**< Shall be last in the list */
+} CFG_IdleTask_Id_t;
+
+/* Scheduler types and defines */
+/*------------------------------------*/
+
+//#define TASK_MSG_FROM_M0_TO_M4 (1U << CFG_TASK_MSG_FROM_M0_TO_M4)
+#define EVENT_ACK_FROM_M0_EVT (1U << CFG_EVT_ACK_FROM_M0_EVT)
+#define EVENT_SYNCHRO_BYPASS_IDLE (1U << CFG_EVT_SYNCHRO_BYPASS_IDLE)
+
+/**
+ * This is the list of priority required by the application
+ * Each Id shall be in the range 0..31
+ */
+typedef enum
+{
+ CFG_SCH_PRIO_0,
+ CFG_SCH_PRIO_1,
+ CFG_PRIO_NBR,
+} CFG_SCH_Prio_Id_t;
+
+/**
+ * This is a bit mapping over 32bits listing all events id supported in the application
+ */
+typedef enum {
+ CFG_EVT_SYSTEM_HCI_CMD_EVT_RESP,
+ CFG_EVT_ACK_FROM_M0_EVT,
+ CFG_EVT_SYNCHRO_BYPASS_IDLE,
+} CFG_IdleEvt_Id_t;
+
+#define EVENT_ACK_FROM_M0_EVT (1U << CFG_EVT_ACK_FROM_M0_EVT)
+#define EVENT_SYNCHRO_BYPASS_IDLE (1U << CFG_EVT_SYNCHRO_BYPASS_IDLE)
+
+/******************************************************************************
+ * Configure Log level for Application
+ ******************************************************************************/
+#define APPLI_CONFIG_LOG_LEVEL LOG_LEVEL_INFO
+#define APPLI_PRINT_FILE_FUNC_LINE 0
+
+/******************************************************************************
+ * LOW POWER
+ ******************************************************************************/
+/**
+ * Supported requester to the MCU Low Power Manager - can be increased up to 32
+ * It lits a bit mapping of all user of the Low Power Manager
+ */
+typedef enum {
+ CFG_LPM_APP,
+} CFG_LPM_Id_t;
+
+/******************************************************************************
+ * OTP manager
+ ******************************************************************************/
+#define CFG_OTP_BASE_ADDRESS OTP_AREA_BASE
+
+#define CFG_OTP_END_ADRESS OTP_AREA_END_ADDR
+
+#endif /*APP_CONF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/app_entry.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/app_entry.h
new file mode 100644
index 000000000..48c467aaa
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/app_entry.h
@@ -0,0 +1,68 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : app_entry.h
+ * Description : App entry configuration file for STM32WPAN Middleware.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_ENTRY_H
+#define APP_ENTRY_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /* Exported types ------------------------------------------------------------*/
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* Exported variables --------------------------------------------------------*/
+/* USER CODE BEGIN EV */
+
+/* USER CODE END EV */
+
+/* Exported macros ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions ---------------------------------------------*/
+ void APPE_Init( void );
+/* USER CODE BEGIN EF */
+
+/* USER CODE END EF */
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /*APP_ENTRY_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/hw_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/hw_conf.h
new file mode 100644
index 000000000..8409edd16
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/hw_conf.h
@@ -0,0 +1,219 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : hw_conf.h
+ * Description : Hardware configuration file for STM32WPAN Middleware.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_CONF_H
+#define HW_CONF_H
+
+/******************************************************************************
+ * Semaphores
+ * THIS SHALL NO BE CHANGED AS THESE SEMAPHORES ARE USED AS WELL ON THE CM0+
+ *****************************************************************************/
+/* Index of the semaphore used to manage the entry Stop Mode procedure */
+#define CFG_HW_ENTRY_STOP_MODE_SEMID 4
+
+/* Index of the semaphore used to access the RCC */
+#define CFG_HW_RCC_SEMID 3
+
+/* Index of the semaphore used to access the FLASH */
+#define CFG_HW_FLASH_SEMID 2
+
+/* Index of the semaphore used to access the PKA */
+#define CFG_HW_PKA_SEMID 1
+
+/* Index of the semaphore used to access the RNG */
+#define CFG_HW_RNG_SEMID 0
+
+/******************************************************************************
+ * HW TIMER SERVER
+ *****************************************************************************/
+/**
+ * The user may define the maximum number of virtual timers supported.
+ * It shall not exceed 255
+ */
+#define CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER 6
+
+/**
+ * The user may define the priority in the NVIC of the RTC_WKUP interrupt handler that is used to manage the
+ * wakeup timer.
+ * This setting is the preemptpriority part of the NVIC.
+ */
+#define CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO 3
+
+/**
+ * The user may define the priority in the NVIC of the RTC_WKUP interrupt handler that is used to manage the
+ * wakeup timer.
+ * This setting is the subpriority part of the NVIC. It does not exist on all processors. When it is not supported
+ * on the CPU, the setting is ignored
+ */
+#define CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO 0
+
+/**
+ * Define a critical section in the Timer server
+ * The Timer server does not support the API to be nested
+ * The Application shall either:
+ * a) Ensure this will never happen
+ * b) Define the critical section
+ * The default implementations is masking all interrupts using the PRIMASK bit
+ * The TimerServer driver uses critical sections to avoid context corruption. This is achieved with the macro
+ * TIMER_ENTER_CRITICAL_SECTION and TIMER_EXIT_CRITICAL_SECTION. When CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION is set
+ * to 1, all STM32 interrupts are masked with the PRIMASK bit of the CortexM CPU. It is possible to use the BASEPRI
+ * register of the CortexM CPU to keep allowed some interrupts with high priority. In that case, the user shall
+ * re-implement TIMER_ENTER_CRITICAL_SECTION and TIMER_EXIT_CRITICAL_SECTION and shall make sure that no TimerServer
+ * API are called when the TIMER critical section is entered
+ */
+#define CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION 1
+
+/**
+ * This value shall reflect the maximum delay there could be in the application between the time the RTC interrupt
+ * is generated by the Hardware and the time when the RTC interrupt handler is called. This time is measured in
+ * number of RTCCLK ticks.
+ * A relaxed timing would be 10ms
+ * When the value is too short, the timerserver will not be able to count properly and all timeout may be random.
+ * When the value is too long, the device may wake up more often than the most optimal configuration. However, the
+ * impact on power consumption would be marginal (unless the value selected is extremely too long). It is strongly
+ * recommended to select a value large enough to make sure it is not too short to ensure reliability of the system
+ * as this will have marginal impact on low power mode
+ */
+#define CFG_HW_TS_RTC_HANDLER_MAX_DELAY ( 10 * (LSI_VALUE/1000) )
+
+ /**
+ * Interrupt ID in the NVIC of the RTC Wakeup interrupt handler
+ * It shall be type of IRQn_Type
+ */
+#define CFG_HW_TS_RTC_WAKEUP_HANDLER_ID RTC_WKUP_IRQn
+
+/******************************************************************************
+ * HW UART
+ *****************************************************************************/
+
+#define CFG_HW_LPUART1_ENABLED 1
+#define CFG_HW_LPUART1_DMA_TX_SUPPORTED 1
+
+#define CFG_HW_USART1_ENABLED 1
+#define CFG_HW_USART1_DMA_TX_SUPPORTED 1
+
+/**
+ * LPUART1
+ */
+#define CFG_HW_LPUART1_PREEMPTPRIORITY 0x0F
+#define CFG_HW_LPUART1_SUBPRIORITY 0
+
+/** < The application shall check the selected source clock is enable */
+#define CFG_HW_LPUART1_SOURCE_CLOCK RCC_LPUART1CLKSOURCE_SYSCLK
+
+#define CFG_HW_LPUART1_BAUDRATE 115200
+#define CFG_HW_LPUART1_WORDLENGTH UART_WORDLENGTH_8B
+#define CFG_HW_LPUART1_STOPBITS UART_STOPBITS_1
+#define CFG_HW_LPUART1_PARITY UART_PARITY_NONE
+#define CFG_HW_LPUART1_HWFLOWCTL UART_HWCONTROL_NONE
+#define CFG_HW_LPUART1_MODE UART_MODE_TX_RX
+#define CFG_HW_LPUART1_ADVFEATUREINIT UART_ADVFEATURE_NO_INIT
+#define CFG_HW_LPUART1_OVERSAMPLING UART_OVERSAMPLING_8
+
+#define CFG_HW_LPUART1_TX_PORT_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE
+#define CFG_HW_LPUART1_TX_PORT GPIOA
+#define CFG_HW_LPUART1_TX_PIN GPIO_PIN_2
+#define CFG_HW_LPUART1_TX_MODE GPIO_MODE_AF_PP
+#define CFG_HW_LPUART1_TX_PULL GPIO_NOPULL
+#define CFG_HW_LPUART1_TX_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_LPUART1_TX_ALTERNATE GPIO_AF8_LPUART1
+
+#define CFG_HW_LPUART1_RX_PORT_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE
+#define CFG_HW_LPUART1_RX_PORT GPIOA
+#define CFG_HW_LPUART1_RX_PIN GPIO_PIN_3
+#define CFG_HW_LPUART1_RX_MODE GPIO_MODE_AF_PP
+#define CFG_HW_LPUART1_RX_PULL GPIO_NOPULL
+#define CFG_HW_LPUART1_RX_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_LPUART1_RX_ALTERNATE GPIO_AF8_LPUART1
+
+#define CFG_HW_LPUART1_CTS_PORT_CLK_ENABLE __HAL_RCC_GPIOvalueNotSetted_CLK_ENABLE
+#define CFG_HW_LPUART1_CTS_PORT GPIOvalueNotSetted
+#define CFG_HW_LPUART1_CTS_PIN GPIO_PIN_valueNotSetted
+#define CFG_HW_LPUART1_CTS_MODE GPIO_MODE_AF_PP
+#define CFG_HW_LPUART1_CTS_PULL GPIO_PULLDOWN
+#define CFG_HW_LPUART1_CTS_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_LPUART1_CTS_ALTERNATE GPIO_AFvalueNotSetted_LPUART1
+
+#define CFG_HW_LPUART1_DMA_TX_PREEMPTPRIORITY 0x0F
+#define CFG_HW_LPUART1_DMA_TX_SUBPRIORITY 0
+
+#define CFG_HW_LPUART1_DMAMUX_CLK_ENABLE __HAL_RCC_DMAMUX1_CLK_ENABLE
+#define CFG_HW_LPUART1_DMA_CLK_ENABLE __HAL_RCC_DMA1_CLK_ENABLE
+#define CFG_HW_LPUART1_TX_DMA_REQ DMA_REQUEST_LPUART1_TX
+#define CFG_HW_LPUART1_TX_DMA_CHANNEL DMA1_CHANNEL_1
+#define CFG_HW_LPUART1_TX_DMA_IRQn DMA1_CHANNEL_1_IRQn
+#define CFG_HW_LPUART1_DMA_TX_IRQHandler DMA1_CHANNEL_1_IRQHandler
+
+/**
+ * UART1
+ */
+#define CFG_HW_USART1_PREEMPTPRIORITY 0x0F
+#define CFG_HW_USART1_SUBPRIORITY 0
+
+/** < The application shall check the selected source clock is enable */
+#define CFG_HW_USART1_SOURCE_CLOCK RCC_USART1CLKSOURCE_SYSCLK
+
+#define CFG_HW_USART1_BAUDRATE 115200
+#define CFG_HW_USART1_WORDLENGTH UART_WORDLENGTH_8B
+#define CFG_HW_USART1_STOPBITS UART_STOPBITS_1
+#define CFG_HW_USART1_PARITY UART_PARITY_NONE
+#define CFG_HW_USART1_HWFLOWCTL UART_HWCONTROL_NONE
+#define CFG_HW_USART1_MODE UART_MODE_TX_RX
+#define CFG_HW_USART1_ADVFEATUREINIT UART_ADVFEATURE_NO_INIT
+#define CFG_HW_USART1_OVERSAMPLING UART_OVERSAMPLING_8
+
+#define CFG_HW_USART1_TX_PORT_CLK_ENABLE __HAL_RCC_GPIOB_CLK_ENABLE
+#define CFG_HW_USART1_TX_PORT GPIOB
+#define CFG_HW_USART1_TX_PIN GPIO_PIN_6
+#define CFG_HW_USART1_TX_MODE GPIO_MODE_AF_PP
+#define CFG_HW_USART1_TX_PULL GPIO_NOPULL
+#define CFG_HW_USART1_TX_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_USART1_TX_ALTERNATE GPIO_AF7_USART1
+
+#define CFG_HW_USART1_RX_PORT_CLK_ENABLE __HAL_RCC_GPIOB_CLK_ENABLE
+#define CFG_HW_USART1_RX_PORT GPIOB
+#define CFG_HW_USART1_RX_PIN GPIO_PIN_7
+#define CFG_HW_USART1_RX_MODE GPIO_MODE_AF_PP
+#define CFG_HW_USART1_RX_PULL GPIO_NOPULL
+#define CFG_HW_USART1_RX_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_USART1_RX_ALTERNATE GPIO_AF7_USART1
+
+#define CFG_HW_USART1_CTS_PORT_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE
+#define CFG_HW_USART1_CTS_PORT GPIOA
+#define CFG_HW_USART1_CTS_PIN GPIO_PIN_11
+#define CFG_HW_USART1_CTS_MODE GPIO_MODE_AF_PP
+#define CFG_HW_USART1_CTS_PULL GPIO_PULLDOWN
+#define CFG_HW_USART1_CTS_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_USART1_CTS_ALTERNATE GPIO_AF7_USART1
+
+#define CFG_HW_USART1_DMA_TX_PREEMPTPRIORITY 0x0F
+#define CFG_HW_USART1_DMA_TX_SUBPRIORITY 0
+
+#define CFG_HW_USART1_DMAMUX_CLK_ENABLE __HAL_RCC_DMAMUX1_CLK_ENABLE
+#define CFG_HW_USART1_DMA_CLK_ENABLE __HAL_RCC_DMA1_CLK_ENABLE
+#define CFG_HW_USART1_TX_DMA_REQ DMA_REQUEST_USART1_TX
+#define CFG_HW_USART1_TX_DMA_CHANNEL DMA1_CHANNEL_2
+#define CFG_HW_USART1_TX_DMA_IRQn DMA1_CHANNEL_2_IRQn
+#define CFG_HW_USART1_DMA_TX_IRQHandler DMA1_CHANNEL_2_IRQHandler
+
+#endif /*HW_CONF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/main.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/main.h
new file mode 100644
index 000000000..68182bc5a
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/main.h
@@ -0,0 +1,71 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file : main.h
+ * @brief : Header for main.c file.
+ * This file contains the common defines of the application.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __MAIN_H
+#define __MAIN_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx_hal.h"
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Exported types ------------------------------------------------------------*/
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* Exported macro ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions prototypes ---------------------------------------------*/
+void Error_Handler(void);
+
+/* USER CODE BEGIN EFP */
+
+/* USER CODE END EFP */
+
+/* Private defines -----------------------------------------------------------*/
+/* USER CODE BEGIN Private defines */
+
+/* USER CODE END Private defines */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MAIN_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/stm32_lpm_if.h
new file mode 100644
index 000000000..70abecaa9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/stm32_lpm_if.h
@@ -0,0 +1,81 @@
+/* USER CODE BEGIN Header */
+/**
+******************************************************************************
+* @file stm32_lpm_if.h
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
+******************************************************************************
+* @attention
+*
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+* All rights reserved.</center></h2>
+*
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+*
+******************************************************************************
+*/
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32_LPM_IF_H
+#define __STM32_LPM_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+
+/**
+ * @brief Enters Low Power Off Mode
+ * @param none
+ * @retval none
+ */
+void PWR_EnterOffMode( void );
+/**
+ * @brief Exits Low Power Off Mode
+ * @param none
+ * @retval none
+ */
+void PWR_ExitOffMode( void );
+
+/**
+ * @brief Enters Low Power Stop Mode
+ * @note ARM exists the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_EnterStopMode( void );
+/**
+ * @brief Exits Low Power Stop Mode
+ * @note Enable the pll at 32MHz
+ * @param none
+ * @retval none
+ */
+void PWR_ExitStopMode( void );
+
+/**
+ * @brief Enters Low Power Sleep Mode
+ * @note ARM exits the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_EnterSleepMode( void );
+
+/**
+ * @brief Exits Low Power Sleep Mode
+ * @note ARM exits the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_ExitSleepMode( void );
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*__STM32_LPM_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/stm32wbxx_hal_conf.h
new file mode 100644
index 000000000..ea9aa40d0
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/stm32wbxx_hal_conf.h
@@ -0,0 +1,353 @@
+/**
+ ******************************************************************************
+ * @file stm32wbxx_hal_conf.h
+ * @author MCD Application Team
+ * @brief HAL configuration file.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32WBxx_HAL_CONF_H
+#define __STM32WBxx_HAL_CONF_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/* Exported types ------------------------------------------------------------*/
+/* Exported constants --------------------------------------------------------*/
+
+/* ########################## Module Selection ############################## */
+/**
+ * @brief This is the list of modules to be used in the HAL driver
+ */
+#define HAL_MODULE_ENABLED
+/*#define HAL_ADC_MODULE_ENABLED */
+/*#define HAL_CRYP_MODULE_ENABLED */
+/*#define HAL_COMP_MODULE_ENABLED */
+/*#define HAL_CRC_MODULE_ENABLED */
+#define HAL_HSEM_MODULE_ENABLED
+/*#define HAL_I2C_MODULE_ENABLED */
+/*#define HAL_IPCC_MODULE_ENABLED */
+/*#define HAL_IRDA_MODULE_ENABLED */
+/*#define HAL_IWDG_MODULE_ENABLED */
+/*#define HAL_LCD_MODULE_ENABLED */
+/*#define HAL_LPTIM_MODULE_ENABLED */
+/*#define HAL_PCD_MODULE_ENABLED */
+/*#define HAL_PKA_MODULE_ENABLED */
+/*#define HAL_QSPI_MODULE_ENABLED */
+/*#define HAL_RNG_MODULE_ENABLED */
+#define HAL_RTC_MODULE_ENABLED
+/*#define HAL_SAI_MODULE_ENABLED */
+/*#define HAL_SMBUS_MODULE_ENABLED */
+/*#define HAL_SMARTCARD_MODULE_ENABLED */
+/*#define HAL_SPI_MODULE_ENABLED */
+/*#define HAL_TIM_MODULE_ENABLED */
+/*#define HAL_TSC_MODULE_ENABLED */
+#define HAL_UART_MODULE_ENABLED
+/*#define HAL_USART_MODULE_ENABLED */
+/*#define HAL_WWDG_MODULE_ENABLED */
+#define HAL_EXTI_MODULE_ENABLED
+#define HAL_CORTEX_MODULE_ENABLED
+#define HAL_DMA_MODULE_ENABLED
+#define HAL_FLASH_MODULE_ENABLED
+#define HAL_GPIO_MODULE_ENABLED
+#define HAL_PWR_MODULE_ENABLED
+#define HAL_RCC_MODULE_ENABLED
+
+#define USE_HAL_ADC_REGISTER_CALLBACKS 0u
+#define USE_HAL_COMP_REGISTER_CALLBACKS 0u
+#define USE_HAL_CRYP_REGISTER_CALLBACKS 0u
+#define USE_HAL_I2C_REGISTER_CALLBACKS 0u
+#define USE_HAL_IRDA_REGISTER_CALLBACKS 0u
+#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0u
+#define USE_HAL_PCD_REGISTER_CALLBACKS 0u
+#define USE_HAL_PKA_REGISTER_CALLBACKS 0u
+#define USE_HAL_QSPI_REGISTER_CALLBACKS 0u
+#define USE_HAL_RNG_REGISTER_CALLBACKS 0u
+#define USE_HAL_RTC_REGISTER_CALLBACKS 0u
+#define USE_HAL_SAI_REGISTER_CALLBACKS 0u
+#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0u
+#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0u
+#define USE_HAL_SPI_REGISTER_CALLBACKS 0u
+#define USE_HAL_TIM_REGISTER_CALLBACKS 0u
+#define USE_HAL_TSC_REGISTER_CALLBACKS 0u
+#define USE_HAL_UART_REGISTER_CALLBACKS 0u
+#define USE_HAL_USART_REGISTER_CALLBACKS 0u
+#define USE_HAL_WWDG_REGISTER_CALLBACKS 0u
+
+/* ########################## Oscillator Values adaptation ####################*/
+/**
+ * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
+ * This value is used by the RCC HAL module to compute the system frequency
+ * (when HSE is used as system clock source, directly or through the PLL).
+ */
+#if !defined (HSE_VALUE)
+#define HSE_VALUE 32000000U /*!< Value of the External oscillator in Hz */
+#endif /* HSE_VALUE */
+
+#if !defined (HSE_STARTUP_TIMEOUT)
+ #define HSE_STARTUP_TIMEOUT ((uint32_t)100) /*!< Time out for HSE start up, in ms */
+#endif /* HSE_STARTUP_TIMEOUT */
+
+/**
+ * @brief Internal Multiple Speed oscillator (MSI) default value.
+ * This value is the default MSI range value after Reset.
+ */
+#if !defined (MSI_VALUE)
+ #define MSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/
+#endif /* MSI_VALUE */
+
+/**
+ * @brief Internal High Speed oscillator (HSI) value.
+ * This value is used by the RCC HAL module to compute the system frequency
+ * (when HSI is used as system clock source, directly or through the PLL).
+ */
+#if !defined (HSI_VALUE)
+#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/
+#endif /* HSI_VALUE */
+
+/**
+ * @brief Internal Low Speed oscillator (LSI1) value.
+ */
+#if !defined (LSI1_VALUE)
+ #define LSI1_VALUE ((uint32_t)32000) /*!< LSI1 Typical Value in Hz*/
+#endif /* LSI1_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
+ The real value may vary depending on the variations
+ in voltage and temperature.*/
+/**
+ * @brief Internal Low Speed oscillator (LSI2) value.
+ */
+#if !defined (LSI2_VALUE)
+ #define LSI2_VALUE ((uint32_t)32000) /*!< LSI2 Typical Value in Hz*/
+#endif /* LSI2_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
+ The real value may vary depending on the variations
+ in voltage and temperature.*/
+
+/**
+ * @brief External Low Speed oscillator (LSE) value.
+ * This value is used by the UART, RTC HAL module to compute the system frequency
+ */
+#if !defined (LSE_VALUE)
+#define LSE_VALUE 32768U /*!< Value of the External oscillator in Hz*/
+#endif /* LSE_VALUE */
+
+/**
+ * @brief Internal Multiple Speed oscillator (HSI48) default value.
+ * This value is the default HSI48 range value after Reset.
+ */
+#if !defined (HSI48_VALUE)
+ #define HSI48_VALUE ((uint32_t)48000000) /*!< Value of the Internal oscillator in Hz*/
+#endif /* HSI48_VALUE */
+
+#if !defined (LSE_STARTUP_TIMEOUT)
+#define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */
+#endif /* HSE_STARTUP_TIMEOUT */
+
+/**
+ * @brief External clock source for SAI1 peripheral
+ * This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source
+ * frequency.
+ */
+#if !defined (EXTERNAL_SAI1_CLOCK_VALUE)
+ #define EXTERNAL_SAI1_CLOCK_VALUE ((uint32_t)2097000) /*!< Value of the SAI1 External clock source in Hz*/
+#endif /* EXTERNAL_SAI1_CLOCK_VALUE */
+
+/* Tip: To avoid modifying this file each time you need to use different HSE,
+ === you can define the HSE value in your toolchain compiler preprocessor. */
+
+/* ########################### System Configuration ######################### */
+/**
+ * @brief This is the HAL system configuration section
+ */
+
+#define VDD_VALUE 3300U /*!< Value of VDD in mv */
+#define TICK_INT_PRIORITY 0U /*!< tick interrupt priority */
+#define USE_RTOS 0U
+#define PREFETCH_ENABLE 1U
+#define INSTRUCTION_CACHE_ENABLE 1U
+#define DATA_CACHE_ENABLE 1U
+
+/* ########################## Assert Selection ############################## */
+/**
+ * @brief Uncomment the line below to expanse the "assert_param" macro in the
+ * HAL drivers code
+ */
+/* #define USE_FULL_ASSERT 1U */
+
+/* ################## SPI peripheral configuration ########################## */
+
+/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
+ * Activated: CRC code is present inside driver
+ * Deactivated: CRC code cleaned from driver
+ */
+
+#define USE_SPI_CRC 0U
+
+/* Includes ------------------------------------------------------------------*/
+/**
+ * @brief Include module's header file
+ */
+#ifdef HAL_DMA_MODULE_ENABLED
+ #include "stm32wbxx_hal_dma.h"
+#endif /* HAL_DMA_MODULE_ENABLED */
+
+#ifdef HAL_ADC_MODULE_ENABLED
+ #include "stm32wbxx_hal_adc.h"
+#endif /* HAL_ADC_MODULE_ENABLED */
+
+#ifdef HAL_COMP_MODULE_ENABLED
+ #include "stm32wbxx_hal_comp.h"
+#endif /* HAL_COMP_MODULE_ENABLED */
+
+#ifdef HAL_CORTEX_MODULE_ENABLED
+ #include "stm32wbxx_hal_cortex.h"
+#endif /* HAL_CORTEX_MODULE_ENABLED */
+
+#ifdef HAL_CRC_MODULE_ENABLED
+ #include "stm32wbxx_hal_crc.h"
+#endif /* HAL_CRC_MODULE_ENABLED */
+
+#ifdef HAL_CRYP_MODULE_ENABLED
+ #include "stm32wbxx_hal_cryp.h"
+#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
+
+#ifdef HAL_FLASH_MODULE_ENABLED
+ #include "stm32wbxx_hal_flash.h"
+#endif /* HAL_FLASH_MODULE_ENABLED */
+
+#ifdef HAL_GPIO_MODULE_ENABLED
+ #include "stm32wbxx_hal_gpio.h"
+#endif /* HAL_GPIO_MODULE_ENABLED */
+
+#ifdef HAL_HSEM_MODULE_ENABLED
+ #include "stm32wbxx_hal_hsem.h"
+#endif /* HAL_HSEM_MODULE_ENABLED */
+
+#ifdef HAL_I2C_MODULE_ENABLED
+ #include "stm32wbxx_hal_i2c.h"
+#endif /* HAL_I2C_MODULE_ENABLED */
+
+#ifdef HAL_IPCC_MODULE_ENABLED
+ #include "stm32wbxx_hal_ipcc.h"
+#endif /* HAL_IPCC_MODULE_ENABLED */
+
+#ifdef HAL_IRDA_MODULE_ENABLED
+ #include "stm32wbxx_hal_irda.h"
+#endif /* HAL_IRDA_MODULE_ENABLED */
+
+#ifdef HAL_IWDG_MODULE_ENABLED
+ #include "stm32wbxx_hal_iwdg.h"
+#endif /* HAL_IWDG_MODULE_ENABLED */
+
+#ifdef HAL_LCD_MODULE_ENABLED
+ #include "stm32wbxx_hal_lcd.h"
+#endif /* HAL_LCD_MODULE_ENABLED */
+
+#ifdef HAL_LPTIM_MODULE_ENABLED
+ #include "stm32wbxx_hal_lptim.h"
+#endif /* HAL_LPTIM_MODULE_ENABLED */
+
+#ifdef HAL_PCD_MODULE_ENABLED
+ #include "stm32wbxx_hal_pcd.h"
+#endif /* HAL_PCD_MODULE_ENABLED */
+
+#ifdef HAL_PKA_MODULE_ENABLED
+ #include "stm32wbxx_hal_pka.h"
+#endif /* HAL_PKA_MODULE_ENABLED */
+
+#ifdef HAL_PWR_MODULE_ENABLED
+ #include "stm32wbxx_hal_pwr.h"
+#endif /* HAL_PWR_MODULE_ENABLED */
+
+#ifdef HAL_QSPI_MODULE_ENABLED
+ #include "stm32wbxx_hal_qspi.h"
+#endif /* HAL_QSPI_MODULE_ENABLED */
+
+#ifdef HAL_RCC_MODULE_ENABLED
+ #include "stm32wbxx_hal_rcc.h"
+#endif /* HAL_RCC_MODULE_ENABLED */
+
+#ifdef HAL_RNG_MODULE_ENABLED
+ #include "stm32wbxx_hal_rng.h"
+#endif /* HAL_RNG_MODULE_ENABLED */
+
+#ifdef HAL_RTC_MODULE_ENABLED
+ #include "stm32wbxx_hal_rtc.h"
+#endif /* HAL_RTC_MODULE_ENABLED */
+
+#ifdef HAL_SAI_MODULE_ENABLED
+ #include "stm32wbxx_hal_sai.h"
+#endif /* HAL_SAI_MODULE_ENABLED */
+
+#ifdef HAL_SMARTCARD_MODULE_ENABLED
+ #include "stm32wbxx_hal_smartcard.h"
+#endif /* HAL_SMARTCARD_MODULE_ENABLED */
+
+#ifdef HAL_SMBUS_MODULE_ENABLED
+ #include "stm32wbxx_hal_smbus.h"
+#endif /* HAL_SMBUS_MODULE_ENABLED */
+
+#ifdef HAL_SPI_MODULE_ENABLED
+ #include "stm32wbxx_hal_spi.h"
+#endif /* HAL_SPI_MODULE_ENABLED */
+
+#ifdef HAL_TIM_MODULE_ENABLED
+ #include "stm32wbxx_hal_tim.h"
+#endif /* HAL_TIM_MODULE_ENABLED */
+
+#ifdef HAL_TSC_MODULE_ENABLED
+ #include "stm32wbxx_hal_tsc.h"
+#endif /* HAL_TSC_MODULE_ENABLED */
+
+#ifdef HAL_UART_MODULE_ENABLED
+ #include "stm32wbxx_hal_uart.h"
+#endif /* HAL_UART_MODULE_ENABLED */
+
+#ifdef HAL_USART_MODULE_ENABLED
+ #include "stm32wbxx_hal_usart.h"
+#endif /* HAL_USART_MODULE_ENABLED */
+
+#ifdef HAL_WWDG_MODULE_ENABLED
+ #include "stm32wbxx_hal_wwdg.h"
+#endif /* HAL_WWDG_MODULE_ENABLED */
+
+/* Exported macro ------------------------------------------------------------*/
+#ifdef USE_FULL_ASSERT
+/**
+ * @brief The assert_param macro is used for function's parameters check.
+ * @param expr If expr is false, it calls assert_failed function
+ * which reports the name of the source file and the source
+ * line number of the call that failed.
+ * If expr is true, it returns no value.
+ * @retval None
+ */
+ #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
+/* Exported functions ------------------------------------------------------- */
+ void assert_failed(uint8_t* file, uint32_t line);
+#else
+ #define assert_param(expr) ((void)0U)
+#endif /* USE_FULL_ASSERT */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __STM32WBxx_HAL_CONF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/stm32wbxx_it.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/stm32wbxx_it.h
new file mode 100644
index 000000000..a3a535f13
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/stm32wbxx_it.h
@@ -0,0 +1,83 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file stm32wbxx_it.h
+ * @brief This file contains the headers of the interrupt handlers.
+ *******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32WBxx_IT_H
+#define __STM32WBxx_IT_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+#include "app_common.h"
+/* USER CODE END Includes */
+
+/* Exported types ------------------------------------------------------------*/
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* Exported macro ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions prototypes ---------------------------------------------*/
+void NMI_Handler(void);
+void HardFault_Handler(void);
+void MemManage_Handler(void);
+void BusFault_Handler(void);
+void UsageFault_Handler(void);
+void SVC_Handler(void);
+void DebugMon_Handler(void);
+void PendSV_Handler(void);
+void SysTick_Handler(void);
+void PVD_PVM_IRQHandler(void);
+void FLASH_IRQHandler(void);
+void RCC_IRQHandler(void);
+void DMA1_Channel1_IRQHandler(void);
+void DMA1_Channel2_IRQHandler(void);
+void C2SEV_PWR_C2H_IRQHandler(void);
+void USART1_IRQHandler(void);
+void LPUART1_IRQHandler(void);
+void PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler(void);
+void HSEM_IRQHandler(void);
+void FPU_IRQHandler(void);
+/* USER CODE BEGIN EFP */
+void RTC_WKUP_IRQHandler(void);
+void EXTI4_IRQHandler(void);
+void IPCC_C1_TX_IRQHandler(void);
+void IPCC_C1_RX_IRQHandler(void);
+/* USER CODE END EFP */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __STM32WBxx_IT_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/stm_logging.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/stm_logging.h
new file mode 100644
index 000000000..58877c570
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/stm_logging.h
@@ -0,0 +1,55 @@
+/**
+ ******************************************************************************
+ * File Name : stm_logging.h
+ * Description : Application header file for logging
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+#ifndef STM_LOGGING_H_
+#define STM_LOGGING_H_
+
+#define LOG_LEVEL_NONE 0 /* None */
+#define LOG_LEVEL_CRIT 1U /* Critical */
+#define LOG_LEVEL_WARN 2U /* Warning */
+#define LOG_LEVEL_INFO 3U /* Info */
+#define LOG_LEVEL_DEBG 4U /* Debug */
+
+#define APP_DBG_FULL(level, region, ...) \
+ if (APPLI_PRINT_FILE_FUNC_LINE == 1U) \
+ { \
+ printf("\r\n[%s][%s][%d] ", DbgTraceGetFileName(__FILE__), __FUNCTION__, __LINE__); \
+ } \
+ logApplication(level, region, __VA_ARGS__);
+
+#define APP_DBG(...) \
+ if (APPLI_PRINT_FILE_FUNC_LINE == 1U) \
+ { \
+ printf("\r\n[%s][%s][%d] ", DbgTraceGetFileName(__FILE__), __FUNCTION__, __LINE__); \
+ } \
+ logApplication(LOG_LEVEL_NONE, APPLI_LOG_REGION_GENERAL, __VA_ARGS__);
+
+/**
+ * This enumeration represents log regions.
+ *
+ */
+typedef enum {
+ APPLI_LOG_REGION_GENERAL = 1U, /* General */
+ APPLI_LOG_REGION_ZIGBEE_API = 2U, /* OpenThread API */
+} appliLogRegion_t;
+
+typedef uint8_t appliLogLevel_t;
+
+void logApplication(appliLogLevel_t aLogLevel, appliLogRegion_t aLogRegion, const char *aFormat, ...);
+
+#endif /* STM_LOGGING_H_ */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/utilities_conf.h
new file mode 100644
index 000000000..4dde3509a
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Inc/utilities_conf.h
@@ -0,0 +1,68 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : utilities_conf.h
+ * Description : Configuration file for STM32 Utilities.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef UTILITIES_CONF_H
+#define UTILITIES_CONF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "cmsis_compiler.h"
+#include "string.h"
+
+/******************************************************************************
+ * common
+ ******************************************************************************/
+#define UTILS_ENTER_CRITICAL_SECTION( ) uint32_t primask_bit = __get_PRIMASK( );\
+ __disable_irq( )
+
+#define UTILS_EXIT_CRITICAL_SECTION( ) __set_PRIMASK( primask_bit )
+
+#define UTILS_MEMSET8( dest, value, size ) memset( dest, value, size);
+
+/******************************************************************************
+ * tiny low power manager
+ * (any macro that does not need to be modified can be removed)
+ ******************************************************************************/
+#define UTIL_LPM_INIT_CRITICAL_SECTION( )
+#define UTIL_LPM_ENTER_CRITICAL_SECTION( ) UTILS_ENTER_CRITICAL_SECTION( )
+#define UTIL_LPM_EXIT_CRITICAL_SECTION( ) UTILS_EXIT_CRITICAL_SECTION( )
+
+/******************************************************************************
+ * sequencer
+ * (any macro that does not need to be modified can be removed)
+ ******************************************************************************/
+#define UTIL_SEQ_INIT_CRITICAL_SECTION( )
+#define UTIL_SEQ_ENTER_CRITICAL_SECTION( ) UTILS_ENTER_CRITICAL_SECTION( )
+#define UTIL_SEQ_EXIT_CRITICAL_SECTION( ) UTILS_EXIT_CRITICAL_SECTION( )
+#define UTIL_SEQ_CONF_TASK_NBR (32)
+#define UTIL_SEQ_CONF_PRIO_NBR (2)
+#define UTIL_SEQ_MEMSET8( dest, value, size ) UTILS_MEMSET8( dest, value, size )
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*UTILITIES_CONF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/app_entry.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/app_entry.c
new file mode 100644
index 000000000..901f796a0
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/app_entry.c
@@ -0,0 +1,396 @@
+/**
+ ******************************************************************************
+ * File Name : app_entry.c
+ * Description : Entry application source file for STM32WPAN Middleware.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "main.h"
+#include "app_entry.h"
+#include "app_zigbee.h"
+#include "app_conf.h"
+#include "hw_conf.h"
+#include "stm32_seq.h"
+#include "stm_logging.h"
+#include "shci_tl.h"
+#include "stm32_lpm.h"
+#include "dbg_trace.h"
+#include "shci.h"
+
+/* Private includes -----------------------------------------------------------*/
+
+/* Private typedef -----------------------------------------------------------*/
+extern RTC_HandleTypeDef hrtc;
+
+/* Private defines -----------------------------------------------------------*/
+#define POOL_SIZE (CFG_TL_EVT_QUEUE_LENGTH * 4U * DIVC((sizeof(TL_PacketHeader_t) + TL_EVENT_FRAME_SIZE), 4U))
+
+/* Private variables ---------------------------------------------------------*/
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t EvtPool[POOL_SIZE];
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static TL_CmdPacket_t SystemCmdBuffer;
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t SystemSpareEvtBuffer[sizeof(TL_PacketHeader_t) + TL_EVT_HDR_SIZE + 255U];
+
+/* Global function prototypes -----------------------------------------------*/
+size_t __write(int handle, const unsigned char *buf, size_t bufSize);
+
+/* Private functions prototypes-----------------------------------------------*/
+static void SystemPower_Config(void);
+static void Init_Debug(void);
+static void appe_Tl_Init(void);
+static void APPE_SysStatusNot(SHCI_TL_CmdStatus_t status);
+static void APPE_SysUserEvtRx(void *pPayload);
+static void APPE_SysEvtReadyProcessing(void);
+static void APPE_SysEvtError(SCHI_SystemErrCode_t ErrorCode);
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+extern void MX_LPUART1_UART_Init(void);
+#endif
+#if (CFG_HW_USART1_ENABLED == 1)
+extern void MX_USART1_UART_Init(void);
+#endif
+
+/* USER CODE BEGIN PFP */
+static void Led_Init(void);
+static void Button_Init(void);
+/* USER CODE END PFP */
+
+/* Functions Definition ------------------------------------------------------*/
+void APPE_Init( void )
+{
+ SystemPower_Config(); /**< Configure the system Power Mode */
+
+ HW_TS_Init(hw_ts_InitMode_Full, &hrtc); /**< Initialize the TimerServer */
+
+ Init_Debug();
+ /**
+ * The Standby mode should not be entered before the initialization is over
+ * The default state of the Low Power Manager is to allow the Standby Mode so an request is needed here
+ */
+ UTIL_LPM_SetOffMode(1 << CFG_LPM_APP, UTIL_LPM_DISABLE);
+ Led_Init();
+ Button_Init();
+ appe_Tl_Init(); /* Initialize all transport layers */
+
+ /**
+ * From now, the application is waiting for the ready event ( VS_HCI_C2_Ready )
+ * received on the system channel before starting the Zigbee Stack
+ * This system event is received with APPE_SysUserEvtRx()
+ */
+
+ return;
+}
+
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+static void Init_Debug( void )
+{
+#if (CFG_DEBUGGER_SUPPORTED == 1)
+ /**
+ * Keep debugger enabled while in any low power mode
+ */
+ HAL_DBGMCU_EnableDBGSleepMode();
+
+ /***************** ENABLE DEBUGGER *************************************/
+ LL_EXTI_EnableIT_32_63(LL_EXTI_LINE_48);
+ LL_C2_EXTI_EnableIT_32_63(LL_EXTI_LINE_48);
+
+#else
+
+ GPIO_InitTypeDef gpio_config = {0};
+
+ gpio_config.Pull = GPIO_NOPULL;
+ gpio_config.Mode = GPIO_MODE_ANALOG;
+
+ gpio_config.Pin = GPIO_PIN_15 | GPIO_PIN_14 | GPIO_PIN_13;
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ HAL_GPIO_Init(GPIOA, &gpio_config);
+ __HAL_RCC_GPIOA_CLK_DISABLE();
+
+ gpio_config.Pin = GPIO_PIN_4 | GPIO_PIN_3;
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+ HAL_GPIO_Init(GPIOB, &gpio_config);
+ __HAL_RCC_GPIOB_CLK_DISABLE();
+
+ HAL_DBGMCU_DisableDBGSleepMode();
+ HAL_DBGMCU_DisableDBGStopMode();
+ HAL_DBGMCU_DisableDBGStandbyMode();
+
+#endif /* (CFG_DEBUGGER_SUPPORTED == 1) */
+
+#if(CFG_DEBUG_TRACE != 0)
+ DbgTraceInit();
+#endif
+
+ return;
+}
+
+/**
+ * @brief Configure the system for power optimization
+ *
+ * @note This API configures the system to be ready for low power mode
+ *
+ * @param None
+ * @retval None
+ */
+static void SystemPower_Config( void )
+{
+
+ /**
+ * Select HSI as system clock source after Wake Up from Stop mode
+ */
+ LL_RCC_SetClkAfterWakeFromStop(LL_RCC_STOP_WAKEUPCLOCK_HSI);
+
+ /* Initialize low power manager */
+ UTIL_LPM_Init( );
+
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+ /**
+ * Enable USB power
+ */
+ HAL_PWREx_EnableVddUSB();
+#endif
+
+ return;
+}
+
+static void appe_Tl_Init( void )
+{
+ TL_MM_Config_t tl_mm_config;
+ SHCI_TL_HciInitConf_t SHci_Tl_Init_Conf;
+ /**< Reference table initialization */
+ TL_Init();
+
+ /**< System channel initialization */
+ UTIL_SEQ_RegTask( 1<< CFG_TASK_SYSTEM_HCI_ASYNCH_EVT, UTIL_SEQ_RFU, shci_user_evt_proc );
+ SHci_Tl_Init_Conf.p_cmdbuffer = (uint8_t*)&SystemCmdBuffer;
+ SHci_Tl_Init_Conf.StatusNotCallBack = APPE_SysStatusNot;
+ shci_init(APPE_SysUserEvtRx, (void*) &SHci_Tl_Init_Conf);
+
+ /**< Memory Manager channel initialization */
+ tl_mm_config.p_BleSpareEvtBuffer = 0;
+ tl_mm_config.p_SystemSpareEvtBuffer = SystemSpareEvtBuffer;
+ tl_mm_config.p_AsynchEvtPool = EvtPool;
+ tl_mm_config.AsynchEvtPoolSize = POOL_SIZE;
+ TL_MM_Init( &tl_mm_config );
+
+ TL_Enable();
+
+ return;
+}
+
+
+static void APPE_SysStatusNot(SHCI_TL_CmdStatus_t status)
+{
+ UNUSED(status);
+ return;
+}
+
+/**
+ * @brief Trap a notification coming from the M0 firmware
+ * @param pPayload : payload associated to the notification
+ *
+ * @retval None
+ */
+
+static void APPE_SysUserEvtRx( void * pPayload )
+{
+ TL_AsynchEvt_t *p_sys_event;
+ p_sys_event = (TL_AsynchEvt_t*)(((tSHCI_UserEvtRxParam*)pPayload)->pckt->evtserial.evt.payload);
+
+ switch(p_sys_event->subevtcode)
+ {
+ case SHCI_SUB_EVT_CODE_READY:
+ APPE_SysEvtReadyProcessing();
+ break;
+ case SHCI_SUB_EVT_ERROR_NOTIF:
+ APPE_SysEvtError((SCHI_SystemErrCode_t) (p_sys_event->payload[0]));
+ break;
+ default:
+ break;
+ }
+ return;
+}
+
+/**
+ * @brief Notify a system error coming from the M0 firmware
+ * @param ErrorCode : errorCode detected by the M0 firmware
+ *
+ * @retval None
+ */
+static void APPE_SysEvtError( SCHI_SystemErrCode_t ErrorCode)
+{
+ switch (ErrorCode) // TODO
+ {
+ case ERR_THREAD_LLD_FATAL_ERROR:
+ APP_DBG("** ERR_ZIGBEE : LLD_FATAL_ERROR \n");
+ break;
+ case ERR_THREAD_UNKNOWN_CMD:
+ APP_DBG("** ERR_ZIGBEE : UNKNOWN_CMD \n");
+ break;
+ default:
+ APP_DBG("** ERR_ZIGBEE : ErroCode=%d \n", ErrorCode);
+ break;
+ }
+ return;
+}
+
+static void APPE_SysEvtReadyProcessing( void )
+{
+ /* Traces channel initialization */
+ TL_TRACES_Init();
+
+ APP_ZIGBEE_Init();
+ UTIL_LPM_SetOffMode(1U << CFG_LPM_APP, UTIL_LPM_ENABLE);
+ return;
+}
+
+/* USER CODE BEGIN FD_LOCAL_FUNCTIONS */
+static void Led_Init( void )
+{
+#if (CFG_LED_SUPPORTED == 1U)
+ /**
+ * Leds Initialization
+ */
+
+ BSP_LED_Init(LED_BLUE);
+ BSP_LED_Init(LED_GREEN);
+ BSP_LED_Init(LED_RED);
+
+#endif
+
+ return;
+}
+
+static void Button_Init( void )
+{
+#if (CFG_BUTTON_SUPPORTED == 1U)
+ /**
+ * Button Initialization
+ */
+ BSP_PB_Init(BUTTON_SW1, BUTTON_MODE_EXTI);
+ BSP_PB_Init(BUTTON_SW2, BUTTON_MODE_EXTI);
+ BSP_PB_Init(BUTTON_SW3, BUTTON_MODE_EXTI);
+#endif
+
+ return;
+}
+
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+
+void UTIL_SEQ_Idle( void )
+{
+#if ( CFG_LPM_SUPPORTED == 1)
+ UTIL_LPM_EnterLowPower( );
+#endif
+ return;
+}
+
+/**
+ * @brief This function is called by the scheduler each time an event
+ * is pending.
+ *
+ * @param evt_waited_bm : Event pending.
+ * @retval None
+ */
+void UTIL_SEQ_EvtIdle( UTIL_SEQ_bm_t task_id_bm, UTIL_SEQ_bm_t evt_waited_bm )
+{
+ switch (evt_waited_bm) {
+ case EVENT_ACK_FROM_M0_EVT:
+ /* Run only the task CFG_TASK_MSG_FROM_M0_TO_M4 */
+ UTIL_SEQ_Run((1U << CFG_TASK_MSG_FROM_M0_TO_M4));
+ break;
+ case EVENT_SYNCHRO_BYPASS_IDLE:
+ UTIL_SEQ_SetEvt(EVENT_SYNCHRO_BYPASS_IDLE);
+ /* Run only the task CFG_TASK_MSG_FROM_M0_TO_M4 */
+ UTIL_SEQ_Run((1U << CFG_TASK_MSG_FROM_M0_TO_M4));
+ break;
+
+ default:
+ /* default case */
+ UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
+ break;
+ }
+}
+
+void shci_notify_asynch_evt(void* pdata)
+{
+ UNUSED(pdata);
+ UTIL_SEQ_SetTask(1U << CFG_TASK_SYSTEM_HCI_ASYNCH_EVT, CFG_SCH_PRIO_0);
+ return;
+}
+
+void shci_cmd_resp_release(uint32_t flag)
+{
+ UNUSED(flag);
+ UTIL_SEQ_SetEvt(1U << CFG_EVT_SYSTEM_HCI_CMD_EVT_RESP);
+ return;
+}
+
+void shci_cmd_resp_wait(uint32_t timeout)
+{
+ UNUSED(timeout);
+ UTIL_SEQ_WaitEvt(1U << CFG_EVT_SYSTEM_HCI_CMD_EVT_RESP);
+ return;
+}
+
+/* Received trace buffer from M0 */
+void TL_TRACES_EvtReceived( TL_EvtPacket_t * hcievt )
+{
+#if(CFG_DEBUG_TRACE != 0)
+ /* Call write/print function using DMA from dbg_trace */
+ /* - Cast to TL_AsynchEvt_t* to get "real" payload (without Sub Evt code 2bytes),
+ - (-2) to size to remove Sub Evt Code */
+ DbgTraceWrite(1U, (const unsigned char *) ((TL_AsynchEvt_t *)(hcievt->evtserial.evt.payload))->payload, hcievt->evtserial.evt.plen - 2U);
+#endif /* CFG_DEBUG_TRACE */
+ /* Release buffer */
+ TL_MM_EvtDone( hcievt );
+}
+/**
+ * @brief Initialisation of the trace mechanism
+ * @param None
+ * @retval None
+ */
+#if(CFG_DEBUG_TRACE != 0)
+void DbgOutputInit( void )
+{
+ MX_USART1_UART_Init();
+
+ return;
+}
+
+/**
+ * @brief Management of the traces
+ * @param p_data : data
+ * @param size : size
+ * @param call-back :
+ * @retval None
+ */
+void DbgOutputTraces( uint8_t *p_data, uint16_t size, void (*cb)(void) )
+{
+ HW_UART_Transmit_DMA(CFG_DEBUG_TRACE_UART, p_data, size, cb);
+
+ return;
+}
+#endif
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/hw_timerserver.c
new file mode 100644
index 000000000..c842ba55e
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/hw_timerserver.c
@@ -0,0 +1,893 @@
+/**
+ ******************************************************************************
+ * File Name : hw_timerserver.c
+ * Description : Hardware timerserver source file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "hw_conf.h"
+
+/* Private typedef -----------------------------------------------------------*/
+typedef enum
+{
+ TimerID_Free,
+ TimerID_Created,
+ TimerID_Running
+}TimerIDStatus_t;
+
+typedef enum
+{
+ SSR_Read_Requested,
+ SSR_Read_Not_Requested
+}RequestReadSSR_t;
+
+typedef enum
+{
+ WakeupTimerValue_Overpassed,
+ WakeupTimerValue_LargeEnough
+}WakeupTimerLimitation_Status_t;
+
+typedef struct
+{
+ HW_TS_pTimerCb_t pTimerCallBack;
+ uint32_t CounterInit;
+ uint32_t CountLeft;
+ TimerIDStatus_t TimerIDStatus;
+ HW_TS_Mode_t TimerMode;
+ uint32_t TimerProcessID;
+ uint8_t PreviousID;
+ uint8_t NextID;
+}TimerContext_t;
+
+/* Private defines -----------------------------------------------------------*/
+#define SSR_FORBIDDEN_VALUE 0xFFFFFFFF
+#define TIMER_LIST_EMPTY 0xFFFF
+
+/* Private macros ------------------------------------------------------------*/
+/* Private variables ---------------------------------------------------------*/
+
+/**
+ * START of Section TIMERSERVER_CONTEXT
+ */
+
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile TimerContext_t aTimerContext[CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER];
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile uint8_t CurrentRunningTimerID;
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile uint8_t PreviousRunningTimerID;
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile uint32_t SSRValueOnLastSetup;
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile WakeupTimerLimitation_Status_t WakeupTimerLimitation;
+
+/**
+ * END of Section TIMERSERVER_CONTEXT
+ */
+
+static RTC_HandleTypeDef *phrtc; /**< RTC handle */
+static uint8_t WakeupTimerDivider;
+static uint8_t AsynchPrescalerUserConfig;
+static uint16_t SynchPrescalerUserConfig;
+static volatile uint16_t MaxWakeupTimerSetup;
+
+/* Global variables ----------------------------------------------------------*/
+/* Private function prototypes -----------------------------------------------*/
+static void RestartWakeupCounter(uint16_t Value);
+static uint16_t ReturnTimeElapsed(void);
+static void RescheduleTimerList(void);
+static void UnlinkTimer(uint8_t TimerID, RequestReadSSR_t RequestReadSSR);
+static void LinkTimerBefore(uint8_t TimerID, uint8_t RefTimerID);
+static void LinkTimerAfter(uint8_t TimerID, uint8_t RefTimerID);
+static uint16_t linkTimer(uint8_t TimerID);
+static uint32_t ReadRtcSsrValue(void);
+
+__weak void HW_TS_RTC_CountUpdated_AppNot(void);
+
+/* Functions Definition ------------------------------------------------------*/
+
+/**
+ * @brief Read the RTC_SSR value
+ * As described in the reference manual, the RTC_SSR shall be read twice to ensure
+ * reliability of the value
+ * @param None
+ * @retval SSR value read
+ */
+static uint32_t ReadRtcSsrValue(void)
+{
+ uint32_t first_read;
+ uint32_t second_read;
+
+ first_read = (uint32_t)(READ_BIT(RTC->SSR, RTC_SSR_SS));
+
+ second_read = (uint32_t)(READ_BIT(RTC->SSR, RTC_SSR_SS));
+
+ while(first_read != second_read)
+ {
+ first_read = second_read;
+
+ second_read = (uint32_t)(READ_BIT(RTC->SSR, RTC_SSR_SS));
+ }
+
+ return second_read;
+}
+
+/**
+ * @brief Insert a Timer in the list after the Timer ID specified
+ * @param TimerID: The ID of the Timer
+ * @param RefTimerID: The ID of the Timer to be linked after
+ * @retval None
+ */
+static void LinkTimerAfter(uint8_t TimerID, uint8_t RefTimerID)
+{
+ uint8_t next_id;
+
+ next_id = aTimerContext[RefTimerID].NextID;
+
+ if(next_id != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ aTimerContext[next_id].PreviousID = TimerID;
+ }
+ aTimerContext[TimerID].NextID = next_id;
+ aTimerContext[TimerID].PreviousID = RefTimerID ;
+ aTimerContext[RefTimerID].NextID = TimerID;
+
+ return;
+}
+
+/**
+ * @brief Insert a Timer in the list before the ID specified
+ * @param TimerID: The ID of the Timer
+ * @param RefTimerID: The ID of the Timer to be linked before
+ * @retval None
+ */
+static void LinkTimerBefore(uint8_t TimerID, uint8_t RefTimerID)
+{
+ uint8_t previous_id;
+
+ if(RefTimerID != CurrentRunningTimerID)
+ {
+ previous_id = aTimerContext[RefTimerID].PreviousID;
+
+ aTimerContext[previous_id].NextID = TimerID;
+ aTimerContext[TimerID].NextID = RefTimerID;
+ aTimerContext[TimerID].PreviousID = previous_id ;
+ aTimerContext[RefTimerID].PreviousID = TimerID;
+ }
+ else
+ {
+ aTimerContext[TimerID].NextID = RefTimerID;
+ aTimerContext[RefTimerID].PreviousID = TimerID;
+ }
+
+ return;
+}
+
+/**
+ * @brief Insert a Timer in the list
+ * @param TimerID: The ID of the Timer
+ * @retval None
+ */
+static uint16_t linkTimer(uint8_t TimerID)
+{
+ uint32_t time_left;
+ uint16_t time_elapsed;
+ uint8_t timer_id_lookup;
+ uint8_t next_id;
+
+ if(CurrentRunningTimerID == CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ /**
+ * No timer in the list
+ */
+ PreviousRunningTimerID = CurrentRunningTimerID;
+ CurrentRunningTimerID = TimerID;
+ aTimerContext[TimerID].NextID = CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER;
+
+ SSRValueOnLastSetup = SSR_FORBIDDEN_VALUE;
+ time_elapsed = 0;
+ }
+ else
+ {
+ time_elapsed = ReturnTimeElapsed();
+
+ /**
+ * update count of the timer to be linked
+ */
+ aTimerContext[TimerID].CountLeft += time_elapsed;
+ time_left = aTimerContext[TimerID].CountLeft;
+
+ /**
+ * Search for index where the new timer shall be linked
+ */
+ if(aTimerContext[CurrentRunningTimerID].CountLeft <= time_left)
+ {
+ /**
+ * Search for the ID after the first one
+ */
+ timer_id_lookup = CurrentRunningTimerID;
+ next_id = aTimerContext[timer_id_lookup].NextID;
+ while((next_id != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) && (aTimerContext[next_id].CountLeft <= time_left))
+ {
+ timer_id_lookup = aTimerContext[timer_id_lookup].NextID;
+ next_id = aTimerContext[timer_id_lookup].NextID;
+ }
+
+ /**
+ * Link after the ID
+ */
+ LinkTimerAfter(TimerID, timer_id_lookup);
+ }
+ else
+ {
+ /**
+ * Link before the first ID
+ */
+ LinkTimerBefore(TimerID, CurrentRunningTimerID);
+ PreviousRunningTimerID = CurrentRunningTimerID;
+ CurrentRunningTimerID = TimerID;
+ }
+ }
+
+ return time_elapsed;
+}
+
+/**
+ * @brief Remove a Timer from the list
+ * @param TimerID: The ID of the Timer
+ * @param RequestReadSSR: Request to read the SSR register or not
+ * @retval None
+ */
+static void UnlinkTimer(uint8_t TimerID, RequestReadSSR_t RequestReadSSR)
+{
+ uint8_t previous_id;
+ uint8_t next_id;
+
+ if(TimerID == CurrentRunningTimerID)
+ {
+ PreviousRunningTimerID = CurrentRunningTimerID;
+ CurrentRunningTimerID = aTimerContext[TimerID].NextID;
+ }
+ else
+ {
+ previous_id = aTimerContext[TimerID].PreviousID;
+ next_id = aTimerContext[TimerID].NextID;
+
+ aTimerContext[previous_id].NextID = aTimerContext[TimerID].NextID;
+ if(next_id != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ aTimerContext[next_id].PreviousID = aTimerContext[TimerID].PreviousID;
+ }
+ }
+
+ /**
+ * Timer is out of the list
+ */
+ aTimerContext[TimerID].TimerIDStatus = TimerID_Created;
+
+ if((CurrentRunningTimerID == CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) && (RequestReadSSR == SSR_Read_Requested))
+ {
+ SSRValueOnLastSetup = SSR_FORBIDDEN_VALUE;
+ }
+
+ return;
+}
+
+/**
+ * @brief Return the number of ticks counted by the wakeuptimer since it has been started
+ * @note The API is reading the SSR register to get how many ticks have been counted
+ * since the time the timer has been started
+ * @param None
+ * @retval Time expired in Ticks
+ */
+static uint16_t ReturnTimeElapsed(void)
+{
+ uint32_t return_value;
+ uint32_t wrap_counter;
+
+ if(SSRValueOnLastSetup != SSR_FORBIDDEN_VALUE)
+ {
+ return_value = ReadRtcSsrValue(); /**< Read SSR register first */
+
+ if (SSRValueOnLastSetup >= return_value)
+ {
+ return_value = SSRValueOnLastSetup - return_value;
+ }
+ else
+ {
+ wrap_counter = SynchPrescalerUserConfig - return_value;
+ return_value = SSRValueOnLastSetup + wrap_counter;
+ }
+
+ /**
+ * At this stage, ReturnValue holds the number of ticks counted by SSR
+ * Need to translate in number of ticks counted by the Wakeuptimer
+ */
+ return_value = return_value*AsynchPrescalerUserConfig;
+ return_value = return_value >> WakeupTimerDivider;
+ }
+ else
+ {
+ return_value = 0;
+ }
+
+ return (uint16_t)return_value;
+}
+
+/**
+ * @brief Set the wakeup counter
+ * @note The API is writing the counter value so that the value is decreased by one to cope with the fact
+ * the interrupt is generated with 1 extra clock cycle (See RefManuel)
+ * It assumes all condition are met to be allowed to write the wakeup counter
+ * @param Value: Value to be written in the counter
+ * @retval None
+ */
+static void RestartWakeupCounter(uint16_t Value)
+{
+ /**
+ * The wakeuptimer has been disabled in the calling function to reduce the time to poll the WUTWF
+ * FLAG when the new value will have to be written
+ * __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc);
+ */
+
+ if(Value == 0)
+ {
+ SSRValueOnLastSetup = ReadRtcSsrValue();
+
+ /**
+ * Simulate that the Timer expired
+ */
+ HAL_NVIC_SetPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID);
+ }
+ else
+ {
+ if((Value > 1) ||(WakeupTimerDivider != 1))
+ {
+ Value -= 1;
+ }
+
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == RESET);
+
+ /**
+ * make sure to clear the flags after checking the WUTWF.
+ * It takes 2 RTCCLK between the time the WUTE bit is disabled and the
+ * time the timer is disabled. The WUTWF bit somehow guarantee the system is stable
+ * Otherwise, when the timer is periodic with 1 Tick, it may generate an extra interrupt in between
+ * due to the autoreload feature
+ */
+ __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */
+ __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */
+ HAL_NVIC_ClearPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Clear pending bit in NVIC */
+
+ MODIFY_REG(RTC->WUTR, RTC_WUTR_WUT, Value);
+
+ /**
+ * Update the value here after the WUTWF polling that may take some time
+ */
+ SSRValueOnLastSetup = ReadRtcSsrValue();
+
+ __HAL_RTC_WAKEUPTIMER_ENABLE(phrtc); /**< Enable the Wakeup Timer */
+
+ HW_TS_RTC_CountUpdated_AppNot();
+ }
+
+ return ;
+}
+
+/**
+ * @brief Reschedule the list of timer
+ * @note 1) Update the count left for each timer in the list
+ * 2) Setup the wakeuptimer
+ * @param None
+ * @retval None
+ */
+static void RescheduleTimerList(void)
+{
+ uint8_t localTimerID;
+ uint32_t timecountleft;
+ uint16_t wakeup_timer_value;
+ uint16_t time_elapsed;
+
+ /**
+ * The wakeuptimer is disabled now to reduce the time to poll the WUTWF
+ * FLAG when the new value will have to be written
+ */
+ if((READ_BIT(RTC->CR, RTC_CR_WUTE) == (RTC_CR_WUTE)) == SET)
+ {
+ /**
+ * Wait for the flag to be back to 0 when the wakeup timer is enabled
+ */
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == SET);
+ }
+ __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc); /**< Disable the Wakeup Timer */
+
+ localTimerID = CurrentRunningTimerID;
+
+ /**
+ * Calculate what will be the value to write in the wakeuptimer
+ */
+ timecountleft = aTimerContext[localTimerID].CountLeft;
+
+ /**
+ * Read how much has been counted
+ */
+ time_elapsed = ReturnTimeElapsed();
+
+ if(timecountleft < time_elapsed )
+ {
+ /**
+ * There is no tick left to count
+ */
+ wakeup_timer_value = 0;
+ WakeupTimerLimitation = WakeupTimerValue_LargeEnough;
+ }
+ else
+ {
+ if(timecountleft > (time_elapsed + MaxWakeupTimerSetup))
+ {
+ /**
+ * The number of tick left is greater than the Wakeuptimer maximum value
+ */
+ wakeup_timer_value = MaxWakeupTimerSetup;
+
+ WakeupTimerLimitation = WakeupTimerValue_Overpassed;
+ }
+ else
+ {
+ wakeup_timer_value = timecountleft - time_elapsed;
+ WakeupTimerLimitation = WakeupTimerValue_LargeEnough;
+ }
+
+ }
+
+ /**
+ * update ticks left to be counted for each timer
+ */
+ while(localTimerID != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ if (aTimerContext[localTimerID].CountLeft < time_elapsed)
+ {
+ aTimerContext[localTimerID].CountLeft = 0;
+ }
+ else
+ {
+ aTimerContext[localTimerID].CountLeft -= time_elapsed;
+ }
+ localTimerID = aTimerContext[localTimerID].NextID;
+ }
+
+ /**
+ * Write next count
+ */
+ RestartWakeupCounter(wakeup_timer_value);
+
+ return ;
+}
+
+/* Public functions ----------------------------------------------------------*/
+
+/**
+ * For all public interface except that may need write access to the RTC, the RTC
+ * shall be unlock at the beginning and locked at the output
+ * In order to ease maintainability, the unlock is done at the top and the lock at then end
+ * in case some new implementation is coming in the future
+ */
+
+void HW_TS_RTC_Wakeup_Handler(void)
+{
+ HW_TS_pTimerCb_t ptimer_callback;
+ uint32_t timer_process_id;
+ uint8_t local_current_running_timer_id;
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ uint32_t primask_bit;
+#endif
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+#endif
+
+/* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+
+ /**
+ * Disable the Wakeup Timer
+ * This may speed up a bit the processing to wait the timer to be disabled
+ * The timer is still counting 2 RTCCLK
+ */
+ __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc);
+
+ local_current_running_timer_id = CurrentRunningTimerID;
+
+ if(aTimerContext[local_current_running_timer_id].TimerIDStatus == TimerID_Running)
+ {
+ ptimer_callback = aTimerContext[local_current_running_timer_id].pTimerCallBack;
+ timer_process_id = aTimerContext[local_current_running_timer_id].TimerProcessID;
+
+ /**
+ * It should be good to check whether the TimeElapsed is greater or not than the tick left to be counted
+ * However, due to the inaccuracy of the reading of the time elapsed, it may return there is 1 tick
+ * to be left whereas the count is over
+ * A more secure implementation has been done with a flag to state whereas the full count has been written
+ * in the wakeuptimer or not
+ */
+ if(WakeupTimerLimitation != WakeupTimerValue_Overpassed)
+ {
+ if(aTimerContext[local_current_running_timer_id].TimerMode == hw_ts_Repeated)
+ {
+ UnlinkTimer(local_current_running_timer_id, SSR_Read_Not_Requested);
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+ HW_TS_Start(local_current_running_timer_id, aTimerContext[local_current_running_timer_id].CounterInit);
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+ }
+ else
+ {
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+ HW_TS_Stop(local_current_running_timer_id);
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+ }
+
+ HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
+ }
+ else
+ {
+ RescheduleTimerList();
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+ }
+ }
+ else
+ {
+ /**
+ * We should never end up in this case
+ * However, if due to any bug in the timer server this is the case, the mistake may not impact the user.
+ * We could just clean the interrupt flag and get out from this unexpected interrupt
+ */
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == RESET);
+
+ /**
+ * make sure to clear the flags after checking the WUTWF.
+ * It takes 2 RTCCLK between the time the WUTE bit is disabled and the
+ * time the timer is disabled. The WUTWF bit somehow guarantee the system is stable
+ * Otherwise, when the timer is periodic with 1 Tick, it may generate an extra interrupt in between
+ * due to the autoreload feature
+ */
+ __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */
+ __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+ }
+
+ /* Enable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_ENABLE( phrtc );
+
+ return;
+}
+
+void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
+{
+ uint8_t loop;
+ uint32_t localmaxwakeuptimersetup;
+
+ /**
+ * Get RTC handler
+ */
+ phrtc = hrtc;
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+
+ SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
+
+ /**
+ * Readout the user config
+ */
+ WakeupTimerDivider = (4 - ((uint32_t)(READ_BIT(RTC->CR, RTC_CR_WUCKSEL))));
+
+ AsynchPrescalerUserConfig = (uint8_t)(READ_BIT(RTC->PRER, RTC_PRER_PREDIV_A) >> (uint32_t)POSITION_VAL(RTC_PRER_PREDIV_A)) + 1;
+
+ SynchPrescalerUserConfig = (uint16_t)(READ_BIT(RTC->PRER, RTC_PRER_PREDIV_S)) + 1;
+
+ /**
+ * Margin is taken to avoid wrong calculation when the wrap around is there and some
+ * application interrupts may have delayed the reading
+ */
+ localmaxwakeuptimersetup = ((((SynchPrescalerUserConfig - 1)*AsynchPrescalerUserConfig) - CFG_HW_TS_RTC_HANDLER_MAX_DELAY) >> WakeupTimerDivider);
+
+ if(localmaxwakeuptimersetup >= 0xFFFF)
+ {
+ MaxWakeupTimerSetup = 0xFFFF;
+ }
+ else
+ {
+ MaxWakeupTimerSetup = (uint16_t)localmaxwakeuptimersetup;
+ }
+
+ /**
+ * Configure EXTI module
+ */
+ LL_EXTI_EnableRisingTrig_0_31(RTC_EXTI_LINE_WAKEUPTIMER_EVENT);
+ LL_EXTI_EnableIT_0_31(RTC_EXTI_LINE_WAKEUPTIMER_EVENT);
+
+ if(TimerInitMode == hw_ts_InitMode_Full)
+ {
+ WakeupTimerLimitation = WakeupTimerValue_LargeEnough;
+ SSRValueOnLastSetup = SSR_FORBIDDEN_VALUE;
+
+ /**
+ * Initialize the timer server
+ */
+ for(loop = 0; loop < CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER; loop++)
+ {
+ aTimerContext[loop].TimerIDStatus = TimerID_Free;
+ }
+
+ CurrentRunningTimerID = CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER; /**< Set ID to non valid value */
+
+ __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc); /**< Disable the Wakeup Timer */
+ __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */
+ __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */
+ HAL_NVIC_ClearPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Clear pending bit in NVIC */
+ __HAL_RTC_WAKEUPTIMER_ENABLE_IT(phrtc, RTC_IT_WUT); /**< Enable interrupt in RTC module */
+ }
+ else
+ {
+ if(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTF) != RESET)
+ {
+ /**
+ * Simulate that the Timer expired
+ */
+ HAL_NVIC_SetPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID);
+ }
+ }
+
+ /* Enable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_ENABLE( phrtc );
+
+ HAL_NVIC_SetPriority(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID, CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO, CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO); /**< Set NVIC priority */
+ HAL_NVIC_EnableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Enable NVIC */
+
+ return;
+}
+
+HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pftimeout_handler)
+{
+ HW_TS_ReturnStatus_t localreturnstatus;
+ uint8_t loop = 0;
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ uint32_t primask_bit;
+#endif
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+#endif
+
+ while((loop < CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) && (aTimerContext[loop].TimerIDStatus != TimerID_Free))
+ {
+ loop++;
+ }
+
+ if(loop != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ aTimerContext[loop].TimerIDStatus = TimerID_Created;
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+
+ aTimerContext[loop].TimerProcessID = TimerProcessID;
+ aTimerContext[loop].TimerMode = TimerMode;
+ aTimerContext[loop].pTimerCallBack = pftimeout_handler;
+ *pTimerId = loop;
+
+ localreturnstatus = hw_ts_Successful;
+ }
+ else
+ {
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+
+ localreturnstatus = hw_ts_Failed;
+ }
+
+ return(localreturnstatus);
+}
+
+void HW_TS_Delete(uint8_t timer_id)
+{
+ HW_TS_Stop(timer_id);
+
+ aTimerContext[timer_id].TimerIDStatus = TimerID_Free; /**< release ID */
+
+ return;
+}
+
+void HW_TS_Stop(uint8_t timer_id)
+{
+ uint8_t localcurrentrunningtimerid;
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ uint32_t primask_bit;
+#endif
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+#endif
+
+ HAL_NVIC_DisableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Disable NVIC */
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+
+ if(aTimerContext[timer_id].TimerIDStatus == TimerID_Running)
+ {
+ UnlinkTimer(timer_id, SSR_Read_Requested);
+ localcurrentrunningtimerid = CurrentRunningTimerID;
+
+ if(localcurrentrunningtimerid == CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ /**
+ * List is empty
+ */
+
+ /**
+ * Disable the timer
+ */
+ if((READ_BIT(RTC->CR, RTC_CR_WUTE) == (RTC_CR_WUTE)) == SET)
+ {
+ /**
+ * Wait for the flag to be back to 0 when the wakeup timer is enabled
+ */
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == SET);
+ }
+ __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc); /**< Disable the Wakeup Timer */
+
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == RESET);
+
+ /**
+ * make sure to clear the flags after checking the WUTWF.
+ * It takes 2 RTCCLK between the time the WUTE bit is disabled and the
+ * time the timer is disabled. The WUTWF bit somehow guarantee the system is stable
+ * Otherwise, when the timer is periodic with 1 Tick, it may generate an extra interrupt in between
+ * due to the autoreload feature
+ */
+ __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */
+ __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */
+ HAL_NVIC_ClearPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Clear pending bit in NVIC */
+ }
+ else if(PreviousRunningTimerID != localcurrentrunningtimerid)
+ {
+ RescheduleTimerList();
+ }
+ }
+
+ /* Enable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_ENABLE( phrtc );
+
+ HAL_NVIC_EnableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Enable NVIC */
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+
+ return;
+}
+
+void HW_TS_Start(uint8_t timer_id, uint32_t timeout_ticks)
+{
+ uint16_t time_elapsed;
+ uint8_t localcurrentrunningtimerid;
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ uint32_t primask_bit;
+#endif
+
+ if(aTimerContext[timer_id].TimerIDStatus == TimerID_Running)
+ {
+ HW_TS_Stop( timer_id );
+ }
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+#endif
+
+ HAL_NVIC_DisableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Disable NVIC */
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+
+ aTimerContext[timer_id].TimerIDStatus = TimerID_Running;
+
+ aTimerContext[timer_id].CountLeft = timeout_ticks;
+ aTimerContext[timer_id].CounterInit = timeout_ticks;
+
+ time_elapsed = linkTimer(timer_id);
+
+ localcurrentrunningtimerid = CurrentRunningTimerID;
+
+ if(PreviousRunningTimerID != localcurrentrunningtimerid)
+ {
+ RescheduleTimerList();
+ }
+ else
+ {
+ aTimerContext[timer_id].CountLeft -= time_elapsed;
+ }
+
+ /* Enable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_ENABLE( phrtc );
+
+ HAL_NVIC_EnableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Enable NVIC */
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+
+ return;
+}
+
+uint16_t HW_TS_RTC_ReadLeftTicksToCount(void)
+{
+ uint32_t primask_bit;
+ uint16_t return_value, auro_reload_value, elapsed_time_value;
+
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+
+ if((READ_BIT(RTC->CR, RTC_CR_WUTE) == (RTC_CR_WUTE)) == SET)
+ {
+ auro_reload_value = (uint32_t)(READ_BIT(RTC->WUTR, RTC_WUTR_WUT));
+
+ elapsed_time_value = ReturnTimeElapsed();
+
+ if(auro_reload_value > elapsed_time_value)
+ {
+ return_value = auro_reload_value - elapsed_time_value;
+ }
+ else
+ {
+ return_value = 0;
+ }
+ }
+ else
+ {
+ return_value = TIMER_LIST_EMPTY;
+ }
+
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+
+ return (return_value);
+}
+
+__weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack)
+{
+ pTimerCallBack();
+
+ return;
+}
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/hw_uart.c
new file mode 100644
index 000000000..9a553610d
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/hw_uart.c
@@ -0,0 +1,318 @@
+/**
+ ******************************************************************************
+ * File Name : Src/hw_uart.c
+ * Description : HW UART source file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "hw_conf.h"
+#if (CFG_HW_LPUART1_ENABLED == 1)
+extern UART_HandleTypeDef hlpuart1;
+#endif
+#if (CFG_HW_USART1_ENABLED == 1)
+extern UART_HandleTypeDef huart1;
+#endif
+
+/* Macros --------------------------------------------------------------------*/
+#define HW_UART_RX_IT(__HANDLE__, __USART_BASE__) \
+ do{ \
+ HW_##__HANDLE__##RxCb = cb; \
+ (__HANDLE__).Instance = (__USART_BASE__); \
+ HAL_UART_Receive_IT(&(__HANDLE__), p_data, size); \
+ } while(0)
+
+#define HW_UART_TX_IT(__HANDLE__, __USART_BASE__) \
+ do{ \
+ HW_##__HANDLE__##TxCb = cb; \
+ (__HANDLE__).Instance = (__USART_BASE__); \
+ HAL_UART_Transmit_IT(&(__HANDLE__), p_data, size); \
+ } while(0)
+
+#define HW_UART_TX(__HANDLE__, __USART_BASE__) \
+ do{ \
+ (__HANDLE__).Instance = (__USART_BASE__); \
+ hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
+ } while(0)
+
+/* Variables -----------------------------------------------------------------*/
+#if (CFG_HW_USART1_ENABLED == 1)
+#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
+ DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
+#endif
+ void (*HW_huart1RxCb)(void);
+ void (*HW_huart1TxCb)(void);
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
+ DMA_HandleTypeDef HW_hdma_hlpuart1_tx ={0};
+#endif
+ void (*HW_hlpuart1RxCb)(void);
+ void (*HW_hlpuart1TxCb)(void);
+#endif
+
+void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HW_UART_RX_IT(huart1, USART1);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HW_UART_RX_IT(hlpuart1, LPUART1);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HW_UART_TX_IT(huart1, USART1);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HW_UART_TX_IT(hlpuart1, LPUART1);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
+{
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
+
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HW_UART_TX(huart1, USART1);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HW_UART_TX(hlpuart1, LPUART1);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ switch (hal_status)
+ {
+ case HAL_OK:
+ hw_status = hw_uart_ok;
+ break;
+
+ case HAL_ERROR:
+ hw_status = hw_uart_error;
+ break;
+
+ case HAL_BUSY:
+ hw_status = hw_uart_busy;
+ break;
+
+ case HAL_TIMEOUT:
+ hw_status = hw_uart_to;
+ break;
+
+ default:
+ break;
+ }
+
+ return hw_status;
+}
+
+hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
+
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HW_huart1TxCb = cb;
+ huart1.Instance = USART1;
+ hal_status = HAL_UART_Transmit_DMA(&huart1, p_data, size);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HW_hlpuart1TxCb = cb;
+ hlpuart1.Instance = LPUART1;
+ hal_status = HAL_UART_Transmit_DMA(&hlpuart1, p_data, size);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ switch (hal_status)
+ {
+ case HAL_OK:
+ hw_status = hw_uart_ok;
+ break;
+
+ case HAL_ERROR:
+ hw_status = hw_uart_error;
+ break;
+
+ case HAL_BUSY:
+ hw_status = hw_uart_busy;
+ break;
+
+ case HAL_TIMEOUT:
+ hw_status = hw_uart_to;
+ break;
+
+ default:
+ break;
+ }
+
+ return hw_status;
+}
+
+void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id)
+{
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HAL_UART_IRQHandler(&huart1);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HAL_UART_IRQHandler(&hlpuart1);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
+{
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
+ case hw_uart1:
+ HAL_DMA_IRQHandler(huart1.hdmatx);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
+ case hw_lpuart1:
+ HAL_DMA_IRQHandler(hlpuart1.hdmatx);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
+{
+ switch ((uint32_t)huart->Instance)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case (uint32_t)USART1:
+ if(HW_huart1RxCb)
+ {
+ HW_huart1RxCb();
+ }
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case (uint32_t)LPUART1:
+ if(HW_hlpuart1RxCb)
+ {
+ HW_hlpuart1RxCb();
+ }
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
+{
+ switch ((uint32_t)huart->Instance)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case (uint32_t)USART1:
+ if(HW_huart1TxCb)
+ {
+ HW_huart1TxCb();
+ }
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case (uint32_t)LPUART1:
+ if(HW_hlpuart1TxCb)
+ {
+ HW_hlpuart1TxCb();
+ }
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/main.c
new file mode 100644
index 000000000..e08ffb500
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/main.c
@@ -0,0 +1,521 @@
+/**
+ ******************************************************************************
+ * @file : main.c
+ * @brief : Main program body
+ *
+ @verbatim
+ ==============================================================================
+ ##### IMPORTANT NOTE #####
+ ==============================================================================
+
+ This application requests having the stm32wb5x_Zigbee_fw.bin binary
+ flashed on the Wireless Coprocessor.
+ If it is not the case, you need to use STM32CubeProgrammer to load the appropriate
+ binary.
+
+ All available binaries are located under following directory:
+ /Projects/STM32_Copro_Wireless_Binaries
+
+ Refer to UM2237 to learn how to use/install STM32CubeProgrammer.
+ Refer to /Projects/STM32_Copro_Wireless_Binaries/ReleaseNote.html for the
+ detailed procedure to change the Wireless Coprocessor binary.
+
+ @endverbatim
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+#include "app_entry.h"
+
+/* Private includes ----------------------------------------------------------*/
+
+#include "dbg_trace.h"
+#include "hw_conf.h"
+#include "otp.h"
+#include "stm32_seq.h"
+
+/* Private variables ---------------------------------------------------------*/
+UART_HandleTypeDef hlpuart1;
+UART_HandleTypeDef huart1;
+DMA_HandleTypeDef hdma_lpuart1_tx;
+DMA_HandleTypeDef hdma_usart1_tx;
+RTC_HandleTypeDef hrtc;
+
+/* Private function prototypes -----------------------------------------------*/
+void SystemClock_Config(void);
+static void MX_GPIO_Init(void);
+static void MX_DMA_Init(void);
+void MX_LPUART1_UART_Init(void);
+void MX_USART1_UART_Init(void);
+static void MX_RF_Init(void);
+static void MX_RTC_Init(void);
+
+void PeriphClock_Config(void);
+static void Reset_Device(void);
+static void Reset_IPCC(void);
+static void Reset_BackupDomain(void);
+static void Init_Exti(void);
+static void Config_HSE(void);
+
+/**
+ * @brief The application entry point.
+ * @retval int
+ */
+int main(void)
+{
+ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
+ HAL_Init();
+
+ Reset_Device();
+ Config_HSE();
+
+ /* Configure the system clock */
+ SystemClock_Config();
+
+ PeriphClock_Config();
+ Init_Exti(); /**< Configure the system Power Mode */
+
+ /* Initialize all configured peripherals */
+ MX_GPIO_Init();
+ MX_DMA_Init();
+ MX_RF_Init();
+ MX_RTC_Init();
+
+ /* Init the full application */
+ APPE_Init();
+
+ /* Infinite loop */
+
+ while (1) {
+ UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
+
+ }
+
+}
+
+/**
+ * @brief System Clock Configuration
+ * @retval None
+ */
+void SystemClock_Config(void)
+{
+ RCC_OscInitTypeDef RCC_OscInitStruct = {0};
+ RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
+ RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
+
+ /** Configure LSE Drive Capability
+ */
+ __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
+ /** Configure the main internal regulator output voltage
+ */
+ __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
+ /** Initializes the CPU, AHB and APB busses clocks
+ */
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE
+ |RCC_OSCILLATORTYPE_LSE;
+ RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ RCC_OscInitStruct.LSEState = RCC_LSE_ON;
+ RCC_OscInitStruct.HSIState = RCC_HSI_ON;
+ RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
+ RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
+ if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /** Configure the SYSCLKSource, HCLK, PCLK1 and PCLK2 clocks dividers
+ */
+ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK4|RCC_CLOCKTYPE_HCLK2
+ |RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
+ |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
+ RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSE;
+ RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
+ RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
+ RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
+ RCC_ClkInitStruct.AHBCLK2Divider = RCC_SYSCLK_DIV1;
+ RCC_ClkInitStruct.AHBCLK4Divider = RCC_SYSCLK_DIV1;
+
+ if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /** Initializes the peripherals clocks
+ */
+ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_SMPS|RCC_PERIPHCLK_RFWAKEUP
+ |RCC_PERIPHCLK_RTC|RCC_PERIPHCLK_USART1
+ |RCC_PERIPHCLK_LPUART1;
+ PeriphClkInitStruct.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2;
+ PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1;
+ PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
+ PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSE;
+ PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSE;
+ PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE0;
+
+ if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
+ {
+ Error_Handler();
+ }
+}
+
+/**
+ * @brief LPUART1 Initialization Function
+ * @param None
+ * @retval None
+ */
+void MX_LPUART1_UART_Init(void)
+{
+
+ hlpuart1.Instance = LPUART1;
+ hlpuart1.Init.BaudRate = 115200;
+ hlpuart1.Init.WordLength = UART_WORDLENGTH_8B;
+ hlpuart1.Init.StopBits = UART_STOPBITS_1;
+ hlpuart1.Init.Parity = UART_PARITY_NONE;
+ hlpuart1.Init.Mode = UART_MODE_TX_RX;
+ hlpuart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
+ hlpuart1.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
+ hlpuart1.Init.ClockPrescaler = UART_PRESCALER_DIV1;
+ hlpuart1.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
+ hlpuart1.FifoMode = UART_FIFOMODE_DISABLE;
+ if (HAL_UART_Init(&hlpuart1) != HAL_OK) {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_SetTxFifoThreshold(&hlpuart1, UART_TXFIFO_THRESHOLD_1_8) != HAL_OK) {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_SetRxFifoThreshold(&hlpuart1, UART_RXFIFO_THRESHOLD_1_8) != HAL_OK) {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_DisableFifoMode(&hlpuart1) != HAL_OK) {
+ Error_Handler();
+ }
+
+}
+
+/**
+ * @brief USART1 Initialization Function
+ * @param None
+ * @retval None
+ */
+void MX_USART1_UART_Init(void)
+{
+
+ huart1.Instance = USART1;
+ huart1.Init.BaudRate = 115200;
+ huart1.Init.WordLength = UART_WORDLENGTH_8B;
+ huart1.Init.StopBits = UART_STOPBITS_1;
+ huart1.Init.Parity = UART_PARITY_NONE;
+ huart1.Init.Mode = UART_MODE_TX_RX;
+ huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
+ huart1.Init.OverSampling = UART_OVERSAMPLING_8;
+ huart1.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
+ huart1.Init.ClockPrescaler = UART_PRESCALER_DIV1;
+ huart1.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
+ if (HAL_UART_Init(&huart1) != HAL_OK) {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_SetTxFifoThreshold(&huart1, UART_TXFIFO_THRESHOLD_1_8) != HAL_OK) {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_SetRxFifoThreshold(&huart1, UART_RXFIFO_THRESHOLD_1_8) != HAL_OK) {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_DisableFifoMode(&huart1) != HAL_OK) {
+ Error_Handler();
+ }
+
+}
+
+/**
+ * @brief RF Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_RF_Init(void)
+{
+
+}
+
+/**
+ * @brief RTC Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_RTC_Init(void)
+{
+
+
+ /** Initialize RTC Only
+ */
+ hrtc.Instance = RTC;
+ hrtc.Init.HourFormat = RTC_HOURFORMAT_24;
+ hrtc.Init.AsynchPrediv = CFG_RTC_ASYNCH_PRESCALER;
+ hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
+ hrtc.Init.OutPut = RTC_OUTPUT_DISABLE;
+ hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH;
+ hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;
+ if (HAL_RTC_Init(&hrtc) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /* USER CODE BEGIN RTC_Init 2 */
+
+ /* USER CODE END RTC_Init 2 */
+
+}
+
+/**
+ * Enable DMA controller clock
+ */
+static void MX_DMA_Init(void)
+{
+
+ /* DMA controller clock enable */
+ __HAL_RCC_DMAMUX1_CLK_ENABLE();
+ __HAL_RCC_DMA1_CLK_ENABLE();
+
+ /* DMA interrupt init */
+ /* DMA1_Channel1_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(DMA1_Channel1_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(DMA1_Channel1_IRQn);
+ /* DMA1_Channel2_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(DMA1_Channel2_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(DMA1_Channel2_IRQn);
+
+}
+
+/**
+ * @brief GPIO Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_GPIO_Init(void)
+{
+
+ /* GPIO Ports Clock Enable */
+ __HAL_RCC_GPIOC_CLK_ENABLE();
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+
+}
+
+/* USER CODE BEGIN 4 */
+void PeriphClock_Config(void)
+{
+ #if (CFG_USB_INTERFACE_ENABLE != 0)
+ RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
+ RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
+ LL_RCC_HSI48_Enable();
+
+ while(!LL_RCC_HSI48_IsReady());
+
+ /* Select HSI48 as USB clock source */
+ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB;
+ PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_HSI48;
+ HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
+
+ /*Configure the clock recovery system (CRS)**********************************/
+
+ /* Enable CRS Clock */
+ __HAL_RCC_CRS_CLK_ENABLE();
+
+ /* Default Synchro Signal division factor (not divided) */
+ RCC_CRSInitStruct.Prescaler = RCC_CRS_SYNC_DIV1;
+
+ /* Set the SYNCSRC[1:0] bits according to CRS_Source value */
+ RCC_CRSInitStruct.Source = RCC_CRS_SYNC_SOURCE_USB;
+
+ /* HSI48 is synchronized with USB SOF at 1KHz rate */
+ RCC_CRSInitStruct.ReloadValue = RCC_CRS_RELOADVALUE_DEFAULT;
+ RCC_CRSInitStruct.ErrorLimitValue = RCC_CRS_ERRORLIMIT_DEFAULT;
+
+ RCC_CRSInitStruct.Polarity = RCC_CRS_SYNC_POLARITY_RISING;
+
+ /* Set the TRIM[5:0] to the default value*/
+ RCC_CRSInitStruct.HSI48CalibrationValue = RCC_CRS_HSI48CALIBRATION_DEFAULT;
+
+ /* Start automatic synchronization */
+ HAL_RCCEx_CRSConfig(&RCC_CRSInitStruct);
+#endif
+
+ return;
+}
+
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+
+static void Config_HSE(void)
+{
+ OTP_ID0_t * p_otp;
+
+ /**
+ * Read HSE_Tuning from OTP
+ */
+ p_otp = (OTP_ID0_t *) OTP_Read(0);
+ if (p_otp)
+ {
+ LL_RCC_HSE_SetCapacitorTuning(p_otp->hse_tuning);
+ }
+
+ return;
+}
+
+
+static void Reset_Device( void )
+{
+#if ( CFG_HW_RESET_BY_FW == 1 )
+ Reset_BackupDomain();
+
+ Reset_IPCC();
+#endif
+
+ return;
+}
+
+static void Reset_IPCC( void )
+{
+ LL_AHB3_GRP1_EnableClock(LL_AHB3_GRP1_PERIPH_IPCC);
+
+ LL_C1_IPCC_ClearFlag_CHx(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C2_IPCC_ClearFlag_CHx(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C1_IPCC_DisableTransmitChannel(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C2_IPCC_DisableTransmitChannel(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C1_IPCC_DisableReceiveChannel(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C2_IPCC_DisableReceiveChannel(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ return;
+}
+
+static void Reset_BackupDomain( void )
+{
+ if ((LL_RCC_IsActiveFlag_PINRST() != FALSE) && (LL_RCC_IsActiveFlag_SFTRST() == FALSE))
+ {
+ HAL_PWR_EnableBkUpAccess(); /**< Enable access to the RTC registers */
+
+ /**
+ * Write twice the value to flush the APB-AHB bridge
+ * This bit shall be written in the register before writing the next one
+ */
+ HAL_PWR_EnableBkUpAccess();
+
+ __HAL_RCC_BACKUPRESET_FORCE();
+ __HAL_RCC_BACKUPRESET_RELEASE();
+ }
+
+ return;
+}
+
+static void Init_Exti( void )
+{
+ /**< Disable all wakeup interrupt on CPU1 except IPCC(36), HSEM(38) */
+ LL_EXTI_DisableIT_0_31(~0);
+ LL_EXTI_DisableIT_32_63( (~0) & (~(LL_EXTI_LINE_36 | LL_EXTI_LINE_38)) );
+
+ return;
+}
+
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+void HAL_Delay(uint32_t Delay)
+{
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
+
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
+}
+
+/**
+ * @brief This function is executed in case of error occurrence.
+ * @retval None
+ */
+void Error_Handler(void)
+{
+
+}
+
+#ifdef USE_FULL_ASSERT
+/**
+ * @brief Reports the name of the source file and the source line number
+ * where the assert_param error has occurred.
+ * @param file: pointer to the source file name
+ * @param line: assert_param error line source number
+ * @retval None
+ */
+void assert_failed(uint8_t *file, uint32_t line)
+{
+ /* USER CODE BEGIN 6 */
+ /* User can add his own implementation to report the file name and line number,
+ tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
+ /* USER CODE END 6 */
+}
+#endif /* USE_FULL_ASSERT */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/stm32_lpm_if.c
new file mode 100644
index 000000000..f024b61e3
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/stm32_lpm_if.c
@@ -0,0 +1,275 @@
+/* USER CODE BEGIN Header */
+/**
+ ***************************************************************************************
+ * File Name : stm32_lpm_if.c
+ * Description : Low layer function to enter/exit low power modes (stop, sleep).
+ ***************************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "stm32_lpm_if.h"
+#include "stm32_lpm.h"
+#include "app_conf.h"
+/* USER CODE BEGIN include */
+
+/* USER CODE END include */
+
+/* Exported variables --------------------------------------------------------*/
+const struct UTIL_LPM_Driver_s UTIL_PowerDriver =
+{
+ PWR_EnterSleepMode,
+ PWR_ExitSleepMode,
+
+ PWR_EnterStopMode,
+ PWR_ExitStopMode,
+
+ PWR_EnterOffMode,
+ PWR_ExitOffMode,
+};
+
+/* Private function prototypes -----------------------------------------------*/
+static void Switch_On_HSI( void );
+/* USER CODE BEGIN Private_Function_Prototypes */
+
+/* USER CODE END Private_Function_Prototypes */
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN Private_Typedef */
+
+/* USER CODE END Private_Typedef */
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN Private_Define */
+
+/* USER CODE END Private_Define */
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN Private_Macro */
+
+/* USER CODE END Private_Macro */
+/* Private variables ---------------------------------------------------------*/
+/* USER CODE BEGIN Private_Variables */
+
+/* USER CODE END Private_Variables */
+
+/* Functions Definition ------------------------------------------------------*/
+/**
+ * @brief Enters Low Power Off Mode
+ * @param none
+ * @retval none
+ */
+void PWR_EnterOffMode( void )
+{
+/* USER CODE BEGIN PWR_EnterOffMode */
+ /************************************************************************************
+ * ENTER OFF MODE
+ ***********************************************************************************/
+ /*
+ * There is no risk to clear all the WUF here because in the current implementation, this API is called
+ * in critical section. If an interrupt occurs while in that critical section before that point,
+ * the flag is set and will be cleared here but the system will not enter Off Mode
+ * because an interrupt is pending in the NVIC. The ISR will be executed when moving out
+ * of this critical section
+ */
+ LL_PWR_ClearFlag_WU( );
+
+ LL_PWR_SetPowerMode( LL_PWR_MODE_STANDBY );
+
+ LL_LPM_EnableDeepSleep( ); /**< Set SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+#if defined ( __CC_ARM)
+ __force_stores( );
+#endif
+
+ __WFI( );
+/* USER CODE END PWR_EnterOffMode */
+}
+
+/**
+ * @brief Exits Low Power Off Mode
+ * @param none
+ * @retval none
+ */
+void PWR_ExitOffMode( void )
+{
+/* USER CODE BEGIN PWR_ExitOffMode */
+
+/* USER CODE END PWR_ExitOffMode */
+}
+
+/**
+ * @brief Enters Low Power Stop Mode
+ * @note ARM exists the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_EnterStopMode( void )
+{
+/* USER CODE BEGIN PWR_EnterStopMode */
+ /**
+ * This function is called from CRITICAL SECTION
+ */
+ while( LL_HSEM_1StepLock( HSEM, CFG_HW_RCC_SEMID ) );
+
+ if ( ! LL_HSEM_1StepLock( HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID ) )
+ {
+ if( LL_PWR_IsActiveFlag_C2DS( ) )
+ {
+ /* Release ENTRY_STOP_MODE semaphore */
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID, 0 );
+
+ /**
+ * The switch on HSI before entering Stop Mode is required on Cut2.0
+ * It is useless from Cut2.1
+ */
+ Switch_On_HSI( );
+ }
+ }
+ else
+ {
+ /**
+ * The switch on HSI before entering Stop Mode is required on Cut2.0
+ * It is useless from Cut2.1
+ */
+ Switch_On_HSI( );
+ }
+
+ /* Release RCC semaphore */
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_RCC_SEMID, 0 );
+
+ /************************************************************************************
+ * ENTER STOP MODE
+ ***********************************************************************************/
+ LL_PWR_SetPowerMode( LL_PWR_MODE_STOP2 );
+
+ LL_LPM_EnableDeepSleep( ); /**< Set SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+#if defined ( __CC_ARM)
+ __force_stores( );
+#endif
+
+ __WFI();
+/* USER CODE END PWR_EnterStopMode */
+}
+
+/**
+ * @brief Exits Low Power Stop Mode
+ * @note Enable the pll at 32MHz
+ * @param none
+ * @retval none
+ */
+void PWR_ExitStopMode( void )
+{
+/* USER CODE BEGIN PWR_ExitStopMode */
+ /**
+ * This function is called from CRITICAL SECTION
+ */
+
+ /* Release ENTRY_STOP_MODE semaphore */
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID, 0 );
+
+ while( LL_HSEM_1StepLock( HSEM, CFG_HW_RCC_SEMID ) );
+
+ if(LL_RCC_GetSysClkSource( ) == LL_RCC_SYS_CLKSOURCE_STATUS_HSI)
+ {
+ LL_RCC_HSE_Enable( );
+ while(!LL_RCC_HSE_IsReady( ));
+ LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_HSE);
+ while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSE);
+ }
+ else
+ {
+ /**
+ * As long as the current application is fine with HSE as system clock source,
+ * there is nothing to do here
+ */
+ }
+
+ /* Release RCC semaphore */
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_RCC_SEMID, 0 );
+/* USER CODE END PWR_ExitStopMode */
+}
+
+/**
+ * @brief Enters Low Power Sleep Mode
+ * @note ARM exits the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_EnterSleepMode( void )
+{
+/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+#if defined ( __CC_ARM)
+ __force_stores();
+#endif
+
+ __WFI( );
+/* USER CODE END PWR_EnterSleepMode */
+}
+
+/**
+ * @brief Exits Low Power Sleep Mode
+ * @note ARM exits the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_ExitSleepMode( void )
+{
+/* USER CODE BEGIN PWR_ExitSleepMode */
+
+ HAL_ResumeTick();
+
+/* USER CODE END PWR_ExitSleepMode */
+}
+
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+/**
+ * @brief Switch the system clock on HSI
+ * @param none
+ * @retval none
+ */
+static void Switch_On_HSI( void )
+{
+ LL_RCC_HSI_Enable( );
+ while(!LL_RCC_HSI_IsReady( ));
+ LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
+ while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
+}
+
+/* USER CODE BEGIN Private_Functions */
+
+/* USER CODE END Private_Functions */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/stm32wbxx_hal_msp.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/stm32wbxx_hal_msp.c
new file mode 100644
index 000000000..9c338486d
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/stm32wbxx_hal_msp.c
@@ -0,0 +1,334 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : stm32wbxx_hal_msp.c
+ * Description : This file provides code for the MSP Initialization
+ * and de-Initialization codes.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+/* USER CODE BEGIN Includes */
+#include "app_conf.h"
+/* USER CODE END Includes */
+extern DMA_HandleTypeDef hdma_lpuart1_tx;
+
+extern DMA_HandleTypeDef hdma_usart1_tx;
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN TD */
+
+/* USER CODE END TD */
+
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN Define */
+
+/* USER CODE END Define */
+
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN Macro */
+
+/* USER CODE END Macro */
+
+/* Private variables ---------------------------------------------------------*/
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+/* USER CODE BEGIN PFP */
+
+/* USER CODE END PFP */
+
+/* External functions --------------------------------------------------------*/
+/* USER CODE BEGIN ExternalFunctions */
+
+/* USER CODE END ExternalFunctions */
+
+/* USER CODE BEGIN 0 */
+
+/* USER CODE END 0 */
+/**
+ * Initializes the Global MSP.
+ */
+void HAL_MspInit(void)
+{
+ /* USER CODE BEGIN MspInit 0 */
+
+ /* USER CODE END MspInit 0 */
+
+ __HAL_RCC_HSEM_CLK_ENABLE();
+
+ /* System interrupt init*/
+
+ /* Peripheral interrupt init */
+ /* PVD_PVM_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(PVD_PVM_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(PVD_PVM_IRQn);
+ /* FLASH_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(FLASH_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(FLASH_IRQn);
+ /* RCC_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(RCC_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(RCC_IRQn);
+ /* C2SEV_PWR_C2H_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(C2SEV_PWR_C2H_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(C2SEV_PWR_C2H_IRQn);
+ /* PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn);
+ /* HSEM_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(HSEM_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(HSEM_IRQn);
+ /* FPU_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(FPU_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(FPU_IRQn);
+
+ /* USER CODE BEGIN MspInit 1 */
+
+ /* USER CODE END MspInit 1 */
+}
+
+/**
+* @brief UART MSP Initialization
+* This function configures the hardware resources used in this example
+* @param huart: UART handle pointer
+* @retval None
+*/
+void HAL_UART_MspInit(UART_HandleTypeDef* huart)
+{
+ GPIO_InitTypeDef GPIO_InitStruct = {0};
+ if(huart->Instance==LPUART1)
+ {
+ /* USER CODE BEGIN LPUART1_MspInit 0 */
+
+ /* USER CODE END LPUART1_MspInit 0 */
+ /* Peripheral clock enable */
+ __HAL_RCC_LPUART1_CLK_ENABLE();
+
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ /**LPUART1 GPIO Configuration
+ PA2 ------> LPUART1_TX
+ PA3 ------> LPUART1_RX
+ */
+ GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_3;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ GPIO_InitStruct.Alternate = GPIO_AF8_LPUART1;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+
+ /* LPUART1 DMA Init */
+ /* LPUART1_TX Init */
+ hdma_lpuart1_tx.Instance = DMA1_Channel1;
+ hdma_lpuart1_tx.Init.Request = DMA_REQUEST_LPUART1_TX;
+ hdma_lpuart1_tx.Init.Direction = DMA_MEMORY_TO_PERIPH;
+ hdma_lpuart1_tx.Init.PeriphInc = DMA_PINC_DISABLE;
+ hdma_lpuart1_tx.Init.MemInc = DMA_MINC_ENABLE;
+ hdma_lpuart1_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
+ hdma_lpuart1_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
+ hdma_lpuart1_tx.Init.Mode = DMA_NORMAL;
+ hdma_lpuart1_tx.Init.Priority = DMA_PRIORITY_LOW;
+ if (HAL_DMA_Init(&hdma_lpuart1_tx) != HAL_OK)
+ {
+ Error_Handler();
+ }
+
+ __HAL_LINKDMA(huart,hdmatx,hdma_lpuart1_tx);
+
+ /* LPUART1 interrupt Init */
+ HAL_NVIC_SetPriority(LPUART1_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(LPUART1_IRQn);
+ /* USER CODE BEGIN LPUART1_MspInit 1 */
+
+ /* USER CODE END LPUART1_MspInit 1 */
+ }
+ else if(huart->Instance==USART1)
+ {
+ /* USER CODE BEGIN USART1_MspInit 0 */
+
+ /* USER CODE END USART1_MspInit 0 */
+ /* Peripheral clock enable */
+ __HAL_RCC_USART1_CLK_ENABLE();
+
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+ /**USART1 GPIO Configuration
+ PA11 ------> USART1_CTS
+ PB6 ------> USART1_TX
+ PB7 ------> USART1_RX
+ */
+ GPIO_InitStruct.Pin = GPIO_PIN_11;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+
+ GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
+ HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
+
+ /* USART1 DMA Init */
+ /* USART1_TX Init */
+ hdma_usart1_tx.Instance = DMA1_Channel2;
+ hdma_usart1_tx.Init.Request = DMA_REQUEST_USART1_TX;
+ hdma_usart1_tx.Init.Direction = DMA_MEMORY_TO_PERIPH;
+ hdma_usart1_tx.Init.PeriphInc = DMA_PINC_DISABLE;
+ hdma_usart1_tx.Init.MemInc = DMA_MINC_ENABLE;
+ hdma_usart1_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
+ hdma_usart1_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
+ hdma_usart1_tx.Init.Mode = DMA_NORMAL;
+ hdma_usart1_tx.Init.Priority = DMA_PRIORITY_LOW;
+ if (HAL_DMA_Init(&hdma_usart1_tx) != HAL_OK)
+ {
+ Error_Handler();
+ }
+
+ __HAL_LINKDMA(huart,hdmatx,hdma_usart1_tx);
+
+ /* USART1 interrupt Init */
+ HAL_NVIC_SetPriority(USART1_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(USART1_IRQn);
+ /* USER CODE BEGIN USART1_MspInit 1 */
+
+ /* USER CODE END USART1_MspInit 1 */
+ }
+
+}
+
+/**
+* @brief UART MSP De-Initialization
+* This function freeze the hardware resources used in this example
+* @param huart: UART handle pointer
+* @retval None
+*/
+void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
+{
+ if(huart->Instance==LPUART1)
+ {
+ /* USER CODE BEGIN LPUART1_MspDeInit 0 */
+
+ /* USER CODE END LPUART1_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_LPUART1_CLK_DISABLE();
+
+ /**LPUART1 GPIO Configuration
+ PA2 ------> LPUART1_TX
+ PA3 ------> LPUART1_RX
+ */
+ HAL_GPIO_DeInit(GPIOA, GPIO_PIN_2|GPIO_PIN_3);
+
+ /* LPUART1 DMA DeInit */
+ HAL_DMA_DeInit(huart->hdmatx);
+
+ /* LPUART1 interrupt DeInit */
+ HAL_NVIC_DisableIRQ(LPUART1_IRQn);
+ /* USER CODE BEGIN LPUART1_MspDeInit 1 */
+
+ /* USER CODE END LPUART1_MspDeInit 1 */
+ }
+ else if(huart->Instance==USART1)
+ {
+ /* USER CODE BEGIN USART1_MspDeInit 0 */
+
+ /* USER CODE END USART1_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_USART1_CLK_DISABLE();
+
+ /**USART1 GPIO Configuration
+ PA11 ------> USART1_CTS
+ PB6 ------> USART1_TX
+ PB7 ------> USART1_RX
+ */
+ HAL_GPIO_DeInit(GPIOA, GPIO_PIN_11);
+
+ HAL_GPIO_DeInit(GPIOB, GPIO_PIN_6|GPIO_PIN_7);
+
+ /* USART1 DMA DeInit */
+ HAL_DMA_DeInit(huart->hdmatx);
+
+ /* USART1 interrupt DeInit */
+ HAL_NVIC_DisableIRQ(USART1_IRQn);
+ /* USER CODE BEGIN USART1_MspDeInit 1 */
+
+ /* USER CODE END USART1_MspDeInit 1 */
+ }
+
+}
+
+/**
+* @brief RTC MSP Initialization
+* This function configures the hardware resources used in this example
+* @param hrtc: RTC handle pointer
+* @retval None
+*/
+void HAL_RTC_MspInit(RTC_HandleTypeDef* hrtc)
+{
+ if(hrtc->Instance==RTC)
+ {
+ /* USER CODE BEGIN RTC_MspInit 0 */
+ HAL_PWR_EnableBkUpAccess(); /**< Enable access to the RTC registers */
+
+ /**
+ * Write twice the value to flush the APB-AHB bridge
+ * This bit shall be written in the register before writing the next one
+ */
+ HAL_PWR_EnableBkUpAccess();
+
+ __HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSE); /**< Select LSE as RTC Input */
+
+ /* USER CODE END RTC_MspInit 0 */
+ /* Peripheral clock enable */
+ __HAL_RCC_RTC_ENABLE();
+ /* USER CODE BEGIN RTC_MspInit 1 */
+
+ MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* USER CODE END RTC_MspInit 1 */
+ }
+
+}
+
+/**
+* @brief RTC MSP De-Initialization
+* This function freeze the hardware resources used in this example
+* @param hrtc: RTC handle pointer
+* @retval None
+*/
+void HAL_RTC_MspDeInit(RTC_HandleTypeDef* hrtc)
+{
+ if(hrtc->Instance==RTC)
+ {
+ /* USER CODE BEGIN RTC_MspDeInit 0 */
+
+ /* USER CODE END RTC_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_RTC_DISABLE();
+ /* USER CODE BEGIN RTC_MspDeInit 1 */
+
+ /* USER CODE END RTC_MspDeInit 1 */
+ }
+
+}
+
+/* USER CODE BEGIN 1 */
+
+/* USER CODE END 1 */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/stm32wbxx_it.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/stm32wbxx_it.c
new file mode 100644
index 000000000..7c5536dfc
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/stm32wbxx_it.c
@@ -0,0 +1,411 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file stm32wbxx_it.c
+ * @brief Interrupt Service Routines.
+ *******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+#include "stm32wbxx_it.h"
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+#include "hw.h"
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN TD */
+
+/* USER CODE END TD */
+
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN PD */
+
+/* USER CODE END PD */
+
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private variables ---------------------------------------------------------*/
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+/* USER CODE BEGIN PFP */
+
+/* USER CODE END PFP */
+
+/* Private user code ---------------------------------------------------------*/
+/* USER CODE BEGIN 0 */
+
+/* USER CODE END 0 */
+
+/* External variables --------------------------------------------------------*/
+
+extern DMA_HandleTypeDef hdma_lpuart1_tx;
+
+extern DMA_HandleTypeDef hdma_usart1_tx;
+
+extern UART_HandleTypeDef hlpuart1;
+
+extern UART_HandleTypeDef huart1;
+
+/* USER CODE BEGIN EV */
+
+/* USER CODE END EV */
+
+/******************************************************************************/
+/* Cortex Processor Interruption and Exception Handlers */
+/******************************************************************************/
+/**
+ * @brief This function handles Non maskable interrupt.
+ */
+void NMI_Handler(void)
+{
+ /* USER CODE BEGIN NonMaskableInt_IRQn 0 */
+
+ /* USER CODE END NonMaskableInt_IRQn 0 */
+ /* USER CODE BEGIN NonMaskableInt_IRQn 1 */
+
+ /* USER CODE END NonMaskableInt_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Hard fault interrupt.
+ */
+void HardFault_Handler(void)
+{
+ /* USER CODE BEGIN HardFault_IRQn 0 */
+
+ /* USER CODE END HardFault_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_HardFault_IRQn 0 */
+ /* USER CODE END W1_HardFault_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles Memory management fault.
+ */
+void MemManage_Handler(void)
+{
+ /* USER CODE BEGIN MemoryManagement_IRQn 0 */
+
+ /* USER CODE END MemoryManagement_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */
+ /* USER CODE END W1_MemoryManagement_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles Prefetch fault, memory access fault.
+ */
+void BusFault_Handler(void)
+{
+ /* USER CODE BEGIN BusFault_IRQn 0 */
+
+ /* USER CODE END BusFault_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_BusFault_IRQn 0 */
+ /* USER CODE END W1_BusFault_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles Undefined instruction or illegal state.
+ */
+void UsageFault_Handler(void)
+{
+ /* USER CODE BEGIN UsageFault_IRQn 0 */
+
+ /* USER CODE END UsageFault_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_UsageFault_IRQn 0 */
+ /* USER CODE END W1_UsageFault_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles System service call via SWI instruction.
+ */
+void SVC_Handler(void)
+{
+ /* USER CODE BEGIN SVCall_IRQn 0 */
+
+ /* USER CODE END SVCall_IRQn 0 */
+ /* USER CODE BEGIN SVCall_IRQn 1 */
+
+ /* USER CODE END SVCall_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Debug monitor.
+ */
+void DebugMon_Handler(void)
+{
+ /* USER CODE BEGIN DebugMonitor_IRQn 0 */
+
+ /* USER CODE END DebugMonitor_IRQn 0 */
+ /* USER CODE BEGIN DebugMonitor_IRQn 1 */
+
+ /* USER CODE END DebugMonitor_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Pendable request for system service.
+ */
+void PendSV_Handler(void)
+{
+ /* USER CODE BEGIN PendSV_IRQn 0 */
+
+ /* USER CODE END PendSV_IRQn 0 */
+ /* USER CODE BEGIN PendSV_IRQn 1 */
+
+ /* USER CODE END PendSV_IRQn 1 */
+}
+
+/**
+ * @brief This function handles System tick timer.
+ */
+void SysTick_Handler(void)
+{
+ /* USER CODE BEGIN SysTick_IRQn 0 */
+
+ /* USER CODE END SysTick_IRQn 0 */
+ HAL_IncTick();
+ /* USER CODE BEGIN SysTick_IRQn 1 */
+
+ /* USER CODE END SysTick_IRQn 1 */
+}
+
+/******************************************************************************/
+/* STM32WBxx Peripheral Interrupt Handlers */
+/* Add here the Interrupt Handlers for the used peripherals. */
+/* For the available peripheral interrupt handler names, */
+/* please refer to the startup file (startup_stm32wbxx.s). */
+/******************************************************************************/
+
+/**
+ * @brief This function handles PVD/PVM0/PVM2 interrupts through EXTI lines 16/31/33.
+ */
+void PVD_PVM_IRQHandler(void)
+{
+ /* USER CODE BEGIN PVD_PVM_IRQn 0 */
+
+ /* USER CODE END PVD_PVM_IRQn 0 */
+ HAL_PWREx_PVD_PVM_IRQHandler();
+ /* USER CODE BEGIN PVD_PVM_IRQn 1 */
+
+ /* USER CODE END PVD_PVM_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Flash global interrupt.
+ */
+void FLASH_IRQHandler(void)
+{
+ /* USER CODE BEGIN FLASH_IRQn 0 */
+
+ /* USER CODE END FLASH_IRQn 0 */
+ HAL_FLASH_IRQHandler();
+ /* USER CODE BEGIN FLASH_IRQn 1 */
+
+ /* USER CODE END FLASH_IRQn 1 */
+}
+
+/**
+ * @brief This function handles RCC global interrupt.
+ */
+void RCC_IRQHandler(void)
+{
+ /* USER CODE BEGIN RCC_IRQn 0 */
+
+ /* USER CODE END RCC_IRQn 0 */
+ /* USER CODE BEGIN RCC_IRQn 1 */
+
+ /* USER CODE END RCC_IRQn 1 */
+}
+
+/**
+ * @brief This function handles DMA1 channel1 global interrupt.
+ */
+void DMA1_Channel1_IRQHandler(void)
+{
+ /* USER CODE BEGIN DMA1_Channel1_IRQn 0 */
+
+ /* USER CODE END DMA1_Channel1_IRQn 0 */
+ HAL_DMA_IRQHandler(&hdma_lpuart1_tx);
+ /* USER CODE BEGIN DMA1_Channel1_IRQn 1 */
+
+ /* USER CODE END DMA1_Channel1_IRQn 1 */
+}
+
+/**
+ * @brief This function handles DMA1 channel2 global interrupt.
+ */
+void DMA1_Channel2_IRQHandler(void)
+{
+ /* USER CODE BEGIN DMA1_Channel2_IRQn 0 */
+
+ /* USER CODE END DMA1_Channel2_IRQn 0 */
+ HAL_DMA_IRQHandler(&hdma_usart1_tx);
+ /* USER CODE BEGIN DMA1_Channel2_IRQn 1 */
+
+ /* USER CODE END DMA1_Channel2_IRQn 1 */
+}
+
+/**
+ * @brief This function handles CPU2 SEV interrupt through EXTI line 40 and PWR CPU2 HOLD wake-up interrupt.
+ */
+void C2SEV_PWR_C2H_IRQHandler(void)
+{
+ /* USER CODE BEGIN C2SEV_PWR_C2H_IRQn 0 */
+
+ /* USER CODE END C2SEV_PWR_C2H_IRQn 0 */
+ /* USER CODE BEGIN C2SEV_PWR_C2H_IRQn 1 */
+
+ /* USER CODE END C2SEV_PWR_C2H_IRQn 1 */
+}
+
+/**
+ * @brief This function handles USART1 global interrupt.
+ */
+void USART1_IRQHandler(void)
+{
+ /* USER CODE BEGIN USART1_IRQn 0 */
+
+ /* USER CODE END USART1_IRQn 0 */
+ HAL_UART_IRQHandler(&huart1);
+ /* USER CODE BEGIN USART1_IRQn 1 */
+
+ /* USER CODE END USART1_IRQn 1 */
+}
+
+/**
+ * @brief This function handles LPUART1 global interrupt.
+ */
+void LPUART1_IRQHandler(void)
+{
+ /* USER CODE BEGIN LPUART1_IRQn 0 */
+
+ /* USER CODE END LPUART1_IRQn 0 */
+ HAL_UART_IRQHandler(&hlpuart1);
+ /* USER CODE BEGIN LPUART1_IRQn 1 */
+
+ /* USER CODE END LPUART1_IRQn 1 */
+}
+
+/**
+ * @brief This function handles PWR switching on the fly, end of BLE activity, end of 802.15.4 activity, end of critical radio phase interrupt.
+ */
+void PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler(void)
+{
+ /* USER CODE BEGIN PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn 0 */
+
+ /* USER CODE END PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn 0 */
+ /* USER CODE BEGIN PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn 1 */
+
+ /* USER CODE END PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn 1 */
+}
+
+/**
+ * @brief This function handles HSEM global interrupt.
+ */
+void HSEM_IRQHandler(void)
+{
+ /* USER CODE BEGIN HSEM_IRQn 0 */
+
+ /* USER CODE END HSEM_IRQn 0 */
+ HAL_HSEM_IRQHandler();
+ /* USER CODE BEGIN HSEM_IRQn 1 */
+
+ /* USER CODE END HSEM_IRQn 1 */
+}
+
+/**
+ * @brief This function handles FPU global interrupt.
+ */
+void FPU_IRQHandler(void)
+{
+ /* USER CODE BEGIN FPU_IRQn 0 */
+
+ /* USER CODE END FPU_IRQn 0 */
+ /* USER CODE BEGIN FPU_IRQn 1 */
+
+ /* USER CODE END FPU_IRQn 1 */
+}
+
+/* USER CODE BEGIN 1 */
+void RTC_WKUP_IRQHandler(void)
+{
+ HW_TS_RTC_Wakeup_Handler();
+}
+
+/**
+ * @brief This function handles External External line 4 interrupt request.
+ * @param None
+ * @retval None
+ */
+void EXTI4_IRQHandler(void)
+{
+ HAL_GPIO_EXTI_IRQHandler(BUTTON_SW1_PIN);
+}
+
+/**
+ * @brief This function handles External External line 0 interrupt request.
+ * @param None
+ * @retval None
+ */
+void EXTI0_IRQHandler(void)
+{
+ HAL_GPIO_EXTI_IRQHandler(BUTTON_SW2_PIN);
+}
+
+/**
+ * @brief This function handles External External line 1 interrupt request.
+ * @param None
+ * @retval None
+ */
+void EXTI1_IRQHandler(void)
+{
+ HAL_GPIO_EXTI_IRQHandler(BUTTON_SW3_PIN);
+}
+
+void
+IPCC_C1_TX_IRQHandler(void)
+{
+ HW_IPCC_Tx_Handler();
+
+ return;
+}
+
+void
+IPCC_C1_RX_IRQHandler(void)
+{
+ HW_IPCC_Rx_Handler();
+ return;
+}
+
+/* USER CODE END 1 */
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/stm_logging.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/stm_logging.c
new file mode 100644
index 000000000..c24b86dd8
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/stm_logging.c
@@ -0,0 +1,205 @@
+/**
+ ******************************************************************************
+ * File Name : stm_logging.c
+ * Description : This file contains all the defines and functions used
+ * for logging on Application examples.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/**
+ * @file
+ * This file implements logging functions to be used in Application examples.
+ *
+ */
+
+#include <ctype.h>
+#include <inttypes.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <string.h>
+
+#include "app_conf.h"
+#include "stm_logging.h"
+
+#define LOG_PARSE_BUFFER_SIZE 256U
+
+#define LOG_TIMESTAMP_ENABLE 0
+#define LOG_REGION_ENABLE 1U
+#define LOG_RTT_COLOR_ENABLE 1U
+
+#if (LOG_RTT_COLOR_ENABLE == 1U)
+#define RTT_COLOR_CODE_DEFAULT "\x1b[0m"
+#define RTT_COLOR_CODE_RED "\x1b[0;91m"
+#define RTT_COLOR_CODE_GREEN "\x1b[0;92m"
+#define RTT_COLOR_CODE_YELLOW "\x1b[0;93m"
+#define RTT_COLOR_CODE_CYAN "\x1b[0;96m"
+
+#else /* LOG_RTT_COLOR_ENABLE == 1 */
+#define RTT_COLOR_CODE_DEFAULT ""
+#define RTT_COLOR_CODE_RED ""
+#define RTT_COLOR_CODE_GREEN ""
+#define RTT_COLOR_CODE_YELLOW ""
+#define RTT_COLOR_CODE_CYAN ""
+#endif /* LOG_RTT_COLOR_ENABLE == 1 */
+
+#define LOG_MSG_SZ_MAX 256
+
+#if (CFG_DEBUG_TRACE != 0)
+/**
+ * Function for outputting code region string.
+ *
+ * @param[inout] aLogString Pointer to log buffer.
+ * @param[in] aMaxSize Maximum size of log buffer.
+ * @param[in] otLogRegion The region ID.
+ *
+ * @returns String with a log level color value.
+ */
+static inline uint16_t
+logRegion(char *aLogString, uint16_t aMaxSize,
+ appliLogRegion_t aLogRegion)
+{
+ char logRegionString[30U];
+
+ switch (aLogRegion) {
+ case APPLI_LOG_REGION_GENERAL:
+ strcpy(logRegionString, "[M4 APPLICATION]");
+ break;
+ case APPLI_LOG_REGION_ZIGBEE_API:
+ strcpy(logRegionString, "[M4 ZIGBEE API]");
+ break;
+ default:
+ strcpy(logRegionString, "[M4]");
+ break;
+ }
+
+ return snprintf(aLogString, aMaxSize, "%s ", logRegionString);
+}
+
+#endif /* CFG_DEBUG_TRACE */
+
+#if (LOG_RTT_COLOR_ENABLE == 1U)
+#if (CFG_DEBUG_TRACE != 0)
+/**
+ * Function for getting color of a given level log.
+ *
+ * @param[in] aLogLevel The log level.
+ *
+ * @returns String with a log level color value.
+ */
+static inline const char *levelToString(appliLogLevel_t aLogLevel)
+{
+ switch (aLogLevel)
+ {
+ case LOG_LEVEL_CRIT:
+ return RTT_COLOR_CODE_RED;
+
+ case LOG_LEVEL_WARN:
+ return RTT_COLOR_CODE_YELLOW;
+
+ case LOG_LEVEL_INFO:
+ return RTT_COLOR_CODE_GREEN;
+
+ case LOG_LEVEL_DEBG:
+ default:
+ return RTT_COLOR_CODE_DEFAULT;
+ }
+}
+#endif /* CFG_DEBUG_TRACE */
+
+#if (CFG_DEBUG_TRACE != 0)
+/**
+ * Function for printing log level.
+ *
+ * @param[inout] aLogString Pointer to log buffer.
+ * @param[in] aMaxSize Maximum size of log buffer.
+ * @param[in] aLogLevel Log level.
+ *
+ * @returns Number of bytes successfully written to the log buffer.
+ */
+static inline uint16_t logLevel(char *aLogString, uint16_t aMaxSize,
+ appliLogLevel_t aLogLevel)
+{
+ return snprintf(aLogString, aMaxSize, "%s", levelToString(aLogLevel));
+}
+#endif /* CFG_DEBUG_TRACE */
+#endif /* LOG_RTT_COLOR_ENABLE */
+
+#if (LOG_TIMESTAMP_ENABLE == 1U)
+/**
+ * Function for printing actual timestamp.
+ *
+ * @param[inout] aLogString Pointer to the log buffer.
+ * @param[in] aMaxSize Maximum size of the log buffer.
+ *
+ * @returns Number of bytes successfully written to the log buffer.
+ */
+static inline uint16_t logTimestamp(char *aLogString, uint16_t aMaxSize)
+{
+ return snprintf(aLogString, aMaxSize, "%s[%010ld]", RTT_COLOR_CODE_DEFAULT,
+ otPlatAlarmMilliGetNow());
+}
+#endif /* LOG_TIMESTAMP_ENABLE */
+
+/**
+ * Function for printing application log
+ *
+ * @param[in] aLogLevel Log level.
+ * @param[in] aLogRegion The region ID.
+ * @param[in] aFormat User string format.
+ *
+ * @returns Number of bytes successfully written to the log buffer.
+ */
+void logApplication(appliLogLevel_t aLogLevel, appliLogRegion_t aLogRegion, const char *aFormat, ...)
+{
+#if (CFG_DEBUG_TRACE != 0) /* Since the traces are disabled, there is nothing to print */
+ uint16_t length = 0;
+ char logString[LOG_PARSE_BUFFER_SIZE + 1U];
+
+#if (LOG_TIMESTAMP_ENABLE == 1U)
+ length += logTimestamp(logString, LOG_PARSE_BUFFER_SIZE);
+#endif
+
+#if (LOG_RTT_COLOR_ENABLE == 1U)
+ /* Add level information */
+ length += logLevel(&logString[length], (LOG_PARSE_BUFFER_SIZE - length),
+ aLogLevel);
+#endif
+
+#if (LOG_REGION_ENABLE == 1U)
+ /* Add Region information */
+ length += logRegion(&logString[length], (LOG_PARSE_BUFFER_SIZE - length),
+ aLogRegion);
+#endif
+
+ /* Parse user string */
+ va_list paramList;
+ va_start(paramList, aFormat);
+ length += vsnprintf(&logString[length], (LOG_PARSE_BUFFER_SIZE - length),
+ aFormat, paramList);
+ logString[length++] = '\r';
+ logString[length++] = '\n';
+ logString[length++] = 0;
+ va_end(paramList);
+
+ if (aLogLevel <= APPLI_CONFIG_LOG_LEVEL)
+ {
+ printf("%s", logString);
+ }else
+ {
+ /* Print nothing */
+ }
+#endif /* CFG_DEBUG_TRACE */
+}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/system_stm32wbxx.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/system_stm32wbxx.c
new file mode 100644
index 000000000..d4653a0ce
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/Core/Src/system_stm32wbxx.c
@@ -0,0 +1,353 @@
+/**
+ ******************************************************************************
+ * @file system_stm32wbxx.c
+ * @author MCD Application Team
+ * @brief CMSIS Cortex Device Peripheral Access Layer System Source File
+ *
+ * This file provides two functions and one global variable to be called from
+ * user application:
+ * - SystemInit(): This function is called at startup just after reset and
+ * before branch to main program. This call is made inside
+ * the "startup_stm32wbxx.s" file.
+ *
+ * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used
+ * by the user application to setup the SysTick
+ * timer or configure other parameters.
+ *
+ * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must
+ * be called whenever the core clock is changed
+ * during program execution.
+ *
+ * After each device reset the MSI (4 MHz) is used as system clock source.
+ * Then SystemInit() function is called, in "startup_stm32wbxx.s" file, to
+ * configure the system clock before to branch to main program.
+ *
+ * This file configures the system clock as follows:
+ *=============================================================================
+ *-----------------------------------------------------------------------------
+ * System Clock source | MSI
+ *-----------------------------------------------------------------------------
+ * SYSCLK(Hz) | 4000000
+ *-----------------------------------------------------------------------------
+ * HCLK(Hz) | 4000000
+ *-----------------------------------------------------------------------------
+ * AHB Prescaler | 1
+ *-----------------------------------------------------------------------------
+ * APB1 Prescaler | 1
+ *-----------------------------------------------------------------------------
+ * APB2 Prescaler | 1
+ *-----------------------------------------------------------------------------
+ * PLL_M | 1
+ *-----------------------------------------------------------------------------
+ * PLL_N | 8
+ *-----------------------------------------------------------------------------
+ * PLL_P | 7
+ *-----------------------------------------------------------------------------
+ * PLL_Q | 2
+ *-----------------------------------------------------------------------------
+ * PLL_R | 2
+ *-----------------------------------------------------------------------------
+ * PLLSAI1_P | NA
+ *-----------------------------------------------------------------------------
+ * PLLSAI1_Q | NA
+ *-----------------------------------------------------------------------------
+ * PLLSAI1_R | NA
+ *-----------------------------------------------------------------------------
+ * Require 48MHz for USB OTG FS, | Disabled
+ * SDIO and RNG clock |
+ *-----------------------------------------------------------------------------
+ *=============================================================================
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+
+/** @addtogroup CMSIS
+ * @{
+ */
+
+/** @addtogroup stm32WBxx_system
+ * @{
+ */
+
+/** @addtogroup stm32WBxx_System_Private_Includes
+ * @{
+ */
+
+#include "stm32wbxx.h"
+
+#if !defined (HSE_VALUE)
+ #define HSE_VALUE (32000000UL) /*!< Value of the External oscillator in Hz */
+#endif /* HSE_VALUE */
+
+#if !defined (MSI_VALUE)
+ #define MSI_VALUE (4000000UL) /*!< Value of the Internal oscillator in Hz*/
+#endif /* MSI_VALUE */
+
+#if !defined (HSI_VALUE)
+ #define HSI_VALUE (16000000UL) /*!< Value of the Internal oscillator in Hz*/
+#endif /* HSI_VALUE */
+
+#if !defined (LSI_VALUE)
+ #define LSI_VALUE (32000UL) /*!< Value of LSI in Hz*/
+#endif /* LSI_VALUE */
+
+#if !defined (LSE_VALUE)
+ #define LSE_VALUE (32768UL) /*!< Value of LSE in Hz*/
+#endif /* LSE_VALUE */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_TypesDefinitions
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_Defines
+ * @{
+ */
+
+/*!< Uncomment the following line if you need to relocate your vector Table in
+ Internal SRAM. */
+/* #define VECT_TAB_SRAM */
+#define VECT_TAB_OFFSET 0x0U /*!< Vector Table base offset field.
+ This value must be a multiple of 0x200. */
+
+#define VECT_TAB_BASE_ADDRESS SRAM1_BASE /*!< Vector Table base offset field.
+ This value must be a multiple of 0x200. */
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_Macros
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_Variables
+ * @{
+ */
+ /* The SystemCoreClock variable is updated in three ways:
+ 1) by calling CMSIS function SystemCoreClockUpdate()
+ 2) by calling HAL API function HAL_RCC_GetHCLKFreq()
+ 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
+ Note: If you use this function to configure the system clock; then there
+ is no need to call the 2 first functions listed above, since SystemCoreClock
+ variable is updated automatically.
+ */
+ uint32_t SystemCoreClock = 4000000UL ; /*CPU1: M4 on MSI clock after startup (4MHz)*/
+
+ const uint32_t AHBPrescTable[16UL] = {1UL, 3UL, 5UL, 1UL, 1UL, 6UL, 10UL, 32UL, 2UL, 4UL, 8UL, 16UL, 64UL, 128UL, 256UL, 512UL};
+
+ const uint32_t APBPrescTable[8UL] = {0UL, 0UL, 0UL, 0UL, 1UL, 2UL, 3UL, 4UL};
+
+ const uint32_t MSIRangeTable[16UL] = {100000UL, 200000UL, 400000UL, 800000UL, 1000000UL, 2000000UL, \
+ 4000000UL, 8000000UL, 16000000UL, 24000000UL, 32000000UL, 48000000UL, 0UL, 0UL, 0UL, 0UL}; /* 0UL values are incorrect cases */
+
+ const uint32_t SmpsPrescalerTable[4UL][6UL]={{1UL,3UL,2UL,2UL,1UL,2UL}, \
+ {2UL,6UL,4UL,3UL,2UL,4UL}, \
+ {4UL,12UL,8UL,6UL,4UL,8UL}, \
+ {4UL,12UL,8UL,6UL,4UL,8UL}};
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_FunctionPrototypes
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_Functions
+ * @{
+ */
+
+/**
+ * @brief Setup the microcontroller system.
+ * @param None
+ * @retval None
+ */
+void SystemInit(void)
+{
+ /* Configure the Vector Table location add offset address ------------------*/
+#if defined(VECT_TAB_SRAM) && defined(VECT_TAB_BASE_ADDRESS)
+ /* program in SRAMx */
+ SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAMx for CPU1 */
+#else /* program in FLASH */
+ SCB->VTOR = VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
+#endif
+
+ /* FPU settings ------------------------------------------------------------*/
+ #if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
+ SCB->CPACR |= ((3UL << (10UL*2UL))|(3UL << (11UL*2UL))); /* set CP10 and CP11 Full Access */
+ #endif
+
+ /* Reset the RCC clock configuration to the default reset state ------------*/
+ /* Set MSION bit */
+ RCC->CR |= RCC_CR_MSION;
+
+ /* Reset CFGR register */
+ RCC->CFGR = 0x00070000U;
+
+ /* Reset PLLSAI1ON, PLLON, HSECSSON, HSEON, HSION, and MSIPLLON bits */
+ RCC->CR &= (uint32_t)0xFAF6FEFBU;
+
+ /*!< Reset LSI1 and LSI2 bits */
+ RCC->CSR &= (uint32_t)0xFFFFFFFAU;
+
+ /*!< Reset HSI48ON bit */
+ RCC->CRRCR &= (uint32_t)0xFFFFFFFEU;
+
+ /* Reset PLLCFGR register */
+ RCC->PLLCFGR = 0x22041000U;
+
+ /* Reset PLLSAI1CFGR register */
+ RCC->PLLSAI1CFGR = 0x22041000U;
+
+ /* Reset HSEBYP bit */
+ RCC->CR &= 0xFFFBFFFFU;
+
+ /* Disable all interrupts */
+ RCC->CIER = 0x00000000;
+}
+
+/**
+ * @brief Update SystemCoreClock variable according to Clock Register Values.
+ * The SystemCoreClock variable contains the core clock (HCLK), it can
+ * be used by the user application to setup the SysTick timer or configure
+ * other parameters.
+ *
+ * @note Each time the core clock (HCLK) changes, this function must be called
+ * to update SystemCoreClock variable value. Otherwise, any configuration
+ * based on this variable will be incorrect.
+ *
+ * @note - The system frequency computed by this function is not the real
+ * frequency in the chip. It is calculated based on the predefined
+ * constant and the selected clock source:
+ *
+ * - If SYSCLK source is MSI, SystemCoreClock will contain the MSI_VALUE(*)
+ *
+ * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(**)
+ *
+ * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(***)
+ *
+ * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(***)
+ * or HSI_VALUE(*) or MSI_VALUE(*) multiplied/divided by the PLL factors.
+ *
+ * (*) MSI_VALUE is a constant defined in stm32wbxx_hal.h file (default value
+ * 4 MHz) but the real value may vary depending on the variations
+ * in voltage and temperature.
+ *
+ * (**) HSI_VALUE is a constant defined in stm32wbxx_hal_conf.h file (default value
+ * 16 MHz) but the real value may vary depending on the variations
+ * in voltage and temperature.
+ *
+ * (***) HSE_VALUE is a constant defined in stm32wbxx_hal_conf.h file (default value
+ * 32 MHz), user has to ensure that HSE_VALUE is same as the real
+ * frequency of the crystal used. Otherwise, this function may
+ * have wrong result.
+ *
+ * - The result of this function could be not correct when using fractional
+ * value for HSE crystal.
+ *
+ * @param None
+ * @retval None
+ */
+void SystemCoreClockUpdate(void)
+{
+ uint32_t tmp, msirange, pllvco, pllr, pllsource , pllm;
+
+ /* Get MSI Range frequency--------------------------------------------------*/
+
+ /*MSI frequency range in Hz*/
+ msirange = MSIRangeTable[(RCC->CR & RCC_CR_MSIRANGE) >> RCC_CR_MSIRANGE_Pos];
+
+ /* Get SYSCLK source -------------------------------------------------------*/
+ switch (RCC->CFGR & RCC_CFGR_SWS)
+ {
+ case 0x00: /* MSI used as system clock source */
+ SystemCoreClock = msirange;
+ break;
+
+ case 0x04: /* HSI used as system clock source */
+ /* HSI used as system clock source */
+ SystemCoreClock = HSI_VALUE;
+ break;
+
+ case 0x08: /* HSE used as system clock source */
+ SystemCoreClock = HSE_VALUE;
+ break;
+
+ case 0x0C: /* PLL used as system clock source */
+ /* PLL_VCO = (HSE_VALUE or HSI_VALUE or MSI_VALUE/ PLLM) * PLLN
+ SYSCLK = PLL_VCO / PLLR
+ */
+ pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC);
+ pllm = ((RCC->PLLCFGR & RCC_PLLCFGR_PLLM) >> RCC_PLLCFGR_PLLM_Pos) + 1UL ;
+
+ if(pllsource == 0x02UL) /* HSI used as PLL clock source */
+ {
+ pllvco = (HSI_VALUE / pllm);
+ }
+ else if(pllsource == 0x03UL) /* HSE used as PLL clock source */
+ {
+ pllvco = (HSE_VALUE / pllm);
+ }
+ else /* MSI used as PLL clock source */
+ {
+ pllvco = (msirange / pllm);
+ }
+
+ pllvco = pllvco * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> RCC_PLLCFGR_PLLN_Pos);
+ pllr = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLR) >> RCC_PLLCFGR_PLLR_Pos) + 1UL);
+
+ SystemCoreClock = pllvco/pllr;
+ break;
+
+ default:
+ SystemCoreClock = msirange;
+ break;
+ }
+
+ /* Compute HCLK clock frequency --------------------------------------------*/
+ /* Get HCLK1 prescaler */
+ tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> RCC_CFGR_HPRE_Pos)];
+ /* HCLK clock frequency */
+ SystemCoreClock = SystemCoreClock / tmp;
+
+}
+
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/EWARM/Project.eww b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/EWARM/Project.eww
new file mode 100644
index 000000000..217fa8e3f
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/EWARM/Project.eww
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workspace>
+ <project>
+ <path>$WS_DIR$\Zigbee_OnOff_Coord.ewp</path>
+ </project>
+ <batchBuild />
+</workspace>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/EWARM/Zigbee_OnOff_Coord.ewd b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/EWARM/Zigbee_OnOff_Coord.ewd
new file mode 100644
index 000000000..6fce36ff1
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/EWARM/Zigbee_OnOff_Coord.ewd
@@ -0,0 +1,1419 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <fileVersion>3</fileVersion>
+ <configuration>
+ <name>Zigbee_OnOff_Coord</name>
+ <toolchain>
+ <name>ARM</name>
+ </toolchain>
+ <debug>1</debug>
+ <settings>
+ <name>C-SPY</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>29</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CInput</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CEndian</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCVariant</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>MemOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MemFile</name>
+ <state>$TOOLKIT_DIR$\CONFIG\debugger\ST\STM32WB_M4.ddf</state>
+ </option>
+ <option>
+ <name>RunToEnable</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RunToName</name>
+ <state>main</state>
+ </option>
+ <option>
+ <name>CExtraOptionsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CExtraOptions</name>
+ <state>--stlink_use_server</state>
+ </option>
+ <option>
+ <name>CFpuProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCDDFArgumentProducer</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCDownloadSuppressDownload</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCDownloadVerifyAll</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCProductVersion</name>
+ <state>8.20.2.14834</state>
+ </option>
+ <option>
+ <name>OCDynDriverList</name>
+ <state>STLINK_ID</state>
+ </option>
+ <option>
+ <name>OCLastSavedByProductVersion</name>
+ <state>8.20.2.14834</state>
+ </option>
+ <option>
+ <name>UseFlashLoader</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CLowLevel</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCBE8Slave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>MacFile2</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CDevice</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>FlashLoadersV3</name>
+ <state>$TOOLKIT_DIR$\config\flashloader\ST\FlashSTM32WB_M4.board</state>
+ </option>
+ <option>
+ <name>OCImagesSuppressCheck1</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesPath1</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCImagesSuppressCheck2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesPath2</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCImagesSuppressCheck3</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesPath3</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OverrideDefFlashBoard</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesOffset1</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCImagesOffset2</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCImagesOffset3</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCImagesUse1</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesUse2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesUse3</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCDeviceConfigMacroFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCDebuggerExtraOption</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCAllMTBOptions</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCMulticoreNrOfCores</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCMulticoreMaster</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCMulticorePort</name>
+ <state>53461</state>
+ </option>
+ <option>
+ <name>OCMulticoreWorkspace</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCMulticoreSlaveProject</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCMulticoreSlaveConfiguration</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCDownloadExtraImage</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCAttachSlave</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MassEraseBeforeFlashing</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>ARMSIM_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>1</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCSimDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCSimEnablePSP</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCSimPspOverrideConfig</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCSimPspConfigFile</name>
+ <state></state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>CADI_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CCadiMemory</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>Fast Model</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCADILogFileCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCADILogFileEditB</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>CMSISDAP_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>4</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCIarProbeScriptFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CMSISDAPResetList</name>
+ <version>1</version>
+ <state>10</state>
+ </option>
+ <option>
+ <name>CMSISDAPHWResetDuration</name>
+ <state>300</state>
+ </option>
+ <option>
+ <name>CMSISDAPHWResetDelay</name>
+ <state>200</state>
+ </option>
+ <option>
+ <name>CMSISDAPDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CMSISDAPInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPMultiTargetEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPMultiTarget</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPJtagSpeedList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPBreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPRestoreBreakpointsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPUpdateBreakpointsEdit</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>RDICatchReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchUndef</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchSWI</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchData</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchPrefetch</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchIRQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchFIQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CatchMMERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchNOCPERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchCHKERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchSTATERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchBUSERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchINTERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchSFERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchHARDERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPMultiCPUEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPMultiCPUNumber</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCProbeCfgOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCProbeConfig</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CMSISDAPProbeConfigRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPSelectedCPUBehaviour</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ICpuName</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCJetEmuParams</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCCMSISDAPUsbSerialNo</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCCMSISDAPUsbSerialNoSelect</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>GDBSERVER_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>TCPIP</name>
+ <state>aaa.bbb.ccc.ddd</state>
+ </option>
+ <option>
+ <name>DoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>LogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCJTagBreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJTagDoUpdateBreakpoints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJTagUpdateBreakpoints</name>
+ <state>_call_main</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>IJET_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>8</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCIarProbeScriptFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IjetResetList</name>
+ <version>1</version>
+ <state>10</state>
+ </option>
+ <option>
+ <name>IjetHWResetDuration</name>
+ <state>300</state>
+ </option>
+ <option>
+ <name>IjetHWResetDelay</name>
+ <state>200</state>
+ </option>
+ <option>
+ <name>IjetPowerFromProbe</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IjetPowerRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>IjetInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetMultiTargetEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetMultiTarget</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetScanChainNonARMDevices</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetIRLength</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetJtagSpeedList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetProtocolRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetSwoPin</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetCpuClockEdit</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IjetSwoPrescalerList</name>
+ <version>1</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetBreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetRestoreBreakpointsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetUpdateBreakpointsEdit</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>RDICatchReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchUndef</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchSWI</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchData</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchPrefetch</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchIRQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchFIQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CatchMMERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchNOCPERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchCHKERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchSTATERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchBUSERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchINTERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchSFERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchHARDERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCProbeCfgOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCProbeConfig</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IjetProbeConfigRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetMultiCPUEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetMultiCPUNumber</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetSelectedCPUBehaviour</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ICpuName</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCJetEmuParams</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IjetPreferETB</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IjetTraceSettingsList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetTraceSizeList</name>
+ <version>0</version>
+ <state>4</state>
+ </option>
+ <option>
+ <name>FlashBoardPathSlave</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCIjetUsbSerialNo</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCIjetUsbSerialNoSelect</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>JLINK_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>16</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>JLinkSpeed</name>
+ <state>1000</state>
+ </option>
+ <option>
+ <name>CCJLinkDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCJLinkHWResetDelay</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>JLinkInitialSpeed</name>
+ <state>1000</state>
+ </option>
+ <option>
+ <name>CCDoJlinkMultiTarget</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCScanChainNonARMDevices</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkMultiTarget</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkIRLength</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkCommRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkTCPIP</name>
+ <state>aaa.bbb.ccc.ddd</state>
+ </option>
+ <option>
+ <name>CCJLinkSpeedRadioV2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCUSBDevice</name>
+ <version>1</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCRDICatchReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchUndef</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchSWI</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchData</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchPrefetch</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchIRQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchFIQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkBreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkDoUpdateBreakpoints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkUpdateBreakpoints</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>CCJLinkInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkResetList</name>
+ <version>6</version>
+ <state>5</state>
+ </option>
+ <option>
+ <name>CCJLinkInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchMMERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchNOCPERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchCHRERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchSTATERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchBUSERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchINTERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchSFERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchHARDERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCJLinkScriptFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCJLinkUsbSerialNo</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCTcpIpAlt</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkTcpIpSerialNo</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCCpuClockEdit</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCSwoClockAuto</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSwoClockEdit</name>
+ <state>2000</state>
+ </option>
+ <option>
+ <name>OCJLinkTraceSource</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCJLinkTraceSourceDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCJLinkDeviceName</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>LMIFTDI_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>2</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>LmiftdiSpeed</name>
+ <state>500</state>
+ </option>
+ <option>
+ <name>CCLmiftdiDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCLmiftdiLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCLmiFtdiInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCLmiFtdiInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>PEMICRO_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>3</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCJPEMicroShowSettings</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>DoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>LogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>STLINK_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>4</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCSTLinkInterfaceRadio</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCSTLinkInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkResetList</name>
+ <version>3</version>
+ <state>4</state>
+ </option>
+ <option>
+ <name>CCCpuClockEdit</name>
+ <state>32.0</state>
+ </option>
+ <option>
+ <name>CCSwoClockAuto</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSwoClockEdit</name>
+ <state>2000</state>
+ </option>
+ <option>
+ <name>DoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>LogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCSTLinkDoUpdateBreakpoints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkUpdateBreakpoints</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchMMERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchNOCPERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchCHRERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchSTATERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchBUSERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchINTERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchSFERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchHARDERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkUsbSerialNo</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCSTLinkUsbSerialNoSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkJtagSpeedList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkDAPNumber</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkDebugAccessPortRadio</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>THIRDPARTY_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CThirdPartyDriverDll</name>
+ <state>###Uninitialized###</state>
+ </option>
+ <option>
+ <name>CThirdPartyLogFileCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CThirdPartyLogFileEditB</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>TIFET_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>1</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCMSPFetResetList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetTargetVccTypeDefault</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetTargetVoltage</name>
+ <state>###Uninitialized###</state>
+ </option>
+ <option>
+ <name>CCMSPFetVCCDefault</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCMSPFetTargetSettlingtime</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetRadioJtagSpeedType</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCMSPFetConnection</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetUsbComPort</name>
+ <state>Automatic</state>
+ </option>
+ <option>
+ <name>CCMSPFetAllowAccessToBSL</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCMSPFetRadioEraseFlash</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>XDS100_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>6</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>TIPackageOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>TIPackage</name>
+ <state></state>
+ </option>
+ <option>
+ <name>BoardFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>DoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>LogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCXds100BreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100DoUpdateBreakpoints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100UpdateBreakpoints</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>CCXds100CatchReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchUndef</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchSWI</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchData</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchPrefetch</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchIRQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchFIQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchMMERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchNOCPERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchCHRERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchSTATERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchBUSERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchINTERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchSFERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchHARDERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CpuClockEdit</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCXds100SwoClockAuto</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100SwoClockEdit</name>
+ <state>1000</state>
+ </option>
+ <option>
+ <name>CCXds100HWResetDelay</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100ResetList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100UsbSerialNo</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCXds100UsbSerialNoSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100JtagSpeedList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100InterfaceRadio</name>
+ <state>2</state>
+ </option>
+ <option>
+ <name>CCXds100InterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100ProbeList</name>
+ <version>0</version>
+ <state>2</state>
+ </option>
+ <option>
+ <name>CCXds100SWOPortRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100SWOPort</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <debuggerPlugins>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\Mbed\MbedArmPlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin</file>
+ <loadFlag>1</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\TargetAccessServer\TargetAccessServer.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ </debuggerPlugins>
+ </configuration>
+</project>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/EWARM/Zigbee_OnOff_Coord.ewp b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/EWARM/Zigbee_OnOff_Coord.ewp
new file mode 100644
index 000000000..98c059752
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/EWARM/Zigbee_OnOff_Coord.ewp
@@ -0,0 +1,1264 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <fileVersion>3</fileVersion>
+ <configuration>
+ <name>Zigbee_OnOff_Coord</name>
+ <toolchain>
+ <name>ARM</name>
+ </toolchain>
+ <debug>1</debug>
+ <settings>
+ <name>General</name>
+ <archiveVersion>3</archiveVersion>
+ <data>
+ <version>30</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>ExePath</name>
+ <state>Zigbee_OnOff_Coord/Exe</state>
+ </option>
+ <option>
+ <name>ObjPath</name>
+ <state>Zigbee_OnOff_Coord/Obj</state>
+ </option>
+ <option>
+ <name>ListPath</name>
+ <state>Zigbee_OnOff_Coord/List</state>
+ </option>
+ <option>
+ <name>GEndianMode</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>Input description</name>
+ <state>Full formatting, with multibyte support.</state>
+ </option>
+ <option>
+ <name>Output description</name>
+ <state>Full formatting, with multibyte support.</state>
+ </option>
+ <option>
+ <name>GOutputBinary</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGCoreOrChip</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>GRuntimeLibSelect</name>
+ <version>0</version>
+ <state>2</state>
+ </option>
+ <option>
+ <name>GRuntimeLibSelectSlave</name>
+ <version>0</version>
+ <state>2</state>
+ </option>
+ <option>
+ <name>RTDescription</name>
+ <state>Use the full configuration of the C/C++ runtime library. Full locale interface, C locale, file descriptor support, multibytes in printf and scanf, and hex floats in strtod.</state>
+ </option>
+ <option>
+ <name>OGProductVersion</name>
+ <state>4.41A</state>
+ </option>
+ <option>
+ <name>OGLastSavedByProductVersion</name>
+ <state>8.20.2.14834</state>
+ </option>
+ <option>
+ <name>GeneralEnableMisra</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GeneralMisraVerbose</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGChipSelectEditMenu</name>
+ <state>STM32WB55RG ST STM32WB55RG</state>
+ </option>
+ <option>
+ <name>GenLowLevelInterface</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>GEndianModeBE</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OGBufferedTerminalOutput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GenStdoutInterface</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GeneralMisraRules98</name>
+ <version>0</version>
+ <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
+ </option>
+ <option>
+ <name>GeneralMisraVer</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GeneralMisraRules04</name>
+ <version>0</version>
+ <state>011111111111111110111111111111011111111111111011110100111111111111111111111111111111111111111111101111111111111011111111111111111111111111111</state>
+ </option>
+ <option>
+ <name>RTConfigPath2</name>
+ <state>$TOOLKIT_DIR$\INC\c\DLib_Config_Full.h</state>
+ </option>
+ <option>
+ <name>GBECoreSlave</name>
+ <version>26</version>
+ <state>39</state>
+ </option>
+ <option>
+ <name>OGUseCmsis</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGUseCmsisDspLib</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GRuntimeLibThreads</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CoreVariant</name>
+ <version>26</version>
+ <state>39</state>
+ </option>
+ <option>
+ <name>GFPUDeviceSlave</name>
+ <state>STM32WB55RG ST STM32WB55RG</state>
+ </option>
+ <option>
+ <name>FPU2</name>
+ <version>0</version>
+ <state>4</state>
+ </option>
+ <option>
+ <name>NrRegs</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>NEON</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GFPUCoreSlave2</name>
+ <version>26</version>
+ <state>39</state>
+ </option>
+ <option>
+ <name>OGCMSISPackSelectDevice</name>
+ </option>
+ <option>
+ <name>OgLibHeap</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGLibAdditionalLocale</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGPrintfVariant</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OGPrintfMultibyteSupport</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OGScanfVariant</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OGScanfMultibyteSupport</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>GenLocaleTags</name>
+ <state></state>
+ </option>
+ <option>
+ <name>GenLocaleDisplayOnly</name>
+ <state></state>
+ </option>
+ <option>
+ <name>DSPExtension</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>TrustZone</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>ICCARM</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>34</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CCOptimizationNoSizeConstraints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCDefines</name>
+ <state>USE_HAL_DRIVER</state>
+ <state>STM32WB55xx</state>
+ <state>USE_STM32WBXX_NUCLEO</state>
+ <state>ZIGBEE_WB</state>
+ </option>
+ <option>
+ <name>CCPreprocFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPreprocComments</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPreprocLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListCFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListCMnemonics</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListCMessages</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListAssFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListAssSource</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCEnableRemarks</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCDiagSuppress</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCDiagRemark</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCDiagWarning</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCDiagError</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCObjPrefix</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCAllowList</name>
+ <version>1</version>
+ <state>11111110</state>
+ </option>
+ <option>
+ <name>CCDebugInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IEndianMode</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IExtraOptionsCheck</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IExtraOptions</name>
+ <state>--diag_suppress Pe111</state>
+ <state>--diag_suppress Pe188</state>
+ </option>
+ <option>
+ <name>CCLangConformance</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSignedPlainChar</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCRequirePrototypes</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCDiagWarnAreErr</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCompilerRuntimeInfo</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IFpuProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OutputFile</name>
+ <state>$FILE_BNAME$.o</state>
+ </option>
+ <option>
+ <name>CCLibConfigHeader</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>PreInclude</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CompilerMisraOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCIncludePath2</name>
+ <state>$PROJ_DIR$/../Core/Inc</state>
+ <state>$PROJ_DIR$/../STM32_WPAN/App</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/BSP/P-NUCLEO-WB55.Nucleo</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/STM32WBxx_HAL_Driver/Inc</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/STM32WBxx_HAL_Driver/Inc/Legacy</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/app</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/utilities</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/CMSIS/Device/ST/STM32WBxx/Include</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/zigbee/core/Inc</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/zigbee/stack</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/zigbee/stack/include</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/zigbee/stack/include/M4</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/CMSIS/Include</state>
+ <state>$PROJ_DIR$/../../../../../../Utilities/sequencer</state>
+ <state>$PROJ_DIR$/../../../../../../Utilities/lpm/tiny_lpm</state>
+ </option>
+ <option>
+ <name>CCStdIncCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCodeSection</name>
+ <state>.text</state>
+ </option>
+ <option>
+ <name>IProcessorMode2</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCOptLevel</name>
+ <state>3</state>
+ </option>
+ <option>
+ <name>CCOptStrategy</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCOptLevelSlave</name>
+ <state>3</state>
+ </option>
+ <option>
+ <name>CompilerMisraRules98</name>
+ <version>0</version>
+ <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
+ </option>
+ <option>
+ <name>CompilerMisraRules04</name>
+ <version>0</version>
+ <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
+ </option>
+ <option>
+ <name>CCPosIndRopi</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPosIndRwpi</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPosIndNoDynInit</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccLang</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccCDialect</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IccAllowVLA</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccStaticDestr</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccCppInlineSemantics</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccCmsis</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IccFloatSemantics</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCNoLiteralPool</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCOptStrategySlave</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCGuardCalls</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCEncSource</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCEncOutput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCEncOutputBom</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCEncInput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccExceptions2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccRTTI2</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>AARM</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>10</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>AObjPrefix</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AEndian</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>ACaseSensitivity</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>MacroChars</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AWarnEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AWarnWhat</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AWarnOne</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AWarnRange1</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AWarnRange2</name>
+ <state></state>
+ </option>
+ <option>
+ <name>ADebug</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AltRegisterNames</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ADefines</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AList</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AListHeader</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AListing</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>Includes</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacDefs</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacExps</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>MacExec</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OnlyAssed</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MultiLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>PageLengthCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>PageLength</name>
+ <state>80</state>
+ </option>
+ <option>
+ <name>TabSpacing</name>
+ <state>8</state>
+ </option>
+ <option>
+ <name>AXRef</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AXRefDefines</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AXRefInternal</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AXRefDual</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AFpuProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AOutputFile</name>
+ <state>$FILE_BNAME$.o</state>
+ </option>
+ <option>
+ <name>ALimitErrorsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ALimitErrorsEdit</name>
+ <state>100</state>
+ </option>
+ <option>
+ <name>AIgnoreStdInclude</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AUserIncludes</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AExtraOptionsCheckV2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AExtraOptionsV2</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AsmNoLiteralPool</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>OBJCOPY</name>
+ <archiveVersion>0</archiveVersion>
+ <data>
+ <version>1</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OOCOutputFormat</name>
+ <version>3</version>
+ <state>3</state>
+ </option>
+ <option>
+ <name>OCOutputOverride</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OOCOutputFile</name>
+ <state>Zigbee_OnOff_Coord.bin</state>
+ </option>
+ <option>
+ <name>OOCCommandLineProducer</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OOCObjCopyEnable</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>CUSTOM</name>
+ <archiveVersion>3</archiveVersion>
+ <data>
+ <extensions></extensions>
+ <cmdline></cmdline>
+ <hasPrio>0</hasPrio>
+ </data>
+ </settings>
+ <settings>
+ <name>BICOMP</name>
+ <archiveVersion>0</archiveVersion>
+ <data />
+ </settings>
+ <settings>
+ <name>BUILDACTION</name>
+ <archiveVersion>1</archiveVersion>
+ <data>
+ <prebuild></prebuild>
+ <postbuild></postbuild>
+ </data>
+ </settings>
+ <settings>
+ <name>ILINK</name>
+ <archiveVersion>0</archiveVersion>
+ <data>
+ <version>20</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>IlinkLibIOConfig</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>XLinkMisraHandler</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkInputFileSlave</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkOutputFile</name>
+ <state>Zigbee_OnOff_Coord.out</state>
+ </option>
+ <option>
+ <name>IlinkDebugInfoEnable</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkKeepSymbols</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinaryFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinarySymbol</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinarySegment</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinaryAlign</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkDefines</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkConfigDefines</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkMapFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkLogFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogInitialization</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogModule</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogSection</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogVeneer</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkIcfOverride</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkIcfFile</name>
+ <state>$PROJ_DIR$\stm32wb55xx_flash_cm4.icf</state>
+ </option>
+ <option>
+ <name>IlinkIcfFileSlave</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkEnableRemarks</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkSuppressDiags</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkTreatAsRem</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkTreatAsWarn</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkTreatAsErr</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkWarningsAreErrors</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkUseExtraOptions</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkExtraOptions</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkLowLevelInterfaceSlave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkAutoLibEnable</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkAdditionalLibs</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkOverrideProgramEntryLabel</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkProgramEntryLabelSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkProgramEntryLabel</name>
+ <state>__iar_program_start</state>
+ </option>
+ <option>
+ <name>DoFill</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>FillerByte</name>
+ <state>0xFF</state>
+ </option>
+ <option>
+ <name>FillerStart</name>
+ <state>0x0</state>
+ </option>
+ <option>
+ <name>FillerEnd</name>
+ <state>0x0</state>
+ </option>
+ <option>
+ <name>CrcSize</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcAlign</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcPoly</name>
+ <state>0x11021</state>
+ </option>
+ <option>
+ <name>CrcCompl</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CrcBitOrder</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CrcInitialValue</name>
+ <state>0x0</state>
+ </option>
+ <option>
+ <name>DoCrc</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkBE8Slave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkBufferedTerminalOutput</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkStdoutInterfaceSlave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcFullSize</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkIElfToolPostProcess</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogAutoLibSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogRedirSymbols</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogUnusedFragments</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkCrcReverseByteOrder</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkCrcUseAsInput</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptInline</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkOptExceptionsAllow</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptExceptionsForce</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkCmsis</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptMergeDuplSections</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkOptUseVfe</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptForceVfe</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkStackAnalysisEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkStackControlFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkStackCallGraphFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CrcAlgorithm</name>
+ <version>1</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcUnitSize</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkThreadsSlave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkLogCallGraph</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkIcfFile_AltDefault</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkEncInput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkEncOutput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkEncOutputBom</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkHeapSelect</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkLocaleSelect</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>IARCHIVE</name>
+ <archiveVersion>0</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>IarchiveInputs</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IarchiveOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IarchiveOutput</name>
+ <state>###Unitialized###</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>BILINK</name>
+ <archiveVersion>0</archiveVersion>
+ <data />
+ </settings>
+ </configuration>
+ <group>
+ <name>Application</name>
+ <group>
+ <name>EWARM</name>
+ <file>
+ <name>$PROJ_DIR$\startup_stm32wb55xx_cm4.s</name>
+ </file>
+ </group>
+ <group>
+ <name>User</name>
+ <group>
+ <name>Core</name>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\app_entry.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\hw_timerserver.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\hw_uart.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\main.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\stm32wbxx_hal_msp.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\stm32wbxx_it.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\stm_logging.c</name>
+ </file>
+ </group>
+ <group>
+ <name>STM32_WPAN</name>
+ <group>
+ <name>App</name>
+ <file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\App\app_zigbee.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\App\app_zigbee_demo.c</name>
+ </file>
+ </group>
+ <group>
+ <name>Target</name>
+ <file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\Target\hw_ipcc.c</name>
+ </file>
+ </group>
+ </group>
+ </group>
+ </group>
+ <group>
+ <name>Drivers</name>
+ <group>
+ <name>BSP</name>
+ <group>
+ <name>STM32WBxx_Nucleo</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\BSP\P-NUCLEO-WB55.Nucleo\stm32wbxx_nucleo.c</name>
+ </file>
+ </group>
+ </group>
+ <group>
+ <name>CMSIS</name>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\system_stm32wbxx.c</name>
+ </file>
+ </group>
+ <group>
+ <name>STM32WBxx_HAL_Driver</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_cortex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_dma.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_dma_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_exti.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_flash.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_flash_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_gpio.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_hsem.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_pwr.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_pwr_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rcc.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rcc_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rtc.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rtc_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_tim.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_tim_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_uart.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_uart_ex.c</name>
+ </file>
+ </group>
+ </group>
+ <group>
+ <name>Middlewares</name>
+ <group>
+ <name>STM32_WPAN</name>
+ <group>
+ <name>interface</name>
+ <group>
+ <name>patterns</name>
+ <group>
+ <name>ble_thread</name>
+ <group>
+ <name>schi</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\shci\shci.c</name>
+ </file>
+ </group>
+ <group>
+ <name>tl</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\hci_tl_if.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\shci_tl.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\shci_tl_if.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\tl_mbox.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\tl_zigbee_hci.c</name>
+ </file>
+ </group>
+ </group>
+ </group>
+ </group>
+ <group>
+ <name>utilities</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\utilities\dbg_trace.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\utilities\otp.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\utilities\stm_list.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\utilities\stm_queue.c</name>
+ </file>
+ </group>
+ <group>
+ <name>zigbee</name>
+ <group>
+ <name>core</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\zigbee\core\src\zigbee_core_wb.c</name>
+ </file>
+ </group>
+ <group>
+ <name>stack</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\zigbee\lib\stm32wb_zigbee_wb_lib.a</name>
+ </file>
+ </group>
+ </group>
+ </group>
+ </group>
+ <group>
+ <name>Utilities</name>
+ <group>
+ <name>lpm</name>
+ <group>
+ <name>tiny_lpm</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Utilities\lpm\tiny_lpm\stm32_lpm.c</name>
+ </file>
+ </group>
+ </group>
+ <group>
+ <name>sequencer</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Utilities\sequencer\stm32_seq.c</name>
+ </file>
+ </group>
+ </group>
+</project>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/EWARM/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/EWARM/startup_stm32wb55xx_cm4.s
new file mode 100644
index 000000000..1f886ff59
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/EWARM/startup_stm32wb55xx_cm4.s
@@ -0,0 +1,517 @@
+;******************************************************************************
+;* File Name : startup_stm32wb55xx_cm4.s
+;* Author : MCD Application Team
+;* Description : M4 core vector table of the STM32WB55xx devices for the
+;* IAR (EWARM) toolchain.
+;*
+;* This module performs:
+;* - Set the initial SP
+;* - Set the initial PC == _iar_program_start,
+;* - Set the vector table entries with the exceptions ISR
+;* address.
+;* - Branches to main in the C library (which eventually
+;* calls main()).
+;* After Reset the Cortex-M4 processor is in Thread mode,
+;* priority is Privileged, and the Stack is set to Main.
+;******************************************************************************
+;* @attention
+;*
+;* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+;* All rights reserved.</center></h2>
+;*
+;* This software component is licensed by ST under BSD 3-Clause license,
+;* the "License"; You may not use this file except in compliance with the
+;* License. You may obtain a copy of the License at:
+;* opensource.org/licenses/BSD-3-Clause
+;*
+;******************************************************************************
+;
+;
+; The modules in this file are included in the libraries, and may be replaced
+; by any user-defined modules that define the PUBLIC symbol _program_start or
+; a user defined start symbol.
+; To override the cstartup defined in the library, simply add your modified
+; version to the workbench project.
+;
+; The vector table is normally located at address 0.
+; When debugging in RAM, it can be located in RAM, aligned to at least 2^6.
+; The name "__vector_table" has special meaning for C-SPY:
+; it is where the SP start value is found, and the NVIC vector
+; table register (VTOR) is initialized to this address if != 0.
+;
+; Cortex-M version
+;
+
+ MODULE ?cstartup
+
+ ;; Forward declaration of sections.
+ SECTION CSTACK:DATA:NOROOT(3)
+
+ SECTION .intvec:CODE:NOROOT(2)
+
+ EXTERN __iar_program_start
+ EXTERN SystemInit
+ PUBLIC __vector_table
+
+ DATA
+__vector_table
+ DCD sfe(CSTACK)
+ DCD Reset_Handler ; Reset Handler
+
+ DCD NMI_Handler ; NMI Handler
+ DCD HardFault_Handler ; Hard Fault Handler
+ DCD MemManage_Handler ; MPU Fault Handler
+ DCD BusFault_Handler ; Bus Fault Handler
+ DCD UsageFault_Handler ; Usage Fault Handler
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD SVC_Handler ; SVCall Handler
+ DCD DebugMon_Handler ; Debug Monitor Handler
+ DCD 0 ; Reserved
+ DCD PendSV_Handler ; PendSV Handler
+ DCD SysTick_Handler ; SysTick Handler
+
+ ; External Interrupts
+ DCD WWDG_IRQHandler ; Window WatchDog
+ DCD PVD_PVM_IRQHandler ; PVD and PVM Interrupt
+ DCD TAMP_STAMP_LSECSS_IRQHandler ; RTC Tamper, TimeStamp Interrupts and LSECSS Interrupts
+ DCD RTC_WKUP_IRQHandler ; RTC Wakeup Interrupt
+ DCD FLASH_IRQHandler ; FLASH global Interrupt
+ DCD RCC_IRQHandler ; RCC Interrupt
+ DCD EXTI0_IRQHandler ; EXTI Line 0 Interrupt
+ DCD EXTI1_IRQHandler ; EXTI Line 1 Interrupt
+ DCD EXTI2_IRQHandler ; EXTI Line 2 Interrupt
+ DCD EXTI3_IRQHandler ; EXTI Line 3 Interrup
+ DCD EXTI4_IRQHandler ; EXTI Line 4 Interrupt
+ DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 Interrupt
+ DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2 Interrupt
+ DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3 Interrupt
+ DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4 Interrupt
+ DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5 Interrupt
+ DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6 Interrupt
+ DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7 Interrupt
+ DCD ADC1_IRQHandler ; ADC1 Interrupt
+ DCD USB_HP_IRQHandler ; USB High Priority Interrupt
+ DCD USB_LP_IRQHandler ; USB Low Priority Interrupt
+ DCD C2SEV_PWR_C2H_IRQHandler ; CPU M0+ SEV Interrupt
+ DCD COMP_IRQHandler ; COMP1 and COMP2 Interrupts
+ DCD EXTI9_5_IRQHandler ; EXTI Lines [9:5] Interrupt
+ DCD TIM1_BRK_IRQHandler ; TIM1 Break Interrupt
+ DCD TIM1_UP_TIM16_IRQHandler ; TIM1 Update and TIM16 global Interrupts
+ DCD TIM1_TRG_COM_TIM17_IRQHandler ; TIM1 Trigger and Communication and TIM17 global Interrupts
+ DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare Interrupt
+ DCD TIM2_IRQHandler ; TIM2 Global Interrupt
+ DCD PKA_IRQHandler ; PKA Interrupt
+ DCD I2C1_EV_IRQHandler ; I2C1 Event Interrupt
+ DCD I2C1_ER_IRQHandler ; I2C1 Error Interrupt
+ DCD I2C3_EV_IRQHandler ; I2C3 Event Interrupt
+ DCD I2C3_ER_IRQHandler ; I2C3 Error Interrupt
+ DCD SPI1_IRQHandler ; SPI1 Interrupt
+ DCD SPI2_IRQHandler ; SPI2 Interrupt
+ DCD USART1_IRQHandler ; USART1 Interrupt
+ DCD LPUART1_IRQHandler ; LPUART1 Interrupt
+ DCD SAI1_IRQHandler ; SAI Interrupt
+ DCD TSC_IRQHandler ; TSC Interrupt
+ DCD EXTI15_10_IRQHandler ; EXTI Lines1[15:10 ]Interrupts
+ DCD RTC_Alarm_IRQHandler ; RTC Alarms (A and B) Interrupt
+ DCD CRS_IRQHandler ; CRS interrupt
+ DCD PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler ; WKUP Interrupt from PWR
+ DCD IPCC_C1_RX_IRQHandler ; IPCC CPU1 RX occupied interrupt
+ DCD IPCC_C1_TX_IRQHandler ; IPCC CPU1 RX free interrupt
+ DCD HSEM_IRQHandler ; HSEM0 Interrupt
+ DCD LPTIM1_IRQHandler ; LPTIM1 Interrupt
+ DCD LPTIM2_IRQHandler ; LPTIM2 Interrupt
+ DCD LCD_IRQHandler ; LCD Interrupt
+ DCD QUADSPI_IRQHandler ; QUADSPI Interrupt
+ DCD AES1_IRQHandler ; AES1 Interrupt
+ DCD AES2_IRQHandler ; AES2 Interrupt
+ DCD RNG_IRQHandler ; RNG1 Interrupt
+ DCD FPU_IRQHandler ; FPU Interrupt
+ DCD DMA2_Channel1_IRQHandler ; DMA2 Channel 1 Interrupt
+ DCD DMA2_Channel2_IRQHandler ; DMA2 Channel 2 Interrupt
+ DCD DMA2_Channel3_IRQHandler ; DMA2 Channel 3 Interrupt
+ DCD DMA2_Channel4_IRQHandler ; DMA2 Channel 4 Interrupt
+ DCD DMA2_Channel5_IRQHandler ; DMA2 Channel 5 Interrupt
+ DCD DMA2_Channel6_IRQHandler ; DMA2 Channel 6 Interrupt
+ DCD DMA2_Channel7_IRQHandler ; DMA2 Channel 7 Interrupt
+ DCD DMAMUX1_OVR_IRQHandler ; DMAMUX overrun Interrupt
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Default interrupt handlers.
+;;
+ THUMB
+
+ PUBWEAK Reset_Handler
+ SECTION .text:CODE:NOROOT:REORDER(2)
+Reset_Handler
+ LDR R0, =SystemInit
+ BLX R0
+ LDR R0, =__iar_program_start
+ BX R0
+
+ PUBWEAK NMI_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+NMI_Handler
+ B NMI_Handler
+
+ PUBWEAK HardFault_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+HardFault_Handler
+ B HardFault_Handler
+
+ PUBWEAK MemManage_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+MemManage_Handler
+ B MemManage_Handler
+
+ PUBWEAK BusFault_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+BusFault_Handler
+ B BusFault_Handler
+
+ PUBWEAK UsageFault_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+UsageFault_Handler
+ B UsageFault_Handler
+
+ PUBWEAK SVC_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SVC_Handler
+ B SVC_Handler
+
+ PUBWEAK DebugMon_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DebugMon_Handler
+ B DebugMon_Handler
+
+ PUBWEAK PendSV_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+PendSV_Handler
+ B PendSV_Handler
+
+ PUBWEAK SysTick_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SysTick_Handler
+ B SysTick_Handler
+
+ PUBWEAK WWDG_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+WWDG_IRQHandler
+ B WWDG_IRQHandler
+
+ PUBWEAK PVD_PVM_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+PVD_PVM_IRQHandler
+ B PVD_PVM_IRQHandler
+
+ PUBWEAK TAMP_STAMP_LSECSS_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TAMP_STAMP_LSECSS_IRQHandler
+ B TAMP_STAMP_LSECSS_IRQHandler
+
+ PUBWEAK RTC_WKUP_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+RTC_WKUP_IRQHandler
+ B RTC_WKUP_IRQHandler
+
+ PUBWEAK FLASH_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+FLASH_IRQHandler
+ B FLASH_IRQHandler
+
+ PUBWEAK RCC_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+RCC_IRQHandler
+ B RCC_IRQHandler
+
+ PUBWEAK EXTI0_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI0_IRQHandler
+ B EXTI0_IRQHandler
+
+ PUBWEAK EXTI1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI1_IRQHandler
+ B EXTI1_IRQHandler
+
+ PUBWEAK EXTI2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI2_IRQHandler
+ B EXTI2_IRQHandler
+
+ PUBWEAK EXTI3_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI3_IRQHandler
+ B EXTI3_IRQHandler
+
+ PUBWEAK EXTI4_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI4_IRQHandler
+ B EXTI4_IRQHandler
+
+ PUBWEAK DMA1_Channel1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel1_IRQHandler
+ B DMA1_Channel1_IRQHandler
+
+ PUBWEAK DMA1_Channel2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel2_IRQHandler
+ B DMA1_Channel2_IRQHandler
+
+ PUBWEAK DMA1_Channel3_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel3_IRQHandler
+ B DMA1_Channel3_IRQHandler
+
+ PUBWEAK DMA1_Channel4_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel4_IRQHandler
+ B DMA1_Channel4_IRQHandler
+
+ PUBWEAK DMA1_Channel5_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel5_IRQHandler
+ B DMA1_Channel5_IRQHandler
+
+ PUBWEAK DMA1_Channel6_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel6_IRQHandler
+ B DMA1_Channel6_IRQHandler
+
+ PUBWEAK DMA1_Channel7_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel7_IRQHandler
+ B DMA1_Channel7_IRQHandler
+
+ PUBWEAK ADC1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+ADC1_IRQHandler
+ B ADC1_IRQHandler
+
+ PUBWEAK USB_HP_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+USB_HP_IRQHandler
+ B USB_HP_IRQHandler
+
+ PUBWEAK USB_LP_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+USB_LP_IRQHandler
+ B USB_LP_IRQHandler
+
+ PUBWEAK C2SEV_PWR_C2H_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+C2SEV_PWR_C2H_IRQHandler
+ B C2SEV_PWR_C2H_IRQHandler
+
+ PUBWEAK COMP_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+COMP_IRQHandler
+ B COMP_IRQHandler
+
+ PUBWEAK EXTI9_5_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI9_5_IRQHandler
+ B EXTI9_5_IRQHandler
+
+ PUBWEAK TIM1_BRK_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM1_BRK_IRQHandler
+ B TIM1_BRK_IRQHandler
+
+ PUBWEAK TIM1_UP_TIM16_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM1_UP_TIM16_IRQHandler
+ B TIM1_UP_TIM16_IRQHandler
+
+ PUBWEAK TIM1_TRG_COM_TIM17_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM1_TRG_COM_TIM17_IRQHandler
+ B TIM1_TRG_COM_TIM17_IRQHandler
+
+ PUBWEAK TIM1_CC_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM1_CC_IRQHandler
+ B TIM1_CC_IRQHandler
+
+ PUBWEAK TIM2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM2_IRQHandler
+ B TIM2_IRQHandler
+
+ PUBWEAK PKA_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+PKA_IRQHandler
+ B PKA_IRQHandler
+
+ PUBWEAK I2C1_EV_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+I2C1_EV_IRQHandler
+ B I2C1_EV_IRQHandler
+
+ PUBWEAK I2C1_ER_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+I2C1_ER_IRQHandler
+ B I2C1_ER_IRQHandler
+
+ PUBWEAK I2C3_EV_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+I2C3_EV_IRQHandler
+ B I2C3_EV_IRQHandler
+
+ PUBWEAK I2C3_ER_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+I2C3_ER_IRQHandler
+ B I2C3_ER_IRQHandler
+
+ PUBWEAK SPI1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SPI1_IRQHandler
+ B SPI1_IRQHandler
+
+ PUBWEAK SPI2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SPI2_IRQHandler
+ B SPI2_IRQHandler
+
+ PUBWEAK USART1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+USART1_IRQHandler
+ B USART1_IRQHandler
+
+ PUBWEAK LPUART1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+LPUART1_IRQHandler
+ B LPUART1_IRQHandler
+
+ PUBWEAK SAI1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SAI1_IRQHandler
+ B SAI1_IRQHandler
+
+ PUBWEAK TSC_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TSC_IRQHandler
+ B TSC_IRQHandler
+
+ PUBWEAK EXTI15_10_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI15_10_IRQHandler
+ B EXTI15_10_IRQHandler
+
+ PUBWEAK RTC_Alarm_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+RTC_Alarm_IRQHandler
+ B RTC_Alarm_IRQHandler
+
+ PUBWEAK CRS_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+CRS_IRQHandler
+ B CRS_IRQHandler
+
+ PUBWEAK PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler
+ B PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler
+
+ PUBWEAK IPCC_C1_RX_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+IPCC_C1_RX_IRQHandler
+ B IPCC_C1_RX_IRQHandler
+
+ PUBWEAK IPCC_C1_TX_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+IPCC_C1_TX_IRQHandler
+ B IPCC_C1_TX_IRQHandler
+
+ PUBWEAK HSEM_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+HSEM_IRQHandler
+ B HSEM_IRQHandler
+
+ PUBWEAK LPTIM1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+LPTIM1_IRQHandler
+ B LPTIM1_IRQHandler
+
+ PUBWEAK LPTIM2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+LPTIM2_IRQHandler
+ B LPTIM2_IRQHandler
+
+ PUBWEAK LCD_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+LCD_IRQHandler
+ B LCD_IRQHandler
+
+ PUBWEAK QUADSPI_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+QUADSPI_IRQHandler
+ B QUADSPI_IRQHandler
+
+ PUBWEAK AES1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+AES1_IRQHandler
+ B AES1_IRQHandler
+
+ PUBWEAK AES2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+AES2_IRQHandler
+ B AES2_IRQHandler
+
+ PUBWEAK RNG_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+RNG_IRQHandler
+ B RNG_IRQHandler
+
+ PUBWEAK FPU_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+FPU_IRQHandler
+ B FPU_IRQHandler
+
+ PUBWEAK DMA2_Channel1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel1_IRQHandler
+ B DMA2_Channel1_IRQHandler
+
+ PUBWEAK DMA2_Channel2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel2_IRQHandler
+ B DMA2_Channel2_IRQHandler
+
+ PUBWEAK DMA2_Channel3_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel3_IRQHandler
+ B DMA2_Channel3_IRQHandler
+
+ PUBWEAK DMA2_Channel4_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel4_IRQHandler
+ B DMA2_Channel4_IRQHandler
+
+ PUBWEAK DMA2_Channel5_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel5_IRQHandler
+ B DMA2_Channel5_IRQHandler
+
+ PUBWEAK DMA2_Channel6_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel6_IRQHandler
+ B DMA2_Channel6_IRQHandler
+
+ PUBWEAK DMA2_Channel7_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel7_IRQHandler
+ B DMA2_Channel7_IRQHandler
+
+ PUBWEAK DMAMUX1_OVR_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMAMUX1_OVR_IRQHandler
+ B DMAMUX1_OVR_IRQHandler
+
+ END
+
+;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE*****
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/EWARM/stm32wb55xx_flash_cm4.icf b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/EWARM/stm32wb55xx_flash_cm4.icf
new file mode 100644
index 000000000..70aec4026
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/EWARM/stm32wb55xx_flash_cm4.icf
@@ -0,0 +1,47 @@
+/*###ICF### Section handled by ICF editor, don't touch! ****/
+/*-Editor annotation file-*/
+/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
+/*-Specials-*/
+define symbol __ICFEDIT_intvec_start__ = 0x08000000;
+/*-Memory Regions-*/
+/***** FLASH Part dedicated to M4 *****/
+define symbol __ICFEDIT_region_ROM_start__ = 0x08000000;
+define symbol __ICFEDIT_region_ROM_end__ = 0x0807FFFF;
+define symbol __ICFEDIT_region_RAM_start__ = 0x20000004;
+define symbol __ICFEDIT_region_RAM_end__ = 0x2002F000;
+
+ /*0x2002FFFF---------------------------------------|
+ * | Emulation Flash |
+ * 0x2002F000-------------------------------------- |
+ * | Region_RAM |
+ * 0x20000004-------------------------------------- |
+
+/*-Sizes-*/
+define symbol __ICFEDIT_size_cstack__ = 0x1000; /* 4K */
+define symbol __ICFEDIT_size_heap__ = 102400; /* was 4K */
+/**** End of ICF editor section. ###ICF###*/
+
+define symbol __ICFEDIT_region_RAM_SHARED_start__ = 0x20030000;
+define symbol __ICFEDIT_region_RAM_SHARED_end__ = 0x20031000;
+
+define memory mem with size = 4G;
+define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
+define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
+define region RAM_SHARED_region = mem:[from __ICFEDIT_region_RAM_SHARED_start__ to __ICFEDIT_region_RAM_SHARED_end__];
+
+define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
+define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
+
+/* MB_MEM1 and MB_MEM2 are sections reserved to mailbox communication. It is placed in the shared memory */
+initialize by copy { readwrite };
+do not initialize { section .noinit,
+ section MAPPING_TABLE,
+ section MB_MEM1 };
+
+place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
+
+place in ROM_region { readonly };
+place in RAM_region { readwrite,block CSTACK, block HEAP };
+place in RAM_SHARED_region { first section MAPPING_TABLE};
+place in RAM_SHARED_region { section MB_MEM1};
+place in RAM_SHARED_region { section MB_MEM2};
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/STM32_WPAN/App/app_zigbee.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/STM32_WPAN/App/app_zigbee.c
new file mode 100644
index 000000000..a7ca65f04
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/STM32_WPAN/App/app_zigbee.c
@@ -0,0 +1,317 @@
+/**
+ ******************************************************************************
+ * File Name : App/app_zigbee.c
+ * Description : Zigbee Application.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "app_entry.h"
+#include "dbg_trace.h"
+#include "app_zigbee.h"
+#include "zigbee_interface.h"
+#include "shci.h"
+#include "stm_logging.h"
+#include "app_conf.h"
+#include "stm32wbxx_core_interface_def.h"
+#include "zigbee_types.h"
+#include "stm32_seq.h"
+
+/* Private defines -----------------------------------------------------------*/
+
+/* Private function prototypes -----------------------------------------------*/
+void APP_ZIGBEE_Demo(void);
+
+static void APP_ZIGBEE_TraceError(const char *pMess, uint32_t ErrCode);
+static void APP_ZIGBEE_CheckWirelessFirmwareInfo(void);
+
+static void Wait_Getting_Ack_From_M0(void);
+static void Receive_Ack_From_M0(void);
+static void Receive_Notification_From_M0(void);
+
+/* Private variables -----------------------------------------------*/
+static TL_CmdPacket_t *p_ZIGBEE_otcmdbuffer;
+static TL_EvtPacket_t *p_ZIGBEE_notif_M0_to_M4;
+static __IO uint32_t CptReceiveMsgFromM0 = 0;
+
+PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static TL_ZIGBEE_Config_t ZigbeeConfigBuffer;
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static TL_CmdPacket_t ZigbeeOtCmdBuffer;
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t ZigbeeNotifRspEvtBuffer[sizeof(TL_PacketHeader_t) + TL_EVT_HDR_SIZE + 255U];
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t ZigbeeNotifLoggingBuffer[sizeof(TL_PacketHeader_t) + TL_EVT_HDR_SIZE + 255U];
+
+/* Functions Definition ------------------------------------------------------*/
+
+void APP_ZIGBEE_Init(void)
+{
+ SHCI_CmdStatus_t ZigbeeInitStatus;
+
+ APP_DBG("APP_ZIGBEE_Init");
+
+ /* Check the compatibility with the Coprocessor Wireless Firmware loaded */
+ APP_ZIGBEE_CheckWirelessFirmwareInfo();
+
+ /* Register cmdbuffer */
+ APP_ZIGBEE_RegisterCmdBuffer(&ZigbeeOtCmdBuffer);
+
+ /* Init config buffer and call TL_ZIGBEE_Init */
+ APP_ZIGBEE_TL_INIT();
+
+ ZigbeeInitStatus = SHCI_C2_ZIGBEE_Init();
+ /* Prevent unused argument(s) compilation warning */
+ UNUSED(ZigbeeInitStatus);
+
+ /* Register task */
+ /* Create the different tasks */
+ UTIL_SEQ_RegTask(1U << (uint32_t)CFG_TASK_MSG_FROM_M0_TO_M4, UTIL_SEQ_RFU,APP_ZIGBEE_ProcessMsgM0ToM4);
+
+ /* Create the zigbee demo task */
+ UTIL_SEQ_RegTask(1U << CFG_TASK_ZIGBEE_APP, UTIL_SEQ_RFU,APP_ZIGBEE_Demo);
+ /* run the task */
+ UTIL_SEQ_SetTask(1U << CFG_TASK_ZIGBEE_APP, CFG_SCH_PRIO_0);
+} /* APP_ZIGBEE_Init */
+
+/**
+ * @brief Trace the error or the warning reported.
+ * @param ErrId :
+ * @param ErrCode
+ * @retval None
+ */
+void APP_ZIGBEE_Error(uint32_t ErrId, uint32_t ErrCode)
+{
+ switch (ErrId) {
+ default:
+ APP_ZIGBEE_TraceError("ERROR Unknown ", 0);
+ break;
+ }
+} /* APP_ZIGBEE_Error */
+
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+
+/**
+ * @brief Warn the user that an error has occurred.In this case,
+ * the LEDs on the Board will start blinking.
+ *
+ * @param pMess : Message associated to the error.
+ * @param ErrCode: Error code associated to the module (Zigbee or other module if any)
+ * @retval None
+ */
+static void APP_ZIGBEE_TraceError(const char *pMess, uint32_t ErrCode)
+{
+ APP_DBG("**** Fatal error = %s (Err = %d)", pMess, ErrCode);
+ while (1U == 1U) {
+ BSP_LED_Toggle(LED1);
+ HAL_Delay(500U);
+ BSP_LED_Toggle(LED2);
+ HAL_Delay(500U);
+ BSP_LED_Toggle(LED3);
+ HAL_Delay(500U);
+ }
+} /* APP_ZIGBEE_TraceError */
+
+/**
+ * @brief Check if the Coprocessor Wireless Firmware loaded supports Zigbee
+ * and display associated informations
+ * @param None
+ * @retval None
+ */
+static void APP_ZIGBEE_CheckWirelessFirmwareInfo(void)
+{
+ WirelessFwInfo_t wireless_info_instance;
+ WirelessFwInfo_t *p_wireless_info = &wireless_info_instance;
+
+ if (SHCI_GetWirelessFwInfo(p_wireless_info) != SHCI_Success) {
+ APP_ZIGBEE_Error((uint32_t)ERR_ZIGBEE_CHECK_WIRELESS, (uint32_t)ERR_INTERFACE_FATAL);
+ }
+ else {
+ APP_DBG("**********************************************************");
+ APP_DBG("WIRELESS COPROCESSOR FW:");
+ /* Print version */
+ APP_DBG("VERSION ID = %d.%d.%d", p_wireless_info->VersionMajor, p_wireless_info->VersionMinor, p_wireless_info->VersionSub);
+
+ switch (p_wireless_info->StackType) {
+ case INFO_STACK_TYPE_ZIGBEE:
+ APP_DBG("FW Type : Zigbee stack");
+ break;
+ default:
+ /* No Zigbee device supported ! */
+ APP_ZIGBEE_Error((uint32_t)ERR_ZIGBEE_CHECK_WIRELESS, (uint32_t)ERR_INTERFACE_FATAL);
+ break;
+ }
+ APP_DBG("**********************************************************");
+ }
+} /* APP_ZIGBEE_CheckWirelessFirmwareInfo */
+
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+
+void APP_ZIGBEE_RegisterCmdBuffer(TL_CmdPacket_t *p_buffer)
+{
+ p_ZIGBEE_otcmdbuffer = p_buffer;
+} /* APP_ZIGBEE_RegisterCmdBuffer */
+
+Zigbee_Cmd_Request_t * ZIGBEE_Get_OTCmdPayloadBuffer(void)
+{
+ return (Zigbee_Cmd_Request_t *)p_ZIGBEE_otcmdbuffer->cmdserial.cmd.payload;
+} /* ZIGBEE_Get_OTCmdPayloadBuffer */
+
+Zigbee_Cmd_Request_t * ZIGBEE_Get_OTCmdRspPayloadBuffer(void)
+{
+ return (Zigbee_Cmd_Request_t *)((TL_EvtPacket_t *)p_ZIGBEE_otcmdbuffer)->evtserial.evt.payload;
+} /* ZIGBEE_Get_OTCmdRspPayloadBuffer */
+
+Zigbee_Cmd_Request_t * ZIGBEE_Get_NotificationPayloadBuffer(void)
+{
+ return (Zigbee_Cmd_Request_t *)(p_ZIGBEE_notif_M0_to_M4)->evtserial.evt.payload;
+} /* ZIGBEE_Get_NotificationPayloadBuffer */
+
+/**
+ * @brief This function is used to transfer the commands from the M4 to the M0.
+ *
+ * @param None
+ * @return None
+ */
+void ZIGBEE_CmdTransfer(void)
+{
+ Zigbee_Cmd_Request_t *cmd_req = (Zigbee_Cmd_Request_t *)p_ZIGBEE_otcmdbuffer->cmdserial.cmd.payload;
+
+ /* Zigbee OT command cmdcode range 0x280 .. 0x3DF = 352 */
+ p_ZIGBEE_otcmdbuffer->cmdserial.cmd.cmdcode = 0x280U;
+ /* Size = otCmdBuffer->Size (Number of OT cmd arguments : 1 arg = 32bits so multiply by 4 to get size in bytes)
+ * + ID (4 bytes) + Size (4 bytes) */
+ p_ZIGBEE_otcmdbuffer->cmdserial.cmd.plen = 8U + (cmd_req->Size * 4U);
+
+ TL_ZIGBEE_SendAppliCmdToM0();
+
+ /* Wait completion of cmd */
+ Wait_Getting_Ack_From_M0();
+} /* ZIGBEE_CmdTransfer */
+
+/**
+ * @brief This function is called when the M0+ acknoledge the fact that it has received a Cmd
+ *
+ *
+ * @param Otbuffer : a pointer to TL_EvtPacket_t
+ * @return None
+ */
+void TL_ZIGBEE_CmdEvtReceived(TL_EvtPacket_t *Otbuffer)
+{
+ /* Prevent unused argument(s) compilation warning */
+ UNUSED(Otbuffer);
+
+ Receive_Ack_From_M0();
+} /* TL_ZIGBEE_CmdEvtReceived */
+
+/**
+ * @brief This function is called when notification from M0+ is received.
+ *
+ * @param Notbuffer : a pointer to TL_EvtPacket_t
+ * @return None
+ */
+void TL_ZIGBEE_NotReceived(TL_EvtPacket_t *Notbuffer)
+{
+ p_ZIGBEE_notif_M0_to_M4 = Notbuffer;
+
+ Receive_Notification_From_M0();
+} /* TL_ZIGBEE_NotReceived */
+
+/**
+ * @brief This function is called before sending any ot command to the M0
+ * core. The purpose of this function is to be able to check if
+ * there are no notifications coming from the M0 core which are
+ * pending before sending a new ot command.
+ * @param None
+ * @retval None
+ */
+void Pre_ZigbeeCmdProcessing(void)
+{
+ UTIL_SEQ_WaitEvt(EVENT_SYNCHRO_BYPASS_IDLE);
+} /* Pre_ZigbeeCmdProcessing */
+
+/**
+ * @brief This function waits for getting an acknowledgment from the M0.
+ *
+ * @param None
+ * @retval None
+ */
+static void Wait_Getting_Ack_From_M0(void)
+{
+ UTIL_SEQ_WaitEvt(EVENT_ACK_FROM_M0_EVT);
+} /* Wait_Getting_Ack_From_M0 */
+
+/**
+ * @brief Receive an acknowledgment from the M0+ core.
+ * Each command send by the M4 to the M0 are acknowledged.
+ * This function is called under interrupt.
+ * @param None
+ * @retval None
+ */
+static void Receive_Ack_From_M0(void)
+{
+ UTIL_SEQ_SetEvt(EVENT_ACK_FROM_M0_EVT);
+} /* Receive_Ack_From_M0 */
+
+/**
+ * @brief Receive a notification from the M0+ through the IPCC.
+ * This function is called under interrupt.
+ * @param None
+ * @retval None
+ */
+static void Receive_Notification_From_M0(void)
+{
+ CptReceiveMsgFromM0++;
+ UTIL_SEQ_SetTask(1U << CFG_TASK_MSG_FROM_M0_TO_M4, CFG_SCH_PRIO_0);
+} /* Receive_Notification_From_M0 */
+
+/**
+ * @brief Perform initialization of TL for Zigbee.
+ * @param None
+ * @retval None
+ */
+void APP_ZIGBEE_TL_INIT(void)
+{
+ ZigbeeConfigBuffer.p_ZigbeeOtCmdRspBuffer = (uint8_t *)&ZigbeeOtCmdBuffer;
+ ZigbeeConfigBuffer.p_ZigbeeNotAckBuffer = (uint8_t *)ZigbeeNotifRspEvtBuffer;
+ ZigbeeConfigBuffer.p_ZigbeeLoggingBuffer = (uint8_t *)ZigbeeNotifLoggingBuffer;
+ TL_ZIGBEE_Init(&ZigbeeConfigBuffer);
+} /* APP_ZIGBEE_TL_INIT */
+
+/**
+ * @brief Process the messages coming from the M0.
+ * @param None
+ * @retval None
+ */
+void APP_ZIGBEE_ProcessMsgM0ToM4(void)
+{
+ if (CptReceiveMsgFromM0 != 0) {
+ /* If CptReceiveMsgFromM0 is > 1. it means that we did not serve all the events from the radio */
+ if (CptReceiveMsgFromM0 > 1U) {
+ APP_ZIGBEE_Error(ERR_REC_MULTI_MSG_FROM_M0, 0);
+ }
+ else {
+ Zigbee_CallBackProcessing();
+ }
+ /* Reset counter */
+ CptReceiveMsgFromM0 = 0;
+ }
+} /* APP_ZIGBEE_ProcessMsgM0ToM4 */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/STM32_WPAN/App/app_zigbee.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/STM32_WPAN/App/app_zigbee.h
new file mode 100644
index 000000000..dd907ec23
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/STM32_WPAN/App/app_zigbee.h
@@ -0,0 +1,61 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : app_zigbee.h
+ * Description : Header for Zigbee Application.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_ZIGBEE_H
+#define APP_ZIGBEE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+/* Private includes ----------------------------------------------------------*/
+#include "tl.h"
+#include "tl_zigbee_hci.h"
+
+/* Exported types ------------------------------------------------------------*/
+
+/*
+ * List of all errors tracked by the Thread application
+ * running on M4. Some of these errors may be fatal
+ * or just warnings
+ */
+typedef enum {
+ ERR_REC_MULTI_MSG_FROM_M0,
+ ERR_ZIGBE_CMD_TO_M0,
+ ERR_ZIGBEE_CHECK_WIRELESS
+} ErrAppliIdEnum_t;
+
+/* Exported constants --------------------------------------------------------*/
+
+/* Exported functions ------------------------------------------------------- */
+void APP_ZIGBEE_Init(void);
+void APP_ZIGBEE_Error(uint32_t ErrId, uint32_t ErrCode);
+void APP_ZIGBEE_RegisterCmdBuffer(TL_CmdPacket_t *p_buffer);
+void APP_ZIGBEE_ProcessMsgM0ToM4(void);
+void APP_ZIGBEE_TL_INIT(void);
+void Pre_ZigbeeCmdProcessing(void);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* APP_ZIGBEE_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/STM32_WPAN/App/app_zigbee_demo.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/STM32_WPAN/App/app_zigbee_demo.c
new file mode 100644
index 000000000..a969fca1c
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/STM32_WPAN/App/app_zigbee_demo.c
@@ -0,0 +1,393 @@
+/**
+ ******************************************************************************
+ * File Name : App/app_zigbee.c
+ * Description : Zigbee Application.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include <assert.h>
+#include "app_common.h"
+#include "app_entry.h"
+#include "dbg_trace.h"
+#include "app_zigbee.h"
+#include "shci.h"
+#include "stm_logging.h"
+#include "app_conf.h"
+#include "stm32wbxx_core_interface_def.h"
+#include "zigbee_types.h"
+#include "zigbee_interface.h"
+#include "stm32_seq.h"
+#include "zcl/zcl.h"
+#include "zcl/zcl.onoff.h"
+#include "zcl/zcl.identify.h"
+
+/* Spec is -40 dBm, but use -60 for ease of testing, and until we get real RSSI from STMAC. */
+#define APP_TOUCHLINK_MIN_RSSI -60
+
+/* Private defines -----------------------------------------------------------*/
+#define APP_ZIGBEE_STARTUP_FAIL_DELAY 3000U
+
+#define SW1_ENDPOINT 17
+#define SW2_ENDPOINT 18
+#define TOUCHLINK_ENDPOINT 200 /* arbitrary */
+
+#define SW1_GROUP_ADDR 0x0001
+#define SW2_GROUP_ADDR 0x0002
+
+#define SW1_FLAG 0x01
+#define SW2_FLAG 0x02
+
+#define SW1_LED LED_RED
+#define SW2_LED LED_GREEN
+#define SW3_LED LED_BLUE
+
+#define CHANNEL 15
+/* Private function prototypes -----------------------------------------------*/
+
+/* Private variables -----------------------------------------------*/
+struct zigbee_demo_info {
+ bool has_init;
+ struct ZigBeeT *zb;
+ enum ZbStartType startupControl;
+ enum ZbStatusCodeT join_status;
+ uint32_t join_delay;
+ bool init_after_join;
+
+ struct ZbZclClusterT *onoff_server_1;
+ struct ZbZclClusterT *onoff_client_1;
+ struct ZbZclClusterT *identify_server_1;
+
+ struct ZbZclClusterT *onoff_server_2;
+ struct ZbZclClusterT *onoff_client_2;
+
+ uint8_t sw_flags;
+};
+
+static struct zigbee_demo_info zigbee_demo_info;
+
+static enum ZclStatusCodeT onoff_server_attr_cb(struct ZbZclClusterT *clusterPtr, struct ZbZclAttrCbInfoT *cb);
+
+static const struct ZbZclAttrT onoff_server_attr_list[] = {
+ /* OnOff Server Attributes */
+ {
+ ZCL_ONOFF_ATTR_ONOFF, ZCL_DATATYPE_BOOLEAN,
+ ZCL_ATTR_FLAG_REPORTABLE | ZCL_ATTR_FLAG_PERSISTABLE | ZCL_ATTR_FLAG_DEFAULTABLE | ZCL_ATTR_FLAG_CB_NOTIFY, 0,
+ onoff_server_attr_cb, {0, 0}, {0, 0}
+ },
+};
+
+/* Functions Definition ------------------------------------------------------*/
+
+static enum ZclStatusCodeT onoff_server_attr_cb(struct ZbZclClusterT *clusterPtr, struct ZbZclAttrCbInfoT *cb)
+{
+ uint8_t endpoint;
+ uint8_t attrVal;
+
+ endpoint = ZbZclClusterGetEndpoint(clusterPtr);
+ switch (cb->info->attributeId) {
+ case ZCL_ONOFF_ATTR_ONOFF:
+ if (endpoint == SW1_ENDPOINT) {
+ if (ZbZclAttrRead(zigbee_demo_info.onoff_server_1, ZCL_ONOFF_ATTR_ONOFF, NULL, &attrVal, sizeof(attrVal), false) == ZCL_STATUS_SUCCESS) {
+ if (attrVal != 0) {
+ APP_DBG("SW1_LED ON");
+ BSP_LED_On(SW1_LED);
+ }
+ else {
+ APP_DBG("SW1_LED OFF");
+ BSP_LED_Off(SW1_LED);
+ }
+ }
+ }
+ else if (endpoint == SW2_ENDPOINT) {
+ if (ZbZclAttrRead(zigbee_demo_info.onoff_server_2, ZCL_ONOFF_ATTR_ONOFF, NULL, &attrVal, sizeof(attrVal), false) == ZCL_STATUS_SUCCESS) {
+ if (attrVal != 0) {
+ APP_DBG("SW2_LED ON");
+ BSP_LED_On(SW2_LED);
+ }
+ else {
+ APP_DBG("SW2_LED OFF");
+ BSP_LED_Off(SW2_LED);
+ }
+ }
+ }
+ break;
+
+ default:
+ break;
+ } /* switch */
+ return ZCL_STATUS_SUCCESS;
+} /* onoff_server_attr_notify */
+
+static void config_endpoints(void)
+{
+ ZbApsmeAddEndpointReqT req;
+ ZbApsmeAddEndpointConfT conf;
+
+ memset(&req, 0, sizeof(req));
+ req.profileId = ZCL_PROFILE_HOME_AUTOMATION;
+ req.deviceId = ZCL_DEVICE_ONOFF_SWITCH;
+
+ /* Endpoint: SW1_ENDPOINT */
+ req.endpoint = SW1_ENDPOINT;
+ ZbZclAddEndpoint(zigbee_demo_info.zb, &req, &conf);
+ assert(conf.status == ZB_STATUS_SUCCESS);
+ /* OnOff Server */
+ zigbee_demo_info.onoff_server_1 = ZbZclOnOffServerAlloc(zigbee_demo_info.zb, SW1_ENDPOINT, NULL);
+ assert(zigbee_demo_info.onoff_server_1 != NULL);
+ ZbZclAttrAppendList(zigbee_demo_info.onoff_server_1, onoff_server_attr_list, ZCL_ATTR_LIST_LEN(onoff_server_attr_list));
+ ZbZclClusterEndpointRegister(zigbee_demo_info.onoff_server_1);
+ /* OnOff Client */
+ zigbee_demo_info.onoff_client_1 = ZbZclOnOffClientAlloc(zigbee_demo_info.zb, SW1_ENDPOINT);
+ assert(zigbee_demo_info.onoff_client_1 != NULL);
+ ZbZclClusterEndpointRegister(zigbee_demo_info.onoff_client_1);
+ /* Identify Server for Touchlink */
+ zigbee_demo_info.identify_server_1 = ZbZclIdentifyServerAlloc(zigbee_demo_info.zb, SW1_ENDPOINT, NULL);
+ assert(zigbee_demo_info.identify_server_1 != NULL);
+
+ /* Endpoint: SW2_ENDPOINT */
+ req.endpoint = SW2_ENDPOINT;
+ ZbZclAddEndpoint(zigbee_demo_info.zb, &req, &conf);
+ assert(conf.status == ZB_STATUS_SUCCESS);
+ /* OnOff Server */
+ zigbee_demo_info.onoff_server_2 = ZbZclOnOffServerAlloc(zigbee_demo_info.zb, SW2_ENDPOINT, NULL);
+ assert(zigbee_demo_info.onoff_server_2 != NULL);
+ ZbZclAttrAppendList(zigbee_demo_info.onoff_server_2, onoff_server_attr_list, ZCL_ATTR_LIST_LEN(onoff_server_attr_list));
+ ZbZclClusterEndpointRegister(zigbee_demo_info.onoff_server_2);
+ /* OnOff Client */
+ zigbee_demo_info.onoff_client_2 = ZbZclOnOffClientAlloc(zigbee_demo_info.zb, SW2_ENDPOINT);
+ assert(zigbee_demo_info.onoff_client_2 != NULL);
+ ZbZclClusterEndpointRegister(zigbee_demo_info.onoff_client_2);
+} /* config_endpoints */
+
+static void config_group_addr(void)
+{
+ ZbApsmeAddGroupReqT req;
+ ZbApsmeAddGroupConfT conf;
+
+ memset(&req, 0, sizeof(req));
+ req.endpt = SW1_ENDPOINT;
+ req.groupAddr = SW1_GROUP_ADDR;
+ ZbApsmeAddGroupReq(zigbee_demo_info.zb, &req, &conf);
+
+ req.endpt = SW2_ENDPOINT;
+ req.groupAddr = SW2_GROUP_ADDR;
+ ZbApsmeAddGroupReq(zigbee_demo_info.zb, &req, &conf);
+} /* config_group_addr */
+
+/**
+ * @brief Zigbee Demo Task
+ * @param None
+ * @retval None
+ */
+void APP_ZIGBEE_Demo(void)
+{
+ /*
+ * Handle Initialization
+ */
+ if (!zigbee_demo_info.has_init) {
+ zigbee_demo_info.sw_flags = 0;
+
+ zigbee_demo_info.zb = ZbInit(0U, NULL, NULL);
+ assert(zigbee_demo_info.zb != NULL);
+
+ /* Create the endpoint and cluster(s) */
+ config_endpoints();
+
+ BSP_LED_Off(SW1_LED);
+ BSP_LED_Off(SW2_LED);
+ BSP_LED_Off(SW3_LED);
+
+ /* Configure the joining parameters */
+ zigbee_demo_info.join_status = 0x01; /* init to error status */
+ zigbee_demo_info.join_delay = HAL_GetTick(); /* now */
+ zigbee_demo_info.startupControl = ZbStartTypeJoin;
+
+ /* Initialization Complete */
+ zigbee_demo_info.has_init = true;
+ }
+
+ /*
+ * Handle Network Joining / Forming
+ */
+ if ((zigbee_demo_info.join_status != ZB_STATUS_SUCCESS) && (HAL_GetTick() >= zigbee_demo_info.join_delay)) {
+ struct ZbStartupT config;
+ enum ZbStatusCodeT status;
+
+ /* Configure Zigbee Logging (only need to do this once, but this is a good place to put it) */
+ ZbSetLogging(zigbee_demo_info.zb, ZB_LOG_MASK_LEVEL_5, NULL);
+
+ /* Attempt to join a zigbee network */
+ ZbStartupConfigGetProDefaults(&config);
+
+ /* Set the centralized network */
+ APP_DBG("Network config : APP_STARTUP_CENTRALIZED_COORD");
+ config.startupControl = ZbStartTypeForm;
+
+ /* Using the default HA preconfigured Link Key */
+ memcpy(config.security.preconfiguredLinkKey, sec_key_ha, ZB_SEC_KEYSIZE);
+
+ config.channelList.count = 1;
+ config.channelList.list[0].page = 0;
+ config.channelList.list[0].channelMask = 1 << CHANNEL; /*Channel in use */
+
+ /* Using ZbStartupWait (blocking) here instead of ZbStartup, in order to demonstrate how to do
+ * a blocking call on the M4. */
+ status = ZbStartupWait(zigbee_demo_info.zb, &config);
+
+ APP_DBG("ZbStartup Callback (status = 0x%02x)", status);
+ zigbee_demo_info.join_status = status;
+
+ if (status == ZB_STATUS_SUCCESS) {
+ zigbee_demo_info.join_delay = 0U;
+ zigbee_demo_info.init_after_join = true;
+ BSP_LED_On(SW3_LED);
+ }
+ else {
+
+ APP_DBG("Startup failed, attempting again after a short delay.");
+ zigbee_demo_info.join_delay = HAL_GetTick() + APP_ZIGBEE_STARTUP_FAIL_DELAY;
+ }
+ }
+
+ /*
+ * Handle Application (Switches and LEDs)
+ */
+ if (zigbee_demo_info.join_status == ZB_STATUS_SUCCESS) {
+ /* Check if we just joined */
+ if (zigbee_demo_info.init_after_join) {
+ zigbee_demo_info.init_after_join = false;
+
+ /* Assign ourselves to the group addresses */
+ config_group_addr();
+
+ /* Since we're using group addressing (broadcast), shorten the broadcast timeout */
+ uint32_t bcast_timeout = 3;
+ ZbNwkSet(zigbee_demo_info.zb, ZB_NWK_NIB_ID_NetworkBroadcastDeliveryTime, &bcast_timeout, sizeof(bcast_timeout));
+ }
+
+ /* Check for switch flags */
+ if (zigbee_demo_info.sw_flags != 0) {
+ struct ZbApsAddrT dst;
+
+ memset(&dst, 0, sizeof(dst));
+ dst.mode = ZB_APSDE_ADDRMODE_GROUP;
+
+ if ((zigbee_demo_info.sw_flags & SW1_FLAG) != 0) {
+ dst.endpoint = SW1_ENDPOINT;
+ dst.nwkAddr = SW1_GROUP_ADDR;
+
+ APP_DBG("SW1 PUSHED (SENDING TOGGLE TO GROUP 0x0001)");
+ if (ZbZclOnOffClientToggleReq(zigbee_demo_info.onoff_client_1, &dst, NULL, NULL) != ZB_STATUS_SUCCESS) {
+ APP_DBG("Error, ZbZclOnOffClientToggleReq failed (SW1_ENDPOINT)");
+ }
+ /* We will get a loopback message because we belong to the same APS Group,
+ * causing our own local LED to toggle. */
+ }
+
+ if ((zigbee_demo_info.sw_flags & SW2_FLAG) != 0) {
+ dst.endpoint = SW2_ENDPOINT;
+ dst.nwkAddr = SW2_GROUP_ADDR;
+
+ APP_DBG("SW2 PUSHED (SENDING TOGGLE TO GROUP 0x0002)");
+ if (ZbZclOnOffClientToggleReq(zigbee_demo_info.onoff_client_2, &dst, NULL, NULL) != ZB_STATUS_SUCCESS) {
+ APP_DBG("Error, ZbZclOnOffClientToggleReq failed (SW2_ENDPOINT)");
+ }
+ /* We will get a loopback message because we belong to the same APS Group,
+ * causing our own local LED to toggle. */
+ }
+
+ /* Clear the flags */
+ zigbee_demo_info.sw_flags = 0;
+ }
+
+ }
+
+ UTIL_SEQ_SetTask(1U << CFG_TASK_ZIGBEE_APP, CFG_SCH_PRIO_0);
+} /* APP_ZIGBEE_Demo */
+
+/*************************************************************
+ * ZbStartupWait Blocking Call
+ *************************************************************/
+
+struct ZbStartupWaitInfo {
+ bool active;
+ enum ZbStatusCodeT status;
+};
+
+static void ZbStartupWaitCb(enum ZbStatusCodeT status, void *cb_arg)
+{
+ struct ZbStartupWaitInfo *info = cb_arg;
+
+ info->status = status;
+ info->active = false;
+} /* ZbStartupWaitCb */
+
+enum ZbStatusCodeT ZbStartupWait(struct ZigBeeT *zb, struct ZbStartupT *config)
+{
+ struct ZbStartupWaitInfo *info;
+ enum ZbStatusCodeT status;
+
+ info = malloc(sizeof(struct ZbStartupWaitInfo));
+ if (info == NULL) {
+ return ZB_STATUS_ALLOC_FAIL;
+ }
+ memset(info, 0, sizeof(struct ZbStartupWaitInfo));
+
+ info->active = true;
+ status = ZbStartup(zb, config, ZbStartupWaitCb, info);
+ if (status != ZB_STATUS_SUCCESS) {
+ info->active = false;
+ return status;
+ }
+ while (info->active) {
+ UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
+ }
+ status = info->status;
+ free(info);
+ return status;
+} /* ZbStartupWait */
+
+/*************************************************************
+ * External Interrupt Handler
+ *************************************************************/
+
+/**
+ * @brief This function manage the Push button action
+ * @param GPIO_Pin : GPIO pin which has been activated
+ * @retval None
+ */
+void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
+{
+ switch (GPIO_Pin) {
+ case BUTTON_SW1_PIN:
+ zigbee_demo_info.sw_flags |= SW1_FLAG;
+ break;
+
+ case BUTTON_SW2_PIN:
+ zigbee_demo_info.sw_flags |= SW2_FLAG;
+ break;
+
+ case BUTTON_SW3_PIN:
+ APP_DBG("SW3 PUSHED (LOCAL LEDS OFF)");
+ ZbZclAttrIntegerWrite(zigbee_demo_info.onoff_server_1, ZCL_ONOFF_ATTR_ONOFF, 0);
+ ZbZclAttrIntegerWrite(zigbee_demo_info.onoff_server_2, ZCL_ONOFF_ATTR_ONOFF, 0);
+ break;
+
+ default:
+ break;
+ }
+} /* HAL_GPIO_EXTI_Callback */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/STM32_WPAN/App/app_zigbee_demo_complete.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/STM32_WPAN/App/app_zigbee_demo_complete.c
new file mode 100644
index 000000000..6b4920d0e
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/STM32_WPAN/App/app_zigbee_demo_complete.c
@@ -0,0 +1,506 @@
+/**
+ ******************************************************************************
+ * File Name : App/app_zigbee.c
+ * Description : Zigbee Application.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include <assert.h>
+#include "app_common.h"
+#include "app_entry.h"
+#include "dbg_trace.h"
+#include "app_zigbee.h"
+#include "shci.h"
+#include "stm_logging.h"
+#include "app_conf.h"
+#include "stm32wbxx_core_interface_def.h"
+#include "zigbee_types.h"
+#include "zigbee_interface.h"
+#include "stm32_seq.h"
+#include "zcl/zcl.h"
+#include "zcl/zcl.onoff.h"
+#include "zcl/zcl.identify.h"
+
+/* Startup Configuration -----------------------------------------------------*/
+#define APP_STARTUP_DISTRIB 0 /* Distributed Netork*/
+#define APP_STARTUP_TOUCHLINK_TARGET 1 /* Touchlink Target*/
+#define APP_STARTUP_TOUCHLINK_INITIATOR 2 /* Touchlink Initiator */
+#define APP_STARTUP_CENTRALIZED_COORD 3 /* Centralized Network Coordinator */
+#define APP_STARTUP_CENTRALIZED_ROUTER 4 /* Centralized Network Router */
+
+/* Choose the startup type you want from the options above */
+#define APP_STARTUP_TYPE APP_STARTUP_CENTRALIZED_COORD
+
+/* Spec is -40 dBm, but use -60 for ease of testing, and until we get real RSSI from STMAC. */
+#define APP_TOUCHLINK_MIN_RSSI -60
+
+/* Private defines -----------------------------------------------------------*/
+#define APP_ZIGBEE_STARTUP_FAIL_DELAY 3000U
+
+#define SW1_ENDPOINT 17
+#define SW2_ENDPOINT 18
+#define TOUCHLINK_ENDPOINT 200 /* arbitrary */
+
+#define SW1_GROUP_ADDR 0x0001
+#define SW2_GROUP_ADDR 0x0002
+
+#define SW1_FLAG 0x01
+#define SW2_FLAG 0x02
+
+#define SW1_LED LED_RED
+#define SW2_LED LED_GREEN
+#define SW3_LED LED_BLUE
+
+#define CHANNEL 16
+/* Private function prototypes -----------------------------------------------*/
+
+/* Private variables -----------------------------------------------*/
+struct zigbee_demo_info {
+ bool has_init;
+ struct ZigBeeT *zb;
+ enum ZbStartType startupControl;
+ enum ZbStatusCodeT join_status;
+ uint32_t join_delay;
+ bool init_after_join;
+
+ struct ZbZclClusterT *onoff_server_1;
+ struct ZbZclClusterT *onoff_client_1;
+ struct ZbZclClusterT *identify_server_1;
+
+ struct ZbZclClusterT *onoff_server_2;
+ struct ZbZclClusterT *onoff_client_2;
+
+ uint8_t sw_flags;
+};
+
+static struct zigbee_demo_info zigbee_demo_info;
+
+static enum ZclStatusCodeT onoff_server_attr_cb(struct ZbZclClusterT *clusterPtr, struct ZbZclAttrCbInfoT *cb);
+
+static const struct ZbZclAttrT onoff_server_attr_list[] = {
+ /* OnOff Server Attributes */
+ {
+ ZCL_ONOFF_ATTR_ONOFF, ZCL_DATATYPE_BOOLEAN,
+ ZCL_ATTR_FLAG_REPORTABLE | ZCL_ATTR_FLAG_PERSISTABLE | ZCL_ATTR_FLAG_DEFAULTABLE | ZCL_ATTR_FLAG_CB_NOTIFY, 0,
+ onoff_server_attr_cb, {0, 0}, {0, 0}
+ },
+};
+
+/* Functions Definition ------------------------------------------------------*/
+
+static enum ZclStatusCodeT onoff_server_attr_cb(struct ZbZclClusterT *clusterPtr, struct ZbZclAttrCbInfoT *cb)
+{
+ uint8_t endpoint;
+ uint8_t attrVal;
+
+ endpoint = ZbZclClusterGetEndpoint(clusterPtr);
+ switch (cb->info->attributeId) {
+ case ZCL_ONOFF_ATTR_ONOFF:
+ if (endpoint == SW1_ENDPOINT) {
+ if (ZbZclAttrRead(zigbee_demo_info.onoff_server_1, ZCL_ONOFF_ATTR_ONOFF, NULL, &attrVal, sizeof(attrVal), false) == ZCL_STATUS_SUCCESS) {
+ if (attrVal != 0) {
+ APP_DBG("SW1_LED ON");
+ BSP_LED_On(SW1_LED);
+ }
+ else {
+ APP_DBG("SW1_LED OFF");
+ BSP_LED_Off(SW1_LED);
+ }
+ }
+ }
+ else if (endpoint == SW2_ENDPOINT) {
+ if (ZbZclAttrRead(zigbee_demo_info.onoff_server_2, ZCL_ONOFF_ATTR_ONOFF, NULL, &attrVal, sizeof(attrVal), false) == ZCL_STATUS_SUCCESS) {
+ if (attrVal != 0) {
+ APP_DBG("SW2_LED ON");
+ BSP_LED_On(SW2_LED);
+ }
+ else {
+ APP_DBG("SW2_LED OFF");
+ BSP_LED_Off(SW2_LED);
+ }
+ }
+ }
+ break;
+
+ default:
+ break;
+ } /* switch */
+ return ZCL_STATUS_SUCCESS;
+} /* onoff_server_attr_notify */
+
+static void config_endpoints(void)
+{
+ ZbApsmeAddEndpointReqT req;
+ ZbApsmeAddEndpointConfT conf;
+
+ memset(&req, 0, sizeof(req));
+ req.profileId = ZCL_PROFILE_HOME_AUTOMATION;
+ req.deviceId = ZCL_DEVICE_ONOFF_SWITCH;
+
+ /* Endpoint: SW1_ENDPOINT */
+ req.endpoint = SW1_ENDPOINT;
+ ZbZclAddEndpoint(zigbee_demo_info.zb, &req, &conf);
+ assert(conf.status == ZB_STATUS_SUCCESS);
+ /* OnOff Server */
+ zigbee_demo_info.onoff_server_1 = ZbZclOnOffServerAlloc(zigbee_demo_info.zb, SW1_ENDPOINT, NULL);
+ assert(zigbee_demo_info.onoff_server_1 != NULL);
+ ZbZclAttrAppendList(zigbee_demo_info.onoff_server_1, onoff_server_attr_list, ZCL_ATTR_LIST_LEN(onoff_server_attr_list));
+ ZbZclClusterEndpointRegister(zigbee_demo_info.onoff_server_1);
+ /* OnOff Client */
+ zigbee_demo_info.onoff_client_1 = ZbZclOnOffClientAlloc(zigbee_demo_info.zb, SW1_ENDPOINT);
+ assert(zigbee_demo_info.onoff_client_1 != NULL);
+ ZbZclClusterEndpointRegister(zigbee_demo_info.onoff_client_1);
+ /* Identify Server for Touchlink */
+ zigbee_demo_info.identify_server_1 = ZbZclIdentifyServerAlloc(zigbee_demo_info.zb, SW1_ENDPOINT, NULL);
+ assert(zigbee_demo_info.identify_server_1 != NULL);
+
+ /* Endpoint: SW2_ENDPOINT */
+ req.endpoint = SW2_ENDPOINT;
+ ZbZclAddEndpoint(zigbee_demo_info.zb, &req, &conf);
+ assert(conf.status == ZB_STATUS_SUCCESS);
+ /* OnOff Server */
+ zigbee_demo_info.onoff_server_2 = ZbZclOnOffServerAlloc(zigbee_demo_info.zb, SW2_ENDPOINT, NULL);
+ assert(zigbee_demo_info.onoff_server_2 != NULL);
+ ZbZclAttrAppendList(zigbee_demo_info.onoff_server_2, onoff_server_attr_list, ZCL_ATTR_LIST_LEN(onoff_server_attr_list));
+ ZbZclClusterEndpointRegister(zigbee_demo_info.onoff_server_2);
+ /* OnOff Client */
+ zigbee_demo_info.onoff_client_2 = ZbZclOnOffClientAlloc(zigbee_demo_info.zb, SW2_ENDPOINT);
+ assert(zigbee_demo_info.onoff_client_2 != NULL);
+ ZbZclClusterEndpointRegister(zigbee_demo_info.onoff_client_2);
+} /* config_endpoints */
+
+static void config_group_addr(void)
+{
+ ZbApsmeAddGroupReqT req;
+ ZbApsmeAddGroupConfT conf;
+
+ memset(&req, 0, sizeof(req));
+ req.endpt = SW1_ENDPOINT;
+ req.groupAddr = SW1_GROUP_ADDR;
+ ZbApsmeAddGroupReq(zigbee_demo_info.zb, &req, &conf);
+
+ req.endpt = SW2_ENDPOINT;
+ req.groupAddr = SW2_GROUP_ADDR;
+ ZbApsmeAddGroupReq(zigbee_demo_info.zb, &req, &conf);
+} /* config_group_addr */
+
+/**
+ * @brief Zigbee Demo Task
+ * @param None
+ * @retval None
+ */
+void APP_ZIGBEE_Demo(void)
+{
+ /*
+ * Handle Initialization
+ */
+ if (!zigbee_demo_info.has_init) {
+ zigbee_demo_info.sw_flags = 0;
+
+ zigbee_demo_info.zb = ZbInit(0U, NULL, NULL);
+ assert(zigbee_demo_info.zb != NULL);
+
+ /* Create the endpoint and cluster(s) */
+ config_endpoints();
+
+ BSP_LED_Off(SW1_LED);
+ BSP_LED_Off(SW2_LED);
+ BSP_LED_Off(SW3_LED);
+
+ /* Configure the joining parameters */
+ zigbee_demo_info.join_status = 0x01; /* init to error status */
+ zigbee_demo_info.join_delay = HAL_GetTick(); /* now */
+ zigbee_demo_info.startupControl = ZbStartTypeJoin;
+
+ /* Initialization Complete */
+ zigbee_demo_info.has_init = true;
+ }
+
+ /*
+ * Handle Network Joining / Forming
+ */
+ if ((zigbee_demo_info.join_status != ZB_STATUS_SUCCESS) && (HAL_GetTick() >= zigbee_demo_info.join_delay)) {
+ struct ZbStartupT config;
+ enum ZbStatusCodeT status;
+
+ /* Configure Zigbee Logging (only need to do this once, but this is a good place to put it) */
+ ZbSetLogging(zigbee_demo_info.zb, ZB_LOG_MASK_LEVEL_5, NULL);
+
+ /* Attempt to join a zigbee network */
+ ZbStartupConfigGetProDefaults(&config);
+
+#if (APP_STARTUP_TYPE == APP_STARTUP_DISTRIB)
+ APP_DBG("Network config : APP_STARTUP_DISTRIB");
+ /* Set the TC address to be distributed. */
+ config.security.trustCenterAddress = ZB_DISTRIBUTED_TC_ADDR;
+
+ /* Using the Uncertified Distributed Global Key (d0:d1:d2:d3:d4:d5:d6:d7:d8:d9:da:db:dc:dd:de:df) */
+ memcpy(config.security.distributedGlobalKey, sec_key_distrib_uncert, ZB_SEC_KEYSIZE);
+
+ config.startupControl = zigbee_demo_info.startupControl;
+
+ config.channelList.count = 1;
+ config.channelList.list[0].page = 0;
+ config.channelList.list[0].channelMask = 1 << CHANNEL; /* Channel in use*/
+
+#elif (APP_STARTUP_TYPE == APP_STARTUP_TOUCHLINK_TARGET)
+ APP_DBG("Network config : APP_STARTUP_TOUCHLINK_TARGET");
+ config.startupControl = ZbStartTypeJoin; /* Ignored */
+
+ /* Using the Uncertified Distributed Global Key (d0:d1:d2:d3:d4:d5:d6:d7:d8:d9:da:db:dc:dd:de:df).
+ * This key can be used as an APS Link Key between Touchlink devices. */
+ memcpy(config.security.distributedGlobalKey, sec_key_distrib_uncert, ZB_SEC_KEYSIZE);
+
+ /* Use the Touchlink Certification Key (c0:c1:c2:c3:c4:c5:c6:c7:c8:c9:ca:cb:cc:cd:ce:cf).
+ * This key is "mashed" with the Touchlink session data to generate the Network Key */
+ ZbBdbSet(zigbee_demo_info.zb, ZB_BDB_TLKey, sec_key_touchlink_cert, ZB_SEC_KEYSIZE);
+ {
+ /* Set the "Key Encryption Algorithm" to Certification */
+ enum ZbBdbTouchlinkKeyIndexT keyIdx = TOUCHLINK_KEY_INDEX_CERTIFICATION;
+ ZbBdbSet(zigbee_demo_info.zb, ZB_BDB_TLKeyIndex, &keyIdx, sizeof(keyIdx));
+ }
+
+#ifdef APP_TOUCHLINK_MIN_RSSI
+ /* For debugging, set the Touchlink RSSI threshold very low */
+ {
+ int8_t val8 = APP_TOUCHLINK_MIN_RSSI;
+ status = ZbBdbSet(zigbee_demo_info.zb, ZB_BDB_TLRssiMin, &val8, sizeof(val8));
+ }
+#endif
+
+ /* Touchlink uses the BDB Primary and Secondary channel masks, which we'll leave as defaults. */
+
+ /* Configure the startup to use Touchlink */
+ config.bdbCommissioningMode |= BDB_COMMISSION_MODE_TOUCHLINK;
+ config.touchlink.tl_endpoint = TOUCHLINK_ENDPOINT;
+ config.touchlink.bind_endpoint = SW1_ENDPOINT;
+ config.touchlink.flags = ZCL_TL_FLAGS_IS_TARGET;
+ config.touchlink.zb_info = ZCL_TL_ZBINFO_TYPE_ROUTER;
+ config.touchlink.zb_info |= ZCL_TL_ZBINFO_RX_ON_IDLE;
+
+#elif (APP_STARTUP_TYPE == APP_STARTUP_TOUCHLINK_INITIATOR)
+ APP_DBG("Network config : APP_STARTUP_TOUCHLINK_INITIATOR");
+ config.startupControl = ZbStartTypeJoin; /* Ignored */
+
+ /* Using the Uncertified Distributed Global Key (d0:d1:d2:d3:d4:d5:d6:d7:d8:d9:da:db:dc:dd:de:df).
+ * This key can be used as an APS Link Key between Touchlink devices. */
+ memcpy(config.security.distributedGlobalKey, sec_key_distrib_uncert, ZB_SEC_KEYSIZE);
+
+ /* Use the Touchlink Certification Key (c0:c1:c2:c3:c4:c5:c6:c7:c8:c9:ca:cb:cc:cd:ce:cf).
+ * This key is "mashed" with the Touchlink session data to generate the Network Key */
+ ZbBdbSet(zigbee_demo_info.zb, ZB_BDB_TLKey, sec_key_touchlink_cert, ZB_SEC_KEYSIZE);
+ {
+ /* Set the "Key Encryption Algorithm" to Certification */
+ enum ZbBdbTouchlinkKeyIndexT keyIdx = TOUCHLINK_KEY_INDEX_CERTIFICATION;
+ ZbBdbSet(zigbee_demo_info.zb, ZB_BDB_TLKeyIndex, &keyIdx, sizeof(keyIdx));
+ }
+
+#ifdef APP_TOUCHLINK_MIN_RSSI
+ /* For debugging, set the Touchlink RSSI threshold very low */
+ {
+ int8_t val8 = APP_TOUCHLINK_MIN_RSSI;
+ status = ZbBdbSet(zigbee_demo_info.zb, ZB_BDB_TLRssiMin, &val8, sizeof(val8));
+ }
+#endif
+
+ /* Touchlink uses the BDB Primary and Secondary channel masks, which we'll leave as defaults. */
+
+ /* Configure the startup to use Touchlink */
+ config.bdbCommissioningMode |= BDB_COMMISSION_MODE_TOUCHLINK;
+ config.touchlink.tl_endpoint = TOUCHLINK_ENDPOINT;
+ config.touchlink.bind_endpoint = SW1_ENDPOINT;
+ config.touchlink.flags = 0x00;
+ config.touchlink.zb_info = ZCL_TL_ZBINFO_TYPE_ROUTER;
+ config.touchlink.zb_info |= ZCL_TL_ZBINFO_RX_ON_IDLE;
+
+#elif (APP_STARTUP_TYPE == APP_STARTUP_CENTRALIZED_COORD)
+ APP_DBG("Network config : APP_STARTUP_CENTRALIZED_COORD");
+ config.startupControl = ZbStartTypeForm;
+
+ /* Using the default HA preconfigured Link Key */
+ memcpy(config.security.preconfiguredLinkKey, sec_key_ha, ZB_SEC_KEYSIZE);
+
+ config.channelList.count = 1;
+ config.channelList.list[0].page = 0;
+ config.channelList.list[0].channelMask = 1 << CHANNEL; /*Channel in use */
+
+#elif (APP_STARTUP_TYPE == APP_STARTUP_CENTRALIZED_ROUTER)
+ APP_DBG("Network config : APP_STARTUP_CENTRALIZED_ROUTER");
+ config.startupControl = ZbStartTypeJoin;
+
+ /* Using the default HA preconfigured Link Key */
+ memcpy(config.security.preconfiguredLinkKey, sec_key_ha, ZB_SEC_KEYSIZE);
+
+ config.channelList.count = 1;
+ config.channelList.list[0].page = 0;
+ config.channelList.list[0].channelMask = WPAN_CHANNELMASK_2400MHZ;
+
+#else
+# error "Invalid APP_STARTUP_TYPE"
+#endif
+
+ /* Using ZbStartupWait (blocking) here instead of ZbStartup, in order to demonstrate how to do
+ * a blocking call on the M4. */
+ status = ZbStartupWait(zigbee_demo_info.zb, &config);
+
+ APP_DBG("ZbStartup Callback (status = 0x%02x)", status);
+ zigbee_demo_info.join_status = status;
+
+ if (status == ZB_STATUS_SUCCESS) {
+ zigbee_demo_info.join_delay = 0U;
+ zigbee_demo_info.init_after_join = true;
+ BSP_LED_On(SW3_LED);
+ }
+ else {
+#if (APP_STARTUP_TYPE == APP_STARTUP_DISTRIB)
+ APP_DBG("Startup failed, attempting to form a network after a short delay.");
+ zigbee_demo_info.startupControl = ZbStartTypeForm;
+#else
+ APP_DBG("Startup failed, attempting again after a short delay.");
+#endif
+ zigbee_demo_info.join_delay = HAL_GetTick() + APP_ZIGBEE_STARTUP_FAIL_DELAY;
+ }
+ }
+
+ /*
+ * Handle Application (Switches and LEDs)
+ */
+ if (zigbee_demo_info.join_status == ZB_STATUS_SUCCESS) {
+ /* Check if we just joined */
+ if (zigbee_demo_info.init_after_join) {
+ zigbee_demo_info.init_after_join = false;
+
+ /* Assign ourselves to the group addresses */
+ config_group_addr();
+
+ /* Since we're using group addressing (broadcast), shorten the broadcast timeout */
+ uint32_t bcast_timeout = 3;
+ ZbNwkSet(zigbee_demo_info.zb, ZB_NWK_NIB_ID_NetworkBroadcastDeliveryTime, &bcast_timeout, sizeof(bcast_timeout));
+ }
+
+ /* Check for switch flags */
+ if (zigbee_demo_info.sw_flags != 0) {
+ struct ZbApsAddrT dst;
+
+ memset(&dst, 0, sizeof(dst));
+ dst.mode = ZB_APSDE_ADDRMODE_GROUP;
+
+ if ((zigbee_demo_info.sw_flags & SW1_FLAG) != 0) {
+ dst.endpoint = SW1_ENDPOINT;
+ dst.nwkAddr = SW1_GROUP_ADDR;
+
+ APP_DBG("SW1 PUSHED (SENDING TOGGLE TO GROUP 0x0001)");
+ if (ZbZclOnOffClientToggleReq(zigbee_demo_info.onoff_client_1, &dst, NULL, NULL) != ZB_STATUS_SUCCESS) {
+ APP_DBG("Error, ZbZclOnOffClientToggleReq failed (SW1_ENDPOINT)");
+ }
+ /* We will get a loopback message because we belong to the same APS Group,
+ * causing our own local LED to toggle. */
+ }
+
+ if ((zigbee_demo_info.sw_flags & SW2_FLAG) != 0) {
+ dst.endpoint = SW2_ENDPOINT;
+ dst.nwkAddr = SW2_GROUP_ADDR;
+
+ APP_DBG("SW2 PUSHED (SENDING TOGGLE TO GROUP 0x0002)");
+ if (ZbZclOnOffClientToggleReq(zigbee_demo_info.onoff_client_2, &dst, NULL, NULL) != ZB_STATUS_SUCCESS) {
+ APP_DBG("Error, ZbZclOnOffClientToggleReq failed (SW2_ENDPOINT)");
+ }
+ /* We will get a loopback message because we belong to the same APS Group,
+ * causing our own local LED to toggle. */
+ }
+
+ /* Clear the flags */
+ zigbee_demo_info.sw_flags = 0;
+ }
+
+ }
+
+ UTIL_SEQ_SetTask(1U << CFG_TASK_ZIGBEE_APP, CFG_SCH_PRIO_0);
+} /* APP_ZIGBEE_Demo */
+
+/*************************************************************
+ * ZbStartupWait Blocking Call
+ *************************************************************/
+
+struct ZbStartupWaitInfo {
+ bool active;
+ enum ZbStatusCodeT status;
+};
+
+static void ZbStartupWaitCb(enum ZbStatusCodeT status, void *cb_arg)
+{
+ struct ZbStartupWaitInfo *info = cb_arg;
+
+ info->status = status;
+ info->active = false;
+} /* ZbStartupWaitCb */
+
+enum ZbStatusCodeT ZbStartupWait(struct ZigBeeT *zb, struct ZbStartupT *config)
+{
+ struct ZbStartupWaitInfo *info;
+ enum ZbStatusCodeT status;
+
+ info = malloc(sizeof(struct ZbStartupWaitInfo));
+ if (info == NULL) {
+ return ZB_STATUS_ALLOC_FAIL;
+ }
+ memset(info, 0, sizeof(struct ZbStartupWaitInfo));
+
+ info->active = true;
+ status = ZbStartup(zb, config, ZbStartupWaitCb, info);
+ if (status != ZB_STATUS_SUCCESS) {
+ info->active = false;
+ return status;
+ }
+ while (info->active) {
+ UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
+ }
+ status = info->status;
+ free(info);
+ return status;
+} /* ZbStartupWait */
+
+/*************************************************************
+ * External Interrupt Handler
+ *************************************************************/
+
+/**
+ * @brief This function manage the Push button action
+ * @param GPIO_Pin : GPIO pin which has been activated
+ * @retval None
+ */
+void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
+{
+ switch (GPIO_Pin) {
+ case BUTTON_SW1_PIN:
+ zigbee_demo_info.sw_flags |= SW1_FLAG;
+ break;
+
+ case BUTTON_SW2_PIN:
+ zigbee_demo_info.sw_flags |= SW2_FLAG;
+ break;
+
+ case BUTTON_SW3_PIN:
+ APP_DBG("SW3 PUSHED (LOCAL LEDS OFF)");
+ ZbZclAttrIntegerWrite(zigbee_demo_info.onoff_server_1, ZCL_ONOFF_ATTR_ONOFF, 0);
+ ZbZclAttrIntegerWrite(zigbee_demo_info.onoff_server_2, ZCL_ONOFF_ATTR_ONOFF, 0);
+ break;
+
+ default:
+ break;
+ }
+} /* HAL_GPIO_EXTI_Callback */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/STM32_WPAN/Target/hw_ipcc.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/STM32_WPAN/Target/hw_ipcc.c
new file mode 100644
index 000000000..ab7f75b9a
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/STM32_WPAN/Target/hw_ipcc.c
@@ -0,0 +1,491 @@
+/**
+ ******************************************************************************
+ * File Name : Target/hw_ipcc.c
+ * Description : Hardware IPCC source file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "mbox_def.h"
+
+/* Global variables ---------------------------------------------------------*/
+/* Private defines -----------------------------------------------------------*/
+#define HW_IPCC_TX_PENDING( channel ) ( !(LL_C1_IPCC_IsActiveFlag_CHx( IPCC, channel )) ) && (((~(IPCC->C1MR)) & (channel << 16U)))
+#define HW_IPCC_RX_PENDING( channel ) (LL_C2_IPCC_IsActiveFlag_CHx( IPCC, channel )) && (((~(IPCC->C1MR)) & (channel << 0U)))
+
+/* Private macros ------------------------------------------------------------*/
+/* Private typedef -----------------------------------------------------------*/
+/* Private variables ---------------------------------------------------------*/
+static void (*FreeBufCb)( void );
+
+/* Private function prototypes -----------------------------------------------*/
+static void HW_IPCC_BLE_EvtHandler( void );
+static void HW_IPCC_BLE_AclDataEvtHandler( void );
+static void HW_IPCC_MM_FreeBufHandler( void );
+static void HW_IPCC_SYS_CmdEvtHandler( void );
+static void HW_IPCC_SYS_EvtHandler( void );
+static void HW_IPCC_TRACES_EvtHandler( void );
+
+#ifdef THREAD_WB
+static void HW_IPCC_OT_CmdEvtHandler( void );
+static void HW_IPCC_THREAD_NotEvtHandler( void );
+static void HW_IPCC_THREAD_CliNotEvtHandler( void );
+#endif
+
+#ifdef MAC_802_15_4_WB
+static void HW_IPCC_MAC_802_15_4_CmdEvtHandler( void );
+static void HW_IPCC_MAC_802_15_4_NotEvtHandler( void );
+#endif
+
+#ifdef ZIGBEE_WB
+static void HW_IPCC_ZIGBEE_CmdEvtHandler( void );
+static void HW_IPCC_ZIGBEE_StackNotifEvtHandler( void );
+
+#endif
+
+/* Public function definition -----------------------------------------------*/
+
+/******************************************************************************
+ * INTERRUPT HANDLER
+ ******************************************************************************/
+void HW_IPCC_Rx_Handler( void )
+{
+ if (HW_IPCC_RX_PENDING( HW_IPCC_SYSTEM_EVENT_CHANNEL ))
+ {
+ HW_IPCC_SYS_EvtHandler();
+ }
+#ifdef MAC_802_15_4_WB
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL ))
+ {
+ HW_IPCC_MAC_802_15_4_NotEvtHandler();
+ }
+#endif /* MAC_802_15_4_WB */
+#ifdef THREAD_WB
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL ))
+ {
+ HW_IPCC_THREAD_NotEvtHandler();
+ }
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL ))
+ {
+ HW_IPCC_THREAD_CliNotEvtHandler();
+ }
+#endif /* MAC_802_15_4_WB */
+#ifdef ZIGBEE_WB
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_ZIGBEE_APPLI_NOTIF_ACK_CHANNEL ))
+ {
+ HW_IPCC_ZIGBEE_StackNotifEvtHandler();
+ }
+#endif /* ZIGBEE_WB */
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_BLE_EVENT_CHANNEL ))
+ {
+ HW_IPCC_BLE_EvtHandler();
+ }
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_TRACES_CHANNEL ))
+ {
+ HW_IPCC_TRACES_EvtHandler();
+ }
+
+ return;
+}
+
+void HW_IPCC_Tx_Handler( void )
+{
+ if (HW_IPCC_TX_PENDING( HW_IPCC_SYSTEM_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_SYS_CmdEvtHandler();
+ }
+#ifdef MAC_802_15_4_WB
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_MAC_802_15_4_CmdEvtHandler();
+ }
+#endif /* MAC_802_15_4_WB */
+#ifdef THREAD_WB
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_OT_CmdEvtHandler();
+ }
+#endif /* THREAD_WB */
+#ifdef ZIGBEE_WB
+ if (HW_IPCC_TX_PENDING( HW_IPCC_ZIGBEE_CMD_APPLI_CHANNEL ))
+ {
+ HW_IPCC_ZIGBEE_CmdEvtHandler();
+ }
+#endif /* ZIGBEE_WB */
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_SYSTEM_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_SYS_CmdEvtHandler();
+ }
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_MM_RELEASE_BUFFER_CHANNEL ))
+ {
+ HW_IPCC_MM_FreeBufHandler();
+ }
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_HCI_ACL_DATA_CHANNEL ))
+ {
+ HW_IPCC_BLE_AclDataEvtHandler();
+ }
+
+ return;
+}
+/******************************************************************************
+ * GENERAL
+ ******************************************************************************/
+void HW_IPCC_Enable( void )
+{
+ /**
+ * In case the SBSFU is implemented, it may have already set the C2BOOT bit to startup the CPU2.
+ * In that case, to keep the mechanism transparent to the user application, it shall call the system command
+ * SHCI_C2_Reinit( ) before jumping to the application.
+ * When the CPU2 receives that command, it waits for its event input to be set to restart the CPU2 firmware.
+ * This is required because once C2BOOT has been set once, a clear/set on C2BOOT has no effect.
+ * When SHCI_C2_Reinit( ) is not called, generating an event to the CPU2 does not have any effect
+ * So, by default, the application shall both set the event flag and set the C2BOOT bit.
+ */
+ __SEV( ); /* Set the internal event flag and send an event to the CPU2 */
+ __WFE( ); /* Clear the internal event flag */
+ LL_PWR_EnableBootC2( );
+
+ return;
+}
+
+void HW_IPCC_Init( void )
+{
+ LL_AHB3_GRP1_EnableClock( LL_AHB3_GRP1_PERIPH_IPCC );
+
+ LL_C1_IPCC_EnableIT_RXO( IPCC );
+ LL_C1_IPCC_EnableIT_TXF( IPCC );
+
+ HAL_NVIC_EnableIRQ(IPCC_C1_RX_IRQn);
+ HAL_NVIC_EnableIRQ(IPCC_C1_TX_IRQn);
+
+ return;
+}
+
+/******************************************************************************
+ * BLE
+ ******************************************************************************/
+void HW_IPCC_BLE_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_BLE_EVENT_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_BLE_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_BLE_CMD_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_BLE_EvtHandler( void )
+{
+ HW_IPCC_BLE_RxEvtNot();
+
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_BLE_EVENT_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_BLE_SendAclData( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_HCI_ACL_DATA_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_HCI_ACL_DATA_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_BLE_AclDataEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_HCI_ACL_DATA_CHANNEL );
+
+ HW_IPCC_BLE_AclDataAckNot();
+
+ return;
+}
+
+__weak void HW_IPCC_BLE_AclDataAckNot( void ){};
+__weak void HW_IPCC_BLE_RxEvtNot( void ){};
+
+/******************************************************************************
+ * SYSTEM
+ ******************************************************************************/
+void HW_IPCC_SYS_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_SYSTEM_EVENT_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_SYS_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_SYSTEM_CMD_RSP_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_SYSTEM_CMD_RSP_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_SYS_CmdEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_SYSTEM_CMD_RSP_CHANNEL );
+
+ HW_IPCC_SYS_CmdEvtNot();
+
+ return;
+}
+
+static void HW_IPCC_SYS_EvtHandler( void )
+{
+ HW_IPCC_SYS_EvtNot();
+
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_SYSTEM_EVENT_CHANNEL );
+
+ return;
+}
+
+__weak void HW_IPCC_SYS_CmdEvtNot( void ){};
+__weak void HW_IPCC_SYS_EvtNot( void ){};
+
+/******************************************************************************
+ * THREAD
+ ******************************************************************************/
+#ifdef THREAD_WB
+void HW_IPCC_THREAD_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_OT_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_CLI_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_THREAD_CLI_CMD_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_THREAD_SendAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_THREAD_CliSendAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_OT_CmdEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+
+ HW_IPCC_OT_CmdEvtNot();
+
+ return;
+}
+
+static void HW_IPCC_THREAD_NotEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_THREAD_EvtNot();
+
+ return;
+}
+
+static void HW_IPCC_THREAD_CliNotEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_THREAD_CliEvtNot();
+
+ return;
+}
+
+__weak void HW_IPCC_OT_CmdEvtNot( void ){};
+__weak void HW_IPCC_CLI_CmdEvtNot( void ){};
+__weak void HW_IPCC_THREAD_EvtNot( void ){};
+
+#endif /* THREAD_WB */
+/******************************************************************************
+ * ZIGBEE
+ ******************************************************************************/
+#ifdef ZIGBEE_WB
+void HW_IPCC_ZIGBEE_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_ZIGBEE_SendAppliCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_ZIGBEE_SendAppliCmdAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_ZIGBEE_CmdEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+
+ HW_IPCC_ZIGBEE_AppliCmdNotification();
+
+ return;
+}
+
+static void HW_IPCC_ZIGBEE_StackNotifEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_ZIGBEE_AppliAsyncEvtNotification();
+
+ return;
+}
+
+
+
+__weak void HW_IPCC_ZIGBEE_AppliCmdNotification( void ){};
+__weak void HW_IPCC_ZIGBEE_AppliAsyncEvtNotification( void ){};
+#endif /* ZIGBEE_WB */
+
+
+/******************************************************************************
+ * MEMORY MANAGER
+ ******************************************************************************/
+void HW_IPCC_MM_SendFreeBuf( void (*cb)( void ) )
+{
+ if ( LL_C1_IPCC_IsActiveFlag_CHx( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL ) )
+ {
+ FreeBufCb = cb;
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+ }
+ else
+ {
+ cb();
+
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+ }
+
+ return;
+}
+
+static void HW_IPCC_MM_FreeBufHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+
+ FreeBufCb();
+
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+
+ return;
+}
+
+/******************************************************************************
+ * TRACES
+ ******************************************************************************/
+void HW_IPCC_TRACES_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_TRACES_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_TRACES_EvtHandler( void )
+{
+ HW_IPCC_TRACES_EvtNot();
+
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_TRACES_CHANNEL );
+
+ return;
+}
+
+__weak void HW_IPCC_TRACES_EvtNot( void ){};
+
+
+/******************************************************************************
+ * MAC 802.15.4
+ ******************************************************************************/
+#ifdef MAC_802_15_4_WB
+void HW_IPCC_MAC_802_15_4_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_MAC_802_15_4_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_MAC_802_15_4_SendAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_MAC_802_15_4_CmdEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL );
+
+ HW_IPCC_MAC_802_15_4_CmdEvtNot();
+
+ return;
+}
+
+static void HW_IPCC_MAC_802_15_4_NotEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_MAC_802_15_4_EvtNot();
+
+ return;
+}
+__weak void HW_IPCC_MAC_802_15_4_CmdEvtNot( void ){};
+__weak void HW_IPCC_MAC_802_15_4_EvtNot( void ){};
+#endif
+
+/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/readme.txt b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/readme.txt
new file mode 100644
index 000000000..d7d49ed76
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Coord/readme.txt
@@ -0,0 +1,138 @@
+/**
+ @page Zigbee_OnOff_Coord application
+
+ @verbatim
+ ******************************************************************************
+ * @file Zigbee/Zigbee_OnOff_Coord/readme.txt
+ * @author MCD Application Team
+ * @brief Description of the Zigbee OnOff Cluster application using a
+ * centralized network. This application concerns only the
+ * coordinator role.
+ ******************************************************************************
+ *
+ * Copyright (c) 2019 STMicroelectronics. All rights reserved.
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ @endverbatim
+
+@par Application Description
+
+How to use OnOff cluster on a Centralized Zigbee network with device acting as coordinator.
+
+The purpose of this application is to show how to create a centralized Zigbee network, and how to communicate
+from one node to another one using the OnOff cluster. Once the Zigbee mesh network is created, the
+user can send requests to the different boards through the push buttons in order to make the LED toggling.
+
+Each device acts as a client and a server at the same time, making the communication between the different
+boards symmetrical (bi-directorial)
+
+
+ Device 1 Device 2
+
+ --------- ---------
+ | | ZbZclOnOffClientToggleReq | |
+ PushB=>|Client | -----------------------------------> |Server | =>LED
+ | | | |
+ | | | |
+ | | ZbZclOnOffClientToggleReq | |
+ LED <= |Server | <------------------------------------|Client |<=PushB
+ | | | |
+ -------- ---------
+
+
+This application requires at minimum two STM32WB55xx nucleo boards, but you can use up four boards.
+
+This application requests having the stm32wb5x_zigbee_full_fw.bin binary flashed on the wireless coprocessor
+and the correct binary flashed on the application processor.
+
+Important note :
+================
+As it is a centralized network, to run this application, you need to have one device acting
+as coordinator and all the others devices acting as routers.
+
+One board must be flashed with the binary generated by this application (Zigbee/Zigbee_OnOff_Coord)
+The other boards must be flashed with the binary generated by the application named (Zigbee/Zigbee_OnOff_Router)
+
+To run the application :
+
+ a) Once the boards have been flashed, eboot the different devices one by one.
+ There must be on board configured in coordinator mode , and all
+ other boards should be configured in router mode.
+
+ b) Wait for a few seconds (around 5 sec), it order to let the zigbee mesh network being created.
+
+ c) At this stage, a Zigbee network is automatically created and it is possible to send OnOffCluster commands
+ in multicast mode by pressing on the SW1 or SW2 push button.
+ Press on SW1 (resp SW2) . You must see the LED1 (resp LED2) toggling on all board connected to this newly created
+ Zigbee network.
+
+
+ ---------- -----------
+ |Device 1 |............|Device 2 |
+ |(Coord.) | |(Router) |
+ ----------- -----------
+ . .
+ . .
+ . .
+ ----------- .
+ |Device 3 |...................
+ |(Router) |
+ -----------
+
+ .
+@par Hardware and Software environment
+
+ - This example runs on STM32WB55xx devices (Nucleo board)
+
+ - This example has been tested with an STMicroelectronics STM32WB55RG_Nucleo
+ board and can be easily tailored to any other supported device
+ and development board.
+
+ - On STM32WB55RG_Nucleo, the jumpers must be configured as described
+ in this section. Starting from the top left position up to the bottom
+ right position, the jumpers on the Board must be set as follows:
+
+ CN11: GND [OFF]
+ JP4: VDDRF [ON]
+ JP6: VC0 [ON]
+ JP2: +3V3 [ON]
+ JP1: USB_STL [ON] All others [OFF]
+ CN12: GND [OFF]
+ CN7: <All> [OFF]
+ JP3: VDD_MCU [ON]
+ JP5: GND [OFF] All others [ON]
+ CN10: <All> [OFF]
+
+
+@par How to use it ?
+
+=> Loading of the stm32wb5x_zigbee_full_fw.bin binary
+
+ This application requests having the stm32wb5x_zigbee_full_fw.bin binary flashed on the Wireless Coprocessor.
+ If it is not the case, you need to use STM32CubeProgrammer to load the appropriate binary.
+ All available binaries are located under /Projects/STM32_Copro_Wireless_Binaries directory.
+ Refer to UM2237 to learn how to use/install STM32CubeProgrammer.
+ Refer to /Projects/STM32_Copro_Wireless_Binaries/ReleaseNote.html for the detailed procedure to change the
+ Wireless Coprocessor binary.
+
+=> Getting traces
+ To get the traces you need to connect your Board to the Hyperterminal (through the STLink Virtual COM Port).
+ The UART must be configured as follows:
+
+ - BaudRate = 115200 baud
+ - Word Length = 8 Bits
+ - Stop Bit = 1 bit
+ - Parity = none
+ - Flow control = none
+
+=> Running the application
+
+ Refer to the Application description at the beginning of this readme.txt
+
+ * <h3><center>&copy; COPYRIGHT STMicroelectronics</center></h3>
+
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/app_common.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/app_common.h
new file mode 100644
index 000000000..4defc5d7a
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/app_common.h
@@ -0,0 +1,114 @@
+/**
+ ******************************************************************************
+ * File Name : app_common.h
+ * Description : App Common application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_COMMON_H
+#define APP_COMMON_H
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+#include <stdint.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+
+#include "app_conf.h"
+
+ /* -------------------------------- *
+ * Basic definitions *
+ * -------------------------------- */
+
+#undef NULL
+#define NULL 0
+
+#undef FALSE
+#define FALSE 0
+
+#undef TRUE
+#define TRUE (!0)
+
+ /* -------------------------------- *
+ * Critical Section definition *
+ * -------------------------------- */
+#define BACKUP_PRIMASK() uint32_t primask_bit= __get_PRIMASK()
+#define DISABLE_IRQ() __disable_irq()
+#define RESTORE_PRIMASK() __set_PRIMASK(primask_bit)
+
+ /* -------------------------------- *
+ * Macro delimiters *
+ * -------------------------------- */
+
+#define M_BEGIN do {
+
+#define M_END } while(0)
+
+ /* -------------------------------- *
+ * Some useful macro definitions *
+ * -------------------------------- */
+
+#define MAX( x, y ) (((x)>(y))?(x):(y))
+
+#define MIN( x, y ) (((x)<(y))?(x):(y))
+
+#define MODINC( a, m ) M_BEGIN (a)++; if ((a)>=(m)) (a)=0; M_END
+
+#define MODDEC( a, m ) M_BEGIN if ((a)==0) (a)=(m); (a)--; M_END
+
+#define MODADD( a, b, m ) M_BEGIN (a)+=(b); if ((a)>=(m)) (a)-=(m); M_END
+
+#define MODSUB( a, b, m ) MODADD( a, (m)-(b), m )
+
+#define PAUSE( t ) M_BEGIN \
+ __IO int _i; \
+ for ( _i = t; _i > 0; _i -- ); \
+ M_END
+
+#define DIVF( x, y ) ((x)/(y))
+
+#define DIVC( x, y ) (((x)+(y)-1)/(y))
+
+#define DIVR( x, y ) (((x)+((y)/2))/(y))
+
+#define SHRR( x, n ) ((((x)>>((n)-1))+1)>>1)
+
+#define BITN( w, n ) (((w)[(n)/32] >> ((n)%32)) & 1)
+
+#define BITNSET( w, n, b ) M_BEGIN (w)[(n)/32] |= ((U32)(b))<<((n)%32); M_END
+
+ /* -------------------------------- *
+ * Compiler *
+ * -------------------------------- */
+#define PLACE_IN_SECTION( __x__ ) __attribute__((section (__x__)))
+
+#ifdef WIN32
+#define ALIGN(n)
+#else
+#define ALIGN(n) __attribute__((aligned(n)))
+#endif
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /*APP_COMMON_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/app_conf.h
new file mode 100644
index 000000000..6d9144c46
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/app_conf.h
@@ -0,0 +1,347 @@
+/**
+ ******************************************************************************
+ * File Name : app_conf.h
+ * Description : Application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_CONF_H
+#define APP_CONF_H
+
+#include "hw.h"
+#include "hw_conf.h"
+#include "hw_if.h"
+
+/******************************************************************************
+ * Application Config
+ ******************************************************************************/
+/******************************************************************************
+ * Transport Layer
+ ******************************************************************************/
+/**
+ * Queue length of BLE Event
+ * This parameter defines the number of asynchronous events that can be stored in the HCI layer before
+ * being reported to the application. When a command is sent to the BLE core coprocessor, the HCI layer
+ * is waiting for the event with the Num_HCI_Command_Packets set to 1. The receive queue shall be large
+ * enough to store all asynchronous events received in between.
+ * When CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE is set to 27, this allow to store three 255 bytes long asynchronous events
+ * between the HCI command and its event.
+ * This parameter depends on the value given to CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE. When the queue size is to small,
+ * the system may hang if the queue is full with asynchronous events and the HCI layer is still waiting
+ * for a CC/CS event, In that case, the notification TL_BLE_HCI_ToNot() is called to indicate
+ * to the application a HCI command did not receive its command event within 30s (Default HCI Timeout).
+ */
+#define CFG_TL_EVT_QUEUE_LENGTH 5
+/**
+ * This parameter should be set to fit most events received by the HCI layer. It defines the buffer size of each element
+ * allocated in the queue of received events and can be used to optimize the amount of RAM allocated by the Memory Manager.
+ * It should not exceed 255 which is the maximum HCI packet payload size (a greater value is a lost of memory as it will
+ * never be used)
+ * It shall be at least 4 to receive the command status event in one frame.
+ * The default value is set to 27 to allow receiving an event of MTU size in a single buffer. This value maybe reduced
+ * further depending on the application.
+ *
+ */
+#define CFG_TL_MOST_EVENT_PAYLOAD_SIZE 255 /**< Set to 255 with the memory manager and the mailbox */
+
+#define TL_EVENT_FRAME_SIZE ( TL_EVT_HDR_SIZE + CFG_TL_MOST_EVENT_PAYLOAD_SIZE )
+/******************************************************************************
+ * UART interfaces
+ ******************************************************************************/
+
+/**
+ * Select UART interfaces
+ */
+#define CFG_DEBUG_TRACE_UART hw_uart1
+#define CFG_CONSOLE_MENU
+#define CFG_CLI_UART hw_lpuart1
+/******************************************************************************
+ * USB interface
+ ******************************************************************************/
+
+/**
+ * Enable/Disable USB interface
+ */
+#define CFG_USB_INTERFACE_ENABLE 0
+
+/******************************************************************************
+ * Low Power
+ *
+ * When CFG_FULL_LOW_POWER is set to 1, the system is configured in full
+ * low power mode. It means that all what can have an impact on the consumptions
+ * are powered down.(For instance LED, Access to Debugger, Etc.)
+ *
+ * When CFG_FULL_LOW_POWER is set to 0, the low power mode is not activated
+ *
+ ******************************************************************************/
+
+#define CFG_FULL_LOW_POWER 0
+
+#if (CFG_FULL_LOW_POWER == 1)
+#undef CFG_LPM_SUPPORTED
+#define CFG_LPM_SUPPORTED 1
+#endif /* CFG_FULL_LOW_POWER */
+
+/******************************************************************************
+ * Timer Server
+ ******************************************************************************/
+/**
+ * CFG_RTC_WUCKSEL_DIVIDER: This sets the RTCCLK divider to the wakeup timer.
+ * The higher is the value, the better is the power consumption and the accuracy of the timerserver
+ * The lower is the value, the finest is the granularity
+ *
+ * CFG_RTC_ASYNCH_PRESCALER: This sets the asynchronous prescaler of the RTC. It should as high as possible ( to ouput
+ * clock as low as possible) but the output clock should be equal or higher frequency compare to the clock feeding
+ * the wakeup timer. A lower clock speed would impact the accuracy of the timer server.
+ *
+ * CFG_RTC_SYNCH_PRESCALER: This sets the synchronous prescaler of the RTC.
+ * When the 1Hz calendar clock is required, it shall be sets according to other settings
+ * When the 1Hz calendar clock is not needed, CFG_RTC_SYNCH_PRESCALER should be set to 0x7FFF (MAX VALUE)
+ *
+ * CFG_RTCCLK_DIVIDER_CONF:
+ * Shall be set to either 0,2,4,8,16
+ * When set to either 2,4,8,16, the 1Hhz calendar is supported
+ * When set to 0, the user sets its own configuration
+ *
+ * The following settings are computed with LSI as input to the RTC
+ */
+#define CFG_RTCCLK_DIVIDER_CONF 0
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 0)
+/**
+ * Custom configuration
+ * It does not support 1Hz calendar
+ * It divides the RTC CLK by 16
+ */
+#define CFG_RTCCLK_DIV (16)
+#define CFG_RTC_WUCKSEL_DIVIDER (0)
+#define CFG_RTC_ASYNCH_PRESCALER (CFG_RTCCLK_DIV - 1)
+#define CFG_RTC_SYNCH_PRESCALER (0x7FFF)
+
+#else
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 2)
+/**
+ * It divides the RTC CLK by 2
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (3)
+#endif
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 4)
+/**
+ * It divides the RTC CLK by 4
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (2)
+#endif
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 8)
+/**
+ * It divides the RTC CLK by 8
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (1)
+#endif
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 16)
+/**
+ * It divides the RTC CLK by 16
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (0)
+#endif
+
+#define CFG_RTCCLK_DIV CFG_RTCCLK_DIVIDER_CONF
+#define CFG_RTC_ASYNCH_PRESCALER (CFG_RTCCLK_DIV - 1)
+#define CFG_RTC_SYNCH_PRESCALER (DIVR( LSE_VALUE, (CFG_RTC_ASYNCH_PRESCALER+1) ) - 1 )
+
+#endif
+
+/** tick timer value in us */
+#define CFG_TS_TICK_VAL DIVR( (CFG_RTCCLK_DIV * 1000000), LSE_VALUE )
+
+typedef enum
+{
+ CFG_TIM_PROC_ID_ISR,
+} CFG_TimProcID_t;
+
+/******************************************************************************
+ * Debug
+ ******************************************************************************/
+/**
+ * When set, this resets some hw resources to set the device in the same state than the power up
+ * The FW resets only register that may prevent the FW to run properly
+ *
+ * This shall be set to 0 in a final product
+ *
+ */
+#define CFG_HW_RESET_BY_FW 1
+
+/**
+ * keep debugger enabled while in any low power mode when set to 1
+ * should be set to 0 in production
+ */
+#define CFG_DEBUGGER_SUPPORTED 1
+
+#if (CFG_FULL_LOW_POWER == 1)
+#undef CFG_DEBUGGER_SUPPORTED
+#define CFG_DEBUGGER_SUPPORTED 0
+#endif /* CFG_FULL_LOW_POWER */
+
+/*****************************************************************************
+ * Traces
+ * Enable or Disable traces in application
+ * When CFG_DEBUG_TRACE is set, traces are activated
+ *
+ * Note : Refer to utilities_conf.h file in order to details
+ * the level of traces : CFG_DEBUG_TRACE_FULL or CFG_DEBUG_TRACE_LIGHT
+ *****************************************************************************/
+#define CFG_DEBUG_TRACE 1
+
+#if (CFG_FULL_LOW_POWER == 1)
+#undef CFG_DEBUG_TRACE
+#define CFG_DEBUG_TRACE 0
+#endif /* CFG_FULL_LOW_POWER */
+
+/**
+ * When CFG_DEBUG_TRACE_FULL is set to 1, the trace are output with the API name, the file name and the line number
+ * When CFG_DEBUG_TRACE_LIGHT is set to 1, only the debug message is output
+ *
+ * When both are set to 0, no trace are output
+ * When both are set to 1, CFG_DEBUG_TRACE_FULL is selected
+ */
+#define CFG_DEBUG_TRACE_LIGHT 1
+#define CFG_DEBUG_TRACE_FULL 0
+
+#if (( CFG_DEBUG_TRACE != 0 ) && ( CFG_DEBUG_TRACE_LIGHT == 0 ) && (CFG_DEBUG_TRACE_FULL == 0))
+#undef CFG_DEBUG_TRACE_FULL
+#undef CFG_DEBUG_TRACE_LIGHT
+#define CFG_DEBUG_TRACE_FULL 0
+#define CFG_DEBUG_TRACE_LIGHT 1
+#endif
+
+#if ( CFG_DEBUG_TRACE == 0 )
+#undef CFG_DEBUG_TRACE_FULL
+#undef CFG_DEBUG_TRACE_LIGHT
+#define CFG_DEBUG_TRACE_FULL 0
+#define CFG_DEBUG_TRACE_LIGHT 0
+#endif
+
+/**
+ * When not set, the traces is looping on sending the trace over UART
+ */
+#define DBG_TRACE_USE_CIRCULAR_QUEUE 1
+
+/**
+ * max buffer Size to queue data traces and max data trace allowed.
+ * Only Used if DBG_TRACE_USE_CIRCULAR_QUEUE is defined
+ */
+#define DBG_TRACE_MSG_QUEUE_SIZE 4096
+#define MAX_DBG_TRACE_MSG_SIZE 1024
+
+/******************************************************************************
+ * Configure Log level for Application
+ ******************************************************************************/
+#define APPLI_CONFIG_LOG_LEVEL LOG_LEVEL_INFO
+#define APPLI_PRINT_FILE_FUNC_LINE 0
+
+/* USER CODE BEGIN Defines */
+/******************************************************************************
+ * User interaction
+ * When CFG_LED_SUPPORTED is set, LEDS are activated if requested
+ * When CFG_BUTTON_SUPPORTED is set, the push button are activated if requested
+ ******************************************************************************/
+#if (CFG_FULL_LOW_POWER == 1)
+#define CFG_LED_SUPPORTED 0
+#define CFG_BUTTON_SUPPORTED 0
+#else
+#define CFG_LED_SUPPORTED 1
+#define CFG_BUTTON_SUPPORTED 1
+#endif /* CFG_FULL_LOW_POWER */
+/* USER CODE END Defines */
+
+/******************************************************************************
+ * Scheduler
+ ******************************************************************************/
+/**
+ * This is the list of task id required by the application
+ * Each Id shall be in the range 0..31
+ */
+
+typedef enum {
+ CFG_TASK_MSG_FROM_M0_TO_M4,
+ CFG_TASK_ZIGBEE_APP,
+ CFG_TASK_SYSTEM_HCI_ASYNCH_EVT,
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+ CFG_TASK_VCP_SEND_DATA,
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+ CFG_TASK_NBR /**< Shall be last in the list */
+} CFG_IdleTask_Id_t;
+
+/* Scheduler types and defines */
+/*------------------------------------*/
+
+//#define TASK_MSG_FROM_M0_TO_M4 (1U << CFG_TASK_MSG_FROM_M0_TO_M4)
+#define EVENT_ACK_FROM_M0_EVT (1U << CFG_EVT_ACK_FROM_M0_EVT)
+#define EVENT_SYNCHRO_BYPASS_IDLE (1U << CFG_EVT_SYNCHRO_BYPASS_IDLE)
+
+/**
+ * This is the list of priority required by the application
+ * Each Id shall be in the range 0..31
+ */
+typedef enum
+{
+ CFG_SCH_PRIO_0,
+ CFG_SCH_PRIO_1,
+ CFG_PRIO_NBR,
+} CFG_SCH_Prio_Id_t;
+
+/**
+ * This is a bit mapping over 32bits listing all events id supported in the application
+ */
+typedef enum {
+ CFG_EVT_SYSTEM_HCI_CMD_EVT_RESP,
+ CFG_EVT_ACK_FROM_M0_EVT,
+ CFG_EVT_SYNCHRO_BYPASS_IDLE,
+} CFG_IdleEvt_Id_t;
+
+#define EVENT_ACK_FROM_M0_EVT (1U << CFG_EVT_ACK_FROM_M0_EVT)
+#define EVENT_SYNCHRO_BYPASS_IDLE (1U << CFG_EVT_SYNCHRO_BYPASS_IDLE)
+
+/******************************************************************************
+ * Configure Log level for Application
+ ******************************************************************************/
+#define APPLI_CONFIG_LOG_LEVEL LOG_LEVEL_INFO
+#define APPLI_PRINT_FILE_FUNC_LINE 0
+
+/******************************************************************************
+ * LOW POWER
+ ******************************************************************************/
+/**
+ * Supported requester to the MCU Low Power Manager - can be increased up to 32
+ * It lits a bit mapping of all user of the Low Power Manager
+ */
+typedef enum {
+ CFG_LPM_APP,
+} CFG_LPM_Id_t;
+
+/******************************************************************************
+ * OTP manager
+ ******************************************************************************/
+#define CFG_OTP_BASE_ADDRESS OTP_AREA_BASE
+
+#define CFG_OTP_END_ADRESS OTP_AREA_END_ADDR
+
+#endif /*APP_CONF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/app_entry.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/app_entry.h
new file mode 100644
index 000000000..48c467aaa
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/app_entry.h
@@ -0,0 +1,68 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : app_entry.h
+ * Description : App entry configuration file for STM32WPAN Middleware.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_ENTRY_H
+#define APP_ENTRY_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /* Exported types ------------------------------------------------------------*/
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* Exported variables --------------------------------------------------------*/
+/* USER CODE BEGIN EV */
+
+/* USER CODE END EV */
+
+/* Exported macros ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions ---------------------------------------------*/
+ void APPE_Init( void );
+/* USER CODE BEGIN EF */
+
+/* USER CODE END EF */
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /*APP_ENTRY_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/hw_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/hw_conf.h
new file mode 100644
index 000000000..8409edd16
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/hw_conf.h
@@ -0,0 +1,219 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : hw_conf.h
+ * Description : Hardware configuration file for STM32WPAN Middleware.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_CONF_H
+#define HW_CONF_H
+
+/******************************************************************************
+ * Semaphores
+ * THIS SHALL NO BE CHANGED AS THESE SEMAPHORES ARE USED AS WELL ON THE CM0+
+ *****************************************************************************/
+/* Index of the semaphore used to manage the entry Stop Mode procedure */
+#define CFG_HW_ENTRY_STOP_MODE_SEMID 4
+
+/* Index of the semaphore used to access the RCC */
+#define CFG_HW_RCC_SEMID 3
+
+/* Index of the semaphore used to access the FLASH */
+#define CFG_HW_FLASH_SEMID 2
+
+/* Index of the semaphore used to access the PKA */
+#define CFG_HW_PKA_SEMID 1
+
+/* Index of the semaphore used to access the RNG */
+#define CFG_HW_RNG_SEMID 0
+
+/******************************************************************************
+ * HW TIMER SERVER
+ *****************************************************************************/
+/**
+ * The user may define the maximum number of virtual timers supported.
+ * It shall not exceed 255
+ */
+#define CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER 6
+
+/**
+ * The user may define the priority in the NVIC of the RTC_WKUP interrupt handler that is used to manage the
+ * wakeup timer.
+ * This setting is the preemptpriority part of the NVIC.
+ */
+#define CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO 3
+
+/**
+ * The user may define the priority in the NVIC of the RTC_WKUP interrupt handler that is used to manage the
+ * wakeup timer.
+ * This setting is the subpriority part of the NVIC. It does not exist on all processors. When it is not supported
+ * on the CPU, the setting is ignored
+ */
+#define CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO 0
+
+/**
+ * Define a critical section in the Timer server
+ * The Timer server does not support the API to be nested
+ * The Application shall either:
+ * a) Ensure this will never happen
+ * b) Define the critical section
+ * The default implementations is masking all interrupts using the PRIMASK bit
+ * The TimerServer driver uses critical sections to avoid context corruption. This is achieved with the macro
+ * TIMER_ENTER_CRITICAL_SECTION and TIMER_EXIT_CRITICAL_SECTION. When CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION is set
+ * to 1, all STM32 interrupts are masked with the PRIMASK bit of the CortexM CPU. It is possible to use the BASEPRI
+ * register of the CortexM CPU to keep allowed some interrupts with high priority. In that case, the user shall
+ * re-implement TIMER_ENTER_CRITICAL_SECTION and TIMER_EXIT_CRITICAL_SECTION and shall make sure that no TimerServer
+ * API are called when the TIMER critical section is entered
+ */
+#define CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION 1
+
+/**
+ * This value shall reflect the maximum delay there could be in the application between the time the RTC interrupt
+ * is generated by the Hardware and the time when the RTC interrupt handler is called. This time is measured in
+ * number of RTCCLK ticks.
+ * A relaxed timing would be 10ms
+ * When the value is too short, the timerserver will not be able to count properly and all timeout may be random.
+ * When the value is too long, the device may wake up more often than the most optimal configuration. However, the
+ * impact on power consumption would be marginal (unless the value selected is extremely too long). It is strongly
+ * recommended to select a value large enough to make sure it is not too short to ensure reliability of the system
+ * as this will have marginal impact on low power mode
+ */
+#define CFG_HW_TS_RTC_HANDLER_MAX_DELAY ( 10 * (LSI_VALUE/1000) )
+
+ /**
+ * Interrupt ID in the NVIC of the RTC Wakeup interrupt handler
+ * It shall be type of IRQn_Type
+ */
+#define CFG_HW_TS_RTC_WAKEUP_HANDLER_ID RTC_WKUP_IRQn
+
+/******************************************************************************
+ * HW UART
+ *****************************************************************************/
+
+#define CFG_HW_LPUART1_ENABLED 1
+#define CFG_HW_LPUART1_DMA_TX_SUPPORTED 1
+
+#define CFG_HW_USART1_ENABLED 1
+#define CFG_HW_USART1_DMA_TX_SUPPORTED 1
+
+/**
+ * LPUART1
+ */
+#define CFG_HW_LPUART1_PREEMPTPRIORITY 0x0F
+#define CFG_HW_LPUART1_SUBPRIORITY 0
+
+/** < The application shall check the selected source clock is enable */
+#define CFG_HW_LPUART1_SOURCE_CLOCK RCC_LPUART1CLKSOURCE_SYSCLK
+
+#define CFG_HW_LPUART1_BAUDRATE 115200
+#define CFG_HW_LPUART1_WORDLENGTH UART_WORDLENGTH_8B
+#define CFG_HW_LPUART1_STOPBITS UART_STOPBITS_1
+#define CFG_HW_LPUART1_PARITY UART_PARITY_NONE
+#define CFG_HW_LPUART1_HWFLOWCTL UART_HWCONTROL_NONE
+#define CFG_HW_LPUART1_MODE UART_MODE_TX_RX
+#define CFG_HW_LPUART1_ADVFEATUREINIT UART_ADVFEATURE_NO_INIT
+#define CFG_HW_LPUART1_OVERSAMPLING UART_OVERSAMPLING_8
+
+#define CFG_HW_LPUART1_TX_PORT_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE
+#define CFG_HW_LPUART1_TX_PORT GPIOA
+#define CFG_HW_LPUART1_TX_PIN GPIO_PIN_2
+#define CFG_HW_LPUART1_TX_MODE GPIO_MODE_AF_PP
+#define CFG_HW_LPUART1_TX_PULL GPIO_NOPULL
+#define CFG_HW_LPUART1_TX_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_LPUART1_TX_ALTERNATE GPIO_AF8_LPUART1
+
+#define CFG_HW_LPUART1_RX_PORT_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE
+#define CFG_HW_LPUART1_RX_PORT GPIOA
+#define CFG_HW_LPUART1_RX_PIN GPIO_PIN_3
+#define CFG_HW_LPUART1_RX_MODE GPIO_MODE_AF_PP
+#define CFG_HW_LPUART1_RX_PULL GPIO_NOPULL
+#define CFG_HW_LPUART1_RX_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_LPUART1_RX_ALTERNATE GPIO_AF8_LPUART1
+
+#define CFG_HW_LPUART1_CTS_PORT_CLK_ENABLE __HAL_RCC_GPIOvalueNotSetted_CLK_ENABLE
+#define CFG_HW_LPUART1_CTS_PORT GPIOvalueNotSetted
+#define CFG_HW_LPUART1_CTS_PIN GPIO_PIN_valueNotSetted
+#define CFG_HW_LPUART1_CTS_MODE GPIO_MODE_AF_PP
+#define CFG_HW_LPUART1_CTS_PULL GPIO_PULLDOWN
+#define CFG_HW_LPUART1_CTS_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_LPUART1_CTS_ALTERNATE GPIO_AFvalueNotSetted_LPUART1
+
+#define CFG_HW_LPUART1_DMA_TX_PREEMPTPRIORITY 0x0F
+#define CFG_HW_LPUART1_DMA_TX_SUBPRIORITY 0
+
+#define CFG_HW_LPUART1_DMAMUX_CLK_ENABLE __HAL_RCC_DMAMUX1_CLK_ENABLE
+#define CFG_HW_LPUART1_DMA_CLK_ENABLE __HAL_RCC_DMA1_CLK_ENABLE
+#define CFG_HW_LPUART1_TX_DMA_REQ DMA_REQUEST_LPUART1_TX
+#define CFG_HW_LPUART1_TX_DMA_CHANNEL DMA1_CHANNEL_1
+#define CFG_HW_LPUART1_TX_DMA_IRQn DMA1_CHANNEL_1_IRQn
+#define CFG_HW_LPUART1_DMA_TX_IRQHandler DMA1_CHANNEL_1_IRQHandler
+
+/**
+ * UART1
+ */
+#define CFG_HW_USART1_PREEMPTPRIORITY 0x0F
+#define CFG_HW_USART1_SUBPRIORITY 0
+
+/** < The application shall check the selected source clock is enable */
+#define CFG_HW_USART1_SOURCE_CLOCK RCC_USART1CLKSOURCE_SYSCLK
+
+#define CFG_HW_USART1_BAUDRATE 115200
+#define CFG_HW_USART1_WORDLENGTH UART_WORDLENGTH_8B
+#define CFG_HW_USART1_STOPBITS UART_STOPBITS_1
+#define CFG_HW_USART1_PARITY UART_PARITY_NONE
+#define CFG_HW_USART1_HWFLOWCTL UART_HWCONTROL_NONE
+#define CFG_HW_USART1_MODE UART_MODE_TX_RX
+#define CFG_HW_USART1_ADVFEATUREINIT UART_ADVFEATURE_NO_INIT
+#define CFG_HW_USART1_OVERSAMPLING UART_OVERSAMPLING_8
+
+#define CFG_HW_USART1_TX_PORT_CLK_ENABLE __HAL_RCC_GPIOB_CLK_ENABLE
+#define CFG_HW_USART1_TX_PORT GPIOB
+#define CFG_HW_USART1_TX_PIN GPIO_PIN_6
+#define CFG_HW_USART1_TX_MODE GPIO_MODE_AF_PP
+#define CFG_HW_USART1_TX_PULL GPIO_NOPULL
+#define CFG_HW_USART1_TX_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_USART1_TX_ALTERNATE GPIO_AF7_USART1
+
+#define CFG_HW_USART1_RX_PORT_CLK_ENABLE __HAL_RCC_GPIOB_CLK_ENABLE
+#define CFG_HW_USART1_RX_PORT GPIOB
+#define CFG_HW_USART1_RX_PIN GPIO_PIN_7
+#define CFG_HW_USART1_RX_MODE GPIO_MODE_AF_PP
+#define CFG_HW_USART1_RX_PULL GPIO_NOPULL
+#define CFG_HW_USART1_RX_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_USART1_RX_ALTERNATE GPIO_AF7_USART1
+
+#define CFG_HW_USART1_CTS_PORT_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE
+#define CFG_HW_USART1_CTS_PORT GPIOA
+#define CFG_HW_USART1_CTS_PIN GPIO_PIN_11
+#define CFG_HW_USART1_CTS_MODE GPIO_MODE_AF_PP
+#define CFG_HW_USART1_CTS_PULL GPIO_PULLDOWN
+#define CFG_HW_USART1_CTS_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_USART1_CTS_ALTERNATE GPIO_AF7_USART1
+
+#define CFG_HW_USART1_DMA_TX_PREEMPTPRIORITY 0x0F
+#define CFG_HW_USART1_DMA_TX_SUBPRIORITY 0
+
+#define CFG_HW_USART1_DMAMUX_CLK_ENABLE __HAL_RCC_DMAMUX1_CLK_ENABLE
+#define CFG_HW_USART1_DMA_CLK_ENABLE __HAL_RCC_DMA1_CLK_ENABLE
+#define CFG_HW_USART1_TX_DMA_REQ DMA_REQUEST_USART1_TX
+#define CFG_HW_USART1_TX_DMA_CHANNEL DMA1_CHANNEL_2
+#define CFG_HW_USART1_TX_DMA_IRQn DMA1_CHANNEL_2_IRQn
+#define CFG_HW_USART1_DMA_TX_IRQHandler DMA1_CHANNEL_2_IRQHandler
+
+#endif /*HW_CONF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/main.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/main.h
new file mode 100644
index 000000000..68182bc5a
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/main.h
@@ -0,0 +1,71 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file : main.h
+ * @brief : Header for main.c file.
+ * This file contains the common defines of the application.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __MAIN_H
+#define __MAIN_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx_hal.h"
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Exported types ------------------------------------------------------------*/
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* Exported macro ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions prototypes ---------------------------------------------*/
+void Error_Handler(void);
+
+/* USER CODE BEGIN EFP */
+
+/* USER CODE END EFP */
+
+/* Private defines -----------------------------------------------------------*/
+/* USER CODE BEGIN Private defines */
+
+/* USER CODE END Private defines */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MAIN_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/stm32_lpm_if.h
new file mode 100644
index 000000000..70abecaa9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/stm32_lpm_if.h
@@ -0,0 +1,81 @@
+/* USER CODE BEGIN Header */
+/**
+******************************************************************************
+* @file stm32_lpm_if.h
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
+******************************************************************************
+* @attention
+*
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+* All rights reserved.</center></h2>
+*
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+*
+******************************************************************************
+*/
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32_LPM_IF_H
+#define __STM32_LPM_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+
+/**
+ * @brief Enters Low Power Off Mode
+ * @param none
+ * @retval none
+ */
+void PWR_EnterOffMode( void );
+/**
+ * @brief Exits Low Power Off Mode
+ * @param none
+ * @retval none
+ */
+void PWR_ExitOffMode( void );
+
+/**
+ * @brief Enters Low Power Stop Mode
+ * @note ARM exists the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_EnterStopMode( void );
+/**
+ * @brief Exits Low Power Stop Mode
+ * @note Enable the pll at 32MHz
+ * @param none
+ * @retval none
+ */
+void PWR_ExitStopMode( void );
+
+/**
+ * @brief Enters Low Power Sleep Mode
+ * @note ARM exits the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_EnterSleepMode( void );
+
+/**
+ * @brief Exits Low Power Sleep Mode
+ * @note ARM exits the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_ExitSleepMode( void );
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*__STM32_LPM_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/stm32wbxx_hal_conf.h
new file mode 100644
index 000000000..ea9aa40d0
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/stm32wbxx_hal_conf.h
@@ -0,0 +1,353 @@
+/**
+ ******************************************************************************
+ * @file stm32wbxx_hal_conf.h
+ * @author MCD Application Team
+ * @brief HAL configuration file.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32WBxx_HAL_CONF_H
+#define __STM32WBxx_HAL_CONF_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/* Exported types ------------------------------------------------------------*/
+/* Exported constants --------------------------------------------------------*/
+
+/* ########################## Module Selection ############################## */
+/**
+ * @brief This is the list of modules to be used in the HAL driver
+ */
+#define HAL_MODULE_ENABLED
+/*#define HAL_ADC_MODULE_ENABLED */
+/*#define HAL_CRYP_MODULE_ENABLED */
+/*#define HAL_COMP_MODULE_ENABLED */
+/*#define HAL_CRC_MODULE_ENABLED */
+#define HAL_HSEM_MODULE_ENABLED
+/*#define HAL_I2C_MODULE_ENABLED */
+/*#define HAL_IPCC_MODULE_ENABLED */
+/*#define HAL_IRDA_MODULE_ENABLED */
+/*#define HAL_IWDG_MODULE_ENABLED */
+/*#define HAL_LCD_MODULE_ENABLED */
+/*#define HAL_LPTIM_MODULE_ENABLED */
+/*#define HAL_PCD_MODULE_ENABLED */
+/*#define HAL_PKA_MODULE_ENABLED */
+/*#define HAL_QSPI_MODULE_ENABLED */
+/*#define HAL_RNG_MODULE_ENABLED */
+#define HAL_RTC_MODULE_ENABLED
+/*#define HAL_SAI_MODULE_ENABLED */
+/*#define HAL_SMBUS_MODULE_ENABLED */
+/*#define HAL_SMARTCARD_MODULE_ENABLED */
+/*#define HAL_SPI_MODULE_ENABLED */
+/*#define HAL_TIM_MODULE_ENABLED */
+/*#define HAL_TSC_MODULE_ENABLED */
+#define HAL_UART_MODULE_ENABLED
+/*#define HAL_USART_MODULE_ENABLED */
+/*#define HAL_WWDG_MODULE_ENABLED */
+#define HAL_EXTI_MODULE_ENABLED
+#define HAL_CORTEX_MODULE_ENABLED
+#define HAL_DMA_MODULE_ENABLED
+#define HAL_FLASH_MODULE_ENABLED
+#define HAL_GPIO_MODULE_ENABLED
+#define HAL_PWR_MODULE_ENABLED
+#define HAL_RCC_MODULE_ENABLED
+
+#define USE_HAL_ADC_REGISTER_CALLBACKS 0u
+#define USE_HAL_COMP_REGISTER_CALLBACKS 0u
+#define USE_HAL_CRYP_REGISTER_CALLBACKS 0u
+#define USE_HAL_I2C_REGISTER_CALLBACKS 0u
+#define USE_HAL_IRDA_REGISTER_CALLBACKS 0u
+#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0u
+#define USE_HAL_PCD_REGISTER_CALLBACKS 0u
+#define USE_HAL_PKA_REGISTER_CALLBACKS 0u
+#define USE_HAL_QSPI_REGISTER_CALLBACKS 0u
+#define USE_HAL_RNG_REGISTER_CALLBACKS 0u
+#define USE_HAL_RTC_REGISTER_CALLBACKS 0u
+#define USE_HAL_SAI_REGISTER_CALLBACKS 0u
+#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0u
+#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0u
+#define USE_HAL_SPI_REGISTER_CALLBACKS 0u
+#define USE_HAL_TIM_REGISTER_CALLBACKS 0u
+#define USE_HAL_TSC_REGISTER_CALLBACKS 0u
+#define USE_HAL_UART_REGISTER_CALLBACKS 0u
+#define USE_HAL_USART_REGISTER_CALLBACKS 0u
+#define USE_HAL_WWDG_REGISTER_CALLBACKS 0u
+
+/* ########################## Oscillator Values adaptation ####################*/
+/**
+ * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
+ * This value is used by the RCC HAL module to compute the system frequency
+ * (when HSE is used as system clock source, directly or through the PLL).
+ */
+#if !defined (HSE_VALUE)
+#define HSE_VALUE 32000000U /*!< Value of the External oscillator in Hz */
+#endif /* HSE_VALUE */
+
+#if !defined (HSE_STARTUP_TIMEOUT)
+ #define HSE_STARTUP_TIMEOUT ((uint32_t)100) /*!< Time out for HSE start up, in ms */
+#endif /* HSE_STARTUP_TIMEOUT */
+
+/**
+ * @brief Internal Multiple Speed oscillator (MSI) default value.
+ * This value is the default MSI range value after Reset.
+ */
+#if !defined (MSI_VALUE)
+ #define MSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/
+#endif /* MSI_VALUE */
+
+/**
+ * @brief Internal High Speed oscillator (HSI) value.
+ * This value is used by the RCC HAL module to compute the system frequency
+ * (when HSI is used as system clock source, directly or through the PLL).
+ */
+#if !defined (HSI_VALUE)
+#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/
+#endif /* HSI_VALUE */
+
+/**
+ * @brief Internal Low Speed oscillator (LSI1) value.
+ */
+#if !defined (LSI1_VALUE)
+ #define LSI1_VALUE ((uint32_t)32000) /*!< LSI1 Typical Value in Hz*/
+#endif /* LSI1_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
+ The real value may vary depending on the variations
+ in voltage and temperature.*/
+/**
+ * @brief Internal Low Speed oscillator (LSI2) value.
+ */
+#if !defined (LSI2_VALUE)
+ #define LSI2_VALUE ((uint32_t)32000) /*!< LSI2 Typical Value in Hz*/
+#endif /* LSI2_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
+ The real value may vary depending on the variations
+ in voltage and temperature.*/
+
+/**
+ * @brief External Low Speed oscillator (LSE) value.
+ * This value is used by the UART, RTC HAL module to compute the system frequency
+ */
+#if !defined (LSE_VALUE)
+#define LSE_VALUE 32768U /*!< Value of the External oscillator in Hz*/
+#endif /* LSE_VALUE */
+
+/**
+ * @brief Internal Multiple Speed oscillator (HSI48) default value.
+ * This value is the default HSI48 range value after Reset.
+ */
+#if !defined (HSI48_VALUE)
+ #define HSI48_VALUE ((uint32_t)48000000) /*!< Value of the Internal oscillator in Hz*/
+#endif /* HSI48_VALUE */
+
+#if !defined (LSE_STARTUP_TIMEOUT)
+#define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */
+#endif /* HSE_STARTUP_TIMEOUT */
+
+/**
+ * @brief External clock source for SAI1 peripheral
+ * This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source
+ * frequency.
+ */
+#if !defined (EXTERNAL_SAI1_CLOCK_VALUE)
+ #define EXTERNAL_SAI1_CLOCK_VALUE ((uint32_t)2097000) /*!< Value of the SAI1 External clock source in Hz*/
+#endif /* EXTERNAL_SAI1_CLOCK_VALUE */
+
+/* Tip: To avoid modifying this file each time you need to use different HSE,
+ === you can define the HSE value in your toolchain compiler preprocessor. */
+
+/* ########################### System Configuration ######################### */
+/**
+ * @brief This is the HAL system configuration section
+ */
+
+#define VDD_VALUE 3300U /*!< Value of VDD in mv */
+#define TICK_INT_PRIORITY 0U /*!< tick interrupt priority */
+#define USE_RTOS 0U
+#define PREFETCH_ENABLE 1U
+#define INSTRUCTION_CACHE_ENABLE 1U
+#define DATA_CACHE_ENABLE 1U
+
+/* ########################## Assert Selection ############################## */
+/**
+ * @brief Uncomment the line below to expanse the "assert_param" macro in the
+ * HAL drivers code
+ */
+/* #define USE_FULL_ASSERT 1U */
+
+/* ################## SPI peripheral configuration ########################## */
+
+/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
+ * Activated: CRC code is present inside driver
+ * Deactivated: CRC code cleaned from driver
+ */
+
+#define USE_SPI_CRC 0U
+
+/* Includes ------------------------------------------------------------------*/
+/**
+ * @brief Include module's header file
+ */
+#ifdef HAL_DMA_MODULE_ENABLED
+ #include "stm32wbxx_hal_dma.h"
+#endif /* HAL_DMA_MODULE_ENABLED */
+
+#ifdef HAL_ADC_MODULE_ENABLED
+ #include "stm32wbxx_hal_adc.h"
+#endif /* HAL_ADC_MODULE_ENABLED */
+
+#ifdef HAL_COMP_MODULE_ENABLED
+ #include "stm32wbxx_hal_comp.h"
+#endif /* HAL_COMP_MODULE_ENABLED */
+
+#ifdef HAL_CORTEX_MODULE_ENABLED
+ #include "stm32wbxx_hal_cortex.h"
+#endif /* HAL_CORTEX_MODULE_ENABLED */
+
+#ifdef HAL_CRC_MODULE_ENABLED
+ #include "stm32wbxx_hal_crc.h"
+#endif /* HAL_CRC_MODULE_ENABLED */
+
+#ifdef HAL_CRYP_MODULE_ENABLED
+ #include "stm32wbxx_hal_cryp.h"
+#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
+
+#ifdef HAL_FLASH_MODULE_ENABLED
+ #include "stm32wbxx_hal_flash.h"
+#endif /* HAL_FLASH_MODULE_ENABLED */
+
+#ifdef HAL_GPIO_MODULE_ENABLED
+ #include "stm32wbxx_hal_gpio.h"
+#endif /* HAL_GPIO_MODULE_ENABLED */
+
+#ifdef HAL_HSEM_MODULE_ENABLED
+ #include "stm32wbxx_hal_hsem.h"
+#endif /* HAL_HSEM_MODULE_ENABLED */
+
+#ifdef HAL_I2C_MODULE_ENABLED
+ #include "stm32wbxx_hal_i2c.h"
+#endif /* HAL_I2C_MODULE_ENABLED */
+
+#ifdef HAL_IPCC_MODULE_ENABLED
+ #include "stm32wbxx_hal_ipcc.h"
+#endif /* HAL_IPCC_MODULE_ENABLED */
+
+#ifdef HAL_IRDA_MODULE_ENABLED
+ #include "stm32wbxx_hal_irda.h"
+#endif /* HAL_IRDA_MODULE_ENABLED */
+
+#ifdef HAL_IWDG_MODULE_ENABLED
+ #include "stm32wbxx_hal_iwdg.h"
+#endif /* HAL_IWDG_MODULE_ENABLED */
+
+#ifdef HAL_LCD_MODULE_ENABLED
+ #include "stm32wbxx_hal_lcd.h"
+#endif /* HAL_LCD_MODULE_ENABLED */
+
+#ifdef HAL_LPTIM_MODULE_ENABLED
+ #include "stm32wbxx_hal_lptim.h"
+#endif /* HAL_LPTIM_MODULE_ENABLED */
+
+#ifdef HAL_PCD_MODULE_ENABLED
+ #include "stm32wbxx_hal_pcd.h"
+#endif /* HAL_PCD_MODULE_ENABLED */
+
+#ifdef HAL_PKA_MODULE_ENABLED
+ #include "stm32wbxx_hal_pka.h"
+#endif /* HAL_PKA_MODULE_ENABLED */
+
+#ifdef HAL_PWR_MODULE_ENABLED
+ #include "stm32wbxx_hal_pwr.h"
+#endif /* HAL_PWR_MODULE_ENABLED */
+
+#ifdef HAL_QSPI_MODULE_ENABLED
+ #include "stm32wbxx_hal_qspi.h"
+#endif /* HAL_QSPI_MODULE_ENABLED */
+
+#ifdef HAL_RCC_MODULE_ENABLED
+ #include "stm32wbxx_hal_rcc.h"
+#endif /* HAL_RCC_MODULE_ENABLED */
+
+#ifdef HAL_RNG_MODULE_ENABLED
+ #include "stm32wbxx_hal_rng.h"
+#endif /* HAL_RNG_MODULE_ENABLED */
+
+#ifdef HAL_RTC_MODULE_ENABLED
+ #include "stm32wbxx_hal_rtc.h"
+#endif /* HAL_RTC_MODULE_ENABLED */
+
+#ifdef HAL_SAI_MODULE_ENABLED
+ #include "stm32wbxx_hal_sai.h"
+#endif /* HAL_SAI_MODULE_ENABLED */
+
+#ifdef HAL_SMARTCARD_MODULE_ENABLED
+ #include "stm32wbxx_hal_smartcard.h"
+#endif /* HAL_SMARTCARD_MODULE_ENABLED */
+
+#ifdef HAL_SMBUS_MODULE_ENABLED
+ #include "stm32wbxx_hal_smbus.h"
+#endif /* HAL_SMBUS_MODULE_ENABLED */
+
+#ifdef HAL_SPI_MODULE_ENABLED
+ #include "stm32wbxx_hal_spi.h"
+#endif /* HAL_SPI_MODULE_ENABLED */
+
+#ifdef HAL_TIM_MODULE_ENABLED
+ #include "stm32wbxx_hal_tim.h"
+#endif /* HAL_TIM_MODULE_ENABLED */
+
+#ifdef HAL_TSC_MODULE_ENABLED
+ #include "stm32wbxx_hal_tsc.h"
+#endif /* HAL_TSC_MODULE_ENABLED */
+
+#ifdef HAL_UART_MODULE_ENABLED
+ #include "stm32wbxx_hal_uart.h"
+#endif /* HAL_UART_MODULE_ENABLED */
+
+#ifdef HAL_USART_MODULE_ENABLED
+ #include "stm32wbxx_hal_usart.h"
+#endif /* HAL_USART_MODULE_ENABLED */
+
+#ifdef HAL_WWDG_MODULE_ENABLED
+ #include "stm32wbxx_hal_wwdg.h"
+#endif /* HAL_WWDG_MODULE_ENABLED */
+
+/* Exported macro ------------------------------------------------------------*/
+#ifdef USE_FULL_ASSERT
+/**
+ * @brief The assert_param macro is used for function's parameters check.
+ * @param expr If expr is false, it calls assert_failed function
+ * which reports the name of the source file and the source
+ * line number of the call that failed.
+ * If expr is true, it returns no value.
+ * @retval None
+ */
+ #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
+/* Exported functions ------------------------------------------------------- */
+ void assert_failed(uint8_t* file, uint32_t line);
+#else
+ #define assert_param(expr) ((void)0U)
+#endif /* USE_FULL_ASSERT */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __STM32WBxx_HAL_CONF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/stm32wbxx_it.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/stm32wbxx_it.h
new file mode 100644
index 000000000..a3a535f13
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/stm32wbxx_it.h
@@ -0,0 +1,83 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file stm32wbxx_it.h
+ * @brief This file contains the headers of the interrupt handlers.
+ *******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32WBxx_IT_H
+#define __STM32WBxx_IT_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+#include "app_common.h"
+/* USER CODE END Includes */
+
+/* Exported types ------------------------------------------------------------*/
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* Exported macro ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions prototypes ---------------------------------------------*/
+void NMI_Handler(void);
+void HardFault_Handler(void);
+void MemManage_Handler(void);
+void BusFault_Handler(void);
+void UsageFault_Handler(void);
+void SVC_Handler(void);
+void DebugMon_Handler(void);
+void PendSV_Handler(void);
+void SysTick_Handler(void);
+void PVD_PVM_IRQHandler(void);
+void FLASH_IRQHandler(void);
+void RCC_IRQHandler(void);
+void DMA1_Channel1_IRQHandler(void);
+void DMA1_Channel2_IRQHandler(void);
+void C2SEV_PWR_C2H_IRQHandler(void);
+void USART1_IRQHandler(void);
+void LPUART1_IRQHandler(void);
+void PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler(void);
+void HSEM_IRQHandler(void);
+void FPU_IRQHandler(void);
+/* USER CODE BEGIN EFP */
+void RTC_WKUP_IRQHandler(void);
+void EXTI4_IRQHandler(void);
+void IPCC_C1_TX_IRQHandler(void);
+void IPCC_C1_RX_IRQHandler(void);
+/* USER CODE END EFP */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __STM32WBxx_IT_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/stm_logging.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/stm_logging.h
new file mode 100644
index 000000000..58877c570
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/stm_logging.h
@@ -0,0 +1,55 @@
+/**
+ ******************************************************************************
+ * File Name : stm_logging.h
+ * Description : Application header file for logging
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+#ifndef STM_LOGGING_H_
+#define STM_LOGGING_H_
+
+#define LOG_LEVEL_NONE 0 /* None */
+#define LOG_LEVEL_CRIT 1U /* Critical */
+#define LOG_LEVEL_WARN 2U /* Warning */
+#define LOG_LEVEL_INFO 3U /* Info */
+#define LOG_LEVEL_DEBG 4U /* Debug */
+
+#define APP_DBG_FULL(level, region, ...) \
+ if (APPLI_PRINT_FILE_FUNC_LINE == 1U) \
+ { \
+ printf("\r\n[%s][%s][%d] ", DbgTraceGetFileName(__FILE__), __FUNCTION__, __LINE__); \
+ } \
+ logApplication(level, region, __VA_ARGS__);
+
+#define APP_DBG(...) \
+ if (APPLI_PRINT_FILE_FUNC_LINE == 1U) \
+ { \
+ printf("\r\n[%s][%s][%d] ", DbgTraceGetFileName(__FILE__), __FUNCTION__, __LINE__); \
+ } \
+ logApplication(LOG_LEVEL_NONE, APPLI_LOG_REGION_GENERAL, __VA_ARGS__);
+
+/**
+ * This enumeration represents log regions.
+ *
+ */
+typedef enum {
+ APPLI_LOG_REGION_GENERAL = 1U, /* General */
+ APPLI_LOG_REGION_ZIGBEE_API = 2U, /* OpenThread API */
+} appliLogRegion_t;
+
+typedef uint8_t appliLogLevel_t;
+
+void logApplication(appliLogLevel_t aLogLevel, appliLogRegion_t aLogRegion, const char *aFormat, ...);
+
+#endif /* STM_LOGGING_H_ */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/utilities_conf.h
new file mode 100644
index 000000000..4dde3509a
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Inc/utilities_conf.h
@@ -0,0 +1,68 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : utilities_conf.h
+ * Description : Configuration file for STM32 Utilities.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef UTILITIES_CONF_H
+#define UTILITIES_CONF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "cmsis_compiler.h"
+#include "string.h"
+
+/******************************************************************************
+ * common
+ ******************************************************************************/
+#define UTILS_ENTER_CRITICAL_SECTION( ) uint32_t primask_bit = __get_PRIMASK( );\
+ __disable_irq( )
+
+#define UTILS_EXIT_CRITICAL_SECTION( ) __set_PRIMASK( primask_bit )
+
+#define UTILS_MEMSET8( dest, value, size ) memset( dest, value, size);
+
+/******************************************************************************
+ * tiny low power manager
+ * (any macro that does not need to be modified can be removed)
+ ******************************************************************************/
+#define UTIL_LPM_INIT_CRITICAL_SECTION( )
+#define UTIL_LPM_ENTER_CRITICAL_SECTION( ) UTILS_ENTER_CRITICAL_SECTION( )
+#define UTIL_LPM_EXIT_CRITICAL_SECTION( ) UTILS_EXIT_CRITICAL_SECTION( )
+
+/******************************************************************************
+ * sequencer
+ * (any macro that does not need to be modified can be removed)
+ ******************************************************************************/
+#define UTIL_SEQ_INIT_CRITICAL_SECTION( )
+#define UTIL_SEQ_ENTER_CRITICAL_SECTION( ) UTILS_ENTER_CRITICAL_SECTION( )
+#define UTIL_SEQ_EXIT_CRITICAL_SECTION( ) UTILS_EXIT_CRITICAL_SECTION( )
+#define UTIL_SEQ_CONF_TASK_NBR (32)
+#define UTIL_SEQ_CONF_PRIO_NBR (2)
+#define UTIL_SEQ_MEMSET8( dest, value, size ) UTILS_MEMSET8( dest, value, size )
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*UTILITIES_CONF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/app_entry.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/app_entry.c
new file mode 100644
index 000000000..901f796a0
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/app_entry.c
@@ -0,0 +1,396 @@
+/**
+ ******************************************************************************
+ * File Name : app_entry.c
+ * Description : Entry application source file for STM32WPAN Middleware.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "main.h"
+#include "app_entry.h"
+#include "app_zigbee.h"
+#include "app_conf.h"
+#include "hw_conf.h"
+#include "stm32_seq.h"
+#include "stm_logging.h"
+#include "shci_tl.h"
+#include "stm32_lpm.h"
+#include "dbg_trace.h"
+#include "shci.h"
+
+/* Private includes -----------------------------------------------------------*/
+
+/* Private typedef -----------------------------------------------------------*/
+extern RTC_HandleTypeDef hrtc;
+
+/* Private defines -----------------------------------------------------------*/
+#define POOL_SIZE (CFG_TL_EVT_QUEUE_LENGTH * 4U * DIVC((sizeof(TL_PacketHeader_t) + TL_EVENT_FRAME_SIZE), 4U))
+
+/* Private variables ---------------------------------------------------------*/
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t EvtPool[POOL_SIZE];
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static TL_CmdPacket_t SystemCmdBuffer;
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t SystemSpareEvtBuffer[sizeof(TL_PacketHeader_t) + TL_EVT_HDR_SIZE + 255U];
+
+/* Global function prototypes -----------------------------------------------*/
+size_t __write(int handle, const unsigned char *buf, size_t bufSize);
+
+/* Private functions prototypes-----------------------------------------------*/
+static void SystemPower_Config(void);
+static void Init_Debug(void);
+static void appe_Tl_Init(void);
+static void APPE_SysStatusNot(SHCI_TL_CmdStatus_t status);
+static void APPE_SysUserEvtRx(void *pPayload);
+static void APPE_SysEvtReadyProcessing(void);
+static void APPE_SysEvtError(SCHI_SystemErrCode_t ErrorCode);
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+extern void MX_LPUART1_UART_Init(void);
+#endif
+#if (CFG_HW_USART1_ENABLED == 1)
+extern void MX_USART1_UART_Init(void);
+#endif
+
+/* USER CODE BEGIN PFP */
+static void Led_Init(void);
+static void Button_Init(void);
+/* USER CODE END PFP */
+
+/* Functions Definition ------------------------------------------------------*/
+void APPE_Init( void )
+{
+ SystemPower_Config(); /**< Configure the system Power Mode */
+
+ HW_TS_Init(hw_ts_InitMode_Full, &hrtc); /**< Initialize the TimerServer */
+
+ Init_Debug();
+ /**
+ * The Standby mode should not be entered before the initialization is over
+ * The default state of the Low Power Manager is to allow the Standby Mode so an request is needed here
+ */
+ UTIL_LPM_SetOffMode(1 << CFG_LPM_APP, UTIL_LPM_DISABLE);
+ Led_Init();
+ Button_Init();
+ appe_Tl_Init(); /* Initialize all transport layers */
+
+ /**
+ * From now, the application is waiting for the ready event ( VS_HCI_C2_Ready )
+ * received on the system channel before starting the Zigbee Stack
+ * This system event is received with APPE_SysUserEvtRx()
+ */
+
+ return;
+}
+
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+static void Init_Debug( void )
+{
+#if (CFG_DEBUGGER_SUPPORTED == 1)
+ /**
+ * Keep debugger enabled while in any low power mode
+ */
+ HAL_DBGMCU_EnableDBGSleepMode();
+
+ /***************** ENABLE DEBUGGER *************************************/
+ LL_EXTI_EnableIT_32_63(LL_EXTI_LINE_48);
+ LL_C2_EXTI_EnableIT_32_63(LL_EXTI_LINE_48);
+
+#else
+
+ GPIO_InitTypeDef gpio_config = {0};
+
+ gpio_config.Pull = GPIO_NOPULL;
+ gpio_config.Mode = GPIO_MODE_ANALOG;
+
+ gpio_config.Pin = GPIO_PIN_15 | GPIO_PIN_14 | GPIO_PIN_13;
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ HAL_GPIO_Init(GPIOA, &gpio_config);
+ __HAL_RCC_GPIOA_CLK_DISABLE();
+
+ gpio_config.Pin = GPIO_PIN_4 | GPIO_PIN_3;
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+ HAL_GPIO_Init(GPIOB, &gpio_config);
+ __HAL_RCC_GPIOB_CLK_DISABLE();
+
+ HAL_DBGMCU_DisableDBGSleepMode();
+ HAL_DBGMCU_DisableDBGStopMode();
+ HAL_DBGMCU_DisableDBGStandbyMode();
+
+#endif /* (CFG_DEBUGGER_SUPPORTED == 1) */
+
+#if(CFG_DEBUG_TRACE != 0)
+ DbgTraceInit();
+#endif
+
+ return;
+}
+
+/**
+ * @brief Configure the system for power optimization
+ *
+ * @note This API configures the system to be ready for low power mode
+ *
+ * @param None
+ * @retval None
+ */
+static void SystemPower_Config( void )
+{
+
+ /**
+ * Select HSI as system clock source after Wake Up from Stop mode
+ */
+ LL_RCC_SetClkAfterWakeFromStop(LL_RCC_STOP_WAKEUPCLOCK_HSI);
+
+ /* Initialize low power manager */
+ UTIL_LPM_Init( );
+
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+ /**
+ * Enable USB power
+ */
+ HAL_PWREx_EnableVddUSB();
+#endif
+
+ return;
+}
+
+static void appe_Tl_Init( void )
+{
+ TL_MM_Config_t tl_mm_config;
+ SHCI_TL_HciInitConf_t SHci_Tl_Init_Conf;
+ /**< Reference table initialization */
+ TL_Init();
+
+ /**< System channel initialization */
+ UTIL_SEQ_RegTask( 1<< CFG_TASK_SYSTEM_HCI_ASYNCH_EVT, UTIL_SEQ_RFU, shci_user_evt_proc );
+ SHci_Tl_Init_Conf.p_cmdbuffer = (uint8_t*)&SystemCmdBuffer;
+ SHci_Tl_Init_Conf.StatusNotCallBack = APPE_SysStatusNot;
+ shci_init(APPE_SysUserEvtRx, (void*) &SHci_Tl_Init_Conf);
+
+ /**< Memory Manager channel initialization */
+ tl_mm_config.p_BleSpareEvtBuffer = 0;
+ tl_mm_config.p_SystemSpareEvtBuffer = SystemSpareEvtBuffer;
+ tl_mm_config.p_AsynchEvtPool = EvtPool;
+ tl_mm_config.AsynchEvtPoolSize = POOL_SIZE;
+ TL_MM_Init( &tl_mm_config );
+
+ TL_Enable();
+
+ return;
+}
+
+
+static void APPE_SysStatusNot(SHCI_TL_CmdStatus_t status)
+{
+ UNUSED(status);
+ return;
+}
+
+/**
+ * @brief Trap a notification coming from the M0 firmware
+ * @param pPayload : payload associated to the notification
+ *
+ * @retval None
+ */
+
+static void APPE_SysUserEvtRx( void * pPayload )
+{
+ TL_AsynchEvt_t *p_sys_event;
+ p_sys_event = (TL_AsynchEvt_t*)(((tSHCI_UserEvtRxParam*)pPayload)->pckt->evtserial.evt.payload);
+
+ switch(p_sys_event->subevtcode)
+ {
+ case SHCI_SUB_EVT_CODE_READY:
+ APPE_SysEvtReadyProcessing();
+ break;
+ case SHCI_SUB_EVT_ERROR_NOTIF:
+ APPE_SysEvtError((SCHI_SystemErrCode_t) (p_sys_event->payload[0]));
+ break;
+ default:
+ break;
+ }
+ return;
+}
+
+/**
+ * @brief Notify a system error coming from the M0 firmware
+ * @param ErrorCode : errorCode detected by the M0 firmware
+ *
+ * @retval None
+ */
+static void APPE_SysEvtError( SCHI_SystemErrCode_t ErrorCode)
+{
+ switch (ErrorCode) // TODO
+ {
+ case ERR_THREAD_LLD_FATAL_ERROR:
+ APP_DBG("** ERR_ZIGBEE : LLD_FATAL_ERROR \n");
+ break;
+ case ERR_THREAD_UNKNOWN_CMD:
+ APP_DBG("** ERR_ZIGBEE : UNKNOWN_CMD \n");
+ break;
+ default:
+ APP_DBG("** ERR_ZIGBEE : ErroCode=%d \n", ErrorCode);
+ break;
+ }
+ return;
+}
+
+static void APPE_SysEvtReadyProcessing( void )
+{
+ /* Traces channel initialization */
+ TL_TRACES_Init();
+
+ APP_ZIGBEE_Init();
+ UTIL_LPM_SetOffMode(1U << CFG_LPM_APP, UTIL_LPM_ENABLE);
+ return;
+}
+
+/* USER CODE BEGIN FD_LOCAL_FUNCTIONS */
+static void Led_Init( void )
+{
+#if (CFG_LED_SUPPORTED == 1U)
+ /**
+ * Leds Initialization
+ */
+
+ BSP_LED_Init(LED_BLUE);
+ BSP_LED_Init(LED_GREEN);
+ BSP_LED_Init(LED_RED);
+
+#endif
+
+ return;
+}
+
+static void Button_Init( void )
+{
+#if (CFG_BUTTON_SUPPORTED == 1U)
+ /**
+ * Button Initialization
+ */
+ BSP_PB_Init(BUTTON_SW1, BUTTON_MODE_EXTI);
+ BSP_PB_Init(BUTTON_SW2, BUTTON_MODE_EXTI);
+ BSP_PB_Init(BUTTON_SW3, BUTTON_MODE_EXTI);
+#endif
+
+ return;
+}
+
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+
+void UTIL_SEQ_Idle( void )
+{
+#if ( CFG_LPM_SUPPORTED == 1)
+ UTIL_LPM_EnterLowPower( );
+#endif
+ return;
+}
+
+/**
+ * @brief This function is called by the scheduler each time an event
+ * is pending.
+ *
+ * @param evt_waited_bm : Event pending.
+ * @retval None
+ */
+void UTIL_SEQ_EvtIdle( UTIL_SEQ_bm_t task_id_bm, UTIL_SEQ_bm_t evt_waited_bm )
+{
+ switch (evt_waited_bm) {
+ case EVENT_ACK_FROM_M0_EVT:
+ /* Run only the task CFG_TASK_MSG_FROM_M0_TO_M4 */
+ UTIL_SEQ_Run((1U << CFG_TASK_MSG_FROM_M0_TO_M4));
+ break;
+ case EVENT_SYNCHRO_BYPASS_IDLE:
+ UTIL_SEQ_SetEvt(EVENT_SYNCHRO_BYPASS_IDLE);
+ /* Run only the task CFG_TASK_MSG_FROM_M0_TO_M4 */
+ UTIL_SEQ_Run((1U << CFG_TASK_MSG_FROM_M0_TO_M4));
+ break;
+
+ default:
+ /* default case */
+ UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
+ break;
+ }
+}
+
+void shci_notify_asynch_evt(void* pdata)
+{
+ UNUSED(pdata);
+ UTIL_SEQ_SetTask(1U << CFG_TASK_SYSTEM_HCI_ASYNCH_EVT, CFG_SCH_PRIO_0);
+ return;
+}
+
+void shci_cmd_resp_release(uint32_t flag)
+{
+ UNUSED(flag);
+ UTIL_SEQ_SetEvt(1U << CFG_EVT_SYSTEM_HCI_CMD_EVT_RESP);
+ return;
+}
+
+void shci_cmd_resp_wait(uint32_t timeout)
+{
+ UNUSED(timeout);
+ UTIL_SEQ_WaitEvt(1U << CFG_EVT_SYSTEM_HCI_CMD_EVT_RESP);
+ return;
+}
+
+/* Received trace buffer from M0 */
+void TL_TRACES_EvtReceived( TL_EvtPacket_t * hcievt )
+{
+#if(CFG_DEBUG_TRACE != 0)
+ /* Call write/print function using DMA from dbg_trace */
+ /* - Cast to TL_AsynchEvt_t* to get "real" payload (without Sub Evt code 2bytes),
+ - (-2) to size to remove Sub Evt Code */
+ DbgTraceWrite(1U, (const unsigned char *) ((TL_AsynchEvt_t *)(hcievt->evtserial.evt.payload))->payload, hcievt->evtserial.evt.plen - 2U);
+#endif /* CFG_DEBUG_TRACE */
+ /* Release buffer */
+ TL_MM_EvtDone( hcievt );
+}
+/**
+ * @brief Initialisation of the trace mechanism
+ * @param None
+ * @retval None
+ */
+#if(CFG_DEBUG_TRACE != 0)
+void DbgOutputInit( void )
+{
+ MX_USART1_UART_Init();
+
+ return;
+}
+
+/**
+ * @brief Management of the traces
+ * @param p_data : data
+ * @param size : size
+ * @param call-back :
+ * @retval None
+ */
+void DbgOutputTraces( uint8_t *p_data, uint16_t size, void (*cb)(void) )
+{
+ HW_UART_Transmit_DMA(CFG_DEBUG_TRACE_UART, p_data, size, cb);
+
+ return;
+}
+#endif
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/hw_timerserver.c
new file mode 100644
index 000000000..c842ba55e
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/hw_timerserver.c
@@ -0,0 +1,893 @@
+/**
+ ******************************************************************************
+ * File Name : hw_timerserver.c
+ * Description : Hardware timerserver source file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "hw_conf.h"
+
+/* Private typedef -----------------------------------------------------------*/
+typedef enum
+{
+ TimerID_Free,
+ TimerID_Created,
+ TimerID_Running
+}TimerIDStatus_t;
+
+typedef enum
+{
+ SSR_Read_Requested,
+ SSR_Read_Not_Requested
+}RequestReadSSR_t;
+
+typedef enum
+{
+ WakeupTimerValue_Overpassed,
+ WakeupTimerValue_LargeEnough
+}WakeupTimerLimitation_Status_t;
+
+typedef struct
+{
+ HW_TS_pTimerCb_t pTimerCallBack;
+ uint32_t CounterInit;
+ uint32_t CountLeft;
+ TimerIDStatus_t TimerIDStatus;
+ HW_TS_Mode_t TimerMode;
+ uint32_t TimerProcessID;
+ uint8_t PreviousID;
+ uint8_t NextID;
+}TimerContext_t;
+
+/* Private defines -----------------------------------------------------------*/
+#define SSR_FORBIDDEN_VALUE 0xFFFFFFFF
+#define TIMER_LIST_EMPTY 0xFFFF
+
+/* Private macros ------------------------------------------------------------*/
+/* Private variables ---------------------------------------------------------*/
+
+/**
+ * START of Section TIMERSERVER_CONTEXT
+ */
+
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile TimerContext_t aTimerContext[CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER];
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile uint8_t CurrentRunningTimerID;
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile uint8_t PreviousRunningTimerID;
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile uint32_t SSRValueOnLastSetup;
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile WakeupTimerLimitation_Status_t WakeupTimerLimitation;
+
+/**
+ * END of Section TIMERSERVER_CONTEXT
+ */
+
+static RTC_HandleTypeDef *phrtc; /**< RTC handle */
+static uint8_t WakeupTimerDivider;
+static uint8_t AsynchPrescalerUserConfig;
+static uint16_t SynchPrescalerUserConfig;
+static volatile uint16_t MaxWakeupTimerSetup;
+
+/* Global variables ----------------------------------------------------------*/
+/* Private function prototypes -----------------------------------------------*/
+static void RestartWakeupCounter(uint16_t Value);
+static uint16_t ReturnTimeElapsed(void);
+static void RescheduleTimerList(void);
+static void UnlinkTimer(uint8_t TimerID, RequestReadSSR_t RequestReadSSR);
+static void LinkTimerBefore(uint8_t TimerID, uint8_t RefTimerID);
+static void LinkTimerAfter(uint8_t TimerID, uint8_t RefTimerID);
+static uint16_t linkTimer(uint8_t TimerID);
+static uint32_t ReadRtcSsrValue(void);
+
+__weak void HW_TS_RTC_CountUpdated_AppNot(void);
+
+/* Functions Definition ------------------------------------------------------*/
+
+/**
+ * @brief Read the RTC_SSR value
+ * As described in the reference manual, the RTC_SSR shall be read twice to ensure
+ * reliability of the value
+ * @param None
+ * @retval SSR value read
+ */
+static uint32_t ReadRtcSsrValue(void)
+{
+ uint32_t first_read;
+ uint32_t second_read;
+
+ first_read = (uint32_t)(READ_BIT(RTC->SSR, RTC_SSR_SS));
+
+ second_read = (uint32_t)(READ_BIT(RTC->SSR, RTC_SSR_SS));
+
+ while(first_read != second_read)
+ {
+ first_read = second_read;
+
+ second_read = (uint32_t)(READ_BIT(RTC->SSR, RTC_SSR_SS));
+ }
+
+ return second_read;
+}
+
+/**
+ * @brief Insert a Timer in the list after the Timer ID specified
+ * @param TimerID: The ID of the Timer
+ * @param RefTimerID: The ID of the Timer to be linked after
+ * @retval None
+ */
+static void LinkTimerAfter(uint8_t TimerID, uint8_t RefTimerID)
+{
+ uint8_t next_id;
+
+ next_id = aTimerContext[RefTimerID].NextID;
+
+ if(next_id != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ aTimerContext[next_id].PreviousID = TimerID;
+ }
+ aTimerContext[TimerID].NextID = next_id;
+ aTimerContext[TimerID].PreviousID = RefTimerID ;
+ aTimerContext[RefTimerID].NextID = TimerID;
+
+ return;
+}
+
+/**
+ * @brief Insert a Timer in the list before the ID specified
+ * @param TimerID: The ID of the Timer
+ * @param RefTimerID: The ID of the Timer to be linked before
+ * @retval None
+ */
+static void LinkTimerBefore(uint8_t TimerID, uint8_t RefTimerID)
+{
+ uint8_t previous_id;
+
+ if(RefTimerID != CurrentRunningTimerID)
+ {
+ previous_id = aTimerContext[RefTimerID].PreviousID;
+
+ aTimerContext[previous_id].NextID = TimerID;
+ aTimerContext[TimerID].NextID = RefTimerID;
+ aTimerContext[TimerID].PreviousID = previous_id ;
+ aTimerContext[RefTimerID].PreviousID = TimerID;
+ }
+ else
+ {
+ aTimerContext[TimerID].NextID = RefTimerID;
+ aTimerContext[RefTimerID].PreviousID = TimerID;
+ }
+
+ return;
+}
+
+/**
+ * @brief Insert a Timer in the list
+ * @param TimerID: The ID of the Timer
+ * @retval None
+ */
+static uint16_t linkTimer(uint8_t TimerID)
+{
+ uint32_t time_left;
+ uint16_t time_elapsed;
+ uint8_t timer_id_lookup;
+ uint8_t next_id;
+
+ if(CurrentRunningTimerID == CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ /**
+ * No timer in the list
+ */
+ PreviousRunningTimerID = CurrentRunningTimerID;
+ CurrentRunningTimerID = TimerID;
+ aTimerContext[TimerID].NextID = CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER;
+
+ SSRValueOnLastSetup = SSR_FORBIDDEN_VALUE;
+ time_elapsed = 0;
+ }
+ else
+ {
+ time_elapsed = ReturnTimeElapsed();
+
+ /**
+ * update count of the timer to be linked
+ */
+ aTimerContext[TimerID].CountLeft += time_elapsed;
+ time_left = aTimerContext[TimerID].CountLeft;
+
+ /**
+ * Search for index where the new timer shall be linked
+ */
+ if(aTimerContext[CurrentRunningTimerID].CountLeft <= time_left)
+ {
+ /**
+ * Search for the ID after the first one
+ */
+ timer_id_lookup = CurrentRunningTimerID;
+ next_id = aTimerContext[timer_id_lookup].NextID;
+ while((next_id != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) && (aTimerContext[next_id].CountLeft <= time_left))
+ {
+ timer_id_lookup = aTimerContext[timer_id_lookup].NextID;
+ next_id = aTimerContext[timer_id_lookup].NextID;
+ }
+
+ /**
+ * Link after the ID
+ */
+ LinkTimerAfter(TimerID, timer_id_lookup);
+ }
+ else
+ {
+ /**
+ * Link before the first ID
+ */
+ LinkTimerBefore(TimerID, CurrentRunningTimerID);
+ PreviousRunningTimerID = CurrentRunningTimerID;
+ CurrentRunningTimerID = TimerID;
+ }
+ }
+
+ return time_elapsed;
+}
+
+/**
+ * @brief Remove a Timer from the list
+ * @param TimerID: The ID of the Timer
+ * @param RequestReadSSR: Request to read the SSR register or not
+ * @retval None
+ */
+static void UnlinkTimer(uint8_t TimerID, RequestReadSSR_t RequestReadSSR)
+{
+ uint8_t previous_id;
+ uint8_t next_id;
+
+ if(TimerID == CurrentRunningTimerID)
+ {
+ PreviousRunningTimerID = CurrentRunningTimerID;
+ CurrentRunningTimerID = aTimerContext[TimerID].NextID;
+ }
+ else
+ {
+ previous_id = aTimerContext[TimerID].PreviousID;
+ next_id = aTimerContext[TimerID].NextID;
+
+ aTimerContext[previous_id].NextID = aTimerContext[TimerID].NextID;
+ if(next_id != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ aTimerContext[next_id].PreviousID = aTimerContext[TimerID].PreviousID;
+ }
+ }
+
+ /**
+ * Timer is out of the list
+ */
+ aTimerContext[TimerID].TimerIDStatus = TimerID_Created;
+
+ if((CurrentRunningTimerID == CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) && (RequestReadSSR == SSR_Read_Requested))
+ {
+ SSRValueOnLastSetup = SSR_FORBIDDEN_VALUE;
+ }
+
+ return;
+}
+
+/**
+ * @brief Return the number of ticks counted by the wakeuptimer since it has been started
+ * @note The API is reading the SSR register to get how many ticks have been counted
+ * since the time the timer has been started
+ * @param None
+ * @retval Time expired in Ticks
+ */
+static uint16_t ReturnTimeElapsed(void)
+{
+ uint32_t return_value;
+ uint32_t wrap_counter;
+
+ if(SSRValueOnLastSetup != SSR_FORBIDDEN_VALUE)
+ {
+ return_value = ReadRtcSsrValue(); /**< Read SSR register first */
+
+ if (SSRValueOnLastSetup >= return_value)
+ {
+ return_value = SSRValueOnLastSetup - return_value;
+ }
+ else
+ {
+ wrap_counter = SynchPrescalerUserConfig - return_value;
+ return_value = SSRValueOnLastSetup + wrap_counter;
+ }
+
+ /**
+ * At this stage, ReturnValue holds the number of ticks counted by SSR
+ * Need to translate in number of ticks counted by the Wakeuptimer
+ */
+ return_value = return_value*AsynchPrescalerUserConfig;
+ return_value = return_value >> WakeupTimerDivider;
+ }
+ else
+ {
+ return_value = 0;
+ }
+
+ return (uint16_t)return_value;
+}
+
+/**
+ * @brief Set the wakeup counter
+ * @note The API is writing the counter value so that the value is decreased by one to cope with the fact
+ * the interrupt is generated with 1 extra clock cycle (See RefManuel)
+ * It assumes all condition are met to be allowed to write the wakeup counter
+ * @param Value: Value to be written in the counter
+ * @retval None
+ */
+static void RestartWakeupCounter(uint16_t Value)
+{
+ /**
+ * The wakeuptimer has been disabled in the calling function to reduce the time to poll the WUTWF
+ * FLAG when the new value will have to be written
+ * __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc);
+ */
+
+ if(Value == 0)
+ {
+ SSRValueOnLastSetup = ReadRtcSsrValue();
+
+ /**
+ * Simulate that the Timer expired
+ */
+ HAL_NVIC_SetPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID);
+ }
+ else
+ {
+ if((Value > 1) ||(WakeupTimerDivider != 1))
+ {
+ Value -= 1;
+ }
+
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == RESET);
+
+ /**
+ * make sure to clear the flags after checking the WUTWF.
+ * It takes 2 RTCCLK between the time the WUTE bit is disabled and the
+ * time the timer is disabled. The WUTWF bit somehow guarantee the system is stable
+ * Otherwise, when the timer is periodic with 1 Tick, it may generate an extra interrupt in between
+ * due to the autoreload feature
+ */
+ __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */
+ __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */
+ HAL_NVIC_ClearPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Clear pending bit in NVIC */
+
+ MODIFY_REG(RTC->WUTR, RTC_WUTR_WUT, Value);
+
+ /**
+ * Update the value here after the WUTWF polling that may take some time
+ */
+ SSRValueOnLastSetup = ReadRtcSsrValue();
+
+ __HAL_RTC_WAKEUPTIMER_ENABLE(phrtc); /**< Enable the Wakeup Timer */
+
+ HW_TS_RTC_CountUpdated_AppNot();
+ }
+
+ return ;
+}
+
+/**
+ * @brief Reschedule the list of timer
+ * @note 1) Update the count left for each timer in the list
+ * 2) Setup the wakeuptimer
+ * @param None
+ * @retval None
+ */
+static void RescheduleTimerList(void)
+{
+ uint8_t localTimerID;
+ uint32_t timecountleft;
+ uint16_t wakeup_timer_value;
+ uint16_t time_elapsed;
+
+ /**
+ * The wakeuptimer is disabled now to reduce the time to poll the WUTWF
+ * FLAG when the new value will have to be written
+ */
+ if((READ_BIT(RTC->CR, RTC_CR_WUTE) == (RTC_CR_WUTE)) == SET)
+ {
+ /**
+ * Wait for the flag to be back to 0 when the wakeup timer is enabled
+ */
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == SET);
+ }
+ __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc); /**< Disable the Wakeup Timer */
+
+ localTimerID = CurrentRunningTimerID;
+
+ /**
+ * Calculate what will be the value to write in the wakeuptimer
+ */
+ timecountleft = aTimerContext[localTimerID].CountLeft;
+
+ /**
+ * Read how much has been counted
+ */
+ time_elapsed = ReturnTimeElapsed();
+
+ if(timecountleft < time_elapsed )
+ {
+ /**
+ * There is no tick left to count
+ */
+ wakeup_timer_value = 0;
+ WakeupTimerLimitation = WakeupTimerValue_LargeEnough;
+ }
+ else
+ {
+ if(timecountleft > (time_elapsed + MaxWakeupTimerSetup))
+ {
+ /**
+ * The number of tick left is greater than the Wakeuptimer maximum value
+ */
+ wakeup_timer_value = MaxWakeupTimerSetup;
+
+ WakeupTimerLimitation = WakeupTimerValue_Overpassed;
+ }
+ else
+ {
+ wakeup_timer_value = timecountleft - time_elapsed;
+ WakeupTimerLimitation = WakeupTimerValue_LargeEnough;
+ }
+
+ }
+
+ /**
+ * update ticks left to be counted for each timer
+ */
+ while(localTimerID != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ if (aTimerContext[localTimerID].CountLeft < time_elapsed)
+ {
+ aTimerContext[localTimerID].CountLeft = 0;
+ }
+ else
+ {
+ aTimerContext[localTimerID].CountLeft -= time_elapsed;
+ }
+ localTimerID = aTimerContext[localTimerID].NextID;
+ }
+
+ /**
+ * Write next count
+ */
+ RestartWakeupCounter(wakeup_timer_value);
+
+ return ;
+}
+
+/* Public functions ----------------------------------------------------------*/
+
+/**
+ * For all public interface except that may need write access to the RTC, the RTC
+ * shall be unlock at the beginning and locked at the output
+ * In order to ease maintainability, the unlock is done at the top and the lock at then end
+ * in case some new implementation is coming in the future
+ */
+
+void HW_TS_RTC_Wakeup_Handler(void)
+{
+ HW_TS_pTimerCb_t ptimer_callback;
+ uint32_t timer_process_id;
+ uint8_t local_current_running_timer_id;
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ uint32_t primask_bit;
+#endif
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+#endif
+
+/* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+
+ /**
+ * Disable the Wakeup Timer
+ * This may speed up a bit the processing to wait the timer to be disabled
+ * The timer is still counting 2 RTCCLK
+ */
+ __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc);
+
+ local_current_running_timer_id = CurrentRunningTimerID;
+
+ if(aTimerContext[local_current_running_timer_id].TimerIDStatus == TimerID_Running)
+ {
+ ptimer_callback = aTimerContext[local_current_running_timer_id].pTimerCallBack;
+ timer_process_id = aTimerContext[local_current_running_timer_id].TimerProcessID;
+
+ /**
+ * It should be good to check whether the TimeElapsed is greater or not than the tick left to be counted
+ * However, due to the inaccuracy of the reading of the time elapsed, it may return there is 1 tick
+ * to be left whereas the count is over
+ * A more secure implementation has been done with a flag to state whereas the full count has been written
+ * in the wakeuptimer or not
+ */
+ if(WakeupTimerLimitation != WakeupTimerValue_Overpassed)
+ {
+ if(aTimerContext[local_current_running_timer_id].TimerMode == hw_ts_Repeated)
+ {
+ UnlinkTimer(local_current_running_timer_id, SSR_Read_Not_Requested);
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+ HW_TS_Start(local_current_running_timer_id, aTimerContext[local_current_running_timer_id].CounterInit);
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+ }
+ else
+ {
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+ HW_TS_Stop(local_current_running_timer_id);
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+ }
+
+ HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
+ }
+ else
+ {
+ RescheduleTimerList();
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+ }
+ }
+ else
+ {
+ /**
+ * We should never end up in this case
+ * However, if due to any bug in the timer server this is the case, the mistake may not impact the user.
+ * We could just clean the interrupt flag and get out from this unexpected interrupt
+ */
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == RESET);
+
+ /**
+ * make sure to clear the flags after checking the WUTWF.
+ * It takes 2 RTCCLK between the time the WUTE bit is disabled and the
+ * time the timer is disabled. The WUTWF bit somehow guarantee the system is stable
+ * Otherwise, when the timer is periodic with 1 Tick, it may generate an extra interrupt in between
+ * due to the autoreload feature
+ */
+ __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */
+ __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+ }
+
+ /* Enable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_ENABLE( phrtc );
+
+ return;
+}
+
+void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
+{
+ uint8_t loop;
+ uint32_t localmaxwakeuptimersetup;
+
+ /**
+ * Get RTC handler
+ */
+ phrtc = hrtc;
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+
+ SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
+
+ /**
+ * Readout the user config
+ */
+ WakeupTimerDivider = (4 - ((uint32_t)(READ_BIT(RTC->CR, RTC_CR_WUCKSEL))));
+
+ AsynchPrescalerUserConfig = (uint8_t)(READ_BIT(RTC->PRER, RTC_PRER_PREDIV_A) >> (uint32_t)POSITION_VAL(RTC_PRER_PREDIV_A)) + 1;
+
+ SynchPrescalerUserConfig = (uint16_t)(READ_BIT(RTC->PRER, RTC_PRER_PREDIV_S)) + 1;
+
+ /**
+ * Margin is taken to avoid wrong calculation when the wrap around is there and some
+ * application interrupts may have delayed the reading
+ */
+ localmaxwakeuptimersetup = ((((SynchPrescalerUserConfig - 1)*AsynchPrescalerUserConfig) - CFG_HW_TS_RTC_HANDLER_MAX_DELAY) >> WakeupTimerDivider);
+
+ if(localmaxwakeuptimersetup >= 0xFFFF)
+ {
+ MaxWakeupTimerSetup = 0xFFFF;
+ }
+ else
+ {
+ MaxWakeupTimerSetup = (uint16_t)localmaxwakeuptimersetup;
+ }
+
+ /**
+ * Configure EXTI module
+ */
+ LL_EXTI_EnableRisingTrig_0_31(RTC_EXTI_LINE_WAKEUPTIMER_EVENT);
+ LL_EXTI_EnableIT_0_31(RTC_EXTI_LINE_WAKEUPTIMER_EVENT);
+
+ if(TimerInitMode == hw_ts_InitMode_Full)
+ {
+ WakeupTimerLimitation = WakeupTimerValue_LargeEnough;
+ SSRValueOnLastSetup = SSR_FORBIDDEN_VALUE;
+
+ /**
+ * Initialize the timer server
+ */
+ for(loop = 0; loop < CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER; loop++)
+ {
+ aTimerContext[loop].TimerIDStatus = TimerID_Free;
+ }
+
+ CurrentRunningTimerID = CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER; /**< Set ID to non valid value */
+
+ __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc); /**< Disable the Wakeup Timer */
+ __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */
+ __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */
+ HAL_NVIC_ClearPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Clear pending bit in NVIC */
+ __HAL_RTC_WAKEUPTIMER_ENABLE_IT(phrtc, RTC_IT_WUT); /**< Enable interrupt in RTC module */
+ }
+ else
+ {
+ if(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTF) != RESET)
+ {
+ /**
+ * Simulate that the Timer expired
+ */
+ HAL_NVIC_SetPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID);
+ }
+ }
+
+ /* Enable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_ENABLE( phrtc );
+
+ HAL_NVIC_SetPriority(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID, CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO, CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO); /**< Set NVIC priority */
+ HAL_NVIC_EnableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Enable NVIC */
+
+ return;
+}
+
+HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pftimeout_handler)
+{
+ HW_TS_ReturnStatus_t localreturnstatus;
+ uint8_t loop = 0;
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ uint32_t primask_bit;
+#endif
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+#endif
+
+ while((loop < CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) && (aTimerContext[loop].TimerIDStatus != TimerID_Free))
+ {
+ loop++;
+ }
+
+ if(loop != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ aTimerContext[loop].TimerIDStatus = TimerID_Created;
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+
+ aTimerContext[loop].TimerProcessID = TimerProcessID;
+ aTimerContext[loop].TimerMode = TimerMode;
+ aTimerContext[loop].pTimerCallBack = pftimeout_handler;
+ *pTimerId = loop;
+
+ localreturnstatus = hw_ts_Successful;
+ }
+ else
+ {
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+
+ localreturnstatus = hw_ts_Failed;
+ }
+
+ return(localreturnstatus);
+}
+
+void HW_TS_Delete(uint8_t timer_id)
+{
+ HW_TS_Stop(timer_id);
+
+ aTimerContext[timer_id].TimerIDStatus = TimerID_Free; /**< release ID */
+
+ return;
+}
+
+void HW_TS_Stop(uint8_t timer_id)
+{
+ uint8_t localcurrentrunningtimerid;
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ uint32_t primask_bit;
+#endif
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+#endif
+
+ HAL_NVIC_DisableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Disable NVIC */
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+
+ if(aTimerContext[timer_id].TimerIDStatus == TimerID_Running)
+ {
+ UnlinkTimer(timer_id, SSR_Read_Requested);
+ localcurrentrunningtimerid = CurrentRunningTimerID;
+
+ if(localcurrentrunningtimerid == CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ /**
+ * List is empty
+ */
+
+ /**
+ * Disable the timer
+ */
+ if((READ_BIT(RTC->CR, RTC_CR_WUTE) == (RTC_CR_WUTE)) == SET)
+ {
+ /**
+ * Wait for the flag to be back to 0 when the wakeup timer is enabled
+ */
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == SET);
+ }
+ __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc); /**< Disable the Wakeup Timer */
+
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == RESET);
+
+ /**
+ * make sure to clear the flags after checking the WUTWF.
+ * It takes 2 RTCCLK between the time the WUTE bit is disabled and the
+ * time the timer is disabled. The WUTWF bit somehow guarantee the system is stable
+ * Otherwise, when the timer is periodic with 1 Tick, it may generate an extra interrupt in between
+ * due to the autoreload feature
+ */
+ __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */
+ __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */
+ HAL_NVIC_ClearPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Clear pending bit in NVIC */
+ }
+ else if(PreviousRunningTimerID != localcurrentrunningtimerid)
+ {
+ RescheduleTimerList();
+ }
+ }
+
+ /* Enable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_ENABLE( phrtc );
+
+ HAL_NVIC_EnableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Enable NVIC */
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+
+ return;
+}
+
+void HW_TS_Start(uint8_t timer_id, uint32_t timeout_ticks)
+{
+ uint16_t time_elapsed;
+ uint8_t localcurrentrunningtimerid;
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ uint32_t primask_bit;
+#endif
+
+ if(aTimerContext[timer_id].TimerIDStatus == TimerID_Running)
+ {
+ HW_TS_Stop( timer_id );
+ }
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+#endif
+
+ HAL_NVIC_DisableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Disable NVIC */
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+
+ aTimerContext[timer_id].TimerIDStatus = TimerID_Running;
+
+ aTimerContext[timer_id].CountLeft = timeout_ticks;
+ aTimerContext[timer_id].CounterInit = timeout_ticks;
+
+ time_elapsed = linkTimer(timer_id);
+
+ localcurrentrunningtimerid = CurrentRunningTimerID;
+
+ if(PreviousRunningTimerID != localcurrentrunningtimerid)
+ {
+ RescheduleTimerList();
+ }
+ else
+ {
+ aTimerContext[timer_id].CountLeft -= time_elapsed;
+ }
+
+ /* Enable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_ENABLE( phrtc );
+
+ HAL_NVIC_EnableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Enable NVIC */
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+
+ return;
+}
+
+uint16_t HW_TS_RTC_ReadLeftTicksToCount(void)
+{
+ uint32_t primask_bit;
+ uint16_t return_value, auro_reload_value, elapsed_time_value;
+
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+
+ if((READ_BIT(RTC->CR, RTC_CR_WUTE) == (RTC_CR_WUTE)) == SET)
+ {
+ auro_reload_value = (uint32_t)(READ_BIT(RTC->WUTR, RTC_WUTR_WUT));
+
+ elapsed_time_value = ReturnTimeElapsed();
+
+ if(auro_reload_value > elapsed_time_value)
+ {
+ return_value = auro_reload_value - elapsed_time_value;
+ }
+ else
+ {
+ return_value = 0;
+ }
+ }
+ else
+ {
+ return_value = TIMER_LIST_EMPTY;
+ }
+
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+
+ return (return_value);
+}
+
+__weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack)
+{
+ pTimerCallBack();
+
+ return;
+}
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/hw_uart.c
new file mode 100644
index 000000000..9a553610d
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/hw_uart.c
@@ -0,0 +1,318 @@
+/**
+ ******************************************************************************
+ * File Name : Src/hw_uart.c
+ * Description : HW UART source file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "hw_conf.h"
+#if (CFG_HW_LPUART1_ENABLED == 1)
+extern UART_HandleTypeDef hlpuart1;
+#endif
+#if (CFG_HW_USART1_ENABLED == 1)
+extern UART_HandleTypeDef huart1;
+#endif
+
+/* Macros --------------------------------------------------------------------*/
+#define HW_UART_RX_IT(__HANDLE__, __USART_BASE__) \
+ do{ \
+ HW_##__HANDLE__##RxCb = cb; \
+ (__HANDLE__).Instance = (__USART_BASE__); \
+ HAL_UART_Receive_IT(&(__HANDLE__), p_data, size); \
+ } while(0)
+
+#define HW_UART_TX_IT(__HANDLE__, __USART_BASE__) \
+ do{ \
+ HW_##__HANDLE__##TxCb = cb; \
+ (__HANDLE__).Instance = (__USART_BASE__); \
+ HAL_UART_Transmit_IT(&(__HANDLE__), p_data, size); \
+ } while(0)
+
+#define HW_UART_TX(__HANDLE__, __USART_BASE__) \
+ do{ \
+ (__HANDLE__).Instance = (__USART_BASE__); \
+ hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
+ } while(0)
+
+/* Variables -----------------------------------------------------------------*/
+#if (CFG_HW_USART1_ENABLED == 1)
+#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
+ DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
+#endif
+ void (*HW_huart1RxCb)(void);
+ void (*HW_huart1TxCb)(void);
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
+ DMA_HandleTypeDef HW_hdma_hlpuart1_tx ={0};
+#endif
+ void (*HW_hlpuart1RxCb)(void);
+ void (*HW_hlpuart1TxCb)(void);
+#endif
+
+void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HW_UART_RX_IT(huart1, USART1);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HW_UART_RX_IT(hlpuart1, LPUART1);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HW_UART_TX_IT(huart1, USART1);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HW_UART_TX_IT(hlpuart1, LPUART1);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
+{
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
+
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HW_UART_TX(huart1, USART1);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HW_UART_TX(hlpuart1, LPUART1);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ switch (hal_status)
+ {
+ case HAL_OK:
+ hw_status = hw_uart_ok;
+ break;
+
+ case HAL_ERROR:
+ hw_status = hw_uart_error;
+ break;
+
+ case HAL_BUSY:
+ hw_status = hw_uart_busy;
+ break;
+
+ case HAL_TIMEOUT:
+ hw_status = hw_uart_to;
+ break;
+
+ default:
+ break;
+ }
+
+ return hw_status;
+}
+
+hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
+
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HW_huart1TxCb = cb;
+ huart1.Instance = USART1;
+ hal_status = HAL_UART_Transmit_DMA(&huart1, p_data, size);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HW_hlpuart1TxCb = cb;
+ hlpuart1.Instance = LPUART1;
+ hal_status = HAL_UART_Transmit_DMA(&hlpuart1, p_data, size);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ switch (hal_status)
+ {
+ case HAL_OK:
+ hw_status = hw_uart_ok;
+ break;
+
+ case HAL_ERROR:
+ hw_status = hw_uart_error;
+ break;
+
+ case HAL_BUSY:
+ hw_status = hw_uart_busy;
+ break;
+
+ case HAL_TIMEOUT:
+ hw_status = hw_uart_to;
+ break;
+
+ default:
+ break;
+ }
+
+ return hw_status;
+}
+
+void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id)
+{
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HAL_UART_IRQHandler(&huart1);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HAL_UART_IRQHandler(&hlpuart1);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
+{
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
+ case hw_uart1:
+ HAL_DMA_IRQHandler(huart1.hdmatx);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
+ case hw_lpuart1:
+ HAL_DMA_IRQHandler(hlpuart1.hdmatx);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
+{
+ switch ((uint32_t)huart->Instance)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case (uint32_t)USART1:
+ if(HW_huart1RxCb)
+ {
+ HW_huart1RxCb();
+ }
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case (uint32_t)LPUART1:
+ if(HW_hlpuart1RxCb)
+ {
+ HW_hlpuart1RxCb();
+ }
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
+{
+ switch ((uint32_t)huart->Instance)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case (uint32_t)USART1:
+ if(HW_huart1TxCb)
+ {
+ HW_huart1TxCb();
+ }
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case (uint32_t)LPUART1:
+ if(HW_hlpuart1TxCb)
+ {
+ HW_hlpuart1TxCb();
+ }
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/main.c
new file mode 100644
index 000000000..e08ffb500
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/main.c
@@ -0,0 +1,521 @@
+/**
+ ******************************************************************************
+ * @file : main.c
+ * @brief : Main program body
+ *
+ @verbatim
+ ==============================================================================
+ ##### IMPORTANT NOTE #####
+ ==============================================================================
+
+ This application requests having the stm32wb5x_Zigbee_fw.bin binary
+ flashed on the Wireless Coprocessor.
+ If it is not the case, you need to use STM32CubeProgrammer to load the appropriate
+ binary.
+
+ All available binaries are located under following directory:
+ /Projects/STM32_Copro_Wireless_Binaries
+
+ Refer to UM2237 to learn how to use/install STM32CubeProgrammer.
+ Refer to /Projects/STM32_Copro_Wireless_Binaries/ReleaseNote.html for the
+ detailed procedure to change the Wireless Coprocessor binary.
+
+ @endverbatim
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+#include "app_entry.h"
+
+/* Private includes ----------------------------------------------------------*/
+
+#include "dbg_trace.h"
+#include "hw_conf.h"
+#include "otp.h"
+#include "stm32_seq.h"
+
+/* Private variables ---------------------------------------------------------*/
+UART_HandleTypeDef hlpuart1;
+UART_HandleTypeDef huart1;
+DMA_HandleTypeDef hdma_lpuart1_tx;
+DMA_HandleTypeDef hdma_usart1_tx;
+RTC_HandleTypeDef hrtc;
+
+/* Private function prototypes -----------------------------------------------*/
+void SystemClock_Config(void);
+static void MX_GPIO_Init(void);
+static void MX_DMA_Init(void);
+void MX_LPUART1_UART_Init(void);
+void MX_USART1_UART_Init(void);
+static void MX_RF_Init(void);
+static void MX_RTC_Init(void);
+
+void PeriphClock_Config(void);
+static void Reset_Device(void);
+static void Reset_IPCC(void);
+static void Reset_BackupDomain(void);
+static void Init_Exti(void);
+static void Config_HSE(void);
+
+/**
+ * @brief The application entry point.
+ * @retval int
+ */
+int main(void)
+{
+ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
+ HAL_Init();
+
+ Reset_Device();
+ Config_HSE();
+
+ /* Configure the system clock */
+ SystemClock_Config();
+
+ PeriphClock_Config();
+ Init_Exti(); /**< Configure the system Power Mode */
+
+ /* Initialize all configured peripherals */
+ MX_GPIO_Init();
+ MX_DMA_Init();
+ MX_RF_Init();
+ MX_RTC_Init();
+
+ /* Init the full application */
+ APPE_Init();
+
+ /* Infinite loop */
+
+ while (1) {
+ UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
+
+ }
+
+}
+
+/**
+ * @brief System Clock Configuration
+ * @retval None
+ */
+void SystemClock_Config(void)
+{
+ RCC_OscInitTypeDef RCC_OscInitStruct = {0};
+ RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
+ RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
+
+ /** Configure LSE Drive Capability
+ */
+ __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
+ /** Configure the main internal regulator output voltage
+ */
+ __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
+ /** Initializes the CPU, AHB and APB busses clocks
+ */
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE
+ |RCC_OSCILLATORTYPE_LSE;
+ RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ RCC_OscInitStruct.LSEState = RCC_LSE_ON;
+ RCC_OscInitStruct.HSIState = RCC_HSI_ON;
+ RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
+ RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
+ if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /** Configure the SYSCLKSource, HCLK, PCLK1 and PCLK2 clocks dividers
+ */
+ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK4|RCC_CLOCKTYPE_HCLK2
+ |RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
+ |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
+ RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSE;
+ RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
+ RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
+ RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
+ RCC_ClkInitStruct.AHBCLK2Divider = RCC_SYSCLK_DIV1;
+ RCC_ClkInitStruct.AHBCLK4Divider = RCC_SYSCLK_DIV1;
+
+ if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /** Initializes the peripherals clocks
+ */
+ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_SMPS|RCC_PERIPHCLK_RFWAKEUP
+ |RCC_PERIPHCLK_RTC|RCC_PERIPHCLK_USART1
+ |RCC_PERIPHCLK_LPUART1;
+ PeriphClkInitStruct.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2;
+ PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1;
+ PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
+ PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSE;
+ PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSE;
+ PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE0;
+
+ if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
+ {
+ Error_Handler();
+ }
+}
+
+/**
+ * @brief LPUART1 Initialization Function
+ * @param None
+ * @retval None
+ */
+void MX_LPUART1_UART_Init(void)
+{
+
+ hlpuart1.Instance = LPUART1;
+ hlpuart1.Init.BaudRate = 115200;
+ hlpuart1.Init.WordLength = UART_WORDLENGTH_8B;
+ hlpuart1.Init.StopBits = UART_STOPBITS_1;
+ hlpuart1.Init.Parity = UART_PARITY_NONE;
+ hlpuart1.Init.Mode = UART_MODE_TX_RX;
+ hlpuart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
+ hlpuart1.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
+ hlpuart1.Init.ClockPrescaler = UART_PRESCALER_DIV1;
+ hlpuart1.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
+ hlpuart1.FifoMode = UART_FIFOMODE_DISABLE;
+ if (HAL_UART_Init(&hlpuart1) != HAL_OK) {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_SetTxFifoThreshold(&hlpuart1, UART_TXFIFO_THRESHOLD_1_8) != HAL_OK) {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_SetRxFifoThreshold(&hlpuart1, UART_RXFIFO_THRESHOLD_1_8) != HAL_OK) {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_DisableFifoMode(&hlpuart1) != HAL_OK) {
+ Error_Handler();
+ }
+
+}
+
+/**
+ * @brief USART1 Initialization Function
+ * @param None
+ * @retval None
+ */
+void MX_USART1_UART_Init(void)
+{
+
+ huart1.Instance = USART1;
+ huart1.Init.BaudRate = 115200;
+ huart1.Init.WordLength = UART_WORDLENGTH_8B;
+ huart1.Init.StopBits = UART_STOPBITS_1;
+ huart1.Init.Parity = UART_PARITY_NONE;
+ huart1.Init.Mode = UART_MODE_TX_RX;
+ huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
+ huart1.Init.OverSampling = UART_OVERSAMPLING_8;
+ huart1.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
+ huart1.Init.ClockPrescaler = UART_PRESCALER_DIV1;
+ huart1.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
+ if (HAL_UART_Init(&huart1) != HAL_OK) {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_SetTxFifoThreshold(&huart1, UART_TXFIFO_THRESHOLD_1_8) != HAL_OK) {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_SetRxFifoThreshold(&huart1, UART_RXFIFO_THRESHOLD_1_8) != HAL_OK) {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_DisableFifoMode(&huart1) != HAL_OK) {
+ Error_Handler();
+ }
+
+}
+
+/**
+ * @brief RF Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_RF_Init(void)
+{
+
+}
+
+/**
+ * @brief RTC Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_RTC_Init(void)
+{
+
+
+ /** Initialize RTC Only
+ */
+ hrtc.Instance = RTC;
+ hrtc.Init.HourFormat = RTC_HOURFORMAT_24;
+ hrtc.Init.AsynchPrediv = CFG_RTC_ASYNCH_PRESCALER;
+ hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
+ hrtc.Init.OutPut = RTC_OUTPUT_DISABLE;
+ hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH;
+ hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;
+ if (HAL_RTC_Init(&hrtc) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /* USER CODE BEGIN RTC_Init 2 */
+
+ /* USER CODE END RTC_Init 2 */
+
+}
+
+/**
+ * Enable DMA controller clock
+ */
+static void MX_DMA_Init(void)
+{
+
+ /* DMA controller clock enable */
+ __HAL_RCC_DMAMUX1_CLK_ENABLE();
+ __HAL_RCC_DMA1_CLK_ENABLE();
+
+ /* DMA interrupt init */
+ /* DMA1_Channel1_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(DMA1_Channel1_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(DMA1_Channel1_IRQn);
+ /* DMA1_Channel2_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(DMA1_Channel2_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(DMA1_Channel2_IRQn);
+
+}
+
+/**
+ * @brief GPIO Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_GPIO_Init(void)
+{
+
+ /* GPIO Ports Clock Enable */
+ __HAL_RCC_GPIOC_CLK_ENABLE();
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+
+}
+
+/* USER CODE BEGIN 4 */
+void PeriphClock_Config(void)
+{
+ #if (CFG_USB_INTERFACE_ENABLE != 0)
+ RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
+ RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
+ LL_RCC_HSI48_Enable();
+
+ while(!LL_RCC_HSI48_IsReady());
+
+ /* Select HSI48 as USB clock source */
+ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB;
+ PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_HSI48;
+ HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
+
+ /*Configure the clock recovery system (CRS)**********************************/
+
+ /* Enable CRS Clock */
+ __HAL_RCC_CRS_CLK_ENABLE();
+
+ /* Default Synchro Signal division factor (not divided) */
+ RCC_CRSInitStruct.Prescaler = RCC_CRS_SYNC_DIV1;
+
+ /* Set the SYNCSRC[1:0] bits according to CRS_Source value */
+ RCC_CRSInitStruct.Source = RCC_CRS_SYNC_SOURCE_USB;
+
+ /* HSI48 is synchronized with USB SOF at 1KHz rate */
+ RCC_CRSInitStruct.ReloadValue = RCC_CRS_RELOADVALUE_DEFAULT;
+ RCC_CRSInitStruct.ErrorLimitValue = RCC_CRS_ERRORLIMIT_DEFAULT;
+
+ RCC_CRSInitStruct.Polarity = RCC_CRS_SYNC_POLARITY_RISING;
+
+ /* Set the TRIM[5:0] to the default value*/
+ RCC_CRSInitStruct.HSI48CalibrationValue = RCC_CRS_HSI48CALIBRATION_DEFAULT;
+
+ /* Start automatic synchronization */
+ HAL_RCCEx_CRSConfig(&RCC_CRSInitStruct);
+#endif
+
+ return;
+}
+
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+
+static void Config_HSE(void)
+{
+ OTP_ID0_t * p_otp;
+
+ /**
+ * Read HSE_Tuning from OTP
+ */
+ p_otp = (OTP_ID0_t *) OTP_Read(0);
+ if (p_otp)
+ {
+ LL_RCC_HSE_SetCapacitorTuning(p_otp->hse_tuning);
+ }
+
+ return;
+}
+
+
+static void Reset_Device( void )
+{
+#if ( CFG_HW_RESET_BY_FW == 1 )
+ Reset_BackupDomain();
+
+ Reset_IPCC();
+#endif
+
+ return;
+}
+
+static void Reset_IPCC( void )
+{
+ LL_AHB3_GRP1_EnableClock(LL_AHB3_GRP1_PERIPH_IPCC);
+
+ LL_C1_IPCC_ClearFlag_CHx(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C2_IPCC_ClearFlag_CHx(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C1_IPCC_DisableTransmitChannel(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C2_IPCC_DisableTransmitChannel(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C1_IPCC_DisableReceiveChannel(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C2_IPCC_DisableReceiveChannel(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ return;
+}
+
+static void Reset_BackupDomain( void )
+{
+ if ((LL_RCC_IsActiveFlag_PINRST() != FALSE) && (LL_RCC_IsActiveFlag_SFTRST() == FALSE))
+ {
+ HAL_PWR_EnableBkUpAccess(); /**< Enable access to the RTC registers */
+
+ /**
+ * Write twice the value to flush the APB-AHB bridge
+ * This bit shall be written in the register before writing the next one
+ */
+ HAL_PWR_EnableBkUpAccess();
+
+ __HAL_RCC_BACKUPRESET_FORCE();
+ __HAL_RCC_BACKUPRESET_RELEASE();
+ }
+
+ return;
+}
+
+static void Init_Exti( void )
+{
+ /**< Disable all wakeup interrupt on CPU1 except IPCC(36), HSEM(38) */
+ LL_EXTI_DisableIT_0_31(~0);
+ LL_EXTI_DisableIT_32_63( (~0) & (~(LL_EXTI_LINE_36 | LL_EXTI_LINE_38)) );
+
+ return;
+}
+
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+void HAL_Delay(uint32_t Delay)
+{
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
+
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
+}
+
+/**
+ * @brief This function is executed in case of error occurrence.
+ * @retval None
+ */
+void Error_Handler(void)
+{
+
+}
+
+#ifdef USE_FULL_ASSERT
+/**
+ * @brief Reports the name of the source file and the source line number
+ * where the assert_param error has occurred.
+ * @param file: pointer to the source file name
+ * @param line: assert_param error line source number
+ * @retval None
+ */
+void assert_failed(uint8_t *file, uint32_t line)
+{
+ /* USER CODE BEGIN 6 */
+ /* User can add his own implementation to report the file name and line number,
+ tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
+ /* USER CODE END 6 */
+}
+#endif /* USE_FULL_ASSERT */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/stm32_lpm_if.c
new file mode 100644
index 000000000..f024b61e3
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/stm32_lpm_if.c
@@ -0,0 +1,275 @@
+/* USER CODE BEGIN Header */
+/**
+ ***************************************************************************************
+ * File Name : stm32_lpm_if.c
+ * Description : Low layer function to enter/exit low power modes (stop, sleep).
+ ***************************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "stm32_lpm_if.h"
+#include "stm32_lpm.h"
+#include "app_conf.h"
+/* USER CODE BEGIN include */
+
+/* USER CODE END include */
+
+/* Exported variables --------------------------------------------------------*/
+const struct UTIL_LPM_Driver_s UTIL_PowerDriver =
+{
+ PWR_EnterSleepMode,
+ PWR_ExitSleepMode,
+
+ PWR_EnterStopMode,
+ PWR_ExitStopMode,
+
+ PWR_EnterOffMode,
+ PWR_ExitOffMode,
+};
+
+/* Private function prototypes -----------------------------------------------*/
+static void Switch_On_HSI( void );
+/* USER CODE BEGIN Private_Function_Prototypes */
+
+/* USER CODE END Private_Function_Prototypes */
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN Private_Typedef */
+
+/* USER CODE END Private_Typedef */
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN Private_Define */
+
+/* USER CODE END Private_Define */
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN Private_Macro */
+
+/* USER CODE END Private_Macro */
+/* Private variables ---------------------------------------------------------*/
+/* USER CODE BEGIN Private_Variables */
+
+/* USER CODE END Private_Variables */
+
+/* Functions Definition ------------------------------------------------------*/
+/**
+ * @brief Enters Low Power Off Mode
+ * @param none
+ * @retval none
+ */
+void PWR_EnterOffMode( void )
+{
+/* USER CODE BEGIN PWR_EnterOffMode */
+ /************************************************************************************
+ * ENTER OFF MODE
+ ***********************************************************************************/
+ /*
+ * There is no risk to clear all the WUF here because in the current implementation, this API is called
+ * in critical section. If an interrupt occurs while in that critical section before that point,
+ * the flag is set and will be cleared here but the system will not enter Off Mode
+ * because an interrupt is pending in the NVIC. The ISR will be executed when moving out
+ * of this critical section
+ */
+ LL_PWR_ClearFlag_WU( );
+
+ LL_PWR_SetPowerMode( LL_PWR_MODE_STANDBY );
+
+ LL_LPM_EnableDeepSleep( ); /**< Set SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+#if defined ( __CC_ARM)
+ __force_stores( );
+#endif
+
+ __WFI( );
+/* USER CODE END PWR_EnterOffMode */
+}
+
+/**
+ * @brief Exits Low Power Off Mode
+ * @param none
+ * @retval none
+ */
+void PWR_ExitOffMode( void )
+{
+/* USER CODE BEGIN PWR_ExitOffMode */
+
+/* USER CODE END PWR_ExitOffMode */
+}
+
+/**
+ * @brief Enters Low Power Stop Mode
+ * @note ARM exists the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_EnterStopMode( void )
+{
+/* USER CODE BEGIN PWR_EnterStopMode */
+ /**
+ * This function is called from CRITICAL SECTION
+ */
+ while( LL_HSEM_1StepLock( HSEM, CFG_HW_RCC_SEMID ) );
+
+ if ( ! LL_HSEM_1StepLock( HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID ) )
+ {
+ if( LL_PWR_IsActiveFlag_C2DS( ) )
+ {
+ /* Release ENTRY_STOP_MODE semaphore */
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID, 0 );
+
+ /**
+ * The switch on HSI before entering Stop Mode is required on Cut2.0
+ * It is useless from Cut2.1
+ */
+ Switch_On_HSI( );
+ }
+ }
+ else
+ {
+ /**
+ * The switch on HSI before entering Stop Mode is required on Cut2.0
+ * It is useless from Cut2.1
+ */
+ Switch_On_HSI( );
+ }
+
+ /* Release RCC semaphore */
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_RCC_SEMID, 0 );
+
+ /************************************************************************************
+ * ENTER STOP MODE
+ ***********************************************************************************/
+ LL_PWR_SetPowerMode( LL_PWR_MODE_STOP2 );
+
+ LL_LPM_EnableDeepSleep( ); /**< Set SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+#if defined ( __CC_ARM)
+ __force_stores( );
+#endif
+
+ __WFI();
+/* USER CODE END PWR_EnterStopMode */
+}
+
+/**
+ * @brief Exits Low Power Stop Mode
+ * @note Enable the pll at 32MHz
+ * @param none
+ * @retval none
+ */
+void PWR_ExitStopMode( void )
+{
+/* USER CODE BEGIN PWR_ExitStopMode */
+ /**
+ * This function is called from CRITICAL SECTION
+ */
+
+ /* Release ENTRY_STOP_MODE semaphore */
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID, 0 );
+
+ while( LL_HSEM_1StepLock( HSEM, CFG_HW_RCC_SEMID ) );
+
+ if(LL_RCC_GetSysClkSource( ) == LL_RCC_SYS_CLKSOURCE_STATUS_HSI)
+ {
+ LL_RCC_HSE_Enable( );
+ while(!LL_RCC_HSE_IsReady( ));
+ LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_HSE);
+ while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSE);
+ }
+ else
+ {
+ /**
+ * As long as the current application is fine with HSE as system clock source,
+ * there is nothing to do here
+ */
+ }
+
+ /* Release RCC semaphore */
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_RCC_SEMID, 0 );
+/* USER CODE END PWR_ExitStopMode */
+}
+
+/**
+ * @brief Enters Low Power Sleep Mode
+ * @note ARM exits the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_EnterSleepMode( void )
+{
+/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+#if defined ( __CC_ARM)
+ __force_stores();
+#endif
+
+ __WFI( );
+/* USER CODE END PWR_EnterSleepMode */
+}
+
+/**
+ * @brief Exits Low Power Sleep Mode
+ * @note ARM exits the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_ExitSleepMode( void )
+{
+/* USER CODE BEGIN PWR_ExitSleepMode */
+
+ HAL_ResumeTick();
+
+/* USER CODE END PWR_ExitSleepMode */
+}
+
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+/**
+ * @brief Switch the system clock on HSI
+ * @param none
+ * @retval none
+ */
+static void Switch_On_HSI( void )
+{
+ LL_RCC_HSI_Enable( );
+ while(!LL_RCC_HSI_IsReady( ));
+ LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
+ while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
+}
+
+/* USER CODE BEGIN Private_Functions */
+
+/* USER CODE END Private_Functions */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/stm32wbxx_hal_msp.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/stm32wbxx_hal_msp.c
new file mode 100644
index 000000000..9c338486d
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/stm32wbxx_hal_msp.c
@@ -0,0 +1,334 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : stm32wbxx_hal_msp.c
+ * Description : This file provides code for the MSP Initialization
+ * and de-Initialization codes.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+/* USER CODE BEGIN Includes */
+#include "app_conf.h"
+/* USER CODE END Includes */
+extern DMA_HandleTypeDef hdma_lpuart1_tx;
+
+extern DMA_HandleTypeDef hdma_usart1_tx;
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN TD */
+
+/* USER CODE END TD */
+
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN Define */
+
+/* USER CODE END Define */
+
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN Macro */
+
+/* USER CODE END Macro */
+
+/* Private variables ---------------------------------------------------------*/
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+/* USER CODE BEGIN PFP */
+
+/* USER CODE END PFP */
+
+/* External functions --------------------------------------------------------*/
+/* USER CODE BEGIN ExternalFunctions */
+
+/* USER CODE END ExternalFunctions */
+
+/* USER CODE BEGIN 0 */
+
+/* USER CODE END 0 */
+/**
+ * Initializes the Global MSP.
+ */
+void HAL_MspInit(void)
+{
+ /* USER CODE BEGIN MspInit 0 */
+
+ /* USER CODE END MspInit 0 */
+
+ __HAL_RCC_HSEM_CLK_ENABLE();
+
+ /* System interrupt init*/
+
+ /* Peripheral interrupt init */
+ /* PVD_PVM_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(PVD_PVM_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(PVD_PVM_IRQn);
+ /* FLASH_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(FLASH_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(FLASH_IRQn);
+ /* RCC_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(RCC_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(RCC_IRQn);
+ /* C2SEV_PWR_C2H_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(C2SEV_PWR_C2H_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(C2SEV_PWR_C2H_IRQn);
+ /* PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn);
+ /* HSEM_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(HSEM_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(HSEM_IRQn);
+ /* FPU_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(FPU_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(FPU_IRQn);
+
+ /* USER CODE BEGIN MspInit 1 */
+
+ /* USER CODE END MspInit 1 */
+}
+
+/**
+* @brief UART MSP Initialization
+* This function configures the hardware resources used in this example
+* @param huart: UART handle pointer
+* @retval None
+*/
+void HAL_UART_MspInit(UART_HandleTypeDef* huart)
+{
+ GPIO_InitTypeDef GPIO_InitStruct = {0};
+ if(huart->Instance==LPUART1)
+ {
+ /* USER CODE BEGIN LPUART1_MspInit 0 */
+
+ /* USER CODE END LPUART1_MspInit 0 */
+ /* Peripheral clock enable */
+ __HAL_RCC_LPUART1_CLK_ENABLE();
+
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ /**LPUART1 GPIO Configuration
+ PA2 ------> LPUART1_TX
+ PA3 ------> LPUART1_RX
+ */
+ GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_3;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ GPIO_InitStruct.Alternate = GPIO_AF8_LPUART1;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+
+ /* LPUART1 DMA Init */
+ /* LPUART1_TX Init */
+ hdma_lpuart1_tx.Instance = DMA1_Channel1;
+ hdma_lpuart1_tx.Init.Request = DMA_REQUEST_LPUART1_TX;
+ hdma_lpuart1_tx.Init.Direction = DMA_MEMORY_TO_PERIPH;
+ hdma_lpuart1_tx.Init.PeriphInc = DMA_PINC_DISABLE;
+ hdma_lpuart1_tx.Init.MemInc = DMA_MINC_ENABLE;
+ hdma_lpuart1_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
+ hdma_lpuart1_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
+ hdma_lpuart1_tx.Init.Mode = DMA_NORMAL;
+ hdma_lpuart1_tx.Init.Priority = DMA_PRIORITY_LOW;
+ if (HAL_DMA_Init(&hdma_lpuart1_tx) != HAL_OK)
+ {
+ Error_Handler();
+ }
+
+ __HAL_LINKDMA(huart,hdmatx,hdma_lpuart1_tx);
+
+ /* LPUART1 interrupt Init */
+ HAL_NVIC_SetPriority(LPUART1_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(LPUART1_IRQn);
+ /* USER CODE BEGIN LPUART1_MspInit 1 */
+
+ /* USER CODE END LPUART1_MspInit 1 */
+ }
+ else if(huart->Instance==USART1)
+ {
+ /* USER CODE BEGIN USART1_MspInit 0 */
+
+ /* USER CODE END USART1_MspInit 0 */
+ /* Peripheral clock enable */
+ __HAL_RCC_USART1_CLK_ENABLE();
+
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+ /**USART1 GPIO Configuration
+ PA11 ------> USART1_CTS
+ PB6 ------> USART1_TX
+ PB7 ------> USART1_RX
+ */
+ GPIO_InitStruct.Pin = GPIO_PIN_11;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+
+ GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
+ HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
+
+ /* USART1 DMA Init */
+ /* USART1_TX Init */
+ hdma_usart1_tx.Instance = DMA1_Channel2;
+ hdma_usart1_tx.Init.Request = DMA_REQUEST_USART1_TX;
+ hdma_usart1_tx.Init.Direction = DMA_MEMORY_TO_PERIPH;
+ hdma_usart1_tx.Init.PeriphInc = DMA_PINC_DISABLE;
+ hdma_usart1_tx.Init.MemInc = DMA_MINC_ENABLE;
+ hdma_usart1_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
+ hdma_usart1_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
+ hdma_usart1_tx.Init.Mode = DMA_NORMAL;
+ hdma_usart1_tx.Init.Priority = DMA_PRIORITY_LOW;
+ if (HAL_DMA_Init(&hdma_usart1_tx) != HAL_OK)
+ {
+ Error_Handler();
+ }
+
+ __HAL_LINKDMA(huart,hdmatx,hdma_usart1_tx);
+
+ /* USART1 interrupt Init */
+ HAL_NVIC_SetPriority(USART1_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(USART1_IRQn);
+ /* USER CODE BEGIN USART1_MspInit 1 */
+
+ /* USER CODE END USART1_MspInit 1 */
+ }
+
+}
+
+/**
+* @brief UART MSP De-Initialization
+* This function freeze the hardware resources used in this example
+* @param huart: UART handle pointer
+* @retval None
+*/
+void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
+{
+ if(huart->Instance==LPUART1)
+ {
+ /* USER CODE BEGIN LPUART1_MspDeInit 0 */
+
+ /* USER CODE END LPUART1_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_LPUART1_CLK_DISABLE();
+
+ /**LPUART1 GPIO Configuration
+ PA2 ------> LPUART1_TX
+ PA3 ------> LPUART1_RX
+ */
+ HAL_GPIO_DeInit(GPIOA, GPIO_PIN_2|GPIO_PIN_3);
+
+ /* LPUART1 DMA DeInit */
+ HAL_DMA_DeInit(huart->hdmatx);
+
+ /* LPUART1 interrupt DeInit */
+ HAL_NVIC_DisableIRQ(LPUART1_IRQn);
+ /* USER CODE BEGIN LPUART1_MspDeInit 1 */
+
+ /* USER CODE END LPUART1_MspDeInit 1 */
+ }
+ else if(huart->Instance==USART1)
+ {
+ /* USER CODE BEGIN USART1_MspDeInit 0 */
+
+ /* USER CODE END USART1_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_USART1_CLK_DISABLE();
+
+ /**USART1 GPIO Configuration
+ PA11 ------> USART1_CTS
+ PB6 ------> USART1_TX
+ PB7 ------> USART1_RX
+ */
+ HAL_GPIO_DeInit(GPIOA, GPIO_PIN_11);
+
+ HAL_GPIO_DeInit(GPIOB, GPIO_PIN_6|GPIO_PIN_7);
+
+ /* USART1 DMA DeInit */
+ HAL_DMA_DeInit(huart->hdmatx);
+
+ /* USART1 interrupt DeInit */
+ HAL_NVIC_DisableIRQ(USART1_IRQn);
+ /* USER CODE BEGIN USART1_MspDeInit 1 */
+
+ /* USER CODE END USART1_MspDeInit 1 */
+ }
+
+}
+
+/**
+* @brief RTC MSP Initialization
+* This function configures the hardware resources used in this example
+* @param hrtc: RTC handle pointer
+* @retval None
+*/
+void HAL_RTC_MspInit(RTC_HandleTypeDef* hrtc)
+{
+ if(hrtc->Instance==RTC)
+ {
+ /* USER CODE BEGIN RTC_MspInit 0 */
+ HAL_PWR_EnableBkUpAccess(); /**< Enable access to the RTC registers */
+
+ /**
+ * Write twice the value to flush the APB-AHB bridge
+ * This bit shall be written in the register before writing the next one
+ */
+ HAL_PWR_EnableBkUpAccess();
+
+ __HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSE); /**< Select LSE as RTC Input */
+
+ /* USER CODE END RTC_MspInit 0 */
+ /* Peripheral clock enable */
+ __HAL_RCC_RTC_ENABLE();
+ /* USER CODE BEGIN RTC_MspInit 1 */
+
+ MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* USER CODE END RTC_MspInit 1 */
+ }
+
+}
+
+/**
+* @brief RTC MSP De-Initialization
+* This function freeze the hardware resources used in this example
+* @param hrtc: RTC handle pointer
+* @retval None
+*/
+void HAL_RTC_MspDeInit(RTC_HandleTypeDef* hrtc)
+{
+ if(hrtc->Instance==RTC)
+ {
+ /* USER CODE BEGIN RTC_MspDeInit 0 */
+
+ /* USER CODE END RTC_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_RTC_DISABLE();
+ /* USER CODE BEGIN RTC_MspDeInit 1 */
+
+ /* USER CODE END RTC_MspDeInit 1 */
+ }
+
+}
+
+/* USER CODE BEGIN 1 */
+
+/* USER CODE END 1 */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/stm32wbxx_it.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/stm32wbxx_it.c
new file mode 100644
index 000000000..7c5536dfc
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/stm32wbxx_it.c
@@ -0,0 +1,411 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file stm32wbxx_it.c
+ * @brief Interrupt Service Routines.
+ *******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+#include "stm32wbxx_it.h"
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+#include "hw.h"
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN TD */
+
+/* USER CODE END TD */
+
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN PD */
+
+/* USER CODE END PD */
+
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private variables ---------------------------------------------------------*/
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+/* USER CODE BEGIN PFP */
+
+/* USER CODE END PFP */
+
+/* Private user code ---------------------------------------------------------*/
+/* USER CODE BEGIN 0 */
+
+/* USER CODE END 0 */
+
+/* External variables --------------------------------------------------------*/
+
+extern DMA_HandleTypeDef hdma_lpuart1_tx;
+
+extern DMA_HandleTypeDef hdma_usart1_tx;
+
+extern UART_HandleTypeDef hlpuart1;
+
+extern UART_HandleTypeDef huart1;
+
+/* USER CODE BEGIN EV */
+
+/* USER CODE END EV */
+
+/******************************************************************************/
+/* Cortex Processor Interruption and Exception Handlers */
+/******************************************************************************/
+/**
+ * @brief This function handles Non maskable interrupt.
+ */
+void NMI_Handler(void)
+{
+ /* USER CODE BEGIN NonMaskableInt_IRQn 0 */
+
+ /* USER CODE END NonMaskableInt_IRQn 0 */
+ /* USER CODE BEGIN NonMaskableInt_IRQn 1 */
+
+ /* USER CODE END NonMaskableInt_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Hard fault interrupt.
+ */
+void HardFault_Handler(void)
+{
+ /* USER CODE BEGIN HardFault_IRQn 0 */
+
+ /* USER CODE END HardFault_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_HardFault_IRQn 0 */
+ /* USER CODE END W1_HardFault_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles Memory management fault.
+ */
+void MemManage_Handler(void)
+{
+ /* USER CODE BEGIN MemoryManagement_IRQn 0 */
+
+ /* USER CODE END MemoryManagement_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */
+ /* USER CODE END W1_MemoryManagement_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles Prefetch fault, memory access fault.
+ */
+void BusFault_Handler(void)
+{
+ /* USER CODE BEGIN BusFault_IRQn 0 */
+
+ /* USER CODE END BusFault_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_BusFault_IRQn 0 */
+ /* USER CODE END W1_BusFault_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles Undefined instruction or illegal state.
+ */
+void UsageFault_Handler(void)
+{
+ /* USER CODE BEGIN UsageFault_IRQn 0 */
+
+ /* USER CODE END UsageFault_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_UsageFault_IRQn 0 */
+ /* USER CODE END W1_UsageFault_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles System service call via SWI instruction.
+ */
+void SVC_Handler(void)
+{
+ /* USER CODE BEGIN SVCall_IRQn 0 */
+
+ /* USER CODE END SVCall_IRQn 0 */
+ /* USER CODE BEGIN SVCall_IRQn 1 */
+
+ /* USER CODE END SVCall_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Debug monitor.
+ */
+void DebugMon_Handler(void)
+{
+ /* USER CODE BEGIN DebugMonitor_IRQn 0 */
+
+ /* USER CODE END DebugMonitor_IRQn 0 */
+ /* USER CODE BEGIN DebugMonitor_IRQn 1 */
+
+ /* USER CODE END DebugMonitor_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Pendable request for system service.
+ */
+void PendSV_Handler(void)
+{
+ /* USER CODE BEGIN PendSV_IRQn 0 */
+
+ /* USER CODE END PendSV_IRQn 0 */
+ /* USER CODE BEGIN PendSV_IRQn 1 */
+
+ /* USER CODE END PendSV_IRQn 1 */
+}
+
+/**
+ * @brief This function handles System tick timer.
+ */
+void SysTick_Handler(void)
+{
+ /* USER CODE BEGIN SysTick_IRQn 0 */
+
+ /* USER CODE END SysTick_IRQn 0 */
+ HAL_IncTick();
+ /* USER CODE BEGIN SysTick_IRQn 1 */
+
+ /* USER CODE END SysTick_IRQn 1 */
+}
+
+/******************************************************************************/
+/* STM32WBxx Peripheral Interrupt Handlers */
+/* Add here the Interrupt Handlers for the used peripherals. */
+/* For the available peripheral interrupt handler names, */
+/* please refer to the startup file (startup_stm32wbxx.s). */
+/******************************************************************************/
+
+/**
+ * @brief This function handles PVD/PVM0/PVM2 interrupts through EXTI lines 16/31/33.
+ */
+void PVD_PVM_IRQHandler(void)
+{
+ /* USER CODE BEGIN PVD_PVM_IRQn 0 */
+
+ /* USER CODE END PVD_PVM_IRQn 0 */
+ HAL_PWREx_PVD_PVM_IRQHandler();
+ /* USER CODE BEGIN PVD_PVM_IRQn 1 */
+
+ /* USER CODE END PVD_PVM_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Flash global interrupt.
+ */
+void FLASH_IRQHandler(void)
+{
+ /* USER CODE BEGIN FLASH_IRQn 0 */
+
+ /* USER CODE END FLASH_IRQn 0 */
+ HAL_FLASH_IRQHandler();
+ /* USER CODE BEGIN FLASH_IRQn 1 */
+
+ /* USER CODE END FLASH_IRQn 1 */
+}
+
+/**
+ * @brief This function handles RCC global interrupt.
+ */
+void RCC_IRQHandler(void)
+{
+ /* USER CODE BEGIN RCC_IRQn 0 */
+
+ /* USER CODE END RCC_IRQn 0 */
+ /* USER CODE BEGIN RCC_IRQn 1 */
+
+ /* USER CODE END RCC_IRQn 1 */
+}
+
+/**
+ * @brief This function handles DMA1 channel1 global interrupt.
+ */
+void DMA1_Channel1_IRQHandler(void)
+{
+ /* USER CODE BEGIN DMA1_Channel1_IRQn 0 */
+
+ /* USER CODE END DMA1_Channel1_IRQn 0 */
+ HAL_DMA_IRQHandler(&hdma_lpuart1_tx);
+ /* USER CODE BEGIN DMA1_Channel1_IRQn 1 */
+
+ /* USER CODE END DMA1_Channel1_IRQn 1 */
+}
+
+/**
+ * @brief This function handles DMA1 channel2 global interrupt.
+ */
+void DMA1_Channel2_IRQHandler(void)
+{
+ /* USER CODE BEGIN DMA1_Channel2_IRQn 0 */
+
+ /* USER CODE END DMA1_Channel2_IRQn 0 */
+ HAL_DMA_IRQHandler(&hdma_usart1_tx);
+ /* USER CODE BEGIN DMA1_Channel2_IRQn 1 */
+
+ /* USER CODE END DMA1_Channel2_IRQn 1 */
+}
+
+/**
+ * @brief This function handles CPU2 SEV interrupt through EXTI line 40 and PWR CPU2 HOLD wake-up interrupt.
+ */
+void C2SEV_PWR_C2H_IRQHandler(void)
+{
+ /* USER CODE BEGIN C2SEV_PWR_C2H_IRQn 0 */
+
+ /* USER CODE END C2SEV_PWR_C2H_IRQn 0 */
+ /* USER CODE BEGIN C2SEV_PWR_C2H_IRQn 1 */
+
+ /* USER CODE END C2SEV_PWR_C2H_IRQn 1 */
+}
+
+/**
+ * @brief This function handles USART1 global interrupt.
+ */
+void USART1_IRQHandler(void)
+{
+ /* USER CODE BEGIN USART1_IRQn 0 */
+
+ /* USER CODE END USART1_IRQn 0 */
+ HAL_UART_IRQHandler(&huart1);
+ /* USER CODE BEGIN USART1_IRQn 1 */
+
+ /* USER CODE END USART1_IRQn 1 */
+}
+
+/**
+ * @brief This function handles LPUART1 global interrupt.
+ */
+void LPUART1_IRQHandler(void)
+{
+ /* USER CODE BEGIN LPUART1_IRQn 0 */
+
+ /* USER CODE END LPUART1_IRQn 0 */
+ HAL_UART_IRQHandler(&hlpuart1);
+ /* USER CODE BEGIN LPUART1_IRQn 1 */
+
+ /* USER CODE END LPUART1_IRQn 1 */
+}
+
+/**
+ * @brief This function handles PWR switching on the fly, end of BLE activity, end of 802.15.4 activity, end of critical radio phase interrupt.
+ */
+void PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler(void)
+{
+ /* USER CODE BEGIN PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn 0 */
+
+ /* USER CODE END PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn 0 */
+ /* USER CODE BEGIN PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn 1 */
+
+ /* USER CODE END PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn 1 */
+}
+
+/**
+ * @brief This function handles HSEM global interrupt.
+ */
+void HSEM_IRQHandler(void)
+{
+ /* USER CODE BEGIN HSEM_IRQn 0 */
+
+ /* USER CODE END HSEM_IRQn 0 */
+ HAL_HSEM_IRQHandler();
+ /* USER CODE BEGIN HSEM_IRQn 1 */
+
+ /* USER CODE END HSEM_IRQn 1 */
+}
+
+/**
+ * @brief This function handles FPU global interrupt.
+ */
+void FPU_IRQHandler(void)
+{
+ /* USER CODE BEGIN FPU_IRQn 0 */
+
+ /* USER CODE END FPU_IRQn 0 */
+ /* USER CODE BEGIN FPU_IRQn 1 */
+
+ /* USER CODE END FPU_IRQn 1 */
+}
+
+/* USER CODE BEGIN 1 */
+void RTC_WKUP_IRQHandler(void)
+{
+ HW_TS_RTC_Wakeup_Handler();
+}
+
+/**
+ * @brief This function handles External External line 4 interrupt request.
+ * @param None
+ * @retval None
+ */
+void EXTI4_IRQHandler(void)
+{
+ HAL_GPIO_EXTI_IRQHandler(BUTTON_SW1_PIN);
+}
+
+/**
+ * @brief This function handles External External line 0 interrupt request.
+ * @param None
+ * @retval None
+ */
+void EXTI0_IRQHandler(void)
+{
+ HAL_GPIO_EXTI_IRQHandler(BUTTON_SW2_PIN);
+}
+
+/**
+ * @brief This function handles External External line 1 interrupt request.
+ * @param None
+ * @retval None
+ */
+void EXTI1_IRQHandler(void)
+{
+ HAL_GPIO_EXTI_IRQHandler(BUTTON_SW3_PIN);
+}
+
+void
+IPCC_C1_TX_IRQHandler(void)
+{
+ HW_IPCC_Tx_Handler();
+
+ return;
+}
+
+void
+IPCC_C1_RX_IRQHandler(void)
+{
+ HW_IPCC_Rx_Handler();
+ return;
+}
+
+/* USER CODE END 1 */
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/stm_logging.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/stm_logging.c
new file mode 100644
index 000000000..c24b86dd8
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/stm_logging.c
@@ -0,0 +1,205 @@
+/**
+ ******************************************************************************
+ * File Name : stm_logging.c
+ * Description : This file contains all the defines and functions used
+ * for logging on Application examples.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/**
+ * @file
+ * This file implements logging functions to be used in Application examples.
+ *
+ */
+
+#include <ctype.h>
+#include <inttypes.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <string.h>
+
+#include "app_conf.h"
+#include "stm_logging.h"
+
+#define LOG_PARSE_BUFFER_SIZE 256U
+
+#define LOG_TIMESTAMP_ENABLE 0
+#define LOG_REGION_ENABLE 1U
+#define LOG_RTT_COLOR_ENABLE 1U
+
+#if (LOG_RTT_COLOR_ENABLE == 1U)
+#define RTT_COLOR_CODE_DEFAULT "\x1b[0m"
+#define RTT_COLOR_CODE_RED "\x1b[0;91m"
+#define RTT_COLOR_CODE_GREEN "\x1b[0;92m"
+#define RTT_COLOR_CODE_YELLOW "\x1b[0;93m"
+#define RTT_COLOR_CODE_CYAN "\x1b[0;96m"
+
+#else /* LOG_RTT_COLOR_ENABLE == 1 */
+#define RTT_COLOR_CODE_DEFAULT ""
+#define RTT_COLOR_CODE_RED ""
+#define RTT_COLOR_CODE_GREEN ""
+#define RTT_COLOR_CODE_YELLOW ""
+#define RTT_COLOR_CODE_CYAN ""
+#endif /* LOG_RTT_COLOR_ENABLE == 1 */
+
+#define LOG_MSG_SZ_MAX 256
+
+#if (CFG_DEBUG_TRACE != 0)
+/**
+ * Function for outputting code region string.
+ *
+ * @param[inout] aLogString Pointer to log buffer.
+ * @param[in] aMaxSize Maximum size of log buffer.
+ * @param[in] otLogRegion The region ID.
+ *
+ * @returns String with a log level color value.
+ */
+static inline uint16_t
+logRegion(char *aLogString, uint16_t aMaxSize,
+ appliLogRegion_t aLogRegion)
+{
+ char logRegionString[30U];
+
+ switch (aLogRegion) {
+ case APPLI_LOG_REGION_GENERAL:
+ strcpy(logRegionString, "[M4 APPLICATION]");
+ break;
+ case APPLI_LOG_REGION_ZIGBEE_API:
+ strcpy(logRegionString, "[M4 ZIGBEE API]");
+ break;
+ default:
+ strcpy(logRegionString, "[M4]");
+ break;
+ }
+
+ return snprintf(aLogString, aMaxSize, "%s ", logRegionString);
+}
+
+#endif /* CFG_DEBUG_TRACE */
+
+#if (LOG_RTT_COLOR_ENABLE == 1U)
+#if (CFG_DEBUG_TRACE != 0)
+/**
+ * Function for getting color of a given level log.
+ *
+ * @param[in] aLogLevel The log level.
+ *
+ * @returns String with a log level color value.
+ */
+static inline const char *levelToString(appliLogLevel_t aLogLevel)
+{
+ switch (aLogLevel)
+ {
+ case LOG_LEVEL_CRIT:
+ return RTT_COLOR_CODE_RED;
+
+ case LOG_LEVEL_WARN:
+ return RTT_COLOR_CODE_YELLOW;
+
+ case LOG_LEVEL_INFO:
+ return RTT_COLOR_CODE_GREEN;
+
+ case LOG_LEVEL_DEBG:
+ default:
+ return RTT_COLOR_CODE_DEFAULT;
+ }
+}
+#endif /* CFG_DEBUG_TRACE */
+
+#if (CFG_DEBUG_TRACE != 0)
+/**
+ * Function for printing log level.
+ *
+ * @param[inout] aLogString Pointer to log buffer.
+ * @param[in] aMaxSize Maximum size of log buffer.
+ * @param[in] aLogLevel Log level.
+ *
+ * @returns Number of bytes successfully written to the log buffer.
+ */
+static inline uint16_t logLevel(char *aLogString, uint16_t aMaxSize,
+ appliLogLevel_t aLogLevel)
+{
+ return snprintf(aLogString, aMaxSize, "%s", levelToString(aLogLevel));
+}
+#endif /* CFG_DEBUG_TRACE */
+#endif /* LOG_RTT_COLOR_ENABLE */
+
+#if (LOG_TIMESTAMP_ENABLE == 1U)
+/**
+ * Function for printing actual timestamp.
+ *
+ * @param[inout] aLogString Pointer to the log buffer.
+ * @param[in] aMaxSize Maximum size of the log buffer.
+ *
+ * @returns Number of bytes successfully written to the log buffer.
+ */
+static inline uint16_t logTimestamp(char *aLogString, uint16_t aMaxSize)
+{
+ return snprintf(aLogString, aMaxSize, "%s[%010ld]", RTT_COLOR_CODE_DEFAULT,
+ otPlatAlarmMilliGetNow());
+}
+#endif /* LOG_TIMESTAMP_ENABLE */
+
+/**
+ * Function for printing application log
+ *
+ * @param[in] aLogLevel Log level.
+ * @param[in] aLogRegion The region ID.
+ * @param[in] aFormat User string format.
+ *
+ * @returns Number of bytes successfully written to the log buffer.
+ */
+void logApplication(appliLogLevel_t aLogLevel, appliLogRegion_t aLogRegion, const char *aFormat, ...)
+{
+#if (CFG_DEBUG_TRACE != 0) /* Since the traces are disabled, there is nothing to print */
+ uint16_t length = 0;
+ char logString[LOG_PARSE_BUFFER_SIZE + 1U];
+
+#if (LOG_TIMESTAMP_ENABLE == 1U)
+ length += logTimestamp(logString, LOG_PARSE_BUFFER_SIZE);
+#endif
+
+#if (LOG_RTT_COLOR_ENABLE == 1U)
+ /* Add level information */
+ length += logLevel(&logString[length], (LOG_PARSE_BUFFER_SIZE - length),
+ aLogLevel);
+#endif
+
+#if (LOG_REGION_ENABLE == 1U)
+ /* Add Region information */
+ length += logRegion(&logString[length], (LOG_PARSE_BUFFER_SIZE - length),
+ aLogRegion);
+#endif
+
+ /* Parse user string */
+ va_list paramList;
+ va_start(paramList, aFormat);
+ length += vsnprintf(&logString[length], (LOG_PARSE_BUFFER_SIZE - length),
+ aFormat, paramList);
+ logString[length++] = '\r';
+ logString[length++] = '\n';
+ logString[length++] = 0;
+ va_end(paramList);
+
+ if (aLogLevel <= APPLI_CONFIG_LOG_LEVEL)
+ {
+ printf("%s", logString);
+ }else
+ {
+ /* Print nothing */
+ }
+#endif /* CFG_DEBUG_TRACE */
+}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/system_stm32wbxx.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/system_stm32wbxx.c
new file mode 100644
index 000000000..d4653a0ce
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/Core/Src/system_stm32wbxx.c
@@ -0,0 +1,353 @@
+/**
+ ******************************************************************************
+ * @file system_stm32wbxx.c
+ * @author MCD Application Team
+ * @brief CMSIS Cortex Device Peripheral Access Layer System Source File
+ *
+ * This file provides two functions and one global variable to be called from
+ * user application:
+ * - SystemInit(): This function is called at startup just after reset and
+ * before branch to main program. This call is made inside
+ * the "startup_stm32wbxx.s" file.
+ *
+ * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used
+ * by the user application to setup the SysTick
+ * timer or configure other parameters.
+ *
+ * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must
+ * be called whenever the core clock is changed
+ * during program execution.
+ *
+ * After each device reset the MSI (4 MHz) is used as system clock source.
+ * Then SystemInit() function is called, in "startup_stm32wbxx.s" file, to
+ * configure the system clock before to branch to main program.
+ *
+ * This file configures the system clock as follows:
+ *=============================================================================
+ *-----------------------------------------------------------------------------
+ * System Clock source | MSI
+ *-----------------------------------------------------------------------------
+ * SYSCLK(Hz) | 4000000
+ *-----------------------------------------------------------------------------
+ * HCLK(Hz) | 4000000
+ *-----------------------------------------------------------------------------
+ * AHB Prescaler | 1
+ *-----------------------------------------------------------------------------
+ * APB1 Prescaler | 1
+ *-----------------------------------------------------------------------------
+ * APB2 Prescaler | 1
+ *-----------------------------------------------------------------------------
+ * PLL_M | 1
+ *-----------------------------------------------------------------------------
+ * PLL_N | 8
+ *-----------------------------------------------------------------------------
+ * PLL_P | 7
+ *-----------------------------------------------------------------------------
+ * PLL_Q | 2
+ *-----------------------------------------------------------------------------
+ * PLL_R | 2
+ *-----------------------------------------------------------------------------
+ * PLLSAI1_P | NA
+ *-----------------------------------------------------------------------------
+ * PLLSAI1_Q | NA
+ *-----------------------------------------------------------------------------
+ * PLLSAI1_R | NA
+ *-----------------------------------------------------------------------------
+ * Require 48MHz for USB OTG FS, | Disabled
+ * SDIO and RNG clock |
+ *-----------------------------------------------------------------------------
+ *=============================================================================
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+
+/** @addtogroup CMSIS
+ * @{
+ */
+
+/** @addtogroup stm32WBxx_system
+ * @{
+ */
+
+/** @addtogroup stm32WBxx_System_Private_Includes
+ * @{
+ */
+
+#include "stm32wbxx.h"
+
+#if !defined (HSE_VALUE)
+ #define HSE_VALUE (32000000UL) /*!< Value of the External oscillator in Hz */
+#endif /* HSE_VALUE */
+
+#if !defined (MSI_VALUE)
+ #define MSI_VALUE (4000000UL) /*!< Value of the Internal oscillator in Hz*/
+#endif /* MSI_VALUE */
+
+#if !defined (HSI_VALUE)
+ #define HSI_VALUE (16000000UL) /*!< Value of the Internal oscillator in Hz*/
+#endif /* HSI_VALUE */
+
+#if !defined (LSI_VALUE)
+ #define LSI_VALUE (32000UL) /*!< Value of LSI in Hz*/
+#endif /* LSI_VALUE */
+
+#if !defined (LSE_VALUE)
+ #define LSE_VALUE (32768UL) /*!< Value of LSE in Hz*/
+#endif /* LSE_VALUE */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_TypesDefinitions
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_Defines
+ * @{
+ */
+
+/*!< Uncomment the following line if you need to relocate your vector Table in
+ Internal SRAM. */
+/* #define VECT_TAB_SRAM */
+#define VECT_TAB_OFFSET 0x0U /*!< Vector Table base offset field.
+ This value must be a multiple of 0x200. */
+
+#define VECT_TAB_BASE_ADDRESS SRAM1_BASE /*!< Vector Table base offset field.
+ This value must be a multiple of 0x200. */
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_Macros
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_Variables
+ * @{
+ */
+ /* The SystemCoreClock variable is updated in three ways:
+ 1) by calling CMSIS function SystemCoreClockUpdate()
+ 2) by calling HAL API function HAL_RCC_GetHCLKFreq()
+ 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
+ Note: If you use this function to configure the system clock; then there
+ is no need to call the 2 first functions listed above, since SystemCoreClock
+ variable is updated automatically.
+ */
+ uint32_t SystemCoreClock = 4000000UL ; /*CPU1: M4 on MSI clock after startup (4MHz)*/
+
+ const uint32_t AHBPrescTable[16UL] = {1UL, 3UL, 5UL, 1UL, 1UL, 6UL, 10UL, 32UL, 2UL, 4UL, 8UL, 16UL, 64UL, 128UL, 256UL, 512UL};
+
+ const uint32_t APBPrescTable[8UL] = {0UL, 0UL, 0UL, 0UL, 1UL, 2UL, 3UL, 4UL};
+
+ const uint32_t MSIRangeTable[16UL] = {100000UL, 200000UL, 400000UL, 800000UL, 1000000UL, 2000000UL, \
+ 4000000UL, 8000000UL, 16000000UL, 24000000UL, 32000000UL, 48000000UL, 0UL, 0UL, 0UL, 0UL}; /* 0UL values are incorrect cases */
+
+ const uint32_t SmpsPrescalerTable[4UL][6UL]={{1UL,3UL,2UL,2UL,1UL,2UL}, \
+ {2UL,6UL,4UL,3UL,2UL,4UL}, \
+ {4UL,12UL,8UL,6UL,4UL,8UL}, \
+ {4UL,12UL,8UL,6UL,4UL,8UL}};
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_FunctionPrototypes
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_Functions
+ * @{
+ */
+
+/**
+ * @brief Setup the microcontroller system.
+ * @param None
+ * @retval None
+ */
+void SystemInit(void)
+{
+ /* Configure the Vector Table location add offset address ------------------*/
+#if defined(VECT_TAB_SRAM) && defined(VECT_TAB_BASE_ADDRESS)
+ /* program in SRAMx */
+ SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAMx for CPU1 */
+#else /* program in FLASH */
+ SCB->VTOR = VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
+#endif
+
+ /* FPU settings ------------------------------------------------------------*/
+ #if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
+ SCB->CPACR |= ((3UL << (10UL*2UL))|(3UL << (11UL*2UL))); /* set CP10 and CP11 Full Access */
+ #endif
+
+ /* Reset the RCC clock configuration to the default reset state ------------*/
+ /* Set MSION bit */
+ RCC->CR |= RCC_CR_MSION;
+
+ /* Reset CFGR register */
+ RCC->CFGR = 0x00070000U;
+
+ /* Reset PLLSAI1ON, PLLON, HSECSSON, HSEON, HSION, and MSIPLLON bits */
+ RCC->CR &= (uint32_t)0xFAF6FEFBU;
+
+ /*!< Reset LSI1 and LSI2 bits */
+ RCC->CSR &= (uint32_t)0xFFFFFFFAU;
+
+ /*!< Reset HSI48ON bit */
+ RCC->CRRCR &= (uint32_t)0xFFFFFFFEU;
+
+ /* Reset PLLCFGR register */
+ RCC->PLLCFGR = 0x22041000U;
+
+ /* Reset PLLSAI1CFGR register */
+ RCC->PLLSAI1CFGR = 0x22041000U;
+
+ /* Reset HSEBYP bit */
+ RCC->CR &= 0xFFFBFFFFU;
+
+ /* Disable all interrupts */
+ RCC->CIER = 0x00000000;
+}
+
+/**
+ * @brief Update SystemCoreClock variable according to Clock Register Values.
+ * The SystemCoreClock variable contains the core clock (HCLK), it can
+ * be used by the user application to setup the SysTick timer or configure
+ * other parameters.
+ *
+ * @note Each time the core clock (HCLK) changes, this function must be called
+ * to update SystemCoreClock variable value. Otherwise, any configuration
+ * based on this variable will be incorrect.
+ *
+ * @note - The system frequency computed by this function is not the real
+ * frequency in the chip. It is calculated based on the predefined
+ * constant and the selected clock source:
+ *
+ * - If SYSCLK source is MSI, SystemCoreClock will contain the MSI_VALUE(*)
+ *
+ * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(**)
+ *
+ * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(***)
+ *
+ * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(***)
+ * or HSI_VALUE(*) or MSI_VALUE(*) multiplied/divided by the PLL factors.
+ *
+ * (*) MSI_VALUE is a constant defined in stm32wbxx_hal.h file (default value
+ * 4 MHz) but the real value may vary depending on the variations
+ * in voltage and temperature.
+ *
+ * (**) HSI_VALUE is a constant defined in stm32wbxx_hal_conf.h file (default value
+ * 16 MHz) but the real value may vary depending on the variations
+ * in voltage and temperature.
+ *
+ * (***) HSE_VALUE is a constant defined in stm32wbxx_hal_conf.h file (default value
+ * 32 MHz), user has to ensure that HSE_VALUE is same as the real
+ * frequency of the crystal used. Otherwise, this function may
+ * have wrong result.
+ *
+ * - The result of this function could be not correct when using fractional
+ * value for HSE crystal.
+ *
+ * @param None
+ * @retval None
+ */
+void SystemCoreClockUpdate(void)
+{
+ uint32_t tmp, msirange, pllvco, pllr, pllsource , pllm;
+
+ /* Get MSI Range frequency--------------------------------------------------*/
+
+ /*MSI frequency range in Hz*/
+ msirange = MSIRangeTable[(RCC->CR & RCC_CR_MSIRANGE) >> RCC_CR_MSIRANGE_Pos];
+
+ /* Get SYSCLK source -------------------------------------------------------*/
+ switch (RCC->CFGR & RCC_CFGR_SWS)
+ {
+ case 0x00: /* MSI used as system clock source */
+ SystemCoreClock = msirange;
+ break;
+
+ case 0x04: /* HSI used as system clock source */
+ /* HSI used as system clock source */
+ SystemCoreClock = HSI_VALUE;
+ break;
+
+ case 0x08: /* HSE used as system clock source */
+ SystemCoreClock = HSE_VALUE;
+ break;
+
+ case 0x0C: /* PLL used as system clock source */
+ /* PLL_VCO = (HSE_VALUE or HSI_VALUE or MSI_VALUE/ PLLM) * PLLN
+ SYSCLK = PLL_VCO / PLLR
+ */
+ pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC);
+ pllm = ((RCC->PLLCFGR & RCC_PLLCFGR_PLLM) >> RCC_PLLCFGR_PLLM_Pos) + 1UL ;
+
+ if(pllsource == 0x02UL) /* HSI used as PLL clock source */
+ {
+ pllvco = (HSI_VALUE / pllm);
+ }
+ else if(pllsource == 0x03UL) /* HSE used as PLL clock source */
+ {
+ pllvco = (HSE_VALUE / pllm);
+ }
+ else /* MSI used as PLL clock source */
+ {
+ pllvco = (msirange / pllm);
+ }
+
+ pllvco = pllvco * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> RCC_PLLCFGR_PLLN_Pos);
+ pllr = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLR) >> RCC_PLLCFGR_PLLR_Pos) + 1UL);
+
+ SystemCoreClock = pllvco/pllr;
+ break;
+
+ default:
+ SystemCoreClock = msirange;
+ break;
+ }
+
+ /* Compute HCLK clock frequency --------------------------------------------*/
+ /* Get HCLK1 prescaler */
+ tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> RCC_CFGR_HPRE_Pos)];
+ /* HCLK clock frequency */
+ SystemCoreClock = SystemCoreClock / tmp;
+
+}
+
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/EWARM/Project.eww b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/EWARM/Project.eww
new file mode 100644
index 000000000..98d679f94
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/EWARM/Project.eww
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workspace>
+ <project>
+ <path>$WS_DIR$\Zigbee_OnOff_Distrib.ewp</path>
+ </project>
+ <batchBuild />
+</workspace>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/EWARM/Zigbee_OnOff_Distrib.ewd b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/EWARM/Zigbee_OnOff_Distrib.ewd
new file mode 100644
index 000000000..a1b53f07b
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/EWARM/Zigbee_OnOff_Distrib.ewd
@@ -0,0 +1,1419 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <fileVersion>3</fileVersion>
+ <configuration>
+ <name>Zigbee_OnOff_Distrib</name>
+ <toolchain>
+ <name>ARM</name>
+ </toolchain>
+ <debug>1</debug>
+ <settings>
+ <name>C-SPY</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>29</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CInput</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CEndian</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCVariant</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>MemOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MemFile</name>
+ <state>$TOOLKIT_DIR$\CONFIG\debugger\ST\STM32WB_M4.ddf</state>
+ </option>
+ <option>
+ <name>RunToEnable</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RunToName</name>
+ <state>main</state>
+ </option>
+ <option>
+ <name>CExtraOptionsCheck</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CExtraOptions</name>
+ <state>--stlink_use_server</state>
+ </option>
+ <option>
+ <name>CFpuProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCDDFArgumentProducer</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCDownloadSuppressDownload</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCDownloadVerifyAll</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCProductVersion</name>
+ <state>8.20.2.14834</state>
+ </option>
+ <option>
+ <name>OCDynDriverList</name>
+ <state>STLINK_ID</state>
+ </option>
+ <option>
+ <name>OCLastSavedByProductVersion</name>
+ <state>8.20.2.14834</state>
+ </option>
+ <option>
+ <name>UseFlashLoader</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CLowLevel</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCBE8Slave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>MacFile2</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CDevice</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>FlashLoadersV3</name>
+ <state>$TOOLKIT_DIR$\config\flashloader\ST\FlashSTM32WB_M4.board</state>
+ </option>
+ <option>
+ <name>OCImagesSuppressCheck1</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesPath1</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCImagesSuppressCheck2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesPath2</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCImagesSuppressCheck3</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesPath3</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OverrideDefFlashBoard</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesOffset1</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCImagesOffset2</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCImagesOffset3</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCImagesUse1</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesUse2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesUse3</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCDeviceConfigMacroFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCDebuggerExtraOption</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCAllMTBOptions</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCMulticoreNrOfCores</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCMulticoreMaster</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCMulticorePort</name>
+ <state>53461</state>
+ </option>
+ <option>
+ <name>OCMulticoreWorkspace</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCMulticoreSlaveProject</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCMulticoreSlaveConfiguration</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCDownloadExtraImage</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCAttachSlave</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MassEraseBeforeFlashing</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>ARMSIM_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>1</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCSimDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCSimEnablePSP</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCSimPspOverrideConfig</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCSimPspConfigFile</name>
+ <state></state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>CADI_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CCadiMemory</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>Fast Model</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCADILogFileCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCADILogFileEditB</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>CMSISDAP_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>4</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCIarProbeScriptFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CMSISDAPResetList</name>
+ <version>1</version>
+ <state>10</state>
+ </option>
+ <option>
+ <name>CMSISDAPHWResetDuration</name>
+ <state>300</state>
+ </option>
+ <option>
+ <name>CMSISDAPHWResetDelay</name>
+ <state>200</state>
+ </option>
+ <option>
+ <name>CMSISDAPDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CMSISDAPInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPMultiTargetEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPMultiTarget</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPJtagSpeedList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPBreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPRestoreBreakpointsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPUpdateBreakpointsEdit</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>RDICatchReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchUndef</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchSWI</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchData</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchPrefetch</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchIRQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchFIQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CatchMMERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchNOCPERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchCHKERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchSTATERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchBUSERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchINTERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchSFERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchHARDERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPMultiCPUEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPMultiCPUNumber</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCProbeCfgOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCProbeConfig</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CMSISDAPProbeConfigRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPSelectedCPUBehaviour</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ICpuName</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCJetEmuParams</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCCMSISDAPUsbSerialNo</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCCMSISDAPUsbSerialNoSelect</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>GDBSERVER_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>TCPIP</name>
+ <state>aaa.bbb.ccc.ddd</state>
+ </option>
+ <option>
+ <name>DoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>LogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCJTagBreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJTagDoUpdateBreakpoints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJTagUpdateBreakpoints</name>
+ <state>_call_main</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>IJET_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>8</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCIarProbeScriptFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IjetResetList</name>
+ <version>1</version>
+ <state>10</state>
+ </option>
+ <option>
+ <name>IjetHWResetDuration</name>
+ <state>300</state>
+ </option>
+ <option>
+ <name>IjetHWResetDelay</name>
+ <state>200</state>
+ </option>
+ <option>
+ <name>IjetPowerFromProbe</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IjetPowerRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>IjetInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetMultiTargetEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetMultiTarget</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetScanChainNonARMDevices</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetIRLength</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetJtagSpeedList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetProtocolRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetSwoPin</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetCpuClockEdit</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IjetSwoPrescalerList</name>
+ <version>1</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetBreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetRestoreBreakpointsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetUpdateBreakpointsEdit</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>RDICatchReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchUndef</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchSWI</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchData</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchPrefetch</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchIRQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchFIQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CatchMMERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchNOCPERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchCHKERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchSTATERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchBUSERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchINTERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchSFERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchHARDERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCProbeCfgOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCProbeConfig</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IjetProbeConfigRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetMultiCPUEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetMultiCPUNumber</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetSelectedCPUBehaviour</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ICpuName</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCJetEmuParams</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IjetPreferETB</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IjetTraceSettingsList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetTraceSizeList</name>
+ <version>0</version>
+ <state>4</state>
+ </option>
+ <option>
+ <name>FlashBoardPathSlave</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCIjetUsbSerialNo</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCIjetUsbSerialNoSelect</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>JLINK_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>16</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>JLinkSpeed</name>
+ <state>1000</state>
+ </option>
+ <option>
+ <name>CCJLinkDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCJLinkHWResetDelay</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>JLinkInitialSpeed</name>
+ <state>1000</state>
+ </option>
+ <option>
+ <name>CCDoJlinkMultiTarget</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCScanChainNonARMDevices</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkMultiTarget</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkIRLength</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkCommRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkTCPIP</name>
+ <state>aaa.bbb.ccc.ddd</state>
+ </option>
+ <option>
+ <name>CCJLinkSpeedRadioV2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCUSBDevice</name>
+ <version>1</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCRDICatchReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchUndef</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchSWI</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchData</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchPrefetch</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchIRQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchFIQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkBreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkDoUpdateBreakpoints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkUpdateBreakpoints</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>CCJLinkInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkResetList</name>
+ <version>6</version>
+ <state>5</state>
+ </option>
+ <option>
+ <name>CCJLinkInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchMMERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchNOCPERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchCHRERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchSTATERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchBUSERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchINTERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchSFERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchHARDERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCJLinkScriptFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCJLinkUsbSerialNo</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCTcpIpAlt</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkTcpIpSerialNo</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCCpuClockEdit</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCSwoClockAuto</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSwoClockEdit</name>
+ <state>2000</state>
+ </option>
+ <option>
+ <name>OCJLinkTraceSource</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCJLinkTraceSourceDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCJLinkDeviceName</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>LMIFTDI_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>2</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>LmiftdiSpeed</name>
+ <state>500</state>
+ </option>
+ <option>
+ <name>CCLmiftdiDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCLmiftdiLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCLmiFtdiInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCLmiFtdiInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>PEMICRO_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>3</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCJPEMicroShowSettings</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>DoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>LogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>STLINK_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>4</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCSTLinkInterfaceRadio</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCSTLinkInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkResetList</name>
+ <version>3</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCpuClockEdit</name>
+ <state>32.0</state>
+ </option>
+ <option>
+ <name>CCSwoClockAuto</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSwoClockEdit</name>
+ <state>2000</state>
+ </option>
+ <option>
+ <name>DoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>LogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCSTLinkDoUpdateBreakpoints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkUpdateBreakpoints</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchMMERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchNOCPERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchCHRERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchSTATERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchBUSERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchINTERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchSFERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchHARDERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkUsbSerialNo</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCSTLinkUsbSerialNoSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkJtagSpeedList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkDAPNumber</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkDebugAccessPortRadio</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>THIRDPARTY_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CThirdPartyDriverDll</name>
+ <state>###Uninitialized###</state>
+ </option>
+ <option>
+ <name>CThirdPartyLogFileCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CThirdPartyLogFileEditB</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>TIFET_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>1</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCMSPFetResetList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetTargetVccTypeDefault</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetTargetVoltage</name>
+ <state>###Uninitialized###</state>
+ </option>
+ <option>
+ <name>CCMSPFetVCCDefault</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCMSPFetTargetSettlingtime</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetRadioJtagSpeedType</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCMSPFetConnection</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetUsbComPort</name>
+ <state>Automatic</state>
+ </option>
+ <option>
+ <name>CCMSPFetAllowAccessToBSL</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCMSPFetRadioEraseFlash</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>XDS100_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>6</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>TIPackageOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>TIPackage</name>
+ <state></state>
+ </option>
+ <option>
+ <name>BoardFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>DoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>LogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCXds100BreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100DoUpdateBreakpoints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100UpdateBreakpoints</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>CCXds100CatchReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchUndef</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchSWI</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchData</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchPrefetch</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchIRQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchFIQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchMMERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchNOCPERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchCHRERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchSTATERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchBUSERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchINTERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchSFERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchHARDERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CpuClockEdit</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCXds100SwoClockAuto</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100SwoClockEdit</name>
+ <state>1000</state>
+ </option>
+ <option>
+ <name>CCXds100HWResetDelay</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100ResetList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100UsbSerialNo</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCXds100UsbSerialNoSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100JtagSpeedList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100InterfaceRadio</name>
+ <state>2</state>
+ </option>
+ <option>
+ <name>CCXds100InterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100ProbeList</name>
+ <version>0</version>
+ <state>2</state>
+ </option>
+ <option>
+ <name>CCXds100SWOPortRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100SWOPort</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <debuggerPlugins>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\Mbed\MbedArmPlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin</file>
+ <loadFlag>1</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\TargetAccessServer\TargetAccessServer.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ </debuggerPlugins>
+ </configuration>
+</project>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/EWARM/Zigbee_OnOff_Distrib.ewp b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/EWARM/Zigbee_OnOff_Distrib.ewp
new file mode 100644
index 000000000..a49e07d7f
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/EWARM/Zigbee_OnOff_Distrib.ewp
@@ -0,0 +1,1264 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <fileVersion>3</fileVersion>
+ <configuration>
+ <name>Zigbee_OnOff_Distrib</name>
+ <toolchain>
+ <name>ARM</name>
+ </toolchain>
+ <debug>1</debug>
+ <settings>
+ <name>General</name>
+ <archiveVersion>3</archiveVersion>
+ <data>
+ <version>30</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>ExePath</name>
+ <state>Zigbee_OnOff_Distrib/Exe</state>
+ </option>
+ <option>
+ <name>ObjPath</name>
+ <state>Zigbee_OnOff_Distrib/Obj</state>
+ </option>
+ <option>
+ <name>ListPath</name>
+ <state>Zigbee_OnOff_Distrib/List</state>
+ </option>
+ <option>
+ <name>GEndianMode</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>Input description</name>
+ <state>Full formatting, with multibyte support.</state>
+ </option>
+ <option>
+ <name>Output description</name>
+ <state>Full formatting, with multibyte support.</state>
+ </option>
+ <option>
+ <name>GOutputBinary</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGCoreOrChip</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>GRuntimeLibSelect</name>
+ <version>0</version>
+ <state>2</state>
+ </option>
+ <option>
+ <name>GRuntimeLibSelectSlave</name>
+ <version>0</version>
+ <state>2</state>
+ </option>
+ <option>
+ <name>RTDescription</name>
+ <state>Use the full configuration of the C/C++ runtime library. Full locale interface, C locale, file descriptor support, multibytes in printf and scanf, and hex floats in strtod.</state>
+ </option>
+ <option>
+ <name>OGProductVersion</name>
+ <state>4.41A</state>
+ </option>
+ <option>
+ <name>OGLastSavedByProductVersion</name>
+ <state>8.20.2.14834</state>
+ </option>
+ <option>
+ <name>GeneralEnableMisra</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GeneralMisraVerbose</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGChipSelectEditMenu</name>
+ <state>STM32WB55RG ST STM32WB55RG</state>
+ </option>
+ <option>
+ <name>GenLowLevelInterface</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>GEndianModeBE</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OGBufferedTerminalOutput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GenStdoutInterface</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GeneralMisraRules98</name>
+ <version>0</version>
+ <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
+ </option>
+ <option>
+ <name>GeneralMisraVer</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GeneralMisraRules04</name>
+ <version>0</version>
+ <state>011111111111111110111111111111011111111111111011110100111111111111111111111111111111111111111111101111111111111011111111111111111111111111111</state>
+ </option>
+ <option>
+ <name>RTConfigPath2</name>
+ <state>$TOOLKIT_DIR$\INC\c\DLib_Config_Full.h</state>
+ </option>
+ <option>
+ <name>GBECoreSlave</name>
+ <version>26</version>
+ <state>39</state>
+ </option>
+ <option>
+ <name>OGUseCmsis</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGUseCmsisDspLib</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GRuntimeLibThreads</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CoreVariant</name>
+ <version>26</version>
+ <state>39</state>
+ </option>
+ <option>
+ <name>GFPUDeviceSlave</name>
+ <state>STM32WB55RG ST STM32WB55RG</state>
+ </option>
+ <option>
+ <name>FPU2</name>
+ <version>0</version>
+ <state>4</state>
+ </option>
+ <option>
+ <name>NrRegs</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>NEON</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GFPUCoreSlave2</name>
+ <version>26</version>
+ <state>39</state>
+ </option>
+ <option>
+ <name>OGCMSISPackSelectDevice</name>
+ </option>
+ <option>
+ <name>OgLibHeap</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGLibAdditionalLocale</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGPrintfVariant</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OGPrintfMultibyteSupport</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OGScanfVariant</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OGScanfMultibyteSupport</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>GenLocaleTags</name>
+ <state></state>
+ </option>
+ <option>
+ <name>GenLocaleDisplayOnly</name>
+ <state></state>
+ </option>
+ <option>
+ <name>DSPExtension</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>TrustZone</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>ICCARM</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>34</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CCOptimizationNoSizeConstraints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCDefines</name>
+ <state>USE_HAL_DRIVER</state>
+ <state>STM32WB55xx</state>
+ <state>USE_STM32WBXX_NUCLEO</state>
+ <state>ZIGBEE_WB</state>
+ </option>
+ <option>
+ <name>CCPreprocFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPreprocComments</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPreprocLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListCFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListCMnemonics</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListCMessages</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListAssFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListAssSource</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCEnableRemarks</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCDiagSuppress</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCDiagRemark</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCDiagWarning</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCDiagError</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCObjPrefix</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCAllowList</name>
+ <version>1</version>
+ <state>11111110</state>
+ </option>
+ <option>
+ <name>CCDebugInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IEndianMode</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IExtraOptionsCheck</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IExtraOptions</name>
+ <state>--diag_suppress Pe111</state>
+ <state>--diag_suppress Pe188</state>
+ </option>
+ <option>
+ <name>CCLangConformance</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSignedPlainChar</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCRequirePrototypes</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCDiagWarnAreErr</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCompilerRuntimeInfo</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IFpuProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OutputFile</name>
+ <state>$FILE_BNAME$.o</state>
+ </option>
+ <option>
+ <name>CCLibConfigHeader</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>PreInclude</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CompilerMisraOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCIncludePath2</name>
+ <state>$PROJ_DIR$/../Core/Inc</state>
+ <state>$PROJ_DIR$/../STM32_WPAN/App</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/BSP/P-NUCLEO-WB55.Nucleo</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/STM32WBxx_HAL_Driver/Inc</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/STM32WBxx_HAL_Driver/Inc/Legacy</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/app</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/utilities</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/CMSIS/Device/ST/STM32WBxx/Include</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/zigbee/core/Inc</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/zigbee/stack</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/zigbee/stack/include</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/zigbee/stack/include/M4</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/CMSIS/Include</state>
+ <state>$PROJ_DIR$/../../../../../../Utilities/sequencer</state>
+ <state>$PROJ_DIR$/../../../../../../Utilities/lpm/tiny_lpm</state>
+ </option>
+ <option>
+ <name>CCStdIncCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCodeSection</name>
+ <state>.text</state>
+ </option>
+ <option>
+ <name>IProcessorMode2</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCOptLevel</name>
+ <state>3</state>
+ </option>
+ <option>
+ <name>CCOptStrategy</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCOptLevelSlave</name>
+ <state>3</state>
+ </option>
+ <option>
+ <name>CompilerMisraRules98</name>
+ <version>0</version>
+ <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
+ </option>
+ <option>
+ <name>CompilerMisraRules04</name>
+ <version>0</version>
+ <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
+ </option>
+ <option>
+ <name>CCPosIndRopi</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPosIndRwpi</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPosIndNoDynInit</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccLang</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccCDialect</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IccAllowVLA</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccStaticDestr</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccCppInlineSemantics</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccCmsis</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IccFloatSemantics</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCNoLiteralPool</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCOptStrategySlave</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCGuardCalls</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCEncSource</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCEncOutput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCEncOutputBom</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCEncInput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccExceptions2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccRTTI2</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>AARM</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>10</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>AObjPrefix</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AEndian</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>ACaseSensitivity</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>MacroChars</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AWarnEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AWarnWhat</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AWarnOne</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AWarnRange1</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AWarnRange2</name>
+ <state></state>
+ </option>
+ <option>
+ <name>ADebug</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AltRegisterNames</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ADefines</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AList</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AListHeader</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AListing</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>Includes</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacDefs</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacExps</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>MacExec</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OnlyAssed</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MultiLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>PageLengthCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>PageLength</name>
+ <state>80</state>
+ </option>
+ <option>
+ <name>TabSpacing</name>
+ <state>8</state>
+ </option>
+ <option>
+ <name>AXRef</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AXRefDefines</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AXRefInternal</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AXRefDual</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AFpuProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AOutputFile</name>
+ <state>$FILE_BNAME$.o</state>
+ </option>
+ <option>
+ <name>ALimitErrorsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ALimitErrorsEdit</name>
+ <state>100</state>
+ </option>
+ <option>
+ <name>AIgnoreStdInclude</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AUserIncludes</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AExtraOptionsCheckV2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AExtraOptionsV2</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AsmNoLiteralPool</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>OBJCOPY</name>
+ <archiveVersion>0</archiveVersion>
+ <data>
+ <version>1</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OOCOutputFormat</name>
+ <version>3</version>
+ <state>3</state>
+ </option>
+ <option>
+ <name>OCOutputOverride</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OOCOutputFile</name>
+ <state>Zigbee_OnOff_Distrib.bin</state>
+ </option>
+ <option>
+ <name>OOCCommandLineProducer</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OOCObjCopyEnable</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>CUSTOM</name>
+ <archiveVersion>3</archiveVersion>
+ <data>
+ <extensions></extensions>
+ <cmdline></cmdline>
+ <hasPrio>0</hasPrio>
+ </data>
+ </settings>
+ <settings>
+ <name>BICOMP</name>
+ <archiveVersion>0</archiveVersion>
+ <data />
+ </settings>
+ <settings>
+ <name>BUILDACTION</name>
+ <archiveVersion>1</archiveVersion>
+ <data>
+ <prebuild></prebuild>
+ <postbuild></postbuild>
+ </data>
+ </settings>
+ <settings>
+ <name>ILINK</name>
+ <archiveVersion>0</archiveVersion>
+ <data>
+ <version>20</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>IlinkLibIOConfig</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>XLinkMisraHandler</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkInputFileSlave</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkOutputFile</name>
+ <state>Zigbee_OnOff_Distrib.out</state>
+ </option>
+ <option>
+ <name>IlinkDebugInfoEnable</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkKeepSymbols</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinaryFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinarySymbol</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinarySegment</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinaryAlign</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkDefines</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkConfigDefines</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkMapFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkLogFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogInitialization</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogModule</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogSection</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogVeneer</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkIcfOverride</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkIcfFile</name>
+ <state>$PROJ_DIR$\stm32wb55xx_flash_cm4.icf</state>
+ </option>
+ <option>
+ <name>IlinkIcfFileSlave</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkEnableRemarks</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkSuppressDiags</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkTreatAsRem</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkTreatAsWarn</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkTreatAsErr</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkWarningsAreErrors</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkUseExtraOptions</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkExtraOptions</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkLowLevelInterfaceSlave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkAutoLibEnable</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkAdditionalLibs</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkOverrideProgramEntryLabel</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkProgramEntryLabelSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkProgramEntryLabel</name>
+ <state>__iar_program_start</state>
+ </option>
+ <option>
+ <name>DoFill</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>FillerByte</name>
+ <state>0xFF</state>
+ </option>
+ <option>
+ <name>FillerStart</name>
+ <state>0x0</state>
+ </option>
+ <option>
+ <name>FillerEnd</name>
+ <state>0x0</state>
+ </option>
+ <option>
+ <name>CrcSize</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcAlign</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcPoly</name>
+ <state>0x11021</state>
+ </option>
+ <option>
+ <name>CrcCompl</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CrcBitOrder</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CrcInitialValue</name>
+ <state>0x0</state>
+ </option>
+ <option>
+ <name>DoCrc</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkBE8Slave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkBufferedTerminalOutput</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkStdoutInterfaceSlave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcFullSize</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkIElfToolPostProcess</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogAutoLibSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogRedirSymbols</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogUnusedFragments</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkCrcReverseByteOrder</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkCrcUseAsInput</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptInline</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkOptExceptionsAllow</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptExceptionsForce</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkCmsis</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptMergeDuplSections</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkOptUseVfe</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptForceVfe</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkStackAnalysisEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkStackControlFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkStackCallGraphFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CrcAlgorithm</name>
+ <version>1</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcUnitSize</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkThreadsSlave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkLogCallGraph</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkIcfFile_AltDefault</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkEncInput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkEncOutput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkEncOutputBom</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkHeapSelect</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkLocaleSelect</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>IARCHIVE</name>
+ <archiveVersion>0</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>IarchiveInputs</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IarchiveOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IarchiveOutput</name>
+ <state>###Unitialized###</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>BILINK</name>
+ <archiveVersion>0</archiveVersion>
+ <data />
+ </settings>
+ </configuration>
+ <group>
+ <name>Application</name>
+ <group>
+ <name>EWARM</name>
+ <file>
+ <name>$PROJ_DIR$\startup_stm32wb55xx_cm4.s</name>
+ </file>
+ </group>
+ <group>
+ <name>User</name>
+ <group>
+ <name>Core</name>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\app_entry.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\hw_timerserver.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\hw_uart.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\main.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\stm32wbxx_hal_msp.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\stm32wbxx_it.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\stm_logging.c</name>
+ </file>
+ </group>
+ <group>
+ <name>STM32_WPAN</name>
+ <group>
+ <name>App</name>
+ <file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\App\app_zigbee.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\App\app_zigbee_demo.c</name>
+ </file>
+ </group>
+ <group>
+ <name>Target</name>
+ <file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\Target\hw_ipcc.c</name>
+ </file>
+ </group>
+ </group>
+ </group>
+ </group>
+ <group>
+ <name>Drivers</name>
+ <group>
+ <name>BSP</name>
+ <group>
+ <name>STM32WBxx_Nucleo</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\BSP\P-NUCLEO-WB55.Nucleo\stm32wbxx_nucleo.c</name>
+ </file>
+ </group>
+ </group>
+ <group>
+ <name>CMSIS</name>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\system_stm32wbxx.c</name>
+ </file>
+ </group>
+ <group>
+ <name>STM32WBxx_HAL_Driver</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_cortex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_dma.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_dma_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_exti.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_flash.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_flash_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_gpio.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_hsem.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_pwr.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_pwr_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rcc.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rcc_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rtc.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rtc_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_tim.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_tim_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_uart.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_uart_ex.c</name>
+ </file>
+ </group>
+ </group>
+ <group>
+ <name>Middlewares</name>
+ <group>
+ <name>STM32_WPAN</name>
+ <group>
+ <name>interface</name>
+ <group>
+ <name>patterns</name>
+ <group>
+ <name>ble_thread</name>
+ <group>
+ <name>schi</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\shci\shci.c</name>
+ </file>
+ </group>
+ <group>
+ <name>tl</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\hci_tl_if.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\shci_tl.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\shci_tl_if.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\tl_mbox.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\tl_zigbee_hci.c</name>
+ </file>
+ </group>
+ </group>
+ </group>
+ </group>
+ <group>
+ <name>utilities</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\utilities\dbg_trace.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\utilities\otp.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\utilities\stm_list.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\utilities\stm_queue.c</name>
+ </file>
+ </group>
+ <group>
+ <name>zigbee</name>
+ <group>
+ <name>core</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\zigbee\core\src\zigbee_core_wb.c</name>
+ </file>
+ </group>
+ <group>
+ <name>stack</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\zigbee\lib\stm32wb_zigbee_wb_lib.a</name>
+ </file>
+ </group>
+ </group>
+ </group>
+ </group>
+ <group>
+ <name>Utilities</name>
+ <group>
+ <name>lpm</name>
+ <group>
+ <name>tiny_lpm</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Utilities\lpm\tiny_lpm\stm32_lpm.c</name>
+ </file>
+ </group>
+ </group>
+ <group>
+ <name>sequencer</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Utilities\sequencer\stm32_seq.c</name>
+ </file>
+ </group>
+ </group>
+</project>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/EWARM/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/EWARM/startup_stm32wb55xx_cm4.s
new file mode 100644
index 000000000..1f886ff59
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/EWARM/startup_stm32wb55xx_cm4.s
@@ -0,0 +1,517 @@
+;******************************************************************************
+;* File Name : startup_stm32wb55xx_cm4.s
+;* Author : MCD Application Team
+;* Description : M4 core vector table of the STM32WB55xx devices for the
+;* IAR (EWARM) toolchain.
+;*
+;* This module performs:
+;* - Set the initial SP
+;* - Set the initial PC == _iar_program_start,
+;* - Set the vector table entries with the exceptions ISR
+;* address.
+;* - Branches to main in the C library (which eventually
+;* calls main()).
+;* After Reset the Cortex-M4 processor is in Thread mode,
+;* priority is Privileged, and the Stack is set to Main.
+;******************************************************************************
+;* @attention
+;*
+;* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+;* All rights reserved.</center></h2>
+;*
+;* This software component is licensed by ST under BSD 3-Clause license,
+;* the "License"; You may not use this file except in compliance with the
+;* License. You may obtain a copy of the License at:
+;* opensource.org/licenses/BSD-3-Clause
+;*
+;******************************************************************************
+;
+;
+; The modules in this file are included in the libraries, and may be replaced
+; by any user-defined modules that define the PUBLIC symbol _program_start or
+; a user defined start symbol.
+; To override the cstartup defined in the library, simply add your modified
+; version to the workbench project.
+;
+; The vector table is normally located at address 0.
+; When debugging in RAM, it can be located in RAM, aligned to at least 2^6.
+; The name "__vector_table" has special meaning for C-SPY:
+; it is where the SP start value is found, and the NVIC vector
+; table register (VTOR) is initialized to this address if != 0.
+;
+; Cortex-M version
+;
+
+ MODULE ?cstartup
+
+ ;; Forward declaration of sections.
+ SECTION CSTACK:DATA:NOROOT(3)
+
+ SECTION .intvec:CODE:NOROOT(2)
+
+ EXTERN __iar_program_start
+ EXTERN SystemInit
+ PUBLIC __vector_table
+
+ DATA
+__vector_table
+ DCD sfe(CSTACK)
+ DCD Reset_Handler ; Reset Handler
+
+ DCD NMI_Handler ; NMI Handler
+ DCD HardFault_Handler ; Hard Fault Handler
+ DCD MemManage_Handler ; MPU Fault Handler
+ DCD BusFault_Handler ; Bus Fault Handler
+ DCD UsageFault_Handler ; Usage Fault Handler
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD SVC_Handler ; SVCall Handler
+ DCD DebugMon_Handler ; Debug Monitor Handler
+ DCD 0 ; Reserved
+ DCD PendSV_Handler ; PendSV Handler
+ DCD SysTick_Handler ; SysTick Handler
+
+ ; External Interrupts
+ DCD WWDG_IRQHandler ; Window WatchDog
+ DCD PVD_PVM_IRQHandler ; PVD and PVM Interrupt
+ DCD TAMP_STAMP_LSECSS_IRQHandler ; RTC Tamper, TimeStamp Interrupts and LSECSS Interrupts
+ DCD RTC_WKUP_IRQHandler ; RTC Wakeup Interrupt
+ DCD FLASH_IRQHandler ; FLASH global Interrupt
+ DCD RCC_IRQHandler ; RCC Interrupt
+ DCD EXTI0_IRQHandler ; EXTI Line 0 Interrupt
+ DCD EXTI1_IRQHandler ; EXTI Line 1 Interrupt
+ DCD EXTI2_IRQHandler ; EXTI Line 2 Interrupt
+ DCD EXTI3_IRQHandler ; EXTI Line 3 Interrup
+ DCD EXTI4_IRQHandler ; EXTI Line 4 Interrupt
+ DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 Interrupt
+ DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2 Interrupt
+ DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3 Interrupt
+ DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4 Interrupt
+ DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5 Interrupt
+ DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6 Interrupt
+ DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7 Interrupt
+ DCD ADC1_IRQHandler ; ADC1 Interrupt
+ DCD USB_HP_IRQHandler ; USB High Priority Interrupt
+ DCD USB_LP_IRQHandler ; USB Low Priority Interrupt
+ DCD C2SEV_PWR_C2H_IRQHandler ; CPU M0+ SEV Interrupt
+ DCD COMP_IRQHandler ; COMP1 and COMP2 Interrupts
+ DCD EXTI9_5_IRQHandler ; EXTI Lines [9:5] Interrupt
+ DCD TIM1_BRK_IRQHandler ; TIM1 Break Interrupt
+ DCD TIM1_UP_TIM16_IRQHandler ; TIM1 Update and TIM16 global Interrupts
+ DCD TIM1_TRG_COM_TIM17_IRQHandler ; TIM1 Trigger and Communication and TIM17 global Interrupts
+ DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare Interrupt
+ DCD TIM2_IRQHandler ; TIM2 Global Interrupt
+ DCD PKA_IRQHandler ; PKA Interrupt
+ DCD I2C1_EV_IRQHandler ; I2C1 Event Interrupt
+ DCD I2C1_ER_IRQHandler ; I2C1 Error Interrupt
+ DCD I2C3_EV_IRQHandler ; I2C3 Event Interrupt
+ DCD I2C3_ER_IRQHandler ; I2C3 Error Interrupt
+ DCD SPI1_IRQHandler ; SPI1 Interrupt
+ DCD SPI2_IRQHandler ; SPI2 Interrupt
+ DCD USART1_IRQHandler ; USART1 Interrupt
+ DCD LPUART1_IRQHandler ; LPUART1 Interrupt
+ DCD SAI1_IRQHandler ; SAI Interrupt
+ DCD TSC_IRQHandler ; TSC Interrupt
+ DCD EXTI15_10_IRQHandler ; EXTI Lines1[15:10 ]Interrupts
+ DCD RTC_Alarm_IRQHandler ; RTC Alarms (A and B) Interrupt
+ DCD CRS_IRQHandler ; CRS interrupt
+ DCD PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler ; WKUP Interrupt from PWR
+ DCD IPCC_C1_RX_IRQHandler ; IPCC CPU1 RX occupied interrupt
+ DCD IPCC_C1_TX_IRQHandler ; IPCC CPU1 RX free interrupt
+ DCD HSEM_IRQHandler ; HSEM0 Interrupt
+ DCD LPTIM1_IRQHandler ; LPTIM1 Interrupt
+ DCD LPTIM2_IRQHandler ; LPTIM2 Interrupt
+ DCD LCD_IRQHandler ; LCD Interrupt
+ DCD QUADSPI_IRQHandler ; QUADSPI Interrupt
+ DCD AES1_IRQHandler ; AES1 Interrupt
+ DCD AES2_IRQHandler ; AES2 Interrupt
+ DCD RNG_IRQHandler ; RNG1 Interrupt
+ DCD FPU_IRQHandler ; FPU Interrupt
+ DCD DMA2_Channel1_IRQHandler ; DMA2 Channel 1 Interrupt
+ DCD DMA2_Channel2_IRQHandler ; DMA2 Channel 2 Interrupt
+ DCD DMA2_Channel3_IRQHandler ; DMA2 Channel 3 Interrupt
+ DCD DMA2_Channel4_IRQHandler ; DMA2 Channel 4 Interrupt
+ DCD DMA2_Channel5_IRQHandler ; DMA2 Channel 5 Interrupt
+ DCD DMA2_Channel6_IRQHandler ; DMA2 Channel 6 Interrupt
+ DCD DMA2_Channel7_IRQHandler ; DMA2 Channel 7 Interrupt
+ DCD DMAMUX1_OVR_IRQHandler ; DMAMUX overrun Interrupt
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Default interrupt handlers.
+;;
+ THUMB
+
+ PUBWEAK Reset_Handler
+ SECTION .text:CODE:NOROOT:REORDER(2)
+Reset_Handler
+ LDR R0, =SystemInit
+ BLX R0
+ LDR R0, =__iar_program_start
+ BX R0
+
+ PUBWEAK NMI_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+NMI_Handler
+ B NMI_Handler
+
+ PUBWEAK HardFault_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+HardFault_Handler
+ B HardFault_Handler
+
+ PUBWEAK MemManage_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+MemManage_Handler
+ B MemManage_Handler
+
+ PUBWEAK BusFault_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+BusFault_Handler
+ B BusFault_Handler
+
+ PUBWEAK UsageFault_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+UsageFault_Handler
+ B UsageFault_Handler
+
+ PUBWEAK SVC_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SVC_Handler
+ B SVC_Handler
+
+ PUBWEAK DebugMon_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DebugMon_Handler
+ B DebugMon_Handler
+
+ PUBWEAK PendSV_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+PendSV_Handler
+ B PendSV_Handler
+
+ PUBWEAK SysTick_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SysTick_Handler
+ B SysTick_Handler
+
+ PUBWEAK WWDG_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+WWDG_IRQHandler
+ B WWDG_IRQHandler
+
+ PUBWEAK PVD_PVM_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+PVD_PVM_IRQHandler
+ B PVD_PVM_IRQHandler
+
+ PUBWEAK TAMP_STAMP_LSECSS_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TAMP_STAMP_LSECSS_IRQHandler
+ B TAMP_STAMP_LSECSS_IRQHandler
+
+ PUBWEAK RTC_WKUP_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+RTC_WKUP_IRQHandler
+ B RTC_WKUP_IRQHandler
+
+ PUBWEAK FLASH_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+FLASH_IRQHandler
+ B FLASH_IRQHandler
+
+ PUBWEAK RCC_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+RCC_IRQHandler
+ B RCC_IRQHandler
+
+ PUBWEAK EXTI0_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI0_IRQHandler
+ B EXTI0_IRQHandler
+
+ PUBWEAK EXTI1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI1_IRQHandler
+ B EXTI1_IRQHandler
+
+ PUBWEAK EXTI2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI2_IRQHandler
+ B EXTI2_IRQHandler
+
+ PUBWEAK EXTI3_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI3_IRQHandler
+ B EXTI3_IRQHandler
+
+ PUBWEAK EXTI4_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI4_IRQHandler
+ B EXTI4_IRQHandler
+
+ PUBWEAK DMA1_Channel1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel1_IRQHandler
+ B DMA1_Channel1_IRQHandler
+
+ PUBWEAK DMA1_Channel2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel2_IRQHandler
+ B DMA1_Channel2_IRQHandler
+
+ PUBWEAK DMA1_Channel3_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel3_IRQHandler
+ B DMA1_Channel3_IRQHandler
+
+ PUBWEAK DMA1_Channel4_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel4_IRQHandler
+ B DMA1_Channel4_IRQHandler
+
+ PUBWEAK DMA1_Channel5_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel5_IRQHandler
+ B DMA1_Channel5_IRQHandler
+
+ PUBWEAK DMA1_Channel6_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel6_IRQHandler
+ B DMA1_Channel6_IRQHandler
+
+ PUBWEAK DMA1_Channel7_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel7_IRQHandler
+ B DMA1_Channel7_IRQHandler
+
+ PUBWEAK ADC1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+ADC1_IRQHandler
+ B ADC1_IRQHandler
+
+ PUBWEAK USB_HP_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+USB_HP_IRQHandler
+ B USB_HP_IRQHandler
+
+ PUBWEAK USB_LP_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+USB_LP_IRQHandler
+ B USB_LP_IRQHandler
+
+ PUBWEAK C2SEV_PWR_C2H_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+C2SEV_PWR_C2H_IRQHandler
+ B C2SEV_PWR_C2H_IRQHandler
+
+ PUBWEAK COMP_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+COMP_IRQHandler
+ B COMP_IRQHandler
+
+ PUBWEAK EXTI9_5_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI9_5_IRQHandler
+ B EXTI9_5_IRQHandler
+
+ PUBWEAK TIM1_BRK_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM1_BRK_IRQHandler
+ B TIM1_BRK_IRQHandler
+
+ PUBWEAK TIM1_UP_TIM16_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM1_UP_TIM16_IRQHandler
+ B TIM1_UP_TIM16_IRQHandler
+
+ PUBWEAK TIM1_TRG_COM_TIM17_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM1_TRG_COM_TIM17_IRQHandler
+ B TIM1_TRG_COM_TIM17_IRQHandler
+
+ PUBWEAK TIM1_CC_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM1_CC_IRQHandler
+ B TIM1_CC_IRQHandler
+
+ PUBWEAK TIM2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM2_IRQHandler
+ B TIM2_IRQHandler
+
+ PUBWEAK PKA_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+PKA_IRQHandler
+ B PKA_IRQHandler
+
+ PUBWEAK I2C1_EV_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+I2C1_EV_IRQHandler
+ B I2C1_EV_IRQHandler
+
+ PUBWEAK I2C1_ER_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+I2C1_ER_IRQHandler
+ B I2C1_ER_IRQHandler
+
+ PUBWEAK I2C3_EV_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+I2C3_EV_IRQHandler
+ B I2C3_EV_IRQHandler
+
+ PUBWEAK I2C3_ER_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+I2C3_ER_IRQHandler
+ B I2C3_ER_IRQHandler
+
+ PUBWEAK SPI1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SPI1_IRQHandler
+ B SPI1_IRQHandler
+
+ PUBWEAK SPI2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SPI2_IRQHandler
+ B SPI2_IRQHandler
+
+ PUBWEAK USART1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+USART1_IRQHandler
+ B USART1_IRQHandler
+
+ PUBWEAK LPUART1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+LPUART1_IRQHandler
+ B LPUART1_IRQHandler
+
+ PUBWEAK SAI1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SAI1_IRQHandler
+ B SAI1_IRQHandler
+
+ PUBWEAK TSC_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TSC_IRQHandler
+ B TSC_IRQHandler
+
+ PUBWEAK EXTI15_10_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI15_10_IRQHandler
+ B EXTI15_10_IRQHandler
+
+ PUBWEAK RTC_Alarm_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+RTC_Alarm_IRQHandler
+ B RTC_Alarm_IRQHandler
+
+ PUBWEAK CRS_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+CRS_IRQHandler
+ B CRS_IRQHandler
+
+ PUBWEAK PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler
+ B PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler
+
+ PUBWEAK IPCC_C1_RX_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+IPCC_C1_RX_IRQHandler
+ B IPCC_C1_RX_IRQHandler
+
+ PUBWEAK IPCC_C1_TX_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+IPCC_C1_TX_IRQHandler
+ B IPCC_C1_TX_IRQHandler
+
+ PUBWEAK HSEM_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+HSEM_IRQHandler
+ B HSEM_IRQHandler
+
+ PUBWEAK LPTIM1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+LPTIM1_IRQHandler
+ B LPTIM1_IRQHandler
+
+ PUBWEAK LPTIM2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+LPTIM2_IRQHandler
+ B LPTIM2_IRQHandler
+
+ PUBWEAK LCD_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+LCD_IRQHandler
+ B LCD_IRQHandler
+
+ PUBWEAK QUADSPI_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+QUADSPI_IRQHandler
+ B QUADSPI_IRQHandler
+
+ PUBWEAK AES1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+AES1_IRQHandler
+ B AES1_IRQHandler
+
+ PUBWEAK AES2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+AES2_IRQHandler
+ B AES2_IRQHandler
+
+ PUBWEAK RNG_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+RNG_IRQHandler
+ B RNG_IRQHandler
+
+ PUBWEAK FPU_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+FPU_IRQHandler
+ B FPU_IRQHandler
+
+ PUBWEAK DMA2_Channel1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel1_IRQHandler
+ B DMA2_Channel1_IRQHandler
+
+ PUBWEAK DMA2_Channel2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel2_IRQHandler
+ B DMA2_Channel2_IRQHandler
+
+ PUBWEAK DMA2_Channel3_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel3_IRQHandler
+ B DMA2_Channel3_IRQHandler
+
+ PUBWEAK DMA2_Channel4_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel4_IRQHandler
+ B DMA2_Channel4_IRQHandler
+
+ PUBWEAK DMA2_Channel5_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel5_IRQHandler
+ B DMA2_Channel5_IRQHandler
+
+ PUBWEAK DMA2_Channel6_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel6_IRQHandler
+ B DMA2_Channel6_IRQHandler
+
+ PUBWEAK DMA2_Channel7_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel7_IRQHandler
+ B DMA2_Channel7_IRQHandler
+
+ PUBWEAK DMAMUX1_OVR_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMAMUX1_OVR_IRQHandler
+ B DMAMUX1_OVR_IRQHandler
+
+ END
+
+;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE*****
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/EWARM/stm32wb55xx_flash_cm4.icf b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/EWARM/stm32wb55xx_flash_cm4.icf
new file mode 100644
index 000000000..70aec4026
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/EWARM/stm32wb55xx_flash_cm4.icf
@@ -0,0 +1,47 @@
+/*###ICF### Section handled by ICF editor, don't touch! ****/
+/*-Editor annotation file-*/
+/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
+/*-Specials-*/
+define symbol __ICFEDIT_intvec_start__ = 0x08000000;
+/*-Memory Regions-*/
+/***** FLASH Part dedicated to M4 *****/
+define symbol __ICFEDIT_region_ROM_start__ = 0x08000000;
+define symbol __ICFEDIT_region_ROM_end__ = 0x0807FFFF;
+define symbol __ICFEDIT_region_RAM_start__ = 0x20000004;
+define symbol __ICFEDIT_region_RAM_end__ = 0x2002F000;
+
+ /*0x2002FFFF---------------------------------------|
+ * | Emulation Flash |
+ * 0x2002F000-------------------------------------- |
+ * | Region_RAM |
+ * 0x20000004-------------------------------------- |
+
+/*-Sizes-*/
+define symbol __ICFEDIT_size_cstack__ = 0x1000; /* 4K */
+define symbol __ICFEDIT_size_heap__ = 102400; /* was 4K */
+/**** End of ICF editor section. ###ICF###*/
+
+define symbol __ICFEDIT_region_RAM_SHARED_start__ = 0x20030000;
+define symbol __ICFEDIT_region_RAM_SHARED_end__ = 0x20031000;
+
+define memory mem with size = 4G;
+define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
+define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
+define region RAM_SHARED_region = mem:[from __ICFEDIT_region_RAM_SHARED_start__ to __ICFEDIT_region_RAM_SHARED_end__];
+
+define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
+define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
+
+/* MB_MEM1 and MB_MEM2 are sections reserved to mailbox communication. It is placed in the shared memory */
+initialize by copy { readwrite };
+do not initialize { section .noinit,
+ section MAPPING_TABLE,
+ section MB_MEM1 };
+
+place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
+
+place in ROM_region { readonly };
+place in RAM_region { readwrite,block CSTACK, block HEAP };
+place in RAM_SHARED_region { first section MAPPING_TABLE};
+place in RAM_SHARED_region { section MB_MEM1};
+place in RAM_SHARED_region { section MB_MEM2};
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/STM32_WPAN/App/app_zigbee.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/STM32_WPAN/App/app_zigbee.c
new file mode 100644
index 000000000..a7ca65f04
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/STM32_WPAN/App/app_zigbee.c
@@ -0,0 +1,317 @@
+/**
+ ******************************************************************************
+ * File Name : App/app_zigbee.c
+ * Description : Zigbee Application.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "app_entry.h"
+#include "dbg_trace.h"
+#include "app_zigbee.h"
+#include "zigbee_interface.h"
+#include "shci.h"
+#include "stm_logging.h"
+#include "app_conf.h"
+#include "stm32wbxx_core_interface_def.h"
+#include "zigbee_types.h"
+#include "stm32_seq.h"
+
+/* Private defines -----------------------------------------------------------*/
+
+/* Private function prototypes -----------------------------------------------*/
+void APP_ZIGBEE_Demo(void);
+
+static void APP_ZIGBEE_TraceError(const char *pMess, uint32_t ErrCode);
+static void APP_ZIGBEE_CheckWirelessFirmwareInfo(void);
+
+static void Wait_Getting_Ack_From_M0(void);
+static void Receive_Ack_From_M0(void);
+static void Receive_Notification_From_M0(void);
+
+/* Private variables -----------------------------------------------*/
+static TL_CmdPacket_t *p_ZIGBEE_otcmdbuffer;
+static TL_EvtPacket_t *p_ZIGBEE_notif_M0_to_M4;
+static __IO uint32_t CptReceiveMsgFromM0 = 0;
+
+PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static TL_ZIGBEE_Config_t ZigbeeConfigBuffer;
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static TL_CmdPacket_t ZigbeeOtCmdBuffer;
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t ZigbeeNotifRspEvtBuffer[sizeof(TL_PacketHeader_t) + TL_EVT_HDR_SIZE + 255U];
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t ZigbeeNotifLoggingBuffer[sizeof(TL_PacketHeader_t) + TL_EVT_HDR_SIZE + 255U];
+
+/* Functions Definition ------------------------------------------------------*/
+
+void APP_ZIGBEE_Init(void)
+{
+ SHCI_CmdStatus_t ZigbeeInitStatus;
+
+ APP_DBG("APP_ZIGBEE_Init");
+
+ /* Check the compatibility with the Coprocessor Wireless Firmware loaded */
+ APP_ZIGBEE_CheckWirelessFirmwareInfo();
+
+ /* Register cmdbuffer */
+ APP_ZIGBEE_RegisterCmdBuffer(&ZigbeeOtCmdBuffer);
+
+ /* Init config buffer and call TL_ZIGBEE_Init */
+ APP_ZIGBEE_TL_INIT();
+
+ ZigbeeInitStatus = SHCI_C2_ZIGBEE_Init();
+ /* Prevent unused argument(s) compilation warning */
+ UNUSED(ZigbeeInitStatus);
+
+ /* Register task */
+ /* Create the different tasks */
+ UTIL_SEQ_RegTask(1U << (uint32_t)CFG_TASK_MSG_FROM_M0_TO_M4, UTIL_SEQ_RFU,APP_ZIGBEE_ProcessMsgM0ToM4);
+
+ /* Create the zigbee demo task */
+ UTIL_SEQ_RegTask(1U << CFG_TASK_ZIGBEE_APP, UTIL_SEQ_RFU,APP_ZIGBEE_Demo);
+ /* run the task */
+ UTIL_SEQ_SetTask(1U << CFG_TASK_ZIGBEE_APP, CFG_SCH_PRIO_0);
+} /* APP_ZIGBEE_Init */
+
+/**
+ * @brief Trace the error or the warning reported.
+ * @param ErrId :
+ * @param ErrCode
+ * @retval None
+ */
+void APP_ZIGBEE_Error(uint32_t ErrId, uint32_t ErrCode)
+{
+ switch (ErrId) {
+ default:
+ APP_ZIGBEE_TraceError("ERROR Unknown ", 0);
+ break;
+ }
+} /* APP_ZIGBEE_Error */
+
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+
+/**
+ * @brief Warn the user that an error has occurred.In this case,
+ * the LEDs on the Board will start blinking.
+ *
+ * @param pMess : Message associated to the error.
+ * @param ErrCode: Error code associated to the module (Zigbee or other module if any)
+ * @retval None
+ */
+static void APP_ZIGBEE_TraceError(const char *pMess, uint32_t ErrCode)
+{
+ APP_DBG("**** Fatal error = %s (Err = %d)", pMess, ErrCode);
+ while (1U == 1U) {
+ BSP_LED_Toggle(LED1);
+ HAL_Delay(500U);
+ BSP_LED_Toggle(LED2);
+ HAL_Delay(500U);
+ BSP_LED_Toggle(LED3);
+ HAL_Delay(500U);
+ }
+} /* APP_ZIGBEE_TraceError */
+
+/**
+ * @brief Check if the Coprocessor Wireless Firmware loaded supports Zigbee
+ * and display associated informations
+ * @param None
+ * @retval None
+ */
+static void APP_ZIGBEE_CheckWirelessFirmwareInfo(void)
+{
+ WirelessFwInfo_t wireless_info_instance;
+ WirelessFwInfo_t *p_wireless_info = &wireless_info_instance;
+
+ if (SHCI_GetWirelessFwInfo(p_wireless_info) != SHCI_Success) {
+ APP_ZIGBEE_Error((uint32_t)ERR_ZIGBEE_CHECK_WIRELESS, (uint32_t)ERR_INTERFACE_FATAL);
+ }
+ else {
+ APP_DBG("**********************************************************");
+ APP_DBG("WIRELESS COPROCESSOR FW:");
+ /* Print version */
+ APP_DBG("VERSION ID = %d.%d.%d", p_wireless_info->VersionMajor, p_wireless_info->VersionMinor, p_wireless_info->VersionSub);
+
+ switch (p_wireless_info->StackType) {
+ case INFO_STACK_TYPE_ZIGBEE:
+ APP_DBG("FW Type : Zigbee stack");
+ break;
+ default:
+ /* No Zigbee device supported ! */
+ APP_ZIGBEE_Error((uint32_t)ERR_ZIGBEE_CHECK_WIRELESS, (uint32_t)ERR_INTERFACE_FATAL);
+ break;
+ }
+ APP_DBG("**********************************************************");
+ }
+} /* APP_ZIGBEE_CheckWirelessFirmwareInfo */
+
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+
+void APP_ZIGBEE_RegisterCmdBuffer(TL_CmdPacket_t *p_buffer)
+{
+ p_ZIGBEE_otcmdbuffer = p_buffer;
+} /* APP_ZIGBEE_RegisterCmdBuffer */
+
+Zigbee_Cmd_Request_t * ZIGBEE_Get_OTCmdPayloadBuffer(void)
+{
+ return (Zigbee_Cmd_Request_t *)p_ZIGBEE_otcmdbuffer->cmdserial.cmd.payload;
+} /* ZIGBEE_Get_OTCmdPayloadBuffer */
+
+Zigbee_Cmd_Request_t * ZIGBEE_Get_OTCmdRspPayloadBuffer(void)
+{
+ return (Zigbee_Cmd_Request_t *)((TL_EvtPacket_t *)p_ZIGBEE_otcmdbuffer)->evtserial.evt.payload;
+} /* ZIGBEE_Get_OTCmdRspPayloadBuffer */
+
+Zigbee_Cmd_Request_t * ZIGBEE_Get_NotificationPayloadBuffer(void)
+{
+ return (Zigbee_Cmd_Request_t *)(p_ZIGBEE_notif_M0_to_M4)->evtserial.evt.payload;
+} /* ZIGBEE_Get_NotificationPayloadBuffer */
+
+/**
+ * @brief This function is used to transfer the commands from the M4 to the M0.
+ *
+ * @param None
+ * @return None
+ */
+void ZIGBEE_CmdTransfer(void)
+{
+ Zigbee_Cmd_Request_t *cmd_req = (Zigbee_Cmd_Request_t *)p_ZIGBEE_otcmdbuffer->cmdserial.cmd.payload;
+
+ /* Zigbee OT command cmdcode range 0x280 .. 0x3DF = 352 */
+ p_ZIGBEE_otcmdbuffer->cmdserial.cmd.cmdcode = 0x280U;
+ /* Size = otCmdBuffer->Size (Number of OT cmd arguments : 1 arg = 32bits so multiply by 4 to get size in bytes)
+ * + ID (4 bytes) + Size (4 bytes) */
+ p_ZIGBEE_otcmdbuffer->cmdserial.cmd.plen = 8U + (cmd_req->Size * 4U);
+
+ TL_ZIGBEE_SendAppliCmdToM0();
+
+ /* Wait completion of cmd */
+ Wait_Getting_Ack_From_M0();
+} /* ZIGBEE_CmdTransfer */
+
+/**
+ * @brief This function is called when the M0+ acknoledge the fact that it has received a Cmd
+ *
+ *
+ * @param Otbuffer : a pointer to TL_EvtPacket_t
+ * @return None
+ */
+void TL_ZIGBEE_CmdEvtReceived(TL_EvtPacket_t *Otbuffer)
+{
+ /* Prevent unused argument(s) compilation warning */
+ UNUSED(Otbuffer);
+
+ Receive_Ack_From_M0();
+} /* TL_ZIGBEE_CmdEvtReceived */
+
+/**
+ * @brief This function is called when notification from M0+ is received.
+ *
+ * @param Notbuffer : a pointer to TL_EvtPacket_t
+ * @return None
+ */
+void TL_ZIGBEE_NotReceived(TL_EvtPacket_t *Notbuffer)
+{
+ p_ZIGBEE_notif_M0_to_M4 = Notbuffer;
+
+ Receive_Notification_From_M0();
+} /* TL_ZIGBEE_NotReceived */
+
+/**
+ * @brief This function is called before sending any ot command to the M0
+ * core. The purpose of this function is to be able to check if
+ * there are no notifications coming from the M0 core which are
+ * pending before sending a new ot command.
+ * @param None
+ * @retval None
+ */
+void Pre_ZigbeeCmdProcessing(void)
+{
+ UTIL_SEQ_WaitEvt(EVENT_SYNCHRO_BYPASS_IDLE);
+} /* Pre_ZigbeeCmdProcessing */
+
+/**
+ * @brief This function waits for getting an acknowledgment from the M0.
+ *
+ * @param None
+ * @retval None
+ */
+static void Wait_Getting_Ack_From_M0(void)
+{
+ UTIL_SEQ_WaitEvt(EVENT_ACK_FROM_M0_EVT);
+} /* Wait_Getting_Ack_From_M0 */
+
+/**
+ * @brief Receive an acknowledgment from the M0+ core.
+ * Each command send by the M4 to the M0 are acknowledged.
+ * This function is called under interrupt.
+ * @param None
+ * @retval None
+ */
+static void Receive_Ack_From_M0(void)
+{
+ UTIL_SEQ_SetEvt(EVENT_ACK_FROM_M0_EVT);
+} /* Receive_Ack_From_M0 */
+
+/**
+ * @brief Receive a notification from the M0+ through the IPCC.
+ * This function is called under interrupt.
+ * @param None
+ * @retval None
+ */
+static void Receive_Notification_From_M0(void)
+{
+ CptReceiveMsgFromM0++;
+ UTIL_SEQ_SetTask(1U << CFG_TASK_MSG_FROM_M0_TO_M4, CFG_SCH_PRIO_0);
+} /* Receive_Notification_From_M0 */
+
+/**
+ * @brief Perform initialization of TL for Zigbee.
+ * @param None
+ * @retval None
+ */
+void APP_ZIGBEE_TL_INIT(void)
+{
+ ZigbeeConfigBuffer.p_ZigbeeOtCmdRspBuffer = (uint8_t *)&ZigbeeOtCmdBuffer;
+ ZigbeeConfigBuffer.p_ZigbeeNotAckBuffer = (uint8_t *)ZigbeeNotifRspEvtBuffer;
+ ZigbeeConfigBuffer.p_ZigbeeLoggingBuffer = (uint8_t *)ZigbeeNotifLoggingBuffer;
+ TL_ZIGBEE_Init(&ZigbeeConfigBuffer);
+} /* APP_ZIGBEE_TL_INIT */
+
+/**
+ * @brief Process the messages coming from the M0.
+ * @param None
+ * @retval None
+ */
+void APP_ZIGBEE_ProcessMsgM0ToM4(void)
+{
+ if (CptReceiveMsgFromM0 != 0) {
+ /* If CptReceiveMsgFromM0 is > 1. it means that we did not serve all the events from the radio */
+ if (CptReceiveMsgFromM0 > 1U) {
+ APP_ZIGBEE_Error(ERR_REC_MULTI_MSG_FROM_M0, 0);
+ }
+ else {
+ Zigbee_CallBackProcessing();
+ }
+ /* Reset counter */
+ CptReceiveMsgFromM0 = 0;
+ }
+} /* APP_ZIGBEE_ProcessMsgM0ToM4 */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/STM32_WPAN/App/app_zigbee.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/STM32_WPAN/App/app_zigbee.h
new file mode 100644
index 000000000..dd907ec23
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/STM32_WPAN/App/app_zigbee.h
@@ -0,0 +1,61 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : app_zigbee.h
+ * Description : Header for Zigbee Application.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_ZIGBEE_H
+#define APP_ZIGBEE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+/* Private includes ----------------------------------------------------------*/
+#include "tl.h"
+#include "tl_zigbee_hci.h"
+
+/* Exported types ------------------------------------------------------------*/
+
+/*
+ * List of all errors tracked by the Thread application
+ * running on M4. Some of these errors may be fatal
+ * or just warnings
+ */
+typedef enum {
+ ERR_REC_MULTI_MSG_FROM_M0,
+ ERR_ZIGBE_CMD_TO_M0,
+ ERR_ZIGBEE_CHECK_WIRELESS
+} ErrAppliIdEnum_t;
+
+/* Exported constants --------------------------------------------------------*/
+
+/* Exported functions ------------------------------------------------------- */
+void APP_ZIGBEE_Init(void);
+void APP_ZIGBEE_Error(uint32_t ErrId, uint32_t ErrCode);
+void APP_ZIGBEE_RegisterCmdBuffer(TL_CmdPacket_t *p_buffer);
+void APP_ZIGBEE_ProcessMsgM0ToM4(void);
+void APP_ZIGBEE_TL_INIT(void);
+void Pre_ZigbeeCmdProcessing(void);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* APP_ZIGBEE_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/STM32_WPAN/App/app_zigbee_demo.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/STM32_WPAN/App/app_zigbee_demo.c
new file mode 100644
index 000000000..fd5c971c1
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/STM32_WPAN/App/app_zigbee_demo.c
@@ -0,0 +1,396 @@
+/**
+ ******************************************************************************
+ * File Name : App/app_zigbee.c
+ * Description : Zigbee Application.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include <assert.h>
+#include "app_common.h"
+#include "app_entry.h"
+#include "dbg_trace.h"
+#include "app_zigbee.h"
+#include "shci.h"
+#include "stm_logging.h"
+#include "app_conf.h"
+#include "stm32wbxx_core_interface_def.h"
+#include "zigbee_types.h"
+#include "zigbee_interface.h"
+#include "stm32_seq.h"
+#include "zcl/zcl.h"
+#include "zcl/zcl.onoff.h"
+#include "zcl/zcl.identify.h"
+
+/* Spec is -40 dBm, but use -60 for ease of testing, and until we get real RSSI from STMAC. */
+#define APP_TOUCHLINK_MIN_RSSI -60
+
+/* Private defines -----------------------------------------------------------*/
+#define APP_ZIGBEE_STARTUP_FAIL_DELAY 3000U
+
+#define SW1_ENDPOINT 17
+#define SW2_ENDPOINT 18
+#define TOUCHLINK_ENDPOINT 200 /* arbitrary */
+
+#define SW1_GROUP_ADDR 0x0001
+#define SW2_GROUP_ADDR 0x0002
+
+#define SW1_FLAG 0x01
+#define SW2_FLAG 0x02
+
+#define SW1_LED LED_RED
+#define SW2_LED LED_GREEN
+#define SW3_LED LED_BLUE
+
+#define CHANNEL 12
+/* Private function prototypes -----------------------------------------------*/
+
+/* Private variables -----------------------------------------------*/
+struct zigbee_demo_info {
+ bool has_init;
+ struct ZigBeeT *zb;
+ enum ZbStartType startupControl;
+ enum ZbStatusCodeT join_status;
+ uint32_t join_delay;
+ bool init_after_join;
+
+ struct ZbZclClusterT *onoff_server_1;
+ struct ZbZclClusterT *onoff_client_1;
+ struct ZbZclClusterT *identify_server_1;
+
+ struct ZbZclClusterT *onoff_server_2;
+ struct ZbZclClusterT *onoff_client_2;
+
+ uint8_t sw_flags;
+};
+
+static struct zigbee_demo_info zigbee_demo_info;
+
+static enum ZclStatusCodeT onoff_server_attr_cb(struct ZbZclClusterT *clusterPtr, struct ZbZclAttrCbInfoT *cb);
+
+static const struct ZbZclAttrT onoff_server_attr_list[] = {
+ /* OnOff Server Attributes */
+ {
+ ZCL_ONOFF_ATTR_ONOFF, ZCL_DATATYPE_BOOLEAN,
+ ZCL_ATTR_FLAG_REPORTABLE | ZCL_ATTR_FLAG_PERSISTABLE | ZCL_ATTR_FLAG_DEFAULTABLE | ZCL_ATTR_FLAG_CB_NOTIFY, 0,
+ onoff_server_attr_cb, {0, 0}, {0, 0}
+ },
+};
+
+/* Functions Definition ------------------------------------------------------*/
+
+static enum ZclStatusCodeT onoff_server_attr_cb(struct ZbZclClusterT *clusterPtr, struct ZbZclAttrCbInfoT *cb)
+{
+ uint8_t endpoint;
+ uint8_t attrVal;
+
+ endpoint = ZbZclClusterGetEndpoint(clusterPtr);
+ switch (cb->info->attributeId) {
+ case ZCL_ONOFF_ATTR_ONOFF:
+ if (endpoint == SW1_ENDPOINT) {
+ if (ZbZclAttrRead(zigbee_demo_info.onoff_server_1, ZCL_ONOFF_ATTR_ONOFF, NULL, &attrVal, sizeof(attrVal), false) == ZCL_STATUS_SUCCESS) {
+ if (attrVal != 0) {
+ APP_DBG("SW1_LED ON");
+ BSP_LED_On(SW1_LED);
+ }
+ else {
+ APP_DBG("SW1_LED OFF");
+ BSP_LED_Off(SW1_LED);
+ }
+ }
+ }
+ else if (endpoint == SW2_ENDPOINT) {
+ if (ZbZclAttrRead(zigbee_demo_info.onoff_server_2, ZCL_ONOFF_ATTR_ONOFF, NULL, &attrVal, sizeof(attrVal), false) == ZCL_STATUS_SUCCESS) {
+ if (attrVal != 0) {
+ APP_DBG("SW2_LED ON");
+ BSP_LED_On(SW2_LED);
+ }
+ else {
+ APP_DBG("SW2_LED OFF");
+ BSP_LED_Off(SW2_LED);
+ }
+ }
+ }
+ break;
+
+ default:
+ break;
+ } /* switch */
+ return ZCL_STATUS_SUCCESS;
+} /* onoff_server_attr_notify */
+
+static void config_endpoints(void)
+{
+ ZbApsmeAddEndpointReqT req;
+ ZbApsmeAddEndpointConfT conf;
+
+ memset(&req, 0, sizeof(req));
+ req.profileId = ZCL_PROFILE_HOME_AUTOMATION;
+ req.deviceId = ZCL_DEVICE_ONOFF_SWITCH;
+
+ /* Endpoint: SW1_ENDPOINT */
+ req.endpoint = SW1_ENDPOINT;
+ ZbZclAddEndpoint(zigbee_demo_info.zb, &req, &conf);
+ assert(conf.status == ZB_STATUS_SUCCESS);
+ /* OnOff Server */
+ zigbee_demo_info.onoff_server_1 = ZbZclOnOffServerAlloc(zigbee_demo_info.zb, SW1_ENDPOINT, NULL);
+ assert(zigbee_demo_info.onoff_server_1 != NULL);
+ ZbZclAttrAppendList(zigbee_demo_info.onoff_server_1, onoff_server_attr_list, ZCL_ATTR_LIST_LEN(onoff_server_attr_list));
+ ZbZclClusterEndpointRegister(zigbee_demo_info.onoff_server_1);
+ /* OnOff Client */
+ zigbee_demo_info.onoff_client_1 = ZbZclOnOffClientAlloc(zigbee_demo_info.zb, SW1_ENDPOINT);
+ assert(zigbee_demo_info.onoff_client_1 != NULL);
+ ZbZclClusterEndpointRegister(zigbee_demo_info.onoff_client_1);
+ /* Identify Server for Touchlink */
+ zigbee_demo_info.identify_server_1 = ZbZclIdentifyServerAlloc(zigbee_demo_info.zb, SW1_ENDPOINT, NULL);
+ assert(zigbee_demo_info.identify_server_1 != NULL);
+
+ /* Endpoint: SW2_ENDPOINT */
+ req.endpoint = SW2_ENDPOINT;
+ ZbZclAddEndpoint(zigbee_demo_info.zb, &req, &conf);
+ assert(conf.status == ZB_STATUS_SUCCESS);
+ /* OnOff Server */
+ zigbee_demo_info.onoff_server_2 = ZbZclOnOffServerAlloc(zigbee_demo_info.zb, SW2_ENDPOINT, NULL);
+ assert(zigbee_demo_info.onoff_server_2 != NULL);
+ ZbZclAttrAppendList(zigbee_demo_info.onoff_server_2, onoff_server_attr_list, ZCL_ATTR_LIST_LEN(onoff_server_attr_list));
+ ZbZclClusterEndpointRegister(zigbee_demo_info.onoff_server_2);
+ /* OnOff Client */
+ zigbee_demo_info.onoff_client_2 = ZbZclOnOffClientAlloc(zigbee_demo_info.zb, SW2_ENDPOINT);
+ assert(zigbee_demo_info.onoff_client_2 != NULL);
+ ZbZclClusterEndpointRegister(zigbee_demo_info.onoff_client_2);
+} /* config_endpoints */
+
+static void config_group_addr(void)
+{
+ ZbApsmeAddGroupReqT req;
+ ZbApsmeAddGroupConfT conf;
+
+ memset(&req, 0, sizeof(req));
+ req.endpt = SW1_ENDPOINT;
+ req.groupAddr = SW1_GROUP_ADDR;
+ ZbApsmeAddGroupReq(zigbee_demo_info.zb, &req, &conf);
+
+ req.endpt = SW2_ENDPOINT;
+ req.groupAddr = SW2_GROUP_ADDR;
+ ZbApsmeAddGroupReq(zigbee_demo_info.zb, &req, &conf);
+} /* config_group_addr */
+
+/**
+ * @brief Zigbee Demo Task
+ * @param None
+ * @retval None
+ */
+void APP_ZIGBEE_Demo(void)
+{
+ /*
+ * Handle Initialization
+ */
+ if (!zigbee_demo_info.has_init) {
+ zigbee_demo_info.sw_flags = 0;
+
+ zigbee_demo_info.zb = ZbInit(0U, NULL, NULL);
+ assert(zigbee_demo_info.zb != NULL);
+
+ /* Create the endpoint and cluster(s) */
+ config_endpoints();
+
+ BSP_LED_Off(SW1_LED);
+ BSP_LED_Off(SW2_LED);
+ BSP_LED_Off(SW3_LED);
+
+ /* Configure the joining parameters */
+ zigbee_demo_info.join_status = 0x01; /* init to error status */
+ zigbee_demo_info.join_delay = HAL_GetTick(); /* now */
+ zigbee_demo_info.startupControl = ZbStartTypeJoin;
+
+ /* Initialization Complete */
+ zigbee_demo_info.has_init = true;
+ }
+
+ /*
+ * Handle Network Joining / Forming
+ */
+ if ((zigbee_demo_info.join_status != ZB_STATUS_SUCCESS) && (HAL_GetTick() >= zigbee_demo_info.join_delay)) {
+ struct ZbStartupT config;
+ enum ZbStatusCodeT status;
+
+ /* Configure Zigbee Logging (only need to do this once, but this is a good place to put it) */
+ ZbSetLogging(zigbee_demo_info.zb, ZB_LOG_MASK_LEVEL_5, NULL);
+
+ /* Attempt to join a zigbee network */
+ ZbStartupConfigGetProDefaults(&config);
+
+ APP_DBG("Network config : APP_STARTUP_DISTRIB");
+ /* Set the TC address to be distributed. */
+ config.security.trustCenterAddress = ZB_DISTRIBUTED_TC_ADDR;
+
+ /* Using the Uncertified Distributed Global Key (d0:d1:d2:d3:d4:d5:d6:d7:d8:d9:da:db:dc:dd:de:df) */
+ memcpy(config.security.distributedGlobalKey, sec_key_distrib_uncert, ZB_SEC_KEYSIZE);
+
+ config.startupControl = zigbee_demo_info.startupControl;
+
+ config.channelList.count = 1;
+ config.channelList.list[0].page = 0;
+ config.channelList.list[0].channelMask = 1 << CHANNEL; /* Channel in use*/
+
+ /* Using ZbStartupWait (blocking) here instead of ZbStartup, in order to demonstrate how to do
+ * a blocking call on the M4. */
+ status = ZbStartupWait(zigbee_demo_info.zb, &config);
+
+ APP_DBG("ZbStartup Callback (status = 0x%02x)", status);
+ zigbee_demo_info.join_status = status;
+
+ if (status == ZB_STATUS_SUCCESS) {
+ zigbee_demo_info.join_delay = 0U;
+ zigbee_demo_info.init_after_join = true;
+ BSP_LED_On(SW3_LED);
+ }
+ else {
+ APP_DBG("Startup failed, attempting to form a network after a short delay.");
+ zigbee_demo_info.startupControl = ZbStartTypeForm;
+
+ zigbee_demo_info.join_delay = HAL_GetTick() + APP_ZIGBEE_STARTUP_FAIL_DELAY;
+ }
+ }
+
+ /*
+ * Handle Application (Switches and LEDs)
+ */
+ if (zigbee_demo_info.join_status == ZB_STATUS_SUCCESS) {
+ /* Check if we just joined */
+ if (zigbee_demo_info.init_after_join) {
+ zigbee_demo_info.init_after_join = false;
+
+ /* Assign ourselves to the group addresses */
+ config_group_addr();
+
+ /* Since we're using group addressing (broadcast), shorten the broadcast timeout */
+ uint32_t bcast_timeout = 3;
+ ZbNwkSet(zigbee_demo_info.zb, ZB_NWK_NIB_ID_NetworkBroadcastDeliveryTime, &bcast_timeout, sizeof(bcast_timeout));
+ }
+
+ /* Check for switch flags */
+ if (zigbee_demo_info.sw_flags != 0) {
+ struct ZbApsAddrT dst;
+
+ memset(&dst, 0, sizeof(dst));
+ dst.mode = ZB_APSDE_ADDRMODE_GROUP;
+
+ if ((zigbee_demo_info.sw_flags & SW1_FLAG) != 0) {
+ dst.endpoint = SW1_ENDPOINT;
+ dst.nwkAddr = SW1_GROUP_ADDR;
+
+ APP_DBG("SW1 PUSHED (SENDING TOGGLE TO GROUP 0x0001)");
+ if (ZbZclOnOffClientToggleReq(zigbee_demo_info.onoff_client_1, &dst, NULL, NULL) != ZB_STATUS_SUCCESS) {
+ APP_DBG("Error, ZbZclOnOffClientToggleReq failed (SW1_ENDPOINT)");
+ }
+ /* We will get a loopback message because we belong to the same APS Group,
+ * causing our own local LED to toggle. */
+ }
+
+ if ((zigbee_demo_info.sw_flags & SW2_FLAG) != 0) {
+ dst.endpoint = SW2_ENDPOINT;
+ dst.nwkAddr = SW2_GROUP_ADDR;
+
+ APP_DBG("SW2 PUSHED (SENDING TOGGLE TO GROUP 0x0002)");
+ if (ZbZclOnOffClientToggleReq(zigbee_demo_info.onoff_client_2, &dst, NULL, NULL) != ZB_STATUS_SUCCESS) {
+ APP_DBG("Error, ZbZclOnOffClientToggleReq failed (SW2_ENDPOINT)");
+ }
+ /* We will get a loopback message because we belong to the same APS Group,
+ * causing our own local LED to toggle. */
+ }
+
+ /* Clear the flags */
+ zigbee_demo_info.sw_flags = 0;
+ }
+
+ }
+
+ UTIL_SEQ_SetTask(1U << CFG_TASK_ZIGBEE_APP, CFG_SCH_PRIO_0);
+} /* APP_ZIGBEE_Demo */
+
+/*************************************************************
+ * ZbStartupWait Blocking Call
+ *************************************************************/
+
+struct ZbStartupWaitInfo {
+ bool active;
+ enum ZbStatusCodeT status;
+};
+
+static void ZbStartupWaitCb(enum ZbStatusCodeT status, void *cb_arg)
+{
+ struct ZbStartupWaitInfo *info = cb_arg;
+
+ info->status = status;
+ info->active = false;
+} /* ZbStartupWaitCb */
+
+enum ZbStatusCodeT ZbStartupWait(struct ZigBeeT *zb, struct ZbStartupT *config)
+{
+ struct ZbStartupWaitInfo *info;
+ enum ZbStatusCodeT status;
+
+ info = malloc(sizeof(struct ZbStartupWaitInfo));
+ if (info == NULL) {
+ return ZB_STATUS_ALLOC_FAIL;
+ }
+ memset(info, 0, sizeof(struct ZbStartupWaitInfo));
+
+ info->active = true;
+ status = ZbStartup(zb, config, ZbStartupWaitCb, info);
+ if (status != ZB_STATUS_SUCCESS) {
+ info->active = false;
+ return status;
+ }
+ while (info->active) {
+ UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
+ }
+ status = info->status;
+ free(info);
+ return status;
+} /* ZbStartupWait */
+
+/*************************************************************
+ * External Interrupt Handler
+ *************************************************************/
+
+/**
+ * @brief This function manage the Push button action
+ * @param GPIO_Pin : GPIO pin which has been activated
+ * @retval None
+ */
+void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
+{
+ switch (GPIO_Pin) {
+ case BUTTON_SW1_PIN:
+ zigbee_demo_info.sw_flags |= SW1_FLAG;
+ break;
+
+ case BUTTON_SW2_PIN:
+ zigbee_demo_info.sw_flags |= SW2_FLAG;
+ break;
+
+ case BUTTON_SW3_PIN:
+ APP_DBG("SW3 PUSHED (LOCAL LEDS OFF)");
+ ZbZclAttrIntegerWrite(zigbee_demo_info.onoff_server_1, ZCL_ONOFF_ATTR_ONOFF, 0);
+ ZbZclAttrIntegerWrite(zigbee_demo_info.onoff_server_2, ZCL_ONOFF_ATTR_ONOFF, 0);
+ break;
+
+ default:
+ break;
+ }
+} /* HAL_GPIO_EXTI_Callback */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/STM32_WPAN/Target/hw_ipcc.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/STM32_WPAN/Target/hw_ipcc.c
new file mode 100644
index 000000000..ab7f75b9a
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/STM32_WPAN/Target/hw_ipcc.c
@@ -0,0 +1,491 @@
+/**
+ ******************************************************************************
+ * File Name : Target/hw_ipcc.c
+ * Description : Hardware IPCC source file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "mbox_def.h"
+
+/* Global variables ---------------------------------------------------------*/
+/* Private defines -----------------------------------------------------------*/
+#define HW_IPCC_TX_PENDING( channel ) ( !(LL_C1_IPCC_IsActiveFlag_CHx( IPCC, channel )) ) && (((~(IPCC->C1MR)) & (channel << 16U)))
+#define HW_IPCC_RX_PENDING( channel ) (LL_C2_IPCC_IsActiveFlag_CHx( IPCC, channel )) && (((~(IPCC->C1MR)) & (channel << 0U)))
+
+/* Private macros ------------------------------------------------------------*/
+/* Private typedef -----------------------------------------------------------*/
+/* Private variables ---------------------------------------------------------*/
+static void (*FreeBufCb)( void );
+
+/* Private function prototypes -----------------------------------------------*/
+static void HW_IPCC_BLE_EvtHandler( void );
+static void HW_IPCC_BLE_AclDataEvtHandler( void );
+static void HW_IPCC_MM_FreeBufHandler( void );
+static void HW_IPCC_SYS_CmdEvtHandler( void );
+static void HW_IPCC_SYS_EvtHandler( void );
+static void HW_IPCC_TRACES_EvtHandler( void );
+
+#ifdef THREAD_WB
+static void HW_IPCC_OT_CmdEvtHandler( void );
+static void HW_IPCC_THREAD_NotEvtHandler( void );
+static void HW_IPCC_THREAD_CliNotEvtHandler( void );
+#endif
+
+#ifdef MAC_802_15_4_WB
+static void HW_IPCC_MAC_802_15_4_CmdEvtHandler( void );
+static void HW_IPCC_MAC_802_15_4_NotEvtHandler( void );
+#endif
+
+#ifdef ZIGBEE_WB
+static void HW_IPCC_ZIGBEE_CmdEvtHandler( void );
+static void HW_IPCC_ZIGBEE_StackNotifEvtHandler( void );
+
+#endif
+
+/* Public function definition -----------------------------------------------*/
+
+/******************************************************************************
+ * INTERRUPT HANDLER
+ ******************************************************************************/
+void HW_IPCC_Rx_Handler( void )
+{
+ if (HW_IPCC_RX_PENDING( HW_IPCC_SYSTEM_EVENT_CHANNEL ))
+ {
+ HW_IPCC_SYS_EvtHandler();
+ }
+#ifdef MAC_802_15_4_WB
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL ))
+ {
+ HW_IPCC_MAC_802_15_4_NotEvtHandler();
+ }
+#endif /* MAC_802_15_4_WB */
+#ifdef THREAD_WB
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL ))
+ {
+ HW_IPCC_THREAD_NotEvtHandler();
+ }
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL ))
+ {
+ HW_IPCC_THREAD_CliNotEvtHandler();
+ }
+#endif /* MAC_802_15_4_WB */
+#ifdef ZIGBEE_WB
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_ZIGBEE_APPLI_NOTIF_ACK_CHANNEL ))
+ {
+ HW_IPCC_ZIGBEE_StackNotifEvtHandler();
+ }
+#endif /* ZIGBEE_WB */
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_BLE_EVENT_CHANNEL ))
+ {
+ HW_IPCC_BLE_EvtHandler();
+ }
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_TRACES_CHANNEL ))
+ {
+ HW_IPCC_TRACES_EvtHandler();
+ }
+
+ return;
+}
+
+void HW_IPCC_Tx_Handler( void )
+{
+ if (HW_IPCC_TX_PENDING( HW_IPCC_SYSTEM_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_SYS_CmdEvtHandler();
+ }
+#ifdef MAC_802_15_4_WB
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_MAC_802_15_4_CmdEvtHandler();
+ }
+#endif /* MAC_802_15_4_WB */
+#ifdef THREAD_WB
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_OT_CmdEvtHandler();
+ }
+#endif /* THREAD_WB */
+#ifdef ZIGBEE_WB
+ if (HW_IPCC_TX_PENDING( HW_IPCC_ZIGBEE_CMD_APPLI_CHANNEL ))
+ {
+ HW_IPCC_ZIGBEE_CmdEvtHandler();
+ }
+#endif /* ZIGBEE_WB */
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_SYSTEM_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_SYS_CmdEvtHandler();
+ }
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_MM_RELEASE_BUFFER_CHANNEL ))
+ {
+ HW_IPCC_MM_FreeBufHandler();
+ }
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_HCI_ACL_DATA_CHANNEL ))
+ {
+ HW_IPCC_BLE_AclDataEvtHandler();
+ }
+
+ return;
+}
+/******************************************************************************
+ * GENERAL
+ ******************************************************************************/
+void HW_IPCC_Enable( void )
+{
+ /**
+ * In case the SBSFU is implemented, it may have already set the C2BOOT bit to startup the CPU2.
+ * In that case, to keep the mechanism transparent to the user application, it shall call the system command
+ * SHCI_C2_Reinit( ) before jumping to the application.
+ * When the CPU2 receives that command, it waits for its event input to be set to restart the CPU2 firmware.
+ * This is required because once C2BOOT has been set once, a clear/set on C2BOOT has no effect.
+ * When SHCI_C2_Reinit( ) is not called, generating an event to the CPU2 does not have any effect
+ * So, by default, the application shall both set the event flag and set the C2BOOT bit.
+ */
+ __SEV( ); /* Set the internal event flag and send an event to the CPU2 */
+ __WFE( ); /* Clear the internal event flag */
+ LL_PWR_EnableBootC2( );
+
+ return;
+}
+
+void HW_IPCC_Init( void )
+{
+ LL_AHB3_GRP1_EnableClock( LL_AHB3_GRP1_PERIPH_IPCC );
+
+ LL_C1_IPCC_EnableIT_RXO( IPCC );
+ LL_C1_IPCC_EnableIT_TXF( IPCC );
+
+ HAL_NVIC_EnableIRQ(IPCC_C1_RX_IRQn);
+ HAL_NVIC_EnableIRQ(IPCC_C1_TX_IRQn);
+
+ return;
+}
+
+/******************************************************************************
+ * BLE
+ ******************************************************************************/
+void HW_IPCC_BLE_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_BLE_EVENT_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_BLE_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_BLE_CMD_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_BLE_EvtHandler( void )
+{
+ HW_IPCC_BLE_RxEvtNot();
+
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_BLE_EVENT_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_BLE_SendAclData( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_HCI_ACL_DATA_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_HCI_ACL_DATA_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_BLE_AclDataEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_HCI_ACL_DATA_CHANNEL );
+
+ HW_IPCC_BLE_AclDataAckNot();
+
+ return;
+}
+
+__weak void HW_IPCC_BLE_AclDataAckNot( void ){};
+__weak void HW_IPCC_BLE_RxEvtNot( void ){};
+
+/******************************************************************************
+ * SYSTEM
+ ******************************************************************************/
+void HW_IPCC_SYS_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_SYSTEM_EVENT_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_SYS_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_SYSTEM_CMD_RSP_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_SYSTEM_CMD_RSP_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_SYS_CmdEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_SYSTEM_CMD_RSP_CHANNEL );
+
+ HW_IPCC_SYS_CmdEvtNot();
+
+ return;
+}
+
+static void HW_IPCC_SYS_EvtHandler( void )
+{
+ HW_IPCC_SYS_EvtNot();
+
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_SYSTEM_EVENT_CHANNEL );
+
+ return;
+}
+
+__weak void HW_IPCC_SYS_CmdEvtNot( void ){};
+__weak void HW_IPCC_SYS_EvtNot( void ){};
+
+/******************************************************************************
+ * THREAD
+ ******************************************************************************/
+#ifdef THREAD_WB
+void HW_IPCC_THREAD_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_OT_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_CLI_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_THREAD_CLI_CMD_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_THREAD_SendAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_THREAD_CliSendAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_OT_CmdEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+
+ HW_IPCC_OT_CmdEvtNot();
+
+ return;
+}
+
+static void HW_IPCC_THREAD_NotEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_THREAD_EvtNot();
+
+ return;
+}
+
+static void HW_IPCC_THREAD_CliNotEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_THREAD_CliEvtNot();
+
+ return;
+}
+
+__weak void HW_IPCC_OT_CmdEvtNot( void ){};
+__weak void HW_IPCC_CLI_CmdEvtNot( void ){};
+__weak void HW_IPCC_THREAD_EvtNot( void ){};
+
+#endif /* THREAD_WB */
+/******************************************************************************
+ * ZIGBEE
+ ******************************************************************************/
+#ifdef ZIGBEE_WB
+void HW_IPCC_ZIGBEE_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_ZIGBEE_SendAppliCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_ZIGBEE_SendAppliCmdAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_ZIGBEE_CmdEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+
+ HW_IPCC_ZIGBEE_AppliCmdNotification();
+
+ return;
+}
+
+static void HW_IPCC_ZIGBEE_StackNotifEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_ZIGBEE_AppliAsyncEvtNotification();
+
+ return;
+}
+
+
+
+__weak void HW_IPCC_ZIGBEE_AppliCmdNotification( void ){};
+__weak void HW_IPCC_ZIGBEE_AppliAsyncEvtNotification( void ){};
+#endif /* ZIGBEE_WB */
+
+
+/******************************************************************************
+ * MEMORY MANAGER
+ ******************************************************************************/
+void HW_IPCC_MM_SendFreeBuf( void (*cb)( void ) )
+{
+ if ( LL_C1_IPCC_IsActiveFlag_CHx( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL ) )
+ {
+ FreeBufCb = cb;
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+ }
+ else
+ {
+ cb();
+
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+ }
+
+ return;
+}
+
+static void HW_IPCC_MM_FreeBufHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+
+ FreeBufCb();
+
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+
+ return;
+}
+
+/******************************************************************************
+ * TRACES
+ ******************************************************************************/
+void HW_IPCC_TRACES_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_TRACES_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_TRACES_EvtHandler( void )
+{
+ HW_IPCC_TRACES_EvtNot();
+
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_TRACES_CHANNEL );
+
+ return;
+}
+
+__weak void HW_IPCC_TRACES_EvtNot( void ){};
+
+
+/******************************************************************************
+ * MAC 802.15.4
+ ******************************************************************************/
+#ifdef MAC_802_15_4_WB
+void HW_IPCC_MAC_802_15_4_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_MAC_802_15_4_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_MAC_802_15_4_SendAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_MAC_802_15_4_CmdEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL );
+
+ HW_IPCC_MAC_802_15_4_CmdEvtNot();
+
+ return;
+}
+
+static void HW_IPCC_MAC_802_15_4_NotEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_MAC_802_15_4_EvtNot();
+
+ return;
+}
+__weak void HW_IPCC_MAC_802_15_4_CmdEvtNot( void ){};
+__weak void HW_IPCC_MAC_802_15_4_EvtNot( void ){};
+#endif
+
+/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/readme.txt b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/readme.txt
new file mode 100644
index 000000000..b2a63da26
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Distrib/readme.txt
@@ -0,0 +1,135 @@
+/**
+ @page Zigbee_OnOff_Distrib application
+
+ @verbatim
+ ******************************************************************************
+ * @file Zigbee/Zigbee_OnOff_Distrib/readme.txt
+ * @author MCD Application Team
+ * @brief Description of the Zigbee OnOff Cluster application using a
+ * distributed network.
+ ******************************************************************************
+ *
+ * Copyright (c) 2019 STMicroelectronics. All rights reserved.
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ @endverbatim
+
+@par Application Description
+
+How to use OnOff cluster on a Distributed Zigbee network.
+
+The purpose of this application is to show how to create a Zigbee distributed network, and
+how to communicate from one node to another one using the OnOff cluster. Once the Zigbee mesh
+network is created, the user can send requests to the different boards through the push buttons
+in order to make the LED toggling.
+
+Each device acts as a client and a server at the same time, making the communication between the
+different boards symmetrical (bi-directorial)
+
+
+ Device 1 Device 2
+
+ --------- ---------
+ | | ZbZclOnOffClientToggleReq | |
+ PushB=>|Client | -----------------------------------> |Server | =>LED
+ | | | |
+ | | | |
+ | | ZbZclOnOffClientToggleReq | |
+ LED <= |Server | <------------------------------------|Client |<=PushB
+ | | | |
+ -------- ---------
+
+
+This application requires at minimum two STM32WB55xx nucleo boards, but you can use up four boards
+when using configuration A and B. When using configuration C, only two boards are requested.
+
+This application requests having the stm32wb5x_zigbee_full_fw.bin binary flashed on the wireless coprocessor
+and the correct Zigbee_OnOff_Distrib.bin binary flashed on the application processor.
+
+
+To setup the application :
+
+ a) Open the project, build it and load your generated application on all your STM32WB devices.
+
+ To run the application :
+
+ a) Start the first board, wait for four seconds. Start the second board, wait for four seconds. Do the same
+ for the other boards if applicable.
+ Note : In order to create correctly the zigbee network, it is important to NOT switch on all the boards
+ at the same time.
+
+ b) At this stage, the Zigbee network is automatically created and it is possible to send OnOffCluster commands
+ in multicast mode by pressing on the SW1 or SW2 push button.
+ Press on SW1 (resp SW2). You must see the LED1 (resp LED2) toggling on all board connected to this
+ newly created Zigbee network.
+
+
+ ---------- -----------
+ |Device 1 |............|Device 2 |
+ |(distr.) | |(distr.) |
+ ----------- -----------
+ . .
+ . .
+ . .
+ ----------- .
+ |Device 3 |...................
+ |(distr.) |
+ -----------
+
+
+@par Hardware and Software environment
+
+ - This example runs on STM32WB55xx devices (Nucleo board)
+
+ - This example has been tested with an STMicroelectronics STM32WB55RG_Nucleo
+ board and can be easily tailored to any other supported device
+ and development board.
+
+ - On STM32WB55RG_Nucleo, the jumpers must be configured as described
+ in this section. Starting from the top left position up to the bottom
+ right position, the jumpers on the Board must be set as follows:
+
+ CN11: GND [OFF]
+ JP4: VDDRF [ON]
+ JP6: VC0 [ON]
+ JP2: +3V3 [ON]
+ JP1: USB_STL [ON] All others [OFF]
+ CN12: GND [OFF]
+ CN7: <All> [OFF]
+ JP3: VDD_MCU [ON]
+ JP5: GND [OFF] All others [ON]
+ CN10: <All> [OFF]
+
+
+@par How to use it ?
+
+=> Loading of the stm32wb5x_zigbee_full_fw.bin binary
+
+ This application requests having the stm32wb5x_zigbee_full_fw.bin binary flashed on the Wireless Coprocessor.
+ If it is not the case, you need to use STM32CubeProgrammer to load the appropriate binary.
+ All available binaries are located under /Projects/STM32_Copro_Wireless_Binaries directory.
+ Refer to UM2237 to learn how to use/install STM32CubeProgrammer.
+ Refer to /Projects/STM32_Copro_Wireless_Binaries/ReleaseNote.html for the detailed procedure to change the
+ Wireless Coprocessor binary.
+
+=> Getting traces
+ To get the traces you need to connect your Board to the Hyperterminal (through the STLink Virtual COM Port).
+ The UART must be configured as follows:
+
+ - BaudRate = 115200 baud
+ - Word Length = 8 Bits
+ - Stop Bit = 1 bit
+ - Parity = none
+ - Flow control = none
+
+=> Running the application
+
+ Refer to the Application description at the beginning of this readme.txt
+
+ * <h3><center>&copy; COPYRIGHT STMicroelectronics</center></h3>
+
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/app_common.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/app_common.h
new file mode 100644
index 000000000..4defc5d7a
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/app_common.h
@@ -0,0 +1,114 @@
+/**
+ ******************************************************************************
+ * File Name : app_common.h
+ * Description : App Common application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_COMMON_H
+#define APP_COMMON_H
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+#include <stdint.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+
+#include "app_conf.h"
+
+ /* -------------------------------- *
+ * Basic definitions *
+ * -------------------------------- */
+
+#undef NULL
+#define NULL 0
+
+#undef FALSE
+#define FALSE 0
+
+#undef TRUE
+#define TRUE (!0)
+
+ /* -------------------------------- *
+ * Critical Section definition *
+ * -------------------------------- */
+#define BACKUP_PRIMASK() uint32_t primask_bit= __get_PRIMASK()
+#define DISABLE_IRQ() __disable_irq()
+#define RESTORE_PRIMASK() __set_PRIMASK(primask_bit)
+
+ /* -------------------------------- *
+ * Macro delimiters *
+ * -------------------------------- */
+
+#define M_BEGIN do {
+
+#define M_END } while(0)
+
+ /* -------------------------------- *
+ * Some useful macro definitions *
+ * -------------------------------- */
+
+#define MAX( x, y ) (((x)>(y))?(x):(y))
+
+#define MIN( x, y ) (((x)<(y))?(x):(y))
+
+#define MODINC( a, m ) M_BEGIN (a)++; if ((a)>=(m)) (a)=0; M_END
+
+#define MODDEC( a, m ) M_BEGIN if ((a)==0) (a)=(m); (a)--; M_END
+
+#define MODADD( a, b, m ) M_BEGIN (a)+=(b); if ((a)>=(m)) (a)-=(m); M_END
+
+#define MODSUB( a, b, m ) MODADD( a, (m)-(b), m )
+
+#define PAUSE( t ) M_BEGIN \
+ __IO int _i; \
+ for ( _i = t; _i > 0; _i -- ); \
+ M_END
+
+#define DIVF( x, y ) ((x)/(y))
+
+#define DIVC( x, y ) (((x)+(y)-1)/(y))
+
+#define DIVR( x, y ) (((x)+((y)/2))/(y))
+
+#define SHRR( x, n ) ((((x)>>((n)-1))+1)>>1)
+
+#define BITN( w, n ) (((w)[(n)/32] >> ((n)%32)) & 1)
+
+#define BITNSET( w, n, b ) M_BEGIN (w)[(n)/32] |= ((U32)(b))<<((n)%32); M_END
+
+ /* -------------------------------- *
+ * Compiler *
+ * -------------------------------- */
+#define PLACE_IN_SECTION( __x__ ) __attribute__((section (__x__)))
+
+#ifdef WIN32
+#define ALIGN(n)
+#else
+#define ALIGN(n) __attribute__((aligned(n)))
+#endif
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /*APP_COMMON_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/app_conf.h
new file mode 100644
index 000000000..6d9144c46
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/app_conf.h
@@ -0,0 +1,347 @@
+/**
+ ******************************************************************************
+ * File Name : app_conf.h
+ * Description : Application configuration file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_CONF_H
+#define APP_CONF_H
+
+#include "hw.h"
+#include "hw_conf.h"
+#include "hw_if.h"
+
+/******************************************************************************
+ * Application Config
+ ******************************************************************************/
+/******************************************************************************
+ * Transport Layer
+ ******************************************************************************/
+/**
+ * Queue length of BLE Event
+ * This parameter defines the number of asynchronous events that can be stored in the HCI layer before
+ * being reported to the application. When a command is sent to the BLE core coprocessor, the HCI layer
+ * is waiting for the event with the Num_HCI_Command_Packets set to 1. The receive queue shall be large
+ * enough to store all asynchronous events received in between.
+ * When CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE is set to 27, this allow to store three 255 bytes long asynchronous events
+ * between the HCI command and its event.
+ * This parameter depends on the value given to CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE. When the queue size is to small,
+ * the system may hang if the queue is full with asynchronous events and the HCI layer is still waiting
+ * for a CC/CS event, In that case, the notification TL_BLE_HCI_ToNot() is called to indicate
+ * to the application a HCI command did not receive its command event within 30s (Default HCI Timeout).
+ */
+#define CFG_TL_EVT_QUEUE_LENGTH 5
+/**
+ * This parameter should be set to fit most events received by the HCI layer. It defines the buffer size of each element
+ * allocated in the queue of received events and can be used to optimize the amount of RAM allocated by the Memory Manager.
+ * It should not exceed 255 which is the maximum HCI packet payload size (a greater value is a lost of memory as it will
+ * never be used)
+ * It shall be at least 4 to receive the command status event in one frame.
+ * The default value is set to 27 to allow receiving an event of MTU size in a single buffer. This value maybe reduced
+ * further depending on the application.
+ *
+ */
+#define CFG_TL_MOST_EVENT_PAYLOAD_SIZE 255 /**< Set to 255 with the memory manager and the mailbox */
+
+#define TL_EVENT_FRAME_SIZE ( TL_EVT_HDR_SIZE + CFG_TL_MOST_EVENT_PAYLOAD_SIZE )
+/******************************************************************************
+ * UART interfaces
+ ******************************************************************************/
+
+/**
+ * Select UART interfaces
+ */
+#define CFG_DEBUG_TRACE_UART hw_uart1
+#define CFG_CONSOLE_MENU
+#define CFG_CLI_UART hw_lpuart1
+/******************************************************************************
+ * USB interface
+ ******************************************************************************/
+
+/**
+ * Enable/Disable USB interface
+ */
+#define CFG_USB_INTERFACE_ENABLE 0
+
+/******************************************************************************
+ * Low Power
+ *
+ * When CFG_FULL_LOW_POWER is set to 1, the system is configured in full
+ * low power mode. It means that all what can have an impact on the consumptions
+ * are powered down.(For instance LED, Access to Debugger, Etc.)
+ *
+ * When CFG_FULL_LOW_POWER is set to 0, the low power mode is not activated
+ *
+ ******************************************************************************/
+
+#define CFG_FULL_LOW_POWER 0
+
+#if (CFG_FULL_LOW_POWER == 1)
+#undef CFG_LPM_SUPPORTED
+#define CFG_LPM_SUPPORTED 1
+#endif /* CFG_FULL_LOW_POWER */
+
+/******************************************************************************
+ * Timer Server
+ ******************************************************************************/
+/**
+ * CFG_RTC_WUCKSEL_DIVIDER: This sets the RTCCLK divider to the wakeup timer.
+ * The higher is the value, the better is the power consumption and the accuracy of the timerserver
+ * The lower is the value, the finest is the granularity
+ *
+ * CFG_RTC_ASYNCH_PRESCALER: This sets the asynchronous prescaler of the RTC. It should as high as possible ( to ouput
+ * clock as low as possible) but the output clock should be equal or higher frequency compare to the clock feeding
+ * the wakeup timer. A lower clock speed would impact the accuracy of the timer server.
+ *
+ * CFG_RTC_SYNCH_PRESCALER: This sets the synchronous prescaler of the RTC.
+ * When the 1Hz calendar clock is required, it shall be sets according to other settings
+ * When the 1Hz calendar clock is not needed, CFG_RTC_SYNCH_PRESCALER should be set to 0x7FFF (MAX VALUE)
+ *
+ * CFG_RTCCLK_DIVIDER_CONF:
+ * Shall be set to either 0,2,4,8,16
+ * When set to either 2,4,8,16, the 1Hhz calendar is supported
+ * When set to 0, the user sets its own configuration
+ *
+ * The following settings are computed with LSI as input to the RTC
+ */
+#define CFG_RTCCLK_DIVIDER_CONF 0
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 0)
+/**
+ * Custom configuration
+ * It does not support 1Hz calendar
+ * It divides the RTC CLK by 16
+ */
+#define CFG_RTCCLK_DIV (16)
+#define CFG_RTC_WUCKSEL_DIVIDER (0)
+#define CFG_RTC_ASYNCH_PRESCALER (CFG_RTCCLK_DIV - 1)
+#define CFG_RTC_SYNCH_PRESCALER (0x7FFF)
+
+#else
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 2)
+/**
+ * It divides the RTC CLK by 2
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (3)
+#endif
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 4)
+/**
+ * It divides the RTC CLK by 4
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (2)
+#endif
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 8)
+/**
+ * It divides the RTC CLK by 8
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (1)
+#endif
+
+#if (CFG_RTCCLK_DIVIDER_CONF == 16)
+/**
+ * It divides the RTC CLK by 16
+ */
+#define CFG_RTC_WUCKSEL_DIVIDER (0)
+#endif
+
+#define CFG_RTCCLK_DIV CFG_RTCCLK_DIVIDER_CONF
+#define CFG_RTC_ASYNCH_PRESCALER (CFG_RTCCLK_DIV - 1)
+#define CFG_RTC_SYNCH_PRESCALER (DIVR( LSE_VALUE, (CFG_RTC_ASYNCH_PRESCALER+1) ) - 1 )
+
+#endif
+
+/** tick timer value in us */
+#define CFG_TS_TICK_VAL DIVR( (CFG_RTCCLK_DIV * 1000000), LSE_VALUE )
+
+typedef enum
+{
+ CFG_TIM_PROC_ID_ISR,
+} CFG_TimProcID_t;
+
+/******************************************************************************
+ * Debug
+ ******************************************************************************/
+/**
+ * When set, this resets some hw resources to set the device in the same state than the power up
+ * The FW resets only register that may prevent the FW to run properly
+ *
+ * This shall be set to 0 in a final product
+ *
+ */
+#define CFG_HW_RESET_BY_FW 1
+
+/**
+ * keep debugger enabled while in any low power mode when set to 1
+ * should be set to 0 in production
+ */
+#define CFG_DEBUGGER_SUPPORTED 1
+
+#if (CFG_FULL_LOW_POWER == 1)
+#undef CFG_DEBUGGER_SUPPORTED
+#define CFG_DEBUGGER_SUPPORTED 0
+#endif /* CFG_FULL_LOW_POWER */
+
+/*****************************************************************************
+ * Traces
+ * Enable or Disable traces in application
+ * When CFG_DEBUG_TRACE is set, traces are activated
+ *
+ * Note : Refer to utilities_conf.h file in order to details
+ * the level of traces : CFG_DEBUG_TRACE_FULL or CFG_DEBUG_TRACE_LIGHT
+ *****************************************************************************/
+#define CFG_DEBUG_TRACE 1
+
+#if (CFG_FULL_LOW_POWER == 1)
+#undef CFG_DEBUG_TRACE
+#define CFG_DEBUG_TRACE 0
+#endif /* CFG_FULL_LOW_POWER */
+
+/**
+ * When CFG_DEBUG_TRACE_FULL is set to 1, the trace are output with the API name, the file name and the line number
+ * When CFG_DEBUG_TRACE_LIGHT is set to 1, only the debug message is output
+ *
+ * When both are set to 0, no trace are output
+ * When both are set to 1, CFG_DEBUG_TRACE_FULL is selected
+ */
+#define CFG_DEBUG_TRACE_LIGHT 1
+#define CFG_DEBUG_TRACE_FULL 0
+
+#if (( CFG_DEBUG_TRACE != 0 ) && ( CFG_DEBUG_TRACE_LIGHT == 0 ) && (CFG_DEBUG_TRACE_FULL == 0))
+#undef CFG_DEBUG_TRACE_FULL
+#undef CFG_DEBUG_TRACE_LIGHT
+#define CFG_DEBUG_TRACE_FULL 0
+#define CFG_DEBUG_TRACE_LIGHT 1
+#endif
+
+#if ( CFG_DEBUG_TRACE == 0 )
+#undef CFG_DEBUG_TRACE_FULL
+#undef CFG_DEBUG_TRACE_LIGHT
+#define CFG_DEBUG_TRACE_FULL 0
+#define CFG_DEBUG_TRACE_LIGHT 0
+#endif
+
+/**
+ * When not set, the traces is looping on sending the trace over UART
+ */
+#define DBG_TRACE_USE_CIRCULAR_QUEUE 1
+
+/**
+ * max buffer Size to queue data traces and max data trace allowed.
+ * Only Used if DBG_TRACE_USE_CIRCULAR_QUEUE is defined
+ */
+#define DBG_TRACE_MSG_QUEUE_SIZE 4096
+#define MAX_DBG_TRACE_MSG_SIZE 1024
+
+/******************************************************************************
+ * Configure Log level for Application
+ ******************************************************************************/
+#define APPLI_CONFIG_LOG_LEVEL LOG_LEVEL_INFO
+#define APPLI_PRINT_FILE_FUNC_LINE 0
+
+/* USER CODE BEGIN Defines */
+/******************************************************************************
+ * User interaction
+ * When CFG_LED_SUPPORTED is set, LEDS are activated if requested
+ * When CFG_BUTTON_SUPPORTED is set, the push button are activated if requested
+ ******************************************************************************/
+#if (CFG_FULL_LOW_POWER == 1)
+#define CFG_LED_SUPPORTED 0
+#define CFG_BUTTON_SUPPORTED 0
+#else
+#define CFG_LED_SUPPORTED 1
+#define CFG_BUTTON_SUPPORTED 1
+#endif /* CFG_FULL_LOW_POWER */
+/* USER CODE END Defines */
+
+/******************************************************************************
+ * Scheduler
+ ******************************************************************************/
+/**
+ * This is the list of task id required by the application
+ * Each Id shall be in the range 0..31
+ */
+
+typedef enum {
+ CFG_TASK_MSG_FROM_M0_TO_M4,
+ CFG_TASK_ZIGBEE_APP,
+ CFG_TASK_SYSTEM_HCI_ASYNCH_EVT,
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+ CFG_TASK_VCP_SEND_DATA,
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+ CFG_TASK_NBR /**< Shall be last in the list */
+} CFG_IdleTask_Id_t;
+
+/* Scheduler types and defines */
+/*------------------------------------*/
+
+//#define TASK_MSG_FROM_M0_TO_M4 (1U << CFG_TASK_MSG_FROM_M0_TO_M4)
+#define EVENT_ACK_FROM_M0_EVT (1U << CFG_EVT_ACK_FROM_M0_EVT)
+#define EVENT_SYNCHRO_BYPASS_IDLE (1U << CFG_EVT_SYNCHRO_BYPASS_IDLE)
+
+/**
+ * This is the list of priority required by the application
+ * Each Id shall be in the range 0..31
+ */
+typedef enum
+{
+ CFG_SCH_PRIO_0,
+ CFG_SCH_PRIO_1,
+ CFG_PRIO_NBR,
+} CFG_SCH_Prio_Id_t;
+
+/**
+ * This is a bit mapping over 32bits listing all events id supported in the application
+ */
+typedef enum {
+ CFG_EVT_SYSTEM_HCI_CMD_EVT_RESP,
+ CFG_EVT_ACK_FROM_M0_EVT,
+ CFG_EVT_SYNCHRO_BYPASS_IDLE,
+} CFG_IdleEvt_Id_t;
+
+#define EVENT_ACK_FROM_M0_EVT (1U << CFG_EVT_ACK_FROM_M0_EVT)
+#define EVENT_SYNCHRO_BYPASS_IDLE (1U << CFG_EVT_SYNCHRO_BYPASS_IDLE)
+
+/******************************************************************************
+ * Configure Log level for Application
+ ******************************************************************************/
+#define APPLI_CONFIG_LOG_LEVEL LOG_LEVEL_INFO
+#define APPLI_PRINT_FILE_FUNC_LINE 0
+
+/******************************************************************************
+ * LOW POWER
+ ******************************************************************************/
+/**
+ * Supported requester to the MCU Low Power Manager - can be increased up to 32
+ * It lits a bit mapping of all user of the Low Power Manager
+ */
+typedef enum {
+ CFG_LPM_APP,
+} CFG_LPM_Id_t;
+
+/******************************************************************************
+ * OTP manager
+ ******************************************************************************/
+#define CFG_OTP_BASE_ADDRESS OTP_AREA_BASE
+
+#define CFG_OTP_END_ADRESS OTP_AREA_END_ADDR
+
+#endif /*APP_CONF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/app_entry.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/app_entry.h
new file mode 100644
index 000000000..48c467aaa
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/app_entry.h
@@ -0,0 +1,68 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : app_entry.h
+ * Description : App entry configuration file for STM32WPAN Middleware.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_ENTRY_H
+#define APP_ENTRY_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /* Exported types ------------------------------------------------------------*/
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* Exported variables --------------------------------------------------------*/
+/* USER CODE BEGIN EV */
+
+/* USER CODE END EV */
+
+/* Exported macros ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions ---------------------------------------------*/
+ void APPE_Init( void );
+/* USER CODE BEGIN EF */
+
+/* USER CODE END EF */
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /*APP_ENTRY_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/hw_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/hw_conf.h
new file mode 100644
index 000000000..8409edd16
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/hw_conf.h
@@ -0,0 +1,219 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : hw_conf.h
+ * Description : Hardware configuration file for STM32WPAN Middleware.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_CONF_H
+#define HW_CONF_H
+
+/******************************************************************************
+ * Semaphores
+ * THIS SHALL NO BE CHANGED AS THESE SEMAPHORES ARE USED AS WELL ON THE CM0+
+ *****************************************************************************/
+/* Index of the semaphore used to manage the entry Stop Mode procedure */
+#define CFG_HW_ENTRY_STOP_MODE_SEMID 4
+
+/* Index of the semaphore used to access the RCC */
+#define CFG_HW_RCC_SEMID 3
+
+/* Index of the semaphore used to access the FLASH */
+#define CFG_HW_FLASH_SEMID 2
+
+/* Index of the semaphore used to access the PKA */
+#define CFG_HW_PKA_SEMID 1
+
+/* Index of the semaphore used to access the RNG */
+#define CFG_HW_RNG_SEMID 0
+
+/******************************************************************************
+ * HW TIMER SERVER
+ *****************************************************************************/
+/**
+ * The user may define the maximum number of virtual timers supported.
+ * It shall not exceed 255
+ */
+#define CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER 6
+
+/**
+ * The user may define the priority in the NVIC of the RTC_WKUP interrupt handler that is used to manage the
+ * wakeup timer.
+ * This setting is the preemptpriority part of the NVIC.
+ */
+#define CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO 3
+
+/**
+ * The user may define the priority in the NVIC of the RTC_WKUP interrupt handler that is used to manage the
+ * wakeup timer.
+ * This setting is the subpriority part of the NVIC. It does not exist on all processors. When it is not supported
+ * on the CPU, the setting is ignored
+ */
+#define CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO 0
+
+/**
+ * Define a critical section in the Timer server
+ * The Timer server does not support the API to be nested
+ * The Application shall either:
+ * a) Ensure this will never happen
+ * b) Define the critical section
+ * The default implementations is masking all interrupts using the PRIMASK bit
+ * The TimerServer driver uses critical sections to avoid context corruption. This is achieved with the macro
+ * TIMER_ENTER_CRITICAL_SECTION and TIMER_EXIT_CRITICAL_SECTION. When CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION is set
+ * to 1, all STM32 interrupts are masked with the PRIMASK bit of the CortexM CPU. It is possible to use the BASEPRI
+ * register of the CortexM CPU to keep allowed some interrupts with high priority. In that case, the user shall
+ * re-implement TIMER_ENTER_CRITICAL_SECTION and TIMER_EXIT_CRITICAL_SECTION and shall make sure that no TimerServer
+ * API are called when the TIMER critical section is entered
+ */
+#define CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION 1
+
+/**
+ * This value shall reflect the maximum delay there could be in the application between the time the RTC interrupt
+ * is generated by the Hardware and the time when the RTC interrupt handler is called. This time is measured in
+ * number of RTCCLK ticks.
+ * A relaxed timing would be 10ms
+ * When the value is too short, the timerserver will not be able to count properly and all timeout may be random.
+ * When the value is too long, the device may wake up more often than the most optimal configuration. However, the
+ * impact on power consumption would be marginal (unless the value selected is extremely too long). It is strongly
+ * recommended to select a value large enough to make sure it is not too short to ensure reliability of the system
+ * as this will have marginal impact on low power mode
+ */
+#define CFG_HW_TS_RTC_HANDLER_MAX_DELAY ( 10 * (LSI_VALUE/1000) )
+
+ /**
+ * Interrupt ID in the NVIC of the RTC Wakeup interrupt handler
+ * It shall be type of IRQn_Type
+ */
+#define CFG_HW_TS_RTC_WAKEUP_HANDLER_ID RTC_WKUP_IRQn
+
+/******************************************************************************
+ * HW UART
+ *****************************************************************************/
+
+#define CFG_HW_LPUART1_ENABLED 1
+#define CFG_HW_LPUART1_DMA_TX_SUPPORTED 1
+
+#define CFG_HW_USART1_ENABLED 1
+#define CFG_HW_USART1_DMA_TX_SUPPORTED 1
+
+/**
+ * LPUART1
+ */
+#define CFG_HW_LPUART1_PREEMPTPRIORITY 0x0F
+#define CFG_HW_LPUART1_SUBPRIORITY 0
+
+/** < The application shall check the selected source clock is enable */
+#define CFG_HW_LPUART1_SOURCE_CLOCK RCC_LPUART1CLKSOURCE_SYSCLK
+
+#define CFG_HW_LPUART1_BAUDRATE 115200
+#define CFG_HW_LPUART1_WORDLENGTH UART_WORDLENGTH_8B
+#define CFG_HW_LPUART1_STOPBITS UART_STOPBITS_1
+#define CFG_HW_LPUART1_PARITY UART_PARITY_NONE
+#define CFG_HW_LPUART1_HWFLOWCTL UART_HWCONTROL_NONE
+#define CFG_HW_LPUART1_MODE UART_MODE_TX_RX
+#define CFG_HW_LPUART1_ADVFEATUREINIT UART_ADVFEATURE_NO_INIT
+#define CFG_HW_LPUART1_OVERSAMPLING UART_OVERSAMPLING_8
+
+#define CFG_HW_LPUART1_TX_PORT_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE
+#define CFG_HW_LPUART1_TX_PORT GPIOA
+#define CFG_HW_LPUART1_TX_PIN GPIO_PIN_2
+#define CFG_HW_LPUART1_TX_MODE GPIO_MODE_AF_PP
+#define CFG_HW_LPUART1_TX_PULL GPIO_NOPULL
+#define CFG_HW_LPUART1_TX_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_LPUART1_TX_ALTERNATE GPIO_AF8_LPUART1
+
+#define CFG_HW_LPUART1_RX_PORT_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE
+#define CFG_HW_LPUART1_RX_PORT GPIOA
+#define CFG_HW_LPUART1_RX_PIN GPIO_PIN_3
+#define CFG_HW_LPUART1_RX_MODE GPIO_MODE_AF_PP
+#define CFG_HW_LPUART1_RX_PULL GPIO_NOPULL
+#define CFG_HW_LPUART1_RX_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_LPUART1_RX_ALTERNATE GPIO_AF8_LPUART1
+
+#define CFG_HW_LPUART1_CTS_PORT_CLK_ENABLE __HAL_RCC_GPIOvalueNotSetted_CLK_ENABLE
+#define CFG_HW_LPUART1_CTS_PORT GPIOvalueNotSetted
+#define CFG_HW_LPUART1_CTS_PIN GPIO_PIN_valueNotSetted
+#define CFG_HW_LPUART1_CTS_MODE GPIO_MODE_AF_PP
+#define CFG_HW_LPUART1_CTS_PULL GPIO_PULLDOWN
+#define CFG_HW_LPUART1_CTS_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_LPUART1_CTS_ALTERNATE GPIO_AFvalueNotSetted_LPUART1
+
+#define CFG_HW_LPUART1_DMA_TX_PREEMPTPRIORITY 0x0F
+#define CFG_HW_LPUART1_DMA_TX_SUBPRIORITY 0
+
+#define CFG_HW_LPUART1_DMAMUX_CLK_ENABLE __HAL_RCC_DMAMUX1_CLK_ENABLE
+#define CFG_HW_LPUART1_DMA_CLK_ENABLE __HAL_RCC_DMA1_CLK_ENABLE
+#define CFG_HW_LPUART1_TX_DMA_REQ DMA_REQUEST_LPUART1_TX
+#define CFG_HW_LPUART1_TX_DMA_CHANNEL DMA1_CHANNEL_1
+#define CFG_HW_LPUART1_TX_DMA_IRQn DMA1_CHANNEL_1_IRQn
+#define CFG_HW_LPUART1_DMA_TX_IRQHandler DMA1_CHANNEL_1_IRQHandler
+
+/**
+ * UART1
+ */
+#define CFG_HW_USART1_PREEMPTPRIORITY 0x0F
+#define CFG_HW_USART1_SUBPRIORITY 0
+
+/** < The application shall check the selected source clock is enable */
+#define CFG_HW_USART1_SOURCE_CLOCK RCC_USART1CLKSOURCE_SYSCLK
+
+#define CFG_HW_USART1_BAUDRATE 115200
+#define CFG_HW_USART1_WORDLENGTH UART_WORDLENGTH_8B
+#define CFG_HW_USART1_STOPBITS UART_STOPBITS_1
+#define CFG_HW_USART1_PARITY UART_PARITY_NONE
+#define CFG_HW_USART1_HWFLOWCTL UART_HWCONTROL_NONE
+#define CFG_HW_USART1_MODE UART_MODE_TX_RX
+#define CFG_HW_USART1_ADVFEATUREINIT UART_ADVFEATURE_NO_INIT
+#define CFG_HW_USART1_OVERSAMPLING UART_OVERSAMPLING_8
+
+#define CFG_HW_USART1_TX_PORT_CLK_ENABLE __HAL_RCC_GPIOB_CLK_ENABLE
+#define CFG_HW_USART1_TX_PORT GPIOB
+#define CFG_HW_USART1_TX_PIN GPIO_PIN_6
+#define CFG_HW_USART1_TX_MODE GPIO_MODE_AF_PP
+#define CFG_HW_USART1_TX_PULL GPIO_NOPULL
+#define CFG_HW_USART1_TX_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_USART1_TX_ALTERNATE GPIO_AF7_USART1
+
+#define CFG_HW_USART1_RX_PORT_CLK_ENABLE __HAL_RCC_GPIOB_CLK_ENABLE
+#define CFG_HW_USART1_RX_PORT GPIOB
+#define CFG_HW_USART1_RX_PIN GPIO_PIN_7
+#define CFG_HW_USART1_RX_MODE GPIO_MODE_AF_PP
+#define CFG_HW_USART1_RX_PULL GPIO_NOPULL
+#define CFG_HW_USART1_RX_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_USART1_RX_ALTERNATE GPIO_AF7_USART1
+
+#define CFG_HW_USART1_CTS_PORT_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE
+#define CFG_HW_USART1_CTS_PORT GPIOA
+#define CFG_HW_USART1_CTS_PIN GPIO_PIN_11
+#define CFG_HW_USART1_CTS_MODE GPIO_MODE_AF_PP
+#define CFG_HW_USART1_CTS_PULL GPIO_PULLDOWN
+#define CFG_HW_USART1_CTS_SPEED GPIO_SPEED_FREQ_VERY_HIGH
+#define CFG_HW_USART1_CTS_ALTERNATE GPIO_AF7_USART1
+
+#define CFG_HW_USART1_DMA_TX_PREEMPTPRIORITY 0x0F
+#define CFG_HW_USART1_DMA_TX_SUBPRIORITY 0
+
+#define CFG_HW_USART1_DMAMUX_CLK_ENABLE __HAL_RCC_DMAMUX1_CLK_ENABLE
+#define CFG_HW_USART1_DMA_CLK_ENABLE __HAL_RCC_DMA1_CLK_ENABLE
+#define CFG_HW_USART1_TX_DMA_REQ DMA_REQUEST_USART1_TX
+#define CFG_HW_USART1_TX_DMA_CHANNEL DMA1_CHANNEL_2
+#define CFG_HW_USART1_TX_DMA_IRQn DMA1_CHANNEL_2_IRQn
+#define CFG_HW_USART1_DMA_TX_IRQHandler DMA1_CHANNEL_2_IRQHandler
+
+#endif /*HW_CONF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/main.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/main.h
new file mode 100644
index 000000000..68182bc5a
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/main.h
@@ -0,0 +1,71 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file : main.h
+ * @brief : Header for main.c file.
+ * This file contains the common defines of the application.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __MAIN_H
+#define __MAIN_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx_hal.h"
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Exported types ------------------------------------------------------------*/
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* Exported macro ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions prototypes ---------------------------------------------*/
+void Error_Handler(void);
+
+/* USER CODE BEGIN EFP */
+
+/* USER CODE END EFP */
+
+/* Private defines -----------------------------------------------------------*/
+/* USER CODE BEGIN Private defines */
+
+/* USER CODE END Private defines */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MAIN_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/stm32_lpm_if.h
new file mode 100644
index 000000000..70abecaa9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/stm32_lpm_if.h
@@ -0,0 +1,81 @@
+/* USER CODE BEGIN Header */
+/**
+******************************************************************************
+* @file stm32_lpm_if.h
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
+******************************************************************************
+* @attention
+*
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+* All rights reserved.</center></h2>
+*
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+*
+******************************************************************************
+*/
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32_LPM_IF_H
+#define __STM32_LPM_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+
+/**
+ * @brief Enters Low Power Off Mode
+ * @param none
+ * @retval none
+ */
+void PWR_EnterOffMode( void );
+/**
+ * @brief Exits Low Power Off Mode
+ * @param none
+ * @retval none
+ */
+void PWR_ExitOffMode( void );
+
+/**
+ * @brief Enters Low Power Stop Mode
+ * @note ARM exists the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_EnterStopMode( void );
+/**
+ * @brief Exits Low Power Stop Mode
+ * @note Enable the pll at 32MHz
+ * @param none
+ * @retval none
+ */
+void PWR_ExitStopMode( void );
+
+/**
+ * @brief Enters Low Power Sleep Mode
+ * @note ARM exits the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_EnterSleepMode( void );
+
+/**
+ * @brief Exits Low Power Sleep Mode
+ * @note ARM exits the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_ExitSleepMode( void );
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*__STM32_LPM_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/stm32wbxx_hal_conf.h
new file mode 100644
index 000000000..ea9aa40d0
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/stm32wbxx_hal_conf.h
@@ -0,0 +1,353 @@
+/**
+ ******************************************************************************
+ * @file stm32wbxx_hal_conf.h
+ * @author MCD Application Team
+ * @brief HAL configuration file.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32WBxx_HAL_CONF_H
+#define __STM32WBxx_HAL_CONF_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/* Exported types ------------------------------------------------------------*/
+/* Exported constants --------------------------------------------------------*/
+
+/* ########################## Module Selection ############################## */
+/**
+ * @brief This is the list of modules to be used in the HAL driver
+ */
+#define HAL_MODULE_ENABLED
+/*#define HAL_ADC_MODULE_ENABLED */
+/*#define HAL_CRYP_MODULE_ENABLED */
+/*#define HAL_COMP_MODULE_ENABLED */
+/*#define HAL_CRC_MODULE_ENABLED */
+#define HAL_HSEM_MODULE_ENABLED
+/*#define HAL_I2C_MODULE_ENABLED */
+/*#define HAL_IPCC_MODULE_ENABLED */
+/*#define HAL_IRDA_MODULE_ENABLED */
+/*#define HAL_IWDG_MODULE_ENABLED */
+/*#define HAL_LCD_MODULE_ENABLED */
+/*#define HAL_LPTIM_MODULE_ENABLED */
+/*#define HAL_PCD_MODULE_ENABLED */
+/*#define HAL_PKA_MODULE_ENABLED */
+/*#define HAL_QSPI_MODULE_ENABLED */
+/*#define HAL_RNG_MODULE_ENABLED */
+#define HAL_RTC_MODULE_ENABLED
+/*#define HAL_SAI_MODULE_ENABLED */
+/*#define HAL_SMBUS_MODULE_ENABLED */
+/*#define HAL_SMARTCARD_MODULE_ENABLED */
+/*#define HAL_SPI_MODULE_ENABLED */
+/*#define HAL_TIM_MODULE_ENABLED */
+/*#define HAL_TSC_MODULE_ENABLED */
+#define HAL_UART_MODULE_ENABLED
+/*#define HAL_USART_MODULE_ENABLED */
+/*#define HAL_WWDG_MODULE_ENABLED */
+#define HAL_EXTI_MODULE_ENABLED
+#define HAL_CORTEX_MODULE_ENABLED
+#define HAL_DMA_MODULE_ENABLED
+#define HAL_FLASH_MODULE_ENABLED
+#define HAL_GPIO_MODULE_ENABLED
+#define HAL_PWR_MODULE_ENABLED
+#define HAL_RCC_MODULE_ENABLED
+
+#define USE_HAL_ADC_REGISTER_CALLBACKS 0u
+#define USE_HAL_COMP_REGISTER_CALLBACKS 0u
+#define USE_HAL_CRYP_REGISTER_CALLBACKS 0u
+#define USE_HAL_I2C_REGISTER_CALLBACKS 0u
+#define USE_HAL_IRDA_REGISTER_CALLBACKS 0u
+#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0u
+#define USE_HAL_PCD_REGISTER_CALLBACKS 0u
+#define USE_HAL_PKA_REGISTER_CALLBACKS 0u
+#define USE_HAL_QSPI_REGISTER_CALLBACKS 0u
+#define USE_HAL_RNG_REGISTER_CALLBACKS 0u
+#define USE_HAL_RTC_REGISTER_CALLBACKS 0u
+#define USE_HAL_SAI_REGISTER_CALLBACKS 0u
+#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0u
+#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0u
+#define USE_HAL_SPI_REGISTER_CALLBACKS 0u
+#define USE_HAL_TIM_REGISTER_CALLBACKS 0u
+#define USE_HAL_TSC_REGISTER_CALLBACKS 0u
+#define USE_HAL_UART_REGISTER_CALLBACKS 0u
+#define USE_HAL_USART_REGISTER_CALLBACKS 0u
+#define USE_HAL_WWDG_REGISTER_CALLBACKS 0u
+
+/* ########################## Oscillator Values adaptation ####################*/
+/**
+ * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
+ * This value is used by the RCC HAL module to compute the system frequency
+ * (when HSE is used as system clock source, directly or through the PLL).
+ */
+#if !defined (HSE_VALUE)
+#define HSE_VALUE 32000000U /*!< Value of the External oscillator in Hz */
+#endif /* HSE_VALUE */
+
+#if !defined (HSE_STARTUP_TIMEOUT)
+ #define HSE_STARTUP_TIMEOUT ((uint32_t)100) /*!< Time out for HSE start up, in ms */
+#endif /* HSE_STARTUP_TIMEOUT */
+
+/**
+ * @brief Internal Multiple Speed oscillator (MSI) default value.
+ * This value is the default MSI range value after Reset.
+ */
+#if !defined (MSI_VALUE)
+ #define MSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/
+#endif /* MSI_VALUE */
+
+/**
+ * @brief Internal High Speed oscillator (HSI) value.
+ * This value is used by the RCC HAL module to compute the system frequency
+ * (when HSI is used as system clock source, directly or through the PLL).
+ */
+#if !defined (HSI_VALUE)
+#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/
+#endif /* HSI_VALUE */
+
+/**
+ * @brief Internal Low Speed oscillator (LSI1) value.
+ */
+#if !defined (LSI1_VALUE)
+ #define LSI1_VALUE ((uint32_t)32000) /*!< LSI1 Typical Value in Hz*/
+#endif /* LSI1_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
+ The real value may vary depending on the variations
+ in voltage and temperature.*/
+/**
+ * @brief Internal Low Speed oscillator (LSI2) value.
+ */
+#if !defined (LSI2_VALUE)
+ #define LSI2_VALUE ((uint32_t)32000) /*!< LSI2 Typical Value in Hz*/
+#endif /* LSI2_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
+ The real value may vary depending on the variations
+ in voltage and temperature.*/
+
+/**
+ * @brief External Low Speed oscillator (LSE) value.
+ * This value is used by the UART, RTC HAL module to compute the system frequency
+ */
+#if !defined (LSE_VALUE)
+#define LSE_VALUE 32768U /*!< Value of the External oscillator in Hz*/
+#endif /* LSE_VALUE */
+
+/**
+ * @brief Internal Multiple Speed oscillator (HSI48) default value.
+ * This value is the default HSI48 range value after Reset.
+ */
+#if !defined (HSI48_VALUE)
+ #define HSI48_VALUE ((uint32_t)48000000) /*!< Value of the Internal oscillator in Hz*/
+#endif /* HSI48_VALUE */
+
+#if !defined (LSE_STARTUP_TIMEOUT)
+#define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */
+#endif /* HSE_STARTUP_TIMEOUT */
+
+/**
+ * @brief External clock source for SAI1 peripheral
+ * This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source
+ * frequency.
+ */
+#if !defined (EXTERNAL_SAI1_CLOCK_VALUE)
+ #define EXTERNAL_SAI1_CLOCK_VALUE ((uint32_t)2097000) /*!< Value of the SAI1 External clock source in Hz*/
+#endif /* EXTERNAL_SAI1_CLOCK_VALUE */
+
+/* Tip: To avoid modifying this file each time you need to use different HSE,
+ === you can define the HSE value in your toolchain compiler preprocessor. */
+
+/* ########################### System Configuration ######################### */
+/**
+ * @brief This is the HAL system configuration section
+ */
+
+#define VDD_VALUE 3300U /*!< Value of VDD in mv */
+#define TICK_INT_PRIORITY 0U /*!< tick interrupt priority */
+#define USE_RTOS 0U
+#define PREFETCH_ENABLE 1U
+#define INSTRUCTION_CACHE_ENABLE 1U
+#define DATA_CACHE_ENABLE 1U
+
+/* ########################## Assert Selection ############################## */
+/**
+ * @brief Uncomment the line below to expanse the "assert_param" macro in the
+ * HAL drivers code
+ */
+/* #define USE_FULL_ASSERT 1U */
+
+/* ################## SPI peripheral configuration ########################## */
+
+/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
+ * Activated: CRC code is present inside driver
+ * Deactivated: CRC code cleaned from driver
+ */
+
+#define USE_SPI_CRC 0U
+
+/* Includes ------------------------------------------------------------------*/
+/**
+ * @brief Include module's header file
+ */
+#ifdef HAL_DMA_MODULE_ENABLED
+ #include "stm32wbxx_hal_dma.h"
+#endif /* HAL_DMA_MODULE_ENABLED */
+
+#ifdef HAL_ADC_MODULE_ENABLED
+ #include "stm32wbxx_hal_adc.h"
+#endif /* HAL_ADC_MODULE_ENABLED */
+
+#ifdef HAL_COMP_MODULE_ENABLED
+ #include "stm32wbxx_hal_comp.h"
+#endif /* HAL_COMP_MODULE_ENABLED */
+
+#ifdef HAL_CORTEX_MODULE_ENABLED
+ #include "stm32wbxx_hal_cortex.h"
+#endif /* HAL_CORTEX_MODULE_ENABLED */
+
+#ifdef HAL_CRC_MODULE_ENABLED
+ #include "stm32wbxx_hal_crc.h"
+#endif /* HAL_CRC_MODULE_ENABLED */
+
+#ifdef HAL_CRYP_MODULE_ENABLED
+ #include "stm32wbxx_hal_cryp.h"
+#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
+
+#ifdef HAL_FLASH_MODULE_ENABLED
+ #include "stm32wbxx_hal_flash.h"
+#endif /* HAL_FLASH_MODULE_ENABLED */
+
+#ifdef HAL_GPIO_MODULE_ENABLED
+ #include "stm32wbxx_hal_gpio.h"
+#endif /* HAL_GPIO_MODULE_ENABLED */
+
+#ifdef HAL_HSEM_MODULE_ENABLED
+ #include "stm32wbxx_hal_hsem.h"
+#endif /* HAL_HSEM_MODULE_ENABLED */
+
+#ifdef HAL_I2C_MODULE_ENABLED
+ #include "stm32wbxx_hal_i2c.h"
+#endif /* HAL_I2C_MODULE_ENABLED */
+
+#ifdef HAL_IPCC_MODULE_ENABLED
+ #include "stm32wbxx_hal_ipcc.h"
+#endif /* HAL_IPCC_MODULE_ENABLED */
+
+#ifdef HAL_IRDA_MODULE_ENABLED
+ #include "stm32wbxx_hal_irda.h"
+#endif /* HAL_IRDA_MODULE_ENABLED */
+
+#ifdef HAL_IWDG_MODULE_ENABLED
+ #include "stm32wbxx_hal_iwdg.h"
+#endif /* HAL_IWDG_MODULE_ENABLED */
+
+#ifdef HAL_LCD_MODULE_ENABLED
+ #include "stm32wbxx_hal_lcd.h"
+#endif /* HAL_LCD_MODULE_ENABLED */
+
+#ifdef HAL_LPTIM_MODULE_ENABLED
+ #include "stm32wbxx_hal_lptim.h"
+#endif /* HAL_LPTIM_MODULE_ENABLED */
+
+#ifdef HAL_PCD_MODULE_ENABLED
+ #include "stm32wbxx_hal_pcd.h"
+#endif /* HAL_PCD_MODULE_ENABLED */
+
+#ifdef HAL_PKA_MODULE_ENABLED
+ #include "stm32wbxx_hal_pka.h"
+#endif /* HAL_PKA_MODULE_ENABLED */
+
+#ifdef HAL_PWR_MODULE_ENABLED
+ #include "stm32wbxx_hal_pwr.h"
+#endif /* HAL_PWR_MODULE_ENABLED */
+
+#ifdef HAL_QSPI_MODULE_ENABLED
+ #include "stm32wbxx_hal_qspi.h"
+#endif /* HAL_QSPI_MODULE_ENABLED */
+
+#ifdef HAL_RCC_MODULE_ENABLED
+ #include "stm32wbxx_hal_rcc.h"
+#endif /* HAL_RCC_MODULE_ENABLED */
+
+#ifdef HAL_RNG_MODULE_ENABLED
+ #include "stm32wbxx_hal_rng.h"
+#endif /* HAL_RNG_MODULE_ENABLED */
+
+#ifdef HAL_RTC_MODULE_ENABLED
+ #include "stm32wbxx_hal_rtc.h"
+#endif /* HAL_RTC_MODULE_ENABLED */
+
+#ifdef HAL_SAI_MODULE_ENABLED
+ #include "stm32wbxx_hal_sai.h"
+#endif /* HAL_SAI_MODULE_ENABLED */
+
+#ifdef HAL_SMARTCARD_MODULE_ENABLED
+ #include "stm32wbxx_hal_smartcard.h"
+#endif /* HAL_SMARTCARD_MODULE_ENABLED */
+
+#ifdef HAL_SMBUS_MODULE_ENABLED
+ #include "stm32wbxx_hal_smbus.h"
+#endif /* HAL_SMBUS_MODULE_ENABLED */
+
+#ifdef HAL_SPI_MODULE_ENABLED
+ #include "stm32wbxx_hal_spi.h"
+#endif /* HAL_SPI_MODULE_ENABLED */
+
+#ifdef HAL_TIM_MODULE_ENABLED
+ #include "stm32wbxx_hal_tim.h"
+#endif /* HAL_TIM_MODULE_ENABLED */
+
+#ifdef HAL_TSC_MODULE_ENABLED
+ #include "stm32wbxx_hal_tsc.h"
+#endif /* HAL_TSC_MODULE_ENABLED */
+
+#ifdef HAL_UART_MODULE_ENABLED
+ #include "stm32wbxx_hal_uart.h"
+#endif /* HAL_UART_MODULE_ENABLED */
+
+#ifdef HAL_USART_MODULE_ENABLED
+ #include "stm32wbxx_hal_usart.h"
+#endif /* HAL_USART_MODULE_ENABLED */
+
+#ifdef HAL_WWDG_MODULE_ENABLED
+ #include "stm32wbxx_hal_wwdg.h"
+#endif /* HAL_WWDG_MODULE_ENABLED */
+
+/* Exported macro ------------------------------------------------------------*/
+#ifdef USE_FULL_ASSERT
+/**
+ * @brief The assert_param macro is used for function's parameters check.
+ * @param expr If expr is false, it calls assert_failed function
+ * which reports the name of the source file and the source
+ * line number of the call that failed.
+ * If expr is true, it returns no value.
+ * @retval None
+ */
+ #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
+/* Exported functions ------------------------------------------------------- */
+ void assert_failed(uint8_t* file, uint32_t line);
+#else
+ #define assert_param(expr) ((void)0U)
+#endif /* USE_FULL_ASSERT */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __STM32WBxx_HAL_CONF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/stm32wbxx_it.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/stm32wbxx_it.h
new file mode 100644
index 000000000..a3a535f13
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/stm32wbxx_it.h
@@ -0,0 +1,83 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file stm32wbxx_it.h
+ * @brief This file contains the headers of the interrupt handlers.
+ *******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32WBxx_IT_H
+#define __STM32WBxx_IT_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+#include "app_common.h"
+/* USER CODE END Includes */
+
+/* Exported types ------------------------------------------------------------*/
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* Exported macro ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions prototypes ---------------------------------------------*/
+void NMI_Handler(void);
+void HardFault_Handler(void);
+void MemManage_Handler(void);
+void BusFault_Handler(void);
+void UsageFault_Handler(void);
+void SVC_Handler(void);
+void DebugMon_Handler(void);
+void PendSV_Handler(void);
+void SysTick_Handler(void);
+void PVD_PVM_IRQHandler(void);
+void FLASH_IRQHandler(void);
+void RCC_IRQHandler(void);
+void DMA1_Channel1_IRQHandler(void);
+void DMA1_Channel2_IRQHandler(void);
+void C2SEV_PWR_C2H_IRQHandler(void);
+void USART1_IRQHandler(void);
+void LPUART1_IRQHandler(void);
+void PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler(void);
+void HSEM_IRQHandler(void);
+void FPU_IRQHandler(void);
+/* USER CODE BEGIN EFP */
+void RTC_WKUP_IRQHandler(void);
+void EXTI4_IRQHandler(void);
+void IPCC_C1_TX_IRQHandler(void);
+void IPCC_C1_RX_IRQHandler(void);
+/* USER CODE END EFP */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __STM32WBxx_IT_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/stm_logging.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/stm_logging.h
new file mode 100644
index 000000000..58877c570
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/stm_logging.h
@@ -0,0 +1,55 @@
+/**
+ ******************************************************************************
+ * File Name : stm_logging.h
+ * Description : Application header file for logging
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+#ifndef STM_LOGGING_H_
+#define STM_LOGGING_H_
+
+#define LOG_LEVEL_NONE 0 /* None */
+#define LOG_LEVEL_CRIT 1U /* Critical */
+#define LOG_LEVEL_WARN 2U /* Warning */
+#define LOG_LEVEL_INFO 3U /* Info */
+#define LOG_LEVEL_DEBG 4U /* Debug */
+
+#define APP_DBG_FULL(level, region, ...) \
+ if (APPLI_PRINT_FILE_FUNC_LINE == 1U) \
+ { \
+ printf("\r\n[%s][%s][%d] ", DbgTraceGetFileName(__FILE__), __FUNCTION__, __LINE__); \
+ } \
+ logApplication(level, region, __VA_ARGS__);
+
+#define APP_DBG(...) \
+ if (APPLI_PRINT_FILE_FUNC_LINE == 1U) \
+ { \
+ printf("\r\n[%s][%s][%d] ", DbgTraceGetFileName(__FILE__), __FUNCTION__, __LINE__); \
+ } \
+ logApplication(LOG_LEVEL_NONE, APPLI_LOG_REGION_GENERAL, __VA_ARGS__);
+
+/**
+ * This enumeration represents log regions.
+ *
+ */
+typedef enum {
+ APPLI_LOG_REGION_GENERAL = 1U, /* General */
+ APPLI_LOG_REGION_ZIGBEE_API = 2U, /* OpenThread API */
+} appliLogRegion_t;
+
+typedef uint8_t appliLogLevel_t;
+
+void logApplication(appliLogLevel_t aLogLevel, appliLogRegion_t aLogRegion, const char *aFormat, ...);
+
+#endif /* STM_LOGGING_H_ */
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/utilities_conf.h
new file mode 100644
index 000000000..4dde3509a
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Inc/utilities_conf.h
@@ -0,0 +1,68 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : utilities_conf.h
+ * Description : Configuration file for STM32 Utilities.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef UTILITIES_CONF_H
+#define UTILITIES_CONF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "cmsis_compiler.h"
+#include "string.h"
+
+/******************************************************************************
+ * common
+ ******************************************************************************/
+#define UTILS_ENTER_CRITICAL_SECTION( ) uint32_t primask_bit = __get_PRIMASK( );\
+ __disable_irq( )
+
+#define UTILS_EXIT_CRITICAL_SECTION( ) __set_PRIMASK( primask_bit )
+
+#define UTILS_MEMSET8( dest, value, size ) memset( dest, value, size);
+
+/******************************************************************************
+ * tiny low power manager
+ * (any macro that does not need to be modified can be removed)
+ ******************************************************************************/
+#define UTIL_LPM_INIT_CRITICAL_SECTION( )
+#define UTIL_LPM_ENTER_CRITICAL_SECTION( ) UTILS_ENTER_CRITICAL_SECTION( )
+#define UTIL_LPM_EXIT_CRITICAL_SECTION( ) UTILS_EXIT_CRITICAL_SECTION( )
+
+/******************************************************************************
+ * sequencer
+ * (any macro that does not need to be modified can be removed)
+ ******************************************************************************/
+#define UTIL_SEQ_INIT_CRITICAL_SECTION( )
+#define UTIL_SEQ_ENTER_CRITICAL_SECTION( ) UTILS_ENTER_CRITICAL_SECTION( )
+#define UTIL_SEQ_EXIT_CRITICAL_SECTION( ) UTILS_EXIT_CRITICAL_SECTION( )
+#define UTIL_SEQ_CONF_TASK_NBR (32)
+#define UTIL_SEQ_CONF_PRIO_NBR (2)
+#define UTIL_SEQ_MEMSET8( dest, value, size ) UTILS_MEMSET8( dest, value, size )
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*UTILITIES_CONF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/app_entry.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/app_entry.c
new file mode 100644
index 000000000..901f796a0
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/app_entry.c
@@ -0,0 +1,396 @@
+/**
+ ******************************************************************************
+ * File Name : app_entry.c
+ * Description : Entry application source file for STM32WPAN Middleware.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "main.h"
+#include "app_entry.h"
+#include "app_zigbee.h"
+#include "app_conf.h"
+#include "hw_conf.h"
+#include "stm32_seq.h"
+#include "stm_logging.h"
+#include "shci_tl.h"
+#include "stm32_lpm.h"
+#include "dbg_trace.h"
+#include "shci.h"
+
+/* Private includes -----------------------------------------------------------*/
+
+/* Private typedef -----------------------------------------------------------*/
+extern RTC_HandleTypeDef hrtc;
+
+/* Private defines -----------------------------------------------------------*/
+#define POOL_SIZE (CFG_TL_EVT_QUEUE_LENGTH * 4U * DIVC((sizeof(TL_PacketHeader_t) + TL_EVENT_FRAME_SIZE), 4U))
+
+/* Private variables ---------------------------------------------------------*/
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t EvtPool[POOL_SIZE];
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static TL_CmdPacket_t SystemCmdBuffer;
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t SystemSpareEvtBuffer[sizeof(TL_PacketHeader_t) + TL_EVT_HDR_SIZE + 255U];
+
+/* Global function prototypes -----------------------------------------------*/
+size_t __write(int handle, const unsigned char *buf, size_t bufSize);
+
+/* Private functions prototypes-----------------------------------------------*/
+static void SystemPower_Config(void);
+static void Init_Debug(void);
+static void appe_Tl_Init(void);
+static void APPE_SysStatusNot(SHCI_TL_CmdStatus_t status);
+static void APPE_SysUserEvtRx(void *pPayload);
+static void APPE_SysEvtReadyProcessing(void);
+static void APPE_SysEvtError(SCHI_SystemErrCode_t ErrorCode);
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+extern void MX_LPUART1_UART_Init(void);
+#endif
+#if (CFG_HW_USART1_ENABLED == 1)
+extern void MX_USART1_UART_Init(void);
+#endif
+
+/* USER CODE BEGIN PFP */
+static void Led_Init(void);
+static void Button_Init(void);
+/* USER CODE END PFP */
+
+/* Functions Definition ------------------------------------------------------*/
+void APPE_Init( void )
+{
+ SystemPower_Config(); /**< Configure the system Power Mode */
+
+ HW_TS_Init(hw_ts_InitMode_Full, &hrtc); /**< Initialize the TimerServer */
+
+ Init_Debug();
+ /**
+ * The Standby mode should not be entered before the initialization is over
+ * The default state of the Low Power Manager is to allow the Standby Mode so an request is needed here
+ */
+ UTIL_LPM_SetOffMode(1 << CFG_LPM_APP, UTIL_LPM_DISABLE);
+ Led_Init();
+ Button_Init();
+ appe_Tl_Init(); /* Initialize all transport layers */
+
+ /**
+ * From now, the application is waiting for the ready event ( VS_HCI_C2_Ready )
+ * received on the system channel before starting the Zigbee Stack
+ * This system event is received with APPE_SysUserEvtRx()
+ */
+
+ return;
+}
+
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+static void Init_Debug( void )
+{
+#if (CFG_DEBUGGER_SUPPORTED == 1)
+ /**
+ * Keep debugger enabled while in any low power mode
+ */
+ HAL_DBGMCU_EnableDBGSleepMode();
+
+ /***************** ENABLE DEBUGGER *************************************/
+ LL_EXTI_EnableIT_32_63(LL_EXTI_LINE_48);
+ LL_C2_EXTI_EnableIT_32_63(LL_EXTI_LINE_48);
+
+#else
+
+ GPIO_InitTypeDef gpio_config = {0};
+
+ gpio_config.Pull = GPIO_NOPULL;
+ gpio_config.Mode = GPIO_MODE_ANALOG;
+
+ gpio_config.Pin = GPIO_PIN_15 | GPIO_PIN_14 | GPIO_PIN_13;
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ HAL_GPIO_Init(GPIOA, &gpio_config);
+ __HAL_RCC_GPIOA_CLK_DISABLE();
+
+ gpio_config.Pin = GPIO_PIN_4 | GPIO_PIN_3;
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+ HAL_GPIO_Init(GPIOB, &gpio_config);
+ __HAL_RCC_GPIOB_CLK_DISABLE();
+
+ HAL_DBGMCU_DisableDBGSleepMode();
+ HAL_DBGMCU_DisableDBGStopMode();
+ HAL_DBGMCU_DisableDBGStandbyMode();
+
+#endif /* (CFG_DEBUGGER_SUPPORTED == 1) */
+
+#if(CFG_DEBUG_TRACE != 0)
+ DbgTraceInit();
+#endif
+
+ return;
+}
+
+/**
+ * @brief Configure the system for power optimization
+ *
+ * @note This API configures the system to be ready for low power mode
+ *
+ * @param None
+ * @retval None
+ */
+static void SystemPower_Config( void )
+{
+
+ /**
+ * Select HSI as system clock source after Wake Up from Stop mode
+ */
+ LL_RCC_SetClkAfterWakeFromStop(LL_RCC_STOP_WAKEUPCLOCK_HSI);
+
+ /* Initialize low power manager */
+ UTIL_LPM_Init( );
+
+#if (CFG_USB_INTERFACE_ENABLE != 0)
+ /**
+ * Enable USB power
+ */
+ HAL_PWREx_EnableVddUSB();
+#endif
+
+ return;
+}
+
+static void appe_Tl_Init( void )
+{
+ TL_MM_Config_t tl_mm_config;
+ SHCI_TL_HciInitConf_t SHci_Tl_Init_Conf;
+ /**< Reference table initialization */
+ TL_Init();
+
+ /**< System channel initialization */
+ UTIL_SEQ_RegTask( 1<< CFG_TASK_SYSTEM_HCI_ASYNCH_EVT, UTIL_SEQ_RFU, shci_user_evt_proc );
+ SHci_Tl_Init_Conf.p_cmdbuffer = (uint8_t*)&SystemCmdBuffer;
+ SHci_Tl_Init_Conf.StatusNotCallBack = APPE_SysStatusNot;
+ shci_init(APPE_SysUserEvtRx, (void*) &SHci_Tl_Init_Conf);
+
+ /**< Memory Manager channel initialization */
+ tl_mm_config.p_BleSpareEvtBuffer = 0;
+ tl_mm_config.p_SystemSpareEvtBuffer = SystemSpareEvtBuffer;
+ tl_mm_config.p_AsynchEvtPool = EvtPool;
+ tl_mm_config.AsynchEvtPoolSize = POOL_SIZE;
+ TL_MM_Init( &tl_mm_config );
+
+ TL_Enable();
+
+ return;
+}
+
+
+static void APPE_SysStatusNot(SHCI_TL_CmdStatus_t status)
+{
+ UNUSED(status);
+ return;
+}
+
+/**
+ * @brief Trap a notification coming from the M0 firmware
+ * @param pPayload : payload associated to the notification
+ *
+ * @retval None
+ */
+
+static void APPE_SysUserEvtRx( void * pPayload )
+{
+ TL_AsynchEvt_t *p_sys_event;
+ p_sys_event = (TL_AsynchEvt_t*)(((tSHCI_UserEvtRxParam*)pPayload)->pckt->evtserial.evt.payload);
+
+ switch(p_sys_event->subevtcode)
+ {
+ case SHCI_SUB_EVT_CODE_READY:
+ APPE_SysEvtReadyProcessing();
+ break;
+ case SHCI_SUB_EVT_ERROR_NOTIF:
+ APPE_SysEvtError((SCHI_SystemErrCode_t) (p_sys_event->payload[0]));
+ break;
+ default:
+ break;
+ }
+ return;
+}
+
+/**
+ * @brief Notify a system error coming from the M0 firmware
+ * @param ErrorCode : errorCode detected by the M0 firmware
+ *
+ * @retval None
+ */
+static void APPE_SysEvtError( SCHI_SystemErrCode_t ErrorCode)
+{
+ switch (ErrorCode) // TODO
+ {
+ case ERR_THREAD_LLD_FATAL_ERROR:
+ APP_DBG("** ERR_ZIGBEE : LLD_FATAL_ERROR \n");
+ break;
+ case ERR_THREAD_UNKNOWN_CMD:
+ APP_DBG("** ERR_ZIGBEE : UNKNOWN_CMD \n");
+ break;
+ default:
+ APP_DBG("** ERR_ZIGBEE : ErroCode=%d \n", ErrorCode);
+ break;
+ }
+ return;
+}
+
+static void APPE_SysEvtReadyProcessing( void )
+{
+ /* Traces channel initialization */
+ TL_TRACES_Init();
+
+ APP_ZIGBEE_Init();
+ UTIL_LPM_SetOffMode(1U << CFG_LPM_APP, UTIL_LPM_ENABLE);
+ return;
+}
+
+/* USER CODE BEGIN FD_LOCAL_FUNCTIONS */
+static void Led_Init( void )
+{
+#if (CFG_LED_SUPPORTED == 1U)
+ /**
+ * Leds Initialization
+ */
+
+ BSP_LED_Init(LED_BLUE);
+ BSP_LED_Init(LED_GREEN);
+ BSP_LED_Init(LED_RED);
+
+#endif
+
+ return;
+}
+
+static void Button_Init( void )
+{
+#if (CFG_BUTTON_SUPPORTED == 1U)
+ /**
+ * Button Initialization
+ */
+ BSP_PB_Init(BUTTON_SW1, BUTTON_MODE_EXTI);
+ BSP_PB_Init(BUTTON_SW2, BUTTON_MODE_EXTI);
+ BSP_PB_Init(BUTTON_SW3, BUTTON_MODE_EXTI);
+#endif
+
+ return;
+}
+
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+
+void UTIL_SEQ_Idle( void )
+{
+#if ( CFG_LPM_SUPPORTED == 1)
+ UTIL_LPM_EnterLowPower( );
+#endif
+ return;
+}
+
+/**
+ * @brief This function is called by the scheduler each time an event
+ * is pending.
+ *
+ * @param evt_waited_bm : Event pending.
+ * @retval None
+ */
+void UTIL_SEQ_EvtIdle( UTIL_SEQ_bm_t task_id_bm, UTIL_SEQ_bm_t evt_waited_bm )
+{
+ switch (evt_waited_bm) {
+ case EVENT_ACK_FROM_M0_EVT:
+ /* Run only the task CFG_TASK_MSG_FROM_M0_TO_M4 */
+ UTIL_SEQ_Run((1U << CFG_TASK_MSG_FROM_M0_TO_M4));
+ break;
+ case EVENT_SYNCHRO_BYPASS_IDLE:
+ UTIL_SEQ_SetEvt(EVENT_SYNCHRO_BYPASS_IDLE);
+ /* Run only the task CFG_TASK_MSG_FROM_M0_TO_M4 */
+ UTIL_SEQ_Run((1U << CFG_TASK_MSG_FROM_M0_TO_M4));
+ break;
+
+ default:
+ /* default case */
+ UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
+ break;
+ }
+}
+
+void shci_notify_asynch_evt(void* pdata)
+{
+ UNUSED(pdata);
+ UTIL_SEQ_SetTask(1U << CFG_TASK_SYSTEM_HCI_ASYNCH_EVT, CFG_SCH_PRIO_0);
+ return;
+}
+
+void shci_cmd_resp_release(uint32_t flag)
+{
+ UNUSED(flag);
+ UTIL_SEQ_SetEvt(1U << CFG_EVT_SYSTEM_HCI_CMD_EVT_RESP);
+ return;
+}
+
+void shci_cmd_resp_wait(uint32_t timeout)
+{
+ UNUSED(timeout);
+ UTIL_SEQ_WaitEvt(1U << CFG_EVT_SYSTEM_HCI_CMD_EVT_RESP);
+ return;
+}
+
+/* Received trace buffer from M0 */
+void TL_TRACES_EvtReceived( TL_EvtPacket_t * hcievt )
+{
+#if(CFG_DEBUG_TRACE != 0)
+ /* Call write/print function using DMA from dbg_trace */
+ /* - Cast to TL_AsynchEvt_t* to get "real" payload (without Sub Evt code 2bytes),
+ - (-2) to size to remove Sub Evt Code */
+ DbgTraceWrite(1U, (const unsigned char *) ((TL_AsynchEvt_t *)(hcievt->evtserial.evt.payload))->payload, hcievt->evtserial.evt.plen - 2U);
+#endif /* CFG_DEBUG_TRACE */
+ /* Release buffer */
+ TL_MM_EvtDone( hcievt );
+}
+/**
+ * @brief Initialisation of the trace mechanism
+ * @param None
+ * @retval None
+ */
+#if(CFG_DEBUG_TRACE != 0)
+void DbgOutputInit( void )
+{
+ MX_USART1_UART_Init();
+
+ return;
+}
+
+/**
+ * @brief Management of the traces
+ * @param p_data : data
+ * @param size : size
+ * @param call-back :
+ * @retval None
+ */
+void DbgOutputTraces( uint8_t *p_data, uint16_t size, void (*cb)(void) )
+{
+ HW_UART_Transmit_DMA(CFG_DEBUG_TRACE_UART, p_data, size, cb);
+
+ return;
+}
+#endif
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/hw_timerserver.c
new file mode 100644
index 000000000..c842ba55e
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/hw_timerserver.c
@@ -0,0 +1,893 @@
+/**
+ ******************************************************************************
+ * File Name : hw_timerserver.c
+ * Description : Hardware timerserver source file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "hw_conf.h"
+
+/* Private typedef -----------------------------------------------------------*/
+typedef enum
+{
+ TimerID_Free,
+ TimerID_Created,
+ TimerID_Running
+}TimerIDStatus_t;
+
+typedef enum
+{
+ SSR_Read_Requested,
+ SSR_Read_Not_Requested
+}RequestReadSSR_t;
+
+typedef enum
+{
+ WakeupTimerValue_Overpassed,
+ WakeupTimerValue_LargeEnough
+}WakeupTimerLimitation_Status_t;
+
+typedef struct
+{
+ HW_TS_pTimerCb_t pTimerCallBack;
+ uint32_t CounterInit;
+ uint32_t CountLeft;
+ TimerIDStatus_t TimerIDStatus;
+ HW_TS_Mode_t TimerMode;
+ uint32_t TimerProcessID;
+ uint8_t PreviousID;
+ uint8_t NextID;
+}TimerContext_t;
+
+/* Private defines -----------------------------------------------------------*/
+#define SSR_FORBIDDEN_VALUE 0xFFFFFFFF
+#define TIMER_LIST_EMPTY 0xFFFF
+
+/* Private macros ------------------------------------------------------------*/
+/* Private variables ---------------------------------------------------------*/
+
+/**
+ * START of Section TIMERSERVER_CONTEXT
+ */
+
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile TimerContext_t aTimerContext[CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER];
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile uint8_t CurrentRunningTimerID;
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile uint8_t PreviousRunningTimerID;
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile uint32_t SSRValueOnLastSetup;
+PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile WakeupTimerLimitation_Status_t WakeupTimerLimitation;
+
+/**
+ * END of Section TIMERSERVER_CONTEXT
+ */
+
+static RTC_HandleTypeDef *phrtc; /**< RTC handle */
+static uint8_t WakeupTimerDivider;
+static uint8_t AsynchPrescalerUserConfig;
+static uint16_t SynchPrescalerUserConfig;
+static volatile uint16_t MaxWakeupTimerSetup;
+
+/* Global variables ----------------------------------------------------------*/
+/* Private function prototypes -----------------------------------------------*/
+static void RestartWakeupCounter(uint16_t Value);
+static uint16_t ReturnTimeElapsed(void);
+static void RescheduleTimerList(void);
+static void UnlinkTimer(uint8_t TimerID, RequestReadSSR_t RequestReadSSR);
+static void LinkTimerBefore(uint8_t TimerID, uint8_t RefTimerID);
+static void LinkTimerAfter(uint8_t TimerID, uint8_t RefTimerID);
+static uint16_t linkTimer(uint8_t TimerID);
+static uint32_t ReadRtcSsrValue(void);
+
+__weak void HW_TS_RTC_CountUpdated_AppNot(void);
+
+/* Functions Definition ------------------------------------------------------*/
+
+/**
+ * @brief Read the RTC_SSR value
+ * As described in the reference manual, the RTC_SSR shall be read twice to ensure
+ * reliability of the value
+ * @param None
+ * @retval SSR value read
+ */
+static uint32_t ReadRtcSsrValue(void)
+{
+ uint32_t first_read;
+ uint32_t second_read;
+
+ first_read = (uint32_t)(READ_BIT(RTC->SSR, RTC_SSR_SS));
+
+ second_read = (uint32_t)(READ_BIT(RTC->SSR, RTC_SSR_SS));
+
+ while(first_read != second_read)
+ {
+ first_read = second_read;
+
+ second_read = (uint32_t)(READ_BIT(RTC->SSR, RTC_SSR_SS));
+ }
+
+ return second_read;
+}
+
+/**
+ * @brief Insert a Timer in the list after the Timer ID specified
+ * @param TimerID: The ID of the Timer
+ * @param RefTimerID: The ID of the Timer to be linked after
+ * @retval None
+ */
+static void LinkTimerAfter(uint8_t TimerID, uint8_t RefTimerID)
+{
+ uint8_t next_id;
+
+ next_id = aTimerContext[RefTimerID].NextID;
+
+ if(next_id != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ aTimerContext[next_id].PreviousID = TimerID;
+ }
+ aTimerContext[TimerID].NextID = next_id;
+ aTimerContext[TimerID].PreviousID = RefTimerID ;
+ aTimerContext[RefTimerID].NextID = TimerID;
+
+ return;
+}
+
+/**
+ * @brief Insert a Timer in the list before the ID specified
+ * @param TimerID: The ID of the Timer
+ * @param RefTimerID: The ID of the Timer to be linked before
+ * @retval None
+ */
+static void LinkTimerBefore(uint8_t TimerID, uint8_t RefTimerID)
+{
+ uint8_t previous_id;
+
+ if(RefTimerID != CurrentRunningTimerID)
+ {
+ previous_id = aTimerContext[RefTimerID].PreviousID;
+
+ aTimerContext[previous_id].NextID = TimerID;
+ aTimerContext[TimerID].NextID = RefTimerID;
+ aTimerContext[TimerID].PreviousID = previous_id ;
+ aTimerContext[RefTimerID].PreviousID = TimerID;
+ }
+ else
+ {
+ aTimerContext[TimerID].NextID = RefTimerID;
+ aTimerContext[RefTimerID].PreviousID = TimerID;
+ }
+
+ return;
+}
+
+/**
+ * @brief Insert a Timer in the list
+ * @param TimerID: The ID of the Timer
+ * @retval None
+ */
+static uint16_t linkTimer(uint8_t TimerID)
+{
+ uint32_t time_left;
+ uint16_t time_elapsed;
+ uint8_t timer_id_lookup;
+ uint8_t next_id;
+
+ if(CurrentRunningTimerID == CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ /**
+ * No timer in the list
+ */
+ PreviousRunningTimerID = CurrentRunningTimerID;
+ CurrentRunningTimerID = TimerID;
+ aTimerContext[TimerID].NextID = CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER;
+
+ SSRValueOnLastSetup = SSR_FORBIDDEN_VALUE;
+ time_elapsed = 0;
+ }
+ else
+ {
+ time_elapsed = ReturnTimeElapsed();
+
+ /**
+ * update count of the timer to be linked
+ */
+ aTimerContext[TimerID].CountLeft += time_elapsed;
+ time_left = aTimerContext[TimerID].CountLeft;
+
+ /**
+ * Search for index where the new timer shall be linked
+ */
+ if(aTimerContext[CurrentRunningTimerID].CountLeft <= time_left)
+ {
+ /**
+ * Search for the ID after the first one
+ */
+ timer_id_lookup = CurrentRunningTimerID;
+ next_id = aTimerContext[timer_id_lookup].NextID;
+ while((next_id != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) && (aTimerContext[next_id].CountLeft <= time_left))
+ {
+ timer_id_lookup = aTimerContext[timer_id_lookup].NextID;
+ next_id = aTimerContext[timer_id_lookup].NextID;
+ }
+
+ /**
+ * Link after the ID
+ */
+ LinkTimerAfter(TimerID, timer_id_lookup);
+ }
+ else
+ {
+ /**
+ * Link before the first ID
+ */
+ LinkTimerBefore(TimerID, CurrentRunningTimerID);
+ PreviousRunningTimerID = CurrentRunningTimerID;
+ CurrentRunningTimerID = TimerID;
+ }
+ }
+
+ return time_elapsed;
+}
+
+/**
+ * @brief Remove a Timer from the list
+ * @param TimerID: The ID of the Timer
+ * @param RequestReadSSR: Request to read the SSR register or not
+ * @retval None
+ */
+static void UnlinkTimer(uint8_t TimerID, RequestReadSSR_t RequestReadSSR)
+{
+ uint8_t previous_id;
+ uint8_t next_id;
+
+ if(TimerID == CurrentRunningTimerID)
+ {
+ PreviousRunningTimerID = CurrentRunningTimerID;
+ CurrentRunningTimerID = aTimerContext[TimerID].NextID;
+ }
+ else
+ {
+ previous_id = aTimerContext[TimerID].PreviousID;
+ next_id = aTimerContext[TimerID].NextID;
+
+ aTimerContext[previous_id].NextID = aTimerContext[TimerID].NextID;
+ if(next_id != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ aTimerContext[next_id].PreviousID = aTimerContext[TimerID].PreviousID;
+ }
+ }
+
+ /**
+ * Timer is out of the list
+ */
+ aTimerContext[TimerID].TimerIDStatus = TimerID_Created;
+
+ if((CurrentRunningTimerID == CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) && (RequestReadSSR == SSR_Read_Requested))
+ {
+ SSRValueOnLastSetup = SSR_FORBIDDEN_VALUE;
+ }
+
+ return;
+}
+
+/**
+ * @brief Return the number of ticks counted by the wakeuptimer since it has been started
+ * @note The API is reading the SSR register to get how many ticks have been counted
+ * since the time the timer has been started
+ * @param None
+ * @retval Time expired in Ticks
+ */
+static uint16_t ReturnTimeElapsed(void)
+{
+ uint32_t return_value;
+ uint32_t wrap_counter;
+
+ if(SSRValueOnLastSetup != SSR_FORBIDDEN_VALUE)
+ {
+ return_value = ReadRtcSsrValue(); /**< Read SSR register first */
+
+ if (SSRValueOnLastSetup >= return_value)
+ {
+ return_value = SSRValueOnLastSetup - return_value;
+ }
+ else
+ {
+ wrap_counter = SynchPrescalerUserConfig - return_value;
+ return_value = SSRValueOnLastSetup + wrap_counter;
+ }
+
+ /**
+ * At this stage, ReturnValue holds the number of ticks counted by SSR
+ * Need to translate in number of ticks counted by the Wakeuptimer
+ */
+ return_value = return_value*AsynchPrescalerUserConfig;
+ return_value = return_value >> WakeupTimerDivider;
+ }
+ else
+ {
+ return_value = 0;
+ }
+
+ return (uint16_t)return_value;
+}
+
+/**
+ * @brief Set the wakeup counter
+ * @note The API is writing the counter value so that the value is decreased by one to cope with the fact
+ * the interrupt is generated with 1 extra clock cycle (See RefManuel)
+ * It assumes all condition are met to be allowed to write the wakeup counter
+ * @param Value: Value to be written in the counter
+ * @retval None
+ */
+static void RestartWakeupCounter(uint16_t Value)
+{
+ /**
+ * The wakeuptimer has been disabled in the calling function to reduce the time to poll the WUTWF
+ * FLAG when the new value will have to be written
+ * __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc);
+ */
+
+ if(Value == 0)
+ {
+ SSRValueOnLastSetup = ReadRtcSsrValue();
+
+ /**
+ * Simulate that the Timer expired
+ */
+ HAL_NVIC_SetPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID);
+ }
+ else
+ {
+ if((Value > 1) ||(WakeupTimerDivider != 1))
+ {
+ Value -= 1;
+ }
+
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == RESET);
+
+ /**
+ * make sure to clear the flags after checking the WUTWF.
+ * It takes 2 RTCCLK between the time the WUTE bit is disabled and the
+ * time the timer is disabled. The WUTWF bit somehow guarantee the system is stable
+ * Otherwise, when the timer is periodic with 1 Tick, it may generate an extra interrupt in between
+ * due to the autoreload feature
+ */
+ __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */
+ __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */
+ HAL_NVIC_ClearPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Clear pending bit in NVIC */
+
+ MODIFY_REG(RTC->WUTR, RTC_WUTR_WUT, Value);
+
+ /**
+ * Update the value here after the WUTWF polling that may take some time
+ */
+ SSRValueOnLastSetup = ReadRtcSsrValue();
+
+ __HAL_RTC_WAKEUPTIMER_ENABLE(phrtc); /**< Enable the Wakeup Timer */
+
+ HW_TS_RTC_CountUpdated_AppNot();
+ }
+
+ return ;
+}
+
+/**
+ * @brief Reschedule the list of timer
+ * @note 1) Update the count left for each timer in the list
+ * 2) Setup the wakeuptimer
+ * @param None
+ * @retval None
+ */
+static void RescheduleTimerList(void)
+{
+ uint8_t localTimerID;
+ uint32_t timecountleft;
+ uint16_t wakeup_timer_value;
+ uint16_t time_elapsed;
+
+ /**
+ * The wakeuptimer is disabled now to reduce the time to poll the WUTWF
+ * FLAG when the new value will have to be written
+ */
+ if((READ_BIT(RTC->CR, RTC_CR_WUTE) == (RTC_CR_WUTE)) == SET)
+ {
+ /**
+ * Wait for the flag to be back to 0 when the wakeup timer is enabled
+ */
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == SET);
+ }
+ __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc); /**< Disable the Wakeup Timer */
+
+ localTimerID = CurrentRunningTimerID;
+
+ /**
+ * Calculate what will be the value to write in the wakeuptimer
+ */
+ timecountleft = aTimerContext[localTimerID].CountLeft;
+
+ /**
+ * Read how much has been counted
+ */
+ time_elapsed = ReturnTimeElapsed();
+
+ if(timecountleft < time_elapsed )
+ {
+ /**
+ * There is no tick left to count
+ */
+ wakeup_timer_value = 0;
+ WakeupTimerLimitation = WakeupTimerValue_LargeEnough;
+ }
+ else
+ {
+ if(timecountleft > (time_elapsed + MaxWakeupTimerSetup))
+ {
+ /**
+ * The number of tick left is greater than the Wakeuptimer maximum value
+ */
+ wakeup_timer_value = MaxWakeupTimerSetup;
+
+ WakeupTimerLimitation = WakeupTimerValue_Overpassed;
+ }
+ else
+ {
+ wakeup_timer_value = timecountleft - time_elapsed;
+ WakeupTimerLimitation = WakeupTimerValue_LargeEnough;
+ }
+
+ }
+
+ /**
+ * update ticks left to be counted for each timer
+ */
+ while(localTimerID != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ if (aTimerContext[localTimerID].CountLeft < time_elapsed)
+ {
+ aTimerContext[localTimerID].CountLeft = 0;
+ }
+ else
+ {
+ aTimerContext[localTimerID].CountLeft -= time_elapsed;
+ }
+ localTimerID = aTimerContext[localTimerID].NextID;
+ }
+
+ /**
+ * Write next count
+ */
+ RestartWakeupCounter(wakeup_timer_value);
+
+ return ;
+}
+
+/* Public functions ----------------------------------------------------------*/
+
+/**
+ * For all public interface except that may need write access to the RTC, the RTC
+ * shall be unlock at the beginning and locked at the output
+ * In order to ease maintainability, the unlock is done at the top and the lock at then end
+ * in case some new implementation is coming in the future
+ */
+
+void HW_TS_RTC_Wakeup_Handler(void)
+{
+ HW_TS_pTimerCb_t ptimer_callback;
+ uint32_t timer_process_id;
+ uint8_t local_current_running_timer_id;
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ uint32_t primask_bit;
+#endif
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+#endif
+
+/* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+
+ /**
+ * Disable the Wakeup Timer
+ * This may speed up a bit the processing to wait the timer to be disabled
+ * The timer is still counting 2 RTCCLK
+ */
+ __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc);
+
+ local_current_running_timer_id = CurrentRunningTimerID;
+
+ if(aTimerContext[local_current_running_timer_id].TimerIDStatus == TimerID_Running)
+ {
+ ptimer_callback = aTimerContext[local_current_running_timer_id].pTimerCallBack;
+ timer_process_id = aTimerContext[local_current_running_timer_id].TimerProcessID;
+
+ /**
+ * It should be good to check whether the TimeElapsed is greater or not than the tick left to be counted
+ * However, due to the inaccuracy of the reading of the time elapsed, it may return there is 1 tick
+ * to be left whereas the count is over
+ * A more secure implementation has been done with a flag to state whereas the full count has been written
+ * in the wakeuptimer or not
+ */
+ if(WakeupTimerLimitation != WakeupTimerValue_Overpassed)
+ {
+ if(aTimerContext[local_current_running_timer_id].TimerMode == hw_ts_Repeated)
+ {
+ UnlinkTimer(local_current_running_timer_id, SSR_Read_Not_Requested);
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+ HW_TS_Start(local_current_running_timer_id, aTimerContext[local_current_running_timer_id].CounterInit);
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+ }
+ else
+ {
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+ HW_TS_Stop(local_current_running_timer_id);
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+ }
+
+ HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
+ }
+ else
+ {
+ RescheduleTimerList();
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+ }
+ }
+ else
+ {
+ /**
+ * We should never end up in this case
+ * However, if due to any bug in the timer server this is the case, the mistake may not impact the user.
+ * We could just clean the interrupt flag and get out from this unexpected interrupt
+ */
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == RESET);
+
+ /**
+ * make sure to clear the flags after checking the WUTWF.
+ * It takes 2 RTCCLK between the time the WUTE bit is disabled and the
+ * time the timer is disabled. The WUTWF bit somehow guarantee the system is stable
+ * Otherwise, when the timer is periodic with 1 Tick, it may generate an extra interrupt in between
+ * due to the autoreload feature
+ */
+ __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */
+ __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+ }
+
+ /* Enable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_ENABLE( phrtc );
+
+ return;
+}
+
+void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
+{
+ uint8_t loop;
+ uint32_t localmaxwakeuptimersetup;
+
+ /**
+ * Get RTC handler
+ */
+ phrtc = hrtc;
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+
+ SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
+
+ /**
+ * Readout the user config
+ */
+ WakeupTimerDivider = (4 - ((uint32_t)(READ_BIT(RTC->CR, RTC_CR_WUCKSEL))));
+
+ AsynchPrescalerUserConfig = (uint8_t)(READ_BIT(RTC->PRER, RTC_PRER_PREDIV_A) >> (uint32_t)POSITION_VAL(RTC_PRER_PREDIV_A)) + 1;
+
+ SynchPrescalerUserConfig = (uint16_t)(READ_BIT(RTC->PRER, RTC_PRER_PREDIV_S)) + 1;
+
+ /**
+ * Margin is taken to avoid wrong calculation when the wrap around is there and some
+ * application interrupts may have delayed the reading
+ */
+ localmaxwakeuptimersetup = ((((SynchPrescalerUserConfig - 1)*AsynchPrescalerUserConfig) - CFG_HW_TS_RTC_HANDLER_MAX_DELAY) >> WakeupTimerDivider);
+
+ if(localmaxwakeuptimersetup >= 0xFFFF)
+ {
+ MaxWakeupTimerSetup = 0xFFFF;
+ }
+ else
+ {
+ MaxWakeupTimerSetup = (uint16_t)localmaxwakeuptimersetup;
+ }
+
+ /**
+ * Configure EXTI module
+ */
+ LL_EXTI_EnableRisingTrig_0_31(RTC_EXTI_LINE_WAKEUPTIMER_EVENT);
+ LL_EXTI_EnableIT_0_31(RTC_EXTI_LINE_WAKEUPTIMER_EVENT);
+
+ if(TimerInitMode == hw_ts_InitMode_Full)
+ {
+ WakeupTimerLimitation = WakeupTimerValue_LargeEnough;
+ SSRValueOnLastSetup = SSR_FORBIDDEN_VALUE;
+
+ /**
+ * Initialize the timer server
+ */
+ for(loop = 0; loop < CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER; loop++)
+ {
+ aTimerContext[loop].TimerIDStatus = TimerID_Free;
+ }
+
+ CurrentRunningTimerID = CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER; /**< Set ID to non valid value */
+
+ __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc); /**< Disable the Wakeup Timer */
+ __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */
+ __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */
+ HAL_NVIC_ClearPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Clear pending bit in NVIC */
+ __HAL_RTC_WAKEUPTIMER_ENABLE_IT(phrtc, RTC_IT_WUT); /**< Enable interrupt in RTC module */
+ }
+ else
+ {
+ if(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTF) != RESET)
+ {
+ /**
+ * Simulate that the Timer expired
+ */
+ HAL_NVIC_SetPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID);
+ }
+ }
+
+ /* Enable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_ENABLE( phrtc );
+
+ HAL_NVIC_SetPriority(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID, CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO, CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO); /**< Set NVIC priority */
+ HAL_NVIC_EnableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Enable NVIC */
+
+ return;
+}
+
+HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pftimeout_handler)
+{
+ HW_TS_ReturnStatus_t localreturnstatus;
+ uint8_t loop = 0;
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ uint32_t primask_bit;
+#endif
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+#endif
+
+ while((loop < CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) && (aTimerContext[loop].TimerIDStatus != TimerID_Free))
+ {
+ loop++;
+ }
+
+ if(loop != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ aTimerContext[loop].TimerIDStatus = TimerID_Created;
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+
+ aTimerContext[loop].TimerProcessID = TimerProcessID;
+ aTimerContext[loop].TimerMode = TimerMode;
+ aTimerContext[loop].pTimerCallBack = pftimeout_handler;
+ *pTimerId = loop;
+
+ localreturnstatus = hw_ts_Successful;
+ }
+ else
+ {
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+
+ localreturnstatus = hw_ts_Failed;
+ }
+
+ return(localreturnstatus);
+}
+
+void HW_TS_Delete(uint8_t timer_id)
+{
+ HW_TS_Stop(timer_id);
+
+ aTimerContext[timer_id].TimerIDStatus = TimerID_Free; /**< release ID */
+
+ return;
+}
+
+void HW_TS_Stop(uint8_t timer_id)
+{
+ uint8_t localcurrentrunningtimerid;
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ uint32_t primask_bit;
+#endif
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+#endif
+
+ HAL_NVIC_DisableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Disable NVIC */
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+
+ if(aTimerContext[timer_id].TimerIDStatus == TimerID_Running)
+ {
+ UnlinkTimer(timer_id, SSR_Read_Requested);
+ localcurrentrunningtimerid = CurrentRunningTimerID;
+
+ if(localcurrentrunningtimerid == CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER)
+ {
+ /**
+ * List is empty
+ */
+
+ /**
+ * Disable the timer
+ */
+ if((READ_BIT(RTC->CR, RTC_CR_WUTE) == (RTC_CR_WUTE)) == SET)
+ {
+ /**
+ * Wait for the flag to be back to 0 when the wakeup timer is enabled
+ */
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == SET);
+ }
+ __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc); /**< Disable the Wakeup Timer */
+
+ while(__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == RESET);
+
+ /**
+ * make sure to clear the flags after checking the WUTWF.
+ * It takes 2 RTCCLK between the time the WUTE bit is disabled and the
+ * time the timer is disabled. The WUTWF bit somehow guarantee the system is stable
+ * Otherwise, when the timer is periodic with 1 Tick, it may generate an extra interrupt in between
+ * due to the autoreload feature
+ */
+ __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */
+ __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */
+ HAL_NVIC_ClearPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Clear pending bit in NVIC */
+ }
+ else if(PreviousRunningTimerID != localcurrentrunningtimerid)
+ {
+ RescheduleTimerList();
+ }
+ }
+
+ /* Enable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_ENABLE( phrtc );
+
+ HAL_NVIC_EnableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Enable NVIC */
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+
+ return;
+}
+
+void HW_TS_Start(uint8_t timer_id, uint32_t timeout_ticks)
+{
+ uint16_t time_elapsed;
+ uint8_t localcurrentrunningtimerid;
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ uint32_t primask_bit;
+#endif
+
+ if(aTimerContext[timer_id].TimerIDStatus == TimerID_Running)
+ {
+ HW_TS_Stop( timer_id );
+ }
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+#endif
+
+ HAL_NVIC_DisableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Disable NVIC */
+
+ /* Disable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
+
+ aTimerContext[timer_id].TimerIDStatus = TimerID_Running;
+
+ aTimerContext[timer_id].CountLeft = timeout_ticks;
+ aTimerContext[timer_id].CounterInit = timeout_ticks;
+
+ time_elapsed = linkTimer(timer_id);
+
+ localcurrentrunningtimerid = CurrentRunningTimerID;
+
+ if(PreviousRunningTimerID != localcurrentrunningtimerid)
+ {
+ RescheduleTimerList();
+ }
+ else
+ {
+ aTimerContext[timer_id].CountLeft -= time_elapsed;
+ }
+
+ /* Enable the write protection for RTC registers */
+ __HAL_RTC_WRITEPROTECTION_ENABLE( phrtc );
+
+ HAL_NVIC_EnableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Enable NVIC */
+
+#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+#endif
+
+ return;
+}
+
+uint16_t HW_TS_RTC_ReadLeftTicksToCount(void)
+{
+ uint32_t primask_bit;
+ uint16_t return_value, auro_reload_value, elapsed_time_value;
+
+ primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */
+ __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
+
+ if((READ_BIT(RTC->CR, RTC_CR_WUTE) == (RTC_CR_WUTE)) == SET)
+ {
+ auro_reload_value = (uint32_t)(READ_BIT(RTC->WUTR, RTC_WUTR_WUT));
+
+ elapsed_time_value = ReturnTimeElapsed();
+
+ if(auro_reload_value > elapsed_time_value)
+ {
+ return_value = auro_reload_value - elapsed_time_value;
+ }
+ else
+ {
+ return_value = 0;
+ }
+ }
+ else
+ {
+ return_value = TIMER_LIST_EMPTY;
+ }
+
+ __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/
+
+ return (return_value);
+}
+
+__weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack)
+{
+ pTimerCallBack();
+
+ return;
+}
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/hw_uart.c
new file mode 100644
index 000000000..9a553610d
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/hw_uart.c
@@ -0,0 +1,318 @@
+/**
+ ******************************************************************************
+ * File Name : Src/hw_uart.c
+ * Description : HW UART source file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "hw_conf.h"
+#if (CFG_HW_LPUART1_ENABLED == 1)
+extern UART_HandleTypeDef hlpuart1;
+#endif
+#if (CFG_HW_USART1_ENABLED == 1)
+extern UART_HandleTypeDef huart1;
+#endif
+
+/* Macros --------------------------------------------------------------------*/
+#define HW_UART_RX_IT(__HANDLE__, __USART_BASE__) \
+ do{ \
+ HW_##__HANDLE__##RxCb = cb; \
+ (__HANDLE__).Instance = (__USART_BASE__); \
+ HAL_UART_Receive_IT(&(__HANDLE__), p_data, size); \
+ } while(0)
+
+#define HW_UART_TX_IT(__HANDLE__, __USART_BASE__) \
+ do{ \
+ HW_##__HANDLE__##TxCb = cb; \
+ (__HANDLE__).Instance = (__USART_BASE__); \
+ HAL_UART_Transmit_IT(&(__HANDLE__), p_data, size); \
+ } while(0)
+
+#define HW_UART_TX(__HANDLE__, __USART_BASE__) \
+ do{ \
+ (__HANDLE__).Instance = (__USART_BASE__); \
+ hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
+ } while(0)
+
+/* Variables -----------------------------------------------------------------*/
+#if (CFG_HW_USART1_ENABLED == 1)
+#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
+ DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
+#endif
+ void (*HW_huart1RxCb)(void);
+ void (*HW_huart1TxCb)(void);
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
+ DMA_HandleTypeDef HW_hdma_hlpuart1_tx ={0};
+#endif
+ void (*HW_hlpuart1RxCb)(void);
+ void (*HW_hlpuart1TxCb)(void);
+#endif
+
+void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HW_UART_RX_IT(huart1, USART1);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HW_UART_RX_IT(hlpuart1, LPUART1);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HW_UART_TX_IT(huart1, USART1);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HW_UART_TX_IT(hlpuart1, LPUART1);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
+{
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
+
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HW_UART_TX(huart1, USART1);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HW_UART_TX(hlpuart1, LPUART1);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ switch (hal_status)
+ {
+ case HAL_OK:
+ hw_status = hw_uart_ok;
+ break;
+
+ case HAL_ERROR:
+ hw_status = hw_uart_error;
+ break;
+
+ case HAL_BUSY:
+ hw_status = hw_uart_busy;
+ break;
+
+ case HAL_TIMEOUT:
+ hw_status = hw_uart_to;
+ break;
+
+ default:
+ break;
+ }
+
+ return hw_status;
+}
+
+hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
+
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HW_huart1TxCb = cb;
+ huart1.Instance = USART1;
+ hal_status = HAL_UART_Transmit_DMA(&huart1, p_data, size);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HW_hlpuart1TxCb = cb;
+ hlpuart1.Instance = LPUART1;
+ hal_status = HAL_UART_Transmit_DMA(&hlpuart1, p_data, size);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ switch (hal_status)
+ {
+ case HAL_OK:
+ hw_status = hw_uart_ok;
+ break;
+
+ case HAL_ERROR:
+ hw_status = hw_uart_error;
+ break;
+
+ case HAL_BUSY:
+ hw_status = hw_uart_busy;
+ break;
+
+ case HAL_TIMEOUT:
+ hw_status = hw_uart_to;
+ break;
+
+ default:
+ break;
+ }
+
+ return hw_status;
+}
+
+void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id)
+{
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case hw_uart1:
+ HAL_UART_IRQHandler(&huart1);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case hw_lpuart1:
+ HAL_UART_IRQHandler(&hlpuart1);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
+{
+ switch (hw_uart_id)
+ {
+#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
+ case hw_uart1:
+ HAL_DMA_IRQHandler(huart1.hdmatx);
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
+ case hw_lpuart1:
+ HAL_DMA_IRQHandler(hlpuart1.hdmatx);
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
+{
+ switch ((uint32_t)huart->Instance)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case (uint32_t)USART1:
+ if(HW_huart1RxCb)
+ {
+ HW_huart1RxCb();
+ }
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case (uint32_t)LPUART1:
+ if(HW_hlpuart1RxCb)
+ {
+ HW_hlpuart1RxCb();
+ }
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
+{
+ switch ((uint32_t)huart->Instance)
+ {
+#if (CFG_HW_USART1_ENABLED == 1)
+ case (uint32_t)USART1:
+ if(HW_huart1TxCb)
+ {
+ HW_huart1TxCb();
+ }
+ break;
+#endif
+
+#if (CFG_HW_LPUART1_ENABLED == 1)
+ case (uint32_t)LPUART1:
+ if(HW_hlpuart1TxCb)
+ {
+ HW_hlpuart1TxCb();
+ }
+ break;
+#endif
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/main.c
new file mode 100644
index 000000000..e08ffb500
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/main.c
@@ -0,0 +1,521 @@
+/**
+ ******************************************************************************
+ * @file : main.c
+ * @brief : Main program body
+ *
+ @verbatim
+ ==============================================================================
+ ##### IMPORTANT NOTE #####
+ ==============================================================================
+
+ This application requests having the stm32wb5x_Zigbee_fw.bin binary
+ flashed on the Wireless Coprocessor.
+ If it is not the case, you need to use STM32CubeProgrammer to load the appropriate
+ binary.
+
+ All available binaries are located under following directory:
+ /Projects/STM32_Copro_Wireless_Binaries
+
+ Refer to UM2237 to learn how to use/install STM32CubeProgrammer.
+ Refer to /Projects/STM32_Copro_Wireless_Binaries/ReleaseNote.html for the
+ detailed procedure to change the Wireless Coprocessor binary.
+
+ @endverbatim
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+#include "app_entry.h"
+
+/* Private includes ----------------------------------------------------------*/
+
+#include "dbg_trace.h"
+#include "hw_conf.h"
+#include "otp.h"
+#include "stm32_seq.h"
+
+/* Private variables ---------------------------------------------------------*/
+UART_HandleTypeDef hlpuart1;
+UART_HandleTypeDef huart1;
+DMA_HandleTypeDef hdma_lpuart1_tx;
+DMA_HandleTypeDef hdma_usart1_tx;
+RTC_HandleTypeDef hrtc;
+
+/* Private function prototypes -----------------------------------------------*/
+void SystemClock_Config(void);
+static void MX_GPIO_Init(void);
+static void MX_DMA_Init(void);
+void MX_LPUART1_UART_Init(void);
+void MX_USART1_UART_Init(void);
+static void MX_RF_Init(void);
+static void MX_RTC_Init(void);
+
+void PeriphClock_Config(void);
+static void Reset_Device(void);
+static void Reset_IPCC(void);
+static void Reset_BackupDomain(void);
+static void Init_Exti(void);
+static void Config_HSE(void);
+
+/**
+ * @brief The application entry point.
+ * @retval int
+ */
+int main(void)
+{
+ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
+ HAL_Init();
+
+ Reset_Device();
+ Config_HSE();
+
+ /* Configure the system clock */
+ SystemClock_Config();
+
+ PeriphClock_Config();
+ Init_Exti(); /**< Configure the system Power Mode */
+
+ /* Initialize all configured peripherals */
+ MX_GPIO_Init();
+ MX_DMA_Init();
+ MX_RF_Init();
+ MX_RTC_Init();
+
+ /* Init the full application */
+ APPE_Init();
+
+ /* Infinite loop */
+
+ while (1) {
+ UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
+
+ }
+
+}
+
+/**
+ * @brief System Clock Configuration
+ * @retval None
+ */
+void SystemClock_Config(void)
+{
+ RCC_OscInitTypeDef RCC_OscInitStruct = {0};
+ RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
+ RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
+
+ /** Configure LSE Drive Capability
+ */
+ __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
+ /** Configure the main internal regulator output voltage
+ */
+ __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
+ /** Initializes the CPU, AHB and APB busses clocks
+ */
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE
+ |RCC_OSCILLATORTYPE_LSE;
+ RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ RCC_OscInitStruct.LSEState = RCC_LSE_ON;
+ RCC_OscInitStruct.HSIState = RCC_HSI_ON;
+ RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
+ RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
+ if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /** Configure the SYSCLKSource, HCLK, PCLK1 and PCLK2 clocks dividers
+ */
+ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK4|RCC_CLOCKTYPE_HCLK2
+ |RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
+ |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
+ RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSE;
+ RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
+ RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
+ RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
+ RCC_ClkInitStruct.AHBCLK2Divider = RCC_SYSCLK_DIV1;
+ RCC_ClkInitStruct.AHBCLK4Divider = RCC_SYSCLK_DIV1;
+
+ if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /** Initializes the peripherals clocks
+ */
+ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_SMPS|RCC_PERIPHCLK_RFWAKEUP
+ |RCC_PERIPHCLK_RTC|RCC_PERIPHCLK_USART1
+ |RCC_PERIPHCLK_LPUART1;
+ PeriphClkInitStruct.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2;
+ PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1;
+ PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
+ PeriphClkInitStruct.RFWakeUpClockSelection = RCC_RFWKPCLKSOURCE_LSE;
+ PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSE;
+ PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE0;
+
+ if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
+ {
+ Error_Handler();
+ }
+}
+
+/**
+ * @brief LPUART1 Initialization Function
+ * @param None
+ * @retval None
+ */
+void MX_LPUART1_UART_Init(void)
+{
+
+ hlpuart1.Instance = LPUART1;
+ hlpuart1.Init.BaudRate = 115200;
+ hlpuart1.Init.WordLength = UART_WORDLENGTH_8B;
+ hlpuart1.Init.StopBits = UART_STOPBITS_1;
+ hlpuart1.Init.Parity = UART_PARITY_NONE;
+ hlpuart1.Init.Mode = UART_MODE_TX_RX;
+ hlpuart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
+ hlpuart1.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
+ hlpuart1.Init.ClockPrescaler = UART_PRESCALER_DIV1;
+ hlpuart1.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
+ hlpuart1.FifoMode = UART_FIFOMODE_DISABLE;
+ if (HAL_UART_Init(&hlpuart1) != HAL_OK) {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_SetTxFifoThreshold(&hlpuart1, UART_TXFIFO_THRESHOLD_1_8) != HAL_OK) {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_SetRxFifoThreshold(&hlpuart1, UART_RXFIFO_THRESHOLD_1_8) != HAL_OK) {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_DisableFifoMode(&hlpuart1) != HAL_OK) {
+ Error_Handler();
+ }
+
+}
+
+/**
+ * @brief USART1 Initialization Function
+ * @param None
+ * @retval None
+ */
+void MX_USART1_UART_Init(void)
+{
+
+ huart1.Instance = USART1;
+ huart1.Init.BaudRate = 115200;
+ huart1.Init.WordLength = UART_WORDLENGTH_8B;
+ huart1.Init.StopBits = UART_STOPBITS_1;
+ huart1.Init.Parity = UART_PARITY_NONE;
+ huart1.Init.Mode = UART_MODE_TX_RX;
+ huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
+ huart1.Init.OverSampling = UART_OVERSAMPLING_8;
+ huart1.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
+ huart1.Init.ClockPrescaler = UART_PRESCALER_DIV1;
+ huart1.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
+ if (HAL_UART_Init(&huart1) != HAL_OK) {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_SetTxFifoThreshold(&huart1, UART_TXFIFO_THRESHOLD_1_8) != HAL_OK) {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_SetRxFifoThreshold(&huart1, UART_RXFIFO_THRESHOLD_1_8) != HAL_OK) {
+ Error_Handler();
+ }
+ if (HAL_UARTEx_DisableFifoMode(&huart1) != HAL_OK) {
+ Error_Handler();
+ }
+
+}
+
+/**
+ * @brief RF Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_RF_Init(void)
+{
+
+}
+
+/**
+ * @brief RTC Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_RTC_Init(void)
+{
+
+
+ /** Initialize RTC Only
+ */
+ hrtc.Instance = RTC;
+ hrtc.Init.HourFormat = RTC_HOURFORMAT_24;
+ hrtc.Init.AsynchPrediv = CFG_RTC_ASYNCH_PRESCALER;
+ hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
+ hrtc.Init.OutPut = RTC_OUTPUT_DISABLE;
+ hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH;
+ hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;
+ if (HAL_RTC_Init(&hrtc) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /* USER CODE BEGIN RTC_Init 2 */
+
+ /* USER CODE END RTC_Init 2 */
+
+}
+
+/**
+ * Enable DMA controller clock
+ */
+static void MX_DMA_Init(void)
+{
+
+ /* DMA controller clock enable */
+ __HAL_RCC_DMAMUX1_CLK_ENABLE();
+ __HAL_RCC_DMA1_CLK_ENABLE();
+
+ /* DMA interrupt init */
+ /* DMA1_Channel1_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(DMA1_Channel1_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(DMA1_Channel1_IRQn);
+ /* DMA1_Channel2_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(DMA1_Channel2_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(DMA1_Channel2_IRQn);
+
+}
+
+/**
+ * @brief GPIO Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_GPIO_Init(void)
+{
+
+ /* GPIO Ports Clock Enable */
+ __HAL_RCC_GPIOC_CLK_ENABLE();
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+
+}
+
+/* USER CODE BEGIN 4 */
+void PeriphClock_Config(void)
+{
+ #if (CFG_USB_INTERFACE_ENABLE != 0)
+ RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
+ RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
+ LL_RCC_HSI48_Enable();
+
+ while(!LL_RCC_HSI48_IsReady());
+
+ /* Select HSI48 as USB clock source */
+ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB;
+ PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_HSI48;
+ HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
+
+ /*Configure the clock recovery system (CRS)**********************************/
+
+ /* Enable CRS Clock */
+ __HAL_RCC_CRS_CLK_ENABLE();
+
+ /* Default Synchro Signal division factor (not divided) */
+ RCC_CRSInitStruct.Prescaler = RCC_CRS_SYNC_DIV1;
+
+ /* Set the SYNCSRC[1:0] bits according to CRS_Source value */
+ RCC_CRSInitStruct.Source = RCC_CRS_SYNC_SOURCE_USB;
+
+ /* HSI48 is synchronized with USB SOF at 1KHz rate */
+ RCC_CRSInitStruct.ReloadValue = RCC_CRS_RELOADVALUE_DEFAULT;
+ RCC_CRSInitStruct.ErrorLimitValue = RCC_CRS_ERRORLIMIT_DEFAULT;
+
+ RCC_CRSInitStruct.Polarity = RCC_CRS_SYNC_POLARITY_RISING;
+
+ /* Set the TRIM[5:0] to the default value*/
+ RCC_CRSInitStruct.HSI48CalibrationValue = RCC_CRS_HSI48CALIBRATION_DEFAULT;
+
+ /* Start automatic synchronization */
+ HAL_RCCEx_CRSConfig(&RCC_CRSInitStruct);
+#endif
+
+ return;
+}
+
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+
+static void Config_HSE(void)
+{
+ OTP_ID0_t * p_otp;
+
+ /**
+ * Read HSE_Tuning from OTP
+ */
+ p_otp = (OTP_ID0_t *) OTP_Read(0);
+ if (p_otp)
+ {
+ LL_RCC_HSE_SetCapacitorTuning(p_otp->hse_tuning);
+ }
+
+ return;
+}
+
+
+static void Reset_Device( void )
+{
+#if ( CFG_HW_RESET_BY_FW == 1 )
+ Reset_BackupDomain();
+
+ Reset_IPCC();
+#endif
+
+ return;
+}
+
+static void Reset_IPCC( void )
+{
+ LL_AHB3_GRP1_EnableClock(LL_AHB3_GRP1_PERIPH_IPCC);
+
+ LL_C1_IPCC_ClearFlag_CHx(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C2_IPCC_ClearFlag_CHx(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C1_IPCC_DisableTransmitChannel(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C2_IPCC_DisableTransmitChannel(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C1_IPCC_DisableReceiveChannel(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ LL_C2_IPCC_DisableReceiveChannel(
+ IPCC,
+ LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4
+ | LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6);
+
+ return;
+}
+
+static void Reset_BackupDomain( void )
+{
+ if ((LL_RCC_IsActiveFlag_PINRST() != FALSE) && (LL_RCC_IsActiveFlag_SFTRST() == FALSE))
+ {
+ HAL_PWR_EnableBkUpAccess(); /**< Enable access to the RTC registers */
+
+ /**
+ * Write twice the value to flush the APB-AHB bridge
+ * This bit shall be written in the register before writing the next one
+ */
+ HAL_PWR_EnableBkUpAccess();
+
+ __HAL_RCC_BACKUPRESET_FORCE();
+ __HAL_RCC_BACKUPRESET_RELEASE();
+ }
+
+ return;
+}
+
+static void Init_Exti( void )
+{
+ /**< Disable all wakeup interrupt on CPU1 except IPCC(36), HSEM(38) */
+ LL_EXTI_DisableIT_0_31(~0);
+ LL_EXTI_DisableIT_32_63( (~0) & (~(LL_EXTI_LINE_36 | LL_EXTI_LINE_38)) );
+
+ return;
+}
+
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+void HAL_Delay(uint32_t Delay)
+{
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
+
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
+}
+
+/**
+ * @brief This function is executed in case of error occurrence.
+ * @retval None
+ */
+void Error_Handler(void)
+{
+
+}
+
+#ifdef USE_FULL_ASSERT
+/**
+ * @brief Reports the name of the source file and the source line number
+ * where the assert_param error has occurred.
+ * @param file: pointer to the source file name
+ * @param line: assert_param error line source number
+ * @retval None
+ */
+void assert_failed(uint8_t *file, uint32_t line)
+{
+ /* USER CODE BEGIN 6 */
+ /* User can add his own implementation to report the file name and line number,
+ tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
+ /* USER CODE END 6 */
+}
+#endif /* USE_FULL_ASSERT */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/stm32_lpm_if.c
new file mode 100644
index 000000000..f024b61e3
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/stm32_lpm_if.c
@@ -0,0 +1,275 @@
+/* USER CODE BEGIN Header */
+/**
+ ***************************************************************************************
+ * File Name : stm32_lpm_if.c
+ * Description : Low layer function to enter/exit low power modes (stop, sleep).
+ ***************************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "stm32_lpm_if.h"
+#include "stm32_lpm.h"
+#include "app_conf.h"
+/* USER CODE BEGIN include */
+
+/* USER CODE END include */
+
+/* Exported variables --------------------------------------------------------*/
+const struct UTIL_LPM_Driver_s UTIL_PowerDriver =
+{
+ PWR_EnterSleepMode,
+ PWR_ExitSleepMode,
+
+ PWR_EnterStopMode,
+ PWR_ExitStopMode,
+
+ PWR_EnterOffMode,
+ PWR_ExitOffMode,
+};
+
+/* Private function prototypes -----------------------------------------------*/
+static void Switch_On_HSI( void );
+/* USER CODE BEGIN Private_Function_Prototypes */
+
+/* USER CODE END Private_Function_Prototypes */
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN Private_Typedef */
+
+/* USER CODE END Private_Typedef */
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN Private_Define */
+
+/* USER CODE END Private_Define */
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN Private_Macro */
+
+/* USER CODE END Private_Macro */
+/* Private variables ---------------------------------------------------------*/
+/* USER CODE BEGIN Private_Variables */
+
+/* USER CODE END Private_Variables */
+
+/* Functions Definition ------------------------------------------------------*/
+/**
+ * @brief Enters Low Power Off Mode
+ * @param none
+ * @retval none
+ */
+void PWR_EnterOffMode( void )
+{
+/* USER CODE BEGIN PWR_EnterOffMode */
+ /************************************************************************************
+ * ENTER OFF MODE
+ ***********************************************************************************/
+ /*
+ * There is no risk to clear all the WUF here because in the current implementation, this API is called
+ * in critical section. If an interrupt occurs while in that critical section before that point,
+ * the flag is set and will be cleared here but the system will not enter Off Mode
+ * because an interrupt is pending in the NVIC. The ISR will be executed when moving out
+ * of this critical section
+ */
+ LL_PWR_ClearFlag_WU( );
+
+ LL_PWR_SetPowerMode( LL_PWR_MODE_STANDBY );
+
+ LL_LPM_EnableDeepSleep( ); /**< Set SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+#if defined ( __CC_ARM)
+ __force_stores( );
+#endif
+
+ __WFI( );
+/* USER CODE END PWR_EnterOffMode */
+}
+
+/**
+ * @brief Exits Low Power Off Mode
+ * @param none
+ * @retval none
+ */
+void PWR_ExitOffMode( void )
+{
+/* USER CODE BEGIN PWR_ExitOffMode */
+
+/* USER CODE END PWR_ExitOffMode */
+}
+
+/**
+ * @brief Enters Low Power Stop Mode
+ * @note ARM exists the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_EnterStopMode( void )
+{
+/* USER CODE BEGIN PWR_EnterStopMode */
+ /**
+ * This function is called from CRITICAL SECTION
+ */
+ while( LL_HSEM_1StepLock( HSEM, CFG_HW_RCC_SEMID ) );
+
+ if ( ! LL_HSEM_1StepLock( HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID ) )
+ {
+ if( LL_PWR_IsActiveFlag_C2DS( ) )
+ {
+ /* Release ENTRY_STOP_MODE semaphore */
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID, 0 );
+
+ /**
+ * The switch on HSI before entering Stop Mode is required on Cut2.0
+ * It is useless from Cut2.1
+ */
+ Switch_On_HSI( );
+ }
+ }
+ else
+ {
+ /**
+ * The switch on HSI before entering Stop Mode is required on Cut2.0
+ * It is useless from Cut2.1
+ */
+ Switch_On_HSI( );
+ }
+
+ /* Release RCC semaphore */
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_RCC_SEMID, 0 );
+
+ /************************************************************************************
+ * ENTER STOP MODE
+ ***********************************************************************************/
+ LL_PWR_SetPowerMode( LL_PWR_MODE_STOP2 );
+
+ LL_LPM_EnableDeepSleep( ); /**< Set SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+#if defined ( __CC_ARM)
+ __force_stores( );
+#endif
+
+ __WFI();
+/* USER CODE END PWR_EnterStopMode */
+}
+
+/**
+ * @brief Exits Low Power Stop Mode
+ * @note Enable the pll at 32MHz
+ * @param none
+ * @retval none
+ */
+void PWR_ExitStopMode( void )
+{
+/* USER CODE BEGIN PWR_ExitStopMode */
+ /**
+ * This function is called from CRITICAL SECTION
+ */
+
+ /* Release ENTRY_STOP_MODE semaphore */
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID, 0 );
+
+ while( LL_HSEM_1StepLock( HSEM, CFG_HW_RCC_SEMID ) );
+
+ if(LL_RCC_GetSysClkSource( ) == LL_RCC_SYS_CLKSOURCE_STATUS_HSI)
+ {
+ LL_RCC_HSE_Enable( );
+ while(!LL_RCC_HSE_IsReady( ));
+ LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_HSE);
+ while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSE);
+ }
+ else
+ {
+ /**
+ * As long as the current application is fine with HSE as system clock source,
+ * there is nothing to do here
+ */
+ }
+
+ /* Release RCC semaphore */
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_RCC_SEMID, 0 );
+/* USER CODE END PWR_ExitStopMode */
+}
+
+/**
+ * @brief Enters Low Power Sleep Mode
+ * @note ARM exits the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_EnterSleepMode( void )
+{
+/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+#if defined ( __CC_ARM)
+ __force_stores();
+#endif
+
+ __WFI( );
+/* USER CODE END PWR_EnterSleepMode */
+}
+
+/**
+ * @brief Exits Low Power Sleep Mode
+ * @note ARM exits the function when waking up
+ * @param none
+ * @retval none
+ */
+void PWR_ExitSleepMode( void )
+{
+/* USER CODE BEGIN PWR_ExitSleepMode */
+
+ HAL_ResumeTick();
+
+/* USER CODE END PWR_ExitSleepMode */
+}
+
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+/**
+ * @brief Switch the system clock on HSI
+ * @param none
+ * @retval none
+ */
+static void Switch_On_HSI( void )
+{
+ LL_RCC_HSI_Enable( );
+ while(!LL_RCC_HSI_IsReady( ));
+ LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
+ while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
+}
+
+/* USER CODE BEGIN Private_Functions */
+
+/* USER CODE END Private_Functions */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/stm32wbxx_hal_msp.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/stm32wbxx_hal_msp.c
new file mode 100644
index 000000000..9c338486d
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/stm32wbxx_hal_msp.c
@@ -0,0 +1,334 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : stm32wbxx_hal_msp.c
+ * Description : This file provides code for the MSP Initialization
+ * and de-Initialization codes.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+/* USER CODE BEGIN Includes */
+#include "app_conf.h"
+/* USER CODE END Includes */
+extern DMA_HandleTypeDef hdma_lpuart1_tx;
+
+extern DMA_HandleTypeDef hdma_usart1_tx;
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN TD */
+
+/* USER CODE END TD */
+
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN Define */
+
+/* USER CODE END Define */
+
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN Macro */
+
+/* USER CODE END Macro */
+
+/* Private variables ---------------------------------------------------------*/
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+/* USER CODE BEGIN PFP */
+
+/* USER CODE END PFP */
+
+/* External functions --------------------------------------------------------*/
+/* USER CODE BEGIN ExternalFunctions */
+
+/* USER CODE END ExternalFunctions */
+
+/* USER CODE BEGIN 0 */
+
+/* USER CODE END 0 */
+/**
+ * Initializes the Global MSP.
+ */
+void HAL_MspInit(void)
+{
+ /* USER CODE BEGIN MspInit 0 */
+
+ /* USER CODE END MspInit 0 */
+
+ __HAL_RCC_HSEM_CLK_ENABLE();
+
+ /* System interrupt init*/
+
+ /* Peripheral interrupt init */
+ /* PVD_PVM_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(PVD_PVM_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(PVD_PVM_IRQn);
+ /* FLASH_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(FLASH_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(FLASH_IRQn);
+ /* RCC_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(RCC_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(RCC_IRQn);
+ /* C2SEV_PWR_C2H_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(C2SEV_PWR_C2H_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(C2SEV_PWR_C2H_IRQn);
+ /* PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn);
+ /* HSEM_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(HSEM_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(HSEM_IRQn);
+ /* FPU_IRQn interrupt configuration */
+ HAL_NVIC_SetPriority(FPU_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(FPU_IRQn);
+
+ /* USER CODE BEGIN MspInit 1 */
+
+ /* USER CODE END MspInit 1 */
+}
+
+/**
+* @brief UART MSP Initialization
+* This function configures the hardware resources used in this example
+* @param huart: UART handle pointer
+* @retval None
+*/
+void HAL_UART_MspInit(UART_HandleTypeDef* huart)
+{
+ GPIO_InitTypeDef GPIO_InitStruct = {0};
+ if(huart->Instance==LPUART1)
+ {
+ /* USER CODE BEGIN LPUART1_MspInit 0 */
+
+ /* USER CODE END LPUART1_MspInit 0 */
+ /* Peripheral clock enable */
+ __HAL_RCC_LPUART1_CLK_ENABLE();
+
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ /**LPUART1 GPIO Configuration
+ PA2 ------> LPUART1_TX
+ PA3 ------> LPUART1_RX
+ */
+ GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_3;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ GPIO_InitStruct.Alternate = GPIO_AF8_LPUART1;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+
+ /* LPUART1 DMA Init */
+ /* LPUART1_TX Init */
+ hdma_lpuart1_tx.Instance = DMA1_Channel1;
+ hdma_lpuart1_tx.Init.Request = DMA_REQUEST_LPUART1_TX;
+ hdma_lpuart1_tx.Init.Direction = DMA_MEMORY_TO_PERIPH;
+ hdma_lpuart1_tx.Init.PeriphInc = DMA_PINC_DISABLE;
+ hdma_lpuart1_tx.Init.MemInc = DMA_MINC_ENABLE;
+ hdma_lpuart1_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
+ hdma_lpuart1_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
+ hdma_lpuart1_tx.Init.Mode = DMA_NORMAL;
+ hdma_lpuart1_tx.Init.Priority = DMA_PRIORITY_LOW;
+ if (HAL_DMA_Init(&hdma_lpuart1_tx) != HAL_OK)
+ {
+ Error_Handler();
+ }
+
+ __HAL_LINKDMA(huart,hdmatx,hdma_lpuart1_tx);
+
+ /* LPUART1 interrupt Init */
+ HAL_NVIC_SetPriority(LPUART1_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(LPUART1_IRQn);
+ /* USER CODE BEGIN LPUART1_MspInit 1 */
+
+ /* USER CODE END LPUART1_MspInit 1 */
+ }
+ else if(huart->Instance==USART1)
+ {
+ /* USER CODE BEGIN USART1_MspInit 0 */
+
+ /* USER CODE END USART1_MspInit 0 */
+ /* Peripheral clock enable */
+ __HAL_RCC_USART1_CLK_ENABLE();
+
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+ /**USART1 GPIO Configuration
+ PA11 ------> USART1_CTS
+ PB6 ------> USART1_TX
+ PB7 ------> USART1_RX
+ */
+ GPIO_InitStruct.Pin = GPIO_PIN_11;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+
+ GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
+ HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
+
+ /* USART1 DMA Init */
+ /* USART1_TX Init */
+ hdma_usart1_tx.Instance = DMA1_Channel2;
+ hdma_usart1_tx.Init.Request = DMA_REQUEST_USART1_TX;
+ hdma_usart1_tx.Init.Direction = DMA_MEMORY_TO_PERIPH;
+ hdma_usart1_tx.Init.PeriphInc = DMA_PINC_DISABLE;
+ hdma_usart1_tx.Init.MemInc = DMA_MINC_ENABLE;
+ hdma_usart1_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
+ hdma_usart1_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
+ hdma_usart1_tx.Init.Mode = DMA_NORMAL;
+ hdma_usart1_tx.Init.Priority = DMA_PRIORITY_LOW;
+ if (HAL_DMA_Init(&hdma_usart1_tx) != HAL_OK)
+ {
+ Error_Handler();
+ }
+
+ __HAL_LINKDMA(huart,hdmatx,hdma_usart1_tx);
+
+ /* USART1 interrupt Init */
+ HAL_NVIC_SetPriority(USART1_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(USART1_IRQn);
+ /* USER CODE BEGIN USART1_MspInit 1 */
+
+ /* USER CODE END USART1_MspInit 1 */
+ }
+
+}
+
+/**
+* @brief UART MSP De-Initialization
+* This function freeze the hardware resources used in this example
+* @param huart: UART handle pointer
+* @retval None
+*/
+void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
+{
+ if(huart->Instance==LPUART1)
+ {
+ /* USER CODE BEGIN LPUART1_MspDeInit 0 */
+
+ /* USER CODE END LPUART1_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_LPUART1_CLK_DISABLE();
+
+ /**LPUART1 GPIO Configuration
+ PA2 ------> LPUART1_TX
+ PA3 ------> LPUART1_RX
+ */
+ HAL_GPIO_DeInit(GPIOA, GPIO_PIN_2|GPIO_PIN_3);
+
+ /* LPUART1 DMA DeInit */
+ HAL_DMA_DeInit(huart->hdmatx);
+
+ /* LPUART1 interrupt DeInit */
+ HAL_NVIC_DisableIRQ(LPUART1_IRQn);
+ /* USER CODE BEGIN LPUART1_MspDeInit 1 */
+
+ /* USER CODE END LPUART1_MspDeInit 1 */
+ }
+ else if(huart->Instance==USART1)
+ {
+ /* USER CODE BEGIN USART1_MspDeInit 0 */
+
+ /* USER CODE END USART1_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_USART1_CLK_DISABLE();
+
+ /**USART1 GPIO Configuration
+ PA11 ------> USART1_CTS
+ PB6 ------> USART1_TX
+ PB7 ------> USART1_RX
+ */
+ HAL_GPIO_DeInit(GPIOA, GPIO_PIN_11);
+
+ HAL_GPIO_DeInit(GPIOB, GPIO_PIN_6|GPIO_PIN_7);
+
+ /* USART1 DMA DeInit */
+ HAL_DMA_DeInit(huart->hdmatx);
+
+ /* USART1 interrupt DeInit */
+ HAL_NVIC_DisableIRQ(USART1_IRQn);
+ /* USER CODE BEGIN USART1_MspDeInit 1 */
+
+ /* USER CODE END USART1_MspDeInit 1 */
+ }
+
+}
+
+/**
+* @brief RTC MSP Initialization
+* This function configures the hardware resources used in this example
+* @param hrtc: RTC handle pointer
+* @retval None
+*/
+void HAL_RTC_MspInit(RTC_HandleTypeDef* hrtc)
+{
+ if(hrtc->Instance==RTC)
+ {
+ /* USER CODE BEGIN RTC_MspInit 0 */
+ HAL_PWR_EnableBkUpAccess(); /**< Enable access to the RTC registers */
+
+ /**
+ * Write twice the value to flush the APB-AHB bridge
+ * This bit shall be written in the register before writing the next one
+ */
+ HAL_PWR_EnableBkUpAccess();
+
+ __HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSE); /**< Select LSE as RTC Input */
+
+ /* USER CODE END RTC_MspInit 0 */
+ /* Peripheral clock enable */
+ __HAL_RCC_RTC_ENABLE();
+ /* USER CODE BEGIN RTC_MspInit 1 */
+
+ MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* USER CODE END RTC_MspInit 1 */
+ }
+
+}
+
+/**
+* @brief RTC MSP De-Initialization
+* This function freeze the hardware resources used in this example
+* @param hrtc: RTC handle pointer
+* @retval None
+*/
+void HAL_RTC_MspDeInit(RTC_HandleTypeDef* hrtc)
+{
+ if(hrtc->Instance==RTC)
+ {
+ /* USER CODE BEGIN RTC_MspDeInit 0 */
+
+ /* USER CODE END RTC_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_RTC_DISABLE();
+ /* USER CODE BEGIN RTC_MspDeInit 1 */
+
+ /* USER CODE END RTC_MspDeInit 1 */
+ }
+
+}
+
+/* USER CODE BEGIN 1 */
+
+/* USER CODE END 1 */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/stm32wbxx_it.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/stm32wbxx_it.c
new file mode 100644
index 000000000..7c5536dfc
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/stm32wbxx_it.c
@@ -0,0 +1,411 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file stm32wbxx_it.c
+ * @brief Interrupt Service Routines.
+ *******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+#include "stm32wbxx_it.h"
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+#include "hw.h"
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN TD */
+
+/* USER CODE END TD */
+
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN PD */
+
+/* USER CODE END PD */
+
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private variables ---------------------------------------------------------*/
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+/* USER CODE BEGIN PFP */
+
+/* USER CODE END PFP */
+
+/* Private user code ---------------------------------------------------------*/
+/* USER CODE BEGIN 0 */
+
+/* USER CODE END 0 */
+
+/* External variables --------------------------------------------------------*/
+
+extern DMA_HandleTypeDef hdma_lpuart1_tx;
+
+extern DMA_HandleTypeDef hdma_usart1_tx;
+
+extern UART_HandleTypeDef hlpuart1;
+
+extern UART_HandleTypeDef huart1;
+
+/* USER CODE BEGIN EV */
+
+/* USER CODE END EV */
+
+/******************************************************************************/
+/* Cortex Processor Interruption and Exception Handlers */
+/******************************************************************************/
+/**
+ * @brief This function handles Non maskable interrupt.
+ */
+void NMI_Handler(void)
+{
+ /* USER CODE BEGIN NonMaskableInt_IRQn 0 */
+
+ /* USER CODE END NonMaskableInt_IRQn 0 */
+ /* USER CODE BEGIN NonMaskableInt_IRQn 1 */
+
+ /* USER CODE END NonMaskableInt_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Hard fault interrupt.
+ */
+void HardFault_Handler(void)
+{
+ /* USER CODE BEGIN HardFault_IRQn 0 */
+
+ /* USER CODE END HardFault_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_HardFault_IRQn 0 */
+ /* USER CODE END W1_HardFault_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles Memory management fault.
+ */
+void MemManage_Handler(void)
+{
+ /* USER CODE BEGIN MemoryManagement_IRQn 0 */
+
+ /* USER CODE END MemoryManagement_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */
+ /* USER CODE END W1_MemoryManagement_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles Prefetch fault, memory access fault.
+ */
+void BusFault_Handler(void)
+{
+ /* USER CODE BEGIN BusFault_IRQn 0 */
+
+ /* USER CODE END BusFault_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_BusFault_IRQn 0 */
+ /* USER CODE END W1_BusFault_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles Undefined instruction or illegal state.
+ */
+void UsageFault_Handler(void)
+{
+ /* USER CODE BEGIN UsageFault_IRQn 0 */
+
+ /* USER CODE END UsageFault_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_UsageFault_IRQn 0 */
+ /* USER CODE END W1_UsageFault_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles System service call via SWI instruction.
+ */
+void SVC_Handler(void)
+{
+ /* USER CODE BEGIN SVCall_IRQn 0 */
+
+ /* USER CODE END SVCall_IRQn 0 */
+ /* USER CODE BEGIN SVCall_IRQn 1 */
+
+ /* USER CODE END SVCall_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Debug monitor.
+ */
+void DebugMon_Handler(void)
+{
+ /* USER CODE BEGIN DebugMonitor_IRQn 0 */
+
+ /* USER CODE END DebugMonitor_IRQn 0 */
+ /* USER CODE BEGIN DebugMonitor_IRQn 1 */
+
+ /* USER CODE END DebugMonitor_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Pendable request for system service.
+ */
+void PendSV_Handler(void)
+{
+ /* USER CODE BEGIN PendSV_IRQn 0 */
+
+ /* USER CODE END PendSV_IRQn 0 */
+ /* USER CODE BEGIN PendSV_IRQn 1 */
+
+ /* USER CODE END PendSV_IRQn 1 */
+}
+
+/**
+ * @brief This function handles System tick timer.
+ */
+void SysTick_Handler(void)
+{
+ /* USER CODE BEGIN SysTick_IRQn 0 */
+
+ /* USER CODE END SysTick_IRQn 0 */
+ HAL_IncTick();
+ /* USER CODE BEGIN SysTick_IRQn 1 */
+
+ /* USER CODE END SysTick_IRQn 1 */
+}
+
+/******************************************************************************/
+/* STM32WBxx Peripheral Interrupt Handlers */
+/* Add here the Interrupt Handlers for the used peripherals. */
+/* For the available peripheral interrupt handler names, */
+/* please refer to the startup file (startup_stm32wbxx.s). */
+/******************************************************************************/
+
+/**
+ * @brief This function handles PVD/PVM0/PVM2 interrupts through EXTI lines 16/31/33.
+ */
+void PVD_PVM_IRQHandler(void)
+{
+ /* USER CODE BEGIN PVD_PVM_IRQn 0 */
+
+ /* USER CODE END PVD_PVM_IRQn 0 */
+ HAL_PWREx_PVD_PVM_IRQHandler();
+ /* USER CODE BEGIN PVD_PVM_IRQn 1 */
+
+ /* USER CODE END PVD_PVM_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Flash global interrupt.
+ */
+void FLASH_IRQHandler(void)
+{
+ /* USER CODE BEGIN FLASH_IRQn 0 */
+
+ /* USER CODE END FLASH_IRQn 0 */
+ HAL_FLASH_IRQHandler();
+ /* USER CODE BEGIN FLASH_IRQn 1 */
+
+ /* USER CODE END FLASH_IRQn 1 */
+}
+
+/**
+ * @brief This function handles RCC global interrupt.
+ */
+void RCC_IRQHandler(void)
+{
+ /* USER CODE BEGIN RCC_IRQn 0 */
+
+ /* USER CODE END RCC_IRQn 0 */
+ /* USER CODE BEGIN RCC_IRQn 1 */
+
+ /* USER CODE END RCC_IRQn 1 */
+}
+
+/**
+ * @brief This function handles DMA1 channel1 global interrupt.
+ */
+void DMA1_Channel1_IRQHandler(void)
+{
+ /* USER CODE BEGIN DMA1_Channel1_IRQn 0 */
+
+ /* USER CODE END DMA1_Channel1_IRQn 0 */
+ HAL_DMA_IRQHandler(&hdma_lpuart1_tx);
+ /* USER CODE BEGIN DMA1_Channel1_IRQn 1 */
+
+ /* USER CODE END DMA1_Channel1_IRQn 1 */
+}
+
+/**
+ * @brief This function handles DMA1 channel2 global interrupt.
+ */
+void DMA1_Channel2_IRQHandler(void)
+{
+ /* USER CODE BEGIN DMA1_Channel2_IRQn 0 */
+
+ /* USER CODE END DMA1_Channel2_IRQn 0 */
+ HAL_DMA_IRQHandler(&hdma_usart1_tx);
+ /* USER CODE BEGIN DMA1_Channel2_IRQn 1 */
+
+ /* USER CODE END DMA1_Channel2_IRQn 1 */
+}
+
+/**
+ * @brief This function handles CPU2 SEV interrupt through EXTI line 40 and PWR CPU2 HOLD wake-up interrupt.
+ */
+void C2SEV_PWR_C2H_IRQHandler(void)
+{
+ /* USER CODE BEGIN C2SEV_PWR_C2H_IRQn 0 */
+
+ /* USER CODE END C2SEV_PWR_C2H_IRQn 0 */
+ /* USER CODE BEGIN C2SEV_PWR_C2H_IRQn 1 */
+
+ /* USER CODE END C2SEV_PWR_C2H_IRQn 1 */
+}
+
+/**
+ * @brief This function handles USART1 global interrupt.
+ */
+void USART1_IRQHandler(void)
+{
+ /* USER CODE BEGIN USART1_IRQn 0 */
+
+ /* USER CODE END USART1_IRQn 0 */
+ HAL_UART_IRQHandler(&huart1);
+ /* USER CODE BEGIN USART1_IRQn 1 */
+
+ /* USER CODE END USART1_IRQn 1 */
+}
+
+/**
+ * @brief This function handles LPUART1 global interrupt.
+ */
+void LPUART1_IRQHandler(void)
+{
+ /* USER CODE BEGIN LPUART1_IRQn 0 */
+
+ /* USER CODE END LPUART1_IRQn 0 */
+ HAL_UART_IRQHandler(&hlpuart1);
+ /* USER CODE BEGIN LPUART1_IRQn 1 */
+
+ /* USER CODE END LPUART1_IRQn 1 */
+}
+
+/**
+ * @brief This function handles PWR switching on the fly, end of BLE activity, end of 802.15.4 activity, end of critical radio phase interrupt.
+ */
+void PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler(void)
+{
+ /* USER CODE BEGIN PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn 0 */
+
+ /* USER CODE END PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn 0 */
+ /* USER CODE BEGIN PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn 1 */
+
+ /* USER CODE END PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn 1 */
+}
+
+/**
+ * @brief This function handles HSEM global interrupt.
+ */
+void HSEM_IRQHandler(void)
+{
+ /* USER CODE BEGIN HSEM_IRQn 0 */
+
+ /* USER CODE END HSEM_IRQn 0 */
+ HAL_HSEM_IRQHandler();
+ /* USER CODE BEGIN HSEM_IRQn 1 */
+
+ /* USER CODE END HSEM_IRQn 1 */
+}
+
+/**
+ * @brief This function handles FPU global interrupt.
+ */
+void FPU_IRQHandler(void)
+{
+ /* USER CODE BEGIN FPU_IRQn 0 */
+
+ /* USER CODE END FPU_IRQn 0 */
+ /* USER CODE BEGIN FPU_IRQn 1 */
+
+ /* USER CODE END FPU_IRQn 1 */
+}
+
+/* USER CODE BEGIN 1 */
+void RTC_WKUP_IRQHandler(void)
+{
+ HW_TS_RTC_Wakeup_Handler();
+}
+
+/**
+ * @brief This function handles External External line 4 interrupt request.
+ * @param None
+ * @retval None
+ */
+void EXTI4_IRQHandler(void)
+{
+ HAL_GPIO_EXTI_IRQHandler(BUTTON_SW1_PIN);
+}
+
+/**
+ * @brief This function handles External External line 0 interrupt request.
+ * @param None
+ * @retval None
+ */
+void EXTI0_IRQHandler(void)
+{
+ HAL_GPIO_EXTI_IRQHandler(BUTTON_SW2_PIN);
+}
+
+/**
+ * @brief This function handles External External line 1 interrupt request.
+ * @param None
+ * @retval None
+ */
+void EXTI1_IRQHandler(void)
+{
+ HAL_GPIO_EXTI_IRQHandler(BUTTON_SW3_PIN);
+}
+
+void
+IPCC_C1_TX_IRQHandler(void)
+{
+ HW_IPCC_Tx_Handler();
+
+ return;
+}
+
+void
+IPCC_C1_RX_IRQHandler(void)
+{
+ HW_IPCC_Rx_Handler();
+ return;
+}
+
+/* USER CODE END 1 */
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/stm_logging.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/stm_logging.c
new file mode 100644
index 000000000..c24b86dd8
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/stm_logging.c
@@ -0,0 +1,205 @@
+/**
+ ******************************************************************************
+ * File Name : stm_logging.c
+ * Description : This file contains all the defines and functions used
+ * for logging on Application examples.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/**
+ * @file
+ * This file implements logging functions to be used in Application examples.
+ *
+ */
+
+#include <ctype.h>
+#include <inttypes.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <string.h>
+
+#include "app_conf.h"
+#include "stm_logging.h"
+
+#define LOG_PARSE_BUFFER_SIZE 256U
+
+#define LOG_TIMESTAMP_ENABLE 0
+#define LOG_REGION_ENABLE 1U
+#define LOG_RTT_COLOR_ENABLE 1U
+
+#if (LOG_RTT_COLOR_ENABLE == 1U)
+#define RTT_COLOR_CODE_DEFAULT "\x1b[0m"
+#define RTT_COLOR_CODE_RED "\x1b[0;91m"
+#define RTT_COLOR_CODE_GREEN "\x1b[0;92m"
+#define RTT_COLOR_CODE_YELLOW "\x1b[0;93m"
+#define RTT_COLOR_CODE_CYAN "\x1b[0;96m"
+
+#else /* LOG_RTT_COLOR_ENABLE == 1 */
+#define RTT_COLOR_CODE_DEFAULT ""
+#define RTT_COLOR_CODE_RED ""
+#define RTT_COLOR_CODE_GREEN ""
+#define RTT_COLOR_CODE_YELLOW ""
+#define RTT_COLOR_CODE_CYAN ""
+#endif /* LOG_RTT_COLOR_ENABLE == 1 */
+
+#define LOG_MSG_SZ_MAX 256
+
+#if (CFG_DEBUG_TRACE != 0)
+/**
+ * Function for outputting code region string.
+ *
+ * @param[inout] aLogString Pointer to log buffer.
+ * @param[in] aMaxSize Maximum size of log buffer.
+ * @param[in] otLogRegion The region ID.
+ *
+ * @returns String with a log level color value.
+ */
+static inline uint16_t
+logRegion(char *aLogString, uint16_t aMaxSize,
+ appliLogRegion_t aLogRegion)
+{
+ char logRegionString[30U];
+
+ switch (aLogRegion) {
+ case APPLI_LOG_REGION_GENERAL:
+ strcpy(logRegionString, "[M4 APPLICATION]");
+ break;
+ case APPLI_LOG_REGION_ZIGBEE_API:
+ strcpy(logRegionString, "[M4 ZIGBEE API]");
+ break;
+ default:
+ strcpy(logRegionString, "[M4]");
+ break;
+ }
+
+ return snprintf(aLogString, aMaxSize, "%s ", logRegionString);
+}
+
+#endif /* CFG_DEBUG_TRACE */
+
+#if (LOG_RTT_COLOR_ENABLE == 1U)
+#if (CFG_DEBUG_TRACE != 0)
+/**
+ * Function for getting color of a given level log.
+ *
+ * @param[in] aLogLevel The log level.
+ *
+ * @returns String with a log level color value.
+ */
+static inline const char *levelToString(appliLogLevel_t aLogLevel)
+{
+ switch (aLogLevel)
+ {
+ case LOG_LEVEL_CRIT:
+ return RTT_COLOR_CODE_RED;
+
+ case LOG_LEVEL_WARN:
+ return RTT_COLOR_CODE_YELLOW;
+
+ case LOG_LEVEL_INFO:
+ return RTT_COLOR_CODE_GREEN;
+
+ case LOG_LEVEL_DEBG:
+ default:
+ return RTT_COLOR_CODE_DEFAULT;
+ }
+}
+#endif /* CFG_DEBUG_TRACE */
+
+#if (CFG_DEBUG_TRACE != 0)
+/**
+ * Function for printing log level.
+ *
+ * @param[inout] aLogString Pointer to log buffer.
+ * @param[in] aMaxSize Maximum size of log buffer.
+ * @param[in] aLogLevel Log level.
+ *
+ * @returns Number of bytes successfully written to the log buffer.
+ */
+static inline uint16_t logLevel(char *aLogString, uint16_t aMaxSize,
+ appliLogLevel_t aLogLevel)
+{
+ return snprintf(aLogString, aMaxSize, "%s", levelToString(aLogLevel));
+}
+#endif /* CFG_DEBUG_TRACE */
+#endif /* LOG_RTT_COLOR_ENABLE */
+
+#if (LOG_TIMESTAMP_ENABLE == 1U)
+/**
+ * Function for printing actual timestamp.
+ *
+ * @param[inout] aLogString Pointer to the log buffer.
+ * @param[in] aMaxSize Maximum size of the log buffer.
+ *
+ * @returns Number of bytes successfully written to the log buffer.
+ */
+static inline uint16_t logTimestamp(char *aLogString, uint16_t aMaxSize)
+{
+ return snprintf(aLogString, aMaxSize, "%s[%010ld]", RTT_COLOR_CODE_DEFAULT,
+ otPlatAlarmMilliGetNow());
+}
+#endif /* LOG_TIMESTAMP_ENABLE */
+
+/**
+ * Function for printing application log
+ *
+ * @param[in] aLogLevel Log level.
+ * @param[in] aLogRegion The region ID.
+ * @param[in] aFormat User string format.
+ *
+ * @returns Number of bytes successfully written to the log buffer.
+ */
+void logApplication(appliLogLevel_t aLogLevel, appliLogRegion_t aLogRegion, const char *aFormat, ...)
+{
+#if (CFG_DEBUG_TRACE != 0) /* Since the traces are disabled, there is nothing to print */
+ uint16_t length = 0;
+ char logString[LOG_PARSE_BUFFER_SIZE + 1U];
+
+#if (LOG_TIMESTAMP_ENABLE == 1U)
+ length += logTimestamp(logString, LOG_PARSE_BUFFER_SIZE);
+#endif
+
+#if (LOG_RTT_COLOR_ENABLE == 1U)
+ /* Add level information */
+ length += logLevel(&logString[length], (LOG_PARSE_BUFFER_SIZE - length),
+ aLogLevel);
+#endif
+
+#if (LOG_REGION_ENABLE == 1U)
+ /* Add Region information */
+ length += logRegion(&logString[length], (LOG_PARSE_BUFFER_SIZE - length),
+ aLogRegion);
+#endif
+
+ /* Parse user string */
+ va_list paramList;
+ va_start(paramList, aFormat);
+ length += vsnprintf(&logString[length], (LOG_PARSE_BUFFER_SIZE - length),
+ aFormat, paramList);
+ logString[length++] = '\r';
+ logString[length++] = '\n';
+ logString[length++] = 0;
+ va_end(paramList);
+
+ if (aLogLevel <= APPLI_CONFIG_LOG_LEVEL)
+ {
+ printf("%s", logString);
+ }else
+ {
+ /* Print nothing */
+ }
+#endif /* CFG_DEBUG_TRACE */
+}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/system_stm32wbxx.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/system_stm32wbxx.c
new file mode 100644
index 000000000..d4653a0ce
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/Core/Src/system_stm32wbxx.c
@@ -0,0 +1,353 @@
+/**
+ ******************************************************************************
+ * @file system_stm32wbxx.c
+ * @author MCD Application Team
+ * @brief CMSIS Cortex Device Peripheral Access Layer System Source File
+ *
+ * This file provides two functions and one global variable to be called from
+ * user application:
+ * - SystemInit(): This function is called at startup just after reset and
+ * before branch to main program. This call is made inside
+ * the "startup_stm32wbxx.s" file.
+ *
+ * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used
+ * by the user application to setup the SysTick
+ * timer or configure other parameters.
+ *
+ * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must
+ * be called whenever the core clock is changed
+ * during program execution.
+ *
+ * After each device reset the MSI (4 MHz) is used as system clock source.
+ * Then SystemInit() function is called, in "startup_stm32wbxx.s" file, to
+ * configure the system clock before to branch to main program.
+ *
+ * This file configures the system clock as follows:
+ *=============================================================================
+ *-----------------------------------------------------------------------------
+ * System Clock source | MSI
+ *-----------------------------------------------------------------------------
+ * SYSCLK(Hz) | 4000000
+ *-----------------------------------------------------------------------------
+ * HCLK(Hz) | 4000000
+ *-----------------------------------------------------------------------------
+ * AHB Prescaler | 1
+ *-----------------------------------------------------------------------------
+ * APB1 Prescaler | 1
+ *-----------------------------------------------------------------------------
+ * APB2 Prescaler | 1
+ *-----------------------------------------------------------------------------
+ * PLL_M | 1
+ *-----------------------------------------------------------------------------
+ * PLL_N | 8
+ *-----------------------------------------------------------------------------
+ * PLL_P | 7
+ *-----------------------------------------------------------------------------
+ * PLL_Q | 2
+ *-----------------------------------------------------------------------------
+ * PLL_R | 2
+ *-----------------------------------------------------------------------------
+ * PLLSAI1_P | NA
+ *-----------------------------------------------------------------------------
+ * PLLSAI1_Q | NA
+ *-----------------------------------------------------------------------------
+ * PLLSAI1_R | NA
+ *-----------------------------------------------------------------------------
+ * Require 48MHz for USB OTG FS, | Disabled
+ * SDIO and RNG clock |
+ *-----------------------------------------------------------------------------
+ *=============================================================================
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+ *
+ ******************************************************************************
+ */
+
+/** @addtogroup CMSIS
+ * @{
+ */
+
+/** @addtogroup stm32WBxx_system
+ * @{
+ */
+
+/** @addtogroup stm32WBxx_System_Private_Includes
+ * @{
+ */
+
+#include "stm32wbxx.h"
+
+#if !defined (HSE_VALUE)
+ #define HSE_VALUE (32000000UL) /*!< Value of the External oscillator in Hz */
+#endif /* HSE_VALUE */
+
+#if !defined (MSI_VALUE)
+ #define MSI_VALUE (4000000UL) /*!< Value of the Internal oscillator in Hz*/
+#endif /* MSI_VALUE */
+
+#if !defined (HSI_VALUE)
+ #define HSI_VALUE (16000000UL) /*!< Value of the Internal oscillator in Hz*/
+#endif /* HSI_VALUE */
+
+#if !defined (LSI_VALUE)
+ #define LSI_VALUE (32000UL) /*!< Value of LSI in Hz*/
+#endif /* LSI_VALUE */
+
+#if !defined (LSE_VALUE)
+ #define LSE_VALUE (32768UL) /*!< Value of LSE in Hz*/
+#endif /* LSE_VALUE */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_TypesDefinitions
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_Defines
+ * @{
+ */
+
+/*!< Uncomment the following line if you need to relocate your vector Table in
+ Internal SRAM. */
+/* #define VECT_TAB_SRAM */
+#define VECT_TAB_OFFSET 0x0U /*!< Vector Table base offset field.
+ This value must be a multiple of 0x200. */
+
+#define VECT_TAB_BASE_ADDRESS SRAM1_BASE /*!< Vector Table base offset field.
+ This value must be a multiple of 0x200. */
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_Macros
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_Variables
+ * @{
+ */
+ /* The SystemCoreClock variable is updated in three ways:
+ 1) by calling CMSIS function SystemCoreClockUpdate()
+ 2) by calling HAL API function HAL_RCC_GetHCLKFreq()
+ 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
+ Note: If you use this function to configure the system clock; then there
+ is no need to call the 2 first functions listed above, since SystemCoreClock
+ variable is updated automatically.
+ */
+ uint32_t SystemCoreClock = 4000000UL ; /*CPU1: M4 on MSI clock after startup (4MHz)*/
+
+ const uint32_t AHBPrescTable[16UL] = {1UL, 3UL, 5UL, 1UL, 1UL, 6UL, 10UL, 32UL, 2UL, 4UL, 8UL, 16UL, 64UL, 128UL, 256UL, 512UL};
+
+ const uint32_t APBPrescTable[8UL] = {0UL, 0UL, 0UL, 0UL, 1UL, 2UL, 3UL, 4UL};
+
+ const uint32_t MSIRangeTable[16UL] = {100000UL, 200000UL, 400000UL, 800000UL, 1000000UL, 2000000UL, \
+ 4000000UL, 8000000UL, 16000000UL, 24000000UL, 32000000UL, 48000000UL, 0UL, 0UL, 0UL, 0UL}; /* 0UL values are incorrect cases */
+
+ const uint32_t SmpsPrescalerTable[4UL][6UL]={{1UL,3UL,2UL,2UL,1UL,2UL}, \
+ {2UL,6UL,4UL,3UL,2UL,4UL}, \
+ {4UL,12UL,8UL,6UL,4UL,8UL}, \
+ {4UL,12UL,8UL,6UL,4UL,8UL}};
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_FunctionPrototypes
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32WBxx_System_Private_Functions
+ * @{
+ */
+
+/**
+ * @brief Setup the microcontroller system.
+ * @param None
+ * @retval None
+ */
+void SystemInit(void)
+{
+ /* Configure the Vector Table location add offset address ------------------*/
+#if defined(VECT_TAB_SRAM) && defined(VECT_TAB_BASE_ADDRESS)
+ /* program in SRAMx */
+ SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAMx for CPU1 */
+#else /* program in FLASH */
+ SCB->VTOR = VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
+#endif
+
+ /* FPU settings ------------------------------------------------------------*/
+ #if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
+ SCB->CPACR |= ((3UL << (10UL*2UL))|(3UL << (11UL*2UL))); /* set CP10 and CP11 Full Access */
+ #endif
+
+ /* Reset the RCC clock configuration to the default reset state ------------*/
+ /* Set MSION bit */
+ RCC->CR |= RCC_CR_MSION;
+
+ /* Reset CFGR register */
+ RCC->CFGR = 0x00070000U;
+
+ /* Reset PLLSAI1ON, PLLON, HSECSSON, HSEON, HSION, and MSIPLLON bits */
+ RCC->CR &= (uint32_t)0xFAF6FEFBU;
+
+ /*!< Reset LSI1 and LSI2 bits */
+ RCC->CSR &= (uint32_t)0xFFFFFFFAU;
+
+ /*!< Reset HSI48ON bit */
+ RCC->CRRCR &= (uint32_t)0xFFFFFFFEU;
+
+ /* Reset PLLCFGR register */
+ RCC->PLLCFGR = 0x22041000U;
+
+ /* Reset PLLSAI1CFGR register */
+ RCC->PLLSAI1CFGR = 0x22041000U;
+
+ /* Reset HSEBYP bit */
+ RCC->CR &= 0xFFFBFFFFU;
+
+ /* Disable all interrupts */
+ RCC->CIER = 0x00000000;
+}
+
+/**
+ * @brief Update SystemCoreClock variable according to Clock Register Values.
+ * The SystemCoreClock variable contains the core clock (HCLK), it can
+ * be used by the user application to setup the SysTick timer or configure
+ * other parameters.
+ *
+ * @note Each time the core clock (HCLK) changes, this function must be called
+ * to update SystemCoreClock variable value. Otherwise, any configuration
+ * based on this variable will be incorrect.
+ *
+ * @note - The system frequency computed by this function is not the real
+ * frequency in the chip. It is calculated based on the predefined
+ * constant and the selected clock source:
+ *
+ * - If SYSCLK source is MSI, SystemCoreClock will contain the MSI_VALUE(*)
+ *
+ * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(**)
+ *
+ * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(***)
+ *
+ * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(***)
+ * or HSI_VALUE(*) or MSI_VALUE(*) multiplied/divided by the PLL factors.
+ *
+ * (*) MSI_VALUE is a constant defined in stm32wbxx_hal.h file (default value
+ * 4 MHz) but the real value may vary depending on the variations
+ * in voltage and temperature.
+ *
+ * (**) HSI_VALUE is a constant defined in stm32wbxx_hal_conf.h file (default value
+ * 16 MHz) but the real value may vary depending on the variations
+ * in voltage and temperature.
+ *
+ * (***) HSE_VALUE is a constant defined in stm32wbxx_hal_conf.h file (default value
+ * 32 MHz), user has to ensure that HSE_VALUE is same as the real
+ * frequency of the crystal used. Otherwise, this function may
+ * have wrong result.
+ *
+ * - The result of this function could be not correct when using fractional
+ * value for HSE crystal.
+ *
+ * @param None
+ * @retval None
+ */
+void SystemCoreClockUpdate(void)
+{
+ uint32_t tmp, msirange, pllvco, pllr, pllsource , pllm;
+
+ /* Get MSI Range frequency--------------------------------------------------*/
+
+ /*MSI frequency range in Hz*/
+ msirange = MSIRangeTable[(RCC->CR & RCC_CR_MSIRANGE) >> RCC_CR_MSIRANGE_Pos];
+
+ /* Get SYSCLK source -------------------------------------------------------*/
+ switch (RCC->CFGR & RCC_CFGR_SWS)
+ {
+ case 0x00: /* MSI used as system clock source */
+ SystemCoreClock = msirange;
+ break;
+
+ case 0x04: /* HSI used as system clock source */
+ /* HSI used as system clock source */
+ SystemCoreClock = HSI_VALUE;
+ break;
+
+ case 0x08: /* HSE used as system clock source */
+ SystemCoreClock = HSE_VALUE;
+ break;
+
+ case 0x0C: /* PLL used as system clock source */
+ /* PLL_VCO = (HSE_VALUE or HSI_VALUE or MSI_VALUE/ PLLM) * PLLN
+ SYSCLK = PLL_VCO / PLLR
+ */
+ pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC);
+ pllm = ((RCC->PLLCFGR & RCC_PLLCFGR_PLLM) >> RCC_PLLCFGR_PLLM_Pos) + 1UL ;
+
+ if(pllsource == 0x02UL) /* HSI used as PLL clock source */
+ {
+ pllvco = (HSI_VALUE / pllm);
+ }
+ else if(pllsource == 0x03UL) /* HSE used as PLL clock source */
+ {
+ pllvco = (HSE_VALUE / pllm);
+ }
+ else /* MSI used as PLL clock source */
+ {
+ pllvco = (msirange / pllm);
+ }
+
+ pllvco = pllvco * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> RCC_PLLCFGR_PLLN_Pos);
+ pllr = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLR) >> RCC_PLLCFGR_PLLR_Pos) + 1UL);
+
+ SystemCoreClock = pllvco/pllr;
+ break;
+
+ default:
+ SystemCoreClock = msirange;
+ break;
+ }
+
+ /* Compute HCLK clock frequency --------------------------------------------*/
+ /* Get HCLK1 prescaler */
+ tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> RCC_CFGR_HPRE_Pos)];
+ /* HCLK clock frequency */
+ SystemCoreClock = SystemCoreClock / tmp;
+
+}
+
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/EWARM/Project.eww b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/EWARM/Project.eww
new file mode 100644
index 000000000..1cbded401
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/EWARM/Project.eww
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workspace>
+ <project>
+ <path>$WS_DIR$\Zigbee_OnOff_Router.ewp</path>
+ </project>
+ <batchBuild />
+</workspace>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/EWARM/Zigbee_OnOff_Router.ewd b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/EWARM/Zigbee_OnOff_Router.ewd
new file mode 100644
index 000000000..ab238be30
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/EWARM/Zigbee_OnOff_Router.ewd
@@ -0,0 +1,1419 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <fileVersion>3</fileVersion>
+ <configuration>
+ <name>Zigbee_OnOff_Router</name>
+ <toolchain>
+ <name>ARM</name>
+ </toolchain>
+ <debug>1</debug>
+ <settings>
+ <name>C-SPY</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>29</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CInput</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CEndian</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCVariant</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>MemOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MemFile</name>
+ <state>$TOOLKIT_DIR$\CONFIG\debugger\ST\STM32WB_M4.ddf</state>
+ </option>
+ <option>
+ <name>RunToEnable</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RunToName</name>
+ <state>main</state>
+ </option>
+ <option>
+ <name>CExtraOptionsCheck</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CExtraOptions</name>
+ <state>--stlink_use_server</state>
+ </option>
+ <option>
+ <name>CFpuProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCDDFArgumentProducer</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCDownloadSuppressDownload</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCDownloadVerifyAll</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCProductVersion</name>
+ <state>8.20.2.14834</state>
+ </option>
+ <option>
+ <name>OCDynDriverList</name>
+ <state>STLINK_ID</state>
+ </option>
+ <option>
+ <name>OCLastSavedByProductVersion</name>
+ <state>8.20.2.14834</state>
+ </option>
+ <option>
+ <name>UseFlashLoader</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CLowLevel</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCBE8Slave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>MacFile2</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CDevice</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>FlashLoadersV3</name>
+ <state>$TOOLKIT_DIR$\config\flashloader\ST\FlashSTM32WB_M4.board</state>
+ </option>
+ <option>
+ <name>OCImagesSuppressCheck1</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesPath1</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCImagesSuppressCheck2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesPath2</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCImagesSuppressCheck3</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesPath3</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OverrideDefFlashBoard</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesOffset1</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCImagesOffset2</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCImagesOffset3</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCImagesUse1</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesUse2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCImagesUse3</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCDeviceConfigMacroFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCDebuggerExtraOption</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCAllMTBOptions</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCMulticoreNrOfCores</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCMulticoreMaster</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCMulticorePort</name>
+ <state>53461</state>
+ </option>
+ <option>
+ <name>OCMulticoreWorkspace</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCMulticoreSlaveProject</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCMulticoreSlaveConfiguration</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCDownloadExtraImage</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCAttachSlave</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MassEraseBeforeFlashing</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>ARMSIM_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>1</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCSimDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCSimEnablePSP</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCSimPspOverrideConfig</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCSimPspConfigFile</name>
+ <state></state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>CADI_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CCadiMemory</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>Fast Model</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCADILogFileCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCADILogFileEditB</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>CMSISDAP_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>4</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCIarProbeScriptFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CMSISDAPResetList</name>
+ <version>1</version>
+ <state>10</state>
+ </option>
+ <option>
+ <name>CMSISDAPHWResetDuration</name>
+ <state>300</state>
+ </option>
+ <option>
+ <name>CMSISDAPHWResetDelay</name>
+ <state>200</state>
+ </option>
+ <option>
+ <name>CMSISDAPDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CMSISDAPInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPMultiTargetEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPMultiTarget</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPJtagSpeedList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPBreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPRestoreBreakpointsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPUpdateBreakpointsEdit</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>RDICatchReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchUndef</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchSWI</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchData</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchPrefetch</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchIRQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchFIQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CatchMMERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchNOCPERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchCHKERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchSTATERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchBUSERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchINTERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchSFERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchHARDERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPMultiCPUEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPMultiCPUNumber</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCProbeCfgOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCProbeConfig</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CMSISDAPProbeConfigRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CMSISDAPSelectedCPUBehaviour</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ICpuName</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCJetEmuParams</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCCMSISDAPUsbSerialNo</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCCMSISDAPUsbSerialNoSelect</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>GDBSERVER_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>TCPIP</name>
+ <state>aaa.bbb.ccc.ddd</state>
+ </option>
+ <option>
+ <name>DoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>LogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCJTagBreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJTagDoUpdateBreakpoints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJTagUpdateBreakpoints</name>
+ <state>_call_main</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>IJET_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>8</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OCIarProbeScriptFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IjetResetList</name>
+ <version>1</version>
+ <state>10</state>
+ </option>
+ <option>
+ <name>IjetHWResetDuration</name>
+ <state>300</state>
+ </option>
+ <option>
+ <name>IjetHWResetDelay</name>
+ <state>200</state>
+ </option>
+ <option>
+ <name>IjetPowerFromProbe</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IjetPowerRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>IjetInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetMultiTargetEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetMultiTarget</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetScanChainNonARMDevices</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetIRLength</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetJtagSpeedList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetProtocolRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetSwoPin</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetCpuClockEdit</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IjetSwoPrescalerList</name>
+ <version>1</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetBreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetRestoreBreakpointsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetUpdateBreakpointsEdit</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>RDICatchReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchUndef</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchSWI</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchData</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchPrefetch</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RDICatchIRQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>RDICatchFIQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CatchMMERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchNOCPERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchCHKERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchSTATERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchBUSERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchINTERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchSFERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchHARDERR</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCProbeCfgOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCProbeConfig</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IjetProbeConfigRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetMultiCPUEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetMultiCPUNumber</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetSelectedCPUBehaviour</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ICpuName</name>
+ <state></state>
+ </option>
+ <option>
+ <name>OCJetEmuParams</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IjetPreferETB</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IjetTraceSettingsList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IjetTraceSizeList</name>
+ <version>0</version>
+ <state>4</state>
+ </option>
+ <option>
+ <name>FlashBoardPathSlave</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCIjetUsbSerialNo</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCIjetUsbSerialNoSelect</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>JLINK_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>16</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>JLinkSpeed</name>
+ <state>1000</state>
+ </option>
+ <option>
+ <name>CCJLinkDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCJLinkHWResetDelay</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>JLinkInitialSpeed</name>
+ <state>1000</state>
+ </option>
+ <option>
+ <name>CCDoJlinkMultiTarget</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCScanChainNonARMDevices</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkMultiTarget</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkIRLength</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkCommRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkTCPIP</name>
+ <state>aaa.bbb.ccc.ddd</state>
+ </option>
+ <option>
+ <name>CCJLinkSpeedRadioV2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCUSBDevice</name>
+ <version>1</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCRDICatchReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchUndef</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchSWI</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchData</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchPrefetch</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchIRQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCRDICatchFIQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkBreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkDoUpdateBreakpoints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkUpdateBreakpoints</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>CCJLinkInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkResetList</name>
+ <version>6</version>
+ <state>5</state>
+ </option>
+ <option>
+ <name>CCJLinkInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchMMERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchNOCPERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchCHRERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchSTATERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchBUSERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchINTERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchSFERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchHARDERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCJLinkScriptFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCJLinkUsbSerialNo</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCTcpIpAlt</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCJLinkTcpIpSerialNo</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCCpuClockEdit</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCSwoClockAuto</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSwoClockEdit</name>
+ <state>2000</state>
+ </option>
+ <option>
+ <name>OCJLinkTraceSource</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCJLinkTraceSourceDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCJLinkDeviceName</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>LMIFTDI_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>2</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>LmiftdiSpeed</name>
+ <state>500</state>
+ </option>
+ <option>
+ <name>CCLmiftdiDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCLmiftdiLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCLmiFtdiInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCLmiFtdiInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>PEMICRO_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>3</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCJPEMicroShowSettings</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>DoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>LogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>STLINK_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>4</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCSTLinkInterfaceRadio</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCSTLinkInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkResetList</name>
+ <version>3</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCpuClockEdit</name>
+ <state>32.0</state>
+ </option>
+ <option>
+ <name>CCSwoClockAuto</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSwoClockEdit</name>
+ <state>2000</state>
+ </option>
+ <option>
+ <name>DoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>LogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCSTLinkDoUpdateBreakpoints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkUpdateBreakpoints</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchMMERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchNOCPERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchCHRERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchSTATERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchBUSERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchINTERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchSFERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchHARDERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkCatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkUsbSerialNo</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCSTLinkUsbSerialNoSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkJtagSpeedList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkDAPNumber</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSTLinkDebugAccessPortRadio</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>THIRDPARTY_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CThirdPartyDriverDll</name>
+ <state>###Uninitialized###</state>
+ </option>
+ <option>
+ <name>CThirdPartyLogFileCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CThirdPartyLogFileEditB</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>TIFET_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>1</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCMSPFetResetList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetInterfaceRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetInterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetTargetVccTypeDefault</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetTargetVoltage</name>
+ <state>###Uninitialized###</state>
+ </option>
+ <option>
+ <name>CCMSPFetVCCDefault</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCMSPFetTargetSettlingtime</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetRadioJtagSpeedType</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCMSPFetConnection</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetUsbComPort</name>
+ <state>Automatic</state>
+ </option>
+ <option>
+ <name>CCMSPFetAllowAccessToBSL</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetDoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMSPFetLogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCMSPFetRadioEraseFlash</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>XDS100_ID</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>6</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OCDriverInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>TIPackageOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>TIPackage</name>
+ <state></state>
+ </option>
+ <option>
+ <name>BoardFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>DoLogfile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>LogFile</name>
+ <state>$PROJ_DIR$\cspycomm.log</state>
+ </option>
+ <option>
+ <name>CCXds100BreakpointRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100DoUpdateBreakpoints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100UpdateBreakpoints</name>
+ <state>_call_main</state>
+ </option>
+ <option>
+ <name>CCXds100CatchReset</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchUndef</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchSWI</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchData</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchPrefetch</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchIRQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchFIQ</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchCORERESET</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchMMERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchNOCPERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchCHRERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchSTATERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchBUSERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchINTERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchSFERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchHARDERR</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CatchDummy</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100CpuClockEdit</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCXds100SwoClockAuto</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100SwoClockEdit</name>
+ <state>1000</state>
+ </option>
+ <option>
+ <name>CCXds100HWResetDelay</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100ResetList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100UsbSerialNo</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCXds100UsbSerialNoSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100JtagSpeedList</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100InterfaceRadio</name>
+ <state>2</state>
+ </option>
+ <option>
+ <name>CCXds100InterfaceCmdLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100ProbeList</name>
+ <version>0</version>
+ <state>2</state>
+ </option>
+ <option>
+ <name>CCXds100SWOPortRadio</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCXds100SWOPort</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <debuggerPlugins>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\Mbed\MbedArmPlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin</file>
+ <loadFlag>1</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\TargetAccessServer\TargetAccessServer.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ <plugin>
+ <file>$EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin</file>
+ <loadFlag>0</loadFlag>
+ </plugin>
+ </debuggerPlugins>
+ </configuration>
+</project>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/EWARM/Zigbee_OnOff_Router.ewp b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/EWARM/Zigbee_OnOff_Router.ewp
new file mode 100644
index 000000000..496862a6b
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/EWARM/Zigbee_OnOff_Router.ewp
@@ -0,0 +1,1264 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <fileVersion>3</fileVersion>
+ <configuration>
+ <name>Zigbee_OnOff_Router</name>
+ <toolchain>
+ <name>ARM</name>
+ </toolchain>
+ <debug>1</debug>
+ <settings>
+ <name>General</name>
+ <archiveVersion>3</archiveVersion>
+ <data>
+ <version>30</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>ExePath</name>
+ <state>Zigbee_OnOff_Router/Exe</state>
+ </option>
+ <option>
+ <name>ObjPath</name>
+ <state>Zigbee_OnOff_Router/Obj</state>
+ </option>
+ <option>
+ <name>ListPath</name>
+ <state>Zigbee_OnOff_Router/List</state>
+ </option>
+ <option>
+ <name>GEndianMode</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>Input description</name>
+ <state>Full formatting, with multibyte support.</state>
+ </option>
+ <option>
+ <name>Output description</name>
+ <state>Full formatting, with multibyte support.</state>
+ </option>
+ <option>
+ <name>GOutputBinary</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGCoreOrChip</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>GRuntimeLibSelect</name>
+ <version>0</version>
+ <state>2</state>
+ </option>
+ <option>
+ <name>GRuntimeLibSelectSlave</name>
+ <version>0</version>
+ <state>2</state>
+ </option>
+ <option>
+ <name>RTDescription</name>
+ <state>Use the full configuration of the C/C++ runtime library. Full locale interface, C locale, file descriptor support, multibytes in printf and scanf, and hex floats in strtod.</state>
+ </option>
+ <option>
+ <name>OGProductVersion</name>
+ <state>4.41A</state>
+ </option>
+ <option>
+ <name>OGLastSavedByProductVersion</name>
+ <state>8.20.2.14834</state>
+ </option>
+ <option>
+ <name>GeneralEnableMisra</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GeneralMisraVerbose</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGChipSelectEditMenu</name>
+ <state>STM32WB55RG ST STM32WB55RG</state>
+ </option>
+ <option>
+ <name>GenLowLevelInterface</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>GEndianModeBE</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OGBufferedTerminalOutput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GenStdoutInterface</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GeneralMisraRules98</name>
+ <version>0</version>
+ <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
+ </option>
+ <option>
+ <name>GeneralMisraVer</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GeneralMisraRules04</name>
+ <version>0</version>
+ <state>011111111111111110111111111111011111111111111011110100111111111111111111111111111111111111111111101111111111111011111111111111111111111111111</state>
+ </option>
+ <option>
+ <name>RTConfigPath2</name>
+ <state>$TOOLKIT_DIR$\INC\c\DLib_Config_Full.h</state>
+ </option>
+ <option>
+ <name>GBECoreSlave</name>
+ <version>26</version>
+ <state>39</state>
+ </option>
+ <option>
+ <name>OGUseCmsis</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGUseCmsisDspLib</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GRuntimeLibThreads</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CoreVariant</name>
+ <version>26</version>
+ <state>39</state>
+ </option>
+ <option>
+ <name>GFPUDeviceSlave</name>
+ <state>STM32WB55RG ST STM32WB55RG</state>
+ </option>
+ <option>
+ <name>FPU2</name>
+ <version>0</version>
+ <state>4</state>
+ </option>
+ <option>
+ <name>NrRegs</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>NEON</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GFPUCoreSlave2</name>
+ <version>26</version>
+ <state>39</state>
+ </option>
+ <option>
+ <name>OGCMSISPackSelectDevice</name>
+ </option>
+ <option>
+ <name>OgLibHeap</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGLibAdditionalLocale</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGPrintfVariant</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OGPrintfMultibyteSupport</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OGScanfVariant</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OGScanfMultibyteSupport</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>GenLocaleTags</name>
+ <state></state>
+ </option>
+ <option>
+ <name>GenLocaleDisplayOnly</name>
+ <state></state>
+ </option>
+ <option>
+ <name>DSPExtension</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>TrustZone</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>ICCARM</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>34</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CCOptimizationNoSizeConstraints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCDefines</name>
+ <state>USE_HAL_DRIVER</state>
+ <state>STM32WB55xx</state>
+ <state>USE_STM32WBXX_NUCLEO</state>
+ <state>ZIGBEE_WB</state>
+ </option>
+ <option>
+ <name>CCPreprocFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPreprocComments</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPreprocLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListCFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListCMnemonics</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListCMessages</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListAssFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListAssSource</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCEnableRemarks</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCDiagSuppress</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCDiagRemark</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCDiagWarning</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCDiagError</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCObjPrefix</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCAllowList</name>
+ <version>1</version>
+ <state>11111110</state>
+ </option>
+ <option>
+ <name>CCDebugInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IEndianMode</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IExtraOptionsCheck</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IExtraOptions</name>
+ <state>--diag_suppress Pe111</state>
+ <state>--diag_suppress Pe188</state>
+ </option>
+ <option>
+ <name>CCLangConformance</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSignedPlainChar</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCRequirePrototypes</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCDiagWarnAreErr</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCompilerRuntimeInfo</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IFpuProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OutputFile</name>
+ <state>$FILE_BNAME$.o</state>
+ </option>
+ <option>
+ <name>CCLibConfigHeader</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>PreInclude</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CompilerMisraOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCIncludePath2</name>
+ <state>$PROJ_DIR$/../Core/Inc</state>
+ <state>$PROJ_DIR$/../STM32_WPAN/App</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/BSP/P-NUCLEO-WB55.Nucleo</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/STM32WBxx_HAL_Driver/Inc</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/STM32WBxx_HAL_Driver/Inc/Legacy</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/app</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/utilities</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/CMSIS/Device/ST/STM32WBxx/Include</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/zigbee/core/Inc</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/zigbee/stack</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/zigbee/stack/include</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/zigbee/stack/include/mac</state>
+ <state>$PROJ_DIR$/../../../../../../Middlewares/ST/STM32_WPAN/zigbee/stack/include/M4</state>
+ <state>$PROJ_DIR$/../../../../../../Drivers/CMSIS/Include</state>
+ <state>$PROJ_DIR$/../../../../../../Utilities/sequencer</state>
+ <state>$PROJ_DIR$/../../../../../../Utilities/lpm/tiny_lpm</state>
+ </option>
+ <option>
+ <name>CCStdIncCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCodeSection</name>
+ <state>.text</state>
+ </option>
+ <option>
+ <name>IProcessorMode2</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCOptLevel</name>
+ <state>3</state>
+ </option>
+ <option>
+ <name>CCOptStrategy</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCOptLevelSlave</name>
+ <state>3</state>
+ </option>
+ <option>
+ <name>CompilerMisraRules98</name>
+ <version>0</version>
+ <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
+ </option>
+ <option>
+ <name>CompilerMisraRules04</name>
+ <version>0</version>
+ <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
+ </option>
+ <option>
+ <name>CCPosIndRopi</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPosIndRwpi</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPosIndNoDynInit</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccLang</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccCDialect</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IccAllowVLA</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccStaticDestr</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccCppInlineSemantics</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccCmsis</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IccFloatSemantics</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCNoLiteralPool</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCOptStrategySlave</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCGuardCalls</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCEncSource</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCEncOutput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCEncOutputBom</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCEncInput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccExceptions2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccRTTI2</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>AARM</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>10</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>AObjPrefix</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AEndian</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>ACaseSensitivity</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>MacroChars</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AWarnEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AWarnWhat</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AWarnOne</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AWarnRange1</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AWarnRange2</name>
+ <state></state>
+ </option>
+ <option>
+ <name>ADebug</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AltRegisterNames</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ADefines</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AList</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AListHeader</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AListing</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>Includes</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacDefs</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacExps</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>MacExec</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OnlyAssed</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MultiLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>PageLengthCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>PageLength</name>
+ <state>80</state>
+ </option>
+ <option>
+ <name>TabSpacing</name>
+ <state>8</state>
+ </option>
+ <option>
+ <name>AXRef</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AXRefDefines</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AXRefInternal</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AXRefDual</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AFpuProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AOutputFile</name>
+ <state>$FILE_BNAME$.o</state>
+ </option>
+ <option>
+ <name>ALimitErrorsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ALimitErrorsEdit</name>
+ <state>100</state>
+ </option>
+ <option>
+ <name>AIgnoreStdInclude</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AUserIncludes</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AExtraOptionsCheckV2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AExtraOptionsV2</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AsmNoLiteralPool</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>OBJCOPY</name>
+ <archiveVersion>0</archiveVersion>
+ <data>
+ <version>1</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OOCOutputFormat</name>
+ <version>3</version>
+ <state>3</state>
+ </option>
+ <option>
+ <name>OCOutputOverride</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OOCOutputFile</name>
+ <state>Zigbee_OnOff_Router.bin</state>
+ </option>
+ <option>
+ <name>OOCCommandLineProducer</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OOCObjCopyEnable</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>CUSTOM</name>
+ <archiveVersion>3</archiveVersion>
+ <data>
+ <extensions></extensions>
+ <cmdline></cmdline>
+ <hasPrio>0</hasPrio>
+ </data>
+ </settings>
+ <settings>
+ <name>BICOMP</name>
+ <archiveVersion>0</archiveVersion>
+ <data />
+ </settings>
+ <settings>
+ <name>BUILDACTION</name>
+ <archiveVersion>1</archiveVersion>
+ <data>
+ <prebuild></prebuild>
+ <postbuild></postbuild>
+ </data>
+ </settings>
+ <settings>
+ <name>ILINK</name>
+ <archiveVersion>0</archiveVersion>
+ <data>
+ <version>20</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>IlinkLibIOConfig</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>XLinkMisraHandler</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkInputFileSlave</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkOutputFile</name>
+ <state>Zigbee_OnOff_Router.out</state>
+ </option>
+ <option>
+ <name>IlinkDebugInfoEnable</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkKeepSymbols</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinaryFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinarySymbol</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinarySegment</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinaryAlign</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkDefines</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkConfigDefines</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkMapFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkLogFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogInitialization</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogModule</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogSection</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogVeneer</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkIcfOverride</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkIcfFile</name>
+ <state>$PROJ_DIR$\stm32wb55xx_flash_cm4.icf</state>
+ </option>
+ <option>
+ <name>IlinkIcfFileSlave</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkEnableRemarks</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkSuppressDiags</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkTreatAsRem</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkTreatAsWarn</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkTreatAsErr</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkWarningsAreErrors</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkUseExtraOptions</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkExtraOptions</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkLowLevelInterfaceSlave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkAutoLibEnable</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkAdditionalLibs</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkOverrideProgramEntryLabel</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkProgramEntryLabelSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkProgramEntryLabel</name>
+ <state>__iar_program_start</state>
+ </option>
+ <option>
+ <name>DoFill</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>FillerByte</name>
+ <state>0xFF</state>
+ </option>
+ <option>
+ <name>FillerStart</name>
+ <state>0x0</state>
+ </option>
+ <option>
+ <name>FillerEnd</name>
+ <state>0x0</state>
+ </option>
+ <option>
+ <name>CrcSize</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcAlign</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcPoly</name>
+ <state>0x11021</state>
+ </option>
+ <option>
+ <name>CrcCompl</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CrcBitOrder</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CrcInitialValue</name>
+ <state>0x0</state>
+ </option>
+ <option>
+ <name>DoCrc</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkBE8Slave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkBufferedTerminalOutput</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkStdoutInterfaceSlave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcFullSize</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkIElfToolPostProcess</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogAutoLibSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogRedirSymbols</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogUnusedFragments</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkCrcReverseByteOrder</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkCrcUseAsInput</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptInline</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkOptExceptionsAllow</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptExceptionsForce</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkCmsis</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptMergeDuplSections</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkOptUseVfe</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptForceVfe</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkStackAnalysisEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkStackControlFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkStackCallGraphFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CrcAlgorithm</name>
+ <version>1</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcUnitSize</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkThreadsSlave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkLogCallGraph</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkIcfFile_AltDefault</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkEncInput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkEncOutput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkEncOutputBom</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkHeapSelect</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkLocaleSelect</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>IARCHIVE</name>
+ <archiveVersion>0</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>IarchiveInputs</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IarchiveOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IarchiveOutput</name>
+ <state>###Unitialized###</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>BILINK</name>
+ <archiveVersion>0</archiveVersion>
+ <data />
+ </settings>
+ </configuration>
+ <group>
+ <name>Application</name>
+ <group>
+ <name>EWARM</name>
+ <file>
+ <name>$PROJ_DIR$\startup_stm32wb55xx_cm4.s</name>
+ </file>
+ </group>
+ <group>
+ <name>User</name>
+ <group>
+ <name>Core</name>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\app_entry.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\hw_timerserver.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\hw_uart.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\main.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\stm32wbxx_hal_msp.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\stm32wbxx_it.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\stm_logging.c</name>
+ </file>
+ </group>
+ <group>
+ <name>STM32_WPAN</name>
+ <group>
+ <name>App</name>
+ <file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\App\app_zigbee.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\App\app_zigbee_demo.c</name>
+ </file>
+ </group>
+ <group>
+ <name>Target</name>
+ <file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\Target\hw_ipcc.c</name>
+ </file>
+ </group>
+ </group>
+ </group>
+ </group>
+ <group>
+ <name>Drivers</name>
+ <group>
+ <name>BSP</name>
+ <group>
+ <name>STM32WBxx_Nucleo</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\BSP\P-NUCLEO-WB55.Nucleo\stm32wbxx_nucleo.c</name>
+ </file>
+ </group>
+ </group>
+ <group>
+ <name>CMSIS</name>
+ <file>
+ <name>$PROJ_DIR$\..\Core\Src\system_stm32wbxx.c</name>
+ </file>
+ </group>
+ <group>
+ <name>STM32WBxx_HAL_Driver</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_cortex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_dma.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_dma_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_exti.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_flash.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_flash_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_gpio.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_hsem.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_pwr.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_pwr_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rcc.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rcc_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rtc.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rtc_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_tim.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_tim_ex.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_uart.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_uart_ex.c</name>
+ </file>
+ </group>
+ </group>
+ <group>
+ <name>Middlewares</name>
+ <group>
+ <name>STM32_WPAN</name>
+ <group>
+ <name>interface</name>
+ <group>
+ <name>patterns</name>
+ <group>
+ <name>ble_thread</name>
+ <group>
+ <name>schi</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\shci\shci.c</name>
+ </file>
+ </group>
+ <group>
+ <name>tl</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\hci_tl_if.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\shci_tl.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\shci_tl_if.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\tl_mbox.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\tl\tl_zigbee_hci.c</name>
+ </file>
+ </group>
+ </group>
+ </group>
+ </group>
+ <group>
+ <name>utilities</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\utilities\dbg_trace.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\utilities\otp.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\utilities\stm_list.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\utilities\stm_queue.c</name>
+ </file>
+ </group>
+ <group>
+ <name>zigbee</name>
+ <group>
+ <name>core</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\zigbee\core\src\zigbee_core_wb.c</name>
+ </file>
+ </group>
+ <group>
+ <name>stack</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\zigbee\lib\stm32wb_zigbee_wb_lib.a</name>
+ </file>
+ </group>
+ </group>
+ </group>
+ </group>
+ <group>
+ <name>Utilities</name>
+ <group>
+ <name>lpm</name>
+ <group>
+ <name>tiny_lpm</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Utilities\lpm\tiny_lpm\stm32_lpm.c</name>
+ </file>
+ </group>
+ </group>
+ <group>
+ <name>sequencer</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Utilities\sequencer\stm32_seq.c</name>
+ </file>
+ </group>
+ </group>
+</project>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/EWARM/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/EWARM/startup_stm32wb55xx_cm4.s
new file mode 100644
index 000000000..1f886ff59
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/EWARM/startup_stm32wb55xx_cm4.s
@@ -0,0 +1,517 @@
+;******************************************************************************
+;* File Name : startup_stm32wb55xx_cm4.s
+;* Author : MCD Application Team
+;* Description : M4 core vector table of the STM32WB55xx devices for the
+;* IAR (EWARM) toolchain.
+;*
+;* This module performs:
+;* - Set the initial SP
+;* - Set the initial PC == _iar_program_start,
+;* - Set the vector table entries with the exceptions ISR
+;* address.
+;* - Branches to main in the C library (which eventually
+;* calls main()).
+;* After Reset the Cortex-M4 processor is in Thread mode,
+;* priority is Privileged, and the Stack is set to Main.
+;******************************************************************************
+;* @attention
+;*
+;* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+;* All rights reserved.</center></h2>
+;*
+;* This software component is licensed by ST under BSD 3-Clause license,
+;* the "License"; You may not use this file except in compliance with the
+;* License. You may obtain a copy of the License at:
+;* opensource.org/licenses/BSD-3-Clause
+;*
+;******************************************************************************
+;
+;
+; The modules in this file are included in the libraries, and may be replaced
+; by any user-defined modules that define the PUBLIC symbol _program_start or
+; a user defined start symbol.
+; To override the cstartup defined in the library, simply add your modified
+; version to the workbench project.
+;
+; The vector table is normally located at address 0.
+; When debugging in RAM, it can be located in RAM, aligned to at least 2^6.
+; The name "__vector_table" has special meaning for C-SPY:
+; it is where the SP start value is found, and the NVIC vector
+; table register (VTOR) is initialized to this address if != 0.
+;
+; Cortex-M version
+;
+
+ MODULE ?cstartup
+
+ ;; Forward declaration of sections.
+ SECTION CSTACK:DATA:NOROOT(3)
+
+ SECTION .intvec:CODE:NOROOT(2)
+
+ EXTERN __iar_program_start
+ EXTERN SystemInit
+ PUBLIC __vector_table
+
+ DATA
+__vector_table
+ DCD sfe(CSTACK)
+ DCD Reset_Handler ; Reset Handler
+
+ DCD NMI_Handler ; NMI Handler
+ DCD HardFault_Handler ; Hard Fault Handler
+ DCD MemManage_Handler ; MPU Fault Handler
+ DCD BusFault_Handler ; Bus Fault Handler
+ DCD UsageFault_Handler ; Usage Fault Handler
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD SVC_Handler ; SVCall Handler
+ DCD DebugMon_Handler ; Debug Monitor Handler
+ DCD 0 ; Reserved
+ DCD PendSV_Handler ; PendSV Handler
+ DCD SysTick_Handler ; SysTick Handler
+
+ ; External Interrupts
+ DCD WWDG_IRQHandler ; Window WatchDog
+ DCD PVD_PVM_IRQHandler ; PVD and PVM Interrupt
+ DCD TAMP_STAMP_LSECSS_IRQHandler ; RTC Tamper, TimeStamp Interrupts and LSECSS Interrupts
+ DCD RTC_WKUP_IRQHandler ; RTC Wakeup Interrupt
+ DCD FLASH_IRQHandler ; FLASH global Interrupt
+ DCD RCC_IRQHandler ; RCC Interrupt
+ DCD EXTI0_IRQHandler ; EXTI Line 0 Interrupt
+ DCD EXTI1_IRQHandler ; EXTI Line 1 Interrupt
+ DCD EXTI2_IRQHandler ; EXTI Line 2 Interrupt
+ DCD EXTI3_IRQHandler ; EXTI Line 3 Interrup
+ DCD EXTI4_IRQHandler ; EXTI Line 4 Interrupt
+ DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 Interrupt
+ DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2 Interrupt
+ DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3 Interrupt
+ DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4 Interrupt
+ DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5 Interrupt
+ DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6 Interrupt
+ DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7 Interrupt
+ DCD ADC1_IRQHandler ; ADC1 Interrupt
+ DCD USB_HP_IRQHandler ; USB High Priority Interrupt
+ DCD USB_LP_IRQHandler ; USB Low Priority Interrupt
+ DCD C2SEV_PWR_C2H_IRQHandler ; CPU M0+ SEV Interrupt
+ DCD COMP_IRQHandler ; COMP1 and COMP2 Interrupts
+ DCD EXTI9_5_IRQHandler ; EXTI Lines [9:5] Interrupt
+ DCD TIM1_BRK_IRQHandler ; TIM1 Break Interrupt
+ DCD TIM1_UP_TIM16_IRQHandler ; TIM1 Update and TIM16 global Interrupts
+ DCD TIM1_TRG_COM_TIM17_IRQHandler ; TIM1 Trigger and Communication and TIM17 global Interrupts
+ DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare Interrupt
+ DCD TIM2_IRQHandler ; TIM2 Global Interrupt
+ DCD PKA_IRQHandler ; PKA Interrupt
+ DCD I2C1_EV_IRQHandler ; I2C1 Event Interrupt
+ DCD I2C1_ER_IRQHandler ; I2C1 Error Interrupt
+ DCD I2C3_EV_IRQHandler ; I2C3 Event Interrupt
+ DCD I2C3_ER_IRQHandler ; I2C3 Error Interrupt
+ DCD SPI1_IRQHandler ; SPI1 Interrupt
+ DCD SPI2_IRQHandler ; SPI2 Interrupt
+ DCD USART1_IRQHandler ; USART1 Interrupt
+ DCD LPUART1_IRQHandler ; LPUART1 Interrupt
+ DCD SAI1_IRQHandler ; SAI Interrupt
+ DCD TSC_IRQHandler ; TSC Interrupt
+ DCD EXTI15_10_IRQHandler ; EXTI Lines1[15:10 ]Interrupts
+ DCD RTC_Alarm_IRQHandler ; RTC Alarms (A and B) Interrupt
+ DCD CRS_IRQHandler ; CRS interrupt
+ DCD PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler ; WKUP Interrupt from PWR
+ DCD IPCC_C1_RX_IRQHandler ; IPCC CPU1 RX occupied interrupt
+ DCD IPCC_C1_TX_IRQHandler ; IPCC CPU1 RX free interrupt
+ DCD HSEM_IRQHandler ; HSEM0 Interrupt
+ DCD LPTIM1_IRQHandler ; LPTIM1 Interrupt
+ DCD LPTIM2_IRQHandler ; LPTIM2 Interrupt
+ DCD LCD_IRQHandler ; LCD Interrupt
+ DCD QUADSPI_IRQHandler ; QUADSPI Interrupt
+ DCD AES1_IRQHandler ; AES1 Interrupt
+ DCD AES2_IRQHandler ; AES2 Interrupt
+ DCD RNG_IRQHandler ; RNG1 Interrupt
+ DCD FPU_IRQHandler ; FPU Interrupt
+ DCD DMA2_Channel1_IRQHandler ; DMA2 Channel 1 Interrupt
+ DCD DMA2_Channel2_IRQHandler ; DMA2 Channel 2 Interrupt
+ DCD DMA2_Channel3_IRQHandler ; DMA2 Channel 3 Interrupt
+ DCD DMA2_Channel4_IRQHandler ; DMA2 Channel 4 Interrupt
+ DCD DMA2_Channel5_IRQHandler ; DMA2 Channel 5 Interrupt
+ DCD DMA2_Channel6_IRQHandler ; DMA2 Channel 6 Interrupt
+ DCD DMA2_Channel7_IRQHandler ; DMA2 Channel 7 Interrupt
+ DCD DMAMUX1_OVR_IRQHandler ; DMAMUX overrun Interrupt
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Default interrupt handlers.
+;;
+ THUMB
+
+ PUBWEAK Reset_Handler
+ SECTION .text:CODE:NOROOT:REORDER(2)
+Reset_Handler
+ LDR R0, =SystemInit
+ BLX R0
+ LDR R0, =__iar_program_start
+ BX R0
+
+ PUBWEAK NMI_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+NMI_Handler
+ B NMI_Handler
+
+ PUBWEAK HardFault_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+HardFault_Handler
+ B HardFault_Handler
+
+ PUBWEAK MemManage_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+MemManage_Handler
+ B MemManage_Handler
+
+ PUBWEAK BusFault_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+BusFault_Handler
+ B BusFault_Handler
+
+ PUBWEAK UsageFault_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+UsageFault_Handler
+ B UsageFault_Handler
+
+ PUBWEAK SVC_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SVC_Handler
+ B SVC_Handler
+
+ PUBWEAK DebugMon_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DebugMon_Handler
+ B DebugMon_Handler
+
+ PUBWEAK PendSV_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+PendSV_Handler
+ B PendSV_Handler
+
+ PUBWEAK SysTick_Handler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SysTick_Handler
+ B SysTick_Handler
+
+ PUBWEAK WWDG_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+WWDG_IRQHandler
+ B WWDG_IRQHandler
+
+ PUBWEAK PVD_PVM_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+PVD_PVM_IRQHandler
+ B PVD_PVM_IRQHandler
+
+ PUBWEAK TAMP_STAMP_LSECSS_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TAMP_STAMP_LSECSS_IRQHandler
+ B TAMP_STAMP_LSECSS_IRQHandler
+
+ PUBWEAK RTC_WKUP_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+RTC_WKUP_IRQHandler
+ B RTC_WKUP_IRQHandler
+
+ PUBWEAK FLASH_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+FLASH_IRQHandler
+ B FLASH_IRQHandler
+
+ PUBWEAK RCC_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+RCC_IRQHandler
+ B RCC_IRQHandler
+
+ PUBWEAK EXTI0_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI0_IRQHandler
+ B EXTI0_IRQHandler
+
+ PUBWEAK EXTI1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI1_IRQHandler
+ B EXTI1_IRQHandler
+
+ PUBWEAK EXTI2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI2_IRQHandler
+ B EXTI2_IRQHandler
+
+ PUBWEAK EXTI3_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI3_IRQHandler
+ B EXTI3_IRQHandler
+
+ PUBWEAK EXTI4_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI4_IRQHandler
+ B EXTI4_IRQHandler
+
+ PUBWEAK DMA1_Channel1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel1_IRQHandler
+ B DMA1_Channel1_IRQHandler
+
+ PUBWEAK DMA1_Channel2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel2_IRQHandler
+ B DMA1_Channel2_IRQHandler
+
+ PUBWEAK DMA1_Channel3_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel3_IRQHandler
+ B DMA1_Channel3_IRQHandler
+
+ PUBWEAK DMA1_Channel4_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel4_IRQHandler
+ B DMA1_Channel4_IRQHandler
+
+ PUBWEAK DMA1_Channel5_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel5_IRQHandler
+ B DMA1_Channel5_IRQHandler
+
+ PUBWEAK DMA1_Channel6_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel6_IRQHandler
+ B DMA1_Channel6_IRQHandler
+
+ PUBWEAK DMA1_Channel7_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA1_Channel7_IRQHandler
+ B DMA1_Channel7_IRQHandler
+
+ PUBWEAK ADC1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+ADC1_IRQHandler
+ B ADC1_IRQHandler
+
+ PUBWEAK USB_HP_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+USB_HP_IRQHandler
+ B USB_HP_IRQHandler
+
+ PUBWEAK USB_LP_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+USB_LP_IRQHandler
+ B USB_LP_IRQHandler
+
+ PUBWEAK C2SEV_PWR_C2H_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+C2SEV_PWR_C2H_IRQHandler
+ B C2SEV_PWR_C2H_IRQHandler
+
+ PUBWEAK COMP_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+COMP_IRQHandler
+ B COMP_IRQHandler
+
+ PUBWEAK EXTI9_5_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI9_5_IRQHandler
+ B EXTI9_5_IRQHandler
+
+ PUBWEAK TIM1_BRK_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM1_BRK_IRQHandler
+ B TIM1_BRK_IRQHandler
+
+ PUBWEAK TIM1_UP_TIM16_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM1_UP_TIM16_IRQHandler
+ B TIM1_UP_TIM16_IRQHandler
+
+ PUBWEAK TIM1_TRG_COM_TIM17_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM1_TRG_COM_TIM17_IRQHandler
+ B TIM1_TRG_COM_TIM17_IRQHandler
+
+ PUBWEAK TIM1_CC_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM1_CC_IRQHandler
+ B TIM1_CC_IRQHandler
+
+ PUBWEAK TIM2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TIM2_IRQHandler
+ B TIM2_IRQHandler
+
+ PUBWEAK PKA_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+PKA_IRQHandler
+ B PKA_IRQHandler
+
+ PUBWEAK I2C1_EV_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+I2C1_EV_IRQHandler
+ B I2C1_EV_IRQHandler
+
+ PUBWEAK I2C1_ER_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+I2C1_ER_IRQHandler
+ B I2C1_ER_IRQHandler
+
+ PUBWEAK I2C3_EV_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+I2C3_EV_IRQHandler
+ B I2C3_EV_IRQHandler
+
+ PUBWEAK I2C3_ER_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+I2C3_ER_IRQHandler
+ B I2C3_ER_IRQHandler
+
+ PUBWEAK SPI1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SPI1_IRQHandler
+ B SPI1_IRQHandler
+
+ PUBWEAK SPI2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SPI2_IRQHandler
+ B SPI2_IRQHandler
+
+ PUBWEAK USART1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+USART1_IRQHandler
+ B USART1_IRQHandler
+
+ PUBWEAK LPUART1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+LPUART1_IRQHandler
+ B LPUART1_IRQHandler
+
+ PUBWEAK SAI1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+SAI1_IRQHandler
+ B SAI1_IRQHandler
+
+ PUBWEAK TSC_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+TSC_IRQHandler
+ B TSC_IRQHandler
+
+ PUBWEAK EXTI15_10_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+EXTI15_10_IRQHandler
+ B EXTI15_10_IRQHandler
+
+ PUBWEAK RTC_Alarm_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+RTC_Alarm_IRQHandler
+ B RTC_Alarm_IRQHandler
+
+ PUBWEAK CRS_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+CRS_IRQHandler
+ B CRS_IRQHandler
+
+ PUBWEAK PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler
+ B PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler
+
+ PUBWEAK IPCC_C1_RX_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+IPCC_C1_RX_IRQHandler
+ B IPCC_C1_RX_IRQHandler
+
+ PUBWEAK IPCC_C1_TX_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+IPCC_C1_TX_IRQHandler
+ B IPCC_C1_TX_IRQHandler
+
+ PUBWEAK HSEM_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+HSEM_IRQHandler
+ B HSEM_IRQHandler
+
+ PUBWEAK LPTIM1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+LPTIM1_IRQHandler
+ B LPTIM1_IRQHandler
+
+ PUBWEAK LPTIM2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+LPTIM2_IRQHandler
+ B LPTIM2_IRQHandler
+
+ PUBWEAK LCD_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+LCD_IRQHandler
+ B LCD_IRQHandler
+
+ PUBWEAK QUADSPI_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+QUADSPI_IRQHandler
+ B QUADSPI_IRQHandler
+
+ PUBWEAK AES1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+AES1_IRQHandler
+ B AES1_IRQHandler
+
+ PUBWEAK AES2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+AES2_IRQHandler
+ B AES2_IRQHandler
+
+ PUBWEAK RNG_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+RNG_IRQHandler
+ B RNG_IRQHandler
+
+ PUBWEAK FPU_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+FPU_IRQHandler
+ B FPU_IRQHandler
+
+ PUBWEAK DMA2_Channel1_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel1_IRQHandler
+ B DMA2_Channel1_IRQHandler
+
+ PUBWEAK DMA2_Channel2_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel2_IRQHandler
+ B DMA2_Channel2_IRQHandler
+
+ PUBWEAK DMA2_Channel3_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel3_IRQHandler
+ B DMA2_Channel3_IRQHandler
+
+ PUBWEAK DMA2_Channel4_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel4_IRQHandler
+ B DMA2_Channel4_IRQHandler
+
+ PUBWEAK DMA2_Channel5_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel5_IRQHandler
+ B DMA2_Channel5_IRQHandler
+
+ PUBWEAK DMA2_Channel6_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel6_IRQHandler
+ B DMA2_Channel6_IRQHandler
+
+ PUBWEAK DMA2_Channel7_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMA2_Channel7_IRQHandler
+ B DMA2_Channel7_IRQHandler
+
+ PUBWEAK DMAMUX1_OVR_IRQHandler
+ SECTION .text:CODE:NOROOT:REORDER(1)
+DMAMUX1_OVR_IRQHandler
+ B DMAMUX1_OVR_IRQHandler
+
+ END
+
+;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE*****
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/EWARM/stm32wb55xx_flash_cm4.icf b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/EWARM/stm32wb55xx_flash_cm4.icf
new file mode 100644
index 000000000..70aec4026
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/EWARM/stm32wb55xx_flash_cm4.icf
@@ -0,0 +1,47 @@
+/*###ICF### Section handled by ICF editor, don't touch! ****/
+/*-Editor annotation file-*/
+/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
+/*-Specials-*/
+define symbol __ICFEDIT_intvec_start__ = 0x08000000;
+/*-Memory Regions-*/
+/***** FLASH Part dedicated to M4 *****/
+define symbol __ICFEDIT_region_ROM_start__ = 0x08000000;
+define symbol __ICFEDIT_region_ROM_end__ = 0x0807FFFF;
+define symbol __ICFEDIT_region_RAM_start__ = 0x20000004;
+define symbol __ICFEDIT_region_RAM_end__ = 0x2002F000;
+
+ /*0x2002FFFF---------------------------------------|
+ * | Emulation Flash |
+ * 0x2002F000-------------------------------------- |
+ * | Region_RAM |
+ * 0x20000004-------------------------------------- |
+
+/*-Sizes-*/
+define symbol __ICFEDIT_size_cstack__ = 0x1000; /* 4K */
+define symbol __ICFEDIT_size_heap__ = 102400; /* was 4K */
+/**** End of ICF editor section. ###ICF###*/
+
+define symbol __ICFEDIT_region_RAM_SHARED_start__ = 0x20030000;
+define symbol __ICFEDIT_region_RAM_SHARED_end__ = 0x20031000;
+
+define memory mem with size = 4G;
+define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
+define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
+define region RAM_SHARED_region = mem:[from __ICFEDIT_region_RAM_SHARED_start__ to __ICFEDIT_region_RAM_SHARED_end__];
+
+define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
+define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
+
+/* MB_MEM1 and MB_MEM2 are sections reserved to mailbox communication. It is placed in the shared memory */
+initialize by copy { readwrite };
+do not initialize { section .noinit,
+ section MAPPING_TABLE,
+ section MB_MEM1 };
+
+place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
+
+place in ROM_region { readonly };
+place in RAM_region { readwrite,block CSTACK, block HEAP };
+place in RAM_SHARED_region { first section MAPPING_TABLE};
+place in RAM_SHARED_region { section MB_MEM1};
+place in RAM_SHARED_region { section MB_MEM2};
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/STM32_WPAN/App/app_zigbee.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/STM32_WPAN/App/app_zigbee.c
new file mode 100644
index 000000000..a7ca65f04
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/STM32_WPAN/App/app_zigbee.c
@@ -0,0 +1,317 @@
+/**
+ ******************************************************************************
+ * File Name : App/app_zigbee.c
+ * Description : Zigbee Application.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "app_entry.h"
+#include "dbg_trace.h"
+#include "app_zigbee.h"
+#include "zigbee_interface.h"
+#include "shci.h"
+#include "stm_logging.h"
+#include "app_conf.h"
+#include "stm32wbxx_core_interface_def.h"
+#include "zigbee_types.h"
+#include "stm32_seq.h"
+
+/* Private defines -----------------------------------------------------------*/
+
+/* Private function prototypes -----------------------------------------------*/
+void APP_ZIGBEE_Demo(void);
+
+static void APP_ZIGBEE_TraceError(const char *pMess, uint32_t ErrCode);
+static void APP_ZIGBEE_CheckWirelessFirmwareInfo(void);
+
+static void Wait_Getting_Ack_From_M0(void);
+static void Receive_Ack_From_M0(void);
+static void Receive_Notification_From_M0(void);
+
+/* Private variables -----------------------------------------------*/
+static TL_CmdPacket_t *p_ZIGBEE_otcmdbuffer;
+static TL_EvtPacket_t *p_ZIGBEE_notif_M0_to_M4;
+static __IO uint32_t CptReceiveMsgFromM0 = 0;
+
+PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static TL_ZIGBEE_Config_t ZigbeeConfigBuffer;
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static TL_CmdPacket_t ZigbeeOtCmdBuffer;
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t ZigbeeNotifRspEvtBuffer[sizeof(TL_PacketHeader_t) + TL_EVT_HDR_SIZE + 255U];
+PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t ZigbeeNotifLoggingBuffer[sizeof(TL_PacketHeader_t) + TL_EVT_HDR_SIZE + 255U];
+
+/* Functions Definition ------------------------------------------------------*/
+
+void APP_ZIGBEE_Init(void)
+{
+ SHCI_CmdStatus_t ZigbeeInitStatus;
+
+ APP_DBG("APP_ZIGBEE_Init");
+
+ /* Check the compatibility with the Coprocessor Wireless Firmware loaded */
+ APP_ZIGBEE_CheckWirelessFirmwareInfo();
+
+ /* Register cmdbuffer */
+ APP_ZIGBEE_RegisterCmdBuffer(&ZigbeeOtCmdBuffer);
+
+ /* Init config buffer and call TL_ZIGBEE_Init */
+ APP_ZIGBEE_TL_INIT();
+
+ ZigbeeInitStatus = SHCI_C2_ZIGBEE_Init();
+ /* Prevent unused argument(s) compilation warning */
+ UNUSED(ZigbeeInitStatus);
+
+ /* Register task */
+ /* Create the different tasks */
+ UTIL_SEQ_RegTask(1U << (uint32_t)CFG_TASK_MSG_FROM_M0_TO_M4, UTIL_SEQ_RFU,APP_ZIGBEE_ProcessMsgM0ToM4);
+
+ /* Create the zigbee demo task */
+ UTIL_SEQ_RegTask(1U << CFG_TASK_ZIGBEE_APP, UTIL_SEQ_RFU,APP_ZIGBEE_Demo);
+ /* run the task */
+ UTIL_SEQ_SetTask(1U << CFG_TASK_ZIGBEE_APP, CFG_SCH_PRIO_0);
+} /* APP_ZIGBEE_Init */
+
+/**
+ * @brief Trace the error or the warning reported.
+ * @param ErrId :
+ * @param ErrCode
+ * @retval None
+ */
+void APP_ZIGBEE_Error(uint32_t ErrId, uint32_t ErrCode)
+{
+ switch (ErrId) {
+ default:
+ APP_ZIGBEE_TraceError("ERROR Unknown ", 0);
+ break;
+ }
+} /* APP_ZIGBEE_Error */
+
+/*************************************************************
+ *
+ * LOCAL FUNCTIONS
+ *
+ *************************************************************/
+
+/**
+ * @brief Warn the user that an error has occurred.In this case,
+ * the LEDs on the Board will start blinking.
+ *
+ * @param pMess : Message associated to the error.
+ * @param ErrCode: Error code associated to the module (Zigbee or other module if any)
+ * @retval None
+ */
+static void APP_ZIGBEE_TraceError(const char *pMess, uint32_t ErrCode)
+{
+ APP_DBG("**** Fatal error = %s (Err = %d)", pMess, ErrCode);
+ while (1U == 1U) {
+ BSP_LED_Toggle(LED1);
+ HAL_Delay(500U);
+ BSP_LED_Toggle(LED2);
+ HAL_Delay(500U);
+ BSP_LED_Toggle(LED3);
+ HAL_Delay(500U);
+ }
+} /* APP_ZIGBEE_TraceError */
+
+/**
+ * @brief Check if the Coprocessor Wireless Firmware loaded supports Zigbee
+ * and display associated informations
+ * @param None
+ * @retval None
+ */
+static void APP_ZIGBEE_CheckWirelessFirmwareInfo(void)
+{
+ WirelessFwInfo_t wireless_info_instance;
+ WirelessFwInfo_t *p_wireless_info = &wireless_info_instance;
+
+ if (SHCI_GetWirelessFwInfo(p_wireless_info) != SHCI_Success) {
+ APP_ZIGBEE_Error((uint32_t)ERR_ZIGBEE_CHECK_WIRELESS, (uint32_t)ERR_INTERFACE_FATAL);
+ }
+ else {
+ APP_DBG("**********************************************************");
+ APP_DBG("WIRELESS COPROCESSOR FW:");
+ /* Print version */
+ APP_DBG("VERSION ID = %d.%d.%d", p_wireless_info->VersionMajor, p_wireless_info->VersionMinor, p_wireless_info->VersionSub);
+
+ switch (p_wireless_info->StackType) {
+ case INFO_STACK_TYPE_ZIGBEE:
+ APP_DBG("FW Type : Zigbee stack");
+ break;
+ default:
+ /* No Zigbee device supported ! */
+ APP_ZIGBEE_Error((uint32_t)ERR_ZIGBEE_CHECK_WIRELESS, (uint32_t)ERR_INTERFACE_FATAL);
+ break;
+ }
+ APP_DBG("**********************************************************");
+ }
+} /* APP_ZIGBEE_CheckWirelessFirmwareInfo */
+
+/*************************************************************
+ *
+ * WRAP FUNCTIONS
+ *
+ *************************************************************/
+
+void APP_ZIGBEE_RegisterCmdBuffer(TL_CmdPacket_t *p_buffer)
+{
+ p_ZIGBEE_otcmdbuffer = p_buffer;
+} /* APP_ZIGBEE_RegisterCmdBuffer */
+
+Zigbee_Cmd_Request_t * ZIGBEE_Get_OTCmdPayloadBuffer(void)
+{
+ return (Zigbee_Cmd_Request_t *)p_ZIGBEE_otcmdbuffer->cmdserial.cmd.payload;
+} /* ZIGBEE_Get_OTCmdPayloadBuffer */
+
+Zigbee_Cmd_Request_t * ZIGBEE_Get_OTCmdRspPayloadBuffer(void)
+{
+ return (Zigbee_Cmd_Request_t *)((TL_EvtPacket_t *)p_ZIGBEE_otcmdbuffer)->evtserial.evt.payload;
+} /* ZIGBEE_Get_OTCmdRspPayloadBuffer */
+
+Zigbee_Cmd_Request_t * ZIGBEE_Get_NotificationPayloadBuffer(void)
+{
+ return (Zigbee_Cmd_Request_t *)(p_ZIGBEE_notif_M0_to_M4)->evtserial.evt.payload;
+} /* ZIGBEE_Get_NotificationPayloadBuffer */
+
+/**
+ * @brief This function is used to transfer the commands from the M4 to the M0.
+ *
+ * @param None
+ * @return None
+ */
+void ZIGBEE_CmdTransfer(void)
+{
+ Zigbee_Cmd_Request_t *cmd_req = (Zigbee_Cmd_Request_t *)p_ZIGBEE_otcmdbuffer->cmdserial.cmd.payload;
+
+ /* Zigbee OT command cmdcode range 0x280 .. 0x3DF = 352 */
+ p_ZIGBEE_otcmdbuffer->cmdserial.cmd.cmdcode = 0x280U;
+ /* Size = otCmdBuffer->Size (Number of OT cmd arguments : 1 arg = 32bits so multiply by 4 to get size in bytes)
+ * + ID (4 bytes) + Size (4 bytes) */
+ p_ZIGBEE_otcmdbuffer->cmdserial.cmd.plen = 8U + (cmd_req->Size * 4U);
+
+ TL_ZIGBEE_SendAppliCmdToM0();
+
+ /* Wait completion of cmd */
+ Wait_Getting_Ack_From_M0();
+} /* ZIGBEE_CmdTransfer */
+
+/**
+ * @brief This function is called when the M0+ acknoledge the fact that it has received a Cmd
+ *
+ *
+ * @param Otbuffer : a pointer to TL_EvtPacket_t
+ * @return None
+ */
+void TL_ZIGBEE_CmdEvtReceived(TL_EvtPacket_t *Otbuffer)
+{
+ /* Prevent unused argument(s) compilation warning */
+ UNUSED(Otbuffer);
+
+ Receive_Ack_From_M0();
+} /* TL_ZIGBEE_CmdEvtReceived */
+
+/**
+ * @brief This function is called when notification from M0+ is received.
+ *
+ * @param Notbuffer : a pointer to TL_EvtPacket_t
+ * @return None
+ */
+void TL_ZIGBEE_NotReceived(TL_EvtPacket_t *Notbuffer)
+{
+ p_ZIGBEE_notif_M0_to_M4 = Notbuffer;
+
+ Receive_Notification_From_M0();
+} /* TL_ZIGBEE_NotReceived */
+
+/**
+ * @brief This function is called before sending any ot command to the M0
+ * core. The purpose of this function is to be able to check if
+ * there are no notifications coming from the M0 core which are
+ * pending before sending a new ot command.
+ * @param None
+ * @retval None
+ */
+void Pre_ZigbeeCmdProcessing(void)
+{
+ UTIL_SEQ_WaitEvt(EVENT_SYNCHRO_BYPASS_IDLE);
+} /* Pre_ZigbeeCmdProcessing */
+
+/**
+ * @brief This function waits for getting an acknowledgment from the M0.
+ *
+ * @param None
+ * @retval None
+ */
+static void Wait_Getting_Ack_From_M0(void)
+{
+ UTIL_SEQ_WaitEvt(EVENT_ACK_FROM_M0_EVT);
+} /* Wait_Getting_Ack_From_M0 */
+
+/**
+ * @brief Receive an acknowledgment from the M0+ core.
+ * Each command send by the M4 to the M0 are acknowledged.
+ * This function is called under interrupt.
+ * @param None
+ * @retval None
+ */
+static void Receive_Ack_From_M0(void)
+{
+ UTIL_SEQ_SetEvt(EVENT_ACK_FROM_M0_EVT);
+} /* Receive_Ack_From_M0 */
+
+/**
+ * @brief Receive a notification from the M0+ through the IPCC.
+ * This function is called under interrupt.
+ * @param None
+ * @retval None
+ */
+static void Receive_Notification_From_M0(void)
+{
+ CptReceiveMsgFromM0++;
+ UTIL_SEQ_SetTask(1U << CFG_TASK_MSG_FROM_M0_TO_M4, CFG_SCH_PRIO_0);
+} /* Receive_Notification_From_M0 */
+
+/**
+ * @brief Perform initialization of TL for Zigbee.
+ * @param None
+ * @retval None
+ */
+void APP_ZIGBEE_TL_INIT(void)
+{
+ ZigbeeConfigBuffer.p_ZigbeeOtCmdRspBuffer = (uint8_t *)&ZigbeeOtCmdBuffer;
+ ZigbeeConfigBuffer.p_ZigbeeNotAckBuffer = (uint8_t *)ZigbeeNotifRspEvtBuffer;
+ ZigbeeConfigBuffer.p_ZigbeeLoggingBuffer = (uint8_t *)ZigbeeNotifLoggingBuffer;
+ TL_ZIGBEE_Init(&ZigbeeConfigBuffer);
+} /* APP_ZIGBEE_TL_INIT */
+
+/**
+ * @brief Process the messages coming from the M0.
+ * @param None
+ * @retval None
+ */
+void APP_ZIGBEE_ProcessMsgM0ToM4(void)
+{
+ if (CptReceiveMsgFromM0 != 0) {
+ /* If CptReceiveMsgFromM0 is > 1. it means that we did not serve all the events from the radio */
+ if (CptReceiveMsgFromM0 > 1U) {
+ APP_ZIGBEE_Error(ERR_REC_MULTI_MSG_FROM_M0, 0);
+ }
+ else {
+ Zigbee_CallBackProcessing();
+ }
+ /* Reset counter */
+ CptReceiveMsgFromM0 = 0;
+ }
+} /* APP_ZIGBEE_ProcessMsgM0ToM4 */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/STM32_WPAN/App/app_zigbee.h b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/STM32_WPAN/App/app_zigbee.h
new file mode 100644
index 000000000..dd907ec23
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/STM32_WPAN/App/app_zigbee.h
@@ -0,0 +1,61 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * File Name : app_zigbee.h
+ * Description : Header for Zigbee Application.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef APP_ZIGBEE_H
+#define APP_ZIGBEE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+/* Private includes ----------------------------------------------------------*/
+#include "tl.h"
+#include "tl_zigbee_hci.h"
+
+/* Exported types ------------------------------------------------------------*/
+
+/*
+ * List of all errors tracked by the Thread application
+ * running on M4. Some of these errors may be fatal
+ * or just warnings
+ */
+typedef enum {
+ ERR_REC_MULTI_MSG_FROM_M0,
+ ERR_ZIGBE_CMD_TO_M0,
+ ERR_ZIGBEE_CHECK_WIRELESS
+} ErrAppliIdEnum_t;
+
+/* Exported constants --------------------------------------------------------*/
+
+/* Exported functions ------------------------------------------------------- */
+void APP_ZIGBEE_Init(void);
+void APP_ZIGBEE_Error(uint32_t ErrId, uint32_t ErrCode);
+void APP_ZIGBEE_RegisterCmdBuffer(TL_CmdPacket_t *p_buffer);
+void APP_ZIGBEE_ProcessMsgM0ToM4(void);
+void APP_ZIGBEE_TL_INIT(void);
+void Pre_ZigbeeCmdProcessing(void);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* APP_ZIGBEE_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/STM32_WPAN/App/app_zigbee_demo.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/STM32_WPAN/App/app_zigbee_demo.c
new file mode 100644
index 000000000..1b9c9cb92
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/STM32_WPAN/App/app_zigbee_demo.c
@@ -0,0 +1,402 @@
+/**
+ ******************************************************************************
+ * File Name : App/app_zigbee.c
+ * Description : Zigbee Application.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include <assert.h>
+#include "app_common.h"
+#include "app_entry.h"
+#include "dbg_trace.h"
+#include "app_zigbee.h"
+#include "shci.h"
+#include "stm_logging.h"
+#include "app_conf.h"
+#include "stm32wbxx_core_interface_def.h"
+#include "zigbee_types.h"
+#include "zigbee_interface.h"
+#include "stm32_seq.h"
+#include "zcl/zcl.h"
+#include "zcl/zcl.onoff.h"
+#include "zcl/zcl.identify.h"
+
+/* Startup Configuration -----------------------------------------------------*/
+#define APP_STARTUP_DISTRIB 0 /* Distributed Netork*/
+#define APP_STARTUP_TOUCHLINK_TARGET 1 /* Touchlink Target*/
+#define APP_STARTUP_TOUCHLINK_INITIATOR 2 /* Touchlink Initiator */
+#define APP_STARTUP_CENTRALIZED_COORD 3 /* Centralized Network Coordinator */
+#define APP_STARTUP_CENTRALIZED_ROUTER 4 /* Centralized Network Router */
+
+/* Choose the startup type you want from the options above */
+#define APP_STARTUP_TYPE APP_STARTUP_CENTRALIZED_ROUTER
+
+/* Spec is -40 dBm, but use -60 for ease of testing, and until we get real RSSI from STMAC. */
+#define APP_TOUCHLINK_MIN_RSSI -60
+
+/* Private defines -----------------------------------------------------------*/
+#define APP_ZIGBEE_STARTUP_FAIL_DELAY 3000U
+
+#define SW1_ENDPOINT 17
+#define SW2_ENDPOINT 18
+#define TOUCHLINK_ENDPOINT 200 /* arbitrary */
+
+#define SW1_GROUP_ADDR 0x0001
+#define SW2_GROUP_ADDR 0x0002
+
+#define SW1_FLAG 0x01
+#define SW2_FLAG 0x02
+
+#define SW1_LED LED_RED
+#define SW2_LED LED_GREEN
+#define SW3_LED LED_BLUE
+
+#define CHANNEL 15
+/* Private function prototypes -----------------------------------------------*/
+
+/* Private variables -----------------------------------------------*/
+struct zigbee_demo_info {
+ bool has_init;
+ struct ZigBeeT *zb;
+ enum ZbStartType startupControl;
+ enum ZbStatusCodeT join_status;
+ uint32_t join_delay;
+ bool init_after_join;
+
+ struct ZbZclClusterT *onoff_server_1;
+ struct ZbZclClusterT *onoff_client_1;
+ struct ZbZclClusterT *identify_server_1;
+
+ struct ZbZclClusterT *onoff_server_2;
+ struct ZbZclClusterT *onoff_client_2;
+
+ uint8_t sw_flags;
+};
+
+static struct zigbee_demo_info zigbee_demo_info;
+
+static enum ZclStatusCodeT onoff_server_attr_cb(struct ZbZclClusterT *clusterPtr, struct ZbZclAttrCbInfoT *cb);
+
+static const struct ZbZclAttrT onoff_server_attr_list[] = {
+ /* OnOff Server Attributes */
+ {
+ ZCL_ONOFF_ATTR_ONOFF, ZCL_DATATYPE_BOOLEAN,
+ ZCL_ATTR_FLAG_REPORTABLE | ZCL_ATTR_FLAG_PERSISTABLE | ZCL_ATTR_FLAG_DEFAULTABLE | ZCL_ATTR_FLAG_CB_NOTIFY, 0,
+ onoff_server_attr_cb, {0, 0}, {0, 0}
+ },
+};
+
+/* Functions Definition ------------------------------------------------------*/
+
+static enum ZclStatusCodeT onoff_server_attr_cb(struct ZbZclClusterT *clusterPtr, struct ZbZclAttrCbInfoT *cb)
+{
+ uint8_t endpoint;
+ uint8_t attrVal;
+
+ endpoint = ZbZclClusterGetEndpoint(clusterPtr);
+ switch (cb->info->attributeId) {
+ case ZCL_ONOFF_ATTR_ONOFF:
+ if (endpoint == SW1_ENDPOINT) {
+ if (ZbZclAttrRead(zigbee_demo_info.onoff_server_1, ZCL_ONOFF_ATTR_ONOFF, NULL, &attrVal, sizeof(attrVal), false) == ZCL_STATUS_SUCCESS) {
+ if (attrVal != 0) {
+ APP_DBG("SW1_LED ON");
+ BSP_LED_On(SW1_LED);
+ }
+ else {
+ APP_DBG("SW1_LED OFF");
+ BSP_LED_Off(SW1_LED);
+ }
+ }
+ }
+ else if (endpoint == SW2_ENDPOINT) {
+ if (ZbZclAttrRead(zigbee_demo_info.onoff_server_2, ZCL_ONOFF_ATTR_ONOFF, NULL, &attrVal, sizeof(attrVal), false) == ZCL_STATUS_SUCCESS) {
+ if (attrVal != 0) {
+ APP_DBG("SW2_LED ON");
+ BSP_LED_On(SW2_LED);
+ }
+ else {
+ APP_DBG("SW2_LED OFF");
+ BSP_LED_Off(SW2_LED);
+ }
+ }
+ }
+ break;
+
+ default:
+ break;
+ } /* switch */
+ return ZCL_STATUS_SUCCESS;
+} /* onoff_server_attr_notify */
+
+static void config_endpoints(void)
+{
+ ZbApsmeAddEndpointReqT req;
+ ZbApsmeAddEndpointConfT conf;
+
+ memset(&req, 0, sizeof(req));
+ req.profileId = ZCL_PROFILE_HOME_AUTOMATION;
+ req.deviceId = ZCL_DEVICE_ONOFF_SWITCH;
+
+ /* Endpoint: SW1_ENDPOINT */
+ req.endpoint = SW1_ENDPOINT;
+ ZbZclAddEndpoint(zigbee_demo_info.zb, &req, &conf);
+ assert(conf.status == ZB_STATUS_SUCCESS);
+ /* OnOff Server */
+ zigbee_demo_info.onoff_server_1 = ZbZclOnOffServerAlloc(zigbee_demo_info.zb, SW1_ENDPOINT, NULL);
+ assert(zigbee_demo_info.onoff_server_1 != NULL);
+ ZbZclAttrAppendList(zigbee_demo_info.onoff_server_1, onoff_server_attr_list, ZCL_ATTR_LIST_LEN(onoff_server_attr_list));
+ ZbZclClusterEndpointRegister(zigbee_demo_info.onoff_server_1);
+ /* OnOff Client */
+ zigbee_demo_info.onoff_client_1 = ZbZclOnOffClientAlloc(zigbee_demo_info.zb, SW1_ENDPOINT);
+ assert(zigbee_demo_info.onoff_client_1 != NULL);
+ ZbZclClusterEndpointRegister(zigbee_demo_info.onoff_client_1);
+ /* Identify Server for Touchlink */
+ zigbee_demo_info.identify_server_1 = ZbZclIdentifyServerAlloc(zigbee_demo_info.zb, SW1_ENDPOINT, NULL);
+ assert(zigbee_demo_info.identify_server_1 != NULL);
+
+ /* Endpoint: SW2_ENDPOINT */
+ req.endpoint = SW2_ENDPOINT;
+ ZbZclAddEndpoint(zigbee_demo_info.zb, &req, &conf);
+ assert(conf.status == ZB_STATUS_SUCCESS);
+ /* OnOff Server */
+ zigbee_demo_info.onoff_server_2 = ZbZclOnOffServerAlloc(zigbee_demo_info.zb, SW2_ENDPOINT, NULL);
+ assert(zigbee_demo_info.onoff_server_2 != NULL);
+ ZbZclAttrAppendList(zigbee_demo_info.onoff_server_2, onoff_server_attr_list, ZCL_ATTR_LIST_LEN(onoff_server_attr_list));
+ ZbZclClusterEndpointRegister(zigbee_demo_info.onoff_server_2);
+ /* OnOff Client */
+ zigbee_demo_info.onoff_client_2 = ZbZclOnOffClientAlloc(zigbee_demo_info.zb, SW2_ENDPOINT);
+ assert(zigbee_demo_info.onoff_client_2 != NULL);
+ ZbZclClusterEndpointRegister(zigbee_demo_info.onoff_client_2);
+} /* config_endpoints */
+
+static void config_group_addr(void)
+{
+ ZbApsmeAddGroupReqT req;
+ ZbApsmeAddGroupConfT conf;
+
+ memset(&req, 0, sizeof(req));
+ req.endpt = SW1_ENDPOINT;
+ req.groupAddr = SW1_GROUP_ADDR;
+ ZbApsmeAddGroupReq(zigbee_demo_info.zb, &req, &conf);
+
+ req.endpt = SW2_ENDPOINT;
+ req.groupAddr = SW2_GROUP_ADDR;
+ ZbApsmeAddGroupReq(zigbee_demo_info.zb, &req, &conf);
+} /* config_group_addr */
+
+/**
+ * @brief Zigbee Demo Task
+ * @param None
+ * @retval None
+ */
+void APP_ZIGBEE_Demo(void)
+{
+ /*
+ * Handle Initialization
+ */
+ if (!zigbee_demo_info.has_init) {
+ zigbee_demo_info.sw_flags = 0;
+
+ zigbee_demo_info.zb = ZbInit(0U, NULL, NULL);
+ assert(zigbee_demo_info.zb != NULL);
+
+ /* Create the endpoint and cluster(s) */
+ config_endpoints();
+
+ BSP_LED_Off(SW1_LED);
+ BSP_LED_Off(SW2_LED);
+ BSP_LED_Off(SW3_LED);
+
+ /* Configure the joining parameters */
+ zigbee_demo_info.join_status = 0x01; /* init to error status */
+ zigbee_demo_info.join_delay = HAL_GetTick(); /* now */
+ zigbee_demo_info.startupControl = ZbStartTypeJoin;
+
+ /* Initialization Complete */
+ zigbee_demo_info.has_init = true;
+ }
+
+ /*
+ * Handle Network Joining / Forming
+ */
+ if ((zigbee_demo_info.join_status != ZB_STATUS_SUCCESS) && (HAL_GetTick() >= zigbee_demo_info.join_delay)) {
+ struct ZbStartupT config;
+ enum ZbStatusCodeT status;
+
+ /* Configure Zigbee Logging (only need to do this once, but this is a good place to put it) */
+ ZbSetLogging(zigbee_demo_info.zb, ZB_LOG_MASK_LEVEL_5, NULL);
+
+ /* Attempt to join a zigbee network */
+ ZbStartupConfigGetProDefaults(&config);
+
+
+ APP_DBG("Network config : APP_STARTUP_CENTRALIZED_ROUTER");
+ config.startupControl = ZbStartTypeJoin;
+
+ /* Using the default HA preconfigured Link Key */
+ memcpy(config.security.preconfiguredLinkKey, sec_key_ha, ZB_SEC_KEYSIZE);
+
+ config.channelList.count = 1;
+ config.channelList.list[0].page = 0;
+ config.channelList.list[0].channelMask = WPAN_CHANNELMASK_2400MHZ;
+
+ /* Using ZbStartupWait (blocking) here instead of ZbStartup, in order to demonstrate how to do
+ * a blocking call on the M4. */
+ status = ZbStartupWait(zigbee_demo_info.zb, &config);
+
+ APP_DBG("ZbStartup Callback (status = 0x%02x)", status);
+ zigbee_demo_info.join_status = status;
+
+ if (status == ZB_STATUS_SUCCESS) {
+ zigbee_demo_info.join_delay = 0U;
+ zigbee_demo_info.init_after_join = true;
+ BSP_LED_On(SW3_LED);
+ }
+ else {
+ APP_DBG("Startup failed, attempting again after a short delay.");
+ zigbee_demo_info.join_delay = HAL_GetTick() + APP_ZIGBEE_STARTUP_FAIL_DELAY;
+ }
+ }
+
+ /*
+ * Handle Application (Switches and LEDs)
+ */
+ if (zigbee_demo_info.join_status == ZB_STATUS_SUCCESS) {
+ /* Check if we just joined */
+ if (zigbee_demo_info.init_after_join) {
+ zigbee_demo_info.init_after_join = false;
+
+ /* Assign ourselves to the group addresses */
+ config_group_addr();
+
+ /* Since we're using group addressing (broadcast), shorten the broadcast timeout */
+ uint32_t bcast_timeout = 3;
+ ZbNwkSet(zigbee_demo_info.zb, ZB_NWK_NIB_ID_NetworkBroadcastDeliveryTime, &bcast_timeout, sizeof(bcast_timeout));
+ }
+
+ /* Check for switch flags */
+ if (zigbee_demo_info.sw_flags != 0) {
+ struct ZbApsAddrT dst;
+
+ memset(&dst, 0, sizeof(dst));
+ dst.mode = ZB_APSDE_ADDRMODE_GROUP;
+
+ if ((zigbee_demo_info.sw_flags & SW1_FLAG) != 0) {
+ dst.endpoint = SW1_ENDPOINT;
+ dst.nwkAddr = SW1_GROUP_ADDR;
+
+ APP_DBG("SW1 PUSHED (SENDING TOGGLE TO GROUP 0x0001)");
+ if (ZbZclOnOffClientToggleReq(zigbee_demo_info.onoff_client_1, &dst, NULL, NULL) != ZB_STATUS_SUCCESS) {
+ APP_DBG("Error, ZbZclOnOffClientToggleReq failed (SW1_ENDPOINT)");
+ }
+ /* We will get a loopback message because we belong to the same APS Group,
+ * causing our own local LED to toggle. */
+ }
+
+ if ((zigbee_demo_info.sw_flags & SW2_FLAG) != 0) {
+ dst.endpoint = SW2_ENDPOINT;
+ dst.nwkAddr = SW2_GROUP_ADDR;
+
+ APP_DBG("SW2 PUSHED (SENDING TOGGLE TO GROUP 0x0002)");
+ if (ZbZclOnOffClientToggleReq(zigbee_demo_info.onoff_client_2, &dst, NULL, NULL) != ZB_STATUS_SUCCESS) {
+ APP_DBG("Error, ZbZclOnOffClientToggleReq failed (SW2_ENDPOINT)");
+ }
+ /* We will get a loopback message because we belong to the same APS Group,
+ * causing our own local LED to toggle. */
+ }
+
+ /* Clear the flags */
+ zigbee_demo_info.sw_flags = 0;
+ }
+
+ }
+
+ UTIL_SEQ_SetTask(1U << CFG_TASK_ZIGBEE_APP, CFG_SCH_PRIO_0);
+} /* APP_ZIGBEE_Demo */
+
+/*************************************************************
+ * ZbStartupWait Blocking Call
+ *************************************************************/
+
+struct ZbStartupWaitInfo {
+ bool active;
+ enum ZbStatusCodeT status;
+};
+
+static void ZbStartupWaitCb(enum ZbStatusCodeT status, void *cb_arg)
+{
+ struct ZbStartupWaitInfo *info = cb_arg;
+
+ info->status = status;
+ info->active = false;
+} /* ZbStartupWaitCb */
+
+enum ZbStatusCodeT ZbStartupWait(struct ZigBeeT *zb, struct ZbStartupT *config)
+{
+ struct ZbStartupWaitInfo *info;
+ enum ZbStatusCodeT status;
+
+ info = malloc(sizeof(struct ZbStartupWaitInfo));
+ if (info == NULL) {
+ return ZB_STATUS_ALLOC_FAIL;
+ }
+ memset(info, 0, sizeof(struct ZbStartupWaitInfo));
+
+ info->active = true;
+ status = ZbStartup(zb, config, ZbStartupWaitCb, info);
+ if (status != ZB_STATUS_SUCCESS) {
+ info->active = false;
+ return status;
+ }
+ while (info->active) {
+ UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
+ }
+ status = info->status;
+ free(info);
+ return status;
+} /* ZbStartupWait */
+
+/*************************************************************
+ * External Interrupt Handler
+ *************************************************************/
+
+/**
+ * @brief This function manage the Push button action
+ * @param GPIO_Pin : GPIO pin which has been activated
+ * @retval None
+ */
+void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
+{
+ switch (GPIO_Pin) {
+ case BUTTON_SW1_PIN:
+ zigbee_demo_info.sw_flags |= SW1_FLAG;
+ break;
+
+ case BUTTON_SW2_PIN:
+ zigbee_demo_info.sw_flags |= SW2_FLAG;
+ break;
+
+ case BUTTON_SW3_PIN:
+ APP_DBG("SW3 PUSHED (LOCAL LEDS OFF)");
+ ZbZclAttrIntegerWrite(zigbee_demo_info.onoff_server_1, ZCL_ONOFF_ATTR_ONOFF, 0);
+ ZbZclAttrIntegerWrite(zigbee_demo_info.onoff_server_2, ZCL_ONOFF_ATTR_ONOFF, 0);
+ break;
+
+ default:
+ break;
+ }
+} /* HAL_GPIO_EXTI_Callback */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/STM32_WPAN/Target/hw_ipcc.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/STM32_WPAN/Target/hw_ipcc.c
new file mode 100644
index 000000000..ab7f75b9a
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/STM32_WPAN/Target/hw_ipcc.c
@@ -0,0 +1,491 @@
+/**
+ ******************************************************************************
+ * File Name : Target/hw_ipcc.c
+ * Description : Hardware IPCC source file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "app_common.h"
+#include "mbox_def.h"
+
+/* Global variables ---------------------------------------------------------*/
+/* Private defines -----------------------------------------------------------*/
+#define HW_IPCC_TX_PENDING( channel ) ( !(LL_C1_IPCC_IsActiveFlag_CHx( IPCC, channel )) ) && (((~(IPCC->C1MR)) & (channel << 16U)))
+#define HW_IPCC_RX_PENDING( channel ) (LL_C2_IPCC_IsActiveFlag_CHx( IPCC, channel )) && (((~(IPCC->C1MR)) & (channel << 0U)))
+
+/* Private macros ------------------------------------------------------------*/
+/* Private typedef -----------------------------------------------------------*/
+/* Private variables ---------------------------------------------------------*/
+static void (*FreeBufCb)( void );
+
+/* Private function prototypes -----------------------------------------------*/
+static void HW_IPCC_BLE_EvtHandler( void );
+static void HW_IPCC_BLE_AclDataEvtHandler( void );
+static void HW_IPCC_MM_FreeBufHandler( void );
+static void HW_IPCC_SYS_CmdEvtHandler( void );
+static void HW_IPCC_SYS_EvtHandler( void );
+static void HW_IPCC_TRACES_EvtHandler( void );
+
+#ifdef THREAD_WB
+static void HW_IPCC_OT_CmdEvtHandler( void );
+static void HW_IPCC_THREAD_NotEvtHandler( void );
+static void HW_IPCC_THREAD_CliNotEvtHandler( void );
+#endif
+
+#ifdef MAC_802_15_4_WB
+static void HW_IPCC_MAC_802_15_4_CmdEvtHandler( void );
+static void HW_IPCC_MAC_802_15_4_NotEvtHandler( void );
+#endif
+
+#ifdef ZIGBEE_WB
+static void HW_IPCC_ZIGBEE_CmdEvtHandler( void );
+static void HW_IPCC_ZIGBEE_StackNotifEvtHandler( void );
+
+#endif
+
+/* Public function definition -----------------------------------------------*/
+
+/******************************************************************************
+ * INTERRUPT HANDLER
+ ******************************************************************************/
+void HW_IPCC_Rx_Handler( void )
+{
+ if (HW_IPCC_RX_PENDING( HW_IPCC_SYSTEM_EVENT_CHANNEL ))
+ {
+ HW_IPCC_SYS_EvtHandler();
+ }
+#ifdef MAC_802_15_4_WB
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL ))
+ {
+ HW_IPCC_MAC_802_15_4_NotEvtHandler();
+ }
+#endif /* MAC_802_15_4_WB */
+#ifdef THREAD_WB
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL ))
+ {
+ HW_IPCC_THREAD_NotEvtHandler();
+ }
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL ))
+ {
+ HW_IPCC_THREAD_CliNotEvtHandler();
+ }
+#endif /* MAC_802_15_4_WB */
+#ifdef ZIGBEE_WB
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_ZIGBEE_APPLI_NOTIF_ACK_CHANNEL ))
+ {
+ HW_IPCC_ZIGBEE_StackNotifEvtHandler();
+ }
+#endif /* ZIGBEE_WB */
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_BLE_EVENT_CHANNEL ))
+ {
+ HW_IPCC_BLE_EvtHandler();
+ }
+ else if (HW_IPCC_RX_PENDING( HW_IPCC_TRACES_CHANNEL ))
+ {
+ HW_IPCC_TRACES_EvtHandler();
+ }
+
+ return;
+}
+
+void HW_IPCC_Tx_Handler( void )
+{
+ if (HW_IPCC_TX_PENDING( HW_IPCC_SYSTEM_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_SYS_CmdEvtHandler();
+ }
+#ifdef MAC_802_15_4_WB
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_MAC_802_15_4_CmdEvtHandler();
+ }
+#endif /* MAC_802_15_4_WB */
+#ifdef THREAD_WB
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_OT_CmdEvtHandler();
+ }
+#endif /* THREAD_WB */
+#ifdef ZIGBEE_WB
+ if (HW_IPCC_TX_PENDING( HW_IPCC_ZIGBEE_CMD_APPLI_CHANNEL ))
+ {
+ HW_IPCC_ZIGBEE_CmdEvtHandler();
+ }
+#endif /* ZIGBEE_WB */
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_SYSTEM_CMD_RSP_CHANNEL ))
+ {
+ HW_IPCC_SYS_CmdEvtHandler();
+ }
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_MM_RELEASE_BUFFER_CHANNEL ))
+ {
+ HW_IPCC_MM_FreeBufHandler();
+ }
+ else if (HW_IPCC_TX_PENDING( HW_IPCC_HCI_ACL_DATA_CHANNEL ))
+ {
+ HW_IPCC_BLE_AclDataEvtHandler();
+ }
+
+ return;
+}
+/******************************************************************************
+ * GENERAL
+ ******************************************************************************/
+void HW_IPCC_Enable( void )
+{
+ /**
+ * In case the SBSFU is implemented, it may have already set the C2BOOT bit to startup the CPU2.
+ * In that case, to keep the mechanism transparent to the user application, it shall call the system command
+ * SHCI_C2_Reinit( ) before jumping to the application.
+ * When the CPU2 receives that command, it waits for its event input to be set to restart the CPU2 firmware.
+ * This is required because once C2BOOT has been set once, a clear/set on C2BOOT has no effect.
+ * When SHCI_C2_Reinit( ) is not called, generating an event to the CPU2 does not have any effect
+ * So, by default, the application shall both set the event flag and set the C2BOOT bit.
+ */
+ __SEV( ); /* Set the internal event flag and send an event to the CPU2 */
+ __WFE( ); /* Clear the internal event flag */
+ LL_PWR_EnableBootC2( );
+
+ return;
+}
+
+void HW_IPCC_Init( void )
+{
+ LL_AHB3_GRP1_EnableClock( LL_AHB3_GRP1_PERIPH_IPCC );
+
+ LL_C1_IPCC_EnableIT_RXO( IPCC );
+ LL_C1_IPCC_EnableIT_TXF( IPCC );
+
+ HAL_NVIC_EnableIRQ(IPCC_C1_RX_IRQn);
+ HAL_NVIC_EnableIRQ(IPCC_C1_TX_IRQn);
+
+ return;
+}
+
+/******************************************************************************
+ * BLE
+ ******************************************************************************/
+void HW_IPCC_BLE_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_BLE_EVENT_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_BLE_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_BLE_CMD_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_BLE_EvtHandler( void )
+{
+ HW_IPCC_BLE_RxEvtNot();
+
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_BLE_EVENT_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_BLE_SendAclData( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_HCI_ACL_DATA_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_HCI_ACL_DATA_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_BLE_AclDataEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_HCI_ACL_DATA_CHANNEL );
+
+ HW_IPCC_BLE_AclDataAckNot();
+
+ return;
+}
+
+__weak void HW_IPCC_BLE_AclDataAckNot( void ){};
+__weak void HW_IPCC_BLE_RxEvtNot( void ){};
+
+/******************************************************************************
+ * SYSTEM
+ ******************************************************************************/
+void HW_IPCC_SYS_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_SYSTEM_EVENT_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_SYS_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_SYSTEM_CMD_RSP_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_SYSTEM_CMD_RSP_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_SYS_CmdEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_SYSTEM_CMD_RSP_CHANNEL );
+
+ HW_IPCC_SYS_CmdEvtNot();
+
+ return;
+}
+
+static void HW_IPCC_SYS_EvtHandler( void )
+{
+ HW_IPCC_SYS_EvtNot();
+
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_SYSTEM_EVENT_CHANNEL );
+
+ return;
+}
+
+__weak void HW_IPCC_SYS_CmdEvtNot( void ){};
+__weak void HW_IPCC_SYS_EvtNot( void ){};
+
+/******************************************************************************
+ * THREAD
+ ******************************************************************************/
+#ifdef THREAD_WB
+void HW_IPCC_THREAD_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_OT_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_CLI_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_THREAD_CLI_CMD_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_THREAD_SendAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_THREAD_CliSendAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_OT_CmdEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+
+ HW_IPCC_OT_CmdEvtNot();
+
+ return;
+}
+
+static void HW_IPCC_THREAD_NotEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_THREAD_EvtNot();
+
+ return;
+}
+
+static void HW_IPCC_THREAD_CliNotEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_THREAD_CliEvtNot();
+
+ return;
+}
+
+__weak void HW_IPCC_OT_CmdEvtNot( void ){};
+__weak void HW_IPCC_CLI_CmdEvtNot( void ){};
+__weak void HW_IPCC_THREAD_EvtNot( void ){};
+
+#endif /* THREAD_WB */
+/******************************************************************************
+ * ZIGBEE
+ ******************************************************************************/
+#ifdef ZIGBEE_WB
+void HW_IPCC_ZIGBEE_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_ZIGBEE_SendAppliCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_ZIGBEE_SendAppliCmdAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_ZIGBEE_CmdEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL );
+
+ HW_IPCC_ZIGBEE_AppliCmdNotification();
+
+ return;
+}
+
+static void HW_IPCC_ZIGBEE_StackNotifEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_ZIGBEE_AppliAsyncEvtNotification();
+
+ return;
+}
+
+
+
+__weak void HW_IPCC_ZIGBEE_AppliCmdNotification( void ){};
+__weak void HW_IPCC_ZIGBEE_AppliAsyncEvtNotification( void ){};
+#endif /* ZIGBEE_WB */
+
+
+/******************************************************************************
+ * MEMORY MANAGER
+ ******************************************************************************/
+void HW_IPCC_MM_SendFreeBuf( void (*cb)( void ) )
+{
+ if ( LL_C1_IPCC_IsActiveFlag_CHx( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL ) )
+ {
+ FreeBufCb = cb;
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+ }
+ else
+ {
+ cb();
+
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+ }
+
+ return;
+}
+
+static void HW_IPCC_MM_FreeBufHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+
+ FreeBufCb();
+
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL );
+
+ return;
+}
+
+/******************************************************************************
+ * TRACES
+ ******************************************************************************/
+void HW_IPCC_TRACES_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_TRACES_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_TRACES_EvtHandler( void )
+{
+ HW_IPCC_TRACES_EvtNot();
+
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_TRACES_CHANNEL );
+
+ return;
+}
+
+__weak void HW_IPCC_TRACES_EvtNot( void ){};
+
+
+/******************************************************************************
+ * MAC 802.15.4
+ ******************************************************************************/
+#ifdef MAC_802_15_4_WB
+void HW_IPCC_MAC_802_15_4_Init( void )
+{
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_MAC_802_15_4_SendCmd( void )
+{
+ LL_C1_IPCC_SetFlag_CHx( IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL );
+ LL_C1_IPCC_EnableTransmitChannel( IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL );
+
+ return;
+}
+
+void HW_IPCC_MAC_802_15_4_SendAck( void )
+{
+ LL_C1_IPCC_ClearFlag_CHx( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+ LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+
+ return;
+}
+
+static void HW_IPCC_MAC_802_15_4_CmdEvtHandler( void )
+{
+ LL_C1_IPCC_DisableTransmitChannel( IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL );
+
+ HW_IPCC_MAC_802_15_4_CmdEvtNot();
+
+ return;
+}
+
+static void HW_IPCC_MAC_802_15_4_NotEvtHandler( void )
+{
+ LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL );
+
+ HW_IPCC_MAC_802_15_4_EvtNot();
+
+ return;
+}
+__weak void HW_IPCC_MAC_802_15_4_CmdEvtNot( void ){};
+__weak void HW_IPCC_MAC_802_15_4_EvtNot( void ){};
+#endif
+
+/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/readme.txt b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/readme.txt
new file mode 100644
index 000000000..b453fced2
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee/Zigbee_OnOff_Router/readme.txt
@@ -0,0 +1,138 @@
+/**
+ @page Zigbee_OnOff_Router application
+
+ @verbatim
+ ******************************************************************************
+ * @file Zigbee/Zigbee_OnOff_Router/readme.txt
+ * @author MCD Application Team
+ * @brief Description of the Zigbee OnOff Cluster application using a
+ * centralized network. This application concerns only the
+ * router role.
+ ******************************************************************************
+ *
+ * Copyright (c) 2019 STMicroelectronics. All rights reserved.
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ @endverbatim
+
+@par Application Description
+
+How to use OnOff cluster on a Centralized Zigbee network with device acting as router.
+
+The purpose of this application is to show how to create a centralized Zigbee network, and how to communicate
+from one node to another one using the OnOff cluster. Once the Zigbee mesh network is created, the
+user can send requests to the different boards through the push buttons in order to make the LED toggling.
+
+Each device acts as a client and a server at the same time, making the communication between the different
+boards symmetrical (bi-directorial)
+
+
+ Device 1 Device 2
+
+ --------- ---------
+ | | ZbZclOnOffClientToggleReq | |
+ PushB=>|Client | -----------------------------------> |Server | =>LED
+ | | | |
+ | | | |
+ | | ZbZclOnOffClientToggleReq | |
+ LED <= |Server | <------------------------------------|Client |<=PushB
+ | | | |
+ -------- ---------
+
+
+This application requires at minimum two STM32WB55xx nucleo boards, but you can use up four boards.
+
+This application requests having the stm32wb5x_zigbee_full_fw.bin binary flashed on the wireless coprocessor
+and the correct binary flashed on the application processor.
+
+Important note :
+================
+As it is a centralized network, to run this application, you need to have one device acting
+as coordinator and all the others devices acting as routers.
+
+One board must be flashed with the binary generated by the application located under Zigbee/Zigbee_OnOff_Coord.
+The other boards must be flashed with the binary generated by this application (Zigbee/Zigbee_OnOff_Router)
+
+To run the application :
+
+ a) Once the boards have been flashed, eboot the different devices one by one.
+ There must be on board configured in coordinator mode, and all
+ other boards should be configured in router mode.
+
+ b) Wait for a few seconds (around 5 sec), it order to let the zigbee mesh network being created.
+
+ c) At this stage, a Zigbee network is automatically created and it is possible to send OnOffCluster commands
+ in multicast mode by pressing on the SW1 or SW2 push button.
+ Press on SW1 (resp SW2) . You must see the LED1 (resp LED2) toggling on all board connected to this newly created
+ Zigbee network.
+
+
+ ---------- -----------
+ |Device 1 |............|Device 2 |
+ |(Coord.) | |(Router) |
+ ----------- -----------
+ . .
+ . .
+ . .
+ ----------- .
+ |Device 3 |...................
+ |(Router) |
+ -----------
+
+ .
+@par Hardware and Software environment
+
+ - This example runs on STM32WB55xx devices (Nucleo board)
+
+ - This example has been tested with an STMicroelectronics STM32WB55RG_Nucleo
+ board and can be easily tailored to any other supported device
+ and development board.
+
+ - On STM32WB55RG_Nucleo, the jumpers must be configured as described
+ in this section. Starting from the top left position up to the bottom
+ right position, the jumpers on the Board must be set as follows:
+
+ CN11: GND [OFF]
+ JP4: VDDRF [ON]
+ JP6: VC0 [ON]
+ JP2: +3V3 [ON]
+ JP1: USB_STL [ON] All others [OFF]
+ CN12: GND [OFF]
+ CN7: <All> [OFF]
+ JP3: VDD_MCU [ON]
+ JP5: GND [OFF] All others [ON]
+ CN10: <All> [OFF]
+
+
+@par How to use it ?
+
+=> Loading of the stm32wb5x_zigbee_full_fw.bin binary
+
+ This application requests having the stm32wb5x_zigbee_full_fw.bin binary flashed on the Wireless Coprocessor.
+ If it is not the case, you need to use STM32CubeProgrammer to load the appropriate binary.
+ All available binaries are located under /Projects/STM32_Copro_Wireless_Binaries directory.
+ Refer to UM2237 to learn how to use/install STM32CubeProgrammer.
+ Refer to /Projects/STM32_Copro_Wireless_Binaries/ReleaseNote.html for the detailed procedure to change the
+ Wireless Coprocessor binary.
+
+=> Getting traces
+ To get the traces you need to connect your Board to the Hyperterminal (through the STLink Virtual COM Port).
+ The UART must be configured as follows:
+
+ - BaudRate = 115200 baud
+ - Word Length = 8 Bits
+ - Stop Bit = 1 bit
+ - Parity = none
+ - Flow control = none
+
+=> Running the application
+
+ Refer to the Application description at the beginning of this readme.txt
+
+ * <h3><center>&copy; COPYRIGHT STMicroelectronics</center></h3>
+
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Demonstrations/Adafruit_LCD_1_8_SD_Joystick/SW4STM32/Adafruit_LCD_1_8_SD_Joystick/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Demonstrations/Adafruit_LCD_1_8_SD_Joystick/SW4STM32/Adafruit_LCD_1_8_SD_Joystick/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Demonstrations/Adafruit_LCD_1_8_SD_Joystick/SW4STM32/Adafruit_LCD_1_8_SD_Joystick/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Demonstrations/Adafruit_LCD_1_8_SD_Joystick/SW4STM32/Adafruit_LCD_1_8_SD_Joystick/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Demonstrations/Adafruit_LCD_1_8_SD_Joystick/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Demonstrations/Adafruit_LCD_1_8_SD_Joystick/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Demonstrations/Adafruit_LCD_1_8_SD_Joystick/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Demonstrations/Adafruit_LCD_1_8_SD_Joystick/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_AnalogWatchdog/SW4STM32/ADC_AnalogWatchdog/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_AnalogWatchdog/SW4STM32/ADC_AnalogWatchdog/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_AnalogWatchdog/SW4STM32/ADC_AnalogWatchdog/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_AnalogWatchdog/SW4STM32/ADC_AnalogWatchdog/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_AnalogWatchdog/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_AnalogWatchdog/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_AnalogWatchdog/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_AnalogWatchdog/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_MultiChannelSingleConversion/SW4STM32/ADC_MultiChannelSingleConversion/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_MultiChannelSingleConversion/SW4STM32/ADC_MultiChannelSingleConversion/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_MultiChannelSingleConversion/SW4STM32/ADC_MultiChannelSingleConversion/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_MultiChannelSingleConversion/SW4STM32/ADC_MultiChannelSingleConversion/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_MultiChannelSingleConversion/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_MultiChannelSingleConversion/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_MultiChannelSingleConversion/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_MultiChannelSingleConversion/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_Oversampling/SW4STM32/ADC_Oversampling/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_Oversampling/SW4STM32/ADC_Oversampling/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_Oversampling/SW4STM32/ADC_Oversampling/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_Oversampling/SW4STM32/ADC_Oversampling/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_Oversampling/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_Oversampling/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_Oversampling/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_Oversampling/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_SingleConversion_TriggerSW_IT/SW4STM32/ADC_SingleConversion_TriggerSW_IT/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_SingleConversion_TriggerSW_IT/SW4STM32/ADC_SingleConversion_TriggerSW_IT/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_SingleConversion_TriggerSW_IT/SW4STM32/ADC_SingleConversion_TriggerSW_IT/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_SingleConversion_TriggerSW_IT/SW4STM32/ADC_SingleConversion_TriggerSW_IT/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_SingleConversion_TriggerSW_IT/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_SingleConversion_TriggerSW_IT/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_SingleConversion_TriggerSW_IT/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_SingleConversion_TriggerSW_IT/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_SingleConversion_TriggerTimer_DMA/SW4STM32/ADC_SingleConversion_TriggerTimer_DMA/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_SingleConversion_TriggerTimer_DMA/SW4STM32/ADC_SingleConversion_TriggerTimer_DMA/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_SingleConversion_TriggerTimer_DMA/SW4STM32/ADC_SingleConversion_TriggerTimer_DMA/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_SingleConversion_TriggerTimer_DMA/SW4STM32/ADC_SingleConversion_TriggerTimer_DMA/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_SingleConversion_TriggerTimer_DMA/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_SingleConversion_TriggerTimer_DMA/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_SingleConversion_TriggerTimer_DMA/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/ADC/ADC_SingleConversion_TriggerTimer_DMA/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/BSP/BSP_Example/SW4STM32/BSP_Example/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/BSP/BSP_Example/SW4STM32/BSP_Example/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/BSP/BSP_Example/SW4STM32/BSP_Example/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/BSP/BSP_Example/SW4STM32/BSP_Example/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/BSP/BSP_Example/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/BSP/BSP_Example/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/BSP/BSP_Example/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/BSP/BSP_Example/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/COMP/COMP_CompareGpioVsVrefInt_IT/SW4STM32/COMP_CompareGpioVsVrefInt_IT/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/COMP/COMP_CompareGpioVsVrefInt_IT/SW4STM32/COMP_CompareGpioVsVrefInt_IT/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/COMP/COMP_CompareGpioVsVrefInt_IT/SW4STM32/COMP_CompareGpioVsVrefInt_IT/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/COMP/COMP_CompareGpioVsVrefInt_IT/SW4STM32/COMP_CompareGpioVsVrefInt_IT/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/COMP/COMP_CompareGpioVsVrefInt_IT/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/COMP/COMP_CompareGpioVsVrefInt_IT/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/COMP/COMP_CompareGpioVsVrefInt_IT/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/COMP/COMP_CompareGpioVsVrefInt_IT/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/COMP/COMP_CompareGpioVsVrefInt_Window_IT/SW4STM32/COMP_CompareGpioVsVrefInt_Window_IT/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/COMP/COMP_CompareGpioVsVrefInt_Window_IT/SW4STM32/COMP_CompareGpioVsVrefInt_Window_IT/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/COMP/COMP_CompareGpioVsVrefInt_Window_IT/SW4STM32/COMP_CompareGpioVsVrefInt_Window_IT/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/COMP/COMP_CompareGpioVsVrefInt_Window_IT/SW4STM32/COMP_CompareGpioVsVrefInt_Window_IT/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/COMP/COMP_CompareGpioVsVrefInt_Window_IT/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/COMP/COMP_CompareGpioVsVrefInt_Window_IT/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/COMP/COMP_CompareGpioVsVrefInt_Window_IT/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/COMP/COMP_CompareGpioVsVrefInt_Window_IT/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRC/CRC_Example/SW4STM32/CRC_Example/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRC/CRC_Example/SW4STM32/CRC_Example/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRC/CRC_Example/SW4STM32/CRC_Example/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRC/CRC_Example/SW4STM32/CRC_Example/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRC/CRC_Example/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRC/CRC_Example/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRC/CRC_Example/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRC/CRC_Example/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRC/CRC_UserDefinedPolynomial/SW4STM32/CRC_UserDefinedPolynomial/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRC/CRC_UserDefinedPolynomial/SW4STM32/CRC_UserDefinedPolynomial/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRC/CRC_UserDefinedPolynomial/SW4STM32/CRC_UserDefinedPolynomial/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRC/CRC_UserDefinedPolynomial/SW4STM32/CRC_UserDefinedPolynomial/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRC/CRC_UserDefinedPolynomial/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRC/CRC_UserDefinedPolynomial/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRC/CRC_UserDefinedPolynomial/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRC/CRC_UserDefinedPolynomial/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRYP/CRYP_AESModes/SW4STM32/CRYP_AESModes/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRYP/CRYP_AESModes/SW4STM32/CRYP_AESModes/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRYP/CRYP_AESModes/SW4STM32/CRYP_AESModes/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRYP/CRYP_AESModes/SW4STM32/CRYP_AESModes/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRYP/CRYP_AESModes/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRYP/CRYP_AESModes/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRYP/CRYP_AESModes/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRYP/CRYP_AESModes/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRYP/CRYP_DMA/SW4STM32/CRYP_DMA/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRYP/CRYP_DMA/SW4STM32/CRYP_DMA/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRYP/CRYP_DMA/SW4STM32/CRYP_DMA/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRYP/CRYP_DMA/SW4STM32/CRYP_DMA/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRYP/CRYP_DMA/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRYP/CRYP_DMA/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRYP/CRYP_DMA/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/CRYP/CRYP_DMA/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/Cortex/CORTEXM_MPU/SW4STM32/CORTEXM_MPU/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/Cortex/CORTEXM_MPU/SW4STM32/CORTEXM_MPU/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/Cortex/CORTEXM_MPU/SW4STM32/CORTEXM_MPU/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/Cortex/CORTEXM_MPU/SW4STM32/CORTEXM_MPU/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/Cortex/CORTEXM_MPU/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/Cortex/CORTEXM_MPU/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/Cortex/CORTEXM_MPU/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/Cortex/CORTEXM_MPU/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/Cortex/CORTEXM_ModePrivilege/SW4STM32/CORTEXM_ModePrivilege/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/Cortex/CORTEXM_ModePrivilege/SW4STM32/CORTEXM_ModePrivilege/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/Cortex/CORTEXM_ModePrivilege/SW4STM32/CORTEXM_ModePrivilege/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/Cortex/CORTEXM_ModePrivilege/SW4STM32/CORTEXM_ModePrivilege/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/Cortex/CORTEXM_ModePrivilege/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/Cortex/CORTEXM_ModePrivilege/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/Cortex/CORTEXM_ModePrivilege/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/Cortex/CORTEXM_ModePrivilege/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/Cortex/CORTEXM_SysTick/SW4STM32/CORTEXM_SysTick/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/Cortex/CORTEXM_SysTick/SW4STM32/CORTEXM_SysTick/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/Cortex/CORTEXM_SysTick/SW4STM32/CORTEXM_SysTick/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/Cortex/CORTEXM_SysTick/SW4STM32/CORTEXM_SysTick/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/Cortex/CORTEXM_SysTick/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/Cortex/CORTEXM_SysTick/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/Cortex/CORTEXM_SysTick/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/Cortex/CORTEXM_SysTick/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/DMA/DMA_FLASHToRAM/SW4STM32/DMA_FLASHToRAM/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/DMA/DMA_FLASHToRAM/SW4STM32/DMA_FLASHToRAM/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/DMA/DMA_FLASHToRAM/SW4STM32/DMA_FLASHToRAM/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/DMA/DMA_FLASHToRAM/SW4STM32/DMA_FLASHToRAM/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/DMA/DMA_FLASHToRAM/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/DMA/DMA_FLASHToRAM/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/DMA/DMA_FLASHToRAM/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/DMA/DMA_FLASHToRAM/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/DMA/DMA_MUXSYNC/SW4STM32/DMA_MUXSYNC/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/DMA/DMA_MUXSYNC/SW4STM32/DMA_MUXSYNC/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/DMA/DMA_MUXSYNC/SW4STM32/DMA_MUXSYNC/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/DMA/DMA_MUXSYNC/SW4STM32/DMA_MUXSYNC/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/DMA/DMA_MUXSYNC/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/DMA/DMA_MUXSYNC/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/DMA/DMA_MUXSYNC/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/DMA/DMA_MUXSYNC/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/DMA/DMA_MUX_RequestGen/SW4STM32/DMA_MUX_RequestGen/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/DMA/DMA_MUX_RequestGen/SW4STM32/DMA_MUX_RequestGen/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/DMA/DMA_MUX_RequestGen/SW4STM32/DMA_MUX_RequestGen/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/DMA/DMA_MUX_RequestGen/SW4STM32/DMA_MUX_RequestGen/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/DMA/DMA_MUX_RequestGen/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/DMA/DMA_MUX_RequestGen/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/DMA/DMA_MUX_RequestGen/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/DMA/DMA_MUX_RequestGen/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/FLASH/FLASH_EraseProgram/SW4STM32/FLASH_EraseProgram/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/FLASH/FLASH_EraseProgram/SW4STM32/FLASH_EraseProgram/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/FLASH/FLASH_EraseProgram/SW4STM32/FLASH_EraseProgram/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/FLASH/FLASH_EraseProgram/SW4STM32/FLASH_EraseProgram/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/FLASH/FLASH_EraseProgram/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/FLASH/FLASH_EraseProgram/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/FLASH/FLASH_EraseProgram/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/FLASH/FLASH_EraseProgram/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/FLASH/FLASH_WriteProtection/SW4STM32/FLASH_WriteProtection/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/FLASH/FLASH_WriteProtection/SW4STM32/FLASH_WriteProtection/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/FLASH/FLASH_WriteProtection/SW4STM32/FLASH_WriteProtection/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/FLASH/FLASH_WriteProtection/SW4STM32/FLASH_WriteProtection/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/FLASH/FLASH_WriteProtection/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/FLASH/FLASH_WriteProtection/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/FLASH/FLASH_WriteProtection/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/FLASH/FLASH_WriteProtection/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/GPIO/GPIO_EXTI/SW4STM32/GPIO_EXTI/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/GPIO/GPIO_EXTI/SW4STM32/GPIO_EXTI/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/GPIO/GPIO_EXTI/SW4STM32/GPIO_EXTI/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/GPIO/GPIO_EXTI/SW4STM32/GPIO_EXTI/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/GPIO/GPIO_EXTI/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/GPIO/GPIO_EXTI/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/GPIO/GPIO_EXTI/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/GPIO/GPIO_EXTI/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/GPIO/GPIO_IOToggle/SW4STM32/GPIO_IOToggle/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/GPIO/GPIO_IOToggle/SW4STM32/GPIO_IOToggle/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/GPIO/GPIO_IOToggle/SW4STM32/GPIO_IOToggle/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/GPIO/GPIO_IOToggle/SW4STM32/GPIO_IOToggle/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/GPIO/GPIO_IOToggle/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/GPIO/GPIO_IOToggle/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/GPIO/GPIO_IOToggle/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/GPIO/GPIO_IOToggle/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase/SW4STM32/HAL_TimeBase/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase/SW4STM32/HAL_TimeBase/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase/SW4STM32/HAL_TimeBase/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase/SW4STM32/HAL_TimeBase/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase_RTC_ALARM/SW4STM32/HAL_TimeBase_RTC_ALARM/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase_RTC_ALARM/SW4STM32/HAL_TimeBase_RTC_ALARM/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase_RTC_ALARM/SW4STM32/HAL_TimeBase_RTC_ALARM/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase_RTC_ALARM/SW4STM32/HAL_TimeBase_RTC_ALARM/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase_RTC_ALARM/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase_RTC_ALARM/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase_RTC_ALARM/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase_RTC_ALARM/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase_RTC_WKUP/SW4STM32/HAL_TimeBase_RTC_WKUP/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase_RTC_WKUP/SW4STM32/HAL_TimeBase_RTC_WKUP/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase_RTC_WKUP/SW4STM32/HAL_TimeBase_RTC_WKUP/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase_RTC_WKUP/SW4STM32/HAL_TimeBase_RTC_WKUP/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase_RTC_WKUP/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase_RTC_WKUP/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase_RTC_WKUP/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase_RTC_WKUP/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase_TIM/SW4STM32/HAL_TimeBase_TIM/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase_TIM/SW4STM32/HAL_TimeBase_TIM/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase_TIM/SW4STM32/HAL_TimeBase_TIM/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase_TIM/SW4STM32/HAL_TimeBase_TIM/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase_TIM/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase_TIM/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase_TIM/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/HAL/HAL_TimeBase_TIM/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/HSEM/HSEM_ProcessSync/SW4STM32/HSEM_ProcessSync/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/HSEM/HSEM_ProcessSync/SW4STM32/HSEM_ProcessSync/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/HSEM/HSEM_ProcessSync/SW4STM32/HSEM_ProcessSync/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/HSEM/HSEM_ProcessSync/SW4STM32/HSEM_ProcessSync/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/HSEM/HSEM_ProcessSync/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/HSEM/HSEM_ProcessSync/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/HSEM/HSEM_ProcessSync/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/HSEM/HSEM_ProcessSync/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/HSEM/HSEM_ReadLock/SW4STM32/HSEM_ReadLock/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/HSEM/HSEM_ReadLock/SW4STM32/HSEM_ReadLock/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/HSEM/HSEM_ReadLock/SW4STM32/HSEM_ReadLock/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/HSEM/HSEM_ReadLock/SW4STM32/HSEM_ReadLock/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/HSEM/HSEM_ReadLock/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/HSEM/HSEM_ReadLock/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/HSEM/HSEM_ReadLock/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/HSEM/HSEM_ReadLock/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_AdvComIT/SW4STM32/I2C_TwoBoards_AdvComIT/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_AdvComIT/SW4STM32/I2C_TwoBoards_AdvComIT/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_AdvComIT/SW4STM32/I2C_TwoBoards_AdvComIT/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_AdvComIT/SW4STM32/I2C_TwoBoards_AdvComIT/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_AdvComIT/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_AdvComIT/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_AdvComIT/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_AdvComIT/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_ComDMA/SW4STM32/I2C_TwoBoards_ComDMA/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_ComDMA/SW4STM32/I2C_TwoBoards_ComDMA/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_ComDMA/SW4STM32/I2C_TwoBoards_ComDMA/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_ComDMA/SW4STM32/I2C_TwoBoards_ComDMA/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_ComDMA/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_ComDMA/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_ComDMA/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_ComDMA/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_ComIT/SW4STM32/I2C_TwoBoards_ComIT/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_ComIT/SW4STM32/I2C_TwoBoards_ComIT/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_ComIT/SW4STM32/I2C_TwoBoards_ComIT/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_ComIT/SW4STM32/I2C_TwoBoards_ComIT/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_ComIT/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_ComIT/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_ComIT/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_ComIT/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_ComPolling/SW4STM32/I2C_TwoBoards_ComPolling/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_ComPolling/SW4STM32/I2C_TwoBoards_ComPolling/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_ComPolling/SW4STM32/I2C_TwoBoards_ComPolling/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_ComPolling/SW4STM32/I2C_TwoBoards_ComPolling/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_ComPolling/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_ComPolling/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_ComPolling/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_ComPolling/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_RestartAdvComIT/SW4STM32/I2C_TwoBoards_RestartAdvComIT/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_RestartAdvComIT/SW4STM32/I2C_TwoBoards_RestartAdvComIT/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_RestartAdvComIT/SW4STM32/I2C_TwoBoards_RestartAdvComIT/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_RestartAdvComIT/SW4STM32/I2C_TwoBoards_RestartAdvComIT/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_RestartAdvComIT/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_RestartAdvComIT/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_RestartAdvComIT/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_RestartAdvComIT/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_RestartComIT/SW4STM32/I2C_TwoBoards_RestartComIT/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_RestartComIT/SW4STM32/I2C_TwoBoards_RestartComIT/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_RestartComIT/SW4STM32/I2C_TwoBoards_RestartComIT/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_RestartComIT/SW4STM32/I2C_TwoBoards_RestartComIT/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_RestartComIT/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_RestartComIT/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_RestartComIT/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_TwoBoards_RestartComIT/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_WakeUpFromStop/SW4STM32/I2C_WakeUpFromStop/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_WakeUpFromStop/SW4STM32/I2C_WakeUpFromStop/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_WakeUpFromStop/SW4STM32/I2C_WakeUpFromStop/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_WakeUpFromStop/SW4STM32/I2C_WakeUpFromStop/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_WakeUpFromStop/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_WakeUpFromStop/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_WakeUpFromStop/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_WakeUpFromStop/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_WakeUpFromStop2/SW4STM32/I2C_WakeUpFromStop2/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_WakeUpFromStop2/SW4STM32/I2C_WakeUpFromStop2/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_WakeUpFromStop2/SW4STM32/I2C_WakeUpFromStop2/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_WakeUpFromStop2/SW4STM32/I2C_WakeUpFromStop2/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_WakeUpFromStop2/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_WakeUpFromStop2/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_WakeUpFromStop2/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/I2C/I2C_WakeUpFromStop2/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/IWDG/IWDG_Reset/SW4STM32/IWDG_Reset/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/IWDG/IWDG_Reset/SW4STM32/IWDG_Reset/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/IWDG/IWDG_Reset/SW4STM32/IWDG_Reset/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/IWDG/IWDG_Reset/SW4STM32/IWDG_Reset/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/IWDG/IWDG_Reset/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/IWDG/IWDG_Reset/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/IWDG/IWDG_Reset/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/IWDG/IWDG_Reset/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/IWDG/IWDG_WindowMode/SW4STM32/IWDG_WindowMode/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/IWDG/IWDG_WindowMode/SW4STM32/IWDG_WindowMode/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/IWDG/IWDG_WindowMode/SW4STM32/IWDG_WindowMode/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/IWDG/IWDG_WindowMode/SW4STM32/IWDG_WindowMode/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/IWDG/IWDG_WindowMode/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/IWDG/IWDG_WindowMode/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/IWDG/IWDG_WindowMode/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/IWDG/IWDG_WindowMode/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/LCD/LCD_SegmentsDrive/SW4STM32/LCD_SegmentsDrive/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/LCD/LCD_SegmentsDrive/SW4STM32/LCD_SegmentsDrive/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/LCD/LCD_SegmentsDrive/SW4STM32/LCD_SegmentsDrive/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/LCD/LCD_SegmentsDrive/SW4STM32/LCD_SegmentsDrive/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/LCD/LCD_SegmentsDrive/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/LCD/LCD_SegmentsDrive/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/LCD/LCD_SegmentsDrive/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/LCD/LCD_SegmentsDrive/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_PWMExternalClock/SW4STM32/LPTIM_PWMExternalClock/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_PWMExternalClock/SW4STM32/LPTIM_PWMExternalClock/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_PWMExternalClock/SW4STM32/LPTIM_PWMExternalClock/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_PWMExternalClock/SW4STM32/LPTIM_PWMExternalClock/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_PWMExternalClock/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_PWMExternalClock/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_PWMExternalClock/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_PWMExternalClock/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_PWM_LSE/SW4STM32/LPTIM_PWM_LSE/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_PWM_LSE/SW4STM32/LPTIM_PWM_LSE/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_PWM_LSE/SW4STM32/LPTIM_PWM_LSE/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_PWM_LSE/SW4STM32/LPTIM_PWM_LSE/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_PWM_LSE/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_PWM_LSE/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_PWM_LSE/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_PWM_LSE/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_PulseCounter/SW4STM32/LPTIM_PulseCounter/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_PulseCounter/SW4STM32/LPTIM_PulseCounter/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_PulseCounter/SW4STM32/LPTIM_PulseCounter/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_PulseCounter/SW4STM32/LPTIM_PulseCounter/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_PulseCounter/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_PulseCounter/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_PulseCounter/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_PulseCounter/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_Timeout/SW4STM32/LPTIM_Timeout/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_Timeout/SW4STM32/LPTIM_Timeout/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_Timeout/SW4STM32/LPTIM_Timeout/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_Timeout/SW4STM32/LPTIM_Timeout/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_Timeout/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_Timeout/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_Timeout/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/LPTIM/LPTIM_Timeout/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECCscalarMultiplication/SW4STM32/PKA_ECCscalarMultiplication/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECCscalarMultiplication/SW4STM32/PKA_ECCscalarMultiplication/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECCscalarMultiplication/SW4STM32/PKA_ECCscalarMultiplication/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECCscalarMultiplication/SW4STM32/PKA_ECCscalarMultiplication/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECCscalarMultiplication/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECCscalarMultiplication/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECCscalarMultiplication/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECCscalarMultiplication/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECCscalarMultiplication_IT/SW4STM32/PKA_ECCscalarMultiplication_IT/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECCscalarMultiplication_IT/SW4STM32/PKA_ECCscalarMultiplication_IT/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECCscalarMultiplication_IT/SW4STM32/PKA_ECCscalarMultiplication_IT/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECCscalarMultiplication_IT/SW4STM32/PKA_ECCscalarMultiplication_IT/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECCscalarMultiplication_IT/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECCscalarMultiplication_IT/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECCscalarMultiplication_IT/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECCscalarMultiplication_IT/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Sign/SW4STM32/PKA_ECDSA_Sign/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Sign/SW4STM32/PKA_ECDSA_Sign/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Sign/SW4STM32/PKA_ECDSA_Sign/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Sign/SW4STM32/PKA_ECDSA_Sign/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Sign/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Sign/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Sign/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Sign/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Sign_IT/SW4STM32/PKA_ECDSA_Sign_IT/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Sign_IT/SW4STM32/PKA_ECDSA_Sign_IT/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Sign_IT/SW4STM32/PKA_ECDSA_Sign_IT/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Sign_IT/SW4STM32/PKA_ECDSA_Sign_IT/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Sign_IT/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Sign_IT/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Sign_IT/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Sign_IT/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Verify/SW4STM32/PKA_ECDSA_Verify/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Verify/SW4STM32/PKA_ECDSA_Verify/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Verify/SW4STM32/PKA_ECDSA_Verify/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Verify/SW4STM32/PKA_ECDSA_Verify/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Verify/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Verify/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Verify/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Verify/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Verify_IT/SW4STM32/PKA_ECDSA_Verify_IT/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Verify_IT/SW4STM32/PKA_ECDSA_Verify_IT/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Verify_IT/SW4STM32/PKA_ECDSA_Verify_IT/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Verify_IT/SW4STM32/PKA_ECDSA_Verify_IT/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Verify_IT/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Verify_IT/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Verify_IT/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ECDSA_Verify_IT/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiation/SW4STM32/PKA_ModularExponentiation/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiation/SW4STM32/PKA_ModularExponentiation/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiation/SW4STM32/PKA_ModularExponentiation/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiation/SW4STM32/PKA_ModularExponentiation/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiation/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiation/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiation/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiation/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiationCRT/SW4STM32/PKA_ModularExponentiationCRT/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiationCRT/SW4STM32/PKA_ModularExponentiationCRT/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiationCRT/SW4STM32/PKA_ModularExponentiationCRT/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiationCRT/SW4STM32/PKA_ModularExponentiationCRT/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiationCRT/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiationCRT/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiationCRT/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiationCRT/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiationCRT_IT/SW4STM32/PKA_ModularExponentiationCRT_IT/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiationCRT_IT/SW4STM32/PKA_ModularExponentiationCRT_IT/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiationCRT_IT/SW4STM32/PKA_ModularExponentiationCRT_IT/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiationCRT_IT/SW4STM32/PKA_ModularExponentiationCRT_IT/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiationCRT_IT/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiationCRT_IT/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiationCRT_IT/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiationCRT_IT/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiation_IT/SW4STM32/PKA_ModularExponentiation_IT/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiation_IT/SW4STM32/PKA_ModularExponentiation_IT/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiation_IT/SW4STM32/PKA_ModularExponentiation_IT/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiation_IT/SW4STM32/PKA_ModularExponentiation_IT/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiation_IT/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiation_IT/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiation_IT/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_ModularExponentiation_IT/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_PointCheck/SW4STM32/PKA_PointCheck/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_PointCheck/SW4STM32/PKA_PointCheck/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_PointCheck/SW4STM32/PKA_PointCheck/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_PointCheck/SW4STM32/PKA_PointCheck/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_PointCheck/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_PointCheck/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_PointCheck/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_PointCheck/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_PointCheck_IT/SW4STM32/PKA_PointCheck_IT/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_PointCheck_IT/SW4STM32/PKA_PointCheck_IT/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_PointCheck_IT/SW4STM32/PKA_PointCheck_IT/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_PointCheck_IT/SW4STM32/PKA_PointCheck_IT/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_PointCheck_IT/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_PointCheck_IT/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_PointCheck_IT/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PKA/PKA_PointCheck_IT/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_LPRUN/SW4STM32/PWR_LPRUN/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_LPRUN/SW4STM32/PWR_LPRUN/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_LPRUN/SW4STM32/PWR_LPRUN/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_LPRUN/SW4STM32/PWR_LPRUN/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_LPRUN/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_LPRUN/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_LPRUN/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_LPRUN/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_LPSLEEP/SW4STM32/PWR_LPSLEEP/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_LPSLEEP/SW4STM32/PWR_LPSLEEP/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_LPSLEEP/SW4STM32/PWR_LPSLEEP/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_LPSLEEP/SW4STM32/PWR_LPSLEEP/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_LPSLEEP/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_LPSLEEP/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_LPSLEEP/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_LPSLEEP/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_PVD/SW4STM32/PWR_PVD/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_PVD/SW4STM32/PWR_PVD/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_PVD/SW4STM32/PWR_PVD/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_PVD/SW4STM32/PWR_PVD/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_PVD/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_PVD/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_PVD/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_PVD/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_STANDBY_RTC/SW4STM32/PWR_STANDBY_RTC/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_STANDBY_RTC/SW4STM32/PWR_STANDBY_RTC/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_STANDBY_RTC/SW4STM32/PWR_STANDBY_RTC/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_STANDBY_RTC/SW4STM32/PWR_STANDBY_RTC/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_STANDBY_RTC/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_STANDBY_RTC/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_STANDBY_RTC/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_STANDBY_RTC/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_STOP2_RTC/SW4STM32/PWR_STOP2_RTC/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_STOP2_RTC/SW4STM32/PWR_STOP2_RTC/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_STOP2_RTC/SW4STM32/PWR_STOP2_RTC/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_STOP2_RTC/SW4STM32/PWR_STOP2_RTC/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_STOP2_RTC/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_STOP2_RTC/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_STOP2_RTC/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_STOP2_RTC/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_STOP2_RTC/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_STOP2_RTC/Src/main.c
index 338219d49..f285ba075 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_STOP2_RTC/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/PWR/PWR_STOP2_RTC/Src/main.c
@@ -141,6 +141,15 @@ int main(void)
__HAL_RCC_GPIOE_CLK_DISABLE();
__HAL_RCC_GPIOH_CLK_DISABLE();
+ /* In case of debugger probe attached, work-around of issue specified in "ES0394 - STM32WB55Cx/Rx/Vx device errata":
+ 2.2.9 Incomplete Stop 2 mode entry after a wakeup from debug upon EXTI line 48 event
+ "With the JTAG debugger enabled on GPIO pins and after a wakeup from debug triggered by an event on EXTI
+ line 48 (CDBGPWRUPREQ), the device may enter in a state in which attempts to enter Stop 2 mode are not fully
+ effective ..."
+ */
+ LL_EXTI_DisableIT_32_63(LL_EXTI_LINE_48);
+ LL_C2_EXTI_DisableIT_32_63(LL_EXTI_LINE_48);
+
/* Disable all used wakeup source */
HAL_RTCEx_DeactivateWakeUpTimer(&hrtc);
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_ExecuteInPlace/SW4STM32/QSPI_ExecuteInPlace/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_ExecuteInPlace/SW4STM32/QSPI_ExecuteInPlace/stm32wb55xx_flash_cm4.ld
index 02e7f073d..5e6d4bd77 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_ExecuteInPlace/SW4STM32/QSPI_ExecuteInPlace/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_ExecuteInPlace/SW4STM32/QSPI_ExecuteInPlace/stm32wb55xx_flash_cm4.ld
@@ -56,9 +56,9 @@ _Min_Stack_Size = 0x1000; /* required amount of stack */
MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K
+QSPI (rx) : ORIGIN = 0x90000000, LENGTH = 1024K
RAM1 (xrw) : ORIGIN = 0x20000004, LENGTH = 0x2FFFC
RAM_SHARED (xrw) : ORIGIN = 0x20030000, LENGTH = 10K
-QSPI (xrw) : ORIGIN = 0x90000000, LENGTH = 1024K
}
/* Define output sections */
@@ -104,16 +104,16 @@ SECTIONS
*(.ARM.exidx*)
__exidx_end = .;
} >FLASH
-
+
_qspi_init_base = LOADADDR(.qspi);
_qspi_init_length = SIZEOF(.qspi);
- .qspi :
+ .qspi :
{
. = ALIGN(4);
- _qspi_start = .; /* create a global symbol at qspi start */
- *(.qspi) /* .qspi sections */
- *(.qspi*) /* .qspi* sections */
+ _qspi_start = .; /* create a global symbol at qspi start */
+ *(.qspi) /* .qspi sections */
+ *(.qspi*) /* .qspi* sections */
. = ALIGN(4);
_qspi_end = .; /* define a global symbols at end of qspi */
@@ -196,7 +196,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_ExecuteInPlace/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_ExecuteInPlace/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_ExecuteInPlace/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_ExecuteInPlace/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_MemoryMapped/SW4STM32/QSPI_MemoryMapped/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_MemoryMapped/SW4STM32/QSPI_MemoryMapped/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_MemoryMapped/SW4STM32/QSPI_MemoryMapped/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_MemoryMapped/SW4STM32/QSPI_MemoryMapped/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_MemoryMapped/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_MemoryMapped/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_MemoryMapped/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_MemoryMapped/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_ReadWrite_DMA/SW4STM32/QSPI_ReadWrite_DMA/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_ReadWrite_DMA/SW4STM32/QSPI_ReadWrite_DMA/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_ReadWrite_DMA/SW4STM32/QSPI_ReadWrite_DMA/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_ReadWrite_DMA/SW4STM32/QSPI_ReadWrite_DMA/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_ReadWrite_DMA/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_ReadWrite_DMA/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_ReadWrite_DMA/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_ReadWrite_DMA/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_ReadWrite_IT/SW4STM32/QSPI_ReadWrite_IT/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_ReadWrite_IT/SW4STM32/QSPI_ReadWrite_IT/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_ReadWrite_IT/SW4STM32/QSPI_ReadWrite_IT/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_ReadWrite_IT/SW4STM32/QSPI_ReadWrite_IT/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_ReadWrite_IT/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_ReadWrite_IT/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_ReadWrite_IT/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/QSPI/QSPI_ReadWrite_IT/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RCC/RCC_CRS_Synchronization_IT/SW4STM32/RCC_CRS_Synchronization_IT/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RCC/RCC_CRS_Synchronization_IT/SW4STM32/RCC_CRS_Synchronization_IT/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RCC/RCC_CRS_Synchronization_IT/SW4STM32/RCC_CRS_Synchronization_IT/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RCC/RCC_CRS_Synchronization_IT/SW4STM32/RCC_CRS_Synchronization_IT/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RCC/RCC_CRS_Synchronization_IT/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RCC/RCC_CRS_Synchronization_IT/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RCC/RCC_CRS_Synchronization_IT/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RCC/RCC_CRS_Synchronization_IT/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RCC/RCC_CRS_Synchronization_Polling/SW4STM32/RCC_CRS_Synchronization_Polling/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RCC/RCC_CRS_Synchronization_Polling/SW4STM32/RCC_CRS_Synchronization_Polling/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RCC/RCC_CRS_Synchronization_Polling/SW4STM32/RCC_CRS_Synchronization_Polling/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RCC/RCC_CRS_Synchronization_Polling/SW4STM32/RCC_CRS_Synchronization_Polling/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RCC/RCC_CRS_Synchronization_Polling/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RCC/RCC_CRS_Synchronization_Polling/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RCC/RCC_CRS_Synchronization_Polling/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RCC/RCC_CRS_Synchronization_Polling/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RCC/RCC_ClockConfig/SW4STM32/RCC_ClockConfig/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RCC/RCC_ClockConfig/SW4STM32/RCC_ClockConfig/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RCC/RCC_ClockConfig/SW4STM32/RCC_ClockConfig/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RCC/RCC_ClockConfig/SW4STM32/RCC_ClockConfig/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RCC/RCC_ClockConfig/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RCC/RCC_ClockConfig/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RCC/RCC_ClockConfig/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RCC/RCC_ClockConfig/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RNG/RNG_MultiRNG/SW4STM32/RNG_MultiRNG/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RNG/RNG_MultiRNG/SW4STM32/RNG_MultiRNG/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RNG/RNG_MultiRNG/SW4STM32/RNG_MultiRNG/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RNG/RNG_MultiRNG/SW4STM32/RNG_MultiRNG/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RNG/RNG_MultiRNG/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RNG/RNG_MultiRNG/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RNG/RNG_MultiRNG/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RNG/RNG_MultiRNG/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RNG/RNG_MultiRNG_IT/SW4STM32/RNG_MultiRNG_IT/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RNG/RNG_MultiRNG_IT/SW4STM32/RNG_MultiRNG_IT/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RNG/RNG_MultiRNG_IT/SW4STM32/RNG_MultiRNG_IT/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RNG/RNG_MultiRNG_IT/SW4STM32/RNG_MultiRNG_IT/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RNG/RNG_MultiRNG_IT/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RNG/RNG_MultiRNG_IT/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RNG/RNG_MultiRNG_IT/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RNG/RNG_MultiRNG_IT/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_Alarm/SW4STM32/RTC_Alarm/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_Alarm/SW4STM32/RTC_Alarm/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_Alarm/SW4STM32/RTC_Alarm/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_Alarm/SW4STM32/RTC_Alarm/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_Alarm/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_Alarm/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_Alarm/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_Alarm/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_Calendar/SW4STM32/RTC_Calendar/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_Calendar/SW4STM32/RTC_Calendar/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_Calendar/SW4STM32/RTC_Calendar/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_Calendar/SW4STM32/RTC_Calendar/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_Calendar/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_Calendar/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_Calendar/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_Calendar/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_LSI/SW4STM32/RTC_LSI/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_LSI/SW4STM32/RTC_LSI/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_LSI/SW4STM32/RTC_LSI/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_LSI/SW4STM32/RTC_LSI/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_LSI/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_LSI/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_LSI/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_LSI/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_Tamper/SW4STM32/RTC_Tamper/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_Tamper/SW4STM32/RTC_Tamper/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_Tamper/SW4STM32/RTC_Tamper/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_Tamper/SW4STM32/RTC_Tamper/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_Tamper/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_Tamper/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_Tamper/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_Tamper/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_TimeStamp/SW4STM32/RTC_TimeStamp/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_TimeStamp/SW4STM32/RTC_TimeStamp/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_TimeStamp/SW4STM32/RTC_TimeStamp/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_TimeStamp/SW4STM32/RTC_TimeStamp/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_TimeStamp/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_TimeStamp/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_TimeStamp/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/RTC/RTC_TimeStamp/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComDMA_Master/SW4STM32/SPI_FullDuplex_ComDMA_Master/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComDMA_Master/SW4STM32/SPI_FullDuplex_ComDMA_Master/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComDMA_Master/SW4STM32/SPI_FullDuplex_ComDMA_Master/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComDMA_Master/SW4STM32/SPI_FullDuplex_ComDMA_Master/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComDMA_Master/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComDMA_Master/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComDMA_Master/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComDMA_Master/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComDMA_Slave/SW4STM32/SPI_FullDuplex_ComDMA_Slave/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComDMA_Slave/SW4STM32/SPI_FullDuplex_ComDMA_Slave/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComDMA_Slave/SW4STM32/SPI_FullDuplex_ComDMA_Slave/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComDMA_Slave/SW4STM32/SPI_FullDuplex_ComDMA_Slave/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComDMA_Slave/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComDMA_Slave/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComDMA_Slave/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComDMA_Slave/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComIT_Master/SW4STM32/SPI_FullDuplex_ComIT_Master/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComIT_Master/SW4STM32/SPI_FullDuplex_ComIT_Master/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComIT_Master/SW4STM32/SPI_FullDuplex_ComIT_Master/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComIT_Master/SW4STM32/SPI_FullDuplex_ComIT_Master/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComIT_Master/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComIT_Master/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComIT_Master/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComIT_Master/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComIT_Slave/SW4STM32/SPI_FullDuplex_ComIT_Slave/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComIT_Slave/SW4STM32/SPI_FullDuplex_ComIT_Slave/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComIT_Slave/SW4STM32/SPI_FullDuplex_ComIT_Slave/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComIT_Slave/SW4STM32/SPI_FullDuplex_ComIT_Slave/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComIT_Slave/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComIT_Slave/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComIT_Slave/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComIT_Slave/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComPolling_Master/SW4STM32/SPI_FullDuplex_ComPolling_Master/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComPolling_Master/SW4STM32/SPI_FullDuplex_ComPolling_Master/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComPolling_Master/SW4STM32/SPI_FullDuplex_ComPolling_Master/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComPolling_Master/SW4STM32/SPI_FullDuplex_ComPolling_Master/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComPolling_Master/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComPolling_Master/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComPolling_Master/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComPolling_Master/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComPolling_Slave/SW4STM32/SPI_FullDuplex_ComPolling_Slave/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComPolling_Slave/SW4STM32/SPI_FullDuplex_ComPolling_Slave/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComPolling_Slave/SW4STM32/SPI_FullDuplex_ComPolling_Slave/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComPolling_Slave/SW4STM32/SPI_FullDuplex_ComPolling_Slave/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComPolling_Slave/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComPolling_Slave/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComPolling_Slave/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/SPI/SPI_FullDuplex_ComPolling_Slave/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_DMA/SW4STM32/TIM_DMA/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_DMA/SW4STM32/TIM_DMA/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_DMA/SW4STM32/TIM_DMA/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_DMA/SW4STM32/TIM_DMA/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_DMA/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_DMA/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_DMA/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_DMA/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_DMABurst/SW4STM32/TIM_DMABurst/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_DMABurst/SW4STM32/TIM_DMABurst/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_DMABurst/SW4STM32/TIM_DMABurst/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_DMABurst/SW4STM32/TIM_DMABurst/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_DMABurst/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_DMABurst/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_DMABurst/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_DMABurst/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_InputCapture/SW4STM32/TIM_InputCapture/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_InputCapture/SW4STM32/TIM_InputCapture/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_InputCapture/SW4STM32/TIM_InputCapture/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_InputCapture/SW4STM32/TIM_InputCapture/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_InputCapture/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_InputCapture/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_InputCapture/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_InputCapture/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OCActive/SW4STM32/TIM_OCActive/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OCActive/SW4STM32/TIM_OCActive/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OCActive/SW4STM32/TIM_OCActive/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OCActive/SW4STM32/TIM_OCActive/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OCActive/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OCActive/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OCActive/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OCActive/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OCInactive/SW4STM32/TIM_OCInactive/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OCInactive/SW4STM32/TIM_OCInactive/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OCInactive/SW4STM32/TIM_OCInactive/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OCInactive/SW4STM32/TIM_OCInactive/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OCInactive/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OCInactive/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OCInactive/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OCInactive/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OCToggle/SW4STM32/TIM_OCToggle/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OCToggle/SW4STM32/TIM_OCToggle/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OCToggle/SW4STM32/TIM_OCToggle/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OCToggle/SW4STM32/TIM_OCToggle/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OCToggle/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OCToggle/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OCToggle/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OCToggle/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OnePulse/SW4STM32/STM32WB55RG_Nucleo_TIM_OnePulse/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OnePulse/SW4STM32/STM32WB55RG_Nucleo_TIM_OnePulse/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OnePulse/SW4STM32/STM32WB55RG_Nucleo_TIM_OnePulse/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OnePulse/SW4STM32/STM32WB55RG_Nucleo_TIM_OnePulse/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OnePulse/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OnePulse/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OnePulse/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_OnePulse/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_PWMInput/SW4STM32/TIM_PWMInput/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_PWMInput/SW4STM32/TIM_PWMInput/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_PWMInput/SW4STM32/TIM_PWMInput/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_PWMInput/SW4STM32/TIM_PWMInput/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_PWMInput/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_PWMInput/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_PWMInput/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_PWMInput/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_PWMOutput/SW4STM32/TIM_PWMOutput/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_PWMOutput/SW4STM32/TIM_PWMOutput/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_PWMOutput/SW4STM32/TIM_PWMOutput/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_PWMOutput/SW4STM32/TIM_PWMOutput/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_PWMOutput/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_PWMOutput/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_PWMOutput/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_PWMOutput/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_TimeBase/SW4STM32/TIM_TimeBase/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_TimeBase/SW4STM32/TIM_TimeBase/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_TimeBase/SW4STM32/TIM_TimeBase/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_TimeBase/SW4STM32/TIM_TimeBase/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_TimeBase/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_TimeBase/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_TimeBase/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/TIM/TIM_TimeBase/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_HyperTerminal_DMA/SW4STM32/UART_HyperTerminal_DMA/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_HyperTerminal_DMA/SW4STM32/UART_HyperTerminal_DMA/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_HyperTerminal_DMA/SW4STM32/UART_HyperTerminal_DMA/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_HyperTerminal_DMA/SW4STM32/UART_HyperTerminal_DMA/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_HyperTerminal_DMA/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_HyperTerminal_DMA/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_HyperTerminal_DMA/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_HyperTerminal_DMA/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_HyperTerminal_IT/SW4STM32/UART_HyperTerminal_IT/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_HyperTerminal_IT/SW4STM32/UART_HyperTerminal_IT/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_HyperTerminal_IT/SW4STM32/UART_HyperTerminal_IT/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_HyperTerminal_IT/SW4STM32/UART_HyperTerminal_IT/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_HyperTerminal_IT/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_HyperTerminal_IT/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_HyperTerminal_IT/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_HyperTerminal_IT/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_Printf/SW4STM32/UART_Printf/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_Printf/SW4STM32/UART_Printf/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_Printf/SW4STM32/UART_Printf/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_Printf/SW4STM32/UART_Printf/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_Printf/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_Printf/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_Printf/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_Printf/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_TwoBoards_ComDMA/SW4STM32/UART_TwoBoards_ComDMA/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_TwoBoards_ComDMA/SW4STM32/UART_TwoBoards_ComDMA/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_TwoBoards_ComDMA/SW4STM32/UART_TwoBoards_ComDMA/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_TwoBoards_ComDMA/SW4STM32/UART_TwoBoards_ComDMA/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_TwoBoards_ComDMA/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_TwoBoards_ComDMA/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_TwoBoards_ComDMA/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_TwoBoards_ComDMA/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_TwoBoards_ComIT/SW4STM32/UART_TwoBoards_ComIT/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_TwoBoards_ComIT/SW4STM32/UART_TwoBoards_ComIT/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_TwoBoards_ComIT/SW4STM32/UART_TwoBoards_ComIT/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_TwoBoards_ComIT/SW4STM32/UART_TwoBoards_ComIT/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_TwoBoards_ComIT/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_TwoBoards_ComIT/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_TwoBoards_ComIT/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_TwoBoards_ComIT/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_TwoBoards_ComPolling/SW4STM32/UART_TwoBoards_ComPolling/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_TwoBoards_ComPolling/SW4STM32/UART_TwoBoards_ComPolling/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_TwoBoards_ComPolling/SW4STM32/UART_TwoBoards_ComPolling/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_TwoBoards_ComPolling/SW4STM32/UART_TwoBoards_ComPolling/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_TwoBoards_ComPolling/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_TwoBoards_ComPolling/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_TwoBoards_ComPolling/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/UART/UART_TwoBoards_ComPolling/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/WWDG/WWDG_Example/SW4STM32/WWDG_Example/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples/WWDG/WWDG_Example/SW4STM32/WWDG_Example/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/WWDG/WWDG_Example/SW4STM32/WWDG_Example/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/WWDG/WWDG_Example/SW4STM32/WWDG_Example/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples/WWDG/WWDG_Example/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples/WWDG/WWDG_Example/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples/WWDG/WWDG_Example/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples/WWDG/WWDG_Example/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_AnalogWatchdog_Init/SW4STM32/ADC_AnalogWatchdog_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_AnalogWatchdog_Init/SW4STM32/ADC_AnalogWatchdog_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_AnalogWatchdog_Init/SW4STM32/ADC_AnalogWatchdog_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_AnalogWatchdog_Init/SW4STM32/ADC_AnalogWatchdog_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_AnalogWatchdog_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_AnalogWatchdog_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_AnalogWatchdog_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_AnalogWatchdog_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_ContinuousConversion_TriggerSW/SW4STM32/STM32WB55RG_Nucleo_ADC_ContinuousConversion_TriggerSW/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_ContinuousConversion_TriggerSW/SW4STM32/STM32WB55RG_Nucleo_ADC_ContinuousConversion_TriggerSW/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_ContinuousConversion_TriggerSW/SW4STM32/STM32WB55RG_Nucleo_ADC_ContinuousConversion_TriggerSW/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_ContinuousConversion_TriggerSW/SW4STM32/STM32WB55RG_Nucleo_ADC_ContinuousConversion_TriggerSW/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_ContinuousConversion_TriggerSW/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_ContinuousConversion_TriggerSW/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_ContinuousConversion_TriggerSW/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_ContinuousConversion_TriggerSW/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_ContinuousConversion_TriggerSW_Init/SW4STM32/ADC_ContinuousConversion_TriggerSW_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_ContinuousConversion_TriggerSW_Init/SW4STM32/ADC_ContinuousConversion_TriggerSW_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_ContinuousConversion_TriggerSW_Init/SW4STM32/ADC_ContinuousConversion_TriggerSW_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_ContinuousConversion_TriggerSW_Init/SW4STM32/ADC_ContinuousConversion_TriggerSW_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_ContinuousConversion_TriggerSW_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_ContinuousConversion_TriggerSW_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_ContinuousConversion_TriggerSW_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_ContinuousConversion_TriggerSW_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_ContinuousConversion_TriggerSW_LowPower_Init/SW4STM32/ADC_ContinuousConversion_TriggerSW_LowPower_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_ContinuousConversion_TriggerSW_LowPower_Init/SW4STM32/ADC_ContinuousConversion_TriggerSW_LowPower_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_ContinuousConversion_TriggerSW_LowPower_Init/SW4STM32/ADC_ContinuousConversion_TriggerSW_LowPower_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_ContinuousConversion_TriggerSW_LowPower_Init/SW4STM32/ADC_ContinuousConversion_TriggerSW_LowPower_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_ContinuousConversion_TriggerSW_LowPower_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_ContinuousConversion_TriggerSW_LowPower_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_ContinuousConversion_TriggerSW_LowPower_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_ContinuousConversion_TriggerSW_LowPower_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_GroupsRegularInjected_Init/SW4STM32/ADC_GroupsRegularInjected_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_GroupsRegularInjected_Init/SW4STM32/ADC_GroupsRegularInjected_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_GroupsRegularInjected_Init/SW4STM32/ADC_GroupsRegularInjected_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_GroupsRegularInjected_Init/SW4STM32/ADC_GroupsRegularInjected_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_GroupsRegularInjected_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_GroupsRegularInjected_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_GroupsRegularInjected_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_GroupsRegularInjected_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_Oversampling_Init/SW4STM32/ADC_Oversampling_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_Oversampling_Init/SW4STM32/ADC_Oversampling_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_Oversampling_Init/SW4STM32/ADC_Oversampling_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_Oversampling_Init/SW4STM32/ADC_Oversampling_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_Oversampling_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_Oversampling_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_Oversampling_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_Oversampling_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerSW_DMA_Init/SW4STM32/ADC_SingleConversion_TriggerSW_DMA_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerSW_DMA_Init/SW4STM32/ADC_SingleConversion_TriggerSW_DMA_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerSW_DMA_Init/SW4STM32/ADC_SingleConversion_TriggerSW_DMA_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerSW_DMA_Init/SW4STM32/ADC_SingleConversion_TriggerSW_DMA_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerSW_DMA_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerSW_DMA_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerSW_DMA_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerSW_DMA_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerSW_IT_Init/SW4STM32/ADC_SingleConversion_TriggerSW_IT_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerSW_IT_Init/SW4STM32/ADC_SingleConversion_TriggerSW_IT_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerSW_IT_Init/SW4STM32/ADC_SingleConversion_TriggerSW_IT_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerSW_IT_Init/SW4STM32/ADC_SingleConversion_TriggerSW_IT_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerSW_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerSW_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerSW_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerSW_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerSW_Init/SW4STM32/ADC_SingleConversion_TriggerSW_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerSW_Init/SW4STM32/ADC_SingleConversion_TriggerSW_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerSW_Init/SW4STM32/ADC_SingleConversion_TriggerSW_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerSW_Init/SW4STM32/ADC_SingleConversion_TriggerSW_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerSW_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerSW_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerSW_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerSW_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerTimer_DMA_Init/SW4STM32/ADC_SingleConversion_TriggerTimer_DMA_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerTimer_DMA_Init/SW4STM32/ADC_SingleConversion_TriggerTimer_DMA_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerTimer_DMA_Init/SW4STM32/ADC_SingleConversion_TriggerTimer_DMA_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerTimer_DMA_Init/SW4STM32/ADC_SingleConversion_TriggerTimer_DMA_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerTimer_DMA_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerTimer_DMA_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerTimer_DMA_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerTimer_DMA_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_TemperatureSensor/SW4STM32/STM32WB55RG_Nucleo_ADC_TemperatureSensor/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_TemperatureSensor/SW4STM32/STM32WB55RG_Nucleo_ADC_TemperatureSensor/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_TemperatureSensor/SW4STM32/STM32WB55RG_Nucleo_ADC_TemperatureSensor/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_TemperatureSensor/SW4STM32/STM32WB55RG_Nucleo_ADC_TemperatureSensor/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_TemperatureSensor/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_TemperatureSensor/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_TemperatureSensor/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/ADC/ADC_TemperatureSensor/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_IT/SW4STM32/STM32WB55RG_Nucleo_COMP_CompareGpioVsVrefInt_IT/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_IT/SW4STM32/STM32WB55RG_Nucleo_COMP_CompareGpioVsVrefInt_IT/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_IT/SW4STM32/STM32WB55RG_Nucleo_COMP_CompareGpioVsVrefInt_IT/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_IT/SW4STM32/STM32WB55RG_Nucleo_COMP_CompareGpioVsVrefInt_IT/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_IT/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_IT/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_IT/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_IT/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_IT_Init/SW4STM32/COMP_CompareGpioVsVrefInt_IT_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_IT_Init/SW4STM32/COMP_CompareGpioVsVrefInt_IT_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_IT_Init/SW4STM32/COMP_CompareGpioVsVrefInt_IT_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_IT_Init/SW4STM32/COMP_CompareGpioVsVrefInt_IT_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_OutputGpio_Init/SW4STM32/COMP_CompareGpioVsVrefInt_OutputGpio_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_OutputGpio_Init/SW4STM32/COMP_CompareGpioVsVrefInt_OutputGpio_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_OutputGpio_Init/SW4STM32/COMP_CompareGpioVsVrefInt_OutputGpio_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_OutputGpio_Init/SW4STM32/COMP_CompareGpioVsVrefInt_OutputGpio_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_OutputGpio_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_OutputGpio_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_OutputGpio_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_OutputGpio_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_Window_IT_Init/SW4STM32/COMP_CompareGpioVsVrefInt_Window_IT_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_Window_IT_Init/SW4STM32/COMP_CompareGpioVsVrefInt_Window_IT_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_Window_IT_Init/SW4STM32/COMP_CompareGpioVsVrefInt_Window_IT_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_Window_IT_Init/SW4STM32/COMP_CompareGpioVsVrefInt_Window_IT_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_Window_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_Window_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_Window_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/COMP/COMP_CompareGpioVsVrefInt_Window_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CORTEX/CORTEX_MPU/SW4STM32/CORTEX_MPU/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CORTEX/CORTEX_MPU/SW4STM32/CORTEX_MPU/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CORTEX/CORTEX_MPU/SW4STM32/CORTEX_MPU/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CORTEX/CORTEX_MPU/SW4STM32/CORTEX_MPU/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CORTEX/CORTEX_MPU/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CORTEX/CORTEX_MPU/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CORTEX/CORTEX_MPU/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CORTEX/CORTEX_MPU/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRC/CRC_CalculateAndCheck/SW4STM32/CRC_CalculateAndCheck/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRC/CRC_CalculateAndCheck/SW4STM32/CRC_CalculateAndCheck/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRC/CRC_CalculateAndCheck/SW4STM32/CRC_CalculateAndCheck/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRC/CRC_CalculateAndCheck/SW4STM32/CRC_CalculateAndCheck/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRC/CRC_CalculateAndCheck/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRC/CRC_CalculateAndCheck/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRC/CRC_CalculateAndCheck/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRC/CRC_CalculateAndCheck/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRC/CRC_UserDefinedPolynomial/SW4STM32/CRC_UserDefinedPolynomial/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRC/CRC_UserDefinedPolynomial/SW4STM32/CRC_UserDefinedPolynomial/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRC/CRC_UserDefinedPolynomial/SW4STM32/CRC_UserDefinedPolynomial/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRC/CRC_UserDefinedPolynomial/SW4STM32/CRC_UserDefinedPolynomial/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRC/CRC_UserDefinedPolynomial/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRC/CRC_UserDefinedPolynomial/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRC/CRC_UserDefinedPolynomial/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRC/CRC_UserDefinedPolynomial/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRS/CRS_Synchronization_IT/SW4STM32/CRS_Synchronization_IT/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRS/CRS_Synchronization_IT/SW4STM32/CRS_Synchronization_IT/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRS/CRS_Synchronization_IT/SW4STM32/CRS_Synchronization_IT/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRS/CRS_Synchronization_IT/SW4STM32/CRS_Synchronization_IT/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRS/CRS_Synchronization_IT/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRS/CRS_Synchronization_IT/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRS/CRS_Synchronization_IT/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRS/CRS_Synchronization_IT/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRS/CRS_Synchronization_Polling/SW4STM32/CRS_Synchronization_Polling/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRS/CRS_Synchronization_Polling/SW4STM32/CRS_Synchronization_Polling/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRS/CRS_Synchronization_Polling/SW4STM32/CRS_Synchronization_Polling/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRS/CRS_Synchronization_Polling/SW4STM32/CRS_Synchronization_Polling/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRS/CRS_Synchronization_Polling/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRS/CRS_Synchronization_Polling/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRS/CRS_Synchronization_Polling/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/CRS/CRS_Synchronization_Polling/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/DMA/DMA_CopyFromFlashToMemory/SW4STM32/STM32WB55RG_Nucleo_DMA_CopyFromFlashToMemory/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/DMA/DMA_CopyFromFlashToMemory/SW4STM32/STM32WB55RG_Nucleo_DMA_CopyFromFlashToMemory/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/DMA/DMA_CopyFromFlashToMemory/SW4STM32/STM32WB55RG_Nucleo_DMA_CopyFromFlashToMemory/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/DMA/DMA_CopyFromFlashToMemory/SW4STM32/STM32WB55RG_Nucleo_DMA_CopyFromFlashToMemory/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/DMA/DMA_CopyFromFlashToMemory/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/DMA/DMA_CopyFromFlashToMemory/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/DMA/DMA_CopyFromFlashToMemory/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/DMA/DMA_CopyFromFlashToMemory/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/DMA/DMA_CopyFromFlashToMemory_Init/SW4STM32/DMA_CopyFromFlashToMemory_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/DMA/DMA_CopyFromFlashToMemory_Init/SW4STM32/DMA_CopyFromFlashToMemory_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/DMA/DMA_CopyFromFlashToMemory_Init/SW4STM32/DMA_CopyFromFlashToMemory_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/DMA/DMA_CopyFromFlashToMemory_Init/SW4STM32/DMA_CopyFromFlashToMemory_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/DMA/DMA_CopyFromFlashToMemory_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/DMA/DMA_CopyFromFlashToMemory_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/DMA/DMA_CopyFromFlashToMemory_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/DMA/DMA_CopyFromFlashToMemory_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/EXTI/EXTI_ToggleLedOnIT/SW4STM32/STM32WB55RG_Nucleo_EXTI_ToggleLedOnIT/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/EXTI/EXTI_ToggleLedOnIT/SW4STM32/STM32WB55RG_Nucleo_EXTI_ToggleLedOnIT/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/EXTI/EXTI_ToggleLedOnIT/SW4STM32/STM32WB55RG_Nucleo_EXTI_ToggleLedOnIT/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/EXTI/EXTI_ToggleLedOnIT/SW4STM32/STM32WB55RG_Nucleo_EXTI_ToggleLedOnIT/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/EXTI/EXTI_ToggleLedOnIT/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/EXTI/EXTI_ToggleLedOnIT/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/EXTI/EXTI_ToggleLedOnIT/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/EXTI/EXTI_ToggleLedOnIT/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/EXTI/EXTI_ToggleLedOnIT_Init/SW4STM32/EXTI_ToggleLedOnIT_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/EXTI/EXTI_ToggleLedOnIT_Init/SW4STM32/EXTI_ToggleLedOnIT_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/EXTI/EXTI_ToggleLedOnIT_Init/SW4STM32/EXTI_ToggleLedOnIT_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/EXTI/EXTI_ToggleLedOnIT_Init/SW4STM32/EXTI_ToggleLedOnIT_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/EXTI/EXTI_ToggleLedOnIT_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/EXTI/EXTI_ToggleLedOnIT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/EXTI/EXTI_ToggleLedOnIT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/EXTI/EXTI_ToggleLedOnIT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/GPIO/GPIO_InfiniteLedToggling/SW4STM32/STM32WB55RG_Nucleo_GPIO_InfiniteLedToggling/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/GPIO/GPIO_InfiniteLedToggling/SW4STM32/STM32WB55RG_Nucleo_GPIO_InfiniteLedToggling/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/GPIO/GPIO_InfiniteLedToggling/SW4STM32/STM32WB55RG_Nucleo_GPIO_InfiniteLedToggling/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/GPIO/GPIO_InfiniteLedToggling/SW4STM32/STM32WB55RG_Nucleo_GPIO_InfiniteLedToggling/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/GPIO/GPIO_InfiniteLedToggling/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/GPIO/GPIO_InfiniteLedToggling/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/GPIO/GPIO_InfiniteLedToggling/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/GPIO/GPIO_InfiniteLedToggling/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/GPIO/GPIO_InfiniteLedToggling_Init/SW4STM32/GPIO_InfiniteLedToggling_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/GPIO/GPIO_InfiniteLedToggling_Init/SW4STM32/GPIO_InfiniteLedToggling_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/GPIO/GPIO_InfiniteLedToggling_Init/SW4STM32/GPIO_InfiniteLedToggling_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/GPIO/GPIO_InfiniteLedToggling_Init/SW4STM32/GPIO_InfiniteLedToggling_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/GPIO/GPIO_InfiniteLedToggling_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/GPIO/GPIO_InfiniteLedToggling_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/GPIO/GPIO_InfiniteLedToggling_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/GPIO/GPIO_InfiniteLedToggling_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/HSEM/HSEM_DualProcess/SW4STM32/HSEM_DualProcess/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/HSEM/HSEM_DualProcess/SW4STM32/HSEM_DualProcess/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/HSEM/HSEM_DualProcess/SW4STM32/HSEM_DualProcess/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/HSEM/HSEM_DualProcess/SW4STM32/HSEM_DualProcess/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/HSEM/HSEM_DualProcess/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/HSEM/HSEM_DualProcess/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/HSEM/HSEM_DualProcess/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/HSEM/HSEM_DualProcess/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/HSEM/HSEM_DualProcess_IT/SW4STM32/HSEM_DualProcess_IT/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/HSEM/HSEM_DualProcess_IT/SW4STM32/HSEM_DualProcess_IT/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/HSEM/HSEM_DualProcess_IT/SW4STM32/HSEM_DualProcess_IT/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/HSEM/HSEM_DualProcess_IT/SW4STM32/HSEM_DualProcess_IT/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/HSEM/HSEM_DualProcess_IT/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/HSEM/HSEM_DualProcess_IT/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/HSEM/HSEM_DualProcess_IT/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/HSEM/HSEM_DualProcess_IT/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_AdvCommunication_DMAAndIT_Init/SW4STM32/I2C_OneBoard_AdvCommunication_DMAAndIT_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_AdvCommunication_DMAAndIT_Init/SW4STM32/I2C_OneBoard_AdvCommunication_DMAAndIT_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_AdvCommunication_DMAAndIT_Init/SW4STM32/I2C_OneBoard_AdvCommunication_DMAAndIT_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_AdvCommunication_DMAAndIT_Init/SW4STM32/I2C_OneBoard_AdvCommunication_DMAAndIT_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_AdvCommunication_DMAAndIT_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_AdvCommunication_DMAAndIT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_AdvCommunication_DMAAndIT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_AdvCommunication_DMAAndIT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_DMAAndIT_Init/SW4STM32/I2C_OneBoard_Communication_DMAAndIT_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_DMAAndIT_Init/SW4STM32/I2C_OneBoard_Communication_DMAAndIT_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_DMAAndIT_Init/SW4STM32/I2C_OneBoard_Communication_DMAAndIT_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_DMAAndIT_Init/SW4STM32/I2C_OneBoard_Communication_DMAAndIT_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_DMAAndIT_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_DMAAndIT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_DMAAndIT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_DMAAndIT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_IT/SW4STM32/STM32WB55RG_Nucleo_I2C_OneBoard_Communication_IT/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_IT/SW4STM32/STM32WB55RG_Nucleo_I2C_OneBoard_Communication_IT/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_IT/SW4STM32/STM32WB55RG_Nucleo_I2C_OneBoard_Communication_IT/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_IT/SW4STM32/STM32WB55RG_Nucleo_I2C_OneBoard_Communication_IT/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_IT/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_IT/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_IT/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_IT/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_IT_Init/SW4STM32/I2C_OneBoard_Communication_IT_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_IT_Init/SW4STM32/I2C_OneBoard_Communication_IT_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_IT_Init/SW4STM32/I2C_OneBoard_Communication_IT_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_IT_Init/SW4STM32/I2C_OneBoard_Communication_IT_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_PollingAndIT_Init/SW4STM32/I2C_OneBoard_Communication_PollingAndIT_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_PollingAndIT_Init/SW4STM32/I2C_OneBoard_Communication_PollingAndIT_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_PollingAndIT_Init/SW4STM32/I2C_OneBoard_Communication_PollingAndIT_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_PollingAndIT_Init/SW4STM32/I2C_OneBoard_Communication_PollingAndIT_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_PollingAndIT_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_PollingAndIT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_PollingAndIT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_Communication_PollingAndIT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_MasterRx_SlaveTx_IT_Init/SW4STM32/I2C_TwoBoards_MasterRx_SlaveTx_IT_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_MasterRx_SlaveTx_IT_Init/SW4STM32/I2C_TwoBoards_MasterRx_SlaveTx_IT_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_MasterRx_SlaveTx_IT_Init/SW4STM32/I2C_TwoBoards_MasterRx_SlaveTx_IT_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_MasterRx_SlaveTx_IT_Init/SW4STM32/I2C_TwoBoards_MasterRx_SlaveTx_IT_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_MasterRx_SlaveTx_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_MasterRx_SlaveTx_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_MasterRx_SlaveTx_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_MasterRx_SlaveTx_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_MasterTx_SlaveRx_DMA_Init/SW4STM32/I2C_TwoBoards_MasterTx_SlaveRx_DMA_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_MasterTx_SlaveRx_DMA_Init/SW4STM32/I2C_TwoBoards_MasterTx_SlaveRx_DMA_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_MasterTx_SlaveRx_DMA_Init/SW4STM32/I2C_TwoBoards_MasterTx_SlaveRx_DMA_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_MasterTx_SlaveRx_DMA_Init/SW4STM32/I2C_TwoBoards_MasterTx_SlaveRx_DMA_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_MasterTx_SlaveRx_DMA_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_MasterTx_SlaveRx_DMA_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_MasterTx_SlaveRx_DMA_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_MasterTx_SlaveRx_DMA_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_MasterTx_SlaveRx_Init/SW4STM32/I2C_TwoBoards_MasterTx_SlaveRx_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_MasterTx_SlaveRx_Init/SW4STM32/I2C_TwoBoards_MasterTx_SlaveRx_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_MasterTx_SlaveRx_Init/SW4STM32/I2C_TwoBoards_MasterTx_SlaveRx_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_MasterTx_SlaveRx_Init/SW4STM32/I2C_TwoBoards_MasterTx_SlaveRx_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_MasterTx_SlaveRx_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_MasterTx_SlaveRx_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_MasterTx_SlaveRx_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_MasterTx_SlaveRx_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_WakeUpFromStop2_IT_Init/SW4STM32/I2C_TwoBoards_WakeUpFromStop2_IT_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_WakeUpFromStop2_IT_Init/SW4STM32/I2C_TwoBoards_WakeUpFromStop2_IT_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_WakeUpFromStop2_IT_Init/SW4STM32/I2C_TwoBoards_WakeUpFromStop2_IT_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_WakeUpFromStop2_IT_Init/SW4STM32/I2C_TwoBoards_WakeUpFromStop2_IT_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_WakeUpFromStop2_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_WakeUpFromStop2_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_WakeUpFromStop2_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_WakeUpFromStop2_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_WakeUpFromStop_IT_Init/SW4STM32/I2C_TwoBoards_WakeUpFromStop_IT_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_WakeUpFromStop_IT_Init/SW4STM32/I2C_TwoBoards_WakeUpFromStop_IT_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_WakeUpFromStop_IT_Init/SW4STM32/I2C_TwoBoards_WakeUpFromStop_IT_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_WakeUpFromStop_IT_Init/SW4STM32/I2C_TwoBoards_WakeUpFromStop_IT_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_WakeUpFromStop_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_WakeUpFromStop_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_WakeUpFromStop_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_TwoBoards_WakeUpFromStop_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/IWDG/IWDG_RefreshUntilUserEvent_Init/SW4STM32/IWDG_RefreshUntilUserEvent_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/IWDG/IWDG_RefreshUntilUserEvent_Init/SW4STM32/IWDG_RefreshUntilUserEvent_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/IWDG/IWDG_RefreshUntilUserEvent_Init/SW4STM32/IWDG_RefreshUntilUserEvent_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/IWDG/IWDG_RefreshUntilUserEvent_Init/SW4STM32/IWDG_RefreshUntilUserEvent_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/IWDG/IWDG_RefreshUntilUserEvent_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/IWDG/IWDG_RefreshUntilUserEvent_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/IWDG/IWDG_RefreshUntilUserEvent_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/IWDG/IWDG_RefreshUntilUserEvent_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPTIM/LPTIM_PulseCounter/SW4STM32/STM32WB55RG_Nucleo_LPTIM_PulseCounter/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPTIM/LPTIM_PulseCounter/SW4STM32/STM32WB55RG_Nucleo_LPTIM_PulseCounter/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPTIM/LPTIM_PulseCounter/SW4STM32/STM32WB55RG_Nucleo_LPTIM_PulseCounter/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPTIM/LPTIM_PulseCounter/SW4STM32/STM32WB55RG_Nucleo_LPTIM_PulseCounter/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPTIM/LPTIM_PulseCounter/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPTIM/LPTIM_PulseCounter/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPTIM/LPTIM_PulseCounter/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPTIM/LPTIM_PulseCounter/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPTIM/LPTIM_PulseCounter_Init/SW4STM32/LPTIM_PulseCounter_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPTIM/LPTIM_PulseCounter_Init/SW4STM32/LPTIM_PulseCounter_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPTIM/LPTIM_PulseCounter_Init/SW4STM32/LPTIM_PulseCounter_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPTIM/LPTIM_PulseCounter_Init/SW4STM32/LPTIM_PulseCounter_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPTIM/LPTIM_PulseCounter_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPTIM/LPTIM_PulseCounter_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPTIM/LPTIM_PulseCounter_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPTIM/LPTIM_PulseCounter_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPUART/LPUART_WakeUpFromStop2_Init/SW4STM32/LPUART_WakeUpFromStop2_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPUART/LPUART_WakeUpFromStop2_Init/SW4STM32/LPUART_WakeUpFromStop2_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPUART/LPUART_WakeUpFromStop2_Init/SW4STM32/LPUART_WakeUpFromStop2_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPUART/LPUART_WakeUpFromStop2_Init/SW4STM32/LPUART_WakeUpFromStop2_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPUART/LPUART_WakeUpFromStop2_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPUART/LPUART_WakeUpFromStop2_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPUART/LPUART_WakeUpFromStop2_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPUART/LPUART_WakeUpFromStop2_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPUART/LPUART_WakeUpFromStop_Init/SW4STM32/LPUART_WakeUpFromStop_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPUART/LPUART_WakeUpFromStop_Init/SW4STM32/LPUART_WakeUpFromStop_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPUART/LPUART_WakeUpFromStop_Init/SW4STM32/LPUART_WakeUpFromStop_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPUART/LPUART_WakeUpFromStop_Init/SW4STM32/LPUART_WakeUpFromStop_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPUART/LPUART_WakeUpFromStop_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPUART/LPUART_WakeUpFromStop_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPUART/LPUART_WakeUpFromStop_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/LPUART/LPUART_WakeUpFromStop_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PKA/PKA_ECDSA_Sign/SW4STM32/PKA_ECDSA_Sign/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PKA/PKA_ECDSA_Sign/SW4STM32/PKA_ECDSA_Sign/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PKA/PKA_ECDSA_Sign/SW4STM32/PKA_ECDSA_Sign/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PKA/PKA_ECDSA_Sign/SW4STM32/PKA_ECDSA_Sign/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PKA/PKA_ECDSA_Sign/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PKA/PKA_ECDSA_Sign/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PKA/PKA_ECDSA_Sign/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PKA/PKA_ECDSA_Sign/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PKA/PKA_ModularExponentiation/SW4STM32/PKA_ModularExponentiation/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PKA/PKA_ModularExponentiation/SW4STM32/PKA_ModularExponentiation/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PKA/PKA_ModularExponentiation/SW4STM32/PKA_ModularExponentiation/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PKA/PKA_ModularExponentiation/SW4STM32/PKA_ModularExponentiation/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PKA/PKA_ModularExponentiation/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PKA/PKA_ModularExponentiation/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PKA/PKA_ModularExponentiation/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PKA/PKA_ModularExponentiation/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_EnterStandbyMode/SW4STM32/PWR_EnterStandbyMode/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_EnterStandbyMode/SW4STM32/PWR_EnterStandbyMode/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_EnterStandbyMode/SW4STM32/PWR_EnterStandbyMode/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_EnterStandbyMode/SW4STM32/PWR_EnterStandbyMode/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_EnterStandbyMode/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_EnterStandbyMode/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_EnterStandbyMode/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_EnterStandbyMode/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_EnterStopMode/SW4STM32/PWR_EnterStopMode/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_EnterStopMode/SW4STM32/PWR_EnterStopMode/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_EnterStopMode/SW4STM32/PWR_EnterStopMode/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_EnterStopMode/SW4STM32/PWR_EnterStopMode/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_EnterStopMode/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_EnterStopMode/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_EnterStopMode/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_EnterStopMode/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_EnterStopMode/Src/main.c b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_EnterStopMode/Src/main.c
index 6287be06e..6ad934dc8 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_EnterStopMode/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_EnterStopMode/Src/main.c
@@ -234,6 +234,15 @@ void Configure_PWR(void)
{
/* Ensure that MSI is wake-up system clock */
LL_RCC_SetClkAfterWakeFromStop(LL_RCC_STOP_WAKEUPCLOCK_MSI);
+
+ /* In case of debugger probe attached, work-around of issue specified in "ES0394 - STM32WB55Cx/Rx/Vx device errata":
+ 2.2.9 Incomplete Stop 2 mode entry after a wakeup from debug upon EXTI line 48 event
+ "With the JTAG debugger enabled on GPIO pins and after a wakeup from debug triggered by an event on EXTI
+ line 48 (CDBGPWRUPREQ), the device may enter in a state in which attempts to enter Stop 2 mode are not fully
+ effective ..."
+ */
+ LL_EXTI_DisableIT_32_63(LL_EXTI_LINE_48);
+ LL_C2_EXTI_DisableIT_32_63(LL_EXTI_LINE_48);
}
/**
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_OptimizedRunMode/SW4STM32/PWR_OptimizedRunMode/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_OptimizedRunMode/SW4STM32/PWR_OptimizedRunMode/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_OptimizedRunMode/SW4STM32/PWR_OptimizedRunMode/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_OptimizedRunMode/SW4STM32/PWR_OptimizedRunMode/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_OptimizedRunMode/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_OptimizedRunMode/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_OptimizedRunMode/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_OptimizedRunMode/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_SMPS_16MHZ_HSI/SW4STM32/PWR_SMPS_16MHZ_HSI/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_SMPS_16MHZ_HSI/SW4STM32/PWR_SMPS_16MHZ_HSI/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_SMPS_16MHZ_HSI/SW4STM32/PWR_SMPS_16MHZ_HSI/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_SMPS_16MHZ_HSI/SW4STM32/PWR_SMPS_16MHZ_HSI/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_SMPS_16MHZ_HSI/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_SMPS_16MHZ_HSI/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_SMPS_16MHZ_HSI/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_SMPS_16MHZ_HSI/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_SMPS_64MHZ_MSI_PLL/SW4STM32/PWR_SMPS_64MHZ_MSI_PLL/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_SMPS_64MHZ_MSI_PLL/SW4STM32/PWR_SMPS_64MHZ_MSI_PLL/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_SMPS_64MHZ_MSI_PLL/SW4STM32/PWR_SMPS_64MHZ_MSI_PLL/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_SMPS_64MHZ_MSI_PLL/SW4STM32/PWR_SMPS_64MHZ_MSI_PLL/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_SMPS_64MHZ_MSI_PLL/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_SMPS_64MHZ_MSI_PLL/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_SMPS_64MHZ_MSI_PLL/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/PWR/PWR_SMPS_64MHZ_MSI_PLL/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_HWAutoMSICalibration/SW4STM32/RCC_HWAutoMSICalibration/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_HWAutoMSICalibration/SW4STM32/RCC_HWAutoMSICalibration/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_HWAutoMSICalibration/SW4STM32/RCC_HWAutoMSICalibration/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_HWAutoMSICalibration/SW4STM32/RCC_HWAutoMSICalibration/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_HWAutoMSICalibration/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_HWAutoMSICalibration/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_HWAutoMSICalibration/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_HWAutoMSICalibration/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_OutputSystemClockOnMCO/SW4STM32/RCC_OutputSystemClockOnMCO/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_OutputSystemClockOnMCO/SW4STM32/RCC_OutputSystemClockOnMCO/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_OutputSystemClockOnMCO/SW4STM32/RCC_OutputSystemClockOnMCO/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_OutputSystemClockOnMCO/SW4STM32/RCC_OutputSystemClockOnMCO/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_OutputSystemClockOnMCO/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_OutputSystemClockOnMCO/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_OutputSystemClockOnMCO/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_OutputSystemClockOnMCO/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_UseHSEasSystemClock/SW4STM32/RCC_UseHSEasSystemClock/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_UseHSEasSystemClock/SW4STM32/RCC_UseHSEasSystemClock/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_UseHSEasSystemClock/SW4STM32/RCC_UseHSEasSystemClock/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_UseHSEasSystemClock/SW4STM32/RCC_UseHSEasSystemClock/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_UseHSEasSystemClock/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_UseHSEasSystemClock/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_UseHSEasSystemClock/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_UseHSEasSystemClock/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_UseHSI_PLLasSystemClock/SW4STM32/RCC_UseHSI_PLLasSystemClock/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_UseHSI_PLLasSystemClock/SW4STM32/RCC_UseHSI_PLLasSystemClock/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_UseHSI_PLLasSystemClock/SW4STM32/RCC_UseHSI_PLLasSystemClock/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_UseHSI_PLLasSystemClock/SW4STM32/RCC_UseHSI_PLLasSystemClock/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_UseHSI_PLLasSystemClock/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_UseHSI_PLLasSystemClock/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_UseHSI_PLLasSystemClock/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RCC/RCC_UseHSI_PLLasSystemClock/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RNG/RNG_GenerateRandomNumbers/SW4STM32/RNG_GenerateRandomNumbers/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RNG/RNG_GenerateRandomNumbers/SW4STM32/RNG_GenerateRandomNumbers/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RNG/RNG_GenerateRandomNumbers/SW4STM32/RNG_GenerateRandomNumbers/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RNG/RNG_GenerateRandomNumbers/SW4STM32/RNG_GenerateRandomNumbers/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RNG/RNG_GenerateRandomNumbers/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RNG/RNG_GenerateRandomNumbers/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RNG/RNG_GenerateRandomNumbers/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RNG/RNG_GenerateRandomNumbers/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RNG/RNG_GenerateRandomNumbers_IT/SW4STM32/RNG_GenerateRandomNumbers_IT/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RNG/RNG_GenerateRandomNumbers_IT/SW4STM32/RNG_GenerateRandomNumbers_IT/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RNG/RNG_GenerateRandomNumbers_IT/SW4STM32/RNG_GenerateRandomNumbers_IT/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RNG/RNG_GenerateRandomNumbers_IT/SW4STM32/RNG_GenerateRandomNumbers_IT/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RNG/RNG_GenerateRandomNumbers_IT/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RNG/RNG_GenerateRandomNumbers_IT/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RNG/RNG_GenerateRandomNumbers_IT/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RNG/RNG_GenerateRandomNumbers_IT/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Alarm/SW4STM32/STM32WB55RG_Nucleo_RTC_Alarm/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Alarm/SW4STM32/STM32WB55RG_Nucleo_RTC_Alarm/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Alarm/SW4STM32/STM32WB55RG_Nucleo_RTC_Alarm/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Alarm/SW4STM32/STM32WB55RG_Nucleo_RTC_Alarm/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Alarm/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Alarm/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Alarm/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Alarm/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Alarm_Init/SW4STM32/RTC_Alarm_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Alarm_Init/SW4STM32/RTC_Alarm_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Alarm_Init/SW4STM32/RTC_Alarm_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Alarm_Init/SW4STM32/RTC_Alarm_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Alarm_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Alarm_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Alarm_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Alarm_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Calendar_Init/SW4STM32/RTC_Calendar_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Calendar_Init/SW4STM32/RTC_Calendar_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Calendar_Init/SW4STM32/RTC_Calendar_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Calendar_Init/SW4STM32/RTC_Calendar_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Calendar_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Calendar_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Calendar_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Calendar_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_ExitStandbyWithWakeUpTimer_Init/SW4STM32/RTC_ExitStandbyWithWakeUpTimer_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_ExitStandbyWithWakeUpTimer_Init/SW4STM32/RTC_ExitStandbyWithWakeUpTimer_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_ExitStandbyWithWakeUpTimer_Init/SW4STM32/RTC_ExitStandbyWithWakeUpTimer_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_ExitStandbyWithWakeUpTimer_Init/SW4STM32/RTC_ExitStandbyWithWakeUpTimer_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_ExitStandbyWithWakeUpTimer_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_ExitStandbyWithWakeUpTimer_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_ExitStandbyWithWakeUpTimer_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_ExitStandbyWithWakeUpTimer_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Tamper_Init/SW4STM32/RTC_Tamper_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Tamper_Init/SW4STM32/RTC_Tamper_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Tamper_Init/SW4STM32/RTC_Tamper_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Tamper_Init/SW4STM32/RTC_Tamper_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Tamper_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Tamper_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Tamper_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_Tamper_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_TimeStamp_Init/SW4STM32/RTC_TimeStamp_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_TimeStamp_Init/SW4STM32/RTC_TimeStamp_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_TimeStamp_Init/SW4STM32/RTC_TimeStamp_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_TimeStamp_Init/SW4STM32/RTC_TimeStamp_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_TimeStamp_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_TimeStamp_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_TimeStamp_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/RTC/RTC_TimeStamp_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_OneBoard_HalfDuplex_DMA/SW4STM32/STM32WB55RG_Nucleo_SPI_OneBoard_HalfDuplex_DMA/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_OneBoard_HalfDuplex_DMA/SW4STM32/STM32WB55RG_Nucleo_SPI_OneBoard_HalfDuplex_DMA/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_OneBoard_HalfDuplex_DMA/SW4STM32/STM32WB55RG_Nucleo_SPI_OneBoard_HalfDuplex_DMA/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_OneBoard_HalfDuplex_DMA/SW4STM32/STM32WB55RG_Nucleo_SPI_OneBoard_HalfDuplex_DMA/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_OneBoard_HalfDuplex_DMA/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_OneBoard_HalfDuplex_DMA/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_OneBoard_HalfDuplex_DMA/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_OneBoard_HalfDuplex_DMA/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_OneBoard_HalfDuplex_DMA_Init/SW4STM32/SPI_OneBoard_HalfDuplex_DMA_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_OneBoard_HalfDuplex_DMA_Init/SW4STM32/SPI_OneBoard_HalfDuplex_DMA_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_OneBoard_HalfDuplex_DMA_Init/SW4STM32/SPI_OneBoard_HalfDuplex_DMA_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_OneBoard_HalfDuplex_DMA_Init/SW4STM32/SPI_OneBoard_HalfDuplex_DMA_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_OneBoard_HalfDuplex_DMA_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_OneBoard_HalfDuplex_DMA_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_OneBoard_HalfDuplex_DMA_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_OneBoard_HalfDuplex_DMA_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_OneBoard_HalfDuplex_IT_Init/SW4STM32/SPI_OneBoard_HalfDuplex_IT_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_OneBoard_HalfDuplex_IT_Init/SW4STM32/SPI_OneBoard_HalfDuplex_IT_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_OneBoard_HalfDuplex_IT_Init/SW4STM32/SPI_OneBoard_HalfDuplex_IT_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_OneBoard_HalfDuplex_IT_Init/SW4STM32/SPI_OneBoard_HalfDuplex_IT_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_OneBoard_HalfDuplex_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_OneBoard_HalfDuplex_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_OneBoard_HalfDuplex_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_OneBoard_HalfDuplex_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_DMA_Master_Init/SW4STM32/SPI_TwoBoards_FullDuplex_DMA_Master_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_DMA_Master_Init/SW4STM32/SPI_TwoBoards_FullDuplex_DMA_Master_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_DMA_Master_Init/SW4STM32/SPI_TwoBoards_FullDuplex_DMA_Master_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_DMA_Master_Init/SW4STM32/SPI_TwoBoards_FullDuplex_DMA_Master_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_DMA_Master_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_DMA_Master_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_DMA_Master_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_DMA_Master_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_DMA_Slave_Init/SW4STM32/SPI_TwoBoards_FullDuplex_DMA_Slave_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_DMA_Slave_Init/SW4STM32/SPI_TwoBoards_FullDuplex_DMA_Slave_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_DMA_Slave_Init/SW4STM32/SPI_TwoBoards_FullDuplex_DMA_Slave_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_DMA_Slave_Init/SW4STM32/SPI_TwoBoards_FullDuplex_DMA_Slave_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_DMA_Slave_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_DMA_Slave_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_DMA_Slave_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_DMA_Slave_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_IT_Master_Init/SW4STM32/SPI_TwoBoards_FullDuplex_IT_Master_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_IT_Master_Init/SW4STM32/SPI_TwoBoards_FullDuplex_IT_Master_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_IT_Master_Init/SW4STM32/SPI_TwoBoards_FullDuplex_IT_Master_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_IT_Master_Init/SW4STM32/SPI_TwoBoards_FullDuplex_IT_Master_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_IT_Master_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_IT_Master_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_IT_Master_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_IT_Master_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_IT_Slave_Init/SW4STM32/SPI_TwoBoards_FullDuplex_IT_Slave_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_IT_Slave_Init/SW4STM32/SPI_TwoBoards_FullDuplex_IT_Slave_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_IT_Slave_Init/SW4STM32/SPI_TwoBoards_FullDuplex_IT_Slave_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_IT_Slave_Init/SW4STM32/SPI_TwoBoards_FullDuplex_IT_Slave_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_IT_Slave_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_IT_Slave_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_IT_Slave_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/SPI/SPI_TwoBoards_FullDuplex_IT_Slave_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_BreakAndDeadtime/SW4STM32/STM32WB55RG_Nucleo_TIM_BreakAndDeadtime/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_BreakAndDeadtime/SW4STM32/STM32WB55RG_Nucleo_TIM_BreakAndDeadtime/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_BreakAndDeadtime/SW4STM32/STM32WB55RG_Nucleo_TIM_BreakAndDeadtime/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_BreakAndDeadtime/SW4STM32/STM32WB55RG_Nucleo_TIM_BreakAndDeadtime/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_BreakAndDeadtime/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_BreakAndDeadtime/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_BreakAndDeadtime/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_BreakAndDeadtime/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_DMA_Init/SW4STM32/TIM_DMA_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_DMA_Init/SW4STM32/TIM_DMA_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_DMA_Init/SW4STM32/TIM_DMA_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_DMA_Init/SW4STM32/TIM_DMA_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_DMA_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_DMA_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_DMA_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_DMA_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_InputCapture_Init/SW4STM32/TIM_InputCapture_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_InputCapture_Init/SW4STM32/TIM_InputCapture_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_InputCapture_Init/SW4STM32/TIM_InputCapture_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_InputCapture_Init/SW4STM32/TIM_InputCapture_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_InputCapture_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_InputCapture_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_InputCapture_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_InputCapture_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_OnePulse/SW4STM32/STM32WB55RG_Nucleo_TIM_OnePulse/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_OnePulse/SW4STM32/STM32WB55RG_Nucleo_TIM_OnePulse/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_OnePulse/SW4STM32/STM32WB55RG_Nucleo_TIM_OnePulse/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_OnePulse/SW4STM32/STM32WB55RG_Nucleo_TIM_OnePulse/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_OnePulse/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_OnePulse/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_OnePulse/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_OnePulse/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_OutputCompare_Init/SW4STM32/TIM_OutputCompare_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_OutputCompare_Init/SW4STM32/TIM_OutputCompare_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_OutputCompare_Init/SW4STM32/TIM_OutputCompare_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_OutputCompare_Init/SW4STM32/TIM_OutputCompare_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_OutputCompare_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_OutputCompare_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_OutputCompare_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_OutputCompare_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_PWMOutput/SW4STM32/STM32WB55RG_Nucleo_TIM_PWMOutput/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_PWMOutput/SW4STM32/STM32WB55RG_Nucleo_TIM_PWMOutput/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_PWMOutput/SW4STM32/STM32WB55RG_Nucleo_TIM_PWMOutput/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_PWMOutput/SW4STM32/STM32WB55RG_Nucleo_TIM_PWMOutput/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_PWMOutput/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_PWMOutput/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_PWMOutput/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_PWMOutput/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_PWMOutput_Init/SW4STM32/TIM_PWMOutput_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_PWMOutput_Init/SW4STM32/TIM_PWMOutput_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_PWMOutput_Init/SW4STM32/TIM_PWMOutput_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_PWMOutput_Init/SW4STM32/TIM_PWMOutput_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_PWMOutput_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_PWMOutput_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_PWMOutput_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_PWMOutput_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_TimeBase_Init/SW4STM32/TIM_TimeBase_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_TimeBase_Init/SW4STM32/TIM_TimeBase_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_TimeBase_Init/SW4STM32/TIM_TimeBase_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_TimeBase_Init/SW4STM32/TIM_TimeBase_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_TimeBase_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_TimeBase_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_TimeBase_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/TIM/TIM_TimeBase_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT/SW4STM32/STM32WB55RG_Nucleo_USART_Communication_Rx_IT/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT/SW4STM32/STM32WB55RG_Nucleo_USART_Communication_Rx_IT/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT/SW4STM32/STM32WB55RG_Nucleo_USART_Communication_Rx_IT/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT/SW4STM32/STM32WB55RG_Nucleo_USART_Communication_Rx_IT/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_Continuous_Init/SW4STM32/USART_Communication_Rx_IT_Continuous_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_Continuous_Init/SW4STM32/USART_Communication_Rx_IT_Continuous_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_Continuous_Init/SW4STM32/USART_Communication_Rx_IT_Continuous_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_Continuous_Init/SW4STM32/USART_Communication_Rx_IT_Continuous_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_Continuous_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_Continuous_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_Continuous_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_Continuous_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_Continuous_VCP_Init/SW4STM32/USART_Communication_Rx_IT_Continuous_VCP_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_Continuous_VCP_Init/SW4STM32/USART_Communication_Rx_IT_Continuous_VCP_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_Continuous_VCP_Init/SW4STM32/USART_Communication_Rx_IT_Continuous_VCP_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_Continuous_VCP_Init/SW4STM32/USART_Communication_Rx_IT_Continuous_VCP_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_Continuous_VCP_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_Continuous_VCP_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_Continuous_VCP_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_Continuous_VCP_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_Init/SW4STM32/USART_Communication_Rx_IT_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_Init/SW4STM32/USART_Communication_Rx_IT_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_Init/SW4STM32/USART_Communication_Rx_IT_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_Init/SW4STM32/USART_Communication_Rx_IT_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_VCP_Init/SW4STM32/USART_Communication_Rx_IT_VCP_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_VCP_Init/SW4STM32/USART_Communication_Rx_IT_VCP_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_VCP_Init/SW4STM32/USART_Communication_Rx_IT_VCP_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_VCP_Init/SW4STM32/USART_Communication_Rx_IT_VCP_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_VCP_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_VCP_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_VCP_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Rx_IT_VCP_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_TxRx_DMA_Init/SW4STM32/USART_Communication_TxRx_DMA_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_TxRx_DMA_Init/SW4STM32/USART_Communication_TxRx_DMA_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_TxRx_DMA_Init/SW4STM32/USART_Communication_TxRx_DMA_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_TxRx_DMA_Init/SW4STM32/USART_Communication_TxRx_DMA_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_TxRx_DMA_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_TxRx_DMA_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_TxRx_DMA_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_TxRx_DMA_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_IT_Init/SW4STM32/USART_Communication_Tx_IT_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_IT_Init/SW4STM32/USART_Communication_Tx_IT_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_IT_Init/SW4STM32/USART_Communication_Tx_IT_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_IT_Init/SW4STM32/USART_Communication_Tx_IT_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_IT_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_IT_VCP_Init/SW4STM32/USART_Communication_Tx_IT_VCP_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_IT_VCP_Init/SW4STM32/USART_Communication_Tx_IT_VCP_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_IT_VCP_Init/SW4STM32/USART_Communication_Tx_IT_VCP_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_IT_VCP_Init/SW4STM32/USART_Communication_Tx_IT_VCP_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_IT_VCP_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_IT_VCP_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_IT_VCP_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_IT_VCP_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_Init/SW4STM32/USART_Communication_Tx_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_Init/SW4STM32/USART_Communication_Tx_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_Init/SW4STM32/USART_Communication_Tx_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_Init/SW4STM32/USART_Communication_Tx_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_VCP_Init/SW4STM32/USART_Communication_Tx_VCP_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_VCP_Init/SW4STM32/USART_Communication_Tx_VCP_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_VCP_Init/SW4STM32/USART_Communication_Tx_VCP_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_VCP_Init/SW4STM32/USART_Communication_Tx_VCP_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_VCP_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_VCP_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_VCP_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_Communication_Tx_VCP_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_WakeUpFromStop1_Init/SW4STM32/USART_WakeUpFromStop1_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_WakeUpFromStop1_Init/SW4STM32/USART_WakeUpFromStop1_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_WakeUpFromStop1_Init/SW4STM32/USART_WakeUpFromStop1_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_WakeUpFromStop1_Init/SW4STM32/USART_WakeUpFromStop1_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_WakeUpFromStop1_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_WakeUpFromStop1_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_WakeUpFromStop1_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_WakeUpFromStop1_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_WakeUpFromStop_Init/SW4STM32/USART_WakeUpFromStop_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_WakeUpFromStop_Init/SW4STM32/USART_WakeUpFromStop_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_WakeUpFromStop_Init/SW4STM32/USART_WakeUpFromStop_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_WakeUpFromStop_Init/SW4STM32/USART_WakeUpFromStop_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_WakeUpFromStop_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_WakeUpFromStop_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_WakeUpFromStop_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/USART/USART_WakeUpFromStop_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/UTILS/UTILS_ConfigureSystemClock/SW4STM32/UTILS_ConfigureSystemClock/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/UTILS/UTILS_ConfigureSystemClock/SW4STM32/UTILS_ConfigureSystemClock/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/UTILS/UTILS_ConfigureSystemClock/SW4STM32/UTILS_ConfigureSystemClock/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/UTILS/UTILS_ConfigureSystemClock/SW4STM32/UTILS_ConfigureSystemClock/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/UTILS/UTILS_ConfigureSystemClock/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/UTILS/UTILS_ConfigureSystemClock/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/UTILS/UTILS_ConfigureSystemClock/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/UTILS/UTILS_ConfigureSystemClock/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/UTILS/UTILS_ReadDeviceInfo/SW4STM32/UTILS_ReadDeviceInfo/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/UTILS/UTILS_ReadDeviceInfo/SW4STM32/UTILS_ReadDeviceInfo/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/UTILS/UTILS_ReadDeviceInfo/SW4STM32/UTILS_ReadDeviceInfo/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/UTILS/UTILS_ReadDeviceInfo/SW4STM32/UTILS_ReadDeviceInfo/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/UTILS/UTILS_ReadDeviceInfo/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/UTILS/UTILS_ReadDeviceInfo/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/UTILS/UTILS_ReadDeviceInfo/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/UTILS/UTILS_ReadDeviceInfo/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/WWDG/WWDG_RefreshUntilUserEvent_Init/SW4STM32/WWDG_RefreshUntilUserEvent_Init/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/WWDG/WWDG_RefreshUntilUserEvent_Init/SW4STM32/WWDG_RefreshUntilUserEvent_Init/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/WWDG/WWDG_RefreshUntilUserEvent_Init/SW4STM32/WWDG_RefreshUntilUserEvent_Init/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/WWDG/WWDG_RefreshUntilUserEvent_Init/SW4STM32/WWDG_RefreshUntilUserEvent_Init/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/WWDG/WWDG_RefreshUntilUserEvent_Init/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/WWDG/WWDG_RefreshUntilUserEvent_Init/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/WWDG/WWDG_RefreshUntilUserEvent_Init/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/WWDG/WWDG_RefreshUntilUserEvent_Init/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/ADC/ADC_SingleConversion_TriggerSW_IT/SW4STM32/ADC_SingleConversion_TriggerSW_IT/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/ADC/ADC_SingleConversion_TriggerSW_IT/SW4STM32/ADC_SingleConversion_TriggerSW_IT/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/ADC/ADC_SingleConversion_TriggerSW_IT/SW4STM32/ADC_SingleConversion_TriggerSW_IT/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/ADC/ADC_SingleConversion_TriggerSW_IT/SW4STM32/ADC_SingleConversion_TriggerSW_IT/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/ADC/ADC_SingleConversion_TriggerSW_IT/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/ADC/ADC_SingleConversion_TriggerSW_IT/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/ADC/ADC_SingleConversion_TriggerSW_IT/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/ADC/ADC_SingleConversion_TriggerSW_IT/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/CRC/CRC_PolynomialUpdate/SW4STM32/CRC_PolynomialUpdate/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/CRC/CRC_PolynomialUpdate/SW4STM32/CRC_PolynomialUpdate/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/CRC/CRC_PolynomialUpdate/SW4STM32/CRC_PolynomialUpdate/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/CRC/CRC_PolynomialUpdate/SW4STM32/CRC_PolynomialUpdate/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/CRC/CRC_PolynomialUpdate/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/CRC/CRC_PolynomialUpdate/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/CRC/CRC_PolynomialUpdate/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/CRC/CRC_PolynomialUpdate/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/DMA/DMA_FLASHToRAM/SW4STM32/DMA_FLASHToRAM/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/DMA/DMA_FLASHToRAM/SW4STM32/DMA_FLASHToRAM/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/DMA/DMA_FLASHToRAM/SW4STM32/DMA_FLASHToRAM/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/DMA/DMA_FLASHToRAM/SW4STM32/DMA_FLASHToRAM/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/DMA/DMA_FLASHToRAM/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/DMA/DMA_FLASHToRAM/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/DMA/DMA_FLASHToRAM/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/DMA/DMA_FLASHToRAM/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/I2C/I2C_OneBoard_ComSlave7_10bits_IT/SW4STM32/I2C_OneBoard_ComSlave7_10bits_IT/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/I2C/I2C_OneBoard_ComSlave7_10bits_IT/SW4STM32/I2C_OneBoard_ComSlave7_10bits_IT/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/I2C/I2C_OneBoard_ComSlave7_10bits_IT/SW4STM32/I2C_OneBoard_ComSlave7_10bits_IT/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/I2C/I2C_OneBoard_ComSlave7_10bits_IT/SW4STM32/I2C_OneBoard_ComSlave7_10bits_IT/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/I2C/I2C_OneBoard_ComSlave7_10bits_IT/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/I2C/I2C_OneBoard_ComSlave7_10bits_IT/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/I2C/I2C_OneBoard_ComSlave7_10bits_IT/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/I2C/I2C_OneBoard_ComSlave7_10bits_IT/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/I2C/I2C_OneBoard_ComSlave7_10bits_IT/Src/stm32wbxx_hal_msp.c b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/I2C/I2C_OneBoard_ComSlave7_10bits_IT/Src/stm32wbxx_hal_msp.c
index d83a8d1ab..0e2fe952d 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/I2C/I2C_OneBoard_ComSlave7_10bits_IT/Src/stm32wbxx_hal_msp.c
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/I2C/I2C_OneBoard_ComSlave7_10bits_IT/Src/stm32wbxx_hal_msp.c
@@ -121,9 +121,9 @@ void HAL_I2C_MspInit(I2C_HandleTypeDef* hi2c)
__HAL_RCC_I2C1_CLK_ENABLE();
/* USER CODE BEGIN I2C1_MspInit 1 */
/* NVIC for I2Cx_MASTER */
- HAL_NVIC_SetPriority(I2Cx_MASTER_ER_IRQn, 0, 1);
+ HAL_NVIC_SetPriority(I2Cx_MASTER_ER_IRQn, 1, 0);
HAL_NVIC_EnableIRQ(I2Cx_MASTER_ER_IRQn);
- HAL_NVIC_SetPriority(I2Cx_MASTER_EV_IRQn, 0, 2);
+ HAL_NVIC_SetPriority(I2Cx_MASTER_EV_IRQn, 2, 0);
HAL_NVIC_EnableIRQ(I2Cx_MASTER_EV_IRQn);
/* USER CODE END I2C1_MspInit 1 */
}
@@ -150,9 +150,9 @@ void HAL_I2C_MspInit(I2C_HandleTypeDef* hi2c)
/* USER CODE BEGIN I2C3_MspInit 1 */
/* NVIC for I2Cx_SLAVE */
- HAL_NVIC_SetPriority(I2Cx_SLAVE_ER_IRQn, 0, 1);
+ HAL_NVIC_SetPriority(I2Cx_SLAVE_ER_IRQn, 1, 0);
HAL_NVIC_EnableIRQ(I2Cx_SLAVE_ER_IRQn);
- HAL_NVIC_SetPriority(I2Cx_SLAVE_EV_IRQn, 0, 2);
+ HAL_NVIC_SetPriority(I2Cx_SLAVE_EV_IRQn, 2, 0);
HAL_NVIC_EnableIRQ(I2Cx_SLAVE_EV_IRQn);
/* USER CODE END I2C3_MspInit 1 */
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/PWR/PWR_STOP1/SW4STM32/PWR_STOP1/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/PWR/PWR_STOP1/SW4STM32/PWR_STOP1/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/PWR/PWR_STOP1/SW4STM32/PWR_STOP1/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/PWR/PWR_STOP1/SW4STM32/PWR_STOP1/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/PWR/PWR_STOP1/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/PWR/PWR_STOP1/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/PWR/PWR_STOP1/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/PWR/PWR_STOP1/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_FullDuplex_ComPolling_Master/SW4STM32/SPI_FullDuplex_ComPolling_Master/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_FullDuplex_ComPolling_Master/SW4STM32/SPI_FullDuplex_ComPolling_Master/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_FullDuplex_ComPolling_Master/SW4STM32/SPI_FullDuplex_ComPolling_Master/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_FullDuplex_ComPolling_Master/SW4STM32/SPI_FullDuplex_ComPolling_Master/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_FullDuplex_ComPolling_Master/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_FullDuplex_ComPolling_Master/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_FullDuplex_ComPolling_Master/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_FullDuplex_ComPolling_Master/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_FullDuplex_ComPolling_Slave/SW4STM32/SPI_FullDuplex_ComPolling_Slave/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_FullDuplex_ComPolling_Slave/SW4STM32/SPI_FullDuplex_ComPolling_Slave/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_FullDuplex_ComPolling_Slave/SW4STM32/SPI_FullDuplex_ComPolling_Slave/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_FullDuplex_ComPolling_Slave/SW4STM32/SPI_FullDuplex_ComPolling_Slave/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_FullDuplex_ComPolling_Slave/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_FullDuplex_ComPolling_Slave/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_FullDuplex_ComPolling_Slave/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_FullDuplex_ComPolling_Slave/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_HalfDuplex_ComPollingIT_Master/SW4STM32/SPI_HalfDuplex_ComPollingIT_Master/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_HalfDuplex_ComPollingIT_Master/SW4STM32/SPI_HalfDuplex_ComPollingIT_Master/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_HalfDuplex_ComPollingIT_Master/SW4STM32/SPI_HalfDuplex_ComPollingIT_Master/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_HalfDuplex_ComPollingIT_Master/SW4STM32/SPI_HalfDuplex_ComPollingIT_Master/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_HalfDuplex_ComPollingIT_Master/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_HalfDuplex_ComPollingIT_Master/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_HalfDuplex_ComPollingIT_Master/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_HalfDuplex_ComPollingIT_Master/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_HalfDuplex_ComPollingIT_Slave/SW4STM32/SPI_HalfDuplex_ComPollingIT_Slave/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_HalfDuplex_ComPollingIT_Slave/SW4STM32/SPI_HalfDuplex_ComPollingIT_Slave/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_HalfDuplex_ComPollingIT_Slave/SW4STM32/SPI_HalfDuplex_ComPollingIT_Slave/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_HalfDuplex_ComPollingIT_Slave/SW4STM32/SPI_HalfDuplex_ComPollingIT_Slave/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_HalfDuplex_ComPollingIT_Slave/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_HalfDuplex_ComPollingIT_Slave/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_HalfDuplex_ComPollingIT_Slave/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/SPI/SPI_HalfDuplex_ComPollingIT_Slave/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/TIM/TIM_PWMInput/SW4STM32/TIM_PWMInput/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/TIM/TIM_PWMInput/SW4STM32/TIM_PWMInput/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/TIM/TIM_PWMInput/SW4STM32/TIM_PWMInput/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/TIM/TIM_PWMInput/SW4STM32/TIM_PWMInput/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/TIM/TIM_PWMInput/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/TIM/TIM_PWMInput/SW4STM32/startup_stm32wb55xx_cm4.s
index ffb0d9d09..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/TIM/TIM_PWMInput/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/TIM/TIM_PWMInput/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -14,29 +14,13 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
*
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -60,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
+ movs r3, #0
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
movs r3, #0
- b LoopCopyDataInit
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -83,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/UART/UART_HyperTerminal_IT/SW4STM32/UART_HyperTerminal_IT/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/UART/UART_HyperTerminal_IT/SW4STM32/UART_HyperTerminal_IT/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/UART/UART_HyperTerminal_IT/SW4STM32/UART_HyperTerminal_IT/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/UART/UART_HyperTerminal_IT/SW4STM32/UART_HyperTerminal_IT/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/UART/UART_HyperTerminal_IT/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/UART/UART_HyperTerminal_IT/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/UART/UART_HyperTerminal_IT/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/UART/UART_HyperTerminal_IT/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/UART/UART_HyperTerminal_TxPolling_RxIT/SW4STM32/UART_HyperTerminal_TxPolling_RxIT/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/UART/UART_HyperTerminal_TxPolling_RxIT/SW4STM32/UART_HyperTerminal_TxPolling_RxIT/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/UART/UART_HyperTerminal_TxPolling_RxIT/SW4STM32/UART_HyperTerminal_TxPolling_RxIT/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/UART/UART_HyperTerminal_TxPolling_RxIT/SW4STM32/UART_HyperTerminal_TxPolling_RxIT/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/UART/UART_HyperTerminal_TxPolling_RxIT/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/UART/UART_HyperTerminal_TxPolling_RxIT/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/UART/UART_HyperTerminal_TxPolling_RxIT/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_MIX/UART/UART_HyperTerminal_TxPolling_RxIT/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Release_Notes.html b/Projects/P-NUCLEO-WB55.Nucleo/Release_Notes.html
index 07094c87d..a3487e59b 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Release_Notes.html
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Release_Notes.html
@@ -48,9 +48,39 @@
<div class="col-sm-12 col-lg-8">
<h1 id="update-history">Update History</h1>
<div class="collapse">
-<input type="checkbox" id="collapse-section3" checked aria-hidden="true"> <label for="collapse-section3" aria-hidden="true">V1.2.0 / 26-June-2019</label>
+<input type="checkbox" id="collapse-section4" checked aria-hidden="true"> <label for="collapse-section4" aria-hidden="true">V1.3.0 / 11-September-2019</label>
<div>
<h2 id="main-changes">Main Changes</h2>
+<h3 id="introduction-of-zigbee-support">Introduction of ZIGBEE support</h3>
+<ul>
+<li>Ensure compatibility with <strong>STM32CubeMX V5.4</strong>.</li>
+<li><strong>Add 3 Zigbee applications</strong>:
+<ul>
+<li>Zigbee_OnOff_Coord</li>
+<li>Zigbee_OnOff_Distrib</li>
+<li>Zigbee_OnOff_Router</li>
+</ul></li>
+<li>Correct Ticket 65791 - .bin generated by SW4STM32 is too big</li>
+<li>Correct a runtime issue in Examples_MIX: I2C_OneBoard_ComSlave7_10bits_IT</li>
+<li>Ensure a workaround for “ES0394 - STM32WB55Cx/Rx/Vx device errata”: 2.2.9 Incomplete Stop 2 mode entry after a wakeup from debug upon EXTI line 48 event.
+<ul>
+<li>Examples: PWR_STOP2_RTC</li>
+<li>Examples_LL: PWR_EnterStopMode</li>
+</ul></li>
+<li>QSPI_ExecuteInPlace: Correct stm32wb55xx_flash_cm4.ld to define qspi section</li>
+<li>Add MDK-ARM and SW4STM32 projects for:
+<ul>
+<li>Thread_Coap_Generic_Ota</li>
+<li>Thread_Ota</li>
+<li>Thread_Ota_Server</li>
+</ul></li>
+</ul>
+</div>
+</div>
+<div class="collapse">
+<input type="checkbox" id="collapse-section3" aria-hidden="true"> <label for="collapse-section3" aria-hidden="true">V1.2.0 / 26-June-2019</label>
+<div>
+<h2 id="main-changes-1">Main Changes</h2>
<h3 id="addition-of-new-application">Addition of new application</h3>
<p><strong>Add CKS (Customer Key Storage) application</strong></p>
<ul>
@@ -65,7 +95,7 @@
<div class="collapse">
<input type="checkbox" id="collapse-section2" aria-hidden="true"> <label for="collapse-section2" aria-hidden="true">V1.1.0 / 05-April-2019</label>
<div>
-<h2 id="main-changes-1">Main Changes</h2>
+<h2 id="main-changes-2">Main Changes</h2>
<h3 id="remove-binaries-addition-of-new-examples">Remove binaries, Addition of new examples</h3>
<p>Change directory name to reflect board RPN: <a href="https://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/stm32-nucleo-expansion-boards/p-nucleo-wb55.html">P-NUCLEO-WB55</a></p>
<p>Add QSPI examples:</p>
@@ -88,7 +118,7 @@
<div class="collapse">
<input type="checkbox" id="collapse-section1" aria-hidden="true"> <label for="collapse-section1" aria-hidden="true">V1.0.0 / 06-February-2019</label>
<div>
-<h2 id="main-changes-2">Main Changes</h2>
+<h2 id="main-changes-3">Main Changes</h2>
<h3 id="first-release">First release</h3>
<p>First official release.</p>
</div>
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Templates/SW4STM32/Templates/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Templates/SW4STM32/Templates/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Templates/SW4STM32/Templates/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Templates/SW4STM32/Templates/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Templates/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Templates/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Templates/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Templates/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Templates_LL/SW4STM32/Templates_LL/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.Nucleo/Templates_LL/SW4STM32/Templates_LL/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Templates_LL/SW4STM32/Templates_LL/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Templates_LL/SW4STM32/Templates_LL/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Templates_LL/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.Nucleo/Templates_LL/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.Nucleo/Templates_LL/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.Nucleo/Templates_LL/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Inc/app_conf.h
index 0009ae802..5e3e0b101 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Inc/app_conf.h
@@ -24,12 +24,13 @@
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* OTA Application Config
******************************************************************************/
-/**< generic parameters ********************************************************/
+/**< generic parameters ******************************************************/
/**
* Define Tx Power
@@ -95,6 +96,15 @@
*/
#define CFG_BLE_ERK {0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21,0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21}
+/* USER CODE BEGIN Generic_Parameters */
+/**
+ * SMPS supply
+ * SMPS not used when Set to 0
+ * SMPS used when Set to 1
+ */
+#define CFG_USE_SMPS 1
+/* USER CODE END Generic_Parameters */
+
/**< specific parameters ********************************************************/
/******************************************************************************
@@ -176,7 +186,7 @@
* 1 : internal RO
* 0 : external crystal ( no calibration )
*/
-#define CFG_BLE_LSE_SOURCE 1
+#define CFG_BLE_LSE_SOURCE 0
/**
* Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
@@ -394,7 +404,6 @@ typedef enum
#define CFG_LPM_SUPPORTED 0
#define CFG_DEBUGGER_SUPPORTED 1
#endif
-
/**
* When CFG_DEBUG_TRACE_FULL is set to 1, the trace are output with the API name, the file name and the line number
* When CFG_DEBUG_TRACE_LIGHT is set to 1, only the debug message is output
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Inc/stm32_lpm_if.h
index 38e326512..d8e67947f 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Inc/stm32_lpm_if.h
@@ -1,46 +1,22 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file stm32_lpm_if.h
-* @brief Header for stm32_lpm_f.c module (device specific LP management)
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
******************************************************************************
* @attention
*
-* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics International N.V.
+* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted, provided that the following conditions are met:
-*
-* 1. Redistribution of source code must retain the above copyright notice,
-* this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following disclaimer in the documentation
-* and/or other materials provided with the distribution.
-* 3. Neither the name of STMicroelectronics nor the names of other
-* contributors to this software may be used to endorse or promote products
-* derived from this software without specific written permission.
-* 4. This software, including modifications and/or derivative works of this
-* software, must execute solely and exclusively on microcontroller or
-* microprocessor devices manufactured by or for STMicroelectronics.
-* 5. Redistribution and use of this software other than as permitted under
-* this license is void and will automatically terminate your rights under
-* this license.
-*
-* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
-* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
-* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+* This software component is licensed by ST under BSD 3-Clause license,
+* the "License"; You may not use this file except in compliance with the
+* License. You may obtain a copy of the License at:
+* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32_LPM_IF_H
@@ -89,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Inc/stm32wbxx_hal_conf.h
index 8cce280aa..4ab9edb7d 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Inc/stm32wbxx_hal_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Inc/stm32wbxx_hal_conf.h
@@ -219,6 +219,10 @@
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32wbxx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32wbxx_hal_flash.h"
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Inc/utilities_conf.h
index c98d97ba1..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Inc/utilities_conf.h
@@ -1,3 +1,4 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* File Name : utilities_conf.h
@@ -9,13 +10,14 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef UTILITIES_CONF_H
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Src/app_entry.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Src/app_entry.c
index de506558a..b2d131301 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Src/app_entry.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Src/app_entry.c
@@ -60,7 +60,6 @@ static void appe_Tl_Init( void );
static void Led_Init( void );
static void Button_Init( void );
static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status );
-
static void APPE_SysUserEvtRx( void * pPayload );
/* Functions Definition ------------------------------------------------------*/
@@ -86,7 +85,7 @@ void APPE_Init( void )
/**
* From now, the application is waiting for the ready event ( VS_HCI_C2_Ready )
- * received on the system channel before starting the BLE Stack
+ * received on the system channel before starting the Stack
* This system event is received with APPE_SysUserEvtRx()
*/
@@ -258,7 +257,6 @@ void UTIL_SEQ_Idle( void )
return;
}
-
void UTIL_SEQ_EvtIdle( UTIL_SEQ_bm_t task_id_bm, UTIL_SEQ_bm_t evt_waited_bm )
{
UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Src/hw_timerserver.c
index 52a1bfa0d..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Src/hw_timerserver.c
@@ -1,22 +1,21 @@
/**
******************************************************************************
- * File Name : hw_timerserver.c
- * Description : Hardware timerserver source file for BLE
- * middleWare.
+ * File Name : hw_timerserver.c
+ * Description : Hardware timerserver source file for STM32WPAN Middleware.
+ *
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Src/hw_uart.c
index c0fc22d58..9a553610d 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Src/hw_uart.c
@@ -1,42 +1,33 @@
/**
******************************************************************************
- * @file hw_uart.c
- * @author MCD Application Team
- * @brief hardware access
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * File Name : Src/hw_uart.c
+ * Description : HW UART source file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
#include "hw_conf.h"
+#if (CFG_HW_LPUART1_ENABLED == 1)
+extern UART_HandleTypeDef hlpuart1;
+#endif
+#if (CFG_HW_USART1_ENABLED == 1)
+extern UART_HandleTypeDef huart1;
+#endif
/* Macros --------------------------------------------------------------------*/
-#define HW_UART_INIT(__HANDLE__, __USART_BASE__) \
- do{ \
- (__HANDLE__).Instance = (__USART_BASE__); \
- (__HANDLE__).Init.BaudRate = CFG_HW_##__USART_BASE__##_BAUDRATE; \
- (__HANDLE__).Init.WordLength = CFG_HW_##__USART_BASE__##_WORDLENGTH; \
- (__HANDLE__).Init.StopBits = CFG_HW_##__USART_BASE__##_STOPBITS; \
- (__HANDLE__).Init.Parity = CFG_HW_##__USART_BASE__##_PARITY; \
- (__HANDLE__).Init.HwFlowCtl = CFG_HW_##__USART_BASE__##_HWFLOWCTL; \
- (__HANDLE__).Init.Mode = CFG_HW_##__USART_BASE__##_MODE; \
- (__HANDLE__).Init.OverSampling = CFG_HW_##__USART_BASE__##_OVERSAMPLING; \
- (__HANDLE__).AdvancedInit.AdvFeatureInit = CFG_HW_##__USART_BASE__##_ADVFEATUREINIT; \
- HAL_UART_Init(&(__HANDLE__)); \
- } while(0)
-
#define HW_UART_RX_IT(__HANDLE__, __USART_BASE__) \
do{ \
HW_##__HANDLE__##RxCb = cb; \
@@ -57,82 +48,8 @@
hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
} while(0)
-#define HW_UART_MSP_UART_INIT(__HANDLE__, __USART_BASE__) \
- do{ \
- \
- /* Configure Tx Pin */ \
- CFG_HW_##__USART_BASE__##_TX_PORT_CLK_ENABLE(); \
- \
- GPIO_InitStruct.Pin = CFG_HW_##__USART_BASE__##_TX_PIN ; \
- GPIO_InitStruct.Mode = CFG_HW_##__USART_BASE__##_TX_MODE; \
- GPIO_InitStruct.Pull = CFG_HW_##__USART_BASE__##_TX_PULL; \
- GPIO_InitStruct.Speed = CFG_HW_##__USART_BASE__##_TX_SPEED; \
- GPIO_InitStruct.Alternate = CFG_HW_##__USART_BASE__##_TX_ALTERNATE; \
- HAL_GPIO_Init(CFG_HW_##__USART_BASE__##_TX_PORT, &GPIO_InitStruct); \
- \
- \
- /* Configure Rx Pin */ \
- CFG_HW_##__USART_BASE__##_RX_PORT_CLK_ENABLE(); \
- \
- GPIO_InitStruct.Pin = CFG_HW_##__USART_BASE__##_RX_PIN; \
- GPIO_InitStruct.Mode = CFG_HW_##__USART_BASE__##_RX_MODE; \
- GPIO_InitStruct.Pull = CFG_HW_##__USART_BASE__##_RX_PULL; \
- GPIO_InitStruct.Speed = CFG_HW_##__USART_BASE__##_RX_SPEED; \
- GPIO_InitStruct.Alternate = CFG_HW_##__USART_BASE__##_RX_ALTERNATE; \
- HAL_GPIO_Init(CFG_HW_##__USART_BASE__##_RX_PORT, &GPIO_InitStruct); \
- \
- \
- /* Configure CTS Pin */ \
- CFG_HW_##__USART_BASE__##_CTS_PORT_CLK_ENABLE(); \
- \
- GPIO_InitStruct.Pin = CFG_HW_##__USART_BASE__##_CTS_PIN; \
- GPIO_InitStruct.Mode = CFG_HW_##__USART_BASE__##_CTS_MODE; \
- GPIO_InitStruct.Pull = CFG_HW_##__USART_BASE__##_CTS_PULL; \
- GPIO_InitStruct.Speed = CFG_HW_##__USART_BASE__##_CTS_SPEED; \
- GPIO_InitStruct.Alternate = CFG_HW_##__USART_BASE__##_CTS_ALTERNATE; \
- HAL_GPIO_Init(CFG_HW_##__USART_BASE__##_CTS_PORT, &GPIO_InitStruct); \
- \
- /* Set USART source clock */ \
- __HAL_RCC_##__USART_BASE__##_CONFIG(CFG_HW_##__USART_BASE__##_SOURCE_CLOCK); \
- \
- /* Enable USART clock */ \
- __HAL_RCC_##__USART_BASE__##_CLK_ENABLE(); \
- \
- HAL_NVIC_SetPriority(__USART_BASE__##_IRQn, CFG_HW_##__USART_BASE__##_PREEMPTPRIORITY, CFG_HW_##__USART_BASE__##_SUBPRIORITY); \
- HAL_NVIC_EnableIRQ(__USART_BASE__##_IRQn); \
- } while(0)
-
-#define HW_UART_MSP_TX_DMA_INIT(__HANDLE__, __USART_BASE__) \
- do{ \
- /* Configure the DMA handler for Transmission process */ \
- /* Enable DMA clock */ \
- CFG_HW_##__USART_BASE__##_DMA_CLK_ENABLE(); \
- /* Enable DMA MUX clock */ \
- CFG_HW_##__USART_BASE__##_DMAMUX_CLK_ENABLE(); \
- \
- HW_hdma_##__HANDLE__##_tx.Instance = CFG_HW_##__USART_BASE__##_TX_DMA_CHANNEL; \
- HW_hdma_##__HANDLE__##_tx.Init.Request = CFG_HW_##__USART_BASE__##_TX_DMA_REQ; \
- HW_hdma_##__HANDLE__##_tx.Init.Direction = DMA_MEMORY_TO_PERIPH; \
- HW_hdma_##__HANDLE__##_tx.Init.PeriphInc = DMA_PINC_DISABLE; \
- HW_hdma_##__HANDLE__##_tx.Init.MemInc = DMA_MINC_ENABLE; \
- HW_hdma_##__HANDLE__##_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; \
- HW_hdma_##__HANDLE__##_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; \
- HW_hdma_##__HANDLE__##_tx.Init.Mode = DMA_NORMAL; \
- HW_hdma_##__HANDLE__##_tx.Init.Priority = DMA_PRIORITY_LOW; \
- \
- HAL_DMA_Init(&HW_hdma_##__HANDLE__##_tx); \
- \
- /* Associate the initialized DMA handle to the UART handle */ \
- __HAL_LINKDMA(huart, hdmatx, HW_hdma_##__HANDLE__##_tx); \
- \
- /* NVIC configuration for DMA transfer complete interrupt */ \
- HAL_NVIC_SetPriority(CFG_HW_##__USART_BASE__##_TX_DMA_IRQn, CFG_HW_##__USART_BASE__##_DMA_TX_PREEMPTPRIORITY, CFG_HW_##__USART_BASE__##_DMA_TX_SUBPRIORITY); \
- HAL_NVIC_EnableIRQ(CFG_HW_##__USART_BASE__##_TX_DMA_IRQn); \
- } while(0)
-
- /* Variables ------------------------------------------------------------------*/
+/* Variables -----------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
- UART_HandleTypeDef huart1 = {0};
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
#endif
@@ -141,331 +58,261 @@
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- UART_HandleTypeDef lpuart1 = {0};
#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
- DMA_HandleTypeDef HW_hdma_lpuart1_tx ={0};
+ DMA_HandleTypeDef HW_hdma_hlpuart1_tx ={0};
#endif
- void (*HW_lpuart1RxCb)(void);
- void (*HW_lpuart1TxCb)(void);
+ void (*HW_hlpuart1RxCb)(void);
+ void (*HW_hlpuart1TxCb)(void);
#endif
- void HW_UART_Init(hw_uart_id_t hw_uart_id)
+void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_INIT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_RX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_INIT(lpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_RX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ return;
+}
+
+void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_RX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_RX_IT(lpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ return;
+}
+
+hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
+{
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
+
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX_IT(lpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
+ switch (hal_status)
{
- HAL_StatusTypeDef hal_status = HAL_OK;
- hw_status_t hw_status = hw_uart_ok;
-
- switch (hw_uart_id)
- {
-#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX(huart1, USART1);
- break;
-#endif
-
-#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX(lpuart1, LPUART1);
- break;
-#endif
-
- default:
- break;
- }
+ case HAL_OK:
+ hw_status = hw_uart_ok;
+ break;
- switch (hal_status)
- {
- case HAL_OK:
- hw_status = hw_uart_ok;
- break;
+ case HAL_ERROR:
+ hw_status = hw_uart_error;
+ break;
- case HAL_ERROR:
- hw_status = hw_uart_error;
- break;
+ case HAL_BUSY:
+ hw_status = hw_uart_busy;
+ break;
- case HAL_BUSY:
- hw_status = hw_uart_busy;
- break;
+ case HAL_TIMEOUT:
+ hw_status = hw_uart_to;
+ break;
- case HAL_TIMEOUT:
- hw_status = hw_uart_to;
- break;
+ default:
+ break;
+ }
- default:
- break;
- }
+ return hw_status;
+}
- return hw_status;
- }
+hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
- hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ switch (hw_uart_id)
{
- HAL_StatusTypeDef hal_status = HAL_OK;
- hw_status_t hw_status = hw_uart_ok;
-
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_huart1TxCb = cb;
- huart1.Instance = USART1;
- hal_status = HAL_UART_Transmit_DMA(&huart1, p_data, size);
- break;
-#endif
-
-#if (CFG_HW_USART2_ENABLED == 1)
- case hw_uart2:
- HW_huart2TxCb = cb;
- huart2.Instance = USART2;
- hal_status = HAL_UART_Transmit_DMA(&huart2, p_data, size);
- break;
+ case hw_uart1:
+ HW_huart1TxCb = cb;
+ huart1.Instance = USART1;
+ hal_status = HAL_UART_Transmit_DMA(&huart1, p_data, size);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_lpuart1TxCb = cb;
- lpuart1.Instance = LPUART1;
- hal_status = HAL_UART_Transmit_DMA(&lpuart1, p_data, size);
- break;
+ case hw_lpuart1:
+ HW_hlpuart1TxCb = cb;
+ hlpuart1.Instance = LPUART1;
+ hal_status = HAL_UART_Transmit_DMA(&hlpuart1, p_data, size);
+ break;
#endif
- default:
- break;
- }
-
- switch (hal_status)
- {
- case HAL_OK:
- hw_status = hw_uart_ok;
- break;
+ default:
+ break;
+ }
- case HAL_ERROR:
- hw_status = hw_uart_error;
- break;
+ switch (hal_status)
+ {
+ case HAL_OK:
+ hw_status = hw_uart_ok;
+ break;
- case HAL_BUSY:
- hw_status = hw_uart_busy;
- break;
+ case HAL_ERROR:
+ hw_status = hw_uart_error;
+ break;
- case HAL_TIMEOUT:
- hw_status = hw_uart_to;
- break;
+ case HAL_BUSY:
+ hw_status = hw_uart_busy;
+ break;
- default:
- break;
- }
+ case HAL_TIMEOUT:
+ hw_status = hw_uart_to;
+ break;
- return hw_status;
+ default:
+ break;
}
- void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id)
+ return hw_status;
+}
+
+void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id)
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HAL_UART_IRQHandler(&huart1);
- break;
+ case hw_uart1:
+ HAL_UART_IRQHandler(&huart1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HAL_UART_IRQHandler(&lpuart1);
- break;
+ case hw_lpuart1:
+ HAL_UART_IRQHandler(&hlpuart1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
- {
- switch (hw_uart_id)
- {
-#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
- case hw_uart1:
- HAL_DMA_IRQHandler(huart1.hdmatx);
- break;
-#endif
-
-#if (CFG_HW_USART2_DMA_TX_SUPPORTED == 1)
- case hw_uart2:
- HAL_DMA_IRQHandler(huart2.hdmatx);
- break;
-#endif
-
-#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
- case hw_lpuart1:
- HAL_DMA_IRQHandler(lpuart1.hdmatx);
- break;
-#endif
-
- default:
- break;
- }
+ return;
+}
- return;
- }
-
- void HAL_UART_MspInit(UART_HandleTypeDef *huart)
+void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
+{
+ switch (hw_uart_id)
{
-#if ( (CFG_HW_USART1_ENABLED == 1) || (CFG_HW_LPUART1_ENABLED == 1) )
- GPIO_InitTypeDef GPIO_InitStruct = {0};
-#endif
- switch ((uint32_t)huart->Instance)
- {
-#if (CFG_HW_USART1_ENABLED == 1)
- case (uint32_t)USART1:
- HW_UART_MSP_UART_INIT( huart1, USART1 );
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
- HW_UART_MSP_TX_DMA_INIT( huart1, USART1 );
-#endif
+ case hw_uart1:
+ HAL_DMA_IRQHandler(huart1.hdmatx);
break;
#endif
-#if (CFG_HW_LPUART1_ENABLED == 1)
- case (uint32_t)LPUART1:
- HW_UART_MSP_UART_INIT( lpuart1, LPUART1 );
#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
- HW_UART_MSP_TX_DMA_INIT( lpuart1, LPUART1 );
-#endif
+ case hw_lpuart1:
+ HAL_DMA_IRQHandler(hlpuart1.hdmatx);
break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
+ return;
+}
+
+void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
+{
+ switch ((uint32_t)huart->Instance)
{
- switch ((uint32_t)huart->Instance)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case (uint32_t)USART1:
- if(HW_huart1RxCb)
- {
- HW_huart1RxCb();
- }
+ case (uint32_t)USART1:
+ if(HW_huart1RxCb)
+ {
+ HW_huart1RxCb();
+ }
break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case (uint32_t)LPUART1:
- if(HW_lpuart1RxCb)
- {
- HW_lpuart1RxCb();
- }
+ case (uint32_t)LPUART1:
+ if(HW_hlpuart1RxCb)
+ {
+ HW_hlpuart1RxCb();
+ }
break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
+ return;
+}
+
+void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
+{
+ switch ((uint32_t)huart->Instance)
{
- switch ((uint32_t)huart->Instance)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case (uint32_t)USART1:
- if(HW_huart1TxCb)
- {
- HW_huart1TxCb();
- }
+ case (uint32_t)USART1:
+ if(HW_huart1TxCb)
+ {
+ HW_huart1TxCb();
+ }
break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case (uint32_t)LPUART1:
- if(HW_lpuart1TxCb)
- {
- HW_lpuart1TxCb();
- }
+ case (uint32_t)LPUART1:
+ if(HW_hlpuart1TxCb)
+ {
+ HW_hlpuart1TxCb();
+ }
break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+ return;
+}
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Src/main.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Src/main.c
index 7e80f2c17..1754a019a 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Src/main.c
@@ -195,7 +195,13 @@ static void Init_RTC( void )
hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
HAL_RTC_Init(&hrtc);
- MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* Disable RTC registers write protection */
+ LL_RTC_DisableWriteProtection(RTC);
+
+ LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER);
+
+ /* Enable RTC registers write protection */
+ LL_RTC_EnableWriteProtection(RTC);
return;
}
@@ -218,6 +224,12 @@ void SystemClock_Config( void )
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -268,19 +280,6 @@ void SystemClock_Config( void )
*/
LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
@@ -289,21 +288,33 @@ void SystemClock_Config( void )
* WRAP FUNCTIONS
*
*************************************************************/
-
-/**
- * This function is empty to avoid starting the SysTick Timer
- */
-HAL_StatusTypeDef HAL_InitTick( uint32_t TickPriority )
+void HAL_Delay(uint32_t Delay)
{
- return (HAL_OK);
-}
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
-/**
- * This function is empty as the SysTick Timer is not used
- */
-void HAL_Delay(__IO uint32_t Delay)
-{
- return;
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
}
/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/STM32_WPAN/App/app_ble.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/STM32_WPAN/App/app_ble.c
index a9d1a6343..bd751342e 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/STM32_WPAN/App/app_ble.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/STM32_WPAN/App/app_ble.c
@@ -678,7 +678,7 @@ static void Adv_Request( APP_BLE_ConnStatus_t New_Status )
ret = aci_gap_set_non_discoverable();
if (ret == BLE_STATUS_SUCCESS)
{
- APP_DBG_MSG("Successfully Stopped Advertising\n");
+ APP_DBG_MSG("Successfully Stopped Advertising \n");
}
else
{
@@ -707,13 +707,13 @@ static void Adv_Request( APP_BLE_ConnStatus_t New_Status )
{
if (New_Status == APP_BLE_FAST_ADV)
{
- APP_DBG_MSG("Successfully Start Fast Advertising\n" );
+ APP_DBG_MSG("Successfully Start Fast Advertising \n" );
/* Start Timer to STOP ADV - TIMEOUT */
HW_TS_Start(BleApplicationContext.Advertising_mgr_timer_Id, INITIAL_ADV_TIMEOUT);
}
else
{
- APP_DBG_MSG("Successfully Start Low Power Advertising\n");
+ APP_DBG_MSG("Successfully Start Low Power Advertising \n");
}
}
else
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/STM32_WPAN/App/ble_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/STM32_WPAN/App/ble_conf.h
index e1d7097fe..023ae07e3 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/STM32_WPAN/App/ble_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/STM32_WPAN/App/ble_conf.h
@@ -50,7 +50,7 @@
* This shall take into account all registered handlers
* (from either the provided services or the custom services)
*/
-#define BLE_CFG_SVC_MAX_NBR_CB 5
+#define BLE_CFG_SVC_MAX_NBR_CB 7
#define BLE_CFG_CLT_MAX_NBR_CB 0
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/SW4STM32/Production/.cproject b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/SW4STM32/Production/.cproject
index 0429c4d40..9b6173118 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/SW4STM32/Production/.cproject
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/SW4STM32/Production/.cproject
@@ -88,7 +88,7 @@
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble"/>
<listOptionValue builtIn="false" value="../../../Core/Inc"/>
- <listOptionValue builtIn="false" value="../../../STM32_WPAN/app"/>
+ <listOptionValue builtIn="false" value="../../../STM32_WPAN/App"/>
<listOptionValue builtIn="false" value="../../../../../../../../Drivers/BSP/P-NUCLEO-WB55.USBDongle"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/vcp"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc"/>
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/SW4STM32/Production/.project b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/SW4STM32/Production/.project
index a26ae9024..ce1e85866 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/SW4STM32/Production/.project
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_HeartRate/SW4STM32/Production/.project
@@ -65,19 +65,19 @@
<location>PARENT-2-PROJECT_LOC/Core/Src/stm32wbxx_it.c</location>
</link>
<link>
- <name>Application/STM32_WPAN/app/app_ble.c</name>
+ <name>Application/STM32_WPAN/App/app_ble.c</name>
<type>1</type>
- <location>PARENT-2-PROJECT_LOC/STM32_WPAN/app/app_ble.c</location>
+ <location>PARENT-2-PROJECT_LOC/STM32_WPAN/App/app_ble.c</location>
</link>
<link>
- <name>Application/STM32_WPAN/app/dis_app.c</name>
+ <name>Application/STM32_WPAN/App/dis_app.c</name>
<type>1</type>
- <location>PARENT-2-PROJECT_LOC/STM32_WPAN/app/dis_app.c</location>
+ <location>PARENT-2-PROJECT_LOC/STM32_WPAN/App/dis_app.c</location>
</link>
<link>
- <name>Application/STM32_WPAN/app/hrs_app.c</name>
+ <name>Application/STM32_WPAN/App/hrs_app.c</name>
<type>1</type>
- <location>PARENT-2-PROJECT_LOC/STM32_WPAN/app/hrs_app.c</location>
+ <location>PARENT-2-PROJECT_LOC/STM32_WPAN/App/hrs_app.c</location>
</link>
<link>
<name>Application/STM32_WPAN/target/hw_ipcc.c</name>
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/app_conf.h
index 34a223db9..bf3dc0138 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/app_conf.h
@@ -24,12 +24,13 @@
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* MESH Application Config
******************************************************************************/
-/**< generic parameters ********************************************************/
+/**< generic parameters ******************************************************/
/**
* Define Tx Power
@@ -101,11 +102,22 @@
*/
#define CFG_BLE_ERK {0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21,0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21}
+/* USER CODE BEGIN Generic_Parameters */
+/**
+ * SMPS supply
+ * SMPS not used when Set to 0
+ * SMPS used when Set to 1
+ */
+#define CFG_USE_SMPS 1
+/* USER CODE END Generic_Parameters */
+
/**< specific parameters ********************************************************/
#define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI15_10_IRQHandler
//#define PUSH_BUTTON_SW2_EXTI_IRQHandler EXTI0_IRQHandler
//#define PUSH_BUTTON_SW3_EXTI_IRQHandler EXTI1_IRQHandler
+#define POWEROFF_EXTI_IRQHandler EXTI2_IRQHandler
+
#define CFG_MAX_CONNECTION 1
#define RADIO_ACTIVITY_EVENT 0
@@ -202,7 +214,7 @@
* 1 : internal RO
* 0 : external crystal ( no calibration )
*/
-#define CFG_BLE_LSE_SOURCE 1
+#define CFG_BLE_LSE_SOURCE 0
/**
* Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
@@ -388,7 +400,7 @@ typedef enum
* keep debugger enabled while in any low power mode when set to 1
* should be set to 0 in production
*/
-#define CFG_DEBUGGER_SUPPORTED 0
+#define CFG_DEBUGGER_SUPPORTED 1
/**
* When set to 1, the traces are enabled in the BLE services
@@ -425,7 +437,7 @@ typedef enum
* When both are set to 0, no trace are output
* When both are set to 1, CFG_DEBUG_TRACE_FULL is selected
*/
-#define CFG_DEBUG_TRACE_LIGHT 1
+#define CFG_DEBUG_TRACE_LIGHT 0
#define CFG_DEBUG_TRACE_FULL 0
#if (( CFG_DEBUG_TRACE != 0 ) && ( CFG_DEBUG_TRACE_LIGHT == 0 ) && (CFG_DEBUG_TRACE_FULL == 0))
@@ -471,6 +483,8 @@ typedef enum
CFG_TASK_ADV_UPDATE_ID,
CFG_TASK_HCI_ASYNCH_EVT_ID,
CFG_TASK_MESH_REQ_ID,
+ CFG_TASK_MESH_BEACON_REQ_ID,
+ CFG_TASK_MESH_UART_RX_REQ_ID,
CFG_LAST_TASK_ID_WITH_HCICMD, /**< Shall be LAST in the list */
} CFG_Task_Id_With_HCI_Cmd_t;
@@ -515,7 +529,7 @@ typedef enum
typedef enum
{
CFG_LPM_APP,
- CFG_LPM_APP_BLE,
+ CFG_LPM_APP_BLE
} CFG_LPM_Id_t;
/******************************************************************************
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/stm32_lpm_if.h
index 38e326512..d8e67947f 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/stm32_lpm_if.h
@@ -1,46 +1,22 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file stm32_lpm_if.h
-* @brief Header for stm32_lpm_f.c module (device specific LP management)
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
******************************************************************************
* @attention
*
-* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics International N.V.
+* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted, provided that the following conditions are met:
-*
-* 1. Redistribution of source code must retain the above copyright notice,
-* this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following disclaimer in the documentation
-* and/or other materials provided with the distribution.
-* 3. Neither the name of STMicroelectronics nor the names of other
-* contributors to this software may be used to endorse or promote products
-* derived from this software without specific written permission.
-* 4. This software, including modifications and/or derivative works of this
-* software, must execute solely and exclusively on microcontroller or
-* microprocessor devices manufactured by or for STMicroelectronics.
-* 5. Redistribution and use of this software other than as permitted under
-* this license is void and will automatically terminate your rights under
-* this license.
-*
-* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
-* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
-* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+* This software component is licensed by ST under BSD 3-Clause license,
+* the "License"; You may not use this file except in compliance with the
+* License. You may obtain a copy of the License at:
+* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32_LPM_IF_H
@@ -89,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/stm32wbxx_hal_conf.h
index 6f505b24b..0270583e8 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/stm32wbxx_hal_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/stm32wbxx_hal_conf.h
@@ -219,6 +219,10 @@
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32wbxx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32wbxx_hal_flash.h"
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/stm32wbxx_it.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/stm32wbxx_it.h
index e26d04fbf..5bebf1ba6 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/stm32wbxx_it.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/stm32wbxx_it.h
@@ -57,6 +57,10 @@ void USB_LP_IRQHandler(void);
void USB_HP_IRQHandler(void);
void USB_FS_WKUP_IRQHandler(void);
+void POWEROFF_EXTI_IRQHandler(void);
+void TIM2_IRQHandler(void);
+void TIM1_CC_IRQHandler(void);
+
#ifdef __cplusplus
}
#endif
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/utilities_conf.h
index c98d97ba1..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Inc/utilities_conf.h
@@ -1,3 +1,4 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* File Name : utilities_conf.h
@@ -9,13 +10,14 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef UTILITIES_CONF_H
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Src/app_entry.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Src/app_entry.c
index 6c680bc35..82ab32927 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Src/app_entry.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Src/app_entry.c
@@ -34,6 +34,8 @@
#include "app_debug.h"
+#include "appli_mesh.h"
+
/* Private includes -----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
@@ -41,6 +43,9 @@
/* Private typedef -----------------------------------------------------------*/
extern RTC_HandleTypeDef hrtc;
+#ifdef SAVE_MODEL_STATE_POWER_FAILURE_DETECTION
+extern MOBLEUINT8 PowerOnOff_flag;
+#endif
/* USER CODE BEGIN PTD */
/* USER CODE END PTD */
@@ -107,12 +112,14 @@ void APPE_Init( void )
Led_Init();
Button_Init();
+
+
/* USER CODE END APPE_Init_1 */
appe_Tl_Init(); /* Initialize all transport layers */
/**
* From now, the application is waiting for the ready event ( VS_HCI_C2_Ready )
- * received on the system channel before starting the BLE Stack
+ * received on the system channel before starting the Stack
* This system event is received with APPE_SysUserEvtRx()
*/
/* USER CODE BEGIN APPE_Init_2 */
@@ -199,7 +206,7 @@ static void APPE_SysUserEvtRx( void * pPayload )
APPD_EnableCPU2( );
APP_BLE_Init( );
- UTIL_LPM_SetOffMode(1 << CFG_LPM_APP, UTIL_LPM_ENABLE);
+ UTIL_LPM_SetOffMode(1U << CFG_LPM_APP, UTIL_LPM_ENABLE);
return;
}
@@ -282,8 +289,13 @@ void HAL_GPIO_EXTI_Callback( uint16_t GPIO_Pin )
{
switch (GPIO_Pin)
{
- case BUTTON_SW1_PIN:
+#ifdef SAVE_MODEL_STATE_POWER_FAILURE_DETECTION
+ case POWEROFF_PIN:
+ {
+ PowerOnOff_flag = 1;
+ }
break;
+#endif
default:
break;
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Src/hw_timerserver.c
index 52a1bfa0d..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Src/hw_timerserver.c
@@ -1,22 +1,21 @@
/**
******************************************************************************
- * File Name : hw_timerserver.c
- * Description : Hardware timerserver source file for BLE
- * middleWare.
+ * File Name : hw_timerserver.c
+ * Description : Hardware timerserver source file for STM32WPAN Middleware.
+ *
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Src/main.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Src/main.c
index 0b70db150..14171a57d 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Src/main.c
@@ -58,6 +58,8 @@
/* Private macros ------------------------------------------------------------*/
/* Global variables ---------------------------------------------------------*/
RTC_HandleTypeDef hrtc = { 0 }; /**< RTC handler declaration */
+TIM_HandleTypeDef htim1 = { 0 };
+TIM_HandleTypeDef htim2 = { 0 };
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
@@ -89,34 +91,10 @@ int main( void )
Init_Exti( );
- /* Enable CRC clock */
- __HAL_RCC_CRC_CLK_ENABLE();
-
Init_RTC();
- // Enable SMPS supply
- RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
- PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_SMPS ;
- PeriphClkInit.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSI;
- PeriphClkInit.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE1;
-
- HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit);
-
- SET_BIT(PWR->CR5, PWR_CR5_SMPSVOS_2 | PWR_CR5_SMPSVOS_0); /*Nucleo QFN68 Cut2.1 nb00920*/
- CLEAR_BIT(PWR->CR5, PWR_CR5_SMPSVOS_3 | PWR_CR5_SMPSVOS_1);
- SET_BIT(PWR->CR5, PWR_CR5_SMPSEN);
-
- // CPU 1 and 2 at 32 Mz - Clk source HSE without PLL
- RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
- RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK;
- RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSE;
- RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
- RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
- RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
- RCC_ClkInitStruct.AHBCLK2Divider = RCC_SYSCLK_DIV1;
- RCC_ClkInitStruct.AHBCLK4Divider = RCC_SYSCLK_DIV1;
-
- HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2);
+ /* Enable CRC clock */
+ __HAL_RCC_CRC_CLK_ENABLE();
APPE_Init( );
@@ -230,7 +208,13 @@ static void Init_RTC( void )
hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
HAL_RTC_Init(&hrtc);
- MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* Disable RTC registers write protection */
+ LL_RTC_DisableWriteProtection(RTC);
+
+ LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER);
+
+ /* Enable RTC registers write protection */
+ LL_RTC_EnableWriteProtection(RTC);
return;
}
@@ -253,6 +237,12 @@ void SystemClock_Config( void )
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -303,19 +293,6 @@ void SystemClock_Config( void )
*/
LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
@@ -324,5 +301,33 @@ void SystemClock_Config( void )
* WRAP FUNCTIONS
*
*************************************************************/
+void HAL_Delay(uint32_t Delay)
+{
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
+
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
+}
/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Src/stm32wbxx_it.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Src/stm32wbxx_it.c
index b930a5814..02c02d26a 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Src/stm32wbxx_it.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/Core/Src/stm32wbxx_it.c
@@ -23,13 +23,16 @@
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
#include "stm32wbxx_it.h"
+#include "appli_mesh.h"
+#include "PWM_handlers.h"
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
extern PCD_HandleTypeDef hpcd;
-
+extern TIM_HandleTypeDef htim1;
+extern TIM_HandleTypeDef htim2;
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
@@ -140,6 +143,19 @@ void PUSH_BUTTON_SW3_EXTI_IRQHandler(void)
// HAL_GPIO_EXTI_IRQHandler(BUTTON_SW3_PIN);
}
+#ifdef SAVE_MODEL_STATE_POWER_FAILURE_DETECTION
+/**
+ * @brief This function handles External line
+ * interrupt request.
+ * @param None
+ * @retval None
+ */
+void POWEROFF_EXTI_IRQHandler(void)
+{
+ HAL_GPIO_EXTI_IRQHandler(POWEROFF_PIN);
+}
+#endif
+
/**
* @brief This function handles USB FS global interrupt request.
* @param None
@@ -217,6 +233,33 @@ void IPCC_C1_RX_IRQHandler(void)
return;
}
+/**
+ * @brief This function handles TIM2 global interrupt.
+ */
+void TIM2_IRQHandler(void)
+{
+ /* USER CODE BEGIN TIM2_IRQn 0 */
+
+ /* USER CODE END TIM2_IRQn 0 */
+ HAL_TIM_IRQHandler(&htim2);
+ /* USER CODE BEGIN TIM2_IRQn 1 */
+
+ /* USER CODE END TIM2_IRQn 1 */
+}
+
+/**
+ * @brief This function handles TIM1 global interrupt.
+ */
+void TIM1_CC_IRQHandler(void)
+{
+ /* USER CODE BEGIN TIM1_IRQn 0 */
+
+ /* USER CODE END TIM1_IRQn 0 */
+ HAL_TIM_IRQHandler(&htim1);
+ /* USER CODE BEGIN TIM1_IRQn 1 */
+
+ /* USER CODE END TIM1_IRQn 1 */
+}
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/EWARM/BLE_MeshLightingDemo.ewp b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/EWARM/BLE_MeshLightingDemo.ewp
index c79554747..afbd35352 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/EWARM/BLE_MeshLightingDemo.ewp
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/EWARM/BLE_MeshLightingDemo.ewp
@@ -121,7 +121,7 @@
</option>
<option>
<name>OGUseCmsis</name>
- <state>1</state>
+ <state>0</state>
</option>
<option>
<name>OGUseCmsisDspLib</name>
@@ -221,7 +221,7 @@
<state>CORE_CM4</state>
<state>STM32</state>
<state>ENABLE_USART</state>
- <state>DISABLE_TRACES</state>
+ <state>TRACE_ENABLE_NO_FUNCTION</state>
</option>
<option>
<name>CCPreprocFile</name>
@@ -390,7 +390,7 @@
<option>
<name>CCOptStrategy</name>
<version>0</version>
- <state>2</state>
+ <state>1</state>
</option>
<option>
<name>CCOptLevelSlave</name>
@@ -457,7 +457,7 @@
<option>
<name>CCOptStrategySlave</name>
<version>0</version>
- <state>2</state>
+ <state>1</state>
</option>
<option>
<name>CCGuardCalls</name>
@@ -1100,9 +1100,15 @@
<name>$PROJ_DIR$\..\STM32_WPAN\app\appli_light.c</name>
</file>
<file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\app\appli_light_lc.c</name>
+ </file>
+ <file>
<name>$PROJ_DIR$\..\STM32_WPAN\app\appli_mesh.c</name>
</file>
<file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\app\appli_nvm.c</name>
+ </file>
+ <file>
<name>$PROJ_DIR$\..\STM32_WPAN\app\appli_sensor.c</name>
</file>
<file>
@@ -1111,6 +1117,15 @@
<file>
<name>$PROJ_DIR$\..\STM32_WPAN\app\models_if.c</name>
</file>
+ <file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\app\pal_nvm.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\app\PWM_config.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\STM32_WPAN\app\PWM_handlers.c</name>
+ </file>
</group>
<group>
<name>target</name>
@@ -1194,6 +1209,12 @@
<name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_rtc_ex.c</name>
</file>
<file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_tim.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_tim_ex.c</name>
+ </file>
+ <file>
<name>$PROJ_DIR$\..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_uart.c</name>
</file>
<file>
@@ -1237,13 +1258,13 @@
<name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\mesh\MeshModel\Src\light.c</name>
</file>
<file>
- <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\svc\Src\mesh.c</name>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\mesh\MeshModel\Src\light_lc.c</name>
</file>
<file>
- <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\mesh\Src\mesh_cfg.c</name>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\svc\Src\mesh.c</name>
</file>
<file>
- <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\mesh\PAL\STM32WB\pal_nvm.c</name>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\mesh\Src\mesh_cfg.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\mesh\MeshModel\Src\sensors.c</name>
@@ -1334,6 +1355,12 @@
<name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\utilities\otp.c</name>
</file>
<file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Utilities\lpm\tiny_lpm\stm32_lpm.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\..\..\..\..\Utilities\sequencer\stm32_seq.c</name>
+ </file>
+ <file>
<name>$PROJ_DIR$\..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\utilities\stm_list.c</name>
</file>
<file>
@@ -1342,13 +1369,4 @@
</group>
</group>
</group>
- <group>
- <name>Utilities</name>
- <file>
- <name>$PROJ_DIR$\..\..\..\..\..\..\Utilities\lpm\tiny_lpm\stm32_lpm.c</name>
- </file>
- <file>
- <name>$PROJ_DIR$\..\..\..\..\..\..\Utilities\sequencer\stm32_seq.c</name>
- </file>
- </group>
</project>
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/EWARM/stm32wb55xx_flash_cm4.icf b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/EWARM/stm32wb55xx_flash_cm4.icf
index e06ae25d2..8c55c2b77 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/EWARM/stm32wb55xx_flash_cm4.icf
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/EWARM/stm32wb55xx_flash_cm4.icf
@@ -17,12 +17,8 @@ define symbol __ICFEDIT_size_heap__ = 0x400;
define symbol __ICFEDIT_region_RAM_SHARED_start__ = 0x20030000;
define symbol __ICFEDIT_region_RAM_SHARED_end__ = 0x200327FF;
-define symbol __PROGRAM_END__ = __ICFEDIT_region_ROM_end__ - 0x2000;
-define symbol __CONFIGURATION_START__ = __PROGRAM_END__ + 1;
-
define memory mem with size = 4G;
-
-define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __PROGRAM_END__];
+define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
define region RAM_SHARED_region = mem:[from __ICFEDIT_region_RAM_SHARED_start__ to __ICFEDIT_region_RAM_SHARED_end__];
@@ -30,27 +26,15 @@ define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
/* MB_MEM1 and MB_MEM2 are sections reserved to mailbox communication. It is placed in the shared memory */
-initialize by copy { readwrite, section .ops };
+initialize by copy { readwrite };
do not initialize { section .noinit,
section MAPPING_TABLE,
section MB_MEM1 };
-initialize manually { section .wow };
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
place in ROM_region { readonly };
-define block WOW with fixed order
-{
- section wow_start_mark,
- section .wow,
- section wow_end_mark
-};
-place in RAM_region { readwrite, block WOW,
- block CSTACK, block HEAP };
-place at address mem:__CONFIGURATION_START__ { readonly section .appconfig };
-define symbol _bdaddr = __CONFIGURATION_START__;
-export symbol _bdaddr;
-
+place in RAM_region { readwrite,block CSTACK, block HEAP };
place in RAM_SHARED_region { first section MAPPING_TABLE};
place in RAM_SHARED_region { section MB_MEM1};
place in RAM_SHARED_region { section MB_MEM2};
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/MDK-ARM/BLE_MeshLightingDemo.uvoptx b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/MDK-ARM/BLE_MeshLightingDemo.uvoptx
index 50b77147b..a00e69f10 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/MDK-ARM/BLE_MeshLightingDemo.uvoptx
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/MDK-ARM/BLE_MeshLightingDemo.uvoptx
@@ -119,13 +119,33 @@
<TargetDriverDllRegistry>
<SetRegEntry>
<Number>0</Number>
+ <Key>ARMRTXEVENTFLAGS</Key>
+ <Name>-L70 -Z18 -C0 -M0 -T1</Name>
+ </SetRegEntry>
+ <SetRegEntry>
+ <Number>0</Number>
+ <Key>DLGTARM</Key>
+ <Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0)</Name>
+ </SetRegEntry>
+ <SetRegEntry>
+ <Number>0</Number>
+ <Key>ARMDBGFLAGS</Key>
+ <Name></Name>
+ </SetRegEntry>
+ <SetRegEntry>
+ <Number>0</Number>
+ <Key>DLGUARM</Key>
+ <Name>(105=-1,-1,-1,-1,0)</Name>
+ </SetRegEntry>
+ <SetRegEntry>
+ <Number>0</Number>
<Key>UL2CM3</Key>
<Name>UL2CM3(-S0 -C0 -P0 -FD20030000 -FC1000 -FN1 -FF0STM32WB_M4 -FS08000000 -FL0100000 -FP0($$Device:STM32WB55CGUx$CMSIS\Flash\STM32WB_M4.FLM))</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>ST-LINKIII-KEIL_SWO</Key>
- <Name>-U-O142 -O2254 -S0 -C0 -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC1000 -FN1 -FF0STM32WB_M4.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32WB55CGUx$CMSIS\Flash\STM32WB_M4.FLM)</Name>
+ <Name>-U51FF75064987505352141387 -O2254 -SF4000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP") -D00(6BA02477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC1000 -FN1 -FF0STM32WB_M4.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32WB55CGUx$CMSIS\Flash\STM32WB_M4.FLM)</Name>
</SetRegEntry>
</TargetDriverDllRegistry>
<Breakpoint/>
@@ -140,7 +160,7 @@
<aSer1>0</aSer1>
<aSer2>0</aSer2>
<aPa>0</aPa>
- <viewmode>0</viewmode>
+ <viewmode>1</viewmode>
<vrSel>0</vrSel>
<aSym>0</aSym>
<aTbox>0</aTbox>
@@ -176,7 +196,7 @@
<Group>
<GroupName>Application/Core</GroupName>
- <tvExp>0</tvExp>
+ <tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@@ -288,7 +308,7 @@
<Group>
<GroupName>Application/STM32_WPAN/app</GroupName>
- <tvExp>1</tvExp>
+ <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@@ -308,7 +328,7 @@
<GroupNumber>3</GroupNumber>
<FileNumber>10</FileNumber>
<FileType>1</FileType>
- <tvExp>0</tvExp>
+ <tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>../STM32_WPAN/app/appli_generic.c</PathWithFileName>
@@ -376,6 +396,66 @@
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
+ <File>
+ <GroupNumber>3</GroupNumber>
+ <FileNumber>16</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>..\STM32_WPAN\app\appli_light_lc.c</PathWithFileName>
+ <FilenameWithoutPath>appli_light_lc.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>3</GroupNumber>
+ <FileNumber>17</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>..\STM32_WPAN\app\pal_nvm.c</PathWithFileName>
+ <FilenameWithoutPath>pal_nvm.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>3</GroupNumber>
+ <FileNumber>18</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>..\STM32_WPAN\app\PWM_config.c</PathWithFileName>
+ <FilenameWithoutPath>PWM_config.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>3</GroupNumber>
+ <FileNumber>19</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>..\STM32_WPAN\app\PWM_handlers.c</PathWithFileName>
+ <FilenameWithoutPath>PWM_handlers.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>3</GroupNumber>
+ <FileNumber>20</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>..\STM32_WPAN\app\appli_nvm.c</PathWithFileName>
+ <FilenameWithoutPath>appli_nvm.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
</Group>
<Group>
@@ -386,7 +466,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>4</GroupNumber>
- <FileNumber>16</FileNumber>
+ <FileNumber>21</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -406,7 +486,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>5</GroupNumber>
- <FileNumber>17</FileNumber>
+ <FileNumber>22</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -420,13 +500,13 @@
<Group>
<GroupName>Drivers/BSP/P-NUCLEO-WB55.USBDongle</GroupName>
- <tvExp>0</tvExp>
+ <tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>6</GroupNumber>
- <FileNumber>18</FileNumber>
+ <FileNumber>23</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -446,7 +526,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>7</GroupNumber>
- <FileNumber>19</FileNumber>
+ <FileNumber>24</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -460,13 +540,13 @@
<Group>
<GroupName>Drivers/STM32WBxx_HAL_Driver</GroupName>
- <tvExp>0</tvExp>
+ <tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>20</FileNumber>
+ <FileNumber>25</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -478,7 +558,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>21</FileNumber>
+ <FileNumber>26</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -490,7 +570,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>22</FileNumber>
+ <FileNumber>27</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -502,7 +582,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>23</FileNumber>
+ <FileNumber>28</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -514,7 +594,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>24</FileNumber>
+ <FileNumber>29</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -526,7 +606,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>25</FileNumber>
+ <FileNumber>30</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -538,7 +618,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>26</FileNumber>
+ <FileNumber>31</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -550,7 +630,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>27</FileNumber>
+ <FileNumber>32</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -562,7 +642,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>28</FileNumber>
+ <FileNumber>33</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -574,7 +654,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>29</FileNumber>
+ <FileNumber>34</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -586,7 +666,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>30</FileNumber>
+ <FileNumber>35</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -598,7 +678,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>31</FileNumber>
+ <FileNumber>36</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -610,7 +690,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>32</FileNumber>
+ <FileNumber>37</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -622,7 +702,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>33</FileNumber>
+ <FileNumber>38</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -634,7 +714,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>34</FileNumber>
+ <FileNumber>39</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -646,7 +726,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>35</FileNumber>
+ <FileNumber>40</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -658,7 +738,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>36</FileNumber>
+ <FileNumber>41</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -670,7 +750,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>37</FileNumber>
+ <FileNumber>42</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -682,7 +762,7 @@
</File>
<File>
<GroupNumber>8</GroupNumber>
- <FileNumber>38</FileNumber>
+ <FileNumber>43</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -692,17 +772,41 @@
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
+ <File>
+ <GroupNumber>8</GroupNumber>
+ <FileNumber>44</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_tim.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_tim.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
+ <File>
+ <GroupNumber>8</GroupNumber>
+ <FileNumber>45</FileNumber>
+ <FileType>1</FileType>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <bDave2>0</bDave2>
+ <PathWithFileName>..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_tim_ex.c</PathWithFileName>
+ <FilenameWithoutPath>stm32wbxx_hal_tim_ex.c</FilenameWithoutPath>
+ <RteFlg>0</RteFlg>
+ <bShared>0</bShared>
+ </File>
</Group>
<Group>
<GroupName>Middlewares/STM32_USB_Device_Library</GroupName>
- <tvExp>0</tvExp>
+ <tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>9</GroupNumber>
- <FileNumber>39</FileNumber>
+ <FileNumber>46</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -714,7 +818,7 @@
</File>
<File>
<GroupNumber>9</GroupNumber>
- <FileNumber>40</FileNumber>
+ <FileNumber>47</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -726,7 +830,7 @@
</File>
<File>
<GroupNumber>9</GroupNumber>
- <FileNumber>41</FileNumber>
+ <FileNumber>48</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -738,7 +842,7 @@
</File>
<File>
<GroupNumber>9</GroupNumber>
- <FileNumber>42</FileNumber>
+ <FileNumber>49</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -758,7 +862,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>10</GroupNumber>
- <FileNumber>43</FileNumber>
+ <FileNumber>50</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -770,7 +874,7 @@
</File>
<File>
<GroupNumber>10</GroupNumber>
- <FileNumber>44</FileNumber>
+ <FileNumber>51</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -782,7 +886,7 @@
</File>
<File>
<GroupNumber>10</GroupNumber>
- <FileNumber>45</FileNumber>
+ <FileNumber>52</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -794,7 +898,7 @@
</File>
<File>
<GroupNumber>10</GroupNumber>
- <FileNumber>46</FileNumber>
+ <FileNumber>53</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -806,7 +910,7 @@
</File>
<File>
<GroupNumber>10</GroupNumber>
- <FileNumber>47</FileNumber>
+ <FileNumber>54</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -818,61 +922,61 @@
</File>
<File>
<GroupNumber>10</GroupNumber>
- <FileNumber>48</FileNumber>
+ <FileNumber>55</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/mesh/PAL/STM32WB/pal_nvm.c</PathWithFileName>
- <FilenameWithoutPath>pal_nvm.c</FilenameWithoutPath>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/sensors.c</PathWithFileName>
+ <FilenameWithoutPath>sensors.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>10</GroupNumber>
- <FileNumber>49</FileNumber>
+ <FileNumber>56</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/sensors.c</PathWithFileName>
- <FilenameWithoutPath>sensors.c</FilenameWithoutPath>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/svc/Src/svc_ctl.c</PathWithFileName>
+ <FilenameWithoutPath>svc_ctl.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>10</GroupNumber>
- <FileNumber>50</FileNumber>
+ <FileNumber>57</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/svc/Src/svc_ctl.c</PathWithFileName>
- <FilenameWithoutPath>svc_ctl.c</FilenameWithoutPath>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/time_scene.c</PathWithFileName>
+ <FilenameWithoutPath>time_scene.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>10</GroupNumber>
- <FileNumber>51</FileNumber>
+ <FileNumber>58</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/time_scene.c</PathWithFileName>
- <FilenameWithoutPath>time_scene.c</FilenameWithoutPath>
+ <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/vendor.c</PathWithFileName>
+ <FilenameWithoutPath>vendor.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>10</GroupNumber>
- <FileNumber>52</FileNumber>
+ <FileNumber>59</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>../../../../../../Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/vendor.c</PathWithFileName>
- <FilenameWithoutPath>vendor.c</FilenameWithoutPath>
+ <PathWithFileName>..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\mesh\MeshModel\Src\light_lc.c</PathWithFileName>
+ <FilenameWithoutPath>light_lc.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
@@ -886,7 +990,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>11</GroupNumber>
- <FileNumber>53</FileNumber>
+ <FileNumber>60</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -898,7 +1002,7 @@
</File>
<File>
<GroupNumber>11</GroupNumber>
- <FileNumber>54</FileNumber>
+ <FileNumber>61</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -910,7 +1014,7 @@
</File>
<File>
<GroupNumber>11</GroupNumber>
- <FileNumber>55</FileNumber>
+ <FileNumber>62</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -922,7 +1026,7 @@
</File>
<File>
<GroupNumber>11</GroupNumber>
- <FileNumber>56</FileNumber>
+ <FileNumber>63</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -934,7 +1038,7 @@
</File>
<File>
<GroupNumber>11</GroupNumber>
- <FileNumber>57</FileNumber>
+ <FileNumber>64</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -946,7 +1050,7 @@
</File>
<File>
<GroupNumber>11</GroupNumber>
- <FileNumber>58</FileNumber>
+ <FileNumber>65</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -966,7 +1070,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>12</GroupNumber>
- <FileNumber>59</FileNumber>
+ <FileNumber>66</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -986,7 +1090,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>13</GroupNumber>
- <FileNumber>60</FileNumber>
+ <FileNumber>67</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -998,7 +1102,7 @@
</File>
<File>
<GroupNumber>13</GroupNumber>
- <FileNumber>61</FileNumber>
+ <FileNumber>68</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -1010,7 +1114,7 @@
</File>
<File>
<GroupNumber>13</GroupNumber>
- <FileNumber>62</FileNumber>
+ <FileNumber>69</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -1022,7 +1126,7 @@
</File>
<File>
<GroupNumber>13</GroupNumber>
- <FileNumber>63</FileNumber>
+ <FileNumber>70</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -1034,7 +1138,7 @@
</File>
<File>
<GroupNumber>13</GroupNumber>
- <FileNumber>64</FileNumber>
+ <FileNumber>71</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -1054,7 +1158,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>14</GroupNumber>
- <FileNumber>65</FileNumber>
+ <FileNumber>72</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -1066,7 +1170,7 @@
</File>
<File>
<GroupNumber>14</GroupNumber>
- <FileNumber>66</FileNumber>
+ <FileNumber>73</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -1078,7 +1182,7 @@
</File>
<File>
<GroupNumber>14</GroupNumber>
- <FileNumber>67</FileNumber>
+ <FileNumber>74</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -1098,7 +1202,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>15</GroupNumber>
- <FileNumber>68</FileNumber>
+ <FileNumber>75</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -1110,7 +1214,7 @@
</File>
<File>
<GroupNumber>15</GroupNumber>
- <FileNumber>69</FileNumber>
+ <FileNumber>76</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -1122,7 +1226,7 @@
</File>
<File>
<GroupNumber>15</GroupNumber>
- <FileNumber>70</FileNumber>
+ <FileNumber>77</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -1134,7 +1238,7 @@
</File>
<File>
<GroupNumber>15</GroupNumber>
- <FileNumber>71</FileNumber>
+ <FileNumber>78</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -1146,7 +1250,7 @@
</File>
<File>
<GroupNumber>15</GroupNumber>
- <FileNumber>72</FileNumber>
+ <FileNumber>79</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -1158,7 +1262,7 @@
</File>
<File>
<GroupNumber>15</GroupNumber>
- <FileNumber>73</FileNumber>
+ <FileNumber>80</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -1178,7 +1282,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>16</GroupNumber>
- <FileNumber>74</FileNumber>
+ <FileNumber>81</FileNumber>
<FileType>4</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -1198,7 +1302,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>17</GroupNumber>
- <FileNumber>75</FileNumber>
+ <FileNumber>82</FileNumber>
<FileType>4</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/MDK-ARM/BLE_MeshLightingDemo.uvprojx b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/MDK-ARM/BLE_MeshLightingDemo.uvprojx
index d35d243c6..174b8d030 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/MDK-ARM/BLE_MeshLightingDemo.uvprojx
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/MDK-ARM/BLE_MeshLightingDemo.uvprojx
@@ -16,7 +16,7 @@
<TargetCommonOption>
<Device>STM32WB55CGUx</Device>
<Vendor>STMicroelectronics</Vendor>
- <PackID>Keil.STM32WBxx.0.0.4</PackID>
+ <PackID>Keil.STM32WBxx_DFP.1.0.0</PackID>
<PackURL>http://www.keil.com/pack</PackURL>
<Cpu>IROM(0x08000000-0x807FFFF) IRAM(0x20000004-0x2002FC03) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4")</Cpu>
<FlashUtilSpec></FlashUtilSpec>
@@ -53,8 +53,8 @@
<CreateExecutable>1</CreateExecutable>
<CreateLib>0</CreateLib>
<CreateHexFile>1</CreateHexFile>
- <DebugInformation>1</DebugInformation>
- <BrowseInformation>1</BrowseInformation>
+ <DebugInformation>0</DebugInformation>
+ <BrowseInformation>0</BrowseInformation>
<ListingPath></ListingPath>
<HexFormatSelection>1</HexFormatSelection>
<Merge32K>0</Merge32K>
@@ -134,11 +134,11 @@
<RunIndependent>0</RunIndependent>
<UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
<Capability>1</Capability>
- <DriverSelection>4107</DriverSelection>
+ <DriverSelection>4101</DriverSelection>
</Flash1>
<bUseTDR>1</bUseTDR>
<Flash2>STLink\ST-LINKIII-KEIL_SWO.dll</Flash2>
- <Flash3></Flash3>
+ <Flash3>"" ()</Flash3>
<Flash4></Flash4>
<pFcarmOut></pFcarmOut>
<pFcarmGrp></pFcarmGrp>
@@ -467,6 +467,31 @@
<FileType>1</FileType>
<FilePath>../STM32_WPAN/app/models_if.c</FilePath>
</File>
+ <File>
+ <FileName>appli_light_lc.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>..\STM32_WPAN\app\appli_light_lc.c</FilePath>
+ </File>
+ <File>
+ <FileName>pal_nvm.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>..\STM32_WPAN\app\pal_nvm.c</FilePath>
+ </File>
+ <File>
+ <FileName>PWM_config.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>..\STM32_WPAN\app\PWM_config.c</FilePath>
+ </File>
+ <File>
+ <FileName>PWM_handlers.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>..\STM32_WPAN\app\PWM_handlers.c</FilePath>
+ </File>
+ <File>
+ <FileName>appli_nvm.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>..\STM32_WPAN\app\appli_nvm.c</FilePath>
+ </File>
</Files>
</Group>
<Group>
@@ -607,6 +632,16 @@
<FileType>1</FileType>
<FilePath>../../../../../../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_ll_usb.c</FilePath>
</File>
+ <File>
+ <FileName>stm32wbxx_hal_tim.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_tim.c</FilePath>
+ </File>
+ <File>
+ <FileName>stm32wbxx_hal_tim_ex.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>..\..\..\..\..\..\Drivers\STM32WBxx_HAL_Driver\Src\stm32wbxx_hal_tim_ex.c</FilePath>
+ </File>
</Files>
</Group>
<Group>
@@ -663,11 +698,6 @@
<FilePath>../../../../../../Middlewares/ST/STM32_WPAN/ble/mesh/Src/mesh_cfg.c</FilePath>
</File>
<File>
- <FileName>pal_nvm.c</FileName>
- <FileType>1</FileType>
- <FilePath>../../../../../../Middlewares/ST/STM32_WPAN/ble/mesh/PAL/STM32WB/pal_nvm.c</FilePath>
- </File>
- <File>
<FileName>sensors.c</FileName>
<FileType>1</FileType>
<FilePath>../../../../../../Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/sensors.c</FilePath>
@@ -687,6 +717,11 @@
<FileType>1</FileType>
<FilePath>../../../../../../Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/vendor.c</FilePath>
</File>
+ <File>
+ <FileName>light_lc.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>..\..\..\..\..\..\Middlewares\ST\STM32_WPAN\ble\mesh\MeshModel\Src\light_lc.c</FilePath>
+ </File>
</Files>
</Group>
<Group>
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_config.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_config.c
new file mode 100644
index 000000000..e9b50f44e
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_config.c
@@ -0,0 +1,109 @@
+/**
+ *******************************************************************************
+ * @file PWM_config.c
+ * @author BLE Mesh Team
+ * @brief Configuration file for PWM.
+ *******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ *******************************************************************************
+*/
+
+/* Includes ------------------------------------------------------------------*/
+#include "hal_common.h"
+#include "PWM_config.h"
+
+extern TIM_HandleTypeDef htim1;
+extern TIM_HandleTypeDef htim2;
+
+#define PRESCALER_VALUE (uint32_t)(((SystemCoreClock) / 1000000) - 1)
+
+/**
+ *@brief Configure PWM sources and GPIO
+ *@retval None
+ */
+void PWM_Init()
+{
+ TIM_OC_InitTypeDef sConfigOC = {0};
+ TIM_MasterConfigTypeDef sMasterConfig = {0};
+
+ /* GPIO Configuration */
+ GPIO_InitTypeDef GPIO_InitStructure = {0};
+
+
+ /* Configure PWM pins */
+ GPIO_InitStructure.Pin = PWM0_PIN | PWM1_PIN;
+ GPIO_InitStructure.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStructure.Pull = GPIO_PULLUP;
+ GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
+ GPIO_InitStructure.Alternate = GPIO_AF1_TIM1;
+ HAL_GPIO_Init(GPIOD, &GPIO_InitStructure);
+
+ /* Configure PWM pins */
+ GPIO_InitStructure.Pin = PWM2_PIN | PWM3_PIN | PWM4_PIN;
+ GPIO_InitStructure.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStructure.Pull = GPIO_PULLUP;
+ GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
+ GPIO_InitStructure.Alternate = GPIO_AF1_TIM2;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStructure);
+
+ /* MFT Configuration */
+ HAL_NVIC_SetPriority((IRQn_Type)(TIM1_CC_IRQn), 15, 0);
+ HAL_NVIC_EnableIRQ((IRQn_Type)(TIM1_CC_IRQn));
+ HAL_NVIC_SetPriority((IRQn_Type)(TIM2_IRQn), 15, 0);
+ HAL_NVIC_EnableIRQ((IRQn_Type)(TIM2_IRQn));
+
+ htim1.Instance = TIM1;
+ htim1.Init.Prescaler = 0/*PRESCALER_VALUE*/;
+ htim1.Init.CounterMode = TIM_COUNTERMODE_UP;
+ htim1.Init.Period = TIME_PERIOD;
+ htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
+ htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
+ HAL_TIM_PWM_Init(&htim1);
+
+ htim2.Instance = TIM2;
+ htim2.Init.Prescaler = 0/*PRESCALER_VALUE*/;
+ htim2.Init.CounterMode = TIM_COUNTERMODE_UP;
+ htim2.Init.Period = TIME_PERIOD;
+ htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
+ htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
+ HAL_TIM_PWM_Init(&htim2);
+
+ sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
+ sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
+ HAL_TIMEx_MasterConfigSynchronization(&htim1, &sMasterConfig);
+ HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig);
+
+ sConfigOC.OCMode = TIM_OCMODE_PWM1;
+ sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH;
+ sConfigOC.OCFastMode = TIM_OCFAST_DISABLE;
+ sConfigOC.Pulse = MFT1_TON_1;
+ HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_1);
+ sConfigOC.Pulse = MFT2_TON_1;
+ HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_2);
+ sConfigOC.Pulse = MFT1_TON_2;
+ HAL_TIM_PWM_ConfigChannel(&htim2, &sConfigOC, TIM_CHANNEL_1);
+ sConfigOC.Pulse = MFT2_TON_2;
+ HAL_TIM_PWM_ConfigChannel(&htim2, &sConfigOC, TIM_CHANNEL_2);
+ sConfigOC.Pulse = MFT2_TON_3;
+ HAL_TIM_PWM_ConfigChannel(&htim2, &sConfigOC, TIM_CHANNEL_3);
+
+ /* Start channel 1 */
+ HAL_TIM_PWM_Start_IT(&htim1, TIM_CHANNEL_1);
+ /* Start channel 2 */
+ HAL_TIM_PWM_Start_IT(&htim1, TIM_CHANNEL_2);
+ /* Start channel 1 */
+ HAL_TIM_PWM_Start_IT(&htim2, TIM_CHANNEL_1);
+ /* Start channel 2 */
+ HAL_TIM_PWM_Start_IT(&htim2, TIM_CHANNEL_2);
+ /* Start channel 3 */
+ HAL_TIM_PWM_Start_IT(&htim2, TIM_CHANNEL_3);
+}
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_config.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_config.h
new file mode 100644
index 000000000..a5e0e1075
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_config.h
@@ -0,0 +1,144 @@
+/******************** (C) COPYRIGHT 2015 STMicroelectronics ********************
+* File Name : PWM/PWM_config.c
+* Author : SNM Application Team
+* Version : V1.0.0
+* Date : September-2015
+* Description : Configuration file for PWM
+********************************************************************************
+* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
+* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
+* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
+* CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
+* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+*******************************************************************************/
+
+//#include "BlueNRG1_mft.h"
+#include "mesh_cfg_usr.h"
+
+/* Macros defined for the number of PWM Provided */
+#define PWM0 0
+#define PWM1 1
+#define PWM2 2
+#define PWM3 3
+#define PWM4 4
+
+/* Setting for the Hardware PWM selection for BlueNRG-1 & BlueNRG-2 board.
+if user want to change the hardware pwm according to his application then user
+can select the given settings.
+
+ SERIAL1_MODE SERIAL2_MODE
+PWM0_PIN GPIO_2 GPIO_4
+PWM1_PIN GPIO_3 GPIO_5
+*/
+
+/*STEVAL_BlueNRG-1
+ *STEVAL_BlueNRG-2
+ * This configuration given below is for the BlueNRG-1 and BlueNRG-2 board.
+ * Here user has selected the PWM0 in SERIAL2_MODE and PWM1 in SERIAL1_MODE.
+ * User can configure software PWM to any of the GPIO which are not used for
+ * hardware PWM.
+*/
+/* PWM pins for MFT1 and MFT2 respectively */
+#if defined STEVAL_BLUENRG_1_BOARD_PWM_SELECTION || defined STEVAL_BLUENRG_2_BOARD_PWM_SELECTION
+
+#define PWM0_PIN GPIO_Pin_4
+#define PWM1_PIN GPIO_Pin_3
+
+/* GPIOs pins (SOFTWARE PWM) used to output a PWM signal */
+#define PWM2_PIN GPIO_Pin_1
+#define PWM3_PIN GPIO_Pin_2
+#define PWM4_PIN GPIO_Pin_14 /*Blue Led*/
+#endif
+/**************************************************************************/
+
+/* CUSTOM BOARD SETTING
+ * Uncomment the macros given below for custom board and comment the above macros
+ * which are given for BlueNRG board.
+ * This configuration given below is for the custom board.
+ * Here user has selected the PWM0 in SERIAL2_MODE and PWM1 in SERIAL2_MODE.
+ * User can configure software PWM to any of the GPIO which are not used for
+ * hardware PWM.
+NOTE - Do not enable the sensor model with this configuration.As GPIO_4 is used
+ for sensor already.
+*/
+/* PWM pins for MFT1 and MFT2 respectively */
+#ifdef CUSTOM_BOARD_PWM_SELECTION
+
+#define PWM0_PIN GPIO_Pin_4
+#define PWM1_PIN GPIO_Pin_5
+
+/* GPIOs pins (SOFTWARE PWM) used to output a PWM signal */
+#define PWM2_PIN GPIO_Pin_0 /* Red Led*/
+#define PWM3_PIN GPIO_Pin_2 /*Green Led*/
+#define PWM4_PIN GPIO_Pin_3 /*Blue Led*/
+
+#endif
+/*************************************************************************/
+
+/*
+ * STEVAL-BLUEMIC-1
+ * This configuration given below is for the BlueNRG-1 and BlueNRG-2 board.
+ * Here user has selected the PWM0 in SERIAL2_MODE and PWM1 in SERIAL1_MODE.
+ * User can configure software PWM to any of the GPIO which are not used for
+ * hardware PWM.
+NOTE - Do not enable the sensor model with this configuration.As GPIO_4 is used
+ for sensor already.
+*/
+/* PWM pins for MFT1 and MFT2 respectively */
+#ifdef STEVAL_BLUEMIC_1_BOARD_PWM_SELECTION
+
+#define PWM0_PIN GPIO_Pin_4
+#define PWM1_PIN GPIO_Pin_3 //blue_led
+
+/* GPIOs pins (SOFTWARE PWM) used to output a PWM signal */
+#define PWM2_PIN GPIO_Pin_8
+#define PWM3_PIN GPIO_Pin_6
+#define PWM4_PIN GPIO_Pin_14
+
+#endif
+/************************************************************************/
+
+/*STM32WB
+ * This configuration given below is for the STM32WB board.
+ * Here user has selected the PWM0 in SERIAL2_MODE and PWM1 in SERIAL1_MODE.
+ * User can configure software PWM to any of the GPIO which are not used for
+ * hardware PWM.
+*/
+/* PWM pins for MFT1 and MFT2 respectively */
+#if defined USE_STM32WBXX_NUCLEO || defined USE_STM32WBXX_USB_DONGLE
+
+#define PWM0_PIN GPIO_PIN_14 /* TIM1_CH1 AF1 */
+#define PWM1_PIN GPIO_PIN_15 /* TIM1_CH2 AF1 */
+
+/* GPIOs pins (SOFTWARE PWM) used to output a PWM signal */
+#define PWM2_PIN GPIO_PIN_0 /* TIM2_CH1 AF1 */
+#define PWM3_PIN GPIO_PIN_1 /* TIM2_CH2 AF1 */
+#define PWM4_PIN GPIO_PIN_2 /* TIM2_CH3 AF1 */
+#endif
+/************************************************************************/
+
+#define TIME_PERIOD 32000
+
+/* TIM1 Channel 1 Timer Ton and T0ff (ticks number) PWM0*/
+#define MFT1_TON_1 (12000 - 1)
+#define MFT1_TOFF_1 (20000 - 1)
+
+/* TIM1 Channel 2 Timer 1 Ton and T0ff (ticks number) PWM1*/
+#define MFT2_TON_1 (8000 - 1 )
+#define MFT2_TOFF_1 (24000 - 1)
+
+/* TIM2 Channel 1 Timer 2 Ton and T0ff (ticks number) PWM2*/
+#define MFT1_TON_2 (16000 - 1)
+#define MFT1_TOFF_2 (16000 -1)
+
+/* TIM2 Channel 2 Timer 2 Ton and T0ff (ticks number) PWM3*/
+#define MFT2_TON_2 (4000 - 1)
+#define MFT2_TOFF_2 (28000 - 1)
+
+/* TIM2 Channel 3 Timer 2 Ton and T0ff (ticks number) PWM4*/
+#define MFT2_TON_3 (4000 - 1)
+#define MFT2_TOFF_3 (28000 - 1)
+
+void PWM_Init(void);
+
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_handlers.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_handlers.c
new file mode 100644
index 000000000..faa56a950
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_handlers.c
@@ -0,0 +1,297 @@
+/**
+********************************************************************************
+* @file PWM_handlers.c
+* @author BLE Mesh Team
+* @version V1.0.0
+* @date 31-July-2018
+* @brief Handlers for PWM and other support functions.
+********************************************************************************
+* @attention
+*
+*<h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
+*
+* Redistribution and use in source and binary forms, with or without modification,
+* are permitted provided that the following conditions are met:
+* 1. Redistributions of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+* 3. Neither the name of STMicroelectronics nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+* Initial BlueNRG-Mesh is built over Motorolas Mesh over Bluetooth Low Energy
+* (MoBLE) technology. The present solution is developed and maintained for both
+* Mesh library and Applications solely by STMicroelectronics.
+*
+******************************************************************************
+*/
+
+/* Includes ------------------------------------------------------------------*/
+#include "hal_common.h"
+#include "PWM_handlers.h"
+#include "mesh_cfg_usr.h"
+
+extern TIM_HandleTypeDef htim1;
+extern TIM_HandleTypeDef htim2;
+
+/* Global Variables */
+uint16_t DUTY;
+int NonZeroPWM0=0;
+int NonZeroPWM1=0;
+uint8_t Duty_flag_A = 0;
+uint16_t PWM0_on,
+ PWM1_on,
+ PWM2_on = MFT1_TON_2, /* Timer2, MFT1 */
+ PWM3_on = MFT2_TON_2, /* Timer2, MFT2 */
+ PWM4_on = MFT2_TON_3; /* Timer2, MFT2 */
+
+uint32_t channel = PWM3_PIN; /* It is the channel with initial lowest duty-cycle */
+uint32_t period = TIME_PERIOD; /* Period in ticks of the PWM signal */
+uint8_t channel_number = 0;
+
+uint32_t PWM_channels[] = {PWM3_PIN, PWM4_PIN}; /* Channels managed by MFT2 Timer 2 */
+uint16_t Ton_values[] = {MFT2_TON_2, MFT2_TON_3}; /* Sorted array containing duty-cycle values
+ respectively for PWM3_PIN and PWM4_PIN */
+uint16_t delta_1 = MFT2_TON_3 - MFT2_TON_2; /* Delta between the first two duty-cycles */
+uint16_t delta = MFT2_TON_3 - MFT2_TON_2;
+
+int number_of_channels = 2; /* Number of channels managed by MFT2 Timer 2 */
+int max_duty = MFT2_TON_3; /* Maximum duty-cycle */
+
+/**
+ *@brief PWM2 handler
+ *@retval None
+ */
+void PWM2_handler()
+{
+ if(__HAL_TIM_GET_FLAG(&htim1, TIM_FLAG_CC1) > 0)
+ {
+ __HAL_TIM_CLEAR_FLAG(&htim1, TIM_FLAG_CC1);
+ if(Duty_flag_A == 1)
+ {
+ HAL_GPIO_WritePin(GPIOA, PWM2_PIN, GPIO_PIN_SET);
+ Duty_flag_A = 0;
+ htim1.Instance->CCR1 = PWM2_on;
+ }
+ else
+ {
+ HAL_GPIO_WritePin(GPIOA, PWM2_PIN, GPIO_PIN_RESET);
+ Duty_flag_A = 1;
+ htim1.Instance->CCR1 = TIME_PERIOD - PWM2_on;
+ }
+ }
+}
+
+/**
+ *@brief PWM3 and PWM4 handler
+ *@retval None
+ */
+void PWM3_PWM4_handler()
+{
+ /*STATE 0
+ if delta != 0, there is a channel with a duty lower than the other one.
+ So the channel with the lower duty is cleared. Delta is period - max_duty
+ (the duty of the other channel)
+ The machine passes to STATE 1.
+
+ if delta == 0, the two channel are cleared together.
+ The machine passes to STATE 2
+
+ The delta is computed for the next timer event*/
+
+ if (channel_number < number_of_channels - 1)
+ {
+ if (delta != 0)
+ {
+// HAL_GPIO_WritePin(GPIOA, channel, GPIO_PIN_RESET);
+ htim2.Instance->CCR2 = delta - 1;
+ htim2.Instance->CCR3 = delta - 1;
+ channel_number ++;
+ delta = period - max_duty; /*computed delta for the next reset of the counter*/
+ channel = PWM_channels[channel_number];
+ }
+ else
+ {
+// HAL_GPIO_WritePin(GPIOA, PWM3_PIN |PWM4_PIN, GPIO_PIN_RESET);
+ delta = period - max_duty;
+ htim2.Instance->CCR2 = delta - 1;
+ htim2.Instance->CCR3 = delta - 1;
+ channel_number = number_of_channels;
+ }
+ }
+ /*STATE 1
+ Here the channel with the max duty-cycle is cleared. The delta is that one
+ computed in STATE 0. The machine passes to STATE 2 */
+ else if (channel_number == number_of_channels - 1)
+ {
+// HAL_GPIO_WritePin(GPIOA, channel, GPIO_PIN_RESET);
+ htim2.Instance->CCR2 = delta - 1;
+ htim2.Instance->CCR3 = delta - 1;
+ channel_number ++;
+ }
+ /*STATE 2
+ All the channels have been cleared and now are set again. The machine passes to STATE 0 */
+ else
+ { /* channel_number > number_of_channels - 1 */
+ HAL_GPIO_WritePin(GPIOA, PWM3_PIN | PWM4_PIN, GPIO_PIN_SET);
+ htim2.Instance->CCR2 = Ton_values[0] - 1;
+ htim2.Instance->CCR3 = Ton_values[1] - 1;
+ Ton_sorting();
+ channel_number = 0;
+ delta = Ton_values[1] - Ton_values[0];
+ channel = PWM_channels[0];
+ }
+}
+
+/**
+ *@brief Sorting on basis of duty cycle
+ *@retval None
+ */
+
+void Ton_sorting(void)
+{
+ if (PWM3_on > PWM4_on)
+ {
+ max_duty = PWM3_on;
+ Ton_values[1] = PWM3_on;
+ Ton_values[0] = PWM4_on;
+ PWM_channels[1] = PWM3_PIN;
+ PWM_channels[0] = PWM4_PIN;
+ }
+ else
+ {
+ max_duty = PWM4_on;
+ Ton_values[0] = PWM3_on;
+ Ton_values[1] = PWM4_on;
+ PWM_channels[0] = PWM3_PIN;
+ PWM_channels[1] = PWM4_PIN;
+ }
+}
+
+
+/**
+ *@brief PWM modification
+ *@param PWM_ID: PWM number
+ *@param duty_cycle: Duty cycle at output
+ *@retval None
+ */
+void Modify_PWM(uint8_t PWM_ID, uint16_t duty_cycle)
+{
+ GPIO_InitTypeDef GPIO_InitStructure1 = {0};
+
+ if (PWM_ID == 0) /* PD14 */
+ {
+ if (duty_cycle == 0 && NonZeroPWM0 == 0)
+ {
+ GPIO_InitStructure1.Pin = PWM0_PIN;
+ GPIO_InitStructure1.Mode = GPIO_MODE_OUTPUT_PP;
+ GPIO_InitStructure1.Pull = GPIO_NOPULL;
+ GPIO_InitStructure1.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
+ HAL_GPIO_Init(GPIOD, &GPIO_InitStructure1);
+ HAL_GPIO_WritePin(GPIOD, PWM0_PIN, GPIO_PIN_RESET);
+
+ NonZeroPWM0=1;
+ }
+ else if ((duty_cycle != 0 && NonZeroPWM0 == 1))
+ {
+ GPIO_InitStructure1.Pin = PWM0_PIN;
+ GPIO_InitStructure1.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStructure1.Pull = GPIO_PULLUP;
+ GPIO_InitStructure1.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
+ GPIO_InitStructure1.Alternate = GPIO_AF1_TIM1;
+ HAL_GPIO_Init(GPIOD, &GPIO_InitStructure1);
+
+ NonZeroPWM0=0;
+ }
+ }
+ else if((PWM_ID == 1)) /* GPIO3 */
+ {
+ if (duty_cycle == 0 && NonZeroPWM1 == 0)
+ {
+ GPIO_InitStructure1.Pin = PWM1_PIN;
+ GPIO_InitStructure1.Mode = GPIO_MODE_OUTPUT_PP;
+ GPIO_InitStructure1.Pull = GPIO_NOPULL;
+ GPIO_InitStructure1.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
+ HAL_GPIO_Init(GPIOD, &GPIO_InitStructure1);
+ HAL_GPIO_WritePin(GPIOD, PWM1_PIN, GPIO_PIN_RESET);
+
+ NonZeroPWM1=1;
+ }
+ else if ((duty_cycle != 0 && NonZeroPWM1 == 1))
+ {
+ GPIO_InitStructure1.Pin = PWM1_PIN;
+ GPIO_InitStructure1.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStructure1.Pull = GPIO_PULLUP;
+ GPIO_InitStructure1.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
+ GPIO_InitStructure1.Alternate = GPIO_AF1_TIM1;
+ HAL_GPIO_Init(GPIOD, &GPIO_InitStructure1);
+
+ NonZeroPWM1=0;
+ }
+ }
+ else
+ {
+ }
+
+ DUTY = duty_cycle;
+ switch (PWM_ID)
+ {
+ case 0: /* PWM0 */
+ {
+ htim1.Instance->CCR1 = DUTY;
+ }
+ break;
+ case 1: /* PWM1 */
+ {
+ htim1.Instance->CCR2 = DUTY;
+ }
+ break;
+ case 2: /* PWM2 */
+ {
+ PWM2_on = DUTY;
+ htim2.Instance->CCR1 = PWM2_on;
+ }
+ break;
+ case 3: /* PWM3 */
+ {
+ PWM3_on = DUTY;
+ htim2.Instance->CCR2 = PWM3_on;
+ }
+ break;
+ case 4: /* PWM4 */
+ {
+ PWM4_on = DUTY;
+ htim2.Instance->CCR3 = PWM4_on;
+ }
+ break;
+ }
+}
+
+/**
+ * @brief Period elapsed callback in non blocking mode
+ * @param htim : TIM handle
+ * @retval None
+ */
+void HAL_TIM_PWM_PulseFinishedCallback(TIM_HandleTypeDef *htim)
+{
+#if 0
+ if(htim->Instance == TIM1)
+ PWM2_handler();
+ else
+ PWM3_PWM4_handler();
+#endif
+}
+
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_handlers.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_handlers.h
new file mode 100644
index 000000000..a27fa757b
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/PWM_handlers.h
@@ -0,0 +1,35 @@
+/**
+ ******************************************************************************
+ * @file PWM/PWM_handlers.c
+* @author SNM Application Team
+* @version V1.0.0
+* @date September-2015
+ * @brief Handlers for PWM and other support functions.
+ ******************************************************************************
+ * @attention
+ *
+ * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+ * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
+ * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
+ * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
+ * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
+ * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+ *
+ * <h2><center>&copy; COPYRIGHT 2015 STMicroelectronics</center></h2>
+ ******************************************************************************
+ */
+
+#include "PWM_config.h"
+//#include "SDK_EVAL_Config.h"
+
+/* PWM2 handler */
+void PWM2_handler(void);
+
+/* PWM3 and PWM4 handler */
+void PWM3_PWM4_handler(void);
+
+/* Here the channel with the lower duty-cycle is established*/
+void Ton_sorting(void);
+
+/* Handle modifications in duty cycle */
+void Modify_PWM(uint8_t PWM_ID, uint16_t duty_cycle);
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_generic.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_generic.c
index f0cd888d8..73469c113 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_generic.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_generic.c
@@ -18,7 +18,7 @@
*/
/* Includes ------------------------------------------------------------------*/
-#include "app_conf.h"
+#include "ble.h"
#include "hal_common.h"
#include "types.h"
#include "ble_mesh.h"
@@ -27,8 +27,10 @@
#include "generic.h"
#include "light.h"
#include "appli_generic.h"
+#include "appli_light.h"
#include "common.h"
#include "mesh_cfg_usr.h"
+#include "appli_nvm.h"
/** @addtogroup BLE_Mesh
* @{
*/
@@ -40,33 +42,18 @@
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
-#define POWER_OFF_STATE 0X02
-#define POWER_ON_STATE 0X01
-#define POWER_RESTORE_STATE 0X02
-
/* Private variables ---------------------------------------------------------*/
-
-
-MOBLEUINT8 OptionalValidParam = 0;
-MOBLEUINT8 LEDState;
-MOBLEUINT8 StatusCode;
-
-#pragma pack(1)
-typedef struct
-{
- MOBLEUINT8 Present_OnOff;
-}Appli_Generic_OnOffSet;
+
+MOBLEUINT8 RestoreFlag;
+extern MOBLEUINT16 IntensityValue;
+extern MOBLEUINT8 IntensityFlag;
+extern MOBLEUINT8 PowerOnOff_flag;
+extern Appli_LightPwmValue_t Appli_LightPwmValue;
Appli_Generic_OnOffSet AppliOnOffSet;
-
-#pragma pack(1)
-typedef struct
-{
- MOBLEINT16 Present_Level16;
-}Appli_Generic_LevelSet;
-
Appli_Generic_LevelSet AppliLevelSet;
-
+Appli_Generic_PowerOnOffSet AppliPowerOnSet;
+Appli_Generic_DefaultTransitionSet AppliDefaultTransitionSet;
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
@@ -74,7 +61,7 @@ Appli_Generic_LevelSet AppliLevelSet;
#ifdef ENABLE_GENERIC_MODEL_SERVER_ONOFF
/**
* @brief Appli_Generic_OnOff_Set: This function is callback for Application
- when Generic OnOff message is received
+* when Generic OnOff message is received
* @param pGeneric_OnOffParam: Pointer to the parameters received for message
* @param OptionalValid: Flag to inform about the validity of optional parameters
* @retval MOBLE_RESULT
@@ -82,25 +69,56 @@ Appli_Generic_LevelSet AppliLevelSet;
MOBLE_RESULT Appli_Generic_OnOff_Set(Generic_OnOffStatus_t* pGeneric_OnOffParam,
MOBLEUINT8 OptionalValid)
{
- AppliOnOffSet.Present_OnOff = pGeneric_OnOffParam->Present_OnOff;
- if(AppliOnOffSet.Present_OnOff > 0)
- {
- BSP_LED_On(LED_BLUE);
+ AppliOnOffSet.Present_OnOff = pGeneric_OnOffParam->Present_OnOff_State;
+ AppliOnOffSet.Present_OnOffValue = pGeneric_OnOffParam->Present_OnOff_Value;
+
+
+ /* This condition is applicable when user want to on off the light with some default
+ * transition value, or optionalValid =IN_TRANSITION , transition is in progress.
+ */
+ if((OptionalValid == DEFAULT_TRANSITION) || (OptionalValid == IN_TRANSITION))
+ {
+ Appli_LightPwmValue.IntensityValue = AppliOnOffSet.Present_OnOffValue;
+ Light_UpdateLedValue(LOAD_STATE ,Appli_LightPwmValue);
+ }
+ else
+ {
+ if((AppliOnOffSet.Present_OnOff == APPLI_LED_ON) && (OptionalValid == NO_TRANSITION))
+ {
+ Appli_LightPwmValue.IntensityValue = PWM_TIME_PERIOD;
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
}
else
- {
- BSP_LED_Off(LED_BLUE);
- }
+ {
+ Appli_LightPwmValue.IntensityValue = PWM_VALUE_OFF;
+ Light_UpdateLedValue(RESET_STATE , Appli_LightPwmValue);
+ }
+ }
+ if(AppliOnOffSet.Present_OnOffValue > 16000)
+ {
+ BSP_LED_On(LED_BLUE);
+ }
+ else
+ {
+ BSP_LED_Off(LED_BLUE);
+ }
+
+ TRACE_M(TF_SERIAL_CTRL,"#8202%02hx!\n\r",AppliOnOffSet.Present_OnOff);
+
+ /* set the flag value for NVM store */
+ RestoreFlag = GENERIC_ON_OFF_NVM_FLAG;
+
+ AppliNvm_SaveMessageParam();
+
return MOBLE_RESULT_SUCCESS;
}
#endif
-
#ifdef ENABLE_GENERIC_MODEL_SERVER_LEVEL
/**
* @brief Appli_Generic_Level_Set: This function is callback for Application
- when Generic Level message is received
+* when Generic Level message is received
* @param plevelParam: Pointer to the parameters message
* @param OptionalValid: Flag to inform about the validity of optional parameters
* @retval MOBLE_RESULT
@@ -108,19 +126,47 @@ MOBLE_RESULT Appli_Generic_OnOff_Set(Generic_OnOffStatus_t* pGeneric_OnOffParam,
MOBLE_RESULT Appli_Generic_Level_Set(Generic_LevelStatus_t* plevelParam,
MOBLEUINT8 OptionalValid)
{
+ MOBLEUINT16 duty;
+ static MOBLEUINT16 previousIntensity = 0;
- AppliLevelSet.Present_Level16= plevelParam->Present_Level16;
+ AppliLevelSet.Present_Level16= plevelParam->Present_Level16;
+ if(AppliLevelSet.Present_Level16 <= 0)
+ {
+ AppliLevelSet.Present_Level16 = 0;
+ }
+
+ IntensityValue = AppliLevelSet.Present_Level16;
+
+ if(((IntensityValue > previousIntensity) && (IntensityValue <PWM_TIME_PERIOD)) ||
+ IntensityValue == INTENSITY_LEVEL_ZERO)
+ {
+ IntensityFlag = MOBLE_FALSE;
+ }
+ else
+ {
+ IntensityFlag = MOBLE_TRUE;
+ }
+ previousIntensity = IntensityValue;
+ duty = PwmValueMapping(AppliLevelSet.Present_Level16 , 0x7FFF ,0);
+ Appli_LightPwmValue.IntensityValue = duty;
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
+
+ TRACE_M(TF_SERIAL_CTRL,"#8206%04hx!\n\r",AppliLevelSet.Present_Level16);
+
+ /* set the flag value for NVM store */
+ RestoreFlag = GENERIC_LEVEL_NVM_FLAG;
+
+ AppliNvm_SaveMessageParam();
+
/* For demo, if Level is more than 100, switch ON the LED */
if(AppliLevelSet.Present_Level16 >= 50)
{
BSP_LED_On(LED_BLUE);
- LEDState = 1;
}
else
{
BSP_LED_Off(LED_BLUE);
- LEDState = 1;
}
return MOBLE_RESULT_SUCCESS;
@@ -128,7 +174,7 @@ MOBLE_RESULT Appli_Generic_Level_Set(Generic_LevelStatus_t* plevelParam,
/**
* @brief Appli_Generic_LevelDelta_Set: This function is callback for Application
- when Generic Level Delta message is received
+* when Generic Level Delta message is received
* @param pdeltalevelParam: Pointer to the parameters message
* @param OptionalValid: Flag to inform about the validity of optional parameters
* @retval MOBLE_RESULT
@@ -142,13 +188,14 @@ MOBLE_RESULT Appli_Generic_LevelDelta_Set(Generic_LevelStatus_t* pdeltalevelPara
/* For demo, if Level is more than 50, switch ON the LED */
if (AppliLevelSet.Present_Level16 >= 50)
{
+ Appli_LightPwmValue.IntensityValue = PWM_TIME_PERIOD;
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
BSP_LED_On(LED_BLUE);
- LEDState = 1;
}
else
{
+ Light_UpdateLedValue(RESET_STATE , Appli_LightPwmValue);
BSP_LED_Off(LED_BLUE);
- LEDState = 1;
}
return MOBLE_RESULT_SUCCESS;
}
@@ -156,7 +203,7 @@ MOBLE_RESULT Appli_Generic_LevelDelta_Set(Generic_LevelStatus_t* pdeltalevelPara
/**
* @brief Appli_Generic_LevelMove_Set: This function is callback for Application
- when Generic Level Move message is received
+* when Generic Level Move message is received
* @param pdeltaMoveParam: Pointer to the parameters message
* @param OptionalValid: Flag to inform about the validity of optional parameters
* @retval MOBLE_RESULT
@@ -168,30 +215,89 @@ MOBLE_RESULT Appli_Generic_LevelMove_Set(Generic_LevelStatus_t* pdeltaMoveParam,
if(OptionalValid == 1)
{
AppliLevelSet.Present_Level16= pdeltaMoveParam->Present_Level16;
-
- OptionalValidParam = 1;
}
+
return MOBLE_RESULT_SUCCESS;
}
+#endif /* ENABLE_GENERIC_MODEL_SERVER_LEVEL */
-#endif
+#ifdef ENABLE_GENERIC_MODEL_SERVER_POWER_ONOFF
+/**
+* @brief Appli_Generic_PowerOnOff_Set: This function is callback for Application
+* when Generic Power on off set message is received
+* @param pPowerOnOffParam: Pointer to the parameters message
+* @param OptionalValid: Flag to inform about the validity of optional parameters
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Appli_Generic_PowerOnOff_Set(Generic_PowerOnOffParam_t* pPowerOnOffParam,
+ MOBLEUINT8 OptionalValid)
+{
+ AppliPowerOnSet.PowerOnState = pPowerOnOffParam->PowerOnOffState;
+
+ TRACE_M(TF_SERIAL_CTRL,"Generic Power OnOff Set: State %d!\n\r",
+ pPowerOnOffParam->PowerOnOffState);
+
+ /* set the flag value for NVM store */
+ RestoreFlag = GENERIC_ON_OFF_NVM_FLAG;
+
+ AppliNvm_SaveMessageParam();
+
+ return MOBLE_RESULT_SUCCESS;
+}
+#endif /* ENABLE_GENERIC_MODEL_SERVER_POWER_ONOFF */
+
+
+#ifdef ENABLE_GENERIC_MODEL_SERVER_DEFAULT_TRANSITION_TIME
+/**
+* @brief Appli_Generic_DefaultTransitionTime_Set: This function is callback for Application
+* when Generic Power on off set message is received
+* @param pDefaultTimeParam: Pointer to the parameters message
+* @param OptionalValid: Flag to inform about the validity of optional parameters
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Appli_Generic_DefaultTransitionTime_Set(Generic_DefaultTransitionParam_t* pDefaultTimeParam,
+ MOBLEUINT8 OptionalValid)
+{
+
+ AppliDefaultTransitionSet.DefaultTransitionTime = pDefaultTimeParam->DefaultTransitionTime;
+
+ return MOBLE_RESULT_SUCCESS;
+}
+#endif /* ENABLE_GENERIC_MODEL_SERVER_DEFAULT_TRANSITION_TIME */
+
/**
* @brief Appli_Generic_GetOnOffState: This function is callback for Application
- when Generic on off status message is to be provided
+* when Generic on off status message is to be provided
* @param pOnOff_status: Pointer to the status message
* @retval MOBLE_RESULT
*/
MOBLE_RESULT Appli_Generic_GetOnOffStatus(MOBLEUINT8* pOnOff_Status)
{
- *pOnOff_Status = AppliOnOffSet.Present_OnOff;
- *(pOnOff_Status+1) = AppliOnOffSet.Present_OnOff >> 8;
-
+ *pOnOff_Status = AppliOnOffSet.Present_OnOff;
+ TRACE_M(TF_SERIAL_CTRL,"Generic Get OnOff Status: Status %d!\n\r",
+ AppliOnOffSet.Present_OnOff);
+
return MOBLE_RESULT_SUCCESS;
}
+/**
+* @brief Appli_Generic_GetOnOffValue: This function is callback for Application
+ to get the PWM value for the generic on off
+* @param pOnOff_Value: Pointer to the status message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Appli_Generic_GetOnOffValue(MOBLEUINT8* pOnOff_Value)
+{
+
+ *pOnOff_Value = AppliOnOffSet.Present_OnOffValue;
+ *(pOnOff_Value+1) = AppliOnOffSet.Present_OnOffValue >> 8;
+ TRACE_M(TF_SERIAL_CTRL,"Generic Get OnOff Value: Value %d!\n\r",
+ AppliOnOffSet.Present_OnOffValue);
+ return MOBLE_RESULT_SUCCESS;
+}
/**
* @brief Appli_Generic_GetLevelStatus: This function is callback for Application
@@ -200,10 +306,40 @@ MOBLE_RESULT Appli_Generic_GetOnOffStatus(MOBLEUINT8* pOnOff_Status)
* @retval MOBLE_RESULT
*/
MOBLE_RESULT Appli_Generic_GetLevelStatus(MOBLEUINT8* pLevel_Status)
-
{
*pLevel_Status = AppliLevelSet.Present_Level16;
*(pLevel_Status+1) = AppliLevelSet.Present_Level16 >> 8;
+ TRACE_M(TF_SERIAL_CTRL,"Generic Get Level Status: Value %d!\n\r",
+ *pLevel_Status);
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Appli_Generic_GetPowerOnOffStatus: This function is callback for Application
+* when Generic Get Power status message is to be provided
+* @param pLevel_status: Pointer to the status message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Appli_Generic_GetPowerOnOffStatus(MOBLEUINT8* pLevel_Status)
+{
+ *pLevel_Status = AppliPowerOnSet.PowerOnState;
+ TRACE_M(TF_SERIAL_CTRL,"Generic Get OnOff Status: Status %d!\n\r",
+ AppliPowerOnSet.PowerOnState);
+
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Appli_Generic_GetDefaultTransitionStatus: This function is callback for Application
+* when Generic Level status message is to be provided
+* @param pTransition_Status: Pointer to the status message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Appli_Generic_GetDefaultTransitionStatus(MOBLEUINT8* pTransition_Status)
+{
+ *pTransition_Status = AppliDefaultTransitionSet.DefaultTransitionTime;
+ TRACE_M(TF_SERIAL_CTRL,"Get Default Transition Status: Status %d!\n\r",
+ AppliDefaultTransitionSet.DefaultTransitionTime);
return MOBLE_RESULT_SUCCESS;
}
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_generic.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_generic.h
index da1395382..4f4f0f36c 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_generic.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_generic.h
@@ -18,8 +18,8 @@
*/
/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __GENERIC_APPLI_H
-#define __GENERIC_APPLI_H
+#ifndef __APPLI_GENERIC_H
+#define __APPLI_GENERIC_H
/* Includes ------------------------------------------------------------------*/
#include "types.h"
@@ -45,8 +45,35 @@
#define BATTERY_REQUIRE_NO_SERVICE 0X01
#define BATTERY_REQUIRE_SERVICE 0X02
#define BATTERY_SERVICE_UNKNOWN 0X03
+
/* Exported variables ------------------------------------------------------- */
/* Application Variable-------------------------------------------------------*/
+#pragma pack(1)
+typedef struct
+{
+ MOBLEUINT8 Present_OnOff;
+ MOBLEUINT16 Present_OnOffValue;
+}Appli_Generic_OnOffSet;
+
+#pragma pack(1)
+typedef struct
+{
+ MOBLEINT16 Present_Level16;
+}Appli_Generic_LevelSet;
+
+#pragma pack(1)
+typedef struct
+{
+ MOBLEINT16 PowerOnState;
+}Appli_Generic_PowerOnOffSet;
+
+#pragma pack(1)
+typedef struct
+{
+ MOBLEINT16 DefaultTransitionTime;
+}Appli_Generic_DefaultTransitionSet;
+
+#pragma pack(1)
typedef struct
{
MOBLEUINT8 Is_BatteryPresent;
@@ -63,10 +90,19 @@ MOBLE_RESULT Appli_Generic_LevelMove_Set(Generic_LevelStatus_t* pdeltaMoveParam,
MOBLEUINT8 OptionalValid);
MOBLE_RESULT Appli_Generic_Level_Status(MOBLEUINT8* level_status,
MOBLEUINT32 *plength);
+MOBLE_RESULT Appli_Generic_PowerOnOff_Set(Generic_PowerOnOffParam_t* pPowerOnOffParam,
+ MOBLEUINT8 OptionalValid);
+MOBLE_RESULT Appli_Generic_DefaultTransitionTime_Set(Generic_DefaultTransitionParam_t* pDefaultTimeParam,
+ MOBLEUINT8 OptionalValid);
+
MOBLE_RESULT Appli_Generic_GetOnOffStatus(MOBLEUINT8* pOnOff_Status);
+MOBLE_RESULT Appli_Generic_GetOnOffValue(MOBLEUINT8* pOnOff_Value);
MOBLE_RESULT Appli_Generic_GetLevelStatus(MOBLEUINT8* pLevel_Status);
+MOBLE_RESULT Appli_Generic_GetPowerOnOffStatus(MOBLEUINT8* pLevel_Status);
+MOBLE_RESULT Appli_Generic_GetDefaultTransitionStatus(MOBLEUINT8* pTransition_Status) ;
+
-#endif /* __GENERIC_APPLI_H */
+#endif /* __APPLI_GENERIC_H */
/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light.c
index 1380246c8..1372d0b4a 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light.c
@@ -18,7 +18,7 @@
*/
/* Includes ------------------------------------------------------------------*/
-#include "app_conf.h"
+#include "ble.h"
#include "hal_common.h"
#include "types.h"
#include "ble_mesh.h"
@@ -28,6 +28,10 @@
#include "appli_generic.h"
#include "common.h"
#include "mesh_cfg.h"
+#include "PWM_handlers.h"
+#include "PWM_config.h"
+#include "appli_nvm.h"
+#include "math.h"
/** @addtogroup BLE_Mesh
* @{
@@ -48,45 +52,9 @@ Following Variables are used for the LIGHTING Lightness MODEL
*******************************************************************************/
#ifdef ENABLE_LIGHT_MODEL_SERVER_LIGHTNESS
-/* Light Lightness set */
-#pragma pack(1)
-typedef struct
-{
- MOBLEUINT16 PresentState16;
- MOBLEUINT16 LastLightness16;
-}Appli_Light_lightnessSet;
-
Appli_Light_lightnessSet ApplilightnessSet;
-
-/* Light Lightness Linear set */
-#pragma pack(1)
-typedef struct
-{
- MOBLEUINT16 PresentState16;
-}Appli_Light_lightnessLinearSet;
-
Appli_Light_lightnessLinearSet ApplilightnessLinearSet;
-/* Light Lightness Default set */
-#pragma pack(1)
-typedef struct
-{
- MOBLEUINT16 LightnessDefault;
-}Appli_Light_lightnessDefaultSet;
-
-Appli_Light_lightnessDefaultSet ApplilightnessDefaultSet;
-
-/* Light Lightness Range set */
-#pragma pack(1)
-typedef struct
-{
- MOBLEUINT8 StatusCode;
- MOBLEUINT16 RangeMin;
- MOBLEUINT16 RangeMax;
-}Appli_Light_lightnessRangeSet;
-
-Appli_Light_lightnessRangeSet ApplilightnessRangeSet = {0x00,0x01,0xFFFF};
-
/******************************************************************************/
#endif /* #ifdef ENABLE_LIGHT_MODEL_SERVER_LIGHTNESS */
/******************************************************************************/
@@ -97,37 +65,8 @@ Following Variables are used for the LIGHTING CTL MODEL
#ifdef ENABLE_LIGHT_MODEL_SERVER_CTL
-/* Light Ctl Set */
-#pragma pack(1)
-typedef struct
-{
- MOBLEUINT16 PresentLightness16;
- MOBLEUINT16 PresentTemperature16;
- MOBLEINT16 PresentCtlDelta16;
-}Appli_Light_CtlSet;
-
Appli_Light_CtlSet AppliCtlSet;
-
-/* Light Ctl Temperature Range Set */
-#pragma pack(1)
-typedef struct
-{
- MOBLEUINT8 StatusCode;
- MOBLEUINT16 RangeMin;
- MOBLEUINT16 RangeMax;
-}Appli_Light_CtlTemperatureRangeSet;
-
Appli_Light_CtlTemperatureRangeSet AppliCtlTemperatureRangeSet;
-
-/* Light Ctl Default set */
-#pragma pack(1)
-typedef struct
-{
- MOBLEUINT16 CtlDefaultLightness16;
- MOBLEUINT16 CtlDefaultTemperature16;
- MOBLEINT16 CtlDefaultDeltaUv;
-}Appli_Light_CtlDefaultSet;
-
Appli_Light_CtlDefaultSet AppliCtlDefaultSet;
/******************************************************************************/
@@ -138,41 +77,23 @@ Appli_Light_CtlDefaultSet AppliCtlDefaultSet;
Following Variables are used for the LIGHTING HSL MODEL
*******************************************************************************/
-
#ifdef ENABLE_LIGHT_MODEL_SERVER_HSL
-/* Light Hsl Hue set */
-#pragma pack(1)
-typedef struct
-{
- MOBLEUINT16 HslLightness16;
- MOBLEUINT16 HslHueLightness16;
- MOBLEUINT16 HslSaturation16;
-}Appli_Light_HslSet;
+ Appli_Light_HslSet AppliHslSet;
+ Appli_Light_RGBSet Appli_RGBParam;
+ Appli_Light_HslRangeSet AppliHslRangeSet;
-Appli_Light_HslSet AppliHslSet;
-
-#pragma pack(1)
-typedef struct
-{
- MOBLEUINT8 StatusCode;
- MOBLEUINT16 HslHueMinRange16;
- MOBLEUINT16 HslHueMaxRange16;
- MOBLEUINT16 HslMinSaturation16;
- MOBLEUINT16 HslMaxSaturation16;
-}Appli_Light_HslRangeSet;
-
-Appli_Light_HslRangeSet AppliHslRangeSet;
-
-/******************************************************************************/
-#endif /* ENABLE_LIGHT_MODEL_SERVER_HSL */
-/******************************************************************************/
+/*******************************************************************************/
+#endif /*End of the LIGHTING HSL MODEL variables */
+/*******************************************************************************/
/*******************************************************************************
-End of the LIGHTING HSL MODEL variables
+Following Variables are used for the RGB board.
*******************************************************************************/
+
+Appli_LightPwmValue_t Appli_LightPwmValue;
-
-MOBLEUINT8 OptionalLightParam = 0;
+extern MOBLEUINT8 RestoreFlag;
+extern MOBLEUINT8 PowerOnOff_flag;
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
@@ -188,17 +109,41 @@ MOBLEUINT8 OptionalLightParam = 0;
MOBLE_RESULT Appli_Light_Lightness_Set(Light_LightnessStatus_t* pLight_LightnessParam,
MOBLEUINT8 OptionalValid)
{
+ MOBLEUINT16 duty;
+
ApplilightnessSet.PresentState16 = pLight_LightnessParam->PresentValue16;
if(pLight_LightnessParam->PresentValue16 != 0x00)
{
ApplilightnessSet.LastLightness16 = pLight_LightnessParam->PresentValue16;
- }
+ }
+ duty = PwmValueMapping(ApplilightnessSet.PresentState16 , 0xfFFF ,0);
+ Appli_LightPwmValue.IntensityValue = duty;
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
+
+ /* For demo, if Level is more than 100, switch ON the LED */
+ if(pLight_LightnessParam->PresentValue16 >= 0x8000)
+ {
+ BSP_LED_On(LED_BLUE);
+ }
+ else
+ {
+ BSP_LED_Off(LED_BLUE);
+ }
+ TRACE_M(TF_SERIAL_CTRL,"#8206%04hx!\n\r",ApplilightnessSet.PresentState16);
+
+ /* set the flag value for NVM store */
+ RestoreFlag = LIGHT_LIGHTNESS_NVM_FLAG;
+
+ AppliNvm_SaveMessageParam();
return MOBLE_RESULT_SUCCESS;
+
}
-#endif
+/******************************************************************************/
+#endif
+/******************************************************************************/
#ifdef ENABLE_LIGHT_MODEL_SERVER_LIGHTNESS
/**
@@ -231,6 +176,7 @@ MOBLE_RESULT Appli_Light_Lightness_Linear_Set(Light_LightnessStatus_t* pLight_Li
MOBLE_RESULT Appli_Light_Lightness_Default_Set(Light_LightnessDefaultParam_t* pLight_LightnessDefaultParam,
MOBLEUINT8 OptionalValid)
{
+ ApplilightnessSet.LightnessDefault = pLight_LightnessDefaultParam->LightnessDefaultStatus;
if(pLight_LightnessDefaultParam->LightnessDefaultStatus > 0)
{
BSP_LED_On(LED_BLUE);
@@ -240,7 +186,6 @@ MOBLE_RESULT Appli_Light_Lightness_Default_Set(Light_LightnessDefaultParam_t* pL
BSP_LED_Off(LED_BLUE);
}
- ApplilightnessDefaultSet.LightnessDefault = pLight_LightnessDefaultParam->LightnessDefaultStatus;
return MOBLE_RESULT_SUCCESS;
}
@@ -259,9 +204,9 @@ MOBLE_RESULT Appli_Light_Lightness_Default_Set(Light_LightnessDefaultParam_t* pL
MOBLE_RESULT Appli_Light_Lightness_Range_Set(Light_LightnessRangeParam_t* pLight_LightnessRangeParam,
MOBLEUINT8 OptionalValid)
{
- ApplilightnessRangeSet.StatusCode = pLight_LightnessRangeParam->StatusCode;
- ApplilightnessRangeSet.RangeMin = pLight_LightnessRangeParam->MinRangeStatus;
- ApplilightnessRangeSet.RangeMax = pLight_LightnessRangeParam->MaxRangeStatus;
+ ApplilightnessSet.StatusCode = pLight_LightnessRangeParam->StatusCode;
+ ApplilightnessSet.RangeMin = pLight_LightnessRangeParam->MinRangeStatus;
+ ApplilightnessSet.RangeMax = pLight_LightnessRangeParam->MaxRangeStatus;
return MOBLE_RESULT_SUCCESS;
}
@@ -281,10 +226,32 @@ MOBLE_RESULT Appli_Light_Lightness_Range_Set(Light_LightnessRangeParam_t* pLight
MOBLE_RESULT Appli_Light_Ctl_Set(Light_CtlStatus_t* pLight_CtlParam,
MOBLEUINT8 OptionalValid)
{
+ float colourRatio;
+ float brightRatio;
AppliCtlSet.PresentLightness16 = pLight_CtlParam->PresentCtlLightness16;
AppliCtlSet.PresentTemperature16 = pLight_CtlParam->PresentCtlTemperature16;
AppliCtlSet.PresentCtlDelta16 = pLight_CtlParam->PresentCtlDelta16;
+ colourRatio = Ratio_CalculateValue(AppliCtlSet.PresentTemperature16 ,MAX_CTL_TEMP_RANGE ,MIN_CTL_TEMP_RANGE);
+
+ brightRatio = Ratio_CalculateValue(AppliCtlSet.PresentLightness16 ,0XFFFF ,0);
+
+ Appli_LightPwmValue.PwmCoolValue = PWM_CoolValue(colourRatio , brightRatio);
+ Appli_LightPwmValue.PwmWarmValue = PWM_WarmValue(colourRatio , brightRatio);
+
+ Rgb_LedOffState();
+
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
+
+ TRACE_M(TF_SERIAL_CTRL,"#825E%04hx%04hx%04hx!\n\r",
+ AppliCtlSet.PresentLightness16,
+ AppliCtlSet.PresentTemperature16,
+ AppliCtlSet.PresentCtlDelta16);
+ /* set the flag value for NVM store */
+ RestoreFlag = LIGHT_CTL_NVM_FLAG;
+
+ AppliNvm_SaveMessageParam();
+
return MOBLE_RESULT_SUCCESS;
}
#endif
@@ -301,9 +268,26 @@ MOBLE_RESULT Appli_Light_Ctl_Set(Light_CtlStatus_t* pLight_CtlParam,
MOBLE_RESULT Appli_Light_CtlTemperature_Set(Light_CtlStatus_t* pLight_CtltempParam,
MOBLEUINT8 OptionalValid)
{
+ float colourRatio;
+ float brightRatio;
AppliCtlSet.PresentTemperature16 = pLight_CtltempParam->PresentCtlTemperature16;
AppliCtlSet.PresentCtlDelta16 = pLight_CtltempParam->PresentCtlDelta16;
+ colourRatio = Ratio_CalculateValue(AppliCtlSet.PresentTemperature16 ,MAX_CTL_TEMP_RANGE ,MIN_CTL_TEMP_RANGE);
+
+ brightRatio = Ratio_CalculateValue(AppliCtlSet.PresentLightness16 ,0XFFFF ,0);
+
+ Appli_LightPwmValue.PwmCoolValue = PWM_CoolValue(colourRatio , brightRatio);
+ Appli_LightPwmValue.PwmWarmValue = PWM_WarmValue(colourRatio , brightRatio);
+
+ Rgb_LedOffState();
+
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
+ /* set the flag value for NVM store */
+ RestoreFlag = LIGHT_CTL_NVM_FLAG;
+
+ AppliNvm_SaveMessageParam();
+
return MOBLE_RESULT_SUCCESS;
}
@@ -364,10 +348,27 @@ MOBLE_RESULT Appli_Light_CtlDefault_Set(Light_CtlDefaultParam_t* pLight_CtlDefau
MOBLE_RESULT Appli_Light_Hsl_Set(Light_HslStatus_t* pLight_HslParam,
MOBLEUINT8 OptionalValid)
{
+
AppliHslSet.HslLightness16 = pLight_HslParam->PresentHslLightness16;
AppliHslSet.HslHueLightness16 = pLight_HslParam->PresentHslHueLightness16;
AppliHslSet.HslSaturation16 = pLight_HslParam->PresentHslSaturation16;
+ /* Function to convert HSL values in RGB values */
+ HSL2RGB_Conversion();
+
+ Appli_LightPwmValue.PwmRedValue = PwmValueMapping(Appli_RGBParam.Red_Value ,0xFFFF ,0x00);
+ Appli_LightPwmValue.PwmGreenValue = PwmValueMapping(Appli_RGBParam.Green_Value ,0xFFFF ,0x00);
+ Appli_LightPwmValue.PwmBlueValue = PwmValueMapping(Appli_RGBParam.Blue_Value ,0xFFFF ,0x00);
+
+ /* when HSL is set, make CTL pwm will bw zero */
+ Ctl_LedOffState();
+
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
+ /* set the flag value for NVM store */
+ RestoreFlag = LIGHT_HSL_NVM_FLAG;
+
+ AppliNvm_SaveMessageParam();
+
return MOBLE_RESULT_SUCCESS;
}
#endif
@@ -386,6 +387,20 @@ MOBLE_RESULT Appli_Light_HslHue_Set(Light_HslStatus_t* pLight_HslHueParam,
{
AppliHslSet.HslHueLightness16 = pLight_HslHueParam->PresentHslHueLightness16;
+ HSL2RGB_Conversion();
+
+ Appli_LightPwmValue.PwmRedValue = PwmValueMapping(Appli_RGBParam.Red_Value ,0xFFFF ,0x00);
+ Appli_LightPwmValue.PwmGreenValue = PwmValueMapping(Appli_RGBParam.Green_Value ,0xFFFF ,0x00);
+ Appli_LightPwmValue.PwmBlueValue = PwmValueMapping(Appli_RGBParam.Blue_Value ,0xFFFF ,0x00);
+
+ Ctl_LedOffState();
+
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
+ /* set the flag value for NVM store */
+ RestoreFlag = LIGHT_HSL_NVM_FLAG;
+
+ AppliNvm_SaveMessageParam();
+
return MOBLE_RESULT_SUCCESS;
}
#endif
@@ -404,6 +419,20 @@ MOBLE_RESULT Appli_Light_HslSaturation_Set(Light_HslStatus_t* pLight_HslSaturati
{
AppliHslSet.HslSaturation16 = pLight_HslSaturationParam->PresentHslSaturation16;
+ HSL2RGB_Conversion();
+
+ Appli_LightPwmValue.PwmRedValue = PwmValueMapping(Appli_RGBParam.Red_Value ,0xFFFF ,0x00);
+ Appli_LightPwmValue.PwmGreenValue = PwmValueMapping(Appli_RGBParam.Green_Value ,0xFFFF ,0x00);
+ Appli_LightPwmValue.PwmBlueValue = PwmValueMapping(Appli_RGBParam.Blue_Value ,0xFFFF ,0x00);
+
+ Ctl_LedOffState();
+
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
+ /* set the flag value for NVM store */
+ RestoreFlag = LIGHT_HSL_NVM_FLAG;
+
+ AppliNvm_SaveMessageParam();
+
return MOBLE_RESULT_SUCCESS;
}
#endif
@@ -424,6 +453,20 @@ MOBLE_RESULT Appli_Light_HslDefault_Set(Light_HslStatus_t* pLight_HslDefaultPara
AppliHslSet.HslHueLightness16 = pLight_HslDefaultParam->PresentHslHueLightness16;
AppliHslSet.HslSaturation16 = pLight_HslDefaultParam->PresentHslSaturation16;
+ HSL2RGB_Conversion();
+
+ Appli_LightPwmValue.PwmRedValue = PwmValueMapping(Appli_RGBParam.Red_Value ,0xFFFF ,0x00);
+ Appli_LightPwmValue.PwmGreenValue = PwmValueMapping(Appli_RGBParam.Green_Value ,0xFFFF ,0x00);
+ Appli_LightPwmValue.PwmBlueValue = PwmValueMapping(Appli_RGBParam.Blue_Value ,0xFFFF ,0x00);
+
+ Ctl_LedOffState();
+
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
+ /* set the flag value for NVM store */
+ RestoreFlag = LIGHT_HSL_NVM_FLAG;
+
+ AppliNvm_SaveMessageParam();
+
return MOBLE_RESULT_SUCCESS;
}
#endif
@@ -466,8 +509,10 @@ MOBLE_RESULT Appli_Light_GetLightnessStatus(MOBLEUINT8* lLightnessState)
{
*(lLightnessState) = ApplilightnessSet.PresentState16;
*(lLightnessState+1) = ApplilightnessSet.PresentState16 >> 8;
- *(lLightnessState+2) = ApplilightnessSet.LastLightness16 ;
- *(lLightnessState+3) = ApplilightnessSet.LastLightness16 >> 8;
+// *(lLightnessState+2) = ApplilightnessSet.LastLightness16 ;
+// *(lLightnessState+3) = ApplilightnessSet.LastLightness16 >> 8;
+ TRACE_M(TF_SERIAL_CTRL,"Get Lighness Status: %d\n\r",
+ ApplilightnessSet.PresentState16);
return MOBLE_RESULT_SUCCESS;
}
@@ -485,6 +530,9 @@ MOBLE_RESULT Appli_Light_GetLightnessLinearStatus(MOBLEUINT8* lLightnessState)
*(lLightnessState+1) = ApplilightnessLinearSet.PresentState16 >> 8;
*(lLightnessState+2) = ApplilightnessSet.LastLightness16 ;
*(lLightnessState+3) = ApplilightnessSet.LastLightness16 >> 8;
+ TRACE_M(TF_SERIAL_CTRL,"Get Lighness Linear Status: present: %d last: %d\n\r",
+ ApplilightnessLinearSet.PresentState16,
+ ApplilightnessSet.LastLightness16);
return MOBLE_RESULT_SUCCESS;
}
@@ -498,8 +546,10 @@ MOBLE_RESULT Appli_Light_GetLightnessLinearStatus(MOBLEUINT8* lLightnessState)
*/
MOBLE_RESULT Appli_Light_GetLightnessDefaultStatus(MOBLEUINT8* lDefaultState)
{
- *(lDefaultState) = ApplilightnessDefaultSet.LightnessDefault;
- *(lDefaultState+1) = ApplilightnessDefaultSet.LightnessDefault >> 8;
+ *(lDefaultState) = ApplilightnessSet.LightnessDefault;
+ *(lDefaultState+1) = ApplilightnessSet.LightnessDefault >> 8;
+ TRACE_M(TF_SERIAL_CTRL,"Get Lighness Default Status: %d\n\r",
+ ApplilightnessSet.LightnessDefault);
return MOBLE_RESULT_SUCCESS;
}
@@ -513,11 +563,15 @@ to get the application values in middleware used for transition change.
*/
MOBLE_RESULT Appli_Light_GetLightnessRangeStatus(MOBLEUINT8* lRangeState)
{
- *(lRangeState) = ApplilightnessRangeSet.StatusCode;
- *(lRangeState+1) = ApplilightnessRangeSet.RangeMin;
- *(lRangeState+2) = ApplilightnessRangeSet.RangeMin >> 8;
- *(lRangeState+3) = ApplilightnessRangeSet.RangeMax;
- *(lRangeState+4) = ApplilightnessRangeSet.RangeMax >> 8;
+ *(lRangeState) = ApplilightnessSet.StatusCode;
+ *(lRangeState+1) = ApplilightnessSet.RangeMin;
+ *(lRangeState+2) = ApplilightnessSet.RangeMin >> 8;
+ *(lRangeState+3) = ApplilightnessSet.RangeMax;
+ *(lRangeState+4) = ApplilightnessSet.RangeMax >> 8;
+ TRACE_M(TF_SERIAL_CTRL,"Get Lighness Range Status: status: %d Min: %d Max: %d\n\r",
+ ApplilightnessSet.StatusCode,
+ ApplilightnessSet.RangeMin,
+ ApplilightnessSet.RangeMax);
return MOBLE_RESULT_SUCCESS;
}
@@ -542,6 +596,12 @@ MOBLE_RESULT Appli_Light_GetCtlLightStatus(MOBLEUINT8* lCtlLightState)
*(lCtlLightState+1) = AppliCtlSet.PresentLightness16 >> 8;
*(lCtlLightState+2) = AppliCtlSet.PresentTemperature16;
*(lCtlLightState+3) = AppliCtlSet.PresentTemperature16 >>8;
+ *(lCtlLightState+4) = AppliCtlSet.PresentCtlDelta16;
+ *(lCtlLightState+5) = AppliCtlSet.PresentCtlDelta16 >>8;
+ TRACE_M(TF_SERIAL_CTRL,"Get Ctl Light Status: lightness: %d temp: %d delta: %d\n\r",
+ AppliCtlSet.PresentLightness16,
+ AppliCtlSet.PresentTemperature16,
+ AppliCtlSet.PresentCtlDelta16);
return MOBLE_RESULT_SUCCESS;
}
@@ -559,6 +619,9 @@ MOBLE_RESULT Appli_Light_GetCtlTemperatureStatus(MOBLEUINT8* lCtlTempState)
*(lCtlTempState+1) = AppliCtlSet.PresentTemperature16 >> 8;
*(lCtlTempState+2) = AppliCtlSet.PresentCtlDelta16;
*(lCtlTempState+3) = AppliCtlSet.PresentCtlDelta16 >>8;
+ TRACE_M(TF_SERIAL_CTRL,"Get Ctl Temperature Status: temp: %d delta: %d\n\r",
+ AppliCtlSet.PresentTemperature16,
+ AppliCtlSet.PresentCtlDelta16);
return MOBLE_RESULT_SUCCESS;
}
@@ -577,6 +640,10 @@ MOBLE_RESULT Appli_Light_GetCtlTemperatureRange(MOBLEUINT8* lCtlTempRange)
*(lCtlTempRange+2) = AppliCtlTemperatureRangeSet.RangeMin >> 8;
*(lCtlTempRange+3) = AppliCtlTemperatureRangeSet.RangeMax;
*(lCtlTempRange+4) = AppliCtlTemperatureRangeSet.RangeMax >>8;
+ TRACE_M(TF_SERIAL_CTRL,"Get Ctl Temperature Range: status: %d Min: %d Max: %d\n\r",
+ AppliCtlTemperatureRangeSet.StatusCode,
+ AppliCtlTemperatureRangeSet.RangeMin,
+ AppliCtlTemperatureRangeSet.RangeMax);
return MOBLE_RESULT_SUCCESS;
}
@@ -596,6 +663,10 @@ MOBLE_RESULT Appli_Light_GetCtlDefaultStatus(MOBLEUINT8* lCtlDefaultState)
*(lCtlDefaultState+3) = AppliCtlDefaultSet.CtlDefaultTemperature16 >>8;
*(lCtlDefaultState+4) = AppliCtlDefaultSet.CtlDefaultDeltaUv;
*(lCtlDefaultState+5) = AppliCtlDefaultSet.CtlDefaultDeltaUv >>8;
+ TRACE_M(TF_SERIAL_CTRL,"Get Ctl Default Status: lightness: %d temp: %d deltaUV: %d\n\r",
+ AppliCtlDefaultSet.CtlDefaultLightness16,
+ AppliCtlDefaultSet.CtlDefaultTemperature16,
+ AppliCtlDefaultSet.CtlDefaultDeltaUv);
return MOBLE_RESULT_SUCCESS;
}
@@ -621,12 +692,14 @@ MOBLE_RESULT Appli_Light_GetHslStatus(MOBLEUINT8* lHslState)
*(lHslState+3) = AppliHslSet.HslHueLightness16 >>8;
*(lHslState+4) = AppliHslSet.HslSaturation16;
*(lHslState+5) = AppliHslSet.HslSaturation16 >>8;
+ TRACE_M(TF_SERIAL_CTRL,"Get Hsl Status: lightness: %d hue: %d saturation: %d\n\r",
+ AppliHslSet.HslLightness16,
+ AppliHslSet.HslHueLightness16,
+ AppliHslSet.HslSaturation16);
return MOBLE_RESULT_SUCCESS;
}
-
-
/**
* @brief Appli_Light_GetHslHueStatus: This function is callback for Application
* to get the application values in middleware used for transition change.
@@ -635,9 +708,10 @@ MOBLE_RESULT Appli_Light_GetHslStatus(MOBLEUINT8* lHslState)
*/
MOBLE_RESULT Appli_Light_GetHslHueStatus(MOBLEUINT8* lHslHueState)
{
-
*(lHslHueState) = AppliHslSet.HslHueLightness16;
*(lHslHueState+1) = AppliHslSet.HslHueLightness16 >>8;
+ TRACE_M(TF_SERIAL_CTRL,"Get Hsl Hue Status: %d\n\r",
+ AppliHslSet.HslHueLightness16);
return MOBLE_RESULT_SUCCESS;
}
@@ -651,13 +725,34 @@ MOBLE_RESULT Appli_Light_GetHslHueStatus(MOBLEUINT8* lHslHueState)
*/
MOBLE_RESULT Appli_Light_GetHslSaturationStatus(MOBLEUINT8* lHslSaturationState)
{
-
*(lHslSaturationState) = AppliHslSet.HslSaturation16;
*(lHslSaturationState+1) = AppliHslSet.HslSaturation16 >>8;
+ TRACE_M(TF_SERIAL_CTRL,"Get Hsl Saturation Status: %d\n\r",
+ AppliHslSet.HslSaturation16);
return MOBLE_RESULT_SUCCESS;
}
+/**
+* @brief Appli_Light_GetHslSatRange: This function is callback for Application
+ to get the application values in middleware used for transition change
+* @param lHslSatRange: Pointer to the status message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Appli_Light_GetHslSatRange(MOBLEUINT8* lHslSatRange)
+{
+ *(lHslSatRange) = AppliHslRangeSet.StatusCode;
+ *(lHslSatRange+1) = AppliHslRangeSet.HslMinSaturation16;
+ *(lHslSatRange+2) = AppliHslRangeSet.HslMinSaturation16 >> 8;
+ *(lHslSatRange+3) = AppliHslRangeSet.HslMaxSaturation16;
+ *(lHslSatRange+4) = AppliHslRangeSet.HslMaxSaturation16 >>8;
+ TRACE_M(TF_SERIAL_CTRL,"Get Hsl Saturation Range: status: %d min: %d max: %d\n\r",
+ AppliHslRangeSet.StatusCode,
+ AppliHslRangeSet.HslMinSaturation16,
+ AppliHslRangeSet.HslMaxSaturation16);
+
+ return MOBLE_RESULT_SUCCESS;
+}
/**
* @brief Appli_Light_GetHslHueRange: This function is callback for Application
@@ -672,43 +767,240 @@ MOBLE_RESULT Appli_Light_GetHslHueRange(MOBLEUINT8* lHslHueRange)
*(lHslHueRange+2) = AppliHslRangeSet.HslHueMinRange16 >> 8;
*(lHslHueRange+3) = AppliHslRangeSet.HslHueMaxRange16;
*(lHslHueRange+4) = AppliHslRangeSet.HslHueMaxRange16 >>8;
+ TRACE_M(TF_SERIAL_CTRL,"Get Hsl Hue Range: status: %d min: %d max: %d\n\r",
+ AppliHslRangeSet.StatusCode,
+ AppliHslRangeSet.HslHueMinRange16,
+ AppliHslRangeSet.HslHueMaxRange16);
return MOBLE_RESULT_SUCCESS;
}
+/******************************************************************************/
+#endif /* ENABLE_LIGHT_MODEL_SERVER_HSL */
+/******************************************************************************/
+
+/* This Function used to initialise the PWM . This is used for the RGB board */
+void Appli_Light_PwmInit()
+{
+
+ Light_UpdateLedValue(RESET_STATE , Appli_LightPwmValue);
+}
+
+#ifdef ENABLE_LIGHT_MODEL_SERVER_HSL
/**
-* @brief Appli_Light_GetHslSatRange: This function is callback for Application
-* to get the application values in middleware used for transition change.
-* @param lHslSatRange: Pointer to the status message
-* @retval MOBLE_RESULT
+* @brief Function to convert the map the RGB values in real values.
+* @param value1: This value corresponds to red led.
+* @param value2: This value corresponds to green led .
+* @param value3: This value corresponds to blue led .
+* @retval void
*/
-MOBLE_RESULT Appli_Light_GetHslSatRange(MOBLEUINT8* lHslSatRange)
-{
- *(lHslSatRange) = AppliHslRangeSet.StatusCode;
- *(lHslSatRange+1) = AppliHslRangeSet.HslMinSaturation16;
- *(lHslSatRange+2) = AppliHslRangeSet.HslMinSaturation16 >> 8;
- *(lHslSatRange+3) = AppliHslRangeSet.HslMaxSaturation16;
- *(lHslSatRange+4) = AppliHslRangeSet.HslMaxSaturation16 >>8;
+void RgbF_Create(MOBLEUINT16 value1, MOBLEUINT16 value2, MOBLEUINT16 value3)
+{
+ Appli_RGBParam.Red_Value = (MOBLEUINT16)(65535 * value1/1000);
+ Appli_RGBParam.Green_Value = (MOBLEUINT16)(65535 * value2/1000);
+ Appli_RGBParam.Blue_Value = (MOBLEUINT16)(65535 * value3/1000);
+}
+
+/**
+* @brief Function to convert the HSL values in RGB values.
+* @param void
+* @retval void
+*/
+void HSL2RGB_Conversion(void)
+{
+
+ MOBLEUINT16 hueValue;
+ float lightnessvalue;
+ float saturationValue;
+ MOBLEUINT16 cValue; /* chroma */
+ MOBLEUINT16 mValue; /* intermediate value used for creating the r,g,b baseline */
+ MOBLEUINT16 xValue; /* intermediate value used for computing r,g,b */
+
+ if(AppliHslSet.HslSaturation16 == 0)
+ {
+ Appli_RGBParam.Red_Value = AppliHslSet.HslLightness16 ;
+ Appli_RGBParam.Green_Value = AppliHslSet.HslLightness16 ;
+ Appli_RGBParam.Blue_Value = AppliHslSet.HslLightness16 ;
+ }
+ else if((AppliHslSet.HslLightness16 == 0xFFFF) || (AppliHslSet.HslLightness16 == 0x00))
+ {
+ Appli_RGBParam.Red_Value = AppliHslSet.HslLightness16 ;
+ Appli_RGBParam.Green_Value = AppliHslSet.HslLightness16 ;
+ Appli_RGBParam.Blue_Value = AppliHslSet.HslLightness16 ;
+ }
+ else
+ {
+ /* Hue is calculated for angular value. so converting in between 0 to 360 degree */
+ hueValue = (MOBLEUINT16)(360 * (float)AppliHslSet.HslHueLightness16/65535);
+ lightnessvalue = (float)AppliHslSet.HslLightness16/65535;
+ saturationValue = (float)AppliHslSet.HslSaturation16/65535;
- return MOBLE_RESULT_SUCCESS;
-}
+ /* Formula to get the values used for RGB conversion */
+ cValue = (MOBLEUINT16)(((1- fabs(2 * lightnessvalue-1))*saturationValue) * 1000);
+ mValue = (MOBLEUINT16)((lightnessvalue * 1000) - (cValue/2));
+ xValue = (MOBLEUINT16)(cValue * (1 - fabs(fmod(hueValue / 60.0, 2.0) - 1)));
+
+ /* Conditons applied for the different angle of hue value */
+ if (hueValue > 0 && hueValue < (HUE_UPPER_LIMIT / 6))
+ {
+ RgbF_Create(cValue + mValue, xValue + mValue, mValue);
+ }
+ else if (hueValue >= (HUE_UPPER_LIMIT / 6) && hueValue < (HUE_UPPER_LIMIT / 3))
+ {
+ RgbF_Create(xValue + mValue, cValue + mValue, mValue);
+ }
+ else if (hueValue >= (HUE_UPPER_LIMIT / 3) && hueValue < (HUE_UPPER_LIMIT / 2))
+ {
+ RgbF_Create(mValue, cValue + mValue, xValue + mValue);
+ }
+ else if (hueValue >= (HUE_UPPER_LIMIT / 2)
+ && hueValue < (2 * HUE_UPPER_LIMIT / 3))
+ {
+ RgbF_Create(mValue, xValue + mValue, cValue + mValue);
+ }
+ else if (hueValue >= (2 * HUE_UPPER_LIMIT / 3)
+ && hueValue < (5 * HUE_UPPER_LIMIT / 6))
+ {
+ RgbF_Create(xValue + mValue, mValue, cValue + mValue);
+ }
+ else if ((hueValue >= (5 * HUE_UPPER_LIMIT / 6) && hueValue <= HUE_UPPER_LIMIT) || (hueValue == 0))
+ {
+ RgbF_Create(cValue + mValue, mValue, xValue + mValue);
+ }
+ else
+ {
+ RgbF_Create(mValue, mValue, mValue);
+ }
+ }
+}
-/******************************************************************************/
-#endif /* ENABLE_LIGHT_MODEL_SERVER_HSL */
-/******************************************************************************/
+#endif
+/**
+* @brief Rgb_LedOffState: This function is called while using CTL, makes all the RGB
+ PWM off state for Application.
+* @param void:
+* @retval void
+*/
+void Rgb_LedOffState(void)
+{
+ Appli_LightPwmValue.PwmRedValue = PWM_VALUE_OFF;
+ Appli_LightPwmValue.PwmGreenValue = PWM_VALUE_OFF;
+ Appli_LightPwmValue.PwmBlueValue = PWM_VALUE_OFF;
+ Appli_LightPwmValue.IntensityValue = PWM_VALUE_OFF;
+}
+/**
+* @brief Ctl_LedOffState: This function is called while using HSL, makes all the
+ cool Warm PWM off state for Application.
+* @param void:
+* @retval void
+*/
+void Ctl_LedOffState(void)
+{
+ Appli_LightPwmValue.PwmWarmValue = PWM_VALUE_OFF;
+ Appli_LightPwmValue.PwmCoolValue = PWM_VALUE_OFF;
+ Appli_LightPwmValue.IntensityValue = PWM_VALUE_OFF;
+}
+
+/**
+* @brief Function to set the values for PWM for RGB board.
+* @param state: decided the state of PWM according to the condition.
+* @retval void
+*/
+void Light_UpdateLedValue(MOBLEUINT8 state ,Appli_LightPwmValue_t light_state)
+{
+
+#ifndef USER_BOARD_1LED
+ if(light_state.IntensityValue > 0)
+ {
+#ifdef USER_BOARD_COOL_WHITE_LED
+ if((light_state.PwmCoolValue == 0) && (light_state.PwmWarmValue == 0))
+ light_state.PwmWarmValue = light_state.IntensityValue;
+#endif
+#ifdef USER_BOARD_RGB_LED
+ if((light_state.PwmRedValue == 0) && (light_state.PwmGreenValue == 0) && (light_state.PwmBlueValue == 0))
+ light_state.PwmBlueValue = light_state.IntensityValue;
+#endif
+ }
+#endif
+
+ if(state == RESUME_STATE)
+ {
+#ifdef USER_BOARD_1LED
+ Modify_PWM(SINGLE_LED, light_state.IntensityValue);
+#endif
+
+#ifdef USER_BOARD_COOL_WHITE_LED
+ Modify_PWM(COOL_LED, light_state.PwmCoolValue);
+ Modify_PWM(WARM_LED, light_state.PwmWarmValue);
+#endif
+
+#ifdef USER_BOARD_RGB_LED
+ Modify_PWM(RED_LED, light_state.PwmRedValue);
+ Modify_PWM(GREEN_LED, light_state.PwmGreenValue);
+ Modify_PWM(BLUE_LED, light_state.PwmBlueValue);
+#endif
+
+ }
+ else if(state == RESET_STATE)
+ {
+#ifdef USER_BOARD_1LED
+ Modify_PWM(SINGLE_LED, PWM_VALUE_OFF);
+#endif
+#ifdef USER_BOARD_COOL_WHITE_LED
+ Modify_PWM(COOL_LED, 0);
+ Modify_PWM(WARM_LED, 0);
+#endif
+#ifdef USER_BOARD_RGB_LED
+ Modify_PWM(RED_LED, PWM_VALUE_OFF);
+ Modify_PWM(GREEN_LED, PWM_VALUE_OFF);
+ Modify_PWM(BLUE_LED, PWM_VALUE_OFF);
+#endif
+ }
+ else if(state == LOAD_STATE)
+ {
+#ifdef USER_BOARD_1LED
+ Modify_PWM(SINGLE_LED, light_state.IntensityValue);
+#endif
+
+#ifdef USER_BOARD_COOL_WHITE_LED
+ Modify_PWM(COOL_LED, light_state.PwmCoolValue);
+ Modify_PWM(WARM_LED, light_state.PwmWarmValue);
+#endif
+#ifdef USER_BOARD_RGB_LED
+ Modify_PWM(RED_LED, light_state.PwmRedValue);
+ Modify_PWM(GREEN_LED, light_state.PwmGreenValue);
+ Modify_PWM(BLUE_LED, light_state.PwmBlueValue);
+#endif
+ }
+ else
+ {
+#ifdef USER_BOARD_1LED
+ Modify_PWM(SINGLE_LED, light_state.IntensityValue);
+#endif
+
+#ifdef USER_BOARD_COOL_WHITE_LED
+ light_state.PwmCoolValue = PWM_DEFAULT_VALUE;
+
+ Modify_PWM(COOL_LED, light_state.PwmCoolValue);
+ Modify_PWM(WARM_LED, light_state.PwmWarmValue);
+#endif
+#ifdef USER_BOARD_RGB_LED
+ Modify_PWM(RED_LED, light_state.PwmRedValue);
+ Modify_PWM(GREEN_LED, light_state.PwmGreenValue);
+ Modify_PWM(BLUE_LED, light_state.PwmBlueValue);
+#endif
+ }
+}
+/**
+* @}
+*/
+/**
+* @}
+*/
+/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
-///**
-// * @}
-// */
-//
-///**
-// * @}
-// */
-//
-///******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
-//
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light.h
index 7b3554951..945aafc31 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light.h
@@ -18,15 +18,101 @@
*/
/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __APPLI_LIGHT_MODEL_H
-#define __APPLI_LIGHT_MODEL_H
+#ifndef __APPLI_LIGHT_H
+#define __APPLI_LIGHT_H
/* Includes ------------------------------------------------------------------*/
#include "types.h"
#include "light.h"
/* Exported macro ------------------------------------------------------------*/
+#define HUE_UPPER_LIMIT 360
/* Exported variables -------------------------------------------------------*/
+
+/* Light Lightness set */
+#pragma pack(1)
+typedef struct
+{
+ MOBLEUINT16 PresentState16;
+ MOBLEUINT16 LastLightness16;
+ MOBLEUINT16 LightnessDefault;
+ MOBLEUINT8 StatusCode;
+ MOBLEUINT16 RangeMin;
+ MOBLEUINT16 RangeMax;
+}Appli_Light_lightnessSet;
+
+
+/* Light Lightness Linear set */
+#pragma pack(1)
+typedef struct
+{
+ MOBLEUINT16 PresentState16;
+}Appli_Light_lightnessLinearSet;
+
+/* Light Ctl Set */
+#pragma pack(1)
+typedef struct
+{
+ MOBLEUINT16 PresentLightness16;
+ MOBLEUINT16 PresentTemperature16;
+ MOBLEINT16 PresentCtlDelta16;
+}Appli_Light_CtlSet;
+
+/* Light Ctl Temperature Range Set */
+#pragma pack(1)
+typedef struct
+{
+ MOBLEUINT8 StatusCode;
+ MOBLEUINT16 RangeMin;
+ MOBLEUINT16 RangeMax;
+}Appli_Light_CtlTemperatureRangeSet;
+
+/* Light Ctl Default set */
+#pragma pack(1)
+typedef struct
+{
+ MOBLEUINT16 CtlDefaultLightness16;
+ MOBLEUINT16 CtlDefaultTemperature16;
+ MOBLEINT16 CtlDefaultDeltaUv;
+}Appli_Light_CtlDefaultSet;
+
+/* Light Hsl Hue set */
+#pragma pack(1)
+typedef struct
+{
+ MOBLEUINT16 HslLightness16;
+ MOBLEUINT16 HslHueLightness16;
+ MOBLEUINT16 HslSaturation16;
+}Appli_Light_HslSet;
+
+#pragma pack(1)
+typedef struct
+{
+ MOBLEUINT16 Red_Value;
+ MOBLEUINT16 Green_Value;
+ MOBLEUINT16 Blue_Value;
+}Appli_Light_RGBSet;
+
+#pragma pack(1)
+typedef struct
+{
+ MOBLEUINT8 StatusCode;
+ MOBLEUINT16 HslHueMinRange16;
+ MOBLEUINT16 HslHueMaxRange16;
+ MOBLEUINT16 HslMinSaturation16;
+ MOBLEUINT16 HslMaxSaturation16;
+}Appli_Light_HslRangeSet;
+
+#pragma pack(1)
+typedef struct
+{
+ MOBLEUINT16 IntensityValue;
+ MOBLEUINT16 PwmRedValue;
+ MOBLEUINT16 PwmGreenValue;
+ MOBLEUINT16 PwmBlueValue;
+ MOBLEUINT16 PwmWarmValue;
+ MOBLEUINT16 PwmCoolValue;
+}Appli_LightPwmValue_t;
/* Exported Functions Prototypes ---------------------------------------------*/
MOBLE_RESULT Appli_Light_Lightness_Set(Light_LightnessStatus_t*, MOBLEUINT8 OptionalValid);
@@ -68,10 +154,13 @@ MOBLE_RESULT Appli_Light_GetHslHueStatus(MOBLEUINT8* lHslHueState);
MOBLE_RESULT Appli_Light_GetHslSaturationStatus(MOBLEUINT8* lHslSaturationState);
MOBLE_RESULT Appli_Light_GetHslHueRange(MOBLEUINT8* lHslHueRange);
MOBLE_RESULT Appli_Light_GetHslSatRange(MOBLEUINT8* lHslSatRange);
-MOBLEUINT16 Light_Actual_LinearBinding(void);
-void Light_Linear_ActualImplicitBinding(MOBLEUINT8 bindingFlag);
-
-#endif /* __APPLI_LIGHT_MODEL_H */
+void Appli_Light_PwmInit(void);
+void HSL2RGB_Conversion(void);
+void Ctl_LedOffState(void);
+void Rgb_LedOffState(void);
+void RgbF_Create(MOBLEUINT16 value1, MOBLEUINT16 value2, MOBLEUINT16 value3);
+void Light_UpdateLedValue(MOBLEUINT8 state , Appli_LightPwmValue_t light_state);
+#endif /* __APPLI_LIGHT_H */
/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light_lc.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light_lc.c
new file mode 100644
index 000000000..b541c256a
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light_lc.c
@@ -0,0 +1,188 @@
+/**
+ ******************************************************************************
+ * @file appli_light_ctrl.c
+ * @author BLE Mesh Team
+ * @brief Application interface for light LC Mesh Models
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "hal_common.h"
+#include "types.h"
+#include "appli_generic.h"
+#include "appli_light.h"
+#include "common.h"
+#include "mesh_cfg_usr.h"
+#include "appli_light_lc.h"
+
+/** @addtogroup BlueNRG_Mesh
+* @{
+*/
+
+/** @addtogroup models_BlueNRG2
+* @{
+*/
+
+/* Private typedef -----------------------------------------------------------*/
+/* Private define ------------------------------------------------------------*/
+/* Private macro -------------------------------------------------------------*/
+/* Private variable ----------------------------------------------------------*/
+
+Appli_LightLC_Set_t Appli_LightLC_set;
+Appli_Light_LC_PropertySet_t Appli_LightLC_PropertySet;
+
+MOBLEUINT16 AmbientLuxLevel;
+/* Private function prototypes -----------------------------------------------*/
+/* Private functions ---------------------------------------------------------*/
+
+/**
+* @brief Appli_Light_LCMode_Set: This function is callback for Application
+when Light LC mode Set message is received
+* @param pLight_LC_Param: Pointer to the parameters received for message
+* @param OptionalValid: Flag to inform about the validity of optional parameters
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Appli_LightLC_Mode_Set(Light_LC_Param_t* pLight_LC_Param,
+ MOBLEUINT8 OptionalValid)
+{
+ Appli_LightLC_set.LC_mode = pLight_LC_Param->LC_mode;
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Appli_LightLC_OM_Set: This function is callback for Application
+when Light LC mode Occupancy Model Set message is received
+* @param pLight_LC_Param: Pointer to the parameters received for message
+* @param OptionalValid: Flag to inform about the validity of optional parameters
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Appli_LightLC_OM_Set(Light_LC_Param_t* pLight_LC_Param,
+ MOBLEUINT8 OptionalValid)
+{
+ Appli_LightLC_set.LC_OM = pLight_LC_Param->LC_OM;
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Appli_LightLC_OnOff_Set: This function is callback for Application
+when Light LC On Off Set message is received
+* @param pLight_LC_Param: Pointer to the parameters received for message
+* @param OptionalValid: Flag to inform about the validity of optional parameters
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Appli_LightLC_OnOff_Set(Light_LC_OnOffState_t* pLight_LC_Param,
+ MOBLEUINT8 OptionalValid)
+{
+ Appli_LightLC_set.Light_OnOffState = pLight_LC_Param->Present_OnOff_State;
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Get_AmbientLuxLevelOutput: This function is given to calculate the Ambient
+ Lux level output from the ambient sensor.
+* @param void:
+* @retval MOBLEUINT16:
+**/
+MOBLEUINT16 Appli_LightLC_Get_AmbientLuxLevelOutput(void)
+{
+ /* Use AmbientLuxLevel global variable to store the value from ambient lux sensor
+ and then use this value to copmpare the lux level output from state machine.
+ */
+
+ return AmbientLuxLevel;
+}
+
+/**
+* @brief Light_LC_LuxLevelPIRegulator: This function will calculate all the parameter
+ Kid,kpu,kiu,kpd and return the value Light Lightness Linear.
+* @param void:
+* @retval MOBLEUINT16:
+**/
+MOBLEUINT16 Appli_Light_LC_PIRegulatorOutput(MOBLEUINT16 tableLuxLevel,MOBLEUINT16 ambientLuxLevel)
+{
+ MOBLEUINT16 luxLevel = 0;
+ /* User can write their code for the calculation */
+
+
+ return luxLevel;
+}
+
+/**
+* @brief Appli_LightLC_Get_ModeStatus: This function is callback for Application
+to get the application values in middleware used for transition change.
+* @param lcModeState: Pointer to the status message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Appli_LightLC_Get_ModeStatus(MOBLEUINT8* plcModeState)
+{
+ *(plcModeState) = Appli_LightLC_set.LC_mode;
+ TRACE_M(TF_SERIAL_CTRL,"Get Mode Status: %d\n\r",
+ Appli_LightLC_set.LC_mode);
+
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Appli_LightLC_Get_OMModeStatus: This function is callback for Application
+to get the application values in middleware used for transition change.
+* @param lcOM_ModeState: Pointer to the status message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Appli_LightLC_Get_OMModeStatus(MOBLEUINT8* plcOM_ModeState)
+{
+ *(plcOM_ModeState) = Appli_LightLC_set.LC_OM;
+ TRACE_M(TF_SERIAL_CTRL,"Get OM Mode Status: %d\n\r",
+ Appli_LightLC_set.LC_OM);
+
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Appli_LightLC_Get_OnOffStatus: This function is callback for Application
+to get the application values in middleware used for transition change.
+* @param lcOnOffState: Pointer to the status message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Appli_LightLC_Get_OnOffStatus(MOBLEUINT8* plcOnOffState)
+{
+ *(plcOnOffState) = Appli_LightLC_set.Light_OnOffState;
+ TRACE_M(TF_SERIAL_CTRL,"Get On Off Status: %d\n\r",
+ Appli_LightLC_set.Light_OnOffState);
+
+
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/**
+* @brief Appli_LightLC_Get_PropertyStatus: This function is callback for Application
+to get the application values in middleware used for transition change.
+* @param plcPropertyState: Pointer to the status message
+* @retval MOBLE_RESULT
+*/
+MOBLE_RESULT Appli_LightLC_Get_PropertyStatus(MOBLEUINT8* plcPropertyState)
+{
+ return MOBLE_RESULT_SUCCESS;
+}
+
+
+/**
+* @}
+*/
+
+/**
+* @}
+*/
+
+/******************* (C) COPYRIGHT 2017 STMicroelectronics *****END OF FILE****/
+
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light_lc.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light_lc.h
new file mode 100644
index 000000000..9edf771d7
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_light_lc.h
@@ -0,0 +1,90 @@
+/**
+******************************************************************************
+* @file appli_light_ctrl.h
+* @author BLE Mesh Team
+* @version V1.10.000
+* @date 15-Jan-2019
+* @brief Application interface for Light Control Mesh Models
+******************************************************************************
+* @attention
+*
+* <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
+*
+* Redistribution and use in source and binary forms, with or without modification,
+* are permitted provided that the following conditions are met:
+* 1. Redistributions of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+* 3. Neither the name of STMicroelectronics nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+* Initial BlueNRG-Mesh is built over Motorolas Mesh over Bluetooth Low Energy
+* (MoBLE) technology. The present solution is developed and maintained for both
+* Mesh library and Applications solely by STMicroelectronics.
+*
+******************************************************************************
+*/
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __APPLI_LIGHT_LC_H
+#define __APPLI_LIGHT_LC_H
+
+/* Includes ------------------------------------------------------------------*/
+#include "types.h"
+#include "light_lc.h"
+
+
+/* Exported macro ------------------------------------------------------------*/
+/* Exported Functions Prototypes ---------------------------------------------*/
+/*******************************************************************************
+Following Variables are used for the Light LC Mode MODEL
+*******************************************************************************/
+/* Light Lightness set */
+#pragma pack(1)
+typedef struct
+{
+ MOBLEUINT8 LC_mode;
+ MOBLEUINT8 LC_OM;
+ MOBLEUINT8 Light_OnOffState;
+ MOBLEUINT16 Light_OnOffValue;
+}Appli_LightLC_Set_t;
+
+#pragma pack(1)
+typedef struct
+{
+ MOBLEUINT16 Property_ID;
+ MOBLEUINT16 Property_Value;
+}Appli_Light_LC_PropertySet_t;
+
+
+MOBLE_RESULT Appli_LightLC_Mode_Set(Light_LC_Param_t* pLight_LC_Param,
+ MOBLEUINT8 OptionalValid);
+MOBLE_RESULT Appli_LightLC_OM_Set(Light_LC_Param_t* pLight_LC_Param,
+ MOBLEUINT8 OptionalValid);
+MOBLE_RESULT Appli_LightLC_OnOff_Set(Light_LC_OnOffState_t* pLight_LC_Param,
+ MOBLEUINT8 OptionalValid);
+MOBLE_RESULT Appli_LightLC_Get_OnOffStatus(MOBLEUINT8* plcOnOffState);
+MOBLE_RESULT Appli_LightLC_Get_ModeStatus(MOBLEUINT8* plcModeState);
+MOBLE_RESULT Appli_LightLC_Get_OMModeStatus(MOBLEUINT8* plcOM_ModeState);
+MOBLE_RESULT Appli_LightLC_Get_PropertyStatus(MOBLEUINT8* plcPropertyState);
+MOBLEUINT16 Appli_LightLC_Get_AmbientLuxLevelOutput(void);
+MOBLEUINT16 Appli_Light_LC_PIRegulatorOutput(MOBLEUINT16 tableLuxLevel,
+ MOBLEUINT16 ambientLuxLevel);
+#endif /* __APPLI_LIGHT_LC_H */
+
+/******************* (C) COPYRIGHT 2017 STMicroelectronics *****END OF FILE****/
+
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_mesh.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_mesh.c
index 289cd7690..ffad67e4d 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_mesh.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_mesh.c
@@ -17,7 +17,7 @@
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
-#include "app_conf.h"
+#include "ble.h"
#include "hal_common.h"
#include "appli_mesh.h"
#include "types.h"
@@ -27,9 +27,13 @@
#include <string.h>
#include "models_if.h"
#include "mesh_cfg.h"
+#include "generic.h"
+#include "serial_if.h"
+#include "appli_nvm.h"
+//#include "gp_timer.h"
#include "stm32_seq.h"
-
+#include "PWM_config.h"
/** @addtogroup BLE_Mesh
* @{
@@ -46,10 +50,13 @@
#define LONG_PRESS_THRESHOLD 1000U
#define MANUAL_UNPROVISION_TIMER 3000U
#define FLASH_ERASE_TIME 100U
-#define DISCOVER_TIMER 10*60*1000 /* 10 minutes */
+//#define DISCOVER_TIMER 10*60*1000 /* 10 minutes */
+#define DISCOVER_TIMER_INTERVAL /*10*60**/(1000000/CFG_TS_TICK_VAL) /* 10 minutes */
#define DEFAULT_DELAY_PACKET_FROM 500U
#define DEFAULT_DELAY_PACKET_RANDOM_TIME 500U
-
+#define USER_OUTPUT_OOB_APPLI_PROCESS 0U
+#define INPUT_OOB_TIMEOUT 300U /* input Oob30 Sec timeout*/
+#define PBADV_UNPROV_DEV_BEACON_INTERVAL 100U /* 100 ms */
/* Private macro -------------------------------------------------------------*/
#define MAX_APPLI_BUFF_SIZE 8
#define MAX_PENDING_PACKETS_QUE_SIZE 2
@@ -69,17 +76,60 @@ enum ButtonState
BS_OFF,
BS_DEBOUNCE,
BS_SHORT_PRESS,
- BS_LONG_PRESS
+ BS_SHORT_PRESS2,
+ BS_LONG_PRESS,
+ BS_LONG_PRESS2
};
enum ButtonState buttonState = BS_OFF;
tClockTime tBounce = 0;
MOBLEUINT8 Appli_LedState = 0;
+MOBLEUINT16 IntensityValue = INTENSITY_LEVEL_ZERO;
+MOBLEUINT8 IntensityFlag = FALSE;
MOBLEUINT8 ProxyFlag = 0;
MOBLEUINT8 ProvisionFlag = 0;
+
+#ifdef ENABLE_AUTH_TYPE_OUTPUT_OOB
+static MOBLEUINT8 PrvngInProcess = 0;
+static MOBLEUINT32 OutputOobData = 0;
+static MOBLEUINT32 OutputOobBlinkCount = 0;
+#endif
+#ifdef ENABLE_AUTH_TYPE_INPUT_OOB
+MOBLEUINT8 InputOobData[8] = {0};
+MOBLEUINT8 inputOOBDataReady = 0;
+#endif
/*Number Of Elements selected per Node. Maximum Elements supported = 3*/
MOBLEUINT8 NumberOfElements = APPLICATION_NUMBER_OF_ELEMENTS;
+
+#ifdef ENABLE_AUTH_TYPE_STATIC_OOB
+/* 16 octets Static OOB information to be input here. Used during provisioning by Library */
+const MOBLEUINT8 StaticOobBuff[STATIC_OOB_SIZE] = {0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01};
+#else
+const MOBLEUINT8 StaticOobBuff[] = {0};
+#endif
+#ifdef PUB_KEY_TYPE_OOB
+/* 64 octets Public Key information to be input here. It is only required for Public Key OOB case.
+Used during provisioning by Library */
+const MOBLEUINT8 PubKeyBuff[64] = {0xF4, 0x65, 0xE4, 0x3F, 0xF2, 0x3D, 0x3F, 0x1B, 0x9D, 0xC7,
+0xDF, 0xC0, 0x4D, 0xA8, 0x75, 0x81, 0x84, 0xDB, 0xC9, 0x66, 0x20, 0x47, 0x96, 0xEC, 0xCF,
+0x0D, 0x6C, 0xF5, 0xE1, 0x65, 0x00, 0xCC, 0x02, 0x01, 0xD0, 0x48, 0xBC, 0xBB, 0xD8, 0x99,
+0xEE, 0xEF, 0xC4, 0x24, 0x16, 0x4E, 0x33, 0xC2, 0x01, 0xC2, 0xB0, 0x10, 0xCA, 0x6B, 0x4D,
+0x43, 0xA8, 0xA1, 0x55, 0xCA, 0xD8, 0xEC, 0xB2, 0x79};
+
+/* 32 octets Private Key information to be input here. It is only required for Public Key OOB case.
+Used during provisioning by Library */
+const MOBLEUINT8 PrivKeyBuff[32] = {0x52, 0x9A, 0xA0, 0x67, 0x0D, 0x72, 0xCD, 0x64, 0x97, 0x50,
+0x2E, 0xD4, 0x73, 0x50, 0x2B, 0x03, 0x7E, 0x88, 0x03, 0xB5, 0xC6, 0x08, 0x29, 0xA5, 0xA3,
+0xCA, 0xA2, 0x19, 0x50, 0x55, 0x30, 0xBA};
+#else
+const MOBLEUINT8 PubKeyBuff[] = NULL;
+const MOBLEUINT8 PrivKeyBuff[] = NULL;
+#endif
+
+
+
/*Select Node as Sniffer, Means able to sniff all the packets*/
MOBLEUINT8 DisableFilter = 0;
@@ -93,24 +143,43 @@ MOBLEUINT8 nvm_operation;
MOBLEUINT8 nvm_flash_page;
MOBLEUINT8 provisioning_completion;
+/* Timer to control unprovisioned device beacons */
+#if PB_ADV_SUPPORTED
+MOBLEUINT8 discoverTimer_Id;
+#endif
+
/********************* Application configuration **************************/
#if defined(__GNUC__) || defined(__IAR_SYSTEMS_ICC__) || defined(__CC_ARM)
MOBLEUINT8 bdaddr[8];
-extern const MOBLEUINT8 _bdaddr[];
+/* Mesh application data 1 sector used 125 */
+//extern const MOBLEUINT8 _bdaddr[];
+//const void *appNvmBase = _bdaddr;
+
+/* Mesh library configuration 2 sectors used: 126 and 127 */
+//extern const char* _bleNvmBase_data[];
+//const void *mobleNvmBase = _bleNvmBase_data;
#ifdef INTERNAL_UNIQUE_NUMBER_MAC
static void Appli_GetMACfromUniqueNumber(void);
-#endif
+#endif /* INTERNAL_UNIQUE_NUMBER_MAC */
+
+/* NVM addresses for Nucleo 1Mb */
+const void *mobleNvmBase = (const void *)0x0807E000; /* 2 sectors used: 126 and 127 */
+const void *appNvmBase = (const void *)0x0807D000; /* 1 sector used: 125 */
+/* NVM addresses for Nucleo 512Kb */
+//const void *mobleNvmBase = (const void *)0x08056000; /* 2 sectors used: 86 and 87 */
+//const void *appNvmBase = (const void *)0x08055000; /* 1 sector used: 85 */
-extern const char _mobleNvmBase_data[];
-const void *mobleNvmBase = (const void *)0x0807E000;
#else
#error "Unknown compiler"
#endif /* __GNUC__ || defined(__IAR_SYSTEMS_ICC__) || defined(__CC_ARM) */
/* Private function prototypes -----------------------------------------------*/
-static void Appli_LongButtonPress(void);
+//static void Appli_LongButtonPress(void);
static void Appli_ShortButtonPress(void);
+void Appli_OobAuthenticationProcess(void);
+void BLEMesh_UnprovisionCallback(MOBLEUINT8 reason);
+void Appli_LowPowerProcess(void);
/* Private functions ---------------------------------------------------------*/
@@ -125,6 +194,7 @@ static void Appli_ShortButtonPress(void)
BLEMesh_ModelsCommand();
}
+#if 0
/**
* @brief Function calls when a button is pressed for Long duration
* @param void
@@ -134,6 +204,7 @@ static void Appli_LongButtonPress(void)
{
/* User Implementation */
}
+#endif
/**
* @brief Updates the button status
@@ -147,15 +218,14 @@ static void Appli_UpdateButtonState(int isPressed)
{
/* Case for Button State off */
case BS_OFF:
- /* if button is pressed */
if (isPressed)
{
+ /* move to debounce state */
buttonState = BS_DEBOUNCE;
tBounce = Clock_Time();
}
break;
-
- /* Case for Button Debouncing */
+ /* Case for Button Debounce */
case BS_DEBOUNCE:
if (isPressed)
{
@@ -167,33 +237,45 @@ static void Appli_UpdateButtonState(int isPressed)
}
else
{
- break;
+ /* continue to be in BS_DEBOUNCE */
}
}
else
{
buttonState = BS_OFF;
+ }
break;
- }
- /* Case if Button is pressed for small duration */
+ /* Case if Button 1 is pressed for duration > BOUNCE_THRESHOLD */
case BS_SHORT_PRESS:
- if (isPressed && ((Clock_Time() - tBounce) > LONG_PRESS_THRESHOLD))
+ if (isPressed)
+ {
+ if ((Clock_Time() - tBounce) > LONG_PRESS_THRESHOLD)
{
+ /* If Button 1 is pressed for duration > LONG_PRESS_THRESHOLD */
buttonState = BS_LONG_PRESS;
}
else
{
- if (!isPressed)
+ /* continue in same state */
+ }
+ }
+ else
{
+ /* Button 1 short press action */
Appli_ShortButtonPress();
+
+ buttonState = BS_OFF;
}
break;
+ case BS_LONG_PRESS:
+ if (isPressed)
+ {
+ /* Long press action */
+ Appli_IntensityControlPublishing();
}
- /* Case if Button is pressed for long duration */
- case BS_LONG_PRESS:
- if (!isPressed)
+ else
{
- Appli_LongButtonPress();
+ buttonState = BS_OFF;
}
break;
/* Default case */
@@ -201,10 +283,6 @@ static void Appli_UpdateButtonState(int isPressed)
buttonState = BS_OFF;
break;
}
- if (!isPressed)
- {
- buttonState = BS_OFF;
- }
}
/**
@@ -352,6 +430,7 @@ MOBLE_RESULT Appli_BleSetUUIDCb(MOBLEUINT8 *uuid_prefix_data)
memcpy(uuid_prefix_data,uuid_buff,sizeof(uuid_buff));
memcpy(&uuid_prefix_data[10],bdaddr,6); /* Copy bdaddr to last 6 bytes of UUID */
+
return MOBLE_RESULT_SUCCESS;
}
@@ -389,9 +468,13 @@ void Appli_BleGattConnectionCompleteCb(void)
{
ProvisionFlag = 1;
/* Proxy Node, will be called whenever Gatt connection is established */
+ /* Turn ON Red LED*/
ProxyFlag = 1;
-// BSP_LED_On(LED_GREEN);
-
+#if LOW_POWER_FEATURE
+ /* do nothing */
+#else
+ BSP_LED_On(LED_GREEN);
+#endif
}
/**
@@ -403,10 +486,13 @@ void Appli_BleGattDisconnectionCompleteCb(void)
{
ProvisionFlag = 0;
/* Proxy Node, will be called whenever Gatt disconnected */
-
+ /* Turn Off Red LED*/
ProxyFlag = 0;
-// BSP_LED_Off(LED_GREEN);
-
+#if LOW_POWER_FEATURE
+ /* do nothing */
+#else
+ BSP_LED_Off(LED_GREEN);
+#endif
}
/**
@@ -416,9 +502,10 @@ void Appli_BleGattDisconnectionCompleteCb(void)
*/
void Appli_BleUnprovisionedIdentifyCb(MOBLEUINT8 data)
{
-#ifndef DISABLE_TRACES
- printf("Unprovisioned Node Identifier received: %02x\n\r", data);
+#ifdef ENABLE_AUTH_TYPE_OUTPUT_OOB
+ PrvngInProcess = 1;
#endif
+ TRACE_M(TF_PROVISION,"Unprovisioned Node Identifier received: %02x\n\r", data);
}
/**
@@ -430,9 +517,7 @@ MOBLEUINT8 Appli_BleSetNumberOfElementsCb(void)
{
if(NumberOfElements > MAX_NUMB_ELEMENTS)
{
-#ifndef DISABLE_TRACES
- printf("Currently Three Elements per node are supported!\r\n");
-#endif
+ TRACE_M(TF_ELEMENTS,"Currently Three Elements per node are supported!\r\n");
return MAX_NUMB_ELEMENTS;
}
else
@@ -448,12 +533,98 @@ MOBLEUINT8 Appli_BleSetNumberOfElementsCb(void)
*/
MOBLE_RESULT Appli_BleAttentionTimerCb(void)
{
-#ifndef DISABLE_TRACES
- printf("Attention timer callback received \r\n");
-#endif
-
+/* avoid printf, if low power feature is supported */
+#if (LOW_POWER_FEATURE == 0)
+ TRACE_M(TF_MISC, " \r\n");
+#endif /* LOW_POWER_FEATURE == 0 */
return MOBLE_RESULT_SUCCESS;
}
+/**
+* @brief Call back function to give Output OOB information
+* @param MOBLEUINT8* output_oob
+* @param MOBLEUINT8 size
+* @retval void
+*/
+void Appli_BleOutputOOBAuthCb(MOBLEUINT8* output_oob, MOBLEUINT8 size)
+{
+#ifdef ENABLE_AUTH_TYPE_OUTPUT_OOB
+ uint32_t ooBData = 0;
+ for (MOBLEUINT8 i = 0; i < size; i++)
+ {
+ ooBData |= (output_oob[i] << 8*i);
+ }
+ OutputOobData = ooBData;
+ TRACE_M(TF_PROVISION,"Output OOB information for provisioner: %ld\n\r", ooBData);
+ #endif
+}
+
+#ifdef ENABLE_AUTH_TYPE_OUTPUT_OOB
+/**
+* @brief Process for both output and Input OOB handling
+* @param void
+* @retval void
+*/
+void Appli_OobAuthenticationProcess(void)
+{
+ if(OutputOobBlinkCount < OutputOobData)
+ {
+ OutputOobBlinkCount++;
+ Appli_LedBlink();
+ }
+ else
+ {
+ OutputOobBlinkCount++;
+ Clock_Wait(1000);
+ if(OutputOobBlinkCount > OutputOobData+3)
+ {
+ OutputOobBlinkCount = 0;
+ }
+ }
+}
+#endif
+/**
+* @brief Call back function to provide Input OOB information
+* @param MOBLEUINT8 size
+* @retval MOBLEUINT8*
+*/
+
+MOBLEUINT8* Appli_BleInputOOBAuthCb(MOBLEUINT8 size)
+{
+#if defined (ENABLE_AUTH_TYPE_INPUT_OOB) && (ENABLE_SERIAL_INTERFACE)
+ MOBLEUINT16 inputTimer = 0;
+ TRACE_M(TF_PROVISION,"Input OOB information for provisioner-Size: %d\n\r", size);
+ while(1)
+ {
+ Serial_InterfaceProcess();
+ /* Check if input is completed or timeout */
+ if((inputOOBDataReady != 0x00) | (inputTimer > INPUT_OOB_TIMEOUT))
+ {
+ inputOOBDataReady = 0;
+ break;
+ }
+ Clock_Wait(100);
+ inputTimer++;
+ }
+ return InputOobData;
+#else
+ return NULL;
+#endif
+}
+/**
+* @brief Call back function to provide Input OOB information
+* @param rcvdStringBuff: buffer to store input string
+* @param rcvdStringSize: length of the input string
+* @retval void
+*/
+void Appli_BleSerialInputOOBValue(char *rcvdStringBuff, uint16_t rcvdStringSize)
+{
+#ifdef ENABLE_AUTH_TYPE_INPUT_OOB
+ unsigned long long InputOobDatatemp;
+ sscanf(rcvdStringBuff + 5, "%lld", &InputOobDatatemp);
+ memmove(&InputOobData, &InputOobDatatemp, sizeof(InputOobDatatemp));
+ inputOOBDataReady = 1;
+#endif
+}
/**
* @brief Enable Node as Sniffer to Capture all the packets
@@ -493,11 +664,13 @@ void Appli_CheckForUnprovision(void)
if (!interrupted)
{
BLEMesh_Unprovision();
-#ifndef DISABLE_TRACES
- printf("Device is unprovisioned by application \r\n");
-#endif
+ AppliNvm_ClearModelState();
+ TRACE_M(TF_PROVISION,"Device is unprovisioned by application \r\n");
t = Clock_Time();
- while ((Clock_Time() - t) < FLASH_ERASE_TIME);
+ while ((Clock_Time() - t) < FLASH_ERASE_TIME)
+ {
+ BLEMesh_Process();
+ }
while (BSP_PB_GetState(BUTTON_SW1) == BUTTON_PRESSED)
{
@@ -514,18 +687,6 @@ void Appli_CheckForUnprovision(void)
}
/**
-* @brief Application processing
-* This function should be called in main loop
-* @param void
-* @retval void
-*/
-void Appli_Process(void)
-{
- Appli_UpdateButtonState(BSP_PB_GetState(BUTTON_SW1) == BUTTON_PRESSED);
-}
-
-
-/**
* @brief Checks and updates Mac address to generate MAC Address
* @param void
* @retval MOBLEUINT8 sum return the sum calculated mac
@@ -537,7 +698,7 @@ int Appli_CheckBdMacAddr(void)
#ifdef EXTERNAL_MAC_ADDR_MGMT
memcpy(bdaddr, (MOBLEUINT8 *)CFG_ADV_BD_ADDRESS, 7);
- bdaddr[7] = EXTERNAL_MAC_ADDR_MGMT;
+ bdaddr[7] = (EXTERNAL_MAC_ADDR_MGMT | EXTERNAL_MAC_TYPE);
#endif
#ifdef INTERNAL_UNIQUE_NUMBER_MAC
@@ -556,9 +717,13 @@ int Appli_CheckBdMacAddr(void)
result = 1;
}
-#ifdef GENERATE_STATIC_RANDOM_MAC
+#if defined(EXTERNAL_MAC_ADDR_MGMT) && defined(EXTERNAL_MAC_IS_PUBLIC_ADDR)
+ /* Do nothing for modification of 2 MSb */
+#else
bdaddr[5] |= 0xC0; /* 2 Msb bits shall be 11b for Static Random Address */
+#endif
+#ifdef GENERATE_STATIC_RANDOM_MAC
bdaddr[7] = GENERATE_STATIC_RANDOM_MAC;
/* Do nothing for bdaddr, just pass the identification */
result = 1; /* This will overwrite the above for loop result,
@@ -623,18 +788,38 @@ static void Appli_GetMACfromUniqueNumber(void)
#endif
+#if 0
+/**
+* @brief provides the information of the power saving mode
+* @param sleepMode curently unused, to be used in future
+* @retval SleepModes returns the mode of the controller
+*/
+SleepModes App_SleepMode_Check(SleepModes sleepMode)
+{
+ if (buttonState == BS_OFF)
+ {
+ return SLEEPMODE_WAKETIMER;
+ }
+ else
+ {
+ return SLEEPMODE_RUNNING;
+ }
+}
+#endif
+
/**
* @brief callback for unprovision the node by provisioner.
* @param status reserved for future
* @retval void
*/
-void BLEMesh_UnprovisionCallback(MOBLEUINT8 status)
+void BLEMesh_UnprovisionCallback(MOBLEUINT8 reason)
{
ProvisionFlag = 0;
-
-#ifndef DISABLE_TRACES
- printf("Device is unprovisioned by provisioner \n\r");
+ TRACE_M(TF_PROVISION,"Device is unprovisioned by provisioner \n\r");
+#if PB_ADV_SUPPORTED
+ BLEMesh_SetUnprovisionedDevBeaconInterval(100);
#endif
+ AppliNvm_ClearModelState();
}
/**
@@ -645,9 +830,10 @@ void BLEMesh_UnprovisionCallback(MOBLEUINT8 status)
void BLEMesh_ProvisionCallback(void)
{
ProvisionFlag = 1;
-#ifndef DISABLE_TRACES
- printf("Device is provisioned by provisioner \r\n");
+#ifdef ENABLE_AUTH_TYPE_OUTPUT_OOB
+ PrvngInProcess = 0;
#endif
+ TRACE_M(TF_PROVISION,"Device is provisioned by provisioner \r\n");
}
/**
@@ -868,6 +1054,223 @@ void BLEMesh_NeighborRefreshedCallback(const MOBLEUINT8* bdAddr,
}
/**
+* @brief Appli_IntensityControl:Function to increase the intensity of led by
+* Publishing the value.
+* @param void
+*/
+void Appli_IntensityControlPublishing(void)
+{
+ MOBLEUINT8 generic_Level_Buff[3];
+ MOBLE_ADDRESS publishAddress;
+ MOBLEUINT8 elementNumber;
+ MOBLEUINT8 elementIndex;
+
+ /*Select the Element Number for which publication address is required*/
+
+ if (NumberOfElements == 1)
+ {
+ elementNumber = 0x01;
+ }
+
+ else if(NumberOfElements == 2)
+ {
+ elementNumber = 0x02; /*Element 2 is configured as switch*/
+ }
+
+ else if(NumberOfElements == 3)
+ {
+ elementNumber = 0x03; /*Element 3 is configured as switch*/
+ }
+
+ else
+ {
+ elementNumber = 0x01;
+ }
+
+ publishAddress = BLEMesh_GetPublishAddress(elementNumber);
+ elementIndex = elementNumber-1;
+
+ TRACE_M(TF_MISC,"IntensityFlag %d\n\r", IntensityFlag);
+
+ if(IntensityFlag == FALSE)
+ {
+
+ IntensityValue = IntensityValue + (INTENSITY_LEVEL_FULL/5);
+ generic_Level_Buff[0] = (MOBLEUINT8)IntensityValue;
+ generic_Level_Buff[1] = (MOBLEUINT8)(IntensityValue >> 8) ;
+
+ TRACE_M(TF_MISC,"IntensityValue %d\n\r", IntensityValue);
+
+ BLEMesh_SetRemoteData(publishAddress, elementIndex, GENERIC_LEVEL_SET_UNACK ,
+ generic_Level_Buff,3, MOBLE_FALSE, MOBLE_FALSE);
+
+ if(IntensityValue >= INTENSITY_LEVEL_FULL)
+ {
+ IntensityFlag = TRUE;
+ }
+
+ }
+ else
+ {
+
+ IntensityValue = IntensityValue - (INTENSITY_LEVEL_FULL/5);
+ generic_Level_Buff[0] = (MOBLEUINT8)IntensityValue;
+ generic_Level_Buff[1] = (MOBLEUINT8)(IntensityValue >> 8) ;
+
+ TRACE_M(TF_MISC,"IntensityValue %d\n\r", IntensityValue);
+
+ BLEMesh_SetRemoteData(publishAddress, elementIndex, GENERIC_LEVEL_SET_UNACK,
+ generic_Level_Buff, 3, MOBLE_FALSE, MOBLE_FALSE);
+
+ if(IntensityValue <= INTENSITY_LEVEL_ZERO)
+ {
+ IntensityFlag = FALSE;
+ }
+
+ }
+}
+
+/**
+* @brief Low Power mode process
+* If low power feature is supported, device enables low power mode
+* @param void
+* @retval void
+*/
+void Appli_LowPowerProcess(void)
+{
+#if 0
+#if LOW_POWER_FEATURE
+ BluenrgMesh_sleepTime = (MOBLEINT32)BluenrgMesh_GetSleepDuration();
+
+ if (BluenrgMesh_sleepTime > 0)
+ {
+ /* Timer 0 used for low power */
+ HAL_VTimerStart_ms(0, BluenrgMesh_sleepTime);
+
+ /* To start virtual timer */
+ BTLE_StackTick();
+
+ /* save virtual timer current count */
+ SysRefCount = HAL_VTimerGetCurrentTime_sysT32();
+
+ /* wakeup either from io or virtual timer */
+ BlueNRG_Sleep(SLEEPMODE_WAKETIMER, WAKEUP_IO13, WAKEUP_IOx_LOW);
+
+ /* update systick count based on updated virtual timer count */
+ Set_Clock_Time(Clock_Time() +
+ HAL_VTimerDiff_ms_sysT32(HAL_VTimerGetCurrentTime_sysT32(), SysRefCount));
+
+ /* Stop Timer 0 */
+ HAL_VTimer_Stop(0);
+ }
+#endif /* LOW_POWER_FEATURE */
+#endif
+}
+
+/**
+* @brief Application processing
+* This function should be called in main loop
+* @param void
+* @retval void
+*/
+void Appli_Process(void)
+{
+ Appli_UpdateButtonState(BSP_PB_GetState(BUTTON_SW1) == BUTTON_PRESSED);
+
+ Appli_LowPowerProcess();
+
+#ifdef ENABLE_AUTH_TYPE_OUTPUT_OOB
+ if(PrvngInProcess)
+ {
+#if USER_OUTPUT_OOB_APPLI_PROCESS
+ Appli_OobAuthenticationProcess();
+#endif
+ }
+#endif
+#ifdef ENABLE_SAVE_MODEL_STATE_NVM
+ AppliNvm_Process();
+#endif
+
+}
+
+#if PB_ADV_SUPPORTED
+static void UnprovisionedDeviceBeaconApp(void)
+{
+ BLEMesh_SetUnprovisionedDevBeaconInterval(0);
+}
+
+static void UnprovisionedDeviceBeaconTask(void)
+{
+ /**
+ * The code shall be executed in the background as aci command may be sent
+ * The background is the only place where the application can make sure a new aci command
+ * is not sent if there is a pending one
+ */
+ UTIL_SEQ_SetTask( 1<<CFG_TASK_MESH_BEACON_REQ_ID, CFG_SCH_PRIO_0);
+
+ return;
+}
+#endif
+
+#ifdef SAVE_MODEL_STATE_POWER_FAILURE_DETECTION
+/**
+* @brief function to inintiallise the GPIO interrupt fot Power down
+* @param void
+* @retval void
+*/
+static void GPIO_InitNVICPowerOff(void)
+{
+ GPIO_InitTypeDef gpioinitstruct = {0};
+
+ /* Enable the PowerOff GPIO Clock */
+ POWEROFF_GPIO_CLK_ENABLE();
+
+ /* Configure PowerOff pin as input with External interrupt */
+ gpioinitstruct.Pin = POWEROFF_PIN;
+ gpioinitstruct.Pull = GPIO_PULLUP;
+ gpioinitstruct.Mode = GPIO_MODE_IT_FALLING;
+ HAL_GPIO_Init(POWEROFF_GPIO_PORT, &gpioinitstruct);
+
+ /* Enable and set PowerOff EXTI Interrupt to the lowest priority */
+ HAL_NVIC_SetPriority((IRQn_Type)(POWEROFF_EXTI_IRQn), 0x0F, 0x00);
+ HAL_NVIC_EnableIRQ((IRQn_Type)(POWEROFF_EXTI_IRQn));
+}
+#endif
+
+/**
+* @brief Initializes the Application
+* @param void
+* @retval void
+*/
+void Appli_Init(void)
+{
+#ifdef ENABLE_UNPROVISIONING_BY_POWER_ONOFF_CYCLE
+ /* Hardware Factory Restore implementation */
+ AppliNvm_FactorySettingReset();
+#endif
+
+#if PB_ADV_SUPPORTED
+ UTIL_SEQ_RegTask( 1<< CFG_TASK_MESH_BEACON_REQ_ID, UTIL_SEQ_RFU, UnprovisionedDeviceBeaconApp );
+ /**
+ * Create Timer to control unprovisioned device beacons
+ */
+ HW_TS_Create(CFG_TIM_PROC_ID_ISR, &discoverTimer_Id, hw_ts_SingleShot, UnprovisionedDeviceBeaconTask);
+
+ HW_TS_Start(discoverTimer_Id, DISCOVER_TIMER_INTERVAL);
+#endif
+#if ENABLE_SERIAL_INTERFACE
+ Serial_Init();
+#endif
+#ifdef SAVE_MODEL_STATE_POWER_FAILURE_DETECTION
+ GPIO_InitNVICPowerOff();
+#endif
+
+ __HAL_RCC_TIM1_CLK_ENABLE();
+ __HAL_RCC_TIM2_CLK_ENABLE();
+ PWM_Init();
+}
+
+/**
* @}
*/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_mesh.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_mesh.h
index a54fff4dc..b56d3dd9e 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_mesh.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_mesh.h
@@ -23,6 +23,7 @@
/* Includes ------------------------------------------------------------------*/
#include "types.h"
+#include "mesh_cfg_usr.h"
/* Exported macro ------------------------------------------------------------*/
/* MACROS for Power Level definitions */
@@ -44,6 +45,15 @@
#define TX_POWER_LEVEL_PLUS_4DBM 6 /* = 4 dBm, */
#define TX_POWER_LEVEL_PLUS_8DBM 7 /* = 8 dBm */
+#ifdef SAVE_MODEL_STATE_POWER_FAILURE_DETECTION
+#define POWEROFF_PIN GPIO_PIN_4
+#define POWEROFF_GPIO_PORT GPIOB
+#define POWEROFF_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
+#define POWEROFF_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
+#define POWEROFF_EXTI_LINE GPIO_PIN_4
+#define POWEROFF_EXTI_IRQn EXTI2_IRQn
+#endif
+
/* Exported variables ------------------------------------------------------- */
extern MOBLEUINT8 bdaddr[];
@@ -58,8 +68,12 @@ void Appli_BleGattConnectionCompleteCb(void);
void Appli_BleGattDisconnectionCompleteCb(void);
MOBLEUINT8 Appli_BleSetNumberOfElementsCb(void);
MOBLE_RESULT Appli_BleAttentionTimerCb(void);
+void Appli_BleOutputOOBAuthCb(MOBLEUINT8* output_oob, MOBLEUINT8 size);
+MOBLEUINT8* Appli_BleInputOOBAuthCb(MOBLEUINT8 size);
+void Appli_BleSerialInputOOBValue(char *rcvdStringBuff, uint16_t rcvdStringSize);
MOBLEUINT8 Appli_BleDisableFilterCb(void);
+void Appli_IntensityControlPublishing(void);
int Appli_CheckBdMacAddr(void);
MOBLE_RESULT Appli_LedBlink(void);
@@ -68,7 +82,7 @@ MOBLE_RESULT Appli_LedStateCtrlCb(MOBLEUINT16 ctrl);
void Appli_CheckForUnprovision(void);
void Appli_Process(void);
void Appli_LedCtrl(void);
-
+void Appli_Init(void);
#endif /* __APPLI_MESH_H */
/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_nvm.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_nvm.c
index 6566aa711..7379df8ae 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_nvm.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_nvm.c
@@ -1,9 +1,9 @@
/**
- ******************************************************************************
- * @file appli_nvm.c
- * @author BLE Mesh Team
- * @brief User Application file
- ******************************************************************************
+ ******************************************************************************
+ * @file appli_nvm.c
+ * @author BLE Mesh Team
+ * @brief User Application file
+ ******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
@@ -20,16 +20,25 @@
/* Includes ------------------------------------------------------------------*/
#include <string.h>
#include "hal_common.h"
+#include "ble_mesh.h"
#include "appli_nvm.h"
#include "mesh_cfg.h"
+#include "pal_nvm.h"
#include "appli_mesh.h"
+#ifdef SAVE_MODEL_STATE_FOR_ALL_MESSAGES
+#include "common.h"
+#endif
extern const MOBLEUINT8* _bdaddr[];
-extern const void* bnrgmNvmBase;
+//extern const void* mobleNvmBase;
+#ifdef SAVE_MODEL_STATE_FOR_ALL_MESSAGES
+extern MOBLEUINT8 PowerOnOff_flag;
+#endif
+extern const void* appNvmBase;
/* Reserved for Bluenrg-Mesh library */
-#define BLUENRGMESH_NVM_BASE ((unsigned int)bnrgmNvmBase)
-#define BLUENRGMESH_NVM_BACKUP_BASE (BLUENRGMESH_NVM_BASE + PAGE_SIZE)
+//#define BLUENRGMESH_NVM_BASE ((unsigned int)mobleNvmBase)
+//#define BLUENRGMESH_NVM_BACKUP_BASE (BLUENRGMESH_NVM_BASE + PAGE_SIZE)
/*
* Page of size 2k, BlueNRG-1 and BlueNRG-2, reserved for application is divided into 8 subpages of each 256 bytes
@@ -37,11 +46,14 @@ extern const void* bnrgmNvmBase;
* Rest 7 subpages are used on rolling basis for application states.
* First byte of each subpage indicates if page is valid or not
*/
-#define APP_NVM_BASE ((unsigned int)_bdaddr)
+//#define APP_NVM_BASE ((unsigned int)_bdaddr)
+#define APP_NVM_BASE ((unsigned int)appNvmBase)
+#define APP_NVM_SIZE 0x00001000
+
#define APP_NVM_RESERVED_SIZE 256U
#define APP_NVM_SUBPAGE_SIZE 256U
-#define APP_NVM_MAX_SUBPAGE 7U
-#define APP_NVM_SUBPAGE_OFFSET(i) (unsigned int)(APP_NVM_BASE+APP_NVM_RESERVED_SIZE+256*i)
+#define APP_NVM_MAX_SUBPAGE 15U
+#define APP_NVM_SUBPAGE_OFFSET(i) (unsigned int)(APP_NVM_RESERVED_SIZE+256*(i))
/* offsets defined wrt start of subpage */
#define APP_NVM_VALID_FLAG_OFFSET 0U
@@ -53,34 +65,51 @@ extern const void* bnrgmNvmBase;
#define APP_NVM_LIGHT_MODEL_OFFSET (unsigned int)(APP_NVM_VALID_FLAG_SIZE+APP_NVM_RESET_COUNT_SIZE+APP_NVM_GENERIC_MODEL_SIZE)
#define APP_NVM_LIGHT_MODEL_SIZE 16U
+/* Private variables ---------------------------------------------------------*/
+typedef struct
+{
+ MOBLEUINT8 modelData[APP_NVM_GENERIC_MODEL_SIZE+APP_NVM_LIGHT_MODEL_SIZE];
+ MOBLEBOOL erasePageReq;
+ MOBLEBOOL writeReq;
+} APPLI_NVM_REQS;
+
+APPLI_NVM_REQS AppliNvm_Reqs;
+
MOBLE_RESULT AppliNvm_EraseRestoreResvNvm(void);
+MOBLE_RESULT AppliNvm_FindFirstValidSubPage(MOBLEINT8* subPageIndex);
+MOBLE_RESULT AppliNvm_MarkSubpageInvalid(void);
+MOBLE_RESULT AppliNvm_FlashProgram(MOBLEUINT32 offset, void const *buf, MOBLEUINT32 size);
+MOBLE_RESULT AppliNvm_LoadGenericState(uint8_t state[], uint8_t* size);
+MOBLE_RESULT AppliNvm_LoadLightState(uint8_t state[], uint8_t* size);
+#if 0
/**
* @brief This function erases a specified flash page
-* @param void
-* @retval MOBLE_RESULT_SUCCESS on success
+* @param Page Number
+* @retval MOBLE_RESULT_INVALIDARG if PageNumber overflow
+* MOBLE_RESULT_FALSE if flash operation is very close to next radio event
+* MOBLE_RESULT_FAIL if flash command error is set
+* MOBLE_RESULT_SUCCESS on success
*/
-MOBLE_RESULT AppliNvm_FlashErase(void)
+MOBLE_RESULT AppliNvm_FlashErase(uint16_t PageNumber)
{
- if(BluenrgMesh_IsFlashReadyToErase())
+ MOBLE_RESULT result;
+
+ if (PageNumber < N_PAGES)
{
BLEMesh_StopAdvScan();
- FLASH_ErasePage((uint16_t)((APP_NVM_BASE - RESET_MANAGER_FLASH_BASE_ADDRESS) / PAGE_SIZE));
-
- if (FLASH_GetFlagStatus(Flash_CMDERR) == SET)
- {
- return MOBLE_RESULT_FAIL;
- }
- else
- {
- return MOBLE_RESULT_SUCCESS;
- }
+ ATOMIC_SECTION_BEGIN();
+ result = MoblePalNvmErase(APP_NVM_BASE, 0);
+ ATOMIC_SECTION_END();
}
- else
+ else /* Invalid page no */
{
- return MOBLE_RESULT_FALSE;
+ result = MOBLE_RESULT_INVALIDARG;
}
+
+ return result;
}
+#endif
/**
* @brief Program word (32-bit) at a APP_NVM_BASE + APP_NVM_RESERVED_SIZE
@@ -89,34 +118,37 @@ MOBLE_RESULT AppliNvm_FlashErase(void)
* @param Data: word to write
* @retval MOBLE_RESULT_SUCCESS on success
*/
-MOBLE_RESULT AppliNvm_FlashProgram(uint32_t TypeProgram, uint32_t Address, uint32_t Data[])
+//MOBLE_RESULT AppliNvm_FlashProgram(uint32_t TypeProgram, uint32_t Address, uint32_t Data[])
+MOBLE_RESULT AppliNvm_FlashProgram(MOBLEUINT32 offset, void const *buf, MOBLEUINT32 size)
{
- if (Address < (APP_NVM_BASE)
- || Address > (APP_NVM_BASE + PAGE_SIZE)
- || (Address & 0x03 != 0))
- {
- return MOBLE_RESULT_INVALIDARG;
- }
- else
- {
- if(TypeProgram == FLASH_WRITE)
- {
- /* Program 4 bytes (32-bit) at a specified address.*/
- FLASH_ProgramWord(Address, (uint32_t) Data[0]);
- }
- else if(TypeProgram == FLASH_BURSTWRITE)
- {
- /*Program 4 words (128-bit) at a specified address.*/
- FLASH_ProgramWordBurst(Address, (uint32_t*) Data);
- }
- }
-
- if (FLASH_GetFlagStatus(Flash_CMDERR) == SET)
- {
- return MOBLE_RESULT_FAIL;
- }
-
- return MOBLE_RESULT_SUCCESS;
+ MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
+
+ if (offset > PAGE_SIZE)
+ {
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else if (size == 0)
+ {
+ result = MOBLE_RESULT_FALSE;
+ }
+ else if (offset + size > (APP_NVM_BASE + PAGE_SIZE))
+ {
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else if (offset & 3)
+ {
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else if (size & 3)
+ {
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else
+ {
+ result = MoblePalNvmWrite(APP_NVM_BASE, offset, buf, size);
+ }
+
+ return result;
}
/**
@@ -127,15 +159,17 @@ MOBLE_RESULT AppliNvm_FlashProgram(uint32_t TypeProgram, uint32_t Address, uint3
*/
MOBLE_RESULT AppliNvm_FindFirstValidSubPage(MOBLEINT8* subPageIndex)
{
- MOBLEUINT32 valid;
+ MOBLEUINT32 valid[2];
MOBLEINT8 subPageIdx = -1;
MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
/* find valid subpage */
for (MOBLEUINT8 count=0; count<APP_NVM_MAX_SUBPAGE; count++)
{
- memcpy((void*)&valid, (void*)(APP_NVM_SUBPAGE_OFFSET(count)), 4);
- if (valid == 0xFFFFFFFF)
+ unsigned int offset = APP_NVM_SUBPAGE_OFFSET(count);
+
+ memcpy((void*)&valid, (void*)(APP_NVM_BASE + offset), 8);
+ if ((valid[0] == 0xFFFFFFFF) && ((valid[1] == 0xFFFFFFFF)))
{
subPageIdx = count;
break;
@@ -145,8 +179,8 @@ MOBLE_RESULT AppliNvm_FindFirstValidSubPage(MOBLEINT8* subPageIndex)
/* if no valid subpage found, erase all subpages and reset subPageIdx */
if (subPageIdx < 0)
{
- result = AppliNvm_EraseRestoreResvNvm();
- subPageIdx = 0;
+ AppliNvm_Reqs.erasePageReq = MOBLE_TRUE;
+ result = MOBLE_RESULT_FAIL;
}
else
{
@@ -160,80 +194,44 @@ MOBLE_RESULT AppliNvm_FindFirstValidSubPage(MOBLEINT8* subPageIndex)
/**
* @brief Mark first valid subpage as invalid.
-* If no valid subpage found, erase page appli nvm to reset it
-* Also copy model data from current subpage into new subpage
-* It is assumed that all models are consecutive in memory
-* @param model backup flag. If true, copy model states from current subpage to new subpage
+* @param void
* @retval MOBLE_RESULT_SUCCESS on success
*/
-MOBLE_RESULT AppliNvm_MarkSubpageInvalid(MOBLEBOOL modelBackup)
+MOBLE_RESULT AppliNvm_MarkSubpageInvalid(void)
{
MOBLEUINT32 valid = 0;
MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
MOBLEINT8 currSubPageIdx;
- MOBLEINT8 newSubPageIdx;
- MOBLEUINT8 modelBackupData[APP_NVM_GENERIC_MODEL_SIZE+APP_NVM_LIGHT_MODEL_SIZE];
+ MOBLEUINT8 subPageTemp[APP_NVM_SUBPAGE_SIZE];
/* find valid subpage */
result = AppliNvm_FindFirstValidSubPage(&currSubPageIdx);
- if (MOBLE_FAILED(result))
+ if (result != MOBLE_RESULT_SUCCESS)
{
- result = MOBLE_RESULT_FAIL;
+ /* do nothing */
}
else
{
- if (modelBackup == MOBLE_TRUE)
- {
- /* copy model data from current subpage*/
- memcpy((void*)modelBackupData,
- (void*)(APP_NVM_SUBPAGE_OFFSET(currSubPageIdx)+APP_NVM_GENERIC_MODEL_OFFSET),
- APP_NVM_GENERIC_MODEL_SIZE+APP_NVM_LIGHT_MODEL_SIZE);
- }
-
/* mark valid subpage as invalid */
- AppliNvm_FlashProgram(FLASH_WRITE,
- APP_NVM_SUBPAGE_OFFSET(currSubPageIdx)+APP_NVM_VALID_FLAG_OFFSET,
- (uint32_t*)&valid);
-
- /* find next valid subpage */
- result = AppliNvm_FindFirstValidSubPage(&newSubPageIdx);
-
+ memcpy((void*)subPageTemp,
+ (void*)(APP_NVM_SUBPAGE_OFFSET(currSubPageIdx)),
+ APP_NVM_SUBPAGE_SIZE);
+ subPageTemp[APP_NVM_VALID_FLAG_OFFSET] = valid;
+ result = AppliNvm_FlashProgram(APP_NVM_SUBPAGE_OFFSET(currSubPageIdx),
+ (uint32_t*)&subPageTemp,
+ APP_NVM_SUBPAGE_SIZE);
if (MOBLE_FAILED(result))
{
result = MOBLE_RESULT_FAIL;
}
- else if (modelBackup == MOBLE_TRUE)
+ else if (result == MOBLE_RESULT_FALSE)
{
- /* update model data in new subpage */
- for (MOBLEUINT32 count=0; count<APP_NVM_GENERIC_MODEL_SIZE+APP_NVM_LIGHT_MODEL_SIZE; )
- {
- if (FLASH_GetFlagStatus(Flash_CMDERR) == RESET)
- {
- /* If size to be written > 4 words, use FLASH_ProgramWordBurst*/
- if (APP_NVM_GENERIC_MODEL_SIZE+APP_NVM_LIGHT_MODEL_SIZE-count >= 4*N_BYTES_WORD)
- {
- AppliNvm_FlashProgram(FLASH_BURSTWRITE,
- APP_NVM_SUBPAGE_OFFSET(newSubPageIdx)+APP_NVM_GENERIC_MODEL_OFFSET+count,
- (uint32_t*)&modelBackupData[count]);
- count += 4*N_BYTES_WORD;
- }
- /* If size to be written < 4 words, use FLASH_ProgramWord*/
- else
- {
- AppliNvm_FlashProgram(FLASH_WRITE,
- APP_NVM_SUBPAGE_OFFSET(newSubPageIdx)+APP_NVM_GENERIC_MODEL_OFFSET+count,
- (uint32_t*)&modelBackupData[count]);
- count += N_BYTES_WORD;
- }
- }
- else
- {
- /* Flash command error occurred */
- result = MOBLE_RESULT_FAIL;
- break;
- }
- }
+ /* radio busy, try again later */
+ }
+ else
+ {
+ /* do nothing */
}
}
@@ -250,9 +248,10 @@ MOBLE_RESULT AppliNvm_MarkSubpageInvalid(MOBLEBOOL modelBackup)
*/
MOBLE_RESULT AppliNvm_FactorySettingReset(void)
{
- MOBLEINT8 currSubPageIdx;
+ MOBLEINT8 currSubPageIdx = 0;
MOBLE_RESULT result;
MOBLEUINT32 resetCount;
+ MOBLEUINT8 subPageTemp[APP_NVM_SUBPAGE_SIZE];
result = AppliNvm_FindFirstValidSubPage(&currSubPageIdx);
@@ -262,19 +261,40 @@ MOBLE_RESULT AppliNvm_FactorySettingReset(void)
}
else
{
- /* read saved reset counter from subpage */
- memcpy((void*)&resetCount, (void*)(APP_NVM_SUBPAGE_OFFSET(currSubPageIdx)+APP_NVM_RESET_COUNT_OFFSET), 4);
+ if(currSubPageIdx > 0)
+ {
+ /* Not the first reset */
+ /* read the previous subpage */
+ memcpy((void*)&(subPageTemp[0]),
+ (void*)(APP_NVM_BASE + APP_NVM_SUBPAGE_OFFSET(currSubPageIdx-1)),
+ APP_NVM_SUBPAGE_SIZE);
+ }
+ else
+ {
+ /* read the current subpage */
+ memcpy((void*)&(subPageTemp[0]),
+ (void*)(APP_NVM_BASE + APP_NVM_SUBPAGE_OFFSET(currSubPageIdx)),
+ APP_NVM_SUBPAGE_SIZE);
+ }
+
+ /* read reset count from the subpage */
+ memcpy((void*)&resetCount,
+ (void*)&(subPageTemp[APP_NVM_RESET_COUNT_OFFSET]),
+ 4);
resetCount = resetCount << 1; /* Shifting for making Bits 0 from LSB */
+ memcpy((void*)&(subPageTemp[APP_NVM_RESET_COUNT_OFFSET]), (void*)&resetCount, 4);
/* Check for 5 times, 5 LSB are not zero */
if (resetCount > 0xFFFFFFE0)
{
/* update reset count */
- AppliNvm_FlashProgram(FLASH_WRITE,
- APP_NVM_SUBPAGE_OFFSET(currSubPageIdx)+APP_NVM_RESET_COUNT_OFFSET,
- (uint32_t*)&resetCount);
+ result = AppliNvm_FlashProgram(APP_NVM_SUBPAGE_OFFSET(currSubPageIdx),
+ (uint32_t*)&subPageTemp,
+ APP_NVM_SUBPAGE_SIZE);
- if (!memcmp((void*)&resetCount, (void*)(APP_NVM_SUBPAGE_OFFSET(currSubPageIdx)+APP_NVM_RESET_COUNT_OFFSET), 4))
+ if (!memcmp((void*)&subPageTemp[APP_NVM_RESET_COUNT_OFFSET],
+ (void*)(APP_NVM_BASE + APP_NVM_SUBPAGE_OFFSET(currSubPageIdx)+APP_NVM_RESET_COUNT_OFFSET),
+ 4))
{
/* updated value of reset count in flash */
}
@@ -285,33 +305,19 @@ MOBLE_RESULT AppliNvm_FactorySettingReset(void)
{
Appli_LedBlink();
}
-
- result = AppliNvm_MarkSubpageInvalid(MOBLE_TRUE);
-
- if (MOBLE_FAILED(result))
- {
- result = MOBLE_RESULT_FAIL;
- }
}
else /* Device is forced to factory reset, 5 LSBs are zero */
{
/* Unprovision node */
- BluenrgMesh_Unprovision();
+ BLEMesh_Unprovision();
- /* Clear lib data, primary and backup nvm used by BlueNRG-Mesh lib */
- FLASH_ErasePage((uint16_t)((BLUENRGMESH_NVM_BASE - RESET_MANAGER_FLASH_BASE_ADDRESS) / PAGE_SIZE));
- FLASH_ErasePage((uint16_t)((BLUENRGMESH_NVM_BACKUP_BASE - RESET_MANAGER_FLASH_BASE_ADDRESS) / PAGE_SIZE));
+ /* Clear lib data, primary and backup nvm used by BLE-Mesh lib */
+ MoblePalNvmErase(NVM_BASE, 0);
+ MoblePalNvmErase(NVM_BASE, 0x1000);
AppliNvm_ClearModelState();
- result = AppliNvm_MarkSubpageInvalid(MOBLE_FALSE);
-
- if (MOBLE_FAILED(result))
- {
- result = MOBLE_RESULT_FAIL;
- }
-
- BluenrgMesh_SetUnprovisionedDevBeaconInterval(100);
+ BLEMesh_SetUnprovisionedDevBeaconInterval(100);
/* Blink 5 times to indicate factory setting reset */
for (MOBLEUINT8 i=0; i<5; i++)
@@ -329,59 +335,6 @@ MOBLE_RESULT AppliNvm_FactorySettingReset(void)
}
/**
-* @brief This function erases application Flash page data only keeping reserved Nvm data
-* located at APP_NVM_BASE + APP_NVM_RESERVED_SIZE
-* @param void
-* @retval MOBLE_RESULT_SUCCESS on success
-*/
-MOBLE_RESULT AppliNvm_EraseRestoreResvNvm(void)
-{
- MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
- MOBLEUINT8 reserveAreaCopy[APP_NVM_RESERVED_SIZE];
-
- /* save reserve flash area */
- memcpy((void*)reserveAreaCopy, (void*)APP_NVM_BASE, APP_NVM_RESERVED_SIZE);
-
- /* erase page */
- FLASH_ErasePage((uint16_t)((APP_NVM_BASE - RESET_MANAGER_FLASH_BASE_ADDRESS) / PAGE_SIZE));
-
- if (FLASH_GetFlagStatus(Flash_CMDERR) == SET)
- {
- result = MOBLE_RESULT_FAIL;
- }
- else
- {
- /* restore reserve area */
- for (MOBLEUINT32 count=0; count<APP_NVM_RESERVED_SIZE; )
- {
- if (FLASH_GetFlagStatus(Flash_CMDERR) == RESET)
- {
- /* If size to be written > 4 words, use FLASH_ProgramWordBurst*/
- if (APP_NVM_RESERVED_SIZE-count >= 4*N_BYTES_WORD)
- {
- AppliNvm_FlashProgram(FLASH_BURSTWRITE,APP_NVM_BASE + count, (uint32_t*)&reserveAreaCopy[count]);
- count += 4*N_BYTES_WORD;
- }
- /* If size to be written < 4 words, use FLASH_ProgramWord*/
- else
- {
- AppliNvm_FlashProgram(FLASH_WRITE,APP_NVM_BASE + count, (uint32_t*)&reserveAreaCopy[count]);
- count += N_BYTES_WORD;
- }
- }
- else
- {
- /* Flash command error occurred */
- result = MOBLE_RESULT_FAIL;
- break;
- }
- }
- }
-
- return result;
-}
-
-/**
* @brief Save model states in nvm
* @param model state buff
* @param model state buff size
@@ -389,66 +342,19 @@ MOBLE_RESULT AppliNvm_EraseRestoreResvNvm(void)
*/
MOBLE_RESULT AppliNvm_SaveModelState(uint8_t* state, uint8_t size)
{
- MOBLE_RESULT result = MOBLE_RESULT_FAIL; /* if save model state not defined, return MOBLE_RESULT_FAIL */
+ MOBLE_RESULT result = MOBLE_RESULT_SUCCESS; /* if save model state not defined, return MOBLE_RESULT_FAIL */
#if (SAVE_MODEL_STATE_NVM == 1)
- MOBLEINT8 subPageIdx;
-
- if (size > APP_NVM_GENERIC_MODEL_SIZE+APP_NVM_LIGHT_MODEL_SIZE)
+ if (size > APP_NVM_MODEL_SIZE)
{
/* incorrect size */
result = MOBLE_RESULT_FAIL;
}
else
{
- AppliNvm_MarkSubpageInvalid(MOBLE_FALSE);
- result = AppliNvm_FindFirstValidSubPage(&subPageIdx);
-
- if (MOBLE_FAILED(result))
- {
- result = MOBLE_RESULT_FAIL;
- }
- else
- {
- /* update models states */
- for (MOBLEUINT32 count=0; count<size; )
- {
- if (FLASH_GetFlagStatus(Flash_CMDERR) == RESET)
- {
- /* If size to be written > 4 words, use FLASH_ProgramWordBurst*/
- if (APP_NVM_RESERVED_SIZE-count >= 4*N_BYTES_WORD)
- {
- result = AppliNvm_FlashProgram(FLASH_BURSTWRITE,
- APP_NVM_SUBPAGE_OFFSET(subPageIdx)+APP_NVM_GENERIC_MODEL_OFFSET+count,
- (uint32_t*)&state[count]);
- count += 4*N_BYTES_WORD;
- }
- /* If size to be written < 4 words, use FLASH_ProgramWord*/
- else
- {
- result = AppliNvm_FlashProgram(FLASH_WRITE,
- APP_NVM_SUBPAGE_OFFSET(subPageIdx)+APP_NVM_GENERIC_MODEL_OFFSET+count,
- (uint32_t*)&state[count]);
- count += N_BYTES_WORD;
- }
- }
- else
- {
- /* Flash command error occurred */
- result = MOBLE_RESULT_FAIL;
- break;
- }
- }
-
- for (MOBLEUINT8 count=0; count<size; count++)
- {
- TRACE_M(TF_MISC, "%.2x ", *((MOBLEUINT8*)((APP_NVM_SUBPAGE_OFFSET(subPageIdx)+APP_NVM_GENERIC_MODEL_OFFSET+count))));
- }
-
- TRACE_M(TF_MISC,"\r\n");
-
- }
+ memcpy(AppliNvm_Reqs.modelData, state, size);
+ AppliNvm_Reqs.writeReq = MOBLE_TRUE;
}
#endif /* SAVE_MODEL_STATE_NVM */
return result;
@@ -464,8 +370,10 @@ MOBLE_RESULT AppliNvm_ClearModelState(void)
MOBLE_RESULT result = MOBLE_RESULT_FAIL; /* if save model state not defined, return MOBLE_RESULT_FAIL */
#if (SAVE_MODEL_STATE_NVM == 1)
+ MOBLEUINT8 subPageTemp[APP_NVM_SUBPAGE_SIZE];
MOBLEINT8 subPageIdx;
- MOBLEUINT8 clearBuff[16] = {0};
+ MOBLEUINT8 clearBuff[APP_NVM_GENERIC_MODEL_SIZE+APP_NVM_LIGHT_MODEL_SIZE] = {0};
+ MOBLEUINT32 valid = 0;
result = AppliNvm_FindFirstValidSubPage(&subPageIdx);
@@ -475,40 +383,41 @@ MOBLE_RESULT AppliNvm_ClearModelState(void)
}
else
{
- /* clear models states */
- for (MOBLEUINT32 count=0; count<APP_NVM_GENERIC_MODEL_SIZE+APP_NVM_LIGHT_MODEL_SIZE; )
- {
- if (FLASH_GetFlagStatus(Flash_CMDERR) == RESET)
- {
- /* If size to be written > 4 words, use FLASH_ProgramWordBurst*/
- if (APP_NVM_RESERVED_SIZE-count >= 4*N_BYTES_WORD)
- {
- result = AppliNvm_FlashProgram(FLASH_BURSTWRITE,
- APP_NVM_SUBPAGE_OFFSET(subPageIdx)+APP_NVM_GENERIC_MODEL_OFFSET+count,
- (uint32_t*)&clearBuff[count]);
- count += 4*N_BYTES_WORD;
- }
- /* If size to be written < 4 words, use FLASH_ProgramWord*/
- else
- {
- result = AppliNvm_FlashProgram(FLASH_WRITE,
- APP_NVM_SUBPAGE_OFFSET(subPageIdx)+APP_NVM_GENERIC_MODEL_OFFSET+count,
- (uint32_t*)&clearBuff[count]);
- count += N_BYTES_WORD;
- }
- }
- else
- {
- /* Flash command error occurred */
- result = MOBLE_RESULT_FAIL;
- break;
- }
+ if(subPageIdx > 1)
+ { /* Not the first subpage */
+ /* clear models states */
+ memcpy((void*)&(subPageTemp[0]),
+ (void*)(APP_NVM_BASE + APP_NVM_SUBPAGE_OFFSET(subPageIdx-1)),
+ APP_NVM_SUBPAGE_SIZE);
+ memcpy((void*)&subPageTemp[APP_NVM_GENERIC_MODEL_OFFSET],
+ (void*)(clearBuff),
+ APP_NVM_GENERIC_MODEL_SIZE+APP_NVM_LIGHT_MODEL_SIZE);
+ subPageTemp[APP_NVM_VALID_FLAG_OFFSET] = valid;
+
+ result = AppliNvm_FlashProgram(APP_NVM_SUBPAGE_OFFSET(subPageIdx),
+ (uint32_t*)&subPageTemp,
+ APP_NVM_SUBPAGE_SIZE);
+ }
+ else
+ { /* First subpage */
+ memcpy((void*)&(subPageTemp[0]),
+ (void*)(APP_NVM_BASE + APP_NVM_SUBPAGE_OFFSET(subPageIdx)),
+ APP_NVM_SUBPAGE_SIZE);
+ memcpy((void*)&subPageTemp[APP_NVM_GENERIC_MODEL_OFFSET],
+ (void*)(clearBuff),
+ APP_NVM_GENERIC_MODEL_SIZE+APP_NVM_LIGHT_MODEL_SIZE);
+ subPageTemp[APP_NVM_VALID_FLAG_OFFSET] = valid;
+
+ result = AppliNvm_FlashProgram(APP_NVM_SUBPAGE_OFFSET(subPageIdx),
+ (uint32_t*)&subPageTemp,
+ APP_NVM_SUBPAGE_SIZE);
}
}
#endif /* SAVE_MODEL_STATE_NVM */
return result;
}
+#if 0
/**
* @brief Load generic states from nvm
* @param generic state buff
@@ -518,32 +427,41 @@ MOBLE_RESULT AppliNvm_ClearModelState(void)
MOBLE_RESULT AppliNvm_LoadGenericState(uint8_t state[], uint8_t* size)
{
#if (SAVE_MODEL_STATE_NVM == 1)
- MOBLEINT8 subPageIdx;
MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
+ MOBLEUINT8 subPageTemp[APP_NVM_SUBPAGE_SIZE];
+ MOBLEINT8 subPageIdx;
result = AppliNvm_FindFirstValidSubPage(&subPageIdx);
-
- if (MOBLE_FAILED(result))
- {
- *size = 0;
- result = MOBLE_RESULT_FAIL;
- }
- else
- {
- /* read saved reset counter from subpage */
- memcpy((void*)state, (void*)(APP_NVM_SUBPAGE_OFFSET(subPageIdx)+APP_NVM_GENERIC_MODEL_OFFSET), APP_NVM_GENERIC_MODEL_SIZE);
- *size = APP_NVM_GENERIC_MODEL_SIZE;
- }
-
- for (MOBLEUINT8 count=0; count<(*size); count++)
+ if (result == MOBLE_RESULT_SUCCESS)
{
- TRACE_M(TF_MISC, "%.2x ", *(state+count));
+ if(subPageIdx > 0)
+ {
+ /* Not the first reset */
+ /* read the previous subpage */
+ memcpy((void*)&(subPageTemp[0]),
+ (void*)(APP_NVM_BASE + APP_NVM_SUBPAGE_OFFSET(subPageIdx-1)),
+ APP_NVM_SUBPAGE_SIZE);
+
+ memcpy((void*)&(state[0]),
+ (void*)&(subPageTemp[APP_NVM_GENERIC_MODEL_OFFSET]),
+ APP_NVM_GENERIC_MODEL_SIZE);
+ *size = APP_NVM_GENERIC_MODEL_SIZE;
+ }
+ else
+ {
+ /* read the current subpage */
+ memcpy((void*)&(subPageTemp[0]),
+ (void*)(APP_NVM_BASE + APP_NVM_SUBPAGE_OFFSET(subPageIdx)),
+ APP_NVM_SUBPAGE_SIZE);
+
+ memcpy((void*)&(state[0]),
+ (void*)&(subPageTemp[APP_NVM_GENERIC_MODEL_OFFSET]),
+ APP_NVM_GENERIC_MODEL_SIZE);
+ *size = APP_NVM_GENERIC_MODEL_SIZE;
+ }
}
-
- TRACE_M(TF_MISC,"\r\n");
-
return result;
-#else
+#else /* SAVE_MODEL_STATE_NVM */
*size = 0;
return MOBLE_RESULT_SUCCESS;
#endif /* SAVE_MODEL_STATE_NVM */
@@ -558,34 +476,165 @@ MOBLE_RESULT AppliNvm_LoadGenericState(uint8_t state[], uint8_t* size)
MOBLE_RESULT AppliNvm_LoadLightState(uint8_t state[], uint8_t* size)
{
#if (SAVE_MODEL_STATE_NVM == 1)
- MOBLEINT8 subPageIdx;
+// MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
+//
+// memcpy((void*)state, (void*)(AppliNvm_Reqs.modelData+APP_NVM_GENERIC_MODEL_SIZE), APP_NVM_LIGHT_MODEL_SIZE);
+// *size = APP_NVM_GENERIC_MODEL_SIZE;
+//
+// return result;
MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
+ MOBLEUINT8 subPageTemp[APP_NVM_SUBPAGE_SIZE];
+ MOBLEINT8 subPageIdx;
result = AppliNvm_FindFirstValidSubPage(&subPageIdx);
-
- if (MOBLE_FAILED(result))
+ if (result == MOBLE_RESULT_SUCCESS)
{
- *size = 0;
- result = MOBLE_RESULT_FAIL;
+ if(subPageIdx > 1)
+ {
+ /* Not the first reset */
+ /* read the previous subpage */
+ memcpy((void*)&(subPageTemp[0]),
+ (void*)(APP_NVM_BASE + APP_NVM_SUBPAGE_OFFSET(subPageIdx-1)),
+ APP_NVM_SUBPAGE_SIZE);
+
+ memcpy((void*)&(state[0]),
+ (void*)&(subPageTemp[APP_NVM_LIGHT_MODEL_OFFSET]),
+ APP_NVM_LIGHT_MODEL_SIZE);
+ *size = APP_NVM_LIGHT_MODEL_SIZE;
+ }
+ else
+ {
+ /* read the current subpage */
+ memcpy((void*)&(subPageTemp[0]),
+ (void*)(APP_NVM_BASE + APP_NVM_SUBPAGE_OFFSET(subPageIdx)),
+ APP_NVM_SUBPAGE_SIZE);
+
+ memcpy((void*)&(state[0]),
+ (void*)&(subPageTemp[APP_NVM_LIGHT_MODEL_OFFSET]),
+ APP_NVM_LIGHT_MODEL_SIZE);
+ *size = APP_NVM_LIGHT_MODEL_SIZE;
+ }
}
- else
- {
- /* read saved reset counter from subpage */
- memcpy((void*)state, (void*)(APP_NVM_SUBPAGE_OFFSET(subPageIdx)+APP_NVM_LIGHT_MODEL_OFFSET), APP_NVM_LIGHT_MODEL_SIZE);
- *size = APP_NVM_LIGHT_MODEL_SIZE;
+ return result;
+#else /* SAVE_MODEL_STATE_NVM */
+ *size = 0;
+ return MOBLE_RESULT_SUCCESS;
+#endif /* SAVE_MODEL_STATE_NVM */
}
+#endif
- for (MOBLEUINT8 count=0; count<(*size); count++)
- {
- TRACE_M(TF_MISC, "%.2x ", *(state+count));
- }
-
- TRACE_M(TF_MISC,"\r\n");
+/**
+* @brief Load Model states from nvm
+* @param model state buff
+* @param model state buff size
+* @retval MOBLE_RESULT_SUCCESS on success
+*/
+MOBLE_RESULT AppliNvm_LoadModelState(uint8_t state[], uint8_t* size)
+{
+#if (SAVE_MODEL_STATE_NVM == 1)
+ MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
+
+ memcpy((void*)state, (void*)(AppliNvm_Reqs.modelData), APP_NVM_MODEL_SIZE);
+ *size = APP_NVM_MODEL_SIZE;
return result;
-#else
+#else /* SAVE_MODEL_STATE_NVM */
*size = 0;
return MOBLE_RESULT_SUCCESS;
#endif /* SAVE_MODEL_STATE_NVM */
}
+/**
+* @brief Process NVM erase and write requests
+* @param void
+* @retval void
+*/
+void AppliNvm_Process(void)
+{
+ MOBLE_RESULT result;
+ MOBLEINT8 subPageIdx;
+ uint8_t reserveAreaCopy[APP_NVM_RESERVED_SIZE];
+
+ /* Erase if required */
+ if (AppliNvm_Reqs.erasePageReq == MOBLE_TRUE)
+ {
+ /* save reserve flash area */
+ memcpy((void*)reserveAreaCopy, (void*)APP_NVM_BASE, APP_NVM_RESERVED_SIZE);
+
+ result = MoblePalNvmErase(APP_NVM_BASE, 0);
+
+ if (result == MOBLE_RESULT_SUCCESS)
+ {
+ AppliNvm_Reqs.erasePageReq = MOBLE_FALSE;
+ AppliNvm_Reqs.writeReq = MOBLE_TRUE;
+ /* restore reserve area */
+/* FLASH_ProgramWordBurst(APP_NVM_BASE, (uint32_t*)reserveAreaCopy); */
+ result = AppliNvm_FlashProgram(0,
+ (uint32_t*)&reserveAreaCopy,
+ APP_NVM_RESERVED_SIZE);
+ if (result == MOBLE_RESULT_SUCCESS)
+ {
+ AppliNvm_Reqs.writeReq = MOBLE_FALSE;
+ }
+ }
+ }
+
+ if (AppliNvm_Reqs.erasePageReq == MOBLE_FALSE
+ && AppliNvm_Reqs.writeReq == MOBLE_TRUE)
+ {
+ result = AppliNvm_FindFirstValidSubPage(&subPageIdx);
+ if (result == MOBLE_RESULT_SUCCESS)
+ {
+ MOBLEUINT8 subPageTemp[APP_NVM_SUBPAGE_SIZE];
+ MOBLEUINT32 valid = 0;
+
+ if(subPageIdx > 0)
+ {
+ /* Not the first reset */
+ /* read the previous subpage */
+ memcpy((void*)&(subPageTemp[0]),
+ (void*)(APP_NVM_BASE + APP_NVM_SUBPAGE_OFFSET(subPageIdx-1)),
+ APP_NVM_SUBPAGE_SIZE);
+ }
+ else
+ {
+ /* read the current subpage */
+ memcpy((void*)&(subPageTemp[0]),
+ (void*)(APP_NVM_BASE + APP_NVM_SUBPAGE_OFFSET(subPageIdx)),
+ APP_NVM_SUBPAGE_SIZE);
+ }
+
+ memcpy((void*)&(subPageTemp[APP_NVM_GENERIC_MODEL_OFFSET]),
+ (void*)&(AppliNvm_Reqs.modelData),
+ APP_NVM_GENERIC_MODEL_SIZE+APP_NVM_LIGHT_MODEL_SIZE);
+
+ subPageTemp[APP_NVM_VALID_FLAG_OFFSET] = valid;
+
+ result = AppliNvm_FlashProgram(APP_NVM_SUBPAGE_OFFSET(subPageIdx),
+ (uint8_t*)subPageTemp,
+ APP_NVM_SUBPAGE_SIZE);
+
+ if (result == MOBLE_RESULT_SUCCESS)
+ {
+ AppliNvm_Reqs.writeReq = MOBLE_FALSE;
+ }
+ }
+ else
+ {
+ /* do nothing */
+ }
+ }
+}
+
+/**
+* @brief Fuction used to set the flag which is responsible for storing the
+ states in flash.
+* @param void
+* @retval void
+*/
+void AppliNvm_SaveMessageParam (void)
+{
+#ifdef SAVE_MODEL_STATE_FOR_ALL_MESSAGES
+ PowerOnOff_flag = FLAG_SET;
+#endif
+}
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_nvm.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_nvm.h
index c54b04bb0..769dc76ad 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_nvm.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_nvm.h
@@ -48,13 +48,16 @@
/* Exported variables ------------------------------------------------------- */
/* Exported Functions Prototypes ---------------------------------------------*/
-MOBLE_RESULT AppliNvm_FlashProgram(uint32_t TypeProgram, uint32_t Address, uint32_t Data[]);
+MOBLE_RESULT AppliNvm_FlashProgram(MOBLEUINT32 offset, void const *buf, MOBLEUINT32 size);
MOBLE_RESULT AppliNvm_FactorySettingReset(void);
-MOBLE_RESULT AppliNvm_FlashErase(void);
+//MOBLE_RESULT AppliNvm_FlashErase(uint16_t PageNumber);
MOBLE_RESULT AppliNvm_SaveModelState(uint8_t* state, uint8_t size);
MOBLE_RESULT AppliNvm_ClearModelState(void);
-MOBLE_RESULT AppliNvm_LoadGenericState(uint8_t state[], uint8_t* size);
-MOBLE_RESULT AppliNvm_LoadLightState(uint8_t state[], uint8_t* size);
+//MOBLE_RESULT AppliNvm_LoadGenericState(uint8_t state[], uint8_t* size);
+//MOBLE_RESULT AppliNvm_LoadLightState(uint8_t state[], uint8_t* size);
+MOBLE_RESULT AppliNvm_LoadModelState(uint8_t state[], uint8_t* size);
+void AppliNvm_Process(void);
+void AppliNvm_SaveMessageParam (void);
#endif /* __APPLI_NVM_H */
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_sensor.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_sensor.c
index 4ac99a03c..a6634a857 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_sensor.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_sensor.c
@@ -18,11 +18,14 @@
*/
/* Includes ------------------------------------------------------------------*/
+
#include "hal_common.h"
#include "types.h"
#include "sensors.h"
+#include "light_lc.h"
#include "appli_sensor.h"
#include "mesh_cfg.h"
+//#include "LPS25HB.h"
#include "string.h"
#include "common.h"
#include "math.h"
@@ -37,72 +40,51 @@
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
-
-MODEL_Property_IDTableParam_t Property_ID_Table[NUMBER_OF_SENSOR] = {
- {TEMPERATURE_PID},
- {PRESSURE_PID}
-};
-/* Private macro -------------------------------------------------------------*/
-/* Private variables ---------------------------------------------------------*/
-
-/* Sensor Cadence set */
-
-typedef struct
+#if 0
+/**
+* @brief PRESSURE init structure definition
+*/
+PRESSURE_InitTypeDef InitStructure =
{
- MOBLEUINT16 Prop_ID;
- MOBLEUINT16 PositiveTolerance;
- MOBLEUINT16 NegativeTolerance;
- MOBLEUINT8 SamplingFunction;
- MOBLEUINT8 MeasurementPeriod;
- MOBLEUINT8 UpdateInterval;
-}Appli_Sensor_DescriptorStatus_t;
-
-Appli_Sensor_DescriptorStatus_t Appli_Sensor_DescriptorStatus;
+ LPS25HB_ODR_1Hz,
+ LPS25HB_BDU_READ,
+ LPS25HB_DIFF_ENABLE,
+ LPS25HB_SPI_SIM_3W,
+ LPS25HB_P_RES_AVG_32,
+ LPS25HB_T_RES_AVG_16
+};
+#endif
-/* Sensor Setting set */
-typedef struct
-{
- MOBLEUINT16 Property_ID;
- MOBLEUINT16 Sensor_Setting_ID;
- MOBLEUINT8 Sensor_Setting_Access;
- MOBLEUINT16 Sensor_Setting_Value;
-}Appli_Sensor_SettingSet_t;
+/* Application variables of sensor model definition */
+#ifdef ENABLE_SENSOR_MODEL_SERVER
+Appli_Sensor_DescriptorStatus_t Appli_Sensor_DescriptorStatus;
Appli_Sensor_SettingSet_t Appli_Sensor_SettingSet;
-/* structure of flags used for publishing data */
-typedef struct
-{
- MOBLEBOOL CadenceDurationFlag ;
- MOBLEBOOL DeltaDataFlag ;
-}PublishingDataFlag_t;
-
-/* structure for the cadence set */
-typedef struct
-{
- MOBLEUINT16 Property_ID;
- MOBLEUINT8 FastCadenceDevisor;
- MOBLEUINT8 StatusTriggerType;
- MOBLEUINT8 triggerDeltaDown;
- MOBLEUINT8 triggerDeltaUp;
- MOBLEUINT8 StatusMinInterval;
- float FastCadenceLow;
- float FastCadenceHigh;
-}Sensor_CadenceSet_t;
-
-extern MOBLEUINT8 NumberOfElements;
-extern MOBLEUINT8 ProvisionFlag;
-
/* By Default value used for cadence set for testing. */
Sensor_CadenceSet_t Sensor_CadenceSet[NUMBER_OF_SENSOR] = {
{0x0071 , 0x2 , 2 , 2 ,2 ,0 ,0X05 , 0x64},
{0x2A6D , 0x2 , 1 , 1 , 1, 0, 0X258 , 0x3ED}
};
+#endif
+
+MODEL_Property_IDTableParam_t Property_ID_Table[NUMBER_OF_SENSOR] =
+{
+ {TEMPERATURE_PID},
+ {PRESSURE_PID}
+};
+MOBLEUINT8 Occupancy_Flag = MOBLE_FALSE;
+extern MOBLEUINT8 NumberOfElements;
+extern MOBLEUINT8 ProvisionFlag;
/* Temperature and Pressure init structure*/
+#if 0
+ PRESSURE_DrvTypeDef* xLPS25HBDrv = &LPS25HBDrv;
+#endif
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
+#ifdef ENABLE_SENSOR_MODEL_SERVER
/**
* @brief Appli_Sensor_Cadence_Set: This function is callback for Application
@@ -163,8 +145,6 @@ MOBLE_RESULT Appli_Sensor_Setting_Set(Sensor_SettingParam_t* pSensor_SettingPara
return MOBLE_RESULT_SUCCESS;
}
-
-#ifdef ENABLE_SENSOR_MODEL_SERVER
/**
* @brief Appli_Sensor_Data_Status: This function is callback for Application
when sensor get message is received
@@ -181,11 +161,11 @@ MOBLE_RESULT Appli_Sensor_Data_Status(MOBLEUINT8* sensor_Data , MOBLEUINT32* pLe
MOBLEUINT32 pressureData = 0;
MOBLEUINT8 data_Length = 0x03;
-/*
+#if 0
LPS25HB_GetTemperature((float*)&temperatureData);
LPS25HB_GetPressure((float*)&pressureData);
-*/
+#endif
result = Check_Property_ID(Property_ID_Table , prop_ID);
@@ -236,8 +216,8 @@ MOBLE_RESULT Appli_Sensor_Data_Status(MOBLEUINT8* sensor_Data , MOBLEUINT32* pLe
/* No Comments */
}
- TRACE_M(TF_SENSOR,"the temperature reading from sender in hex 0x%08x \n\r ", temperatureData);
- TRACE_M(TF_SENSOR,"the pressure reading from sender in hex 0x%08x \n\r", pressureData );
+ TRACE_M(TF_SENSOR,"the temperature reading from sender in hex 0x%08lx \n\r ", temperatureData);
+ TRACE_M(TF_SENSOR,"the pressure reading from sender in hex 0x%08lx \n\r", pressureData );
return MOBLE_RESULT_SUCCESS;
}
@@ -252,34 +232,40 @@ when sensor descriptor get message is received
*/
MOBLE_RESULT Appli_Sensor_Descriptor_Status(MOBLEUINT8* sensor_Descriptor , MOBLEUINT32* pLength)
{
- Appli_Sensor_DescriptorStatus_t Appli_Sensor_DescriptorStatus1[] = {{PRESSURE_PID,0x00,0x00,0x00,0x00,0x00},
- {TEMPERATURE_PID,0x00,0x00,0x00,0x00,0x00}};
+ Appli_Sensor_DescriptorStatus_t Appli_Sensor_DescriptorStatus1[] = {{PRESSURE_PID,0xABC,0xDEF,0x03,0x04,0x05},
+ {TEMPERATURE_PID,0xc56,0xd78,0x06,0x07,0x08}};
+ MOBLEUINT32 tolerance;
+ tolerance = Appli_Sensor_DescriptorStatus1[0].NegativeTolerance;
+ tolerance = (tolerance << 12 ) | Appli_Sensor_DescriptorStatus1[0].PositiveTolerance;
*(sensor_Descriptor) = Appli_Sensor_DescriptorStatus1[0].Prop_ID;
*(sensor_Descriptor+1) = Appli_Sensor_DescriptorStatus1[0].Prop_ID >> 8;
- *(sensor_Descriptor+2) = Appli_Sensor_DescriptorStatus1[0].PositiveTolerance;
- *(sensor_Descriptor+3) = Appli_Sensor_DescriptorStatus1[0].PositiveTolerance >> 8;
- *(sensor_Descriptor+4) = Appli_Sensor_DescriptorStatus1[0].NegativeTolerance;
- *(sensor_Descriptor+5) = Appli_Sensor_DescriptorStatus1[0].NegativeTolerance >> 8;
- *(sensor_Descriptor+6) = Appli_Sensor_DescriptorStatus1[0].SamplingFunction;
- *(sensor_Descriptor+7) = Appli_Sensor_DescriptorStatus1[0].MeasurementPeriod;
- *(sensor_Descriptor+8) = Appli_Sensor_DescriptorStatus1[0].UpdateInterval;
+ *(sensor_Descriptor+2) = tolerance;
+ *(sensor_Descriptor+3) = tolerance >> 8;
+ *(sensor_Descriptor+4) = tolerance >> 16;
+ *(sensor_Descriptor+5) = Appli_Sensor_DescriptorStatus1[0].SamplingFunction;
+ *(sensor_Descriptor+6) = Appli_Sensor_DescriptorStatus1[0].MeasurementPeriod;
+ *(sensor_Descriptor+7) = Appli_Sensor_DescriptorStatus1[0].UpdateInterval;
- *(sensor_Descriptor+9) = Appli_Sensor_DescriptorStatus1[1].Prop_ID;
- *(sensor_Descriptor+10) = Appli_Sensor_DescriptorStatus1[1].Prop_ID >> 8;
- *(sensor_Descriptor+11) = Appli_Sensor_DescriptorStatus1[1].PositiveTolerance;
- *(sensor_Descriptor+12) = Appli_Sensor_DescriptorStatus1[1].PositiveTolerance >> 8;
- *(sensor_Descriptor+13) = Appli_Sensor_DescriptorStatus1[1].NegativeTolerance;
- *(sensor_Descriptor+14) = Appli_Sensor_DescriptorStatus1[1].NegativeTolerance >> 8;
- *(sensor_Descriptor+15) = Appli_Sensor_DescriptorStatus1[1].SamplingFunction;
- *(sensor_Descriptor+16) = Appli_Sensor_DescriptorStatus1[1].MeasurementPeriod;
- *(sensor_Descriptor+17) = Appli_Sensor_DescriptorStatus1[1].UpdateInterval;
+ tolerance = Appli_Sensor_DescriptorStatus1[1].NegativeTolerance;
+ tolerance = (tolerance << 12 ) | Appli_Sensor_DescriptorStatus1[1].PositiveTolerance ;
+
+ *(sensor_Descriptor+8) = Appli_Sensor_DescriptorStatus1[1].Prop_ID;
+ *(sensor_Descriptor+9) = Appli_Sensor_DescriptorStatus1[1].Prop_ID >> 8;
+ *(sensor_Descriptor+10) = tolerance;
+ *(sensor_Descriptor+11) = tolerance >> 8;
+ *(sensor_Descriptor+12) = tolerance >> 16;
+ *(sensor_Descriptor+13) = Appli_Sensor_DescriptorStatus1[1].SamplingFunction;
+ *(sensor_Descriptor+14) = Appli_Sensor_DescriptorStatus1[1].MeasurementPeriod;
+ *(sensor_Descriptor+15) = Appli_Sensor_DescriptorStatus1[1].UpdateInterval;
*pLength = 18;
return MOBLE_RESULT_SUCCESS;
}
+#endif
+
/**
* @brief Sensor Process function
* @param Function will continuously monitor the sensors.
@@ -288,29 +274,74 @@ Function used for the Publishing, data monitoring..
*/
void Sensor_Process(void)
{
+
+#ifdef ENABLE_SENSOR_PUBLICATION
float sensorValue[NUMBER_OF_SENSOR];
if(ProvisionFlag == 1)
{
Read_Sensor_Data(&sensorValue[0]);
Sensor_Publication_Process(&sensorValue[0], &Property_ID_Table[0]);
}
+#endif
+/* Occupancy_Flag become True when ever sensor detect occupancy and get interrupt
+ and make flag True to run this routine.
+*/
+ if(Occupancy_Flag == MOBLE_TRUE)
+ {
+ if(BLE_waitPeriod(CONTROLLER_WAIT_TIME))
+ {
+/* publishing the command for LC Light occupancy set message in the sensor status
+ message .
+*/
+ Sensor_LC_Light_Publish();
+ Occupancy_Flag = MOBLE_FALSE;
+ }
+ }
}
/**
+* @brief Function check for the couupancy in the location and send the status
+ message with the ocuppancy value, when the interrupt is detected.
+* @param void
+* @retval void
+*/
+void Sensor_LC_Light_Publish(void)
+{
+ MOBLE_ADDRESS publishAddress;
+ MOBLEUINT8 elementNumber;
+ MOBLEUINT8 occupancyData = 0x1;
+ MOBLEUINT8 sensor_Data[5];
+
+ sensor_Data[1] = (MOBLEUINT8)(LIGHT_CONTROL_LIGHTNESS_ON_ID << 8);
+ sensor_Data[0] = (MOBLEUINT8)LIGHT_CONTROL_LIGHTNESS_ON_ID;
+ sensor_Data[2] = occupancyData;
+
+ elementNumber = BLE_GetElementNumber();
+ publishAddress = BLEMesh_GetPublishAddress(elementNumber);
+
+ BLEMesh_SetRemoteData(publishAddress, 0,
+ SENSOR_STATUS ,
+ sensor_Data,3,
+ MOBLE_FALSE, MOBLE_FALSE);
+
+}
+
+#if defined ENABLE_SENSOR_PUBLICATION && defined ENABLE_SENSOR_MODEL_SERVER
+/**
* @brief Function read the particular sensor value which are called inside.
* @param pSensorValue: pointer to the sensor data array.
* @retval void
*/
void Read_Sensor_Data(float *pSensorValue)
{
- /*
+#if 0
float temp,press;
- LPS25HB_GetTemperature(&temp);
- pSensorValue[0] = temp;
- LPS25HB_GetPressure(&press);
- pSensorValue[1] = press;
- */
+ LPS25HB_GetTemperature(&temp);
+ pSensorValue[0] = temp;
+ LPS25HB_GetPressure(&press);
+ pSensorValue[1] = press;
+#endif
}
/**
@@ -355,7 +386,9 @@ void Sensor_Publication_Process(float* pSensorData, MODEL_Property_IDTableParam_
if((pSensorData[sensor_Count] >= (previousDataValue[sensor_Count] + Sensor_CadenceSet[sensor_Count].triggerDeltaUp)) ||
(pSensorData[sensor_Count] <= (previousDataValue[sensor_Count] - Sensor_CadenceSet[sensor_Count].triggerDeltaDown)))
{
- SensorDataPublish((MOBLEUINT32*)&pSensorData[sensor_Count] , &pProp_ID[sensor_Count].Property_ID);
+ MOBLEUINT16 prop_id = pProp_ID[sensor_Count].Property_ID;
+
+ SensorDataPublish((MOBLEUINT32*)&pSensorData[sensor_Count] , &prop_id);
PublishingDataFlag[sensor_Count].DeltaDataFlag = MOBLE_FALSE;
TRACE_M(TF_SENSOR,"previous value data %.3f \r\n",previousDataValue[sensor_Count]);
@@ -377,7 +410,9 @@ void Sensor_Publication_Process(float* pSensorData, MODEL_Property_IDTableParam_
if(((Clock_Time()- cadenceDurationTick[sensor_Count]) >= publishTime))
{
- SensorDataPublish((MOBLEUINT32*)&pSensorData[sensor_Count] , &pProp_ID[sensor_Count].Property_ID);
+ MOBLEUINT16 prop_id = pProp_ID[sensor_Count].Property_ID;
+
+ SensorDataPublish((MOBLEUINT32*)&pSensorData[sensor_Count] , &prop_id);
PublishingDataFlag[sensor_Count].CadenceDurationFlag = MOBLE_FALSE;
TRACE_M(TF_SENSOR,"Cadence publication of data %.2f \r\n",*((float*)&pSensorData[sensor_Count]));
sensor_Count++;
@@ -389,7 +424,9 @@ void Sensor_Publication_Process(float* pSensorData, MODEL_Property_IDTableParam_
if(((Clock_Time()- cadenceDurationTick[sensor_Count]) >= SENSOR_PUBLISH_PERIOD))
{
- SensorDataPublish((MOBLEUINT32*)&pSensorData[sensor_Count] , &pProp_ID[sensor_Count].Property_ID);
+ MOBLEUINT16 prop_id = pProp_ID[sensor_Count].Property_ID;
+
+ SensorDataPublish((MOBLEUINT32*)&pSensorData[sensor_Count] , &prop_id);
PublishingDataFlag[sensor_Count].CadenceDurationFlag = MOBLE_FALSE;
TRACE_M(TF_SENSOR,"Regular publication of data %.3f \r\n",*((float*)&pSensorData[sensor_Count]));
@@ -469,7 +506,9 @@ void SensorDataPublish(MOBLEUINT32 *pSensor_Value , MOBLEUINT16* pProp_ID)
}
+#endif
+#ifdef ENABLE_SENSOR_MODEL_SERVER
/**
* @brief Appli_Sensor_GetSettingStatus: This function is callback for Application
when sensor setting numbers status message is to be provided
@@ -507,6 +546,15 @@ MOBLE_RESULT Appli_Sensor_GetSetting_IDStatus(MOBLEUINT8* pSetting_Status)
return MOBLE_RESULT_SUCCESS;
}
+#endif
+
+/**
+* @brief Check_Property_ID: This function is used for checking the Property id
+of sensor available in table.
+* @param prop_ID_Table: address of the property id table array.
+* @param prop_ID:received property id of sensor.
+* @retval MOBLE_RESULT
+*/
MOBLE_RESULT Check_Property_ID(const MODEL_Property_IDTableParam_t prop_ID_Table[]
, MOBLEUINT16 prop_ID)
{
@@ -531,12 +579,12 @@ Application interface
*/
MOBLE_RESULT Appli_Sensor_Init(void)
{
- //LPS25HB_Init(&InitStructure);
-
+#if 0
+ LPS25HB_Init(&InitStructure);
+#endif
return MOBLE_RESULT_SUCCESS;
}
-#endif
/**
* @}
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_sensor.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_sensor.h
index aacbd6ef9..9e86cf0b1 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_sensor.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_sensor.h
@@ -18,20 +18,65 @@
*/
/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __APPLI_SENSOR_MODEL_H
-#define __APPLI_SENSOR_MODEL_H
+#ifndef __APPLI_SENSOR_H
+#define __APPLI_SENSOR_H
/* Includes ------------------------------------------------------------------*/
#include "types.h"
/* Exported macro ------------------------------------------------------------*/
-/* Exported variables -------------------------------------------------------*/
-/*
- structure for the Property id for the sensors Present inside the firmware.
-*/
+#define CONTROLLER_WAIT_TIME 1000
+/* Exported variables -------------------------------------------------------*/
/* Exported Functions Prototypes ---------------------------------------------*/
+/* Application variables------------------------------------------------------*/
+/* Private variables ---------------------------------------------------------*/
+
+/* Sensor Cadence set */
+#pragma pack(1)
+typedef struct
+{
+ MOBLEUINT16 Prop_ID;
+ MOBLEUINT16 PositiveTolerance;
+ MOBLEUINT16 NegativeTolerance;
+ MOBLEUINT8 SamplingFunction;
+ MOBLEUINT8 MeasurementPeriod;
+ MOBLEUINT8 UpdateInterval;
+}Appli_Sensor_DescriptorStatus_t;
+
+/* Sensor Setting set */
+#pragma pack(1)
+typedef struct
+{
+ MOBLEUINT16 Property_ID;
+ MOBLEUINT16 Sensor_Setting_ID;
+ MOBLEUINT8 Sensor_Setting_Access;
+ MOBLEUINT16 Sensor_Setting_Value;
+}Appli_Sensor_SettingSet_t;
+
+
+/* structure of flags used for publishing data */
+#pragma pack(1)
+typedef struct
+{
+ MOBLEBOOL CadenceDurationFlag ;
+ MOBLEBOOL DeltaDataFlag ;
+}PublishingDataFlag_t;
+
+/* structure for the cadence set */
+#pragma pack(1)
+typedef struct
+{
+ MOBLEUINT16 Property_ID;
+ MOBLEUINT8 FastCadenceDevisor;
+ MOBLEUINT8 StatusTriggerType;
+ MOBLEUINT8 triggerDeltaDown;
+ MOBLEUINT8 triggerDeltaUp;
+ MOBLEUINT8 StatusMinInterval;
+ float FastCadenceLow;
+ float FastCadenceHigh;
+}Sensor_CadenceSet_t;
MOBLE_RESULT Appli_Sensor_Cadence_Set(Sensor_CadenceParam_t* pCadence_param, MOBLEUINT16 property_ID,
MOBLEUINT32 length);
@@ -52,8 +97,9 @@ MOBLE_RESULT Appli_Sensor_GetSettingStatus(MOBLEUINT8* pSetting_Status);
MOBLE_RESULT Appli_Sensor_GetSetting_IDStatus(MOBLEUINT8* pSetting_Status);
MOBLE_RESULT Appli_Sensor_Init(void);
void Sensor_Process(void);
+void Sensor_LC_Light_Publish(void);
-#endif /* __APPLI_SENSOR_MODEL_H */
+#endif /* __APPLI_SENSOR_H */
/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_vendor.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_vendor.c
index 9512b0a86..62cc906ee 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_vendor.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_vendor.c
@@ -17,12 +17,15 @@
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
+#include "ble.h"
#include "hal_common.h"
#include "types.h"
#include "ble_mesh.h"
#include "appli_mesh.h"
#include "vendor.h"
#include "appli_vendor.h"
+#include "common.h"
+#include "appli_light.h"
#include "models_if.h"
#include "mesh_cfg.h"
#include <string.h>
@@ -43,6 +46,9 @@
MOBLEUINT8 ResponseBuffer[8];
MOBLEUINT8 BuffLength;
extern MOBLEUINT8 Appli_LedState;
+extern uint16_t DUTY;
+MOBLEUINT32 TestHitCounter = 0;
+extern Appli_LightPwmValue_t Appli_LightPwmValue;
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
@@ -164,8 +170,8 @@ MOBLE_RESULT Appli_Vendor_Test(MOBLEUINT8 const *data, MOBLEUINT32 length)
{
case APPLI_TEST_ECHO:
{
- memcpy ((ResponseBuffer+1),data,length);
- BuffLength = length+1;
+ memcpy ((ResponseBuffer+1),(data+1),length);
+ BuffLength = length;
break;
}
case APPLI_TEST_RANDOMIZATION_RANGE:
@@ -175,11 +181,42 @@ MOBLE_RESULT Appli_Vendor_Test(MOBLEUINT8 const *data, MOBLEUINT32 length)
}
case APPLI_TEST_COUNTER:
{
+ if((DUTY <= PWM_TIME_PERIOD) && (DUTY > 1))
+ {
+ Appli_LightPwmValue.IntensityValue = LED_OFF_VALUE;
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
+ }
+ else
+ {
+ Appli_LightPwmValue.IntensityValue = PWM_TIME_PERIOD;
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
+ }
+ TRACE_M(TF_VENDOR,"Test Counter is running \r\n");
+ ResponseBuffer[0] = subCmd;
+ ResponseBuffer[1] = Appli_LedState ;
+ BuffLength = 2;
/*Insert Test related Commands here*/
break;
}
case APPLI_TEST_INC_COUNTER:
{
+
+ if((DUTY <= PWM_TIME_PERIOD) && (DUTY > 1))
+ {
+ Appli_LightPwmValue.IntensityValue = LED_OFF_VALUE;
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
+ }
+ else
+ {
+ Appli_LightPwmValue.IntensityValue = PWM_TIME_PERIOD;
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
+ }
+
+ TestHitCounter++;
+ TRACE_M(TF_VENDOR,"Command received Count %.2x \r\n",TestHitCounter);
+ ResponseBuffer[0] = subCmd;
+ ResponseBuffer[1] = Appli_LedState ;
+ BuffLength = 2;
/*Insert Test related Commands here*/
break;
}
@@ -194,6 +231,7 @@ MOBLE_RESULT Appli_Vendor_Test(MOBLEUINT8 const *data, MOBLEUINT32 length)
break;
}
}
+
return status;
}
@@ -211,12 +249,14 @@ MOBLE_RESULT Appli_Vendor_LEDControl( MOBLEUINT8 const *data, MOBLEUINT32 length
MOBLE_RESULT status = MOBLE_RESULT_SUCCESS;
MOBLEUINT8 subCommand;
subCommand = data[0];
+ MOBLEUINT16 duty;
+ MOBLEUINT16 intensityValue = 0;
/* tClockTime delay_t = Clock_Time(); */
switch(subCommand)
{
/*
- Meesage Received B0 B1 B2 B3 B4 B5 B6 B7
+ Message Received B0 B1 B2 B3 B4 B5 B6 B7
B0 - Sub-Cmd LED
B1-B7 - Data Bytes
*/
@@ -228,7 +268,11 @@ MOBLE_RESULT Appli_Vendor_LEDControl( MOBLEUINT8 const *data, MOBLEUINT32 length
}
else if(elementNumber == SECOND_ELEMENT)
{
- /* Toggle the state of the Yellow LED */
+ /* user application code */
+ }
+ else if(elementNumber == THIRD_ELEMENT)
+ {
+ /* user application code */
}
break;
}
@@ -238,12 +282,27 @@ MOBLE_RESULT Appli_Vendor_LEDControl( MOBLEUINT8 const *data, MOBLEUINT32 length
{
if(elementNumber == FIRST_ELEMENT)
{
-
- Appli_LedState = !Appli_LedState; /* Toggle the state of the Blue LED */
+ if((Appli_LightPwmValue.IntensityValue <= PWM_TIME_PERIOD) && (Appli_LightPwmValue.IntensityValue > 1))
+ {
+ Appli_LightPwmValue.IntensityValue = LED_OFF_VALUE;
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
+ BSP_LED_Off(LED_BLUE);
+ }
+ else
+ {
+ Appli_LightPwmValue.IntensityValue = PWM_TIME_PERIOD;
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
+ BSP_LED_On(LED_BLUE);
+ }
+
}
else if(elementNumber == SECOND_ELEMENT)
{
- /* Toggle the state of the Yellow LED */
+ /* user application code */
+ }
+ else if(elementNumber == THIRD_ELEMENT)
+ {
+ /* user application code */
}
break;
}
@@ -252,12 +311,21 @@ MOBLE_RESULT Appli_Vendor_LEDControl( MOBLEUINT8 const *data, MOBLEUINT32 length
{
if(elementNumber == FIRST_ELEMENT)
{
-
- Appli_LedState = 1; /* Switch On the Blue LED */
+ Appli_LightPwmValue.IntensityValue = PWM_TIME_PERIOD;
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue); /* PWM_ID = PWM4, mapped on PWM4_PIN (GPIO_14 in mapping) */
+ BSP_LED_On(LED_BLUE);
+ Appli_LedState = 1;
}
else if(elementNumber == SECOND_ELEMENT)
{
- /* Toggle the state of the Yellow LED */
+ Appli_LightPwmValue.IntensityValue = PWM_TIME_PERIOD;
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue); /* PWM_ID = PWM3, mapped on PWM3_PIN (GPIO_2 in mapping) */
+ BSP_LED_On(LED_BLUE);
+ Appli_LedState = 1;
+ }
+ else if(elementNumber == THIRD_ELEMENT)
+ {
+ /* user application code */
}
break;
}
@@ -266,14 +334,53 @@ MOBLE_RESULT Appli_Vendor_LEDControl( MOBLEUINT8 const *data, MOBLEUINT32 length
{
if(elementNumber == FIRST_ELEMENT)
{
-
- Appli_LedState = 0; /* Switch Off the Blue LED */
+ Appli_LightPwmValue.IntensityValue = LED_OFF_VALUE;
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue); /* PWM_ID = PWM4, mapped on PWM4_PIN (GPIO_14 in mapping) */
+ Appli_LedState = 0;
+ BSP_LED_Off(LED_BLUE);
}
else if(elementNumber == SECOND_ELEMENT)
+ {
+ Appli_LightPwmValue.IntensityValue = LED_OFF_VALUE;
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue); /* PWM_ID = PWM3, mapped on PWM3_PIN (GPIO_2 in mapping) */
+ Appli_LedState = 0;
+ BSP_LED_Off(LED_BLUE);
+ }
+ else if(elementNumber == THIRD_ELEMENT)
{
- /* Switch Off the Yellow LED */
+ /* user application code */
}
-
+
+ break;
+ }
+ /* intensity command */
+ case APPLI_CMD_LED_INTENSITY:
+ {
+ if(elementNumber == FIRST_ELEMENT)
+ {
+ intensityValue = data[2] << 8;
+ intensityValue |= data[1];
+
+ duty = PwmValueMapping(intensityValue , 0x7FFF ,0);
+ Appli_LightPwmValue.IntensityValue = duty;
+ Light_UpdateLedValue(LOAD_STATE , Appli_LightPwmValue);
+ if(duty > 16000)
+ {
+ BSP_LED_On(LED_BLUE);
+ }
+ else
+ {
+ BSP_LED_Off(LED_BLUE);
+ }
+ }
+ else if(elementNumber == SECOND_ELEMENT)
+ {
+ /* user application code */
+ }
+ else if(elementNumber == THIRD_ELEMENT)
+ {
+ /* user application code */
+ }
break;
}
/* Default case - Not valid command */
@@ -286,14 +393,29 @@ MOBLE_RESULT Appli_Vendor_LEDControl( MOBLEUINT8 const *data, MOBLEUINT32 length
/*Buffer will be sent for Reliable Response*/
/*First Byte is Sub Command and 2nd Byte is LED Status*/
ResponseBuffer[0] = subCommand;
- ResponseBuffer[1] = Appli_LedState ;
- BuffLength = 2;
-
- Appli_LedCtrl(); /* Controls the LED State */
+ if(subCommand == APPLI_CMD_LED_INTENSITY)
+ {
+ ResponseBuffer[1] = intensityValue >> 8 ;
+ ResponseBuffer[2] = intensityValue ;
+ BuffLength = 3;
+ }
+ else
+ {
+ ResponseBuffer[1] = Appli_LedState ;
+ BuffLength = 2;
+ }
return status;
}
+void Appli_GetTestValue (MOBLEUINT8 *responseValue)
+{
+ *responseValue = TestHitCounter;
+ *(responseValue+1) = TestHitCounter >> 8;
+ *(responseValue+2) = TestHitCounter >> 16;
+ *(responseValue+3) = TestHitCounter >> 24;
+ TestHitCounter = 0;
+}
/**
* @}
*/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_vendor.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_vendor.h
index 2798ac852..3efba69ed 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_vendor.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/appli_vendor.h
@@ -18,22 +18,25 @@
*/
/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __VENDOR_APPLI_H
-#define __VENDOR_APPLI_H
+#ifndef __APPLI_VENDOR_H
+#define __APPLI_VENDOR_H
/* Includes ------------------------------------------------------------------*/
#include "types.h"
#include "ble_mesh.h"
/* Exported macro ------------------------------------------------------------*/
+#define LED_OFF_VALUE 1U
+#define LED_ON_VALUE 32000U
/* Private define ------------------------------------------------------------*/
MOBLE_RESULT Appli_Vendor_LEDControl( MOBLEUINT8 const *data, MOBLEUINT32 length,
MOBLEUINT8 elementNumber, MOBLE_ADDRESS dst_peer);
MOBLE_RESULT Appli_Vendor_DeviceInfo(MOBLEUINT8 const *data, MOBLEUINT32 length);
MOBLE_RESULT Appli_Vendor_Test(MOBLEUINT8 const *data, MOBLEUINT32 length);
+void Appli_GetTestValue (MOBLEUINT8 *responseValue);
-#endif /* __VENDOR_APPLI_H */
+#endif /* __APPLI_VENDOR_H */
/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/ble_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/ble_conf.h
index 6a258c188..4cc3ce72b 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/ble_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/ble_conf.h
@@ -58,7 +58,7 @@
* This shall take into account all registered handlers
* (from either the provided services or the custom services)
*/
-#define BLE_CFG_SVC_MAX_NBR_CB 5
+#define BLE_CFG_SVC_MAX_NBR_CB 7
#define BLE_CFG_CLT_MAX_NBR_CB 5
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/mesh_cfg.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/mesh_cfg.h
index eea81c61b..6c7fa7965 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/mesh_cfg.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/mesh_cfg.h
@@ -28,30 +28,23 @@
/* Exported macro ------------------------------------------------------------*/
/* Flash parameters */
-#define PAGE_SIZE 2048
+#define PAGE_SIZE 4096
#define RESET_MANAGER_FLASH_BASE_ADDRESS (0x10040000)
-#ifdef TRACE_ENABLE_MODEL
void TraceHeader(const char* func_name, int mode);
#define TraceB0(func_name, ...)
#define TraceB1(func_name, ...) do {TraceHeader(func_name, 0); printf( __VA_ARGS__);} while(0)
#define TraceBX(flags, func_name, ...) TraceB ##flags(func_name, ##__VA_ARGS__)
#define TRACE_M(flag, ...) TraceBX(flag, __func__, ##__VA_ARGS__)
-#else
-#define TRACE_M(flag, ...)
-#endif
/*Enable this Macro to enable the main function prints.
* This trace does not print the function name and clock.
*/
-#ifdef TRACE_ENABLE_NO_FUNCTION
#define TraceC0(...)
#define TraceC1(...) do { printf( __VA_ARGS__);} while(0)
-#define TraceCX(flags, ...) TraceC ##flags( ##__VA_ARGS__)
+//#define TraceCX(flags, ...) TraceC ##flags( ##__VA_ARGS__)
+#define TraceCX(flags, ...) TraceC ##flags( __VA_ARGS__)
#define TRACE_I(flag, ...) TraceCX(flag, ##__VA_ARGS__)
-#else
-#define TRACE_I(flag, ...)
-#endif
#ifdef EXTERNAL_MAC_ADDR_MGMT
@@ -64,6 +57,10 @@ void TraceHeader(const char* func_name, int mode);
#error "Please select atleast one MAC address Option"
#endif
+#ifdef ENABLE_UNPROVISIONING_BY_POWER_ONOFF_CYCLE
+#define ENABLE_SAVE_MODEL_STATE_NVM
+#endif
+
#ifdef ENABLE_SAVE_MODEL_STATE_NVM
#define SAVE_MODEL_STATE_NVM 1
#else
@@ -75,8 +72,24 @@ void TraceHeader(const char* func_name, int mode);
TR_GAP_BETWEEN_TRANSMISSION \
}
+#ifdef ENABLE_PB_ADV
+#define PB_ADV_SUPPORTED 1
+#else
#define PB_ADV_SUPPORTED 0
+#endif
+
+#ifdef ENABLE_PB_GATT
#define PB_GATT_SUPPORTED 1
+#else
+#define PB_GATT_SUPPORTED 0
+#endif
+
+#ifdef ENABLE_PUB_KEY_TYPE_OOB
+#define PUB_KEY_TYPE_OOB MOBLE_TRUE
+#else
+#define PUB_KEY_TYPE_OOB MOBLE_FALSE
+#endif
+
#if (PB_ADV_SUPPORTED == 0 && PB_GATT_SUPPORTED == 0)
#error "Atleast one of PB-ADV and PB-GATT should be defined"
@@ -116,20 +129,50 @@ void TraceHeader(const char* func_name, int mode);
#error "Low power node can't be friend node"
#endif
-#define BLUENRG_MESH_FEATURES (RELAY_FEATURE << 0 | PROXY_FEATURE << 1 | FRIEND_FEATURE << 2)
+#define BLUENRG_MESH_FEATURES (RELAY_FEATURE << 0 | PROXY_FEATURE << 1 | FRIEND_FEATURE << 2 | LOW_POWER_FEATURE << 3)
#define FRIEND_NODE_PARAMS \
{ \
FN_NO_OF_LPNS \
}
+#define LOW_POWER_NODE_PARAMS \
+{ \
+ LPN_RSSI_FACTOR_LEVEL, \
+ LPN_RECIVE_WINDOW_FACTOR_LEVEL, \
+ LPN_MINIMUM_QUEUE_SIZE_LOG, \
+ LPN_RECEIVE_DELAY, \
+ LPN_POLL_TIMEOUT, \
+ LPN_FRIEND_REQUEST_FREQUENCY, \
+ LPN_FRIEND_POLL_FREQUENCY, \
+ LPN_RECEIVE_WINDOW_SIZE, \
+ LPN_SUBSCR_LIST_SIZE, \
+ LPN_MINIMUM_RSSI, \
+ LPN_NO_OF_RETRIES \
+}
-
+/*
+* If PB-GATT and Proxy not supported, optimize related to GATT database not required
+*/
+#if (PB_GATT_SUPPORTED == 0 && PROXY_FEATURE == 0)
+#define BLUENRG_MESH_GATT_REQ 0
+#else
+#define BLUENRG_MESH_GATT_REQ 1
+#endif
#define UNPROV_NODE_INFO_PARAMS \
{ \
+ PUB_KEY_TYPE_OOB, \
+ PubKeyBuff, \
+ PrivKeyBuff, \
STATIC_OOB_SIZE, \
- StaticOobBuff \
+ StaticOobBuff, \
+ OUTPUT_OOB_SIZE, \
+ OUTPUT_OOB_ACTION, \
+ Appli_BleOutputOOBAuthCb, \
+ INPUT_OOB_SIZE, \
+ INPUT_OOB_ACTION, \
+ Appli_BleInputOOBAuthCb \
}
#ifdef ENABLE_NEIGHBOR_TABLE
@@ -170,6 +213,8 @@ void TraceHeader(const char* func_name, int mode);
#if FRIEND_FEATURE
#define FRIEND_BUFF_DYNAMIC_MEMORY_SIZE FN_NO_OF_LPNS*816+4
+#elif LOW_POWER_FEATURE
+#define FRIEND_BUFF_DYNAMIC_MEMORY_SIZE 112U
#else
#define FRIEND_BUFF_DYNAMIC_MEMORY_SIZE 1U
#endif
@@ -179,6 +224,7 @@ void TraceHeader(const char* func_name, int mode);
#define SEGMENTATION_COUNT (MAX_APPLICATION_PACKET_SIZE / 12) + 2
#define SAR_BUFFER_SIZE ((uint8_t)SEGMENTATION_COUNT) * 40
/* Added Interrupt handler for Uart */
+#define SdkEvalComIOUartIrqHandler UART_Handler
#if NEIGHBOR_TABLE_SUPPORTED
#define NEIGHBOR_TABLE_DYNAMIC_MEMORY_SIZE 32U*NEIGHBOR_COUNT
@@ -196,14 +242,14 @@ void TraceHeader(const char* func_name, int mode);
#define ENABLE_SERIAL_INTERFACE 1
#define ENABLE_UT 0
#define ENABLE_SERIAL_CONTROL 1
+#define ENABLE_APPLI_TEST 0
/* Exported variables ------------------------------------------------------- */
extern const DynBufferParam_t DynBufferParam;
extern const tr_params_t TrParams;
extern const lpn_params_t LpnParams;
extern const fn_params_t FnParams;
-extern const unprov_node_info_params_t UnprovNodeInfoParams;
-extern const MOBLEUINT8 StaticOobBuff[STATIC_OOB_SIZE];
+extern const prvn_params_t PrvnParams;
extern const neighbor_table_init_params_t NeighborTableParams;
/* Exported Functions Prototypes ---------------------------------------------*/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/mesh_cfg_usr.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/mesh_cfg_usr.h
index f2594f744..72a069391 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/mesh_cfg_usr.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/mesh_cfg_usr.h
@@ -48,7 +48,8 @@
/* Exported macro ------------------------------------------------------------*/
-/* Macros Used for user defined serial print data for models. Either use 0 to disable or 1 to enable
+/* Macros Used for user defined serial print data for models.
+Either use 0 to disable or 1 to enable
@ TF_GENERIC is responsible for the Generic model traces.
@ TF_LIGHT is responsible for the Light model traces.
@ TF_SENSOR is responsible for the Sensor model traces.
@@ -63,19 +64,20 @@
@ TF_MISC is responsible for the other type traces.
*/
-#define TF_GENERIC 0
-#define TF_LIGHT 0
-#define TF_SENSOR 0
-#define TF_VENDOR 0
-#define TF_NEIGHBOUR 0
-#define TF_PROVISION 1
-#define TF_LPN_FRND 0
-#define TF_ELEMENTS 0
-#define TF_ADDRESS 0
-#define TF_HANDLER 1
-#define TF_INIT 1
-#define TF_MISC 0
-#define TF_SERIAL_CTRL 0
+#define TF_GENERIC 0
+#define TF_LIGHT 0
+#define TF_LIGHT_LC 0
+#define TF_SENSOR 0
+#define TF_VENDOR 0
+#define TF_NEIGHBOUR 0
+#define TF_LPN_FRND 0
+#define TF_ELEMENTS 0
+#define TF_ADDRESS 0
+#define TF_PROVISION 0
+#define TF_HANDLER 0
+#define TF_INIT 0
+#define TF_MISC 0
+#define TF_SERIAL_CTRL 0
/*******************************************************************************
*** Following section helps to select right configuration of Models ***********
@@ -85,10 +87,14 @@
/* Define the following Macros to enable the usage of the Server Generic Models */
#define ENABLE_GENERIC_MODEL_SERVER_ONOFF
#define ENABLE_GENERIC_MODEL_SERVER_LEVEL
-/*
-#define ENABLE_GENERIC_MODEL_SERVER_DEFAULT_TRANSITION_TIME
#define ENABLE_GENERIC_MODEL_SERVER_POWER_ONOFF
#define ENABLE_GENERIC_MODEL_SERVER_POWER_ONOFF_SETUP
+//#define ENABLE_GENERIC_MODEL_SERVER_DEFAULT_TRANSITION_TIME
+
+/* The Following Models are not available in this version, will be developed in
+ next version.
+*/
+/*
#define ENABLE_GENERIC_MODEL_SERVER_POWER_LEVEL
#define ENABLE_GENERIC_MODEL_SERVER_POWER_LEVEL_SETUP
#define ENABLE_GENERIC_MODEL_SERVER_BATTERY
@@ -106,53 +112,112 @@
#define ENABLE_GENERIC_MODEL_CLIENT_LEVEL
*/
-/* Define the following Macros to enable the usage of the Light Models */
+/******************************************************************************/
+/******* Define the following Macros to enable the usage of the Light Models */
+/******************************************************************************/
#define ENABLE_LIGHT_MODEL_SERVER_LIGHTNESS
#define ENABLE_LIGHT_MODEL_SERVER_LIGHTNESS_SETUP
#define ENABLE_LIGHT_MODEL_SERVER_CTL
#define ENABLE_LIGHT_MODEL_SERVER_CTL_SETUP
#define ENABLE_LIGHT_MODEL_SERVER_CTL_TEMPERATURE
-//#define ENABLE_LIGHT_MODEL_SERVER_HSL
-//#define ENABLE_LIGHT_MODEL_SERVER_HSL_SETUP
-//#define ENABLE_LIGHT_MODEL_SERVER_HSL_HUE
-//#define ENABLE_LIGHT_MODEL_SERVER_HSL_SATURATION
+#define ENABLE_LIGHT_MODEL_SERVER_HSL
+#define ENABLE_LIGHT_MODEL_SERVER_HSL_SETUP
+#define ENABLE_LIGHT_MODEL_SERVER_HSL_HUE
+#define ENABLE_LIGHT_MODEL_SERVER_HSL_SATURATION
-/*
-#define ENABLE_LIGHT_MODEL_SERVER_XYL
-#define ENABLE_LIGHT_MODEL_SERVER_XYL_SETUP
+/*
+ The following Models are managed in different file light_lc.c in middleware
+*/
#define ENABLE_LIGHT_MODEL_SERVER_LC
#define ENABLE_LIGHT_MODEL_SERVER_LC_SETUP
+
+/*
+ The Following Models are not available in this version
*/
+//#define ENABLE_LIGHT_MODEL_SERVER_XYL
+//#define ENABLE_LIGHT_MODEL_SERVER_XYL_SETUP
+
+
+/* Following Macro helps to know if the Fixed functions are needed or not
+ DO NOT change or add any space at the end of the file */
+#if defined(ENABLE_LIGHT_MODEL_SERVER_LIGHTNESS) \
+ || defined(ENABLE_LIGHT_MODEL_SERVER_LIGHTNESS_SETUP) \
+ || defined(ENABLE_LIGHT_MODEL_SERVER_CTL) \
+ || defined(ENABLE_LIGHT_MODEL_SERVER_CTL_SETUP) \
+ || defined(ENABLE_LIGHT_MODEL_SERVER_CTL_TEMPERATURE) \
+ || defined(ENABLE_LIGHT_MODEL_SERVER_HSL) \
+ || defined(ENABLE_LIGHT_MODEL_SERVER_HSL_SETUP) \
+ || defined(ENABLE_LIGHT_MODEL_SERVER_HSL_HUE) \
+ || defined(ENABLE_LIGHT_MODEL_SERVER_HSL_SATURATION) \
+ || defined(ENABLE_LIGHT_MODEL_SERVER_LC) \
+ || defined(ENABLE_LIGHT_MODEL_SERVER_LC_SETUP) \
+ || defined(ENABLE_LIGHT_MODEL_SERVER_XYL) \
+ || defined(ENABLE_LIGHT_MODEL_SERVER_XYL_SETUP)
+ #define ENABLE_LIGHT_MODEL_SERVER
+#endif
+
+#if defined(ENABLE_LIGHT_MODEL_SERVER_LC) \
+ || defined(ENABLE_LIGHT_MODEL_SERVER_LC_SETUP)
+ #define ENABLE_LIGHT_LC_MODEL_SERVER
+#endif
+/******************************************************************************/
+/*
+Define the Macros for Enabling/disabling the binding of data between the Generic
+and Light model.
+@ define the Macro for enabling the binding
+@ Undefine or comment the macro for disabling the binding.
+*/
+/******************************************************************************/
+//#define ENABLE_MODEL_BINDING
+
+/******************************************************************************/
/* Define the following Macros to enable the usage of the Sensor Models */
+/******************************************************************************/
+
#define ENABLE_SENSOR_MODEL_SERVER
-//#define ENABLE_SENSOR_MODEL_SERVER_SETUP
+#define ENABLE_SENSOR_MODEL_SERVER_SETUP
+
+/* Define the macros for the numbers of sensor present.*/
+#define NUMBER_OF_SENSOR 2
+#define ENABLE_OCCUPANCY_SENSOR
+/*
+Macro is responsible for enabling and desabling the sensor publication.
+Comment this macro to disable the publication
+*/
+//#define ENABLE_SENSOR_PUBLICATION
+/******************************************************************************/
+/* Define the following Macros to enable the usage of the time and scene Models */
+/******************************************************************************/
+
+//#define ENABLE_TIME_MODEL_SERVER
+//#define ENABLE_TIME_MODEL_SERVER_SETUP
+//#define ENABLE_SCENE_MODEL_SERVER
+//#define ENABLE_SCENE_MODEL_SERVER_SETUP
+
+/******************************************************************************/
/*
Macros are defined to enable the setting for the PWM. these Macros are given for
-custom board of BLE, RGB board and default transition
-inserted in generic on off.
-NOTE- Only one macro must be enabled at one time , otherwise get confliction and
- firmware will not work properly.
+eval board of BlueNRG-1 and BlueNRG-2, costom board and STEVAL-BLUEMIC-1 board
+and default transition inserted in generic on off.
+IMPORTATNT NOTE- STEVAL_BLUENRG_1_BOARD_PWM_SELECTION
+ STEVAL_BLUENRG_2_BOARD_PWM_SELECTION
+ STEVAL_BLUEMIC_1_BOARD_PWM_SELECTION
+ CUSTOM_BOARD_PWM_SELECTION
+ GENERIC_ONOFF_DEFAULT_TRANSITION_ENABLE
+Only one macro must be enabled at one time from list of mocros provided here,
+otherwise get confliction and firmware will not work properly.
*/
+/******************************************************************************/
//#define STEVAL_BLUENRG_1_BOARD_PWM_SELECTION
//#define STEVAL_BLUENRG_2_BOARD_PWM_SELECTION
//#define STEVAL_BLUEMIC_1_BOARD_PWM_SELECTION
//#define CUSTOM_BOARD_PWM_SELECTION
-/* Macro to enable default transition for generic on off message.*/
-//#define GENERIC_ONOFF_DEFAULT_TRANSITION_ENABLE
-
-/*
-Define the Macros for Enabling/disabling the binding of data between the Generic and
-Light model.
-@ define the Macro for enabling the binding
-@ Undefine or comment the macro for disabling the binding.
-*/
-//#define ENABLE_MODEL_BINDING
-
+/******************************************************************************/
/*
Define the Macro for enabling/disabling the Publishing with Generic on off
or by Vendor Model.
@@ -161,25 +226,27 @@ or by Vendor Model.
*/
//#define VENDOR_MODEL_PUBLISH
-/* Define the macros for the numbers of sensor present.*/
-#define NUMBER_OF_SENSOR 2
+/******************************************************************************/
-/*
-Macro is responsible for enabling and desabling the sensor publication.
-Comment this macro to disable the publication
-*/
-//#define ENABLE_SENSOR_PUBLICATION
-/* Define the following Macros to change the step resolution and step count value */
-#define TRANSITION_SCALER 4
+/* Maximum Time period value of PWM */
#define PWM_TIME_PERIOD 31990U
-//#define PWM_DEFAULT_VALUE 10000U
-/* Macros are used to update the PWM state according to the condition. */
-//#define RESUME_STATE 1
-//#define RESET_STATE 2
-//#define DEFAULT_STATE 3
-//#define LOAD_STATE 4
+/******************************************************************************/
+/***** MACROS for POWER ON-OFF CYCLE BASED UNPROVISIONING *********************/
+/******************************************************************************/
+
+/*
+Define the following Macro to check the Power-OnOff Cycles
+5 Continous cycles of OnOff with Ontime <2 sec will cause unprovisioning
+*/
+//#define ENABLE_UNPROVISIONING_BY_POWER_ONOFF_CYCLE
+
+#define POWER_ON_OFF_CYCLES_FOR_UNPROVISIONING 5
+#define MASK_BITS_FOR_POWER_ON_OFF_CYCLES (0xFFFFFFFF << POWER_ON_OFF_CYCLES_FOR_UNPROVISIONING)
+ /* 0xFFFFFFE0 */
+#define ON_TIME_IN_SECONDS_FOR_POWER_CYCLING 2
+#define BLINK_TIMES_FOR_FACTORY_RESET 5
/*
Define the following Macro to save Generic and Light Model states in NVM
@@ -187,24 +254,85 @@ This may result into excessive flash erase operations, this should be avoided to
*/
#define ENABLE_SAVE_MODEL_STATE_NVM
+/* Only one Macro will be enable at one time */
+//#define SAVE_MODEL_STATE_FOR_ALL_MESSAGES
+#define SAVE_MODEL_STATE_POWER_FAILURE_DETECTION
+
+/* Macros defined for the number of bytes saved, number of bytes dedicated for ganeric
+ model and light model.
+*/
+#define APP_NVM_GENERIC_MODEL_SIZE 16U
+#define APP_NVM_LIGHT_MODEL_SIZE 16U
+#define APP_NVM_MODEL_SIZE 40U
+
+/*Macros are defined for the selection of the number of led and type of lighting
+ used for the application.
+*if board has one led, uncomment USER_BOARD_1LED
+*if board has cool warm leds, uncomment USER_BOARD_COOL_WHITE_LED
+*if board has RGB leds, uncomment USER_BOARD_RGB_LED
+*if board has RGB leds as well as cool warm leds, uncomment USER_BOARD_COOL_WHITE_LED
+ and USER_BOARD_RGB_LED
+*/
+/* comment ENABLE_GENERIC_MODEL_SERVER_DEFAULT_TRANSITION_TIME when using
+ USER_BOARD_COOL_WHITE_LED ,USER_BOARD_RGB_LED
+ Default transition is provided only for one led.
+*/
+//#define USER_BOARD_1LED
+//#define USER_BOARD_COOL_WHITE_LED
+#define USER_BOARD_RGB_LED
+
+#if defined(STEVAL_BLUEMIC_1_BOARD_PWM_SELECTION)
+ #define SINGLE_LED PWM1
+#endif
+
+/*******************************************************************************
+*** Following section helps to configure the LEDs of Application of Mesh ***********
+*******************************************************************************/
+
+#if defined STEVAL_BLUENRG_1_BOARD_PWM_SELECTION || defined STEVAL_BLUENRG_2_BOARD_PWM_SELECTION
+ #define SINGLE_LED PWM4
+ #define COOL_LED PWM0
+ #define WARM_LED PWM1
+ #define RED_LED PWM2
+ #define GREEN_LED PWM3
+ #define BLUE_LED PWM4
+#endif
+
+#if defined CUSTOM_BOARD_PWM_SELECTION || defined USE_STM32WBXX_NUCLEO || defined USE_STM32WBXX_USB_DONGLE
+ #define SINGLE_LED PWM4
+ #define COOL_LED PWM0
+ #define WARM_LED PWM1
+ #define RED_LED PWM2
+ #define GREEN_LED PWM3
+ #define BLUE_LED PWM4
+#endif
+
+#ifdef STEVAL_BLUEMIC_1_BOARD_PWM_SELECTION
+ #define SINGLE_LED PWM1
+ #define COOL_LED PWM0
+ #define WARM_LED PWM1
+ #define RED_LED PWM2
+ #define GREEN_LED PWM3
+ #define BLUE_LED PWM4
+#endif
/*******************************************************************************
*** Following section helps to configure the Application of Mesh ***********
*******************************************************************************/
-#define APPLICATION_NUMBER_OF_ELEMENTS 1
+#define APPLICATION_NUMBER_OF_ELEMENTS 1
/* Contains a 16-bit company identifier assigned by the Bluetooth SIG
(the list is available @ https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers )
For STMicroelectronics : it is 0x0030 */
-#define COMPANY_ID 0x0030
+#define COMPANY_ID 0x0030
/* Contains a 16-bit vendor-assigned product identifier */
-#define PRODUCT_ID 0x0001
+#define PRODUCT_ID 0x0001
/* Contains a 16-bit vendor-assigned product version ID */
-#define PRODUCT_VERSION_ID 0x0001
+#define PRODUCT_VERSION_ID 0x0001
-#define MAX_APPLICATION_PACKET_SIZE 160
+#define MAX_APPLICATION_PACKET_SIZE 160
/*******************************************************************************
********** MAC Address Configuration *******************************************
@@ -215,18 +343,17 @@ For STMicroelectronics : it is 0x0030 */
* DONT change the Values 0x01, 0x02, 0x03
* SELECT ONLY One of the Option
*/
-//#define GENERATE_STATIC_RANDOM_MAC 0x01
-//#define EXTERNAL_MAC_ADDR_MGMT 0x02
-#define INTERNAL_UNIQUE_NUMBER_MAC 0x03
+//#define GENERATE_STATIC_RANDOM_MAC 0x01
+//#define EXTERNAL_MAC_ADDR_MGMT 0x02
+#define INTERNAL_UNIQUE_NUMBER_MAC 0x03
/* Declare this value as 0x01 if the External Address is PUBLIC Address */
/* For example like this: #define EXTERNAL_MAC_IS_PUBLIC_ADDR 0x1 */
/* Else, by default, the external address will be treated as RANDOM */
-#define EXTERNAL_MAC_IS_PUBLIC_ADDR 0x0
+#define EXTERNAL_MAC_IS_PUBLIC_ADDR 0x0
/******************************************************************************/
-#define STATIC_OOB_SIZE 16U
/*******************************************************************************
****** Following section helps to select right configuration of node ***********
@@ -235,11 +362,46 @@ For STMicroelectronics : it is 0x0030 */
* Minimum gap between successive transmissions
* varies from 10 to 65535
*/
-#define TR_GAP_BETWEEN_TRANSMISSION 50U
+#define TR_GAP_BETWEEN_TRANSMISSION 50U
/*
-* Different features supported by BLE-Mesh. Uncomment according to application.
+* Different provision bearer supported by BlueNRG-Mesh. Define according to application.
+* Atleast one of PB-ADV and PB-GATT should be defined
+*/
+#define ENABLE_PB_ADV
+#define ENABLE_PB_GATT
+#define ENABLE_PUB_KEY_TYPE_OOB
+#define ENABLE_AUTH_TYPE_STATIC_OOB
+#define ENABLE_AUTH_TYPE_OUTPUT_OOB
+//#define ENABLE_AUTH_TYPE_INPUT_OOB
+
+/* Static OOB Configurations */
+#ifdef ENABLE_AUTH_TYPE_STATIC_OOB
+#define STATIC_OOB_SIZE 16U
+#else
+#define STATIC_OOB_SIZE 0U
+#endif
+/* Output OOB Configurations */
+#ifdef ENABLE_AUTH_TYPE_OUTPUT_OOB
+#define OUTPUT_OOB_SIZE 1U
+#define OUTPUT_OOB_ACTION OUTPUT_OOB_ACTION_BIT_BLINK
+#else
+#define OUTPUT_OOB_SIZE 0U
+#define OUTPUT_OOB_ACTION OUTPUT_OOB_ACTION_BIT_BLINK
+#endif
+
+/* Input OOB Configurations */
+#ifdef ENABLE_AUTH_TYPE_INPUT_OOB
+#define INPUT_OOB_SIZE 1U
+#define INPUT_OOB_ACTION INPUT_OOB_ACTION_BIT_PUSH
+#else
+#define INPUT_OOB_SIZE 0U
+#define INPUT_OOB_ACTION INPUT_OOB_ACTION_BIT_PUSH
+#endif
+
+/*
+* Different features supported by BlueNRG-Mesh. Uncomment according to application.
* Low power feature enabled node do not support other features.
* Do not define any other feature if Low Power feature is defined
*/
@@ -250,7 +412,7 @@ For STMicroelectronics : it is 0x0030 */
/*
-* Friend node receive window size is fixed at 255 ms
+* Friend node receive window size is fixed at 50 ms
*/
/*
@@ -265,12 +427,92 @@ For STMicroelectronics : it is 0x0030 */
* Number of Low power nodes that can be associated with Friend node
* varies from 1 to 10
*/
-#define FN_NO_OF_LPNS 2U
+#define FN_NO_OF_LPNS 2U
+
+/*
+* For prioritizing friendship offer with good RSSI link
+* varies from 0 to 3
+* Ref @Mesh_v1.0
+*/
+#define LPN_RSSI_FACTOR_LEVEL 1U
+
+/*
+* For prioritizing friendship offer with good receive window factor
+* varies from 0 to 3
+* Ref @Mesh_v1.0
+*/
+#define LPN_RECIVE_WINDOW_FACTOR_LEVEL 1U
+
+/*
+* Minimum packets queue size required
+* varies from 1 to 7
+* Ref @Mesh_v1.0
+*/
+#define LPN_MINIMUM_QUEUE_SIZE_LOG 2U
+
+/*
+* (unit ms)
+* varies from 0x0A to 0xFF
+* Ref @Mesh_v1.0
+*/
+#define LPN_RECEIVE_DELAY 150U
+
+/*
+* Poll timeout value after which friendship cease to exist (unit 100ms)
+* varies from 0x00000A to 0x34BBFF
+* Ref @Mesh_v1.0
+*/
+#define LPN_POLL_TIMEOUT 2000U
+
+/*
+* Maximum receive window size acceptable to low power node (unit ms)
+* varies from 10 to 255
+* Ref @Mesh_v1.0
+*/
+#define LPN_RECEIVE_WINDOW_SIZE 55U
+
+/*
+* Minimum friend's subscription list size capability required by lpn
+* varies from 1 to 5
+* Ref @Mesh_v1.0
+*/
+#define LPN_SUBSCR_LIST_SIZE 2U
+
+/*
+* Frequency at which low power node would send friend request (unit 100ms)
+* varies from 0 to 255
+*/
+#define LPN_FRIEND_REQUEST_FREQUENCY 50U
+
+/*
+* Frequency at which low power node would poll friend node (unit 100ms)
+* should be less than poll timeout
+*/
+#define LPN_FRIEND_POLL_FREQUENCY 25U
+
+/*
+* Minimum RSSI required by low power node
+* should be less than equal to -60
+*/
+#define LPN_MINIMUM_RSSI -100
+
+/*
+* Retries to be made by lpn before termination of friendship
+* varies from 2 to 10
+*/
+#define LPN_NO_OF_RETRIES 10U
/*
* Enable or disable neighbor table
* if defined -> enabled
+* If MAC address of neighbor changes it appears as new neighbor
+* Neighbor table update can be triggered (configurable) in following cases
+* On receiving Unprovisioned device beacon
+* On receiving Secure network beacon
+* On receiving Mesh message
+* Message with any TTL
+* Message with TTL = 0
* if not defined -> disabled
*/
#define ENABLE_NEIGHBOR_TABLE
@@ -278,27 +520,27 @@ For STMicroelectronics : it is 0x0030 */
/*
* Size of neighbor table
*/
-#define NEIGHBOR_COUNT 5U
+#define NEIGHBOR_COUNT 5U
/*
* (unit s)
* Duration (wrt appear or last refresh) for which neighbor exists in neighbor table
*/
-#define NEIGHBOR_ALIVE_TIME 20U
+#define NEIGHBOR_ALIVE_TIME 20U
/*
* Enable/disable neighbor table update with unprovisioned device beacon
* 0: Disable neighbor table update with unprovisioned device beacon
* 1: Enable neighbor table update with unprovisioned device beacon
*/
-#define NEIGHBOR_UNPRVND_DEV_BEACON_NTU 0U
+#define NEIGHBOR_UNPRVND_DEV_BEACON_NTU 0U
/*
* Enable/disable neighbor table update with secure network beacon
* 0: Disable neighbor table update with secure network beacon
* 1: Enable neighbor table update with secure network beacon
*/
-#define NEIGHBOR_SECURE_NET_BEACON_NTU 1U
+#define NEIGHBOR_SECURE_NET_BEACON_NTU 1U
/*
* Enable/disable neighbor table update with TTL 0 message
@@ -306,9 +548,9 @@ For STMicroelectronics : it is 0x0030 */
* 1: Enable neighbor table update with messages with 0 TTL
* 2: Enable neighbor table update with messages with any TTL
*/
-#define NEIGHBOR_MSG_TTLX_NTU 1U
+#define NEIGHBOR_MSG_TTLX_NTU 1U
-/* Exported variables ------------------------------------------------------- */
+/* Exported variables -------------------------------------------------------*/
/* Exported Functions Prototypes ---------------------------------------------*/
#endif /* __MESH_CFG_USR_H */
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/models_if.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/models_if.c
index e3f3ec4cc..989d14b7f 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/models_if.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/models_if.c
@@ -33,6 +33,11 @@
#include "appli_nvm.h"
#include "ble_hci_le.h"
#include "models_if.h"
+//#include "bluenrg1_api.h"
+#include "PWM_config.h"
+#include "PWM_handlers.h"
+#include "appli_light_lc.h"
+#include "light_lc.h"
/** @addtogroup BLE_Mesh
* @{
@@ -52,7 +57,7 @@ typedef struct
MOBLEUINT32 length;
} APPLI_SEND_RESPONSE_MODULE;
-
+#pragma pack(1)
typedef struct
{
MOBLEUINT8 packet_count;
@@ -84,7 +89,8 @@ const Appli_Vendor_cb_t VendorAppli_cb =
Appli_Vendor_LEDControl,
Appli_Vendor_DeviceInfo,
Appli_Vendor_Test,
- Appli_LedCtrl
+ Appli_LedCtrl,
+ Appli_GetTestValue
};
__attribute__((aligned(4)))
@@ -96,7 +102,13 @@ const Appli_Generic_cb_t GenericAppli_cb =
/* Generic Level callbacks */
Appli_Generic_Level_Set,
Appli_Generic_LevelDelta_Set,
- Appli_Generic_LevelMove_Set
+ Appli_Generic_LevelMove_Set,
+
+ /* Generic Power on off callbacks */
+ Appli_Generic_PowerOnOff_Set,
+
+ /* Generic Default transition time callbacks */
+ Appli_Generic_DefaultTransitionTime_Set
};
__attribute__((aligned(4)))
@@ -105,9 +117,13 @@ const Appli_Generic_State_cb_t Appli_GenericState_cb =
/* Generic Get On Off status */
Appli_Generic_GetOnOffStatus,
+ Appli_Generic_GetOnOffValue,
/* Generic Get level status */
Appli_Generic_GetLevelStatus,
-
+ /* Generic Get Power on off status */
+ Appli_Generic_GetPowerOnOffStatus,
+ /* Generic Get Default transition time status */
+ Appli_Generic_GetDefaultTransitionStatus
};
__attribute__((aligned(4)))
@@ -125,7 +141,7 @@ const Appli_Light_GetStatus_cb_t Appli_Light_GetStatus_cb =
Appli_Light_GetHslHueStatus,
Appli_Light_GetHslSaturationStatus,
Appli_Light_GetHslHueRange,
- Appli_Light_GetHslSatRange
+ Appli_Light_GetHslSatRange,
};
@@ -152,6 +168,27 @@ const Appli_Light_cb_t LightAppli_cb =
__attribute__((aligned(4)))
+const Appli_Light_Ctrl_cb_t LightLCAppli_cb =
+{
+ /* Light LC mode set callbacks */
+ Appli_LightLC_Mode_Set,
+ Appli_LightLC_OM_Set,
+ Appli_LightLC_OnOff_Set,
+};
+
+__attribute__((aligned(4)))
+const Appli_LightLC_GetStatus_cb_t Appli_LightLC_GetStatus_cb =
+{
+ Appli_LightLC_Get_ModeStatus,
+ Appli_LightLC_Get_OMModeStatus,
+ Appli_LightLC_Get_OnOffStatus,
+ Appli_LightLC_Get_AmbientLuxLevelOutput,
+ Appli_Light_LC_PIRegulatorOutput,
+};
+
+#ifdef ENABLE_SENSOR_MODEL_SERVER
+
+__attribute__((aligned(4)))
const Appli_Sensor_cb_t SensorAppli_cb =
{
/* Sensor Model callbacks */
@@ -168,6 +205,8 @@ const Appli_Sensor_GetStatus_cb_t Appli_Sensor_GetStatus_cb =
Appli_Sensor_GetSetting_IDStatus
};
+#endif
+
__attribute__((aligned(4)))
const MODEL_SIG_cb_t Model_SIG_cb[] =
@@ -177,33 +216,66 @@ const MODEL_SIG_cb_t Model_SIG_cb[] =
GenericModelServer_GetStatusRequestCb,
GenericModelServer_ProcessMessageCb
},
+#ifdef ENABLE_LIGHT_MODEL_SERVER
{
LightModelServer_GetOpcodeTableCb,
LightModelServer_GetStatusRequestCb,
LightModelServer_ProcessMessageCb
},
+#endif
+#if defined(ENABLE_SENSOR_MODEL_SERVER) || defined(ENABLE_SENSOR_MODEL_SERVER_SETUP)
{
SensorModelServer_GetOpcodeTableCb,
SensorModelServer_GetStatusRequestCb,
SensorModelServer_ProcessMessageCb
},
+#endif
+#if defined(ENABLE_TIME_MODEL_SERVER) || defined(ENABLE_SCENE_MODEL_SERVER)
{
Time_SceneModelServer_GetOpcodeTableCb,
Time_SceneModelServer_GetStatusRequestCb,
Time_SceneModelServer_ProcessMessageCb
},
+#endif
+#if defined(ENABLE_LIGHT_MODEL_SERVER_LC) || defined(ENABLE_LIGHT_MODEL_SERVER_LC_SETUP)
+ {
+ Light_LC_ModelServer_GetOpcodeTableCb,
+ Light_LC_ModelServer_GetStatusRequestCb,
+ Light_LC_ModelServer_ProcessMessageCb
+ },
+#endif
{ 0, 0,0 }
};
-/* __attribute__((aligned(4))) const APPLI_SAVE_MODEL_STATE_CB SaveModelState_cb = AppliNvm_SaveModelState; */
+__attribute__((aligned(4))) const APPLI_SAVE_MODEL_STATE_CB SaveModelState_cb = AppliNvm_SaveModelState;
#define MODEL_SIG_COUNT ( ( sizeof(Model_SIG_cb)/sizeof(Model_SIG_cb[0]) - 1 ))
+__attribute__((aligned(4)))
+const MODEL_Vendor_cb_t Model_Vendor_cb[] =
+{
+ {
+ VendorModel_PID1_GetOpcodeTableCb,
+ VendorModel_PID1_GetStatusRequestCb,
+ VendorModel_PID1_ProcessMessageCb
+ },
+ { 0, 0,0 }
+};
+
+#define MODEL_VENDOR_COUNT ( ( sizeof(Model_Vendor_cb)/sizeof(Model_Vendor_cb[0]) - 1 ))
+
extern MOBLEUINT8 NumberOfElements;
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
+void GetApplicationVendorModels(const MODEL_Vendor_cb_t** pModelsTable, MOBLEUINT32* VendorModelscount)
+{
+ *pModelsTable = Model_Vendor_cb ;
+ *VendorModelscount = MODEL_VENDOR_COUNT;
+
+ TRACE_M(TF_VENDOR,"GetApplicationVendorModels \r\n");
+}
/**
* @brief Initialization Commands for Models
@@ -212,24 +284,27 @@ extern MOBLEUINT8 NumberOfElements;
*/
void BLEMesh_ModelsInit(void)
{
-
- /* Callbacks used by BLE-Mesh library */
- BLEMesh_SetVendorCbMap(&vendor_cb);
+ MOBLEUINT8 modelStateLoad_Size;
+ MOBLEUINT8 modelStateLoadBuff[APP_NVM_MODEL_SIZE];
/* Callbacks used by BLE-Mesh Models */
BLEMesh_SetSIGModelsCbMap(Model_SIG_cb, MODEL_SIG_COUNT);
-#if defined ENABLE_GENERIC_MODEL_SERVER_ONOFF || defined ENABLE_LIGHT_MODEL_SERVER_CTL || defined ENABLE_GENERIC_MODEL_SERVER_LEVEL
/* Initialization of PWM value to 1 */
- /* PWM Initialization */
+ Appli_Light_PwmInit();
-#endif
+ /* Load generic model states from nvm */
+ AppliNvm_LoadModelState(modelStateLoadBuff, &modelStateLoad_Size);
+ if (modelStateLoad_Size != 0)
+ {
+ /* update states of generic model */
+ Model_RestoreStates(modelStateLoadBuff, modelStateLoad_Size);
+ }
-#ifdef ENABLE_SENSOR_MODEL_SERVER
+#if defined ENABLE_SENSOR_MODEL_SERVER && !defined CUSTOM_BOARD_PWM_SELECTION
/* Initiallization of sensors */
Appli_Sensor_Init();
-
#endif
}
@@ -243,9 +318,19 @@ void BLEMesh_ModelsProcess(void)
Generic_Process();
Lighting_Process();
Vendor_Process();
-#ifdef ENABLE_SENSOR_PUBLICATION
+/* Define this Macro to enable the publication of sensors data.*/
+#if defined ENABLE_SENSOR_MODEL_SERVER
Sensor_Process();
#endif
+
+#ifdef ENABLE_APPLI_TEST
+ Test_Process();
+#endif
+ ModelSave_Process();
+
+#ifdef ENABLE_LIGHT_MODEL_SERVER_LC
+ Light_control_Process();
+#endif
}
/**
@@ -281,16 +366,11 @@ void BLEMesh_ModelsCommand(void)
if(publishAddress)
{
-#ifndef DISABLE_TRACES
- printf("Published Address is= 0x%2x \n\r", publishAddress);
-#endif
-
+ TRACE_M(TF_ADDRESS,"Published Address is= 0x%2x \n\r", publishAddress);
}
else
{
-#ifndef DISABLE_TRACES
- printf("Publish Address is unassigned!\r\n");
-#endif
+ TRACE_M(TF_ADDRESS,"Publish Address is unassigned!\r\n");
}
#ifdef VENDOR_MODEL_PUBLISH
@@ -374,9 +454,7 @@ void BLEMesh_ModelsDelayPacket(MOBLE_ADDRESS peer,
%DEFAULT_DELAY_PACKET_RANDOM_TIME;
Appli_PendingPackets.head = Appli_PendingPackets.packet;
Appli_PendingPackets.head_index = 0;
-#ifndef DISABLE_TRACES
- printf("Randomized time: %ld\n\r", Appli_PendingPackets.send_time - Clock_Time());
-#endif
+ TRACE_M(TF_MISC, "Randomized time: %d\n\r", Appli_PendingPackets.send_time - Clock_Time());
}
else
{
@@ -421,19 +499,18 @@ void BLEMesh_ModelsSendDelayedPacket(void)
{
for (MOBLEUINT8 count=Appli_PendingPackets.packet_count; count!=0; count--)
{
-#ifndef DISABLE_TRACES
- printf("Sending randomized packets. Packet count: %d \n\r",\
+ TRACE_M(TF_MISC, "Sending randomized packets. Packet count: %d \n\r",\
Appli_PendingPackets.packet_count - count + 1);
-#endif
temp_index = ((Appli_PendingPackets.head_index+MAX_PENDING_PACKETS_QUE_SIZE+1)\
-count)%MAX_PENDING_PACKETS_QUE_SIZE;
ptr = Appli_PendingPackets.packet + temp_index;
- BLEMesh_SendResponse(ptr->peer,
- ptr->dst,
- ptr->command,
- ptr->data,
- ptr->length);
+ VendorModel_SendResponse(VENDOR_STMICRO_CID,
+ ptr->peer,
+ ptr->dst,
+ ptr->command,
+ ptr->data,
+ ptr->length);
}
Appli_PendingPackets.packet_count = 0;
@@ -452,6 +529,9 @@ MOBLEUINT8 BLEMesh_ModelsASCII_To_Char(MOBLEUINT8 tempValue)
return tempValue;
}
+__weak void Test_Process(void)
+{
+}
/**
* @}
*/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/models_if.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/models_if.h
index be510c9b8..59d6ece5e 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/models_if.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/models_if.h
@@ -39,7 +39,7 @@ void BLEMesh_ModelsDelayPacket(MOBLE_ADDRESS peer, MOBLE_ADDRESS dst, MOBLEUINT8
MOBLEUINT8 const * data, MOBLEUINT32 length);
void BLEMesh_ModelsSendDelayedPacket(void);
MOBLEUINT8 BLEMesh_ModelsASCII_To_Char(MOBLEUINT8 tempValue);
-#endif /* __MESH_MODELS_H */
+#endif /* __MODELS_H */
/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/pal_nvm.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/pal_nvm.c
new file mode 100644
index 000000000..329ca553d
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/STM32_WPAN/app/pal_nvm.c
@@ -0,0 +1,487 @@
+/**
+ ******************************************************************************
+ * @file pal_nvm.c
+ * @author BLE Mesh Team
+ * @brief Flash management for the Controller
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+******************************************************************************
+*/
+
+/* Includes ------------------------------------------------------------------*/
+#include "types.h"
+#include "pal_nvm.h"
+#include "pal_if.h"
+#include <string.h>
+
+#include "ble.h"
+#include "shci.h"
+
+/* Private define ------------------------------------------------------------*/
+#define NVM_SIZE 0x00002000
+#define FLASH_SECTOR_SIZE 0x1000
+#define MAX_NVM_PENDING_WRITE_REQS 1
+
+/* Private variables ---------------------------------------------------------*/
+typedef struct
+{
+ MOBLEUINT16 offset;
+ MOBLEUINT16 size;
+ void const *buff;
+} BNRGM_NVM_WRITE;
+
+typedef struct
+{
+ MOBLEUINT8 no_of_pages_to_be_erased;
+ MOBLEUINT8 no_of_write_reqs;
+ MOBLEBOOL backup_req;
+ BNRGM_NVM_WRITE write_req[MAX_NVM_PENDING_WRITE_REQS];
+} BNRGM_NVM_REQS;
+
+BNRGM_NVM_REQS BnrgmNvmReqs = {0};
+
+/* Private functions ---------------------------------------------------------*/
+/**
+ * @brief Gets the page of a given address
+ * @param Addr: Address of the FLASH Memory
+ * @retval The page of a given address
+ */
+static MOBLEUINT32 GetPage(MOBLEUINT32 Addr)
+{
+ MOBLEUINT32 page = 0;
+
+ if (Addr < (FLASH_BASE + FLASH_BANK_SIZE))
+ {
+ /* Bank 1 */
+ page = (Addr - FLASH_BASE) / FLASH_PAGE_SIZE;
+ }
+ else
+ {
+ /* Bank 2 */
+ page = (Addr - (FLASH_BASE + FLASH_BANK_SIZE)) / FLASH_PAGE_SIZE;
+ }
+
+ return page;
+}
+
+#if 0
+/**
+* @brief PalNvmErase
+* @param None
+* @retval Result
+*/
+MOBLE_RESULT PalNvmErase(MOBLEUINT32 address,
+ MOBLEUINT32 offset)
+{
+ HAL_StatusTypeDef status = HAL_OK;
+ uint32_t pageError = 0;
+
+// printf("PalNvmErase >>>\r\n");
+
+ FLASH_EraseInitTypeDef erase;
+ erase.TypeErase = FLASH_TYPEERASE_PAGES;
+ erase.Page = GetPage(address + offset); /* 126 or 127 */;
+ erase.NbPages = FLASH_SECTOR_SIZE >> 12;
+
+ while( LL_HSEM_1StepLock( HSEM, CFG_HW_FLASH_SEMID ) );
+ HAL_FLASH_Unlock();
+ __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_WRPERR | FLASH_FLAG_OPTVERR);
+
+ SHCI_C2_FLASH_EraseActivity( ERASE_ACTIVITY_ON);
+
+ while(LL_FLASH_IsActiveFlag_OperationSuspended());
+ status = HAL_FLASHEx_Erase(&erase, &pageError);
+ while(LL_FLASH_IsActiveFlag_OperationSuspended());
+
+ SHCI_C2_FLASH_EraseActivity( ERASE_ACTIVITY_OFF);
+
+ HAL_FLASH_Lock();
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_FLASH_SEMID, 0 );
+
+// printf("PalNvmErase <<<\r\n");
+
+ return status == HAL_OK ? MOBLE_RESULT_SUCCESS : MOBLE_RESULT_FAIL;
+}
+#endif
+
+/**
+* @brief returns NVM write protect status
+* @param None
+* @retval TRUE if flash is write protected
+*/
+MOBLEBOOL MoblePalNvmIsWriteProtected(void)
+{
+ /* All flash is writable */
+ return MOBLE_FALSE;
+}
+
+/**
+* @brief Read NVM
+* @param address: read start address of nvm
+* @param offset: offset read start address of nvm
+* @param buf: copy of read content
+* @param size: size of memory to be read
+* @param backup: If read from backup memory
+* @retval Result of read operation
+*/
+MOBLE_RESULT MoblePalNvmRead(MOBLEUINT32 address,
+ MOBLEUINT32 offset,
+ void *buf,
+ MOBLEUINT32 size,
+ MOBLEBOOL backup)
+{
+ MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
+
+// printf("MoblePalNvmRead >>>\r\n");
+
+ if (offset > NVM_SIZE)
+ {
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else if (size == 0)
+ {
+ result = MOBLE_RESULT_FALSE;
+ }
+ else if (offset + size > NVM_SIZE)
+ {
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else
+ {
+ memcpy(buf, (void *)(address + offset), size);
+ }
+
+// printf("MoblePalNvmRead <<<\r\n");
+ return result;
+}
+
+/**
+* @brief Compare with NVM
+* @param offset: start address of nvm to compare
+* @param offset: offset start address of nvm
+* @param buf: copy of content
+* @param size: size of memory to be compared
+* @param comparison: outcome of comparison
+* @retval Result
+*/
+MOBLE_RESULT MoblePalNvmCompare(MOBLEUINT32 address,
+ MOBLEUINT32 offset,
+ void const *buf,
+ MOBLEUINT32 size,
+ MOBLE_NVM_COMPARE* comparison)
+{
+ MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
+
+// printf("MoblePalNvmCompare >>>\r\n");
+
+ if ((comparison == NULL) || (buf == NULL))
+ {
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else if (offset > NVM_SIZE)
+ {
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else if (size == 0)
+ {
+ result = MOBLE_RESULT_FALSE;
+ }
+ else if (offset + size > NVM_SIZE)
+ {
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else if (offset & 3)
+ {
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else if (size & 3)
+ {
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else
+ {
+ *comparison = MOBLE_NVM_COMPARE_EQUAL;
+ size >>= 3;
+
+ uint64_t* src = (uint64_t*)buf;
+ uint64_t* dst = (uint64_t*)(address + offset);
+
+ for (MOBLEUINT32 i=0; i<size; ++i)
+ {
+ if ((src[i<<3] != dst[i<<3]) && (*comparison == MOBLE_NVM_COMPARE_EQUAL))
+ {
+ *comparison = MOBLE_NVM_COMPARE_NOT_EQUAL;
+ }
+ if ((src[i<<3] & dst[i<<3]) != dst[i<<3])
+ {
+ *comparison = MOBLE_NVM_COMPARE_NOT_EQUAL_ERASE;
+ break;
+ }
+ }
+ }
+
+// printf("MoblePalNvmCompare <<<\r\n");
+
+ return result;
+}
+
+/**
+* @brief Erase NVM
+* @param None
+* @retval Result
+*/
+MOBLE_RESULT MoblePalNvmErase(MOBLEUINT32 address,
+ MOBLEUINT32 offset)
+{
+#if 0
+ if (BnrgmNvmReqs.no_of_pages_to_be_erased == 0)
+ {
+ BnrgmNvmReqs.no_of_pages_to_be_erased = BNRGM_NVM_SIZE/PAGE_SIZE;
+ }
+
+ return MOBLE_RESULT_SUCCESS;
+#else
+ HAL_StatusTypeDef status = HAL_OK;
+ uint32_t pageError = 0;
+
+// printf("MoblePalNvmErase >>>\r\n");
+
+ FLASH_EraseInitTypeDef erase;
+ erase.TypeErase = FLASH_TYPEERASE_PAGES;
+ erase.Page = GetPage(address + offset); /* 126 or 127 */;
+ erase.NbPages = FLASH_SECTOR_SIZE >> 12;
+
+ while( LL_HSEM_1StepLock( HSEM, CFG_HW_FLASH_SEMID ) );
+ HAL_FLASH_Unlock();
+ __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_WRPERR | FLASH_FLAG_OPTVERR);
+
+// SHCI_C2_FLASH_EraseActivity( ERASE_ACTIVITY_ON);
+
+ while(LL_FLASH_IsActiveFlag_OperationSuspended());
+ status = HAL_FLASHEx_Erase(&erase, &pageError);
+ while(LL_FLASH_IsActiveFlag_OperationSuspended());
+
+// SHCI_C2_FLASH_EraseActivity( ERASE_ACTIVITY_OFF);
+
+ HAL_FLASH_Lock();
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_FLASH_SEMID, 0 );
+
+// printf("MoblePalNvmErase <<<\r\n");
+
+ return status == HAL_OK ? MOBLE_RESULT_SUCCESS : MOBLE_RESULT_FAIL;
+#endif
+}
+
+/**
+* @brief Write to NVM
+* @param offset: wrt start address of nvm
+* @param offset: offset wrt start address of nvm
+* @param buf: copy of write content
+* @param size: size of memory to be written
+* @retval Result
+*/
+MOBLE_RESULT MoblePalNvmWrite(MOBLEUINT32 address,
+ MOBLEUINT32 offset,
+ void const *buf,
+ MOBLEUINT32 size)
+{
+ MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
+
+// printf("MoblePalNvmWrite >>>\r\n");
+
+ if (offset > NVM_SIZE)
+ {
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else if (size == 0)
+ {
+ result = MOBLE_RESULT_FALSE;
+ }
+ else if (offset + size > NVM_SIZE)
+ {
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else if (offset & 3)
+ {
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else if (size & 3)
+ {
+ result = MOBLE_RESULT_INVALIDARG;
+ }
+ else
+ {
+#if 0
+ /* Check for repeated write request */
+ for (MOBLEUINT8 count = 0; count < BnrgmNvmReqs.no_of_write_reqs; count++)
+ {
+ if ((BnrgmNvmReqs.write_req[count].offset == (MOBLEUINT16)offset) &&
+ (BnrgmNvmReqs.write_req[count].size == (MOBLEUINT16)size) &&
+ (BnrgmNvmReqs.write_req[count].buff == buf))
+ {
+ return result;
+ }
+ }
+
+ if (BnrgmNvmReqs.no_of_write_reqs < MAX_NVM_PENDING_WRITE_REQS)
+ {
+ BnrgmNvmReqs.write_req[BnrgmNvmReqs.no_of_write_reqs].offset = (MOBLEUINT16)offset;
+ BnrgmNvmReqs.write_req[BnrgmNvmReqs.no_of_write_reqs].size = (MOBLEUINT16)size;
+ BnrgmNvmReqs.write_req[BnrgmNvmReqs.no_of_write_reqs].buff = buf;
+ BnrgmNvmReqs.no_of_write_reqs++;
+ }
+ /* If pending write requests already full, overwrite oldest one */
+ else
+ {
+ for (MOBLEINT8 count=0; count<MAX_NVM_PENDING_WRITE_REQS-2; count++)
+ {
+ BnrgmNvmReqs.write_req[count].offset = BnrgmNvmReqs.write_req[count+1].offset;
+ BnrgmNvmReqs.write_req[count].size = BnrgmNvmReqs.write_req[count+1].size;
+ BnrgmNvmReqs.write_req[count].buff = BnrgmNvmReqs.write_req[count+1].buff;
+ }
+
+ BnrgmNvmReqs.write_req[MAX_NVM_PENDING_WRITE_REQS - 1].offset = (MOBLEUINT16)offset;
+ BnrgmNvmReqs.write_req[MAX_NVM_PENDING_WRITE_REQS - 1].size = (MOBLEUINT16)size;
+ BnrgmNvmReqs.write_req[MAX_NVM_PENDING_WRITE_REQS - 1].buff = buf;
+ }
+#else
+ size >>= 3;
+
+ uint64_t* src = (uint64_t*)buf;
+// uint64_t* dst = (uint64_t*)(address + offset);
+
+ HAL_StatusTypeDef status = HAL_OK;
+
+ while( LL_HSEM_1StepLock( HSEM, CFG_HW_FLASH_SEMID ) );
+ HAL_FLASH_Unlock();
+ __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_WRPERR | FLASH_FLAG_OPTVERR);
+ for (size_t i = 0; (i < size) && (status == HAL_OK); i++)
+ {
+// if (src[i<<3] != dst[i<<3])
+// {
+ while(LL_FLASH_IsActiveFlag_OperationSuspended());
+ status = HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLEWORD, address + offset + (i <<3), src[i]);
+ if (status != HAL_OK)
+ {
+ break;
+ }
+// }
+ }
+ HAL_FLASH_Lock();
+ LL_HSEM_ReleaseLock( HSEM, CFG_HW_FLASH_SEMID, 0 );
+
+ if (HAL_OK != status)
+ {
+ result = MOBLE_RESULT_FAIL;
+ }
+#endif
+ }
+// printf("MoblePalNvmWrite <<<\r\n");
+
+ return result;
+}
+
+#if 0
+/**
+* @brief Backup process
+* @param None
+* @retval Result
+*/
+static MOBLE_RESULT BnrgmPalNvmBackupProcess(void)
+{
+ MOBLEUINT32 buff[4*N_BYTES_WORD];
+ static MOBLEUINT8 backup_pages_to_be_erased = 0;
+ MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
+
+ if (backup_pages_to_be_erased == 0)
+ {
+ backup_pages_to_be_erased = 1;
+ }
+
+ if(backup_pages_to_be_erased != 0)
+ {
+#if 0
+ BluenrgMesh_StopAdvScan();
+ ATOMIC_SECTION_BEGIN();
+ if(BluenrgMesh_IsFlashReadyToErase())
+ {
+ FLASH_ErasePage((uint16_t)((BNRGM_NVM_BACKUP_BASE - RESET_MANAGER_FLASH_BASE_ADDRESS) / PAGE_SIZE +
+ BNRGM_NVM_BACKUP_SIZE/PAGE_SIZE - backup_pages_to_be_erased));
+
+ if (FLASH_GetFlagStatus(Flash_CMDERR) == SET)
+ {
+ result = MOBLE_RESULT_FAIL;
+ }
+ else
+ {
+ backup_pages_to_be_erased--;
+ }
+ }
+ else
+ {
+ /* do nothing */
+ }
+ ATOMIC_SECTION_END();
+#else
+ result = PalNvmErase(NVM_BASE, FLASH_SECTOR_SIZE);
+ if(result == MOBLE_RESULT_SUCCESS)
+ backup_pages_to_be_erased = 0;
+#endif
+ }
+
+ if (result == MOBLE_RESULT_SUCCESS && backup_pages_to_be_erased == 0)
+ {
+#if 0
+ BluenrgMesh_StopAdvScan();
+ ATOMIC_SECTION_BEGIN();
+ if(BluenrgMesh_IsFlashReadyToErase())
+ {
+ for (size_t i = 0; i < BNRGM_NVM_BACKUP_SIZE && FLASH_GetFlagStatus(Flash_CMDERR) == RESET; )
+ {
+ memcpy((MOBLEUINT8*)buff, (void *)(BNRGM_NVM_BASE + i), 4*N_BYTES_WORD);
+ FLASH_ProgramWordBurst(BNRGM_NVM_BACKUP_BASE + i, (uint32_t*)buff);
+ i += 4*N_BYTES_WORD;
+ }
+
+ if (FLASH_GetFlagStatus(Flash_CMDERR) == SET)
+ {
+ result = MOBLE_RESULT_FAIL;
+ }
+ else
+ {
+ BnrgmNvmReqs.backup_req = MOBLE_FALSE;
+ }
+ }
+ else
+ {
+ /* do nothing */
+ }
+ ATOMIC_SECTION_END();
+#else
+#endif
+ }
+ return result;
+}
+#endif
+
+/**
+* @brief NVM process
+* @param None
+* @retval Result
+*/
+MOBLE_RESULT BnrgmPalNvmProcess(void)
+{
+ /* do nothing */
+ return MOBLE_RESULT_SUCCESS;
+}
+
+/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/Production/.cproject b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/BLE_Lighting_Demo/.cproject
index fa404989a..20e75fef1 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/Production/.cproject
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/BLE_Lighting_Demo/.cproject
@@ -17,16 +17,16 @@
<configuration artifactExtension="elf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" errorParsers="org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.GCCErrorParser" id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.255252984" name="Debug" parent="fr.ac6.managedbuild.config.gnu.cross.exe.debug" postannouncebuildStep="Generating binary and Printing size information:" postbuildStep="arm-none-eabi-objcopy -O ihex &quot;${BuildArtifactFileBaseName}.elf&quot; &quot;${BuildArtifactFileBaseName}.hex&quot; &amp;&amp; arm-none-eabi-size &quot;${BuildArtifactFileName}&quot;" preannouncebuildStep="" prebuildStep="">
<folderInfo id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.255252984." name="/" resourcePath="">
<toolChain errorParsers="" id="fr.ac6.managedbuild.toolchain.gnu.cross.exe.debug.1957562278" name="Ac6 STM32 MCU GCC" superClass="fr.ac6.managedbuild.toolchain.gnu.cross.exe.debug">
- <option id="fr.ac6.managedbuild.option.gnu.cross.prefix.1265148026" name="Prefix" superClass="fr.ac6.managedbuild.option.gnu.cross.prefix" value="arm-none-eabi-" valueType="string"/>
- <option id="fr.ac6.managedbuild.option.gnu.cross.mcu.1799716565" name="Mcu" superClass="fr.ac6.managedbuild.option.gnu.cross.mcu" value="STM32WB55CGUx" valueType="string"/>
- <option id="fr.ac6.managedbuild.option.gnu.cross.board.509449639" name="Board" superClass="fr.ac6.managedbuild.option.gnu.cross.board" value="P-NUCLEO-WB55.USBDONGLE" valueType="string"/>
- <option id="fr.ac6.managedbuild.option.gnu.cross.core.1083960614" name="Core" superClass="fr.ac6.managedbuild.option.gnu.cross.core" valueType="stringList">
+ <option id="fr.ac6.managedbuild.option.gnu.cross.prefix.1265148026" name="Prefix" superClass="fr.ac6.managedbuild.option.gnu.cross.prefix" useByScannerDiscovery="false" value="arm-none-eabi-" valueType="string"/>
+ <option id="fr.ac6.managedbuild.option.gnu.cross.mcu.1799716565" name="Mcu" superClass="fr.ac6.managedbuild.option.gnu.cross.mcu" useByScannerDiscovery="false" value="STM32WB55CGUx" valueType="string"/>
+ <option id="fr.ac6.managedbuild.option.gnu.cross.board.509449639" name="Board" superClass="fr.ac6.managedbuild.option.gnu.cross.board" useByScannerDiscovery="false" value="P-NUCLEO-WB55.USBDONGLE" valueType="string"/>
+ <option id="fr.ac6.managedbuild.option.gnu.cross.core.1083960614" name="Core" superClass="fr.ac6.managedbuild.option.gnu.cross.core" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value="ARM Cortex-M4"/>
<listOptionValue builtIn="false" value="CM4"/>
</option>
- <option id="fr.ac6.managedbuild.option.gnu.cross.instructionSet.1003520235" name="Instruction Set" superClass="fr.ac6.managedbuild.option.gnu.cross.instructionSet" value="fr.ac6.managedbuild.option.gnu.cross.instructionSet.thumbII" valueType="enumerated"/>
- <option id="fr.ac6.managedbuild.option.gnu.cross.fpu.34648766" name="Floating point hardware" superClass="fr.ac6.managedbuild.option.gnu.cross.fpu" value="fr.ac6.managedbuild.option.gnu.cross.fpu.fpv4-sp-d16" valueType="enumerated"/>
- <option id="fr.ac6.managedbuild.option.gnu.cross.floatabi.2011975885" name="Floating-point ABI" superClass="fr.ac6.managedbuild.option.gnu.cross.floatabi" value="fr.ac6.managedbuild.option.gnu.cross.floatabi.softfp" valueType="enumerated"/>
+ <option id="fr.ac6.managedbuild.option.gnu.cross.instructionSet.1003520235" name="Instruction Set" superClass="fr.ac6.managedbuild.option.gnu.cross.instructionSet" useByScannerDiscovery="false" value="fr.ac6.managedbuild.option.gnu.cross.instructionSet.thumbII" valueType="enumerated"/>
+ <option id="fr.ac6.managedbuild.option.gnu.cross.fpu.34648766" name="Floating point hardware" superClass="fr.ac6.managedbuild.option.gnu.cross.fpu" useByScannerDiscovery="false" value="fr.ac6.managedbuild.option.gnu.cross.fpu.fpv4-sp-d16" valueType="enumerated"/>
+ <option id="fr.ac6.managedbuild.option.gnu.cross.floatabi.2011975885" name="Floating-point ABI" superClass="fr.ac6.managedbuild.option.gnu.cross.floatabi" useByScannerDiscovery="false" value="fr.ac6.managedbuild.option.gnu.cross.floatabi.softfp" valueType="enumerated"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="fr.ac6.managedbuild.targetPlatform.gnu.cross.60872405" isAbstract="false" osList="all" superClass="fr.ac6.managedbuild.targetPlatform.gnu.cross"/>
<builder buildPath="${workspace_loc:/Production}/Debug" errorParsers="org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.CWDLocator" id="fr.ac6.managedbuild.builder.gnu.cross.714815385" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="fr.ac6.managedbuild.builder.gnu.cross">
<outputEntries>
@@ -55,7 +55,7 @@
<listOptionValue builtIn="false" value="../../../../../../../../Drivers/BSP/P-NUCLEO-WB55.USBDongle"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Inc"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread"/>
- <listOptionValue builtIn="false" value="../../../STM32_WPAN/App"/>
+ <listOptionValue builtIn="false" value="../../../STM32_WPAN/app"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_USB_Device_Library/Core/Inc"/>
@@ -117,16 +117,16 @@
<inputType id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.s.554991843" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.s"/>
</tool>
<tool command="gcc" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GLDErrorParser" id="fr.ac6.managedbuild.tool.gnu.cross.c.linker.171061538" name="MCU GCC Linker" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.linker">
- <option id="fr.ac6.managedbuild.tool.gnu.cross.c.linker.script.2071516110" name="Linker Script (-T)" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.linker.script" value="../stm32wb55xx_flash_cm4.ld" valueType="string"/>
+ <option id="fr.ac6.managedbuild.tool.gnu.cross.c.linker.script.2071516110" name="Linker Script (-T)" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.linker.script" useByScannerDiscovery="false" value="../stm32wb55xx_flash_cm4.ld" valueType="string"/>
<option id="gnu.c.link.option.libs.1535080069" name="Libraries (-l)" superClass="gnu.c.link.option.libs" useByScannerDiscovery="false" valueType="libs">
<listOptionValue builtIn="false" value=":libBle_Mesh_CM4_GCC.a"/>
<listOptionValue builtIn="false" value=":libSTM32CryptographicV3.0.0_CM4_GCC.a"/>
</option>
- <option id="gnu.c.link.option.paths.1802107777" name="Library search path (-L)" superClass="gnu.c.link.option.paths" valueType="libPaths">
+ <option id="gnu.c.link.option.paths.1802107777" name="Library search path (-L)" superClass="gnu.c.link.option.paths" useByScannerDiscovery="false" valueType="libPaths">
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble/mesh/Library"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble/cryptographic/Lib"/>
</option>
- <option id="gnu.c.link.option.ldflags.1867259756" name="Linker flags" superClass="gnu.c.link.option.ldflags" value="-specs=nosys.specs -specs=nano.specs" valueType="string"/>
+ <option id="gnu.c.link.option.ldflags.1867259756" name="Linker flags" superClass="gnu.c.link.option.ldflags" useByScannerDiscovery="false" value="-specs=nosys.specs -specs=nano.specs" valueType="string"/>
<option id="gnu.c.link.option.other.1754275742" name="Other options (-Xlinker [option])" superClass="gnu.c.link.option.other" useByScannerDiscovery="false"/>
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1713532778" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
@@ -152,7 +152,7 @@
</tool>
<tool id="fr.ac6.managedbuild.tool.gnu.archiver.2070690614" name="MCU GCC Archiver" superClass="fr.ac6.managedbuild.tool.gnu.archiver"/>
<tool command="as" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GASErrorParser" id="fr.ac6.managedbuild.tool.gnu.cross.assembler.1608008158" name="MCU GCC Assembler" superClass="fr.ac6.managedbuild.tool.gnu.cross.assembler">
- <option id="gnu.both.asm.option.include.paths.2031495593" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths"/>
+ <option id="gnu.both.asm.option.include.paths.2031495593" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" useByScannerDiscovery="false"/>
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1172292769" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
<inputType id="fr.ac6.managedbuild.tool.gnu.cross.assembler.input.1143744392" superClass="fr.ac6.managedbuild.tool.gnu.cross.assembler.input"/>
</tool>
@@ -177,8 +177,8 @@
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope" versionNumber="2">
- <configuration artifactName="${ProjName}" configurationName="Debug">
- <resource resourceType="PROJECT" workspacePath="Production"/>
+ <configuration configurationName="Debug">
+ <resource resourceType="PROJECT" workspacePath="/Production"/>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/BLE_Lighting_Demo/.project b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/BLE_Lighting_Demo/.project
new file mode 100644
index 000000000..ed0339e7a
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/BLE_Lighting_Demo/.project
@@ -0,0 +1,434 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>BLE_Lighting_Demo</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+ <triggers>clean,full,incremental,</triggers>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+ <triggers>full,incremental,</triggers>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+ <nature>fr.ac6.mcu.ide.core.MCUProjectNature</nature>
+ </natures>
+ <linkedResources>
+ <link>
+ <name>Doc/readme.txt</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/readme.txt</locationURI>
+ </link>
+ <link>
+ <name>Utilities/stm32_lpm.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Utilities/lpm/tiny_lpm/stm32_lpm.c</locationURI>
+ </link>
+ <link>
+ <name>Utilities/stm32_seq.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Utilities/sequencer/stm32_seq.c</locationURI>
+ </link>
+ <link>
+ <name>Application/Core/app_debug.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/Core/Src/app_debug.c</locationURI>
+ </link>
+ <link>
+ <name>Application/Core/app_entry.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/Core/Src/app_entry.c</locationURI>
+ </link>
+ <link>
+ <name>Application/Core/hw_timerserver.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/Core/Src/hw_timerserver.c</locationURI>
+ </link>
+ <link>
+ <name>Application/Core/hw_uart.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/Core/Src/hw_uart.c</locationURI>
+ </link>
+ <link>
+ <name>Application/Core/main.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/Core/Src/main.c</locationURI>
+ </link>
+ <link>
+ <name>Application/Core/stm32_lpm_if.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/Core/Src/stm32_lpm_if.c</locationURI>
+ </link>
+ <link>
+ <name>Application/Core/stm32wbxx_it.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/Core/Src/stm32wbxx_it.c</locationURI>
+ </link>
+ <link>
+ <name>Application/SW4STM32/startup_stm32wb55xx_cm4.s</name>
+ <type>1</type>
+ <locationURI>PARENT-1-PROJECT_LOC/startup_stm32wb55xx_cm4.s</locationURI>
+ </link>
+ <link>
+ <name>Application/SW4STM32/syscalls.c</name>
+ <type>1</type>
+ <locationURI>PARENT-1-PROJECT_LOC/syscalls.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/CMSIS/system_stm32wbxx.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/Core/Src/system_stm32wbxx.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_cortex.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_cortex.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_dma.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_dma.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_flash.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_flash.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_flash_ex.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_flash_ex.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_gpio.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_gpio.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_i2c.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_i2c.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_i2c_ex.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_i2c_ex.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_pcd.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pcd.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_pcd_ex.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pcd_ex.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_pwr.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pwr.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_pwr_ex.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pwr_ex.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_rcc.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rcc.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_rcc_ex.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rcc_ex.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_rtc.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rtc.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_rtc_ex.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rtc_ex.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_uart.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_uart.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_uart_ex.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_uart_ex.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_tim.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_tim.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_tim_ex.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_tim_ex.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_ll_usb.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_ll_usb.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_USB_Device_Library/usbd_cdc.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_USB_Device_Library/usbd_core.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_USB_Device_Library/usbd_ctlreq.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_USB_Device_Library/usbd_ioreq.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c</locationURI>
+ </link>
+ <link>
+ <name>Application/STM32_WPAN/app/app_ble.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/STM32_WPAN/app/app_ble.c</locationURI>
+ </link>
+ <link>
+ <name>Application/STM32_WPAN/app/appli_generic.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/STM32_WPAN/app/appli_generic.c</locationURI>
+ </link>
+ <link>
+ <name>Application/STM32_WPAN/app/appli_light.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/STM32_WPAN/app/appli_light.c</locationURI>
+ </link>
+ <link>
+ <name>Application/STM32_WPAN/app/appli_mesh.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/STM32_WPAN/app/appli_mesh.c</locationURI>
+ </link>
+ <link>
+ <name>Application/STM32_WPAN/app/appli_sensor.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/STM32_WPAN/app/appli_sensor.c</locationURI>
+ </link>
+ <link>
+ <name>Application/STM32_WPAN/app/appli_vendor.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/STM32_WPAN/app/appli_vendor.c</locationURI>
+ </link>
+ <link>
+ <name>Application/STM32_WPAN/app/models_if.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/STM32_WPAN/app/models_if.c</locationURI>
+ </link>
+ <link>
+ <name>Application/STM32_WPAN/app/appli_light_lc.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/STM32_WPAN/app/appli_light_lc.c</locationURI>
+ </link>
+ <link>
+ <name>Application/STM32_WPAN/app/appli_nvm.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/STM32_WPAN/app/appli_nvm.c</locationURI>
+ </link>
+ <link>
+ <name>Application/STM32_WPAN/app/pal_nvm.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/STM32_WPAN/app/pal_nvm.c</locationURI>
+ </link>
+ <link>
+ <name>Application/STM32_WPAN/app/PWM_config.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/STM32_WPAN/app/PWM_config.c</locationURI>
+ </link>
+ <link>
+ <name>Application/STM32_WPAN/app/PWM_handlers.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/STM32_WPAN/app/PWM_handlers.c</locationURI>
+ </link>
+ <link>
+ <name>Application/STM32_WPAN/target/hw_ipcc.c</name>
+ <type>1</type>
+ <locationURI>PARENT-2-PROJECT_LOC/STM32_WPAN/target/hw_ipcc.c</locationURI>
+ </link>
+ <link>
+ <name>Drivers/BSP/P-NUCLEO-WB55.USBDongle/stm32wbxx_usb_dongle.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Drivers/BSP/P-NUCLEO-WB55.USBDongle/stm32wbxx_usb_dongle.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/utilities/dbg_trace.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/utilities/dbg_trace.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/utilities/otp.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/utilities/otp.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/utilities/stm_list.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/utilities/stm_list.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/utilities/stm_queue.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/utilities/stm_queue.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/ble/blesvc/common.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/common.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/ble/blesvc/generic.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/generic.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/ble/blesvc/light.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/light.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/ble/blesvc/mesh.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/svc/Src/mesh.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/ble/blesvc/mesh_cfg.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/mesh/Src/mesh_cfg.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/ble/blesvc/sensors.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/sensors.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/ble/blesvc/svc_ctl.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/svc/Src/svc_ctl.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/ble/blesvc/time_scene.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/time_scene.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/ble/blesvc/vendor.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/vendor.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/ble/blesvc/light_lc.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/light_lc.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/ble/core/ble_gap_aci.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_gap_aci.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/ble/core/ble_gatt_aci.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_gatt_aci.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/ble/core/ble_hal_aci.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_hal_aci.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/ble/core/ble_hci_le.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_hci_le.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/ble/core/ble_l2cap_aci.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_l2cap_aci.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/ble/core/osal.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/core/template/osal.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/interface/patterns/ble_thread/shci/shci.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci/shci.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/interface/patterns/ble_thread/tl/hci_tl.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/hci_tl.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/interface/patterns/ble_thread/tl/hci_tl_if.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/hci_tl_if.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/interface/patterns/ble_thread/tl/shci_tl.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/shci_tl.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/interface/patterns/ble_thread/tl/shci_tl_if.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/shci_tl_if.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/interface/patterns/ble_thread/tl/tl_mbox.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_mbox.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/interface/patterns/ble_thread/vcp/usbd_conf.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/vcp/usbd_conf.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/interface/patterns/ble_thread/vcp/usbd_desc.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/vcp/usbd_desc.c</locationURI>
+ </link>
+ <link>
+ <name>Middlewares/STM32_WPAN/interface/patterns/ble_thread/vcp/vcp.c</name>
+ <type>1</type>
+ <locationURI>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/vcp/vcp.c</locationURI>
+ </link>
+ </linkedResources>
+</projectDescription>
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/Production/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/BLE_Lighting_Demo/stm32wb55xx_flash_cm4.ld
index a9ccd801e..a9ccd801e 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/Production/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/BLE_Lighting_Demo/stm32wb55xx_flash_cm4.ld
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/Production/.project b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/Production/.project
deleted file mode 100644
index 6b0d36da9..000000000
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/SW4STM32/Production/.project
+++ /dev/null
@@ -1,398 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><projectDescription>
- <name>Production</name>
- <comment/>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
- <triggers>clean,full,incremental,</triggers>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
- <triggers>full,incremental,</triggers>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.cdt.core.cnature</nature>
- <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
- <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
- <nature>fr.ac6.mcu.ide.core.MCUProjectNature</nature>
- </natures>
- <linkedResources>
- <link>
- <name>Application/SW4STM32/syscalls.c</name>
- <type>1</type>
- <location>PARENT-1-PROJECT_LOC/syscalls.c</location>
- </link><link>
- <name>Application/SW4STM32/startup_stm32wb55xx_cm4.s</name>
- <type>1</type>
- <location>PARENT-1-PROJECT_LOC/startup_stm32wb55xx_cm4.s</location>
- </link>
-
- <link>
- <name>Application/Core/app_debug.c</name>
- <type>1</type>
- <location>PARENT-2-PROJECT_LOC/Core/Src/app_debug.c</location>
- </link>
- <link>
- <name>Application/Core/app_entry.c</name>
- <type>1</type>
- <location>PARENT-2-PROJECT_LOC/Core/Src/app_entry.c</location>
- </link>
- <link>
- <name>Application/Core/hw_timerserver.c</name>
- <type>1</type>
- <location>PARENT-2-PROJECT_LOC/Core/Src/hw_timerserver.c</location>
- </link>
- <link>
- <name>Application/Core/hw_uart.c</name>
- <type>1</type>
- <location>PARENT-2-PROJECT_LOC/Core/Src/hw_uart.c</location>
- </link>
- <link>
- <name>Application/Core/main.c</name>
- <type>1</type>
- <location>PARENT-2-PROJECT_LOC/Core/Src/main.c</location>
- </link>
- <link>
- <name>Application/Core/stm32_lpm_if.c</name>
- <type>1</type>
- <location>PARENT-2-PROJECT_LOC/Core/Src/stm32_lpm_if.c</location>
- </link>
- <link>
- <name>Application/Core/stm32wbxx_it.c</name>
- <type>1</type>
- <location>PARENT-2-PROJECT_LOC/Core/Src/stm32wbxx_it.c</location>
- </link>
- <link>
- <name>Application/STM32_WPAN/app/app_ble.c</name>
- <type>1</type>
- <location>PARENT-2-PROJECT_LOC/STM32_WPAN/app/app_ble.c</location>
- </link>
- <link>
- <name>Application/STM32_WPAN/app/appli_generic.c</name>
- <type>1</type>
- <location>PARENT-2-PROJECT_LOC/STM32_WPAN/app/appli_generic.c</location>
- </link>
- <link>
- <name>Application/STM32_WPAN/app/appli_light.c</name>
- <type>1</type>
- <location>PARENT-2-PROJECT_LOC/STM32_WPAN/app/appli_light.c</location>
- </link>
- <link>
- <name>Application/STM32_WPAN/app/appli_mesh.c</name>
- <type>1</type>
- <location>PARENT-2-PROJECT_LOC/STM32_WPAN/app/appli_mesh.c</location>
- </link>
- <link>
- <name>Application/STM32_WPAN/app/appli_sensor.c</name>
- <type>1</type>
- <location>PARENT-2-PROJECT_LOC/STM32_WPAN/app/appli_sensor.c</location>
- </link>
- <link>
- <name>Application/STM32_WPAN/app/appli_vendor.c</name>
- <type>1</type>
- <location>PARENT-2-PROJECT_LOC/STM32_WPAN/app/appli_vendor.c</location>
- </link>
- <link>
- <name>Application/STM32_WPAN/app/models_if.c</name>
- <type>1</type>
- <location>PARENT-2-PROJECT_LOC/STM32_WPAN/app/models_if.c</location>
- </link>
- <link>
- <name>Application/STM32_WPAN/target/hw_ipcc.c</name>
- <type>1</type>
- <location>PARENT-2-PROJECT_LOC/STM32_WPAN/target/hw_ipcc.c</location>
- </link>
- <link>
- <name>Doc/readme.txt</name>
- <type>1</type>
- <location>PARENT-2-PROJECT_LOC/readme.txt</location>
- </link>
- <link>
- <name>Drivers/BSP/P-NUCLEO-WB55.USBDongle/stm32wbxx_usb_dongle.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Drivers/BSP/P-NUCLEO-WB55.USBDongle/stm32wbxx_usb_dongle.c</location>
- </link>
- <link>
- <name>Drivers/CMSIS/system_stm32wbxx.c</name>
- <type>1</type>
- <location>PARENT-2-PROJECT_LOC/Core/Src/system_stm32wbxx.c</location>
- </link>
- <link>
- <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal.c</location>
- </link>
- <link>
- <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_cortex.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_cortex.c</location>
- </link>
- <link>
- <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_dma.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_dma.c</location>
- </link>
- <link>
- <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_flash.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_flash.c</location>
- </link>
- <link>
- <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_flash_ex.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_flash_ex.c</location>
- </link>
- <link>
- <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_gpio.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_gpio.c</location>
- </link>
- <link>
- <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_pcd.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pcd.c</location>
- </link>
- <link>
- <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_pcd_ex.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pcd_ex.c</location>
- </link>
- <link>
- <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_i2c.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_i2c.c</location>
- </link>
- <link>
- <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_i2c_ex.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_i2c_ex.c</location>
- </link>
- <link>
- <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_pwr.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pwr.c</location>
- </link>
- <link>
- <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_pwr_ex.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pwr_ex.c</location>
- </link>
- <link>
- <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_rcc.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rcc.c</location>
- </link>
- <link>
- <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_rcc_ex.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rcc_ex.c</location>
- </link>
- <link>
- <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_rtc.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rtc.c</location>
- </link>
- <link>
- <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_rtc_ex.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rtc_ex.c</location>
- </link>
- <link>
- <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_uart.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_uart.c</location>
- </link>
- <link>
- <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_hal_uart_ex.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_uart_ex.c</location>
- </link>
- <link>
- <name>Drivers/STM32WBxx_HAL_Driver/stm32wbxx_ll_usb.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_ll_usb.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_USB_Device_Library/usbd_cdc.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_USB_Device_Library/usbd_core.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_USB_Device_Library/usbd_ctlreq.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_USB_Device_Library/usbd_ioreq.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_WPAN/ble/blesvc/common.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/common.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_WPAN/ble/blesvc/generic.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/generic.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_WPAN/ble/blesvc/light.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/light.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_WPAN/ble/blesvc/mesh.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/svc/Src/mesh.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_WPAN/ble/blesvc/mesh_cfg.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/mesh/Src/mesh_cfg.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_WPAN/ble/blesvc/pal_nvm.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/mesh/PAL/STM32WB/pal_nvm.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_WPAN/ble/blesvc/sensors.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/sensors.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_WPAN/ble/blesvc/svc_ctl.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/svc/Src/svc_ctl.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_WPAN/ble/blesvc/time_scene.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/time_scene.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_WPAN/ble/blesvc/vendor.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/mesh/MeshModel/Src/vendor.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_WPAN/ble/core/ble_gap_aci.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_gap_aci.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_WPAN/ble/core/ble_gatt_aci.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_gatt_aci.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_WPAN/ble/core/ble_hal_aci.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_hal_aci.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_WPAN/ble/core/ble_hci_le.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_hci_le.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_WPAN/ble/core/ble_l2cap_aci.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/core/auto/ble_l2cap_aci.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_WPAN/ble/core/osal.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/ble/core/template/osal.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_WPAN/interface/patterns/ble_thread/shci/shci.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci/shci.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_WPAN/interface/patterns/ble_thread/tl/hci_tl.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/hci_tl.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_WPAN/interface/patterns/ble_thread/tl/hci_tl_if.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/hci_tl_if.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_WPAN/interface/patterns/ble_thread/tl/shci_tl.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/shci_tl.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_WPAN/interface/patterns/ble_thread/tl/shci_tl_if.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/shci_tl_if.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_WPAN/interface/patterns/ble_thread/tl/tl_mbox.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl/tl_mbox.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_WPAN/interface/patterns/ble_thread/vcp/usbd_conf.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/vcp/usbd_conf.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_WPAN/interface/patterns/ble_thread/vcp/usbd_desc.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/vcp/usbd_desc.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_WPAN/interface/patterns/ble_thread/vcp/vcp.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/vcp/vcp.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_WPAN/utilities/dbg_trace.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/utilities/dbg_trace.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_WPAN/utilities/otp.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/utilities/otp.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_WPAN/utilities/stm_list.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/utilities/stm_list.c</location>
- </link>
- <link>
- <name>Middlewares/STM32_WPAN/utilities/stm_queue.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Middlewares/ST/STM32_WPAN/utilities/stm_queue.c</location>
- </link>
- <link>
- <name>Utilities/stm32_lpm.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Utilities/lpm/tiny_lpm/stm32_lpm.c</location>
- </link>
- <link>
- <name>Utilities/stm32_seq.c</name>
- <type>1</type>
- <location>PARENT-7-PROJECT_LOC/Utilities/sequencer/stm32_seq.c</location>
- </link>
- </linkedResources>
-</projectDescription> \ No newline at end of file
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/readme.txt b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/readme.txt
index 084c9b62f..8027d0890 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/readme.txt
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_MeshLightingDemo/readme.txt
@@ -56,8 +56,12 @@ This is the implementation of the BLE Mesh Lighting profile as specified by the
- BLE/BLE_MeshLightingDemo/STM32_WPAN/App/appli_generic.h Header of BLE Mesh Generic Profile implementation
- BLE/BLE_MeshLightingDemo/STM32_WPAN/App/appli_light.c BLE Mesh Light Profile implementation
- BLE/BLE_MeshLightingDemo/STM32_WPAN/App/appli_light.h Header of BLE Mesh Light Profile implementation
+ - BLE/BLE_MeshLightingDemo/STM32_WPAN/App/appli_light_lc.c BLE Mesh Light Lightness Controller Profile implementation
+ - BLE/BLE_MeshLightingDemo/STM32_WPAN/App/appli_light_lc.h Header of BLE Mesh Light Lightness Controller Profile implementation
- BLE/BLE_MeshLightingDemo/STM32_WPAN/App/appli_mesh.c BLE Mesh application implementation
- BLE/BLE_MeshLightingDemo/STM32_WPAN/App/appli_mesh.h Header of BLE Mesh application implementation
+ - BLE/BLE_MeshLightingDemo/STM32_WPAN/App/appli_nvm.c BLE Mesh NVM application implementation
+ - BLE/BLE_MeshLightingDemo/STM32_WPAN/App/appli_nvm.h Header of BLE Mesh NVM application implementation
- BLE/BLE_MeshLightingDemo/STM32_WPAN/App/appli_sensor.c BLE Mesh Sensor Profile implementation
- BLE/BLE_MeshLightingDemo/STM32_WPAN/App/appli_sensor.h Header of BLE Mesh Sensor Profile implementation
- BLE/BLE_MeshLightingDemo/STM32_WPAN/App/appli_vendor.c BLE Mesh Vendor Profile implementation
@@ -69,6 +73,12 @@ This is the implementation of the BLE Mesh Lighting profile as specified by the
- BLE/BLE_MeshLightingDemo/STM32_WPAN/App/mesh_cfg_usr.h Header for user Mesh configuration
- BLE/BLE_MeshLightingDemo/STM32_WPAN/App/models_if.h Header for the BLE Mesh Models Interface file
- BLE/BLE_MeshLightingDemo/STM32_WPAN/App/models_if.c BLE Mesh Models Interface file
+ - BLE/BLE_MeshLightingDemo/STM32_WPAN/App/pal_nvm.c BLE Mesh NVM management implementation
+ - BLE/BLE_MeshLightingDemo/STM32_WPAN/App/pal_nvm.h Header of BLE Mesh NVM management implementation
+ - BLE/BLE_MeshLightingDemo/STM32_WPAN/App/PWM_config.c Pulse Width Modulation configuration
+ - BLE/BLE_MeshLightingDemo/STM32_WPAN/App/PWM_config.h Header of Pulse Width Modulation configuration
+ - BLE/BLE_MeshLightingDemo/STM32_WPAN/App/PWM_handlers.c Pulse Width Modulation handlers
+ - BLE/BLE_MeshLightingDemo/STM32_WPAN/App/PWM_handlers.h Header of Pulse Width Modulation handlers
- BLE/BLE_MeshLightingDemo/STM32_WPAN/App/svcctl_conf.c Service Controller configuration API
- BLE/BLE_MeshLightingDemo/STM32_WPAN/App/tl_conf.h Configuration file of the Transport layer
- BLE/BLE_MeshLightingDemo/STM32_WPAN/App/tl_if.c Transport Layer interface
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Inc/app_conf.h
index d70109fdd..eedb48d7f 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Inc/app_conf.h
@@ -24,6 +24,7 @@
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Transparent Mode Config
@@ -39,6 +40,15 @@
*/
#define CFG_BLE_ERK {0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21,0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21}
+/* USER CODE BEGIN Generic_Parameters */
+/**
+ * SMPS supply
+ * SMPS not used when Set to 0
+ * SMPS used when Set to 1
+ */
+#define CFG_USE_SMPS 1
+/* USER CODE END Generic_Parameters */
+
/**< specific parameters ********************************************************/
/******************************************************************************
* Information Table
@@ -137,7 +147,7 @@
* 1 : internal RO
* 0 : external crystal ( no calibration )
*/
-#define CFG_BLE_LSE_SOURCE 1
+#define CFG_BLE_LSE_SOURCE 0
/**
* Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
@@ -353,7 +363,6 @@ typedef enum
#define CFG_LPM_SUPPORTED 0
#define CFG_DEBUGGER_SUPPORTED 1
#endif
-
/**
* When CFG_DEBUG_TRACE_FULL is set to 1, the trace are output with the API name, the file name and the line number
* When CFG_DEBUG_TRACE_LIGHT is set to 1, only the debug message is output
@@ -455,6 +464,9 @@ typedef enum
{
CFG_LPM_APP,
CFG_LPM_APP_BLE,
+ /* USER CODE BEGIN CFG_LPM_Id_t */
+
+ /* USER CODE END CFG_LPM_Id_t */
} CFG_LPM_Id_t;
/******************************************************************************
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Inc/stm32_lpm_if.h
index 38e326512..d8e67947f 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Inc/stm32_lpm_if.h
@@ -1,46 +1,22 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file stm32_lpm_if.h
-* @brief Header for stm32_lpm_f.c module (device specific LP management)
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
******************************************************************************
* @attention
*
-* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics International N.V.
+* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted, provided that the following conditions are met:
-*
-* 1. Redistribution of source code must retain the above copyright notice,
-* this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following disclaimer in the documentation
-* and/or other materials provided with the distribution.
-* 3. Neither the name of STMicroelectronics nor the names of other
-* contributors to this software may be used to endorse or promote products
-* derived from this software without specific written permission.
-* 4. This software, including modifications and/or derivative works of this
-* software, must execute solely and exclusively on microcontroller or
-* microprocessor devices manufactured by or for STMicroelectronics.
-* 5. Redistribution and use of this software other than as permitted under
-* this license is void and will automatically terminate your rights under
-* this license.
-*
-* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
-* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
-* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+* This software component is licensed by ST under BSD 3-Clause license,
+* the "License"; You may not use this file except in compliance with the
+* License. You may obtain a copy of the License at:
+* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32_LPM_IF_H
@@ -89,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Inc/stm32wbxx_hal_conf.h
index 8cce280aa..4ab9edb7d 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Inc/stm32wbxx_hal_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Inc/stm32wbxx_hal_conf.h
@@ -219,6 +219,10 @@
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32wbxx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32wbxx_hal_flash.h"
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Inc/utilities_conf.h
index c98d97ba1..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Inc/utilities_conf.h
@@ -1,3 +1,4 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* File Name : utilities_conf.h
@@ -9,13 +10,14 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef UTILITIES_CONF_H
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Src/app_entry.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Src/app_entry.c
index 3ac9b04a5..5c507c3ec 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Src/app_entry.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Src/app_entry.c
@@ -85,7 +85,7 @@ void APPE_Init( void )
/**
* From now, the application is waiting for the ready event ( VS_HCI_C2_Ready )
- * received on the system channel before starting the BLE Stack
+ * received on the system channel before starting the Stack
* This system event is received with APPE_SysUserEvtRx()
*/
@@ -271,7 +271,6 @@ void UTIL_SEQ_Idle( void )
return;
}
-
void UTIL_SEQ_EvtIdle( UTIL_SEQ_bm_t task_id_bm, UTIL_SEQ_bm_t evt_waited_bm )
{
UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Src/hw_timerserver.c
index 52a1bfa0d..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Src/hw_timerserver.c
@@ -1,22 +1,21 @@
/**
******************************************************************************
- * File Name : hw_timerserver.c
- * Description : Hardware timerserver source file for BLE
- * middleWare.
+ * File Name : hw_timerserver.c
+ * Description : Hardware timerserver source file for STM32WPAN Middleware.
+ *
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Src/main.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Src/main.c
index 7e80f2c17..1754a019a 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Src/main.c
@@ -195,7 +195,13 @@ static void Init_RTC( void )
hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
HAL_RTC_Init(&hrtc);
- MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* Disable RTC registers write protection */
+ LL_RTC_DisableWriteProtection(RTC);
+
+ LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER);
+
+ /* Enable RTC registers write protection */
+ LL_RTC_EnableWriteProtection(RTC);
return;
}
@@ -218,6 +224,12 @@ void SystemClock_Config( void )
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -268,19 +280,6 @@ void SystemClock_Config( void )
*/
LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
@@ -289,21 +288,33 @@ void SystemClock_Config( void )
* WRAP FUNCTIONS
*
*************************************************************/
-
-/**
- * This function is empty to avoid starting the SysTick Timer
- */
-HAL_StatusTypeDef HAL_InitTick( uint32_t TickPriority )
+void HAL_Delay(uint32_t Delay)
{
- return (HAL_OK);
-}
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
-/**
- * This function is empty as the SysTick Timer is not used
- */
-void HAL_Delay(__IO uint32_t Delay)
-{
- return;
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
}
/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/STM32_WPAN/App/ble_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/STM32_WPAN/App/ble_conf.h
index 9ea96e136..e0323c49b 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/STM32_WPAN/App/ble_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/STM32_WPAN/App/ble_conf.h
@@ -50,7 +50,7 @@
* This shall take into account all registered handlers
* (from either the provided services or the custom services)
*/
-#define BLE_CFG_SVC_MAX_NBR_CB 5
+#define BLE_CFG_SVC_MAX_NBR_CB 7
#define BLE_CFG_CLT_MAX_NBR_CB 0
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/STM32_WPAN/App/tm.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/STM32_WPAN/App/tm.c
index 91d50e696..22b14baaa 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/STM32_WPAN/App/tm.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/STM32_WPAN/App/tm.c
@@ -353,7 +353,7 @@ static void TM_SysLocalCmd( void )
((TL_CcEvt_t *)(((TL_EvtPacket_t*)&SysLocalCmd)->evtserial.evt.payload))->cmdcode = SysLocalCmd.cmdserial.cmd.cmdcode;
((TL_CcEvt_t *) (((TL_EvtPacket_t*) &SysLocalCmd)->evtserial.evt.payload))->payload[0] = 0x01;
((TL_CcEvt_t *) (((TL_EvtPacket_t*) &SysLocalCmd)->evtserial.evt.payload))->numcmd = 1;
- ((TL_EvtPacket_t*) &SysLocalCmd)->evtserial.type = TL_BLEEVT_PKT_TYPE;
+ ((TL_EvtPacket_t*) &SysLocalCmd)->evtserial.type = TL_LOCRSP_PKT_TYPE;
((TL_EvtPacket_t*) &SysLocalCmd)->evtserial.evt.evtcode = TL_BLEEVT_CC_OPCODE;
((TL_EvtPacket_t*) &SysLocalCmd)->evtserial.evt.plen = TL_EVT_CS_PAYLOAD_SIZE;
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/SW4STM32/Production/.cproject b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/SW4STM32/Production/.cproject
index 6c134351d..5e213b6e2 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/SW4STM32/Production/.cproject
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_TransparentModeVCP/SW4STM32/Production/.cproject
@@ -89,7 +89,7 @@
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble"/>
<listOptionValue builtIn="false" value="../../../Core/Inc"/>
- <listOptionValue builtIn="false" value="../../../STM32_WPAN/app"/>
+ <listOptionValue builtIn="false" value="../../../STM32_WPAN/App"/>
<listOptionValue builtIn="false" value="../../../../../../../../Drivers/BSP/P-NUCLEO-WB55.USBDongle"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/vcp"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc"/>
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Binary/BLE_p2pClient_reference.hex b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Binary/BLE_p2pClient_reference.hex
index 07964b522..c1de72b1a 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Binary/BLE_p2pClient_reference.hex
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Binary/BLE_p2pClient_reference.hex
@@ -1,1048 +1,1071 @@
:020000040800F2
-:100000009015002019400008D13E0008D33E00089A
-:1000100035400008394000083D400008000000005D
-:10002000000000000000000000000000D53E0008B5
-:10003000D73E000800000000D93E0008DB3E000863
-:10004000414000084540000849400008F53E0008CE
-:100050004D40000851400008554000085940000834
-:100060005D400008614000086540000869400008E4
-:100070006D40000871400008754000087940000894
-:100080007D4000088140000885400008E93E0008E6
-:10009000E73E0008894000088D40000891400008B4
-:1000A00095400008994000089D400008A1400008C4
-:1000B000A5400008A9400008AD400008B140000874
-:1000C000B5400008B9400008BD400008C140000824
-:1000D000C5400008C9400008CD400008D1400008D4
-:1000E000DF3E0008D5400008D9400008DD40000888
-:1000F000FD3E0008F93E0008E1400008E540000828
-:10010000E9400008ED400008F1400008F540000813
-:10011000F9400008FD4000080141000805410008C1
-:10012000094100080D41000811410008154100086F
-:10013000194100081D41000821410008002084F8F1
-:10014000280210BD38B5044600F0B0F8010444BFE1
-:10015000204600F074F900F0A9F840050CD500F035
-:10016000A1F84FF6FF3000F099F8204600F0B5FAFC
+:100000009815002095410008494000084B40000821
+:10001000B1410008B5410008B941000800000000E6
+:100020000000000000000000000000004D4000083B
+:100030004F400008000000005140000853400008F5
+:10004000BD410008C1410008C54100086D400008DD
+:10005000C9410008CD410008D1410008D541000840
+:10006000D9410008DD410008E1410008E5410008F0
+:10007000E9410008ED410008F1410008F5410008A0
+:10008000F9410008FD4100080142000861400008F4
+:100090005F40000805420008094200080D420008C0
+:1000A0001142000815420008194200081D420008CC
+:1000B0002142000825420008294200082D4200087C
+:1000C0003142000835420008394200083D4200082C
+:1000D0004142000845420008494200084D420008DC
+:1000E0005740000851420008554200085942000894
+:1000F00075400008714000085D4200086142000838
+:1001000065420008694200086D420008714200081B
+:1001100075420008794200087D42000881420008CB
+:1001200085420008894200088D420008914200087B
+:1001300095420008994200089D420008002084F87A
+:10014000280210BD70B5044600F0B0F8000444BFAA
+:10015000204600F076F900F0A9F840050CD500F033
+:10016000A1F84FF6FF3000F099F8204600F0BDFAF4
:100170000021204600F0A2F800F098F8400405D5D0
:1001800000F090F84BF6FF7000F088F800F08EF861
:10019000800405D500F086F84DF6FF7000F07EF87B
-:1001A00004F5187500F082F8C0041FD52168B1F875
+:1001A00004F5187500F082F8C00420D52168B1F874
:1001B00040204FF6FB700240A1F840204FF6F77048
-:1001C000B1F840200240A1F840202878012804D14D
-:1001D000002129702046C046C046204600F08EFA15
-:1001E00000F060F84EF6FF7000F058F800F05EF88E
-:1001F000000516D5206800F14002118841F0080181
-:1002000011804FF2FF7193880B409380118841F069
-:1002100004011180B0F84400C0045CBF204600F027
-:1002200069FA00F043F8000620D5206800F140018B
-:100230004FF67F708A8802408A80287898B90A88A9
-:1002400042F004020A800122088840F00800088079
-:100250002A70888A800800F03C00686001212046EE
-:10026000C046C04602E0204600F044FA00F01EF806
+:1001C000B1F840200240A1F840202978012905D14A
+:1001D0000020287000212046C046C046204600F07E
+:1001E00095FA00F05FF84EF6FF7000F057F800F057
+:1001F0005DF8000516D5206800F14002118841F035
+:10020000080111804FF2FF7193880B40938016888C
+:1002100046F004061680B0F84400C0045CBF2046D7
+:1002200000F070FA00F042F800061FD5216801F1D5
+:1002300040024FF67F7193880B409380287890B9E5
+:10024000118841F0040111800121108840F008005C
+:1002500010802970908A800800F03C006860204679
+:10026000C046C04602E0204600F04CFA00F01EF8FE
:10027000800508D500F016F84FF6FF5000F00EF894
-:10028000204600F026FA00F011F8C00505D500F070
-:1002900009F84FF6FF6000F001F831BD0240A1F807
+:10028000204600F02EFA00F011F8C00505D500F068
+:1002900009F84FF6FF6000F001F870BD0240A1F8C8
:1002A000442070472168B1F844207047206800F06E
-:1002B000ADBC044694F828020128704710B5FFF73A
-:1002C000F8FF01D1022010BD012284F8282284F811
-:1002D0002410206800F094FC30E738B5054601F0A2
+:1002B000C6BC044694F828020128704710B5FFF721
+:1002C000F8FF01D1022010BD012084F8280284F833
+:1002D0002410206800F0ADFC30E738B5054601F089
:1002E000070005EB40100C0647BF00F12804012071
:1002F00000F59474002001F0070160702170226104
:10030000E370607808B12178E181022B04BF0020FE
-:10031000207195F82802012801D1022032BD012167
-:1003200085F828122146286800F028FA52E01CB50A
-:1003300001F0070400EB441404F5947400F014F881
-:10034000627021700AE01CB501F0070400EB441450
-:10035000283400F009F821700122627021460068FB
-:1003600000F03FFB002016BD01F007016261A361B0
-:100370000022E261704738B505460C46696804F012
+:10031000207195F82802012801D1022032BD012068
+:1003200085F828022146286800F04CFA52E010B502
+:1003300001F0070400EB441404F5947401F0070184
+:100340006261A3610022E26162700DE010B501F00C
+:10035000070400EB441428346261A36100220123E6
+:1003600001F00701E261637021702146006800F02E
+:1003700051FB002010BD38B505460C46696804F0F5
:100380000700814201D2012032BD210605D505EBCF
:10039000401000F12801012204E005EB441000F5B3
:1003A000947100224A700120887004F007040C70D8
-:1003B00095F82802012801D1022032BD012285F8DA
-:1003C0002822286800F0C6FB24B9286805F50C71BE
-:1003D0000020C046002085F8280232BD1CB5044626
-:1003E00001F00F0362689A4201D2012016BD00F0AD
-:1003F0001AF847BF2830012200F59470002201F05E
-:100400000701427000228270017094F828120129BD
-:1004100001D1022016BD00F00CF800F0B4FB002062
-:1004200084F8280216BD01F0070004EB40100A060C
-:100430007047012284F828220146206870472DE980
-:10044000F84F00F59475064627E001880AEA010195
-:1004500041F40041018006F124043068B0F85010E6
-:10046000227901EBC201401800F202400088A16924
-:10047000C0F3090020620844A0610021304600F06A
-:1004800021F9217849B1E06938B92178306841F023
-:100490008001A0F84C1000212170306800F1440167
-:1004A0000A88130440F1E7800A8812F00F0440F62E
-:1004B0008F7748F60F7A57D1D206C6D50288130532
-:1004C00011D5898900F0E0F8EA88C3F30903EB61EC
-:1004D00006F50C7100F0AEFB306800F0CFF8304646
-:1004E00000F0E2F8D9E71104D7D500F0C7F830687A
-:1004F000B0F8501000F0C8F8C3F30903002BEB610B
-:1005000007D0EA88696900F095FB6869E9690844E1
-:1005100068610021304600F0CDF83068B0F8501026
-:100520004118286901F2064120B9088848F2FF32D3
-:10053000104009E03E2805D24208C00748BF521CBF
-:10054000900203E04009800240F4004008804BF62E
-:100550008F7230680188114081F4405141F40041AC
-:1005600041F08001018098E730F824805FEA08417B
-:1005700006EB441957D530F824100F4047F0800798
-:1005800020F8247009F594773068397B71B9B0F898
-:100590005030397803EBC103C21800F07DF82DD03C
-:1005A000FA8879695B4600F045FB27E039780B460D
-:1005B00030F823305A04B0F8503003EBC10107D5AE
-:1005C000421802F2024200F069F80AD03A8904E0C7
-:1005D000421800F061F804D07A895B46796900F02E
-:1005E00029FB3168387831F8202048F68F731A409B
-:1005F00042F4004242F0C00221F82020F969594437
-:10060000F961796901EB0B027A61BB6913B1396950
-:100610008B4504D23978304600F04CF803E0397845
-:100620003046FFF784FE5FEA086020D5316831F874
-:1006300024200AEA020242F4004209F1280021F8CB
-:10064000242032680178B2F8503003EBC103D2188D
-:1006500002F2024212884369C2F30902C2611A44DB
-:1006600083694261002B304602D100F02BF814E779
-:10067000FFF769FE11E70020BDE8F28F01880F4007
-:1006800047F08007078070472A7801EBC2014118C4
-:1006900001F206410B88704702F206421188C1F34D
-:1006A000090BBBF1000F704700F50C71D0F8700218
-:1006B00000F0E3BA00EB4112D0F87002D2F83C210E
-:1006C00000F005BB00EB4112D0F87002D26B00F0D5
-:1006D0003DBBD0F8700200F0C6BB10B50446D4F89C
-:1006E000700200F088FBD4F87002BDE810400121D0
-:1006F00000F0AABBD0F8700200F0A9BBD0F87002DD
-:1007000000F0ABBB10B51C461346D0F89802224649
-:10071000FFF7E3FD002010BD80B5D0F89802FFF789
-:100720002AFE002002BD80B5D0F89802FFF756FEE1
-:10073000002002BD81B0D0F8980201F07F0200EBEA
-:10074000421009064CBF90F82A0090F82A0101B027
-:10075000704780B5D0F89802FFF7B0FD002002BDC9
-:1007600080B5D0F89802FFF7EEFD002002BD80B5FD
-:10077000D0F89802FFF7DBFD002002BD2DE9F84715
-:100780000B4648F68F111D780246002032F825608E
-:100790000E40D97803290CD8DFE801F002080C05D7
-:1007A00046F4007606E046F4C06603E046F4806650
-:1007B00000E0012048F28004264322F8256048F634
-:1007C0008F7519780E4632F826702F403943214331
-:1007D00022F826104BF68F76197B93F800900029AB
-:1007E0004CF2800748F6BF7C48F2C00E67D1B3F8E0
-:1007F00006A04FF6FE7101EA0A0A59780029B2F8FC
-:10080000501011441ED001EBC90101F58061A1F81F
-:1008100000A0197832F82160760606D532F82160FA
-:1008200035404EEA050522F821501978DB78012B76
-:1008300032F821300CEA03030EBF1C4383F020037F
-:100840001C43CAE001EBC90909F20449A9F800A058
-:10085000B2F8501002EB010C19780CEBC10C1969BD
-:100860000CF2064C31B9BCF800E048F2FF3101EA65
-:100870000E010CE03E2908D24FEA510EC90748BFCD
-:100880000EF1010E4FEA8E2E03E04909890241F470
-:10089000004EACF800E0197832F821C05FEA4C4C09
-:1008A00006D532F821C005EA0C053D4322F8215057
-:1008B000197832F821301E4086F440568CE032F828
-:1008C0002910294041F4014141F0800122F829100A
-:1008D000B2F85010B3F808A002EB0109197809EB3F
-:1008E000C10101F580694FF6FE7101EA0A01A9F81C
-:1008F0000010B2F85010B3F80A9002EB0108197812
-:1009000008EBC10808F204484FF6FE7101EA09013C
-:10091000A8F80010597893F80080002932F82810C0
-:100920002BD1490405D532F8281029400F4322F86D
-:100930002870197832F821707F0606D532F82170B8
-:100940002F404EEA070722F82170197832F82170FB
-:100950003D404EEA050522F82150197832F8215021
-:100960002E4086F44056264322F82160197832F84A
-:1009700021300CEA03031C432FE0490405D532F86B
-:1009800028102940394322F82810197832F821809C
-:100990005FEA486807D532F8218005EA08084EEA80
-:1009A000080E22F821E0197832F821E005EA0E0558
-:1009B0003D4322F82150DD781978012D32F821507D
-:1009C0000CEA050518BF85F02005254322F82150C3
-:1009D000197832F821301E40344322F82140BDE816
-:1009E000F287F8B50E46054672783469B069012A77
-:1009F00048F2800748D1844232BF001B04460020E1
-:100A0000B061307B40B9F28800F0A0F800F097F8B0
-:100A100000F2024004802EE03078C10035F820005A
-:100A20004206B5F85000284405D5091801F20641E0
-:100A30000C80728904E0091801F202410C803289AD
-:100A400000F084F8707848F68F7140B9307835F846
-:100A50002020114041F4004141F0C00109E001288B
-:100A600009D1307835F82020114041F4404141F05F
-:100A7000800125F82010317835F8212048F6BF7024
-:100A8000024082F030024EE0844232BF001B044636
-:100A90000020B0616009317B8302002943F40043E8
-:100AA00004F001004FEA540C18D0AAB900F040F845
-:100AB00001F202413CB9B1F800E0202262F38F2E2E
-:100AC000A1F800E008E03E2C05D2624600B1521CBD
-:100AD00092020A8000E00B807178A9B900F028F832
-:100AE00001F206412CB90A88202060F38F220A8087
-:100AF00011E03E2C06D208B10CF1010C4FEA8C201B
-:100B0000088008E00B8006E0012904D100F017F806
-:100B100000F2064004804BF68F70317835F82120C2
-:100B2000024082F44052174325F821700020F2BDA4
-:100B3000B5F850103278691801EBC2017047B5F86A
-:100B400050003178281800EBC10070477169A3B2DA
-:100B500028465EE018B50A78497830F82240002926
-:100B600048F2800305D048F6BF710C4084F01004B1
-:100B700004E04BF68F710C4084F48054234320F83A
-:100B80002230002012BD30B50A7B002A36D14A78C7
-:100B90000C78002A30F8242048F2800348F68F753C
-:100BA00016D0520608D530F82420154045F40045EB
-:100BB00045F0C00520F82450CA78012A1ED00A78D2
-:100BC00030F8224048F6BF710C4084F0200412E057
-:100BD000520408D530F82420154045F4404545F02E
-:100BE000800520F824500A7830F822404BF68F71A7
-:100BF0000C4084F44054234320F82230002030BDC0
-:100C000011B98021A0F84C1000207047B0F84400C2
-:100C1000704710B580185B1C00F580605B0807E02A
-:100C20000A784C7842EA0422891C20F8022B5B1EC9
-:100C3000F6D110BD10B5821802F58062580806E0A2
-:100C400032F8024B0C70240A4C70891C401EF7D1FC
-:100C5000D80744BF1088087010BD10B5D0F88C229A
-:100C600002241AB11268904700B90024204610BD32
-:100C700080B5D0F88C22536801E138B5044604F5FC
-:100C80002075284600F0F6FA04F51B70012101607A
-:100C9000418B4160017D11F01F0003D002280BD071
-:100CA00005D30EE02946204600F0ECF80DE0294679
-:100CB000204600F05FF908E02946204600F07FF961
-:100CC00003E001F0800100F03EF8002032BD38B5AD
-:100CD000044610460A0004F51B7328D1196803293D
-:100CE0001DD104F5A6714A680D68AA420BD2AD1A4F
-:100CF0000D60954238BF2A46014692B2204600F068
-:100D0000E8FA002032BD186A016921B1187A032877
-:100D100004BF20468847204600F0E3FAF1E70529A2
-:100D2000EFD100201860002100F00DF8E9E7186A03
-:100D300082692AB1187A032802D120469047E0E759
-:100D4000022032BD80212046FFF7E6BC38B50446BC
-:100D50000800134604F51B7542D12868022832D1D9
-:100D6000226A616A914207D2521A2262194692B2ED
-:100D7000204600F0A6FA11E0E269B2FBF1F001FBB7
-:100D8000102090B98A4210D3686882420DD20022A6
-:100D90000021204600F095FA002068600023002220
-:100DA00000212046FFF7E3FC13E0286AC16821B167
-:100DB000287A032804BF20468847FFF7C3FF204650
-:100DC00000F096FA05E0042818BF002801D1FFF7CB
-:100DD000B9FF287B012804BF00212973002032BD00
-:100DE000286A42692AB1287A032802D1204690470E
-:100DF000F4E7022032BD10B5044640230022002152
-:100E0000FFF780FC04F5A27001210160402340211E
-:100E1000C160002280212046FFF774FC0120A06100
-:100E200004F51B72402060620120107200201060E7
-:100E300060601061506A28B1126A61685368C9B273
-:100E400020469847002010BD01740020704700F52F
-:100E50001D7001784170042102E000F51D70417899
-:100E600001700020704780B500F51D710A78032AD3
-:100E700003D18969C96901B18847002002BD98473B
-:100E8000002002BD7CB50446087810F0600004F52F
-:100E90001D7508D0202818BF40282DD1AA69936855
-:100EA0002046984764E04878092825D8DFE800F014
-:100EB0003D552450240905242B27204600F014F921
-:100EC00056E08A88002A04BFC888002814D14E88BA
-:100ED000802E11D22878032806F07F060CD0AE7041
-:100EE00031462046FFF735FC00F0FBF8002E14BF1A
-:100EF0000220012028703BE000F072F938E0204623
-:100F000000F070F934E0C8880128F5D12A78521E23
-:100F1000012A04D9921EEFD10122211D14E00020E4
-:100F2000A060012204F108010EE02878401E02288A
-:100F3000E2D8C8880228DFD1A868012100B10321C6
-:100F4000E160022204F10C01204600F0B2F90FE04A
-:100F5000488801280CD1012107E02878401E02288A
-:100F6000CAD84888012803D10021A96000F0B9F847
-:100F7000002076BD38B50D460446287810F0600094
-:100F80001CBF2028402816D104F51D721178491E77
-:100F9000022910D8287902280DDA92699368294627
-:100FA000204698470146E888002808BF002904D158
-:100FB00000F097F801E000F012F9002032BD7CB596
-:100FC0000446084604F51D730278017912F06005A5
-:100FD00009D0202D18BF402D6BD19A699368014626
-:100FE0002046984768E002F06002202A07D19A69FB
-:100FF00093680146204602B0BDE870401847427829
-:101000008AB3012A12D0032A53D11A78022A13D0A4
-:10101000032A4ED142881ABB002918BF80291FD04D
-:10102000C088E8B92046FFF777FB19E01A78022A52
-:1010300002D0032A0CD03CE0002918BF802938D008
-:101040002046FFF769FB80212046FFF765FB33E070
-:10105000408888BB11F07F0F1CBF2046FFF763FB61
-:1010600000F03FF828E0142201F07F051B7855437B
-:101070006619022B06F5A07502D0032B10D018E0DC
-:10108000002918BF802914D1080648BF06F11405AD
-:101090000020286002222946204600F00AF90BE0D1
-:1010A00001F00F0312FB03F20B06224406D59269EE
-:1010B00072B9014600F094F8002076BDD2F84421C0
-:1010C000002AF6D0002918BF802904D10020E0E7CB
-:1010D00006F11405F6E72046FFF72CFB00B10120CE
-:1010E000D7E7204600F0FDB838B50D4604466888BD
-:1010F000010A012904F5227208D0022923D003290C
-:101100002ED0062958D007295DD065E01268207CD2
-:10111000136869469847BDF8001079B1E98879B13C
-:10112000BDF80010EA88914288BF1146ADF8001062
-:101130000146BDF80020204600F0BBF8E88808B959
-:10114000FFF7CFFF31BD207C51680028684604D1ED
-:10115000896A884702214170DDE7C96A8847F9E753
-:10116000C0B2052838D8DFE800F003090F151B21AD
-:101170001268207C536869469847CCE71268207C47
-:10118000936869469847C6E71268207CD368694629
-:101190009847C0E71268207C136969469847BAE708
-:1011A0001268207C536969469847B4E71268207C2E
-:1011B000936969469847AEE7207C68B951684A6BE5
-:1011C00068469047A7E7207C30B951680A6B6846AB
-:1011D0009047072242709EE700F001F831BD294692
-:1011E00020465BE07CB50D460446214E6888307091
-:1011F0003178084602282DDA94F87422022A02D0A7
-:10120000032A0FD02BE041B16060032084F8740200
-:101210002046FFF722FD02281CD02046BDE876407C
-:1012200000F05FB841B9022084F8740200206060C9
-:101230002046FFF71DFDF0E761688842EDD0C9B296
-:101240002046FFF715FD317861602046FFF705FD68
-:101250000228E2D129462046BDE87C401EE0FFF787
-:10126000BEFF31782046BDE87C40FFF701BD00009D
-:101270008C0500200A7802704A784270CB788A7810
-:1012800002EB032242804B790A7902EB032282802F
-:101290008A79C97902EB0122C280704710B50446F1
-:1012A0008021FFF739FA2046BDE810400021FFF702
-:1012B00033BA80B513460222C0F86C22C3610362C0
-:1012C00001E080B513460A460021FFF749FA0020E5
-:1012D00002BD80B513460A460021FFF748FA0020F8
-:1012E00002BD80B50421C0F86C1200230022EBE798
-:1012F00080B50521C0F86C1200230022ECE7000045
-:10130000DFF83C150A6892B200E00246086880B235
-:101310008242FAD170472DE9FC4104461825DFF8D6
-:101320002485DFF82465684308EB00073078062839
-:1013300008D131787170347078754FF0FF3070607B
-:10134000002039E000F077F8B9680918B96008F1B1
-:101350000803B96832786A439A589142327813D3B5
-:1013600008F1150315FB02FC13F80C30062B25D0F1
-:1013700008F108066B43F358994222BF08F11503A0
-:101380006A439A5CEED219E01146337869439A4277
-:101390000BD008F1140308F1150C5B5C15FB03F589
-:1013A0000CF805407A753B7500E07A7508F1140277
-:1013B0005454317871703470BDE8F6811146694338
-:1013C00008F115035B5C062B04D008F1140615FB2D
-:1013D00003F574557B753A7508F115025454EBE723
-:1013E000F8B5DFF86434DFF85C541E781824024640
-:1013F0006243B0422A4404D118785870507D187066
-:101400000FE0167D507D92F815C005F11507664373
-:10141000062807F806C004D0167D143514FB00F426
-:101420002E55012010731878062802BF00294FF0AE
-:10143000FF315960F1BD10B5DFF80C44606810F160
-:10144000010F0FD0FFF75CFF6168DFF800248142D5
-:1014500061683CBF5388C918081A5178484311780D
-:10146000C84000E0002080B210BD2DE9F84FDFF841
-:10147000DC53DFF8DCB3D5F80880D8F80000DBF8DF
-:1014800000104A0500F090F9DFF8BC63DFF8B4A360
-:1014900021F4806181604FF0180934780AF1080066
-:1014A00019FB04F14758FFF7C6FF874217D2002700
-:1014B0000121B170062C3DD019FB04F40AF108019A
-:1014C0000AF108020959814223BF0AF108010959AA
-:1014D000091A002111510AEB04014C7DEAE7A988A1
-:1014E0004118B94202D2AF880021E2E73F1ADFE794
-:1014F000022802DA2878012800D07F1ED8F80000E0
-:10150000C1684A07FAD500F055F9DBF80C00000C69
-:10151000BFB247EA0047CBF80C70FFF7F1FE7060EE
-:10152000A8680068816841F480618160AFF3008041
-:10153000BDE8F18FB8B20028DAD1FFF7E1FE7060A4
-:101540000320BDE8F24F00F0E2B92DE9F843EFF3D4
-:10155000108872B6BD4DBB4BA8680168CA224A62AA
-:1015600053204862B84A886820F480608860182058
-:101570001678374647431F44387B022826D13C68FB
-:10158000D7F810909078F0B17A7B012A0AD1012126
-:101590003046FFF725FF88F310887968304600F061
-:1015A00016F904E088F31088304600F0C1F8A86806
-:1015B0000068CA21416222465321416248463146B1
-:1015C00000F050F90BE0FFF750FF06E0C868420753
-:1015D000FCD500F07EF89F49086088F31088FF2151
-:1015E000A86802685162BDE8F183F8B5974CA16024
-:1015F000CA2209684A6253224A62954A136843F034
-:1016000020031360136803F00703C3F1040323707E
-:1016100095682D0C05F07F056D1C6570EDB2926824
-:10162000C2F30E02521C628092B2521E6A43A2F5AD
-:10163000A072DA404FF6FF739A422CBFA380A280BB
-:10164000854A136843F400231360844B1D6845F4F6
-:1016500000251D6048BB7C487A4E01238370182505
-:101660004FF0FF33436000235FFA83FC06F10C0761
-:1016700015FB0CFC4FF0000E07F80CE05B1CDFB212
-:10168000062FF1DB06230370886820F480608860F1
-:1016900000F01FF8D060032000F044F9A16808684A
-:1016A000826842F48042826005E0C868410544BF18
-:1016B000032000F02CF9A1680A68FF205062002284
-:1016C0000321032000F0ECF8BDE8F240032000F015
-:1016D00004B9C86800F0800060F49060C8604FF4FE
-:1016E00000207047F0B504460025EFF3108672B66F
-:1016F0001827DFF850C10CF10C0007FB05FE10F8AD
-:101700000E0010B16D1C062DF5DB062D0CD06F43BD
-:101710000CEB07000127077386F3108804614273FE
-:1017200003600D700020F0BD86F310880120F0BD2D
-:10173000F8B50746EFF3108472B6032000F0D8F82E
-:10174000424DAE683068CA2141623A465321416237
-:10175000182043494243895C02291BD100213846A5
-:10176000FFF73EFE3848017806290ED13068384927
-:101770000A68530500F018F821F480618160C1689F
-:101780004A07FCD500F016F804E04078884218BFFC
-:10179000FFF76BFEA9680A68FF205062032000F083
-:1017A0009CF884F31088F1BD02D5C1684A07FCD4C7
-:1017B00081687047C16801F0800161F49061C16087
-:1017C0004FF4002023490860032000F0ABB82DE956
-:1017D000F04180460F46424618201A4942438C1871
-:1017E000207B022804BF4046FFF7A2FFEFF31085DD
-:1017F00072B6032000F07CF8144EB0680068CA216D
-:1018000041625321416202202073A7606760404615
-:10181000FFF781FD0C490A784978914202D0FFF721
-:1018200024FE02E0A168081AA060FF20B1680A68DF
-:101830005062032000F051F885F31088BDE8F08174
-:10184000282800405803002080050020440500207F
-:10185000082800400C08005800080058800800586C
-:1018600064030020104700000901020081B002D487
-:101870003248815405E0324802F00F02104400F86B
-:10188000041C01B070472F4A13684FF6FF01000295
-:101890000B4000F4E06018432B4908431060704788
-:1018A00038B5284B1C68C4F30223C3F10704052C88
-:1018B00028BF04241D1D072D34BF0023DB1E012576
-:1018C00005FA04F4641E2140994005FA03F35B1EF7
-:1018D0001A401143BDE83440C6E7010007D4012295
-:1018E00000F01F01194B8A40400943F8202070473F
-:1018F00001000BD4012200F01F01154B8A40400962
-:1019000043F82020BFF34F8FBFF36F8F7047010064
-:1019100007D4012200F01F010E4B8A40400943F812
-:1019200020207047010007D4012200F01F010A4B5C
-:101930008A40400943F820207047000000E400E09E
-:1019400018ED00E00CED00E00000FA0500E100E019
-:1019500080E100E000E200E080E200E010B58EB03F
-:1019600002A80FF24441DFF8AC43302200F044FA01
-:101970000FF2F1300190009469460FF2D130DFF898
-:10198000984300F07DFA0121022000F058FBDFF8B7
-:101990008C230021202000F0E8FB02A800F05CFC72
-:1019A00000F0E3F800F060FC0FF2E52200210120D6
-:1019B00000F0DBFB0FF209320021022000F0D5FB22
-:1019C000002084F89000202000F0EDFC00F020FDC5
-:1019D0000FF25D33002204F191010020FFF782FE37
-:1019E0000EB010BDF0B5064685B07078CA4FCC4D2C
-:1019F0000021052807F1900450D03E285ED0FF2832
-:101A00000DD101202872B6F8030004283ED040F220
-:101A10000741884204D040F60201884214D089E090
-:101A20007079022804BFB1790029F8D1002000F0B4
-:101A30007DFEA17801297DD1207806287AD0002169
-:101A4000022000F09FFB75E0002000F0ACFCF07974
-:101A5000287301243089E88171892982B2896A82D8
-:101A6000F389AB82308A04940090E8822C7BF88C56
-:101A7000039410250295019500F0A3FE10B10220F9
-:101A800000F04AFE202000F08EFC53E0012000F020
-:101A900043FE60780A21FFF79AFE4BE0B088F98C8C
-:101AA000884247D10020F88420700120287200204D
-:101AB000688105F1080000F0C8FC3BE0F0780128DF
-:101AC00002D0022810D035E00621B6F805002170BA
-:101AD000F88400216881297205F1080000F0B5FC46
-:101AE000F88C00F0F7FE25E0727B707910BB1FE0E8
-:101AF00073187018DB7B807BFF2B17D1072815DB51
-:101B000073181B7C012B02BF73185F7C832F0DD1D0
-:101B10000123A370F3792B70337A6B70737AAB70F7
-:101B2000B37AEB70F37A2B71337B6B71401C4118E5
-:101B30009142DDDB012005B0F0BD7749CA8C8242BD
-:101B400002D191F8900070470020704780B500F0F6
-:101B5000A2FD062805D0BDE804400021012000F0C8
-:101B600011BBBDE8014000F082BC18B589B000206F
-:101B7000ADF81A0000F06CFF6A4C216811F1010FFA
-:101B80000DD0694862680170120A0B0A090C817055
-:101B9000437061680271C170120A427105E0002051
-:101BA00000F07AFF08B90FF2D81002460621002093
-:101BB00000F0C4FB4EF66E50089007AA2068564C01
-:101BC000079006212E2000F0B9FB0FF2BC12102165
-:101BD000182000F0B3FB0FF2C0121021082000F013
-:101BE000ADFB1821012000F0D0FB00F02CFE0DF120
-:101BF000160006A90190009105AB072200210520DF
-:101C000000F0A8FF0FF27010BDF818100090072325
-:101C1000BDF81400002200F02DFE0DF11A00009016
-:101C20000223BDF81610BDF81400002200F022FEB9
-:101C30000020207000F042FF012060700020E07062
-:101C4000082060751020A075012020753748A0611C
-:101C50000120A0700020C1B221440871401CC1B213
-:101C60001029F8DB002004900023A069617803901C
-:101C70000022207D0290A07D0190607D0090A078E0
-:101C800000F035FFA07808B100F09CFF0AB010BD4D
-:101C9000214890F89010062900D1704780B50020A7
-:101CA00000F03AFD4FF4487101230022084600F08D
-:101CB000A4FF20B1BDE80240022000F02DBD01BD0F
-:101CC00030B5154C94F89000062887B01FD010212D
-:101CD000069105914FF4FA7004905021002302916F
-:101CE00000200393009028254FF4487101950022AD
-:101CF0000B4B084600F0A6FF18B9042184F8901099
-:101D000005E0022000F008FD002084F8900007B0F4
-:101D100030BD0000A0080320C4020020BF1E000840
-:101D2000DC0400208075FF1F5005002007B2010071
-:101D3000012000F0FBBC0021202000F023BA01208C
-:101D400000F042BA012000F047BA000010B5044686
-:101D5000616801F1080000F0B4FA00B101202070C0
-:101D600010BD000010B1012803D070473F2000F0E3
-:101D700019BA3F2000F01EBA53544D333257420077
-:101D8000AA55443322AA0000123456789ABCDEF0D9
-:101D9000123456789ABCDEF0FEDCBA09876543211E
-:101DA000FEDCBA0987654321000000000000000046
-:101DB00000000000000000000000000044000800D7
-:101DC000400508013A799C00F4010001FFFFFFFF84
-:101DD000480101000000000062B38B0708D0521ECA
-:101DE00011F8013B00F8013B00F024808B07F6D18D
-:101DF000830740F0208000BF103A07D330B4B1E829
-:101E00003810103AA0E83810F9D230BC530724BF7C
-:101E1000B1E80810A0E8081044BF51F8043B40F8AE
-:101E2000043BD20724BF31F8022B20F8022B44BF19
-:101E30000B7803707047121F17D35B0009D151F85C
-:101E4000043B20F8023B1B0C121F20F8023BF6D289
-:101E50000BE051F8043B00F8013B1B0A20F8023B61
-:101E60001B0C121F00F8013BF3D238BF121D521E8B
-:101E700024BF11F8013B00F8013BF8D8704700007F
-:101E80007FB50C46684D6168684EE8612962284656
-:101E900000F050FF246805F1240000604060746089
-:101EA00006F108000060406001203070296829B107
-:101EB0000FF2411000900294684688477FBD3EB5FE
-:101EC000594C5A4D02E0009800F0DCFF05F1080083
-:101ED00001F029F8D8B92878002818D0694605F10A
-:101EE000080001F049F801202870E1690029EAD0D2
-:101EF0000098029001A888479DF8040028700028E7
-:101F0000E1D1009905F1080001F016F8DEE737BDD0
-:101F10002DE9F8430646002000F05FF87488308809
-:101F2000B268DFF80481C4F3090444EA8024F0684D
-:101F3000A4B2C1B2204600F03CF8002748F2E809FC
-:101F40004846FFF7FFFE08E06888A04202D13169E9
-:101F500028780870687800B1012708F1240000F0A3
-:101F6000E2FFF0B9694608F1240001F005F8009895
-:101F700000F10B05407A0F28E6D0B5F80110A14218
-:101F80000DD10098817AC81E7169C0B28842C8BF5D
-:101F90000846706102463069E91CFFF71DFF28788A
-:101FA000D9E73800CCD0012000F017F80020BDE8B8
-:101FB000F28310B513461D4A5468A4F80900E17273
-:101FC0000A46194604F10C00FFF706FF164A13698A
-:101FD000BDE810400021002018471349096A82B06B
-:101FE00008B921B101E011B1012002B0084702B0E7
-:101FF0007047000010B50146487A0F2818BF0E2818
-:1020000007D10B4800F0A2FFBDE810400020FFF709
-:1020100096BE064C04F1080000F098FF04F1080099
-:10202000BDE81040FFF787BE6804002024050020AB
-:102030008C0400201948002101604160704710B5F0
-:1020400000F00CF85C6819B1012904D1204301E0CB
-:1020500024EA0000586082F3108810BDEFF310826C
-:1020600072B60E4B704738B5EFF3108472B60B4959
-:102070000B4D086820B129688847686880470AE0E6
-:10208000486820B1A9688847E868804703E0286964
-:1020900080476869804784F3108831BD5805002067
-:1020A000004000082DE9FC47554CDFF85891A56920
-:1020B0002840A0614FF0010A4FF0FF3830E0491C82
-:1020C00054F831000642FAD004EBC1071840796891
-:1020D0001040014208BFC7F804807E68304000F01D
-:1020E00093F860620AFA00F086437E60EFF3108195
-:1020F00072B6626A20690AFA02F2D2431040206185
-:10210000022004EBC00353F8086C1640401E43F84D
-:10211000086CF6D181F31088606A59F8201088475E
-:1021200063692069A2691840104207D0E069216AFA
-:10213000084203D1002103EA0206C1E7C046C046B7
-:10214000EFF3108972B6216960690140A06901420C
-:1021500001BFE169206A014200F089FF89F310881C
-:10216000C046C046A561BDE8F38738B51446EFF315
-:10217000108572B600F048F8224941F8204085F3F6
-:10218000108831BD10B5EFF3108272B61C4B1C697C
-:1021900004431C6153F83140204343F8310082F37B
-:1021A000108810BDEFF3108172B6154A536923EA07
-:1021B000000005E0EFF3108172B6114A536918432D
-:1021C000506181F310887047EFF3108172B60C4AAA
-:1021D000D3691843D061F4E770B5094C656A266A83
-:1021E0002062012101FA05F502E0284600F041FFD6
-:1021F000216AE0690842F8D088432662E06170BD38
-:1022000004000020E803002002460020110C09040D
-:1022100004BF1020120412F07F4F04BF08301202D6
-:102220000FF2180112F0704F04BF001D1201120FBF
-:10223000C0F11F00895C401A7047000004030202CD
-:1022400001010101000000000000000000F070FF2B
-:102250009DF80E0005B000BDF8B500F10C026B460C
-:1022600021214FF66640F1E780B53249002008751C
-:10227000002231480271C046C046C046C046C04632
-:10228000C046C046C046C046C046C046C046C0461E
-:10229000C046C046C046C046C046C046C046C0460E
-:1022A000C046C046C046C046C046BDE8014000F03A
-:1022B0008FBF21490A7941F822000879401C087132
-:1022C000704770B504466078FF2802BFB4F8031069
-:1022D00001F47F41B1F5406F1FD10025154E317DCE
-:1022E000E8B2884222D2E9B256F821102046884747
-:1022F000002808BF6D1CF2D018E0761C2979F0B2D6
-:1023000088420AD2F1B255F82110204688470100D0
-:10231000F3D002D0022805D006E02046BDE8704088
-:10232000FFF760BB002070BD012070BD0026024D8C
-:10233000E4E700000C0500207805002018B50C46E5
-:10234000C7B0114600228DF800208DF81C008DF8D2
-:102350001D4022460DF11E0000F03BFF00F03BF84F
-:102360003F200C21ADF80400ADF8061007A80121AC
-:1023700003900691A41C049400F043F800284CBF7D
-:10238000FF209DF8000048B010BD00B5C7B000F0B8
-:102390001BF80F2000F02AF800284CBFFF209DF802
-:1023A000000047B000BD00B5C7B00021ADF81C006B
-:1023B00000F016F8182000F019F800284CBFFF2094
-:1023C0009DF8000047B000BD00228DF800208DF878
-:1023D0001C008DF81D101822002101A800F0FFBE7E
-:1023E0008DF80010182201A800F0F9BEADF8060023
-:1023F00007A9022004903F22012003910690ADF826
-:102400000420CDF814D0002101A8FFF781BD000001
-:1024100080B50FF2252200210420FFF7A6FE0FF25F
-:10242000F51200210820FFF7A0FE9C480021018042
-:10243000C18081700121C1700021017101720FF210
-:102440003900BDE80240FFF734BF0278934912B16A
-:10245000012A03D070474088C88070470020C88098
-:10246000087A08B100220A72002000F05FB900214A
-:102470000820FFF787BE0000F8B504466078FF2803
-:1024800011D1864DB4F80300698940F60442801AE0
-:1024900072D0801E41D0001F06D0401F00F09480F3
-:1024A000401E00F0AA80AFE0B4F80560287A58B169
-:1024B0000846FFF742FB297A062908BF0028F2D117
-:1024C00028724FF6FF7068816E81E179207A90FB67
-:1024D000F1F01429C0B2E6D1102200234FF640617A
-:1024E000DEB28642DFDAA618777A96F80AC047EAA3
-:1024F0000C278F420DD116F8077D96F801C047EAE8
-:102500000C27AF81B778F67847EA0627EF810827CE
-:102510002F72921DD2B25B1CE2E700F077F802BF87
-:102520001121E07915286FD1227A501E20724FF6C2
-:1025300042624FF64163207A002865D0661804F1A4
-:102540000A07707A7F5C40EA0720771F98423E783E
-:102550007F7846EA072605D0904206D10A202872E5
-:10256000AE8202E0092028722E821531207AA0F175
-:1025700015062672C9B2DEE700F048F801BF207ADE
-:102580000021E279012A3FD1002342F60212DEB295
-:10259000B6EB900F38DA671804F10A0C97F80BE0E5
-:1025A0007E7A3F7B1CF801C04EEA0727974204BFA2
-:1025B0002F7A0A2F46EA0C2602D1EE820B262E72C3
-:1025C000091DC9B25B1CE2E700F020F802BFB4F8B5
-:1025D0000700A98A884217D1607A022802BFA07A30
-:1025E0006870012810D1E07AA87010B900F09EF848
-:1025F0000AE0002000F090F806E000F007F803D1B0
-:1026000000210420FFF7BEFD0020F2BDB4F8050054
-:102610008142704710B5214C2079401E8041C00F87
-:102620002071207A38B1218A6089E31CBDE810400E
-:10263000022200F0BDB910BD1CB5184C227A012051
-:10264000ADF8000032B3083A6089E18A042A21D843
-:10265000DFE802F003080A101A00E289A18900F0FD
-:1026600053F913BD218A00E0A18A8A1C92B200F0BE
-:102670005CF913BD6B46022200F06DF90620207252
-:10268000022000F053F813BD6B46022200F063F9FC
-:102690000620207213BD0148007A7047F404002020
-:1026A000404981B00A6802430A6009680840009006
-:1026B000009801B0704778B585B00446684614218B
-:1026C00000F098FD0CB9012004E0012C18BF022C89
-:1026D00002D10220FFF7E4FF00F012F8009501207C
-:1026E000019000210220039000F004F800F00EF8A1
-:1026F00006B070BD0291694656F8240000F07EBD18
-:102700000FF2B000284E30F81450704756F82400ED
-:102710000022294600F036BE0FF29801224B31F814
-:10272000101053F82000012200F02CBE0FF284019B
-:102730001D4B31F8101053F82000002200F022BE8B
-:10274000F0B585B004460D466846142100F052FDF0
-:102750000120FFF7A5FF2800144E0FF260070AD1F1
-:1027600037F814000090002101910120029002210D
-:102770000391FFF7C0FF012D12D137F8140000902C
-:1027800001210B480190FFF7B5FF0FF23400045D03
-:1027900000220F2160B2FFF783F860B2FFF79DF8C7
-:1027A00005B0F0BD4C000058380000204400002067
-:1027B00000002110100001000200000000040000D1
-:1027C00028002DE9F841C7B04FF00008ADF81C0013
-:1027D000DDF838C14F9E509F519D529C8DF800806E
-:1027E00007A84180ADF82020ADF82230A0F808C03D
-:1027F000ADF8266087818DF82A508DF82B4000F0C7
-:1028000015F84FF4C170ADF8060007A91020049028
-:102810003F2201200391069000F00DF800284CBFE4
-:10282000FF209DF8000048B0BDE8F081182200218B
-:1028300001A800F0D4BCADF80420CDF814D00021DC
-:1028400001A8FFF765BB00B587B000208DF8000038
-:1028500000F07CF840F20110ADF806003F220120A4
-:10286000069000F0EDF800284CBFFF209DF8000016
-:1028700007B000BD30B5C7B01C464A9B00F0C7F892
-:1028800000258DF800508DF82140224619460DF1A3
-:10289000220000F09EFC00F059F83F204FF48371B5
-:1028A00000F0BCF8A41D049400F0CCF800284CBF44
-:1028B000FF209DF8000047B030BD0023ADF81C009C
-:1028C0008DF8003007A8418082800021182201A8DD
-:1028D00000F085BC00B5C7B000F010F8FFF7F6FFB8
-:1028E0000F2102914FF48970022100F0A1F8002815
-:1028F0004CBFFF209DF8000047B000BD0021ADF89F
-:102900001C008DF80010704700B5C7B0FFF7D5FF69
-:102910000F21029140F2151000F089F800284CBFF9
-:10292000FF209DF8000047B000BD00B5C7B0FFF71D
-:10293000C4FF0F21029140F2171000F078F8002830
-:102940004CBFFF209DF8000047B000BD18220021B9
-:1029500001A800F044BC18B5C7B000F011F800F0B1
-:1029600045F8FFF7F3FF40F2211100F013F800F0F3
-:1029700069F800284CBFFF209DF8000048B010BD4A
-:102980001446ADF81C00002207A88DF800204180F5
-:1029900004717047ADF806103F2007A9ADF8040098
-:1029A00003910F20012102900691641D0494704749
-:1029B00018B5C7B000F010F8FFF7C8FF3F2040F28D
-:1029C000231100F019F800F03DF800284CBFFF205B
-:1029D0009DF8000048B010BD144600228DF800207C
-:1029E000ADF81C00ADF81E108DF8204022461946A7
-:1029F0000DF1210000F0EDBBADF80400ADF80610BC
-:102A000007A8012103900691641D04947047ADF856
-:102A10001C00ADF81E108DF820207047ADF80400A2
-:102A2000ADF8061007A80121039006917047062112
-:102A3000ADF80600049107A801213F2203900691FA
-:102A4000ADF80420CDF814D0002101A8FFF760BA3A
-:102A500000B587B000F010F8012003220690ADF811
-:102A60000420ADF8062000F011F800284CBFFF202C
-:102A70009DF8000007B000BD00208DF8000018226E
-:102A8000002101A800F0ABBB03900691CDF814D053
-:102A9000002101A8FFF73CBA01460648064AC3795F
-:102AA0008B4218BF904218BF0838F8D18B4218BF2C
-:102AB00000207047F873FF1F0070FF1F00B5C7B0FC
-:102AC00000F00CF8852000F075F800F014F90028EB
-:102AD0004CBFFF209DF8000047B000BD00218DF8DD
-:102AE0001C008DF80010182201A800F078BB2DE919
-:102AF000F841C7B04FF0000800F026F80DF12300B0
-:102B0000DDF844E14E9F4F9E509D529C8DF81F3042
-:102B1000C0F800E08DF800808DF820708DF82160FD
-:102B20008DF822508DF8274000F087F88620ADF808
-:102B3000060007A90C2000F0DAF800284CBFFF209F
-:102B40009DF8000000F0F2B88DF81C0007A8417055
-:102B500082707047F8B5C8B005460E4617461C4649
-:102B600000F023F808A8467087708DF8205000F018
-:102B7000D8F88A21ADF80A103F20032100F0C4F8EC
-:102B8000002848BFFF200ED49DF8000058B94F9987
-:102B90004E98BDF801202280BDF803200280BDF8C8
-:102BA00005000880002049B0F0BD072200216846DA
-:102BB00000F015BBADF8060007A901203F220391E4
-:102BC0000490704700B587B000F013F800F035F8B6
-:102BD000922000F009F800F08EF800284CBFFF208A
-:102BE0009DF8000007B000BDADF806003F220120AF
-:102BF000704700208DF80000704718B5C7B000F08E
-:102C000011F800F01AF80F2102919720062100F028
-:102C100065F800F071F800284CBFFF209DF8000017
-:102C200048B010BD0024ADF81C008DF8213007A875
-:102C3000418002718DF8004070471822002101A8E0
-:102C400000F0CDBA2DE9F04F0646C7B000F020F8ED
-:102C500000F012F8FFF7F1FF3F20ADF804009C21CF
-:102C600000F030F800F04AF800284CBFFF209DF833
+:1003B00095F82802012801D1022032BD012085F8DC
+:1003C0002802286800F0DFFB24B9286805F50C71C5
+:1003D0000020C046002085F8280232BD10B5044632
+:1003E00001F00F0362689A4201D2012010BD00F0B3
+:1003F00013F80023837000F008F801D1022010BD2B
+:1004000000F019F800F0D8FB98E601F00701017040
+:1004100094F828120129704701F007000A0604EB3E
+:10042000401003D5283001234370704700F59470C5
+:10043000002242707047012284F828220146206879
+:1004400070472DE9F84F00F5947500F12406074632
+:1004500026E0018848F60F72114041F40041018006
+:100460003868B0F85010327901EBC203C01800F2BE
+:1004700002400088B269C0F3090030620244B261F0
+:100480000021384600F026F932784AB1F06938B9CF
+:100490003178386841F08001A0F84C1000213170AB
+:1004A000386800F144010A88130440F1E9800A88A1
+:1004B00012F00F0A59D1D206CBD50288130511D5F7
+:1004C000898900F0E0F8EA88C3F30903EB6107F5D6
+:1004D0000C7100F0C8FB386800F0DDF8384600F019
+:1004E000EBF8DDE71104DBD500F0D5F83868B0F89B
+:1004F000501000F0C8F8C3F30903002BEB611CBFD8
+:10050000696900290AD0EA8800F0ADFB6869E969E9
+:10051000014469613846002100F0D4F83868B0F829
+:1005200050104118286901F2064120B9088848F2A4
+:10053000FF32104009E03E2805D24208C00748BFFC
+:10054000521C900203E04009800240F40040088001
+:100550004BF68F7238680188114081F4405141F4A4
+:10056000004141F0800101809AE730F82A805FEA7B
+:10057000084207EB4A195AD530F82A1040F68F7214
+:10058000114041F0800120F82A1009F59474386870
+:10059000217B69B9B0F85010237801EBC30100F05A
+:1005A00082F830D0E28861695B4600F05CFB2AE0AB
+:1005B00021780B4630F8232053040BD5B0F8502097
+:1005C00002EBC101421802F2024200F06FF80DD0B6
+:1005D000228907E0B0F8503003EBC10100F063F866
+:1005E00004D062895B46616900F03DFB3968207880
+:1005F00031F8202048F68F731A4042F4004242F04E
+:10060000C00221F82020E1695944E16162695A443D
+:100610006261A36913B121698B4504D22178384600
+:1006200000F050F803E021783846FFF780FE5FEADB
+:10063000086021D5396831F82A2048F60F731A402E
+:1006400042F4004209F1280021F82A203A68017892
+:10065000B2F8503003EBC1031A4402F2024212888E
+:100660004369C2F30902C2611A4483694261002BE3
+:10067000384602D100F02EF812E7FFF767FE0FE7C9
+:100680000020BDE8F28F2A7801EBC203C31803F201
+:1006900006431B887047018840F68F72114041F075
+:1006A000800101807047421802F206421188C1F3AE
+:1006B000090BBBF1000F704700F50C71D0F8700208
+:1006C00000F0F4BA00EB4112D0F87002D2F83C21ED
+:1006D00000F016BB00EB4112D0F87002D26B00F0B4
+:1006E00050BBD0F8700200F0E0BB10B50446D4F85F
+:1006F000700200F09DFBD4F87002BDE810400121AB
+:1007000000F0BFBBD0F8700200F0BEBBD0F87002A2
+:1007100000F0C2BB10B51C461346D0F8C0022246FA
+:10072000FFF7DBFD002010BD80B5D0F8C002FFF759
+:1007300022FE002002BD80B5D0F8C002FFF74EFEB9
+:10074000002002BDD0F8C00201F07F02090600EBD4
+:10075000421002D590F82A00704790F82A0170479D
+:1007600080B5D0F8C002FFF7A9FD002002BD80B51A
+:10077000D0F8C002FFF7EAFD002002BD80B5D0F836
+:10078000C002FFF7D4FD002002BD30B4002513E005
+:1007900050F8042BD30744BFA9F101039A18091F8D
+:1007A000042942F8045BFAD213468C0744BF158033
+:1007B0009B1CC90748BF1D7050F8041B0029E7D1D6
+:1007C00030BC70472DE9F0470B4602461C7832F8E2
+:1007D0002460DD7848F68F1100200E40032D0CD8E0
+:1007E000DFE805F002080C0546F4007606E046F462
+:1007F000C06603E046F4806600E0012048F2800510
+:100800002E4322F8246048F68F7619780C4632F889
+:10081000247037403943294322F824104BF68F7750
+:10082000197B93F800A000294CF2800C48F6BF7E9B
+:1008300048F2C00862D1D9884FF6FE740C4059784E
+:100840000029B2F8501011441DD001EBCA0101F586
+:1008500080610C80197832F82140640606D532F8A0
+:100860002140264048EA060622F821601978DB7804
+:10087000012B32F821300EEA03030EBF1D4383F033
+:1008800020031D43C2E001EBCA0A0AF2044AAAF897
+:100890000040B2F850105418197804EBC1041969DB
+:1008A00004F2064431B9B4F800E048F2FF3101EA3D
+:1008B0000E010CE03E2908D24FEA510EC90748BF8D
+:1008C0000EF1010E4FEA8E2E03E04909890241F430
+:1008D000004EA4F800E0197832F82140640406D5EF
+:1008E00032F8214026404CEA060622F821601978A9
+:1008F00032F821301F4087F4405786E032F82A1042
+:10090000314041F4014141F0800122F82A10B2F84F
+:100910005010B3F808A05418197804EBC10404F57A
+:1009200080644FF6FE7101EA0A012180B2F850108E
+:100930001C78511801EBC409598909F204494FF692
+:10094000FE742140A9F8001059781C78002932F86B
+:1009500024102CD1490406D532F8241031404CEA39
+:10096000010122F82410197832F82140640606D5D6
+:1009700032F82140344048EA040422F82140197832
+:1009800032F82140264048EA060622F8216019780C
+:1009900032F82140274087F440572F4322F8217036
+:1009A000197832F821300EEA03031D432EE0490482
+:1009B00006D532F8241031404CEA010122F8241007
+:1009C000197832F82140640606D532F821403440C7
+:1009D00048EA040422F82140197832F821402640E0
+:1009E0004CEA060622F82160DC781978012C32F8EE
+:1009F00021400EEA040418BF84F020042C4322F89E
+:100A00002140197832F821301F403D4322F821500F
+:100A1000BDE8F087F8B50E46054672783469B069CE
+:100A2000012A48F2800748D1844232BF001B0446A5
+:100A30000020B061307B40B9F28800F099F800F0F6
+:100A40009BF800F2024004802EE03078C10035F8B7
+:100A500020004206B5F85000284405D5091801F2D7
+:100A600006410C80728904E0091801F202410C80F1
+:100A7000328900F07DF8707848F68F7140B930788F
+:100A800035F82020114041F4004141F0C00109E057
+:100A9000012809D1307835F82020114041F4404137
+:100AA00041F0800125F82010317835F8212048F6F2
+:100AB000BF70024082F030024EE0844232BF001B21
+:100AC00004460020B0616009317B8302002943F4B1
+:100AD000004304F001004FEA540C18D0AAB900F00A
+:100AE00040F801F202413CB9B1F800E0202262F383
+:100AF0008F2EA1F800E008E03E2C05D2624600B13E
+:100B0000521C92020A8000E00B807178A9B900F0B3
+:100B100028F801F206412CB90A88202060F38F22C0
+:100B20000A8011E03E2C06D208B10CF1010C4FEA0C
+:100B30008C20088008E00B8006E0012904D100F039
+:100B40001BF800F2064004804BF68F70317835F8C0
+:100B50002120024082F44052174325F821700020E2
+:100B6000F2BDB5F850103278691801EBC201704738
+:100B70007169A3B2284665E0B5F8500031782818AD
+:100B800000EBC100704710B50A78497830F8224070
+:100B9000002948F2800305D048F6BF710C4084F06C
+:100BA000100404E04BF68F710C4084F4805423430E
+:100BB00020F82230002010BD30B50A7B002A36D143
+:100BC0004A780C78002A30F8242048F2800348F64E
+:100BD0008F7516D0520608D530F82420154045F4FC
+:100BE000004545F0C00520F82450CA78012A1ED0DF
+:100BF0000A7830F8224048F6BF710C4084F0200497
+:100C000012E0520408D530F82420154045F4404540
+:100C100045F0800520F824500A7830F822404BF641
+:100C20008F710C4084F44054234320F8223000207C
+:100C300030BD11B98021A0F84C1000207047B0F8E9
+:100C40004400704710B580185B1C00F580605B089D
+:100C500007E00A784C7842EA0422891C20F8022B2B
+:100C60005B1EF6D110BD10B5821802F580625808DF
+:100C700006E032F8024B0C70240A4C70891C401EAE
+:100C8000F7D1D80744BF1088087010BD10B5D0F850
+:100C9000B42202241AB11268904700B900242046F9
+:100CA00010BD80B5D0F8B42253680AE138B50446C7
+:100CB00004F52A75284600F0F5FA04F5257001219F
+:100CC0000160428B017D426011F01F0003D00228B9
+:100CD0000BD005D30EE02946204600F0F5F80DE0D4
+:100CE0002946204600F09AF908E02946204600F0FF
+:100CF000BCF903E001F0800100F040F8002032BDB3
+:100D000038B5044610460A0004F5257329D1196840
+:100D100003291ED104F5B0714A680D68AA420BD2AE
+:100D2000AD1A0D60954238BF2A46014692B2204660
+:100D300000F0E8FA002032BD196A086928B1187A73
+:100D4000032802D1096920468847204600F0E2FACC
+:100D5000F0E70529EED100201860002100F00EF820
+:100D6000E8E71A6A906930B1187A032803D19269CA
+:100D700020469047DEE7022032BD80212046FFF763
+:100D8000D3BC38B504460800134604F5257543D195
+:100D90002868022833D1226A616A914207D2521A26
+:100DA0002262194692B2204600F0A4FA11E0E269EC
+:100DB000B2FBF1F001FB102090B98A4210D36868B1
+:100DC00082420DD200220021204600F093FA00203A
+:100DD00068600023002200212046FFF7CFFC14E0CA
+:100DE000296AC86828B1287A032802D1C968204630
+:100DF0008847FFF7C2FF204600F093FA05E0042879
+:100E000018BF002801D1FFF7B8FF287B012804BFD5
+:100E100000212973002032BD2A6A506930B1287A36
+:100E2000032803D1526920469047F3E7022032BDE0
+:100E300038B50446402300220021FFF76BFC04F57F
+:100E4000AC70012140220160C26040230022802159
+:100E50002046FFF75FFC0120402104F52572A061C8
+:100E6000616210720021116061600025506A156195
+:100E700028B1126A61685368C9B2204698470020B9
+:100E800032BD01740020704700F5277004220178FC
+:100E9000417002700020704700F527700178042926
+:100EA00004BF417801700020704780B500F52771BC
+:100EB0000A78032A03D18969C96901B188470020EA
+:100EC00002BD9847002002BDF8B500F0C8F804F54F
+:100ED000277608D0202818BF402850D1B2699368DF
+:100EE0002046984795E06878092848D8DFE800F060
+:100EF0006E864780470905475C25204600F04AF981
+:100F000087E0A888002804BFE888002837D16F88C8
+:100F1000802F34D23078032807F07F072FD0B770A6
+:100F200039462046FFF71CFC00F031F9002F07BFBF
+:100F300001213170022030706BE0374F68883870C3
+:100F4000397802291BDA3378022B08461AD0032B92
+:100F500023D131B90220307061602046FFF7A1FE35
+:100F600055E06168884252D0C9B22046FFF799FE29
+:100F7000397861602046FFF789FE022847D100F0EA
+:100F80008EF946E0002942D0606003203070204690
+:100F9000FFF77CFE0228F2D039E000F080F93978C2
+:100FA0002046FFF77EFE34E0E8880128E7D131785B
+:100FB000491E012904D9891EE1D10122211D13E016
+:100FC0000020A060012204F108010DE03078401EED
+:100FD0000228D4D8EA88022AD1D1B068012100B110
+:100FE0000321E16004F10C01204600F07BF910E0E0
+:100FF000688801280DD10121B16008E03078401ED9
+:101000000228BCD86A88012A03D10020B06000F011
+:10101000BEF80020F2BD00009405002038B500F0B5
+:101020001EF81CBF2028402815D104F5277210781F
+:10103000401E02280FD82B79022B0CDA9269936894
+:10104000204698470146E888002808BF002904D1B7
+:1010500000F09DF801E000F023F9002032BD0D46BC
+:101060000446287810F060007047F8B5044608463A
+:1010700004F527730278017912F0600509D0202D5C
+:1010800018BF402D6AD19A69936801462046984757
+:1010900067E002F06002202A06D19A69936801464F
+:1010A0002046BDE8F440184742788AB3012A12D09E
+:1010B000032A53D11B78022B13D0032B4ED1428825
+:1010C0001ABB002918BF80291FD0C088E8B9204664
+:1010D000FFF72AFB19E01A78022A02D0032A0CD063
+:1010E0003CE0002918BF802938D02046FFF71CFBC0
+:1010F00080212046FFF718FB33E0408888BB11F0C1
+:101100007F0F1CBF2046FFF716FB00F040F828E0D9
+:10111000142201F07F051B7855436619022B06F552
+:10112000AA7502D0032B10D018E0002918BF80291F
+:1011300014D1080648BF06F11405002028600222D9
+:101140002946204600F0CEF80BE001F00F0312FB19
+:1011500003F20F06224406D5926972B9014600F0E7
+:101160009FF80020F2BDD2F85821002AF6D00029BD
+:1011700018BF802904D10020E0E706F11405F6E746
+:101180002046FFF7DFFA0028D8D00120D6E7204616
+:1011900000F0C0B838B5044600200D46ADF8000098
+:1011A00004F52C726888030A012B08D0022B23D087
+:1011B000032B2ED0062B5FD0072B64D06CE0126877
+:1011C000207C136869469847BDF8001079B1E9881A
+:1011D00079B1BDF80010EA88914288BF1146ADF898
+:1011E00000100146BDF80020204600F07BF8E8889A
+:1011F00008B9FFF7CCFF31BD207C51680028684654
+:1012000004D1896A884702224270DDE7C96A8847AB
+:10121000F9E7C0B205283FD8DFE800F0030B121948
+:10122000202710684268002A36D0207C6946904703
+:10123000CAE7106882687AB3207C69469047C3E7A2
+:101240001068C26842B3207C69469047BCE71068CA
+:1012500002690AB3207C69469047B5E71068426985
+:10126000D2B1207C69469047AEE7106882699AB196
+:10127000207C69469047A7E7207C68B951684A6B93
+:1012800068469047A0E7207C30B951680A6B6846F1
+:1012900090470721417097E700F002F831BD2946D9
+:1012A000204614E010B50A7802704B7843708A78B3
+:1012B000CB7802EB032444800A794B7902EB0324B8
+:1012C00084808A79C97902EB0123C38010BD10B5EF
+:1012D00004468021FFF728FA2046BDE8104000218F
+:1012E000FFF722BA80B513460222C0F89422C361E8
+:1012F000036201E080B513460A460021FFF737FA82
+:10130000002002BD80B513460A460021FFF736FAD9
+:10131000002002BD80B50421C0F8941200230022F1
+:10132000EBE780B50521C0F8941200230022ECE71A
+:10133000DFF84C150A6892B200E00246086880B2F5
+:101340008242FAD170472DE9F041DFF83865DFF8C5
+:1013500038853178044618256843062908EB0007CC
+:1013600008D130787070347079754FF0FF3070604C
+:1013700000203DE000F07BF8B9680918B96008F179
+:101380000803B96832786A439A589142327813D385
+:1013900008F1150315FB02FC13F80C30062B29D0BD
+:1013A00008F108066B43F358994222BF08F1150370
+:1013B0006A439A5CECD21DE01146337869439A4245
+:1013C0000FD008F1140C08F1150E1CF8013015FBB4
+:1013D00003F50EF805407A753B7508F11402545474
+:1013E00003E008F114037A755C543178717034703D
+:1013F000BDE8F0811146694308F115035B5C062BDB
+:1014000004D008F1140615FB03F574557B753A7585
+:1014100008F115025454EBE7F0B5DFF86834DFF853
+:1014200068541E78182402466243B0422A4404D10C
+:1014300018785870547D1C700FE0167D507D92F81E
+:1014400015C005F115076643062807F806C004D045
+:10145000167D143514FB00F42E55012010731A78F4
+:10146000062A02BF00294FF0FF305860F0BD10B5CA
+:10147000DFF81044606810F1010F10D0FFF758FF3B
+:101480006168DFF8082481422FBF63686168538870
+:10149000CB1851781278181A4843D04000E0002049
+:1014A00080B210BD2DE9F84FDFF8E053DFF8E0B36C
+:1014B000D5F80880D8F80000DBF800104A0500F0E5
+:1014C000A2F9DFF8C063DFF8C0A321F48061816076
+:1014D0004FF0180934780AF1080019FB04F1475855
+:1014E000FFF7C5FF874211D200270121B170062CFA
+:1014F0003FD019FB04F40AF108010A59824210D2C4
+:1015000000230B510AEB04014C7DF0E7A988411838
+:10151000B94202D2AF880021E8E701223F1AB27037
+:10152000E5E70A590AF10803121A1A51EAE70228F4
+:1015300002DA2878012800D07F1ED8F80000C168A0
+:101540004A07FAD500F052F9DBF80C00000CBFB2E4
+:1015500047EA0047CBF80C70FFF7EAFE7060A86816
+:101560000068816841F480618160AFF30080BDE86C
+:10157000F18FB8B20028DAD1FFF7DAFE70600320ED
+:10158000BDE8F24F00F0F5B92DE9F843EFF310880C
+:1015900072B6BE4DBC4BA8680168CA224A6253208D
+:1015A000486218208A6822F480628A60B54A1678F8
+:1015B000374647431F44387B022823D13C68D7F87D
+:1015C00010909078D8B17A7B012A0AD10121304657
+:1015D000FFF722FF88F310887968304600F019F988
+:1015E00004E088F31088304600F0C6F8A86800F0E0
+:1015F0001AF831462246484600F054F90DE0FFF74C
+:1016000051FF08E0C8684207FCD500F086F84FF4A7
+:101610000020A049086088F31088FF22A8680168AC
+:101620004A62BDE8F1830068CA21416253224262E6
+:101630007047F8B5954CA160CA2209684A625323E5
+:10164000934A4B62156845F020051560136803F056
+:101650000703C3F10403237095682D0C05F07F0583
+:101660006D1C6570EDB29268C2F30E02521C62806E
+:1016700092B2521E6A43A2F5A072DA404FF6FF738F
+:101680009A422CBFA380A280834A136843F40023AC
+:101690001360824B1D6845F400251D6048BB7948E6
+:1016A000012383704FF0FF3545600023764D0026FF
+:1016B0000C355FFA83FC182717FB0CFC5B1CDFB2B0
+:1016C00005F80C60062FF4DB06230370886820F40D
+:1016D0008060886000F021F84FF40021D160032081
+:1016E00000F052F9A0680068816841F4804181608F
+:1016F00005E0C868410544BF032000F03AF9A1683D
+:101700000A68FF20506200220321032000F0E6F85F
+:10171000BDE8F240032000F0FEB8C86800F0800089
+:1017200060F49060C86070472DE9F04104460025E0
+:10173000EFF3108672B61827DFF84CC10CF10C0ECF
+:1017400007FB05F81EF8080010B16D1C062DF5DB2F
+:10175000062D0CD06F430CEB07000127077386F3AF
+:1017600010880461427303600D70002002E086F36C
+:1017700010880120BDE8F081F8B50746EFF310842A
+:1017800072B6032000F0D2F8404DAE683068FFF723
+:101790004BFF3B46182042494343CA5C022A1BD1F7
+:1017A00000213846FFF738FE3648017806290ED169
+:1017B000306837490A68530500F025F821F4806144
+:1017C0008160C1684A07FCD500F010F804E0407859
+:1017D000884218BFFFF766FEA9680A68FF205062BA
+:1017E000032000F098F884F31088F1BDC16801F07F
+:1017F000800161F49061C1604FF4002025490860C8
+:10180000032000F0C1B802D5C1684A07FCD4816842
+:1018100070472DE9F04180460F46424618201A498C
+:1018200042438C18237B022B04BF4046FFF7A4FFE2
+:10183000EFF3108572B6032000F078F8134EB0680D
+:10184000FFF7F1FE02202073A76067604046FFF7B4
+:101850007AFD0C490A784978914202D0FFF722FEBE
+:1018600002E0A168081AA060FF20B1680A6850620F
+:10187000032000F050F885F31088BDE8F0810000E7
+:101880002828004088050020580300204C0500202F
+:10189000082800400C08005800080058800800582C
+:1018A00064030020104700000901020002D43C48F4
+:1018B000815470473B4B02F00F021A4402F8041C9B
+:1018C0007047394B19684FF6FF020002114000F4CF
+:1018D000E0600843354908431860704738B5324B1B
+:1018E0001C68C4F30223C3F10704052C28BF042499
+:1018F0001D1D072D34BF0023DB1E012505FA04F44E
+:10190000641E2140994005FA03F35B1E1A401143FF
+:10191000BDE83440C8E7010007D4012200F01F01F0
+:10192000234B8A40400943F82020704701000BD424
+:10193000012200F01F011F4B8A40400943F820207C
+:10194000BFF34F8FBFF36F8F704710B5401EB0F1DC
+:10195000807F01D3012010BD174C60600F214FF034
+:10196000FF30FFF7A1FF0021A160072020600020C9
+:1019700010BD010007D4012200F01F010F4B8A4067
+:10198000400943F820207047010007D4012200F0ED
+:101990001F010B4B8A40400943F82020704700008C
+:1019A00000E400E018ED00E00CED00E00000FA05B6
+:1019B00000E100E080E100E010E000E000E200E093
+:1019C00080E200E038B58EB002A8DFF8A013DFF89F
+:1019D000A0430FF2ED35302200F014FA0094019587
+:1019E00069460FF2C530DFF88C4300F017FA012189
+:1019F000022000F0F6FADFF880230021202000F01A
+:101A000083FB02A800F0F6FB00F0E0F800F0FAFB20
+:101A10000FF2D9220021012000F076FB0FF2FD2207
+:101A20000021022000F070FB002084F890002020AC
+:101A300000F086FC00F0C0FC0FF25133002204F1EC
+:101A400091010020FFF770FE0FB030BDF0B50646E3
+:101A500085B07078C74FC94D0021052807F1900463
+:101A600050D03E2859D0FF280DD101212972B6F857
+:101A7000030004283ED040F20742904204D040F6D2
+:101A80000202904214D07FE07179022904BFB1793B
+:101A9000002979D1002000F013FEA078012873D12D
+:101AA0002178062970D00021022000F03AFB6BE07B
+:101AB000002000F045FCF079287301243189E98188
+:101AC00071892982B2896A82F389AB82308AE8827D
+:101AD000009010262D7BF88C0494039502960196B5
+:101AE00000F047FE10B1022000F0E2FD202000F0DF
+:101AF00027FC49E0012000F0DBFD60780A21FFF7B8
+:101B000088FE41E0B088F98C88423DD10020F884FD
+:101B10002070012200F03BF836E0F078012802D076
+:101B200002280CD030E0B6F80500F88406212170B8
+:101B3000002200F02CF8F88C00F096FE24E0727B76
+:101B4000707908BB1EE073187018DF7B807BFF2F55
+:101B500016D1072814DB1B7C012B02BF73185B7C9A
+:101B6000832B0DD10127A770F3792B70377A6F7013
+:101B7000737AAB70B77AEF70F37A2B71377B6F7132
+:101B8000401C41189142DEDB012005B0F0BD6881A8
+:101B90002A7205F1080000F02BBC7649CA8C8242FB
+:101BA00002D191F8900070470020704780B500F096
+:101BB00040FD062805D0BDE804400021012000F0CA
+:101BC000B0BABDE8014000F024BC000018B589B0EF
+:101BD0000020ADF81A0000F02BFF694C216811F1CC
+:101BE000010F0DD0674862680170120A0B0A090CD8
+:101BF0008170437061680271C170120A427104E021
+:101C0000002000F041FF00B974A002460621002028
+:101C100000F067FB4EF66E51089107AA2068554CFC
+:101C2000079006212E2000F05CFB00BF6DA2102162
+:101C3000182000F056FB00BF6EA21021082000F013
+:101C400050FB1821012000F06DFB00F0D4FD0DF1D8
+:101C5000160006A90190009105AB0722002105207E
+:101C600000F069FF5BA0BDF8181000900723BDF8D5
+:101C70001400002200F0D5FD0DF11A00009002239F
+:101C8000BDF81610BDF81400002200F0CAFD0020B7
+:101C9000207000F00DFF012060700021E17008202D
+:101CA00060751021A17501202075A07000203649B3
+:101CB000A161C1B221440871401CC1B21029F8DBF6
+:101CC000002004900023A169207D0391029000224E
+:101CD000A17D607D019100906178A07800F0FCFE0C
+:101CE000A07808B100F063FF0AB010BD214890F859
+:101CF0009010062900D1704780B5002000F0D8FC74
+:101D00004FF4487101230022084600F069FF20B11A
+:101D1000BDE80240022000F0CBBC01BD30B5154C3F
+:101D200094F89000062887B01ED0102106910591E6
+:101D30004FF4FA7250210023029128200492039359
+:101D4000019000254FF44871009500220B4B084686
+:101D500000F07BFF18B9042084F8900004E0022012
+:101D600000F0A6FC84F8905007B030BD1840000881
+:101D7000A4080320C40200205B1E0008FC0400200D
+:101D80008075FF1F5805002007B20100012000F0F8
+:101D900097BC0021202000F0C4B9012000F0E3B975
+:101DA000012000F0E8B9000010B50446616801F1B7
+:101DB000080000F037FA00B10120207010BD0000CB
+:101DC00010B1012803D070473F2000F0BAB93F207E
+:101DD00000F0BFB953544D3332574200AA55443333
+:101DE00022AA0000123456789ABCDEF012345678DB
+:101DF0009ABCDEF0FEDCBA0987654321FEDCBA0935
+:101E0000876543214AB1000011F8013B521E00F8DA
+:101E1000013B1CBF11F8013BF8E770477FB50C464A
+:101E20006A4D61686A4EE8612962284600F07CFFCD
+:101E3000246805F1240000604060746006F1080029
+:101E40000060406001203070296829B10FF249120A
+:101E500000920294684688477FBD1FB55C4C04F130
+:101E6000080000F06EFFE8B92078D8B1694604F1A7
+:101E7000080000F08FFF012054492070C96941B16A
+:101E80000098029001A888479DF80410217008006E
+:101E900003D0009801F031F804E0009904F1080043
+:101EA00000F058FF04F1080000F04BFF28B920783B
+:101EB00018B104F10800FFF76CFF1FBD2DE9FC41CC
+:101EC0000446002000F05EF866882088A268DFF8EB
+:101ED000FC80C6F3090646EA8026E068B6B2C1B2C5
+:101EE000304600F03BF8002548F2E800FFF758FFC5
+:101EF00008E07888B04202D1226939781170787888
+:101F000000B1012508F1240000F01BFFF0B969467B
+:101F100008F1240000F03EFF0098014600F10B0795
+:101F2000487A0F28E5D0B7F80100B0420CD1887A82
+:101F30006169C01EC0B28842C8BF084660610246DF
+:101F40002069F91CFFF75EFF3878D9E72800CBD06D
+:101F5000012000F017F80020BDE8F68110B5134607
+:101F60001B4A5468A4F80900E1720A46194604F1B4
+:101F70000C00FFF747FF154A1369BDE81040002128
+:101F8000002018471149096A08B921B108470029FA
+:101F90001CBF01200847704710B50146487A0F283A
+:101FA00018BF0E2807D10B4800F0DEFEBDE8104038
+:101FB0000020FFF7F2BE064C04F1080000F0D4FE4A
+:101FC00004F10800BDE81040FFF7E3BE68040020FC
+:101FD0002C0500208C04002019480021016041607C
+:101FE000704710B500F00CF85C6819B1012904D1F4
+:101FF000204301E024EA0000586082F3108810BDFD
+:10200000EFF3108272B60E4B704738B5EFF31084C1
+:1020100072B60B490B4D086820B1296888476A6879
+:1020200090470AE0486820B1A8688047E968884777
+:1020300003E0286980476969884784F3108831BDC7
+:10204000600500207C4100082DE9F041544CDFF888
+:102050005481A5692840A06131E0491C54F8310041
+:102060000742FAD004EBC1071840796810400142DA
+:1020700004BF4FF0FF327A607E68304000F094F881
+:102080006062012101FA00F086437E60EFF3108266
+:1020900072B6606A23698140C9430B402361022004
+:1020A00004EBC00353F8087C0F40401E43F8087C43
+:1020B000F6D182F31088606A58F820108847636967
+:1020C0002069A2691840104207D0E069216A0842DD
+:1020D00003D1002103EA0207C0E7C046C046EFF380
+:1020E000108872B621696069A2690140114201BF7E
+:1020F000E069216A084200F0B6FF88F31088C04604
+:10210000C046A561BDE8F08138B51446EFF31085EF
+:1021100072B600F049F8234941F8204085F3108851
+:1021200031BD30B5EFF3108272B61D4B1C6904430C
+:102130001C6153F83150284343F8310082F3108872
+:1021400030BDEFF3108172B6154A536923EA0000DF
+:1021500005E0EFF3108172B6114A536918435061DC
+:1021600081F310887047EFF3108172B60C4AD3697F
+:102170001843D061F4E770B5094C656A266A20629D
+:10218000012101FA05F502E0284600F06EFF216A00
+:10219000E0690842F8D088432662E06170BD000023
+:1021A00004000020E803002002460020110C09046E
+:1021B00004BF1020120412F07F4F04BF0830120237
+:1021C00005A312F0704F04BF001D1201120FC0F1E1
+:1021D0001F00995C401A70470403020201010101CB
+:1021E000000000000000000000F0A6FF9DF80E00B7
+:1021F00005B000BDF8B500F10C026B4621214FF689
+:102200006640F1E723490020087700222248027146
+:1022100000F044B820490A7941F822000879401CAE
+:102220000871704770B504466078FF2802BFB4F8A3
+:10223000030000F47F40B0F5406F1FD10025154E1C
+:10224000317FE8B2884222D2E9B256F821202046F6
+:102250009047002808BF6D1CF2D018E0761C297941
+:10226000F0B288420AD2F1B255F8212020469047B8
+:102270000100F3D002D0022805D006E02046BDE8D8
+:102280007040FFF7E3BB002070BD012070BD002649
+:10229000014DE4E7DC0400208005002080B5C04645
+:1022A000C046C046C046C046C046C046C046C046FE
+:1022B000C046C046C046C046C046C046C046C046EE
+:1022C000C046C046C046C046C046C046C046C046DE
+:1022D000C046C046C046C046C046BDE8014000F00A
+:1022E0007BBF18B50C46C7B0114600F04EF88DF80C
+:1022F0001D4022460DF11E0000F06FFF00F03AF87D
+:102300003F21ADF804100C2200F039F8A41C06920D
+:10231000049400F04BF800284CBFFF209DF800000B
+:1023200048B010BD00B5C7B000F01DF80F2200F096
+:1023300032F800284CBFFF209DF8000047B000BDD8
+:1023400000B5C7B000228DF80020ADF81C0000F0E9
+:1023500011F8182200F01FF800284CBFFF209DF84C
+:10236000000047B000BD00238DF81C008DF81D1043
+:102370008DF800301822002101A800F034BFADF81C
+:10238000062007A903910122704700228DF8002042
+:102390008DF81C007047ADF806203F21ADF8041001
+:1023A0000222049207A9039101220692CDF814D0CB
+:1023B000002101A8FFF782BD80B50FF2192200218C
+:1023C0000420FFF7A1FE0FF2E91200210820FFF719
+:1023D0009BFE9948002101220180C1808170C2705A
+:1023E000017101720FF23500BDE80240FFF712BF24
+:1023F0000278914912B1012A03D070474088C88001
+:1024000070470022087ACA8000B10A72002000F0EA
+:1024100057B900210820FFF784BE0000F8B5044634
+:102420006078FF2811D1844DB4F80300698940F623
+:102430000442801A70D0801E3FD0001F06D0401F7B
+:1024400000F09080401E00F0A680ABE0B4F805607C
+:10245000287A58B10846FFF7A0FB297A062908BF59
+:102460000028F2D14FF6FF71287269816E81E179FF
+:10247000207A90FBF1F01429C0B2E6D1102100229D
+:102480004FF6406CD3B28342DFDA63185E7A9F7AEC
+:1024900046EA072666450CD113F8076D5F7846EAD1
+:1024A0000726AE819E78DB7846EA0326EE81082671
+:1024B0002E72891DC9B2521CE4E700F075F802BF04
+:1024C0001121E07915286DD1207A421E2272207ADE
+:1024D000002867D0621804F10A03507A5E5C531F2B
+:1024E00040EA06201A785B784FF64166B04242EA2D
+:1024F000032207D04FF64263984206D10A20287281
+:10250000AA8202E0092028722A821531207AA0F1DD
+:1025100015022272C9B2DAE700F046F801BF207A4C
+:102520000021E279012A3DD10022D3B2B3EB900F12
+:1025300038DA661804F10A07737A7F5C43EA0723E6
+:10254000F77A367B47EA062742F60216B74204BFFF
+:102550002E7A0A2E02D1EB820B232B72091DC9B2EF
+:10256000521CE2E700F020F802BFB4F80710A88A76
+:10257000814217D1617A022902BFA07A68700128CE
+:1025800010D1E07AA87010B900F09AF80AE00020A3
+:1025900000F08EF806E000F007F803D100210420D7
+:1025A000FFF7BFFD0020F2BDB4F80500814270477F
+:1025B00010B5214C2079401E8041C00F2071207A37
+:1025C00038B1218A6089E31CBDE81040022200F086
+:1025D000EFB910BD1CB5184C227A0120ADF80000EF
+:1025E00032B3083A6089E18A042A21D8DFE802F090
+:1025F00003080A101A00E289A18900F05BF913BDF3
+:10260000218A00E0A18A8A1C92B200F073F913BDFE
+:102610006B46022200F09FF906202072022000F093
+:102620004FF813BD6B46022200F095F90620207288
+:1026300013BD0148007A704714050020454981B058
+:102640000A6802430A60096808400090009801B0D7
+:102650007047000078B585B004466846142100F044
+:10266000CDFD210008BF012005D02046012C0CBF64
+:102670000220022C01D1FFF7E1FF00BF39A1364E45
+:1026800031F814500095012101910022022102929B
+:102690000391694656F8240000F0B4FD00F002F8FA
+:1026A00006B070BD56F824000022294600F059BE3D
+:1026B00010B500F00FF8BDE81040012200F051BE47
+:1026C00010B500F007F8BDE81040002200F049BE48
+:1026D0000000000023A3204C33F8101054F8200011
+:1026E0007047000030B585B004460D466846142199
+:1026F00000F084FD0120FFF7A1FF2900DFF85C2036
+:102700001AA00BD130F8141000910023019301217D
+:1027100002230291039300F017F813E0012D11D169
+:1027200030F814000E4B00900295019300F00CF865
+:102730000FA0045D00220F2160B2FFF7CFF860B256
+:10274000FFF7E9F805B030BD694652F8240000F003
+:1027500059BD00004C000058380000204400002003
+:102760000000211010000100020000000004000021
+:1027700028002DE9F842C7B04FF00009ADF81C0061
+:10278000DDF838C14F9E509F519D529C8DF80090AE
+:1027900007A84180ADF82020ADF82230A0F808C08D
+:1027A000ADF8266087818DF82A508DF82B4000F017
+:1027B00017F84FF4C172ADF806203F21ADF80410B0
+:1027C0001022049207A903910122069200F00DF84D
+:1027D00000284CBFFF209DF8000048B0BDE8F08203
+:1027E0001822002101A800F0FEBCCDF814D0002171
+:1027F00001A8FFF763BB00B587B000208DF800008B
+:1028000000F09CF840F2011200F00CF9012206924F
+:1028100000F09BF800284CBFFF209DF8000007B097
+:1028200000BD78B5C7B01D464C9B00F0EEF8002601
+:102830008DF800608DF821502A4619460DF12200CE
+:1028400000F0CBFC00F07AF800F067F84FF48372E8
+:1028500000F0E2F8AD1D00F076F800284CBFFF2034
+:102860009DF8000049B060BD00B5C7B000F011F898
+:1028700000F064F800F051F84FF4897200F00FF89E
+:1028800000F063F800284CBFFF209DF8000047B01F
+:1028900000BD00228DF80020ADF81C0070470F210C
+:1028A0000291ADF806200221049107AA01210691A8
+:1028B0000392704718B5C7B000F00FF800F02DF87C
+:1028C00040F2151200F02DF800F03FF800284CBF40
+:1028D000FF209DF8000048B010BD0024ADF81C009A
+:1028E0008DF8004007A8418082800021182201A8AD
+:1028F00000F079BC18B5C7B0FFF7EFFF00F00DF896
+:1029000040F2171200F00DF800F01FF800284CBF3D
+:10291000FF209DF8000048B010BD3F21ADF8041025
+:1029200070470F210291ADF806200621049107AAF5
+:1029300001210691039270478DF800301822002182
+:1029400001A800F050BC06920495CDF814D00021E7
+:1029500001A8FFF7B3BA30B5C7B000F011F800F026
+:1029600046F8FFF7EBFF40F2211100F013F8FFF7F4
+:10297000ECFF00284CBFFF209DF8000047B030BDA1
+:102980001446ADF81C00002507A88DF800504180C2
+:1029900004717047ADF806100F2202923F2007A97C
+:1029A000ADF8040003910122641D0692049470475F
+:1029B00030B5C7B000F011F8FFF7C0FFFFF7ADFF6B
+:1029C00040F2231200F018F8FFF7BFFF00284CBFB9
+:1029D000FF209DF8000047B030BDADF81C00ADF8F9
+:1029E0001E10144600258DF800508DF82040194621
+:1029F0000DF1210000F0F1BBADF8062007A903910D
+:102A00000122641D069204947047ADF81C00ADF8D5
+:102A10001E108DF820207047ADF8062007A90391FD
+:102A200001227047ADF806203F21ADF80410704731
+:102A300000B587B000F013F800F020F8032100F093
+:102A400009F800F013F800284CBFFF209DF80000A3
+:102A500007B000BDADF80410ADF8061070470020B7
+:102A60008DF800007047049207A903910122069295
+:102A7000CDF814D0002101A8FFF720BA18220021B8
+:102A800001A800F0B0BB000020B501460648074D84
+:102A9000C2798A4218BFA84218BF0838F8D18A42C2
+:102AA00018BF002020BD00BFF873FF1F0070FF1F7C
+:102AB00000B5C7B000F06EF800F0C2F800F0AFF853
+:102AC000852200F06DF800F012F900284CBFFF20BD
+:102AD0009DF8000047B000BD2DE9F043C7B0DDF818
+:102AE00038814F9E509D519F529C8DF81C004FF095
+:102AF000000907A88DF80090417082700DF1230144
+:102B00008DF81F308DF820808DF821608DF82250CF
+:102B10000F608DF8274000F093F8862200F05AF8F5
+:102B20000C2200F0E0F800284CBFFF209DF80000C8
+:102B300047B0BDE8F083F8B5C8B005460E46174665
+:102B40001C4600F022F808A8467087708DF82050C7
+:102B500000F0E5F88A2200F0D1F8032200F0D4F862
+:102B6000002848BFFF200ED49DF8000058B94F99A7
+:102B70004E98BDF801202280BDF803300380BDF8D7
+:102B800005000880002049B0F0BD072200216846FA
+:102B900000F029BB00228DF800208DF81C00704742
+:102BA000ADF8062007A9039101220492704700B5F1
+:102BB00087B000208DF8000000F042F8922200F06B
+:102BC00009F800F093F800284CBFFF209DF80000A2
+:102BD00007B000BDADF806203F21ADF804107047E6
+:102BE00030B5C7B000F010F800F02AF800F017F880
+:102BF000972200F018F800F07BF800284CBFFF2067
+:102C00009DF8000048B020BD0025ADF81C008DF8EF
+:102C1000213007A8418002718DF8005070473F2194
+:102C2000ADF8041070470F210291ADF8062006217F
+:102C3000049107AA01210691039270478DF8003094
+:102C40001822002101A800F0CEBA2DE9F04F00268D
+:102C5000C7B000F01DF800F00FF8FFF7F1FF0F22EA
+:102C600002929C2100F02EF800284CBFFF209DF816
:102C7000000047B0BDE8F08F8DF82790B581ADF822
:102C80002AB03782ADF82E80B482ADF832A07047FA
-:102C900008461946559CDDF84091519DDDF848B134
-:102CA000539FDDF85081DDF858A1ADF81C6000237A
-:102CB00007AE8DF80030708032710DF121000622D0
-:102CC00000F087BA0F200290ADF80610182004908B
-:102CD00007A901200391069070470321ADF8060073
-:102CE000049107A801213F220390069170470490A8
-:102CF0003F22012003910690ADF80420CDF814D0B6
-:102D0000002101A8FFF704B9ADF80800059108A853
-:102D1000072104900791CDF818D0002102A8FFF7F1
-:102D2000F7B81822002102A800F059BA48B0BDE84F
-:102D3000F08100000249016002490161704700BF53
-:102D40007F2D0008A92D000800F0B0BB6B486C492E
-:102D5000016001F12002426001F13002826001F164
-:102D60003C02C26001F14402026101F16002426171
-:102D700001F1640282617031C16100F09FBB38B51E
-:102D80000446604D05F1100000F0CAF85B49486840
-:102D9000A1680160E168C160456005F110018160D2
-:102DA00000F0A8FB58482DE080B554494A681368E4
-:102DB0000120187200F0A4FB002002BD38B5524C6F
-:102DC000504D07E0694605F1100000F0D5F8009875
-:102DD0002168884705F1100000F0A5F80028F1D01F
-:102DE00031BD49484168084738B50446474D284633
-:102DF000006040604148C068A1680160456000F023
-:102E000084FB43482168016061684160002032BD55
-:102E100080B53A49CA6813681020187200F07BFB2D
-:102E2000002002BD3549CA68394910680B68184747
-:102E300038B5374C354D06E06946284600F09CF819
-:102E4000009861688847284600F06DF80028F3D0A4
-:102E500031BD38B504462F4D2846006040602E48ED
-:102E60000060406025480069A1688160E168C16038
-:102E700005612168016061684160216941616169A2
-:102E8000816131BD80B50146234800F05FF8BDE89F
-:102E900002400FF2090000F04EBB000038B5174C9D
-:102EA0001D4D08E06946284600F066F80099206943
-:102EB000006900F04BF8284600F035F80028F1D002
-:102EC00031BD10B5154C2046006040600B4841698B
-:102ED0000C60BDE8104000F042BB1CB50F4C06E092
-:102EE0006946204600F048F80098C046C046204693
-:102EF00000F019F80028F3D013BD000000000320F3
-:102F0000AC090320800803206805002098080320EE
-:102F100070050020240A0320600500202C0A0320ED
-:102F2000006040607047EFF3108172B60268824221
-:102F30000CBF012000201CE0EFF3108272B6036882
-:102F40000B60486001600868416023E0EFF3108285
-:102F500072B6086043684B6041604868016019E0E0
-:102F6000EFF3108172B6436802681A604268006825
-:102F7000426081F31088704710B5EFF3108472B689
-:102F800002680A600068FFE7FFF7EAFF84F3108831
-:102F900010BD086082F310887047000010B5284803
-:102FA000284C88B0016841F400410160FFF742F805
-:102FB00000F0E8FA24490020FEF717FB00F0FBFAC6
-:102FC0002248016841F4803101600121026C42F421
-:102FD000803202640120FFF732F80020FFF76BFB1C
-:102FE0000120FFF768FB0220FFF765FB0120FFF7D8
-:102FF00093FB01210020FFF7A3FBFFF7A7FE144A74
-:1030000000214020FFF7B1F804F23C500FF24501D7
-:103010000090019169460FF2410000F03FF804F280
-:103020005470029004F5C96140F23C500590039140
-:10303000049402A8FFF70DFFFFF786FE08B010BD4D
-:103040000800005820000320940400209008005835
-:10305000DF3000087047000080B5FFF732FF002125
-:103060000120FEF7ECFFBDE80140FEF777BCFEF75C
-:10307000FABF4FF0FF30FFF715B800214020FFF7EF
-:1030800081B80220FFF7A0B80220FFF7A5B8B0F57D
-:10309000806F08BFFEF75ABD704700007FB50C4631
-:1030A000484D6168484EE8612962284600F08EFA72
-:1030B0002468746006F1080000604060012000F0A0
-:1030C0005DF801203070296841B10FF2D5000FF290
-:1030D000D902009001920294684688477FBD3EB5B0
-:1030E000384C394D02E00098FFF7CCFE05F108009E
-:1030F000FFF719FFD8B92878002818D0694605F1DC
-:103100000800FFF739FF01202870E1690029EAD0A3
-:103110000098029001A888479DF8040028700028B4
-:10312000E1D1009905F10800FFF706FFDEE737BDA2
-:103130002DE9F04105460E4690461C46002000F061
-:103140001DF8214F7868A0F80950C67232464146F2
-:103150000C30FEF741FE1B4A1369002100209847FE
-:1031600048F2E800FFF790FF79688A78D21C04F1F2
-:103170000800FEF731FEBDE8F04101201CB5114901
-:10318000124C096A20B901B188470020207013BD94
-:103190000120207011B1BDE81C40084713BD00009C
-:1031A0000020FFF76EBF000010B50146064C04F189
-:1031B0000800FFF7CBFE04F10800BDE81040FFF760
-:1031C0005CBF0000B8040020340500208D050020FD
-:1031D000704710B50446FEF7FFFD204610BD10B540
-:1031E000044610460A460146204600F0F9F92046FA
-:1031F00010BD0000002200F027BA00002DE9F84FB2
-:103200004FF0000C674A684BDFF8A0814FF00F09C0
-:1032100082460F4633E0664DAA4514BF07250425B4
-:103220008D40254348F82E50C1431C6801EA040E26
-:103230007C68E50348BF40EA0E0EC3F800E05C6816
-:1032400001EA040E7C68A50348BF40EA0E0EC3F8ED
-:1032500004E0146801EA040E7C68E50248BF40EA15
-:103260000E0EC2F800E0546801EA040E79688C0280
-:1032700048BF40EA0E0EC2F804E00CF1010C3968B8
-:1032800031FA0CF000F07C80012000FA0CFE1EEAFE
-:103290000100F2D07C68022C18BF122C4FEA8C017E
-:1032A00010D14FEADC040AEB840401F01C05266A05
-:1032B00009FA05FB26EA0B06D7F810B00BFA05F55C
-:1032C000354325624FEA4C040325DAF8006097F88D
-:1032D00004B0A540ED430BF0030B2E400BFA04FBAA
-:1032E0004BEA0606CAF800607E68012E18BF022E5F
-:1032F00003D0112E18BF122E17D1DAF80860D7F8B4
-:103300000CB02E400BFA04FB4BEA0606CAF8086024
-:10331000DAF8046026EA0E0E7E68C6F3001606FA96
-:103320000CF646EA0E06CAF80460DAF80C6035407E
-:10333000BE6806FA04F42C43CAF80C407C68E4002A
-:103340009BD54FEA9C0E58F82E5001F00C0109FA5B
-:1033500001F425EA0404BAF1904F08BF00250ED00D
-:10336000144DAA4508BF012509D0134DAA4508BF31
-:10337000022504D0114DAA457FF44DAF03254FE738
-:10338000BDE8F18F81B0002A14BF8161816201B074
-:1033900070470B4A136803421CBF1060FFF777BEEB
-:1033A00070470000000800588008005808000140DD
-:1033B000001000480004004800080048000C0048C5
-:1033C0000C080058C0680840884201D101207047AD
-:1033D00000207047C0690840884201D10120704731
-:1033E0000020704710B5614C02212046FFF7F2FF24
-:1033F00038B16068C043810703D5FFF719FD02208B
-:1034000018E001212046FFF7E5FF38B16068C043AE
-:10341000C10703D5FFF7D2FC01200BE008212046AD
-:10342000FFF7D8FF38B16068C043010703D5FFF745
-:1034300054FD0820A06010BD10B54C4C00F033F8CE
-:1034400018B96068C043810306D400F02CF830B985
-:103450006068C043810302D5BDE8104064E00821E4
-:1034600000F022F870B96068C04301030AD56068B3
-:103470003F4940F400206060086880474FF4002016
-:10348000A06010BD202100F00FF858B96068C0435B
-:10349000810207D5606840F400106060BDE810400C
-:1034A000FFF79FBC10BD022120468BE740BF20BF25
-:1034B0003048016841F400410160704780B52E48F2
-:1034C000016841F480110160006800F480100090F0
-:1034D00000982648016841F001010160026842F449
-:1034E000803202602C20FEF7F8F9BDE802402D2062
-:1034F000FEF7F3B9214801684908490001607047A7
-:103500001F494FF48030086070471C48016821F063
-:1035100002010160704719484FF4003141600168B1
-:1035200021F40031016070471448016841F4003112
-:103530000160FFF777BC38B504460C4D08212846DA
-:10354000FFF740FF30B10A480460686820F40020AB
-:10355000686031BDA0474FF40021A96031BD074824
-:10356000016821F00801016070470000000C00585C
-:10357000880500200C04005850000058040C005826
-:10358000080C0058DFF80C00FFE7016841F4806187
-:103590000160704704040058032010B5FEF773F96A
-:1035A0000F200020C0460024002814BF012400F092
-:1035B0000BF8204610BD0348FFE7016841F0010108
-:1035C00001607047042004E0704700000249016078
-:1035D00002490161704700BFE92D0008112E000863
-:1035E00062F30F2262F31F42401810F0030308D069
-:1035F000C91A1FD3DB0748BF00F8012D28BF20F8E8
-:10360000022D130030B414461546103928BF20E9A6
-:103610003C00FAD8490728BF20E90C0048BF40F811
-:10362000042D890028BF20F8022D48BF00F8012D85
-:1036300030BC7047C91818BF00F8012DCB0728BF50
-:1036400000F8012D7047000000B500BF130096463A
-:103650009446103928BFA0E80C50FAD85FEA417CA4
-:1036600028BF0CC048BF40F8042BC90728BF20F86A
-:10367000022B48BF00F8012B00BD0000DFF830131B
-:103680000A68030903F47F2300019A4300F47F20B2
-:1036900000F068B9DFF818231368010C23EA01432E
-:1036A00043EA0043136070472DE9F84305460026BE
-:1036B0002878DFF8FC724106B0464FF0B0442DD5B3
-:1036C000286B70B1B0F5800F06D0B0F5000F18BFB1
-:1036D000B0F5400F17D01FE0E06840F48030E060A4
-:1036E000C5E0206820F08060206000F067F9814626
-:1036F0002068000140F1A88000F060F9A0EB09000B
-:103700000228F5D90326AFE000F058F9A0EB090034
-:10371000022840F2A180F5E70126B046286801059D
-:1037200031D5B86800F44078286C80452AD000F084
-:103730004BF9B8F1000FB96805D1286C21F440713C
-:103740000143B9601EE0B86840F48030B86021F4ED
-:103750004071B86820F48030B860286C0143B960CB
-:10376000B868C0070ED500F029F9804641F28939C2
-:10377000B868800706D400F021F9A0EB080048459E
-:10378000F6D30326B0462878C10705D53968A8695D
-:10379000890840EA810139602878810705D53968B0
-:1037A000E86921F44061014339602878C10644BFCB
-:1037B000A86AFFF76FFF2878810644BFE86AFFF721
-:1037C00069FF2878410744BF286AFFF757FF287828
-:1037D000010744BF686AFFF751FF2868C1055CD53F
-:1037E0003968686B21F0406101433960686BB0F162
-:1037F000006F03D1E16841F08071E160686BB0F166
-:10380000806F4AD100F0A0F806462068000135D547
-:1038100000F0D4F8801B0228F7D94FF003083CE0F1
-:1038200000F0CCF8801B022830D9F6E700F0C6F88B
-:10383000801B022852D94FF0030861E000F0BEF867
-:10384000801B022855D9F6E700F075F8A86821F426
-:10385000781100F07FF88146206800017FF554AFB1
-:10386000216968690143216130007FF456AF3968EE
-:10387000286B21F44001014339604FE700F05BF809
-:10388000E86821F0606100F065F8064620680001F4
-:10389000C6D521696869014321612868810505D57C
-:1038A0003968A86B21F0404101433960286841051F
-:1038B00026D53968E86B21F0405101433960E86B47
-:1038C000B0F1005F03D1E16841F48031E160E86B61
-:1038D000B0F1805F14D100F037F80646206800018F
-:1038E000A4D400F028F8286921F0604100F032F8F3
-:1038F000064620680001A1D521696869014321615C
-:103900002868C10405D5F968686C21F44041014379
-:10391000F960286881040BD5616AE86C21F03001F8
-:1039200001436162616AA86C890840EA81016162B1
-:103930004046BDE8F2832069696820F4FE4040EA11
-:103940000120206121697047216821F08061216098
-:1039500000F034B801432161206840F080602060AD
-:1039600000F02CB810430860704710B511490A6880
-:1039700042F080720A600B680F4A23F080730B607C
-:10398000046841680C4381680C43C1680C430169B9
-:1039900044EA014454601368406923F47C5343EAC9
-:1039A00000231360116841F06001116010BD000038
-:1039B0008800005838000058006000400148006846
-:1039C000704700BF2C0000200248016841F480715C
-:1039D000016070470004005818B59BB0FFF7DCFD8C
-:1039E000574CE06B40010ED5E06BC0000BD4FFF7E5
-:1039F000EBFFFFF7E9FFA06B40F48030A063A06B02
-:103A000020F48030A06300F07AF807A85021FFF777
-:103A1000F1FB68461821FFF7EDFB00F068F84FF462
-:103A2000807007900021149107A8FFF73DFE2068E1
-:103A300040F0807020604FF00052216801F08071EA
-:103A400006910021069800914BF67F3003902221C9
-:103A50000491002002902021019205916846FFF711
-:103A600084FFFFF7B1FFFFF7AFFFA06B40F001004D
-:103A7000A063A06B8007FCD5E06B20F4404040F4CD
-:103A80008040E063E06B40084000E06300F02FF806
-:103A90000022206B20F0406020632A480168026009
-:103AA000026902F050020261FFF78EFFFFF78CFF00
-:103AB000A06B20F4407040F48070A0630F21A06BD5
-:103AC00040F40040A063204C2048816047F6FF711D
-:103AD000C160046000F040F8A068C008C000A060A9
-:103AE000FFF75CFA4FF0FF30FEF7DCFAFAE7206CE4
-:103AF00040F001002064206C8007FCD5704714481A
-:103B000081B0016841F4801101603F21006800F438
-:103B10008010009000980F4841604161016841F4B5
-:103B20007C110160026942F47C120261016841F07B
-:103B30003F010160026942F03F02026101B070473B
-:103B400058000058800800580028004094040020C5
-:103B500050000058040C005838B5040044D094F8C4
-:103B6000210028B9002184F820102046C046C04614
-:103B700000F049F8FF2510B100F03FF834E021686B
-:103B8000DFF8B0008A6802408A6021688A6863684A
-:103B900020690343A06903431A438A602168E068EF
-:103BA000086120680169A26841EA02410161206858
-:103BB000C16821F08001C1602068C16C890889005A
-:103BC000C1642168CA6CE369606903431A43CA642B
-:103BD00020688168880609D400F020F830B1206898
-:103BE0004562042100F01FF8012032BD20684562C3
-:103BF000012184F82110002032BD20684562042193
-:103C000084F821107047022084F82100CA2021681E
-:103C10004862532022685062204626E020460BE08E
-:103C20002068C0F8248084F82110002084F8200047
-:103C300070470000BFFF8FFF70B5044640F2E936C1
-:103C40002068C16821F0A001C160FFF7B7FE0546FA
-:103C50002068C168880606D4FFF7B0FE401BB0425A
-:103C6000F6D3032070BD002070BD70B504462068F7
-:103C7000C1684A0612D44FF0FF32C26040F2E93602
-:103C8000FFF79CFE05462068C168480606D4FFF78A
-:103C900095FE401BB042F6D3032070BD002070BDDE
-:103CA00000EB81003B4AD0F88010914201D0012006
-:103CB00070470020704742F4806240F8212070472E
-:103CC00035481F2181610168C908C90041F003011D
-:103CD00001603248016841F0040157E0704710B5B7
-:103CE0002F4C00F048F80028FBD1042100F044F8E4
-:103CF00028B92C480068010403D500F03FF800F013
-:103D000054F8002203212046FFF7D5FF224801681E
-:103D1000C908C90041F0020101602048016841F072
-:103D20000401016030BF10BD10B51D4C00F026F835
-:103D300000F021F80028FBD14FF0B040816801F07D
-:103D40000C01042911D1016841F48031016001683E
-:103D50008903FCD581688908890041F002018160EE
-:103D6000816801F00C010829FAD12046BDE8104015
-:103D7000002203219FE70321204691E7002204212E
-:103D8000204698E70548016821F00401016030BF32
-:103D900070470000000400800004005810ED00E0AF
-:103DA000001400588804005870474FF0B040016874
-:103DB00041F48071016001684905FCD5816889087A
-:103DC000890041F001018160816801F00C01042942
-:103DD000FAD1704780B51C48016841F47001016058
-:103DE0000020FEF759FE48B180791849184A0A6048
-:103DF0000A6822F47C5242EA00220A604FF0B04086
-:103E0000016841F48031016012490A68D208D20089
-:103E100042F001020A600A6802F00702012AFAD1A0
-:103E200001688903FCD581688908890041F0020195
-:103E30008160816801F00C010829FAD10168490804
-:103E40004900016001BD000088ED00E09C000058C1
-:103E5000FECAFECA0040005819E050F8042BD307F0
-:103E600044BFA9F101039A18091F0023042942F84D
-:103E7000043BF9D25FEA817C134604D54FF0000C75
-:103E8000A2F800C09B1CC90744BF0021197050F85C
-:103E9000041B0029E1D1704730B5016884684218DD
-:103EA000416802EB5103C9070BD54C4409E012F9F4
-:103EB000011B12F8015B002904F8015B05D5491CC0
-:103EC000F9D19A42F3D10C3030BD491EF1D5F8E753
-:103ED0007047FEE770477047704700F011B84FF425
-:103EE0008060FFF756BA00E000BF0148FCF72AB92E
-:103EF00050000020FDF729BBFFF79EBAFFF772BA0A
-:103F000002490A68886882180A6070472C000020FD
-:103F100010B500F013F802000023DB430024106802
-:103F2000984203D011000220ABBE14605068984242
-:103F300003D0111D0220ABBE546010BD0148704774
-:103F4000000000004800002010B5074979441831EE
-:103F5000064C7C44163404E00A68081D1144884766
-:103F60000146A142F8D110BD2C0000005000000015
-:103F70004EF68851CEF20001086840F470000860E7
-:103F8000BFF34F8FBFF36F8F4FF00070E1EE100A59
-:103F900070470000C5FEFFFF4005000050000020F4
-:103FA000800800002000032000000000EDFEFFFF5D
-:103FB000740100003C000000040000200120C04605
-:103FC000002801D0FFF7C0FFAFF300800020AFF35F
-:103FD0000080FFF701FD00F000F800F001B80000DC
-:103FE0000746384600F002F8FBE7000080B5FFF70F
-:103FF0008FFF024A11001820ABBEFBE7260002002B
-:10400000853D0008A93D0008DF3C0008293D000867
-:10401000C13C0008DD3C00080148804701480047DA
-:10402000D53D000829400008AFF30080FFF7A0FF4E
-:10403000FFF7C4FFFFF7FEBFFFF7FEBFFFF7FEBFAE
-:10404000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFA4
-:10405000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF94
-:10406000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF84
-:10407000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF74
-:10408000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF64
-:10409000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF54
-:1040A000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF44
-:1040B000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF34
-:1040C000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF24
-:1040D000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF14
-:1040E000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF04
-:1040F000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFF4
-:10410000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFE3
-:10411000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFD3
-:10412000FFF7FEBFEC00F8FFF0000010FD000001FB
-:10413000FA0008480004004800040048FD00004858
-:02414000F8FF86
-:040000050800402986
+:102C90008446559CDDF84091519DDDF848B1539F25
+:102CA000DDF85081DDF858A18DF80060ADF81CC04A
+:102CB00007AE084670803271194606220DF12100D8
+:102CC00000F08BBAADF80610182204923F2007A935
+:102CD000ADF80400039101220692CDF814D0002132
+:102CE00001A8FFF7EBB8049207A90391012206920D
+:102CF000CDF814D0002101A8FFF7E0B8ADF80A2004
+:102D00003F21ADF808107047059208A904910722E9
+:102D10000792CDF818D0002102A8FFF7CFB81822EB
+:102D2000002102A800F05FBA0249034A0160026173
+:102D3000704700BFF52D00081F2E0008006040609E
+:102D40007047EFF3108172B6026882420CBF012017
+:102D500000201CE0EFF3108272B603680B6048603D
+:102D600001600868416023E0EFF3108272B60860EA
+:102D700043684B6041604868016019E0EFF31081DF
+:102D800072B6436802681A6042680068426081F364
+:102D90001088704710B5EFF3108472B602680A60AD
+:102DA0000068FFE7FFF7EAFF84F3108810BD0860B2
+:102DB00082F310887047000000F066BB6C486D49D4
+:102DC000016001F12002426001F13003836001F1F2
+:102DD0003C02026201F14403C36001F14C02026152
+:102DE00001F16803436101F16C0282617831C161D4
+:102DF00000F052BB38B504465F4D05F11000FFF7F7
+:102E00009DFF5B494868A168016005F11001E26817
+:102E1000C2608160456000F05BFB58482DE080B5E2
+:102E200053494A6813680120187200F057FB0020CC
+:102E300002BD38B5514C504D07E0694605F1100010
+:102E4000FFF7A8FF00982168884705F11000FFF7F9
+:102E500078FF0028F1D031BD48484168084738B5AF
+:102E60000446474D2846006040604149C868A16853
+:102E70000160456000F037FB4248216801606268EC
+:102E80004260002032BD80B53949CA6813681020FD
+:102E9000187200F02EFB002002BD3549CA6839497E
+:102EA00010680B68184738B5364C354D06E0694652
+:102EB0002846FFF76FFF0098616888472846FFF7AC
+:102EC00040FF0028F3D031BD38B504462E4D2846CA
+:102ED000006040602D480060406025480069A1689E
+:102EE0008160E268C26005612168016062684260D9
+:102EF000216941616269826131BD80B50146234823
+:102F0000FFF732FFBDE802400FF2050000F001BB01
+:102F100038B5174C1D4D08E069462846FFF73AFFC3
+:102F2000009920690069FFF71FFF2846FFF709FF96
+:102F30000028F1D031BD10B5154C2046006040602E
+:102F40000B4948690460BDE8104000F0F6BA1CB5B2
+:102F50000F4C06E069462046FFF71CFF0098C0466C
+:102F6000C0462046FFF7EDFE0028F3D013BD000059
+:102F700000000320B009032084080320700500200E
+:102F80009C08032078050020340A032068050020EF
+:102F90003C0A032010B52848284C88B0016841F449
+:102FA00000410160FFF718F800F0DAFA2449002028
+:102FB000FEF73FFB00F0EDFA2248016841F4803152
+:102FC00001600121026C42F4803202640120FFF7AB
+:102FD00008F80020FFF73EFB0120FFF73BFB022033
+:102FE000FFF738FB0120FFF763FB01210020FFF70B
+:102FF00079FBFFF7E3FE144A00214020FFF784F835
+:1030000004F23C51009169460FF241020FF2410077
+:10301000019200F03FF804F25471029104F5C96284
+:1030200040F23C5103920591049402A8FFF74CFF33
+:10303000FFF7C2FE08B010BD0800005824000320AE
+:103040009404002090080058D73000087047000012
+:1030500080B5FFF770FF00210120FEF7C2FFBDE839
+:103060000140FEF7AFBCFEF7D0BF4FF0FF30FEF7D8
+:10307000EBBF00214020FFF754B80220FFF773B8E0
+:103080000220FFF778B8B0F5806F08BFFEF78EBD5D
+:10309000704700007FB50C464C4D61684C4EE861AE
+:1030A0002962284600F080FA2468746006F108005E
+:1030B00000604060012000F065F801203070296850
+:1030C00041B10FF2E5020FF2E9030092019302947D
+:1030D000684688477FBD1FB53D4C04F10800FFF7E7
+:1030E00030FEE8B92078D8B1694604F10800FFF74E
+:1030F00051FE012035492070C96941B10098029004
+:1031000001A888479DF804102170080003D000989A
+:10311000FFF7F3FE04E0009904F10800FFF71AFE40
+:1031200004F10800FFF70DFE28B9207818B104F16A
+:103130000800FFF79EFF1FBD2DE9F04105460E4632
+:1031400090461C46002000F01DF8214F7868A0F83A
+:103150000950C672324641460C30FEF753FE1B4AF8
+:10316000136900210020984748F2E800FFF788FF24
+:1031700079688A78D21C04F10800FEF743FEBDE8A6
+:10318000F041012010B51149124C096A20B901B172
+:1031900088470021217010BD0120207011B1BDE8C9
+:1031A0001040084710BD00000020FFF766BF000078
+:1031B00010B50146064C04F10800FFF7D5FD04F1F7
+:1031C0000800BDE81040FFF754BF0000B80400201D
+:1031D0003C05002095050020704710B50446FEF719
+:1031E00011FE204610BD10B5044610460A460146A1
+:1031F000204600F0E3F9204610BD0000002200F058
+:10320000E7B900002DE9F04106460A464FF0000CF0
+:103210004FF00F082CE05A4FBE4214BF4FF0070E7C
+:103220004FF0040E0EFA01F1294344F82310C14374
+:10323000544C236855680B40ED0348BF034323609B
+:10324000636855680B40AD0348BF034363604E4C51
+:10325000236855680B40ED0248BF03432360636851
+:103260000B4051688D0248BF034363600CF1010CB1
+:10327000106830FA0CF172D0012303FA0CF31840F5
+:10328000F4D05468022C18BF122C4FEA8C010ED1D6
+:103290004FEADC0406EB840401F01C0E256A08FAF0
+:1032A0000EF7BD43176907FA0EF73D4325624FEA53
+:1032B0004C0403253768A540ED4305EA070E17794E
+:1032C00007F00307A74047EA0E0737605768012F4A
+:1032D00018BF022F03D0112F18BF122F11D1B768BA
+:1032E00005EA070ED768A74047EA0E07B760776878
+:1032F00027EA03035768C7F3001707FA0CF73B43A5
+:103300007360F3681D40936803FA04F42C43F4607F
+:103310005468E300AAD51D4C4FEA9C0354F823706F
+:1033200001F00C0108FA01F5B6F1904F27EA050506
+:1033300008BF4FF0000E11D0154FBE4208BF4FF02E
+:10334000010E0BD0134FBE4208BF4FF0020E05D046
+:10335000114FBE427FF45FAF4FF0030E62E7BDE84E
+:10336000F0810AB181617047816270470B4A13682E
+:1033700003421CBF1060FFF786BE704700000000CC
+:10338000001000488008005800080058080001405C
+:103390000004004800080048000C00480C080058D1
+:1033A000C0680840884201D1012070470020704762
+:1033B000C0690840884201D1012070470020704751
+:1033C00010B5614C02212046FFF7F2FF38B160686A
+:1033D000C043810703D5FFF766FD022018E00121F5
+:1033E0002046FFF7E5FF38B16068C043C10703D549
+:1033F000FFF71FFD01200BE008212046FFF7D8FF53
+:1034000038B16068C043010703D5FFF7A0FD08206D
+:10341000A06010BD10B54C4C00F033F818B96068CE
+:10342000C043810306D400F02CF830B96068C04373
+:10343000810302D5BDE8104064E0082100F022F8C5
+:1034400070B96068C04301030AD560683F4940F421
+:1034500000206060086880474FF40022A26010BD21
+:10346000202100F00FF858B96068C043810207D5E9
+:10347000606840F400106060BDE81040FFF7ECBCED
+:1034800010BD022120468BE740BF20BF30480168B5
+:1034900041F400410160704780B52E48016841F455
+:1034A00080110160006800F48010009000982648A8
+:1034B000016841F001010160026842F4803202605B
+:1034C0002C20FEF728FABDE802402D20FEF723BA93
+:1034D0002148016849084900016070471F494FF4BD
+:1034E0008030086070471C48016821F002010160CB
+:1034F000704719484FF400314160026822F40032ED
+:10350000026070471448016841F400310160FFF720
+:10351000C4BC38B504460C4D08212846FFF740FFCF
+:1035200030B10A480460696821F40021696031BD46
+:10353000A0474FF40020A86031BD0748016821F082
+:103540000801016070470000000C00589005002041
+:103550000C04005850000058040C0058080C005887
+:10356000DFF80C00FFE7016841F4806101607047FB
+:1035700004040058032010B5FEF7A3F90F2000F053
+:1035800041F80024002814BF012400F00BF8204665
+:1035900010BD0348FFE7016841F001010160704779
+:1035A000042004E0704700000249034A0160026100
+:1035B000704700BF5F2E0008872E00084018491C86
+:1035C0001CBFB1F1010100F8012DF9D170470000D5
+:1035D00000B500BF130096469446103928BFA0E8F6
+:1035E0000C50FAD85FEA417C28BF0CC048BF40F8B5
+:1035F000042BC90728BF20F8022B48BF00F8012B75
+:1036000000BD000070B50F4E0446B0680025A8B19B
+:1036100000F05FF8B2684FF47A71B1FBF2F2B0FBE0
+:10362000F2F0FEF792F948B9102C07D20022214699
+:103630004FF0FF30FEF752F9746000E00125284694
+:1036400070BD00BF2C0000204FF0B040006800F0BB
+:10365000F000B02888BFB020704738B54FF0B044B4
+:10366000244DA16811F00C0106D1FFF7EDFFC0F366
+:10367000031055F8200032BD04291F4A05D008293F
+:103680001E4804D12168C90222D5104632BDE16826
+:1036900001F00301022904D0032904D12168C902E1
+:1036A00007D5104605E0FFF7CFFFC0F3031055F82C
+:1036B0002000E168E268E368C1F306214843C2F3F1
+:1036C0000211491C5B0FB0FBF1F05B1CB0FBF3F087
+:1036D00032BD80B5FFF7C1FF0549FFE7084A096819
+:1036E000C1F3031152F82110B0FBF1F002BD00004C
+:1036F00008000058A03F00080024F4000048E8013A
+:10370000603F0008DFF870130A68030903F47F23A1
+:1037100000019A4300F47F2000F088B9DFF85823B5
+:103720001368010C23EA014343EA00431360704726
+:103730002DE9F843054600242878DFF83C6341066C
+:10374000A0464FF0B0472DD5286B70B1B0F5800F73
+:1037500006D0B0F5000F18BFB0F5400F17D01FE02E
+:10376000F96841F48031F960F3E0386820F0806056
+:10377000386000F087F981463868000140F1D68052
+:1037800000F080F9A0EB09000228F5D90324DDE060
+:1037900000F078F9A0EB0900022840F2CF80F5E7AD
+:1037A0000124A0462868010531D5B06800F44078AE
+:1037B000286C80452AD000F06BF9B8F1000FB16891
+:1037C00005D1286C21F440710143B1601EE0B0685E
+:1037D00040F48030B06021F44071B06820F4803053
+:1037E000B060286C0143B160B068C0070ED500F02E
+:1037F00049F98046B068800708D400F043F9A0EB8F
+:10380000080041F289318842F4D30324A046287885
+:10381000C10705D53268A869920840EA8202326081
+:103820002978880705D53168E86921F440610143AA
+:1038300031602978C80644BFA86AFFF76FFF28786F
+:10384000810644BFE86AFFF769FF2878410744BF53
+:10385000286AFFF757FF2878010744BF686AFFF717
+:1038600051FF2868C1051ED53268686B22F040629E
+:1038700002433260696BB1F1006F00F0C9F8686B08
+:10388000B0F1806F0FD1396821F0806100F0CBF882
+:1038900004463868000163D500F0F4F8001B0228E4
+:1038A000F7D94FF0030870E000F0ECF8001B022895
+:1038B00064D9F6E7316821F04041316020F0805052
+:1038C000326822F0406210433060A86BB0F1C05FF4
+:1038D00000F09EF82868410576D53268E86B22F042
+:1038E000405202433260E96BB1F1005F03D1F868E6
+:1038F00040F48030F860E86BB0F1805F64D13968E3
+:1039000021F0806100F08FF80446386800014CD542
+:1039100000F0B8F8001B0228F7D94FF0030853E075
+:1039200000F0B0F8001B022847D9F6E700F067F86E
+:10393000A86821F4781100F071F881463868000118
+:103940007FF526AF3969686901433961002C7FF43E
+:1039500028AF3168286B21F440010143316021E731
+:103960003969686821F4FE4141EA00213961396909
+:10397000E86821F0606100F051F804463868000101
+:1039800092D5396968690143396129688805A1D5EB
+:10399000A86BB0F1804F1CBFB0F1004F002889D157
+:1039A000316821F0404108438EE700F028F828698B
+:1039B00021F0604100F032F8044638680001AFD5CC
+:1039C00039696869014339612968C80405D5F16816
+:1039D000686C21F440410143F160296888040BD5EB
+:1039E000796AE86C21F0300101437962796AA86C48
+:1039F000890840EA810179624046BDE8F28338696E
+:103A0000696820F4FE4040EA012038613969704756
+:103A100003D1F86840F08070F86070470143396165
+:103A2000396841F08061396000F02CB810430860BB
+:103A3000704710B511490A6842F080720A600B683D
+:103A400023F080730B600468416882680C4B0C4360
+:103A5000C168144302690C4344EA02445C6019687B
+:103A6000406921F47C5141EA00211960196841F054
+:103A70006001196010BD000088000058380000582F
+:103A80000060004001480068704700BF2C00002023
+:103A90000248016841F480710160704700040058D9
+:103AA00018B59BB0FFF766FD574CE06B40010ED593
+:103AB000E06BC0000BD4FFF7EBFFFFF7E9FFA06B53
+:103AC00040F48030A063A06B20F48030A06300F04D
+:103AD00055F807A85021FFF791FB68461821FFF71A
+:103AE0008DFB4A480168226C42F001022264206C7E
+:103AF0008107FCD54FF4807200210792149107A82A
+:103B0000FFF716FE206840F08070206000222168D8
+:103B100001F0807106914FF00053069900924BF628
+:103B20007F312222039104920021202201930291ED
+:103B300005926846FFF77DFFFFF7AAFFFFF7A8FF92
+:103B4000A06B40F00100A063A06B8007FCD50022B1
+:103B5000E16B2F4821F4404141F48041E163016869
+:103B60000260036903F05003036100F028F8FFF7D7
+:103B700011FA4FF0FF30FEF767FAFAE7254881B0F7
+:103B8000016841F4801101603F21006800F4801059
+:103B900000900098204841604161016841F47C1127
+:103BA0000160026942F47C120261016841F03F0148
+:103BB0000160026942F03F02026101B0704710B536
+:103BC000FFF766FFFFF764FF1448154C016821F406
+:103BD000407141F4807101600F21026842F400429B
+:103BE000026047F6FF720F488160C260046000F017
+:103BF0001BF8CA20606253216162FF21A068C008DF
+:103C0000C000A060616210BD5800005894140058B4
+:103C10008008005850000058040C005890000058CC
+:103C2000002800409404002070B5040049D094F8A6
+:103C3000210028B9002184F820102046C046C04643
+:103C400000F04EF853202168486200F052F8FF253A
+:103C500010B100F03FF834E02168DFF8AC008A686A
+:103C600002408A602268936866682169A0690E43F1
+:103C70000643334393602068E1680161206801696D
+:103C8000A26841EA024101612068C16821F0800117
+:103C9000C1602068C16C89088900C1642168CA6C50
+:103CA000E369606903431A43CA642168886881062E
+:103CB00009D400F01CF830B120684562042100F0FE
+:103CC0001DF8012070BD20684562012184F8211093
+:103CD000002070BD20684562042184F821107047DF
+:103CE000022084F82100CA212268516270472046D0
+:103CF0000CE0204623E02068C0F8248084F82110DE
+:103D0000002084F820007047BFFF8FFF38B50446BD
+:103D10002068C16821F0A001C160FFF7B3FE05462D
+:103D20002068C168880608D4FFF7ACFE401B40F24B
+:103D3000E9318842F4D3032032BD002032BD38B5CA
+:103D400004462068C1684A0612D44FF0FF31C160B2
+:103D5000FFF798FE05462068C168480608D4FFF7BB
+:103D600091FE401B40F2E9318842F4D3032032BD7A
+:103D7000002032BD00EB81003D4AD0F88010914216
+:103D800001D0012070470020704742F4806240F863
+:103D90002120704737481F2181610268D208D20074
+:103DA00042F0030202603448016841F004010160FE
+:103DB00030BF7047704710B5304C00F048F800280D
+:103DC000FBD1042100F044F828B92D480068010413
+:103DD00003D500F03FF800F057F8002203212046F9
+:103DE000FFF7D3FF23480168C908C90041F0020169
+:103DF00001602148016841F00401016030BF10BD3D
+:103E000010B51E4C00F026F800F021F80028FBD178
+:103E10004FF0B040816801F00C01042911D1016814
+:103E200041F48031016001688903FCD58268920801
+:103E3000920042F002028260816801F00C010829C0
+:103E4000FAD12046BDE81040002203219DE703215E
+:103E500020468FE700220421204696E780B500F037
+:103E60002DF80548016821F00401016030BF01BD53
+:103E7000000400800004005810ED00E00014005819
+:103E80008804005800F022B84FF0B040016841F4B7
+:103E90008071016001684905FCD582689208920032
+:103EA00042F001028260416A8908890041628168AA
+:103EB00001F00C010429FAD17047000002480168A2
+:103EC00021F002010160704710E000E00248016843
+:103ED00041F002010160704710E000E080B51C482D
+:103EE000016841F4700101600020FEF7CDFD48B18A
+:103EF00080791849184A0A600B6823F47C5343EA16
+:103F000000230B604FF0B040016841F48031016044
+:103F100012490A68D208D20042F001020A600A6817
+:103F200002F00702012AFAD101688903FCD58268F0
+:103F30009208920042F002028260816801F00C0156
+:103F40000829FAD1016849084900016001BD000053
+:103F500088ED00E09C000058FECAFECA00400058F0
+:103F60000100000003000000050000000100000047
+:103F700001000000060000000A0000002000000010
+:103F80000200000004000000080000001000000013
+:103F9000400000008000000000010000000200005E
+:103FA000A0860100400D0300801A060000350C00B9
+:103FB00040420F0080841E0000093D0000127A007C
+:103FC0000024F40000366E010048E801006CDC02B9
+:103FD00000000000000000000000000000000000E1
+:103FE00030B5016884684218416802EB5103C90783
+:103FF0000BD54C4409E012F9011B12F8015B0029B2
+:1040000004F8015B05D5491CF9D19A42F3D10C3073
+:1040100030BD491EF1D5F8E70000000000000000A7
+:104020000000000000000000000000004400080044
+:10403000400508013A799C00F4010000FFFFFFFFF2
+:1040400048010100000000007047FEE7704770471C
+:10405000704700F011B84FF48060FFF787B900E0B7
+:1040600000BF0148FCF76EB850000020FDF78CBA85
+:10407000FFF7D0B9FFF7A4B902490A688868821827
+:104080000A6070472C00002080B500F015F802008F
+:104090000023DB431068984204D011000220ABBE1D
+:1040A000002010605068984204D0111D0220ABBE61
+:1040B0000020506001BD0000014870470000000072
+:1040C0004800002010B5074979441831064C7C445B
+:1040D000163404E00A68081D114488470146A142CD
+:1040E000F8D110BD2C000000500000004EF68851A1
+:1040F000CEF20001086840F470000860BFF34F8FF3
+:10410000BFF36F8F4FF00070E1EE100A70470000B0
+:104110007BC6FFFF4805000050000020800800001B
+:104120002400032000000000B9FEFFFF740100001E
+:104130003C000000040000200120C046002801D0FF
+:10414000FFF7C0FFAFF300800020AFF30080FFF760
+:10415000A7FC00F000F800F001B800000746384660
+:1041600000F002F8FBE7000080B5FFF78DFF024A80
+:1041700011001820ABBEFBE7260002005D3E0008E0
+:10418000853E0008B73D0008013E0008953D000847
+:10419000B53D00080148804701480047DD3E000862
+:1041A000A5410008AFF30080FFF7A0FFFFF7C4FFB1
+:1041B000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF33
+:1041C000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF23
+:1041D000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF13
+:1041E000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF03
+:1041F000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFF3
+:10420000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFE2
+:10421000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFD2
+:10422000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFC2
+:10423000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFB2
+:10424000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFA2
+:10425000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF92
+:10426000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF82
+:10427000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF72
+:10428000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF62
+:10429000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF52
+:1042A000EC00F8FFF0000010FD000001FA000848E3
+:0E42B0000004004800040048FD000048F8FF2C
+:04000005080041A509
:00000001FF
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Inc/app_conf.h
index bbd7e02a0..d37fe22e8 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Inc/app_conf.h
@@ -24,12 +24,13 @@
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* OTA Application Config
******************************************************************************/
-/**< generic parameters ********************************************************/
+/**< generic parameters ******************************************************/
/**
* Define Tx Power
@@ -79,6 +80,15 @@
*/
#define CFG_BLE_ERK {0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21,0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21}
+/* USER CODE BEGIN Generic_Parameters */
+/**
+ * SMPS supply
+ * SMPS not used when Set to 0
+ * SMPS used when Set to 1
+ */
+#define CFG_USE_SMPS 1
+/* USER CODE END Generic_Parameters */
+
/**< specific parameters ********************************************************/
#if defined (USE_STM32WBXX_USB_DONGLE_REVA)
#define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI9_5_IRQHandler
@@ -181,7 +191,7 @@
* 1 : internal RO
* 0 : external crystal ( no calibration )
*/
-#define CFG_BLE_LSE_SOURCE 1
+#define CFG_BLE_LSE_SOURCE 0
/**
* Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
@@ -378,7 +388,6 @@ typedef enum
* Enable or Disable traces in application
*/
#define CFG_DEBUG_APP_TRACE 0
-
#if (CFG_DEBUG_APP_TRACE != 0)
#define APP_DBG_MSG PRINT_MESG_DBG
#else
@@ -396,7 +405,6 @@ typedef enum
#define CFG_LPM_SUPPORTED 0
#define CFG_DEBUGGER_SUPPORTED 1
#endif
-
/**
* When CFG_DEBUG_TRACE_FULL is set to 1, the trace are output with the API name, the file name and the line number
* When CFG_DEBUG_TRACE_LIGHT is set to 1, only the debug message is output
@@ -501,6 +509,9 @@ typedef enum
{
CFG_LPM_APP,
CFG_LPM_APP_BLE,
+ /* USER CODE BEGIN CFG_LPM_Id_t */
+
+ /* USER CODE END CFG_LPM_Id_t */
} CFG_LPM_Id_t;
/******************************************************************************
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Inc/stm32_lpm_if.h
index 38e326512..d8e67947f 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Inc/stm32_lpm_if.h
@@ -1,46 +1,22 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file stm32_lpm_if.h
-* @brief Header for stm32_lpm_f.c module (device specific LP management)
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
******************************************************************************
* @attention
*
-* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics International N.V.
+* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted, provided that the following conditions are met:
-*
-* 1. Redistribution of source code must retain the above copyright notice,
-* this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following disclaimer in the documentation
-* and/or other materials provided with the distribution.
-* 3. Neither the name of STMicroelectronics nor the names of other
-* contributors to this software may be used to endorse or promote products
-* derived from this software without specific written permission.
-* 4. This software, including modifications and/or derivative works of this
-* software, must execute solely and exclusively on microcontroller or
-* microprocessor devices manufactured by or for STMicroelectronics.
-* 5. Redistribution and use of this software other than as permitted under
-* this license is void and will automatically terminate your rights under
-* this license.
-*
-* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
-* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
-* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+* This software component is licensed by ST under BSD 3-Clause license,
+* the "License"; You may not use this file except in compliance with the
+* License. You may obtain a copy of the License at:
+* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32_LPM_IF_H
@@ -89,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Inc/stm32wbxx_hal_conf.h
index 8cce280aa..4ab9edb7d 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Inc/stm32wbxx_hal_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Inc/stm32wbxx_hal_conf.h
@@ -219,6 +219,10 @@
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32wbxx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32wbxx_hal_flash.h"
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Inc/utilities_conf.h
index c98d97ba1..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Inc/utilities_conf.h
@@ -1,3 +1,4 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* File Name : utilities_conf.h
@@ -9,13 +10,14 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef UTILITIES_CONF_H
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Src/app_entry.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Src/app_entry.c
index de506558a..b2d131301 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Src/app_entry.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Src/app_entry.c
@@ -60,7 +60,6 @@ static void appe_Tl_Init( void );
static void Led_Init( void );
static void Button_Init( void );
static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status );
-
static void APPE_SysUserEvtRx( void * pPayload );
/* Functions Definition ------------------------------------------------------*/
@@ -86,7 +85,7 @@ void APPE_Init( void )
/**
* From now, the application is waiting for the ready event ( VS_HCI_C2_Ready )
- * received on the system channel before starting the BLE Stack
+ * received on the system channel before starting the Stack
* This system event is received with APPE_SysUserEvtRx()
*/
@@ -258,7 +257,6 @@ void UTIL_SEQ_Idle( void )
return;
}
-
void UTIL_SEQ_EvtIdle( UTIL_SEQ_bm_t task_id_bm, UTIL_SEQ_bm_t evt_waited_bm )
{
UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Src/hw_timerserver.c
index 52a1bfa0d..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Src/hw_timerserver.c
@@ -1,22 +1,21 @@
/**
******************************************************************************
- * File Name : hw_timerserver.c
- * Description : Hardware timerserver source file for BLE
- * middleWare.
+ * File Name : hw_timerserver.c
+ * Description : Hardware timerserver source file for STM32WPAN Middleware.
+ *
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Src/hw_uart.c
index c0fc22d58..9a553610d 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Src/hw_uart.c
@@ -1,42 +1,33 @@
/**
******************************************************************************
- * @file hw_uart.c
- * @author MCD Application Team
- * @brief hardware access
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * File Name : Src/hw_uart.c
+ * Description : HW UART source file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
#include "hw_conf.h"
+#if (CFG_HW_LPUART1_ENABLED == 1)
+extern UART_HandleTypeDef hlpuart1;
+#endif
+#if (CFG_HW_USART1_ENABLED == 1)
+extern UART_HandleTypeDef huart1;
+#endif
/* Macros --------------------------------------------------------------------*/
-#define HW_UART_INIT(__HANDLE__, __USART_BASE__) \
- do{ \
- (__HANDLE__).Instance = (__USART_BASE__); \
- (__HANDLE__).Init.BaudRate = CFG_HW_##__USART_BASE__##_BAUDRATE; \
- (__HANDLE__).Init.WordLength = CFG_HW_##__USART_BASE__##_WORDLENGTH; \
- (__HANDLE__).Init.StopBits = CFG_HW_##__USART_BASE__##_STOPBITS; \
- (__HANDLE__).Init.Parity = CFG_HW_##__USART_BASE__##_PARITY; \
- (__HANDLE__).Init.HwFlowCtl = CFG_HW_##__USART_BASE__##_HWFLOWCTL; \
- (__HANDLE__).Init.Mode = CFG_HW_##__USART_BASE__##_MODE; \
- (__HANDLE__).Init.OverSampling = CFG_HW_##__USART_BASE__##_OVERSAMPLING; \
- (__HANDLE__).AdvancedInit.AdvFeatureInit = CFG_HW_##__USART_BASE__##_ADVFEATUREINIT; \
- HAL_UART_Init(&(__HANDLE__)); \
- } while(0)
-
#define HW_UART_RX_IT(__HANDLE__, __USART_BASE__) \
do{ \
HW_##__HANDLE__##RxCb = cb; \
@@ -57,82 +48,8 @@
hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
} while(0)
-#define HW_UART_MSP_UART_INIT(__HANDLE__, __USART_BASE__) \
- do{ \
- \
- /* Configure Tx Pin */ \
- CFG_HW_##__USART_BASE__##_TX_PORT_CLK_ENABLE(); \
- \
- GPIO_InitStruct.Pin = CFG_HW_##__USART_BASE__##_TX_PIN ; \
- GPIO_InitStruct.Mode = CFG_HW_##__USART_BASE__##_TX_MODE; \
- GPIO_InitStruct.Pull = CFG_HW_##__USART_BASE__##_TX_PULL; \
- GPIO_InitStruct.Speed = CFG_HW_##__USART_BASE__##_TX_SPEED; \
- GPIO_InitStruct.Alternate = CFG_HW_##__USART_BASE__##_TX_ALTERNATE; \
- HAL_GPIO_Init(CFG_HW_##__USART_BASE__##_TX_PORT, &GPIO_InitStruct); \
- \
- \
- /* Configure Rx Pin */ \
- CFG_HW_##__USART_BASE__##_RX_PORT_CLK_ENABLE(); \
- \
- GPIO_InitStruct.Pin = CFG_HW_##__USART_BASE__##_RX_PIN; \
- GPIO_InitStruct.Mode = CFG_HW_##__USART_BASE__##_RX_MODE; \
- GPIO_InitStruct.Pull = CFG_HW_##__USART_BASE__##_RX_PULL; \
- GPIO_InitStruct.Speed = CFG_HW_##__USART_BASE__##_RX_SPEED; \
- GPIO_InitStruct.Alternate = CFG_HW_##__USART_BASE__##_RX_ALTERNATE; \
- HAL_GPIO_Init(CFG_HW_##__USART_BASE__##_RX_PORT, &GPIO_InitStruct); \
- \
- \
- /* Configure CTS Pin */ \
- CFG_HW_##__USART_BASE__##_CTS_PORT_CLK_ENABLE(); \
- \
- GPIO_InitStruct.Pin = CFG_HW_##__USART_BASE__##_CTS_PIN; \
- GPIO_InitStruct.Mode = CFG_HW_##__USART_BASE__##_CTS_MODE; \
- GPIO_InitStruct.Pull = CFG_HW_##__USART_BASE__##_CTS_PULL; \
- GPIO_InitStruct.Speed = CFG_HW_##__USART_BASE__##_CTS_SPEED; \
- GPIO_InitStruct.Alternate = CFG_HW_##__USART_BASE__##_CTS_ALTERNATE; \
- HAL_GPIO_Init(CFG_HW_##__USART_BASE__##_CTS_PORT, &GPIO_InitStruct); \
- \
- /* Set USART source clock */ \
- __HAL_RCC_##__USART_BASE__##_CONFIG(CFG_HW_##__USART_BASE__##_SOURCE_CLOCK); \
- \
- /* Enable USART clock */ \
- __HAL_RCC_##__USART_BASE__##_CLK_ENABLE(); \
- \
- HAL_NVIC_SetPriority(__USART_BASE__##_IRQn, CFG_HW_##__USART_BASE__##_PREEMPTPRIORITY, CFG_HW_##__USART_BASE__##_SUBPRIORITY); \
- HAL_NVIC_EnableIRQ(__USART_BASE__##_IRQn); \
- } while(0)
-
-#define HW_UART_MSP_TX_DMA_INIT(__HANDLE__, __USART_BASE__) \
- do{ \
- /* Configure the DMA handler for Transmission process */ \
- /* Enable DMA clock */ \
- CFG_HW_##__USART_BASE__##_DMA_CLK_ENABLE(); \
- /* Enable DMA MUX clock */ \
- CFG_HW_##__USART_BASE__##_DMAMUX_CLK_ENABLE(); \
- \
- HW_hdma_##__HANDLE__##_tx.Instance = CFG_HW_##__USART_BASE__##_TX_DMA_CHANNEL; \
- HW_hdma_##__HANDLE__##_tx.Init.Request = CFG_HW_##__USART_BASE__##_TX_DMA_REQ; \
- HW_hdma_##__HANDLE__##_tx.Init.Direction = DMA_MEMORY_TO_PERIPH; \
- HW_hdma_##__HANDLE__##_tx.Init.PeriphInc = DMA_PINC_DISABLE; \
- HW_hdma_##__HANDLE__##_tx.Init.MemInc = DMA_MINC_ENABLE; \
- HW_hdma_##__HANDLE__##_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; \
- HW_hdma_##__HANDLE__##_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; \
- HW_hdma_##__HANDLE__##_tx.Init.Mode = DMA_NORMAL; \
- HW_hdma_##__HANDLE__##_tx.Init.Priority = DMA_PRIORITY_LOW; \
- \
- HAL_DMA_Init(&HW_hdma_##__HANDLE__##_tx); \
- \
- /* Associate the initialized DMA handle to the UART handle */ \
- __HAL_LINKDMA(huart, hdmatx, HW_hdma_##__HANDLE__##_tx); \
- \
- /* NVIC configuration for DMA transfer complete interrupt */ \
- HAL_NVIC_SetPriority(CFG_HW_##__USART_BASE__##_TX_DMA_IRQn, CFG_HW_##__USART_BASE__##_DMA_TX_PREEMPTPRIORITY, CFG_HW_##__USART_BASE__##_DMA_TX_SUBPRIORITY); \
- HAL_NVIC_EnableIRQ(CFG_HW_##__USART_BASE__##_TX_DMA_IRQn); \
- } while(0)
-
- /* Variables ------------------------------------------------------------------*/
+/* Variables -----------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
- UART_HandleTypeDef huart1 = {0};
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
#endif
@@ -141,331 +58,261 @@
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- UART_HandleTypeDef lpuart1 = {0};
#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
- DMA_HandleTypeDef HW_hdma_lpuart1_tx ={0};
+ DMA_HandleTypeDef HW_hdma_hlpuart1_tx ={0};
#endif
- void (*HW_lpuart1RxCb)(void);
- void (*HW_lpuart1TxCb)(void);
+ void (*HW_hlpuart1RxCb)(void);
+ void (*HW_hlpuart1TxCb)(void);
#endif
- void HW_UART_Init(hw_uart_id_t hw_uart_id)
+void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_INIT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_RX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_INIT(lpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_RX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ return;
+}
+
+void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_RX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_RX_IT(lpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ return;
+}
+
+hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
+{
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
+
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX_IT(lpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
+ switch (hal_status)
{
- HAL_StatusTypeDef hal_status = HAL_OK;
- hw_status_t hw_status = hw_uart_ok;
-
- switch (hw_uart_id)
- {
-#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX(huart1, USART1);
- break;
-#endif
-
-#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX(lpuart1, LPUART1);
- break;
-#endif
-
- default:
- break;
- }
+ case HAL_OK:
+ hw_status = hw_uart_ok;
+ break;
- switch (hal_status)
- {
- case HAL_OK:
- hw_status = hw_uart_ok;
- break;
+ case HAL_ERROR:
+ hw_status = hw_uart_error;
+ break;
- case HAL_ERROR:
- hw_status = hw_uart_error;
- break;
+ case HAL_BUSY:
+ hw_status = hw_uart_busy;
+ break;
- case HAL_BUSY:
- hw_status = hw_uart_busy;
- break;
+ case HAL_TIMEOUT:
+ hw_status = hw_uart_to;
+ break;
- case HAL_TIMEOUT:
- hw_status = hw_uart_to;
- break;
+ default:
+ break;
+ }
- default:
- break;
- }
+ return hw_status;
+}
- return hw_status;
- }
+hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
- hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ switch (hw_uart_id)
{
- HAL_StatusTypeDef hal_status = HAL_OK;
- hw_status_t hw_status = hw_uart_ok;
-
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_huart1TxCb = cb;
- huart1.Instance = USART1;
- hal_status = HAL_UART_Transmit_DMA(&huart1, p_data, size);
- break;
-#endif
-
-#if (CFG_HW_USART2_ENABLED == 1)
- case hw_uart2:
- HW_huart2TxCb = cb;
- huart2.Instance = USART2;
- hal_status = HAL_UART_Transmit_DMA(&huart2, p_data, size);
- break;
+ case hw_uart1:
+ HW_huart1TxCb = cb;
+ huart1.Instance = USART1;
+ hal_status = HAL_UART_Transmit_DMA(&huart1, p_data, size);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_lpuart1TxCb = cb;
- lpuart1.Instance = LPUART1;
- hal_status = HAL_UART_Transmit_DMA(&lpuart1, p_data, size);
- break;
+ case hw_lpuart1:
+ HW_hlpuart1TxCb = cb;
+ hlpuart1.Instance = LPUART1;
+ hal_status = HAL_UART_Transmit_DMA(&hlpuart1, p_data, size);
+ break;
#endif
- default:
- break;
- }
-
- switch (hal_status)
- {
- case HAL_OK:
- hw_status = hw_uart_ok;
- break;
+ default:
+ break;
+ }
- case HAL_ERROR:
- hw_status = hw_uart_error;
- break;
+ switch (hal_status)
+ {
+ case HAL_OK:
+ hw_status = hw_uart_ok;
+ break;
- case HAL_BUSY:
- hw_status = hw_uart_busy;
- break;
+ case HAL_ERROR:
+ hw_status = hw_uart_error;
+ break;
- case HAL_TIMEOUT:
- hw_status = hw_uart_to;
- break;
+ case HAL_BUSY:
+ hw_status = hw_uart_busy;
+ break;
- default:
- break;
- }
+ case HAL_TIMEOUT:
+ hw_status = hw_uart_to;
+ break;
- return hw_status;
+ default:
+ break;
}
- void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id)
+ return hw_status;
+}
+
+void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id)
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HAL_UART_IRQHandler(&huart1);
- break;
+ case hw_uart1:
+ HAL_UART_IRQHandler(&huart1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HAL_UART_IRQHandler(&lpuart1);
- break;
+ case hw_lpuart1:
+ HAL_UART_IRQHandler(&hlpuart1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
- {
- switch (hw_uart_id)
- {
-#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
- case hw_uart1:
- HAL_DMA_IRQHandler(huart1.hdmatx);
- break;
-#endif
-
-#if (CFG_HW_USART2_DMA_TX_SUPPORTED == 1)
- case hw_uart2:
- HAL_DMA_IRQHandler(huart2.hdmatx);
- break;
-#endif
-
-#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
- case hw_lpuart1:
- HAL_DMA_IRQHandler(lpuart1.hdmatx);
- break;
-#endif
-
- default:
- break;
- }
+ return;
+}
- return;
- }
-
- void HAL_UART_MspInit(UART_HandleTypeDef *huart)
+void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
+{
+ switch (hw_uart_id)
{
-#if ( (CFG_HW_USART1_ENABLED == 1) || (CFG_HW_LPUART1_ENABLED == 1) )
- GPIO_InitTypeDef GPIO_InitStruct = {0};
-#endif
- switch ((uint32_t)huart->Instance)
- {
-#if (CFG_HW_USART1_ENABLED == 1)
- case (uint32_t)USART1:
- HW_UART_MSP_UART_INIT( huart1, USART1 );
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
- HW_UART_MSP_TX_DMA_INIT( huart1, USART1 );
-#endif
+ case hw_uart1:
+ HAL_DMA_IRQHandler(huart1.hdmatx);
break;
#endif
-#if (CFG_HW_LPUART1_ENABLED == 1)
- case (uint32_t)LPUART1:
- HW_UART_MSP_UART_INIT( lpuart1, LPUART1 );
#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
- HW_UART_MSP_TX_DMA_INIT( lpuart1, LPUART1 );
-#endif
+ case hw_lpuart1:
+ HAL_DMA_IRQHandler(hlpuart1.hdmatx);
break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
+ return;
+}
+
+void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
+{
+ switch ((uint32_t)huart->Instance)
{
- switch ((uint32_t)huart->Instance)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case (uint32_t)USART1:
- if(HW_huart1RxCb)
- {
- HW_huart1RxCb();
- }
+ case (uint32_t)USART1:
+ if(HW_huart1RxCb)
+ {
+ HW_huart1RxCb();
+ }
break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case (uint32_t)LPUART1:
- if(HW_lpuart1RxCb)
- {
- HW_lpuart1RxCb();
- }
+ case (uint32_t)LPUART1:
+ if(HW_hlpuart1RxCb)
+ {
+ HW_hlpuart1RxCb();
+ }
break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
+ return;
+}
+
+void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
+{
+ switch ((uint32_t)huart->Instance)
{
- switch ((uint32_t)huart->Instance)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case (uint32_t)USART1:
- if(HW_huart1TxCb)
- {
- HW_huart1TxCb();
- }
+ case (uint32_t)USART1:
+ if(HW_huart1TxCb)
+ {
+ HW_huart1TxCb();
+ }
break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case (uint32_t)LPUART1:
- if(HW_lpuart1TxCb)
- {
- HW_lpuart1TxCb();
- }
+ case (uint32_t)LPUART1:
+ if(HW_hlpuart1TxCb)
+ {
+ HW_hlpuart1TxCb();
+ }
break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+ return;
+}
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Src/main.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Src/main.c
index 7e80f2c17..1754a019a 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Src/main.c
@@ -195,7 +195,13 @@ static void Init_RTC( void )
hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
HAL_RTC_Init(&hrtc);
- MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* Disable RTC registers write protection */
+ LL_RTC_DisableWriteProtection(RTC);
+
+ LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER);
+
+ /* Enable RTC registers write protection */
+ LL_RTC_EnableWriteProtection(RTC);
return;
}
@@ -218,6 +224,12 @@ void SystemClock_Config( void )
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -268,19 +280,6 @@ void SystemClock_Config( void )
*/
LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
@@ -289,21 +288,33 @@ void SystemClock_Config( void )
* WRAP FUNCTIONS
*
*************************************************************/
-
-/**
- * This function is empty to avoid starting the SysTick Timer
- */
-HAL_StatusTypeDef HAL_InitTick( uint32_t TickPriority )
+void HAL_Delay(uint32_t Delay)
{
- return (HAL_OK);
-}
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
-/**
- * This function is empty as the SysTick Timer is not used
- */
-void HAL_Delay(__IO uint32_t Delay)
-{
- return;
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
}
/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/STM32_WPAN/App/app_ble.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/STM32_WPAN/App/app_ble.c
index 56e900afc..627536103 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/STM32_WPAN/App/app_ble.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/STM32_WPAN/App/app_ble.c
@@ -467,6 +467,11 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
event_data_size = le_advertising_event->Advertising_Report[0].Length_Data;
+ /* WARNING: be careful when decoding advertising report as its raw format cannot be mapped on a C structure.
+ The data and RSSI values could not be directly decoded from the RAM using the data and RSSI field from hci_le_advertising_report_event_rp0 structure.
+ Instead they must be read by using offsets (please refer to BLE specification).
+ RSSI = *(uint8_t*) (adv_report_data + le_advertising_event->Advertising_Report[0].Length_Data);
+ */
adv_report_data = (uint8_t*)(&le_advertising_event->Advertising_Report[0].Length_Data) + 1;
k = 0;
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/STM32_WPAN/App/ble_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/STM32_WPAN/App/ble_conf.h
index 37636cf44..464a01904 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/STM32_WPAN/App/ble_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/STM32_WPAN/App/ble_conf.h
@@ -54,7 +54,7 @@
* This shall take into account all registered handlers
* (from either the provided services or the custom services)
*/
-#define BLE_CFG_SVC_MAX_NBR_CB 5
+#define BLE_CFG_SVC_MAX_NBR_CB 7
#define BLE_CFG_CLT_MAX_NBR_CB 1
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/SW4STM32/Production/.cproject b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/SW4STM32/Production/.cproject
index f0e6978dd..eaca4166f 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/SW4STM32/Production/.cproject
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/SW4STM32/Production/.cproject
@@ -88,7 +88,7 @@
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble"/>
<listOptionValue builtIn="false" value="../../../Core/Inc"/>
- <listOptionValue builtIn="false" value="../../../STM32_WPAN/app"/>
+ <listOptionValue builtIn="false" value="../../../STM32_WPAN/App"/>
<listOptionValue builtIn="false" value="../../../../../../../../Drivers/BSP/P-NUCLEO-WB55.USBDongle"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/vcp"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc"/>
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Inc/app_conf.h
index 9602032c1..5f5e556f7 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Inc/app_conf.h
@@ -24,12 +24,13 @@
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* OTA Application Config
******************************************************************************/
-/**< generic parameters ********************************************************/
+/**< generic parameters ******************************************************/
/**
* Define Tx Power
@@ -81,6 +82,15 @@
*/
#define CFG_BLE_ERK {0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21,0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21}
+/* USER CODE BEGIN Generic_Parameters */
+/**
+ * SMPS supply
+ * SMPS not used when Set to 0
+ * SMPS used when Set to 1
+ */
+#define CFG_USE_SMPS 1
+/* USER CODE END Generic_Parameters */
+
/**< specific parameters ********************************************************/
#if defined (USE_STM32WBXX_USB_DONGLE_REVA)
#define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI9_5_IRQHandler
@@ -192,7 +202,7 @@
* 1 : internal RO
* 0 : external crystal ( no calibration )
*/
-#define CFG_BLE_LSE_SOURCE 1
+#define CFG_BLE_LSE_SOURCE 0
/**
* Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
@@ -389,7 +399,6 @@ typedef enum
* Enable or Disable traces in application
*/
#define CFG_DEBUG_APP_TRACE 0
-
#if (CFG_DEBUG_APP_TRACE != 0)
#define APP_DBG_MSG PRINT_MESG_DBG
#else
@@ -407,7 +416,6 @@ typedef enum
#define CFG_LPM_SUPPORTED 0
#define CFG_DEBUGGER_SUPPORTED 1
#endif
-
/**
* When CFG_DEBUG_TRACE_FULL is set to 1, the trace are output with the API name, the file name and the line number
* When CFG_DEBUG_TRACE_LIGHT is set to 1, only the debug message is output
@@ -516,6 +524,9 @@ typedef enum
{
CFG_LPM_APP,
CFG_LPM_APP_BLE,
+ /* USER CODE BEGIN CFG_LPM_Id_t */
+
+ /* USER CODE END CFG_LPM_Id_t */
} CFG_LPM_Id_t;
/******************************************************************************
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Inc/stm32_lpm_if.h
index 38e326512..d8e67947f 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Inc/stm32_lpm_if.h
@@ -1,46 +1,22 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file stm32_lpm_if.h
-* @brief Header for stm32_lpm_f.c module (device specific LP management)
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
******************************************************************************
* @attention
*
-* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics International N.V.
+* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted, provided that the following conditions are met:
-*
-* 1. Redistribution of source code must retain the above copyright notice,
-* this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following disclaimer in the documentation
-* and/or other materials provided with the distribution.
-* 3. Neither the name of STMicroelectronics nor the names of other
-* contributors to this software may be used to endorse or promote products
-* derived from this software without specific written permission.
-* 4. This software, including modifications and/or derivative works of this
-* software, must execute solely and exclusively on microcontroller or
-* microprocessor devices manufactured by or for STMicroelectronics.
-* 5. Redistribution and use of this software other than as permitted under
-* this license is void and will automatically terminate your rights under
-* this license.
-*
-* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
-* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
-* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+* This software component is licensed by ST under BSD 3-Clause license,
+* the "License"; You may not use this file except in compliance with the
+* License. You may obtain a copy of the License at:
+* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32_LPM_IF_H
@@ -89,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Inc/stm32wbxx_hal_conf.h
index 8cce280aa..4ab9edb7d 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Inc/stm32wbxx_hal_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Inc/stm32wbxx_hal_conf.h
@@ -219,6 +219,10 @@
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32wbxx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32wbxx_hal_flash.h"
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Inc/utilities_conf.h
index c98d97ba1..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Inc/utilities_conf.h
@@ -1,3 +1,4 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* File Name : utilities_conf.h
@@ -9,13 +10,14 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef UTILITIES_CONF_H
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Src/app_entry.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Src/app_entry.c
index c47840c75..d793aa7ae 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Src/app_entry.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Src/app_entry.c
@@ -61,7 +61,6 @@ static void appe_Tl_Init( void );
static void Led_Init( void );
static void Button_Init( void );
static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status );
-
static void APPE_SysUserEvtRx( void * pPayload );
/* Functions Definition ------------------------------------------------------*/
@@ -87,7 +86,7 @@ void APPE_Init( void )
/**
* From now, the application is waiting for the ready event ( VS_HCI_C2_Ready )
- * received on the system channel before starting the BLE Stack
+ * received on the system channel before starting the Stack
* This system event is received with APPE_SysUserEvtRx()
*/
@@ -259,7 +258,6 @@ void UTIL_SEQ_Idle( void )
return;
}
-
void UTIL_SEQ_EvtIdle( UTIL_SEQ_bm_t task_id_bm, UTIL_SEQ_bm_t evt_waited_bm )
{
UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Src/hw_timerserver.c
index 52a1bfa0d..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Src/hw_timerserver.c
@@ -1,22 +1,21 @@
/**
******************************************************************************
- * File Name : hw_timerserver.c
- * Description : Hardware timerserver source file for BLE
- * middleWare.
+ * File Name : hw_timerserver.c
+ * Description : Hardware timerserver source file for STM32WPAN Middleware.
+ *
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Src/hw_uart.c
index c0fc22d58..9a553610d 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Src/hw_uart.c
@@ -1,42 +1,33 @@
/**
******************************************************************************
- * @file hw_uart.c
- * @author MCD Application Team
- * @brief hardware access
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * File Name : Src/hw_uart.c
+ * Description : HW UART source file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
#include "hw_conf.h"
+#if (CFG_HW_LPUART1_ENABLED == 1)
+extern UART_HandleTypeDef hlpuart1;
+#endif
+#if (CFG_HW_USART1_ENABLED == 1)
+extern UART_HandleTypeDef huart1;
+#endif
/* Macros --------------------------------------------------------------------*/
-#define HW_UART_INIT(__HANDLE__, __USART_BASE__) \
- do{ \
- (__HANDLE__).Instance = (__USART_BASE__); \
- (__HANDLE__).Init.BaudRate = CFG_HW_##__USART_BASE__##_BAUDRATE; \
- (__HANDLE__).Init.WordLength = CFG_HW_##__USART_BASE__##_WORDLENGTH; \
- (__HANDLE__).Init.StopBits = CFG_HW_##__USART_BASE__##_STOPBITS; \
- (__HANDLE__).Init.Parity = CFG_HW_##__USART_BASE__##_PARITY; \
- (__HANDLE__).Init.HwFlowCtl = CFG_HW_##__USART_BASE__##_HWFLOWCTL; \
- (__HANDLE__).Init.Mode = CFG_HW_##__USART_BASE__##_MODE; \
- (__HANDLE__).Init.OverSampling = CFG_HW_##__USART_BASE__##_OVERSAMPLING; \
- (__HANDLE__).AdvancedInit.AdvFeatureInit = CFG_HW_##__USART_BASE__##_ADVFEATUREINIT; \
- HAL_UART_Init(&(__HANDLE__)); \
- } while(0)
-
#define HW_UART_RX_IT(__HANDLE__, __USART_BASE__) \
do{ \
HW_##__HANDLE__##RxCb = cb; \
@@ -57,82 +48,8 @@
hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
} while(0)
-#define HW_UART_MSP_UART_INIT(__HANDLE__, __USART_BASE__) \
- do{ \
- \
- /* Configure Tx Pin */ \
- CFG_HW_##__USART_BASE__##_TX_PORT_CLK_ENABLE(); \
- \
- GPIO_InitStruct.Pin = CFG_HW_##__USART_BASE__##_TX_PIN ; \
- GPIO_InitStruct.Mode = CFG_HW_##__USART_BASE__##_TX_MODE; \
- GPIO_InitStruct.Pull = CFG_HW_##__USART_BASE__##_TX_PULL; \
- GPIO_InitStruct.Speed = CFG_HW_##__USART_BASE__##_TX_SPEED; \
- GPIO_InitStruct.Alternate = CFG_HW_##__USART_BASE__##_TX_ALTERNATE; \
- HAL_GPIO_Init(CFG_HW_##__USART_BASE__##_TX_PORT, &GPIO_InitStruct); \
- \
- \
- /* Configure Rx Pin */ \
- CFG_HW_##__USART_BASE__##_RX_PORT_CLK_ENABLE(); \
- \
- GPIO_InitStruct.Pin = CFG_HW_##__USART_BASE__##_RX_PIN; \
- GPIO_InitStruct.Mode = CFG_HW_##__USART_BASE__##_RX_MODE; \
- GPIO_InitStruct.Pull = CFG_HW_##__USART_BASE__##_RX_PULL; \
- GPIO_InitStruct.Speed = CFG_HW_##__USART_BASE__##_RX_SPEED; \
- GPIO_InitStruct.Alternate = CFG_HW_##__USART_BASE__##_RX_ALTERNATE; \
- HAL_GPIO_Init(CFG_HW_##__USART_BASE__##_RX_PORT, &GPIO_InitStruct); \
- \
- \
- /* Configure CTS Pin */ \
- CFG_HW_##__USART_BASE__##_CTS_PORT_CLK_ENABLE(); \
- \
- GPIO_InitStruct.Pin = CFG_HW_##__USART_BASE__##_CTS_PIN; \
- GPIO_InitStruct.Mode = CFG_HW_##__USART_BASE__##_CTS_MODE; \
- GPIO_InitStruct.Pull = CFG_HW_##__USART_BASE__##_CTS_PULL; \
- GPIO_InitStruct.Speed = CFG_HW_##__USART_BASE__##_CTS_SPEED; \
- GPIO_InitStruct.Alternate = CFG_HW_##__USART_BASE__##_CTS_ALTERNATE; \
- HAL_GPIO_Init(CFG_HW_##__USART_BASE__##_CTS_PORT, &GPIO_InitStruct); \
- \
- /* Set USART source clock */ \
- __HAL_RCC_##__USART_BASE__##_CONFIG(CFG_HW_##__USART_BASE__##_SOURCE_CLOCK); \
- \
- /* Enable USART clock */ \
- __HAL_RCC_##__USART_BASE__##_CLK_ENABLE(); \
- \
- HAL_NVIC_SetPriority(__USART_BASE__##_IRQn, CFG_HW_##__USART_BASE__##_PREEMPTPRIORITY, CFG_HW_##__USART_BASE__##_SUBPRIORITY); \
- HAL_NVIC_EnableIRQ(__USART_BASE__##_IRQn); \
- } while(0)
-
-#define HW_UART_MSP_TX_DMA_INIT(__HANDLE__, __USART_BASE__) \
- do{ \
- /* Configure the DMA handler for Transmission process */ \
- /* Enable DMA clock */ \
- CFG_HW_##__USART_BASE__##_DMA_CLK_ENABLE(); \
- /* Enable DMA MUX clock */ \
- CFG_HW_##__USART_BASE__##_DMAMUX_CLK_ENABLE(); \
- \
- HW_hdma_##__HANDLE__##_tx.Instance = CFG_HW_##__USART_BASE__##_TX_DMA_CHANNEL; \
- HW_hdma_##__HANDLE__##_tx.Init.Request = CFG_HW_##__USART_BASE__##_TX_DMA_REQ; \
- HW_hdma_##__HANDLE__##_tx.Init.Direction = DMA_MEMORY_TO_PERIPH; \
- HW_hdma_##__HANDLE__##_tx.Init.PeriphInc = DMA_PINC_DISABLE; \
- HW_hdma_##__HANDLE__##_tx.Init.MemInc = DMA_MINC_ENABLE; \
- HW_hdma_##__HANDLE__##_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; \
- HW_hdma_##__HANDLE__##_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; \
- HW_hdma_##__HANDLE__##_tx.Init.Mode = DMA_NORMAL; \
- HW_hdma_##__HANDLE__##_tx.Init.Priority = DMA_PRIORITY_LOW; \
- \
- HAL_DMA_Init(&HW_hdma_##__HANDLE__##_tx); \
- \
- /* Associate the initialized DMA handle to the UART handle */ \
- __HAL_LINKDMA(huart, hdmatx, HW_hdma_##__HANDLE__##_tx); \
- \
- /* NVIC configuration for DMA transfer complete interrupt */ \
- HAL_NVIC_SetPriority(CFG_HW_##__USART_BASE__##_TX_DMA_IRQn, CFG_HW_##__USART_BASE__##_DMA_TX_PREEMPTPRIORITY, CFG_HW_##__USART_BASE__##_DMA_TX_SUBPRIORITY); \
- HAL_NVIC_EnableIRQ(CFG_HW_##__USART_BASE__##_TX_DMA_IRQn); \
- } while(0)
-
- /* Variables ------------------------------------------------------------------*/
+/* Variables -----------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
- UART_HandleTypeDef huart1 = {0};
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
#endif
@@ -141,331 +58,261 @@
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- UART_HandleTypeDef lpuart1 = {0};
#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
- DMA_HandleTypeDef HW_hdma_lpuart1_tx ={0};
+ DMA_HandleTypeDef HW_hdma_hlpuart1_tx ={0};
#endif
- void (*HW_lpuart1RxCb)(void);
- void (*HW_lpuart1TxCb)(void);
+ void (*HW_hlpuart1RxCb)(void);
+ void (*HW_hlpuart1TxCb)(void);
#endif
- void HW_UART_Init(hw_uart_id_t hw_uart_id)
+void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_INIT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_RX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_INIT(lpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_RX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ return;
+}
+
+void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_RX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_RX_IT(lpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ return;
+}
+
+hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
+{
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
+
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX_IT(lpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
+ switch (hal_status)
{
- HAL_StatusTypeDef hal_status = HAL_OK;
- hw_status_t hw_status = hw_uart_ok;
-
- switch (hw_uart_id)
- {
-#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX(huart1, USART1);
- break;
-#endif
-
-#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX(lpuart1, LPUART1);
- break;
-#endif
-
- default:
- break;
- }
+ case HAL_OK:
+ hw_status = hw_uart_ok;
+ break;
- switch (hal_status)
- {
- case HAL_OK:
- hw_status = hw_uart_ok;
- break;
+ case HAL_ERROR:
+ hw_status = hw_uart_error;
+ break;
- case HAL_ERROR:
- hw_status = hw_uart_error;
- break;
+ case HAL_BUSY:
+ hw_status = hw_uart_busy;
+ break;
- case HAL_BUSY:
- hw_status = hw_uart_busy;
- break;
+ case HAL_TIMEOUT:
+ hw_status = hw_uart_to;
+ break;
- case HAL_TIMEOUT:
- hw_status = hw_uart_to;
- break;
+ default:
+ break;
+ }
- default:
- break;
- }
+ return hw_status;
+}
- return hw_status;
- }
+hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
- hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ switch (hw_uart_id)
{
- HAL_StatusTypeDef hal_status = HAL_OK;
- hw_status_t hw_status = hw_uart_ok;
-
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_huart1TxCb = cb;
- huart1.Instance = USART1;
- hal_status = HAL_UART_Transmit_DMA(&huart1, p_data, size);
- break;
-#endif
-
-#if (CFG_HW_USART2_ENABLED == 1)
- case hw_uart2:
- HW_huart2TxCb = cb;
- huart2.Instance = USART2;
- hal_status = HAL_UART_Transmit_DMA(&huart2, p_data, size);
- break;
+ case hw_uart1:
+ HW_huart1TxCb = cb;
+ huart1.Instance = USART1;
+ hal_status = HAL_UART_Transmit_DMA(&huart1, p_data, size);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_lpuart1TxCb = cb;
- lpuart1.Instance = LPUART1;
- hal_status = HAL_UART_Transmit_DMA(&lpuart1, p_data, size);
- break;
+ case hw_lpuart1:
+ HW_hlpuart1TxCb = cb;
+ hlpuart1.Instance = LPUART1;
+ hal_status = HAL_UART_Transmit_DMA(&hlpuart1, p_data, size);
+ break;
#endif
- default:
- break;
- }
-
- switch (hal_status)
- {
- case HAL_OK:
- hw_status = hw_uart_ok;
- break;
+ default:
+ break;
+ }
- case HAL_ERROR:
- hw_status = hw_uart_error;
- break;
+ switch (hal_status)
+ {
+ case HAL_OK:
+ hw_status = hw_uart_ok;
+ break;
- case HAL_BUSY:
- hw_status = hw_uart_busy;
- break;
+ case HAL_ERROR:
+ hw_status = hw_uart_error;
+ break;
- case HAL_TIMEOUT:
- hw_status = hw_uart_to;
- break;
+ case HAL_BUSY:
+ hw_status = hw_uart_busy;
+ break;
- default:
- break;
- }
+ case HAL_TIMEOUT:
+ hw_status = hw_uart_to;
+ break;
- return hw_status;
+ default:
+ break;
}
- void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id)
+ return hw_status;
+}
+
+void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id)
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HAL_UART_IRQHandler(&huart1);
- break;
+ case hw_uart1:
+ HAL_UART_IRQHandler(&huart1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HAL_UART_IRQHandler(&lpuart1);
- break;
+ case hw_lpuart1:
+ HAL_UART_IRQHandler(&hlpuart1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
- {
- switch (hw_uart_id)
- {
-#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
- case hw_uart1:
- HAL_DMA_IRQHandler(huart1.hdmatx);
- break;
-#endif
-
-#if (CFG_HW_USART2_DMA_TX_SUPPORTED == 1)
- case hw_uart2:
- HAL_DMA_IRQHandler(huart2.hdmatx);
- break;
-#endif
-
-#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
- case hw_lpuart1:
- HAL_DMA_IRQHandler(lpuart1.hdmatx);
- break;
-#endif
-
- default:
- break;
- }
+ return;
+}
- return;
- }
-
- void HAL_UART_MspInit(UART_HandleTypeDef *huart)
+void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
+{
+ switch (hw_uart_id)
{
-#if ( (CFG_HW_USART1_ENABLED == 1) || (CFG_HW_LPUART1_ENABLED == 1) )
- GPIO_InitTypeDef GPIO_InitStruct = {0};
-#endif
- switch ((uint32_t)huart->Instance)
- {
-#if (CFG_HW_USART1_ENABLED == 1)
- case (uint32_t)USART1:
- HW_UART_MSP_UART_INIT( huart1, USART1 );
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
- HW_UART_MSP_TX_DMA_INIT( huart1, USART1 );
-#endif
+ case hw_uart1:
+ HAL_DMA_IRQHandler(huart1.hdmatx);
break;
#endif
-#if (CFG_HW_LPUART1_ENABLED == 1)
- case (uint32_t)LPUART1:
- HW_UART_MSP_UART_INIT( lpuart1, LPUART1 );
#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
- HW_UART_MSP_TX_DMA_INIT( lpuart1, LPUART1 );
-#endif
+ case hw_lpuart1:
+ HAL_DMA_IRQHandler(hlpuart1.hdmatx);
break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
+ return;
+}
+
+void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
+{
+ switch ((uint32_t)huart->Instance)
{
- switch ((uint32_t)huart->Instance)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case (uint32_t)USART1:
- if(HW_huart1RxCb)
- {
- HW_huart1RxCb();
- }
+ case (uint32_t)USART1:
+ if(HW_huart1RxCb)
+ {
+ HW_huart1RxCb();
+ }
break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case (uint32_t)LPUART1:
- if(HW_lpuart1RxCb)
- {
- HW_lpuart1RxCb();
- }
+ case (uint32_t)LPUART1:
+ if(HW_hlpuart1RxCb)
+ {
+ HW_hlpuart1RxCb();
+ }
break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
+ return;
+}
+
+void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
+{
+ switch ((uint32_t)huart->Instance)
{
- switch ((uint32_t)huart->Instance)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case (uint32_t)USART1:
- if(HW_huart1TxCb)
- {
- HW_huart1TxCb();
- }
+ case (uint32_t)USART1:
+ if(HW_huart1TxCb)
+ {
+ HW_huart1TxCb();
+ }
break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case (uint32_t)LPUART1:
- if(HW_lpuart1TxCb)
- {
- HW_lpuart1TxCb();
- }
+ case (uint32_t)LPUART1:
+ if(HW_hlpuart1TxCb)
+ {
+ HW_hlpuart1TxCb();
+ }
break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+ return;
+}
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Src/main.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Src/main.c
index 7e80f2c17..1754a019a 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Src/main.c
@@ -195,7 +195,13 @@ static void Init_RTC( void )
hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
HAL_RTC_Init(&hrtc);
- MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* Disable RTC registers write protection */
+ LL_RTC_DisableWriteProtection(RTC);
+
+ LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER);
+
+ /* Enable RTC registers write protection */
+ LL_RTC_EnableWriteProtection(RTC);
return;
}
@@ -218,6 +224,12 @@ void SystemClock_Config( void )
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -268,19 +280,6 @@ void SystemClock_Config( void )
*/
LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
@@ -289,21 +288,33 @@ void SystemClock_Config( void )
* WRAP FUNCTIONS
*
*************************************************************/
-
-/**
- * This function is empty to avoid starting the SysTick Timer
- */
-HAL_StatusTypeDef HAL_InitTick( uint32_t TickPriority )
+void HAL_Delay(uint32_t Delay)
{
- return (HAL_OK);
-}
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
-/**
- * This function is empty as the SysTick Timer is not used
- */
-void HAL_Delay(__IO uint32_t Delay)
-{
- return;
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
}
/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/STM32_WPAN/App/app_ble.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/STM32_WPAN/App/app_ble.c
index 1de54a167..bd299f79f 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/STM32_WPAN/App/app_ble.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/STM32_WPAN/App/app_ble.c
@@ -876,6 +876,11 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification(void *pckt)
event_data_size = le_advertising_event->Advertising_Report[0].Length_Data;
+ /* WARNING: be careful when decoding advertising report as its raw format cannot be mapped on a C structure.
+ The data and RSSI values could not be directly decoded from the RAM using the data and RSSI field from hci_le_advertising_report_event_rp0 structure.
+ Instead they must be read by using offsets (please refer to BLE specification).
+ RSSI = *(uint8_t*) (adv_report_data + le_advertising_event->Advertising_Report[0].Length_Data);
+ */
adv_report_data = (uint8_t*)(&le_advertising_event->Advertising_Report[0].Length_Data) + 1;
k = 0;
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/STM32_WPAN/App/ble_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/STM32_WPAN/App/ble_conf.h
index 17bc78dc7..390b238fc 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/STM32_WPAN/App/ble_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/STM32_WPAN/App/ble_conf.h
@@ -54,7 +54,7 @@
* This shall take into account all registered handlers
* (from either the provided services or the custom services)
*/
-#define BLE_CFG_SVC_MAX_NBR_CB 5
+#define BLE_CFG_SVC_MAX_NBR_CB 7
#define BLE_CFG_CLT_MAX_NBR_CB 6
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/SW4STM32/Production/.cproject b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/SW4STM32/Production/.cproject
index 28100f228..c21f3b64b 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/SW4STM32/Production/.cproject
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/SW4STM32/Production/.cproject
@@ -88,7 +88,7 @@
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble"/>
<listOptionValue builtIn="false" value="../../../Core/Inc"/>
- <listOptionValue builtIn="false" value="../../../STM32_WPAN/app"/>
+ <listOptionValue builtIn="false" value="../../../STM32_WPAN/App"/>
<listOptionValue builtIn="false" value="../../../../../../../../Drivers/BSP/P-NUCLEO-WB55.USBDongle"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/vcp"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc"/>
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/SW4STM32/Production/.project b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/SW4STM32/Production/.project
index b9846a85d..92f53ab6c 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/SW4STM32/Production/.project
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pRouteur/SW4STM32/Production/.project
@@ -65,14 +65,14 @@
<location>PARENT-2-PROJECT_LOC/Core/Src/stm32wbxx_it.c</location>
</link>
<link>
- <name>Application/STM32_WPAN/app/app_ble.c</name>
+ <name>Application/STM32_WPAN/App/app_ble.c</name>
<type>1</type>
- <location>PARENT-2-PROJECT_LOC/STM32_WPAN/app/app_ble.c</location>
+ <location>PARENT-2-PROJECT_LOC/STM32_WPAN/App/app_ble.c</location>
</link>
<link>
- <name>Application/STM32_WPAN/app/p2p_routeur_app.c</name>
+ <name>Application/STM32_WPAN/App/p2p_routeur_app.c</name>
<type>1</type>
- <location>PARENT-2-PROJECT_LOC/STM32_WPAN/app/p2p_routeur_app.c</location>
+ <location>PARENT-2-PROJECT_LOC/STM32_WPAN/App/p2p_routeur_app.c</location>
</link>
<link>
<name>Application/STM32_WPAN/target/hw_ipcc.c</name>
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Binary/BLE_p2pServer_reference.hex b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Binary/BLE_p2pServer_reference.hex
index 9c01b2890..c44d4b357 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Binary/BLE_p2pServer_reference.hex
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Binary/BLE_p2pServer_reference.hex
@@ -1,1036 +1,1058 @@
:020000040800F2
-:1000000070150020593F0008113E0008133E0008FB
-:10001000753F0008793F00087D3F000800000000A0
-:10002000000000000000000000000000153E000875
-:10003000173E000800000000193E00081B3E0008A3
-:10004000813F0008853F0008893F0008353E0008D1
-:100050008D3F0008913F0008953F0008993F000838
-:100060009D3F0008A13F0008A53F0008A93F0008E8
-:10007000AD3F0008B13F0008B53F0008B93F000898
-:10008000BD3F0008C13F0008C53F0008293E0008E9
-:10009000273E0008C93F0008CD3F0008D13F0008B7
-:1000A000D53F0008D93F0008DD3F0008E13F0008C8
-:1000B000E53F0008E93F0008ED3F0008F13F000878
-:1000C000F53F0008F93F0008FD3F00080140000827
-:1000D00005400008094000080D40000811400008D4
-:1000E0001F3E000815400008194000081D40000888
-:1000F0003D3E0008393E0008214000082540000828
-:10010000294000082D400008314000083540000813
-:10011000394000083D4000084140000845400008C3
-:10012000494000084D400008514000085540000873
-:10013000594000085D40000861400008002084F834
-:10014000280210BD38B5044600F0B0F8010444BFE1
-:10015000204600F074F900F0A9F840050CD500F035
-:10016000A1F84FF6FF3000F099F8204600F0B5FAFC
+:1000000070150020B94000086D3F00086F3F0008E0
+:10001000D5400008D9400008DD400008000000007D
+:10002000000000000000000000000000713F000818
+:10003000733F000800000000753F0008773F00088C
+:10004000E1400008E5400008E9400008913F000851
+:10005000ED400008F1400008F5400008F9400008B4
+:10006000FD40000801410008054100080941000861
+:100070000D41000811410008154100081941000810
+:100080001D4100082141000825410008853F000866
+:10009000833F0008294100082D4100083141000834
+:1000A00035410008394100083D4100084141000840
+:1000B00045410008494100084D41000851410008F0
+:1000C00055410008594100085D41000861410008A0
+:1000D00065410008694100086D4100087141000850
+:1000E0007B3F000875410008794100087D41000808
+:1000F000993F0008953F00088141000885410008AC
+:10010000894100088D41000891410008954100088F
+:10011000994100089D410008A1410008A54100083F
+:10012000A9410008AD410008B1410008B5410008EF
+:10013000B9410008BD410008C1410008002084F811
+:10014000280210BD70B5044600F0B0F8000444BFAA
+:10015000204600F076F900F0A9F840050CD500F033
+:10016000A1F84FF6FF3000F099F8204600F0BDFAF4
:100170000021204600F0A2F800F098F8400405D5D0
:1001800000F090F84BF6FF7000F088F800F08EF861
:10019000800405D500F086F84DF6FF7000F07EF87B
-:1001A00004F5187500F082F8C0041FD52168B1F875
+:1001A00004F5187500F082F8C00420D52168B1F874
:1001B00040204FF6FB700240A1F840204FF6F77048
-:1001C000B1F840200240A1F840202878012804D14D
-:1001D000002129702046C046C046204600F08EFA15
-:1001E00000F060F84EF6FF7000F058F800F05EF88E
-:1001F000000516D5206800F14002118841F0080181
-:1002000011804FF2FF7193880B409380118841F069
-:1002100004011180B0F84400C0045CBF204600F027
-:1002200069FA00F043F8000620D5206800F140018B
-:100230004FF67F708A8802408A80287898B90A88A9
-:1002400042F004020A800122088840F00800088079
-:100250002A70888A800800F03C00686001212046EE
-:10026000C046C04602E0204600F044FA00F01EF806
+:1001C000B1F840200240A1F840202978012905D14A
+:1001D0000020287000212046C046C046204600F07E
+:1001E00095FA00F05FF84EF6FF7000F057F800F057
+:1001F0005DF8000516D5206800F14002118841F035
+:10020000080111804FF2FF7193880B40938016888C
+:1002100046F004061680B0F84400C0045CBF2046D7
+:1002200000F070FA00F042F800061FD5216801F1D5
+:1002300040024FF67F7193880B409380287890B9E5
+:10024000118841F0040111800121108840F008005C
+:1002500010802970908A800800F03C006860204679
+:10026000C046C04602E0204600F04CFA00F01EF8FE
:10027000800508D500F016F84FF6FF5000F00EF894
-:10028000204600F026FA00F011F8C00505D500F070
-:1002900009F84FF6FF6000F001F831BD0240A1F807
+:10028000204600F02EFA00F011F8C00505D500F068
+:1002900009F84FF6FF6000F001F870BD0240A1F8C8
:1002A000442070472168B1F844207047206800F06E
-:1002B000ADBC044694F828020128704710B5FFF73A
-:1002C000F8FF01D1022010BD012284F8282284F811
-:1002D0002410206800F094FC30E738B5054601F0A2
+:1002B000C6BC044694F828020128704710B5FFF721
+:1002C000F8FF01D1022010BD012084F8280284F833
+:1002D0002410206800F0ADFC30E738B5054601F089
:1002E000070005EB40100C0647BF00F12804012071
:1002F00000F59474002001F0070160702170226104
:10030000E370607808B12178E181022B04BF0020FE
-:10031000207195F82802012801D1022032BD012167
-:1003200085F828122146286800F028FA52E01CB50A
-:1003300001F0070400EB441404F5947400F014F881
-:10034000627021700AE01CB501F0070400EB441450
-:10035000283400F009F821700122627021460068FB
-:1003600000F03FFB002016BD01F007016261A361B0
-:100370000022E261704738B505460C46696804F012
+:10031000207195F82802012801D1022032BD012068
+:1003200085F828022146286800F04CFA52E010B502
+:1003300001F0070400EB441404F5947401F0070184
+:100340006261A3610022E26162700DE010B501F00C
+:10035000070400EB441428346261A36100220123E6
+:1003600001F00701E261637021702146006800F02E
+:1003700051FB002010BD38B505460C46696804F0F5
:100380000700814201D2012032BD210605D505EBCF
:10039000401000F12801012204E005EB441000F5B3
:1003A000947100224A700120887004F007040C70D8
-:1003B00095F82802012801D1022032BD012285F8DA
-:1003C0002822286800F0C6FB24B9286805F50C71BE
-:1003D0000020C046002085F8280232BD1CB5044626
-:1003E00001F00F0362689A4201D2012016BD00F0AD
-:1003F0001AF847BF2830012200F59470002201F05E
-:100400000701427000228270017094F828120129BD
-:1004100001D1022016BD00F00CF800F0B4FB002062
-:1004200084F8280216BD01F0070004EB40100A060C
-:100430007047012284F828220146206870472DE980
-:10044000F84F00F59475064627E001880AEA010195
-:1004500041F40041018006F124043068B0F85010E6
-:10046000227901EBC201401800F202400088A16924
-:10047000C0F3090020620844A0610021304600F06A
-:1004800021F9217849B1E06938B92178306841F023
-:100490008001A0F84C1000212170306800F1440167
-:1004A0000A88130440F1E7800A8812F00F0440F62E
-:1004B0008F7748F60F7A57D1D206C6D50288130532
-:1004C00011D5898900F0E0F8EA88C3F30903EB61EC
-:1004D00006F50C7100F0AEFB306800F0CFF8304646
-:1004E00000F0E2F8D9E71104D7D500F0C7F830687A
-:1004F000B0F8501000F0C8F8C3F30903002BEB610B
-:1005000007D0EA88696900F095FB6869E9690844E1
-:1005100068610021304600F0CDF83068B0F8501026
-:100520004118286901F2064120B9088848F2FF32D3
-:10053000104009E03E2805D24208C00748BF521CBF
-:10054000900203E04009800240F4004008804BF62E
-:100550008F7230680188114081F4405141F40041AC
-:1005600041F08001018098E730F824805FEA08417B
-:1005700006EB441957D530F824100F4047F0800798
-:1005800020F8247009F594773068397B71B9B0F898
-:100590005030397803EBC103C21800F07DF82DD03C
-:1005A000FA8879695B4600F045FB27E039780B460D
-:1005B00030F823305A04B0F8503003EBC10107D5AE
-:1005C000421802F2024200F069F80AD03A8904E0C7
-:1005D000421800F061F804D07A895B46796900F02E
-:1005E00029FB3168387831F8202048F68F731A409B
-:1005F00042F4004242F0C00221F82020F969594437
-:10060000F961796901EB0B027A61BB6913B1396950
-:100610008B4504D23978304600F04CF803E0397845
-:100620003046FFF784FE5FEA086020D5316831F874
-:1006300024200AEA020242F4004209F1280021F8CB
-:10064000242032680178B2F8503003EBC103D2188D
-:1006500002F2024212884369C2F30902C2611A44DB
-:1006600083694261002B304602D100F02BF814E779
-:10067000FFF769FE11E70020BDE8F28F01880F4007
-:1006800047F08007078070472A7801EBC2014118C4
-:1006900001F206410B88704702F206421188C1F34D
-:1006A000090BBBF1000F704700F50C71D0F8700218
-:1006B00000F0E3BA00EB4112D0F87002D2F83C210E
-:1006C00000F005BB00EB4112D0F87002D26B00F0D5
-:1006D0003DBBD0F8700200F0C6BB10B50446D4F89C
-:1006E000700200F088FBD4F87002BDE810400121D0
-:1006F00000F0AABBD0F8700200F0A9BBD0F87002DD
-:1007000000F0ABBB10B51C461346D0F89802224649
-:10071000FFF7E3FD002010BD80B5D0F89802FFF789
-:100720002AFE002002BD80B5D0F89802FFF756FEE1
-:10073000002002BD81B0D0F8980201F07F0200EBEA
-:10074000421009064CBF90F82A0090F82A0101B027
-:10075000704780B5D0F89802FFF7B0FD002002BDC9
-:1007600080B5D0F89802FFF7EEFD002002BD80B5FD
-:10077000D0F89802FFF7DBFD002002BD2DE9F84715
-:100780000B4648F68F111D780246002032F825608E
-:100790000E40D97803290CD8DFE801F002080C05D7
-:1007A00046F4007606E046F4C06603E046F4806650
-:1007B00000E0012048F28004264322F8256048F634
-:1007C0008F7519780E4632F826702F403943214331
-:1007D00022F826104BF68F76197B93F800900029AB
-:1007E0004CF2800748F6BF7C48F2C00E67D1B3F8E0
-:1007F00006A04FF6FE7101EA0A0A59780029B2F8FC
-:10080000501011441ED001EBC90101F58061A1F81F
-:1008100000A0197832F82160760606D532F82160FA
-:1008200035404EEA050522F821501978DB78012B76
-:1008300032F821300CEA03030EBF1C4383F020037F
-:100840001C43CAE001EBC90909F20449A9F800A058
-:10085000B2F8501002EB010C19780CEBC10C1969BD
-:100860000CF2064C31B9BCF800E048F2FF3101EA65
-:100870000E010CE03E2908D24FEA510EC90748BFCD
-:100880000EF1010E4FEA8E2E03E04909890241F470
-:10089000004EACF800E0197832F821C05FEA4C4C09
-:1008A00006D532F821C005EA0C053D4322F8215057
-:1008B000197832F821301E4086F440568CE032F828
-:1008C0002910294041F4014141F0800122F829100A
-:1008D000B2F85010B3F808A002EB0109197809EB3F
-:1008E000C10101F580694FF6FE7101EA0A01A9F81C
-:1008F0000010B2F85010B3F80A9002EB0108197812
-:1009000008EBC10808F204484FF6FE7101EA09013C
-:10091000A8F80010597893F80080002932F82810C0
-:100920002BD1490405D532F8281029400F4322F86D
-:100930002870197832F821707F0606D532F82170B8
-:100940002F404EEA070722F82170197832F82170FB
-:100950003D404EEA050522F82150197832F8215021
-:100960002E4086F44056264322F82160197832F84A
-:1009700021300CEA03031C432FE0490405D532F86B
-:1009800028102940394322F82810197832F821809C
-:100990005FEA486807D532F8218005EA08084EEA80
-:1009A000080E22F821E0197832F821E005EA0E0558
-:1009B0003D4322F82150DD781978012D32F821507D
-:1009C0000CEA050518BF85F02005254322F82150C3
-:1009D000197832F821301E40344322F82140BDE816
-:1009E000F287F8B50E46054672783469B069012A77
-:1009F00048F2800748D1844232BF001B04460020E1
-:100A0000B061307B40B9F28800F0A0F800F097F8B0
-:100A100000F2024004802EE03078C10035F820005A
-:100A20004206B5F85000284405D5091801F20641E0
-:100A30000C80728904E0091801F202410C803289AD
-:100A400000F084F8707848F68F7140B9307835F846
-:100A50002020114041F4004141F0C00109E001288B
-:100A600009D1307835F82020114041F4404141F05F
-:100A7000800125F82010317835F8212048F6BF7024
-:100A8000024082F030024EE0844232BF001B044636
-:100A90000020B0616009317B8302002943F40043E8
-:100AA00004F001004FEA540C18D0AAB900F040F845
-:100AB00001F202413CB9B1F800E0202262F38F2E2E
-:100AC000A1F800E008E03E2C05D2624600B1521CBD
-:100AD00092020A8000E00B807178A9B900F028F832
-:100AE00001F206412CB90A88202060F38F220A8087
-:100AF00011E03E2C06D208B10CF1010C4FEA8C201B
-:100B0000088008E00B8006E0012904D100F017F806
-:100B100000F2064004804BF68F70317835F82120C2
-:100B2000024082F44052174325F821700020F2BDA4
-:100B3000B5F850103278691801EBC2017047B5F86A
-:100B400050003178281800EBC10070477169A3B2DA
-:100B500028465EE018B50A78497830F82240002926
-:100B600048F2800305D048F6BF710C4084F01004B1
-:100B700004E04BF68F710C4084F48054234320F83A
-:100B80002230002012BD30B50A7B002A36D14A78C7
-:100B90000C78002A30F8242048F2800348F68F753C
-:100BA00016D0520608D530F82420154045F40045EB
-:100BB00045F0C00520F82450CA78012A1ED00A78D2
-:100BC00030F8224048F6BF710C4084F0200412E057
-:100BD000520408D530F82420154045F4404545F02E
-:100BE000800520F824500A7830F822404BF68F71A7
-:100BF0000C4084F44054234320F82230002030BDC0
-:100C000011B98021A0F84C1000207047B0F84400C2
-:100C1000704710B580185B1C00F580605B0807E02A
-:100C20000A784C7842EA0422891C20F8022B5B1EC9
-:100C3000F6D110BD10B5821802F58062580806E0A2
-:100C400032F8024B0C70240A4C70891C401EF7D1FC
-:100C5000D80744BF1088087010BD10B5D0F88C229A
-:100C600002241AB11268904700B90024204610BD32
-:100C700080B5D0F88C22536801E138B5044604F5FC
-:100C80002075284600F0F6FA04F51B70012101607A
-:100C9000418B4160017D11F01F0003D002280BD071
-:100CA00005D30EE02946204600F0ECF80DE0294679
-:100CB000204600F05FF908E02946204600F07FF961
-:100CC00003E001F0800100F03EF8002032BD38B5AD
-:100CD000044610460A0004F51B7328D1196803293D
-:100CE0001DD104F5A6714A680D68AA420BD2AD1A4F
-:100CF0000D60954238BF2A46014692B2204600F068
-:100D0000E8FA002032BD186A016921B1187A032877
-:100D100004BF20468847204600F0E3FAF1E70529A2
-:100D2000EFD100201860002100F00DF8E9E7186A03
-:100D300082692AB1187A032802D120469047E0E759
-:100D4000022032BD80212046FFF7E6BC38B50446BC
-:100D50000800134604F51B7542D12868022832D1D9
-:100D6000226A616A914207D2521A2262194692B2ED
-:100D7000204600F0A6FA11E0E269B2FBF1F001FBB7
-:100D8000102090B98A4210D3686882420DD20022A6
-:100D90000021204600F095FA002068600023002220
-:100DA00000212046FFF7E3FC13E0286AC16821B167
-:100DB000287A032804BF20468847FFF7C3FF204650
-:100DC00000F096FA05E0042818BF002801D1FFF7CB
-:100DD000B9FF287B012804BF00212973002032BD00
-:100DE000286A42692AB1287A032802D1204690470E
-:100DF000F4E7022032BD10B5044640230022002152
-:100E0000FFF780FC04F5A27001210160402340211E
-:100E1000C160002280212046FFF774FC0120A06100
-:100E200004F51B72402060620120107200201060E7
-:100E300060601061506A28B1126A61685368C9B273
-:100E400020469847002010BD01740020704700F52F
-:100E50001D7001784170042102E000F51D70417899
-:100E600001700020704780B500F51D710A78032AD3
-:100E700003D18969C96901B18847002002BD98473B
-:100E8000002002BD7CB50446087810F0600004F52F
-:100E90001D7508D0202818BF40282DD1AA69936855
-:100EA0002046984764E04878092825D8DFE800F014
-:100EB0003D552450240905242B27204600F014F921
-:100EC00056E08A88002A04BFC888002814D14E88BA
-:100ED000802E11D22878032806F07F060CD0AE7041
-:100EE00031462046FFF735FC00F0FBF8002E14BF1A
-:100EF0000220012028703BE000F072F938E0204623
-:100F000000F070F934E0C8880128F5D12A78521E23
-:100F1000012A04D9921EEFD10122211D14E00020E4
-:100F2000A060012204F108010EE02878401E02288A
-:100F3000E2D8C8880228DFD1A868012100B10321C6
-:100F4000E160022204F10C01204600F0B2F90FE04A
-:100F5000488801280CD1012107E02878401E02288A
-:100F6000CAD84888012803D10021A96000F0B9F847
-:100F7000002076BD38B50D460446287810F0600094
-:100F80001CBF2028402816D104F51D721178491E77
-:100F9000022910D8287902280DDA92699368294627
-:100FA000204698470146E888002808BF002904D158
-:100FB00000F097F801E000F012F9002032BD7CB596
-:100FC0000446084604F51D730278017912F06005A5
-:100FD00009D0202D18BF402D6BD19A699368014626
-:100FE0002046984768E002F06002202A07D19A69FB
-:100FF00093680146204602B0BDE870401847427829
-:101000008AB3012A12D0032A53D11A78022A13D0A4
-:10101000032A4ED142881ABB002918BF80291FD04D
-:10102000C088E8B92046FFF777FB19E01A78022A52
-:1010300002D0032A0CD03CE0002918BF802938D008
-:101040002046FFF769FB80212046FFF765FB33E070
-:10105000408888BB11F07F0F1CBF2046FFF763FB61
-:1010600000F03FF828E0142201F07F051B7855437B
-:101070006619022B06F5A07502D0032B10D018E0DC
-:10108000002918BF802914D1080648BF06F11405AD
-:101090000020286002222946204600F00AF90BE0D1
-:1010A00001F00F0312FB03F20B06224406D59269EE
-:1010B00072B9014600F094F8002076BDD2F84421C0
-:1010C000002AF6D0002918BF802904D10020E0E7CB
-:1010D00006F11405F6E72046FFF72CFB00B10120CE
-:1010E000D7E7204600F0FDB838B50D4604466888BD
-:1010F000010A012904F5227208D0022923D003290C
-:101100002ED0062958D007295DD065E01268207CD2
-:10111000136869469847BDF8001079B1E98879B13C
-:10112000BDF80010EA88914288BF1146ADF8001062
-:101130000146BDF80020204600F0BBF8E88808B959
-:10114000FFF7CFFF31BD207C51680028684604D1ED
-:10115000896A884702214170DDE7C96A8847F9E753
-:10116000C0B2052838D8DFE800F003090F151B21AD
-:101170001268207C536869469847CCE71268207C47
-:10118000936869469847C6E71268207CD368694629
-:101190009847C0E71268207C136969469847BAE708
-:1011A0001268207C536969469847B4E71268207C2E
-:1011B000936969469847AEE7207C68B951684A6BE5
-:1011C00068469047A7E7207C30B951680A6B6846AB
-:1011D0009047072242709EE700F001F831BD294692
-:1011E00020465BE07CB50D460446214E6888307091
-:1011F0003178084602282DDA94F87422022A02D0A7
-:10120000032A0FD02BE041B16060032084F8740200
-:101210002046FFF722FD02281CD02046BDE876407C
-:1012200000F05FB841B9022084F8740200206060C9
-:101230002046FFF71DFDF0E761688842EDD0C9B296
-:101240002046FFF715FD317861602046FFF705FD68
-:101250000228E2D129462046BDE87C401EE0FFF787
-:10126000BEFF31782046BDE87C40FFF701BD00009D
-:10127000290500200A7802704A784270CB788A7873
-:1012800002EB032242804B790A7902EB032282802F
-:101290008A79C97902EB0122C280704710B50446F1
-:1012A0008021FFF739FA2046BDE810400021FFF702
-:1012B00033BA80B513460222C0F86C22C3610362C0
-:1012C00001E080B513460A460021FFF749FA0020E5
-:1012D00002BD80B513460A460021FFF748FA0020F8
-:1012E00002BD80B50421C0F86C1200230022EBE798
-:1012F00080B50521C0F86C1200230022ECE7000045
-:10130000DFF83C150A6892B200E00246086880B235
-:101310008242FAD170472DE9FC4104461825DFF8D6
-:101320002485DFF82465684308EB00073078062839
-:1013300008D131787170347078754FF0FF3070607B
-:10134000002039E000F077F8B9680918B96008F1B1
-:101350000803B96832786A439A589142327813D3B5
-:1013600008F1150315FB02FC13F80C30062B25D0F1
-:1013700008F108066B43F358994222BF08F11503A0
-:101380006A439A5CEED219E01146337869439A4277
-:101390000BD008F1140308F1150C5B5C15FB03F589
-:1013A0000CF805407A753B7500E07A7508F1140277
-:1013B0005454317871703470BDE8F6811146694338
-:1013C00008F115035B5C062B04D008F1140615FB2D
-:1013D00003F574557B753A7508F115025454EBE723
-:1013E000F8B5DFF86434DFF85C541E781824024640
-:1013F0006243B0422A4404D118785870507D187066
-:101400000FE0167D507D92F815C005F11507664373
-:10141000062807F806C004D0167D143514FB00F426
-:101420002E55012010731878062802BF00294FF0AE
-:10143000FF315960F1BD10B5DFF80C44606810F160
-:10144000010F0FD0FFF75CFF6168DFF800248142D5
-:1014500061683CBF5388C918081A5178484311780D
-:10146000C84000E0002080B210BD2DE9F84FDFF841
-:10147000DC53DFF8DCB3D5F80880D8F80000DBF8DF
-:1014800000104A0500F090F9DFF8BC63DFF8B4A360
-:1014900021F4806181604FF0180934780AF1080066
-:1014A00019FB04F14758FFF7C6FF874217D2002700
-:1014B0000121B170062C3DD019FB04F40AF108019A
-:1014C0000AF108020959814223BF0AF108010959AA
-:1014D000091A002111510AEB04014C7DEAE7A988A1
-:1014E0004118B94202D2AF880021E2E73F1ADFE794
-:1014F000022802DA2878012800D07F1ED8F80000E0
-:10150000C1684A07FAD500F055F9DBF80C00000C69
-:10151000BFB247EA0047CBF80C70FFF7F1FE7060EE
-:10152000A8680068816841F480618160AFF3008041
-:10153000BDE8F18FB8B20028DAD1FFF7E1FE7060A4
-:101540000320BDE8F24F00F0E2B92DE9F843EFF3D4
-:10155000108872B6BD4DBB4BA8680168CA224A62AA
-:1015600053204862B84A886820F480608860182058
-:101570001678374647431F44387B022826D13C68FB
-:10158000D7F810909078F0B17A7B012A0AD1012126
-:101590003046FFF725FF88F310887968304600F061
-:1015A00016F904E088F31088304600F0C1F8A86806
-:1015B0000068CA21416222465321416248463146B1
-:1015C00000F050F90BE0FFF750FF06E0C868420753
-:1015D000FCD500F07EF89F49086088F31088FF2151
-:1015E000A86802685162BDE8F183F8B5974CA16024
-:1015F000CA2209684A6253224A62954A136843F034
-:1016000020031360136803F00703C3F1040323707E
-:1016100095682D0C05F07F056D1C6570EDB2926824
-:10162000C2F30E02521C628092B2521E6A43A2F5AD
-:10163000A072DA404FF6FF739A422CBFA380A280BB
-:10164000854A136843F400231360844B1D6845F4F6
-:1016500000251D6048BB7C487A4E01238370182505
-:101660004FF0FF33436000235FFA83FC06F10C0761
-:1016700015FB0CFC4FF0000E07F80CE05B1CDFB212
-:10168000062FF1DB06230370886820F480608860F1
-:1016900000F01FF8D060032000F044F9A16808684A
-:1016A000826842F48042826005E0C868410544BF18
-:1016B000032000F02CF9A1680A68FF205062002284
-:1016C0000321032000F0ECF8BDE8F240032000F015
-:1016D00004B9C86800F0800060F49060C8604FF4FE
-:1016E00000207047F0B504460025EFF3108672B66F
-:1016F0001827DFF850C10CF10C0007FB05FE10F8AD
-:101700000E0010B16D1C062DF5DB062D0CD06F43BD
-:101710000CEB07000127077386F3108804614273FE
-:1017200003600D700020F0BD86F310880120F0BD2D
-:10173000F8B50746EFF3108472B6032000F0D8F82E
-:10174000424DAE683068CA2141623A465321416237
-:10175000182043494243895C02291BD100213846A5
-:10176000FFF73EFE3848017806290ED13068384927
-:101770000A68530500F018F821F480618160C1689F
-:101780004A07FCD500F016F804E04078884218BFFC
-:10179000FFF76BFEA9680A68FF205062032000F083
-:1017A0009CF884F31088F1BD02D5C1684A07FCD4C7
-:1017B00081687047C16801F0800161F49061C16087
-:1017C0004FF4002023490860032000F0ABB82DE956
-:1017D000F04180460F46424618201A4942438C1871
-:1017E000207B022804BF4046FFF7A2FFEFF31085DD
-:1017F00072B6032000F07CF8144EB0680068CA216D
-:1018000041625321416202202073A7606760404615
-:10181000FFF781FD0C490A784978914202D0FFF721
-:1018200024FE02E0A168081AA060FF20B1680A68DF
-:101830005062032000F051F885F31088BDE8F08174
-:1018400028280040700300205C05002014050020BB
-:10185000082800400C08005800080058800800586C
-:101860007C030020104700000901020081B002D46F
-:101870003248815405E0324802F00F02104400F86B
-:10188000041C01B070472F4A13684FF6FF01000295
-:101890000B4000F4E06018432B4908431060704788
-:1018A00038B5284B1C68C4F30223C3F10704052C88
-:1018B00028BF04241D1D072D34BF0023DB1E012576
-:1018C00005FA04F4641E2140994005FA03F35B1EF7
-:1018D0001A401143BDE83440C6E7010007D4012295
-:1018E00000F01F01194B8A40400943F8202070473F
-:1018F00001000BD4012200F01F01154B8A40400962
-:1019000043F82020BFF34F8FBFF36F8F7047010064
-:1019100007D4012200F01F010E4B8A40400943F812
-:1019200020207047010007D4012200F01F010A4B5C
-:101930008A40400943F820207047000000E400E09E
-:1019400018ED00E00CED00E00000FA0500E100E019
-:1019500080E100E000E200E080E200E038B58EB017
-:1019600002A80FF2C431C54C302200F005FA0FF284
-:101970006D300190009469460FF24930C04C00F080
-:101980003FFA0121022000F01AFBBE4A0021042088
-:1019900000F0ABFB02A800F01FFC00F072F800F0B2
-:1019A00023FC002084F8900004F126054FF6FF7018
-:1019B000288000210FF2A522012000F096FB0620CE
-:1019C00000F09DFC00F00AFD0FF2D523002204F187
-:1019D00091010020FFF786FE0FF2CD23002204F1D3
-:1019E00092010020FFF77EFE002068808021A6483B
-:1019F0000180A0214180012000F0EAF80FB030BD45
-:101A0000F8B507469E4C7878A04D052804F190065D
-:101A100004D03E2810D0FF2824D02EE0B888E18CD6
-:101A2000884202D10020E0843070012000F0D0F81C
-:101A300001212970E08C10E0F87801281DD1707820
-:101A4000FFF776FE307804280CBF062005203070A2
-:101A50000021B7F80500E08429706880284600F06E
-:101A6000B7FC0AE0B7F80300042806D1012000F013
-:101A70001FFDB0780A21FFF7AAFE0120F2BD00F099
-:101A8000C7BC78B589B00020ADF81A0000F065FD3C
-:101A90007F4D804E286810F1010F0ED069683074B8
-:101AA000090A020A000CB074727406F11004686826
-:101AB0003175F074090A717506E0002000F09EFD92
-:101AC000040008BF0FF2302422460621002000F057
-:101AD000E1FB6079307207AA207970720621E07804
-:101AE000B072A078F072607830732078644C7073B4
-:101AF0004EF66E500890286807902E2000F0CAFB22
-:101B00000FF2FC121021182000F0C4FB0FF200228B
-:101B10001021082000F0BEFB1821012000F0E1FB9D
-:101B200000F07EFD0DF1160006A90190009105ABB5
-:101B300007220021012000F01EFF0FF2B410BDF8B3
-:101B4000181000900723BDF81400002200F028FEB2
-:101B50000DF11A0000900223BDF81610BDF8140014
-:101B6000002200F01DFE02220221002000F015FDDF
-:101B70000020207000F0B3FE012060700020E070B3
-:101B8000082060751020A075012020754248A061D2
-:101B90000120A0700020C1B221440871401CC1B2D4
-:101BA0001029F8DB002004900023A06961780390DD
-:101BB0000022207D0290A07D0190607D0090A078A1
-:101BC00000F0A6FEA07808B100F028FF0AB070BDB2
-:101BD0002DE9F8420746012F87B003D12A4805882E
-:101BE000468803E04FF4C8654FF47A66DFF89090BA
-:101BF00009F190046078FFF79BFD022F05D1207852
-:101C0000012814BF022800F00FFE27700020069064
-:101C1000059009F129010491082299F828000FF292
-:101C2000001103900291019200230093324629464D
-:101C3000002000F00BFE17490E2000F0CCFE00281B
-:101C400008BF012F06D16078144908B0BDE8F04202
-:101C5000FFF7BDBD08B0BDE8F082000010B501205F
-:101C600000F030FC064C94F89000052804D000F0F9
-:101C7000DBFD002184F8901010BD0000A0080320B7
-:101C8000DC0200203F1E00086C05002064050020D7
-:101C90008075FF1F0400002007B2010046E001002C
-:101CA0000021012000F02EBA012000F00BBC002121
-:101CB000042000F027BA012000F046BA012000F00D
-:101CC0004BBA000010B50446616801F1080000F04D
-:101CD000B6FA00B10120207010BD000010B101283B
-:101CE00003D07047072000F01DBA072000F022BA89
-:101CF00053544D33325742006C7AD8AC57720000BF
-:101D0000123456789ABCDEF0123456789ABCDEF063
-:101D1000FEDCBA0987654321FEDCBA0987654321E9
-:101D200009503250535256310000000000000000AC
-:101D30000000000000000000000000004400080057
-:101D4000400508013A799C00F4010001FFFFFFFF04
-:101D5000480101000000000062B38B0708D0521E4A
-:101D600011F8013B00F8013B00F024808B07F6D10D
-:101D7000830740F0208000BF103A07D330B4B1E8A9
-:101D80003810103AA0E83810F9D230BC530724BFFD
-:101D9000B1E80810A0E8081044BF51F8043B40F82F
-:101DA000043BD20724BF31F8022B20F8022B44BF9A
-:101DB0000B7803707047121F17D35B0009D151F8DD
-:101DC000043B20F8023B1B0C121F20F8023BF6D20A
-:101DD0000BE051F8043B00F8013B1B0A20F8023BE2
-:101DE0001B0C121F00F8013BF3D238BF121D521E0C
-:101DF00024BF11F8013B00F8013BF8D87047000000
-:101E00007FB50C46684D6168684EE86129622846D6
-:101E100000F05CFE246805F12400006040607460FE
-:101E200006F108000060406001203070296829B187
-:101E30000FF2411000900294684688477FBD3EB57E
-:101E4000594C5A4D02E0009800F0E8FE05F10800F8
-:101E500000F035FFD8B92878002818D0694605F178
-:101E6000080000F055FF01202870E1690029EAD040
-:101E70000098029001A888479DF804002870002867
-:101E8000E1D1009905F1080000F022FFDEE737BD3F
-:101E90002DE9F8430646002000F05FF8748830888A
-:101EA000B268DFF80481C4F3090444EA8024F068CE
-:101EB000A4B2C1B2204600F03CF8002748F2E8097D
-:101EC0004846FFF7FBFE08E06888A04202D131696E
-:101ED00028780870687800B1012708F1240000F024
-:101EE000EEFEF0B9694608F1240000F011FF0098F9
-:101EF00000F10B05407A0F28E6D0B5F80110A14299
-:101F00000DD10098817AC81E7169C0B28842C8BFDD
-:101F10000846706102463069E91CFFF71DFF28780A
-:101F2000D9E73800CCD0012000F017F80020BDE838
-:101F3000F28310B513461D4A5468A4F80900E172F3
-:101F40000A46194604F10C00FFF706FF164A13690A
-:101F5000BDE810400021002018471349096A82B0EB
-:101F600008B921B101E011B1012002B0084702B067
-:101F70007047000010B50146487A0F2818BF0E2898
-:101F800007D10B4800F0AEFEBDE810400020FFF77F
-:101F900092BE064C04F1080000F0A4FE04F1080013
-:101FA000BDE81040FFF783BE80040020F404002049
-:101FB000A40400201948002101604160704710B559
-:101FC00000F00CF85C6819B1012904D1204301E04C
-:101FD00024EA0000586082F3108810BDEFF31082ED
-:101FE00072B60E4B704738B5EFF3108472B60B49DA
-:101FF0000B4D086820B129688847686880470AE067
-:10200000486820B1A9688847E868804703E02869E4
-:1020100080476869804784F3108831BD2C05002013
-:10202000403F00082DE9FC47554CDFF85891A56961
-:102030002840A0614FF0010A4FF0FF3830E0491C02
-:1020400054F831000642FAD004EBC1071840796811
-:102050001040014208BFC7F804807E68304000F09D
-:1020600093F860620AFA00F086437E60EFF3108115
-:1020700072B6626A20690AFA02F2D2431040206105
-:10208000022004EBC00353F8086C1640401E43F8CE
-:10209000086CF6D181F31088606A59F820108847DF
-:1020A00063692069A2691840104207D0E069216A7B
-:1020B000084203D1002103EA0206C1E7C046C04638
-:1020C000EFF3108972B6216960690140A06901428D
-:1020D00001BFE169206A014200F095FE89F3108892
-:1020E000C046C046A561BDE8F38738B51446EFF396
-:1020F000108572B600F048F8224941F8204085F377
-:10210000108831BD10B5EFF3108272B61C4B1C69FC
-:1021100004431C6153F83140204343F8310082F3FB
-:10212000108810BDEFF3108172B6154A536923EA87
-:10213000000005E0EFF3108172B6114A53691843AD
-:10214000506181F310887047EFF3108172B60C4A2A
-:10215000D3691843D061F4E770B5094C656A266A03
-:102160002062012101FA05F502E0284600F04DFE4B
-:10217000216AE0690842F8D088432662E06170BDB8
-:102180001C0000200004002002460020110C09045D
-:1021900004BF1020120412F07F4F04BF0830120257
-:1021A0000FF2180112F0704F04BF001D1201120F40
-:1021B000C0F11F00895C401A70470000040302024E
-:1021C00001010101000000000000000000F07CFEA1
-:1021D0009DF80E0005B000BDF8B500F10C026B468D
-:1021E00021214FF66640F1E780B5294800210171B1
-:1021F0000172C046C046C046C046C046C046C04642
-:10220000C046C046C046C046C046C046C046C0469E
-:10221000C046C046C046C046C04600F0D4FEC046D8
-:10222000C046C046C046BDE8014000F071BF184935
-:102230000A7941F822000879401C0871704770B58E
-:1022400004466078FF2802BFB4F8031001F47F4110
-:10225000B1F5406F12D100260D4D00E0761C2979B2
-:10226000F0B288420AD2F1B255F8211020468847D0
-:102270000100F3D002D0022805D006E02046BDE8D8
-:102280007040FFF7BDBB002070BD012070BD000095
-:102290002005002018B50C46C7B0114600228DF865
-:1022A00000208DF81C008DF81D4022460DF11E0007
-:1022B00000F02FFF00F03BF83F200C21ADF80400A8
-:1022C000ADF8061007A8012103900691A41C049400
-:1022D00000F043F800284CBFFF209DF8000048B0F4
-:1022E00010BD00B5C7B000F01BF80F2000F02AF8B1
-:1022F00000284CBFFF209DF8000047B000BD00B58E
-:10230000C7B00021ADF81C0000F016F8182000F04E
-:1023100019F800284CBFFF209DF8000047B000BD11
-:1023200000228DF800208DF81C008DF81D10182259
-:10233000002101A800F0F3BE8DF80010182201A8BA
-:1023400000F0EDBEADF8060007A9022004903F2280
-:10235000012003910690ADF80420CDF814D000219F
-:1023600001A8FFF795BD000038B50546314C287827
-:1023700020B1012804D0032805D031BD012000E0A0
-:102380000020207031BD6968087868B94978012952
-:1023900003D100F08DF80121A1706968487818B95F
-:1023A00000F090F80020A0706868017801290ED133
-:1023B0004078012804D1002000F07AF80120A070B4
-:1023C0006968487818B900F07DF80020A07031BD28
-:1023D0000078012808BF00F00DB8704780B50FF2F3
-:1023E000390200210220FFF780FE124900220A7004
-:1023F000BDE8014080B5002000F064F80D480121DF
-:102400004170002181700121C1700021017101BD65
-:1024100000210220FFF776BE06490879401E804160
-:10242000C00F0871087820B1C91C4FF6426000F057
-:102430005ABE70474C050020404981B00A680243EB
-:102440000A60096808400090009801B0704778B5AC
-:1024500085B004466846142100F06CFE0CB90120DA
-:1024600004E0012C18BF022C02D10220FFF7E4FF88
-:1024700000F012F800950120019000210220039045
-:1024800000F004F800F00EF806B070BD0291694645
-:1024900056F8240000F052BE0FF2B000284E30F87B
-:1024A0001450704756F824000022294600F00ABF55
-:1024B0000FF29801224B31F8101053F8200001223E
-:1024C00000F000BF0FF284011D4B31F8101053F8DB
-:1024D0002000002200F0F6BEF0B585B004460D469F
-:1024E0006846142100F026FE0120FFF7A5FF280012
-:1024F000144E0FF260070AD137F814000090002143
-:1025000001910120029002210391FFF7C0FF012DEC
-:1025100012D137F81400009001210B480190FFF709
-:10252000B5FF0FF23400045D00220F2160B2FFF707
-:10253000B7F960B2FFF7D1F905B0F0BD4C00005813
-:10254000500000205C00002000002110100001005D
-:102550000200000000040000280000B587B000F071
-:1025600010F8012003220690ADF80420ADF80620F3
-:1025700000F03DF800284CBFFF209DF8000007B098
-:1025800000BD00208DF800001822002101A800F0F5
-:10259000C6BD182201A800F0C2BD00B5C7B000F04A
-:1025A0000EF8FFF7F6FF312000F013F800F01FF8E7
-:1025B00000284CBFFF209DF8000047B000BD00235D
-:1025C0008DF81C008DF8003007A841708270002142
-:1025D0007047ADF8060007A90320049008220120E7
-:1025E00003910690ADF80420704703900691CDF852
-:1025F00014D0002101A8FFF74BBC0000014606489B
-:10260000064AC3798B4218BF904218BF0838F8D1E8
-:102610008B4218BF00207047F873FF1F0070FF1F28
-:1026200000B587B000208DF8000000F0E0F840F21F
-:102630000110ADF806003F220120069000F0ECF8F2
-:1026400000284CBFFF209DF8000007B000BD2DE919
-:10265000F84107460128C7B0884615461E4608BF00
-:10266000022003D002280CBF102000200DF11D0114
-:102670000C1800F036F8012F8DF81C7002D0022FD4
-:1026800018D019E002273A4641460DF11D0000F02E
-:1026900040FD2570667000F0AAF83F204FF481716C
-:1026A00000F016F8FF1C049700F0B8F8002805D5D4
-:1026B000FF2009E01027E6E7472005E09DF800002D
-:1026C00010B94E9800F067F8FFE748B0BDE8F08118
-:1026D000ADF80400ADF8061007A803210390069199
-:1026E000704703220021684600F019BD2DE9F64F1E
-:1026F0000C460546012CC7B09B4608BF022003D0FC
-:10270000022C0CBF102000200DF11F010E18FFF746
-:10271000E8FF012CADF81C508DF81E4002D0022CB1
-:102720002CD02DE00227569C559DDDF85091DDF808
-:102730004CA1DDF8488148993A4600F054F8A6F8D3
-:1027400000B086F8028086F803A086F804907571C0
-:10275000B47100F04CF83F20ADF804004FF48271E2
-:1027600007A8ADF80610039003210A3704970691D5
-:1027700000F054F8002805D5FF2009E01027D2E723
-:10278000472005E09DF8000010B9579800F003F8C5
-:1027900049B0BDE8F08FBDF80110018000207047FE
-:1027A00030B5C7B01C464A9B00F026F800258DF8CE
-:1027B00000508DF82140224619460DF1220000F00C
-:1027C000A8FC00F014F83F204FF4837100F01BF8D0
-:1027D000A41D049400F022F800284CBFFF209DF8AF
-:1027E000000047B030BD0DF11F0000F092BC182270
-:1027F000002101A800F093BCADF81C00ADF81E103C
-:102800008DF820207047ADF80400ADF8061007A839
-:102810000121039006917047ADF80420CDF814D043
-:10282000002101A8FFF734BB00B587B000F00DF917
-:1028300000F00FF9812000F003F900F013F90028EF
-:102840004CBFFF209DF8000007B000BD2DE9F84DFA
-:10285000C7B09446DDF840E1519A559D569EDDF88B
-:102860004CA1ADF81D108DF81C004FF0000BADF819
-:102870001FC08DF821308DF822E000F024F800F020
-:1028800017F824F8095F668000F0E3F83F20832101
-:1028900000F003F9574406910D37049700F0E5F86E
-:1028A00000284CBFFF209DF8000048B0BDE8F08D27
-:1028B00088F800A007AC5499E419524608F10100C9
-:1028C000544400F026BC8DF82320174652998DF809
-:1028D00000B00DF1240809A8B84400F01ABC00B5F6
-:1028E000C7B000F00CF8852000F090F800F0BAF8BE
-:1028F00000284CBFFF209DF8000047B000BD00211C
-:102900008DF81C008DF80010182201A800F007BCFB
-:102910002DE9F841C7B04FF0000800F026F80DF19E
-:102920002300DDF844E14E9F4F9E509D529C8DF850
-:102930001F30C0F800E08DF800808DF820708DF811
-:1029400021608DF822508DF8274000F082F8862013
-:10295000ADF8060007A90C2000F080F800284CBF55
-:10296000FF209DF8000000F0A4B88DF81C0007A817
-:10297000417082707047F8B5C8B005460E461746DC
-:102980001C4600F023F808A8467087708DF8205088
-:1029900000F07EF88A21ADF80A103F20032100F0F4
-:1029A0006AF8002848BFFF200ED49DF8000058B9EF
-:1029B0004F994E98BDF801202280BDF80320028077
-:1029C000BDF805000880002049B0F0BD07220021B5
-:1029D000684600F0A4BB18B5C7B0044600F035F84F
-:1029E0008DF81C40224600F060F800F032F83F20DD
-:1029F0008E2100F061F8641C049400F036F8002881
-:102A00004CBFFF209DF8000048B010BDADF8060097
-:102A100007A901203F2203910490704700B587B0B9
-:102A200000F013F800F015F8922000F009F800F01B
-:102A300019F800284CBFFF209DF8000007B000BD2A
-:102A4000ADF806003F220120704700208DF80000FD
-:102A500070471822002101A800F061BB04903F22BA
-:102A6000012003910690ADF80420CDF814D0002188
-:102A700001A8FFF70DBAADF80800059108A80721D5
-:102A800004900791CDF818D0002102A8FFF700BAF2
-:102A90001822002102A800F042BBADF80400ADF8F6
-:102AA000061007A80121039070470DF11D0000F0EA
-:102AB00030BB48B0BDE8F081ADF80400ADF80610B9
-:102AC00007A80121039006917047000002490160A8
-:102AD00002490161704700BF172B0008412B000815
-:102AE00000F084BC6B486C49016001F12002426037
-:102AF00001F13002826001F13C02C26001F1440246
-:102B0000026101F16002426101F16402826170318F
-:102B1000C16100F073BC38B50446604D05F110008A
-:102B200000F0CAF85B494868A1680160E168C160CB
-:102B3000456005F11001816000F07CFC58482DE0F3
-:102B400080B554494A6813680120187200F078FC77
-:102B5000002002BD38B5524C504D07E0694605F1E2
-:102B6000100000F0D5F800982168884705F11000A2
-:102B700000F0A5F80028F1D031BD49484168084768
-:102B800038B50446474D2846006040604148C0685B
-:102B9000A1680160456000F058FC4348216801606D
-:102BA00061684160002032BD80B53A49CA68136847
-:102BB0001020187200F04FFC002002BD3549CA6891
-:102BC000394910680B68184738B5374C354D06E061
-:102BD0006946284600F09CF80098616888472846B6
-:102BE00000F06DF80028F3D031BD38B504462F4D04
-:102BF0002846006040602E4800604060254800691B
-:102C0000A1688160E168C160056121680160616857
-:102C10004160216941616169816131BD80B50146D1
-:102C2000234800F05FF8BDE802400FF2090000F011
-:102C300022BC000038B5174C1D4D08E069462846F7
-:102C400000F066F800992069006900F04BF828460A
-:102C500000F035F80028F1D031BD10B5154C2046F4
-:102C6000006040600B4841690C60BDE8104000F016
-:102C700016BC1CB50F4C06E06946204600F048F82B
-:102C80000098C046C046204600F019F80028F3D04E
-:102C900013BD000000000320AC09032080080320BE
-:102CA0003C0500209808032044050020240A032046
-:102CB000340500202C0A0320006040607047EFF3C9
-:102CC000108172B6026882420CBF012000201CE015
-:102CD000EFF3108272B603680B6048600160086809
-:102CE000416023E0EFF3108272B6086043684B60E6
-:102CF00041604868016019E0EFF3108172B64368E3
-:102D000002681A6042680068426081F31088704768
-:102D100010B5EFF3108472B602680A600068FFE72E
-:102D2000FFF7EAFF84F3108810BD086082F3108873
-:102D30007047000010B52848284C88B0016841F45D
-:102D400000410160FFF736F900F0BCFB2449002088
-:102D5000FEF74BFC00F0CFFB2248016841F48031C4
-:102D600001600121026C42F4803202640120FFF70D
-:102D700026F90020FFF76BFB0120FFF768FB02201C
-:102D8000FFF765FB0120FFF793FB01210020FFF710
-:102D9000A3FBFFF7A7FE144A00210820FFF7A5F9BF
-:102DA00004F23C500FF245010090019169460FF288
-:102DB000410000F03FF804F25470029004F5C9613C
-:102DC00040F23C5005900391049402A8FFF70DFFD8
-:102DD000FFF786FE08B010BD080000582000032051
-:102DE000AC04002090080058772E000870470000BF
-:102DF00080B5FFF732FF00210120FFF7E0F8BDE8C2
-:102E00000140FEF7ABBDFFF7EEB84FF0FF30FFF724
-:102E100009B900210820FFF775B90220FFF794B91E
-:102E20000220FFF799B9B0F5806F08BFFEF727BE03
-:102E3000704700007FB50C46484D6168484EE86118
-:102E40002962284600F062FB2468746006F10800DD
-:102E500000604060012000F05DF8012030702968BA
-:102E600041B10FF2D5000FF2D90200900192029405
-:102E7000684688477FBD3EB5384C394D02E0009822
-:102E8000FFF7CCFE05F10800FFF719FFD8B9287845
-:102E9000002818D0694605F10800FFF739FF012026
-:102EA0002870E1690029EAD00098029001A88847BB
-:102EB0009DF8040028700028E1D1009905F1080070
-:102EC000FFF706FFDEE737BD2DE9F04105460E4668
-:102ED00090461C46002000F01DF8214F7868A0F8AD
-:102EE0000950C672324641460C30FEF735FF1B4A88
-:102EF000136900210020984748F2E800FFF790FF8F
-:102F000079688A78D21C04F10800FEF725FFBDE835
-:102F1000F04101201CB51149124C096A20B901B1D8
-:102F200088470020207013BD0120207011B1BDE83A
-:102F30001C40084713BD00000020FFF76EBF0000D3
-:102F400010B50146064C04F10800FFF7CBFE04F172
-:102F50000800BDE81040FFF75CBF0000D00400206F
-:102F6000040500202A0500201FB541780024FF2910
-:102F700002BFB0F8032040F601418A4220D1624AE4
-:102F80009388B0F807109B1C994209D1407B01241B
-:102F9000C10752BF8DF8004000218DF800100CE0F1
-:102FA0005288521C91420BD103218DF80010B0F8C9
-:102FB0000B208DF808200D3001906846FFF7D4F9FA
-:102FC000204604B010BD10B58AB050484E4CFFF7F3
-:102FD0002EF98F218DF81810E520B3218DF81900F6
-:102FE0008DF81A10D5202E218DF81B008DF81C109D
-:102FF0007F204A218DF81D008DF81E1098202A216F
-:103000008DF81F008DF8201048207A218DF82100BE
-:103010008DF82210CC2040218DF823008DF824104B
-:10302000FE2000218DF82500ADF82610009408231D
-:10303000012206A90220FFF70AFB00F032F8412026
-:1030400000F023F8A01C00F010F8062100F015F89D
-:1030500000F027F8422000F018F8201D00F005F8D5
-:10306000102100F00AF80AB010BD0590012104916A
-:10307000029100200A2201907047039200910223DE
-:10308000208806AA0221FFF731BB8E218DF824008B
-:103090008DF823100020FE21ADF826008DF82510B4
-:1030A000704719208DF81800ED2182208DF81A0044
-:1030B0008DF81910ED20AE218DF81C008DF81B1035
-:1030C0004C2021218DF81E008DF81D1041209D21DE
-:1030D0008DF820008DF81F10222045218DF8220048
-:1030E0008DF82110704780B542224FF64263984216
-:1030F00008D1054800910223818800880022FFF74B
-:103100004FFB0246104602BD54050020692F0008FF
-:10311000704710B50446FEF71FFE204610BD10B5DF
-:10312000044610460A460146204600F0F9F92046BA
-:1031300010BD0000002200F027BA00002DE9F84F72
-:103140004FF0000C674A684BDFF8A0814FF00F0981
-:1031500082460F4633E0664DAA4514BF0725042575
-:103160008D40254348F82E50C1431C6801EA040EE7
-:103170007C68E50348BF40EA0E0EC3F800E05C68D7
-:1031800001EA040E7C68A50348BF40EA0E0EC3F8AE
-:1031900004E0146801EA040E7C68E50248BF40EAD6
-:1031A0000E0EC2F800E0546801EA040E79688C0241
-:1031B00048BF40EA0E0EC2F804E00CF1010C396879
-:1031C00031FA0CF000F07C80012000FA0CFE1EEABF
-:1031D0000100F2D07C68022C18BF122C4FEA8C013F
-:1031E00010D14FEADC040AEB840401F01C05266AC6
-:1031F00009FA05FB26EA0B06D7F810B00BFA05F51D
-:10320000354325624FEA4C040325DAF8006097F84D
-:1032100004B0A540ED430BF0030B2E400BFA04FB6A
-:103220004BEA0606CAF800607E68012E18BF022E1F
-:1032300003D0112E18BF122E17D1DAF80860D7F874
-:103240000CB02E400BFA04FB4BEA0606CAF80860E5
-:10325000DAF8046026EA0E0E7E68C6F3001606FA57
-:103260000CF646EA0E06CAF80460DAF80C6035403F
-:10327000BE6806FA04F42C43CAF80C407C68E400EB
-:103280009BD54FEA9C0E58F82E5001F00C0109FA1C
-:1032900001F425EA0404BAF1904F08BF00250ED0CE
-:1032A000144DAA4508BF012509D0134DAA4508BFF2
-:1032B000022504D0114DAA457FF44DAF03254FE7F9
-:1032C000BDE8F18F81B0002A14BF8161816201B035
-:1032D00070470B4A136803421CBF1060FFF7A3BD81
-:1032E000704700000008005880080058080001409E
-:1032F000001000480004004800080048000C004886
-:103300000C080058C0680840884201D1012070476D
-:1033100000207047C0690840884201D101207047F1
-:103320000020704710B5614C02212046FFF7F2FFE4
-:1033300038B16068C043810703D5FFF745FC022020
-:1033400018E001212046FFF7E5FF38B16068C0436F
-:10335000C10703D5FFF7FEFB01200BE00821204643
-:10336000FFF7D8FF38B16068C043010703D5FFF706
-:1033700080FC0820A06010BD10B54C4C00F033F864
-:1033800018B96068C043810306D400F02CF830B946
-:103390006068C043810302D5BDE8104064E00821A5
-:1033A00000F022F870B96068C04301030AD5606874
-:1033B0003F4940F400206060086880474FF40020D7
-:1033C000A06010BD202100F00FF858B96068C0431C
-:1033D000810207D5606840F400106060BDE81040CD
-:1033E000FFF7CBBB10BD022120468BE740BF20BFBB
-:1033F0003048016841F400410160704780B52E48B3
-:10340000016841F480110160006800F480100090B0
-:1034100000982648016841F001010160026842F409
-:10342000803202602C20FEF758FABDE802402D20C1
-:10343000FEF753BA21480168490849000160704706
-:103440001F494FF48030086070471C48016821F024
-:1034500002010160704719484FF400314160016872
-:1034600021F40031016070471448016841F40031D3
-:103470000160FFF7A3BB38B504460C4D0821284670
-:10348000FFF740FF30B10A480460686820F400206C
-:10349000686031BDA0474FF40021A96031BD0748E5
-:1034A000016821F00801016070470000000C00581D
-:1034B000680500200C04005850000058040C005807
-:1034C000080C0058DFF80C00FFE7016841F4806148
-:1034D0000160704704040058032010B5FEF7D3F9CB
-:1034E0000F200020C0460024002814BF012400F053
-:1034F0000BF8204610BD0348FFE7016841F00101C9
-:1035000001607047042004E0704700000249016038
-:1035100002490161704700BF812B0008A92B0008F8
-:1035200062F30F2262F31F42401810F0030308D029
-:10353000C91A1FD3DB0748BF00F8012D28BF20F8A8
-:10354000022D130030B414461546103928BF20E967
-:103550003C00FAD8490728BF20E90C0048BF40F8D2
-:10356000042D890028BF20F8022D48BF00F8012D46
-:1035700030BC7047C91818BF00F8012DCB0728BF11
-:1035800000F8012D7047000000B500BF13009646FB
-:103590009446103928BFA0E80C50FAD85FEA417C65
-:1035A00028BF0CC048BF40F8042BC90728BF20F82B
-:1035B000022B48BF00F8012B00BD0000DFF83013DC
-:1035C0000A68030903F47F2300019A4300F47F2073
-:1035D00000F068B9DFF818231368010C23EA0143EF
-:1035E00043EA0043136070472DE9F843054600267F
-:1035F0002878DFF8FC724106B0464FF0B0442DD574
-:10360000286B70B1B0F5800F06D0B0F5000F18BF71
-:10361000B0F5400F17D01FE0E06840F48030E06064
-:10362000C5E0206820F08060206000F067F98146E6
-:103630002068000140F1A88000F060F9A0EB0900CB
-:103640000228F5D90326AFE000F058F9A0EB0900F5
-:10365000022840F2A180F5E70126B046286801055E
-:1036600031D5B86800F44078286C80452AD000F045
-:103670004BF9B8F1000FB96805D1286C21F44071FD
-:103680000143B9601EE0B86840F48030B86021F4AE
-:103690004071B86820F48030B860286C0143B9608C
-:1036A000B868C0070ED500F029F9804641F2893983
-:1036B000B868800706D400F021F9A0EB080048455F
-:1036C000F6D30326B0462878C10705D53968A8691E
-:1036D000890840EA810139602878810705D5396871
-:1036E000E86921F44061014339602878C10644BF8C
-:1036F000A86AFFF76FFF2878810644BFE86AFFF7E2
-:1037000069FF2878410744BF286AFFF757FF2878E8
-:10371000010744BF686AFFF751FF2868C1055CD5FF
-:103720003968686B21F0406101433960686BB0F122
-:10373000006F03D1E16841F08071E160686BB0F126
-:10374000806F4AD100F0A0F806462068000135D508
-:1037500000F0D4F8801B0228F7D94FF003083CE0B2
-:1037600000F0CCF8801B022830D9F6E700F0C6F84C
-:10377000801B022852D94FF0030861E000F0BEF828
-:10378000801B022855D9F6E700F075F8A86821F4E7
-:10379000781100F07FF88146206800017FF554AF72
-:1037A000216968690143216130007FF456AF3968AF
-:1037B000286B21F44001014339604FE700F05BF8CA
-:1037C000E86821F0606100F065F8064620680001B5
-:1037D000C6D521696869014321612868810505D53D
-:1037E0003968A86B21F040410143396028684105E0
-:1037F00026D53968E86B21F0405101433960E86B08
-:10380000B0F1005F03D1E16841F48031E160E86B21
-:10381000B0F1805F14D100F037F80646206800014F
-:10382000A4D400F028F8286921F0604100F032F8B3
-:10383000064620680001A1D521696869014321611C
-:103840002868C10405D5F968686C21F4404101433A
-:10385000F960286881040BD5616AE86C21F03001B9
-:1038600001436162616AA86C890840EA8101616272
-:103870004046BDE8F2832069696820F4FE4040EAD2
-:103880000120206121697047216821F08061216059
-:1038900000F034B801432161206840F0806020606E
-:1038A00000F02CB810430860704710B511490A6841
-:1038B00042F080720A600B680F4A23F080730B603D
-:1038C000046841680C4381680C43C1680C4301697A
-:1038D00044EA014454601368406923F47C5343EA8A
-:1038E00000231360116841F06001116010BD0000F9
-:1038F0008800005838000058006000400148006807
-:10390000704700BF440000200248016841F4807104
-:10391000016070470004005818B59BB0FFF7DCFD4C
-:10392000574CE06B40010ED5E06BC0000BD4FFF7A5
-:10393000EBFFFFF7E9FFA06B40F48030A063A06BC2
-:1039400020F48030A06300F07AF807A85021FFF738
-:10395000F1FB68461821FFF7EDFB00F068F84FF423
-:10396000807007900021149107A8FFF73DFE2068A2
-:1039700040F0807020604FF00052216801F08071AB
-:1039800006910021069800914BF67F30039022218A
-:103990000491002002902021019205916846FFF7D2
-:1039A00084FFFFF7B1FFFFF7AFFFA06B40F001000E
-:1039B000A063A06B8007FCD5E06B20F4404040F48E
-:1039C0008040E063E06B40084000E06300F02FF8C7
-:1039D0000022206B20F0406020632A4801680260CA
-:1039E000026902F050020261FFF78EFFFFF78CFFC1
-:1039F000A06B20F4407040F48070A0630F21A06B96
-:103A000040F40040A063204C2048816047F6FF71DD
-:103A1000C160046000F040F8A068C008C000A06069
-:103A2000FFF788F94FF0FF30FEF7FCFAFAE7206C59
-:103A300040F001002064206C8007FCD570471448DA
-:103A400081B0016841F4801101603F21006800F4F9
-:103A50008010009000980F4841604161016841F476
-:103A60007C110160026942F47C120261016841F03C
-:103A70003F010160026942F03F02026101B07047FC
-:103A8000580000588008005800280040AC0400206E
-:103A900050000058040C005838B5040044D094F885
-:103AA000210028B9002184F820102046C046C046D5
-:103AB00000F049F8FF2510B100F03FF834E021682C
-:103AC000DFF8B0008A6802408A6021688A6863680B
-:103AD00020690343A06903431A438A602168E068B0
-:103AE000086120680169A26841EA02410161206819
-:103AF000C16821F08001C1602068C16C890889001B
-:103B0000C1642168CA6CE369606903431A43CA64EB
-:103B100020688168880609D400F020F830B1206858
-:103B20004562042100F01FF8012032BD2068456283
-:103B3000012184F82110002032BD20684562042153
-:103B400084F821107047022084F82100CA202168DF
-:103B50004862532022685062204626E020460BE04F
-:103B60002068C0F8248084F82110002084F8200008
-:103B700070470000BFFF8FFF70B5044640F2E93682
-:103B80002068C16821F0A001C160FFF7B7FE0546BB
-:103B90002068C168880606D4FFF7B0FE401BB0421B
-:103BA000F6D3032070BD002070BD70B504462068B8
-:103BB000C1684A0612D44FF0FF32C26040F2E936C3
-:103BC000FFF79CFE05462068C168480606D4FFF74B
-:103BD00095FE401BB042F6D3032070BD002070BD9F
-:103BE00000EB81003B4AD0F88010914201D00120C7
-:103BF00070470020704742F4806240F821207047EF
-:103C000035481F2181610168C908C90041F00301DD
-:103C100001603248016841F0040157E0704710B577
-:103C20002F4C00F048F80028FBD1042100F044F8A4
-:103C300028B92C480068010403D500F03FF800F0D3
-:103C400054F8002203212046FFF7D5FF22480168DF
-:103C5000C908C90041F0020101602048016841F033
-:103C60000401016030BF10BD10B51D4C00F026F8F6
-:103C700000F021F80028FBD14FF0B040816801F03E
-:103C80000C01042911D1016841F4803101600168FF
-:103C90008903FCD581688908890041F002018160AF
-:103CA000816801F00C010829FAD12046BDE81040D6
-:103CB000002203219FE70321204691E700220421EF
-:103CC000204698E70548016821F00401016030BFF3
-:103CD00070470000000400800004005810ED00E070
-:103CE000001400588804005870474FF0B040016835
-:103CF00041F48071016001684905FCD5816889083B
-:103D0000890041F001018160816801F00C01042902
-:103D1000FAD1704780B51C48016841F47001016018
-:103D20000020FEF76BFC48B180791849184A0A60F8
-:103D30000A6822F47C5242EA00220A604FF0B04046
-:103D4000016841F48031016012490A68D208D2004A
-:103D500042F001020A600A6802F00702012AFAD161
-:103D600001688903FCD581688908890041F0020156
-:103D70008160816801F00C010829FAD101684908C5
-:103D80004900016001BD000088ED00E09C00005882
-:103D9000FECAFECA0040005819E050F8042BD307B1
-:103DA00044BFA9F101039A18091F0023042942F80E
-:103DB000043BF9D25FEA817C134604D54FF0000C36
-:103DC000A2F800C09B1CC90744BF0021197050F81D
-:103DD000041B0029E1D1704730B50168846842189E
-:103DE000416802EB5103C9070BD54C4409E012F9B5
-:103DF000011B12F8015B002904F8015B05D5491C81
-:103E0000F9D19A42F3D10C3030BD491EF1D5F8E713
-:103E10007047FEE770477047704700F011B84FF4E5
-:103E20008060FFF756BA00E000BF0148FCF78AB98E
-:103E300068000020FDF789BBFFF79EBAFFF772BA52
-:103E400002490A68886882180A60704744000020A6
-:103E500010B500F013F802000023DB4300241068C3
-:103E6000984203D011000220ABBE14605068984203
-:103E700003D0111D0220ABBE546010BD0148704735
-:103E8000000000006000002010B507497944183197
-:103E9000064C7C44163404E00A68081D1144884727
-:103EA0000146A142F8D110BD2C00000050000000D6
-:103EB0004EF68851CEF20001086840F470000860A8
-:103EC000BFF34F8FBFF36F8F4FF00070E1EE100A1A
-:103ED00070470000C5FEFFFF0805000068000020D5
-:103EE000800800002000032000000000EDFEFFFF1E
-:103EF0007401000046000000040000200120C046BC
-:103F0000002801D0FFF7C0FFAFF300800020AFF31F
-:103F10000080FFF701FD00F000F800F001B800009C
-:103F20000746384600F002F8FBE7000080B5FFF7CF
-:103F30008FFF024A11001820ABBEFBE726000200EB
-:103F4000C53C0008E93C00081F3C0008693C00082B
-:103F5000013C00081D3C000801488047014800471B
-:103F6000153D0008693F0008AFF30080FFF7A0FF90
-:103F7000FFF7C4FFFFF7FEBFFFF7FEBFFFF7FEBF6F
-:103F8000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF65
-:103F9000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF55
-:103FA000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF45
-:103FB000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF35
-:103FC000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF25
-:103FD000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF15
-:103FE000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF05
-:103FF000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFF5
-:10400000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFE4
-:10401000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFD4
-:10402000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFC4
-:10403000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFB4
-:10404000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFA4
-:10405000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF94
-:10406000FFF7FEBF030DFF0183D800F8FFF000004B
-:1040700010FD000001FA0008480004004800040098
-:0740800048FD000048F8FFB5
-:0400000508003F6947
+:1003B00095F82802012801D1022032BD012085F8DC
+:1003C0002802286800F0DFFB24B9286805F50C71C5
+:1003D0000020C046002085F8280232BD10B5044632
+:1003E00001F00F0362689A4201D2012010BD00F0B3
+:1003F00013F80023837000F008F801D1022010BD2B
+:1004000000F019F800F0D8FB98E601F00701017040
+:1004100094F828120129704701F007000A0604EB3E
+:10042000401003D5283001234370704700F59470C5
+:10043000002242707047012284F828220146206879
+:1004400070472DE9F84F00F5947500F12406074632
+:1004500026E0018848F60F72114041F40041018006
+:100460003868B0F85010327901EBC203C01800F2BE
+:1004700002400088B269C0F3090030620244B261F0
+:100480000021384600F026F932784AB1F06938B9CF
+:100490003178386841F08001A0F84C1000213170AB
+:1004A000386800F144010A88130440F1E9800A88A1
+:1004B00012F00F0A59D1D206CBD50288130511D5F7
+:1004C000898900F0E0F8EA88C3F30903EB6107F5D6
+:1004D0000C7100F0C8FB386800F0DDF8384600F019
+:1004E000EBF8DDE71104DBD500F0D5F83868B0F89B
+:1004F000501000F0C8F8C3F30903002BEB611CBFD8
+:10050000696900290AD0EA8800F0ADFB6869E969E9
+:10051000014469613846002100F0D4F83868B0F829
+:1005200050104118286901F2064120B9088848F2A4
+:10053000FF32104009E03E2805D24208C00748BFFC
+:10054000521C900203E04009800240F40040088001
+:100550004BF68F7238680188114081F4405141F4A4
+:10056000004141F0800101809AE730F82A805FEA7B
+:10057000084207EB4A195AD530F82A1040F68F7214
+:10058000114041F0800120F82A1009F59474386870
+:10059000217B69B9B0F85010237801EBC30100F05A
+:1005A00082F830D0E28861695B4600F05CFB2AE0AB
+:1005B00021780B4630F8232053040BD5B0F8502097
+:1005C00002EBC101421802F2024200F06FF80DD0B6
+:1005D000228907E0B0F8503003EBC10100F063F866
+:1005E00004D062895B46616900F03DFB3968207880
+:1005F00031F8202048F68F731A4042F4004242F04E
+:10060000C00221F82020E1695944E16162695A443D
+:100610006261A36913B121698B4504D22178384600
+:1006200000F050F803E021783846FFF780FE5FEADB
+:10063000086021D5396831F82A2048F60F731A402E
+:1006400042F4004209F1280021F82A203A68017892
+:10065000B2F8503003EBC1031A4402F2024212888E
+:100660004369C2F30902C2611A4483694261002BE3
+:10067000384602D100F02EF812E7FFF767FE0FE7C9
+:100680000020BDE8F28F2A7801EBC203C31803F201
+:1006900006431B887047018840F68F72114041F075
+:1006A000800101807047421802F206421188C1F3AE
+:1006B000090BBBF1000F704700F50C71D0F8700208
+:1006C00000F0F4BA00EB4112D0F87002D2F83C21ED
+:1006D00000F016BB00EB4112D0F87002D26B00F0B4
+:1006E00050BBD0F8700200F0E0BB10B50446D4F85F
+:1006F000700200F09DFBD4F87002BDE810400121AB
+:1007000000F0BFBBD0F8700200F0BEBBD0F87002A2
+:1007100000F0C2BB10B51C461346D0F8C0022246FA
+:10072000FFF7DBFD002010BD80B5D0F8C002FFF759
+:1007300022FE002002BD80B5D0F8C002FFF74EFEB9
+:10074000002002BDD0F8C00201F07F02090600EBD4
+:10075000421002D590F82A00704790F82A0170479D
+:1007600080B5D0F8C002FFF7A9FD002002BD80B51A
+:10077000D0F8C002FFF7EAFD002002BD80B5D0F836
+:10078000C002FFF7D4FD002002BD30B4002513E005
+:1007900050F8042BD30744BFA9F101039A18091F8D
+:1007A000042942F8045BFAD213468C0744BF158033
+:1007B0009B1CC90748BF1D7050F8041B0029E7D1D6
+:1007C00030BC70472DE9F0470B4602461C7832F8E2
+:1007D0002460DD7848F68F1100200E40032D0CD8E0
+:1007E000DFE805F002080C0546F4007606E046F462
+:1007F000C06603E046F4806600E0012048F2800510
+:100800002E4322F8246048F68F7619780C4632F889
+:10081000247037403943294322F824104BF68F7750
+:10082000197B93F800A000294CF2800C48F6BF7E9B
+:1008300048F2C00862D1D9884FF6FE740C4059784E
+:100840000029B2F8501011441DD001EBCA0101F586
+:1008500080610C80197832F82140640606D532F8A0
+:100860002140264048EA060622F821601978DB7804
+:10087000012B32F821300EEA03030EBF1D4383F033
+:1008800020031D43C2E001EBCA0A0AF2044AAAF897
+:100890000040B2F850105418197804EBC1041969DB
+:1008A00004F2064431B9B4F800E048F2FF3101EA3D
+:1008B0000E010CE03E2908D24FEA510EC90748BF8D
+:1008C0000EF1010E4FEA8E2E03E04909890241F430
+:1008D000004EA4F800E0197832F82140640406D5EF
+:1008E00032F8214026404CEA060622F821601978A9
+:1008F00032F821301F4087F4405786E032F82A1042
+:10090000314041F4014141F0800122F82A10B2F84F
+:100910005010B3F808A05418197804EBC10404F57A
+:1009200080644FF6FE7101EA0A012180B2F850108E
+:100930001C78511801EBC409598909F204494FF692
+:10094000FE742140A9F8001059781C78002932F86B
+:1009500024102CD1490406D532F8241031404CEA39
+:10096000010122F82410197832F82140640606D5D6
+:1009700032F82140344048EA040422F82140197832
+:1009800032F82140264048EA060622F8216019780C
+:1009900032F82140274087F440572F4322F8217036
+:1009A000197832F821300EEA03031D432EE0490482
+:1009B00006D532F8241031404CEA010122F8241007
+:1009C000197832F82140640606D532F821403440C7
+:1009D00048EA040422F82140197832F821402640E0
+:1009E0004CEA060622F82160DC781978012C32F8EE
+:1009F00021400EEA040418BF84F020042C4322F89E
+:100A00002140197832F821301F403D4322F821500F
+:100A1000BDE8F087F8B50E46054672783469B069CE
+:100A2000012A48F2800748D1844232BF001B0446A5
+:100A30000020B061307B40B9F28800F099F800F0F6
+:100A40009BF800F2024004802EE03078C10035F8B7
+:100A500020004206B5F85000284405D5091801F2D7
+:100A600006410C80728904E0091801F202410C80F1
+:100A7000328900F07DF8707848F68F7140B930788F
+:100A800035F82020114041F4004141F0C00109E057
+:100A9000012809D1307835F82020114041F4404137
+:100AA00041F0800125F82010317835F8212048F6F2
+:100AB000BF70024082F030024EE0844232BF001B21
+:100AC00004460020B0616009317B8302002943F4B1
+:100AD000004304F001004FEA540C18D0AAB900F00A
+:100AE00040F801F202413CB9B1F800E0202262F383
+:100AF0008F2EA1F800E008E03E2C05D2624600B13E
+:100B0000521C92020A8000E00B807178A9B900F0B3
+:100B100028F801F206412CB90A88202060F38F22C0
+:100B20000A8011E03E2C06D208B10CF1010C4FEA0C
+:100B30008C20088008E00B8006E0012904D100F039
+:100B40001BF800F2064004804BF68F70317835F8C0
+:100B50002120024082F44052174325F821700020E2
+:100B6000F2BDB5F850103278691801EBC201704738
+:100B70007169A3B2284665E0B5F8500031782818AD
+:100B800000EBC100704710B50A78497830F8224070
+:100B9000002948F2800305D048F6BF710C4084F06C
+:100BA000100404E04BF68F710C4084F4805423430E
+:100BB00020F82230002010BD30B50A7B002A36D143
+:100BC0004A780C78002A30F8242048F2800348F64E
+:100BD0008F7516D0520608D530F82420154045F4FC
+:100BE000004545F0C00520F82450CA78012A1ED0DF
+:100BF0000A7830F8224048F6BF710C4084F0200497
+:100C000012E0520408D530F82420154045F4404540
+:100C100045F0800520F824500A7830F822404BF641
+:100C20008F710C4084F44054234320F8223000207C
+:100C300030BD11B98021A0F84C1000207047B0F8E9
+:100C40004400704710B580185B1C00F580605B089D
+:100C500007E00A784C7842EA0422891C20F8022B2B
+:100C60005B1EF6D110BD10B5821802F580625808DF
+:100C700006E032F8024B0C70240A4C70891C401EAE
+:100C8000F7D1D80744BF1088087010BD10B5D0F850
+:100C9000B42202241AB11268904700B900242046F9
+:100CA00010BD80B5D0F8B42253680AE138B50446C7
+:100CB00004F52A75284600F0F5FA04F5257001219F
+:100CC0000160428B017D426011F01F0003D00228B9
+:100CD0000BD005D30EE02946204600F0F5F80DE0D4
+:100CE0002946204600F09AF908E02946204600F0FF
+:100CF000BCF903E001F0800100F040F8002032BDB3
+:100D000038B5044610460A0004F5257329D1196840
+:100D100003291ED104F5B0714A680D68AA420BD2AE
+:100D2000AD1A0D60954238BF2A46014692B2204660
+:100D300000F0E8FA002032BD196A086928B1187A73
+:100D4000032802D1096920468847204600F0E2FACC
+:100D5000F0E70529EED100201860002100F00EF820
+:100D6000E8E71A6A906930B1187A032803D19269CA
+:100D700020469047DEE7022032BD80212046FFF763
+:100D8000D3BC38B504460800134604F5257543D195
+:100D90002868022833D1226A616A914207D2521A26
+:100DA0002262194692B2204600F0A4FA11E0E269EC
+:100DB000B2FBF1F001FB102090B98A4210D36868B1
+:100DC00082420DD200220021204600F093FA00203A
+:100DD00068600023002200212046FFF7CFFC14E0CA
+:100DE000296AC86828B1287A032802D1C968204630
+:100DF0008847FFF7C2FF204600F093FA05E0042879
+:100E000018BF002801D1FFF7B8FF287B012804BFD5
+:100E100000212973002032BD2A6A506930B1287A36
+:100E2000032803D1526920469047F3E7022032BDE0
+:100E300038B50446402300220021FFF76BFC04F57F
+:100E4000AC70012140220160C26040230022802159
+:100E50002046FFF75FFC0120402104F52572A061C8
+:100E6000616210720021116061600025506A156195
+:100E700028B1126A61685368C9B2204698470020B9
+:100E800032BD01740020704700F5277004220178FC
+:100E9000417002700020704700F527700178042926
+:100EA00004BF417801700020704780B500F52771BC
+:100EB0000A78032A03D18969C96901B188470020EA
+:100EC00002BD9847002002BDF8B500F0C8F804F54F
+:100ED000277608D0202818BF402850D1B2699368DF
+:100EE0002046984795E06878092848D8DFE800F060
+:100EF0006E864780470905475C25204600F04AF981
+:100F000087E0A888002804BFE888002837D16F88C8
+:100F1000802F34D23078032807F07F072FD0B770A6
+:100F200039462046FFF71CFC00F031F9002F07BFBF
+:100F300001213170022030706BE0374F68883870C3
+:100F4000397802291BDA3378022B08461AD0032B92
+:100F500023D131B90220307061602046FFF7A1FE35
+:100F600055E06168884252D0C9B22046FFF799FE29
+:100F7000397861602046FFF789FE022847D100F0EA
+:100F80008EF946E0002942D0606003203070204690
+:100F9000FFF77CFE0228F2D039E000F080F93978C2
+:100FA0002046FFF77EFE34E0E8880128E7D131785B
+:100FB000491E012904D9891EE1D10122211D13E016
+:100FC0000020A060012204F108010DE03078401EED
+:100FD0000228D4D8EA88022AD1D1B068012100B110
+:100FE0000321E16004F10C01204600F07BF910E0E0
+:100FF000688801280DD10121B16008E03078401ED9
+:101000000228BCD86A88012A03D10020B06000F011
+:10101000BEF80020F2BD00002905002038B500F020
+:101020001EF81CBF2028402815D104F5277210781F
+:10103000401E02280FD82B79022B0CDA9269936894
+:10104000204698470146E888002808BF002904D1B7
+:1010500000F09DF801E000F023F9002032BD0D46BC
+:101060000446287810F060007047F8B5044608463A
+:1010700004F527730278017912F0600509D0202D5C
+:1010800018BF402D6AD19A69936801462046984757
+:1010900067E002F06002202A06D19A69936801464F
+:1010A0002046BDE8F440184742788AB3012A12D09E
+:1010B000032A53D11B78022B13D0032B4ED1428825
+:1010C0001ABB002918BF80291FD0C088E8B9204664
+:1010D000FFF72AFB19E01A78022A02D0032A0CD063
+:1010E0003CE0002918BF802938D02046FFF71CFBC0
+:1010F00080212046FFF718FB33E0408888BB11F0C1
+:101100007F0F1CBF2046FFF716FB00F040F828E0D9
+:10111000142201F07F051B7855436619022B06F552
+:10112000AA7502D0032B10D018E0002918BF80291F
+:1011300014D1080648BF06F11405002028600222D9
+:101140002946204600F0CEF80BE001F00F0312FB19
+:1011500003F20F06224406D5926972B9014600F0E7
+:101160009FF80020F2BDD2F85821002AF6D00029BD
+:1011700018BF802904D10020E0E706F11405F6E746
+:101180002046FFF7DFFA0028D8D00120D6E7204616
+:1011900000F0C0B838B5044600200D46ADF8000098
+:1011A00004F52C726888030A012B08D0022B23D087
+:1011B000032B2ED0062B5FD0072B64D06CE0126877
+:1011C000207C136869469847BDF8001079B1E9881A
+:1011D00079B1BDF80010EA88914288BF1146ADF898
+:1011E00000100146BDF80020204600F07BF8E8889A
+:1011F00008B9FFF7CCFF31BD207C51680028684654
+:1012000004D1896A884702224270DDE7C96A8847AB
+:10121000F9E7C0B205283FD8DFE800F0030B121948
+:10122000202710684268002A36D0207C6946904703
+:10123000CAE7106882687AB3207C69469047C3E7A2
+:101240001068C26842B3207C69469047BCE71068CA
+:1012500002690AB3207C69469047B5E71068426985
+:10126000D2B1207C69469047AEE7106882699AB196
+:10127000207C69469047A7E7207C68B951684A6B93
+:1012800068469047A0E7207C30B951680A6B6846F1
+:1012900090470721417097E700F002F831BD2946D9
+:1012A000204614E010B50A7802704B7843708A78B3
+:1012B000CB7802EB032444800A794B7902EB0324B8
+:1012C00084808A79C97902EB0123C38010BD10B5EF
+:1012D00004468021FFF728FA2046BDE8104000218F
+:1012E000FFF722BA80B513460222C0F89422C361E8
+:1012F000036201E080B513460A460021FFF737FA82
+:10130000002002BD80B513460A460021FFF736FAD9
+:10131000002002BD80B50421C0F8941200230022F1
+:10132000EBE780B50521C0F8941200230022ECE71A
+:10133000DFF84C150A6892B200E00246086880B2F5
+:101340008242FAD170472DE9F041DFF83865DFF8C5
+:1013500038853178044618256843062908EB0007CC
+:1013600008D130787070347079754FF0FF3070604C
+:1013700000203DE000F07BF8B9680918B96008F179
+:101380000803B96832786A439A589142327813D385
+:1013900008F1150315FB02FC13F80C30062B29D0BD
+:1013A00008F108066B43F358994222BF08F1150370
+:1013B0006A439A5CECD21DE01146337869439A4245
+:1013C0000FD008F1140C08F1150E1CF8013015FBB4
+:1013D00003F50EF805407A753B7508F11402545474
+:1013E00003E008F114037A755C543178717034703D
+:1013F000BDE8F0811146694308F115035B5C062BDB
+:1014000004D008F1140615FB03F574557B753A7585
+:1014100008F115025454EBE7F0B5DFF86834DFF853
+:1014200068541E78182402466243B0422A4404D10C
+:1014300018785870547D1C700FE0167D507D92F81E
+:1014400015C005F115076643062807F806C004D045
+:10145000167D143514FB00F42E55012010731A78F4
+:10146000062A02BF00294FF0FF305860F0BD10B5CA
+:10147000DFF81044606810F1010F10D0FFF758FF3B
+:101480006168DFF8082481422FBF63686168538870
+:10149000CB1851781278181A4843D04000E0002049
+:1014A00080B210BD2DE9F84FDFF8E053DFF8E0B36C
+:1014B000D5F80880D8F80000DBF800104A0500F0E5
+:1014C000A2F9DFF8C063DFF8C0A321F48061816076
+:1014D0004FF0180934780AF1080019FB04F1475855
+:1014E000FFF7C5FF874211D200270121B170062CFA
+:1014F0003FD019FB04F40AF108010A59824210D2C4
+:1015000000230B510AEB04014C7DF0E7A988411838
+:10151000B94202D2AF880021E8E701223F1AB27037
+:10152000E5E70A590AF10803121A1A51EAE70228F4
+:1015300002DA2878012800D07F1ED8F80000C168A0
+:101540004A07FAD500F052F9DBF80C00000CBFB2E4
+:1015500047EA0047CBF80C70FFF7EAFE7060A86816
+:101560000068816841F480618160AFF30080BDE86C
+:10157000F18FB8B20028DAD1FFF7DAFE70600320ED
+:10158000BDE8F24F00F0F5B92DE9F843EFF310880C
+:1015900072B6BE4DBC4BA8680168CA224A6253208D
+:1015A000486218208A6822F480628A60B54A1678F8
+:1015B000374647431F44387B022823D13C68D7F87D
+:1015C00010909078D8B17A7B012A0AD10121304657
+:1015D000FFF722FF88F310887968304600F019F988
+:1015E00004E088F31088304600F0C6F8A86800F0E0
+:1015F0001AF831462246484600F054F90DE0FFF74C
+:1016000051FF08E0C8684207FCD500F086F84FF4A7
+:101610000020A049086088F31088FF22A8680168AC
+:101620004A62BDE8F1830068CA21416253224262E6
+:101630007047F8B5954CA160CA2209684A625323E5
+:10164000934A4B62156845F020051560136803F056
+:101650000703C3F10403237095682D0C05F07F0583
+:101660006D1C6570EDB29268C2F30E02521C62806E
+:1016700092B2521E6A43A2F5A072DA404FF6FF738F
+:101680009A422CBFA380A280834A136843F40023AC
+:101690001360824B1D6845F400251D6048BB7948E6
+:1016A000012383704FF0FF3545600023764D0026FF
+:1016B0000C355FFA83FC182717FB0CFC5B1CDFB2B0
+:1016C00005F80C60062FF4DB06230370886820F40D
+:1016D0008060886000F021F84FF40021D160032081
+:1016E00000F052F9A0680068816841F4804181608F
+:1016F00005E0C868410544BF032000F03AF9A1683D
+:101700000A68FF20506200220321032000F0E6F85F
+:10171000BDE8F240032000F0FEB8C86800F0800089
+:1017200060F49060C86070472DE9F04104460025E0
+:10173000EFF3108672B61827DFF84CC10CF10C0ECF
+:1017400007FB05F81EF8080010B16D1C062DF5DB2F
+:10175000062D0CD06F430CEB07000127077386F3AF
+:1017600010880461427303600D70002002E086F36C
+:1017700010880120BDE8F081F8B50746EFF310842A
+:1017800072B6032000F0D2F8404DAE683068FFF723
+:101790004BFF3B46182042494343CA5C022A1BD1F7
+:1017A00000213846FFF738FE3648017806290ED169
+:1017B000306837490A68530500F025F821F4806144
+:1017C0008160C1684A07FCD500F010F804E0407859
+:1017D000884218BFFFF766FEA9680A68FF205062BA
+:1017E000032000F098F884F31088F1BDC16801F07F
+:1017F000800161F49061C1604FF4002025490860C8
+:10180000032000F0C1B802D5C1684A07FCD4816842
+:1018100070472DE9F04180460F46424618201A498C
+:1018200042438C18237B022B04BF4046FFF7A4FFE2
+:10183000EFF3108572B6032000F078F8134EB0680D
+:10184000FFF7F1FE02202073A76067604046FFF7B4
+:101850007AFD0C490A784978914202D0FFF722FEBE
+:1018600002E0A168081AA060FF20B1680A6850620F
+:10187000032000F050F885F31088BDE8F0810000E7
+:10188000282800405C05002070030020140500207B
+:10189000082800400C08005800080058800800582C
+:1018A0007C030020104700000901020002D43C48DC
+:1018B000815470473B4B02F00F021A4402F8041C9B
+:1018C0007047394B19684FF6FF020002114000F4CF
+:1018D000E0600843354908431860704738B5324B1B
+:1018E0001C68C4F30223C3F10704052C28BF042499
+:1018F0001D1D072D34BF0023DB1E012505FA04F44E
+:10190000641E2140994005FA03F35B1E1A401143FF
+:10191000BDE83440C8E7010007D4012200F01F01F0
+:10192000234B8A40400943F82020704701000BD424
+:10193000012200F01F011F4B8A40400943F820207C
+:10194000BFF34F8FBFF36F8F704710B5401EB0F1DC
+:10195000807F01D3012010BD174C60600F214FF034
+:10196000FF30FFF7A1FF0021A160072020600020C9
+:1019700010BD010007D4012200F01F010F4B8A4067
+:10198000400943F820207047010007D4012200F0ED
+:101990001F010B4B8A40400943F82020704700008C
+:1019A00000E400E018ED00E00CED00E00000FA05B6
+:1019B00000E100E080E100E010E000E000E200E093
+:1019C00080E200E038B58EB002A8C549C54C0FF2E0
+:1019D0007535302200F0DCF90094019569460FF26C
+:1019E0004D30C14C00F0E0F90121022000F0BFFAB7
+:1019F000BE4A0021042000F04DFB02A800F0C0FB0D
+:101A000000F072F800F0C4FB04F1260500204FF648
+:101A1000FF7184F89000298001200FF2A522002197
+:101A200000F038FB062000F03FFC00F0B4FC0FF2A1
+:101A3000D923002204F191010020FFF775FE0FF277
+:101A4000D123002204F192010020FFF76DFE002057
+:101A500068808022A648A02102804180012000F0F9
+:101A6000E9F80FB030BDF8B507469F4C7878A14D26
+:101A7000052804F1900604D03E2810D0FF2824D079
+:101A80002EE0B988E08C814202D10021E1843170DE
+:101A9000012000F0CFF801212970E08C10E0F878E7
+:101AA00001281DD17078FFF767FE307804280CBF3D
+:101AB0000620052030700021B7F80500E084297069
+:101AC0006880284600F061FC0AE0B7F803000428AB
+:101AD00006D1012000F0C6FCB0780A21FFF799FE7C
+:101AE0000120F2BD00F06FBC78B589B00020ADF8E0
+:101AF0001A0000F018FD804D804E286810F1010F8B
+:101B00000ED069683074090A020A000CB07472744D
+:101B100006F1100468683175F074090A717506E001
+:101B2000002000F04FFD040008BF0FF234242246CD
+:101B30000621002000F089FB607930724EF66E526B
+:101B400021797172E078B072A178F17260783073A7
+:101B500021787173089207AA2868634C07900621C0
+:101B60002E2000F072FB00BF7FA21021182000F091
+:101B70006CFB00BF80A21021082000F066FB18213A
+:101B8000012000F083FB00F031FD0DF1160006A9E5
+:101B90000190009105AB07220021012000F0D7FE43
+:101BA0006DA0BDF8181000900723BDF814000022A6
+:101BB00000F0D9FD0DF11A0000900223BDF81610B7
+:101BC000BDF81400002200F0CEFD02220221002008
+:101BD00000F0DBFC0020207000F076FE0120607039
+:101BE0000021E170082060751021A1750120207589
+:101BF000A07000204249A161C1B221440871401C7B
+:101C0000C1B21029F8DB002004900023A169207DD7
+:101C1000039102900022A17D607D01910090617886
+:101C2000A07800F065FEA07808B100F0EAFE0AB0E6
+:101C300070BD00002DE9F841012887B0044603D1AA
+:101C40002B480588468803E04FF4C8654FF47A6650
+:101C5000DFF8948008F190077878FFF78DFD022C6B
+:101C600005D13878012814BF022800F0C9FD3C7066
+:101C700000200690059008F1290204925FF0080206
+:101C800098F8280040A1039002910192002300934C
+:101C900032462946002000F0C6FD18490E2000F00B
+:101CA00085FE002808BF012C06D17878154908B0B8
+:101CB000BDE8F041FFF7ADBD08B0BDE8F081000020
+:101CC00010B5012000F0D6FB074C94F890000528D1
+:101CD00004D000F095FD002084F8900010BD0000B5
+:101CE0003C3F0008A4080320DC020020E71D000898
+:101CF0006C050020640500208075FF1F0400002093
+:101D000007B2010046E001000021012000F0CFB938
+:101D1000012000F0AFBB0021042000F0C8B9012071
+:101D200000F0E7B9012000F0ECB9000010B504465E
+:101D3000616801F1080000F039FA00B1012020705B
+:101D400010BD000010B1012803D07047072000F03B
+:101D5000BEB9072000F0C3B953544D333257420087
+:101D60006C7AD8AC57720000123456789ABCDEF008
+:101D7000123456789ABCDEF0FEDCBA09876543213E
+:101D8000FEDCBA098765432109503250535256315F
+:101D90004AB1000011F8013B521E00F8013B1CBF84
+:101DA00011F8013BF8E770477FB50C466A4D616852
+:101DB0006A4EE8612962284600F072FE246805F147
+:101DC000240000604060746006F10800006040601C
+:101DD00001203070296829B10FF249120092029453
+:101DE000684688477FBD1FB55C4C04F1080000F0D1
+:101DF00064FEE8B92078D8B1694604F1080000F023
+:101E000085FE012054492070C96941B100980290B3
+:101E100001A888479DF804102170080003D000989D
+:101E200000F027FF04E0009904F1080000F04EFEE6
+:101E300004F1080000F041FE28B9207818B104F13F
+:101E40000800FFF768FF1FBD2DE9FC410446002094
+:101E500000F05EF866882088A268DFF8FC80C6F390
+:101E6000090646EA8026E068B6B2C1B2304600F004
+:101E70003BF8002548F2E800FFF754FF08E07888B7
+:101E8000B04202D1226939781170787800B1012509
+:101E900008F1240000F011FEF0B9694608F12400B1
+:101EA00000F034FE0098014600F10B07487A0F2835
+:101EB000E5D0B7F80100B0420CD1887A6169C01E44
+:101EC000C0B28842C8BF0846606102462069F91C5A
+:101ED000FFF75EFF3878D9E72800CBD0012000F06B
+:101EE00017F80020BDE8F68110B513461B4A546868
+:101EF000A4F80900E1720A46194604F10C00FFF744
+:101F000047FF154A1369BDE810400021002018471B
+:101F10001149096A08B921B1084700291CBF0120ED
+:101F20000847704710B50146487A0F2818BF0E2899
+:101F300007D10B4800F0D4FDBDE810400020FFF7AA
+:101F4000EEBE064C04F1080000F0CAFD04F10800E2
+:101F5000BDE81040FFF7DFBE80040020F40400203D
+:101F6000A40400201948002101604160704710B5A9
+:101F700000F00CF85C6819B1012904D1204301E09C
+:101F800024EA0000586082F3108810BDEFF310823D
+:101F900072B60E4B704738B5EFF3108472B60B492A
+:101FA0000B4D086820B1296888476A6890470AE0A5
+:101FB000486820B1A8688047E968884703E0286935
+:101FC00080476969884784F3108831BD2C0500205B
+:101FD000A04000082DE9F041544CDFF85481A56978
+:101FE0002840A06131E0491C54F831000742FAD082
+:101FF00004EBC107184079681040014204BF4FF05C
+:10200000FF327A607E68304000F094F8606201210F
+:1020100001FA00F086437E60EFF3108272B6606AC8
+:1020200023698140C9430B402361022004EBC003B4
+:1020300053F8087C0F40401E43F8087CF6D182F329
+:102040001088606A58F82010884763692069A2697F
+:102050001840104207D0E069216A084203D10021EC
+:1020600003EA0207C0E7C046C046EFF3108872B625
+:1020700021696069A2690140114201BFE069216ADA
+:10208000084200F0ACFE88F31088C046C046A56147
+:10209000BDE8F08138B51446EFF3108572B600F054
+:1020A00049F8234941F8204085F3108831BD30B507
+:1020B000EFF3108272B61D4B1C6904431C6153F888
+:1020C0003150284343F8310082F3108830BDEFF3DC
+:1020D000108172B6154A536923EA000005E0EFF358
+:1020E000108172B6114A53691843506181F3108808
+:1020F0007047EFF3108172B60C4AD3691843D06170
+:10210000F4E770B5094C656A266A2062012101FA7C
+:1021100005F502E0284600F064FE216AE069084205
+:10212000F8D088432662E06170BD00001C000020EA
+:102130000004002002460020110C090404BF1020F6
+:10214000120412F07F4F04BF0830120205A312F0F0
+:10215000704F04BF001D1201120FC0F11F00995CE7
+:10216000401A70470403020201010101000000004F
+:102170000000000000F09CFE9DF80E0005B000BDC0
+:10218000F8B500F10C026B4621214FF66640F1E7ED
+:102190001B4800210171017200F034B818490A7916
+:1021A00041F822000879401C0871704770B5044658
+:1021B0006078FF2802BFB4F8030000F47F40B0F558
+:1021C000406F12D100260E4D00E0761C2979F0B246
+:1021D00088420AD2F1B255F82120204690470100EA
+:1021E000F3D002D0022805D006E02046BDE87040BA
+:1021F000FFF739BC002070BD012070BD0000000059
+:102200002005002080B5C046C046C046C046C04636
+:10221000C046C046C046C046C046C046C046C0468E
+:10222000C046C046C046C046C046C046C046C0467E
+:10223000C04600F0BDFEC046C046C046C046C046CF
+:10224000C046BDE8014000F059BF18B50C46C7B004
+:10225000114600F04EF88DF81D4022460DF11E008B
+:1022600000F04DFF00F03AF83F21ADF804100C22C9
+:1022700000F039F8A41C0692049400F04BF80028F2
+:102280004CBFFF209DF8000048B010BD00B5C7B09E
+:1022900000F01DF80F2200F032F800284CBFFF209C
+:1022A0009DF8000047B000BD00B5C7B000228DF812
+:1022B0000020ADF81C0000F011F8182200F01FF803
+:1022C00000284CBFFF209DF8000047B000BD002350
+:1022D0008DF81C008DF81D108DF80030182200219B
+:1022E00001A800F012BFADF8062007A90391012252
+:1022F000704700228DF800208DF81C007047ADF863
+:1023000006203F21ADF804100222049207A9039190
+:1023100001220692CDF814D0002101A8FFF794BD48
+:1023200038B50546314C287820B1012805D003285E
+:1023300006D031BD0121217031BD0020207031BD9A
+:102340006968087868B94978012903D100F08AF8EA
+:102350000121A1706968487818B900F08BF8002055
+:10236000A0706868017801290ED14078012804D155
+:10237000002000F077F80120A0706968487818B94B
+:1023800000F078F80020A07031BD0078012808BF67
+:1023900000F00DB8704780B50FF235020021022021
+:1023A000FFF778FE114800210170BDE8014080B5BB
+:1023B000002000F05FF80D4801210022417082707A
+:1023C000C170027101BD00210220FFF770BE000044
+:1023D00006490879401E8041C00F0871087820B175
+:1023E000C91C4FF6426000F073BE70474C050020D8
+:1023F000454981B00A6802430A60096808400090B4
+:10240000009801B07047000078B585B00446684672
+:10241000142100F085FE210008BF012005D02046D0
+:10242000012C0CBF0220022C01D1FFF7E1FF00BFFD
+:1024300039A1364E31F81450009501210191002246
+:10244000022102920391694656F8240000F06CFEC6
+:1024500000F002F806B070BD56F8240000222946AC
+:1024600000F011BF10B500F00FF8BDE810400122D8
+:1024700000F009BF10B500F007F8BDE810400022D9
+:1024800000F001BF0000000023A3204C33F810101F
+:1024900054F820007047000030B585B004460D4662
+:1024A0006846142100F03CFE0120FFF7A1FF29003F
+:1024B000DFF85C201AA00BD130F814100091002333
+:1024C0000193012102230291039300F017F813E016
+:1024D000012D11D130F814000E4B0090029501939C
+:1024E00000F00CF80FA0045D00220F2160B2FFF78E
+:1024F000F5F960B2FFF70FFA05B030BD694652F842
+:10250000240000F011BE00004C00005850000020D4
+:102510005C000020000021101000010002000000FB
+:1025200000040000280000B587B000F013F800F0A8
+:1025300020F8032100F009F800F013F800284CBF40
+:10254000FF209DF8000007B000BDADF80410ADF805
+:102550000610704700208DF800007047049207A90C
+:10256000039101220692CDF814D0002101A8FFF7B3
+:102570006BBC1822002101A800F0C7BDADF80620F1
+:102580000821ADF804100322704718B5C7B000F059
+:102590000CF83122FFF7F2FFFFF7E0FF00284CBFF5
+:1025A000FF209DF8000048B010BD00248DF81C00ED
+:1025B0008DF8004007A8417082700021182201A800
+:1025C00000F0A3BD20B501460648074DC2798A42F6
+:1025D00018BFA84218BF0838F8D18A4218BF002097
+:1025E00020BD00BFF873FF1F0070FF1F00B587B04C
+:1025F00000208DF8000000F0E3F840F2011200F036
+:10260000F9F80122069200F0E2F800284CBFFF2002
+:102610009DF8000007B000BD2DE9F84104460128EF
+:10262000C7B0884616461F4608BF022003D00228BE
+:102630000CBF102000200DF11D031D1800F035F80F
+:10264000012C8DF81C4002D0022C1AD01BE0022471
+:10265000224641460DF11D0000F051FD2E706F70B5
+:1026600000F0AEF800F0A6F84FF4817200F017F811
+:10267000E41C0692049400F0AAF8002805D5FF2077
+:1026800009E01024E4E7472005E09DF8000010B9B8
+:102690004E9800F063F8FFE748B0BDE8F081ADF870
+:1026A000062007A9039103227047032200216846F0
+:1026B00000F02BBD2DE9F64F0C460546012CC7B0A6
+:1026C0009B4608BF022003D0022C0CBF1020002024
+:1026D0000DF11F031E18FFF7E8FF012CADF81C5089
+:1026E0008DF81E4002D0022C2BD02CE00227569CE5
+:1026F000559DDDF85091DDF84CA1DDF848814899F1
+:102700003A4600F053F8A6F800B086F8028086F842
+:1027100003A086F804907571B47100F051F800F0D0
+:1027200049F84FF4827207A9ADF8062003910A37E1
+:1027300003220497069200F04AF8002805D5FF20EE
+:1027400009E01027D3E7472005E09DF8000010B905
+:10275000579800F003F849B0BDE8F08FBDF80110BC
+:1027600001800020704778B5C7B01D464C9B00F033
+:1027700034F800268DF800608DF821502A4619465D
+:102780000DF1220000F0BBFC00F01AF800F012F886
+:102790004FF4837200F028F8AD1D00F016F8002801
+:1027A0004CBFFF209DF8000049B060BD0DF11F0037
+:1027B00000F0A5BC3F21ADF8041070478DF8003043
+:1027C0001822002101A800F0A0BC06920495CDF8C3
+:1027D00014D0002101A8FFF737BBADF81C00ADF8FD
+:1027E0001E108DF820207047ADF8062007A9039130
+:1027F00001227047ADF806203F21ADF80410704764
+:1028000000B587B000208DF8000000F019F9812292
+:1028100000F00AF900F01CF900284CBFFF209DF8D9
+:10282000000007B000BD2DE9F84DC7B09446DDF8B3
+:1028300040E1519A559D569EDDF84CA1ADF81D1012
+:102840008DF81C004FF0000BADF81FC08DF8213043
+:102850008DF822E000F02CF800F01FF824F8095F52
+:10286000668000F0EDF83F20ADF8040083210120E0
+:10287000ADF8061000F00AF800F0ECF800284CBFA4
+:10288000FF209DF8000048B0BDE8F08D07AA57442E
+:10289000069003920D370497704788F800A007ACA4
+:1028A0005499E419524608F10100544400F027BC41
+:1028B0008DF82320174652998DF800B00DF12408A9
+:1028C00009A8B84400F01BBC00B5C7B000F08CF8F4
+:1028D00000F0B6F800F0AEF8852200F08BF800F0BA
+:1028E000B8F800284CBFFF209DF8000047B000BD9D
+:1028F0002DE9F043C7B0DDF838814F9E509D519FC0
+:10290000529C8DF81C004FF0000907A88DF800902C
+:10291000417082700DF123018DF81F308DF82080F9
+:102920008DF821608DF822500F608DF8274000F05F
+:1029300087F8862200F078F80C2200F086F800284C
+:102940004CBFFF209DF8000047B0BDE8F083F8B50C
+:10295000C8B005460E4617461C4600F022F808A8E7
+:10296000467087708DF8205000F08BF88A2200F0B6
+:1029700077F8032200F07AF8002848BFFF200ED431
+:102980009DF8000058B94F994E98BDF8012022805B
+:10299000BDF803300380BDF805000880002049B071
+:1029A000F0BD07220021684600F0AFBB18B5C7B0E4
+:1029B000002304468DF800308DF81C40224600F0BC
+:1029C00065F800F03DF800F035F88E2200F062F86E
+:1029D000641C0692049400F03DF800284CBFFF20D0
+:1029E0009DF8000048B010BD00228DF800208DF841
+:1029F0001C007047ADF8062007A90391012204923C
+:102A0000704700B587B000208DF8000000F018F87E
+:102A1000922200F009F800F01BF800284CBFFF20BC
+:102A20009DF8000007B000BDADF806203F21ADF8CD
+:102A3000041070473F21ADF8041070478DF8003046
+:102A40001822002101A800F060BB049207A903919D
+:102A500001220692CDF814D0002101A8FFF7F4B9A5
+:102A6000ADF80A203F21ADF808107047059208A97B
+:102A7000049107220792CDF818D0002102A8FFF791
+:102A8000E3B91822002102A800F03FBB0DF11D00A0
+:102A900000F035BBADF8062007A90391012270476D
+:102AA0000249034A01600261704700BF6D2B0008B4
+:102AB000972B0008006040607047EFF3108172B6FA
+:102AC000026882420CBF012000201CE0EFF310825C
+:102AD00072B603680B60486001600868416023E0DB
+:102AE000EFF3108272B6086043684B60416048683B
+:102AF000016019E0EFF3108172B6436802681A6052
+:102B000042680068426081F31088704710B5EFF3A7
+:102B1000108472B602680A600068FFE7FFF7EAFFF8
+:102B200084F3108810BD086082F31088704700009D
+:102B300000F03CBC6C486D49016001F1200242602C
+:102B400001F13003836001F13C02026201F14403B0
+:102B5000C36001F14C02026101F16803436101F1BC
+:102B60006C0282617831C16100F028BC38B504463E
+:102B70005F4D05F11000FFF79DFF5B494868A168B4
+:102B8000016005F11001E268C2608160456000F0FB
+:102B900031FC58482DE080B553494A68136801203C
+:102BA000187200F02DFC002002BD38B5514C504D7C
+:102BB00007E0694605F11000FFF7A8FF00982168BB
+:102BC000884705F11000FFF778FF0028F1D031BDEC
+:102BD00048484168084738B50446474D28460060D4
+:102BE00040604149C868A1680160456000F00DFC83
+:102BF00042482168016062684260002032BD80B5B1
+:102C00003949CA6813681020187200F004FC0020CB
+:102C100002BD3549CA68394910680B68184738B58C
+:102C2000364C354D06E069462846FFF76FFF0098A1
+:102C3000616888472846FFF740FF0028F3D031BD80
+:102C400038B504462E4D2846006040602D4800608F
+:102C5000406025480069A1688160E268C260056142
+:102C60002168016062684260216941616269826134
+:102C700031BD80B501462348FFF732FFBDE8024071
+:102C80000FF2050000F0D7BB38B5174C1D4D08E01A
+:102C900069462846FFF73AFF009920690069FFF767
+:102CA0001FFF2846FFF709FF0028F1D031BD10B5FE
+:102CB000154C2046006040600B4948690460BDE83F
+:102CC000104000F0CCBB1CB50F4C06E06946204616
+:102CD000FFF71CFF0098C046C0462046FFF7EDFEF8
+:102CE0000028F3D013BD000000000320B00903202A
+:102CF000840803203C0500209C0803204405002094
+:102D0000340A0320340500203C0A032010B528486B
+:102D1000284C88B0016841F400410160FFF722F9B6
+:102D200000F0B0FB24490020FEF783FC00F0C3FB59
+:102D30002248016841F4803101600121026C42F4B3
+:102D4000803202640120FFF712F90020FFF75CFBDC
+:102D50000120FFF759FB0220FFF756FB0120FFF788
+:102D600081FB01210020FFF797FBFFF7E3FE144AE8
+:102D700000210820FFF78EF904F23C5100916946CA
+:102D80000FF241020FF24100019200F03FF804F20D
+:102D90005471029104F5C96240F23C5103920591CD
+:102DA000049402A8FFF74CFFFFF7C2FE08B010BD65
+:102DB0000800005824000320AC04002090080058AC
+:102DC0004F2E00087047000080B5FFF770FF00210C
+:102DD0000120FFF7CCF8BDE80140FEF7F3BDFFF797
+:102DE000DAB84FF0FF30FFF7F5B800210820FFF701
+:102DF0005EB90220FFF77DB90220FFF782B9B0F576
+:102E0000806F08BFFEF76EBE704700007FB50C46AE
+:102E10004C4D61684C4EE8612962284600F056FB33
+:102E20002468746006F1080000604060012000F032
+:102E300065F801203070296841B10FF2E5020FF208
+:102E4000E903009201930294684688477FBD1FB54D
+:102E50003D4C04F10800FFF730FEE8B92078D8B106
+:102E6000694604F10800FFF751FE01203549207042
+:102E7000C96941B10098029001A888479DF80410E3
+:102E80002170080003D00098FFF7F3FE04E00099DA
+:102E900004F10800FFF71AFE04F10800FFF70DFE29
+:102EA00028B9207818B104F10800FFF79EFF1FBD74
+:102EB0002DE9F04105460E4690461C46002000F0E4
+:102EC0001DF8214F7868A0F80950C6723246414675
+:102ED0000C30FEF75DFF1B4A136900210020984764
+:102EE00048F2E800FFF788FF79688A78D21C04F17D
+:102EF0000800FEF74DFFBDE8F041012010B5114973
+:102F0000124C096A20B901B188470021217010BD17
+:102F10000120207011B1BDE81040084710BD00002D
+:102F20000020FFF766BF000010B50146064C04F113
+:102F30000800FFF7D5FD04F10800BDE81040FFF7D9
+:102F400054BF0000D0040020040500202A05002002
+:102F50001FB541780024FF2902BFB0F8031040F6E6
+:102F60000142914221D1634A9388B0F807109B1C1B
+:102F7000994209D1407B0124C10752BF8DF800401E
+:102F800000228DF800200DE05288521C91420CD195
+:102F900003218DF8001000F10D01B0F80B208DF821
+:102FA000082001916846FFF7BBF9204604B010BD28
+:102FB00010B58AB050484F4CFFF7F0F88F218DF8CC
+:102FC0001810E522B3218DF819208DF81A10D5229A
+:102FD0002E218DF81B208DF81C107F224A218DF8A0
+:102FE0001D208DF81E1098222A218DF81F208DF8A3
+:102FF000201048227A218DF821208DF82210CC2231
+:1030000040218DF823208DF82410FE2200218DF818
+:103010002520ADF8261000940823012206A90220DD
+:10302000FFF7FAFA00F034F8412100F026F8A01C6E
+:1030300000F018F8062100F00DF800F029F8422100
+:1030400000F01BF8201D00F00DF8102100F002F830
+:103050000AB010BD039200910223208806AA022123
+:10306000FFF728BBFE22059001218DF82520049151
+:10307000029100200A22019070478DF821208DF8DE
+:1030800024108E2200218DF82320ADF826107047E1
+:1030900019218DF81810ED2282218DF81A108DF863
+:1030A0001920ED218DF81C10AE224C218DF81B202B
+:1030B0008DF81E10212241218DF81D208DF8201041
+:1030C0009D2222218DF81F208DF822104522704765
+:1030D0001CB542224FF64264A04208D10548009137
+:1030E0000223818800880022FFF73DFB024610463C
+:1030F00016BD000054050020512F0008704710B580
+:103100000446FEF745FE204610BD10B504461046A5
+:103110000A460146204600F0E3F9204610BD0000B3
+:10312000002200F0E7B900002DE9F04106460A460A
+:103130004FF0000C4FF00F082CE05A4FBE4214BF66
+:103140004FF0070E4FF0040E0EFA01F1294344F838
+:103150002310C143544C236855680B40ED0348BF0E
+:1031600003432360636855680B40AD0348BF0343C6
+:1031700063604E4C236855680B40ED0248BF034323
+:10318000236063680B4051688D0248BF034363604E
+:103190000CF1010C106830FA0CF172D0012303FA23
+:1031A0000CF31840F4D05468022C18BF122C4FEACC
+:1031B0008C010ED14FEADC0406EB840401F01C0EF6
+:1031C000256A08FA0EF7BD43176907FA0EF73D4363
+:1031D00025624FEA4C0403253768A540ED4305EA14
+:1031E000070E177907F00307A74047EA0E07376075
+:1031F0005768012F18BF022F03D0112F18BF122FAD
+:1032000011D1B76805EA070ED768A74047EA0E074D
+:10321000B760776827EA03035768C7F3001707FA10
+:103220000CF73B437360F3681D40936803FA04F4A2
+:103230002C43F4605468E300AAD51D4C4FEA9C036C
+:1032400054F8237001F00C0108FA01F5B6F1904F23
+:1032500027EA050508BF4FF0000E11D0154FBE42FA
+:1032600008BF4FF0010E0BD0134FBE4208BF4FF006
+:10327000020E05D0114FBE427FF45FAF4FF0030E38
+:1032800062E7BDE8F0810AB18161704781627047F1
+:103290000B4A136803421CBF1060FFF7B0BD7047B4
+:1032A0000000000000100048800800580008005886
+:1032B000080001400004004800080048000C0048D5
+:1032C0000C080058C0680840884201D101207047AE
+:1032D00000207047C0690840884201D10120704732
+:1032E0000020704710B5614C02212046FFF7F2FF25
+:1032F00038B16068C043810703D5FFF790FC022016
+:1033000018E001212046FFF7E5FF38B16068C043AF
+:10331000C10703D5FFF749FC01200BE00821204637
+:10332000FFF7D8FF38B16068C043010703D5FFF746
+:10333000CAFC0820A06010BD10B54C4C00F033F85A
+:1033400018B96068C043810306D400F02CF830B986
+:103350006068C043810302D5BDE8104064E00821E5
+:1033600000F022F870B96068C04301030AD56068B4
+:103370003F4940F400206060086880474FF4002215
+:10338000A26010BD202100F00FF858B96068C0435A
+:10339000810207D5606840F400106060BDE810400D
+:1033A000FFF716BC10BD022120468BE740BF20BFAF
+:1033B0003048016841F400410160704780B52E48F3
+:1033C000016841F480110160006800F480100090F1
+:1033D00000982648016841F001010160026842F44A
+:1033E000803202602C20FEF796FABDE802402D20C4
+:1033F000FEF791BA21480168490849000160704709
+:103400001F494FF48030086070471C48016821F064
+:1034100002010160704719484FF4003141600268B1
+:1034200022F40032026070471448016841F4003110
+:103430000160FFF7EEBB38B504460C4D0821284665
+:10344000FFF740FF30B10A480460696821F40021A9
+:10345000696031BDA0474FF40020A86031BD074826
+:10346000016821F00801016070470000000C00585D
+:10347000680500200C04005850000058040C005847
+:10348000080C0058DFF80C00FFE7016841F4806188
+:103490000160704704040058032010B5FEF711FACC
+:1034A0000F2000F041F80024002814BF012400F090
+:1034B0000BF8204610BD0348FFE7016841F0010109
+:1034C00001607047042004E0704700000249034A8D
+:1034D00001600261704700BFD72B0008FF2B000876
+:1034E0004018491C1CBFB1F1010100F8012DF9D1B0
+:1034F0007047000000B500BF13009646944610398F
+:1035000028BFA0E80C50FAD85FEA417C28BF0CC065
+:1035100048BF40F8042BC90728BF20F8022B48BF3A
+:1035200000F8012B00BD000070B50F4E0446B068D6
+:103530000025A8B100F05FF8B2684FF47A71B1FBD2
+:10354000F2F2B0FBF2F0FEF700FA48B9102C07D205
+:10355000002221464FF0FF30FEF7C0F9746000E012
+:103560000125284670BD00BF440000204FF0B04048
+:10357000006800F0F000B02888BFB020704738B570
+:103580004FF0B044244DA16811F00C0106D1FFF7B3
+:10359000EDFFC0F3031055F8200032BD04291F4A87
+:1035A00005D008291E4804D12168C90222D5104639
+:1035B00032BDE16801F00301022904D0032904D1DE
+:1035C0002168C90207D5104605E0FFF7CFFFC0F319
+:1035D000031055F82000E168E268E368C1F30621B2
+:1035E0004843C2F30211491C5B0FB0FBF1F05B1CB6
+:1035F000B0FBF3F032BD80B5FFF7C1FF0549FFE72F
+:10360000084A0968C1F3031152F82110B0FBF1F028
+:1036100002BD000008000058C43E00080024F40069
+:103620000048E801843E0008DFF870130A680309C7
+:1036300003F47F2300019A4300F47F2000F088B94F
+:10364000DFF858231368010C23EA014343EA0043DF
+:10365000136070472DE9F843054600242878DFF809
+:103660003C634106A0464FF0B0472DD5286B70B1A2
+:10367000B0F5800F06D0B0F5000F18BFB0F5400FC1
+:1036800017D01FE0F96841F48031F960F3E0386841
+:1036900020F08060386000F087F9814638680001CA
+:1036A00040F1D68000F080F9A0EB09000228F5D99E
+:1036B0000324DDE000F078F9A0EB0900022840F2D5
+:1036C000CF80F5E70124A0462868010531D5B06810
+:1036D00000F44078286C80452AD000F06BF9B8F1EE
+:1036E000000FB16805D1286C21F440710143B1602D
+:1036F0001EE0B06840F48030B06021F44071B068E2
+:1037000020F48030B060286C0143B160B068C0071D
+:103710000ED500F049F98046B068800708D400F063
+:1037200043F9A0EB080041F289318842F4D3032425
+:10373000A0462878C10705D53268A869920840EAF2
+:10374000820232602978880705D53168E86921F45A
+:103750004061014331602978C80644BFA86AFFF779
+:103760006FFF2878810644BFE86AFFF769FF287871
+:10377000410744BF286AFFF757FF2878010744BF75
+:10378000686AFFF751FF2868C1051ED53268686B6B
+:1037900022F0406202433260696BB1F1006F00F0C9
+:1037A000C9F8686BB0F1806F0FD1396821F0806182
+:1037B00000F0CBF804463868000163D500F0F4F857
+:1037C000001B0228F7D94FF0030870E000F0ECF876
+:1037D000001B022864D9F6E7316821F040413160CE
+:1037E00020F08050326822F0406210433060A86BB5
+:1037F000B0F1C05F00F09EF82868410576D53268C8
+:10380000E86B22F0405202433260E96BB1F1005F95
+:1038100003D1F86840F48030F860E86BB0F1805F65
+:1038200064D1396821F0806100F08FF8044638686F
+:1038300000014CD500F0B8F8001B0228F7D94FF072
+:10384000030853E000F0B0F8001B022847D9F6E760
+:1038500000F067F8A86821F4781100F071F881464B
+:10386000386800017FF526AF39696869014339611D
+:10387000002C7FF428AF3168286B21F4400101430C
+:10388000316021E73969686821F4FE4141EA00218D
+:1038900039613969E86821F0606100F051F8044647
+:1038A0003868000192D5396968690143396129682E
+:1038B0008805A1D5A86BB0F1804F1CBFB0F1004FB7
+:1038C000002889D1316821F0404108438EE700F09B
+:1038D00028F8286921F0604100F032F80446386881
+:1038E0000001AFD539696869014339612968C804A5
+:1038F00005D5F168686C21F440410143F160296805
+:1039000088040BD5796AE86C21F0300101437962B3
+:10391000796AA86C890840EA810179624046BDE86D
+:10392000F2833869696820F4FE4040EA012038617A
+:103930003969704703D1F86840F08070F8607047CB
+:1039400001433961396841F08061396000F02CB879
+:1039500010430860704710B511490A6842F0807240
+:103960000A600B6823F080730B600468416882680A
+:103970000C4B0C43C168144302690C4344EA0244F3
+:103980005C601968406921F47C5141EA00211960AA
+:10399000196841F06001196010BD000088000058EE
+:1039A000380000580060004001480068704700BFC0
+:1039B000440000200248016841F4807101607047B2
+:1039C0000004005818B59BB0FFF766FD574CE06B3C
+:1039D00040010ED5E06BC0000BD4FFF7EBFFFFF703
+:1039E000E9FFA06B40F48030A063A06B20F480302E
+:1039F000A06300F055F807A85021FFF791FB684637
+:103A00001821FFF78DFB4A480168226C42F0010241
+:103A10002264206C8107FCD54FF48072002107924C
+:103A2000149107A8FFF716FE206840F08070206010
+:103A30000022216801F0807106914FF00053069931
+:103A400000924BF67F312222039104920021202222
+:103A50000193029105926846FFF77DFFFFF7AAFFE9
+:103A6000FFF7A8FFA06B40F00100A063A06B8007E8
+:103A7000FCD50022E16B2F4821F4404141F4804104
+:103A8000E16301680260036903F05003036100F021
+:103A900028F8FFF73BF94FF0FF30FEF79BFAFAE703
+:103AA000254881B0016841F4801101603F21006820
+:103AB00000F4801000900098204841604161016846
+:103AC00041F47C110160026942F47C1202610168D8
+:103AD00041F03F010160026942F03F02026101B022
+:103AE000704710B5FFF766FFFFF764FF1448154CE9
+:103AF000016821F4407141F4807101600F21026876
+:103B000042F40042026047F6FF720F488160C260D3
+:103B1000046000F01BF8CA20606253216162FF213B
+:103B2000A068C008C000A060616210BD58000058C5
+:103B3000941400588008005850000058040C005895
+:103B40009000005800280040AC04002070B504002C
+:103B500049D094F8210028B9002184F8201020468B
+:103B6000C046C04600F04EF853202168486200F07D
+:103B700052F8FF2510B100F03FF834E02168DFF87B
+:103B8000AC008A6802408A6022689368666821698E
+:103B9000A0690E430643334393602068E1680161E6
+:103BA00020680169A26841EA024101612068C16898
+:103BB00021F08001C1602068C16C89088900C1645E
+:103BC0002168CA6CE369606903431A43CA642168C7
+:103BD0008868810609D400F01CF830B1206845627D
+:103BE000042100F01DF8012070BD2068456201210C
+:103BF00084F82110002070BD20684562042184F8FB
+:103C000021107047022084F82100CA2122685162E5
+:103C1000704720460CE0204623E02068C0F824804E
+:103C200084F82110002084F820007047BFFF8FFF28
+:103C300038B504462068C16821F0A001C160FFF7D3
+:103C4000B3FE05462068C168880608D4FFF7ACFEBD
+:103C5000401B40F2E9318842F4D3032032BD0020FA
+:103C600032BD38B504462068C1684A0612D44FF008
+:103C7000FF31C160FFF798FE05462068C16848061D
+:103C800008D4FFF791FE401B40F2E9318842F4D39B
+:103C9000032032BD002032BD00EB81003D4AD0F848
+:103CA0008010914201D0012070470020704742F4FB
+:103CB000806240F82120704737481F2181610268E7
+:103CC000D208D20042F0030202603448016841F099
+:103CD0000401016030BF7047704710B5304C00F0F0
+:103CE00048F80028FBD1042100F044F828B92D48F9
+:103CF0000068010403D500F03FF800F057F80022F7
+:103D000003212046FFF7D3FF23480168C908C900F3
+:103D100041F0020101602148016841F004010160A5
+:103D200030BF10BD10B51E4C00F026F800F021F891
+:103D30000028FBD14FF0B040816801F00C0104294C
+:103D400011D1016841F48031016001688903FCD51B
+:103D500082689208920042F002028260816801F05B
+:103D60000C010829FAD12046BDE8104000220321A9
+:103D70009DE7032120468FE700220421204696E795
+:103D800080B500F02DF80548016821F004010160BC
+:103D900030BF01BD000400800004005810ED00E0B9
+:103DA000001400588804005800F022B84FF0B040CA
+:103DB000016841F48071016001684905FCD58268A1
+:103DC0009208920042F001028260416A89088900EB
+:103DD0004162816801F00C010429FAD170470000AA
+:103DE0000248016821F002010160704710E000E024
+:103DF0000248016841F002010160704710E000E0F4
+:103E000080B51C48016841F4700101600020FEF794
+:103E1000D9FB48B180791849184A0A600B6823F425
+:103E20007C5343EA00230B604FF0B040016841F43B
+:103E30008031016012490A68D208D20042F00102C2
+:103E40000A600A6802F00702012AFAD101688903B0
+:103E5000FCD582689208920042F00202826081687A
+:103E600001F00C010829FAD10168490849000160F4
+:103E700001BD000088ED00E09C000058FECAFECAAB
+:103E80000040005801000000030000000500000091
+:103E90000100000001000000060000000A00000010
+:103EA00020000000020000000400000008000000E4
+:103EB0001000000040000000800000000001000031
+:103EC00000020000A0860100400D0300801A0600D9
+:103ED00000350C0040420F0080841E0000093D00A8
+:103EE00000127A000024F40000366E010048E80158
+:103EF000006CDC0200000000000000000000000078
+:103F00000000000030B5016884684218416802EB87
+:103F10005103C9070BD54C4409E012F9011B12F8F3
+:103F2000015B002904F8015B05D5491CF9D19A42CF
+:103F3000F3D10C3030BD491EF1D5F8E70000000088
+:103F40000000000000000000000000000000000071
+:103F500044000800400508013A799C00F401000083
+:103F6000FFFFFFFF48010100000000007047FEE76F
+:103F700070477047704700F011B84FF48060FFF74A
+:103F800087B900E000BF0148FCF7DCB868000020FA
+:103F9000FDF7FABAFFF7D0B9FFF7A4B902490A68EA
+:103FA000886882180A6070474400002080B500F0DD
+:103FB00015F802000023DB431068984204D011007A
+:103FC0000220ABBE002010605068984204D0111D42
+:103FD0000220ABBE0020506001BD000001487047C8
+:103FE000000000006000002010B507497944183136
+:103FF000064C7C44163404E00A68081D11448847C6
+:104000000146A142F8D110BD2C0000005000000074
+:104010004EF68851CEF20001086840F47000086046
+:10402000BFF34F8FBFF36F8F4FF00070E1EE100AB8
+:104030007047000057C7FFFF080500006800002018
+:10404000800800002400032000000000B9FEFFFFEC
+:104050007401000046000000040000200120C0465A
+:10406000002801D0FFF7C0FFAFF300800020AFF3BE
+:104070000080FFF7A7FC00F000F800F001B8000096
+:104080000746384600F002F8FBE7000080B5FFF76E
+:104090008DFF024A11001820ABBEFBE7260002008C
+:1040A000813D0008A93D0008DB3C0008253D0008D3
+:1040B000B93C0008D93C0008014880470148004746
+:1040C000013E0008C9400008AFF30080FFF7A0FFE1
+:1040D000FFF7C4FFFFF7FEBFFFF7FEBFFFF7FEBF0E
+:1040E000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF04
+:1040F000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFF4
+:10410000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFE3
+:10411000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFD3
+:10412000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFC3
+:10413000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFB3
+:10414000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFA3
+:10415000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF93
+:10416000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF83
+:10417000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF73
+:10418000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF63
+:10419000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF53
+:1041A000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF43
+:1041B000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF33
+:1041C000FFF7FEBF030DFF0183D800F8FFF00000EA
+:1041D00010FD000001FA0008480004004800040037
+:0741E00048FD000048F8FF54
+:04000005080040C9E6
:00000001FF
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Inc/app_conf.h
index 3f44b6de7..5413be266 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Inc/app_conf.h
@@ -24,12 +24,13 @@
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* P2P Server Config
******************************************************************************/
-/**< generic parameters ********************************************************/
+/**< generic parameters ******************************************************/
/**
* Define Tx Power
@@ -95,6 +96,15 @@
*/
#define CFG_BLE_ERK {0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21,0xfe,0xdc,0xba,0x09,0x87,0x65,0x43,0x21}
+/* USER CODE BEGIN Generic_Parameters */
+/**
+ * SMPS supply
+ * SMPS not used when Set to 0
+ * SMPS used when Set to 1
+ */
+#define CFG_USE_SMPS 1
+/* USER CODE END Generic_Parameters */
+
/**< specific parameters ********************************************************/
#if defined (USE_STM32WBXX_USB_DONGLE_REVA)
#define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI9_5_IRQHandler
@@ -120,16 +130,16 @@
#define CFG_DEV_ID_P2P_ROUTER (0x85)
-#define RADIO_ACTIVITY_EVENT 1 /* 1 for OOB Demo */
+#define RADIO_ACTIVITY_EVENT 1 /* 1 for OOB Demo */
/**
* AD Element - Group B Feature
*/
-/* LSB - Firt Byte */
+/* LSB - First Byte */
#define CFG_FEATURE_THREAD_SWITCH (0x40)
-/* LSB - Second Byte */
+/* LSB - Second Byte */
#define CFG_FEATURE_OTA_REBOOT (0x20)
#define CONN_L(x) ((int)((x)/0.625f))
@@ -220,7 +230,7 @@
* 1 : internal RO
* 0 : external crystal ( no calibration )
*/
-#define CFG_BLE_LSE_SOURCE 1
+#define CFG_BLE_LSE_SOURCE 0
/**
* Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
@@ -417,7 +427,6 @@ typedef enum
* Enable or Disable traces in application
*/
#define CFG_DEBUG_APP_TRACE 0
-
#if (CFG_DEBUG_APP_TRACE != 0)
#define APP_DBG_MSG PRINT_MESG_DBG
#else
@@ -435,7 +444,6 @@ typedef enum
#define CFG_LPM_SUPPORTED 0
#define CFG_DEBUGGER_SUPPORTED 1
#endif
-
/**
* When CFG_DEBUG_TRACE_FULL is set to 1, the trace are output with the API name, the file name and the line number
* When CFG_DEBUG_TRACE_LIGHT is set to 1, only the debug message is output
@@ -537,6 +545,9 @@ typedef enum
{
CFG_LPM_APP,
CFG_LPM_APP_BLE,
+ /* USER CODE BEGIN CFG_LPM_Id_t */
+
+ /* USER CODE END CFG_LPM_Id_t */
} CFG_LPM_Id_t;
/******************************************************************************
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Inc/stm32_lpm_if.h
index 38e326512..d8e67947f 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Inc/stm32_lpm_if.h
@@ -1,46 +1,22 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file stm32_lpm_if.h
-* @brief Header for stm32_lpm_f.c module (device specific LP management)
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
******************************************************************************
* @attention
*
-* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics International N.V.
+* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted, provided that the following conditions are met:
-*
-* 1. Redistribution of source code must retain the above copyright notice,
-* this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following disclaimer in the documentation
-* and/or other materials provided with the distribution.
-* 3. Neither the name of STMicroelectronics nor the names of other
-* contributors to this software may be used to endorse or promote products
-* derived from this software without specific written permission.
-* 4. This software, including modifications and/or derivative works of this
-* software, must execute solely and exclusively on microcontroller or
-* microprocessor devices manufactured by or for STMicroelectronics.
-* 5. Redistribution and use of this software other than as permitted under
-* this license is void and will automatically terminate your rights under
-* this license.
-*
-* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
-* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
-* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+* This software component is licensed by ST under BSD 3-Clause license,
+* the "License"; You may not use this file except in compliance with the
+* License. You may obtain a copy of the License at:
+* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32_LPM_IF_H
@@ -89,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Inc/stm32wbxx_hal_conf.h
index 8cce280aa..4ab9edb7d 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Inc/stm32wbxx_hal_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Inc/stm32wbxx_hal_conf.h
@@ -219,6 +219,10 @@
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32wbxx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32wbxx_hal_flash.h"
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Inc/utilities_conf.h
index c98d97ba1..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Inc/utilities_conf.h
@@ -1,3 +1,4 @@
+/* USER CODE BEGIN Header */
/**
******************************************************************************
* File Name : utilities_conf.h
@@ -9,13 +10,14 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
+/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef UTILITIES_CONF_H
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Src/app_entry.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Src/app_entry.c
index 683e9e546..7bebc59f7 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Src/app_entry.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Src/app_entry.c
@@ -61,7 +61,6 @@ static void appe_Tl_Init( void );
static void Led_Init( void );
static void Button_Init( void );
static void APPE_SysStatusNot( SHCI_TL_CmdStatus_t status );
-
static void APPE_SysUserEvtRx( void * pPayload );
/* Functions Definition ------------------------------------------------------*/
@@ -87,7 +86,7 @@ void APPE_Init( void )
/**
* From now, the application is waiting for the ready event ( VS_HCI_C2_Ready )
- * received on the system channel before starting the BLE Stack
+ * received on the system channel before starting the Stack
* This system event is received with APPE_SysUserEvtRx()
*/
@@ -259,7 +258,6 @@ void UTIL_SEQ_Idle( void )
return;
}
-
void UTIL_SEQ_EvtIdle( UTIL_SEQ_bm_t task_id_bm, UTIL_SEQ_bm_t evt_waited_bm )
{
UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Src/hw_timerserver.c
index 52a1bfa0d..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Src/hw_timerserver.c
@@ -1,22 +1,21 @@
/**
******************************************************************************
- * File Name : hw_timerserver.c
- * Description : Hardware timerserver source file for BLE
- * middleWare.
+ * File Name : hw_timerserver.c
+ * Description : Hardware timerserver source file for STM32WPAN Middleware.
+ *
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Src/hw_uart.c
index c0fc22d58..9a553610d 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Src/hw_uart.c
@@ -1,42 +1,33 @@
/**
******************************************************************************
- * @file hw_uart.c
- * @author MCD Application Team
- * @brief hardware access
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * File Name : Src/hw_uart.c
+ * Description : HW UART source file for STM32WPAN Middleware.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
#include "hw_conf.h"
+#if (CFG_HW_LPUART1_ENABLED == 1)
+extern UART_HandleTypeDef hlpuart1;
+#endif
+#if (CFG_HW_USART1_ENABLED == 1)
+extern UART_HandleTypeDef huart1;
+#endif
/* Macros --------------------------------------------------------------------*/
-#define HW_UART_INIT(__HANDLE__, __USART_BASE__) \
- do{ \
- (__HANDLE__).Instance = (__USART_BASE__); \
- (__HANDLE__).Init.BaudRate = CFG_HW_##__USART_BASE__##_BAUDRATE; \
- (__HANDLE__).Init.WordLength = CFG_HW_##__USART_BASE__##_WORDLENGTH; \
- (__HANDLE__).Init.StopBits = CFG_HW_##__USART_BASE__##_STOPBITS; \
- (__HANDLE__).Init.Parity = CFG_HW_##__USART_BASE__##_PARITY; \
- (__HANDLE__).Init.HwFlowCtl = CFG_HW_##__USART_BASE__##_HWFLOWCTL; \
- (__HANDLE__).Init.Mode = CFG_HW_##__USART_BASE__##_MODE; \
- (__HANDLE__).Init.OverSampling = CFG_HW_##__USART_BASE__##_OVERSAMPLING; \
- (__HANDLE__).AdvancedInit.AdvFeatureInit = CFG_HW_##__USART_BASE__##_ADVFEATUREINIT; \
- HAL_UART_Init(&(__HANDLE__)); \
- } while(0)
-
#define HW_UART_RX_IT(__HANDLE__, __USART_BASE__) \
do{ \
HW_##__HANDLE__##RxCb = cb; \
@@ -57,82 +48,8 @@
hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \
} while(0)
-#define HW_UART_MSP_UART_INIT(__HANDLE__, __USART_BASE__) \
- do{ \
- \
- /* Configure Tx Pin */ \
- CFG_HW_##__USART_BASE__##_TX_PORT_CLK_ENABLE(); \
- \
- GPIO_InitStruct.Pin = CFG_HW_##__USART_BASE__##_TX_PIN ; \
- GPIO_InitStruct.Mode = CFG_HW_##__USART_BASE__##_TX_MODE; \
- GPIO_InitStruct.Pull = CFG_HW_##__USART_BASE__##_TX_PULL; \
- GPIO_InitStruct.Speed = CFG_HW_##__USART_BASE__##_TX_SPEED; \
- GPIO_InitStruct.Alternate = CFG_HW_##__USART_BASE__##_TX_ALTERNATE; \
- HAL_GPIO_Init(CFG_HW_##__USART_BASE__##_TX_PORT, &GPIO_InitStruct); \
- \
- \
- /* Configure Rx Pin */ \
- CFG_HW_##__USART_BASE__##_RX_PORT_CLK_ENABLE(); \
- \
- GPIO_InitStruct.Pin = CFG_HW_##__USART_BASE__##_RX_PIN; \
- GPIO_InitStruct.Mode = CFG_HW_##__USART_BASE__##_RX_MODE; \
- GPIO_InitStruct.Pull = CFG_HW_##__USART_BASE__##_RX_PULL; \
- GPIO_InitStruct.Speed = CFG_HW_##__USART_BASE__##_RX_SPEED; \
- GPIO_InitStruct.Alternate = CFG_HW_##__USART_BASE__##_RX_ALTERNATE; \
- HAL_GPIO_Init(CFG_HW_##__USART_BASE__##_RX_PORT, &GPIO_InitStruct); \
- \
- \
- /* Configure CTS Pin */ \
- CFG_HW_##__USART_BASE__##_CTS_PORT_CLK_ENABLE(); \
- \
- GPIO_InitStruct.Pin = CFG_HW_##__USART_BASE__##_CTS_PIN; \
- GPIO_InitStruct.Mode = CFG_HW_##__USART_BASE__##_CTS_MODE; \
- GPIO_InitStruct.Pull = CFG_HW_##__USART_BASE__##_CTS_PULL; \
- GPIO_InitStruct.Speed = CFG_HW_##__USART_BASE__##_CTS_SPEED; \
- GPIO_InitStruct.Alternate = CFG_HW_##__USART_BASE__##_CTS_ALTERNATE; \
- HAL_GPIO_Init(CFG_HW_##__USART_BASE__##_CTS_PORT, &GPIO_InitStruct); \
- \
- /* Set USART source clock */ \
- __HAL_RCC_##__USART_BASE__##_CONFIG(CFG_HW_##__USART_BASE__##_SOURCE_CLOCK); \
- \
- /* Enable USART clock */ \
- __HAL_RCC_##__USART_BASE__##_CLK_ENABLE(); \
- \
- HAL_NVIC_SetPriority(__USART_BASE__##_IRQn, CFG_HW_##__USART_BASE__##_PREEMPTPRIORITY, CFG_HW_##__USART_BASE__##_SUBPRIORITY); \
- HAL_NVIC_EnableIRQ(__USART_BASE__##_IRQn); \
- } while(0)
-
-#define HW_UART_MSP_TX_DMA_INIT(__HANDLE__, __USART_BASE__) \
- do{ \
- /* Configure the DMA handler for Transmission process */ \
- /* Enable DMA clock */ \
- CFG_HW_##__USART_BASE__##_DMA_CLK_ENABLE(); \
- /* Enable DMA MUX clock */ \
- CFG_HW_##__USART_BASE__##_DMAMUX_CLK_ENABLE(); \
- \
- HW_hdma_##__HANDLE__##_tx.Instance = CFG_HW_##__USART_BASE__##_TX_DMA_CHANNEL; \
- HW_hdma_##__HANDLE__##_tx.Init.Request = CFG_HW_##__USART_BASE__##_TX_DMA_REQ; \
- HW_hdma_##__HANDLE__##_tx.Init.Direction = DMA_MEMORY_TO_PERIPH; \
- HW_hdma_##__HANDLE__##_tx.Init.PeriphInc = DMA_PINC_DISABLE; \
- HW_hdma_##__HANDLE__##_tx.Init.MemInc = DMA_MINC_ENABLE; \
- HW_hdma_##__HANDLE__##_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; \
- HW_hdma_##__HANDLE__##_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; \
- HW_hdma_##__HANDLE__##_tx.Init.Mode = DMA_NORMAL; \
- HW_hdma_##__HANDLE__##_tx.Init.Priority = DMA_PRIORITY_LOW; \
- \
- HAL_DMA_Init(&HW_hdma_##__HANDLE__##_tx); \
- \
- /* Associate the initialized DMA handle to the UART handle */ \
- __HAL_LINKDMA(huart, hdmatx, HW_hdma_##__HANDLE__##_tx); \
- \
- /* NVIC configuration for DMA transfer complete interrupt */ \
- HAL_NVIC_SetPriority(CFG_HW_##__USART_BASE__##_TX_DMA_IRQn, CFG_HW_##__USART_BASE__##_DMA_TX_PREEMPTPRIORITY, CFG_HW_##__USART_BASE__##_DMA_TX_SUBPRIORITY); \
- HAL_NVIC_EnableIRQ(CFG_HW_##__USART_BASE__##_TX_DMA_IRQn); \
- } while(0)
-
- /* Variables ------------------------------------------------------------------*/
+/* Variables -----------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
- UART_HandleTypeDef huart1 = {0};
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
DMA_HandleTypeDef HW_hdma_huart1_tx ={0};
#endif
@@ -141,331 +58,261 @@
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- UART_HandleTypeDef lpuart1 = {0};
#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
- DMA_HandleTypeDef HW_hdma_lpuart1_tx ={0};
+ DMA_HandleTypeDef HW_hdma_hlpuart1_tx ={0};
#endif
- void (*HW_lpuart1RxCb)(void);
- void (*HW_lpuart1TxCb)(void);
+ void (*HW_hlpuart1RxCb)(void);
+ void (*HW_hlpuart1TxCb)(void);
#endif
- void HW_UART_Init(hw_uart_id_t hw_uart_id)
+void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_INIT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_RX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_INIT(lpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_RX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ return;
+}
+
+void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_RX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX_IT(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_RX_IT(lpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX_IT(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ return;
+}
+
+hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
+{
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
+
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX_IT(huart1, USART1);
- break;
+ case hw_uart1:
+ HW_UART_TX(huart1, USART1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX_IT(lpuart1, LPUART1);
- break;
+ case hw_lpuart1:
+ HW_UART_TX(hlpuart1, LPUART1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout)
+ switch (hal_status)
{
- HAL_StatusTypeDef hal_status = HAL_OK;
- hw_status_t hw_status = hw_uart_ok;
-
- switch (hw_uart_id)
- {
-#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_UART_TX(huart1, USART1);
- break;
-#endif
-
-#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_UART_TX(lpuart1, LPUART1);
- break;
-#endif
-
- default:
- break;
- }
+ case HAL_OK:
+ hw_status = hw_uart_ok;
+ break;
- switch (hal_status)
- {
- case HAL_OK:
- hw_status = hw_uart_ok;
- break;
+ case HAL_ERROR:
+ hw_status = hw_uart_error;
+ break;
- case HAL_ERROR:
- hw_status = hw_uart_error;
- break;
+ case HAL_BUSY:
+ hw_status = hw_uart_busy;
+ break;
- case HAL_BUSY:
- hw_status = hw_uart_busy;
- break;
+ case HAL_TIMEOUT:
+ hw_status = hw_uart_to;
+ break;
- case HAL_TIMEOUT:
- hw_status = hw_uart_to;
- break;
+ default:
+ break;
+ }
- default:
- break;
- }
+ return hw_status;
+}
- return hw_status;
- }
+hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+{
+ HAL_StatusTypeDef hal_status = HAL_OK;
+ hw_status_t hw_status = hw_uart_ok;
- hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*cb)(void))
+ switch (hw_uart_id)
{
- HAL_StatusTypeDef hal_status = HAL_OK;
- hw_status_t hw_status = hw_uart_ok;
-
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HW_huart1TxCb = cb;
- huart1.Instance = USART1;
- hal_status = HAL_UART_Transmit_DMA(&huart1, p_data, size);
- break;
-#endif
-
-#if (CFG_HW_USART2_ENABLED == 1)
- case hw_uart2:
- HW_huart2TxCb = cb;
- huart2.Instance = USART2;
- hal_status = HAL_UART_Transmit_DMA(&huart2, p_data, size);
- break;
+ case hw_uart1:
+ HW_huart1TxCb = cb;
+ huart1.Instance = USART1;
+ hal_status = HAL_UART_Transmit_DMA(&huart1, p_data, size);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HW_lpuart1TxCb = cb;
- lpuart1.Instance = LPUART1;
- hal_status = HAL_UART_Transmit_DMA(&lpuart1, p_data, size);
- break;
+ case hw_lpuart1:
+ HW_hlpuart1TxCb = cb;
+ hlpuart1.Instance = LPUART1;
+ hal_status = HAL_UART_Transmit_DMA(&hlpuart1, p_data, size);
+ break;
#endif
- default:
- break;
- }
-
- switch (hal_status)
- {
- case HAL_OK:
- hw_status = hw_uart_ok;
- break;
+ default:
+ break;
+ }
- case HAL_ERROR:
- hw_status = hw_uart_error;
- break;
+ switch (hal_status)
+ {
+ case HAL_OK:
+ hw_status = hw_uart_ok;
+ break;
- case HAL_BUSY:
- hw_status = hw_uart_busy;
- break;
+ case HAL_ERROR:
+ hw_status = hw_uart_error;
+ break;
- case HAL_TIMEOUT:
- hw_status = hw_uart_to;
- break;
+ case HAL_BUSY:
+ hw_status = hw_uart_busy;
+ break;
- default:
- break;
- }
+ case HAL_TIMEOUT:
+ hw_status = hw_uart_to;
+ break;
- return hw_status;
+ default:
+ break;
}
- void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id)
+ return hw_status;
+}
+
+void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id)
+{
+ switch (hw_uart_id)
{
- switch (hw_uart_id)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case hw_uart1:
- HAL_UART_IRQHandler(&huart1);
- break;
+ case hw_uart1:
+ HAL_UART_IRQHandler(&huart1);
+ break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case hw_lpuart1:
- HAL_UART_IRQHandler(&lpuart1);
- break;
+ case hw_lpuart1:
+ HAL_UART_IRQHandler(&hlpuart1);
+ break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
- {
- switch (hw_uart_id)
- {
-#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
- case hw_uart1:
- HAL_DMA_IRQHandler(huart1.hdmatx);
- break;
-#endif
-
-#if (CFG_HW_USART2_DMA_TX_SUPPORTED == 1)
- case hw_uart2:
- HAL_DMA_IRQHandler(huart2.hdmatx);
- break;
-#endif
-
-#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
- case hw_lpuart1:
- HAL_DMA_IRQHandler(lpuart1.hdmatx);
- break;
-#endif
-
- default:
- break;
- }
+ return;
+}
- return;
- }
-
- void HAL_UART_MspInit(UART_HandleTypeDef *huart)
+void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id)
+{
+ switch (hw_uart_id)
{
-#if ( (CFG_HW_USART1_ENABLED == 1) || (CFG_HW_LPUART1_ENABLED == 1) )
- GPIO_InitTypeDef GPIO_InitStruct = {0};
-#endif
- switch ((uint32_t)huart->Instance)
- {
-#if (CFG_HW_USART1_ENABLED == 1)
- case (uint32_t)USART1:
- HW_UART_MSP_UART_INIT( huart1, USART1 );
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
- HW_UART_MSP_TX_DMA_INIT( huart1, USART1 );
-#endif
+ case hw_uart1:
+ HAL_DMA_IRQHandler(huart1.hdmatx);
break;
#endif
-#if (CFG_HW_LPUART1_ENABLED == 1)
- case (uint32_t)LPUART1:
- HW_UART_MSP_UART_INIT( lpuart1, LPUART1 );
#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1)
- HW_UART_MSP_TX_DMA_INIT( lpuart1, LPUART1 );
-#endif
+ case hw_lpuart1:
+ HAL_DMA_IRQHandler(hlpuart1.hdmatx);
break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
+ return;
+}
+
+void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
+{
+ switch ((uint32_t)huart->Instance)
{
- switch ((uint32_t)huart->Instance)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case (uint32_t)USART1:
- if(HW_huart1RxCb)
- {
- HW_huart1RxCb();
- }
+ case (uint32_t)USART1:
+ if(HW_huart1RxCb)
+ {
+ HW_huart1RxCb();
+ }
break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case (uint32_t)LPUART1:
- if(HW_lpuart1RxCb)
- {
- HW_lpuart1RxCb();
- }
+ case (uint32_t)LPUART1:
+ if(HW_hlpuart1RxCb)
+ {
+ HW_hlpuart1RxCb();
+ }
break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
+ return;
+}
+
+void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
+{
+ switch ((uint32_t)huart->Instance)
{
- switch ((uint32_t)huart->Instance)
- {
#if (CFG_HW_USART1_ENABLED == 1)
- case (uint32_t)USART1:
- if(HW_huart1TxCb)
- {
- HW_huart1TxCb();
- }
+ case (uint32_t)USART1:
+ if(HW_huart1TxCb)
+ {
+ HW_huart1TxCb();
+ }
break;
#endif
#if (CFG_HW_LPUART1_ENABLED == 1)
- case (uint32_t)LPUART1:
- if(HW_lpuart1TxCb)
- {
- HW_lpuart1TxCb();
- }
+ case (uint32_t)LPUART1:
+ if(HW_hlpuart1TxCb)
+ {
+ HW_hlpuart1TxCb();
+ }
break;
#endif
- default:
- break;
- }
-
- return;
+ default:
+ break;
}
- /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+ return;
+}
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Src/main.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Src/main.c
index 7e80f2c17..1754a019a 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Src/main.c
@@ -195,7 +195,13 @@ static void Init_RTC( void )
hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
HAL_RTC_Init(&hrtc);
- MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* Disable RTC registers write protection */
+ LL_RTC_DisableWriteProtection(RTC);
+
+ LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER);
+
+ /* Enable RTC registers write protection */
+ LL_RTC_EnableWriteProtection(RTC);
return;
}
@@ -218,6 +224,12 @@ void SystemClock_Config( void )
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -268,19 +280,6 @@ void SystemClock_Config( void )
*/
LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
-
-
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
-
return;
}
@@ -289,21 +288,33 @@ void SystemClock_Config( void )
* WRAP FUNCTIONS
*
*************************************************************/
-
-/**
- * This function is empty to avoid starting the SysTick Timer
- */
-HAL_StatusTypeDef HAL_InitTick( uint32_t TickPriority )
+void HAL_Delay(uint32_t Delay)
{
- return (HAL_OK);
-}
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
-/**
- * This function is empty as the SysTick Timer is not used
- */
-void HAL_Delay(__IO uint32_t Delay)
-{
- return;
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
}
/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/STM32_WPAN/App/app_ble.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/STM32_WPAN/App/app_ble.c
index 3cd401b6d..8d0a5600a 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/STM32_WPAN/App/app_ble.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/STM32_WPAN/App/app_ble.c
@@ -790,7 +790,7 @@ static void Adv_Request( APP_BLE_ConnStatus_t New_Status )
ret = aci_gap_set_non_discoverable();
if (ret == BLE_STATUS_SUCCESS)
{
- APP_DBG_MSG("Successfully Stopped Advertising\n");
+ APP_DBG_MSG("Successfully Stopped Advertising \n");
}
else
{
@@ -819,13 +819,13 @@ static void Adv_Request( APP_BLE_ConnStatus_t New_Status )
{
if (New_Status == APP_BLE_FAST_ADV)
{
- APP_DBG_MSG("Successfully Start Fast Advertising\n" );
+ APP_DBG_MSG("Successfully Start Fast Advertising \n" );
/* Start Timer to STOP ADV - TIMEOUT */
HW_TS_Start(BleApplicationContext.Advertising_mgr_timer_Id, INITIAL_ADV_TIMEOUT);
}
else
{
- APP_DBG_MSG("Successfully Start Low Power Advertising\n");
+ APP_DBG_MSG("Successfully Start Low Power Advertising \n");
}
}
else
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/SW4STM32/Production/.cproject b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/SW4STM32/Production/.cproject
index 8977b1238..9bfdac567 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/SW4STM32/Production/.cproject
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer/SW4STM32/Production/.cproject
@@ -88,7 +88,7 @@
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/ble"/>
<listOptionValue builtIn="false" value="../../../Core/Inc"/>
- <listOptionValue builtIn="false" value="../../../STM32_WPAN/app"/>
+ <listOptionValue builtIn="false" value="../../../STM32_WPAN/App"/>
<listOptionValue builtIn="false" value="../../../../../../../../Drivers/BSP/P-NUCLEO-WB55.USBDongle"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/vcp"/>
<listOptionValue builtIn="false" value="../../../../../../../../Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc"/>
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Inc/app_conf.h
index f58880673..2adead9df 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Inc/app_conf.h
@@ -25,6 +25,7 @@
/* Includes ------------------------------------------------------------------*/
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Transport Layer
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Inc/stm32_lpm_if.h
index 45db98456..70abecaa9 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Inc/stm32_lpm_if.h
@@ -1,21 +1,21 @@
/* USER CODE BEGIN Header */
/**
- ******************************************************************************
- * File Name : stm32_lpm_if.h
- * Description : Header for stm32_lpm_f.c module (device specific LP management).
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
+******************************************************************************
+* @file stm32_lpm_if.h
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
+******************************************************************************
+* @attention
+*
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+* All rights reserved.</center></h2>
+*
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+*
+******************************************************************************
+*/
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
@@ -65,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Inc/stm32wbxx_hal_conf.h
index 55d1a0e24..ec0f85423 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Inc/stm32wbxx_hal_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Inc/stm32wbxx_hal_conf.h
@@ -220,6 +220,10 @@
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32wbxx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32wbxx_hal_flash.h"
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Inc/utilities_conf.h
index 2c5384639..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Inc/utilities_conf.h
@@ -10,10 +10,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Src/hw_timerserver.c
index 17c9af0a4..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Src/hw_timerserver.c
@@ -4,19 +4,18 @@
* Description : Hardware timerserver source file for STM32WPAN Middleware.
*
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Src/hw_uart.c
index c0fc22d58..775aa241d 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Src/hw_uart.c
@@ -130,7 +130,7 @@
HAL_NVIC_EnableIRQ(CFG_HW_##__USART_BASE__##_TX_DMA_IRQn); \
} while(0)
- /* Variables ------------------------------------------------------------------*/
+/* Variables ------------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
UART_HandleTypeDef huart1 = {0};
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Src/main.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Src/main.c
index 7a144f6d2..9f1faa6ad 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Src/main.c
@@ -91,15 +91,6 @@ int main( void )
* LOCAL FUNCTIONS
*
*************************************************************/
-static void Init_Exti( void )
-{
- /**< Disable all wakeup interrupt on CPU1 except IPCC(36), HSEM(38) */
- LL_EXTI_DisableIT_0_31(~0);
- LL_EXTI_DisableIT_32_63( (~0) & (~(LL_EXTI_LINE_36 | LL_EXTI_LINE_38)) );
-
- return;
-}
-
static void Reset_Device( void )
{
#if ( CFG_HW_RESET_BY_FW == 1 )
@@ -206,7 +197,13 @@ static void Init_RTC( void )
hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
HAL_RTC_Init(&hrtc);
- MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* Disable RTC registers write protection */
+ LL_RTC_DisableWriteProtection(RTC);
+
+ LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER);
+
+ /* Enable RTC registers write protection */
+ LL_RTC_EnableWriteProtection(RTC);
return;
}
@@ -230,6 +227,12 @@ static void SystemClock_Config( void )
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -280,17 +283,14 @@ static void SystemClock_Config( void )
*/
LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
+ return;
+}
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
+static void Init_Exti( void )
+{
+ /**< Disable all wakeup interrupt on CPU1 except IPCC(36), HSEM(38) */
+ LL_EXTI_DisableIT_0_31(~0);
+ LL_EXTI_DisableIT_32_63( (~0) & (~(LL_EXTI_LINE_36 | LL_EXTI_LINE_38)) );
return;
}
@@ -300,21 +300,34 @@ static void SystemClock_Config( void )
* WRAP FUNCTIONS
*
*************************************************************/
-
-void HAL_Delay(uint32_t delay)
+void HAL_Delay(uint32_t Delay)
{
uint32_t tickstart = HAL_GetTick();
- uint32_t wait = delay;
+ uint32_t wait = Delay;
+ /* Add a freq to guarantee minimum wait */
if (wait < HAL_MAX_DELAY)
{
- wait ++;
+ wait += HAL_GetTickFreq();
}
while ((HAL_GetTick() - tickstart) < wait)
{
- UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
}
}
+
/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/STM32_WPAN/App/app_thread.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/STM32_WPAN/App/app_thread.c
index 94b1e63a7..03719f60b 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/STM32_WPAN/App/app_thread.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Cli_Cmd/STM32_WPAN/App/app_thread.c
@@ -44,6 +44,7 @@
/* USER CODE BEGIN PTD */
/* USER CODE END PTD */
+
/* Private defines -----------------------------------------------------------*/
#define C_SIZE_CMD_STRING 256U
@@ -60,8 +61,9 @@ static void APP_THREAD_CheckWirelessFirmwareInfo(void);
static void APP_THREAD_DeviceConfig(void);
static void APP_THREAD_StateNotif(uint32_t NotifFlags, void *pContext);
static void APP_THREAD_TraceError(const char * pMess, uint32_t ErrCode);
-
+#if (CFG_FULL_LOW_POWER == 0)
static void Send_CLI_To_M0(void);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
static void Send_CLI_Ack_For_OT(void);
static void HostTxCb( void );
static void Wait_Getting_Ack_From_M0(void);
@@ -70,10 +72,12 @@ static void Receive_Notification_From_M0(void);
#if (CFG_USB_INTERFACE_ENABLE != 0)
static uint32_t ProcessCmdString(uint8_t* buf , uint32_t len);
#else
+#if (CFG_FULL_LOW_POWER == 0)
static void RxCpltCallback(void);
-#endif
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
- /* USER CODE BEGIN PFP */
+/* USER CODE BEGIN PFP */
/* USER CODE END PFP */
@@ -83,10 +87,14 @@ static uint8_t TmpString[C_SIZE_CMD_STRING];
static uint8_t VcpRxBuffer[sizeof(TL_CmdSerial_t)]; /* Received Data over USB are stored in this buffer */
static uint8_t VcpTxBuffer[sizeof(TL_EvtPacket_t) + 254U]; /* Transmit buffer over USB */
#else
+#if (CFG_FULL_LOW_POWER == 0)
static uint8_t aRxBuffer[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+#if (CFG_FULL_LOW_POWER == 0)
static uint8_t CommandString[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
static __IO uint16_t indexReceiveChar = 0;
static __IO uint16_t CptReceiveCmdFromUser = 0;
@@ -345,7 +353,6 @@ static void APP_THREAD_CheckWirelessFirmwareInfo(void)
APP_DBG("**********************************************************");
}
}
-
/* USER CODE BEGIN FD_LOCAL_FUNCTIONS */
/* USER CODE END FD_LOCAL_FUNCTIONS */
@@ -360,7 +367,6 @@ void APP_THREAD_RegisterCmdBuffer(TL_CmdPacket_t* p_buffer)
p_thread_otcmdbuffer = p_buffer;
}
-
Thread_OT_Cmd_Request_t* THREAD_Get_OTCmdPayloadBuffer(void)
{
return (Thread_OT_Cmd_Request_t*)p_thread_otcmdbuffer->cmdserial.cmd.payload;
@@ -435,7 +441,7 @@ void TL_THREAD_NotReceived( TL_EvtPacket_t * Notbuffer )
*/
void Pre_OtCmdProcessing(void)
{
- UTIL_SEQ_WaitEvt( EVENT_SYNCHRO_BYPASS_IDLE);
+ UTIL_SEQ_WaitEvt(EVENT_SYNCHRO_BYPASS_IDLE);
}
/**
@@ -475,6 +481,7 @@ static void Receive_Notification_From_M0(void)
#if (CFG_USB_INTERFACE_ENABLE != 0)
#else
+#if (CFG_FULL_LOW_POWER == 0)
static void RxCpltCallback(void)
{
/* Filling buffer and wait for '\r' char */
@@ -493,6 +500,7 @@ static void RxCpltCallback(void)
/* Once a character has been sent, put back the device in reception mode */
HW_UART_Receive_IT(CFG_CLI_UART, aRxBuffer, 1U, RxCpltCallback);
}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
#if (CFG_USB_INTERFACE_ENABLE != 0)
@@ -535,6 +543,7 @@ static uint32_t ProcessCmdString( uint8_t* buf , uint32_t len )
}
#endif/* (CFG_USB_INTERFACE_ENABLE != 0) */
+#if (CFG_FULL_LOW_POWER == 0)
/**
* @brief Process sends receive CLI command to M0.
* @param None
@@ -554,6 +563,7 @@ static void Send_CLI_To_M0(void)
TL_CLI_SendCmd();
}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
/**
* @brief Send notification for CLI TL Channel.
@@ -574,7 +584,10 @@ static void Send_CLI_Ack_For_OT(void)
*/
void APP_THREAD_Init_UART_CLI(void)
{
+#if (CFG_FULL_LOW_POWER == 0)
UTIL_SEQ_RegTask( 1<<CFG_TASK_SEND_CLI_TO_M0, UTIL_SEQ_RFU,Send_CLI_To_M0);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+
#if (CFG_USB_INTERFACE_ENABLE != 0)
#else
HW_UART_Init(CFG_CLI_UART);
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/app_conf.h
index 2236509d3..f7394d2c6 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/app_conf.h
@@ -25,6 +25,7 @@
/* Includes ------------------------------------------------------------------*/
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Transport Layer
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/stm32_lpm_if.h
index 45db98456..70abecaa9 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/stm32_lpm_if.h
@@ -1,21 +1,21 @@
/* USER CODE BEGIN Header */
/**
- ******************************************************************************
- * File Name : stm32_lpm_if.h
- * Description : Header for stm32_lpm_f.c module (device specific LP management).
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
+******************************************************************************
+* @file stm32_lpm_if.h
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
+******************************************************************************
+* @attention
+*
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+* All rights reserved.</center></h2>
+*
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+*
+******************************************************************************
+*/
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
@@ -65,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/stm32wbxx_hal_conf.h
index 55d1a0e24..ec0f85423 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/stm32wbxx_hal_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/stm32wbxx_hal_conf.h
@@ -220,6 +220,10 @@
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32wbxx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32wbxx_hal_flash.h"
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/utilities_conf.h
index 2c5384639..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Inc/utilities_conf.h
@@ -10,10 +10,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/hw_timerserver.c
index 17c9af0a4..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/hw_timerserver.c
@@ -4,19 +4,18 @@
* Description : Hardware timerserver source file for STM32WPAN Middleware.
*
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/hw_uart.c
index c0fc22d58..775aa241d 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/hw_uart.c
@@ -130,7 +130,7 @@
HAL_NVIC_EnableIRQ(CFG_HW_##__USART_BASE__##_TX_DMA_IRQn); \
} while(0)
- /* Variables ------------------------------------------------------------------*/
+/* Variables ------------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
UART_HandleTypeDef huart1 = {0};
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/main.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/main.c
index 7a144f6d2..9f1faa6ad 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/main.c
@@ -91,15 +91,6 @@ int main( void )
* LOCAL FUNCTIONS
*
*************************************************************/
-static void Init_Exti( void )
-{
- /**< Disable all wakeup interrupt on CPU1 except IPCC(36), HSEM(38) */
- LL_EXTI_DisableIT_0_31(~0);
- LL_EXTI_DisableIT_32_63( (~0) & (~(LL_EXTI_LINE_36 | LL_EXTI_LINE_38)) );
-
- return;
-}
-
static void Reset_Device( void )
{
#if ( CFG_HW_RESET_BY_FW == 1 )
@@ -206,7 +197,13 @@ static void Init_RTC( void )
hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
HAL_RTC_Init(&hrtc);
- MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* Disable RTC registers write protection */
+ LL_RTC_DisableWriteProtection(RTC);
+
+ LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER);
+
+ /* Enable RTC registers write protection */
+ LL_RTC_EnableWriteProtection(RTC);
return;
}
@@ -230,6 +227,12 @@ static void SystemClock_Config( void )
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -280,17 +283,14 @@ static void SystemClock_Config( void )
*/
LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
+ return;
+}
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
+static void Init_Exti( void )
+{
+ /**< Disable all wakeup interrupt on CPU1 except IPCC(36), HSEM(38) */
+ LL_EXTI_DisableIT_0_31(~0);
+ LL_EXTI_DisableIT_32_63( (~0) & (~(LL_EXTI_LINE_36 | LL_EXTI_LINE_38)) );
return;
}
@@ -300,21 +300,34 @@ static void SystemClock_Config( void )
* WRAP FUNCTIONS
*
*************************************************************/
-
-void HAL_Delay(uint32_t delay)
+void HAL_Delay(uint32_t Delay)
{
uint32_t tickstart = HAL_GetTick();
- uint32_t wait = delay;
+ uint32_t wait = Delay;
+ /* Add a freq to guarantee minimum wait */
if (wait < HAL_MAX_DELAY)
{
- wait ++;
+ wait += HAL_GetTickFreq();
}
while ((HAL_GetTick() - tickstart) < wait)
{
- UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
}
}
+
/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/STM32_WPAN/App/app_thread.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/STM32_WPAN/App/app_thread.c
index efb2a8ae2..2c26d2689 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/STM32_WPAN/App/app_thread.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_DataTransfer/STM32_WPAN/App/app_thread.c
@@ -39,9 +39,9 @@
#include "data_transfer.h"
/* Private defines -----------------------------------------------------------*/
-#define C_SIZE_CMD_STRING 256U
-#define C_PANID 0x2226U
-#define C_CHANNEL_NB 19U
+#define C_SIZE_CMD_STRING 256U
+#define C_PANID 0x2226U
+#define C_CHANNEL_NB 19U
#define C_RESSOURCE_DATA_TRANSFER "dataTransfer"
#define C_RESSOURCE_Provisioning "provisioning"
@@ -53,8 +53,9 @@ static void APP_THREAD_CheckWirelessFirmwareInfo(void);
static void APP_THREAD_DeviceConfig(void);
static void APP_THREAD_StateNotif(uint32_t NotifFlags, void *pContext);
static void APP_THREAD_TraceError(const char * pMess, uint32_t ErrCode);
-
+#if (CFG_FULL_LOW_POWER == 0)
static void Send_CLI_To_M0(void);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
static void Send_CLI_Ack_For_OT(void);
static void HostTxCb( void );
static void Wait_Getting_Ack_From_M0(void);
@@ -63,8 +64,10 @@ static void Receive_Notification_From_M0(void);
#if (CFG_USB_INTERFACE_ENABLE != 0)
static uint32_t ProcessCmdString(uint8_t* buf , uint32_t len);
#else
+#if (CFG_FULL_LOW_POWER == 0)
static void RxCpltCallback(void);
-#endif
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
static void APP_THREAD_CheckMsgValidity(void);
static void APP_THREAD_SendNextBuffer(void);
@@ -105,9 +108,14 @@ static uint8_t TmpString[C_SIZE_CMD_STRING];
static uint8_t VcpRxBuffer[sizeof(TL_CmdSerial_t)]; /* Received Data over USB are stored in this buffer */
static uint8_t VcpTxBuffer[sizeof(TL_EvtPacket_t) + 254U]; /* Transmit buffer over USB */
#else
+#if (CFG_FULL_LOW_POWER == 0)
static uint8_t aRxBuffer[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
-char CommandString[C_SIZE_CMD_STRING];
+
+#if (CFG_FULL_LOW_POWER == 0)
+static uint8_t CommandString[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
static __IO uint16_t indexReceiveChar = 0;
static __IO uint16_t CptReceiveCmdFromUser = 0;
@@ -177,11 +185,11 @@ void APP_THREAD_Init( void )
}
/**
- * @brief Trace the error or the warning reported.
- * @param ErrId :
- * @param ErrCode
- * @retval None
- */
+ * @brief Trace the error or the warning reported.
+ * @param ErrId :
+ * @param ErrCode
+ * @retval None
+ */
void APP_THREAD_Error(uint32_t ErrId, uint32_t ErrCode)
{
switch(ErrId)
@@ -195,7 +203,7 @@ void APP_THREAD_Error(uint32_t ErrId, uint32_t ErrCode)
case ERR_THREAD_SET_STATE_CB :
APP_THREAD_TraceError("ERR:ERR_THREAD_SET_STATE_CB ", ErrCode);
break;
- case ERR_THREAD_SET_CHANNEL :
+ case ERR_THREAD_SET_CHANNEL :
APP_THREAD_TraceError("ERR:ERR_THREAD_SET_CHANNEL ", ErrCode);
break;
case ERR_THREAD_SET_PANID :
@@ -271,7 +279,6 @@ void APP_THREAD_Error(uint32_t ErrId, uint32_t ErrCode)
}
}
-
/*************************************************************
*
* LOCAL FUNCTIONS
@@ -902,7 +909,6 @@ void APP_THREAD_RegisterCmdBuffer(TL_CmdPacket_t* p_buffer)
p_thread_otcmdbuffer = p_buffer;
}
-
Thread_OT_Cmd_Request_t* THREAD_Get_OTCmdPayloadBuffer(void)
{
return (Thread_OT_Cmd_Request_t*)p_thread_otcmdbuffer->cmdserial.cmd.payload;
@@ -977,7 +983,7 @@ void TL_THREAD_NotReceived( TL_EvtPacket_t * Notbuffer )
*/
void Pre_OtCmdProcessing(void)
{
- UTIL_SEQ_WaitEvt( EVENT_SYNCHRO_BYPASS_IDLE);
+ UTIL_SEQ_WaitEvt(EVENT_SYNCHRO_BYPASS_IDLE);
}
/**
@@ -1017,6 +1023,7 @@ static void Receive_Notification_From_M0(void)
#if (CFG_USB_INTERFACE_ENABLE != 0)
#else
+#if (CFG_FULL_LOW_POWER == 0)
static void RxCpltCallback(void)
{
/* Filling buffer and wait for '\r' char */
@@ -1035,6 +1042,7 @@ static void RxCpltCallback(void)
/* Once a character has been sent, put back the device in reception mode */
HW_UART_Receive_IT(CFG_CLI_UART, aRxBuffer, 1U, RxCpltCallback);
}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
#if (CFG_USB_INTERFACE_ENABLE != 0)
@@ -1077,6 +1085,7 @@ static uint32_t ProcessCmdString( uint8_t* buf , uint32_t len )
}
#endif/* (CFG_USB_INTERFACE_ENABLE != 0) */
+#if (CFG_FULL_LOW_POWER == 0)
/**
* @brief Process sends receive CLI command to M0.
* @param None
@@ -1096,6 +1105,7 @@ static void Send_CLI_To_M0(void)
TL_CLI_SendCmd();
}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
/**
* @brief Send notification for CLI TL Channel.
@@ -1116,7 +1126,10 @@ static void Send_CLI_Ack_For_OT(void)
*/
void APP_THREAD_Init_UART_CLI(void)
{
+#if (CFG_FULL_LOW_POWER == 0)
UTIL_SEQ_RegTask( 1<<CFG_TASK_SEND_CLI_TO_M0, UTIL_SEQ_RFU,Send_CLI_To_M0);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+
#if (CFG_USB_INTERFACE_ENABLE != 0)
#else
HW_UART_Init(CFG_CLI_UART);
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Inc/app_conf.h
index b04df32a6..286bd8d9e 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Inc/app_conf.h
@@ -25,6 +25,7 @@
/* Includes ------------------------------------------------------------------*/
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Transport Layer
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Inc/stm32_lpm_if.h
index 45db98456..70abecaa9 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Inc/stm32_lpm_if.h
@@ -1,21 +1,21 @@
/* USER CODE BEGIN Header */
/**
- ******************************************************************************
- * File Name : stm32_lpm_if.h
- * Description : Header for stm32_lpm_f.c module (device specific LP management).
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
+******************************************************************************
+* @file stm32_lpm_if.h
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
+******************************************************************************
+* @attention
+*
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+* All rights reserved.</center></h2>
+*
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+*
+******************************************************************************
+*/
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
@@ -65,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Inc/stm32wbxx_hal_conf.h
index 55d1a0e24..ec0f85423 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Inc/stm32wbxx_hal_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Inc/stm32wbxx_hal_conf.h
@@ -220,6 +220,10 @@
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32wbxx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32wbxx_hal_flash.h"
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Inc/utilities_conf.h
index 2c5384639..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Inc/utilities_conf.h
@@ -10,10 +10,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Src/hw_timerserver.c
index 17c9af0a4..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Src/hw_timerserver.c
@@ -4,19 +4,18 @@
* Description : Hardware timerserver source file for STM32WPAN Middleware.
*
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Src/hw_uart.c
index c0fc22d58..775aa241d 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Src/hw_uart.c
@@ -130,7 +130,7 @@
HAL_NVIC_EnableIRQ(CFG_HW_##__USART_BASE__##_TX_DMA_IRQn); \
} while(0)
- /* Variables ------------------------------------------------------------------*/
+/* Variables ------------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
UART_HandleTypeDef huart1 = {0};
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Src/main.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Src/main.c
index 7a144f6d2..9f1faa6ad 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Src/main.c
@@ -91,15 +91,6 @@ int main( void )
* LOCAL FUNCTIONS
*
*************************************************************/
-static void Init_Exti( void )
-{
- /**< Disable all wakeup interrupt on CPU1 except IPCC(36), HSEM(38) */
- LL_EXTI_DisableIT_0_31(~0);
- LL_EXTI_DisableIT_32_63( (~0) & (~(LL_EXTI_LINE_36 | LL_EXTI_LINE_38)) );
-
- return;
-}
-
static void Reset_Device( void )
{
#if ( CFG_HW_RESET_BY_FW == 1 )
@@ -206,7 +197,13 @@ static void Init_RTC( void )
hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
HAL_RTC_Init(&hrtc);
- MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* Disable RTC registers write protection */
+ LL_RTC_DisableWriteProtection(RTC);
+
+ LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER);
+
+ /* Enable RTC registers write protection */
+ LL_RTC_EnableWriteProtection(RTC);
return;
}
@@ -230,6 +227,12 @@ static void SystemClock_Config( void )
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -280,17 +283,14 @@ static void SystemClock_Config( void )
*/
LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
+ return;
+}
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
+static void Init_Exti( void )
+{
+ /**< Disable all wakeup interrupt on CPU1 except IPCC(36), HSEM(38) */
+ LL_EXTI_DisableIT_0_31(~0);
+ LL_EXTI_DisableIT_32_63( (~0) & (~(LL_EXTI_LINE_36 | LL_EXTI_LINE_38)) );
return;
}
@@ -300,21 +300,34 @@ static void SystemClock_Config( void )
* WRAP FUNCTIONS
*
*************************************************************/
-
-void HAL_Delay(uint32_t delay)
+void HAL_Delay(uint32_t Delay)
{
uint32_t tickstart = HAL_GetTick();
- uint32_t wait = delay;
+ uint32_t wait = Delay;
+ /* Add a freq to guarantee minimum wait */
if (wait < HAL_MAX_DELAY)
{
- wait ++;
+ wait += HAL_GetTickFreq();
}
while ((HAL_GetTick() - tickstart) < wait)
{
- UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
}
}
+
/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/STM32_WPAN/App/app_thread.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/STM32_WPAN/App/app_thread.c
index 6f2a3d394..046e2a736 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/STM32_WPAN/App/app_thread.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_Coap_Generic/STM32_WPAN/App/app_thread.c
@@ -65,8 +65,9 @@ static void APP_THREAD_CheckWirelessFirmwareInfo(void);
static void APP_THREAD_DeviceConfig(void);
static void APP_THREAD_StateNotif(uint32_t NotifFlags, void *pContext);
static void APP_THREAD_TraceError(const char * pMess, uint32_t ErrCode);
-
+#if (CFG_FULL_LOW_POWER == 0)
static void Send_CLI_To_M0(void);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
static void Send_CLI_Ack_For_OT(void);
static void HostTxCb( void );
static void Wait_Getting_Ack_From_M0(void);
@@ -75,8 +76,10 @@ static void Receive_Notification_From_M0(void);
#if (CFG_USB_INTERFACE_ENABLE != 0)
static uint32_t ProcessCmdString(uint8_t* buf , uint32_t len);
#else
+#if (CFG_FULL_LOW_POWER == 0)
static void RxCpltCallback(void);
-#endif
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
static void APP_THREAD_CoapSendRequest(otCoapResource* pCoapRessource, otCoapType CoapType, otCoapCode CoapCode, const char *Address, uint8_t* Payload, uint16_t Size);
static void APP_THREAD_DummyReqHandler(void * p_context,
otCoapHeader * pHeader,
@@ -110,9 +113,13 @@ static uint8_t TmpString[C_SIZE_CMD_STRING];
static uint8_t VcpRxBuffer[sizeof(TL_CmdSerial_t)]; /* Received Data over USB are stored in this buffer */
static uint8_t VcpTxBuffer[sizeof(TL_EvtPacket_t) + 254U]; /* Transmit buffer over USB */
#else
+#if (CFG_FULL_LOW_POWER == 0)
static uint8_t aRxBuffer[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+#if (CFG_FULL_LOW_POWER == 0)
static uint8_t CommandString[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
static __IO uint16_t indexReceiveChar = 0;
static __IO uint16_t CptReceiveCmdFromUser = 0;
@@ -198,11 +205,11 @@ void APP_THREAD_Init( void )
}
/**
- * @brief Trace the error or the warning reported.
- * @param ErrId :
- * @param ErrCode
- * @retval None
- */
+ * @brief Trace the error or the warning reported.
+ * @param ErrId :
+ * @param ErrCode
+ * @retval None
+ */
void APP_THREAD_Error(uint32_t ErrId, uint32_t ErrCode)
{
/* USER CODE BEGIN APP_THREAD_Error_1 */
@@ -211,7 +218,7 @@ void APP_THREAD_Error(uint32_t ErrId, uint32_t ErrCode)
switch(ErrId)
{
case ERR_REC_MULTI_MSG_FROM_M0 :
- APP_THREAD_TraceError("ERROR : ERR_REC_MULTI_MSG_FROM_M0 ",ErrCode);
+ APP_THREAD_TraceError("ERROR : ERR_REC_MULTI_MSG_FROM_M0 ", ErrCode);
break;
case ERR_THREAD_SET_STATE_CB :
APP_THREAD_TraceError("ERROR : ERR_THREAD_SET_STATE_CB ",ErrCode);
@@ -657,7 +664,6 @@ static void APP_THREAD_CheckWirelessFirmwareInfo(void)
APP_DBG("**********************************************************");
}
}
-
/* USER CODE BEGIN FD_LOCAL_FUNCTIONS */
/**
* @brief Initialize CoAP write buffer.
@@ -804,47 +810,47 @@ void TL_THREAD_NotReceived( TL_EvtPacket_t * Notbuffer )
}
/**
- * @brief This function is called before sending any ot command to the M0
- * core. The purpose of this function is to be able to check if
- * there are no notifications coming from the M0 core which are
- * pending before sending a new ot command.
- * @param None
- * @retval None
- */
+ * @brief This function is called before sending any ot command to the M0
+ * core. The purpose of this function is to be able to check if
+ * there are no notifications coming from the M0 core which are
+ * pending before sending a new ot command.
+ * @param None
+ * @retval None
+ */
void Pre_OtCmdProcessing(void)
{
- UTIL_SEQ_WaitEvt( EVENT_SYNCHRO_BYPASS_IDLE);
+ UTIL_SEQ_WaitEvt(EVENT_SYNCHRO_BYPASS_IDLE);
}
/**
- * @brief This function waits for getting an acknowledgment from the M0.
- *
- * @param None
- * @retval None
- */
+ * @brief This function waits for getting an acknowledgment from the M0.
+ *
+ * @param None
+ * @retval None
+ */
static void Wait_Getting_Ack_From_M0(void)
{
UTIL_SEQ_WaitEvt(EVENT_ACK_FROM_M0_EVT);
}
/**
- * @brief Receive an acknowledgment from the M0+ core.
- * Each command send by the M4 to the M0 are acknowledged.
- * This function is called under interrupt.
- * @param None
- * @retval None
- */
+ * @brief Receive an acknowledgment from the M0+ core.
+ * Each command send by the M4 to the M0 are acknowledged.
+ * This function is called under interrupt.
+ * @param None
+ * @retval None
+ */
static void Receive_Ack_From_M0(void)
{
UTIL_SEQ_SetEvt(EVENT_ACK_FROM_M0_EVT);
}
/**
- * @brief Receive a notification from the M0+ through the IPCC.
- * This function is called under interrupt.
- * @param None
- * @retval None
- */
+ * @brief Receive a notification from the M0+ through the IPCC.
+ * This function is called under interrupt.
+ * @param None
+ * @retval None
+ */
static void Receive_Notification_From_M0(void)
{
CptReceiveMsgFromM0++;
@@ -853,6 +859,7 @@ static void Receive_Notification_From_M0(void)
#if (CFG_USB_INTERFACE_ENABLE != 0)
#else
+#if (CFG_FULL_LOW_POWER == 0)
static void RxCpltCallback(void)
{
/* Filling buffer and wait for '\r' char */
@@ -871,6 +878,7 @@ static void RxCpltCallback(void)
/* Once a character has been sent, put back the device in reception mode */
HW_UART_Receive_IT(CFG_CLI_UART, aRxBuffer, 1U, RxCpltCallback);
}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
#if (CFG_USB_INTERFACE_ENABLE != 0)
@@ -913,6 +921,7 @@ static uint32_t ProcessCmdString( uint8_t* buf , uint32_t len )
}
#endif/* (CFG_USB_INTERFACE_ENABLE != 0) */
+#if (CFG_FULL_LOW_POWER == 0)
/**
* @brief Process sends receive CLI command to M0.
* @param None
@@ -932,6 +941,7 @@ static void Send_CLI_To_M0(void)
TL_CLI_SendCmd();
}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
/**
* @brief Send notification for CLI TL Channel.
@@ -952,7 +962,10 @@ static void Send_CLI_Ack_For_OT(void)
*/
void APP_THREAD_Init_UART_CLI(void)
{
+#if (CFG_FULL_LOW_POWER == 0)
UTIL_SEQ_RegTask( 1<<CFG_TASK_SEND_CLI_TO_M0, UTIL_SEQ_RFU,Send_CLI_To_M0);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+
#if (CFG_USB_INTERFACE_ENABLE != 0)
#else
HW_UART_Init(CFG_CLI_UART);
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/app_conf.h
index b9ab677a7..b0097b0a7 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/app_conf.h
@@ -25,6 +25,7 @@
/* Includes ------------------------------------------------------------------*/
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Transport Layer
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/stm32_lpm_if.h
index 45db98456..70abecaa9 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/stm32_lpm_if.h
@@ -1,21 +1,21 @@
/* USER CODE BEGIN Header */
/**
- ******************************************************************************
- * File Name : stm32_lpm_if.h
- * Description : Header for stm32_lpm_f.c module (device specific LP management).
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
+******************************************************************************
+* @file stm32_lpm_if.h
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
+******************************************************************************
+* @attention
+*
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+* All rights reserved.</center></h2>
+*
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+*
+******************************************************************************
+*/
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
@@ -65,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/stm32wbxx_hal_conf.h
index 55d1a0e24..ec0f85423 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/stm32wbxx_hal_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/stm32wbxx_hal_conf.h
@@ -220,6 +220,10 @@
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32wbxx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32wbxx_hal_flash.h"
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/utilities_conf.h
index 2c5384639..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Inc/utilities_conf.h
@@ -10,10 +10,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/hw_timerserver.c
index 17c9af0a4..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/hw_timerserver.c
@@ -4,19 +4,18 @@
* Description : Hardware timerserver source file for STM32WPAN Middleware.
*
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/hw_uart.c
index c0fc22d58..775aa241d 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/hw_uart.c
@@ -130,7 +130,7 @@
HAL_NVIC_EnableIRQ(CFG_HW_##__USART_BASE__##_TX_DMA_IRQn); \
} while(0)
- /* Variables ------------------------------------------------------------------*/
+/* Variables ------------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
UART_HandleTypeDef huart1 = {0};
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/main.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/main.c
index 7a144f6d2..9f1faa6ad 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/main.c
@@ -91,15 +91,6 @@ int main( void )
* LOCAL FUNCTIONS
*
*************************************************************/
-static void Init_Exti( void )
-{
- /**< Disable all wakeup interrupt on CPU1 except IPCC(36), HSEM(38) */
- LL_EXTI_DisableIT_0_31(~0);
- LL_EXTI_DisableIT_32_63( (~0) & (~(LL_EXTI_LINE_36 | LL_EXTI_LINE_38)) );
-
- return;
-}
-
static void Reset_Device( void )
{
#if ( CFG_HW_RESET_BY_FW == 1 )
@@ -206,7 +197,13 @@ static void Init_RTC( void )
hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
HAL_RTC_Init(&hrtc);
- MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* Disable RTC registers write protection */
+ LL_RTC_DisableWriteProtection(RTC);
+
+ LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER);
+
+ /* Enable RTC registers write protection */
+ LL_RTC_EnableWriteProtection(RTC);
return;
}
@@ -230,6 +227,12 @@ static void SystemClock_Config( void )
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -280,17 +283,14 @@ static void SystemClock_Config( void )
*/
LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
+ return;
+}
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
+static void Init_Exti( void )
+{
+ /**< Disable all wakeup interrupt on CPU1 except IPCC(36), HSEM(38) */
+ LL_EXTI_DisableIT_0_31(~0);
+ LL_EXTI_DisableIT_32_63( (~0) & (~(LL_EXTI_LINE_36 | LL_EXTI_LINE_38)) );
return;
}
@@ -300,21 +300,34 @@ static void SystemClock_Config( void )
* WRAP FUNCTIONS
*
*************************************************************/
-
-void HAL_Delay(uint32_t delay)
+void HAL_Delay(uint32_t Delay)
{
uint32_t tickstart = HAL_GetTick();
- uint32_t wait = delay;
+ uint32_t wait = Delay;
+ /* Add a freq to guarantee minimum wait */
if (wait < HAL_MAX_DELAY)
{
- wait ++;
+ wait += HAL_GetTickFreq();
}
while ((HAL_GetTick() - tickstart) < wait)
{
- UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
}
}
+
/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/STM32_WPAN/App/app_thread.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/STM32_WPAN/App/app_thread.c
index 50cc520f5..70e92e1bb 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/STM32_WPAN/App/app_thread.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_FTD_Coap_Multicast/STM32_WPAN/App/app_thread.c
@@ -47,8 +47,9 @@ static void APP_THREAD_CheckWirelessFirmwareInfo(void);
static void APP_THREAD_DeviceConfig(void);
static void APP_THREAD_StateNotif(uint32_t NotifFlags, void *pContext);
static void APP_THREAD_TraceError(const char * pMess, uint32_t ErrCode);
-
+#if (CFG_FULL_LOW_POWER == 0)
static void Send_CLI_To_M0(void);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
static void Send_CLI_Ack_For_OT(void);
static void HostTxCb( void );
static void Wait_Getting_Ack_From_M0(void);
@@ -57,8 +58,10 @@ static void Receive_Notification_From_M0(void);
#if (CFG_USB_INTERFACE_ENABLE != 0)
static uint32_t ProcessCmdString(uint8_t* buf , uint32_t len);
#else
+#if (CFG_FULL_LOW_POWER == 0)
static void RxCpltCallback(void);
-#endif
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
static void APP_THREAD_SendCoapMulticastRequest(uint8_t command);
static void APP_THREAD_DummyReqHandler(void * p_context,
otCoapHeader * pHeader,
@@ -75,9 +78,13 @@ static uint8_t TmpString[C_SIZE_CMD_STRING];
static uint8_t VcpRxBuffer[sizeof(TL_CmdSerial_t)]; /* Received Data over USB are stored in this buffer */
static uint8_t VcpTxBuffer[sizeof(TL_EvtPacket_t) + 254U]; /* Transmit buffer over USB */
#else
+#if (CFG_FULL_LOW_POWER == 0)
static uint8_t aRxBuffer[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+#if (CFG_FULL_LOW_POWER == 0)
static uint8_t CommandString[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
static __IO uint16_t indexReceiveChar = 0;
static __IO uint16_t CptReceiveCmdFromUser = 0;
@@ -152,12 +159,12 @@ void APP_THREAD_Error(uint32_t ErrId, uint32_t ErrCode)
switch(ErrId)
{
case ERR_REC_MULTI_MSG_FROM_M0 :
- APP_THREAD_TraceError("ERROR : ERR_REC_MULTI_MSG_FROM_M0 ",ErrCode);
+ APP_THREAD_TraceError("ERROR : ERR_REC_MULTI_MSG_FROM_M0 ", ErrCode);
break;
case ERR_THREAD_SET_STATE_CB :
APP_THREAD_TraceError("ERROR : ERR_THREAD_SET_STATE_CB ",ErrCode);
break;
- case ERR_THREAD_SET_CHANNEL :
+ case ERR_THREAD_SET_CHANNEL :
APP_THREAD_TraceError("ERROR : ERR_THREAD_SET_CHANNEL ",ErrCode);
break;
case ERR_THREAD_SET_PANID :
@@ -495,7 +502,6 @@ void APP_THREAD_RegisterCmdBuffer(TL_CmdPacket_t* p_buffer)
p_thread_otcmdbuffer = p_buffer;
}
-
Thread_OT_Cmd_Request_t* THREAD_Get_OTCmdPayloadBuffer(void)
{
return (Thread_OT_Cmd_Request_t*)p_thread_otcmdbuffer->cmdserial.cmd.payload;
@@ -570,7 +576,7 @@ void TL_THREAD_NotReceived( TL_EvtPacket_t * Notbuffer )
*/
void Pre_OtCmdProcessing(void)
{
- UTIL_SEQ_WaitEvt( EVENT_SYNCHRO_BYPASS_IDLE);
+ UTIL_SEQ_WaitEvt(EVENT_SYNCHRO_BYPASS_IDLE);
}
/**
@@ -610,6 +616,7 @@ static void Receive_Notification_From_M0(void)
#if (CFG_USB_INTERFACE_ENABLE != 0)
#else
+#if (CFG_FULL_LOW_POWER == 0)
static void RxCpltCallback(void)
{
/* Filling buffer and wait for '\r' char */
@@ -628,6 +635,7 @@ static void RxCpltCallback(void)
/* Once a character has been sent, put back the device in reception mode */
HW_UART_Receive_IT(CFG_CLI_UART, aRxBuffer, 1U, RxCpltCallback);
}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
#if (CFG_USB_INTERFACE_ENABLE != 0)
@@ -670,6 +678,7 @@ static uint32_t ProcessCmdString( uint8_t* buf , uint32_t len )
}
#endif/* (CFG_USB_INTERFACE_ENABLE != 0) */
+#if (CFG_FULL_LOW_POWER == 0)
/**
* @brief Process sends receive CLI command to M0.
* @param None
@@ -689,6 +698,7 @@ static void Send_CLI_To_M0(void)
TL_CLI_SendCmd();
}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
/**
* @brief Send notification for CLI TL Channel.
@@ -709,7 +719,10 @@ static void Send_CLI_Ack_For_OT(void)
*/
void APP_THREAD_Init_UART_CLI(void)
{
+#if (CFG_FULL_LOW_POWER == 0)
UTIL_SEQ_RegTask( 1<<CFG_TASK_SEND_CLI_TO_M0, UTIL_SEQ_RFU,Send_CLI_To_M0);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+
#if (CFG_USB_INTERFACE_ENABLE != 0)
#else
HW_UART_Init(CFG_CLI_UART);
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/app_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/app_conf.h
index 1b21d7e2f..86caf1ec6 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/app_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/app_conf.h
@@ -25,6 +25,7 @@
/* Includes ------------------------------------------------------------------*/
#include "hw.h"
#include "hw_conf.h"
+#include "hw_if.h"
/******************************************************************************
* Transport Layer
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/hw_if.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/hw_if.h
new file mode 100644
index 000000000..271a222a9
--- /dev/null
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/hw_if.h
@@ -0,0 +1,250 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file hw_if.h
+ * @author MCD Application Team
+ * @brief Hardware Interface
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef HW_IF_H
+#define HW_IF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Includes ------------------------------------------------------------------*/
+#include "stm32wbxx.h"
+#include "stm32wbxx_ll_exti.h"
+#include "stm32wbxx_ll_system.h"
+#include "stm32wbxx_ll_rcc.h"
+#include "stm32wbxx_ll_ipcc.h"
+#include "stm32wbxx_ll_bus.h"
+#include "stm32wbxx_ll_pwr.h"
+#include "stm32wbxx_ll_cortex.h"
+#include "stm32wbxx_ll_utils.h"
+#include "stm32wbxx_ll_hsem.h"
+#include "stm32wbxx_ll_gpio.h"
+#include "stm32wbxx_ll_rtc.h"
+
+#ifdef USE_STM32WBXX_USB_DONGLE
+#include "stm32wbxx_usb_dongle.h"
+#endif
+#ifdef USE_STM32WBXX_NUCLEO
+#include "stm32wbxx_nucleo.h"
+#endif
+#ifdef USE_X_NUCLEO_EPD
+#include "x_nucleo_epd.h"
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+ /******************************************************************************
+ * HW UART
+ ******************************************************************************/
+ typedef enum
+ {
+ hw_uart1,
+ hw_uart2,
+ hw_lpuart1,
+ } hw_uart_id_t;
+
+ typedef enum
+ {
+ hw_uart_ok,
+ hw_uart_error,
+ hw_uart_busy,
+ hw_uart_to,
+ } hw_status_t;
+
+ void HW_UART_Init(hw_uart_id_t hw_uart_id);
+ void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
+ hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
+ hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
+ void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+ void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
+
+ /******************************************************************************
+ * HW TimerServer
+ ******************************************************************************/
+ /* Exported types ------------------------------------------------------------*/
+ /**
+ * This setting is used when standby mode is supported.
+ * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does
+ * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured
+ * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized.
+ */
+ typedef enum
+ {
+ hw_ts_InitMode_Full,
+ hw_ts_InitMode_Limited,
+ } HW_TS_InitMode_t;
+
+ /**
+ * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However,
+ * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start()
+ *
+ * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs.
+ */
+ typedef enum
+ {
+ hw_ts_SingleShot,
+ hw_ts_Repeated
+ } HW_TS_Mode_t;
+
+ /**
+ * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed
+ * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a
+ * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased
+ */
+ typedef enum
+ {
+ hw_ts_Successful,
+ hw_ts_Failed,
+ }HW_TS_ReturnStatus_t;
+
+ typedef void (*HW_TS_pTimerCb_t)(void);
+
+ /**
+ * @brief Initialize the timer server
+ * This API shall be called by the application before any timer is requested to the timer server. It
+ * configures the RTC module to be connected to the LSI input clock.
+ *
+ * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the
+ * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested
+ * @param hrtc: RTC Handle
+ * @retval None
+ */
+ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc);
+
+ /**
+ * @brief Interface to create a virtual timer
+ * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it
+ * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the
+ * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler
+ * which module is concerned. In return, the user gets a timer ID to handle it.
+ *
+ * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow
+ * identification of the requester
+ * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete)
+ * @param TimerMode: Mode of the virtual timer (Single shot or repeated)
+ * @param pTimerCallBack: Callback when the virtual timer expires
+ * @retval HW_TS_ReturnStatus_t: Return whether the creation is sucessfull or not
+ */
+ HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t *pTimerId, HW_TS_Mode_t TimerMode, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Stop a virtual timer
+ * This API may be used to stop a running timer. A timer which is stopped is move to the pending state.
+ * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed.
+ * Nothing is done when it is called to stop a timer which has been already stopped
+ *
+ * @param TimerID: Id of the timer to stop
+ * @retval None
+ */
+ void HW_TS_Stop(uint8_t TimerID);
+
+ /**
+ * @brief Start a virtual timer
+ * This API shall be used to start a timer. The timeout value is specified and may be different each time.
+ * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may
+ * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always
+ * stay in the running state. When the timer expires, it will be restarted with the same timeout value.
+ * This API shall not be called on a running timer.
+ *
+ * @param TimerID: The ID Id of the timer to start
+ * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000)
+ * @retval None
+ */
+ void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks);
+
+ /**
+ * @brief Delete a virtual timer from the list
+ * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from
+ * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the
+ * creation of a new timer if required and may get a different timer id
+ *
+ * @param TimerID: The ID of the timer to remove from the list
+ * @retval None
+ */
+ void HW_TS_Delete(uint8_t TimerID);
+
+ /**
+ * @brief Schedule the timer list on the timer interrupt handler
+ * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes
+ * care of clearing all status flag required in the RTC and EXTI peripherals
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_Wakeup_Handler(void);
+
+ /**
+ * @brief Return the number of ticks to count before the interrupt
+ * This API returns the number of ticks left to be counted before an interrupt is generated by the
+ * Timer Server. This API may be used by the application for power management optimization. When the system
+ * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running
+ * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the
+ * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time
+ * versus time in low power mode is implementation specific
+ * When the timer is disabled (No timer in the list), it returns 0xFFFF
+ *
+ * @param None
+ * @retval The number of ticks left to count
+ */
+ uint16_t HW_TS_RTC_ReadLeftTicksToCount(void);
+
+ /**
+ * @brief Notify the application that a registered timer has expired
+ * This API shall be implemented by the user application.
+ * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt
+ * context. The application may implement an Operating System to change the context priority where the timer
+ * callback may be handled. This API provides the module ID to identify which module is concerned and to allow
+ * sending the information to the correct task
+ *
+ * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created
+ * @param TimerID: The TimerID of the expired timer
+ * @param pTimerCallBack: The Callback associated with the timer when it has been created
+ * @retval None
+ */
+ void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack);
+
+ /**
+ * @brief Notify the application that the wakeupcounter has been updated
+ * This API should be implemented by the user application
+ * This API notifies the application that the counter has been updated. This is expected to be used along
+ * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the
+ * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification
+ * provides a way to the application to solve that race condition to reevaluate the counter value before
+ * entering low power mode
+ *
+ * @param None
+ * @retval None
+ */
+ void HW_TS_RTC_CountUpdated_AppNot(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*HW_IF_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/stm32_lpm_if.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/stm32_lpm_if.h
index 45db98456..70abecaa9 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/stm32_lpm_if.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/stm32_lpm_if.h
@@ -1,21 +1,21 @@
/* USER CODE BEGIN Header */
/**
- ******************************************************************************
- * File Name : stm32_lpm_if.h
- * Description : Header for stm32_lpm_f.c module (device specific LP management).
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
+******************************************************************************
+* @file stm32_lpm_if.h
+* @brief Header for stm32_lpm_if.c module (device specific LP management)
+******************************************************************************
+* @attention
+*
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+* All rights reserved.</center></h2>
+*
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
+*
+******************************************************************************
+*/
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
@@ -65,7 +65,7 @@ void PWR_ExitStopMode( void );
void PWR_EnterSleepMode( void );
/**
- * @brief Enters Low Power Sleep Mode
+ * @brief Exits Low Power Sleep Mode
* @note ARM exits the function when waking up
* @param none
* @retval none
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/stm32wbxx_hal_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/stm32wbxx_hal_conf.h
index 55d1a0e24..ec0f85423 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/stm32wbxx_hal_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/stm32wbxx_hal_conf.h
@@ -220,6 +220,10 @@
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32wbxx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+ #include "stm32wbxx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32wbxx_hal_flash.h"
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/utilities_conf.h b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/utilities_conf.h
index 2c5384639..4dde3509a 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/utilities_conf.h
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Inc/utilities_conf.h
@@ -10,10 +10,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/hw_timerserver.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/hw_timerserver.c
index 17c9af0a4..c842ba55e 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/hw_timerserver.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/hw_timerserver.c
@@ -4,19 +4,18 @@
* Description : Hardware timerserver source file for STM32WPAN Middleware.
*
******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
- *
- ******************************************************************************
- */
-
+ * @attention
+ *
+ * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
+ * All rights reserved.</center></h2>
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
/* Includes ------------------------------------------------------------------*/
#include "app_common.h"
@@ -81,7 +80,6 @@ static uint8_t AsynchPrescalerUserConfig;
static uint16_t SynchPrescalerUserConfig;
static volatile uint16_t MaxWakeupTimerSetup;
-
/* Global variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void RestartWakeupCounter(uint16_t Value);
@@ -475,7 +473,6 @@ static void RescheduleTimerList(void)
return ;
}
-
/* Public functions ----------------------------------------------------------*/
/**
@@ -499,7 +496,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
__disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/
#endif
- /* Disable the write protection for RTC registers */
+/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
/**
@@ -535,7 +532,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
else
{
#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1)
@@ -545,7 +542,7 @@ void HW_TS_RTC_Wakeup_Handler(void)
/* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
- }
+ }
HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback);
}
@@ -597,7 +594,7 @@ void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef *hrtc)
*/
phrtc = hrtc;
- /* Disable the write protection for RTC registers */
+ /* Disable the write protection for RTC registers */
__HAL_RTC_WRITEPROTECTION_DISABLE( phrtc );
SET_BIT(RTC->CR, RTC_CR_BYPSHAD);
@@ -893,5 +890,4 @@ __weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS
return;
}
-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/hw_uart.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/hw_uart.c
index c0fc22d58..775aa241d 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/hw_uart.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/hw_uart.c
@@ -130,7 +130,7 @@
HAL_NVIC_EnableIRQ(CFG_HW_##__USART_BASE__##_TX_DMA_IRQn); \
} while(0)
- /* Variables ------------------------------------------------------------------*/
+/* Variables ------------------------------------------------------------------*/
#if (CFG_HW_USART1_ENABLED == 1)
UART_HandleTypeDef huart1 = {0};
#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1)
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/main.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/main.c
index 27df26e38..0c29cc158 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/main.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/main.c
@@ -91,15 +91,6 @@ int main( void )
* LOCAL FUNCTIONS
*
*************************************************************/
-static void Init_Exti( void )
-{
- /**< Disable all wakeup interrupt on CPU1 except IPCC(36), HSEM(38) */
- LL_EXTI_DisableIT_0_31(~0);
- LL_EXTI_DisableIT_32_63( (~0) & (~(LL_EXTI_LINE_36 | LL_EXTI_LINE_38)) );
-
- return;
-}
-
static void Reset_Device( void )
{
#if ( CFG_HW_RESET_BY_FW == 1 )
@@ -206,7 +197,13 @@ static void Init_RTC( void )
hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER;
HAL_RTC_Init(&hrtc);
- MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER);
+ /* Disable RTC registers write protection */
+ LL_RTC_DisableWriteProtection(RTC);
+
+ LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER);
+
+ /* Enable RTC registers write protection */
+ LL_RTC_EnableWriteProtection(RTC);
return;
}
@@ -230,6 +227,12 @@ static void SystemClock_Config( void )
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
RCC_CRSInitTypeDef RCC_CRSInitStruct = { 0 };
+ /**
+ * This prevents the CPU2 to disable the HSI48 oscillator when
+ * it does not use anymore the RNG IP
+ */
+ LL_HSEM_1StepLock( HSEM, 5 );
+
LL_RCC_HSI48_Enable();
while(!LL_RCC_HSI48_IsReady());
@@ -280,17 +283,14 @@ static void SystemClock_Config( void )
*/
LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
- /**
- * Switch OFF LSI
- */
- LL_RCC_LSI1_Disable();
+ return;
+}
- /**
- * Set RNG on HSI48
- */
- LL_RCC_HSI48_Enable();
- while(!LL_RCC_HSI48_IsReady());
- LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
+static void Init_Exti( void )
+{
+ /**< Disable all wakeup interrupt on CPU1 except IPCC(36), HSEM(38) */
+ LL_EXTI_DisableIT_0_31(~0);
+ LL_EXTI_DisableIT_32_63( (~0) & (~(LL_EXTI_LINE_36 | LL_EXTI_LINE_38)) );
return;
}
@@ -300,21 +300,33 @@ static void SystemClock_Config( void )
* WRAP FUNCTIONS
*
*************************************************************/
-
-/**
- * This function is empty to avoid starting the SysTick Timer
- */
-HAL_StatusTypeDef HAL_InitTick( uint32_t TickPriority )
+void HAL_Delay(uint32_t Delay)
{
- return (HAL_OK);
-}
+ uint32_t tickstart = HAL_GetTick();
+ uint32_t wait = Delay;
-/**
- * This function is empty as the SysTick Timer is not used
- */
-void HAL_Delay(__IO uint32_t Delay)
-{
- return;
+ /* Add a freq to guarantee minimum wait */
+ if (wait < HAL_MAX_DELAY)
+ {
+ wait += HAL_GetTickFreq();
+ }
+
+ while ((HAL_GetTick() - tickstart) < wait)
+ {
+ /************************************************************************************
+ * ENTER SLEEP MODE
+ ***********************************************************************************/
+ LL_LPM_EnableSleep( ); /**< Clear SLEEPDEEP bit of Cortex System Control Register */
+
+ /**
+ * This option is used to ensure that store operations are completed
+ */
+ #if defined ( __CC_ARM)
+ __force_stores();
+ #endif
+
+ __WFI( );
+ }
}
/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/stm32_lpm_if.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/stm32_lpm_if.c
index b0018ac58..f024b61e3 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/stm32_lpm_if.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/Core/Src/stm32_lpm_if.c
@@ -9,10 +9,10 @@
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
- * This software component is licensed by ST under Ultimate Liberty license
- * SLA0044, the "License"; You may not use this file except in compliance with
- * the License. You may obtain a copy of the License at:
- * www.st.com/SLA0044
+ * This software component is licensed by ST under BSD 3-Clause license,
+ * the "License"; You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ * opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
@@ -214,6 +214,9 @@ void PWR_ExitStopMode( void )
void PWR_EnterSleepMode( void )
{
/* USER CODE BEGIN PWR_EnterSleepMode */
+
+ HAL_SuspendTick();
+
/************************************************************************************
* ENTER SLEEP MODE
***********************************************************************************/
@@ -240,6 +243,8 @@ void PWR_ExitSleepMode( void )
{
/* USER CODE BEGIN PWR_ExitSleepMode */
+ HAL_ResumeTick();
+
/* USER CODE END PWR_ExitSleepMode */
}
@@ -258,6 +263,7 @@ static void Switch_On_HSI( void )
LL_RCC_HSI_Enable( );
while(!LL_RCC_HSI_IsReady( ));
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_HSI );
+ LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSI);
}
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/STM32_WPAN/App/app_thread.c b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/STM32_WPAN/App/app_thread.c
index 7efbb7412..bd2ecb3f1 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/STM32_WPAN/App/app_thread.c
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/Thread/Thread_SED_Coap_Multicast/STM32_WPAN/App/app_thread.c
@@ -50,7 +50,9 @@ static void APP_THREAD_CheckWirelessFirmwareInfo(void);
static void APP_THREAD_DeviceConfig(void);
static void APP_THREAD_StateNotif(uint32_t NotifFlags, void *pContext);
static void APP_THREAD_TraceError(const char * pMess, uint32_t ErrCode);
+#if (CFG_FULL_LOW_POWER == 0)
static void Send_CLI_To_M0(void);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
static void Send_CLI_Ack_For_OT(void);
static void HostTxCb( void );
static void Wait_Getting_Ack_From_M0(void);
@@ -59,8 +61,10 @@ static void Receive_Notification_From_M0(void);
#if (CFG_USB_INTERFACE_ENABLE != 0)
static uint32_t ProcessCmdString(uint8_t* buf , uint32_t len);
#else
+#if (CFG_FULL_LOW_POWER == 0)
static void RxCpltCallback(void);
-#endif
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
static void APP_THREAD_SendCoapMsg(void);
static void APP_THREAD_SendCoapMulticastRequest(uint8_t command);
static void APP_THREAD_DummyReqHandler(void * p_context,
@@ -82,9 +86,13 @@ static uint8_t TmpString[C_SIZE_CMD_STRING];
static uint8_t VcpRxBuffer[sizeof(TL_CmdSerial_t)]; /* Received Data over USB are stored in this buffer */
static uint8_t VcpTxBuffer[sizeof(TL_EvtPacket_t) + 254U]; /* Transmit buffer over USB */
#else
+#if (CFG_FULL_LOW_POWER == 0)
static uint8_t aRxBuffer[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
+#if (CFG_FULL_LOW_POWER == 0)
static uint8_t CommandString[C_SIZE_CMD_STRING];
+#endif /* (CFG_FULL_LOW_POWER == 0) */
static __IO uint16_t indexReceiveChar = 0;
static __IO uint16_t CptReceiveCmdFromUser = 0;
@@ -179,12 +187,12 @@ void APP_THREAD_Error(uint32_t ErrId, uint32_t ErrCode)
switch(ErrId)
{
case ERR_REC_MULTI_MSG_FROM_M0 :
- APP_THREAD_TraceError("ERROR : ERR_REC_MULTI_MSG_FROM_M0 ",ErrCode);
+ APP_THREAD_TraceError("ERROR : ERR_REC_MULTI_MSG_FROM_M0 ", ErrCode);
break;
case ERR_THREAD_SET_STATE_CB :
APP_THREAD_TraceError("ERROR : ERR_THREAD_SET_STATE_CB ",ErrCode);
break;
- case ERR_THREAD_SET_CHANNEL :
+ case ERR_THREAD_SET_CHANNEL :
APP_THREAD_TraceError("ERROR : ERR_THREAD_SET_CHANNEL ",ErrCode);
break;
case ERR_THREAD_SET_PANID :
@@ -268,7 +276,6 @@ static void APP_THREAD_DummyReqHandler(void * p_context,
{
}
-
/*************************************************************
*
* LOCAL FUNCTIONS
@@ -640,7 +647,6 @@ void APP_THREAD_RegisterCmdBuffer(TL_CmdPacket_t* p_buffer)
p_thread_otcmdbuffer = p_buffer;
}
-
Thread_OT_Cmd_Request_t* THREAD_Get_OTCmdPayloadBuffer(void)
{
return (Thread_OT_Cmd_Request_t*)p_thread_otcmdbuffer->cmdserial.cmd.payload;
@@ -717,7 +723,7 @@ void Pre_OtCmdProcessing(void)
{
#ifdef CFG_LPM_CORE
#else
- UTIL_SEQ_WaitEvt( EVENT_SYNCHRO_BYPASS_IDLE);
+ UTIL_SEQ_WaitEvt(EVENT_SYNCHRO_BYPASS_IDLE);
#endif /* CFG_LPM_CORE */
}
@@ -758,6 +764,7 @@ static void Receive_Notification_From_M0(void)
#if (CFG_USB_INTERFACE_ENABLE != 0)
#else
+#if (CFG_FULL_LOW_POWER == 0)
static void RxCpltCallback(void)
{
/* Filling buffer and wait for '\r' char */
@@ -776,6 +783,7 @@ static void RxCpltCallback(void)
/* Once a character has been sent, put back the device in reception mode */
HW_UART_Receive_IT(CFG_CLI_UART, aRxBuffer, 1U, RxCpltCallback);
}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
#endif /* (CFG_USB_INTERFACE_ENABLE != 0) */
#if (CFG_USB_INTERFACE_ENABLE != 0)
@@ -818,6 +826,7 @@ static uint32_t ProcessCmdString( uint8_t* buf , uint32_t len )
}
#endif/* (CFG_USB_INTERFACE_ENABLE != 0) */
+#if (CFG_FULL_LOW_POWER == 0)
/**
* @brief Process sends receive CLI command to M0.
* @param None
@@ -837,6 +846,7 @@ static void Send_CLI_To_M0(void)
TL_CLI_SendCmd();
}
+#endif /* (CFG_FULL_LOW_POWER == 0) */
/**
* @brief Send notification for CLI TL Channel.
@@ -857,7 +867,10 @@ static void Send_CLI_Ack_For_OT(void)
*/
void APP_THREAD_Init_UART_CLI(void)
{
+#if (CFG_FULL_LOW_POWER == 0)
UTIL_SEQ_RegTask( 1<<CFG_TASK_SEND_CLI_TO_M0, UTIL_SEQ_RFU,Send_CLI_To_M0);
+#endif /* (CFG_FULL_LOW_POWER == 0) */
+
#if (CFG_USB_INTERFACE_ENABLE != 0)
#else
HW_UART_Init(CFG_CLI_UART);
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/USB_Device/DFU_Standalone/SW4STM32/DFU_Standalone/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.USBDongle/Applications/USB_Device/DFU_Standalone/SW4STM32/DFU_Standalone/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/USB_Device/DFU_Standalone/SW4STM32/DFU_Standalone/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/USB_Device/DFU_Standalone/SW4STM32/DFU_Standalone/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/USB_Device/DFU_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.USBDongle/Applications/USB_Device/DFU_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/USB_Device/DFU_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/USB_Device/DFU_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/USB_Device/HID_Standalone/SW4STM32/HID_Standalone/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.USBDongle/Applications/USB_Device/HID_Standalone/SW4STM32/HID_Standalone/stm32wb55xx_flash_cm4.ld
index ae3874eb4..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/USB_Device/HID_Standalone/SW4STM32/HID_Standalone/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/USB_Device/HID_Standalone/SW4STM32/HID_Standalone/stm32wb55xx_flash_cm4.ld
@@ -11,7 +11,7 @@
**
** Environment : System Workbench for MCU
**
-** Distribution: The file is distributed “as is,� without any warranty
+** Distribution: The file is distributed “as is,” without any warranty
** of any kind.
**
*****************************************************************************
@@ -49,8 +49,8 @@ ENTRY(Reset_Handler)
/* Highest address of the user mode stack */
_estack = 0x20030000; /* end of RAM */
/* Generate a link error if heap and stack don't fit into RAM */
-_Min_Heap_Size = 0x1000; /* required amount of heap */
-_Min_Stack_Size = 0x1000; /* required amount of stack */
+_Min_Heap_Size = 0x400; /* required amount of heap */
+_Min_Stack_Size = 0x1000; /* required amount of stack */
/* Specify the memory areas */
MEMORY
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Applications/USB_Device/HID_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.USBDongle/Applications/USB_Device/HID_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Applications/USB_Device/HID_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Applications/USB_Device/HID_Standalone/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Examples/BSP/SW4STM32/P-NUCLEO-WB55.USBDongle/stm32wb55xx_flash_cm4.ld b/Projects/P-NUCLEO-WB55.USBDongle/Examples/BSP/SW4STM32/P-NUCLEO-WB55.USBDongle/stm32wb55xx_flash_cm4.ld
index 1679a357b..7ac9a391f 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Examples/BSP/SW4STM32/P-NUCLEO-WB55.USBDongle/stm32wb55xx_flash_cm4.ld
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Examples/BSP/SW4STM32/P-NUCLEO-WB55.USBDongle/stm32wb55xx_flash_cm4.ld
@@ -181,7 +181,7 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
- MB_MEM2 : { *(MB_MEM2) } >RAM_SHARED
+ MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Examples/BSP/SW4STM32/startup_stm32wb55xx_cm4.s b/Projects/P-NUCLEO-WB55.USBDongle/Examples/BSP/SW4STM32/startup_stm32wb55xx_cm4.s
index 023c1b016..f79eec117 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Examples/BSP/SW4STM32/startup_stm32wb55xx_cm4.s
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Examples/BSP/SW4STM32/startup_stm32wb55xx_cm4.s
@@ -44,21 +44,29 @@ defined in linker script */
.word _sbss
/* end address for the .bss section. defined in linker script */
.word _ebss
-
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- ldr r0, =_estack
- mov sp, r0 /* set stack pointer */
-
-/* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- ldr r1, =_edata
- ldr r2, =_sidata
+/* start address for the .MB_MEM2 section. defined in linker script */
+.word _sMB_MEM2
+/* end address for the .MB_MEM2 section. defined in linker script */
+.word _eMB_MEM2
+
+/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
+.macro INIT_BSS start, end
+ ldr r0, =\start
+ ldr r1, =\end
movs r3, #0
- b LoopCopyDataInit
+ bl LoopFillZerobss
+.endm
+
+/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
+.macro INIT_DATA start, end, src
+ ldr r0, =\start
+ ldr r1, =\end
+ ldr r2, =\src
+ movs r3, #0
+ bl LoopCopyDataInit
+.endm
+.section .text.data_initializers
CopyDataInit:
ldr r4, [r2, r3]
str r4, [r0, r3]
@@ -67,21 +75,31 @@ CopyDataInit:
LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
- bcc CopyDataInit
-
-/* Zero fill the bss segment. */
- ldr r2, =_sbss
- ldr r4, =_ebss
- movs r3, #0
- b LoopFillZerobss
+ bcc CopyDataInit
+ bx lr
FillZerobss:
- str r3, [r2]
- adds r2, r2, #4
+ str r3, [r0]
+ adds r0, r0, #4
LoopFillZerobss:
- cmp r2, r4
+ cmp r0, r1
bcc FillZerobss
+ bx lr
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ INIT_DATA _sdata, _edata, _sidata
+
+/* Zero fill the bss segments. */
+ INIT_BSS _sbss, _ebss
+ INIT_BSS _sMB_MEM2, _eMB_MEM2
/* Call the clock system intitialization function.*/
bl SystemInit
diff --git a/Projects/P-NUCLEO-WB55.USBDongle/Release_Notes.html b/Projects/P-NUCLEO-WB55.USBDongle/Release_Notes.html
index 40d92ed59..890acd056 100644
--- a/Projects/P-NUCLEO-WB55.USBDongle/Release_Notes.html
+++ b/Projects/P-NUCLEO-WB55.USBDongle/Release_Notes.html
@@ -46,17 +46,28 @@
<div class="col-sm-12 col-lg-8">
<h1 id="update-history">Update History</h1>
<div class="collapse">
-<input type="checkbox" id="collapse-section3" checked aria-hidden="true"> <label for="collapse-section3" aria-hidden="true">V1.2.0 / 26-June-2019</label>
+<input type="checkbox" id="collapse-section4" checked aria-hidden="true"> <label for="collapse-section4" aria-hidden="true">V1.3.0 / 11-September-2019</label>
<div>
<h2 id="main-changes">Main Changes</h2>
<h3 id="maintenance">Maintenance</h3>
+<ul>
+<li>Ensure compatibility with STM32CubeMX V5.4.</li>
+<li>Correct Ticket 65791 - .bin generated by SW4STM32 is too big</li>
+</ul>
+</div>
+</div>
+<div class="collapse">
+<input type="checkbox" id="collapse-section3" aria-hidden="true"> <label for="collapse-section3" aria-hidden="true">V1.2.0 / 26-June-2019</label>
+<div>
+<h2 id="main-changes-1">Main Changes</h2>
+<h3 id="maintenance-1">Maintenance</h3>
<p>Adapt applications to new utility directory tree.</p>
</div>
</div>
<div class="collapse">
<input type="checkbox" id="collapse-section2" aria-hidden="true"> <label for="collapse-section2" aria-hidden="true">V1.1.0 / 05-April-2019</label>
<div>
-<h2 id="main-changes-1">Main Changes</h2>
+<h2 id="main-changes-2">Main Changes</h2>
<h3 id="remove-binaries-addition-of-new-examples">Remove binaries, Addition of new examples</h3>
<p>Change directory name to reflect board RPN: <a href="https://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/stm32-nucleo-expansion-boards/p-nucleo-wb55.html">P-NUCLEO-WB55</a></p>
<p>Add USB Device applications:</p>
@@ -69,7 +80,7 @@
<div class="collapse">
<input type="checkbox" id="collapse-section1" aria-hidden="true"> <label for="collapse-section1" aria-hidden="true">V1.0.0 / 06-February-2019</label>
<div>
-<h2 id="main-changes-2">Main Changes</h2>
+<h2 id="main-changes-3">Main Changes</h2>
<h3 id="first-release">First release</h3>
<p>First official release.</p>
</div>
diff --git a/Projects/STM32CubeProjectsList.html b/Projects/STM32CubeProjectsList.html
index dd675e23d..3374a993f 100644
--- a/Projects/STM32CubeProjectsList.html
+++ b/Projects/STM32CubeProjectsList.html
@@ -2097,8 +2097,8 @@ the STM32WBxx UART HAL and LL API, the LL API being used for performance improve
<td>12</td>
</tr>
<tr align=center>
- <td style="background-repeat: no-repeat;background-position: right center;background-color: #39A9DC;color: #FFF;" rowspan=46><p id="Applications">Applications</p></td>
- <td align=left rowspan=18><p id="BLE">BLE</p></td>
+ <td style="background-repeat: no-repeat;background-position: right center;background-color: #39A9DC;color: #FFF;" rowspan=53><p id="Applications">Applications</p></td>
+ <td align=left rowspan=19><p id="BLE">BLE</p></td>
<td align=left><p id="BLE_Beacon">BLE_Beacon</p></td>
<td align=left>
How to advertize 3 types of beacon ( tlm, uuid, url ).
@@ -2152,7 +2152,7 @@ How to use the Heart Rate profile as specified by the BLE SIG.
How to use the Heart Rate profile as specified by the BLE SIG.
</td>
<td>-</td>
- <td><font size="5" color=green>X</font></td>
+ <td><font size="5" color=green>CubeMx</font></td>
</tr>
<tr align=center>
<td align=left><p id="BLE_HeartRate_ota">BLE_HeartRate_ota</p></td>
@@ -2178,6 +2178,14 @@ How to use the Human Interface Device profile as specified by the BLE SIG.
<td><font size="5" color=green>X</font></td>
</tr>
<tr align=center>
+ <td align=left><p id="BLE_MultiAppAt">BLE_MultiAppAt</p></td>
+ <td align=left>
+How to use multi BLE applications using a network processor architecture.
+</td>
+ <td>-</td>
+ <td><font size="5" color=green>X</font></td>
+ </tr>
+ <tr align=center>
<td align=left><p id="BLE_Ota">BLE_Ota</p></td>
<td align=left>
OTA implementation to download a new image into the user flash.
@@ -2360,7 +2368,7 @@ How to use MAC 802.15.4 Association and Data exchange.
<td><font size="5" color=green>X</font></td>
</tr>
<tr align=center>
- <td align=left rowspan=8><p id="Thread">Thread</p></td>
+ <td align=left rowspan=11><p id="Thread">Thread</p></td>
<td align=left><p id="Thread_Cli_Cmd">Thread_Cli_Cmd</p></td>
<td align=left>
How to control the Thread stack via Cli commands.
@@ -2374,7 +2382,7 @@ How to control the Thread stack via Cli commands.
How to transfer large blocks of data through the CoAP messaging protocol.
</td>
<td><font size="5" color=green>X</font></td>
- <td><font size="5" color=green>X</font></td>
+ <td><font size="5" color=green>CubeMx</font></td>
</tr>
<tr align=center>
<td align=left><p id="Thread_Coap_Generic">Thread_Coap_Generic</p></td>
@@ -2385,12 +2393,20 @@ How to build Thread application based on Coap messages.
<td><font size="5" color=green>CubeMx</font></td>
</tr>
<tr align=center>
+ <td align=left><p id="Thread_Coap_Generic_Ota">Thread_Coap_Generic_Ota</p></td>
+ <td align=left>
+How to build Thread application based on Coap messages.
+</td>
+ <td>-</td>
+ <td><font size="5" color=green>X</font></td>
+ </tr>
+ <tr align=center>
<td align=left><p id="Thread_Coap_MultiBoard">Thread_Coap_MultiBoard</p></td>
<td align=left>
How to use Coap for sending message to multiple boards.
</td>
<td>-</td>
- <td><font size="5" color=green>X</font></td>
+ <td><font size="5" color=green>CubeMx</font></td>
</tr>
<tr align=center>
<td align=left><p id="Thread_Commissioning">Thread_Commissioning</p></td>
@@ -2398,7 +2414,7 @@ How to use Coap for sending message to multiple boards.
How to use Thread commissioning process.
</td>
<td>-</td>
- <td><font size="5" color=green>X</font></td>
+ <td><font size="5" color=green>CubeMx</font></td>
</tr>
<tr align=center>
<td align=left><p id="Thread_FTD_Coap_Multicast">Thread_FTD_Coap_Multicast</p></td>
@@ -2406,6 +2422,22 @@ How to use Thread commissioning process.
How to exchange multicast Coap messages.
</td>
<td><font size="5" color=green>X</font></td>
+ <td><font size="5" color=green>CubeMx</font></td>
+ </tr>
+ <tr align=center>
+ <td align=left><p id="Thread_Ota">Thread_Ota</p></td>
+ <td align=left>
+How to update Over The Air (OTA) FW application and Copro Wireless binary using Thread.
+</td>
+ <td>-</td>
+ <td><font size="5" color=green>X</font></td>
+ </tr>
+ <tr align=center>
+ <td align=left><p id="Thread_Ota_Server">Thread_Ota_Server</p></td>
+ <td align=left>
+How to update Over The Air (OTA) FW application and Copro Wireless binary using Thread.
+</td>
+ <td>-</td>
<td><font size="5" color=green>X</font></td>
</tr>
<tr align=center>
@@ -2414,7 +2446,7 @@ How to exchange multicast Coap messages.
How to exchange a Coap message using the Thread protocol.
</td>
<td>-</td>
- <td><font size="5" color=green>X</font></td>
+ <td><font size="5" color=green>CubeMx</font></td>
</tr>
<tr align=center>
<td align=left><p id="Thread_SED_Coap_Multicast">Thread_SED_Coap_Multicast</p></td>
@@ -2422,7 +2454,7 @@ How to exchange a Coap message using the Thread protocol.
How to exchange a Coap message using the Thread protocol.
</td>
<td><font size="5" color=green>X</font></td>
- <td><font size="5" color=green>X</font></td>
+ <td><font size="5" color=green>CubeMx</font></td>
</tr>
<tr align=center>
<td align=left rowspan=1><p id="TouchSensing">TouchSensing</p></td>
@@ -2467,10 +2499,35 @@ This application shows how to use the USB device application based on the Mass S
<td>-</td>
<td><font size="5" color=green>CubeMx</font></td>
</tr>
+ <tr align=center>
+ <td align=left rowspan=3><p id="Zigbee">Zigbee</p></td>
+ <td align=left><p id="Zigbee_OnOff_Coord">Zigbee_OnOff_Coord</p></td>
+ <td align=left>
+How to use OnOff cluster on a Centralized Zigbee network with device acting as coordinator.
+</td>
+ <td>-</td>
+ <td><font size="5" color=green>X</font></td>
+ </tr>
+ <tr align=center>
+ <td align=left><p id="Zigbee_OnOff_Distrib">Zigbee_OnOff_Distrib</p></td>
+ <td align=left>
+How to use OnOff cluster on a Distributed Zigbee network.
+</td>
+ <td>-</td>
+ <td><font size="5" color=green>X</font></td>
+ </tr>
+ <tr align=center>
+ <td align=left><p id="Zigbee_OnOff_Router">Zigbee_OnOff_Router</p></td>
+ <td align=left>
+How to use OnOff cluster on a Centralized Zigbee network with device acting as router.
+</td>
+ <td>-</td>
+ <td><font size="5" color=green>X</font></td>
+ </tr>
<tr style="background-repeat: no-repeat;background-position: right center;background-color: #39A9DC;color: #FFF;" align=center>
- <td colspan="3"><b>Total number of applications: 57</b></td>
+ <td colspan="3"><b>Total number of applications: 64</b></td>
<td>13</td>
- <td>44</td>
+ <td>51</td>
</tr>
<tr align=center>
<td style="background-repeat: no-repeat;background-position: right center;background-color: #39A9DC;color: #FFF;" rowspan=2><p id="Demonstrations">Demonstrations</p></td>
@@ -2489,9 +2546,9 @@ Cortex-M devices that can be plugged on a STM32 Nucleo board.
<td>1</td>
</tr>
<tr style="background-repeat: no-repeat;background-position: right center;background-color: #39A9DC;color: #FFF;" align=center>
- <td colspan="4"><b>Total number of projects: 264</b></td>
+ <td colspan="4"><b>Total number of projects: 271</b></td>
<td>14</td>
- <td>250</td>
+ <td>257</td>
</tr>
</table>
</body>
diff --git a/Projects/STM32WB_Copro_Wireless_Binaries/Release_Notes.html b/Projects/STM32WB_Copro_Wireless_Binaries/Release_Notes.html
index b84a36260..cc2ba5e4f 100644
--- a/Projects/STM32WB_Copro_Wireless_Binaries/Release_Notes.html
+++ b/Projects/STM32WB_Copro_Wireless_Binaries/Release_Notes.html
@@ -72,6 +72,11 @@
<li>Dedicated firmware binary to be used with STM32CubeMonitor-RF application.</li>
<li>Refer to STM32CubeMonitor-RF User Manual (UM2288) to get application details.</li>
</ul></li>
+<li>stm32wb5x_zigbee_full_fw.bin
+<ul>
+<li>Zigbee Compliant Platform certified</li>
+<li>Supports Full Function Device (FFD)</li>
+</ul></li>
<li>stm32wb5x_FUS_fw.bin
<ul>
<li>Firmware Upgrade Services (FUS)</li>
@@ -130,18 +135,156 @@
<div class="col-sm-12 col-lg-8">
<h1 id="update-history">Update History</h1>
<div class="collapse">
-<input type="checkbox" id="collapse-section4" checked aria-hidden="true"> <label for="collapse-section4" aria-hidden="true">V1.2.0 / 3rd-July-2019</label>
+<input type="checkbox" id="collapse-section5" checked aria-hidden="true"> <label for="collapse-section5" aria-hidden="false">V1.3.0 / 09-September-2019</label>
<div>
<h2 id="main-changes">Main Changes</h2>
<p><strong>Associated changes in Wireless Coprocessor Binary</strong>:</p>
<ul>
-<li>BLE Link layer : fix issues with pairing
+<li>ZIGBEE :
+<ul>
+<li>Introducing support of Zigbee FFD (Full Function Device)</li>
+</ul></li>
+<li>BLE :
<ul>
+<li>Erase Flash while RF activity</li>
+<li>BLE Initialization execution time reduced</li>
+</ul></li>
+<li>THREAD / MAC 802.15.4 :
+<ul>
+<li>New version of 802.15.4 Low Level Driver</li>
+</ul></li>
+</ul>
+<p><strong>Firmware Upgrade Services Binary Table</strong>: Provides Install address for the targeted binary to be used in “STEP 5” of flash procedure.</p>
+<table>
+<colgroup>
+<col style="width: 41%" />
+<col style="width: 15%" />
+<col style="width: 15%" />
+<col style="width: 15%" />
+<col style="width: 7%" />
+<col style="width: 4%" />
+</colgroup>
+<thead>
+<tr class="header">
+<th>Wireless Coprocessor Binary</th>
+<th>STM32WB5xxG(1M)</th>
+<th>STM32WB5xxE(512K)</th>
+<th>STM32WB5xxC(256K)</th>
+<th>Version</th>
+<th>Date</th>
+</tr>
+</thead>
+<tbody>
+<tr class="odd">
+<td>stm32wb5x_FUS_fw.bin</td>
+<td>0x080<strong>EC</strong>000</td>
+<td>0x080<strong>7A</strong>000</td>
+<td>0x080<strong>3A</strong>000</td>
+<td>v1.0.2</td>
+<td>04/10/2019</td>
+</tr>
+</tbody>
+</table>
+<p><strong>Wireless Coprocessor Binary Table</strong>: Provides Install address for the targeted binary to be used in “STEP 6” of flash procedure.</p>
+<table>
+<colgroup>
+<col style="width: 41%" />
+<col style="width: 15%" />
+<col style="width: 15%" />
+<col style="width: 15%" />
+<col style="width: 7%" />
+<col style="width: 4%" />
+</colgroup>
+<thead>
+<tr class="header">
+<th>Wireless Coprocessor Binary</th>
+<th>STM32WB5xxG(1M)</th>
+<th>STM32WB5xxE(512K)</th>
+<th>STM32WB5xxC(256K)</th>
+<th>Version</th>
+<th>Date</th>
+</tr>
+</thead>
+<tbody>
+<tr class="odd">
+<td>stm32wb5x_BLE_HCILayer_fw.bin</td>
+<td>0x080DC000</td>
+<td>0x08068000</td>
+<td>0x08028000</td>
+<td><strong>v1.3.0</strong></td>
+<td>09/09/2019</td>
+</tr>
+<tr class="even">
+<td>stm32wb5x_BLE_Stack_fw.bin</td>
+<td>0x080CB000</td>
+<td>0x08057000</td>
+<td>0x08017000</td>
+<td><strong>v1.3.1</strong></td>
+<td>09/24/2019</td>
+</tr>
+<tr class="odd">
+<td>stm32wb5x_BLE_Thread_fw.bin</td>
+<td>0x08078000</td>
+<td>NA</td>
+<td>NA</td>
+<td><strong>v1.3.1</strong></td>
+<td>09/24/2019</td>
+</tr>
+<tr class="even">
+<td>stm32wb5x_Mac_802_15_4_fw.bin</td>
+<td>0x080E5000</td>
+<td>0x08071000</td>
+<td>0x08031000</td>
+<td><strong>v1.3.0</strong></td>
+<td>09/09/2019</td>
+</tr>
+<tr class="odd">
+<td>stm32wb5x_rfmonitor_phy802_15_4_fw.bin</td>
+<td>0x080EC000</td>
+<td>0x08078000</td>
+<td>0x08038000</td>
+<td>v1.1.0</td>
+<td>04/05/2019</td>
+</tr>
+<tr class="even">
+<td>stm32wb5x_Thread_FTD_fw.bin</td>
+<td>0x0809F000</td>
+<td>0x0802B000</td>
+<td>NA</td>
+<td><strong>v1.3.1</strong></td>
+<td>09/24/2019</td>
+</tr>
+<tr class="odd">
+<td>stm32wb5x_Thread_MTD_fw.bin</td>
+<td>0x080B5000</td>
+<td>0x08041000</td>
+<td>NA</td>
+<td><strong>v1.3.1</strong></td>
+<td>09/24/2019</td>
+</tr>
+<tr class="even">
+<td>stm32wb5x_zigbee_full_fw.bin</td>
+<td>0x0808D000 </td>
+<td>0x08019000 </td>
+<td>NA</td>
+<td><strong>v1.3.0</strong></td>
+<td>09/09/2019</td>
+</tr>
+</tbody>
+</table>
+</div>
+</div>
+<div class="collapse">
+<input type="checkbox" id="collapse-section4" aria-hidden="true"> <label for="collapse-section4" aria-hidden="true">V1.2.0 / 3rd-July-2019</label>
+<div>
+<h2 id="main-changes-1">Main Changes</h2>
+<p><strong>Associated changes in Wireless Coprocessor Binary</strong>:</p>
+<ul>
+<li>BLE Link layer : fix issues with pairing</li>
<li>Reception of 2 pairing complete events after failing numeric comparison</li>
<li>Slave_security_req collision with connection update made unstable security</li>
<li>No timeout event after slave req pairing if link key was deleted @ slave side</li>
-<li>Blackout time should be back to 5sec after bonding OK</li>
-</ul></li>
+<li><p>Blackout time should be back to 5sec after bonding OK</p></li>
<li>BLE GATT : improvement of GATT Read event management for certain values of attribute length and ATT_MTU</li>
<li>BLE GATT : Add ACI_GATT_INDICATION_EXT_EVENT</li>
<li>THREAD / MAC 802.15.4 :
@@ -247,7 +390,7 @@
<div class="collapse">
<input type="checkbox" id="collapse-section3" aria-hidden="true"> <label for="collapse-section3" aria-hidden="true">V1.1.1 / 10-May-2019</label>
<div>
-<h2 id="main-changes-1">Main Changes</h2>
+<h2 id="main-changes-2">Main Changes</h2>
<p><strong>Associated changes in Firmware Upgrade Services (FUS)</strong>:</p>
<ul>
<li>Add support for STM32WB5xxE(512K) and STM32WB5xxC(256K) devices.</li>
@@ -353,7 +496,7 @@
<div class="collapse">
<input type="checkbox" id="collapse-section2" aria-hidden="true"> <label for="collapse-section2" aria-hidden="true">V1.1.0 / 05-April-2019</label>
<div>
-<h2 id="main-changes-2">Main Changes</h2>
+<h2 id="main-changes-3">Main Changes</h2>
<p><strong>Introduction of the Firmware Upgrade Services (FUS)</strong>:</p>
<ul>
<li>This feature is embedded inside stm32wb5x_FUS_fw.bin.</li>
@@ -462,7 +605,7 @@
<div class="collapse">
<input type="checkbox" id="collapse-section1" aria-hidden="true"> <label for="collapse-section1" aria-hidden="true">V1.0.0 / 06-February-2019</label>
<div>
-<h2 id="main-changes-3">Main Changes</h2>
+<h2 id="main-changes-4">Main Changes</h2>
<h3 id="first-release">First release</h3>
<p>First official release.</p>
<p><strong>Binary Install Address and version</strong> : Provides Install address for the targeted binary to be used in “STEP 6” of flash procedure.</p>
diff --git a/Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_BLE_HCILayer_fw.bin b/Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_BLE_HCILayer_fw.bin
index 2ad17a37b..8e74b3928 100644
--- a/Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_BLE_HCILayer_fw.bin
+++ b/Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_BLE_HCILayer_fw.bin
Binary files differ
diff --git a/Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_BLE_Stack_fw.bin b/Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_BLE_Stack_fw.bin
index 35c2db33a..6bdb5705e 100644
--- a/Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_BLE_Stack_fw.bin
+++ b/Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_BLE_Stack_fw.bin
Binary files differ
diff --git a/Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_BLE_Thread_fw.bin b/Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_BLE_Thread_fw.bin
index 0c4107ad3..5a1d71289 100644
--- a/Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_BLE_Thread_fw.bin
+++ b/Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_BLE_Thread_fw.bin
Binary files differ
diff --git a/Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_Mac_802_15_4_fw.bin b/Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_Mac_802_15_4_fw.bin
index 9da51a573..bc82de3df 100644
--- a/Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_Mac_802_15_4_fw.bin
+++ b/Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_Mac_802_15_4_fw.bin
Binary files differ
diff --git a/Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_Thread_FTD_fw.bin b/Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_Thread_FTD_fw.bin
index c8da00fb2..a4541a329 100644
--- a/Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_Thread_FTD_fw.bin
+++ b/Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_Thread_FTD_fw.bin
Binary files differ
diff --git a/Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_Thread_MTD_fw.bin b/Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_Thread_MTD_fw.bin
index 43814bafd..a916296e3 100644
--- a/Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_Thread_MTD_fw.bin
+++ b/Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_Thread_MTD_fw.bin
Binary files differ
diff --git a/Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_zigbee_full_fw.bin b/Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_zigbee_full_fw.bin
new file mode 100644
index 000000000..6cbe8326d
--- /dev/null
+++ b/Projects/STM32WB_Copro_Wireless_Binaries/stm32wb5x_zigbee_full_fw.bin
Binary files differ
diff --git a/Release_Notes.html b/Release_Notes.html
index cd9098670..0a512670d 100644
--- a/Release_Notes.html
+++ b/Release_Notes.html
@@ -68,9 +68,328 @@
<div class="col-sm-12 col-lg-8">
<h1 id="update-history">Update History</h1>
<div class="collapse">
-<input type="checkbox" id="collapse-section4" checked aria-hidden="true"> <label for="collapse-section4" aria-hidden="true">V1.2.0 / 3rd-July-2019</label>
+<input type="checkbox" id="collapse-section5" checked aria-hidden="true"> <label for="collapse-section5" aria-hidden="true">V1.3.0 / 11-September-2019</label>
<div>
<h2 id="main-changes">Main Changes</h2>
+<h3 id="introduction-of-zigbee-support">Introduction of ZIGBEE support</h3>
+<p>STM32WB ecosystem keeps growing, now with the introduction of ZigBee protocol support as <strong>certified compliant platform</strong>, running on <strong>certified 802.15.4 2015 LLD MAC and PHY</strong>.</p>
+<p>The wireless stack is based on <strong>ZigBee pro 2017, R22 release version</strong> in order to propose a ZigBee 3.0 solution. First ON/OFF cluster is coming in this STM32CubeWB Firmware Package delivery release.</p>
+<p><em>More clusters with examples will be introduced with further STM32CubeWB Firmware Package release.</em></p>
+<ul>
+<li><strong>Zigbee Compliant Platform certified</strong> and 3 associated applications linked to OnOff cluster:
+<ul>
+<li>Zigbee_OnOff_Coord: <em>How to use OnOff cluster on a Centralized Zigbee network with device acting as coordinator.</em></li>
+<li>Zigbee_OnOff_Distrib: <em>How to use OnOff cluster on a Distributed Zigbee network.</em></li>
+<li>Zigbee_OnOff_Router: <em>How to use OnOff cluster on a Centralized Zigbee network with device acting as router.</em></li>
+<li>They are added under “Projects\P-NUCLEO-WB55.Nucleo\Applications\Zigbee”</li>
+</ul></li>
+<li><strong>Certified 802.15.4 MAC</strong> and compliancy with Zigbee.</li>
+<li>Thread secured FOTA for both wireless stack and user application. Supports 3 new applications:
+<ul>
+<li>Thread_Ota</li>
+<li>Thread_Ota_Server</li>
+<li>Thread_Coap_Generic_Ota</li>
+</ul></li>
+<li>BLE stack and application improvements:
+<ul>
+<li><strong>Support Flash erase during RF activity from Application side</strong></li>
+<li>Support new Application : BLE_MultiAppAt - STM32WB Network processor via AT Instruction<br />
+</li>
+</ul></li>
+<li>Integration of BLE Mesh library v1.10.004</li>
+<li>Maintenance release for CMSIS, HAL and LL drivers.</li>
+</ul>
+<h2 id="contents">Contents</h2>
+<h3 id="projects">Projects</h3>
+<p>The STM32CubeWB Firmware package comes with a rich set of examples running on STMicroelectronics boards, organized by board and provided with preconfigured projects for the main supported toolchains.</p>
+<p>The exhaustive list of projects and their short description is provided in this table (<a href="Projects/STM32CubeProjectsList.html">STM32CubeProjectsList.html</a>).</p>
+<ul>
+<li><strong>P-NUCLEO-WB55.Nucleo</strong> (<a href="Projects/P-NUCLEO-WB55.Nucleo/Release_Notes.html">release notes</a>) (<a href="Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/readme.txt">default application</a>)</li>
+<li><strong>P-NUCLEO-WB55.USBDongle</strong> (<a href="Projects/P-NUCLEO-WB55.USBDongle/Release_Notes.html">release notes</a>) (<a href="Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/readme.txt">default application</a>)</li>
+</ul>
+<h3 id="components">Components</h3>
+<table>
+<caption>Firmware Upgrade Services Binary</caption>
+<thead>
+<tr class="header">
+<th style="text-align: left;">Name</th>
+<th style="text-align: left;">Version</th>
+<th>License</th>
+<th>Release note</th>
+</tr>
+</thead>
+<tbody>
+<tr class="odd">
+<td style="text-align: left;">stm32wb5x_FUS_fw.bin</td>
+<td style="text-align: left;">V1.0.2</td>
+<td><a href="http://www.st.com/SLA0044">SLA0044 (binary release)</a></td>
+<td><a href="Projects/STM32WB_Copro_Wireless_Binaries/Release_Notes.html">release note</a></td>
+</tr>
+</tbody>
+</table>
+<table>
+<caption>Coprocessor Wireless Binaries</caption>
+<thead>
+<tr class="header">
+<th style="text-align: left;">Name</th>
+<th style="text-align: left;">Version</th>
+<th>License</th>
+<th>Release note</th>
+</tr>
+</thead>
+<tbody>
+<tr class="odd">
+<td style="text-align: left;">stm32wb5x_BLE_Stack_fw.bin</td>
+<td style="text-align: left;"><strong>v1.3.0</strong></td>
+<td><a href="http://www.st.com/SLA0044">SLA0044 (binary release)</a></td>
+<td><a href="Projects/STM32WB_Copro_Wireless_Binaries/Release_Notes.html">release note</a></td>
+</tr>
+<tr class="even">
+<td style="text-align: left;">stm32wb5x_BLE_HCILayer_fw.bin</td>
+<td style="text-align: left;"><strong>v1.3.0</strong></td>
+<td><a href="http://www.st.com/SLA0044">SLA0044 (binary release)</a></td>
+<td><a href="Projects/STM32WB_Copro_Wireless_Binaries/Release_Notes.html">release note</a></td>
+</tr>
+<tr class="odd">
+<td style="text-align: left;">stm32wb5x_Thread_FTD_fw.bin</td>
+<td style="text-align: left;"><strong>v1.3.0</strong></td>
+<td><a href="http://www.st.com/SLA0044">SLA0044 (binary release)</a></td>
+<td><a href="Projects/STM32WB_Copro_Wireless_Binaries/Release_Notes.html">release note</a></td>
+</tr>
+<tr class="even">
+<td style="text-align: left;">stm32wb5x_Thread_MTD_fw.bin</td>
+<td style="text-align: left;"><strong>v1.3.0</strong></td>
+<td><a href="http://www.st.com/SLA0044">SLA0044 (binary release)</a></td>
+<td><a href="Projects/STM32WB_Copro_Wireless_Binaries/Release_Notes.html">release note</a></td>
+</tr>
+<tr class="odd">
+<td style="text-align: left;">stm32wb5x_BLE_Thread_fw.bin</td>
+<td style="text-align: left;"><strong>v1.3.0</strong></td>
+<td><a href="http://www.st.com/SLA0044">SLA0044 (binary release)</a></td>
+<td><a href="Projects/STM32WB_Copro_Wireless_Binaries/Release_Notes.html">release note</a></td>
+</tr>
+<tr class="even">
+<td style="text-align: left;">stm32wb5x_Mac_802_15_4_fw.bin</td>
+<td style="text-align: left;"><strong>v1.3.0</strong></td>
+<td><a href="http://www.st.com/SLA0044">SLA0044 (binary release)</a></td>
+<td><a href="Projects/STM32WB_Copro_Wireless_Binaries/Release_Notes.html">release note</a></td>
+</tr>
+<tr class="odd">
+<td style="text-align: left;">stm32wb5x_rfmonitor_phy802_15_4_fw.bin</td>
+<td style="text-align: left;">v1.1.0</td>
+<td><a href="http://www.st.com/SLA0044">SLA0044 (binary release)</a></td>
+<td><a href="Projects/STM32WB_Copro_Wireless_Binaries/Release_Notes.html">release note</a></td>
+</tr>
+</tbody>
+</table>
+<table>
+<caption>Drivers</caption>
+<thead>
+<tr class="header">
+<th style="text-align: left;">Name</th>
+<th>Version</th>
+<th>License</th>
+<th>Release note</th>
+</tr>
+</thead>
+<tbody>
+<tr class="odd">
+<td style="text-align: left;">Cortex-M CMSIS</td>
+<td>V5.4.0</td>
+<td><a href="https://opensource.org/licenses/BSD-3-Clause">BSD 3-Clause</a></td>
+<td><a href="Drivers/CMSIS/index.html">release notes</a></td>
+</tr>
+<tr class="even">
+<td style="text-align: left;">STM32WB CMSIS</td>
+<td><strong>V1.3.0</strong></td>
+<td><a href="https://opensource.org/licenses/BSD-3-Clause">BSD 3-Clause</a></td>
+<td><a href="Drivers/CMSIS/Device/ST/STM32WBxx/Release_Notes.html">release notes</a></td>
+</tr>
+<tr class="odd">
+<td style="text-align: left;">STM32WBxx_HAL_Driver</td>
+<td><strong>V1.3.0</strong></td>
+<td><a href="https://opensource.org/licenses/BSD-3-Clause">BSD 3-Clause</a></td>
+<td><a href="Drivers/STM32WBxx_HAL_Driver/Release_Notes.html">release notes</a></td>
+</tr>
+<tr class="even">
+<td style="text-align: left;">P-NUCLEO-WB55.USBDongle</td>
+<td>V1.0.0</td>
+<td><a href="https://opensource.org/licenses/BSD-3-Clause">BSD 3-Clause</a></td>
+<td><a href="Drivers/BSP/P-NUCLEO-WB55.USBDongle/Release_Notes.html">release notes</a></td>
+</tr>
+<tr class="odd">
+<td style="text-align: left;">P-NUCLEO-WB55.Nucleo</td>
+<td>V1.0.0</td>
+<td><a href="https://opensource.org/licenses/BSD-3-Clause">BSD 3-Clause</a></td>
+<td><a href="Drivers/BSP/P-NUCLEO-WB55.Nucleo/Release_Notes.html">release notes</a></td>
+</tr>
+<tr class="even">
+<td style="text-align: left;">BSP Adafruit Shield</td>
+<td>V3.0.3</td>
+<td><a href="https://opensource.org/licenses/BSD-3-Clause">BSD 3-Clause</a></td>
+<td><a href="Drivers/BSP/Adafruit_Shield/Release_Notes.html">release notes</a></td>
+</tr>
+<tr class="odd">
+<td style="text-align: left;">BSP Common</td>
+<td>V5.0.0</td>
+<td><a href="https://opensource.org/licenses/BSD-3-Clause">BSD 3-Clause</a></td>
+<td><a href="Drivers/BSP/Components/Common/Release_Notes.html">release notes</a></td>
+</tr>
+<tr class="even">
+<td style="text-align: left;">BSP st7735</td>
+<td>V1.1.2</td>
+<td><a href="https://opensource.org/licenses/BSD-3-Clause">BSD 3-Clause</a></td>
+<td><a href="Drivers/BSP/Components/st7735/Release_Notes.html">release notes</a></td>
+</tr>
+</tbody>
+</table>
+<table>
+<caption>Middleware</caption>
+<thead>
+<tr class="header">
+<th style="text-align: left;">Name</th>
+<th style="text-align: left;">Version</th>
+<th>License</th>
+<th>Release note</th>
+</tr>
+</thead>
+<tbody>
+<tr class="odd">
+<td style="text-align: left;">STM32 USB Device Library</td>
+<td style="text-align: left;">V2.5.3</td>
+<td><a href="http://www.st.com/SLA0044">SLA0044</a></td>
+<td><a href="Middlewares/ST/STM32_USB_Device_Library/Release_Notes.html">release notes</a></td>
+</tr>
+<tr class="even">
+<td style="text-align: left;">STM32 WPAN</td>
+<td style="text-align: left;"><strong>V1.3.0</strong></td>
+<td><a href="http://www.st.com/SLA0044">SLA0044</a></td>
+<td><a href="Middlewares/ST/STM32_WPAN/Release_Notes.html">release notes</a></td>
+</tr>
+<tr class="odd">
+<td style="text-align: left;">FatFS</td>
+<td style="text-align: left;">R0.12c</td>
+<td><a href="Middlewares/Third_Party/FatFs/doc/en/appnote.html#license">FatFs License</a></td>
+<td><a href="Middlewares/Third_Party/FatFs/doc/updates.txt">release notes</a></td>
+</tr>
+<tr class="even">
+<td style="text-align: left;"></td>
+<td style="text-align: left;">ST modified 20190329</td>
+<td><a href="http://www.st.com/SLA0044">SLA0044</a></td>
+<td><a href="Middlewares/Third_Party/FatFs/src/st_readme.txt">release notes ST</a></td>
+</tr>
+<tr class="odd">
+<td style="text-align: left;">FreeRTOS</td>
+<td style="text-align: left;">V10.0.1</td>
+<td><a href="Middlewares/Third_Party/FreeRTOS/License/license.txt">MIT</a></td>
+<td><a href="Middlewares/Third_Party/FreeRTOS/Source/readme.txt">release notes</a></td>
+</tr>
+<tr class="even">
+<td style="text-align: left;"></td>
+<td style="text-align: left;">ST modified 20190329</td>
+<td><a href="http://www.st.com/SLA0044">SLA0044</a></td>
+<td><a href="Middlewares/Third_Party/FreeRTOS/Source/st_readme.txt">release notes ST</a></td>
+</tr>
+<tr class="odd">
+<td style="text-align: left;">STM32_TouchSensing_Library</td>
+<td style="text-align: left;">V2.2.0</td>
+<td><a href="http://www.st.com/SLA0044">SLA0044</a></td>
+<td><a href="Middlewares/ST/STM32_TouchSensing_Library/Release_Notes.html">release notes</a></td>
+</tr>
+</tbody>
+</table>
+<table>
+<caption>Utilities</caption>
+<thead>
+<tr class="header">
+<th style="text-align: left;">Name</th>
+<th style="text-align: left;">Version</th>
+<th>License</th>
+<th>Release note</th>
+</tr>
+</thead>
+<tbody>
+<tr class="odd">
+<td style="text-align: left;">CPU</td>
+<td style="text-align: left;">V1.1.0</td>
+<td><a href="https://opensource.org/licenses/BSD-3-Clause">BSD 3-Clause</a></td>
+<td><a href="Utilities/CPU/Release_Notes.html">release notes</a></td>
+</tr>
+<tr class="even">
+<td style="text-align: left;">Fonts</td>
+<td style="text-align: left;">V1.0.0</td>
+<td><a href="https://opensource.org/licenses/BSD-3-Clause">BSD 3-Clause</a></td>
+<td><a href="Utilities/Fonts/Release_Notes.html">release notes</a></td>
+</tr>
+<tr class="odd">
+<td style="text-align: left;">Log</td>
+<td style="text-align: left;">V1.0.0</td>
+<td><a href="https://opensource.org/licenses/BSD-3-Clause">BSD 3-Clause</a></td>
+<td><a href="Utilities/Log/Release_Notes.html">release notes</a></td>
+</tr>
+<tr class="even">
+<td style="text-align: left;">conf</td>
+<td style="text-align: left;">V1.0.0</td>
+<td><a href="https://opensource.org/licenses/BSD-3-Clause">BSD 3-Clause</a></td>
+<td><a href="Utilities/conf/Release_Notes.html">release notes</a></td>
+</tr>
+<tr class="odd">
+<td style="text-align: left;">lpm</td>
+<td style="text-align: left;">V1.1.0</td>
+<td><a href="https://opensource.org/licenses/BSD-3-Clause">BSD 3-Clause</a></td>
+<td><a href="Utilities/lpm/tiny_lpm/Release_Notes.html">release notes</a></td>
+</tr>
+<tr class="even">
+<td style="text-align: left;">sequencer</td>
+<td style="text-align: left;">V1.2.0</td>
+<td><a href="https://opensource.org/licenses/BSD-3-Clause">BSD 3-Clause</a></td>
+<td><a href="Utilities/sequencer/Release_Notes.html">release notes</a></td>
+</tr>
+</tbody>
+</table>
+<h2 id="known-limitations">Known Limitations</h2>
+<ul>
+<li>With the ability to change the Coprocessor Wireless Binaries Over The Air (OTA), it is possible to switch from one binary to another. Only, the following case is not possible due to available memory size:
+<ul>
+<li>Moving from stm32wb5x_BLE_Stack_fw.bin to stm32wb5x_BLE_Thread_fw.bin</li>
+</ul></li>
+<li>Mac 802-15-4 applications are provided with EWARM IDE. MDK-ARM and SW4STM32 IDE are planned for a future release.</li>
+<li>BLE_MeshLightingDemo application is not functionnal under Linux platform.</li>
+</ul>
+<h2 id="development-toolchains-and-compilers">Development Toolchains and Compilers</h2>
+<ul>
+<li>IAR Embedded Workbench for ARM (EWARM) toolchain V8.20.2 + ST-Link</li>
+<li>RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.25 + ST-Link</li>
+<li>System Workbench for STM32 (SW4STM32) toolchain V2.7 + ST-Link</li>
+</ul>
+<h2 id="supported-devices-and-boards">Supported Devices and boards</h2>
+<ul>
+<li>STM32WB55xx and STM32WB50xx devices</li>
+<li>P-NUCLEO-WB55 kit composed of P-NUCLEO-WB55.Nucleo and P-NUCLEO-WB55.USBDongle</li>
+</ul>
+<h2 id="dependencies">Dependencies</h2>
+<p>This software release is compatible with:</p>
+<ul>
+<li>STM32WB_Copro_Wireless_Binaries available under Projects/STM32WB_Copro_Wireless_Binaries</li>
+</ul>
+<p>Several applications (BLE (Bluetooth low energy), Thread or Mac 802-15-4) are available under:</p>
+<ul>
+<li>Projects/P-NUCLEO-WB55.Nucleo/Applications</li>
+<li>Projects/P-NUCLEO-WB55.USBDongle/Applications</li>
+</ul>
+<p>All of them are provided in source code and some of them are also available in binary format directly for ready to use usage:</p>
+<ul>
+<li>Projects/P-NUCLEO-WB55.Nucleo/Applications/xxx/Binary/<projectName>.hex</li>
+<li>Projects/P-NUCLEO-WB55.USBDongle/Applications/xxx/Binary/<projectName>.hex</li>
+</ul>
+<p>Each of them require a different coprocessor binary in order to behave correctly. This is documented inside each readme.txt of those applications.</p>
+<p>You can refer to the <a href="Projects/STM32WB_Copro_Wireless_Binaries/Release_Notes.html">release note</a> of the binaries for a detailed explanation on how to use and how to flash them.</p>
+</div>
+</div>
+<div class="collapse">
+<input type="checkbox" id="collapse-section4" aria-hidden="true"> <label for="collapse-section4" aria-hidden="true">V1.2.0 / 3rd-July-2019</label>
+<div>
+<h2 id="main-changes-1">Main Changes</h2>
<h3 id="stm32wb50xx-introduction-and-new-features-addition">STM32WB50xx introduction and new features addition</h3>
<p>This release introduces the following feature:</p>
<ul>
@@ -97,15 +416,15 @@
<li>Mesh Library V1.10.000</li>
</ul></li>
</ul>
-<h2 id="contents">Contents</h2>
-<h3 id="projects">Projects</h3>
+<h2 id="contents-1">Contents</h2>
+<h3 id="projects-1">Projects</h3>
<p>The STM32CubeWB Firmware package comes with a rich set of examples running on STMicroelectronics boards, organized by board and provided with preconfigured projects for the main supported toolchains.</p>
<p>The exhaustive list of projects and their short description is provided in this table (<a href="Projects/STM32CubeProjectsList.html">STM32CubeProjectsList.html</a>).</p>
<ul>
<li><strong>P-NUCLEO-WB55.Nucleo</strong> (<a href="Projects/P-NUCLEO-WB55.Nucleo/Release_Notes.html">release notes</a>) (<a href="Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/readme.txt">default application</a>)</li>
<li><strong>P-NUCLEO-WB55.USBDongle</strong> (<a href="Projects/P-NUCLEO-WB55.USBDongle/Release_Notes.html">release notes</a>) (<a href="Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/readme.txt">default application</a>)</li>
</ul>
-<h3 id="components">Components</h3>
+<h3 id="components-1">Components</h3>
<table>
<caption>Firmware Upgrade Services Binary</caption>
<thead>
@@ -345,27 +664,28 @@
</tr>
</tbody>
</table>
-<h2 id="known-limitations">Known Limitations</h2>
+<h2 id="known-limitations-1">Known Limitations</h2>
<ul>
<li>With the ability to change the Coprocessor Wireless Binaries Over The Air (OTA), it is possible to switch from one binary to another. Only, the following case is not possible due to available memory size:
<ul>
<li>Moving from stm32wb5x_BLE_Stack_fw.bin to stm32wb5x_BLE_Thread_fw.bin</li>
</ul></li>
-<li>Mac 802-15-4 applications are provided with EWARM IDE. MDK-ARM and SW4STM32 IDE are planned for a future release.</li>
+<li>Mac 802-15-4 and Zigbee applications are provided only with EWARM IDE. MDK-ARM and SW4STM32 IDE are planned for a future release.</li>
<li>BLE_MeshLightingDemo application is not functionnal under Linux platform.</li>
+<li>Zigbee supports only OnOff cluster.</li>
</ul>
-<h2 id="development-toolchains-and-compilers">Development Toolchains and Compilers</h2>
+<h2 id="development-toolchains-and-compilers-1">Development Toolchains and Compilers</h2>
<ul>
<li>IAR Embedded Workbench for ARM (EWARM) toolchain V8.20.2 + ST-Link</li>
<li>RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.25 + ST-Link</li>
<li>System Workbench for STM32 (SW4STM32) toolchain V2.7 + ST-Link</li>
</ul>
-<h2 id="supported-devices-and-boards">Supported Devices and boards</h2>
+<h2 id="supported-devices-and-boards-1">Supported Devices and boards</h2>
<ul>
<li>STM32WB55xx and STM32WB50xx devices</li>
<li>P-NUCLEO-WB55 kit composed of P-NUCLEO-WB55.Nucleo and P-NUCLEO-WB55.USBDongle</li>
</ul>
-<h2 id="dependencies">Dependencies</h2>
+<h2 id="dependencies-1">Dependencies</h2>
<p>This software release is compatible with:</p>
<ul>
<li>STM32WB_Copro_Wireless_Binaries available under Projects/STM32WB_Copro_Wireless_Binaries</li>
@@ -387,7 +707,7 @@
<div class="collapse">
<input type="checkbox" id="collapse-section3" aria-hidden="true"> <label for="collapse-section3" aria-hidden="true">V1.1.1 / 17-May-2019</label>
<div>
-<h2 id="main-changes-1">Main Changes</h2>
+<h2 id="main-changes-2">Main Changes</h2>
<h3 id="patch-release-for-fus-v1.0.2wireless-coprocessor-binary-bug-fix-and-ble-mesh-library-improvements">Patch release for FUS V1.0.2,Wireless Coprocessor Binary bug fix and BLE Mesh Library improvements</h3>
<p>This release introduces the following feature:</p>
<ul>
@@ -413,8 +733,8 @@
</ul></li>
</ul></li>
</ul>
-<h2 id="contents-1">Contents</h2>
-<h3 id="projects-1">Projects</h3>
+<h2 id="contents-2">Contents</h2>
+<h3 id="projects-2">Projects</h3>
<p>The STM32CubeWB Firmware package comes with a rich set of examples running on STMicroelectronics boards, organized by board and provided with preconfigured projects for the main supported toolchains.</p>
<p>The exhaustive list of projects and their short description is provided in this table (<a href="Projects/STM32CubeProjectsList.html">STM32CubeProjectsList.html</a>).</p>
<ul>
@@ -422,7 +742,7 @@
<li><strong>P-NUCLEO-WB55.USBDongle</strong> (<a href="Projects/P-NUCLEO-WB55.USBDongle/Release_Notes.html">release notes</a>) (<a href="Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/readme.txt">default application</a>)</li>
</ul>
<p><em>Please note that the path of the example projects have been change to P-NUCLEO-WB55.Nucleo and P-NUCLEO-WB55.USBDongle.</em></p>
-<h3 id="components-1">Components</h3>
+<h3 id="components-2">Components</h3>
<table>
<caption>Firmware Upgrade Services Binary</caption>
<thead>
@@ -644,7 +964,7 @@
</tr>
</tbody>
</table>
-<h2 id="known-limitations-1">Known Limitations</h2>
+<h2 id="known-limitations-2">Known Limitations</h2>
<ul>
<li>With the ability to change the Coprocessor Wireless Binaries Over The Air (OTA), it is possible to switch from one binary to another. Only, the following case is not possible due to available memory size:
<ul>
@@ -662,18 +982,18 @@
<li>SW4STM32 project is compiled without optimisation. (With optimised size compilation, the virtual com port required for the application is not functionnal)</li>
</ul></li>
</ul>
-<h2 id="development-toolchains-and-compilers-1">Development Toolchains and Compilers</h2>
+<h2 id="development-toolchains-and-compilers-2">Development Toolchains and Compilers</h2>
<ul>
<li>IAR Embedded Workbench for ARM (EWARM) toolchain V8.20.2 + ST-Link</li>
<li>RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.25 + ST-Link</li>
<li>System Workbench for STM32 (SW4STM32) toolchain V2.7 + ST-Link</li>
</ul>
-<h2 id="supported-devices-and-boards-1">Supported Devices and boards</h2>
+<h2 id="supported-devices-and-boards-2">Supported Devices and boards</h2>
<ul>
<li>STM32WB55xx devices</li>
<li>P-NUCLEO-WB55 kit composed of P-NUCLEO-WB55.Nucleo and P-NUCLEO-WB55.USBDongle</li>
</ul>
-<h2 id="dependencies-1">Dependencies</h2>
+<h2 id="dependencies-2">Dependencies</h2>
<p>This software release is compatible with:</p>
<ul>
<li>STM32WB_Copro_Wireless_Binaries available under Projects/STM32WB_Copro_Wireless_Binaries</li>
@@ -695,7 +1015,7 @@
<div class="collapse">
<input type="checkbox" id="collapse-section2" aria-hidden="true"> <label for="collapse-section2" aria-hidden="true">V1.1.0 / 05-April-2019</label>
<div>
-<h2 id="main-changes-2">Main Changes</h2>
+<h2 id="main-changes-3">Main Changes</h2>
<h3 id="new-features-introduction-and-maintenance-release">New features introduction and maintenance release</h3>
<p>This release introduces the following feature:</p>
<ul>
@@ -757,8 +1077,8 @@
<li>Projects\P-NUCLEO-WB55.USBDongle\Applications\BLE</li>
<li>Projects\P-NUCLEO-WB55.USBDongle\Applications\Thread</li>
</ul>
-<h2 id="contents-2">Contents</h2>
-<h3 id="projects-2">Projects</h3>
+<h2 id="contents-3">Contents</h2>
+<h3 id="projects-3">Projects</h3>
<p>The STM32CubeWB Firmware package comes with a rich set of examples running on STMicroelectronics boards, organized by board and provided with preconfigured projects for the main supported toolchains.</p>
<p>The exhaustive list of projects and their short description is provided in this table (<a href="Projects/STM32CubeProjectsList.html">STM32CubeProjectsList.html</a>).</p>
<ul>
@@ -766,7 +1086,7 @@
<li><strong>P-NUCLEO-WB55.USBDongle</strong> (<a href="Projects/P-NUCLEO-WB55.USBDongle/Release_Notes.html">release notes</a>) (<a href="Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/readme.txt">default application</a>)</li>
</ul>
<p><em>Please note that the path of the example projects have been change to P-NUCLEO-WB55.Nucleo and P-NUCLEO-WB55.USBDongle.</em></p>
-<h3 id="components-2">Components</h3>
+<h3 id="components-3">Components</h3>
<table>
<caption>Firmware Upgrade Services Binary</caption>
<thead>
@@ -988,7 +1308,7 @@
</tr>
</tbody>
</table>
-<h2 id="known-limitations-2">Known Limitations</h2>
+<h2 id="known-limitations-3">Known Limitations</h2>
<ul>
<li>With the ability to change the Coprocessor Wireless Binaries Over The Air (OTA), it is possible to switch from one binary to another. Only, the following case is not possible due to available memory size:
<ul>
@@ -1006,18 +1326,18 @@
<li>SW4STM32 project is compiled without optimisation. (With optimised size compilation, the virtual com port required for the application is not functionnal)</li>
</ul></li>
</ul>
-<h2 id="development-toolchains-and-compilers-2">Development Toolchains and Compilers</h2>
+<h2 id="development-toolchains-and-compilers-3">Development Toolchains and Compilers</h2>
<ul>
<li>IAR Embedded Workbench for ARM (EWARM) toolchain V8.20.2 + ST-Link</li>
<li>RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.25 + ST-Link</li>
<li>System Workbench for STM32 (SW4STM32) toolchain V2.7 + ST-Link</li>
</ul>
-<h2 id="supported-devices-and-boards-2">Supported Devices and boards</h2>
+<h2 id="supported-devices-and-boards-3">Supported Devices and boards</h2>
<ul>
<li>STM32WB55xx devices</li>
<li>P-NUCLEO-WB55 kit composed of P-NUCLEO-WB55.Nucleo and P-NUCLEO-WB55.USBDongle</li>
</ul>
-<h2 id="dependencies-2">Dependencies</h2>
+<h2 id="dependencies-3">Dependencies</h2>
<p>This software release is compatible with:</p>
<ul>
<li>STM32WB_Copro_Wireless_Binaries available under Projects/STM32WB_Copro_Wireless_Binaries</li>
@@ -1039,7 +1359,7 @@
<div class="collapse">
<input type="checkbox" id="collapse-section1" aria-hidden="true"> <label for="collapse-section1" aria-hidden="true">V1.0.0 / 06-February-2019</label>
<div>
-<h2 id="main-changes-3">Main Changes</h2>
+<h2 id="main-changes-4">Main Changes</h2>
<h3 id="first-release">First release</h3>
<p>First release of STM32CubeWB (STM32Cube for STM32WB Series) supporting STM32WB55xx devices.</p>
<p>In the STM32CubeWB MCU Package, most of the examples and applications projects are generated with the STM32CubeMX tool to initialize the system, peripherals and middleware stacks.</p>
@@ -1055,15 +1375,15 @@
<li>Projects\P-NUCLEO-WB55.USBDongle\Applications\BLE</li>
<li>Projects\P-NUCLEO-WB55.USBDongle\Applications\Thread</li>
</ul>
-<h2 id="contents-3">Contents</h2>
-<h3 id="projects-3">Projects</h3>
+<h2 id="contents-4">Contents</h2>
+<h3 id="projects-4">Projects</h3>
<p>The STM32CubeWB Firmware package comes with a rich set of examples running on STMicroelectronics boards, organized by board and provided with preconfigured projects for the main supported toolchains.</p>
<p>The exhaustive list of projects and their short description is provided in this table (<a href="Projects/STM32CubeProjectsList.html">STM32CubeProjectsList.html</a>).</p>
<ul>
<li><strong>P-NUCLEO-WB55.Nucleo</strong> (<a href="Projects/P-NUCLEO-WB55.Nucleo/Release_Notes.html">release notes</a>) (<a href="Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_p2pServer/readme.txt">default application</a>)</li>
<li><strong>P-NUCLEO-WB55.USBDongle</strong> (<a href="Projects/P-NUCLEO-WB55.USBDongle/Release_Notes.html">release notes</a>) (<a href="Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pClient/readme.txt">default application</a>)</li>
</ul>
-<h3 id="components-3">Components</h3>
+<h3 id="components-4">Components</h3>
<table>
<caption>Coprocessor Wireless Binaries</caption>
<thead>
@@ -1254,7 +1574,7 @@
</tr>
</tbody>
</table>
-<h2 id="known-limitations-3">Known Limitations</h2>
+<h2 id="known-limitations-4">Known Limitations</h2>
<ul>
<li>BLE\BLE_p2pClient is provided with EWARM and MDK-ARM IDE. A connection issue with BLE_p2pServer is encounter with SW4STM32.</li>
<li>BLE\BLE_p2pRouter is provided with EWARM and MDK-ARM IDE. A connection issue with BLE_p2pServer is encounter with SW4STM32.</li>
@@ -1284,18 +1604,18 @@
</ul></li>
</ul></li>
</ul>
-<h2 id="development-toolchains-and-compilers-3">Development Toolchains and Compilers</h2>
+<h2 id="development-toolchains-and-compilers-4">Development Toolchains and Compilers</h2>
<ul>
<li>IAR Embedded Workbench for ARM (EWARM) toolchain V8.20.2 + ST-Link</li>
<li>RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.25 + ST-Link</li>
<li>System Workbench for STM32 (SW4STM32) toolchain V2.7 + ST-Link</li>
</ul>
-<h2 id="supported-devices-and-boards-3">Supported Devices and boards</h2>
+<h2 id="supported-devices-and-boards-4">Supported Devices and boards</h2>
<ul>
<li>STM32WB55xx devices</li>
<li>P-NUCLEO-WB55 kit composed of P-NUCLEO-WB55.Nucleo and P-NUCLEO-WB55.USBDongle</li>
</ul>
-<h2 id="dependencies-3">Dependencies</h2>
+<h2 id="dependencies-4">Dependencies</h2>
<p>This software release is compatible with:</p>
<ul>
<li>STM32WB_Copro_Wireless_Binaries available under Projects/STM32WB_Copro_Wireless_Binaries</li>
diff --git a/_htmresc/ReleaseNotes.html b/_htmresc/ReleaseNotes.html
index ba53e5b91..a8d789c94 100644
--- a/_htmresc/ReleaseNotes.html
+++ b/_htmresc/ReleaseNotes.html
@@ -1,5 +1,20 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"><head></head>
-<body><font color="blue"><b><u>STM32CubeWB Firmware Package V1.2.0 / 26-June-2019</u></b></font><br>
-<br><p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
-Changes</span></u></b></p><ol><li><span style="font-size: 11pt; font-family: &quot;Calibri&quot;,sans-serif; color: black;" lang="EN">Add STM32WB50 support</span></li><li><span style="font-size: 11pt; font-family: &quot;Calibri&quot;,sans-serif; color: black;" lang="EN">Add new utilities folder structure</span></li><li><span style="font-size: 11pt; font-family: &quot;Calibri&quot;,sans-serif; color: black;" lang="EN">Add CKS (Customer Key Storage) application</span></li><li><span style="font-size: 11pt; font-family: &quot;Calibri&quot;,sans-serif; color: black;" lang="EN">Rework all BLE/Thread/802.15.4 application to match new utilities folder structure<br></span></li></ol></body></html> \ No newline at end of file
+<body>
+<font color="blue"><b><u>STM32CubeWB Firmware Package V1.3.0 / 11-September-2019</u></b></font><br>
+<br>
+<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
+Changes</span></u></b></p><span style="font-weight: bold;"><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Zigbee support introduction</span><br><br>STM32WB ecosystem keeps growing, now with the introduction of ZigBee protocol support&nbsp;as <strong style="font-size: 14px; font-weight: 700; line-height: 19.6px;">certified compliant platform</strong>, running on <strong style="font-size: 14px; font-weight: 700; line-height: 19.6px;">certified 802.15.4 2015 LLD MAC and PHY</strong>.<span style="display: inline ! important; float: none; background-color: rgb(250, 250, 250); color: rgb(17, 17, 17); font-family: -apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,Ubuntu,&quot;Helvetica Neue&quot;,Helvetica,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 19.6px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"></span><br>The wireless stack is based on <strong style="font-size: 14px; font-weight: 700; line-height: 19.6px;">ZigBee pro 2017, R22 release version</strong>
+in order to propose a ZigBee 3.0 solution. First ON/OFF cluster is
+coming in this STM32CubeWB Firmware Package delivery release.<br><div style="margin-left: 40px;"><span style="display: inline ! important; float: none; background-color: transparent; color: rgb(17, 17, 17); font-family: -apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,Ubuntu,&quot;Helvetica Neue&quot;,Helvetica,sans-serif; font-size: 14px; font-style: italic; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 19.6px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">More clusters with examples will be introduced with further STM32CubeWB Firmware Package release.</span></div>
+<ol>
+<li><strong style="background-color: transparent; color: rgb(17, 17, 17); font-size: 14px; font-style: normal; font-variant: normal; font-weight: 700; letter-spacing: normal; line-height: 19.6px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">Zigbee Compliant Platform certified</strong><span style="display: inline ! important; float: none; background-color: transparent; color: rgb(17, 17, 17); font-family: -apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,Ubuntu,&quot;Helvetica Neue&quot;,Helvetica,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 19.6px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"> and 3 associated applications linked to OnOff cluster</span></li>
+<li><strong style="background-color: transparent; color: rgb(17, 17, 17); font-size: 14px; font-style: normal; font-variant: normal; font-weight: 700; letter-spacing: normal; line-height: 19.6px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">Certified 802.15.4 MAC</strong><span style="display: inline ! important; float: none; background-color: transparent; color: rgb(17, 17, 17); font-family: -apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,Ubuntu,&quot;Helvetica Neue&quot;,Helvetica,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 19.6px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"> and compliancy with Zigbee</span>
+</li>
+<li><span style="display: inline ! important; float: none; background-color: transparent; color: rgb(17, 17, 17); font-family: -apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,Ubuntu,&quot;Helvetica Neue&quot;,Helvetica,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 19.6px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">Thread secured FOTA for both wireless stack and user application. Supports 3 new applications</span></li>
+<li><span style="display: inline ! important; float: none; background-color: transparent; color: rgb(17, 17, 17); font-family: -apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,Ubuntu,&quot;Helvetica Neue&quot;,Helvetica,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 19.6px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">BLE stack and application improvements</span></li><ul><li><span style="display: inline ! important; float: none; background-color: transparent; color: rgb(17, 17, 17); font-family: -apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,Ubuntu,&quot;Helvetica Neue&quot;,Helvetica,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 700; letter-spacing: normal; line-height: 19.6px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">Support Flash erase during RF activity from Application side</span></li></ul><ul><li><span style="display: inline ! important; float: none; background-color: transparent; color: rgb(17, 17, 17); font-family: -apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,Ubuntu,&quot;Helvetica Neue&quot;,Helvetica,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 19.6px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">Support new Application : BLE_MultiAppAt - STM32WB Network processor via AT Instruction</span></li></ul>
+<li><span style="display: inline ! important; float: none; background-color: transparent; color: rgb(17, 17, 17); font-family: -apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,Ubuntu,&quot;Helvetica Neue&quot;,Helvetica,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 19.6px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">Integration of BLE Mesh library v1.10.004</span></li>
+<li><span style="display: inline ! important; float: none; background-color: transparent; color: rgb(17, 17, 17); font-family: -apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,Ubuntu,&quot;Helvetica Neue&quot;,Helvetica,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 19.6px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">Maintenance release for CMSIS, HAL and LL drivers</span></li>
+
+</ol>
+</body></html> \ No newline at end of file
diff --git a/package.xml b/package.xml
index 0b5fc60ab..16181aa58 100644
--- a/package.xml
+++ b/package.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<Package DBVersion="2.0">
- <PackDescription Release="FW.WB.1.2.0">
+ <PackDescription Release="FW.WB.1.3.0">
<Note Release="ReleaseNotes.html"/>
</PackDescription>
</Package> \ No newline at end of file