2025-01-31 06:47 PM
I am using a custom board which is using stm32l4r9aii6 as the main microcontroller . The full name of the microcontroller is following :- stm32l4r9aii678a3n . The firmware for this board was developed on stm32l4r9 discovery board which uses the following controller :- stm32l4r9aii6u78a5u . The problem i am facing in my dev board are following:
1. The first issue is if i enable any of the interrupts my code breaks and the lr and pc value goes to an undefined location outside of flash memory after the code runs for a few seconds .
2. No hard fault handlers get triggered when this happens
Please let me know if any of you have faced similar issues or if you need any more data to know what might be happening
2025-01-31 07:26 PM
Check clocking and PLL settings, check FLASH wait states.
Check SCB->VTOR
Perhaps run from MSI, and not reconfigure and see if it keeps running or fails.
2025-02-01 06:53 AM
Check that "#define USER_VECT_TAB_ADDRESS" is not commented out in the system_stm32*.c file
2025-02-01 05:27 PM
Thanks for the reply @TDK @Tesla DeLorean I was able to resolve the issue . So I noticed that the device was going to an erroneous address immediately after the first interrupt was generated so I thought that there could be some issue with the flash memory data stored in the ISR handler region so I changed the flash memory address in the linker file to the next available bank of flash memory which was 0x8100000 . As soon as I flashed my code to this address it started working as expected . Also, i did check the scb->vtor values for both my discovery board and the dev board it was the same so that did not seem to be the issue . It looks like for some very weird reason the 4kb page which holds the isr handler address seem to have some kind of memory integrity issue since the rest of the code was working fine it was only when the isr handlers were getting triggered this issue occured .