zigate-flasher icon indicating copy to clipboard operation
zigate-flasher copied to clipboard

IndexError: index out of range

Open dcolens opened this issue 6 years ago • 7 comments

Thanks for creating and publishing this project, I tried using it to flash multiple FW to a zigate and am getting the following error:

./zigate-flasher.py -p /dev/ttyUSB1 -w ../ZiGate_Coordinator_v3.0e.bin -e
Found MAC-address: 00:15:8d:00:01:b2:2a:54
writing new flash from ../ZiGate_Coordinator_v3.0e.bin
Traceback (most recent call last):
  File "./zigate-flasher.py", line 349, in <module>
    main()
  File "./zigate-flasher.py", line 345, in main
    erase_EEPROM(ser, args.pdm_only)
  File "./zigate-flasher.py", line 306, in erase_EEPROM
    res = read_response(ser)
  File "./zigate-flasher.py", line 102, in read_response
    return _unpack_raw_message(length, answer)
  File "./zigate-flasher.py", line 113, in _unpack_raw_message
    return _responses.get(type_, Response)(type_, data, chksum)
  File "./zigate-flasher.py", line 62, in __init__
    self.status = data[0]
IndexError: index out of range

I don't get this error when using JennicModuleProgrammer.

dcolens avatar Jan 23 '19 07:01 dcolens

Same problem here: python3 zigate-flasher.py -p /dev/ttyUSBRPI3 -e -w /tmp/ZiGate_v3.1b.bin Found MAC-address: 00:15:8d:00:01:c6:1b:bb writing new flash from /tmp/ZiGate_v3.1b.bin Traceback (most recent call last): File "zigate-flasher.py", line 349, in main() File "zigate-flasher.py", line 345, in main erase_EEPROM(ser, args.pdm_only) File "zigate-flasher.py", line 306, in erase_EEPROM res = read_response(ser) File "zigate-flasher.py", line 102, in read_response return _unpack_raw_message(length, answer) File "zigate-flasher.py", line 113, in unpack_raw_message return responses.get(type, Response)(type, data, chksum) File "zigate-flasher.py", line 62, in init self.status = data[0] IndexError: index out of range

Looks like it is related to the use of Erase option

pipiche38 avatar Aug 24 '19 10:08 pipiche38

@tjikkun do you have any idea on how to fix this issue ? Basically I'm not able to Erase EEPROM nor PDM

pipiche38 avatar Jan 03 '21 16:01 pipiche38

@doudz wrote this part (erase option). I haven't played with Zigate for a while now so have not really tested that part myself. From what I remember this was not a documented feature of the bootloader. If I recall correctly JennicModuleProgrammer uses a boot image that it boots from, which then erases the EEPROM from within that boot.

tjikkun avatar Jan 04 '21 12:01 tjikkun

Hello. I am struggleling with my ZiGate update witch lead me to zigate-flasher. As far as I understand, both JennicModuleProgrammer and zigate-flasher erase the FLASH memory with command 0x07 before writing the new firmware. zigate-flasher implements an undocumented (and apparently not functional) command 0x36 to erase EEPROM. Dont know what we are supposed to achieve with that.

chrisaga avatar Mar 29 '21 13:03 chrisaga

My understand is that the command 0x07 is an Erase in preparation of the flash ( this is done by JeenicModuleProgrammer as well as the zigate-flasher), the 0x37 is done after the flash to Erase the EEPROM

pipiche38 avatar Apr 18 '21 11:04 pipiche38

Yes, I think this is the idea. Unfortunately, erasing the EEPROM doesn't work. I needed it and I managed to run the windows utility under wine to achieve that. I have no access to the sources nor to debuging tools so I don't know how it's done.

chrisaga avatar Apr 19 '21 09:04 chrisaga

2 years ago I started to port NXP programmer to Python3, it's not working but it can help https://github.com/doudz/nxp_flashprogrammer

doudz avatar Apr 19 '21 10:04 doudz