Problem of FOPT configuration

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

Problem of FOPT configuration

Jump to solution
1,657 Views
masahirokiniwa
Contributor IV

Hi,

I use FRDM-KL03Z and adc16_polling sample in SDK.

When I change the FOPT value from 0x3D to 0xFD for using ROM bootloader, it occur to jump default handler.

Its issue occurs only using Keil MDK-ARM. (It doesn't occur, when I use IAR EWARM.)

And it occures both P&E OpenSDA and J-Link.

<Detail of issue>

1. Change the FOPT value from 0x3D to 0xD

2. Build and debug by Keil MDK-ARM

3. Connect virtual COM and received first message from FRDM-KL03Z, and FRDM-KL03Z wait for key input

4. As soon as press a key, FRDM-KL03Z jump to default handler.

Could you tell me a reason of its issue and workaround for using MDK-ARM?

Best regards,

M.Kiniwa 

0 Kudos
Reply
1 Solution
1,321 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi M.kiniwa,

   I think, MDK can't support to debug the code in ROM bootloader mode.

   Now, If you don't want to debug without FOPT, another way, download code without debug, then use the uart printf the information which you want. Actually, just download the code to the chip, and check the function directly, all without debug mode.


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
10 Replies
1,321 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Masahiro Kiniwa,

   Please tell me, you change FOPT from 0X3D to 0XFD or 0X0D, because you said 0XFD in the beginning, but in detail of issue, you said 0X0D.

   0X0D and 0XFD is totally not the same.

  You said IAR works, I think you didn't add --enable_config_write in the IAR options, then the IAR won't allow you modify the FOPT, so actually your modification in the IAR didn't work.

  Please confirm me the FOPT data which you want to modify, then I will check it on my side.


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
1,321 Views
masahirokiniwa
Contributor IV

Hi Kerry,

 Thank you for your reply.

 Sorry, 0x0D is my miss type. I change FOPT to 0xFD.

 When I use IAR, I added --enable_config_wirte and I confirmed the FOPT data.

Best regards,

M.Kiniwa

0 Kudos
Reply
1,321 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi M.Kiniwa,

   Thank you for your confirmation.

   If you change FOPT to 0XFD, it means your code will boot from ROM not flash after reset.

   So, you can't debug it directly, when you enter the ROM bootloader, you need to use the kinetisFlashTool in the KBOOT2.0, download the application code at first.

   I think, you can use the MDK to download the code, and then reset the chip, use the kinetisFlashTool to download the application code, whether you can download the app, if yes, it means, the MDK already download your modified code to your chip.

Wish it helps you!

 


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
1,321 Views
masahirokiniwa
Contributor IV

Hi Kerry,

Thank you for your answer.

I tried below sequence, but I couldn't debug by MDK. (It happened same things.)

If it is not correct, please tell me correct sequence.

<sequence>

1. MDK start debug

2. KinetisFlashTools connect

3. Kinetis FlashTools firmware update

4. RUN new firmware on MDK (not handle the console of MDK).

5. go into defaultISR

I changed the IDE to EWARM, so it doesn't impact to me.

However I need to know can I use MDK as EWARM.

Best regards,

M.Kiniwa 

0 Kudos
Reply
1,321 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Masahiro Kiniwa,

    Just as I have said, if you change FOPT to 0XFD, the code will boot from ROM bootloader directly, not flash, you can't debug it.

    If you want to use the KinetisFlashTool to update the application code, you don't need to enter MDK, just use the ROM bootloader directly.

    About the IAR, I think you didn't configure the options” --enable_config_write “ in Flash loader configuration windows. Then, actually, you didn't modify the FOPT successfully.


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
1,321 Views
masahirokiniwa
Contributor IV

Hi Kerry,

 I see that I cannot use MDK for debugging when I change FOPT to 0xFD.

 About the IAR, I can change FOPT to 0xFD and debug when I configure the option "--enable_config_write". I confirmed FOPT value by memory window.

Best regards,

M.Kiniwa

0 Kudos
Reply
1,321 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi M.Kinwa,

    Thank you for your updated information.

   Could you tell me why you need to enter debug mode, when you boot from ROM, and also use KinetisFlashTool to download the application code?

  


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
1,321 Views
masahirokiniwa
Contributor IV

Hi Kerry,

 I enter debug mode for using same code as finally application. I uinderstand I should debug without FOPT configulation and add it after dubbuging.But I must use same code.

 I don't have to download the application code when I debug the application. I use KinetisFlashTool for checking can I use MDK with FOPT configulation. Normally, I don't use ROM bootloader when I debug my application.

Best regards,

M.Kiniwa

0 Kudos
Reply
1,322 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi M.kiniwa,

   I think, MDK can't support to debug the code in ROM bootloader mode.

   Now, If you don't want to debug without FOPT, another way, download code without debug, then use the uart printf the information which you want. Actually, just download the code to the chip, and check the function directly, all without debug mode.


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
1,321 Views
mjbcswitzerland
Specialist V

Hi

Although I don't know why it may be compiler depended, do check the ROM LOADER errata for the chip in question.
When the ROM loader operates before jumping to the application it leaves some things enabled which can cause problems.
Eg.
LPUART0, I2C0 and SPI0 ports and interrupts.

Regards

Mark

0 Kudos
Reply