noopkat / avrgirl-usbtinyisp

AVRGirl wrapper for driving USBtinyISP programmers
13 stars 5 forks source link

Looking for physical hardware testers #8

Open noopkat opened 8 years ago

noopkat commented 8 years ago

If you have any of the devices that avrgirl-usbtinyisp supports, please have a go at using it to upload a precompiled script to a chip. Open an issue if you run into anything other than success.

Thank you :sparkles:

shickey commented 6 years ago

Hi @noopkat,

Thanks for putting this library together. I'm having trouble getting my script to upload using avrgirl-usbtinyisp. I tried using the example code

async.series([
  avrgirl.enterProgrammingMode,
  avrgirl.writeFlash.bind(avrgirl, 'script.c.hex'),
  avrgirl.exitProgrammingMode
  ], function (error) {
    console.log('err', error);
    avrgirl.close();
  }
);

as well as trying to call each function and callback manually

avrgirl.enterProgrammingMode(function(e) {
  if (e === undefined) {
    avrgirl.writeFlash('script.c.hex', function(e) {
      if (e === null) {
        avrgirl.exitProgrammingMode(function(e) {
          if (e === undefined) {
            console.log("Flash succeeded");
          }
          else {
            console.log("Error exiting programming mode");
            console.log(e);
          }
        });
      }
      else {
        console.log("Error writing flash");
        console.log(e);
      }
    });
  }
  else {
    console.log("Error entering programming mode");
    console.log(e);
  }
});

Neither are throwing errors and it appears my code is successfully finding my programmer and attempting to flash the chip, but it just doesn't quite finish correctly. It almost seems like it's not taking enough time to fully send the data across the wire. Am I missing something obvious and/or is there a way to get more debug output?

noopkat commented 6 years ago

Hi there @shickey thanks for reporting this issue. Let's see if we can figure out what's going wrong 🔍

  1. Which microchip are you using?
  2. By not finish correctly, do you mean that there are no errors, just the process seems to quit too soon?
  3. What's the size (in bytes) of your program?

This could be old dependencies needing an update, or my code being not so robust for all scenarios, or something else entirely. We'll try to get to the bottom of it though. I'll get out my usbtinyisp and try flashing something to an attiny85 in the meantime to see if I can replicate.

Thanks and apologies that you're having dramas using this library!