cancel
Showing results for 
Search instead for 
Did you mean: 

[STM32WB55] Erasing Flash without Wireless Stack present

Sander_UP
Associate

Hello!

I am facing a problem when trying to erase a page from flash. It is working when the stm32wb5x_BLE_Stack_full_fw wireless stack is present. But since BLE is not used anymore, it has been removed, so now there is no wireless stack present. The problem occurs when trying to notify the CPU2 that some flash erase activity may be executed using this line (flash_driver.c file, FD_EraseSectors() function)

 

SHCI_C2_FLASH_EraseActivity(ERASE_ACTIVITY_ON);

 

After that it goes into HardFault_Handler. To be exact, this happens when the shci_send() function is called from shci.c file, and form there, whenever this line is executed from the shci_tl.c file

 

pCmdBuffer->cmdserial.cmd.plen = len_cmd_payload

 

it goes into the HardFault_Handler.

I have tried to use the FLASH_EraseProgram example from P-NUCLEO-WB55.Nucleo examples, but this does not help. As I understand that when there is no wireless stack present, and when trying to do something with the flash, there will be an issue regarding CPU2.

The file where the flash erase function comes from is the flash_driver.c file. This file has not been modified, it is the same as in the example projects found in the STM32Cube Project's folder. Also, added a picture that shows the call stack.

Also, I have tried following the AN5289 document, but this is more relevant when the BLE or other wireless stack is present. Followed the same principals as stated in the chapter 4.7.1 in the AN5289 document, but still the issue remains.

So, my question is if the wireless stack is always needed, even if BLE functionality is not used, in order to do flash operations or am I missing something else? Also, added my option bytes to files, maybe it will help to resolve something.

 

Edit: Using STM32CubeWB Firmware Package v1.15.0.

1 REPLY 1
STTwo-32
ST Employee

Hello @Sander_UP 

The SHCI_C2_FLASH_EraseActivity function is designed to notify the CPU2 (Cortex-M0+) about flash erase activities. This function relies on the presence of the wireless stack firmware. So, you need to have a Wireless stack implemented to be able to send this command and avoid the HardFault.

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.