Flash Erase

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Flash Erase

3,915 次查看
ganeshvaka2
Contributor II

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

Capture1.PNG

 

Thank you for your Support 
Ganesh Babu Vaka

0 项奖励
回复
11 回复数

3,842 次查看
nelson_scheja
Contributor III

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.

0 项奖励
回复

3,900 次查看
davidtosenovjan
NXP TechSupport
NXP TechSupport

Hi, could you defined which our SW product is this question related to?

0 项奖励
回复

3,885 次查看
ganeshvaka2
Contributor II

Hello @davidtosenovjan 

 

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 .

flash.PNG

 If anyone have Any Idea please help me out 
Thanks and Regards 
Ganesh Babu.

0 项奖励
回复

3,868 次查看
davidtosenovjan
NXP TechSupport
NXP TechSupport

OK.

Do you execute this function from RAM?

0 项奖励
回复

3,767 次查看
pankajprasad100
Contributor III

Hello @davidtosenovjan 

How to call function from RAM?

 

 

Thanks & Regards

Pankaj Prasad

0 项奖励
回复

3,738 次查看
davidtosenovjan
NXP TechSupport
NXP TechSupport

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);

0 项奖励
回复

3,731 次查看
pankajprasad100
Contributor III

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 

0 项奖励
回复

3,704 次查看
davidtosenovjan
NXP TechSupport
NXP TechSupport

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

 

0 项奖励
回复

3,184 次查看
ganeshvaka2
Contributor II

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 

ganeshvaka2_0-1643697514756.png


Please find flash.ld file 

Thank you 

 

0 项奖励
回复

3,860 次查看
ganeshvaka2
Contributor II

Yes 

0 项奖励
回复

3,820 次查看
davidtosenovjan
NXP TechSupport
NXP TechSupport

What is value of 'add' at that moment? Could you check in assembler window if code runs for SRAM to be completely sure?

0 项奖励
回复