2023-11-10 07:05 AM
I am using an STM32L562VET6Q. My device contains both a (custom) bootloader and an application. The bootloader jumps into the application by reading the address of the Reset_Handler from the application's ISR vector then branching to this address. I have had absolutely no issues with this until the other day. I performed a firmware upgrade on a group of devices after which about 10% ceased responding. I placed a few of these on a debugger and they all, after branching to the application, throw an Undefined Instruction Hard Fault at the same instruction. This is not happening immediately at the start of the application but after hundred of instructions in. Keep in mind, this exact same firmware is running without issue on the other 90%. I have performed the following tests:
At this point, I am forced to the conclusion that something in internally wrong with specific chips in combination with the specific sequence of instructions/addresses that are being executed. Based upon my testing, it appears to be related to the instruction cache. I believe the instruction cache is somehow becoming "corrupted."
I have looked through the errata for this chip, but have not found any related entries to this issue. I would appreciate any further debugging steps I can follow to narrow down this issue.
2023-11-10 12:51 PM
I'd suggest disabling the Instruction Cache in your bootloader before the "LL_ICACHE_Invalidate();", then ensure that your application code invalidates before enabling. This'll be consistent with the CMSIS SCB_... functions.
2023-11-12 07:52 AM
This forum thread was marked by the moderator as needing a little more investigation, so a Support case was created in your name and will be handled off-line.