Bootloader uSDX programming issue

Post Reply
pd5gl
 

Posts: 6
Joined: 06 Apr 2022, 19:51

Bootloader uSDX programming issue

Post by pd5gl »

I've the 3th batch of *Rxxxx* uSDX and can't figure out why I can't upload the bootloader to the uSDX.
I used a USBtinyISP a USBADP and had most succes with a AZDelivery Microcontroller. See my log and I hope someone have another idea.
Maybe someone in Europe can help so I can ship the uSDX for programming or repair?

FIRST ATTEMPT

Code: Select all

c:\Program Files (x86)\AVRDUDESS>avrdude -c arduino -p m328p -P COM4 -b 19200 -e -U flash:w:"C:\Program Files (x86)\AVRDUDESS\truSDX-initial_Bootloader.hex":a

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.03s

avrdude: Device signature = 0xffffff (probably .reduced_core_tiny) (retrying)

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

avrdude: Device signature = 0xffffff (probably .reduced_core_tiny) (retrying)

Reading | ################################################## | 100% 0.03s

avrdude: Device signature = 0xffffff (probably .reduced_core_tiny)
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.


avrdude done. Thank you.
SECOND ATTEMPT

Code: Select all

c:\Program Files (x86)\AVRDUDESS>avrdude -c arduino -p m328p -P COM4 -e -U flash:w:"C:\Program Files (x86)\AVRDUDESS\truSDX-initial_Bootloader.hex":i -U lfuse:w:0xFF:m -U hfuse:w:0xD6:m -U efuse:w:0xFD:m

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.03s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: erasing chip
avrdude: reading input file "C:\Program Files (x86)\AVRDUDESS\truSDX-initial_Bootloader.hex"
avrdude: writing flash (32768 bytes):

Writing | ################################################## | 100% 7.57s

avrdude: 32768 bytes of flash written
avrdude: verifying flash memory against C:\Program Files (x86)\AVRDUDESS\truSDX-initial_Bootloader.hex:
avrdude: load data flash data from input file C:\Program Files (x86)\AVRDUDESS\truSDX-initial_Bootloader.hex:
avrdude: input file C:\Program Files (x86)\AVRDUDESS\truSDX-initial_Bootloader.hex contains 32768 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 6.23s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x7e00
0x11 != 0x01
avrdude: verification error; content mismatch

avrdude: safemode: Fuses OK (E:00, H:00, L:00)

avrdude done. Thank you.
THIRD ATTEMPT

Code: Select all

c:\Program Files (x86)\AVRDUDESS>avrdude -c arduino -p m328p -P COM4 -b 19200 -F -v -e -U flash:w:"C:\Program Files (x86)\AVRDUDESS\truSDX-initial_Bootloader.hex":i -U lfuse:w:0xFF:m -U hfuse:w:0xD6:m -U efuse:w:0xFD:m

avrdude: Version 6.3, compiled on Feb 17 2016 at 09:25:53
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "c:\Program Files (x86)\AVRDUDESS\avrdude.conf"

Using Port : COM4
Using Programmer : arduino
Overriding Baud Rate : 19200
AVR Part : ATmega328P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :

Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff
flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00

Programmer Type : Arduino
Description : Arduino
Hardware Version: 2
Firmware Version: 1.18
Topcard : Unknown
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.03s

avrdude: Device signature = 0xffffff (probably .reduced_core_tiny) (retrying)

Reading | ################################################## | 100% 0.03s

avrdude: Device signature = 0xffffff (probably .reduced_core_tiny) (retrying)

Reading | ################################################## | 100% 0.03s

avrdude: Device signature = 0xffffff (probably .reduced_core_tiny)
avrdude: Yikes! Invalid device signature.
avrdude: Expected signature for ATmega328P is 1E 95 0F
avrdude: safemode: hfuse reads as FF
avrdude: safemode: efuse reads as FF
avrdude: erasing chip
avrdude: reading input file "C:\Program Files (x86)\AVRDUDESS\truSDX-initial_Bootloader.hex"
avrdude: writing flash (32768 bytes):

