Inteligentne Domy Kraków

Flash CC2531- Raspberry Pi 3 bez CC Debugger

Flash CC2531 bez CC Debugger’a przez Raspberry Pi 3

Potrzebne:
– Raspberry Pi 3
– CC2531
– adapter lub lutownica

Na karcie SD czysta instalacja Raspbian Full + włączenie SSH (utworzenie pliku ssh bez rozszerzenia na karcie SD).
W programie Putty należy podać IP Raspberry.

 


Podłączenie:

Zestaw komend (na czerwono komendy do wklejenia):

login as: pi
pi@192.168.0.115’s password: (należy podać hasło)

pi@raspberrypi:~ $ gpio -v
gpio version: 2.50
Copyright (c) 2012-2018 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty

Raspberry Pi Details:
Type: Pi 3, Revision: 02, Memory: 1024MB, Maker: Sony
* Device tree is enabled.
*–> Raspberry Pi 3 Model B Rev 1.2
* This Raspberry Pi supports user-level GPIO access.
pi@raspberrypi:~ $ git clone https://github.com/jmichault/flash_cc2531.git
Cloning into ‘flash_cc2531’…
remote: Enumerating objects: 30, done.
remote: Counting objects: 100% (30/30), done.
remote: Compressing objects: 100% (25/25), done.
remote: Total 106 (delta 16), reused 7 (delta 4), pack-reused 76
Receiving objects: 100% (106/106), 132.19 KiB | 756.00 KiB/s, done.
Resolving deltas: 100% (64/64), done.

pi@raspberrypi:~ $ cd flash_cc2531
pi@raspberrypi:~/flash_cc2531 $ ./cc_chipid

ID = b524.

pi@raspberrypi:~/flash_cc2531 $ wget https://github.com/Koenkk/Z-Stack-firmware/archive/master.zip

–2020-05-03 19:42:49– https://github.com/Koenkk/Z-Stack-firmware/archive/master.zip
Resolving github.com (github.com)… 140.82.118.4
Connecting to github.com (github.com)|140.82.118.4|:443… connected.
HTTP request sent, awaiting response… 302 Found
Location: https://codeload.github.com/Koenkk/Z-Stack-firmware/zip/master [following]
–2020-05-03 19:42:50– https://codeload.github.com/Koenkk/Z-Stack-firmware/zip/master
Resolving codeload.github.com (codeload.github.com)… 140.82.112.10
Connecting to codeload.github.com (codeload.github.com)|140.82.112.10|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: unspecified [application/zip]
Saving to: ‘master.zip’

master.zip [ <=> ] 5.92M 2.93MB/s in 2.0s

2020-05-03 19:42:53 (2.93 MB/s) – ‘master.zip’ saved [6210308]

pi@raspberrypi:~/flash_cc2531 $ dir
cc_chipid CCDebugger.h cc_read cc_write.c master.zip
cc_chipid.c cc_erase cc_read.c LICENSE README.md
CCDebugger.c cc_erase.c cc_write Makefile

pi@raspberrypi:~/flash_cc2531 $ unzip master.zip

