cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB5MMG - CPU2 is Blocking Flash operations from CPU1

rdiaz_ice
Associate II

Hi everybody,

Here's a bit of context of my project:

  • I'm using BLE Mesh Template, using Sensor and Generic Models.
  • I'm enabling the USB and the CDC middleware. Thus:
  • I changed the configuration of the SystemClock.
  • The nodes are mostly self-provisioned.
  • One node is working as root/gateway.

And here comes the problem. When I try to Self-Provision the Root Node, by enabling the

DYNAMIC_PROVISIONER feature in mesh_cfg_usr.h, and execute the command ATEP ROOT. The app "hangs" indefinitely.
These two logs show: 1.- The uncomplete self-provisioning process and (2.-) the second log shows the complete self-provisioning process.
 
UNCOMPLETE PROCESS. Application Crashes; the last line is where the app dies.

 

Wireless Firmware version 1.17.3 Wireless Firmware build 2 FUS version 1.2.0 >>== SHCI_SUB _EVT_CODE_READY >>== WIRELESS_FW_RUNNING >>== DBGMCU_GetRevisionID= 2003 >>== DBGMCU_GetDeviceID= 495 Success: SHCI_C2_BLE_Init command Success: aci_hal_write_config_data command - CONFIG_DATA_PUBADDR_OFFSET Public Bluetooth Address: 00:80:e1: 27:f3:c3 Unprovisioned device ******************** [Features Supported] Relay = Enabled Proxy = Enabled Friend = Enabled Dynamic Provisioner = Enabled [Options] PB-ADV = Enabled PB-GATT = Enabled [Library Capabilities] Net Keys = 3 App Keys = 3 Elements per Node = 5 Models per Element = 11 Subscription per Model = 10 Default TTL = 8 Default Network Transmit Count = 3 Default Relay retransmit Count = 2 [Enabled Models] For Element Index = 0 or Element Number = 1 Generic On Off Server Generic Power On Off Server Generic Power On Off Setup Server Sensor Client For Element Index = 1 or Element Number = 2 Generic On Off Client Generic Power On Off Client For Element Index = 2 or Element Number = 3 Generic On Off Client Generic Power On Off Client [Important Information] Embedded Provisioner data saving enabled Number of Elements enabled in Application: 3 Neighbour Table is enabled ******************** BLE-Mesh Lighting Demo v1.13.008 BLE-Mesh Library v01.13.008 BLE Stack v1.17.3 Branch=0 Type=2 FUS v1.2.0 BD_MAC Address = [c0]:[80]:[e1]:[27]:[f3]:[c3] UUID Address = [f8] [1d] [4f] [ae] [7d] [ec] [4b] [53] [a1] [54] [c3] [f3] [27] [e1] [80] [c0] ATEP ROOT received ATEP ROOT Provisioner node Provisioner Dev Key:[42] [c8] [d8] [e2] [62] [9f] [97] [cb] [06] [06] [50] [c6] [ba] [ac] [48] [bd] Test command executed successfully 75987 AppliPrvnNvm_Process - Saving provisioning data in SubPage[00000000] 76039 ConfigClient_ModelAppBind - Config Client App Key Bind message 76039 ConfigClient_ModelAppBind - elementAddr = [0001] 76039 ConfigClient_ModelAppBind - modelIdentifier = [00001000] 76039 ConfigClient_ModelAppBind - Config Client App Key Bind message 76039 ConfigClient_ModelAppBind - elementAddr = [0001] 76040 ConfigClient_ModelAppBind - modelIdentifier = [00001006] 76040 ConfigClient_ModelAppBind - Config Client App Key Bind message 76040 ConfigClient_ModelAppBind - elementAddr = [0001] 76040 ConfigClient_ModelAppBind - modelIdentifier = [00001007] 76040 ConfigClient_ModelAppBind - Config Client App Key Bind message 76041 ConfigClient_ModelAppBind - elementAddr = [0001] 76041 ConfigClient_ModelAppBind - modelIdentifier = [00001102] 76041 ConfigClient_ModelAppBind - Config Client App Key Bind message 76041 ConfigClient_ModelAppBind - elementAddr = [0002] 76041 ConfigClient_ModelAppBind - modelIdentifier = [00001001] 76041 ConfigClient_ModelAppBind - Config Client App Key Bind message 76042 ConfigClient_ModelAppBind - elementAddr = [0002] 76042 ConfigClient_ModelAppBind - modelIdentifier = [00001008] 76042 ConfigClient_ModelAppBind - Config Client App Key Bind message 76042 ConfigClient_ModelAppBind - elementAddr = [0003] 76042 ConfigClient_ModelAppBind - modelIdentifier = [00001001] 76043 ConfigClient_ModelAppBind - Config Client App Key Bind message 76043 ConfigClient_ModelAppBind - elementAddr = [0003] 76043 ConfigClient_ModelAppBind - modelIdentifier = [00001008] 76043 ConfigClient_SubscriptionAdd - Config Client Subscription Add Message Subscription Set buffer 01 00 00 c0 00 10 76044 ConfigClient_SubscriptionAdd - elementAddr = [0001] 76044 ConfigClient_SubscriptionAdd - SubscriptionAddress = [c000] 76044 ConfigClient_SubscriptionAdd - modelIdentifier = [00001000] 76063 ConfigClient_SubscriptionAdd - Config Client Subscription Add Message Subscription Set buffer 01 00 00 c0 06 10 76063 ConfigClient_SubscriptionAdd - elementAddr = [0001] 76063 ConfigClient_SubscriptionAdd - SubscriptionAddress = [c000] 76064 ConfigClient_SubscriptionAdd - modelIdentifier = [00001006] 76082 ConfigClient_SubscriptionAdd - Config Client Subscription Add Message Subscription Set buffer 01 00 00 c0 07 10 76083 ConfigClient_SubscriptionAdd - elementAddr = [0001] 76083 ConfigClient_SubscriptionAdd - SubscriptionAddress = [c000] 76083 ConfigClient_SubscriptionAdd - modelIdentifier = [00001007] 76102 ConfigClient_SubscriptionAdd - Config Client Subscription Add Message Subscription Set buffer 01 00 00 c0 02 11 76102 ConfigClient_SubscriptionAdd - elementAddr = [0001] 76102 ConfigClient_SubscriptionAdd - SubscriptionAddress = [c000] 76103 ConfigClient_SubscriptionAdd - modelIdentifier = [00001102] 76121 ConfigClient_SubscriptionAdd - Config Client Subscription Add Message Subscription Set buffer 02 00 00 c0 01 10 76122 ConfigClient_SubscriptionAdd - elementAddr = [0002] 76122 ConfigClient_SubscriptionAdd - SubscriptionAddress = [c000] 76122 ConfigClient_SubscriptionAdd - modelIdentifier = [00001001] 76141 ConfigClient_SubscriptionAdd - Config Client Subscription Add Message Subscription Set buffer 02 00 00 c0 08 10 76141 ConfigClient_SubscriptionAdd - elementAddr = [0002] 76141 ConfigClient_SubscriptionAdd - SubscriptionAddress = [c000] 76142 ConfigClient_SubscriptionAdd - modelIdentifier = [00001008] 76160 ConfigClient_SubscriptionAdd - Config Client Subscription Add Message Subscription Set buffer 03 00 00 c0 01 10 76160 ConfigClient_SubscriptionAdd - elementAddr = [0003] 76161 ConfigClient_SubscriptionAdd - SubscriptionAddress = [c000] 76161 ConfigClient_SubscriptionAdd - modelIdentifier = [00001001] 76180 ConfigClient_SubscriptionAdd - Config Client Subscription Add Message Subscription Set buffer 03 00 00 c0 08 10 76180 ConfigClient_SubscriptionAdd - elementAddr = [0003] 76180 ConfigClient_SubscriptionAdd - SubscriptionAddress = [c000] 76180 ConfigClient_SubscriptionAdd - modelIdentifier = [00001008] 76248 ConfigClient_PublicationSet - Config Client Publication Add Message 76248 ConfigClient_PublicationSet - Config Client Publication Add 76248 ConfigClient_PublicationSet - elementAddr = [0001] 76248 ConfigClient_PublicationSet - publishAddress = [c000] 76248 ConfigClient_PublicationSet - modelIdentifier = [00001000] Publication Set buffer 01 00 00 c0 00 00 08 00 00 00 10 76318 ConfigClient_PublicationSet - Config Client Publication Add Message 76318 ConfigClient_PublicationSet - Config Client Publication Add 76318 ConfigClient_PublicationSet - elementAddr = [0001] 76318 ConfigClient_PublicationSet - publishAddress = [c000] 76319 ConfigClient_PublicationSet - modelIdentifier = [00001006] Publication Set buffer 01 00 00 c0 00 00 08 00 00 06 10
View more

 

 
COMPLETE PROCESS. Application is working

 

