2020-09-30 02:01 AM
I've changed the .ld file for STM32G474 generated by STM32CUBEIDE.
The part of old .ld file is like this,
I added ">RAM AT" at the last line like this,
But when I'm debugging,the code is running into the HardFault Handler.I want to know if something else need to be edited.
Solved! Go to Solution.
2020-09-30 05:11 AM
Need to make sure linker places things as expected.
Code in startup.s needs to facilitate moving the code.
Hard Faults typically provide enough information to understand/fix the issue. Likely the data hasn't been moved prior to jumping into it.
2020-09-30 05:11 AM
Need to make sure linker places things as expected.
Code in startup.s needs to facilitate moving the code.
Hard Faults typically provide enough information to understand/fix the issue. Likely the data hasn't been moved prior to jumping into it.
2020-09-30 06:00 AM
Thanks for your help.
I don't know if you could give me some advice about modifying the code in startup.s. By using the Disassembly,the reason of Hard Faults was that the code was at the last address of RAM.Then I didn't know what to do.Maybe I need learn more about the boot process of ARM and debug method. I also tried to use __attribute__ and memcpy (code is copied from flash to RAM ) to realize it,but it also didn't work.Hope you can reply when free.I will also try to find a way to move the code correctly.
2021-09-09 12:02 AM
Hey! Did you manage to solve the problem?