I decided to use LPCScrypt from NXP to flash the Bambino-200E board. This way other people could to flash NuttX inside the board without a JTAG/SWD programmer, because LPCScrypt uses DFU to do that.
Initially I downloaded the LPCScrypt 1.8 for Linux from NXP site: http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/lpc-cortex-m-mcus/software-tools/lpc-microcontroller-utilities/lpcscrypt-v1.8.0:LPCSCRYPT
I read the documentation and installed the dependencies and support to run 32-bits application. But LPCScrypt installer was not starting:
$ ./lpcscrypt_1.8.0_723_Linux-x86 invalid command name "bind" while executing "::unknown bind Text " ("uplevel" body line 1) invoked from within "uplevel 1 $next $args" (procedure "::obj::Unknown" line 3) invoked from within "bind Text " (procedure "::InstallJammer::InitializeGui" line 19) invoked from within "::InstallJammer::InitializeGui " (procedure "::InstallJammer::InitInstall" line 68) invoked from within "::InstallJammer::InitInstall" (file "/installkitvfs/main.tcl" line 22457)
Fortunately Jim Wolfman from Smoothie project had the LPCScrypt as a tar ball, then I don’t need to install:
$ wget blog.wolfman.com/files/lpcscrypt.tgz $ tar xvf lpcscrypt.tgz
I need to create a udev rule to avoid the USB CDC/ACM port be used as modem:
$ sudo vi /etc/udev/rules.d/99-lpcscrypt.rules SUBSYSTEM=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="000c", MODE="0666" SUBSYSTEM=="tty", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0083", MODE="0666" ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0083", ENV{ID_MM_DEVICE_IGNORE}="1"
Also you need to install the dfu-util program before using the lpcscrypt.
So, now jump/connect the two pins of BOOT (JP1) and reset the board. The board will enter on DFU mode, then you can execute the boot_lpcscrypt:
$ sudo ./lpcscrypt/scripts/boot_lpcscrypt
If the above command fails, you can try to run it manually:
$ sudo dfu-util -d 0x1fc9:0x000c -c 0 -i 0 -t 2048 -R -D ./lpcscrypt/bin/LPCScrypt_140.bin.hdr
You can run dmesg to see if ttyACM0 was detected after running the LPCScrypt binary.
Finally you can run this command to flash nuttx.bin inside the external flash of Bambino board:
$ ./lpcscrypt/bin/lpcscrypt program -d /dev/ttyACM0 +c nuttx.bin SPIFI
That is it. I hope it works for you too.
One thought on “Using LPCScrypt to flash firmware on Bambino board”