__DSB() generates no code after SDK update

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

__DSB() generates no code after SDK update

823 次查看
mrd
Contributor III

I have a fairly large RT1176 (cortex M7, M4) application where I need to make some major changes so I thought it would be good to update the IDE and SDK first. My application is a mix of C and C++ and uses Free RTOS. I updated from MCUXpresso v11.7.1 to v11.10.0 and SDK from 2.13 to 2.16.

After the update, I found that a few interrupt service routines were intermittently failing. After some troubleshooting, found by looking at the assembler output that the __DSB() (required by ARM errata 838869) at the end of the ISR was generating no code. After I replaced the __DSB() lines with __ASM volatile ("dsb 0xF":::"memory") the problems were solved.

While looking at the many changes in the SDK files between 2.13 and 2.16, I found that fsl_os_abstraction.h added the following at line# 448.
#ifndef __DSB
#define __DSB()
#endif

I think these lines define __DSB as nothing if it wasn't defined.

Since __DSB() is an inline static function in cmsis_gcc.h, I don't understand why it was not seen as "defined". And, I don't understand why fsl_os_abstraction.h would define it is as "nothing" if it wasn't defined.

I found that I could comment out the above mentioned lines in fsl_os_abstraction.h and then __DSB() started generating the "DSB SY" mnemonics as it should in the assembly output.

My questions are: Have I done something wrong to cause this? Or, is this an SDK bug? If it is a bug, is there a list of known bugs somewhere?

Thank you.

0 项奖励
回复
2 回复数

794 次查看
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @mrd ,

Thanks for your interest in NXP MIMXRT series!

What I understand about this issue is that if the inclusion is in the right order, then the definition in cmsis_gcc.h will be called first .However, I still need to check with the internal team as to why the code is written this way in the SDK as you mentioned. It will take some time and I'll sync with you once there is progress. Thanks in advance!

Best regards,
Gavin

0 项奖励
回复

738 次查看
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @mrd ,

Apologies for my late reply, it has taken some time due to in-house experts being on vacation and troubleshooting the issue.

But for now the issue I believe has been concluded. Since the code in fsl_os_**.h is:

#ifndef __DSB
#define __DSB()
#endif

And in cmsis_gcc.h, it's a static function rather than a macro definition, so it still overwrites the previous function.

And in Keil, macro definitions are used instead of static functions. Since this judgment is not present in fsl_os_**.h, it is recommended that you try not to include these header files in your mcuxpressoIDE project.

 

Best regards,
Gavin

0 项奖励
回复