Hi team,
I am working with nrf52840 module on our custom board.
For flashing I want to use FT2232H. I got a few suggestions from uncle Google about using the openOCD. But I cannot find proper steps for the same. I tried multiple trial and error scenarios to flash the MCU using the FT2232H, but could not!
Could you please help us with the steps to flash the nRF using the openOCD and FT2232H?
Please let me know if any more details are required!
Thanks in advance for your help!
- Connect the FT2232H to your nRF52840 custom board. The connections should be:
- FT2232H ADBUS0 → nRF52840 SWDIO
- FT2232H ADBUS1 → nRF52840 SWCLK
- FT2232H GND → nRF52840 GND
- Create an OpenOCD configuration file for your setup. Let’s call it
nrf52840_ft2232h.cfg
.
Here’s a basic template:
interface ftdi
ftdi_vid_pid 0x0403 0x6010
ftdi_channel 0
ftdi_layout_init 0x0018 0x05fb
ftdi_layout_signal nTRST -data 0x0010
ftdi_layout_signal nSRST -data 0x0020 -oe 0x0020
transport select swd
source [find target/nrf52.cfg]
- Open a terminal and navigate to the directory containing your OpenOCD configuration file and the firmware file you want to flash.
- Run OpenOCD with your configuration file:
openocd -f nrf52840_ft2232h.cfg
- In a new terminal window, connect to the OpenOCD server using telnet:
telnet localhost 4444
- In the telnet session, run the following commands to flash your firmware:
halt
program path/to/your/firmware.hex verify
reset
exit
Replace path/to/your/firmware.hex
with the actual path to your firmware file.
If successful the nRF52840 should be programmed
Hi Russell,
Thank you so much for your quick help.
Using the steps you mentioned I can move forward from my last error. But now I am getting the below attached error.
Could you please help me with that?
Thanks in advance.
- Incorrect wiring:
- Double-check that SWDIO and SWCLK are connected to the correct pins
- Verify there’s a solid ground (GND) connection between FT2232H and target
- Ensure no wires are loose or disconnected
- Power supply issues:
- Confirm your nRF52840 is properly powered with 3.3V
- Check if the voltage level is stable
- Make sure the power supply can provide sufficient current
- Try reducing the clock speed: Let’s modify the OpenOCD configuration to use a lower speed:
# Add this line to your OpenOCD config file before 'init'
adapter speed 2000
# or even lower if needed:
adapter speed 1000
- Additional troubleshooting steps:
- Try adding a pull-up resistor (10kΩ) on the SWDIO line
- Make sure you’re using Channel A of the FT2232H
- Check if your target is in a reset state
- Verify that the nRF52840 hasn’t enabled any security features that might block debugging
Could you:
- Confirm which pins on the FT2232H you’ve connected to SWDIO and SWCLK?
- Are you powering the nRF52840 separately or through the FT2232H?
- Ensure you have the FTDI drivers