__boot() function stops working

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

__boot() function stops working

1,001 Views
jean-francoisle
Contributor III

Hi,

We are developping an application on a kinetis K20 (MQX4.0 and IAR 7.40). This application has a bootloader. We use the function __boot to reboot only MQX and than restart the user application. This function is called after the sleep mode to restart the app. Where is specification of what we do.

  • The sleep mode is configured to wake up with a transition on a specific pin.
  • At the wake up, the function __boot() is called to restart MQX with our app.
  • At a certain size of application (flash and ram) we observed that the function boot is not working properly. That means the code is not restarting. The MCU freeze.
  • We implement a workaround: after calling this function: _lpm_set_operation_mode(LPM_OPERATION_MODE_STOP)), we call _lpm_set_operation_mode(LPM_OPERATION_MODE_RUN)). and we repalce the function __boot() by a custom reset function. This situation is a workaroud because we do not want to reset, but just restart.
  • When the function is not working properly, the MCU freeze and nothing happen (depending of the watch dog configuration, the MCU reset and restart normally, but it's not normal).

We need help to understand what's happening.

Any clue?

Regards

JF

Tags (3)
0 Kudos
Reply
2 Replies

771 Views
DavidS
NXP Employee
NXP Employee

Hi JF,

Please see if this posts helps:

Problem of initialization of MQX after jumping to the start of MQX application ( _boot() )

Why not use VLLSx mode so that once the LLWU wakes up processor it will do a reset exception?  RAM retention?

Regards,

David

0 Kudos
Reply

771 Views
RadekS
NXP Employee
NXP Employee

It is hard to say what could be reason for such behavior.

Idea1: Some pending interrupt could blocks MCU when it wake-ups. Please try disable all interrupts prior you call __boot function. e.g. by CPSID instruction (asm (CPSID f);).

Idea2: Problem could be in some transitions between clock modes. You can try set clock to default values after reset or switch to some non-conflict clock mode.

Theoretically you can try set some software breakpoint at enter from sleep mode, attach debugger and try debugging root cause of system hangs.

The MCU freeze in 100% cases or behavior is random?

I hope it helps you.

Have a great day,
RadekS

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

0 Kudos
Reply