This repository contains an Atmel Solution with two projects - a basic bootloader compatible with AVR-DA family and a host application - and the flashing environment (Python™ scripts) used to upload the application image into the microcontroller's memory, as described in AN3341 - Basic Bootloader for the AVR MCU DA (AVR DA) Family Application Note from Microchip.
More details and code examples on the AVR128DA48 can be found at the following links:
- AN3341 - Basic Bootloader for the AVR MCU DA (AVR DA) Family
- AVR128DA48 Product Page
- AVR128DA48 Code Examples on GitHub
- AVR128DA48 Project Examples in START
- Atmel Studio 7.0.2397 or newer (microchip.com/mplab/avr-support/atmel-studio-7)
- AVR-Dx 1.0.18 or newer Device Pack
- Python™ 3.7.0 or newer (python.org)
- AVR128DA48 Curiosity Nano (DM164151)
The AVR128DA48 Curiosity Nano Development Board is used as test platform.
In order to upload the application image follow this steps:
-
Connect the board to the PC.
-
Check the COM port the AVR128DA48 Curiosity Nano was connected to by opening Device Manager in Windows:
-
Open the Bootloader.atsln solution in Atmel Studio
-
Build the Bootloader solution: right click on Bootloader solution and select Build
-
Select the AVR128DA48 Curiosity Nano on-board debugger in the Tool section of the AVR-Dx_Bootloader project settings:
- Right click on the project and click Properties;
- Click Tool tab on the left panel, select the corresponding debugger and save the configuration (Ctrl + S)
-
Program AVR-Dx_Bootloader project to the board: select AVR-Dx_Bootloader project and click Start Without Debugging:
-
Browse to scripts folder and open for editing SerialUpload.bat file. The python command has the following format:
python AVR-DA_uploader.py {path_to_hex_file} {flash_max_size} {COM_port} {baud_rate}
The parameters are:
{path_to_hex_file}
- path to the executable file to be flashed, including its path{flash_max_size}
- maximum size of the flash in hexadecimal value{COM_port}
- the COM port where the AVR128DA48 Curiosity Nano is attached to{baud_rate}
- the baud rate of the serial communication
Note: For the current implementation, the baud rate for serial communication is configured in code as 9600.
-
Replace {path_to_hex_file}, {flash_max_size}, {COM_port}, {baud_rate} fields with their actual values and save the file.
-
Press SW0 button to make the Bootloader enter in "application flashing mode".
-
Run SerialUpload.bat
This AN3341 - Basic Bootloader for the AVR MCU DA (AVR-DA) Family application note describes how the AVR® MCU DA (AVR-DA) family of microcontrollers (MCUs) can use self-programming. This enables the user to download application code into Flash without the need for an external programmer.