Giter Site home page Giter Site logo

Won't flash using IDE 2.2.1 about lgt8fx HOT 38 OPEN

bmentink avatar bmentink commented on May 24, 2024
Won't flash using IDE 2.2.1

from lgt8fx.

Comments (38)

dbuezas avatar dbuezas commented on May 24, 2024 2

With the old IDE (v1.8.19) the ISP works fine as is. It has happened to me that it failed to work, but the reason ended up being that the boards were fried.

from lgt8fx.

bmentink avatar bmentink commented on May 24, 2024

Update: I wonder if I got some bad boards. I have 5 boards, 3 program ok, 2 won't.

from lgt8fx.

hmeijdam avatar hmeijdam commented on May 24, 2024

You could try to use one of the working ones for attempting to burn the bootloader on one of the defective boards.

from lgt8fx.

bmentink avatar bmentink commented on May 24, 2024

You could try to use one of the working ones for attempting to burn the bootloader on one of the defective boards.

Can you show me how to connect the SPI pins? It is not clear from the board which ones connect to MOSI and MISO, CLK etc, seems to have a pin missing. Cheers (can only see SWC and SWD)

from lgt8fx.

hmeijdam avatar hmeijdam commented on May 24, 2024

You need LGTISP to burn the bootloader via SWD and SWC.

from lgt8fx.

bmentink avatar bmentink commented on May 24, 2024

Thanks, will give it a try.

from lgt8fx.

bmentink avatar bmentink commented on May 24, 2024

I loaded up a good LGT board with the LGTISP.ino sketch ok. However, when I go to program the bootloader to another LGT board connected with SWC,SWD etc it gives error.

avrdude error: programmer is out of sync
 ***failed;
avrdude error: programmer is out of sync
 ***failed;

I am somewhat confused as the instructions say to use AVR ISP as programmer, even though there is an " LGTSWD markii as ISP" option ??

from lgt8fx.

hmeijdam avatar hmeijdam commented on May 24, 2024

There is a LarduinoISP sketch amongst the examples. Did you compile and load that one?
It also mentions how to wire it up. You need to look at the right column under LGT8FX8P:

image

The LGTSWD Mark II is this one. Probably not what you have.

from lgt8fx.

bmentink avatar bmentink commented on May 24, 2024

You linked the github site, it only shows these files, no examples. Please be specific.
Screenshot 2024-02-23 at 10 39 14 AM

You show me an Arduino as ESP, in your example above, I am using LGT to program LGT. ARe the pin connections the same?

from lgt8fx.

hmeijdam avatar hmeijdam commented on May 24, 2024

This is the example I mean. It comes with this core.

image

from lgt8fx.

bmentink avatar bmentink commented on May 24, 2024

Right, you did not link that initially, now I understand. BUt the question remains, If I use LGT as ESP are the pin connections the same?

from lgt8fx.

hmeijdam avatar hmeijdam commented on May 24, 2024

LGT as ISP has these connections.
image
If that does not work, I will dig up my LGT's and hook them up. Has been a few years since I had to bootload one.

from lgt8fx.

bmentink avatar bmentink commented on May 24, 2024

I don't have those examples .... maybe I have the wrong LGT library?

I got the library from here:
https://raw.githubusercontent.com/dbuezas/lgt8fx/master/package_lgt8fx_index.json

from lgt8fx.

bmentink avatar bmentink commented on May 24, 2024

LGT as ISP has these connections. image If that does not work, I will dig up my LGT's and hook them up. Has been a few years since I had to bootload one.

I don't have those names, please give the corresponding D8,D10) etc ..

from lgt8fx.

hmeijdam avatar hmeijdam commented on May 24, 2024

Well.... you are posting your question in the Github forum of the core I am using, so I assumed you will have the LarduinoISP as well. But apparently not

Here are the pins

lgt8f328p_nano_qfp32l_pinout-1-1024x627

from lgt8fx.

bmentink avatar bmentink commented on May 24, 2024

