Generation and burning of AVR ELF files

Publisher:brian808090Latest update time:2018-10-07 Source: eefocusKeywords:AVR Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Usually AVR chips include flash, eeprom, fuse, lockbits, user signature and other non-volatile contents that need to be burned into the chip during programming. Among them, the fuse part can only be rewritten by an external programmer, and the application itself cannot be changed.


During ISP burning, users want to complete the burning with a single action such as clicking a button, which requires combining the actions of erasing, burning, and comparing in different parts. ELF format can be used to achieve this goal. The target file in ELF format can contain different area segments, and the download tool can extract and burn them to the corresponding locations respectively.


1) Software development using Atmel Studio 6


If the developer uses Atmel Studio 6 (or AVR Studio 4/5, anyway, GCC is fine) to write the user's source code, avr glibc provides a set of methods to specify the values ​​of these different areas in the source code.


If you want the generated ELF file to contain a chip ID segment, you can use it to compare the ELF Production file before downloading it to see if it matches the download file of the current device. This step only requires adding the header file #include in the source code


  1. const unsigned char __signature[3] __attribute__((section (".signature"))) =  

  2.         { SIGNATURE_2, SIGNATURE_1, SIGNATURE_0 };  


2) Software development using IAR AVR


Since IAR extended syntax cannot support the definition of fuses, lockbits and other bits, IAR can only produce single FLASH content, usually in HEX format.


At this time, you need to use the ELF Production File Fomart function in AVR Studio 4: after selecting the HEX file location of flash and eeprom, go to the fuse and lockbits pages to check the corresponding configuration, then come back to set the ELF file path to be generated, and click Save to let AVR Studio 4 generate an ELF file format containing the contents of each segment. You can simply click the Program button or use the command line tool atprogram.exe to burn it.



Keywords:AVR Reference address:Generation and burning of AVR ELF files

Previous article:ATmega16 Timer 1 Time Setting
Next article:AVR usage example - using Bootloader to upgrade the program in the chip

Recommended ReadingLatest update time:2024-11-23 07:52

Application of AVR MCU ADC
Application of AVR MCU ADC 1. Basic knowledge of digital-to-analog conversion The digital-to-analog converter (ADC) is basically a matter of ratios, that is, the digital value produced by the ADC is related to the ratio of the input analog value to the converter range. The conversion relationship is as follows:
[Microcontroller]
Application of AVR MCU ADC
Using high-speed AVR microcontroller to realize vibration/temperature signal acquisition and storage
Lead-acid batteries have the advantages of low price, reliable power supply, and stable voltage. They are widely used in communications, railways, transportation, electricity, petroleum, national defense, and industrial and agricultural production departments. In traditional charging technology, commonly used consta
[Microcontroller]
Using high-speed AVR microcontroller to realize vibration/temperature signal acquisition and storage
[AVR ASF4 library function study notes] 2. GPIO
Platform: Microchip Studio (formerly Atmel Studio 7) Xinshiji DMAVR-L Atmega 128A - AU The header file is port.h Enumeration Types enum port_pull_mode { PORT_PULL_OFF, PORT_PULL_UP, }; enum port_dir { PORT_DIR_IN, PORT_DIR_OUT, PORT_DIR_OFF, }; function X = ABCDEFG static inline bool PORTX_get_pin_
[Microcontroller]
Summary of UART communication of AVR microcontroller ATMega16
#include #include macros.h typedef unsigned char uint8_t; #define DF_Config_Uart0_BaudRate 9600 //UART0 initialization // desired baud rate: 9600 // actual: baud rate:9600 (0.0%) void uart0_init(void) {  UCSRB = 0x00; //disable while setting baud rate  UCSRA = 0x00;  UCSRC = BIT(URSEL) | 0x06;  //Conf
[Microcontroller]
Interpretation of the Reset program example based on AVR watchdog
The AVR watchdog is a hardware unit that resets the program when it runs away for some reason, just like a puppy guarding the door. //Watchdog ini TI alize // prescale: 2048K void watchdog_init(void) { WDR(); //this prevents a  TI mout on enabling WDTCR = 0x0F; //WATCHDOG ENABLED - don't forget to issue WDRs } The
[Microcontroller]
Interpretation of the Reset program example based on AVR watchdog
Design of multifunctional power supply based on single chip microcomputer AVR Butterfly
0 Introduction With the development of embedded system design technology, system engineers have higher and higher requirements for power supply in design and simulation. When embedded system design uses 8031 ​​microcontrollers and 74 series integrated circuits, all circuit boards using 74 series integrated
[Microcontroller]
Part of the MODBUS program for AVR
M64, 14.7456M crystal oscillator  timer interrupt time is 1s, if the sending interval is greater than T1.5 but less than T3.5, the data will be discarded  SIGNAL (SIG_UART0_RECV)  {          Com0_Receive_Data_Buffer =UDR0;          if (Com0_Receive_Cout 18) Com0_Receive_Cout++;      Uart_Fin = 5;          Rcvfl
[Microcontroller]
Design of Lithium Battery Pack Balancing Circuit Based on LTC6802
Power battery packs are widely used in electric bicycles and hybrid vehicles. It is very common for the overall performance and life of the battery pack to decline during use due to the difference in the performance of the single cells. The energy utilization rate and service life of the battery pack can be improved th
[Automotive Electronics]
Design of Lithium Battery Pack Balancing Circuit Based on LTC6802
Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号