Bootloader misery

Post Reply
mm0gyx
 

Posts: 83
Joined: 30 Dec 2021, 20:22

Bootloader misery

Post by mm0gyx »

I got the bootloaders on all 50 boards, or so I thought. It went fine, AVRDUDESS reported it was on ok, so the next step I held an OLED against the pin header to read the serial number. I got all of them down except one, that one for some reason had the firmware on it. This is obviously my error, as I had loaded the firmware on a few boards too, using the serial number etc. In this case though, I did not intend to, and need the serial number, I guess.

So, I was stuck without a serial number, I tried to reinstall the bootloader thinking it would clear the flash and write the bootloader, hey presto, serial number. No, nothing, when I hook up the OLED I see nothing. I have usb connected for power, just like all the others. Then I did something silly, I got one of the boards I know has the bootloader on and overwrote it, it showed the same symptoms.

By the way, the first time the BL goes on it takes a while, when I try overwriting it takes a second, presumably it just sees the BL is there and does nothing? I know very little about software, so need help. How do I clear the 328 and start from scratch on these two?

Ian MM0GYX
VK4ARZ
 

Posts: 5
Joined: 31 Dec 2021, 04:09

Re: Bootloader misery

Post by VK4ARZ »

I believe I read that you use ICSP for the bootloader then USB for programming.
Hope I've got it right.

Roger
mm0gyx
 

Posts: 83
Joined: 30 Dec 2021, 20:22

Re: Bootloader misery

Post by mm0gyx »

VK4ARZ wrote: 13 Jan 2022, 05:57 I believe I read that you use ICSP for the bootloader then USB for programming.
Hope I've got it right.

Roger
Yeah, that’s correct, I’ve probably done a bad job of explaining myself. It was late and I was tired. I Have no idea how I ended up with firmware on instead of bootloader, but I did. Presumably I flashed it through the ICSP by mistake, probably left my FW file in the avedudess software.

Basically, for whatever reason I’ve tried putting bootloader on twice and it doesn’t seem to like it, now there is no serial number. How do I get the 328 back to its original state in order to load the bootloader and get the serial number?

Ian MM0GYX
VK4ARZ
 

Posts: 5
Joined: 31 Dec 2021, 04:09

Re: Bootloader misery

Post by VK4ARZ »

The 1st question is : Is the chip in DFU mode?
Check for the DFU ID in device manager (or R U using Linux?)
You may have to go back to the start and erase what you've done.
It would be worth checking what the configuration registers have and what's required.
I'm not sure what Manuel has happening if the unit isn't activated but it may be a loop so as
to appear that nothings happening. I haven't been through the process yet, just trying to help.

Cheers
Roger
dc8lz
 

Posts: 41
Joined: 31 Dec 2021, 01:35

Re: Bootloader misery

Post by dc8lz »

New informations about the fuse settings:

Check update on web page! hfuse 0xd6 is preferred!

So for example my cmd line (on linux):

Code: Select all

avrdude  -c usbasp  -b 19200   -p m328p -U flash:w:truSDX-initial_Bootloader.hex -U lfuse:w:0xff:m -U hfuse:w:0xd6:m -U efuse:w:0xfd:m
It would be very interesting how it looks like with this on your side!

Best 73 (and thanks Guido!)
mm0gyx
 

Posts: 83
Joined: 30 Dec 2021, 20:22

Re: Bootloader misery

Post by mm0gyx »

dc8lz wrote: 13 Jan 2022, 17:12 New informations about the fuse settings:

Check update on web page! hfuse 0xd6 is preferred!

So for example my cmd line (on linux):

Code: Select all

avrdude  -c usbasp  -b 19200   -p m328p -U flash:w:truSDX-initial_Bootloader.hex -U lfuse:w:0xff:m -U hfuse:w:0xd6:m -U efuse:w:0xfd:m
It would be very interesting how it looks like with this on your side!

