Hi,
I'm building a port of libmaple for OpenBSD. I'll try to simplify the
steps I followed as much as possible.
I have the Sourcery Unix toolchain available on LeafLabs website
(gcc-arm-none-eabi-latest-linux32.tar.gz) as a base for the new
toolchain. In Linux, I can compile and upload a binary for a Maple Mini
without problems (without the IDE).
From Linux, I extracted the configure args of the Unix
toolchain with:
$ arm-none-eabi-gcc -v
Using built-in specs.
Target: arm-none-eabi
Configured with: /scratch/julian/2010q1-release-eabi-lite/src/gcc-4.4-2010q1/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-none-eabi --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --enable-extra-sgxxlite-multilibs --with-gnu-as --with-gnu-ld --with-specs='%{O2:%{!fno-remove-local-statics: -fremove-local-statics}} %{O*:%{O|O0|O1|O2|Os:;:%{!fno-remove-local-statics: -fremove-local-statics}}}' --enable-languages=c,c++ --disable-shared --disable-lto --with-newlib --with-pkgversion='Sourcery G++ Lite 2010q1-188' --with-bugurl=https://support.codesourcery.com/GNUToolchain/ --disable-nls --prefix=/opt/codesourcery --with-headers=yes --with-sysroot=/opt/codesourcery/arm-none-eabi --with-build-sysroot=/scratch/julian/2010q1-release-eabi-lite/install/arm-none-eabi --with-gmp=/scratch/julian/2010q1-release-eabi-lite/obj/host-libs-2010q1-188-arm-none-eabi-i686-pc-linux-gnu/usr --with-mpfr=/scratch/julian/2010q1-release-eabi-lite/obj/host-libs-2010q1-188-arm-none-eabi-i686-pc-linux-gnu/usr --with-ppl=/scratch/julian/2010q1-release-eabi-lite/obj/host-libs-2010q1-188-arm-none-eabi-i686-pc-linux-gnu/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-cloog=/scratch/julian/2010q1-release-eabi-lite/obj/host-libs-2010q1-188-arm-none-eabi-i686-pc-linux-gnu/usr --disable-libgomp --enable-poison-system-directories --with-build-time-tools=/scratch/julian/2010q1-release-eabi-lite/install/arm-none-eabi/bin --with-build-time-tools=/scratch/julian/2010q1-release-eabi-lite/install/arm-none-eabi/bin
Thread model: single
gcc version 4.4.1 (Sourcery G++ Lite 2010q1-188)
So I sorted this all to create a cross compiler toolchain based on the
toolchain above in OpenBSD. After compiling binutils, gcc, newlib and
libstdc++-v3, I succeeded compiling libmaple + a simple Blink. Then
downloaded maple_mini.bin into the board with dfu-util 0.8.
The problem: after downloading the .bin and resetting the board, the
program won't run after the bootloader stops. I've tried all sorts of
configure args possible for gcc, but somehow gcc isn't generating code
compatible with Cortex-M3/Maple or is something else I'm missing.
Question: are there something obvious am I missing? Maybe some starting
point or something like alike.
Also had to modify support/make/target-config.mk
-TARGET_FLAGS += -mcpu=cortex-m3 -march=armv7-m
+TARGET_FLAGS += -mcpu=cortex-m3
since this leads to:
error: switch -mcpu=cortex-m3 conflicts with -march= switch
Any help is appreciated.
Thank you.