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

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

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

跳至解决方案
3,167 次查看
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 项奖励
回复
1 解答
3,007 次查看
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

在原帖中查看解决方案

7 回复数
3,142 次查看
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 项奖励
回复
3,128 次查看
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 项奖励
回复
3,124 次查看
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 项奖励
回复
3,119 次查看
David_Estevez
Contributor I

Hi again,

David_Estevez_0-1731489803671.png

This is the SR0 value.

0 项奖励
回复
3,099 次查看
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 项奖励
回复
3,008 次查看
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,993 次查看
David_Estevez
Contributor I
Thank you for the solution!
0 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-1992845%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9C%A8s32k116%E6%9D%BF%E4%B8%8A%E4%BD%BF%E7%94%A8IAR%E7%BC%96%E8%AF%91%E5%99%A8%E5%88%B7%E6%96%B0%E7%A8%8B%E5%BA%8F%E6%97%B6%E5%87%BA%E7%8E%B0%E7%9A%84%E9%97%AE%E9%A2%98%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1992845%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%88%91%E6%AD%A3%E5%9C%A8%E4%BD%BF%E7%94%A8%E4%B8%80%E4%B8%AA%E5%B8%A6%E6%9C%89%20IAR%20Toolchain%20for%20ARM%20-8.x%20%E7%BC%96%E8%AF%91%E5%99%A8%E7%9A%84%20S32K116%20%E5%BE%AE%E6%8E%A7%E5%88%B6%E5%99%A8%E9%A1%B9%E7%9B%AE%E3%80%82%3C%2FP%3E%3CP%3E%E6%88%91%E6%AD%A3%E5%9C%A8%E4%BD%BF%E7%94%A8%20PE%20Micro%20Multilink%20%E5%88%B7%E6%96%B0%E8%AF%A5%E7%A8%8B%E5%BA%8F%E3%80%82%E8%AF%A5%E7%A8%8B%E5%BA%8F%E5%9C%A8%E8%B0%83%E8%AF%95%E6%A8%A1%E5%BC%8F%E4%B8%8B%E5%B7%A5%E4%BD%9C%EF%BC%8C%E4%BD%86%E6%98%AF%E5%BD%93%E6%88%91%E6%96%AD%E5%BC%80%20PE%20Micro%20Multilink%E3%80%81%E5%85%B3%E9%97%AD%E7%94%B5%E6%BA%90%E7%84%B6%E5%90%8E%E6%89%93%E5%BC%80%E5%BE%AE%E6%8E%A7%E5%88%B6%E5%99%A8%E7%94%B5%E6%BA%90%E6%97%B6%EF%BC%8C%E7%A8%8B%E5%BA%8F%E5%81%9C%E6%AD%A2%E5%B7%A5%E4%BD%9C%E3%80%82%E4%BD%A0%E8%83%BD%E5%B8%AE%E6%88%91%E8%A7%A3%E5%86%B3%E8%BF%99%E4%B8%AA%E9%97%AE%E9%A2%98%E5%90%97%EF%BC%9F%3C%2FP%3E%3CP%3E%E4%BA%B2%E5%88%87%E7%9A%84%E9%97%AE%E5%80%99%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1997872%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E5%9C%A8s32k116%E6%9D%BF%E4%B8%8A%E4%BD%BF%E7%94%A8IAR%E7%BC%96%E8%AF%91%E5%99%A8%E5%88%B7%E6%96%B0%E7%A8%8B%E5%BA%8F%E6%97%B6%E5%87%BA%E7%8E%B0%E7%9A%84%E9%97%AE%E9%A2%98%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1997872%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E6%84%9F%E8%B0%A2%E6%82%A8%E7%9A%84%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%EF%BC%81%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1996953%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E5%9C%A8s32k116%E6%9D%BF%E4%B8%8A%E4%BD%BF%E7%94%A8IAR%E7%BC%96%E8%AF%91%E5%99%A8%E5%88%B7%E6%96%B0%E7%A8%8B%E5%BA%8F%E6%97%B6%E5%87%BA%E7%8E%B0%E7%9A%84%E9%97%AE%E9%A2%98%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1996953%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E8%AF%B7%E5%B0%86%3CSTRONG%3ESTART_FROM_FLASH%3C%2FSTRONG%3E%E6%B7%BB%E5%8A%A0%E5%88%B0%20IAR%20Assembler-%26gt%3BPreprocessor-%26gt%3BDefined%20symbol%3C%2FP%3E%0A%3CP%3E%E6%AD%A3%E5%A6%82%E6%88%91%E4%B9%8B%E5%89%8D%E6%8F%90%E5%88%B0%E7%9A%84%EF%BC%8C%E6%B7%BB%E5%8A%A0%3CSTRONG%3ESTART_FROM_FLASH%3C%2FSTRONG%3E%E5%90%8E%EF%BC%8CS32K116EVB%20%E5%BC%80%E6%9C%BA%E5%90%8E%E5%B0%B1%E5%8F%AF%E4%BB%A5%E6%AD%A3%E5%B8%B8%E5%B7%A5%E4%BD%9C%E3%80%82%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22S32DS%20ARM2.2%20to%20IAR%208.32%20S32K116%20START_FROM_FLASH.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22S32DS%20ARM2.2%20to%20IAR%208.32%20S32K116%20START_FROM_FLASH.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F311197iE957B8789496AD06%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22S32DS%20ARM2.2%20to%20IAR%208.32%20S32K116%20START_FROM_FLASH.jpg%22%20alt%3D%22S32DS%20ARM2.2%20to%20IAR%208.32%20S32K116%20START_FROM_FLASH.jpg%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E