Best 73 (and thanks Guido!)
Thanks for this info, I just tried these alternate fuse settings, no luck. When I run AVRDUDESS the MCU is recognised, Detected 1e950f = ATmega328P. So, I try to install bootloader with recommended settings and the page flashes through process very quickly, a second or so. At the end of this I look to the OLED and there's nothing.

If I then go to the micro usb and try detection with AVRDUDESS, there is no detection, so bootloader either isn't really there, or is corrupt, yet it keeps telling me it's done. I'm lost, maybe I bricked these two by reloading an already loaded bootloader, is it possible?

73,

Ian MM0GYX
dc8lz
 

Posts: 41
Joined: 31 Dec 2021, 01:35

Re: Bootloader misery

Post by dc8lz »

Hi Ian,

no... I did so many different things with flashing the 328p the last days... It never died by that.

As long as you can write over ISP everything is fine.

One thing I have tested today was the uSDX software. Worked on an truSDX (just tested the display). Would you like to test this?

May I could help..?

73, Stephan
mm0gyx
 

Posts: 83
Joined: 30 Dec 2021, 20:22

Re: Bootloader misery

Post by mm0gyx »

dc8lz wrote: 13 Jan 2022, 21:15 Hi Ian,

no... I did so many different things with flashing the 328p the last days... It never died by that.

As long as you can write over ISP everything is fine.

One thing I have tested today was the uSDX software. Worked on an truSDX (just tested the display). Would you like to test this?

May I could help..?

73, Stephan
I'd like to try it Stephan. There must be something basic I am missing. I guess this would show that the MCU flash is okay? Or isn't, then I need to get the heat gun out.

73,

Ian MM0GYX
mm0gyx
 

Posts: 83
Joined: 30 Dec 2021, 20:22

Re: Bootloader misery

Post by mm0gyx »

I have one board working now, I don't really know why, but I decided to try pressing "GO" in the Flash area, instead of using "program". I then tried using program a second time and all was well, it took the usual longer time to load, and I have the serial number.

The other board though, it's weird, when I load the bootloader, then look on the display, the firmware is there. Frequency readout etc. Hmmm, it might be time to celebrate the one board success and leave the other to tomorrow.

73,

Ian MM0GYX
dc8lz
 

Posts: 41
Joined: 31 Dec 2021, 01:35

Re: Bootloader misery

Post by dc8lz »

... Have winavr on the laptop, too. But it I flash I carry the truSDX to my old Linux server with a more recent avrdude version. :D

Don't know about buttons there... Just use my one line command. (:

But strange... Sad... Hopefully it works next time!
DL2MAN
 

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

Re: Bootloader misery

Post by DL2MAN »

mm0gyx wrote: 13 Jan 2022, 20:45 I try to install bootloader with recommended settings and the page flashes through process very quickly, a second or so.
There´s your problem. It´s not programming. Programming via ISP takes forever...
OK, so in order to make progress, would you be able to provide a screenshot of your settings and after " fast successful upload" the content of your terminal window ?

73 Manuel; DL2MAN
mm0gyx
 

Posts: 83
Joined: 30 Dec 2021, 20:22

Re: Bootloader misery

Post by mm0gyx »

DL2MAN wrote: 14 Jan 2022, 00:36
mm0gyx wrote: 13 Jan 2022, 20:45 I try to install bootloader with recommended settings and the page flashes through process very quickly, a second or so.
There´s your problem. It´s not programming. Programming via ISP takes forever...
OK, so in order to make progress, would you be able to provide a screenshot of your settings and after " fast successful upload" the content of your terminal window ?

73 Manuel; DL2MAN
Thanks Manuel, actually that is clear to me, hence the frustration, but this morning I tried again. I reset the Uno by uploading blink sketch and reloading ISP. Then went through settings, fuses etc carefully and tried the 'program', output:

>>>: avrdude
truSDX-initial_Bootloader.hex: 32,366 / 32,768 Bytes (98.77%)
>>>: avrdude -u -c arduino -P COM17 -b 19200 -p m8
Detected 1e950f = ATmega328P
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
>>>: avrdude -u -c arduino -p m328p -P COM17 -b 19200 -e -U flash:w:"C:\trusdx\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.01s

