I2C Periperal Config Mode FreeRTOS: Missing SetPriority

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

I2C Periperal Config Mode FreeRTOS: Missing SetPriority

1,615 次查看
tsparber
Contributor II

We would like to use the I2C periperal using the fsl_i2c_freertos driver. Configuring this in the MCUXpresso Config Tool works, but it is not possible to specify the interrupt priority for the periperal.

The current workaround, is to manually configure the interrupt priority using the following code.

#include "fsl_common.h"
const IRQn_Type s_i2cIrqs[] = I2C_IRQS;
uint32_t I2C_GetInstance(I2C_Type *base);
NVIC_SetPriority(s_i2cIrqs[I2C_GetInstance(I2C_LED_rtosHandle.base)], 2u);

Not setting the NVIC priority results in assertions by FreeRTOS, as a interrupt with a priority of 0 is not allowed to use the FreeRTOS functions (see configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY).

pastedImage_2.png

When selecting the "Interrupt" Mode it is possible to configure the priority as expected.

Is this functionality missing or is there another way to configure the priority?

标签 (1)
标记 (2)
2 回复数

1,361 次查看
jorge_a_vazquez
NXP Employee
NXP Employee

Hi Tommy Sparber 

Yes, the method to set the priority is through the NVIC_SetPriority(), this is not implemented in the fsl_i2c_freertos driver and so it is not implemented in the Peripheral config tools.

Hope this helps

Best regards

Jorge Alcala

0 项奖励
回复

1,361 次查看
bradarno
Contributor I

Why not fix this? As is, the freertos spi driver as shipped does not work.

0 项奖励
回复