Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the limits of C on microcontrollers without operating systems?

I've never programmed a microcontroller. I've been playing around with Arduino and have discovered that the programming language is just C, with boilerplate code dynamically generated by the IDE. So: what can't I do in C/C++ on Arduino/microcontroller without an operating system versus C on Linux/Windows? Should any program that uses nothing but the standard library work? Or are there limits on specialized functions like malloc/free and setjmp/longjmp?

I ask because I want to compile and use an encryption library like openssl or crypto++ an Arduino Due (with a 32 bit arm processor).

like image 777
user3243135 Avatar asked Sep 19 '25 11:09

user3243135


1 Answers

There are no limits, except those that are imposed by your compiler. Clearly you cannot make "operating system calls" when you don't have an "operating system", but as long as somebody wrote a library that provides the functionality you need, there are indeed "no limits". Encryption - done. Malloc - easy. TCP/IP - got it. Lots of Arduino libraries. It's fun. Go for it.

Some helpful information at http://www.nongnu.org/avr-libc/user-manual/malloc.html

like image 72
Floris Avatar answered Sep 21 '25 04:09

Floris