Introduction

Mecrisp-Across is a very strong optimising cross compiler running on a STM32F4 Discovery, Ti TM4C1294 or ARM Linux and generating code for small classic MSP430 chips like MSP430F2012. It is capable of global optimisations, automatic inlining, dead code elimination and register allocation of both data and return stack across control structures. On a TM4C1294 host, Mecrisp-Across offers IO port redirection into real hardware for interactive testing before crosscompilation.

In A Nutshell

The C Programming Languange takes C source files and produces a BINARY file which is then flashed to the target MCU. Everything needed to run the program on the target chip is included and the binary can be very compact due to the C Compiler making multiple passes over the source to produce highly optimised output.

However C is not interactive like Forth. If you want to test a LED, you have to write a program to turn the led on, then compile and flash that program into the target.

A Tethered Forth takes a Forth source file and produces a BINARY file which is then Flashed to the target MCU. Everything needed to run the program on the target chip is added and the binary can be very compact due to the Forth Compiler making multiple passes over the source to produce highly optimised output.

However a Tethered Forth IS INTERACTIVE. If you want to test a LED, you can do that at the terminal and the LED will turn on immediately, or off immediately.

PLUS it will also create a binary file for your records and flash it to the target if you want.

Summary

A Tethered Forth can do everything C can do, and it is also INTERACTIVE.

The Forth Solution

This allows near real time speed during the development process and yet produces a small compiled binary ‘Machine Code’ program for the cheaper 2KB Flash Microcontrollers in exactly the same way that C does.

The equipment consists of a fast and capable Cortex M Microcontroller, “The Host” with lots of Flash and speed running Mecrisp-Stellaris and talking to a serial terminal for the developer to use.

The Target is a memory limited MSP430 Microcontroller which is Tethered” to the Host with a four wire cable allowing remote control via JTAG.

To the developer, it looks and feels like the Terminal is connected directly to the Target even though it’s the Host doing all the work by sending special JTAG commands to Target.

When the Forth program is finished, and the User command “FLASHTARGET” is executed, the Host consolidates all the Words, constants and variables etc then compiles them into a single Machine Code program and flashes it to the Target to allow standalone operation without the Tether.

Mecrisp-Across

Mecrisp-Across was designed by Matthias Koch, the author of Mecrisp-Stellaris (and many other applications) who said that “Mecrisp-Across is the most complicated compiler I have ever written”.

Mecrisp Across :

  • Is designed for the very popular Texas Instruments MSP430 MCUs available in DIP packaging, making them easy to hand solder.

  • Runs on the smallest, low cost MSP430 chips some as low as $0.78 USD each in 100x quantities, from Mouser.com. ( MSP430FR2000IPW16R 500 Byte FRAM, 512 Byte SRAM, 1.8 - 3.6V, 16 pin TSSOP )

  • Is a “Tethered Forth” system which allows writing and testing Forth code on a Target too small to host Forth internally.

  • Generates and flashes the project binary image to the Target from the Host via JTAG.

  • Includes a very strong optimising cross compiler running on a TM4C1294 which generates Machine Code for Texas Instruments MSP430 chips such as the MSP430F2013 (14 pin DIP).

  • Compiler is capable of global optimisations, automatic inlining, dead code elimination and register allocation of both data and return stack across control structures.

Definitions for V0.9

See definitions target 0.9 for the complete list of Target Words.

Host

The (cross compiling) HOST is a dedicated Cortex-M4 class mcu with tether or a tether-less PC or Laptop.

The Target

The Target can be a Texas Instruments MSP-EXP430G2 Board with a DIP MSP430 or a home made pcb with a SMT MSP430, it’s up to you.

_images/msp-exp430g2.jpg _images/pcb-round-pins-mcu2.jpg

Ready to Get Started on STM32F4 Discovery or TM4C1294 Tiva ?

Jump to Installing on the STM32F0 Discovery Board This is the latest release and the preferred board.

or

Jump to Installing on the Tiva TM4C1294 Board. This is the first release of Mecrisp-Across and not recommended unless you must have Ethernet.

No, I want a better explanation of Mecrisp-Across please ?