Posts tagged with: arm

Tinycortex, part 3. Offline compiling

The MBED IDE is an online IDE, which is less pleasant if you want to work without internet or prefer your own editor. Luckily it is possible to export an MBED project and use an offline compiler. It can export to KEIL, GCC and a few others.

KEIL is a well known IDE now owned by ARM. They offer a free 32KB limited version and with the Tinycortex having 32KB of flash memory that limit is no issue. KEIL is Windows only and the unlimited version is quite expensive. A guide on exporting to KEIL can be found here. Because KEIL just works it’s the recommended way for offline compiling.

It is also possible to export to a GCC makefile which is especially nice for people using Linux or OS X.  An ARM compiler is required, the most used and free one being GCC ARM Embedded, which is being maintained by ARM employees. On a Linux system with make and the ARM compiler installed compiling the code is just typing “make” in the terminal. After a few seconds the output for the Blinkaled project you can find on my github is:
Selection_020

Sadly enough it’s not possible to just copy the generated .bin file on the tinycortex. With just the makefile the binary file isn’t checksummed. A small script in the “Tools” folder called checksum is used to checksum the file. Place it in the folder with the binary and run it with the command “./checksum filename.bin”. The checksum script is compiled for Linux, OS-X or Windows users need to recompile it using the command “gcc -o checksum checksum.c”.

Linux and OS-X users have to use the dd command to place the binary on the Tinycortex.


Tinycortex, part 2.

The last post described the dev board now called the Tinycortex. In this post I’m going to explain how to use it. All files can be found on the following github page. On this page you can find the hardware design files, a few scripts to make using them in Linux easier, a blink a led project that can be compiled offline and the pinout. The pinout of the Tinycortex is the following:

pinout

It has 32 IO pins, 3 UART, 2 SPI, 1 I2C and 8 analog inputs. It also has 1 LED and 1 button on the PCB for small tests and projects.

To use the Tinycortex in the MBED online compiler the MBED LPC11U24 can be selected. One header file needs to be included. It can be found on the github page or in the example blink a led project on the MBED website. After the header is added the pin names IC1 to IC33 and LED1 can be used in the code. Or you can import the blink a led example and modify that.

After compiling the MBED environment will generate a .bin file. To place this file on the Tinycortex connect it to the USB port with the ISP button pressed. Release the button after plugging it in and you should see a 32KB flash drive with one file, firmware.bin, on it. Remove this file and place the new .bin file on it. After that press the reset button (labeled RST) and the new code will be executed.


A tiny MBED compatible dev board

I like the MBED boards, they are small, fast and the libraries and community are great. The only downside is the price. The cheapest official MBED board is around 50 euro’s and some cheaper supported boards like the ST nucleo boards don’t fit in a breadboard. I wanted to make a small MBED compatible dev board that fits in my breadboard and costs a lot less then the real MBED boards so I can just leave them in a project without caring too much.

I decided to use the LPC11U24 as this is one of the two microcontrollers that is also used for the real MBED boards. I have had some bad experiences with the MBED libraries for the ST microcontrollers so I’ll stick to the well supported NXP one.  For the rest a SMPS 5V to 3.3V was something I’d wanted. A linear regulator would get a little bit too hot if more then 250mA of current would be requested from the 3.3V line. I also made everything SMD, including the pinheaders. It just feels a bit cleaner for me to have zero through hole parts :)

The end product looks like this and I shall call it: the Tinycortex, because I suck at making names:

WP_20150805_009

It is even a bit smaller then the real MBED, has 32 IO pins and looks cute. What more to wish for :)

In the next post I will show the pinout and how to use it in case anyone makes one and for the people I gave one as a reference.