Bootloader Flashing Issue

Post Reply
kn6otw
 

Posts: 8
Joined: 08 Oct 2023, 16:07

Bootloader Flashing Issue

Post by kn6otw »

Hi all -

I am using an Arduino Uno R3 as an ISP to attempt to flash the bootloader onto a newly built (from parts) truSDX, and am getting the following error:

Code: Select all

>>>: avrdude -c avrisp -p m328p -P COM9 -b 19200 -e -U flash:w:"truSDX-initial_Bootloader.hex":a -U lfuse:w:0xFF:m -U hfuse:w:0xD6:m -U efuse:w:0xFD:m 

avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude.exe: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.02s

avrdude.exe: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.02s

avrdude.exe: Device signature = 0x000000
avrdude.exe: Yikes!  Invalid device signature.
             Double check connections and try again, or use -F to override
             this check.


avrdude.exe done.  Thank you.
Essentially, it is coming back with the device signature of 000000 rather than what it should come back with. The odd thing here is that I was able to at least detect the chip (used the 'Detect' button) before soldering any components to the board, but after the board has all of the components soldered, I am getting this error. So it was at least able to read the chip before adding any components other than the ISP pins...

The reason that I checked before building the board is that I have a second board that has the exact same issue; device signature as all 0's. So before building the second board, I did the just the minimum - soldered the ISP header on - and connected it to at least see if AVRDUDESS could detect the chip. That went just fine. I was very careful when soldering (I have triple-checked and see no solder bridges) but now have two boards with this issue.

What should I be checking here? I'm kind of stuck at this point because I can't get the bootloader onto either of these boards, and don't really want to build a third unless I know what's going wrong with these two. I ordered 5 sets of boards for myself/to give to local club members (and because the minimum board order from JLCPCB is 5).

I'm attaching a screenshot of my AVRDUDESS screen in case that helps see what my setup is.

Appreciate any guidance/advice that anyone can offer.
Attachments
Screenshot 2023-11-22 002341.png
Screenshot 2023-11-22 002341.png (214.74 KiB) Viewed 1856 times
kn6otw
 

Posts: 8
Joined: 08 Oct 2023, 16:07

Re: Bootloader Flashing Issue

Post by kn6otw »

Here's the (kind of) weird part - if I tell AVRDUDESS to 'Force" (-F flag), it will actually complete the programming. Verification fails at the end of programming, but the display on the truSDX does display a hex number after this flashing. This tells me that the bootloader IS making it onto the truSDX (went from blank screen due to no bootloader to showing a hex value with the bootloader), however the value shown on the screen changes with every power cycle and occasionally starts with a 7000 series of numbers (per documentation, indicating some sort of issue). So the chip isn't detecting properly, and if I try to flash the bootloader WITHOUT force, I get the errors in my initial message (unknown signature 000000), but if I DO use force, it flashes the bootloader, but clearly there is some sort of issue because it isn't giving a consistent serial number and occasionally provides one of the numbers that indicates an error condition.

Additional information - if I use both -F and -V (to force and skip verification), it tries to move onto the fuse step. All three of the fuse sets fail, and when I get fuse values, it comes back as 0x00.
DL2MAN
 

Posts: 712
Joined: 30 Dec 2021, 19:18
Contact:

Re: Bootloader Flashing Issue

Post by DL2MAN »

There´s plenty of stuff, that could have gone wrong.
Most common:
- Inconsistent connection through bad jumper-cables.
- Bad (instable) power supply -> Do you use external Power to (tr)uSDX OR did you supply 5V via ISP ? Both together is creating a bad situation.
- Do you really have the 328P on there ? Or is it a PU ? Needs to be selected correctly for the Bootloader.
And last but not least:
You probably substituted the crystal for the ATMega in your JLC PCB BOM. Are you sure, it´s was the right replacement ? I had one case where the chosen crystal was actually a TCXO and of course would not work in that application.

73 Manuel; DL2MAN
pe1nnz
 

Posts: 50
Joined: 30 Dec 2021, 19:29

Re: Bootloader Flashing Issue

Post by pe1nnz »

In general a device signature of 0x0000 indeed indicates that the ISP programmer cannot reach the ATMEGA.

This can have multiple reasons:
1. the ISP cable is not connected or wrongly wired
2. the ATMEGA is not running because 5V is not on the VCC/VDD pins for some reason. Or there is an issue with the clock (crystal)
3. the fuse settings have programmed such that the ISP pins became inaccessible, in such case a HV programmer is needed to program the default fuse settings
kn6otw
 

Posts: 8
Joined: 08 Oct 2023, 16:07

Re: Bootloader Flashing Issue

Post by kn6otw »