I have added the core I am using above, is it incorrect?

from lgt8fx.

hmeijdam avatar hmeijdam commented on May 24, 2024

That's the one I use.

from lgt8fx.

bmentink avatar bmentink commented on May 24, 2024

That's the one I use.

So why no examples?

from lgt8fx.

hmeijdam avatar hmeijdam commented on May 24, 2024

I honestly have no clue.
Here is the LarduinoISP sketch


// 20 July 2020 David Buezas
// - Bundled and added menu utility
// * When uploading to the programmer,
//   select in the menu: Tools/Arduino as ISP/SERIAL_RX_BUFFER_SIZE to 250)
// * Before using the ISP to program another board, 
//   connect (in the ISP board) the reset pin to gnd via a capacitor,
//   or (at your own risk) short reset to vcc.
// https://github.com/dbuezas/lgt8fx/
//
// author : brother_yan (https://github.com/brother-yan/LGTISP)
//
// LarduinoISP for LGT8FX8P series
// Project fork from
//    - ArduinoISP version 04m3
// Copyright (c) 2008-2011 Randall Bohn
// If you require a license, see 
//     http://www.opensource.org/licenses/bsd-license.php
//
// This sketch turns the Arduino into a AVRISP
// using the following arduino pins:
//
// pin name:    Arduino:          LGT8FX8P:
// slave reset: 10:               PC6/RESET 
// SWD:         12:               PE2/SWD
// SWC:         13:               PE0/SCK
// Make sure to 
// Put an LED (with resistor) on the following pins:
// 9: Heartbeat   - shows the programmer is running
// 8: Error       - Lights up if something goes wrong (use red if that makes sense)
// 7: Programming - In communication with the slave
//
// 23 July 2011 Randall Bohn
// -Address Arduino issue 509 :: Portability of ArduinoISP
// http://code.google.com/p/arduino/issues/detail?id=509
//
// October 2010 by Randall Bohn
// - Write to EEPROM > 256 bytes
// - Better use of LEDs:
// -- Flash LED_PMODE on each flash commit
// -- Flash LED_PMODE while writing EEPROM (both give visual feedback of writing progress)
// - Light LED_ERR whenever we hit a STK_NOSYNC. Turn it off when back in sync.
// - Use pins_arduino.h (should also work on Arduino Mega)
//
// October 2009 by David A. Mellis
// - Added support for the read signature command
// 
// February 2009 by Randall Bohn
// - Added support for writing to EEPROM (what took so long?)
// Windows users should consider WinAVR's avrdude instead of the
// avrdude included with Arduino software.
//
// January 2008 by Randall Bohn
// - Thanks to Amplificar for helping me with the STK500 protocol
// - The AVRISP/STK500 (mk I) protocol is used in the arduino bootloader
// - The SPI functions herein were developed for the AVR910_ARD programmer 
// - More information at http://code.google.com/p/mega-isp

// LarduinoISP for LGTF8FX8P Series
#include "swd_lgt8fx8p.h"

#if SERIAL_RX_BUFFER_SIZE < 250 // 64 bytes的RX缓冲不够大
#error : Please change the macro SERIAL_RX_BUFFER_SIZE to 250 (In the menu: Tools/Arduino as ISP/SERIAL_RX_BUFFER_SIZE)
#endif

#define RESET	10
#define LED_HB    9
#define LED_ERR   8
#define LED_PMODE 7
#define PROG_FLICKER true

#define HWVER 3
#define SWMAJ 5
#define SWMIN 1

// STK Definitions
#define STK_OK      0x10
#define STK_FAILED  0x11
#define STK_UNKNOWN 0x12
#define STK_INSYNC  0x14
#define STK_NOSYNC  0x15
#define CRC_EOP     0x20 //ok it is a space...

void pulse(int pin, int times);

