[舊文] 使用 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 的線也可以自動下載燒錄了,應該是更新了那個引導的問題。

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