2024-07-03 06:18 AM - edited 2024-07-03 07:14 AM
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.
Solved! Go to Solution.
2024-07-11 08:38 AM
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.
2024-07-11 08:38 AM
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.
2024-07-29 03:45 AM
Hi @STTwo-32
Thank You for the reply. Now I have another question. Is it possible to erase flash sectors or do flash operations without needing to notify the CPU2 or having the wireless stack present? Or whatever the case, the wireless stack firmware is always needed when dealing with flash operations?
All the best,
Sander
2024-07-29 05:48 AM
This is a new question . Please close this one (by selecting a best answer)and create a new thread for your new request to give it more visibility.
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.