Going to a simple caveman C paradigm

17 Jul 2012

I'm experienced in C, but don't know squat about c++. I'm trying to use mbed as a real-time coprocessor to a linux SBC that does the big picture thinking (linking the two w/ eth udp's). I have the ethernet working fine using a simple udp example. I've managed to combine the RTOS layer and the ethernet and all is good. However when I do anything with serial using SerialBuffered or ModSerial (to implement multiple serial channels in addition to the USB channel) I seem to get wrapped around the axle. Can anyone recommend a simple serial paradigm/codebase that uses just C so I'm not guessing at how to use c++? I will take my lumps and patiently read flames that suggest that I should learn c++, however I would appreciate more tolerant helpful answers. cheers from Baghdad (temporarily)

17 Jul 2012

Have you tried using them without the ethernet (/RTOS) stuff? They are fairly straightforward, and while I haven't used ethernet myself, from these forums I get the idea it is not the most stable/friendly library. Personally I started out with C for uCs (actually ASM before that), and now I use the mbed I really like C++ alot better than C.

But anyway since you wanted a pure C solution, there exist C libraries for the UART. You can try this one: http://mbed.org/users/igorsk/code/DriverLibrary/file/1063a091a062/source/lpc17xx_uart.c. Quite frankly imo there isnt that much learning to go from C to basic C++ (of course all extra functionality will take some time to find out), but thats of course your choice.

17 Jul 2012

Thanks Erik. Yup, I had gone back to just simple code, stripping away the ethernet interface and the RTOS layer but was still running into a lot of odd problems with multiple serial interfaces, like reading from one and writing to another.. things that I've done for decades seem to elude me on this platform so I'm doubting my assumptions about c++. thanks for the c link. I'll get through some learning curve there while I'm studying ++.