[旧文] 使用 arduino 串口烧写 nrf52832

adafruit bluefruit feather

今天收了个 adafruit bluefruit feather 的 nrf52832 版型 50 多块。

图片.png

arduino 官方教程

刚拿到手的时候,我是一脸懵逼,好像没有自动下载电路,然后拿到 platformio 里就爆出这些错误。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "nordicsemi\__main__.py", line 294, in serial
File "nordicsemi\dfu\dfu.py", line 235, in dfu_send_images
File "nordicsemi\dfu\dfu.py", line 157, in _dfu_send_image
File "nordicsemi\dfu\dfu_transport_serial.py", line 115, in open

Possible causes:
- Selected Bootloader version does not match the one on Bluefruit device.
Please upgrade the Bootloader or select correct version in Tools->Bootloader.
- Baud rate must be 115200, Flow control must be off.
- Target is not in DFU mode. Ground DFU pin and RESET and release both to enter DFU mode.

本来想当作一般的 arduino 来操作的,不过感觉应该是要进入 dfu 模式之类的,比如把 dfu 拉低到地。

也就是图中的左下角的 dfu 接到 g(gnd)上,这时候,这个板子的灯开始转变,说明是进入了dfu模式。

那么我琢磨的应该可以烧进去了,结果发现,还是不行,这时候查阅了资料后发现,它需要烧入一个引导程序,但这个引导程序哪里来呢?

大多数人是从 arduino 上取出来的,它应该是存在 nrf 的官方 nordicsemi 上,只是被 arduino 封装出来了,那么在哪里呢?

我截图备注一下。

图片.png

所以这时候,板子开始闪烁,应该是串口的 RX 灯,表示烧录新的引导程序。

有了引导后,我尝试了最初的烧写程序,这会,无论是 platformio 还是 arduino 都可以烧入 nrf52832 了。

图片.png

注意,断开 dfu 接地(接线在下图)才能正常运行你写的程序,果然还是需要自动下载电路鸭,不然太原始了:)。

图片.png

现在可以开始的编写 nrf52832 啦,另外,这些操作也适用其他 nrf 的硬件。(大概趴haha)

最后发现,从此之后不需要 接 dfu 的线也可以自动下载烧录了,应该是更新了那个引导的问题。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章