Wireless Firmware version 1.17.3 Wireless Firmware build 2 FUS version 1.2.0 >>== SHCI_SUB_EVT_CODE_READY >>== WIRELESS_FW_RUNNING >>== DBGMCU_GetRevisionID= 2003 >>== DBGMCU_GetDeviceID= 495 Success: SHCI_C2_BLE_Init command Success: aci_hal_write_config_data command - CONFIG_DATA_PUBADDR_OFFSET Public Bluetooth Address: 00:80:e1: 27:f3:c3 Provisioned node Provisioned Node Address: [0001] ******************** [Features Supported] Relay = Enabled Proxy = Enabled Friend = Enabled Dynamic Provisioner = Enabled [Options] PB-ADV = Enabled PB-GATT = Enabled [Library Capabilities] Net Keys = 3 App Keys = 3 Elements per Node = 5 Models per Element = 11 Subscription per Model = 10 Default TTL = 8 Default Network Transmit Count = 3 Default Relay retransmit Count = 2 [Enabled Models] For Element Index = 0 or Element Number = 1 Generic On Off Server Generic Power On Off Server Generic Power On Off Setup Server Sensor Client For Element Index = 1 or Element Number = 2 Generic On Off Client Generic Power On Off Client For Element Index = 2 or Element Number = 3 Generic On Off Client Generic Power On Off Client [Important Information] Embedded Provisioner data saving enabled Number of Elements enabled in Application: 3 Neighbour Table is enabled ******************** BLE-Mesh Lighting Demo v1.13.008 BLE-Mesh Library v01.13.008 BLE Stack v1.17.3 Branch=0 Type=2 FUS v1.2.0 BD_MAC Address = [c0]:[80]:[e1]:[27]:[f3]:[c3] UUID Address = [f8] [1d] [4f] [ae] [7d] [ec] [4b] [53] [a1] [54] [c3] [f3] [27] [e1] [80] [c0] ATEP ROOT received ATEP ROOT Provisioner node Provisioner Dev Key:[d1] [af] [02] [08] [00] [00] [00] [00] [00] [00] [00] [00] [00] [00] [00] [00] Test command executed successfully 8567 AppliPrvnNvm_Process - Saving provisioning data in SubPage[00000018] 8584 ConfigClient_ModelAppBind - Config Client App Key Bind message 8584 ConfigClient_ModelAppBind - elementAddr = [0001] 8585 ConfigClient_ModelAppBind - modelIdentifier = [00001000] 8585 ConfigClient_ModelAppBind - Config Client App Key Bind message 8585 ConfigClient_ModelAppBind - elementAddr = [0001] 8585 ConfigClient_ModelAppBind - modelIdentifier = [00001006] 8585 ConfigClient_ModelAppBind - Config Client App Key Bind message 8585 ConfigClient_ModelAppBind - elementAddr = [0001] 8586 ConfigClient_ModelAppBind - modelIdentifier = [00001007] 8586 ConfigClient_ModelAppBind - Config Client App Key Bind message 8586 ConfigClient_ModelAppBind - elementAddr = [0001] 8586 ConfigClient_ModelAppBind - modelIdentifier = [00001102] 8586 ConfigClient_ModelAppBind - Config Client App Key Bind message 8587 ConfigClient_ModelAppBind - elementAddr = [0002] 8587 ConfigClient_ModelAppBind - modelIdentifier = [00001001] 8587 ConfigClient_ModelAppBind - Config Client App Key Bind message 8587 ConfigClient_ModelAppBind - elementAddr = [0002] 8587 ConfigClient_ModelAppBind - modelIdentifier = [00001008] 8587 ConfigClient_ModelAppBind - Config Client App Key Bind message 8588 ConfigClient_ModelAppBind - elementAddr = [0003] 8588 ConfigClient_ModelAppBind - modelIdentifier = [00001001] 8588 ConfigClient_ModelAppBind - Config Client App Key Bind message 8588 ConfigClient_ModelAppBind - elementAddr = [0003] 8588 ConfigClient_ModelAppBind - modelIdentifier = [00001008] 8589 ConfigClient_SubscriptionAdd - Config Client Subscription Add Message Subscription Set buffer 01 00 00 c0 00 10 8589 ConfigClient_SubscriptionAdd - elementAddr = [0001] 8589 ConfigClient_SubscriptionAdd - SubscriptionAddress = [c000] 8590 ConfigClient_SubscriptionAdd - modelIdentifier = [00001000] 8590 ConfigClient_SubscriptionAdd - Config Client Subscription Add Message Subscription Set buffer 01 00 00 c0 06 10 8590 ConfigClient_SubscriptionAdd - elementAddr = [0001] 8590 ConfigClient_SubscriptionAdd - SubscriptionAddress = [c000] 8591 ConfigClient_SubscriptionAdd - modelIdentifier = [00001006] 8591 ConfigClient_SubscriptionAdd - Config Client Subscription Add Message Subscription Set buffer 01 00 00 c0 07 10 8591 ConfigClient_SubscriptionAdd - elementAddr = [0001] 8591 ConfigClient_SubscriptionAdd - SubscriptionAddress = [c000] 8592 ConfigClient_SubscriptionAdd - modelIdentifier = [00001007] 8592 ConfigClient_SubscriptionAdd - Config Client Subscription Add Message Subscription Set buffer 01 00 00 c0 02 11 8592 ConfigClient_SubscriptionAdd - elementAddr = [0001] 8592 ConfigClient_SubscriptionAdd - SubscriptionAddress = [c000] 8593 ConfigClient_SubscriptionAdd - modelIdentifier = [00001102] 8593 ConfigClient_SubscriptionAdd - Config Client Subscription Add Message Subscription Set buffer 02 00 00 c0 01 10 8593 ConfigClient_SubscriptionAdd - elementAddr = [0002] 8593 ConfigClient_SubscriptionAdd - SubscriptionAddress = [c000] 8594 ConfigClient_SubscriptionAdd - modelIdentifier = [00001001] 8594 ConfigClient_SubscriptionAdd - Config Client Subscription Add Message Subscription Set buffer 02 00 00 c0 08 10 8594 ConfigClient_SubscriptionAdd - elementAddr = [0002] 8594 ConfigClient_SubscriptionAdd - SubscriptionAddress = [c000] 8595 ConfigClient_SubscriptionAdd - modelIdentifier = [00001008] 8595 ConfigClient_SubscriptionAdd - Config Client Subscription Add Message Subscription Set buffer 03 00 00 c0 01 10 8595 ConfigClient_SubscriptionAdd - elementAddr = [0003] 8595 ConfigClient_SubscriptionAdd - SubscriptionAddress = [c000] 8596 ConfigClient_SubscriptionAdd - modelIdentifier = [00001001] 8596 ConfigClient_SubscriptionAdd - Config Client Subscription Add Message Subscription Set buffer 03 00 00 c0 08 10 8596 ConfigClient_SubscriptionAdd - elementAddr = [0003] 8596 ConfigClient_SubscriptionAdd - SubscriptionAddress = [c000] 8597 ConfigClient_SubscriptionAdd - modelIdentifier = [00001008] 8597 ConfigClient_PublicationSet - elementAddr = [0001] 8617 ConfigClient_PublicationSet - Config Client Publication Add Message 8617 ConfigClient_PublicationSet - Config Client Publication Add 8617 ConfigClient_PublicationSet - elementAddr = [0001] Publication Set buffer 8636 ConfigClient_PublicationSet - Config Client Publication Add Message 8636 ConfigClient_PublicationSet - Config Client Publication Add 8636 ConfigClient_PublicationSet - elementAddr = [0001] 8656 ConfigClient_PublicationSet - Config Client Publication Add Message 8656 ConfigClient_PublicationSet - Config Client Publication Add 8656 ConfigClient_PublicationSet - elementAddr = [0001] 8656 ConfigClient_PublicationSet - publishAddress = [c000] 8675 ConfigClient_PublicationSet - Config Client Publication Add Message 8675 ConfigClient_PublicationSet - Config Client Publication Add Publication Set buffer 8695 ConfigClient_PublicationSet - Config Client Publication Add Message 8695 ConfigClient_PublicationSet - Config Client Publication Add 8695 ConfigClient_PublicationSet - elementAddr = [0002] 8695 ConfigClient_PublicationSet - publishAddress = [c000] 8714 ConfigClient_PublicationSet - Config Client Publication Add Message 8715 ConfigClient_PublicationSet - Config Client Publication Add 8715 ConfigClient_PublicationSet - elementAddr = [0003] 8715 ConfigClient_PublicationSet - publishAddress = [c000] 8734 ConfigClient_PublicationSet - Config Client Publication Add Message 8734 ConfigClient_PublicationSet - Config Client Publication Add **Provisioner Node configured**
View more

 

 

