Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DXcore bootloader burn and updi uploading #42

Open
matou78 opened this issue Mar 21, 2022 · 5 comments
Open

DXcore bootloader burn and updi uploading #42

matou78 opened this issue Mar 21, 2022 · 5 comments

Comments

@matou78
Copy link

matou78 commented Mar 21, 2022

Hello everyone,

I'm trying to get the program upload through updi and bootloader burn to work
Using DXCore with arduinoIDE works as intended .

I did a small program to tests things that make a led blink and send "test ok" through UART
Uploading this program through UPDI does nothing, the chip does nothing .
Compiles correctly and uploads successfully too , but nothing happens .

here is my platformio.ini

[env]
platform = atmelmegaavr
board = AVR64DA32
framework = arduino
board_build.f_cpu = 24000000L

[env:Upload_using_pyupdi]
upload_protocol = custom
upload_speed = 230340
upload_port = COM4
upload_flags =
  -t
  uart
  -d
  $BOARD_MCU
  -u
  $UPLOAD_PORT
  -c
  $UPLOAD_SPEED
upload_command = pymcuprog write $UPLOAD_FLAGS -f $SOURCE

Tried to change few things that i found on google but i don't know much about this things, still learning .

I wanted to burn the bootloader too, hitting the option " Burn Bootloader " but all i get is "Error: missing bootloader configuration!"

I'm looking inside the bootloader.py file that maxgerhardt linked on forum
image
But as i don't understand much there , not sure what needs to be done, will try to play with it a little, maybe by miracle i can get it working lol as i did with the UART upload i my other post x)

Thanks for your time and have a nice day

@matou78
Copy link
Author

matou78 commented May 11, 2022

pyupdi no more needed as with avrdude 7.x , serialupdi is included so no more need for the whole custom upload protocol
simple upload_protocol = serialupdi is usable .

But the same problem persist on the AVRxxDx chips , the program not working . I continue in my free time to look around and try to find something to get it working.

@matou78
Copy link
Author

matou78 commented May 12, 2022

hello again :)
Well , got working the updi upload as it should :D

I made my arduino AVRxxDx pcbs and updated avrdude to 7.x so it was way easier to test things .

So when uploading with ArduinoIDE going from bootloader (serial) to no bootloader (updi) or other way, every time the thing worked.

Then as i love platformIO and don't want to go back to arduinoIDE, i tried to upload with updi my little program to test the new chips but didn't work . Like the chip looked dead .
I will let you to see what i had to do to get it working for UART upload #41 (comment)

And there we are today, updi upload but with platformIO .
I had 2 Situations to test ,

  • First is when uploading to a empty chip ( new never used)
  • Second when uploading to a chip with a bootloader already present but not needed

Already tried to set the fuses before with the "set fuses" option but didn't work, no idea why
Today i hit the "upload" button then hit the "set fuses" button and everything worked, in both situations listed above

Maybe it has to do something with the avrdude update ?
Do someone know how to add the option --target fuses to platformio.ini ?

Here is my platformio.ini used in my latest tests for updi upload

[env]
platform = atmelmegaavr
board = AVR64DA32
framework = arduino
board_build.f_cpu = 24000000L

[env:serial_updi]
upload_protocol = serialupdi
upload_flags =  -e 
                -v

It leaves me to get the Bootloader Burn to get working

@samisabik
Copy link

I have got a similar behavior, but for me it seems to be OS dependent. With the exact same code source and setup on PIO, I have successfully compiled and flash on both Linux and Windows. However on Linux (Arch) the UPDI process seems to leave my 3208AVR blank after a seemingly successful upload, on windows my program get loaded correctly and runs fine. Not sure if this is related, and I have not yet found a solution to this issue.

@samisabik
Copy link

Linux verbose :
avrdude: max packet size expected 912, but found 512 due to EP 0x01's wMaxPacketSize

This is the only difference I could spot when comparing the verbose between the two machines.

@matou78
Copy link
Author

matou78 commented Oct 28, 2022

there is few things wrong with the merge of DxCore and PIO but overall , going with the avrdude 7.x version + setting the fuses at least once when using a new chip or when going from bootloader to no-bootloader everything is working

i don't use linux so can't test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants