zigbeer / zigbee-shepherd

An open source ZigBee gateway solution with node.js.
MIT License
250 stars 89 forks source link

how to flash the CC2531 #3

Closed mrose17 closed 7 years ago

mrose17 commented 7 years ago

hello zigbee shepherds!

i purchased as CC2531 and tested it using the packet-sniifer tool on windows10 running in a VM on my mac. no issues.

the next step is to flash the CC2531 with the hex file... however, neither of the TI flash programs seem to be able to find the CC2531! (i doubt that the flash programmer 2 even knows about the CC2531).

so, what now? how do i get the "right" firmware onto the CC2531 so i can start doing work with node?

thanks,

/mtr

jackchased commented 7 years ago

hi @mrose17 ,

The flash programmer 2 is used to flash the ARM-based MCU, but the CC2531 is 8051-based. So, you can refer to the wiki page, then use CC Debugger and "flash programmer" to flash the CC2531.

The hex file is at zigbeer/documents/zigbee-shepherd/CC2531ZNP-Test.rar

mrose17 commented 7 years ago

thanks! i tried both flash programmers -- i guessed that flash programmer 2 wasn't going to work, but thought i would try it just in case.

if i understand your reply, i need to use the original flash programmer AND get a CC debugger in order to flash the CC2531. is that right?

that seems like a lot of friction. any chance one of the zigbee shepherds could just write a node program that does flashes the CC2531?

if that's not possible, is there an after-market source that might sell the CC2531 with the correct firmware??

ideally, i would like to tell people: go to ti.com/.... and buy the CC2531, then do an npm install, plug in the CC2531, and do npm run update-firmware to make it ready for use with zigbee-shepherd...

thanks!

jackchased commented 7 years ago

Yes, the original flash programmer and CC Debugger is necessary to flash the CC2531. Thanks for your suggestion. We will discuss the matter internally and try to see if this is possible.

many thanks!

mrose17 commented 7 years ago

many thanks! that would really help folks out. i don't mind telling people "go buy this dongle", i just don't want them to have to flash stuff by hand, etc... thanks!

mrose17 commented 7 years ago

@simenkid - so is that a "no"?

simenkid commented 7 years ago

@mrose17 Oops, I thought this issue is done. According to the tile "how to flash...". Sorry. 😳

To flash the CC2531, we do need a cc-debugger which has its own driver and I/Os to control the debug timing and data. And the problem is we don't have the spec of cc-debugger, therefore it still depends on TI's drive even we wrap all the things into a npm utility. (If TI's driver is dead, the npm tool is dead too. And users feel frustrated again.)

And do you mean you need a CC2531 that is out-of-box with a correct firmware ready for zigbee-shepeherd? At this moment, we can do nothing with it. The cost will be high because of few users, shipment, online payment, blah blah blah. 😵

Did you get the flashing things right? Maybe we can send you one, how do you think?

mrose17 commented 7 years ago

@simenkid - thanks. the core issue is that there is too much "friction" to have someone buy both the CC2531 and the debugger and then to flash it. i can order a CC2531 from amazon.com ... which is great! but having to go to TI to get a debugger and then flash it is going to stop most people code.

my goal here is to bring zigbee to homekit via this package and https://github.com/nfarina/homebridge ... i am pretty sure that i can write the homebidge plugin to talk to zigbee-shepherd, but if the plugin instructions say something more than go to amazon and get ..., then it's not going to get much use.

in fact, i was thinking of putting a REST server on top of zigbee-shepherd first, so it would not be dependent on homekit and other HA systems could make use of it.

but this all hinges on making it very simple for folks to get a CC2531 with the correct firmware!

your thoughts?

simenkid commented 7 years ago

@mrose17 - I totally agree with you. Preparing those things is quite bothering. We tried to reach TI before, but not any response came back. I know it will be very good to have a CC2531 out-of-box with the right firmware, but it's difficult for us a small team to make it possible, especially to make dongles into market. I hope for your understanding.

I'm thinking of sending a mail to ZigBee Alliance to seek for some help. But I'm not expecting that the Alliance will support the open source community, who knows? Or should I try to reach TI again?

Maybe I should reopen this issue, and pass it to TI. 😆 Any idea?

coold8d commented 7 years ago

@mrose17 I really like your ideas, but there seems no quick and easy workaround so far. As for USB dongle, there are actually a few makers that manufacture commercial cc2531 USB dongles with the right firmware. However, you won't see that in the consumer market neither on Amazon/eBay. I could look for a FCC approved zigbee dongle that I can legally sell on Amazon, but supply and demand is the next problem. ( i.e. We won't get a good bargain without certain MOQ. ) so my next question is what do you think the reasonable price range could be for a zigbee USB dongle?

