1
votes

I'm trying to run the demo described here: https://blog.adacore.com/ada-on-the-microbit

I followed the tutorial's directions carefully. I did install the 2019 versions of the software instead of the 2018 versions. GPS seems to be installed and working on my windows 7 machine. The project builds but pyocd-flashtool can't seem to recognize my microbit. It reports it as a "generic cortex_m" and throws an exception.

Here's the output:

gprbuild --target=arm-eabi -d -PC:\Domains\ada\microbit_scrolling_text_demo\microbit_example.gpr
C:\Domains\ada\microbit_scrolling_text_demo\src\main.adb -largs -Wl,-Map=map.txt
Compile
   [Ada]          main.adb
Bind
   [gprbind]      main.bexch
   [Ada]          main.ali
Link
   [link]         main.adb

[2019-09-21 18:40:29] process terminated successfully, elapsed time: 02.57s

Retrieving the load address.

arm-eabi-objdump C:\Domains\ada\microbit_scrolling_text_demo\obj\main -h

Load address is: 0x00000000

Creating the binary (flashable) image.

arm-eabi-objcopy -O binary C:\Domains\ada\microbit_scrolling_text_demo\obj\main C:\Domains\ada\microbit_scrolling_text_demo\obj\main.bin

Flashing image to board...

pyocd-flashtool -a 0x00000000 C:\Domains\ada\microbit_scrolling_text_demo\obj\main.bin

WARNING:root:Unsupported board found 9901

INFO:root:DAP SWD MODE initialised

INFO:root:ROM table #0 @ 0xf0000000 cidr=b105100d pidr=2007c4001

INFO:root:[0]<e00ff000: cidr=b105100d, pidr=4000bb471, class=1>

INFO:root:ROM table #1 @ 0xe00ff000 cidr=b105100d pidr=4000bb471

INFO:root:[0]<e000e000:SCS-M0+ cidr=b105e00d, pidr=4000bb008, class=14>

INFO:root:[1]<e0001000:DWT-M0+ cidr=b105e00d, pidr=4000bb00a, class=14>

INFO:root:[2]<e0002000:BPU cidr=b105e00d, pidr=4000bb00b, class=14>

INFO:root:[1]<f0002000: cidr=b105900d, pidr=4000bb9a3, class=9, devtype=13, devid=0>

INFO:root:CPU core is Cortex-M0

INFO:root:4 hardware breakpoints, 0 literal comparators

INFO:root:2 hardware watchpoints

Traceback (most recent call last):

  File "C:\GNAT\2019\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)

  File "C:\GNAT\2019\lib\runpy.py", line 72, in _run_code
    exec code in run_globals

  File "C:\GNAT\2019\bin\pyocd-flashtool.exe\__main__.py", line 9, in <module>

  File "C:\GNAT\2019\lib\site-packages\pyOCD\tools\flash_tool.py", line 214, in main fast_verify=args.fast_program)

  File "C:\GNAT\2019\lib\site-packages\pyOCD\flash\flash.py", line 286, in flashBlock flash_start = self.getFlashInfo().rom_start

  File "C:\GNAT\2019\lib\site-packages\pyOCD\flash\flash_cortex_m.py", line 44, in getFlashInfo raise Exception("Unsupported flash operation on generic cortex_m")

Exception: Unsupported flash operation on generic cortex_m

Could not flash the executable.

[workflow stopped]

Anyone know what could be wrong?

1
Any chance you can investigate that WARNING:root:Unsupported board found 9901 ?LoneWanderer
Found this link github.com/makerdiary/nrf52832-mdk/issues/11 that might be of use ?LoneWanderer
Thanks. I had found that already. There's a list of supported boards in C:\GNAT\2019\site-packages\pyOCD\board\mbed_board.py. The microbit is listed there but I'm not sure why it's not being detected. There's lots of python to trace through. I think I'd rather try installing the 2018 version and see if that magically works before I try to debug all that python. Thoughts?Blaine Osepchuk
IIRC, on my Linux laptop, the micro:bit mounts as a usb drive and I had to manually copy the binary over to it.egilhh
Likewise on Mac - just dropped binaries on the micro:bit drive. Of course you can’t then debug it if things go wrongSimon Wright

1 Answers

1
votes

In C:\GNAT\2019\lib\site-packages\pyOCD\board\mbed_board.py (or the equivalent location on your platform), add this line and it will work.

"9901": BoardInfo( "Microbit", "nrf51", "l1_microbit.bin", ),