Hi,
Am using LPC1756 for my project. I have been working on the code for sometime, but recently when I added a new code for sprintf the firmware version of the project, i am getting HARDFAULT-FORCED(30),
void func(void){
char Dummy[50];
uint8_t new_rev_vers;
sprintf(Dummy,"DOWNLOADING..%hu",new_rev_vers);
}
I tried understanding the disassembly and also tried adjusting heap and stack in mcuxpresso style, which did not even start the code.
I'll share the memory consumed by the code. and the fault details.
memory consumption:
MCU details
解決済! 解決策の投稿を見る。
Hi,
I solved the issue, as I was using FOTA and I accidently replaced the current program sector with the latest one. This caused hardfault.
Hi,
I solved the issue, as I was using FOTA and I accidently replaced the current program sector with the latest one. This caused hardfault.
Hi @Alice_Yang ,
Thanks for the reply, my IDE is MCUXpresso IDE v11.1.0 [Build 3209] [2019-12-12].
Hi @converse ,
Thanks for the reply, and yes I tried with %u for uint32_t for new_rev_vers, and am using redlib -semihost.
Hello athmesh_n,
Which version of MCUXpresso IDE you used? You can share a simple project that can reproduce your issue, we can help to check.
Regards,
Alice
One obvious thing (but I doubt it is causing the problem) is that %hu expects a short (16 bit) but you have defined new_rev_vers at uint8_t which is a byte (8 bits).
But, more information required:
where is the PC - which module is it in?
which library are you using - newlib, newlib-nano, or redline?