Compiling

Compiling Mecrisp-Stellaris is easy.

  • You’ll need none-arm-eabi installed, which is available for FreeBSD. OpenBSD and Linux (at least).

Compile example for mecrisp-stellaris-x.x.x

  • cd mecrisp-stellaris-x.x.x/mecrisp-stellaris-source
  • ./assemble
  • ./tidyup
  • The new image is now available in mecrisp-stellaris-x.x.x/your-mcu/mecrisp-stellaris-your-mcu.bin (except Linux)

Kernel Patches

  1. Apply the patch Apply the patch
  2. Compile Mecrisp-Stellaris

Testing A Patch Before Applying

patch --dry-run  < myfile.patch

mecrisp-stellaris-2.3.7/mecrisp-stellaris-source/common% patch --dry-run < simpler-stackprint-deepinsight.s.patch
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- deepinsight.s      2017-05-10 13:00:55.263208835 +1000
|+++ deepinsight-simplestackprint.s     2017-04-28 09:30:54.000000000 +1000
--------------------------
Patching file deepinsight.s using Plan A...
Hunk #1 succeeded at 87.
Hunk #2 succeeded at 116.
done

Applying patches

patch < myfile.patch

Reversing Patches

patch -R < myfile.patch

Patch: Simpler Stack Printer

Reason: While some write new Words to modify the default Stack printer ”.s”, I prefer to patch the assembly source code.
From :         Stack: [7 ] 42 1 2 3 4 5 6  TOS: 7  *>
To:            .s [7 ] 42 1 2 3 4 5 6 7  ok.

STM32F0

Patch: Move Terminal From USART1 to USART2

Reason: To provide a byte of eleven consecutive bits, PA-4 to PA-15.
  • USART 1 is the default
  • Both USART1 and USART2 are enabled with SF1 which is also default
Board MCU Comms Type TX RX
STM32F0 Discovery STM32F051R8 USART1 PA9 PA10
or        
STM32F0 Discovery STM32F051R8 USART2 PA2 PA3

Patch: Add RTS Handshaking To USART1

Reason, so the MCU UART can tell the terminal to stop sending as required. Note this won’t fix the Mecrisp-Stellaris compiler receiving Words too fast with the resultant freeze. A terminal that handles flow control via ‘OK’ processing such as e4thcom is still required for maximum performance and minimum delay.

Patch: Add RTS Handshaking at 460800 Baud To USART1

Reason: Because at 460800 Baud you’ll need RTS handshaking!