Author Topic: Bootloader for custom nrf52840  (Read 2205 times)

0 Members and 1 Guest are viewing this topic.

Offline Kageni

  • Thread Starter
  • Posts: 24
Bootloader for custom nrf52840
« on: Fri, 04 June 2021, 14:02:13 »
Hi I am trying to find a bootloader that works with my custom nrf52840 board. It is based on the PTR9818 module https://freqchina.en.alibaba.com/product/62501832603-810441729/bluetooth_5_0_module_mesh_module_zigbee_ANT_nRF52840_module_PTR9818.html, which doesn't ship with a bootloader. I can connect to the chip with a J link mini edu, and have tried flashing a number of different bootloaders. I am able to successfully flash but then it shows "USB device not recognized" when I plug in the USB. This happens with the adafruit bootloader, as well as the different variants of the ada fruit bootloader such as for dongle, dk, bluemicro, bluefruit express etc. The usb drive appears on my pc, but if I try to copy my UF2 to it, it says "please insert disk into usb drive". I have tried flashing with jlink command line tools, arduino, and jlink commander. They are all able to flash successfully, but the problem remains the same.

I am not sure where to go from here. Is it possible to flash my ZMK UF2 file via SWD for now, just to test if it will work as a keyboard? I am not super familiar with this stuff.


Offline ice9js

  • Posts: 26
Re: Bootloader for custom nrf52840
« Reply #1 on: Sat, 05 June 2021, 14:04:45 »
The Adafruit bootloader should work and as far as I'm aware that's indeed what most of the ZMK folks are using on their boards. The module doesn't really matter much as long as it's the same chip underneath. You might have to update the config a little for your board although as far as USB is concerned, I don't think it affects much. Hard to tell without seeing your config but I'm sure we can figure something out if you can share it somewhere.

I am not sure where to go from here. Is it possible to flash my ZMK UF2 file via SWD for now, just to test if it will work as a keyboard? I am not super familiar with this stuff.

You can definitely just flash your ZMK image directly to the board but when you do that, you need to flash the hex file, not the UF2 image.
Theoretically `west build` and `west flash` should do it if you've got everything configured correctly, might want to look at other board configs if you run into trouble. ZMK docs also do a reasonable job of describing the process: https://zmkfirmware.dev/docs/development/build-flash/.

Hope this helps.

Offline mrninhvn

  • Posts: 24
Re: Bootloader for custom nrf52840
« Reply #2 on: Sun, 06 June 2021, 08:29:53 »
Are you check usb wiring?

Gửi từ Pixel XL của tôi bằng cách sử dụng Tapatalk


Offline Kageni

  • Thread Starter
  • Posts: 24
Re: Bootloader for custom nrf52840
« Reply #3 on: Sun, 06 June 2021, 12:40:17 »
What do you mean by configs? How can I share them?

Offline Kageni

  • Thread Starter
  • Posts: 24
Re: Bootloader for custom nrf52840
« Reply #4 on: Sun, 06 June 2021, 13:20:29 »
Ok I definitely feel dumb. My daughtercard had a slightly different 4 pin breakout then I did on my main PCB, and so D+ and D- were reversed and that's what was causing the problem. Thanks for the suggestion, it works now! A reminder to double check the simple stuff before spending hours trying to create a new bootloader.

Offline mrninhvn

  • Posts: 24
Re: Bootloader for custom nrf52840
« Reply #5 on: Sun, 06 June 2021, 13:39:22 »
Ok I definitely feel dumb. My daughtercard had a slightly different 4 pin breakout then I did on my main PCB, and so D+ and D- were reversed and that's what was causing the problem. Thanks for the suggestion, it works now! A reminder to double check the simple stuff before spending hours trying to create a new bootloader.
I'm glad you solved it, I also got only one side of the usb c port yesterday :))

Gửi từ Pixel XL của tôi bằng cách sử dụng Tapatalk