K64 + KSDK2.0 + IRQn_Type

cancel
Showing results for 
Search instead for 
Did you mean: 

K64 + KSDK2.0 + IRQn_Type

315 Views
Contributor IV

Hello,

 

we use K64 + KSDK2.0 + FreeRTOS with IAR Workbench.

 

Why are some of the Arrays with type "IRQn_Type" in different modules of KSDK2.0 defined as "static"?

So they are module-local. I have to define the same array in my code again...

In combination with Free-RTOS I need to set an appropriate IRQ-Level to each IRQ.

 

I think the IRQ-Arrays of every hardware-module should be defined as "const" not be defined as "static const".

example      fsl_sai.c:

static const IRQn_Type s_saiTxIRQ[] = I2S_TX_IRQS;

should be:

const IRQn_Type s_saiTxIRQ[] = I2S_TX_IRQS;

 

Please Review your code according to this.

 

Best regards.

Manfred

Labels (1)
0 Kudos
3 Replies

6 Views
NXP Employee
NXP Employee

Manfred,

It looks as though you've identified a use case that wasn't considered when we originally architected the drivers. The reason you're seeing these interrupt arrays as static is due to their use inside of the driver to provide interrupt functionality out of the box.

You should be able to easily expose these arrays to other pieces of your code with slight modifications to the driver c and h files. We'll discuss this change in future releases of the SDK. Thanks for the feedback.

Jason

0 Kudos

6 Views
Contributor IV

Hi Jason,

that's true, I can easily expose these arrays to my source.

But it would be nice, to have this "IRQn_Type" defined by KSDK2.x for every hardware module.

Every user of FreeRTOS has to do this workaround in his Project. --> so it should be done one time in the right place. --> more happy users

Best regards

Manfred

0 Kudos

6 Views
Contributor IV

Hi Jason,

now I'm working with KSDK2.4.2.

Every "IRQn_Type" - Array is "static const" --> module local.

What a pitty. It seems, the decision was to keep this arrays module local.

To use any of these functions, I have to define the "IRQn_Type"-array in my code a second time in addition to KSDK-lib Definition...

example:

InstallIRQHandler(IRQn_Type...

EnableDeepSleepIRQ(IRQn_Type...

DisableDeepSleepIRQ(IRQn_Type...

NVIC_SetPriority(IRQn_Type...

NVIC_GetPriority(IRQn_Type

... and so on...

Yes... I can edit the driver .c and .h files --> but this is annoying to do in every version of KSDK...

Can you please discuss this topic again?

Best regards

Manfred

0 Kudos