SW does not boot with hex file

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

SW does not boot with hex file

1,693 Views
ktbalazs
Contributor II

Hi!

I have a well working SW on a MK22FN256VLH12, everything working fine if I flash .ELF file to the controller.

But if I flash a .hex file with eg. Flash Lite, the SW does not start, it seems that it stayed in reset state.

I restart the power supply, but it does not help.

I modified the flash config, like this:

* Flash Configuration */
.section .FlashConfig, "a"
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFFBFE

The Watchdog is turned off in the startup file, too.

Nothing helps.

Do you have any idea?

Thank you in advance!

0 Kudos
Reply
7 Replies

1,678 Views
ktbalazs
Contributor II

This project is almost ready.

Do you think, that the fresh SDK implementation would be easy and fast?

And will the new SDK solve this problem?

We use the old SDK in another project and there was not problem like this.

 

Thank you!

0 Kudos
Reply

1,676 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @ktbalazs 

 Old SDK and the IDE may have bugs, that why I recommend you use the newest SDK and IDE to download code.

Best Regards,

Kerry

0 Kudos
Reply

1,674 Views
ktbalazs
Contributor II

I think, the linker script can influence this, too.

What do you think?

This is my modifications: (commented are the originals)

/* Specify the memory areas */
MEMORY
{
m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000400
m_flash_config (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010
m_text (RX) : ORIGIN = 0x00000410, LENGTH = 0x0003FBF0
m_data (RW) : ORIGIN = 0x1FFFC000, LENGTH = 0x00006000
m_data_2 (RW) : ORIGIN = 0x20002000, LENGTH = 0x00008000

//m_data (RW) : ORIGIN = 0x1FFFC000, LENGTH = 0x00004000
//m_data_2 (RW) : ORIGIN = 0x20000000, LENGTH = 0x00008000
}

The left is the hex what I read back, the right is what I flash.

ktbalazs_0-1634812686441.png

 

0 Kudos
Reply

1,656 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @ktbalazs ,

 From your right side which should be the original code, it is totally wrong, as the original app 0X40C is the special area.

  This is the mcuxpresso IDE generated .hex.

kerryzhou_0-1634870884323.png

In my memory, the KDS generate .hex should be the .s19 in default, so you may try to modify the .hex to .s19. Then open it again, whether the 0X400 is all 0XFF except the 0X40C is 0XFE.

So, I recommend you use the MCUXPresso IDE with the newest SDK.

As even the KDS IDE have bugs, it won't be fixed, MCUXpresso is used to replace the KDS for the kinetis, thanks.

Wish it helps you!

Best Regards,

Kerry

 

0 Kudos
Reply

1,688 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @ktbalazs ,

   What's the debugger you are using with the Flash Lite?

    After you download the .hex code to your K22, do you also try to readout the flash memory, whether it is the same as your write .hex?

  Please also tell me which IDE you used to generate the .hex?

  What's the k22 board you are using? FRDM-K22? 

  Do you have the JLINK or not? I think you also can try the JLINK to download the .hex, whether the boot works ok or not?

Best Regards,

kerry

0 Kudos
Reply

1,682 Views
ktbalazs
Contributor II

Hi @kerryzhou !

Thank you for your extremly fast answer.

I use Segger Jlink Edu 11.0.

I did not try to read out the memory. How can I make it? Witch JFlash?

The Kinetis Studio IDE generate the .hex file (Intel Hex)

Tags (1)
0 Kudos
Reply

1,680 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @ktbalazs ,

  Good, you can use the JFLASH to readout.

 You are using the old KDS, that is very old.

As I know, your K22 can support the new SDK and the MCUXpresso IDE now, please update it.

You can find the new SDK from this link:

https://mcuxpresso.nxp.com/en/builder?hw=FRDM-K22F

MCUxpresso IDE download link:

https://www.nxp.com/design/software/development-software/mcuxpresso-software-and-tools-/mcuxpresso-i...

 

Wish it helps you!

Best Regards,

Kerry

0 Kudos
Reply