Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

AVR Soft-Core (ATMega103) - issues during synthesis and implementation

Status
Not open for further replies.
Hello,

yesterday I received clone of "Atmel JTAG ICE" programmer/debugger (the parcel has been delayed) This is Chinese clone.Today I was trying to program "AVR Core" (as ATMega128) described in this thread. These attempts has been made on Windows 10 (64bit) using "ArduinoIDE 1.9.0 Beta" (in earlier versions of "ArduinoIDE" 'JTAG ICE programer hasn't been available). I installed "MEgaCore" package to Arduino IDE in order to has "ATmega128" compiling target:

https://github.com/MCUdude/MegaCore

I compiled simple blink program for "ATMEga128" without errors, but during attempt of loading compiled application I encountered errors. Here are error information from "ArduinoIDE":
avrdude: Version 6.3, compiled on Dec 16 2016 at 13:33:19
Copyright (c) 2000-2005 Brian Dean, https://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "C:\Users\mgabr\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino8/etc/avrdude.conf"

Using Port : usb
Using Programmer : atmelice_isp
avrdude: jtag3_open_common(): Did not find any device matching VID 0x03eb and PID list: 0x2141

avrdude done. Thank you.

An error occurred while uploading the sketch

Here is screenshot from "ArduinoIDE":

Arduino9.png

I tried to edit "avrdude.conf" file changing USB PID of my programmer ( I seen real VID and PID in "Device Manager" of Windowsd 10). Unfortunately these trials didn't finish positive.

I also tried the same simple blink program on Windows 7 (on VirtualBox) and "AVR Studio 4.13" with the same result - issue relating to mistaken PID of device. Here is screenshot:

Win7AVRStu4_01.png

Could somebpdy help me to overcome these obstacles ?

Best Regards
 

Hello,

My "AVR JTAG ICE" clone programer has different hardware VID and PID than original. After several attempts with different drivers (for JTAG programmer), few versions of "AVR studio" and editing "avrdude" configuration file (JTAG programmer description) from ArduinoIDE I realized that only one option for me is altering of "avrdude" source code and compiling again that program for Windows.

I downloaded "avrdude" sources (version 6.3) from this page:

https://download.savannah.gnu.org/releases/avrdude/

The project site is:

https://savannah.nongnu.org/projects/avrdude/

In source file "jtag3.c" (excerpt starting from line 1322) I found message showing by "avrdude" program of ArduinoIDE:

Code:
if (strncmp(port, "usb", 3) != 0) {
    avrdude_message(MSG_INFO, "%s: jtag3_open_common(): JTAGICE3/EDBG port names must start with \"usb\"\n",
                    progname);
    return -1;
  }

  serdev = &usb_serdev_frame;
  if (pgm->usbvid)
    pinfo.usbinfo.vid = pgm->usbvid;
  else
    pinfo.usbinfo.vid = USB_VENDOR_ATMEL;

  /* If the config entry did not specify a USB PID, insert the default one. */
  if (lfirst(pgm->usbpid) == NULL)
    ladd(pgm->usbpid, (void *)USB_DEVICE_JTAGICE3);

  for (usbpid = lfirst(pgm->usbpid); rv < 0 && usbpid != NULL; usbpid = lnext(usbpid)) {
    pinfo.usbinfo.flags = PINFO_FL_SILENT;
    pinfo.usbinfo.pid = *(int *)(ldata(usbpid));
    pgm->fd.usb.max_xfer = USBDEV_MAX_XFER_3;
    pgm->fd.usb.rep = USBDEV_BULK_EP_READ_3;
    pgm->fd.usb.wep = USBDEV_BULK_EP_WRITE_3;
    pgm->fd.usb.eep = USBDEV_EVT_EP_READ_3;

    strcpy(pgm->port, port);
    rv = serial_open(port, pinfo, &pgm->fd);
  }
  if (rv < 0) {
    avrdude_message(MSG_INFO, "%s: jtag3_open_common(): Did not find any device matching VID 0x%04x and PID list: ",
                    progname, (unsigned)pinfo.usbinfo.vid);
    int notfirst = 0;
    for (usbpid = lfirst(pgm->usbpid); usbpid != NULL; usbpid = lnext(usbpid)) {
      if (notfirst)
        avrdude_message(MSG_INFO, ", ");
      avrdude_message(MSG_INFO, "0x%04x", (unsigned int)(*(int *)(ldata(usbpid))));
      notfirst = 1;
    }
    fputc('\n', stderr);

    return -1;
  }