jeroenvollenbrock commented 7 years ago

Doesn't the default firmware include the TI Serial Bootloader code?

mrose17 commented 7 years ago

@coold8d - thanks for the reply and sorry for the long delay in replying.

if @jeroenvollenbrock is correct, then perhaps the issue can be solved by having zigbee-shepherd look for the bootloader in the firmware and use it as needed. as long as people can buy one thing and plug that into something running zigbee-shepherd/node/etc. without having to mess with a stand-alone program, it's a winner.

in terms of pricing, if we can't make use of the firmware, and have to do our own zigbee dongle, then i suspect the pain point is lower than usd99, but probably not much lower. i'm pretty sure that anyone with zigbee devices doing HA would love to have something to plug into the USB port of a computer that puts those devices on homekit via homebridge.

jackchased commented 7 years ago

Hi @jeroenvollenbrock and @mrose17,

TI CC2531 USB Dongle default firmware is for IEEE 802.15.4 packet sniffer, the bootloader is not programmed. So, the first time still need use cc-debugger to program it.

https://e2e.ti.com/support/wireless_connectivity/zigbee_6lowpan_802-15-4_mac/f/158/p/531806/1978461#1978461

AndrewLinden commented 7 years ago

I successfully flashed my TI CC2531 stick with an Arduino using https://github.com/wavesoft/CCLib I used hex files from here: https://github.com/mtornblad/zstack-1.2.2a.44539/tree/master/CC2531

More info: https://github.com/wavesoft/CCLib/issues/19

sveip commented 6 years ago

Did this ever get solved?

oysteinkrog commented 6 years ago

For anyone trying to flash a CC2531 with TI SmartRF Flash programmer software and a smartRF04 programmer, you may need the updated 64-bit windows drivers (swrc212a.zip): http://www.ti.com/general/docs/lit/getliterature.tsp?baseLiteratureNumber=swrc212&fileType=zip

ghost commented 6 years ago

@oysteinkrog

bildschirmfoto 2018-03-01 um 21 41 50

I have installed the TI Smart RF Program Flasher an the USB Sniffer is detected. When I try to flash I receive the following error message in the status bar:

Not able to reset SmartRF04EB

Looks like the SmartRF04EB is locked. But how can I unlock?

oysteinkrog commented 6 years ago

I just pressed the reset button on the SmartRF device and it worked after that.

ghost commented 6 years ago

Hi, Thanks - pressing the reset button at least led to another error message :-) "Could not open specified HEX file"

ghost commented 6 years ago

Finally. After using the right firmware as described in openHAB binding description it worked. Thanks

xxyyttxx commented 6 years ago

Crowd-funding may be another choice.

whitelynx commented 5 years ago

Just for reference, there are several alternate flashing methods listed at: https://www.zigbee2mqtt.io/information/alternative_flashing_methods.html

Molino69 commented 7 months ago

For people who would have trouble with flashing the CC2531 sniffer due to the chip being locked : this is a procedure which worked for me to unlock the sniffer and (re)flash the firmware :

Hope this helps.