2007-12-20 02:29 AM
C++ Development
2011-05-17 03:19 AM
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.2011-05-17 03:19 AM
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 ]