Firmware 0.0.0 error

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
budm
Posts: 11
Joined: 29 Mar 2018 17:16

Firmware 0.0.0 error

Post by budm » 18 Oct 2018 13:13

This makes the second Zuno I've received this error on after spending days trying to port the MFRC522 library to the Zuno.

"Z-Uno core version and device version mismatch. You have 0.0.0 firmware version on the board. Core version is 2.1.4. Please upgrade the bootloader."
"An error occurred while uploading the sketch"

Everything was going fine as I tried to debug what I think are stack overflows. The Zuno would lock up, I would reset it, upload a new version of my sketch and continue working.

If I try to re-burn the bootloader, it says:

"Error 0 There is no firmware "myhome/.arduino15/packages/Z-Uno/hardware/zw8051/2.1.4/bootloaders/zuno_bootloader_AAAABBBB1B0000000000000002*.bin" that is needed for your Z-Uno"

What's going on here? Have I really nuked the firmware simply by uploading a sketch? How can I fix my Zunos that report this error?

User avatar
PoltoS
Posts: 4302
Joined: 26 Jan 2011 19:36

Re: Firmware 0.0.0 error

Post by PoltoS » 20 Oct 2018 00:13

I don't think you killed the bootloader. But looks your sketch overflows the stack and this harms Serial API of Z-Uno.

Try to go into rescue mode to disable your sketch. It should help.

budm
Posts: 11
Joined: 29 Mar 2018 17:16

Re: Firmware 0.0.0 error

Post by budm » 23 Oct 2018 00:29

I have two Zunos, A and B. I started on Zuno A. The stack was regularly being clobbered, so I would routinely enter rescue mode, upload an updated sketch, then continue debugging. Eventually this Zuno hit the error where it said it had Firmware 0.0.0 installed, and I tried a factory reset. After that the Zuno won't even accept a device id on the USB bus. It seems completely hosed.

I dug through my wiring and realized that the MOSI and MISO pins were not connected to the correct pins (but no power or ground wires/pins were wrong). I fixed that, verified that everything else seemed right, and hooked up Zuno B. I got much further with Zuno B; I could get the library to perform a self test that succeeded, and I eventually got it to detect an RFID card. I did encounter a very odd persistent error wherein the library would fail to initialize in the "setup" function. By setting a global boolean and running the initialization in the loop function, I could get the library to initialize. So I was testing that way, figuring I would go back later and see why the library wouldn't initialize in "setup". During all of my debugging, I was constantly having to enter rescue mode, then upload an updated sketch. Everything was going smoothly.

While debugging the library's "read card" code, the device just failed to upload once, and said it was because the device had firmware 0.0.0 installed. Same as Zuno A had done.

This is where I sit right now. I'm a little afraid of the factory reset, since the last time I tried that the device was hosed bad enough to not even work on the USB bus.

If I hose this Zuno, I'm definitely not attempting another library port, because I'm worried that my stack overflows have overwritten something important in the Zuno that I can't fix. And these things are not cheap. :)

I can write off Zuno A, but is there any way you might know of to figure out if the firmware really i trashed, and if so any way to fix it?

budm
Posts: 11
Joined: 29 Mar 2018 17:16

Re: Firmware 0.0.0 error

Post by budm » 23 Oct 2018 00:47

Below are the last few lines from my IDE output when I try to upload the sketch. I had real problems getting this Zuno to attach to the USB bus as well, had to go into rescue mode a few times and unplug/replug the device.

----------------

*** ZME Z-UNO Compiler. Platform:Linux Version:1.05b1 Text: ***

Sketch uses 15895 bytes (49%) of program storage space. Maximum is 32256 bytes.
Global variables use 658 bytes of dynamic memory.

Openning port ..............................
Openning port .............................. OK

Stoping the user code ..............................
Stoping the user code .............................. OK

Closing port ..............................
Closing port .............................. OK

Openning port ..............................
Openning port .............................. OK


RAW Info:
AA AA BB BB 1B 00 00 00
00 00 00 00 9A CE 3B A7
00 7F C6 65 67 7F FF 7F
FC 01 15 02 0E FE A1 01
00 17 13 FF FF FF FF FF
FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF
FF FF FF 0E 11 06 0A 06
C9 01 23 00 01 1E
----------------------------------------------------------
FIRMWARE DATA
----------------------------------------------------------
REVISION:00. 0
Z-WAVE FREQUENCY:UNKNOWN
ORIGINAL FW. CRC32: 9A CE 3B A7
MAXIMUM CODE SIZE: 30 KB
CURRENT FW. CRC16: FE A1
RADIO CHANNELS: 00
----------------------------------------------------------
HARDWARE DATA
----------------------------------------------------------
CALIBRATION
MAIN:00 TX: 17 13
DEVICE PUBLIC KEY:
HEX: 5F D2 E9 64 11 03 DF 54 C9 BE F7 A5 72 BE 5D BF 0B 5A 05 F4 F9 72 4A 7B 14 A9 5A 7E BA 17 5A 39
DEC: 24530-59748-04355-57172-51646-63397-29374-23999-02906-01524-63858-19067-05289-23166-47639-23097
----------------------------------------------------------
PRODUCTION DATA
----------------------------------------------------------
YOUR ZUNO S/N: 0E 11 06 0A 06 C9 01 00 01
----------------------------------------------------------
PRODUCTION TIME:
WEEK:14 YEAR:2017
WORKSTATION:
NUMBER:1 SEQUENCE:1737
HARDWARE:
CHIP:1546 REVISION:1
----------------------------------------------------------
Z-Uno core version and device version mismatch. You have 0.0.0 firmware version on the board. Core version is 2.1.4. Please upgrade the bootloader.
An error occurred while uploading the sketch