Archive: master.zip
5e94a391e556f9ed663c420f95c627e037361b80
creating: Z-Stack-firmware-master/
inflating: Z-Stack-firmware-master/LICENSE
inflating: Z-Stack-firmware-master/README.md
creating: Z-Stack-firmware-master/coordinator/
inflating: Z-Stack-firmware-master/coordinator/README.md
creating: Z-Stack-firmware-master/coordinator/Z-Stack_3.0.x/
inflating: Z-Stack-firmware-master/coordinator/Z-Stack_3.0.x/CHANGELOG.md
inflating: Z-Stack-firmware-master/coordinator/Z-Stack_3.0.x/COMPILE.md
creating: Z-Stack-firmware-master/coordinator/Z-Stack_3.0.x/bin/
inflating: Z-Stack-firmware-master/coordinator/Z-Stack_3.0.x/bin/CC2530_20190523.zip
inflating: Z-Stack-firmware-master/coordinator/Z-Stack_3.0.x/bin/CC2530_CC2591_20190523.zip
inflating: Z-Stack-firmware-master/coordinator/Z-Stack_3.0.x/bin/CC2530_CC2592_20190523.zip
inflating: Z-Stack-firmware-master/coordinator/Z-Stack_3.0.x/bin/CC2531_20190425.zip
inflating: Z-Stack-firmware-master/coordinator/Z-Stack_3.0.x/bin/CC2538_CC2592_MODKAMRU_V3_20200327.zip
inflating: Z-Stack-firmware-master/coordinator/Z-Stack_3.0.x/firmware_CC2531_CC2530.patch
inflating: Z-Stack-firmware-master/coordinator/Z-Stack_3.0.x/firmware_CC2538_CC2592_MODKAMRU_V3.patch
creating: Z-Stack-firmware-master/coordinator/Z-Stack_3.x.0/
inflating: Z-Stack-firmware-master/coordinator/Z-Stack_3.x.0/CHANGELOG.md
inflating: Z-Stack-firmware-master/coordinator/Z-Stack_3.x.0/COMPILE.md
creating: Z-Stack-firmware-master/coordinator/Z-Stack_3.x.0/bin/
inflating: Z-Stack-firmware-master/coordinator/Z-Stack_3.x.0/bin/CC1352P_2_20191106.zip
inflating: Z-Stack-firmware-master/coordinator/Z-Stack_3.x.0/bin/CC26X2R1_20191106.zip
inflating: Z-Stack-firmware-master/coordinator/Z-Stack_3.x.0/firmware.patch
creating: Z-Stack-firmware-master/coordinator/Z-Stack_Home_1.2/
inflating: Z-Stack-firmware-master/coordinator/Z-Stack_Home_1.2/CHANGELOG.md
inflating: Z-Stack-firmware-master/coordinator/Z-Stack_Home_1.2/COMPILE.md
creating: Z-Stack-firmware-master/coordinator/Z-Stack_Home_1.2/bin/
creating: Z-Stack-firmware-master/coordinator/Z-Stack_Home_1.2/bin/default/
inflating: Z-Stack-firmware-master/coordinator/Z-Stack_Home_1.2/bin/default/CC2530_CC2591_DEFAULT_20190608.zip
inflating: Z-Stack-firmware-master/coordinator/Z-Stack_Home_1.2/bin/default/CC2530_CC2592_DEFAULT_20190608.zip
inflating: Z-Stack-firmware-master/coordinator/Z-Stack_Home_1.2/bin/default/CC2530_DEFAULT_20190608.zip
inflating: Z-Stack-firmware-master/coordinator/Z-Stack_Home_1.2/bin/default/CC2531_DEFAULT_20190608.zip
creating: Z-Stack-firmware-master/coordinator/Z-Stack_Home_1.2/bin/source_routing/
inflating: Z-Stack-firmware-master/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2530_CC2591_SOURCE_ROUTING_20190619.zip
inflating: Z-Stack-firmware-master/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2530_CC2592_SOURCE_ROUTING_20190619.zip
inflating: Z-Stack-firmware-master/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2530_SOURCE_ROUTING_20190619.zip
inflating: Z-Stack-firmware-master/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2531_SOURCE_ROUTING_20190619.zip
inflating: Z-Stack-firmware-master/coordinator/Z-Stack_Home_1.2/firmware.patch
creating: Z-Stack-firmware-master/router/
creating: Z-Stack-firmware-master/router/CC2530/
inflating: Z-Stack-firmware-master/router/CC2530/README.md
creating: Z-Stack-firmware-master/router/CC2530/bin/
inflating: Z-Stack-firmware-master/router/CC2530/bin/CC2530_router_2019_02.zip
creating: Z-Stack-firmware-master/router/CC2530_CC2591/
inflating: Z-Stack-firmware-master/router/CC2530_CC2591/README.md
creating: Z-Stack-firmware-master/router/CC2530_CC2591/bin/
inflating: Z-Stack-firmware-master/router/CC2530_CC2591/bin/CC2530_CC2591_router_2019_02.zip
creating: Z-Stack-firmware-master/router/CC2531/
inflating: Z-Stack-firmware-master/router/CC2531/README.md
creating: Z-Stack-firmware-master/router/CC2531/bin/
inflating: Z-Stack-firmware-master/router/CC2531/bin/CC2531_router_2019_02.zip
inflating: Z-Stack-firmware-master/router/README.md

pi@raspberrypi:~/flash_cc2531 $ cd Z-Stack-firmware-master/coordinator/Z-Stack_Home_1.2/bin/default/

pi@raspberrypi:~/flash_cc2531/Z-Stack-firmware-master/coordinator/Z-Stack_Home_1.2/bin/default $ unzip CC2531_DEFAULT_20190608.zip

Archive: CC2531_DEFAULT_20190608.zip
inflating: CC2531ZNP-Prod.hex
inflating: CC2531ZNP-Prod.bin

pi@raspberrypi:~/flash_cc2531/Z-Stack-firmware-master/coordinator/Z-Stack_Home_1.2/bin/default $ cd ..
pi@raspberrypi:~/flash_cc2531/Z-Stack-firmware-master/coordinator/Z-Stack_Home_1.2/bin $ cd ..
pi@raspberrypi:~/flash_cc2531/Z-Stack-firmware-master/coordinator/Z-Stack_Home_1.2 $ cd ..
pi@raspberrypi:~/flash_cc2531/Z-Stack-firmware-master/coordinator $ cd ..
pi@raspberrypi:~/flash_cc2531/Z-Stack-firmware-master $ cd ..

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

pi@raspberrypi:~/flash_cc2531 $ cd Z-Stack-firmware-master/coordinator/Z-Stack_Home_1.2/bin/default

pi@raspberrypi:~/flash_cc2531/Z-Stack-firmware-master/coordinator/Z-Stack_Home_1.2/bin/default $ dir

CC2530_CC2591_DEFAULT_20190608.zip CC2531_DEFAULT_20190608.zip
CC2530_CC2592_DEFAULT_20190608.zip CC2531ZNP-Prod.bin
CC2530_DEFAULT_20190608.zip CC2531ZNP-Prod.hex

pi@raspberrypi:~/flash_cc2531/Z-Stack-firmware-master/coordinator/Z-Stack_Home_1.2/bin/default $ cp CC2531ZNP-Prod.hex ~/flash_cc2531/

pi@raspberrypi:~/flash_cc2531/Z-Stack-firmware-master/coordinator/Z-Stack_Home_1.2/bin/default $ cd ..
pi@raspberrypi:~/flash_cc2531/Z-Stack-firmware-master/coordinator/Z-Stack_Home_1.2/bin $ cd ..
pi@raspberrypi:~/flash_cc2531/Z-Stack-firmware-master/coordinator/Z-Stack_Home_1.2 $ cd ..
pi@raspberrypi:~/flash_cc2531/Z-Stack-firmware-master/coordinator $ cd ..
pi@raspberrypi:~/flash_cc2531/Z-Stack-firmware-master $ cd ..

pi@raspberrypi:~/flash_cc2531 $ dir

CC2531ZNP-Prod.hex CCDebugger.h cc_read.c Makefile
cc_chipid cc_erase cc_write master.zip
cc_chipid.c cc_erase.c cc_write.c README.md
CCDebugger.c cc_read LICENSE Z-Stack-firmware-master

pi@raspberrypi:~/flash_cc2531 $ ./cc_write CC2531ZNP-Prod.hex
ID = b524.
reading line 15490.
file loaded (15497 lines read).
writing page 128/128.
verifying page 128/128.
flash OK.