The embedded development community/industry seems stuck in C. (I'm talking truly embedded here -- not Linux gumsticks, not "single board computers", etc.)
How about C++ with STL (but without vector and other containers that use new/malloc)?
Does this buy you anything?
There has to be an alternative to C. I wish it was Forth, but there doesn't even seem to be a Forth for Cortex.
I love C, but it doesn't scale very well (when it comes to abstractions and type safety).
How would generic programming (templates) look on an MCU? Would I be able to come up with a template that would let me abstract away SPI and UART code?
Is Embedded C++ (with templates) inevitable?
The prospect almost makes me want to buy this: http://www.digikey.com/scripts/dksearch/dksus.dll?Detail&name=497-6049-ND&enterprise=12 (a Cortex M3 demo/devkit for < $40).

1 comments:
I'm starting with the STM32, and using C++ with it. Before I was using C++ with an ARM7 (LPC2000 series). Microcontrollers with >= 256KB of flash and > 32 KB of RAM support nearly all features of C++, including exceptions and vector, list, string... iostream is another matter, it pulls in code for locale support and makes the binary file too big, but who needs iostream in an embedded device anyway?
The big problem with the STM32 is that Cortex-M3 seems to be standardizing startup an peripherals into libraries (CMSIS), and these libraries are designed for C developers and not C++ friendly...
Post a Comment