User avatar
PoltoS
Posts: 4302
Joined: 26 Jan 2011 19:36

Re: Firmware 0.0.0 error

Post by PoltoS » 28 Oct 2018 12:37

Are you using S2 variant of bootloader? If so, looks we have one nesty bug with sketch upgrade. Please contact me by mail

p0lyg0n1
Posts: 160
Joined: 04 Aug 2016 07:14

Re: Firmware 0.0.0 error

Post by p0lyg0n1 » 29 Oct 2018 10:57

Please provide a sketch code & IDE settings.

budm
Posts: 11
Joined: 29 Mar 2018 17:16

Re: Firmware 0.0.0 error

Post by budm » 29 Oct 2018 12:21

Attached is the code I have been working with, verbatim. I cannot submit a stripped-down version because I wouldn't know if it caused the same problem (both Zunos are basically unusable now).

Hardware:

- A few buttons
- LiquidCrystal, Hitachi hd44780 chip (https://www.arduino.cc/en/Reference/LiquidCrystal)
- MFRC522 / RFID RC522, RFID reader (https://github.com/miguelbalboa/rfid)

IDE Settings:

Board: Z-Wave>ME Z-Uno
Logging: Disabled
Multicommand: Disabled
Frequency: Europe
Erase NVM: Disabled
Security: Disabled
Programmer: Z-Uno programmer

Additional Boards Manager URLs: http://z-uno.z-wave.me/files/z-uno/pack ... index.json

Porting:

Both included libraries were ported/being ported to the Zuno. The LiquidCrystal required minor mods, but the MFRC522 was much more. I took a lot of stack arguments and just crammed them into a struct, made it a member variable and used those values instead of passing values in. (Please bear in mind this was for testing purposes only. :) )

Quirks:

If you look at the ".ino" file, you will notice that I was pressing the blue button to initialize both libraries. For some reason I could not get the libraries to initialize in "setup".

Issue:

The big issue here, of course, is that I highly suspect that I damaged the Zunos using a sketch upload. Power draw on the hardware seemed acceptable, so I don't think that was a problem. I have two RFID-522 chips that I alternated between when testing. I would upload this sketch, press the blue button, then wave an RFID chip over the reader.

The one thing I would be interested in knowing is whether there is a stack overflow that causes any "protected" area of the Zuno to be modified.
Attachments
zuno.bad.zip
(41.83 KiB) Downloaded 6 times

p0lyg0n1
Posts: 160
Joined: 04 Aug 2016 07:14

Re: Firmware 0.0.0 error

Post by p0lyg0n1 » 31 Oct 2018 17:26

Hi, I tried you code with RC522 connected and I can't reproduce the issue. It doesn't work, but I can go to rescue mode anytime and I can reflash the sketch. I have no "REVISION:00. 0" in the output.
Lets try these steps:
1. Unplug all the external modules from Z-Uno (LCD/RC522/Buttons). Just a naked Z-Uno itself.
2. Go to rescue mode (BTN + RST, RST UP, BTN UP). Z-Uno pulses with green LED.
3. Select "Erase NVM"->All In IDE.
4. Select a "Blink" sketch and try to flash it. If you see Error: "Can't upload sketch! Something went wrong. Bad CRC16 :'(" it is OK.
5. Select "Erase NVM"->Disabled
6. Reupload the sketch.
If you have the same result as it was I need all the log files you will find in the "<...>/Arduino15/packages/Z-Uno/tools/zuno_toolchain/00.08.71/*.log"

The issues looks very strange, I didn't see the cases when somebody corrupt the internal flash memory of Z-Uno using a sketch, cause it's impossible, you can corrupt it only if you unplug the power (or some peripheral device eats too much and makes voltage less the 2.6V) during uploading of the bootloader, not the user sketch. Anyway lets try to find the reason and the way to fix it.


Alex.

budm
Posts: 11
Joined: 29 Mar 2018 17:16

Re: Firmware 0.0.0 error

Post by budm » 05 Nov 2018 14:45

Ok, naked Zuno, went into reset mode (+BTN, +RST, -RST, -BTN).

Set Erase NVM=All, cleared the logs, uploaded an empty sketch. Result says invalid Firmware 0.0.0. Think it also said "Found corrupt S2 key", which was something I'd noticed before I hosed it.

Set Erase NVM=Disabled, moved the log out of the way, uploaded an empty sketch. Same error, firmware 0.0.0.0. Both logs are attached, as well as a screenshot of my tools menu.
Attachments
logs.zip
(14.39 KiB) Downloaded 2 times

budm
Posts: 11
Joined: 29 Mar 2018 17:16

Re: Firmware 0.0.0 error

Post by budm » 05 Nov 2018 14:47

Screenshot.
Attachments
ss.png
ss.png (38.75 KiB) Viewed 676 times

Post Reply