Writing | ################################################## | 100% 37.61s

avrdude: 32768 bytes of flash written
avrdude: verifying flash memory against C:\Program Files (x86)\AVRDUDESS\truSDX-initial_Bootloader.hex:
avrdude: load data flash data from input file C:\Program Files (x86)\AVRDUDESS\truSDX-initial_Bootloader.hex:
avrdude: input file C:\Program Files (x86)\AVRDUDESS\truSDX-initial_Bootloader.hex contains 32768 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 21.77s

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

avrdude: safemode: hfuse reads as FF
avrdude: safemode: efuse reads as FF
avrdude: safemode: Fuses OK (E:FF, H:FF, L:FF)

avrdude done. Thank you.
AZ-Delivery.jpg
AZ-Delivery.jpg (218.11 KiB) Viewed 2199 times
Last edited by pd5gl on 07 Apr 2022, 09:08, edited 3 times in total.
hari
 

Posts: 17
Joined: 14 Feb 2022, 09:25

Re: Bootloader uSDX programming issue

Post by hari »

When using another Arduino board as ISP programmer, shouldn't you then use "-c avrisp" for programming the bootloader via ISP? "-c arduino" would be used for the regular firmware upload via USB/serial, not for the bootloader. But I don't have any experience with avrisp (I've always used USBASP for ISP).
pd5gl
 

Posts: 6
Joined: 06 Apr 2022, 19:51

Re: Bootloader uSDX programming issue

Post by pd5gl »

When I use the USBAS I get these errors

USBASP with m328p

Code: Select all

c:\Program Files (x86)\AVRDUDESS>avrdude -u -c usbasp -p m328p -P usb:bus-0:\\.\libusb0-0001--0x1781-0x0c9f -b 19200 -e -U flash:w:"C:\Program Files (x86)\AVRDUDESS\truSDX-initial_Bootloader.hex":a -U lfuse:w:0xFF:m -U hfuse:w:0xD6:m -U efuse:w:0xFD:m

avrdude: set SCK frequency to 1500000 Hz
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: error: program enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.
USBASP with m328 and -F

Code: Select all

c:\Program Files (x86)\AVRDUDESS>avrdude -c usbasp -p m328 -P usb:bus-0:\\.\libusb0-0001--0x1781-0x0c9f -b 19200 -e -U flash:w:"C:\Program Files (x86)\AVRDUDESS\truSDX-initial_Bootloader.hex":a -U lfuse:w:0xFF:m -U hfuse:w:0xD6:m -U efuse:w:0xFD:m -F

avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: error: program enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x6c6f63
avrdude: Expected signature for ATmega328 is 1E 95 14
[code]
Last edited by pd5gl on 07 Apr 2022, 09:00, edited 1 time in total.
hari
 

Posts: 17
Joined: 14 Feb 2022, 09:25

Re: Bootloader uSDX programming issue

Post by hari »

It seems you're using "-p m328p" for ISP bootloader flashing, which is likely incorrect. You'd either want '-p ATmega328PB' or '-p ATmega328P', depending on the MCU on your board.

This worked for me (on Linux):

Code: Select all

./bin/avrdude -C etc/avrdude.conf -c usbasp -p ATmega328PB -B5 -U efuse:w:0xfd:m -U hfuse:w:0xd6:m -U lfuse:w:0xff:m  -U flash:w:/home/hari/Downloads/truSDX-initial_Bootloader.hex 
pd5gl
 

Posts: 6
Joined: 06 Apr 2022, 19:51

Re: Bootloader uSDX programming issue

Post by pd5gl »

Tried all of them.
USBAS.jpg
USBAS.jpg (208.33 KiB) Viewed 2199 times
hari
 

Posts: 17
Joined: 14 Feb 2022, 09:25

Re: Bootloader uSDX programming issue

Post by hari »

I'd recommend a structured approach:
1) identify what exact MCU you're using, and use only that for the -p switch (likely either 'ATmega328PB' or 'ATmega328P')
2) decide on a specific programmer, and then use the matching settings (e.g. '-c usbasp' for the USB ASP. Ensure that the -P settings are correct. The bitclock setting (-B6) from my example did work for me. The usbasp doesn't need a baudrate setting)
3) ensure that you got the pins right on the ISP connector
4) ensure that he MCU is powered (e.g. by using the right jumper setting on the USB ASP, or by applying 5V via USB)
Faraaz VK4JJ
 

