Coder Social home page Coder Social logo

Comments (23)

MCUdude avatar MCUdude commented on July 29, 2024

Hi!
I've never experienced any issues while uploading using a USB to serial adapter. Do you have another chip/board to test with? You might want to double check that the fuses is correct

from megacore.

Borsoft73 avatar Borsoft73 commented on July 29, 2024

I'm stuck, still no progress...:( Bootloader don't want to write the code into the chip.

  • I tried 3 another Atmega128A chips and 1 another PC.
  • LED on PB5 is flashing so bootloader is in place and working.
  • USB-UART - I tried CH340 and CP2102 based devices. They work well with Atmega328 boards.
  • UART connection seems also working as avrdude starting upload and can read chip signature
  • 2x100nF caps Vcc-Gnd are in place, Reset pull-up 10k (I tried also 47k as mentioned in datasheet), 100nF cap on DTR to Reset line
  • Fuses:
    LFUSE - 0x3F
    HFUSE - 0xC6
    EFUSE - 0xFF
    LOCK - 0x0F
  • I tried with HFUSE 0xC4 (I found that bootloader starts from 0xFC00) and LOCK 0x3F (fully unlocked) - no result.
  • I noted that upload starts even without DTR signal - usually other boards waiting for LOW on DTR line or manual Reset to start upload - looks strange

Here is the schematics I use: https://easyeda.com/normal/Schematic-daa7aab244404e378c8103818bf43c53

Any other ideas?

from megacore.

Borsoft73 avatar Borsoft73 commented on July 29, 2024

Do I have any chance to get some feedback?

from megacore.

MCUdude avatar MCUdude commented on July 29, 2024

I'm sorry, but I've been on business trip for a whole week. I'll dig into it in a couple of days

from megacore.

MCUdude avatar MCUdude commented on July 29, 2024

I'm not able to view the EasyEDA schematic. All I see is the logo.. please post a picture the schematic instead. A photo of your actual board would also be nice 🙂

Like I've already mentioned; I've never seen this before. Using USB to serial uploading have always worked perfectly without any errors. BTW what kind of programmer are you using?

from megacore.

Borsoft73 avatar Borsoft73 commented on July 29, 2024

Hi! I'm happy that you are here again😊
Here is my schematic:
default
And here is the board itself with some marks:
fullsizerender 4
fullsizerender 5
As you may see there is no USB-UART chip on it so far, so I used external adapters on CP2102 and CH340 for serial connection.
I'm using USBASP for flashing and fuses setting.

from megacore.

MCUdude avatar MCUdude commented on July 29, 2024

hmm. I don't see any obvious hardware issues. Your schematic looks correct. Can you get avrdude to verify the current fuse settings, both low, high, extended and lockfuse?

BTW have you disconnected the programmer when uploading with the USB to serial adapter?

from megacore.

Borsoft73 avatar Borsoft73 commented on July 29, 2024

Here are the fuses which I found in the chip after MegaCore installation: Low = 0xBF, High = 0xC6, Ext = 0xFF, Lock = 0x0F.
Bootloader settings I choose in Arduino IDE: Atmega128, BOD = 2.7V, Clock = Ext. 16MHz, LTO disabled.
LED on PB5 is flashing.
Serial itself is working well, I checked it with AnalogReadSerial example sketch.
But the same behavior during sketch upload by Serial:

Reading | ################################################## | 100% 0.68s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
0xff != 0x0c
avrdude: verification error; content mismatch

avrdude done. Thank you.

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

And yes, I disconnected a programmer when uploading by UART

from megacore.

Borsoft73 avatar Borsoft73 commented on July 29, 2024

And what about DTR behaviour? Is it normal if bootloader starting to receive data even without DTR line?

from megacore.

MCUdude avatar MCUdude commented on July 29, 2024

Optiboot is able to start receiving data without the DTR line, but only once. After a program is received, it will never stay in bootloader mode forever, like it does when you have just burned the bootloader.

from megacore.

MCUdude avatar MCUdude commented on July 29, 2024

If you want you can try to use the older version of optiboot to see if it works better. This bootloader was "shipped" with MegaCore v1.0.1

from megacore.

Borsoft73 avatar Borsoft73 commented on July 29, 2024

I'm here back again! The same with 1.0.1 and all other versions.
You can see how it looks here: https://youtu.be/W3Efb8uDyqI

Also I found similar behaviour with your SerialReadWrite sketch. It runs, serial connection is working, but it can't write anything to the Flash. Here is how it works: https://youtu.be/45vlQO1n-Yg, and here is how the Flash dump looks after: https://youtu.be/F0FbI3GkcaA.

What do you think?

from megacore.

MCUdude avatar MCUdude commented on July 29, 2024

You're not able to write to the flash memory without the bootloader installed. I have no idea why uploading using Serial doesn't work. @majekw do you have any idea why this happen?

from megacore.

Borsoft73 avatar Borsoft73 commented on July 29, 2024

Tried SerialReadWrite sketch compiled with bootloader - the same result - it can not write to the flash

from megacore.

Borsoft73 avatar Borsoft73 commented on July 29, 2024

Hi @majekw, may be you can help me with my issue? Still no progress and I will appreciate any ideas…

from megacore.

Borsoft73 avatar Borsoft73 commented on July 29, 2024

SOLVED!
Just switched from USBISP to AVRISP Mk2 programmer.

from megacore.

MCUdude avatar MCUdude commented on July 29, 2024

Really?!

from megacore.

MCUdude avatar MCUdude commented on July 29, 2024

You need to re-program you USBasp and check for sure. I use the USBasp as one of my main programmers, and it has never failed me.

from megacore.

X3msnake avatar X3msnake commented on July 29, 2024

What usbisp are you using. Is it the chinese version. If so you should take a look at this git i fixed mine with it. https://github.com/aleh/usbisp

from megacore.

majekw avatar majekw commented on July 29, 2024

Better late than never :-)
I also heard about some USBasp which have problems with devices with more flash. I'm glad that this is not bootloader problem, because everything from description looked fine.

from megacore.

Borsoft73 avatar Borsoft73 commented on July 29, 2024

Yes, probably it has old firmware. But I was confused as it looked like both bootloader and USBasp works properly - LED on PB5 flashed and I had no problems with loading my software (~70kB) through this USBasp... So anyway thanks to everybody for support!

from megacore.

prajwalreddy7 avatar prajwalreddy7 commented on July 29, 2024

I had the same problem getting that Verification error and content mismatch all the time for code above 50 bytes (Blink code works fine), I m using USBasp programmer, So should I buy the new one?

Thank You.

from megacore.

Borsoft73 avatar Borsoft73 commented on July 29, 2024

I had the same problem getting that Verification error and content mismatch all the time for code above 50 bytes (Blink code works fine), I m using USBasp programmer, So should I buy the new one?

Thank You.

I switched to AVRIsp mkII programmer - works fine for me, no issues.

from megacore.

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.