MKL27 crashes when ANY interrupt occurs

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

MKL27 crashes when ANY interrupt occurs

830 Views
epicedium
Contributor II

I'm running a MKL27Z64VFM4 chip on a custom board.

I started a project on KDE w/ KSDK1.3 and PE, but as the chip wasn't properly supported I had to abandon that approach.

I downloaded the MCUXpresso IDE and the SDK for the MKL27Z64VFM4 chip. I installed the SDK into the IDE.

I created a new product using..  New / MCUXpresso IDE / New C/C++ Project. I selected the correct CPU, no board, I selected the correct package (VFM4) and some drivers. I then configured the clocks and basic Peripheral settings via the GUI:-

Screen Shot 2017-12-08 at 14.13.58.png

This generates code which seems sensible and compiles.

I add the app IRQHandlers with basic code to clear the flags.

When I run it, it crashes when an IRQ occurs. My IRQ functions are never called. I've tried TPM, UART and other IRQs and they all have the same problem- when the triggering event occurs, the PC ends up at 0x1C002228 without touching my IRQ code.

This address appears to be in the ROM space, i.e. the integrated bootloader.

I saw some other posts with related issues, someone changed their FOPT from 0xFF to 0x3D and it fixed their problem. My flash config code (auto generated) appears to be OK:-

__attribute__ ((used,section(".FlashConfig"))) const struct {
unsigned int word1;
unsigned int word2;
unsigned int word3;
unsigned int word4;
} Flash_Config = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFF3DFE};

I tried changing 3D to FF, and 3B, in case the NMI was causing problems. I also checked that the runtime value in 0x40020003 matches the non-volatile value- it does.

I also set the NMI pin to GPIO muxing, to try to make sure it's not interfering.

No changes- I still bounce to 0x1C002228 when any ISR occurs.

Is there anything I could be missing?

It's frustrating that interrupts were working fine in KDE. 

I also tried re-creating the project several times, choosing different semi-hosting settings, and creating a project by importing the "frdmkl27z_demo_testdemo_apps_adc16_low_power" demo. I get the exact same behaviour - everything works, until any ISR triggers.

Any ideas would be appreciated

Kris

Labels (1)
3 Replies

602 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Kris Bird,

  1. Please use the newest KL27 SDK code, which you can find it from this link:

   Welcome | MCUXpresso SDK Builder 

  Select your chip, generate the code and download it.

  2. Refer to the KSDK document: Getting Started with MCUXpresso SDK.pdf in folder SDK_2.3.0_FRDM-KL27Z\docs

    You can import the SDK_2.3.0_FRDM-KL27Z\boards\frdmkl27z\driver_examples\adc16\interrupt

    This is the ADC interrupt code, I can make it works, when the interrupt occur, it works OK.

   Please check this picture:

pastedImage_2.png

You can try the official code at first, I have test it on my FRDM-KL27 board, it works OK.

Have a great day,
Kerry

 

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

0 Kudos

602 Views
epicedium
Contributor II

Thanks, Kerry.

I managed to resolve the issue myself - I discovered that some of the flash bootloader settings are quite sticky.

It appears that on a new MKL27 chip even if you change the bootsel settings and reset lots of times, certain bootup settings (such as vector table offset) stay as per factory settings. 

After some hard power cycles the issues go away completely.

602 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Kris Bird,

   Thank you for your updated information.

   Please check my post, maybe it is useful to you:

Problem Analysis and solutions for booting from ROM BOOTLOADER in KL series 

 

Have a great day,
Kerry

 

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

-------------------------------------------------------------------------------------------------------------------------