问题
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:
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", ),
来源:https://stackoverflow.com/questions/58045255/unable-to-get-the-ada-scrolling-text-demo-working-on-the-microbit-on-gnat-2019-c