DL2MAN wrote: 23 Nov 2023, 08:37 There´s plenty of stuff, that could have gone wrong.
Most common:
- Inconsistent connection through bad jumper-cables.
- Bad (instable) power supply -> Do you use external Power to (tr)uSDX OR did you supply 5V via ISP ? Both together is creating a bad situation.
- Do you really have the 328P on there ? Or is it a PU ? Needs to be selected correctly for the Bootloader.
And last but not least:
You probably substituted the crystal for the ATMega in your JLC PCB BOM. Are you sure, it´s was the right replacement ? I had one case where the chosen crystal was actually a TCXO and of course would not work in that application.

73 Manuel; DL2MAN
Actually I did have to substitute the crystal... and now I'm suspicious about that part! I have tried with externally powering both boards having this issue, so I don't think it's that. And I don't think it's an inconsistent connection -- tried multiple sets of cables over two different boards. I am pretty sure it is a 328P -- I was able to get the exact item listed on the BOM that you provided (I didn't have to replace it).

Do you happen to have a link to a known-good crystal that's in-stock somewhere, so that I can try ordering it and being sure that it is actually a crystal?

Thanks so much!
kn6otw
 

Posts: 8
Joined: 08 Oct 2023, 16:07

Re: Bootloader Flashing Issue

Post by kn6otw »

pe1nnz wrote: 23 Nov 2023, 10:59 In general a device signature of 0x0000 indeed indicates that the ISP programmer cannot reach the ATMEGA.

This can have multiple reasons:
1. the ISP cable is not connected or wrongly wired
2. the ATMEGA is not running because 5V is not on the VCC/VDD pins for some reason. Or there is an issue with the clock (crystal)
3. the fuse settings have programmed such that the ISP pins became inaccessible, in such case a HV programmer is needed to program the default fuse settings
In this case the only reason why I know that it somehow could reach it is that using the '-F' option actually did flash the bootloader (just not in a healthy state) -- presumably that would have failed entirely if they just couldn't communicate. I think that DL2MAN may be onto something when he mentions the crystal replacement (which I had to do).
AA3K
 

Posts: 6
Joined: 20 Jan 2024, 17:13

Re: Bootloader Flashing Issue

Post by AA3K »

Just had this same problem. After my heart sank, I looked everything over and found one of the jumpers popped off my Arduino board. Plugged it back in, and all was fine.

Now to get the actual firmware.

Mark - AA3K
Mark - AA3K
dl6sez
 

Posts: 399
Joined: 30 Dec 2021, 22:54

Re: Bootloader Flashing Issue

Post by dl6sez »

Hello OMs,

you have been warned by Manuel to get a not intermittent solid connection while ISP programming the bootloader!

If you used -F it could easy set fuses wrong and your Atmega328 is now useless until soldered off and resetted by a HV programmer. This is in no case a solution with -F, forcing doesn't do it right here.
KN6OTW, for me your this could be your phenomenon...

73 de Chris
Chris DL6SEZ, JN48XL near Ulm, Southern Germany
kn6otw
 

Posts: 8
Joined: 08 Oct 2023, 16:07

Re: Bootloader Flashing Issue

Post by kn6otw »

dl6sez wrote: 20 Jan 2024, 20:07 Hello OMs,

you have been warned by Manuel to get a not intermittent solid connection while ISP programming the bootloader!

If you used -F it could easy set fuses wrong and your Atmega328 is now useless until soldered off and resetted by a HV programmer. This is in no case a solution with -F, forcing doesn't do it right here.
KN6OTW, for me your this could be your phenomenon...

73 de Chris
It is not; the -F was after failures and hours of troubleshooting. Though it may have caused additional problems (possible), it is not the initial cause. I have three additional boards that were not done with -F that now also have the proper crystal, and are still failing; the boards aren't being detected properly by the programmer at all so it won't even start...
dl6sez
 

Posts: 399
Joined: 30 Dec 2021, 22:54

Re: Bootloader Flashing Issue

Post by dl6sez »

ESD killed some parts maybe?
USB to serial CH340g or at Atmega328 itself.

73 de Chris
Chris DL6SEZ, JN48XL near Ulm, Southern Germany
wi7s
 

Posts: 5
Joined: 07 Feb 2024, 06:47

Re: Bootloader Flashing Issue

Post by wi7s »

I thought you needed to use "arduino" as programmer type in the avrdude command, if you are using an Arduino as an ISP. Also you need to have the ArduinoISP 'sketch' running in the Arduino UNO.

I.e. use -c arduino instead of -c avrisp

So the command line becomes

avrdude -c arduino -p m328p -P COM9 -b 19200 -e -U flash:w:"truSDX-initial_Bootloader.hex":a -U lfuse:w:0xFF:m -U hfuse:w:0xD6:m -U efuse:w:0xFD:m

If you use -c avrisp, then avrdude thinks it's dealing with the "Atmel AVR ISP" programmer.
Post Reply

Users browsing this forum: No registered users and 21 guests