Open myyong opened 2 months ago
These are the issues I encountered when running OMicroB/targets/microbit/tests/display/make, to create mbdisplay.hex.
Somewhere, there are system calls resulting in errors like _lseekr.c:(.text._lseek_r+0x14): warning: lseek is not implemented and will always fail. I don't want to implement these, because of here
I encountered the error _unwind-arm.c:(.text.get_eit_entry+0x94): undefined reference to `__exidxend' which prevented creation of hex file. I added the following:
.ARM.exidx :
{
__exidx_start = .;
*(.ARM.exidx*)
__exidx_end = .;
} >FLASH
to the linker targets/microbit/byterun/nRF52833.ld. 602b9fed2cec303f7e7efeb45711901eb614d79b.
Not sure this is a great idea. The error stems from arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -fno-exceptions -fno-unwind-tables -Os -Wall \ -Wl,-Os -fdata-sections -ffunction-sections -Wl,--gc-sections \ -specs=nosys.specs -D__MICROBIT__ \ -T /Users/myong/Documents/workspace/OMicroB/src/byterun/microbit/nRF52833.ld \ -nostartfiles -lnosys mbdisplay.arm_o \ /Users/myong/Documents/workspace/OMicroB/src/byterun/microbit/startup2.o \ /Users/myong/Documents/workspace/OMicroB/src/byterun/microbit/microbian2.a \ -lm -lc -lgcc -o mbdisplay.arm_elf
.
Options:
-fno-exceptions -fno-unwind-tables
options are already on. -lnosys
ensures that minimal system libraries are used. Therefore I think Ensure the linker script properly defines the .ARM.exidx section.
is my quickest option. I may be stuck in debugging hell for weeks in future for this.
Flashing the hex to microbit using omicrob -flash <file.hex> -device $DEVICE
didn't work for me. I copied the hex file over to the mounted device instead.
This documents my efforts to deploy mbdisplay.ml on a microbit.
I found that the README is broadly accurate. Here are some issues I encountered when setting up the environment.
Obytelib1.6 has following dependency: ocaml](https://ocaml.org/p/ocaml/latest) >= "4.02.0" & < "4.15.0"
So I used
opam switch create omicrob4.12 4.12.0
. ocaml4.14 may work just as well.I ran into basic linker errors (eg. # include). Turns out I needed I needed the full arm tool chain as explained here
As a result, the etc/Makefile.conf created by
./configure -target microbit
looks like this:I removed
* open Simul *
because it pops up an unused module warning. b0265bd342845c6a468379e4c34a9ac56275ec2d The alternative is to silence the warning by editing-w A-4-58-70
inocamlc.opt -w A-4-58-70 -warn-error A -safe-string -strict-formats -strict-sequence
.I installed Graphics:
opam install Graphics
These got
./configure -target microbit && make && make install
to set up environment working.