tessel / attiny-common

A common library for Tessel's ATTiny based modules
2 stars 0 forks source link

T1 Bug: Updating doesn't work consistently anymore #6

Open johnnyman727 opened 8 years ago

johnnyman727 commented 8 years ago

I wasn't able to find the exact commit that caused this (potentially because it works occasionally, giving you false positives), but attempting to update the firmware on the ambient module (untested on IR but there's no reason why it would work differently) often returns with one of a handful of different errors. The easiest way to test this is by running the update script from the ambient module.

Some of the errors I get:

  ambient-attx4 git:(jon-t2-compat) ✗ tessel run debug/update.js
TESSEL! Connected to TM-00-04-f0009a30-0056434b-54396208.
INFO Bundling directory /Users/Jon/Work/technical/modules/ambient-attx4
INFO Deploying bundle (2.45 MB)...
INFO Running script...
Error: Unable to update firmware: Programming confirmation not received.
    at _new ([string "colony-init.lua"]:1)
    at callback (/app/node_modules/attiny-common/lib/index.js:191)
    at callback (/app/node_modules/attiny-common/lib/attiny-isp.js:150)
    at next (/app/node_modules/attiny-common/lib/attiny-isp.js:15)
    at next (...node_modules/attiny-common/node_modules/avr-isp/index.js:74)
    at callback (...node_modules/attiny-common/node_modules/avr-isp/index.js:373)
    at func ([string "tessel.js"]:1110)
    at apply ([string "colony-js.lua"]:1)
    at func ([string "events.js"]:180)
    at call ([string "colony-js.lua"]:1)
➜  ambient-attx4 git:(jon-t2-compat) ✗ tessel run debug/update.js
TESSEL! Connected to TM-00-04-f0009a30-0056434b-54396208.
INFO Bundling directory /Users/Jon/Work/technical/modules/ambient-attx4
INFO Deploying bundle (2.45 MB)...
INFO Running script...
Error: Unable to update firmware: Invalid Module signature. Are you sure you plugged in the right module?
    at _new ([string "colony-init.lua"]:1)
    at callback (/app/node_modules/attiny-common/lib/index.js:191)
    at callback (/app/node_modules/attiny-common/lib/attiny-isp.js:150)
    at next (/app/node_modules/attiny-common/lib/attiny-isp.js:24)
    at next (...node_modules/attiny-common/node_modules/avr-isp/index.js:69)
    at callback (...node_modules/attiny-common/node_modules/avr-isp/index.js:539)
    at func ([string "tessel.js"]:1110)
    at apply ([string "colony-js.lua"]:1)
    at func ([string "events.js"]:180)
    at call ([string "colony-js.lua"]:1)
➜  ambient-attx4 git:(jon-t2-compat) ✗ tessel run debug/update.js
TESSEL! Connected to TM-00-04-f0009a30-0056434b-54396208.
INFO Bundling directory /Users/Jon/Work/technical/modules/ambient-attx4
INFO Deploying bundle (2.45 MB)...
INFO Running script...
Uploading new firmware...
Update finished!
Error: Invalid response from CRC check.
    at _new ([string "colony-init.lua"]:504)
    at callback (/app/node_modules/attiny-common/lib/index.js:277)
    at func ([string "tessel.js"]:1110)
    at apply ([string "colony-js.lua"]:380)
    at func ([string "events.js"]:180)
    at call ([string "colony-js.lua"]:354)
    at emit ([string "events.js"]:89)
    at <anonymous> ([string "colony-node.lua"]:52)

I've tried testing with attiny-common on master and the jon-t2-compat branch. I also tested avr-isp from jon-t2-compat back to e1bf12c (I think that's about 6 commits back from master at this point in time).

johnnyman727 commented 8 years ago

We may want to consider switching to avrgirl instead of the avr-isp package because the former is currently supported.

rwaldron commented 8 years ago

We may want to consider switching to avrgirl

@noopkat I can give you a T2 as soon as you're back from JSConf

noopkat commented 8 years ago

@rwaldron :raising_hand: :cool:

vsviridov commented 8 years ago

Updating doesn't work on T1 with both IR and ambient modules. Usually the behavior is following: It detects old firmware because module id and firmware version are being reported as 0xFF, which triggers the update. It flashes the firmware, waits, attempts to check for CRC and fails. Both modules end up in a corrupted state until power-cycled, because any subsequent attempts fail at various stages of trying to obtain module id and/or firmware version.