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,910 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,750 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,885 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,871 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,867 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,862 Views
David_Estevez
Contributor I

Hi again,

David_Estevez_0-1731489803671.png

This is the SR0 value.

0 Kudos
Reply
2,842 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,751 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,736 Views
David_Estevez
Contributor I
Thank you for the solution!
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-1992845%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EProblems%20when%20flashing%20a%20program%20with%20IAR%20compiler%20on%20the%20s32k116%20board%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1992845%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20am%20using%20a%20project%20for%20an%20S32K116%20microcontroller%20with%20the%20IAR%20Toolchain%20for%20ARM%20-8.x%20compiler.%3C%2FP%3E%3CP%3EI%20am%20flashing%20the%20program%20with%20a%20PE%20Micro%20Multilink.%20The%20program%20works%20in%20debug%20mode%2C%20but%20when%20I%20disconnect%20the%20PE%20Micro%20Multilink%2C%20power%20off%20and%20then%20power%20on%20the%20microcontroller%2C%20the%20program%20stops%20working.%20Could%20you%20help%20me%20with%20this%20problem%3F%3C%2FP%3E%3CP%3EKind%20regards.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1997872%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Problems%20when%20flashing%20a%20program%20with%20IAR%20compiler%20on%20the%20s32k116%20board%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1997872%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EThank%20you%20for%20the%20solution!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1996953%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Problems%20when%20flashing%20a%20program%20with%20IAR%20compiler%20on%20the%20s32k116%20board%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1996953%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EPlease%20add%20%3CSTRONG%3ESTART_FROM_FLASH%3C%2FSTRONG%3E%20to%20IAR%20Assembler-%26gt%3BPreprocessor-%26gt%3BDefined%20symbols%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20I%20mentioned%20before%2C%20after%20adding%20%3CSTRONG%3ESTART_FROM_FLASH%3C%2FSTRONG%3E%20the%20S32K116EVB%20can%20work%20normally%20after%20power%20on.%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%3CLINGO-SUB%20id%3D%22lingo-sub-1994251%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Problems%20when%20flashing%20a%20program%20with%20IAR%20compiler%20on%20the%20s32k116%20board%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1994251%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EIt%20looks%20the%20same%20as%20the%20picture%20I%20replied%20to%20you%20last%20time.%20This%20is%20because%20the%20ECC%20error%20is%20caused%20by%20not%20executing%20the%20%3CSTRONG%3E%23ifdef%20START_FROM_FLASH%3C%2FSTRONG%3E%20code%20that%20initializes%20the%20ECC%20RAM.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22hardfault%20init_data_bss%20START_FROM_FLASH%20.png%22%20style%3D%22width%3A%20399px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22hardfault%20init_data_bss%20START_FROM_FLASH%20.png%22%20style%3D%22width%3A%20399px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310434i223A201EFFBA4C97%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22hardfault%20init_data_bss%20START_FROM_FLASH%20.png%22%20alt%3D%22hardfault%20init_data_bss%20START_FROM_FLASH%20.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EI%20have%20not%20finished%20the%20installation%20of%20IAR.%20If%20you%20find%20through%20debugging%20that%20the%20initialization%20ECC%20RAM%20code%20is%20not%20executed%2C%20then%20we%20should%20check%20why%20the%20definition%20of%20%3CSTRONG%3ESTART_FROM_FLASH%3C%2FSTRONG%3E%20is%20not%20working.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1993564%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Problems%20when%20flashing%20a%20program%20with%20IAR%20compiler%20on%20the%20s32k116%20board%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1993564%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20again%2C%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22David_Estevez_0-1731489803671.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22David_Estevez_0-1731489803671.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310249i0EF22CEB0518C6BD%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22David_Estevez_0-1731489803671.png%22%20alt%3D%22David_Estevez_0-1731489803671.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThis%20is%20the%20SR0%20value.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1993551%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Problems%20when%20flashing%20a%20program%20with%20IAR%20compiler%20on%20the%20s32k116%20board%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1993551%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ELet's%20check%20where%20the%20program%20went%20wrong%20by%20%3CSTRONG%3EAttach%20to%20Running%20Target%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Attach%20to%20Running%20Target.png%22%20style%3D%22width%3A%20950px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Attach%20to%20Running%20Target.png%22%20style%3D%22width%3A%20950px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310245i4231F0A5A9E696AB%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Attach%20to%20Running%20Target.png%22%20alt%3D%22Attach%20to%20Running%20Target.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22hardfault%20init_data_bss.png%22%20style%3D%22width%3A%20729px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22hardfault%20init_data_bss.png%22%20style%3D%22width%3A%20729px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310246i984820532428FD81%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22hardfault%20init_data_bss.png%22%20alt%3D%22hardfault%20init_data_bss.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EWhat%20is%20the%20value%20of%20SR0%20you%20see%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1993531%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Problems%20when%20flashing%20a%20program%20with%20IAR%20compiler%20on%20the%20s32k116%20board%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1993531%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Robin%2C%3CBR%20%2F%3EI%20have%20made%20that%20change%20just%20as%20you%20have%20shown.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22David_Estevez_0-1731488718946.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22David_Estevez_0-1731488718946.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310237i357F21E03AAC005E%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22David_Estevez_0-1731488718946.png%22%20alt%3D%22David_Estevez_0-1731488718946.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EBut%20I%20am%20still%20facing%20the%20same%20problem.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1993300%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Problems%20when%20flashing%20a%20program%20with%20IAR%20compiler%20on%20the%20s32k116%20board%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1993300%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%3C%2FP%3E%0A%3CP%3EThis%20may%20be%20caused%20by%20the%20lack%20of%20START_FROM_FLASH%20in%20the%20assembly%20preprocessor.%20Please%20refer%20to%20the%20previous%20discussion%3A%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K%2FS32K188-runs-with-debugger-but-not-witout%2Ftd-p%2F1203150%22%20target%3D%22_self%22%3ES32K118%20runs%20with%20debugger%2C%20but%20not%20without%3C%2FA%3E%3C%2FP%3E%0A%3CP%3ESince%20I%20didn't%20install%20the%20IAR%20Toolchain%20for%20ARM%20-8.x%20compiler%2C%20I%20found%20a%20picture%20on%20the%20Internet%3A%26nbsp%3BAssembler%20-%26gt%3B%20Preprocessor%20-%26gt%3B%20Defined%20symbols-%26gt%3B%20%3CSTRONG%3ESTART_FROM_FLASH%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22IAR%20Assembler%20Preprocessor%20Defined%20symbols%20START_FROM_FLASH.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22IAR%20Assembler%20Preprocessor%20Defined%20symbols%20START_FROM_FLASH.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310181i21E32CFCA6A86822%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22IAR%20Assembler%20Preprocessor%20Defined%20symbols%20START_FROM_FLASH.png%22%20alt%3D%22IAR%20Assembler%20Preprocessor%20Defined%20symbols%20START_FROM_FLASH.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EBest%20Regards%2C%3CBR%20%2F%3ERobin%3CBR%20%2F%3E-------------------------------------------------------------------------------%3CBR%20%2F%3ENote%3A%3CBR%20%2F%3E-%20If%20this%20post%20answers%20your%20question%2C%20please%20click%20the%20%22Mark%20Correct%22%20button.%20Thank%20you!%3C%2FP%3E%0A%3CP%3E-%20We%20are%20following%20threads%20for%207%20weeks%20after%20the%20last%20post%2C%20later%20replies%20are%20ignored%3CBR%20%2F%3EPlease%20open%20a%20new%20thread%20and%20refer%20to%20the%20closed%20one%2C%20if%20you%20have%20a%20related%20question%20at%20a%20later%20point%20in%20time.%3CBR%20%2F%3E-------------------------------------------------------------------------------%3C%2FP%3E%3C%2FLINGO-BODY%3E