void setup() 
{
  SWD_init();
  Serial.begin(115200);
  
  //pinMode(LED_PMODE, OUTPUT);
  //pulse(LED_PMODE, 2);
  //pinMode(LED_ERR, OUTPUT);
  //pulse(LED_ERR, 2);
  //pinMode(LED_HB, OUTPUT);
  //pulse(LED_HB, 2);
}

uint8_t error=0;
uint8_t pmode=0;

// address for reading and writing, set by 'U' command
int address;
uint8_t buff[256]; // global block storage

#define beget16(addr) (*addr * 256 + *(addr+1) )
typedef struct param {
  uint8_t devicecode;
  uint8_t revision;
  uint8_t progtype;
  uint8_t parmode;
  uint8_t polling;
  uint8_t selftimed;
  uint8_t lockbytes;
  uint8_t fusebytes;
  uint8_t flashpoll;
  uint16_t eeprompoll;
  uint16_t pagesize;
  uint16_t eepromsize;
  uint32_t flashsize;
}  parameter_t;
parameter_t param;

// this provides a heartbeat on pin 9, so you can tell the software is running.
uint8_t hbval=128;
uint8_t hbdelta=8;
void heartbeat() 
{
  if (hbval > 192) hbdelta = -hbdelta;
  if (hbval < 32) hbdelta = -hbdelta;
  hbval += hbdelta;
  analogWrite(LED_HB, hbval);
  delay(40);
}

void loop(void) 
{
  // is pmode active?
/*
  if (pmode) digitalWrite(LED_PMODE, HIGH); 
  else digitalWrite(LED_PMODE, LOW);
  // is taddress an error?
  if (error) digitalWrite(LED_ERR, HIGH); 
  else digitalWrite(LED_ERR, LOW);
*/
  // light the heartbeat LED
  //heartbeat();
  if (Serial.available()) 
    avrisp();
}

uint8_t getch() {
  while(!Serial.available());
  return Serial.read();
}

void fill(int n) 
{
  for (int x = 0; x < n; x++) {
    buff[x] = getch();
  }
}

#define PTIME 30
void pulse(int pin, int times) 
{
  do {
    digitalWrite(pin, HIGH);
    delay(PTIME);
    digitalWrite(pin, LOW);
    delay(PTIME);
  } 
  while (times--);
}

void prog_lamp(int state) 
{
  if (PROG_FLICKER)
    digitalWrite(LED_PMODE, state);
}

void empty_reply() 
{
  if (CRC_EOP == getch()) {
    Serial.print((char)STK_INSYNC);
    Serial.print((char)STK_OK);
  } 
  else {
    error++;
    Serial.print((char)STK_NOSYNC);
  }
}

void breply(uint8_t b) 
{
  if (CRC_EOP == getch()) {
    Serial.print((char)STK_INSYNC);
    Serial.print((char)b);
    Serial.print((char)STK_OK);
  } 
  else {
    error++;
    Serial.print((char)STK_NOSYNC);
  }
}

void get_version(uint8_t c) 
{
  switch(c) {
  case 0x80:
    breply(HWVER);
    break;
  case 0x81:
    breply(SWMAJ);
    break;
  case 0x82:
    breply(SWMIN);
    break;
  case 0x93:
    breply('S'); // serial programmer
    break;
  default:
    breply(0);
  }
}

void set_parameters() 
{
  // call this after reading paramter packet into buff[]
  param.devicecode = buff[0];
  param.revision   = buff[1];
  param.progtype   = buff[2];
  param.parmode    = buff[3];
  param.polling    = buff[4];
  param.selftimed  = buff[5];
  param.lockbytes  = buff[6];
  param.fusebytes  = buff[7];
  param.flashpoll  = buff[8]; 
  // ignore buff[9] (= buff[8])
  // following are 16 bits (big endian)
  param.eeprompoll = beget16(&buff[10]);
  param.pagesize   = beget16(&buff[12]);
  param.eepromsize = beget16(&buff[14]);

  // 32 bits flashsize (big endian)
  param.flashsize = buff[16] * 0x01000000
    + buff[17] * 0x00010000
    + buff[18] * 0x00000100
    + buff[19];

}

