wrong macro check in some files

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

wrong macro check in some files

ソリューションへジャンプ
220件の閲覧回数
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 解決策
205件の閲覧回数
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 返信
206件の閲覧回数
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 件の賞賛
返信