Posts: 215
Joined: 30 Dec 2021, 21:56

Re: Bootloader uSDX programming issue

Post by Faraaz VK4JJ »

And never use the -F flag. It is a complete waste of time.
pd5gl
 

Posts: 6
Joined: 06 Apr 2022, 19:51

Re: Bootloader uSDX programming issue

Post by pd5gl »

ok, structured approach.

1. using the USBASP. The chip is ATmega8A. The only option is m8 in the software.
2. USBASP jumper on 5v. Measured the uSDX voltages and is 5V.
3. Measured al the SCK, MISO, MOSI, RESET, GND with Ohm meter and are all connected.
board.jpg
board.jpg (232.39 KiB) Viewed 2181 times
4. installed the right driver for the USBASP
Zadig.JPG
Zadig.JPG (21.51 KiB) Viewed 2180 times
5. Used the AVRDUDDES software with this result.
AVRdudes m8.JPG
AVRdudes m8.JPG (88.74 KiB) Viewed 2181 times
Same result when i change the MCU to ATMega328, ATMega328P or ATMega328PB. Only difference is that the red line will be blue when the MCU is ATMega328.
hari
 

Posts: 17
Joined: 14 Feb 2022, 09:25

Re: Bootloader uSDX programming issue

Post by hari »

You should check the MCU used on the (tr)uSDX board, not on the usbasp programmer, it's either ATMega328P or ATMega328PB. Set this to what's printed on the MCU on your (tr)uSDX.
Try a slower Bit clock (I had success with -B6, equals to 187500 Hz). Some USBASP clones have issues with high speed.
pd5gl
 

Posts: 6
Joined: 06 Apr 2022, 19:51

Re: Bootloader uSDX programming issue

Post by pd5gl »

Nope, still not working.
board.jpg
board.jpg (240.99 KiB) Viewed 2167 times
AVDDUDDESS.JPG
AVDDUDDESS.JPG (88.81 KiB) Viewed 2167 times

Code: Select all

c:\Program Files (x86)\AVRDUDESS>avrdude -c usbasp -p m328p -P usb:bus-0:\\.\libusb0-0001--0x1781-0x0c9f -b 19200 -B 6 -e -U flash:w:"C:\Program Files (x86)\AVRDUDESS\truSDX-initial_Bootloader.hex":a -U lfuse:w:0xFF:m -U hfuse:w:0xD6:m -U efuse:w:0xFD:m

avrdude: set SCK frequency to 93750 Hz
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: error: program enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

Code: Select all

c:\Program Files (x86)\AVRDUDESS>avrdude -c usbasp -p m328p -P usb -b 19200 -B 6 -e -U flash:w:"C:\Program Files (x86)\AVRDUDESS\truSDX-initial_Bootloader.hex":a -U lfuse:w:0xFF:m -U hfuse:w:0xD6:m -U efuse:w:0xFD:m

avrdude: set SCK frequency to 93750 Hz
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: error: program enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.
hari
 

Posts: 17
Joined: 14 Feb 2022, 09:25

Re: Bootloader uSDX programming issue

Post by hari »

I'd attempt to set jumper JP3 on the USBASP, this should be slow sck, and retry.
Do you have any other (known to be good) target to test the USBASP with? Some arduino board with ISP?
pd5gl
 

Posts: 6
Joined: 06 Apr 2022, 19:51

Re: Bootloader uSDX programming issue

Post by pd5gl »

Used the USBASP to program the arduino board. That goes fine. I think it's a dead pcb board but thats out of my skils.
AzBoard.JPG
AzBoard.JPG (48.52 KiB) Viewed 2155 times

Code: Select all