void start_pmode(uint8_t chip_erase) 
{
  digitalWrite(RESET, HIGH);
  pinMode(RESET, OUTPUT);
  delay(20);
  digitalWrite(RESET, LOW);
  
  SWD_init();
  SWD_Idle(10);
  
  pmode = SWD_UnLock(chip_erase);
  if (!pmode)
    pmode = SWD_UnLock(chip_erase);
}

void end_pmode()
{
  SWD_exit();
  pmode = 0;
  
  digitalWrite(RESET, HIGH);
  pinMode(RESET, INPUT);
}

void universal() 
{
  fill(4);

  if(buff[0] == 0x30 && buff[1] == 0x00) {
    switch(buff[2]) {
    case 0x00:
      breply(0x1e);
      break;
    case 0x01:
      breply(0x95);
      break;
    case 0x02:
      breply(0x0f);
      break;
    default:
      breply(0xff);
      break;  
    }
  } else if(buff[0] == 0xf0) {
    breply(0x00);
  } else {
    breply(0xff);
  }
}

void write_flash(int length) 
{
  fill(length);
  if (CRC_EOP == getch()) {
    Serial.print((char) STK_INSYNC);
    Serial.print((char) write_flash_pages(length));
  } 
  else {
    error++;
    Serial.print((char) STK_NOSYNC);
  }
}

uint8_t write_flash_pages(int length)
{
  int addr = address / 2;
  /*
  lgt8fx8p的flash是按4字节编址的,而avr是按2字节编址的,avrdude传过来的是按2字节编址的address
  avrisp()函数中也有证实:
  case 'U': // set address (word)
  */
  
  SWD_EEE_CSEQ(0x00, addr);
  SWD_EEE_CSEQ(0x84, addr);
  SWD_EEE_CSEQ(0x86, addr);
  
  for (int i = 0; i < length; i += 4)
    {
      SWD_EEE_Write(*((uint32_t *)(&buff[i])), addr);
      ++addr;
    }
  
  SWD_EEE_CSEQ(0x82, addr - 1);
  SWD_EEE_CSEQ(0x80, addr - 1);
  SWD_EEE_CSEQ(0x00, addr - 1);
  
  return STK_OK;
}

#define EECHUNK (32)
uint8_t write_eeprom(int length) 
{
  // address is a word address, get the byte address
  int start = address * 2;
  int remaining = length;
  if (length > param.eepromsize) {
    error++;
    return STK_FAILED;
  }
  while (remaining > EECHUNK) {
    write_eeprom_chunk(start, EECHUNK);
    start += EECHUNK;
    remaining -= EECHUNK;
  }
  write_eeprom_chunk(start, remaining);
  return STK_OK;
}

// write (length) bytes, (start) is a byte address
uint8_t write_eeprom_chunk(int start, int length) 
{
  // this writes byte-by-byte,
  // page writing may be faster (4 bytes at a time)
  fill(length);
  prog_lamp(LOW);
  for (int x = 0; x < length; x++) {
    int addr = start+x;
    // do e2prom program here
    // donothing for lgt8fx8d series
    delay(45);
  }
  prog_lamp(HIGH); 
  return STK_OK;
}

void program_page() 
{
  char result = (char) STK_FAILED;

  // get length
  uint16_t length = getch() << 8;
  length += getch();

  char memtype = getch();
  // flash memory @address, (length) bytes
  if (memtype == 'F') {
    write_flash(length);
    return;
  }
  if (memtype == 'E') {
    result = (char)write_eeprom(length);
    if (CRC_EOP == getch()) {
      Serial.print((char) STK_INSYNC);
      Serial.print(result);
    } 
    else {
      error++;
      Serial.print((char) STK_NOSYNC);
    }
    return;
  }
  Serial.print((char)STK_FAILED);
  return;
}

