All,
I've made some fantastic progress in the last week on a feasibility study on getting opendnp3 to run on a "bare metal" system.
If anyone's curious, check out the "runnable" branch.
1) No STL
2) No dynamic allocation
3) No C++ standard library (chrono, mutex, limits, etc).
I've got the code cross compiling using ATMEL's AVR Studio for the Arduino Mega2560. A basic outstation is using 70% of the Flash program storage. I didn't expect this to work at all since the basic Arduinos are 8-bit microcontrollers.
The outstation overflows the stack though, which isn't terribly surprising since the Mega only has 8KB SRAM. I'm going to turn some of the buffer sizes down for a very basic outstation and see if I can get it to fit. I'm also going to order an Arduino Due (32-bit ARM Cortex with 96KB SRAM. It will definitely fit on there.
The first pass will be to define a simple PAL that superloops a UART and timers. The next step if this works will be to define an interrupt driven PAL.
I'm pretty pumped that this compiles and fits in flash. I expected there to be more "gotchas". Check out the attached presentation that extolls the virtues of using C++11 for embedded systems.
-Adam