AnsweredAssumed Answered

MKL27 crashes when ANY interrupt occurs

Question asked by Kris Bird on Dec 8, 2017
Latest reply on Dec 17, 2017 by Kerry Zhou

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:-



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