wrong macro check in some files

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

wrong macro check in some files

跳至解决方案
415 次查看
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 解答
400 次查看
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 回复
401 次查看
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 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-2166550%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E6%9F%90%E4%BA%9B%E6%96%87%E4%BB%B6%E4%B8%AD%E7%9A%84%E9%94%99%E8%AF%AF%E5%AE%8F%E6%A3%80%E6%9F%A5%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2166550%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHI%3C%2FP%3E%3CP%3E%E6%88%91%E6%8C%87%E7%9A%84%E6%98%AF%20SDK%2025.06.00%E3%80%82%3C%2FP%3E%3CP%3E%E6%88%91%E7%9A%84%E9%A1%B9%E7%9B%AE%E5%8F%AF%E4%BB%A5%E4%BD%BF%E7%94%A8%20FreeRTOS%EF%BC%8C%E4%B9%9F%E5%8F%AF%E4%BB%A5%E6%98%AF%E8%A3%B8%E6%9C%BA%E3%80%82%3C%2FP%3E%3CP%3E%E5%9B%A0%E6%AD%A4%EF%BC%8C%E6%88%91%E5%8F%AF%E4%BB%A5%E5%B0%86%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3EUSE_RTOS%3C%2FFONT%3E%E7%AC%A6%E5%8F%B7%E5%AE%9A%E4%B9%89%E4%B8%BA%200%20%E6%88%96%201%E3%80%82%3C%2FP%3E%3CP%3E%E4%B8%80%E8%88%AC%E6%83%85%E5%86%B5%E4%B8%8B%EF%BC%8C%E8%BF%99%E6%A0%B7%E5%81%9A%E6%98%AF%E6%B2%A1%E6%9C%89%E9%97%AE%E9%A2%98%E7%9A%84%EF%BC%8C%E5%9B%A0%E4%B8%BA%E6%A3%80%E6%9F%A5%E5%AE%8C%E6%88%90%E5%90%8E%EF%BC%8C%E9%80%9A%E5%B8%B8%E9%83%BD%E6%98%AF%E8%BF%99%E6%A0%B7%EF%BC%9A%3C%2FP%3E%3CPRE%20translate%3D%22no%22%3E%23if%20(defined(USE_RTOS)%20%26amp%3B%26amp%3B%20(USE_RTOS%20%26gt%3B%200U))%3C%2FPRE%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fnxp-mcuxpresso%2Fmcux-component%2Fblob%2Fmain%2Flists%2Ffsl_component_generic_list.c%23L17%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3E%E5%8F%82%E8%A7%81%20https%3A%2F%2Fgithub.com%2Fnxp-mcuxpresso%2Fmcux-component%2Fblob%2Fmain%2Flists%2Ffsl_component_generic_list.c%23L17%3C%2FA%3E%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fnxp-mcuxpresso%2Fmcux-component%2Fblob%2Fmain%2Fmem_manager%2Ffsl_component_mem_manager.c%23L20%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3E%E6%88%96%20https%3A%2F%2Fgithub.com%2Fnxp-mcuxpresso%2Fmcux-component%2Fblob%2Fmain%2Fmem_manager%2Ffsl_component_mem_manager.c%23L20%3C%2FA%3E%3C%2FP%3E%3CP%3E%E5%9B%A0%E6%AD%A4%EF%BC%8C%E6%AD%A3%E5%A6%82%E6%88%91%E5%9C%A8%E8%A3%B8%E6%9C%BA%E9%A1%B9%E7%9B%AE%E4%B8%AD%E6%8F%90%E5%88%B0%E7%9A%84%EF%BC%8C%E6%88%91%E5%8F%AF%E4%BB%A5%E9%9A%8F%E6%84%8F%E5%B0%86%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3EUSE_RTOS%3C%2FFONT%3E%E8%AE%BE%E7%BD%AE%E4%B8%BA%200%E3%80%82%3C%2FP%3E%3CP%3E%E5%9C%A8%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3Efsl_os_abstraction.h%3C%2FFONT%3E%E4%B8%AD%E6%96%87%E4%BB%B6%E6%9C%AC%E8%BA%AB%EF%BC%8C%E5%9C%A8%E6%9F%90%E4%BA%9B%E6%9D%A1%E4%BB%B6%E4%B8%8B%E6%9C%89%E8%BF%99%E6%A0%B7%E7%9A%84%E5%AE%9A%E4%B9%89%EF%BC%9A%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fnxp-mcuxpresso%2Fmcux-component%2Fblob%2Fmain%2Fosa%2Ffsl_os_abstraction.h%23L194%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fnxp-mcuxpresso%2Fmcux-component%2Fblob%2Fmain%2Fosa%2Ffsl_os_abstraction.h%23L194%3C%2FA%3E%3C%2FP%3E%3CP%3E%E4%BD%86%E6%98%AF%EF%BC%8C%E6%81%A9%E6%99%BA%E6%B5%A6%E5%8F%91%E5%B8%83%E7%9A%84%E6%9F%90%E4%BA%9B%E6%96%87%E4%BB%B6%E4%B8%8D%E9%81%B5%E5%BE%AA%E8%BF%99%E7%A7%8D%E6%A8%A1%E5%BC%8F%EF%BC%8C%E4%BE%8B%E5%A6%82%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%2F%E4%B8%AD%E9%97%B4%E4%BB%B6%2Fmcuboot_opensource%2F%E5%90%AF%E5%8A%A8%2Fnxp_mcux_sdk%2Finclude%2Fos%2Fos_malloc.h%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3E%E5%85%B6%E4%B8%AD%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3E%E5%85%B6%E4%B8%AD%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3E%E6%A3%80%E6%9F%A5%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3E%E6%98%AF%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3E%E5%8F%AA%E6%98%AF%3C%2FSPAN%3E%3C%2FSPAN%3E%3A%3C%2FP%3E%3CPRE%20translate%3D%22no%22%3E%23if%20defined(USE_RTOS)%3C%2FPRE%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fnxp-mcuxpresso%2Fmcuboot%2Fblob%2Fmcux_main%2Fboot%2Fnxp_mcux_sdk%2Finclude%2Fos%2Fos_malloc.h%23L23%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fnxp-mcuxpresso%2Fmcuboot%2Fblob%2Fmcux_main%2Fboot%2Fnxp_mcux_sdk%2Finclude%2Fos%2Fos_malloc.h%23L23%3C%2FA%3E%3C%2FP%3E%3CP%3E%E6%98%BE%E7%84%B6%EF%BC%8C%E5%A6%82%E6%9E%9C%20USE_RTOS%20%E8%A2%AB%E5%AE%9A%E4%B9%89%E4%B8%BA%200%20%E4%BB%A5%E7%A6%81%E7%94%A8%E8%AF%A5%E5%8A%9F%E8%83%BD%EF%BC%8C%E5%88%99%E8%AF%A5%E6%A3%80%E6%9F%A5%E6%97%A0%E6%95%88%E3%80%82%3C%2FP%3E%3CP%3E%E8%BF%99%E4%B8%8D%E6%98%AF%E5%94%AF%E4%B8%80%E7%9A%84%E4%BE%8B%E5%AD%90%E3%80%82%3CBR%20%2F%3E%E6%88%91%E6%83%B3%E8%AF%B7%E6%82%A8%E6%A3%80%E6%9F%A5%E6%95%B4%E4%B8%AA%E4%BB%A3%E7%A0%81%E5%BA%93%EF%BC%8C%E5%B9%B6%E8%A7%A3%E5%86%B3%E8%BF%99%E4%B8%AA%E9%97%AE%E9%A2%98%E3%80%82%3C%2FP%3E%3CP%3E%E9%A1%BA%E7%A5%9D%E5%95%86%E7%A5%BA%EF%BC%81%3C%2FP%3E%3CP%3E%E6%9C%80%E5%A4%A7%E5%80%BC%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2166663%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20wrong%20macro%20check%20in%20some%20files%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2166663%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F124967%22%20target%3D%22_blank%22%3E%40mastupristi%3C%2FA%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%E6%98%AF%E7%9A%84%EF%BC%8C%E4%BD%A0%E8%AF%B4%E5%BE%97%E5%AF%B9%E3%80%82%20%E8%BF%99%E6%98%AF%E4%B8%80%E4%B8%AA%E5%B7%B2%E7%9F%A5%E9%97%AE%E9%A2%98%EF%BC%8C%E6%88%91%E5%B0%86%E6%8A%8A%E5%AE%83%E8%BD%AC%E7%BB%99%E8%BD%AF%E4%BB%B6%E5%9B%A2%E9%98%9F%E3%80%82%3C%2FP%3E%0A%3CP%3E%E9%9D%9E%E5%B8%B8%E6%84%9F%E8%B0%A2%E6%82%A8%E7%9A%84%E5%8F%8D%E9%A6%88%E3%80%82%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%E6%AD%A4%E8%87%B4%3C%2FP%3E%0A%3CP%3E%E4%B8%B9%E5%B0%BC%E5%B0%94%3C%2FP%3E%3C%2FLINGO-BODY%3E