Well this is embarrassing...
I started with a hello world example for the KL17. __disable_interrupt fails at linking telling me
Error[Li005]: no definition for "__iar_builtin_disable_interrupt"
and asm ("CPSID f") fails to compile, telling me
Error[Og006]: Error in inline assembly: "Illegal sequence of interrupt flags"
It looks like you need to include "intrinsics.h" starting with IAR 8.22 but I have another project for the K24 and both of these methods work without including intrinsics.h. Including it with my KL17 projects doesn't fix it.
Hi Ryan
"CPSID f" is a valid assembler instruction on the Cortex-M4 (K24) but not on a Cortex-M0+ (KL17)
The KL17 can use "CPSID i" but not "CPSID f".
Therefore you must have an incorrect HW interface set up for the KL17 project.
Regards
Mark
Yeah I just noticed that... I've been using it incorrectly for years on the
M0+ and this is the first time the compiler has chocked and thrown an
error. Code Warrior doesn't throw any error and interrupts are definitely
being enabled/disabled.
On Wed, Oct 31, 2018 at 12:29 PM mjbcswitzerland <admin@community.nxp.com>
Ryan
It is potentially a compiler/assembler thing whereby some may treat "CPSID f" simply as "CPSID i" on a Cortex-M0+ since both disable interrupts.
Possibly IAR decided to change and flag an error instead in their more recent version.
Regards
Mark