OSVR / OSVR-HDK-MCU-Firmware

Firmware source for the main Atmel microcontroller in HMDs related to the OSVR HDK
13 stars 6 forks source link

0 invalid bytes in program region, 83 outside region... Memory did not validate. Did you erase? #37

Closed isopix closed 3 years ago

isopix commented 3 years ago

dfu-programmer atxmega256a3bu flash --force --suppress-bootloader-mem hdk2svr-2.01beta.hex 0% 100% Programming 0xDE00 bytes... [>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success 0% 100% Reading 0x40000 bytes... [>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success Validating... 0 invalid bytes in program region, 5062 outside region. FAIL Memory did not validate. Did you erase? [root@sinistar firmware]# dfu-programmer atxmega256a3bu flash --force --suppress-bootloader-mem hdk2svr-2.0 hdk2svr-2.00.hex hdk2svr-2.01beta.hex
[root@sinistar firmware]# dfu-programmer atxmega256a3bu flash --force --suppress-bootloader-mem hdk2svr-2.00.hex 0% 100% Programming 0xF200 bytes... [>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success 0% 100% Reading 0x40000 bytes... [>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success Validating... Success 0xF200 bytes written into 0x40000 bytes memory (23.63%).

isopix commented 3 years ago

I'm now not sure about anything in this bug report...: 172K hdk2svr-2.00.hex 156K hdk2svr-2.01beta.hex

isopix commented 3 years ago

Checked second unit and everything went smooth.

Went back to the first and took the risk of running: # dfu-programmer atxmega256a3bu erase --force --suppress-bootloader-mem

Amd then I was able to flash it successfully :-)

isopix commented 1 year ago

It looks it's random. It can work or fail with exact firmware file version. And it works(or fails) consistently across boot(of HMD). Not sure if it would mean that my HDK2 has broken RAM or something It's not firmware version/build dependent.

[code]dfu-programmer atxmega256a3bu flash --force --suppress-bootloader-mem hdk2svr-HDMI_VERBOSE.hex 0% 100% Programming 0xEA00 bytes... [>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success 0% 100% Reading 0x40000 bytes... [>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success Validating... Success 0xEA00 bytes written into 0x40000 bytes memory (22.85%).

0% 100% Programming 0xE800 bytes... [>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success 0% 100% Reading 0x40000 bytes... [>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success Validating... 0 invalid bytes in program region, 83 outside region. FAIL Memory did not validate. Did you erase?

dfu-programmer atxmega256a3bu flash --force --suppress-bootloader-mem hdk2svr-HDMI_VERBOSE.hex   3  0% 100% Programming 0xEA00 bytes... [>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success 0% 100% Reading 0x40000 bytes... [>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success Validating... Success 0xEA00 bytes written into 0x40000 bytes memory (22.85%) [/code]

rpavlik commented 1 year ago

IIRC this is from the "suppress bootloader mem" flag, you're intentionally not clearing some flash.

isopix commented 1 year ago

IIRC this is from the "suppress bootloader mem" flag, you're intentionally not clearing some flash.

But I always used the same command(copied it over), and after some HMD reboots it failed and sometimes not (I was worried 1st time I saw it and was scared to not reboot[to not brick permamently], so tried flashing different firmwares. After reboot every of this firmwares flashed cleanly.

The problem is that it's not reproducible.

rpavlik commented 1 year ago

yeah, unfortunately I don't have time to dig into it. If you want to, you're welcome to, and if you find a bug + fix it, I'll merge a fix, I just can't look into it myself.

(Long ago, I did consider combining the firmware hex with the bootloader hex for flashing...)

isopix commented 1 year ago

I didn't exptected that you would work on harmless bug(it's fortunately not bricking HMD,but it looked scary at 1st) for long ago abandoned hardware. I simply wondrif my HDK2 unit is broken or if it's general problem with this HDKs(or firmware). If it's general problem(not my unit), then maybe it should be left as 'open' (if it's not fixed)