char flash_read_page(int length)
{
  int addr = address / 2;
  /*
  lgt8fx8p的flash是按4字节编址的,而avr是按2字节编址的,avrdude传过来的是按2字节编址的address
  avrisp()函数中也有证实:
  case 'U': // set address (word)
  */
  
  SWD_EEE_CSEQ(0x00, 0x01);
  
  uint32_t data;
  for (int i = 0; i < length; ++i)
    {
      if (i % 4 == 0)
        {
          data = SWD_EEE_Read(addr);
          ++addr;
        }
      Serial.print((char)((uint8_t *)&data)[i % 4]);
    }
  
  SWD_EEE_CSEQ(0x00, 0x01);
  
  return STK_OK;
}

char eeprom_read_page(uint16_t length) 
{
  // address again we have a word address
  uint16_t start = address * 2;
  for (int x = 0; x < length; x++) {
    uint16_t addr = start + x;
    // do ep2rom read here
    // but donothing for lgt8fx8d series (by now...)
    Serial.print((char) 0xff);
  }
  return STK_OK;
}

void read_page() 
{
  char result = (char)STK_FAILED;

  uint16_t length = getch() << 8;
  length += getch();
  char memtype = getch();
  if (CRC_EOP != getch()) {
    error++;
    Serial.print((char) STK_NOSYNC);
    return;
  }
  Serial.print((char) STK_INSYNC);

  if (memtype == 'F') result = flash_read_page(length);
  if (memtype == 'E') result = eeprom_read_page(length);
  Serial.print(result);
  return;
}

void read_signature() 
{
  if (CRC_EOP != getch()) {
    error++;
    Serial.print((char) STK_NOSYNC);
    return;
  }
  
  Serial.print((char) STK_INSYNC);
  Serial.print((char) 0x1e);
  Serial.print((char) 0x95);
  Serial.print((char) 0x0a);
  Serial.print((char) STK_OK);
}

//////////////////////////////////////////
//////////////////////////////////////////


////////////////////////////////////
////////////////////////////////////
volatile uint8_t chip_erased;
int avrisp() 
{ 
  uint8_t data, low, high;
  uint8_t ch = getch();
  switch (ch) {
  case '0': // signon
    error = 0;
    empty_reply();
    break;
  case '1':
    if (getch() == CRC_EOP) {
      Serial.print((char) STK_INSYNC);
      Serial.print("AVR ISP");
      Serial.print((char) STK_OK);
    } else {
      error++;
      Serial.print((char) STK_NOSYNC);
    }
    break;
  case 'A':
    get_version(getch());
    break;
  case 'B':	// optional for lgt8fx8d series
    fill(20);
    set_parameters();
    empty_reply();
    break;
  case 'E': // extended parameters - ignore for now
    fill(5);
    empty_reply();
    break;

  case 'P':
    if (pmode) {
      pulse(LED_ERR, 3);
    } else {
      start_pmode(0);
      chip_erased = 0;
    }
    if (pmode)
      empty_reply();
    else
      {
        if (CRC_EOP == getch()) {
          Serial.print((char)STK_INSYNC);
          Serial.print((char)STK_FAILED);
        } 
        else {
          error++;
          Serial.print((char)STK_NOSYNC);
        }
      }
    break;
  case 'U': // set address (word)
    address = getch();
    address += (getch() << 8);
    empty_reply();
    break;
  case 0x60: //STK_PROG_FLASH
    low = getch();
    high = getch();
    empty_reply();
    break;
  case 0x61: //STK_PROG_DATA
    data = getch();
    empty_reply();
    break;
  case 0x64: //STK_PROG_PAGE
    if (!chip_erased)
      {
        error = 0;
        end_pmode();
        start_pmode(1);
        chip_erased = 1;
      }
    program_page();
    break;
  case 0x74: //STK_READ_PAGE 't'
    read_page();    
    break;
  case 'V': //0x56
    universal();
    break;
  case 'Q': //0x51
    error=0;
    end_pmode();
    empty_reply();
    break;
  case 0x75: //STK_READ_SIGN 'u'
    read_signature();
    break;
    // expecting a command, not CRC_EOP
    // this is how we can get back in sync
  case CRC_EOP:
    error++;
    Serial.print((char) STK_NOSYNC);
    break;

    // anything else we will return STK_UNKNOWN
  default:
    error++;
    if (CRC_EOP == getch()) 
      Serial.print((char)STK_UNKNOWN);
    else
      Serial.print((char)STK_NOSYNC);
  }
}

