9 years, 5 months ago.

ARM Cortex M3 Linux

I am new to this forum and new to ARM programming, i have a few questions and a senario i would like to explore.

I am planning on an IoT like set up build where i would like to connect to the cloud or server by a modem like the one of your partners 'Multi-Tech'.

The data i would like to make availible on the cloud would be GPS data as in one of the meny partners from ARM, 'U-Blox'.

Therefor the choice for ARM mbed was quite easy.

I am currently working on a Linux Mint VM work enviroment where i have writen code in C to read out the /dev/ttyUSB0 port by using the terminos.h api, and i am still working on the part where it would connect to the cloud via HTTP, AT commands, by socket programming.

Once i have this working i would like to move the code to an embedded platform and i was wondering if it is possible to use the ARM cortex M3 or M4 as a controller for this project.

I am not familiar with how i would tackle this problem of porting my code to an ARM chip, and how i would have the Linux kernel availible. Also questions regarding how to programm the ARM chip, by means on a JTAG programmer?

My prior experience with ARM is with AVR STUDIO and the atmel ATmega32, and i remember that reading its IO is quite different as from Linux.

I dont know if it is a commen problem but i hope someone might be able to point me in the right directions,

Thank you in advance,

3 Answers

7 years, 12 months ago.

This thread is more than 1 year old, but I want to give my contribution.

You will need too much RAM to run Linux on microcontrollers (the uClinux patches were incorporated in the kernel mainline years ago).

Around 2004 I got uClinux running on Netburner MOD-5282 board. This board has only 512KB of Flash but 8MB of RAM. It was difficult to configure and reduce the kernel and busybox to fit in less than 512KB of Flash (if I recall correctly I had only 448KB because the bootloader spent 64KB).

The EmCraft (http://www.emcraft.com) has ported/adapted Linux/uClinux to run on STM32 board with external RAM memory. So normally in these boards you will have more than 2MB of RAM, then it is possible to get Linux/uClinux running it.

If you want something similar to Linux running on low/mid-end microcontrollers then I suggest you to take a look on NuttX (www.nuttx.org). This RTOS follows the POSIX standard and has many subsystems similar to Linux (VFS, MTD, USB, etc) and it comes with a shell-like prompt called NSH (NuttX Shell). NuttX is used on many Drone projects: PX4, VRBRAIN, etc.

I hope this info could help you! Good luck!

9 years, 5 months ago.

You can use a JTAG programmer, or CMSIS-DAP, or manufacturer dependent programmer. The LPC1768 also has a serial bootloader which can be used.

Now the main one: Linux. While a google shows it is possible to run Linux in theory on an M3 (I don't know if the LPC1768 has sufficient memory), you have to realise this will be a very bare linux with alot of stuff removed, and probably still an enormous overhead: Why do you want to run Linux on it? If you want to run Linux, imo switch to Raspberry/Beagle/etc. For an MCU you want to run either no OS, or an RTOS such as the mbed RTOS.

Thank you for your answer,

I am interrested in linux because of the multipule api.s like terminos.h and socket.h which are availible to make things more easy.

I would indeed like to use a beaglebone but then in the end i still will end up with the same questions,

how do i strip the beaglebone down to only the arm cortex and linux and IO;s (such as USB, usb driver, non volitile memory, flash, UART, uart driver) which i am interested in, i cannot put a whole beagle in my embedded systeem but only use it as a development test bord/tool.

posted by Bejoy Sarnakar 05 Jun 2015

Well I don't know about the Beaglebone, however for Raspberry I once had a discussions with someone and decided to look up the difference in cost between making a PCB with random MCU and one with the Raspberry CPU. That was a very short search, since I quickly found out there was no way to get that CPU if you weren't planning to buy 100k of them. So I don't know what kind of numbers you are talking about, but that can be a bit of a problem ;).

Quite frankly, I think it will be alot easier to figure out how to do everything within mbed (or a different development environment, but mbed should do fine), than figuring out if it is possible to run linux on an LPC1768 (quick google tells: no). The LPC4088 or better the GR-PEACH may run it, but quite frankly, I expect it to be easier to just stick to either bare metal or RTOS.

posted by Erik - 05 Jun 2015
9 years, 5 months ago.

look at https://www.olimex.com/Products/OLinuXino/open-source-hardware , this may answer your needs.