Can't disable interrupts with IAR 8.22.1 & KSDK 2.4

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

Can't disable interrupts with IAR 8.22.1 & KSDK 2.4

1,651 Views
ryanlush
Contributor IV

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.

0 Kudos
3 Replies

1,241 Views
mjbcswitzerland
Specialist V

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

0 Kudos

1,241 Views
ryanlush
Contributor IV

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>

0 Kudos

1,241 Views
mjbcswitzerland
Specialist V

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

0 Kudos