我按照 adacore 教程显示滚动文本 ( https://blog.adacore.com/ada-for-microbit-part-1-getting-started ),但无法在我的 microbit 上使用它。
也许我的 microbit 是尚未受支持的较新版本?我怀疑这是因为我第一次尝试刷新到开发板时不支持我的开发板 ID (9904)。我使用了此处描述的修复:Unable to get the Ada scrolling text demo working on the microbit on GNAT 2019 community edition并在 board_ids.py 中添加以下行:
"9904": BoardInfo( "micro:bit", "nrf51", "l1_microbit.bin", ),
完成此操作后,我能够将滚动文本示例闪烁到板上,但出现以下警告:
0000601:WARNING:common:STLink and CMSIS-DAPv2 probes are not supported because no libusb library was found.
现在的问题是只有一个 LED 亮起。似乎单个 LED 会根据基于其闪烁模式的输入文本正确点亮。我不确定 libusb 警告是否是导致问题的原因。
我使用的是 GNAT 2020 版本的 x86_64 和 arm-elf。我已经被困在这个问题上有一段时间了,非常感谢任何建议。谢谢!
编辑:
我使用的是 Windows 10。
我不认为问题与 pyocd/libusb 有关,因为在确保我在 GNAT 中的 python exe 所在目录中有一个 libusb dll 后,在刷新到开发板时我不再收到任何警告。滚动文本示例仍然无法正常工作(只有一个 LED 亮起)。
我也在另一台计算机上尝试过此操作,结果相同。
来自https://github.com/AdaCore/Ada_Drivers_Library/issues/379看起来 ada 驱动程序库不支持新版本的主板?但这个问题涉及加速度计版本,我不确定这是否是我的情况的原因。
最佳答案
您的 LED 问题将是 V2 板重新设计了 GPIO 引脚和 LED 之间的关系(现在非常更加有用!)
microbit.org 页面 here说
The LED matrix is physically laid out as a 5x5. On the V2 board this is implemented as a 5x5 matrix, but in the V1, this is implemented as a scanned matrix of 9x3 (i.e. 9 columns by 3 rows). Row 2 Col 8, and Row 2 Col 9 are not used.
您需要在标记为“Pixel to IO Pins”的部分中修改 Ada_Drivers_Library/boards/MicroBit/src/microbit-display.adb
。
关于microbit 上的 Ada : scrolling text example not working, 未找到 libusb 库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65859253/