Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError: index out of range #3

Open
dcolens opened this issue Jan 23, 2019 · 7 comments
Open

IndexError: index out of range #3

dcolens opened this issue Jan 23, 2019 · 7 comments

Comments

@dcolens
Copy link

dcolens commented Jan 23, 2019

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.

@pipiche38
Copy link
Contributor

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
Copy link
Contributor

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

@tjikkun
Copy link
Owner

tjikkun commented Jan 4, 2021

@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.

@chrisaga
Copy link

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.

@pipiche38
Copy link
Contributor

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

@chrisaga
Copy link

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.

@doudz
Copy link
Contributor

doudz commented Apr 19, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants