Giter VIP home page Giter VIP logo

flash_cc2531's People

Contributors

beikeland avatar jmichault avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flash_cc2531's Issues

Reading line 15280.incorrect hex file (incorrect length

Anyone seen that before?

Trying to flash using Pi3B with Buster (all updated).

Result from ./cc_erase =

ID = b524.
erase result  = 00a2

Result from ./cc_write CC2531ZNP-Prod.hex =

ID = b524.
reading line 15280.incorrect hex file (incorrect length

Tried m -100 and m -300 with same result.

CC_Flasher clone from here https://github.com/jmichault/flash_cc2531
Firmware downloaded from here https://github.com/Koenkk/Z-Stack-firmware/blob/master/coordinator/Z-Stack_Home_1.2/bin/default/CC2531_DEFAULT_20211115.zip

FYI, ./cc_read save.hex saved a file called save.hex and took about 2 minutes

cc_write hangs

I'm trying to flash a cc2530 via an raspberry and flash_cc2531.
It worked twice ... but not any more ... success is not reproducable.
Most of my tries hang on "page 1"

writing page 1/127.

I have to press CTRL+C - to abort the flashing.

The ID gets recognized correctly - and I can also use cc_read to dump the current firmware. So the raspberry setup and GPIO pins seem to be okay.

Reseting the board, rebooting the raspberry, unhooking/attaching the power supply does not help.

I've tracked down the problem to - the part

"// wait DMA end :"

... but don't how to fix the problem ... might be a timing problem.

I tried two different CC2530 boards - on of the cc2530 I'm using is a E18-MS1-PCB.

Any ideas?

chipid fa80

Good day,

in all manuals i read if chipid is 0000 of ffff your wires are not correct.
i checked my wires multiple times. (and disconnecting any of them result in a chipid 0000)
but my id is fa80
when i use cc_erase i got

  ID = fa80.
  erase result = 003f.

when i simply ignore the instructions and start writing the green led blinks once .

root@raspberrypi:/home/pi/flash_cc2531# ./cc_write cc2531.hex
  ID = fa80.
  reading line 15490.
  file loaded (15497 lines read).
writing page   1/128.

and it stay's at page 1 all the time.
if i do a ^C the chipid is changed to 0000
when i disconnect the usb. and connect it again the chipid is back at fa80

what do i do wrong?

Flash CC2530 ?

Hi, is it possible to flash a CC2530?
Flashing CC2530 with debugger I need to use also 3.3V pin...in your tutorial for CC2531 with Rpi 3.3V is not used.

cc_read not read all lines

Hi,
im backup the firmware from my cc2531 usb adapter, but i can read only 13566 lines
the original firmware have 15497 lines.

im using the command:
./cc_read -m 100 out.hex

original file size: 697099 bytes
-rw-r--r-- 1 pi pi 697099 Nov 28 2020 CC2531ZNP-Prod.hex
backup size: 597596 bytes
-rw-r--r-- 1 pi pi 597596 Jan 19 10:31 out.hex

i'm wrong somethings?

incorrect hex file

CC2531 with a Raspberry Pi 2B.
who had it?

pi@raspberrypi:~/flash_cc2531 $ ./cc_erase
  ID = b524.
  erase result = 00a2.

pi@raspberrypi:~/flash_cc2531 $ ./cc_write CC2531ZNP-Prod.hex
  ID = b524.
incorrect hex file ( : missing)

Size of cc_delay variables

Please prove me wrong, but if unsigned char is used as a type for cc_delay(), value of 200 is passed to the function and this value is multiplied by 50 in the function and stored to the same data type (unsigned char), the value inevitably overflows (to value of 16).

Is this a bug or a feature?

cc_write uses hardcoded pin numbers

cc_write.c uses hardcoded pin numbers and overwrites the values provided in CCDebugger.h or via command line.
Please replace the values of rePin, dcPin and ddPin with -1, so that cc_init() will be able to decide which values to use.

int main(int argc,char *argv[]) { int opt; int rePin=24; int dcPin=27; int ddPin=28; int setMult=-1;

error on page 0: byte 0x00 is 0x00 instead of expected 0x02

Hi I have the same issue reported today by caisyew on the other project:

Koenkk/zigbee2mqtt#1430 (comment)

by flashing with a RPI a cc2531 stick I get an error during the verification for the first byte of the first page. It writes 0x00 instead of the 0x02 value taken from the Hex file.

Maybe this is a regression of your fix from yesterday. Checking the code right now. The hex file seems to be read in the right way since I dumped the data from the Page[0] structure.
It could be that the offset is not set in the right way. Checking your code right now :)

But probably you're faster :)

Can't open file CC2531ZNP-Prod.hex.

Running a Pi4 lite os.
thinks looks fine, until I try to flash:

pi@raspberrypi:/flash_cc2531 $ ./cc_chipid
ID = b524.
pi@raspberrypi:
/flash_cc2531 $ ./cc_read save.hex
ID = b524.
reading 256k/256kpi@raspberrypi:/flash_cc2531 $ ./cc_erase
ID = b524.
erase result = 00a2.
**pi@raspberrypi:
/flash_cc2531 $ ./cc_write CC2531ZNP-Prod.hex
Can't open file CC2531ZNP-Prod.hex
pi@raspberrypi:~/flash_cc2531 $ ./cc_chipid
ID = b524.

TI CC2650 support ?

I am looking for Raspberry software to flash the TI CC2650 SensorTag. Any chance this can be achieved with this same "flash_cc2531" ?

Stuck on verifying

Hi, I am trying to flash a CC2531 with a Raspberry Pi 1 B+ V1.2, however it's getting stuck on "verifying page" :

./cc_chipid
  ID = b524.
./cc_erase
  ID = b524.
  erase result = 00a2.
./cc_write CC2531ZNP-Prod.hex
  ID = b524.
  reading line 15490.
  file loaded (15497 lines read).
writing page 128/128.
verifying page   1/128.

cc2531 wrong ID

Hello,

I'm trying to flash my cc2531, but the ID returned after running "./cc_chipid" is "ID = 1fff ."
I don't know where could the problem be. I checked my wiring a hundred time an everything seems to be ok.

I have no idea what to do, can you help me please ?

verification error

Hello,
I have the same problem that was discussed before in issue # 32.
Always get the message:
ID = b524.
reading line 15490.
file loaded (15497 lines read).
writing page 65/128.verification error... Have you erased before write ?
I tried with Rasberry PI B and Raspberry Pi Zero W.
Also tested wit -m 300. No changes.
Any new ideas ?

Verification error

:/home/pi/flash_cc2531# ./cc_erase
ID = b524.
erase result = 00a2.

After cc_erase , writing is stopped after 65 pages.
/home/pi/flash_cc2531# sudo ./cc_write -m 300 CC2531ZNP-Prod.hex
ID = b524.
reading line 15490.
file loaded (15497 lines read).
writing page 65/128.verification error... Have you erased before write ?
I cannot find a solution on internet. What is going wrong

issues compiling on odroid-c2

OS:

root@odroid:~/flash_cc2531# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"
root@odroid:~/flash_cc2531#

Hardware:

Architecture:        aarch64
Byte Order:          Little Endian
CPU(s):              4
On-line CPU(s) list: 0-3
Thread(s) per core:  1
Core(s) per socket:  1
Socket(s):           4
Vendor ID:           ARM
Model:               4
Model name:          Cortex-A53
Stepping:            r0p4
CPU max MHz:         1536.0000
CPU min MHz:         100.0000
BogoMIPS:            2.00
Flags:               fp asimd crc32
root@odroid:~/flash_cc2531#

running with WiringPi https://wiki.odroid.com/odroid-c2/application_note/gpio/wiringpi#tab__odroid-c2

Added few things to make sure Makefile compiles (the pre-compiled binaries would always say "directory not found"):

LDLIBS=-lwiringPi -lcrypt -lm -lrt
CFLAGS=-g
LDFLAGS=-g

all: cc_chipid cc_read cc_write cc_erase

cc_erase : cc_erase.o CCDebugger.o
        gcc $(LDFLAGS) -o $@ $^ $(LDLIBS)

cc_write : cc_write.o CCDebugger.o
        gcc $(LDFLAGS) -o $@ $^ $(LDLIBS)

cc_read : cc_read.o CCDebugger.o
        gcc $(LDFLAGS) -o $@ $^ $(LDLIBS)

cc_chipid : cc_chipid.o CCDebugger.o
        gcc $(LDFLAGS) -o $@ $^ $(LDLIBS)

cc_chipid.o : cc_chipid.c CCDebugger.h
        gcc $(CFLAGS) -c $*.c

CCDebugger.o : CCDebugger.c CCDebugger.h
        gcc $(CFLAGS) -c $*.c
root@odroid:~/flash_cc2531#

Running make yields some warnings.

root@odroid:~/flash_cc2531# make
gcc -g -c cc_chipid.c
gcc -g -c CCDebugger.c
CCDebugger.c: In function ‘cc_reset’:
CCDebugger.c:421:12: warning: large integer implicitly truncated to unsigned type [-Woverflow]
   cc_delay(500);
            ^~~
gcc -g -o cc_chipid cc_chipid.o CCDebugger.o -lwiringPi -lcrypt -lm -lrt
cc -g   -c -o cc_read.o cc_read.c
gcc -g -o cc_read cc_read.o CCDebugger.o -lwiringPi -lcrypt -lm -lrt
cc -g   -c -o cc_write.o cc_write.c
cc_write.c: In function ‘main’:
cc_write.c:289:48: warning: format ‘%d’ expects a matching ‘int’ argument [-Wformat=]
     if(line%10==0) { printf("\r  reading line %d.");fflush(stdout); }
                                               ~^
cc_write.c:298:31: warning: format ‘%x’ expects argument of type ‘unsigned int *’, but argument 3 has type ‘uint16_t * {aka short unsigned int *}’ [-Wformat=]
       if(!sscanf(buffer+9,"%04x",&ela)) { fprintf(stderr,"incorrect hex file (incorrect extended addr)\n"); exit(1); }
                            ~~~^  ~~~~
                            %04hx
cc_write.c:317:35: warning: format ‘%x’ expects argument of type ‘unsigned int *’, but argument 3 has type ‘uint8_t * {aka unsigned char *}’ [-Wformat=]
       if(!sscanf(buffer+9+2*i,"%02x",&data[i])) { fprintf(stderr,"incorrect hex file (incorrect data)\n"); exit(1); }
                                ~~~^  ~~~~~~~~
                                %02hhx
gcc -g -o cc_write cc_write.o CCDebugger.o -lwiringPi -lcrypt -lm -lrt
cc -g   -c -o cc_erase.o cc_erase.c
gcc -g -o cc_erase cc_erase.o CCDebugger.o -lwiringPi -lcrypt -lm -lrt
root@odroid:~/flash_cc2531#

Can these warnings be ignored?

Also, when running the binaries, getting some errors:

root@odroid:~/flash_cc2531# ./cc_chipid
warn : pinMode: Not available for pin 28.
warn : digitalWrite: Not available for pin 28.
warn : digitalWrite: Not available for pin 28.
warn : pinMode: Not available for pin 28.
warn : digitalWrite: Not available for pin 28.
warn : digitalWrite: Not available for pin 28.
warn : digitalWrite: Not available for pin 28.
warn : digitalWrite: Not available for pin 28.
warn : digitalWrite: Not available for pin 28.
warn : digitalWrite: Not available for pin 28.
warn : digitalWrite: Not available for pin 28.
warn : digitalWrite: Not available for pin 28.
warn : digitalWrite: Not available for pin 28.
warn : digitalWrite: Not available for pin 28.
warn : pinMode: Not available for pin 28.
warn : digitalWrite: Not available for pin 28.
warn : digitalWrite: Not available for pin 28.
warn : pinMode: Not available for pin 28.
warn : digitalWrite: Not available for pin 28.
  ID = 0000.
warn : pinMode: Not available for pin 28.
warn : digitalWrite: Not available for pin 28.
warn : pinMode: Not available for pin 28.
root@odroid:~/flash_cc2531#
root@odroid:~/flash_cc2531#

Output of Wiringpi:

 +------+-----+----------+------+---+----+---- Model  ODROID-C2 ----+----+---+------+----------+-----+------+
 | GPIO | wPi |   Name   | Mode | V | DS | PU/PD | Physical | PU/PD | DS | V | Mode |   Name   | wPi | GPIO |
 +------+-----+----------+------+---+----+-------+----++----+-------+----+---+------+----------+-----+------+
 |      |     |     3.3V |      |   |    |       |  1 || 2  |       |    |   |      | 5V       |     |      |
 |  205 |   8 |    SDA.1 |   IN | 1 |    | DSBLD |  3 || 4  |       |    |   |      | 5V       |     |      |
 |  206 |   9 |    SCL.1 |   IN | 1 |    | DSBLD |  5 || 6  |       |    |   |      | GND(0V)  |     |      |
 |  249 |   7 | GPIO.249 |   IN | 1 |    |   P/U |  7 || 8  |       |    |   |      | TxD1     | 15  |      |
 |      |     |  GND(0V) |      |   |    |       |  9 || 10 |       |    |   |      | RxD1     | 16  |      |
 |  247 |   0 | GPIO.247 |   IN | 1 |    |   P/U | 11 || 12 | P/U   |    | 1 | IN   | GPIO.238 | 1   | 238  |
 |  239 |   2 | GPIO.239 |   IN | 1 |    |   P/U | 13 || 14 |       |    |   |      | GND(0V)  |     |      |
 |  237 |   3 | GPIO.237 |   IN | 1 |    |   P/U | 15 || 16 | P/U   |    | 1 | IN   | GPIO.236 | 4   | 236  |
 |      |     |     3.3V |      |   |    |       | 17 || 18 | P/U   |    | 1 | IN   | GPIO.233 | 5   | 233  |
 |  235 |  12 | GPIO.235 |   IN | 1 |    |   P/U | 19 || 20 |       |    |   |      | GND(0V)  |     |      |
 |  232 |  13 | GPIO.232 |   IN | 1 |    |   P/U | 21 || 22 | P/U   |    | 1 | IN   | GPIO.231 | 6   | 231  |
 |  230 |  14 | GPIO.230 |   IN | 1 |    |   P/U | 23 || 24 | P/U   |    | 1 | IN   | GPIO.229 | 10  | 229  |
 |      |     |  GND(0V) |      |   |    |       | 25 || 26 | P/D   |    | 1 | OUT  | GPIO.225 | 11  | 225  |
 |      |  30 |    SDA.2 |      |   |    |       | 27 || 28 |       |    |   |      | SCL.2    | 31  |      |
 |  228 |  21 | GPIO.228 |   IN | 1 |    |   P/U | 29 || 30 |       |    |   |      | GND(0V)  |     |      |
 |  219 |  22 | GPIO.219 |   IN | 1 |    |   P/U | 31 || 32 | P/U   |    | 1 | IN   | GPIO.224 | 26  | 224  |
 |  234 |  23 | GPIO.234 |   IN | 0 |    |   P/D | 33 || 34 |       |    |   |      | GND(0V)  |     |      |
 |  214 |  24 | GPIO.214 |   IN | 1 |    | DSBLD | 35 || 36 | DSBLD |    | 1 | IN   | GPIO.218 | 27  | 218  |
 |      |  25 |    AIN.1 |      |   |    |       | 37 || 38 |       |    |   |      | 1V8      | 28  |      |
 |      |     |  GND(0V) |      |   |    |       | 39 || 40 |       |    |   |      | AIN.0    | 29  |      |
 +------+-----+----------+------+---+----+-------+----++----+-------+----+---+------+----------+-----+------+
 | GPIO | wPi |   Name   | Mode | V | DS | PU/PD | Physical | PU/PD | DS | V | Mode |   Name   | wPi | GPIO |
 +------+-----+----------+------+---+----+---- Model  ODROID-C2 ----+----+---+------+----------+-----+------+
root@odroid:~/flash_cc2531#
root@odroid:~/flash_cc2531#

Solution for some cc_chipid returning 0000

Encountered the error where cc_chipid would only return 0000 (running wiringpi 2.52 on a rpi zero w)

Some cc2531 devices has a physical deubg button on the PCB. After plugging everything in, press that debug button and try again, it solved all my issues.

Flash from OrangePI

Hello!

I'm trying to flash CC2531 dongle from OrangePI Prime.

Correct ID = b524 I receive irregularly and only after executing cc_write.
For example:
root@orangepiprime:~/flash_cc2531# ./cc_chipid -r 2 -c 0 -d 1 -m 100
ID = ffff.
root@orangepiprime:~/flash_cc2531# ./cc_write router-cc2531-diag-usb.hex -r 2 -c 0 -d 1 -m 100
ID = ffff.
reading line 12550.
file loaded (12557 lines read).
writing page 1/ 99.^C
root@orangepiprime:~/flash_cc2531# ./cc_chipid -r 2 -c 0 -d 1 -m 100
ID = b524.
root@orangepiprime:~/flash_cc2531# ./cc_chipid -r 2 -c 0 -d 1 -m 100
ID = ffff.

I was able to do cc_erase this way:
root@orangepiprime:~/flash_cc2531# ./cc_erase -r 2 -c 0 -d 1 -m 100
ID = b524.
erase result = 00a2.

But I can't write firmware, I get error all the time:
root@orangepiprime:~/flash_cc2531# ./cc_write router-cc2531-diag-usb.hex -r 2 -c 0 -d 1 -m 100
ID = b524.
reading line 12550.
file loaded (12557 lines read).
writing page 1/ 99.
flash error... Have you erased before write ?

Flash of CC2531 hangs

I am trying to flash the CC2531 with the the Z-Stack-firmware (CC2531_DEFAULT_20190608).

I have the CC2531 connected to my RaspberryPI via GPIO-Pins (Raspberry Pi Model B Rev 2).

When trying to flash, cc_write hangs on the first page, see below:

# In TMUX, via SSH

./cc_chipid -c6 -r 10 -d 11 
  ID = b524.

./cc_erase  -c6 -r 10 -d 11 -m 600
  ID = b524.
  erase result = 00a2.

./cc_write CC2531ZNP-Prod.hex -c6 -r 10 -d 11 -m 600
  ID = b524.
  reading line 15490.
  file loaded (15497 lines read).
writing page   1/128.

I've played with the delay timing to no avail.

Trying to flash back the original firmware results in the same issue - the flashing process gets stuck on page 1:

./cc_write save.hex  -c6 -r 10 -d 11 -m 300
  ID = b524.
  reading line 530.
  file loaded (539 lines read).
writing page   1/  5.

Verifying takes several hours on CC2530

I've a DRF1605H Module with CC2530 Chip, flashed over Rpi 3b. Writing process works fine and fast, but verifying takes several hours. Is it normal process?

cc_chipid showing no id at all

Hello

I am trying to reflash my cc2531 usb dongle with a source-routing firmware instead the default one. I am doing this through my rp4 (I haven't a cc debugger). When I flashed the default firmware it works flawlessly, but now, with the same setup when I check the wiring with cc_chipid I get no response at all, just came back to prompt. I googled for the same issue, but nobody describes that behavior. I triple check every wire and connector and they work ok. Any ideas how to solve this?

PD: I am running over RP OS Lite, the first time I flashed over RP OS Standard

cc2531 won't be recognized by chipid.

I have bought a serie of CC2531 chips and tried to flash through flash_cc2531, but got stuck on recognition. I haven't tried to flash it and did a fall-back to CC-Debugger and the smartRF flash on Windows.

Everytime I try with the other chip I received I get the following:
ID = ffff.

With the right chip I receive the correct output:
ID = b524.

The output from dmesg.
With the working one:
[ 6651.753985] usb 1-1.4: New USB device found, idVendor=0451, idProduct=16a8, bcdDevice= 0.09

With the failing one:
[ 6781.541867] usb 1-1.3: New USB device found, idVendor=0451, idProduct=16ae, bcdDevice=45.00

Not sure if OK?

Hi - thanks for the software!

With the id check I get a result of 3FFF or 7FFF.

The backup copy seems to work - but hangs at 1/128 when I try to write.

Is this likely to be a faulty USB? The green light goes out when I start working with it and have checked all the pin connections (with a multimeter to ensure it def linking through to the right port).

Thanks

Directory not found using ubuntu on RPI 4b?

Good afternoon,

After giving the command ./cc_chipid it says it cannot find the file or directory
~/flash_cc2531$ ./cc_chipid
-bash: ./cc_chipid: No such file or directory

I do have WiringPi installed (gpio version: 2.50)
Does it have to do that I am running on Ubuntu 64 bit version (20.04 LTS) ?

Many thanks for your help!

flash cc2531 with raspberry PI4

Hi, just wondering if this would work on a raspberry PI4. I'm following the steps but cc_chipid returns ffff. Has anyone been able to flash the cc2531 with a PI4? What other steps are required?

Thanks,
Oscar

Update prerequisites (downdate?)

The prerequisites section lists a Raspberry Pi 3, but it also works just fine on a Pi 1 RevB using the the commands in the using other pins section. A clearer presentation would be

  • Raspberry Pi
  • wiringpi

I almost didn't try this because the prerequisites lead me to believe it could not be done with a first or second gen Pi, which is plausible given arm6 vs arm7, processing power/ram, after all it talks about shutting down other software and other tips to improve performance.

That said; thanks for an awesome tool!

Update for 128KB CC2531.

Hello, I wanted to ask if you would be able to update it so it supports the 128KB version as well. I have tried changing it but without any luck, but since you wrote it could you change it?

writing page 65/128.verification error

hello,
chip it'is correct : ID = b524.
reading files OK: reading line 15490.
file loaded (15497 lines read).
have everytime one error at step 65.
writing page 65/128.verification error
somebody have an idea ? thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.