Problems when flashing a program with IAR compiler on the s32k116 board

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

Problems when flashing a program with IAR compiler on the s32k116 board

Jump to solution
2,912 Views
David_Estevez
Contributor I

I am using a project for an S32K116 microcontroller with the IAR Toolchain for ARM -8.x compiler.

I am flashing the program with a PE Micro Multilink. The program works in debug mode, but when I disconnect the PE Micro Multilink, power off and then power on the microcontroller, the program stops working. Could you help me with this problem?

Kind regards.

0 Kudos
Reply
1 Solution
2,752 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Please add START_FROM_FLASH to IAR Assembler->Preprocessor->Defined symbols 

As I mentioned before, after adding START_FROM_FLASH the S32K116EVB can work normally after power on.

S32DS ARM2.2 to IAR 8.32 S32K116 START_FROM_FLASH.jpg

View solution in original post

7 Replies
2,887 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

This may be caused by the lack of START_FROM_FLASH in the assembly preprocessor. Please refer to the previous discussion: S32K118 runs with debugger, but not without

Since I didn't install the IAR Toolchain for ARM -8.x compiler, I found a picture on the Internet: Assembler -> Preprocessor -> Defined symbols-> START_FROM_FLASH 

IAR Assembler Preprocessor Defined symbols START_FROM_FLASH.png


Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply
2,873 Views
David_Estevez
Contributor I

Hi Robin,
I have made that change just as you have shown.

David_Estevez_0-1731488718946.png

 

But I am still facing the same problem.

0 Kudos
Reply
2,869 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Let's check where the program went wrong by Attach to Running Target.

Attach to Running Target.pnghardfault init_data_bss.png

What is the value of SR0 you see?

0 Kudos
Reply
2,864 Views
David_Estevez
Contributor I

Hi again,

David_Estevez_0-1731489803671.png

This is the SR0 value.

0 Kudos
Reply
2,844 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

It looks the same as the picture I replied to you last time. This is because the ECC error is caused by not executing the #ifdef START_FROM_FLASH code that initializes the ECC RAM.

hardfault init_data_bss START_FROM_FLASH .png

I have not finished the installation of IAR. If you find through debugging that the initialization ECC RAM code is not executed, then we should check why the definition of START_FROM_FLASH is not working.

0 Kudos
Reply
2,753 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Please add START_FROM_FLASH to IAR Assembler->Preprocessor->Defined symbols 

As I mentioned before, after adding START_FROM_FLASH the S32K116EVB can work normally after power on.

S32DS ARM2.2 to IAR 8.32 S32K116 START_FROM_FLASH.jpg

2,738 Views
David_Estevez
Contributor I
Thank you for the solution!
0 Kudos
Reply