cancel
Showing results for 
Search instead for 
Did you mean: 

C++ Development

sjackson
Associate II
Posted on December 20, 2007 at 11:29

C++ Development

2 REPLIES 2
sjackson
Associate II
Posted on May 17, 2011 at 12:19

I'm using IAR Embedded Workbench v4.42 to develop an application for the STM32. I would much prefer to use C++ for my project due to the numerous advantages of OOP.

I have tried to compile and run a demo application (specifically the Virtual USB COM Port) by changing the language to C++ and making the necessary mods to ST's firmware library so that everything compiles correctly. Upon loading code onto the MCU, however, it does not seem to work. I suspect that for some reason interrupts (or maybe some special USB thing) did not get compiled and linked correctly.

Does anyone have any thoughts on this? Thanks.

sjackson
Associate II
Posted on May 17, 2011 at 12:19

The problem apparently lies in stm32f10x.c as the vector table there gets optimized away by the C++ compiler since it is never directly referenced. You need to force the compiler to keep it around and maybe throw an extern ''C'' in around ''void program_start();'' so that the system doesn't complain about an undefined symbol.

I'd post code but last time I tried to do that my entire message was blank.

[ This message was edited by: SJackson on 20-12-2007 16:01 ]