Can I use an ESP32 to program/flash an nRF51822 directly without a PC connected to the nRF? I am designing a VERY small device with two microcontrollers on the same PCB, and would like to save space by having just one interface for flashing both chips. Thus I'm wondering how I may use an ESP32 (on the PCB) to flash an nRF chip (also on the PCB). For clarity, I can have a computer connected to the ESP32.
Asked
Active
Viewed 211 times
1
-
1yes and it is quite simple. You can have the ESP32 implement a SWD interface using two gpio. The serial flash of the ESP32 should have enough space for the flash image of the NRF51. There are few open source projects for the programming code. Openocd comes to mind and there are others. Note the NRF51 series is basically obsolete. I'd suggest you look at the NRF52 series. – Kartman Jan 21 '22 at 12:30
-
1As an addition to @Kartman comment, you can also program an UART bootloader to NRF51 and use it to program it from ESP32 later. It might be simpler than a SWD. – NStorm Jan 21 '22 at 12:33
-
1https://hackaday.com/2021/07/01/esp32-turned-handy-swd-flasher-for-nrf52-chips/ – Ron Beyer Jan 21 '22 at 12:57