redbearlab / ccloader Goto Github PK
View Code? Open in Web Editor NEWBurn BLE Mini (CC2540) firmware using Blend Micro board.
Burn BLE Mini (CC2540) firmware using Blend Micro board.
Ccloader can not work with the Arduino with 168p microcontrоller due lack of the RAM. This Patch resolve this issue. After uploading sketch to the Arduino there is need to disconnect DTR -> Reset (if it used).
--- CCLoader.ino 2020-11-19 10:21:59.000000000 +0300
+++ ccloader168.ino 2020-11-19 11:29:07.000000000 +0300
@@ -452,6 +452,47 @@
}
/**************************************************************************//**
+* @brief Verify 1-32767 bytes from DUP's flash against a given buffer on the
+* programmer.
+* @param bank Flash bank to read from [0-7]
+* @param address Flash memory start address [0x0000 - 0x7FFF]
+* @param values Pointer to destination buffer.
+* @return Error. Zero if no errors
+******************************************************************************/
+unsigned char verify_flash_memory_block(unsigned char bank,unsigned short flash_addr,
+ unsigned short num_bytes, unsigned const char *values)
+{
+ unsigned char instr[3];
+ unsigned short i;
+ unsigned short xdata_addr = (0x8000 + flash_addr);
+ unsigned char err = 0;
+ unsigned char val;
+
+ // 1. Map flash memory bank to XDATA address 0x8000-0xFFFF
+ write_xdata_memory(DUP_MEMCTR, bank);
+
+ // 2. Move data pointer to XDATA address (MOV DPTR, xdata_addr)
+ instr[0] = 0x90;
+ instr[1] = HIBYTE(xdata_addr);
+ instr[2] = LOBYTE(xdata_addr);
+ debug_command(CMD_DEBUG_INSTR_3B, instr, 3);
+
+ for (i = 0; i < num_bytes; i++)
+ {
+ // 3. Move value pointed to by DPTR to accumulator (MOVX A, @DPTR)
+ instr[0] = 0xE0;
+ val = debug_command(CMD_DEBUG_INSTR_1B, instr, 1);
+ err = values[i] != val ? 1 : err;
+
+ // 4. Increment data pointer (INC DPTR)
+ instr[0] = 0xA3;
+ debug_command(CMD_DEBUG_INSTR_1B, instr, 1);
+ }
+
+ return err;
+}
+
+/**************************************************************************//**
* @brief Writes 4-2048 bytes to DUP's flash memory. Parameter \c num_bytes
* must be a multiple of 4.
* @param src Pointer to programmer's source buffer (in XDATA space)
@@ -526,9 +567,11 @@
Serial.begin(115200);
// If using Leonado as programmer,
//it should add below code,otherwise,comment it.
- while(!Serial);
+ // while(!Serial);
}
+unsigned char rxBuf[514];
+
void loop()
{
unsigned char chip_id = 0;
@@ -536,6 +579,13 @@
unsigned char Continue = 0;
unsigned char Verify = 0;
+ for (unsigned char j = 0; j < 3; j++){
+ digitalWrite(LED, HIGH);
+ delay(50);
+ digitalWrite(LED, LOW);
+ delay(50);
+ }
+
while(!Continue) // Wait for starting
{
@@ -583,7 +633,6 @@
digitalWrite(LED, HIGH);
unsigned char Done = 0;
unsigned char State = WAITING;
- unsigned char rxBuf[514];
unsigned int BufIndex = 0;
unsigned int addr = 0x0000;
while(!Done)
@@ -633,18 +682,25 @@
{
unsigned char bank = addr / (512 * 16);
unsigned int offset = (addr % (512 * 16)) * 4;
- unsigned char read_data[512];
- read_flash_memory_block(bank, offset, 512, read_data); // Bank, address, count, dest.
- for(unsigned int i = 0; i < 512; i++)
- {
- if(read_data[i] != rxBuf[i])
- {
- // Fail
+ // unsigned char read_data[512];
+ // read_flash_memory_block(bank, offset, 512, read_data); // Bank, address, count, dest.
+ // for(unsigned int i = 0; i < 512; i++)
+ // {
+ // if(read_data[i] != rxBuf[i])
+ // {
+ // // Fail
+ // State = WAITING;
+ // Serial.write(ERRO);
+ // chip_erase();
+ // return;
+ // }
+ // }
+ unsigned char err = verify_flash_memory_block(bank, offset, 512, rxBuf);
+ if (err) {
State = WAITING;
Serial.write(ERRO);
chip_erase();
return;
- }
}
}
addr += (unsigned int)128;
From the little that I have analyzed of the code, there is no exclusive nail of the Arduino UNO, therefore it seems perfectly possible to use an Arduino DUE, but before starting, I would like to have this answer on your part. What do you think? do you see something that implies that such a code is used directly on Arduino DUE or Zero? And even if you think it's complex to carry it?
The advantage of using DUE or Zero is the voltage compatibility.
How do you load a fex file with this? what is a "bin" file?
the com port is 57 on my computer and it doesn't work. => illegal port number. Strange
can someone help me i use this video
https://www.youtube.com/watch?v=01lLqWbhyaM
and then nothing happens anymore
kann mir jemand helfen ich benutze dieses video
https://www.youtube.com/watch?v=01lLqWbhyaM
und dann passiert nichts mehr
I use Manjaro 18.0.4 Linux
./ccloader /dev/ttyACM0 CC2541.bin 0
Comport open:
Device : Default (e.g. UNO)
Baud:115200 data:8 parity:none stopbit:1 DTR:off RTS:off
File open success!
Block total: 512
Enable transmission...
Request sent already! Waiting for respond...
and then nothing happens anymore
If you still accept Pull requests, I might consider creating one, giving instructions on how to use the tool with Linux.
Bin file uploaded successfully, but after restart led doesn't blink and module not respond to AT commands. Also reflash with and without resistors doesn't help
Is it necessary to use a voltage divider in the connection to the arduino pins by the low voltage values in the module?
Hi, I try to use CCLoader.exe via cmd.
But I always fail to do that.
I use BLEduino(developed by elefreaks : http://www.elecfreaks.com/estore/bleduino-ble-for-arduino.html)
and Windows10
Hello All,
I was dump hex file using cc debugger but now my module is not accepting any AT command. Now I want install New firmware.I have followed the procedure but ccloader is not working
Is there another way to upgrade hm10
Thanks in advanced
I've been trying to flash it using Arduino Mega2560 board using both CCLoader_x86_64.exe version 0.5 and CCLoader.exe version 0.5.
But the only response i get is this:
Waiting for respond from Arduino...
No chip detected!
Upload Failed!
File closed!
Comport closed!
EDIT:
Maybe my connections pins are not the same.
I connected pins 4,5,6 from the PWM side of the board to 11,7,8 respectively on bluetooth module
I have a small CC2541 based project to make. I don't really want to buy CCDebugger just because it will take a few weeks to arrive and I hope to finish the project in a few days. I'm using CCLoader for flashing and it works great. Kudos to you guys!
I'd like to avoid debugging via UART and use proper debugging tools in IAR Workshop. Is it possible to configure CCLoader as a debugging device? Do you have instructions how to do it?
Thanks in advance and thanks for this wonderful project!
Hi there,
Somehow it is not working out for me. I double checked all connections. But it allways get's stuck when I run the program...
And I can't use it (the fake HM-10) as before
Greets Simon
When I attempt to run ccloader.exe, malwarebytes identifies a backdoor and quarantines it. Is there a way to get the source for this or a new, clean build?
I'm writing that because it might be useful for someone.
On Windows 10 with an Arduino 2009 (clone), CC2531 powered via USB and jumper cables on bended pins (be careful I broke pin 1!). It didn't work at first (waiting for arduino response) but resetting the Arduino board after executing ccloader fixed that.
Hi,
I tried to flash my new CC2531 dongle via a Wemos D1 Mini with this tutorial, I followed.
The wiring is correct and the flash process went through successfully without any issues.
But after flashing the dongle stopped working. The onboard LED is off and nothing happens when I stick it into my computer. It also won't show up in Windows' device manager or in 'lsusb' under Linux.
So I tried flashing the stick again and it flashed successfully as well...but still, the dongle doesn't work.
Any ideas how to fix this?
Hello, stupid question, but i can't find any info about construction of command line command to start flashing.
I have got Leonardo with sketch uploaded, and CCloader.exe and HCI_UART_115200bps_20130429.bin
And i want to flash it. My Leonardo is on on COM12
Sorry for that question, but no idea where to put switch for com port and i do not want to damage the CC2540 IC by using flasher in a wrong way.
I do have CCdebuger also, with their flasher downloaded from TI website, but it cannot recognize the .bin files, because it works with .hex
When i use bin2hex to convert the files the TI software is saing that it cannot read that file, so i need help.
Thank yoy :)
Is this project supports ESP8266 boards - instead of Arduino? I ask because the ESP is a 3.3V based board and hence no level converter is needed.
I tried your great tool with a WeMos D1 mini: compiled, uploaded but "Waiting for respond from Arduino..."
(Tried with UNO and Leonardo options too.)
Thank you for posting the C source code for the Windows/Dos executable program. I have built it using the TDM-GCC compiler and successfully flashed my CC41 using it. If you'd like to host it here, I'm attaching
CCLoader_x86_64.zip
the executable for others to download.
Hi, I'm trying to flash 2 different BLE module(JDY-08 and MLT-BT05) as described in the arduino thread but CCLoader get stuck at the first block. I have tried both with Linux(never get past "waiting for arduino") and windows.
Both modules have become unusable after the procedure (they are in debug state(?)) so it must have done something.
I'm using an Arduino Pro Mini at 3.3v connected with an USB TTL converter to the PC.
Is there something I can do? Thanks
Is CCloader runing properly on esp32?
Sketch uploads to esp32 jist fine.
But can here be any problem with this setup ?
Hi! Is it possible to get IEEE mac address from chip using CCLoader?
Can I have communication with the HM11 through AT commands after flashing the firmware?
I have connected arduino 5,6,4 and BLE 7,8,11 pin respectively and I have flashed the ccloader sketch to my arduino. But when I load the bin file ccloader.exe stuck at waiting for response from arduino.. Any help
Hi there! I am trying to execute CCLoader.exe. I double click on it. Run option appears. I run it. Nothing happens. I also tried CCLoader_x86_64.exe and also tried to run both via Run as administrator. Still nothing.
Any idea what I should do?
Thank you!!
Hi,
Write the CCLoader.ino with Arduino to ESP32
// Debug control pins & the indicate LED
int DD = 5;
int DC = 2;
int RESET = 1;
int LED = 13;
Create FW
objcopy --gap-fill 0xFF --pad-to 0x040000 -I ihex CC2530ZNP-with-SBL.hex -O binary CC2530ZNP-with-SBL.bin
try to flash
./CCLoader /dev/ttyUSB0 CC2530ZNP-with-SBL.bin 0
Comport open:
Device : Default (e.g. UNO)
Baud:115200 data:8 parity:none stopbit:1 DTR:off RTS:off
File open success!
Block total: 512
Enable transmission...
Request sent already! Waiting for respond...
But nothing happen....
ESP32: ESP32_Devkitc_V4
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/_images/esp32-devkitC-v4-pinout.png
CC2530
https://zigbee.blakadder.com/assets/images/devices/CC2530_pinout.webp
VCC <-> VCC
GND <-> GND
GPIO5 <-> DD / 21
GPIO2 <-> DC / 22
GPIO1 / TX <-> RST
What did I wrong ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.