Procedure to flash the MonaLisa cc2530 board using Windows and a NodeMCU V1.0 board.
(All the information below is the work of others before me. My only contribution is collecting it and applying it specifically to the Mona Lisa.)
While learning the MonaLisa board from Dr Haas I wanted to be able to flash the cc2530 board using a NodeMCU. My goal was driven by.
- I don’t own an Arduino UNO
- I feel much better flashing a 3.3V device with another 3.3V device. No 5V signals to be concerned about.
First let’s look at the process overall.
Simply stated the NodeMCU is programmed to be a simple programmer module. It will be used to program the MonaLisa with the firmware sent by the Windows computer running CCloader.exe.
There are three parts to the process.
- A windows computer (linux will use nearly the same steps) with two programs installed.
a. Arduino IDE
b. CCloader.exe
The computer will first use the Arduino IDE to load the CCloader.ino onto the NodeMCU board.
Then it will be used in a CMD window to run the CCloader.exe program
-
The NodeMCU will receive data from the CCloader program and send the commands to the MonaLisa to flash the new code.
-
The MonaLisa board: The program target.
CCloader.ino modification to use the NodeMCU
The original CCloader.ino code needs to be modified to enable the correct pins of the NodeMCU. In the Arduino editor replace the UNO pin numbers (around line 92) with:
// Debug control pins & the indicate LED
#define NodeMCU
#ifdef NodeMCU
// define pins for NodeMCU
int DD = 14;
int DC = 4;
int RESET = 5;
int LED = 2;
#else
// define pins for UNO
int DD = 6;
int DC = 5;
int RESET = 4;
int LED = 13;
#endif
Now program the NodeMCU with the modified CCloader.ino
Connections:
Windows computer to NodeMCU: use a standard USB cable.
NodeMCU to MonaLisa:
MonaLisa
Flashing the MonaLisa:
Be sure to close the Arduino IDE else the port will be unavailable to CCloader.exe
With the Windows computer connected to the NodeMCU and the NodeMCU connected to the MonaLisa.
In one directory put the CCloader.exe and the MonaLisa firmware found in the original thread:
(BTW this is an awesome device !)
Create a text file with the following command line in it: (optional)
CCloader.exe <port#> <firmwarefilename.bin> 0
- The port# is the same port# the Arduino used to communicate with the NodeMCU board.
- For some reason I found it did not like me typing the firmwarefilename but worked when I copy and pasted the filename from windows explorer to the text file.
- The 0 (zero) tells CCloader to expect a UNO (even though we have a NodeMCU)
From that directory open a CMD window:
- Copy the command line from the text file to the CMD window (right click paste not Ctrl V)
- Press enter.
You should see something like:
C:\work>CCloader.exe 7 SampleLight_v1.2_butt3reset_ieee_lqi.bin 0
Copyright (c) 2013 RedBearLab.com
CCloader.exe version 0.5
Comport : COM7
Bin file: SampleLight_v1.2_butt3reset_ieee_lqi.bin
Device : Default (e.g. UNO)
Comport open!
<Baud:115200> <data:8> <parity:none> <stopbit:1> <DTR:off> <RTS:off>
File open!
Block total: 512
Enable transmission...
Request sent already!
plus many more lines of text as each block is uploaded.
Completed !