cancel
Showing results for 
Search instead for 
Did you mean: 

Hard Fault on STM32L486, is there a Flash Bug?

christophschwarz9
Associate II
Posted on January 26, 2016 at 10:07

Hello,

I have an application running on STM32L4 The application has also the ability to erase and reprogram some pages of the Flash, which are reserved for data storage (EEPROM emulation). After several hours of working the device suddenly stops working. I started the debugger without program the device to see what happenes on the Controller. After Reset the SystemInit()-Function is executed. In this function the first statement is

RCC->CR |= RCC_CR_MSION;

Therefore the controller executes the following assembler statements: LDR.N R0 [PC,#0x3c] LDR R0,[R0] ORR.W R0,R0,#1 LDR.N R1,[PC,#0x34] STR R0,[R1] With the first Load the address 0x40021000 is loaded into R0. This is RCC->CR. The next statement tries to load the content of the register, but when this line is executed a fault occurs. In the system control block I cannot see any hints what is wrong. On another Controller I solved it with erasing all the memory and reprogram it, but I expect the error again after some hours of working. Does anyone know if this could be a bug? How can I get more Informations what is happening there? The registers at the fault are pushed on the stack, but i just can figure out that I know the place where the fault occurs. I hope someone has a hint what to do... Regards, Chris #stm32l4 #flash #fault
2 REPLIES 2
Posted on January 26, 2016 at 11:00

Weird. Can't this be firewall-related?

JW
christophschwarz9
Associate II
Posted on January 27, 2016 at 18:45

I don't think so. I do not use the firewall. After erasing all the flash the exactly same code runs days and days without any problem...