wrong macro check in some files

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

wrong macro check in some files

跳至解决方案
65 次查看
mastupristi
Senior Contributor I

Hi

I refer to SDK 25.06.00.

My projects can use FreeRTOS or be bare metal.

So I can have the USE_RTOS symbol defined as 0 or 1.

And this is generally fine because when the check is done, it is usually:

#if (defined(USE_RTOS) && (USE_RTOS > 0U))

see https://github.com/nxp-mcuxpresso/mcux-component/blob/main/lists/fsl_component_generic_list.c#L17

or https://github.com/nxp-mcuxpresso/mcux-component/blob/main/mem_manager/fsl_component_mem_manager.c#L...

So, as I already mentioned in my bare metal projects, I feel free to set USE_RTOS to 0.

In the fsl_os_abstraction.h file itself, there is this define under certain conditions:

https://github.com/nxp-mcuxpresso/mcux-component/blob/main/osa/fsl_os_abstraction.h#L194

However, there are some files released by NXP that do not follow this paradigm, for example ./middleware/mcuboot_opensource/boot/nxp_mcux_sdk/include/os/os_malloc.h

where the check is simply:

#if defined(USE_RTOS)

https://github.com/nxp-mcuxpresso/mcuboot/blob/mcux_main/boot/nxp_mcux_sdk/include/os/os_malloc.h#L2...

Obviously, this check is not valid if USE_RTOS is defined as 0 in order to disable the functionality.

This is not the only example.
I would ask you to review your entire code base and fix this problem.

best regards

Max

0 项奖励
回复
1 解答
50 次查看
danielchen
NXP TechSupport
NXP TechSupport

Hi @mastupristi 

 

 Yes, you are right.  This is a known issue and I will forward it to  the software team .

Thanks a lot for your feedback.

 

Regards

Daniel

在原帖中查看解决方案

0 项奖励
回复
1 回复
51 次查看
danielchen
NXP TechSupport
NXP TechSupport

Hi @mastupristi 

 

 Yes, you are right.  This is a known issue and I will forward it to  the software team .

Thanks a lot for your feedback.

 

Regards

Daniel

0 项奖励
回复