These are instructions for setting up a toolchain for flashing and debugging a LPC4330 using an FTDI C232HM cable (FT232H chipset) with OpenOCD and GDB.
- http://www.ftdichip.com/Products/Cables/USBMPSSE.htm
- http://www.ftdichip.com/Support/Documents/DataSheets/Cables/DS_C232HM_MPSSE_CABLE.PDF
- connect the ftdi device to the jtag port of the target board
- red: 5V
- orange: tck
- yellow: tdi
- green: tdo
- brown: tms
- grey: gpioL0 (reserved for srst)
- black: gnd
- clone the Smoothie2 firmware to a folder and follow its readme to install the build environment and gdb
- download and install openocd as is appropriate for your operating system
- download the .cfg files attached to this gist in a place where they will be available to openocd
- run openocd with the command line
openocd -f ft232h.cfg -f lpc4330_spifi_generic.cfg
adding appropriate directories for each file - in a separate terminal start a Smoothie2 build environment with gcc4mbed/BuildShell and run gdb with the appropriate elf file
arm-none-eabi-gdb -n LPC4330_M4/Smoothie2.elf
- tell gdb to connect to open ocd with
target remote localhost:3333
- if all went well you should now be connected and can start running commands
- connect the toolchain as described above and run (in gdb terminal)
monitor reset halt
- run (in gdb terminal)
monitor flash write_image erase Smoothie2.bin 0x14000000
- connect the toolchain to the target and run (in gdb)
monitor halt
- simplest way I have atm is to then run
target remote localhost:3333
again to get it to refresh now that the chip is halted - run
bt
to get the backtrace