from lgt8fx.

bmentink avatar bmentink commented on May 24, 2024

THanks, these are the examples I have:
Screenshot 2024-02-23 at 11 02 05 AM

So just put the above code on the LGT board that has to act as ISP, right?
In that case, what is the LGTISP.ino I put on from github do then?

from lgt8fx.

hmeijdam avatar hmeijdam commented on May 24, 2024

LGTISP.ino may be a newer or older version. I have not used it myself as I usually grab my dedicated SWDICE programmer.

The sketch I just uploaded here I have used a while back. But I just found my box with LGT's so let me try if it still works.

from lgt8fx.

bmentink avatar bmentink commented on May 24, 2024

Thanks will wait. Meantime I tried connecting the programming pins at the end of the board to the target board pins, but that did not work either. So Still unsure of pin connections.

from lgt8fx.

hmeijdam avatar hmeijdam commented on May 24, 2024

Just tested and works fine

First burn the LarduinoISP.ino to your working Nano

Then hook it up like

// pin name:    Programmer NANO         Target LGT8FX8P:
// reset:                   10:            PC6/RESET 
// SWD:                     12:           PE2/SWD
// SWC:                     13:           PE0/SCK

Keep AVRISP as programmer and press "burn Bootloader"

image

I burned it to a "promini style" LGT board, as my second Nano has no pinheaders yet. But you will select the board you have to get the bootloader that goes with your board.

from lgt8fx.

bmentink avatar bmentink commented on May 24, 2024

First burn the LarduinoISP.ino to your working Nano

I keep teling you, I am not using an Arduino Nano as ISP, I am using LGT Nano, do I still use pins 10,12,13 on the ISP side ?

from lgt8fx.

hmeijdam avatar hmeijdam commented on May 24, 2024

I also used LGT Nano

from lgt8fx.

bmentink avatar bmentink commented on May 24, 2024

Well I get this using those pinouts:

avrdude error: programmer is not responding
avrdude warning: attempt 1 of 10: not in sync: resp=0x00
avrdude warning: ignoring mismatch in unused bits of lock
        (device 0xff != input 0x3f); to prevent this warning set
        unused bits to 1 when writing (double check with datasheet)
avrdude error: programmer is not responding
avrdude warning: attempt 1 of 10: not in sync: resp=0x00
avrdude warning: ignoring mismatch in unused bits of lock
        (device 0xff != input 0x3f); to prevent this warning set
        unused bits to 1 when writing (double check with datasheet)

from lgt8fx.

bmentink avatar bmentink commented on May 24, 2024

I have to go out, will pick this up later. Thanks for the help.

from lgt8fx.

hmeijdam avatar hmeijdam commented on May 24, 2024

This is how I wired it up

image

from lgt8fx.

bmentink avatar bmentink commented on May 24, 2024

I have exactly that!

from lgt8fx.

bmentink avatar bmentink commented on May 24, 2024

I'm back now if you have any more suggestions. I am using LarduinoISP.ino, but LGTISP.ino does not work either.

from lgt8fx.

dbuezas avatar dbuezas commented on May 24, 2024

Have you seen the tutorial in this repo?
https://github.com/dbuezas/lgt8fx/blob/master/lgt8f/libraries/LarduinoISP/readme.md

from lgt8fx.

hmeijdam avatar hmeijdam commented on May 24, 2024

Well I get this using those pinouts:

