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

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

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

ソリューションへジャンプ
1,237件の閲覧回数
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,222件の閲覧回数
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,229件の閲覧回数
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,223件の閲覧回数
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.