wrong macro check in some files

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

wrong macro check in some files

Jump to solution
133 Views
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 Kudos
Reply
1 Solution
118 Views
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

View solution in original post

0 Kudos
Reply
1 Reply
119 Views
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 Kudos
Reply