Day: November 2, 2016

Flash Micromint Bambino 200E board using OpenOCD

This is the way I flashed Bambino 200E board:

1) First create an OpenOCD “lpc4330.cfg” file:

$ sudo cp /usr/local/share/openocd/scripts/target/lpc4350.cfg /usr/local/share/openocd/scripts/target/lpc4330.cfg

Edit this file:

$ vi /usr/local/share/openocd/scripts/target/lpc4330.cfg

And add inside it:

flash bank SPIFI_FLASH lpcspifi 0x14000000 0 0 0 $_CHIPNAME.m4

Now just execute this command to flash “nuttx.bin” in sthe external SPI NOR Flash:

sudo openocd -f interface/stlink-v2.cfg -f target/lpc4330.cfg -c init -c "reset halt" -c "flash write_image erase nuttx.bin 0x14000000"

You should see this output:

Open On-Chip Debugger 0.10.0-dev-00371-g81631e4 (2016-09-26-12:35)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select '.
adapter speed: 500 kHz
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : Unable to match requested speed 500 kHz, using 480 kHz
Info : Unable to match requested speed 500 kHz, using 480 kHz
Info : clock speed 480 kHz
Info : STLINK v2 JTAG v17 API v2 SWIM v4 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.221508
Info : lpc4350.m4: hardware has 6 breakpoints, 4 watchpoints
lpc4350.m4: target state: halted
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x10402c40 msp: 0x10087ff0
auto erase enabled
Info : Found flash device 'win w25q64cv' (ID 0x001740ef)
lpc4350.m4: target state: halted
target halted due to breakpoint, current mode: Thread 
xPSR: 0x61000000 pc: 0x10000154 msp: 0x10087ff0
lpc4350.m4: target state: halted
target halted due to breakpoint, current mode: Thread 
xPSR: 0x61000000 pc: 0x10000198 msp: 0x10087ff0
wrote 131072 bytes from file nuttx.bin in 3.775009s (33.907 KiB/s)

Source: https://sourceforge.net/p/openocd/mailman/message/31311198/