microbit-foundation / standalone-error-program

A small, standalone (No CODAL) bit of code to display errors on the micro:bit, for use in DAPLink and as a template for BLE bootloader
MIT License
0 stars 1 forks source link

Python 2 only? #14

Open microbit-carlos opened 3 years ago

microbit-carlos commented 3 years ago

Trying to build this with Python 3.6 threw the following error:

mkdir _build
cd _build && mkdir nrfx_nrf52833_xxaa
Assembling file: gcc_startup_nrf52833.S
Compiling file: system_nrf52833.c
Compiling file: MicroBitSAPanicFont.c
Compiling file: MicroBitSAPanic.c
Compiling file: main_forever.c
Linking target: _build/nrfx_nrf52833_xxaa.out
   text    data     bss     dec     hex filename
   1892     116      28    2036     7f4 _build/nrfx_nrf52833_xxaa.out
Preparing: _build/nrfx_nrf52833_xxaa.hex
Preparing: _build/nrfx_nrf52833_xxaa.bin
DONE nrfx_nrf52833_xxaa
Traceback (most recent call last):
  File "build.py", line 56, in <module>
    bin = f.read();
  File "/Users/microbit-carlos/.pyenv/versions/3.6.8/lib/python3.6/codecs.py", line 321, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbd in position 4: invalid start byte

Switching to Python 2.7 worked.

I haven't looked into the issue at all, so just assuming is a Python 2 vs 3 thing. If so we should probably update the README to indicate it.

martinwork commented 3 years ago

@microbit-carlos Created https://github.com/microbit-foundation/standalone-error-program/pull/15

microbit-carlos commented 3 years ago

Thank you Martin! Btw, just to clarify I didn't mean we needed to look into this right away, just making a note for future updates, but thanks for the quick turnaround!

martinwork commented 3 years ago

No problem. I was curious!

Note... The issue is duplicated in ram-build.py