avrdude.exe: Device signature = 0x1e950f (probably m328p)
avrdude.exe: erasing chip
avrdude.exe: reading input file "C:\trusdx\truSDX-initial_Bootloader.hex"
avrdude.exe: input file C:\trusdx\truSDX-initial_Bootloader.hex auto detected as Intel Hex
avrdude.exe: writing flash (32768 bytes):

Writing | ################################################## | 100% 34.82s

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

Reading | ################################################## | 100% 19.48s

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.01s

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.01s

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.01s

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.01s

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.01s

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.01s

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

avrdude.exe done. Thank you.

>>>: avrdude -u -c arduino -P COM6 -b 115200 -p m8
Detected 1e950f = ATmega328P
mm0gyx
 

Posts: 83
Joined: 30 Dec 2021, 20:22

Re: Bootloader misery

Post by mm0gyx »

So, to add to that, it appeared to program okay, it took a longer time, as did the other 48! However, when I place the OLED on, there is the full firmware ready to go! So, I think what happened some days ago I was loading firmware on my usdx, then I started to load 49 bootloaders for my group. I think the first one, this one, I missed that the file was for FW instead of BL, somehow it seems that FW is on there and doesn't come off.

I can see the serial number must end ## (I know the actual numbers, can see when FW boots briefly) and I know the first 12 numbers too, if I had the other missing 2 I'd be good to go I think, as I believe the BL is truly on there now, it's just when I hook it up the FW boots up, instead of BL serial number.

At no stage have I ever seen the BL serial number for this board, so I didn't get it down, this is my problem.

I hope this makes some sense.

Actually, I was thinking to try loading my callsign FW to see if it loads through BL.

73,

Ian MM0GYX
mm0gyx
 

Posts: 83
Joined: 30 Dec 2021, 20:22

Re: Bootloader misery

Post by mm0gyx »

Ok, it resolved. After I loaded BL apparently successfully, I see the FW on the OLED. Then I hooked it up to my PC and it was assigned Com6, I used that to upload a FW NOT for this serial number board (I don't know it yet). The FW apparently loaded correctly, but when I look on the OLED I see the desired serial number (weird behaviour, but I'm not complaining). I used the serial number and callsign to get FW and loaded it, sorted, lets go drink coffee!

Sorry for the long messages, I did think to delete parts above, but maybe someone could find it useful somehow??

73,

Ian MM0GYX
Faraaz VK4JJ
 

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

Re: Bootloader misery

Post by Faraaz VK4JJ »

Moved to troubleshooting forum - shadow topic left. Please continue discussions in the other forum.
Df5GF
 

Posts: 22
Joined: 31 Dec 2021, 10:01

Re: Bootloader misery

Post by Df5GF »

How can I see if the boot loader is on the device or not?

I assembled the device and installed the AVR-Dudess software and USB Driver for the CH340 chip.

USB Serial is not displayed / recognized in the device manager.
Df5GF
 

Posts: 22
Joined: 31 Dec 2021, 10:01

Re: Bootloader misery

Post by Df5GF »

I solved the problem with the exchange of the USB cable. Two cables did not work on the third cable it worked
andergrin
 

Posts: 7
Joined: 07 Feb 2022, 13:50

Re: Bootloader misery

Post by andergrin »

Can someone help me to figure out the solution to my problem? I have successfully flash bootloader and fuses, but nothing have to appear on the display (display has been modified according to instructions).
DL2MAN
 

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

Re: Bootloader misery

Post by DL2MAN »

Check for continuity between Transistor and C6... I had the same effect when the tiny wire was broken inside, and did not supply the voltage to C6....
If that doesn´t help, please post a pictrue of your OLED mod.
It should look somehow like the Pic attached.

73 Manuel; DL2MAN
Attachments
OLED.JPG
OLED.JPG (86.82 KiB) Viewed 4810 times
andergrin
 

Posts: 7
Joined: 07 Feb 2022, 13:50

Re: Bootloader misery

Post by andergrin »

