Debug issue S32DS v2018R1 flash /flexram acess

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Debug issue S32DS v2018R1 flash /flexram acess

1,880 Views
Hb2023
Contributor II

I am working on bootloader software for S32K116 device. When trying debugging program does not start correctly, only when I single step through init routine (init  flex ram) write init data to flex ram will be successful and program run correctly. I thought may be stack size problem, I have no idea what is the issue. Any help?

0 Kudos
Reply
11 Replies

1,851 Views
Hb2023
Contributor II

Program received signal SIGINT, Interrupt.
Reset_Handler () at ../Project_Settings/Startup_Code/startup_S32K116.S:138
138 subs r2, 4

this is the failure I become during ECC RAM init

0 Kudos
Reply

1,855 Views
Hb2023
Contributor II

thank you for the reply I have tried to add the fault exeption from the example you provided but the s32K116 support only the hardfault interrupt, is there any example for trap handling for s32k116 device? (MemManage_Handler, BusFault_Handler and UsageFault_Handler are not available in the s32k116 device)

0 Kudos
Reply

1,864 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @Hb2023,

Hard to say, it could be because while you are programming the PFlash or the EEPROM (DFlash), a collision on the Flash block occurs.

Do you see FSAT[RDCOLERR] set?

Do you see a fault exception? If so, can you provide more details about it, like the type of the exception, possibly the fault instruction or bus fault location?

https://community.nxp.com/t5/S32K-Knowledge-Base/Fault-handling-on-S32K14x/ta-p/1114447

 

Regards,

Daniel

1,822 Views
Hb2023
Contributor II

@danielmartynekI found out that with optimization set to zero, program is able to run without problems, but when activating the optimization program gets fail at NVM init flash partition. I can attach list files with optimization set to zero and with optimazation set to one if this could be helpful.

0 Kudos
Reply

1,819 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @Hb2023,

Do you use any NXP drivers?

If so, which version?

 

Thanks,

BR, Daniel

0 Kudos
Reply

1,813 Views
Hb2023
Contributor II

@danielmartynekwith optimization enabled the program get failed when excuting the flash command for flash partition added the debug log. Do you have any idea what is going wrong. I need urgent help.

0 Kudos
Reply

1,809 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Does it fail after the CCIF is cleared by the SW to launch the Program partition command?

If so, please make sure that the function is in SRAM and that interrupts are masked globally.

0 Kudos
Reply

1,805 Views
Hb2023
Contributor II

@danielmartynekis there a way to disable optimization for one siongle function s32DS GCC compiler?

0 Kudos
Reply

1,800 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @Hb2023,

You can define a function with this attribute:

__attribute__((optimize("-O0")))

Or you can move the function to another .c file and set a different optimization level for it.

In S32DS IDE, right-click on a .c file, go to properties:

danielmartynek_0-1677246104266.png

 

If the issue is caused by the optimization, I would recommend comparing the two compiled ASM codes.

 

Regards,

Daniel

 

 

0 Kudos
Reply

1,807 Views
Hb2023
Contributor II

@danielmartynekif I single step through the flash execute command function it does not fail, it fails only when I let debug run without single step, it seems to be optimization problem. Now I kept optimization enabled for complete project and disable optimization only for flash driver module where flash execute command function is defined (seems to work ok, but still have trouble why it does not work with optimization enabled).

Yes the execute command function is copied into ram with start ram declaration and end ram declaration, and global interrupt is disabled before clearing the CCIF command per SW.

0 Kudos
Reply

1,817 Views
Hb2023
Contributor II

@danielmartynekNo I am not using NXP driver code, its our own written code originally for ARMCC compiler (IAR IDE) now switching to GCC compiler/S32DS studio raises some problems

0 Kudos
Reply