iceman1001 / ChameleonMini-rebooted

Chameleon Mini revE rebooted - Iceman Fork, the ChameleonMini is a versatile contactless smartcard emulator (NFC/RFID)
Other
391 stars 85 forks source link

[FORUM] dfu-programmer 0.7.2 fails on linux #210

Open mywalkb opened 1 year ago

mywalkb commented 1 year ago

I trying to update the firmware from linux but fails with this error:

dfu-programmer atxmega32a4u flash --eeprom --force --suppress-validation ChameleonMini.eep.scramble
0%                            100%  Programming 0x40 bytes...
[ X  ERROR
Memory write error, use debug for more info.
dfu-programmer atxmega32a4u flash --eeprom --force --suppress-validation ChameleonMini.eep.scramble --debug 100
     target: atxmega32a4u
    chip_id: 0x2fe4
  vendor_id: 0x03eb
    command: flash
      quiet: false
      debug: 100
device_type: XMEGA
------ command specific below ------
   validate: false
   hex file: ChameleonMini.eep.scramble

atmel.c:1293: atmel_flash( 0x7ffc73928c20, 0x7ffc73928b80, true, false )
atmel.c:1158: atmel_flash_prep_buffer( 0x7ffc73928b80 )
atmel.c:1331: Flash available from 0x0 to 0x3FF (64kB p. 0 to 0), 0x400 bytes.
atmel.c:1336: Data start @ 0x0: 64kB p 0; 32B p 0x0 + 0x0 offset.
atmel.c:1340: Data end @ 0x3F: 64kB p 0; 32B p 0x1 + 0x1F offset.
atmel.c:1344: Totals: 0x40 bytes, 2 32B pages, 1 64kB byte pages.
atmel.c:1041: atmel_select_memory_unit( 0x7ffc73928c20, 1 )
atmel.c:1073: Selecting eeprom memory unit.
Programming 0x40 bytes...
atmel.c:1100: atmel_select_page( 0x7ffc73928c20, 0 )
atmel.c:1113: Selecting page 0, address 0x0.
atmel.c:1428: Program data block: 0x0 to 0x3F (p. 0), 0x40 bytes.
atmel.c:1565: __atmel_flash_block( 0x7ffc73928c20, 0x7ffc73928b80, true )
atmel.c:1527: atmel_flash_populate_header( 0x7ffc73928650, 0x0, 0x3F, true )
atmel.c:1481: atmel_flash_populate_footer( 0x7ffc73928650, 0x7ffc739286d0, 65535, 65535, 65535 )
atmel.c:1627: atmel_flash: flash data dfu_download failed.
atmel.c:1628: Expected message length of 144, got -9.
atmel.c:1434: Error flashing the block: err -2.
ERROR
Memory write error, use debug for more info.
commands.c:360: Error writing memory data. (err -4)

I tested version 0.7.2 and latest from dfu-programmer without success. I tried on Windows and works.

OT Github support Discussion just enable it from Settings. So we can use it as forum instead of issue.

pdarcos commented 1 year ago

I have the exact same problem. Running Pop!_OS 22.04 LTS

Did anyone figure out a solution?

tgiachi commented 1 year ago

Same problem here!

tbaumann commented 1 year ago

I assumed I was supposed to expect those errors (Because --force) My dfu-programmer is even newer

❯ sudo dfu-programmer atxmega32a4u erase --force
Erasing flash...  Success
Checking memory from 0x0 to 0x7FFF...  Not blank at 0x7FF1.

❯ sudo dfu-programmer atxmega32a4u flash --eeprom --force --suppress-validation ./Firmware/ChameleonMini/ChameleonMini.eep.scramble
WARNING (line 3): 0x8000 address outside valid region,
 suppressing additional address error messages.
Total of 0xFA6 bytes in invalid addressed.
WARNING: 0xFA6 bytes are outside target memory,
 and will not be written.
Hex file error, use debug for more info.

❯ sudo dfu-programmer atxmega32a4u flash --force --suppress-validation ./Firmware/ChameleonMini/ChameleonMini.hex.scramble
0%                            100%  Programming 0x5900 bytes...
[ X  ERROR
Memory write error, use debug for more info.

❯ dfu-programmer --version
dfu-programmer 1.0.0

But it's not waking up.

I had SNAFUed the device with the wrong files I think. So I followed instructions to unbrick it. I scrambled ChameleonMiniRDV2.0_ATxmega32A4U.hex and ITS_A_CARD.hex (In the ./Firmware/ChameleonMini/ directory to make copy&paste easier)

pdarcos commented 1 year ago

So no one is able to flash recent releases on linux? There must be a way to do this

ca1e commented 1 year ago

seems like you bricked your device by flashed a big fireware, try unbrick your dev by follow the wiki:

https://github.com/iceman1001/ChameleonMini-rebooted/wiki/How-to-program-with-AVRISP-mkII

to use a new bootloader that no need to scramble the hex anymore: https://github.com/iceman1001/ChameleonMini-rebooted/wiki/Reference-RevE-Bootloader