photo_2022-02-07_17-36-36.jpg
photo_2022-02-07_17-36-36.jpg (194.23 KiB) Viewed 4806 times
andergrin
 

Posts: 7
Joined: 07 Feb 2022, 13:50

Re: Bootloader misery

Post by andergrin »

I have replaced ATmega, and flash bootloader. Display gives me serial number (18 characters, most of which are F and two numbers 7)
I generate Firmware, and after flash it, I got static snow on the screen.

PS: it seems, that I have some difficulties with USB port, because I managed to flash Beta firmware via ISP.
N1MID
 

Posts: 7
Joined: 31 Dec 2021, 13:28

Re: Bootloader misery

Post by N1MID »

Hi all. In the group buy that I am participating in, the Arduino chip does not have a bootloader.

Leveraging Manuel's site, I understand the procedure for my situation to be:
1) Convert my Arduino to an ISP using the ArduinoISP.ino.hex using the Arduino IDE
2) Download the (tr)uSDX bootloader and Avrdudess. Install Avrdudess on my PC
3) Hook up wires between the Arduino and the (tr)uSDX
4) Set up Averdudess, then upload the (tr)uSDX bootloader to the Arduino via Avrdudess
5) Power on the (tr)uSDX and retrieve the serial number
6) use the serial number to get my customized firmware? (why customized?)
7) Upload the customized firmware to the Arduinio via Avrdudess
8) Enjoy my new radio.

Does this sound right? Why the customized firmware?

Thank you.
-Joe
mm0gyx
 

Posts: 83
Joined: 30 Dec 2021, 20:22

Re: Bootloader misery

Post by mm0gyx »

N1MID wrote: 11 Feb 2022, 12:24 Hi all. In the group buy that I am participating in, the Arduino chip does not have a bootloader.

Leveraging Manuel's site, I understand the procedure for my situation to be:
1) Convert my Arduino to an ISP using the ArduinoISP.ino.hex using the Arduino IDE
2) Download the (tr)uSDX bootloader and Avrdudess. Install Avrdudess on my PC
3) Hook up wires between the Arduino and the (tr)uSDX
4) Set up Averdudess, then upload the (tr)uSDX bootloader to the Arduino via Avrdudess
5) Power on the (tr)uSDX and retrieve the serial number
6) use the serial number to get my customized firmware? (why customized?)
7) Upload the customized firmware to the Arduinio via Avrdudess
8) Enjoy my new radio.

Does this sound right? Why the customized firmware?

Thank you.
-Joe
Ask your group buy organiser if they would load all the bootloaders, it's pretty straightforward. Once you get the cable set up and the software set you can rattle through 50 in no time.

Good luck,

Ian MM0GYX
Faraaz VK4JJ
 

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

Re: Bootloader misery

Post by Faraaz VK4JJ »

I'd suggest buying a usbasp for small change and doing it that way.
Poptarts_McGee
 

Posts: 2
Joined: 27 Jan 2022, 00:40

Re: Bootloader misery

Post by Poptarts_McGee »

Do both boards need to be assembled and sandwiched before the bootloader will use the OLED screen?

I have the MainBoard mostly assembled (except LT6231, speaker/mic, and switches) and the atmega328p seemed to accept the bootloader/fuses without issues. However, when I apply power, I'm not getting anything on the screen.

Tapping into the I2C lines, I can see the mcu "initializing" the si5351, as well as the encoder pins being pulled up and the gate of Q1 going high. I know the bootloader/firmware is different than that of the uSDX, but if the setup() is similar, I'm expecting the OLED be initialized next.

In my case, I am not seeing any activity on the OLED's dedicated I2C lines (PD2 and PD3). The board just appears to be looping through its setup every few seconds. Is there a certain signal/condition the bootloader is looking for before initializing the screen? And would this signal require the RF board to be attached/populated?

I would prefer to validate my MainBoards first before I begin on the RF boards, but if it's required then I don't mind, I would just like to know if my boards already have an issue.
Post Reply

Users browsing this forum: No registered users and 0 guests