>>>: avrdude 
truSDX-initial_Bootloader.hex: 32,366 / 32,768 Bytes (98.77%)
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
>>>: avrdude -u -c usbasp -p m328p -P usb -b 19200 -B 4.0 -e -U flash:w:"C:\Program Files (x86)\AVRDUDESS\truSDX-initial_Bootloader.hex":a -U lfuse:w:0xFF:m -U hfuse:w:0xD6:m -U efuse:w:0xFD:m 

avrdude.exe: set SCK frequency to 187500 Hz
avrdude.exe: warning: cannot set sck period. please check for usbasp firmware update.
avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude.exe: Device signature = 0x1e950f (probably m328p)
avrdude.exe: erasing chip
avrdude.exe: set SCK frequency to 187500 Hz
avrdude.exe: warning: cannot set sck period. please check for usbasp firmware update.
avrdude.exe: reading input file "C:\Program Files (x86)\AVRDUDESS\truSDX-initial_Bootloader.hex"
avrdude.exe: input file C:\Program Files (x86)\AVRDUDESS\truSDX-initial_Bootloader.hex auto detected as Intel Hex
avrdude.exe: writing flash (32768 bytes):


Writing | ################################################## | 100% 18.63s

avrdude.exe: 32768 bytes of flash written
avrdude.exe: verifying flash memory against C:\Program Files (x86)\AVRDUDESS\truSDX-initial_Bootloader.hex:
avrdude.exe: load data flash data from input file C:\Program Files (x86)\AVRDUDESS\truSDX-initial_Bootloader.hex:
avrdude.exe: input file C:\Program Files (x86)\AVRDUDESS\truSDX-initial_Bootloader.hex auto detected as Intel Hex
avrdude.exe: input file C:\Program Files (x86)\AVRDUDESS\truSDX-initial_Bootloader.hex contains 32768 bytes
avrdude.exe: reading on-chip flash data:

Reading | ################################################## | 100% 16.25s

avrdude.exe: verifying ...
avrdude.exe: 32768 bytes of flash verified
avrdude.exe: reading input file "0xFF"
avrdude.exe: writing lfuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude.exe: 1 bytes of lfuse written
avrdude.exe: verifying lfuse memory against 0xFF:
avrdude.exe: load data lfuse data from input file 0xFF:
avrdude.exe: input file 0xFF contains 1 bytes
avrdude.exe: reading on-chip lfuse data:

Reading | ################################################## | 100% 0.00s

avrdude.exe: verifying ...
avrdude.exe: 1 bytes of lfuse verified
avrdude.exe: reading input file "0xD6"
avrdude.exe: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.02s

avrdude.exe: 1 bytes of hfuse written
avrdude.exe: verifying hfuse memory against 0xD6:
avrdude.exe: load data hfuse data from input file 0xD6:
avrdude.exe: input file 0xD6 contains 1 bytes
avrdude.exe: reading on-chip hfuse data:

Reading | ################################################## | 100% 0.00s

avrdude.exe: verifying ...
avrdude.exe: 1 bytes of hfuse verified
avrdude.exe: reading input file "0xFD"
avrdude.exe: writing efuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude.exe: 1 bytes of efuse written
avrdude.exe: verifying efuse memory against 0xFD:
avrdude.exe: load data efuse data from input file 0xFD:
avrdude.exe: input file 0xFD contains 1 bytes
avrdude.exe: reading on-chip efuse data:

Reading | ################################################## | 100% 0.00s

avrdude.exe: verifying ...
avrdude.exe: 1 bytes of efuse verified

avrdude.exe done.  Thank you.

Last edited by pd5gl on 08 Apr 2022, 06:06, edited 1 time in total.
Faraaz VK4JJ
 

Posts: 215
Joined: 30 Dec 2021, 21:56

Re: Bootloader uSDX programming issue

Post by Faraaz VK4JJ »

Select usbasp clone instead of 'USBAsp' in programmer menu.
Faraaz VK4JJ
 

Posts: 215
Joined: 30 Dec 2021, 21:56

Re: Bootloader uSDX programming issue

Post by Faraaz VK4JJ »

