VR ELF file generation and burning

Publisher:茶叶侠Latest update time:2018-09-20 Source: eefocus 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 to generate an ELF file that contains 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 to the source code and recompiling. This header file will define a constant array and place it in the .signature segment of the ELF. (If the .user_signature segment is added, it seems that the compiler will automatically add the .signature segment to the ELF file TBD)


[cpp]  view plain copy

  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.


Reference address:VR ELF file generation and burning

Previous article:AVR counter - how to calculate the initial value of the count
Next article:STM32F407 GPIO (operation register)

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号