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

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

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

Jump to solution
1,225 Views
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 Kudos
Reply
1 Solution
1,210 Views
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.  

View solution in original post

2 Replies
1,217 Views
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,211 Views
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.