I am suspecting that this if is responsible for not positive result of altering "avrdude" configuration file (from unknow reason this condition wasn't met)
I was able to change PID of my programer, but not VID - which was always this VID of Atmel company:
Code:
 if (pgm->usbvid)
    pinfo.usbinfo.vid = pgm->usbvid;
  else
    pinfo.usbinfo.vid = USB_VENDOR_ATMEL;

I have to find tutorial how to compile "avrdude" program from sources for Windows7 and then try to edit it's sources and compile again. If somebody have hints please feel free to write.

Best Reagards
 

Hello,

today I compiled "avrdude" program from sources (for Windows10). Although my Windows10 is 64-bit I decided to compile "avrdude" as 32-bit application (reason -less problems).

I downloaded "avrdude" sources (version 6.3) from this WWW page:

https://download.savannah.gnu.org/releases/avrdude/

The compilation I performed according to this tutorial:

https://tomeko.net/other/avrdude/building_avrdude.php?lang=en

Everything went smoothly. Here is screenshot after ./configure:

AVRDudeKompil.png

The compilation itself has taken few minutes (command make) and after that the target "avrdude.exe" has been made. Here is screenshot from testing run of built application (avrdude.exe):

AVRDudeAfterKompil.png

Now I will be trying to embed this compiled version of "avrdude.exe" in ArduinoIDE and check if it is working properly. This "avrdude" application had been compiled with debug symbols and I am wondering what debugger I can use? In "MINGW" environment there is "gdb" debbuger, but I don't know how to use it during "avrdude" is working together with "ArduinboIDE" (on Windows OS)? If somebody have hints he is welcome ;)

If "avrdude" wil be working properly with "ArduinoIDE" i try to alter it's source code in order to work with "JTAG ICE" programer (clone).

Regards

- - - Updated - - -

I checked this compiled from sources version of "avrdude" (version 6.3) with ArduinoIDE (1.9.0 beta) and it is working properly together. Now i am seeking how to debug "avrdue" program during normal work of ArduinoIDE.

Regards
 

Hello,

I bought hardware board with ATMega128, and checked this board with Chinese clone of "AVR ICE JTAG" programer. I have exactly the same errors with this hardware board with ATMega128 and "AVR core" on FPGA board. Here are erros from "avrdude" (from Arduino IDE on Windows10):

Code:
avrdude: Version 6.3, compiled on Mar 14 2020 at 11:11:00
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Users\mgabr\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino8/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : jtag3
         Setting bit clk period        : 0.1
pgm->usbvid=0x1a86   pgm->usbpid=0x283c150 "
avrdude: usbdev_open(): Found USB2.0-Serial, serno: ?
avrdude: max packet size expected 512, but found 32 due to EP 0x82's wMaxPacketSize
avrdude: usbdev_send(): wrote -22 out of 7 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: The parameter is incorrect.


avrdude: jtag3_send(): failed to send command to serial port

avrdude done.  Thank you.

the selected serial port 
 does not exist or your board is not connected

It seems that this is error in implementation of 'avrdude" program on Windows platform. More precisely speaking this JTAG programer clone is different than original "Atmel ICE" and current version of "avrdude" (or libusb under the hood) is not handling it properly. It seems that it is not issue with implementation JTAG interface in "AVR Core" on FPGA board. Maybe under Linux OS it is working properly, but unfortunately I am not able to check this because hard disk with Linux partitions in my PCbox had break-down some time ago.

Best Regards
 

Hello,

today I installed Linux on new disk (on my PCBox) and checked this Chinese clone of "AVR ICE JTAG" programer with ATMega128 board. I used "avrdude" from "Arduino IDE" on Linux Mint. Results are the same as on Windows10, so I gave up hope to run this "AVR core" project.

Kind regards
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top