Conversion from C to C++ not working in MCUXpresso Configuration

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

Conversion from C to C++ not working in MCUXpresso Configuration

跳至解决方案
1,325 次查看
jmueckl
Contributor IV

I used the MCUXpresso Configuration tool to generate a C project that created three PIT timers and an ADC instance for the FRDM-K64F development board.  I then wrote code in main() that implemented its functionality. In debug mode I verified that the breakpoints I inserted in each of the 3 PIT ISR's and the one ADC0 ISR cause the program to stop as each of the ISR's are triggered by the code. 

I likewise generated the same code for a new C++ project, but had to tweak some of the references in the ISR functions because the C++ configuration code that is generated is different. Without those changes the code would not compile.  However, the C++ version never calls the modified ISR's. In debug mode the breakpoints I inserted in the ISRs do not break. 

Are there any known bugs or troubleshooting steps I could take to help me determine the cause of this problem? 

    

    

0 项奖励
回复
1 解答
1,310 次查看
jmueckl
Contributor IV

Thank you Erich,  your response addressed the correct solution for this problem.  

After I wrapped the ISR prototypes within an extern "C" block, the linker was able to generate proper handler addresses.  They were likely null before.  

在原帖中查看解决方案

2 回复数
1,317 次查看
ErichStyger
Specialist I

Hi @jmueckl ,

have you implemented your ISRs marked with extern "C"?

Your interrupts have to use the C name mangling, not the C++ one.

 

Erich

1,311 次查看
jmueckl
Contributor IV

Thank you Erich,  your response addressed the correct solution for this problem.  

After I wrapped the ISR prototypes within an extern "C" block, the linker was able to generate proper handler addresses.  They were likely null before.