Open fozayDost opened 9 months ago
Hello @fozayDost,
Thank you for this report. We will get back to you as soon as we analyze it further. This may take some time. Thank you for your comprehension.
With regards,
Hi,
From the registers from the flash peripheral you've posted I've seen that the bit CFGBSY from SR register is set.
Some time ago I've had a similar problem (busfault escalated to hardfault with this bit set).
This may help you somehow, if it is still a problem after all the time this issue is opened.
Hello guys,
During flash update operation, i sometimes got hard fault. Here is some information :
Board : Custom board with STM32WLE5JCIX based LoRa-E5 (not module). IDE : STM32CubeIDE
I am using Lorawan, GNSS, power modes (stop mode) and TIMER_IF functions to wake up periodically to read accelerometer.
Error production steps : 1- Board is low power state 2- Send downlink signal to board in order to trigger flash update. 3- Board wake up for sending data over LoRa (TX) 4- After sending data board receiving data over LoRa (RX) 5- Board got my message and try to update the flash with the procedure below :
a- FLASH_IF_Erase to erase the flash b- FLASH_IF_WRİTE to write the flash c- Reset the board if necessary
` struct flashVariables flashWrite;
__CONFIG_START is defined in .ld file as :
MEMORY { RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K RAM2 (xrw) : ORIGIN = 0x10000000, LENGTH = 32K FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 254K FCONF(r) : ORIGIN = 0x0803F800, LENGTH = 2K }
and user page size is :
#define USER_FLASH_PAGE_SIZE 0x800
By the way, it is working without problem most of the times. I got the error maybe 1/20 trial. I have tested it in a loop like erase-write-read and i could not cause the error.
This is the error stack, HAL_FLASH_LOCK causes the hard fault especially READ_BIT line.
/* verify Flash is locked */ if (READ_BIT(FLASH->CR, FLASH_CR_LOCK) == 0U) { status = HAL_ERROR; }
I could not find a way to handle the problem anymore. Could someone help me with this.