pd5gl wrote: 07 Apr 2022, 15:45 Used the USBASP to program the arduino board. Thats goes fine. I think it's a dead pcb board but thats out of my skils.

AzBoard.JPG

Code: Select all

>>>: avrdude 
truSDX-initial_Bootloader.hex: 32,366 / 32,768 Bytes (98.77%)
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
>>>: avrdude -u -c usbasp -p m328p -P usb -b 19200 -B 4.0 -e -U flash:w:"C:\Program Files (x86)\AVRDUDESS\truSDX-initial_Bootloader.hex":a -U lfuse:w:0xFF:m -U hfuse:w:0xD6:m -U efuse:w:0xFD:m 

avrdude.exe: set SCK frequency to 187500 Hz
avrdude.exe: warning: cannot set sck period. please check for usbasp firmware update.
avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude.exe: Device signature = 0x1e950f (probably m328p)
avrdude.exe: erasing chip
avrdude.exe: set SCK frequency to 187500 Hz
avrdude.exe: warning: cannot set sck period. please check for usbasp firmware update.
avrdude.exe: reading input file "C:\Program Files (x86)\AVRDUDESS\truSDX-initial_Bootloader.hex"
avrdude.exe: input file C:\Program Files (x86)\AVRDUDESS\truSDX-initial_Bootloader.hex auto detected as Intel Hex
avrdude.exe: writing flash (32768 bytes):


Writing | ################################################## | 100% 18.63s

avrdude.exe: 32768 bytes of flash written
avrdude.exe: verifying flash memory against C:\Program Files (x86)\AVRDUDESS\truSDX-initial_Bootloader.hex:
avrdude.exe: load data flash data from input file C:\Program Files (x86)\AVRDUDESS\truSDX-initial_Bootloader.hex:
avrdude.exe: input file C:\Program Files (x86)\AVRDUDESS\truSDX-initial_Bootloader.hex auto detected as Intel Hex
avrdude.exe: input file C:\Program Files (x86)\AVRDUDESS\truSDX-initial_Bootloader.hex contains 32768 bytes
avrdude.exe: reading on-chip flash data:

Reading | ################################################## | 100% 16.25s

avrdude.exe: verifying ...
avrdude.exe: 32768 bytes of flash verified
avrdude.exe: reading input file "0xFF"
avrdude.exe: writing lfuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude.exe: 1 bytes of lfuse written
avrdude.exe: verifying lfuse memory against 0xFF:
avrdude.exe: load data lfuse data from input file 0xFF:
avrdude.exe: input file 0xFF contains 1 bytes
avrdude.exe: reading on-chip lfuse data:

Reading | ################################################## | 100% 0.00s

avrdude.exe: verifying ...
avrdude.exe: 1 bytes of lfuse verified
avrdude.exe: reading input file "0xD6"
avrdude.exe: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.02s

avrdude.exe: 1 bytes of hfuse written
avrdude.exe: verifying hfuse memory against 0xD6:
avrdude.exe: load data hfuse data from input file 0xD6:
avrdude.exe: input file 0xD6 contains 1 bytes
avrdude.exe: reading on-chip hfuse data:

Reading | ################################################## | 100% 0.00s

avrdude.exe: verifying ...
avrdude.exe: 1 bytes of hfuse verified
avrdude.exe: reading input file "0xFD"
avrdude.exe: writing efuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude.exe: 1 bytes of efuse written
avrdude.exe: verifying efuse memory against 0xFD:
avrdude.exe: load data efuse data from input file 0xFD:
avrdude.exe: input file 0xFD contains 1 bytes
avrdude.exe: reading on-chip efuse data:

Reading | ################################################## | 100% 0.00s

avrdude.exe: verifying ...
avrdude.exe: 1 bytes of efuse verified

avrdude.exe done.  Thank you.

OK, that's more interesting. It means your programming setup is fine if you can flash an arduino.

Under magnification, examine all the pins of the Atmega, wiggle them with a pair of tweezers. Look for loose, or lifted, pins.
Post Reply

Users browsing this forum: No registered users and 28 guests