avrdude error: programmer is not responding
avrdude warning: attempt 1 of 10: not in sync: resp=0x00
avrdude warning: ignoring mismatch in unused bits of lock
        (device 0xff != input 0x3f); to prevent this warning set
        unused bits to 1 when writing (double check with datasheet)
avrdude error: programmer is not responding
avrdude warning: attempt 1 of 10: not in sync: resp=0x00
avrdude warning: ignoring mismatch in unused bits of lock
        (device 0xff != input 0x3f); to prevent this warning set
        unused bits to 1 when writing (double check with datasheet)

The only way how I can get your error is when I do not upload LarduinoISP to the LGT-Nano.

When I upload LarduinoISP to it and do not connect a target I get this error instead

Arduino: 1.8.19 (Windows 10), Board: "LGT8F328, 250 (to burn ISP), Internal 32MHz, 1, 328P-SSOP20 (e.g. green pseudo pro mini), 57600"

E:\Arduino\arduino-1.8.19\portable\packages\MiniCore\tools\avrdude\7.2-arduino.1/bin/avrdude -CE:\Arduino\arduino-1.8.19\portable\packages\MiniCore\tools\avrdude\7.2-arduino.1/etc/avrdude.conf -v -patmega328p -cstk500v1 -PCOM20 -e -Ulock:w:0x3f:m -Uefuse:w:0xff:m -Uhfuse:w:0xff:m -Ulfuse:w:0xff:m 

<<<< snip  - non informative part >>>>

avrdude stk500_program_enable() error: unable to enter programming mode
avrdude main() error: initialization failed, rc=-1
        - double check the connections and try again
        - use -B to set lower the bit clock frequency, e.g. -B 125kHz
        - use -F to override this check
avrdude done.  Thank you.

When I connect a target everything works 100%, even without the capacitor or disabled reset pin.

The only other difference I see is that I work on Arduino IDE V1.8.19 as I cannot upgrade to IDE V2 (it has no portable IDE anymore)

from lgt8fx.

bmentink avatar bmentink commented on May 24, 2024

Ok, trying again. I uploaded LarduinoISP to a working LGT sucessfully. Then without connecting target, I try to burn bootloader, I get this error:

avrdude error: unable to enter programming mode
avrdude error: initialization failed, rc=-1
        - double check the connections and try again
        - use -B to set lower the bit clock frequency, e.g. -B 125kHz
        - use -F to override this check
Failed chip erase: uploading error: exit status 1

Looks same as yours, except I am on MacOS not Windoze ...

from lgt8fx.

hmeijdam avatar hmeijdam commented on May 24, 2024

And what happens if you now connect one of your known working and one of your known not working targets?
The communication between the programmer and your Mac seems to be working.

from lgt8fx.

bmentink avatar bmentink commented on May 24, 2024

I get the error above. Maybe it's just a dud board?

avrdude error: programmer is not responding
avrdude warning: attempt 1 of 10: not in sync: resp=0x00
avrdude warning: ignoring mismatch in unused bits of lock
        (device 0xff != input 0x3f); to prevent this warning set
        unused bits to 1 when writing (double check with datasheet)
avrdude error: programmer is not responding
avrdude warning: attempt 1 of 10: not in sync: resp=0x00
avrdude warning: ignoring mismatch in unused bits of lock
        (device 0xff != input 0x3f); to prevent this warning set
        unused bits to 1 when writing (double check with datasheet)

Edit, that's the non-working board, I will try a good board next.

from lgt8fx.

bmentink avatar bmentink commented on May 24, 2024

Nope, new working board does the same thing.

from lgt8fx.

hmeijdam avatar hmeijdam commented on May 24, 2024

I start to suspect faulty breadboard wires or some HW problem.

from lgt8fx.

LaZsolt avatar LaZsolt commented on May 24, 2024

In my opinion the the communication speed is the source of the issue.
The LarduinoISP.ino in line 88 set the speed to 115200,


but the programmers.txt set the speed to 19200 baud.
avrisp.speed=19200

from lgt8fx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.