hard fault error occur
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-12-19 5:56 AM
I use the STM32F100RB and make a bootloader.
​
The PC is connected to the STM32F100RB via UART, and the program to be executed is sent from the PC and extracted to the internal RAM. However, when the program is executed in the RAM, hard fault error occurs.
​
​The function I want to execute is located at 0x20001364, and I want to shift the execution as follows.
#define MAIN_ADDR (0x20001364)
…
f = (int(*)(void))(MAIN_ADDR);
f();
…
When stopped at 「f();�?, step execution will cause hard fault error to occur.
The value of CFSR is as follows.
​
I tried setting 0x20001364 directly to the PC register from the debugger, and it works as expected.
Is there a problem with the above method of shifting the execution?
- Labels:
-
DEBUG
-
RAM
-
STM32CubeIDE
-
STM32F1 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-12-19 6:44 AM
Its THUMB code, add ONE to the address to make it ODD
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-12-19 7:41 AM
@Community member​
Thank you for quick reply.
I set MAIN_ADDR to 0x20001365(0x20001364 + 1), and the program works as expected !
Thank you for your support !
