How to generate a new bootloader for atmega 4809?

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0



 

how do I generate a bootloader for the new atmega 4809?

 

I already made some attempts following the steps of optboot_x, however I had no results and presented some errors:

 

make (e=2): The system cannot find the file specified.

make: *** [bootloaders/mega0/115200/Optiboot_mega0_UART__115200_.elf] Error 2

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Welcome to AVRFreaks!

 

I'm not sure but I don't think the arduino 4809's have a bootloader, instead the usb interface chip programs the 09, IIRC.

But others may know more....

 

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
  1. The Arduino ATmega4809 boards (Uno WiFi 2, Nano Every) do not use a bootloader.  There is actual UPDI programming code in the USB/Serial chip.
  2. "omake" in the optiboot distribution has not worked in a very long time, since Arduino started using an avr-gcc distribution that doesn't include "make"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:

Welcome to AVRFreaks!

 

Jim

 

 

Thank you for the welcome

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

westfw wrote:

  1. The Arduino ATmega4809 boards (Uno WiFi 2, Nano Every) do not use a bootloader.  There is actual UPDI programming code in the USB/Serial chip

 

I am using the 4809 pure. no Uno WiFi 2, Nano Every. 

 

westfw wrote:

  1. "omake" in the optiboot distribution has not worked in a very long time, since Arduino started using an avr-gcc distribution that doesn't include "make"

 

Yes. however I used the "make" of atmelstuio 7 trying to generate a new hex for the boot and presented these errors to me.

 

 

 

 

 

sorry for those questions. I am new to the atmel platform, in fact this is my first project with him. and i would like to create a bootloader for 4809 and i'm a little lost. I'm following the documentation. but I did not understand how do I generate a bootloader hex.

http://ww1.microchip.com/downloa...

thank you.

 

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Are you even sure that the 4809 can be programmed by using a bootloader?   Could you cite the section number in the data sheet (for the 4809) that refers to programming the flash using data that has been received by the USART?  What's your level of software development experience?   Are you "just sort of" learning Arduino, or do you keep a pen and paper by your bed table so that you can write down all the AVR assembly language code that comes to you in your dreams at night?

 

  Why do you want a bootloader?  Are you planning to make a manufacturing run of 100,000 units and want to be able to be able to have your customers reprogram the device as the hidden errors in the firmware become apparent?  Do you have one 4809 demo board on your workbench and you think that making a bootloader for it would be a cool way to learn how to make bootloaders?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Another utter BS answer there then?

 

Almost every AVR ever made has support for running the SPM opcode so they all have the potential to do bootloading. The 4809 is no different in this respect than almost all preceding AVRs. Of course the Tiny chips and low flash megas sometimes made things trickier by not having a separate BLS, BOOTSZ and BOOTRST but beyond that most AVRs have the facility.

 

Of course there is also a "chicken/egg dilema" as most AVRs arrive "empty" so if you want to use a bootloader you have to use ISP/UPDI/PDI/JTAG just once to get the bootloader in to get started. But even then some AVRs are available with an option to have a bootloader already loaded - like Xmegas and some AT90USB which can some with "DFU" pre-loaded.

 

I don't think there's an option for a preloaded bootloader in 4809 but it's not really any different in that respect to mega16, mega328, mega2560 or pretty much every other mega AVR

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Simonetta wrote:

Are you even sure that the 4809 can be programmed by using a bootloader?  

Yes. optboot_x does that. and page 7 of the datasheet (http://ww1.microchip.com/downloa...) illustrates this.

 

Simonetta wrote:

 What's your level of software development experience? 

I have a few years of experience in shipping. however it is the first time in the atmel line

 

Simonetta wrote:

  Why do you want a bootloader?  Are you planning to make a manufacturing run of 100,000 units and want to be able to be able to have your customers reprogram the device as the hidden errors in the firmware become apparent?  Do you have one 4809 demo board on your workbench and you think that making a bootloader for it would be a cool way to learn how to make bootloaders?

yes i created a PCB for the 4809 to test it. i need a boot loader to make future updates via rs482 and not rs232.

 

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Simonetta wrote:
Could you cite the section number in the data sheet (for the 4809) that refers to programming the flash using data that has been received by the USART? 
BTW:  http://ww1.microchip.com/downloads/en/AppNotes/AN2634%20Microchip%20Bootloader%20for%20tinyAVR_megaAVR%2000002634.pdf

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

Simonetta wrote:
Could you cite the section number in the data sheet (for the 4809) that refers to programming the flash using data that has been received by the USART? 
BTW:  http://ww1.microchip.com/downloads/en/AppNotes/AN2634%20Microchip%20Bootloader%20for%20tinyAVR_megaAVR%2000002634.pdf

And it comes with code for uart and I2C too!

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The problem of these new parts, is that the memory area reserved for the bootloader is the bottom of memory, instead of the top like classical AVRs.

So you have to compile different binaries for a MCU with bootloader than those for an MCU without bootloader, which basically sucks compared to classic AVRs.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I used the "make" of atmelstuio 7 trying to generate a new hex for the boot and presented these errors to me.

Don't use "omake", then.  The loss of "make" in the Arduino binary directories is one problem, but omake.bat hasn't been updated at all since then, so I don't doubt that other things are wrong.  It certainly wasn't updated to support the mega0 cpus.

 

If you're using the AS7 compiler, You'll need to set up a PACKS environment variable as well.  And there isn't any "default" mega0 set of parameters - you have to specify a minimal set.  (although there are some board-level targets pre-defined.)

Starting from an "AS7 Command Prompt" window, and a fresh download from http://github.com/optiboot/optiboot, the basics look like:

 

cd C:\Users\billw\src\Optiboot\optiboot\bootloaders\optiboot

set PACKS="C:\Program Files (x86)\Atmel\Studio\7.0\packs\atmel\ATmega_DFP\1.4.351"

make -f Makefile.mega0 atmega4809 LED=D6 UARTTX=A0

make -f Makefile.mega0 curiosity4809

 

See the makeall.mega0.sh script for some more examples.

 

 

you have to compile different binaries for a MCU with bootloader than those for an MCU without bootloader, which basically sucks

Yeah :-(
Compatible with most ARM chips, though!

Last Edited: Fri. May 15, 2020 - 10:48 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Since this post is in the Arduino section...

There are pre-built Optiboot hex files for the Mega-0 series parts on github as part of the Arduino MegaCoreX distribution.

https://github.com/MCUdude/MegaCoreX/tree/master/megaavr/bootloaders/optiboot/bootloaders/mega0/115200