Main Goal:
Build a toolchain for 68k, avr and cortex-m3 and cortex-m4 cross developement using recent compilers and libraries.
This supports development for various m68k boards, Arduinos and STM32 Boards (STM32F411 Nucleo, 32F411EDiscovery, Blue Pill )
The used toolchain versions are
The build script can build for the following target architectures
The script works on Windows 10 with MSYS2 and on Ubuntu 23.10 (mantic). It may work on other platforms but i dont run any tests.
The toolchains are packaged into archives suitable for the platformio development environment (https://platformio.org). The archives can be used with eclipse or with make files as well - just unpack them.
The releases section of this git repo contains prebuilt toolchains. This can be used as package repository for platformio and there is a platform definition referencing the toolchain packages for platformio use.
The Platform URL to be used for platformio projects are
There are example projects for m68k avr and arm-none-eabi
all commands are to be typed into the msys shell
pacman -Syu
pacman -Su
pacman -S git
Now clone the git repository.
git clone https://github.com/haarer/toolchain68k.git
Install the required packages for msys
cd toolchain68k
sh install_req_pkg_windows-latest.sh
First install git.
sudo apt-get install git
Now clone the git repository.
git clone https://github.com/haarer/toolchain68k.git
Install the required packages for msys.
cd toolchain68k
bash install_req_pkg_ubuntu-latest.sh
First install git.
sudo yum install git
Now clone the git repository.
git clone https://github.com/haarer/toolchain68k.git
Install the required packages for fedora.
sh install_req_pkg_fedora.sh
Set the wanted target architecture by passing it to the build script as second parameter. In order to change or add target specific build options, see the arm-none-eabi target in the script how to do this.
bash buildtoolchain.sh linux m68k-elf
The script obtains the sources, unpacks them and builds the tools of the toolchain.
The progress of the build is written to a logfile: buildlog.txt
Note that the toolchain script does not install the toolchain, it always creates platformio toolchain packages.
Add the path to the binaries and run gcc
export PATH=$PATH:<your toolchain dir>/bin:
<architecture>-gcc --version
for example
export PATH=$PATH://home/mac/toolchain68k/toolchain-avr-current/bin/bin:
avr-gcc --version
see the linker scripts called for the make file. One example uses toolchain provided startup files and linkerscript (m68k-example2), the other one uses custom linker scripts and own startup files (m68k-example)
cd examples/m68k-example
make
This example assumes an arduino mega connected to usb (see makefile and change com port accordingly) and is a simple led blink example.
cd examples/avr-example-example
make
make flash
This example assumes blue pill STM32F103C8 board connected via a STLINK-2 adapter to usb (see makefile ) and is a simple led blink example. It requires the ST Microelectronics Std_Peripheral Lib unpacked into the example directory
cd examples/arm-none-eabi
make
make flash