Hi @all experts,
I am working CAN Based Bootloader for S32k142.I am Facing issue for Erase Application memory from 0x5000 to 0x3FFFF.when I was debugging step by step I will be Successfully Erasing memory. When I was Flash and run code it is immediately going to HardFault_Handler.if any having any idea please explore here .
Debugging mode: Successfully Erasing memory
Run Mode: HardFault_Handler
Thank you for your Support
Ganesh Babu Vaka
I had a very similar problem once (crash at flash operation in Run mode, but working fine on debugging). For me, it was solved by putting the function that starts the flash command into RAM and executing it from there.
If you are absolutely sure that your function EraseAndProgram() runs in RAM, I got no more idea about this.
Hi, could you defined which our SW product is this question related to?
Thank you for your Valuable response!
As I said earlier I am working on CAN Based Bootloader. If I want flash new software need to erase old Software. When I was Request erase Software am getting Hardfault handler .When i debug step by step I am facing Issue here .
If anyone have Any Idea please help me out
Thanks and Regards
Ganesh Babu.
OK.
Do you execute this function from RAM?
Easiest way it is just execute Debug_RAM target (if S32DS used), if runs the code from SRAM. Or you create new memory segment/section in the linker file and use an attribute before C function declaration to relocated selected function to RAM
__attribute__ ((section(".MyRamCode"))) // place the code below into .MyRamCode section
void EraseAndProgram(void);
Since we are using IAR compiler, it will generate .icf file , so how can i declare the
__MY_RAM_ADR = ADDR (.MyRamCode);
__MY_RAM_SIZE = SIZEOF (.MyRamCode);
__MY_RAM_ROM_ADR = LOADADDR (.MyRamCode);
if you have any demo .icf file, please share to us.
Thanks & Regards
PANKAJ PRASAD
You may see example for design studio, where linker command file is modified this way:
https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K144-Flash-RW-simple/ta-p/1110000
For IAR, please consult with IAR documentation or support. Thanks
Hello @davidtosenovjan
we are facing issue with s32k116 ,while trying to erase memory from RAM using API: EraseAndProgram .
Programming terminated with SIGINT Interrupt
Please find the attached Debugging Console Screenshot
Please find flash.ld file
Thank you
Yes
What is value of 'add' at that moment? Could you check in assembler window if code runs for SRAM to be completely sure?