Now, I take time to figue out what was causing this problem. And I found out this.

The app is hanging in this call stack:

AppliPrvnNvm_Process AppliPrvnNvm_FlashProgram > PalNvmWrite > FD_WriteData > FD_WriteSingleData > 
ProcessSingleFlashOperation
 
There, the PC is on an infinity loop in the line:

 

while(LL_FLASH_IsActiveFlag_OperationSuspended());

 

 Take a look of this and:

 

/** * @brief Check if new program or erase operation request from CPU1 or CPU2 is suspended * @rmtoll FLASH_SR PESD LL_FLASH_IsActiveFlag_OperationSuspended * @rmtoll FLASH_C2SR PESD LL_FLASH_IsActiveFlag_OperationSuspended * @retval State of bit (1 or 0). */ __STATIC_INLINE uint32_t LL_FLASH_IsActiveFlag_OperationSuspended(void) { return ((READ_BIT(FLASH->SR, FLASH_SR_PESD) == (FLASH_SR_PESD)) ? 1UL : 0UL); }

 

and effectively, this bit is set in the FLASH SR register.

Taking a look on the datasheet, this PESD bits in SR is set and cleared by Hardware.

 

How can I solve this, is there a problem in the BLE Stack firmware loaded in the CPU2? 

 

2 REPLIES 2
STTwo-32
ST Employee

Hello @rdiaz_ice 

Have you tested the same behavior with our discovery Board? 

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hey, it's been a while since I've been here.

Yeah, I've been working with the STM3232WB5MM-DK.
It is worth mentioning that is an aleatory situation, perhaps in 2 out of 5 attempts this problem occurs, and the only way out is with a hardware reset.