DavidGriffith / minipro-import-test

An open source program for controlling the MiniPRO TL866xx series of chip programmers
GNU General Public License v3.0
3 stars 0 forks source link

Feature suggestion: ELF files. #153

Open DavidGriffith opened 5 years ago

DavidGriffith commented 5 years ago

In GitLab by @xcvista on Oct 5, 2019, 11:13

This is a very common executable file format used by the tools of various microcontrollers, and it can pack code, EEPROM data and configuration bits all in one file. When coming to embedded world, AVR and ARM based chips has been using ELF for quite a while, and as of recently Microchip XC8 version 2.0 introduced ELF to 8-bit PIC.

Would it be a good idea to allow burning of ELF files directly without using objcopy to split it into multiple files first, at least for certain types of microcontrollers? For example, ELF generated by avr-gcc for AVR and xc8 for PIC.

DavidGriffith commented 5 years ago

In GitLab by @radiomanV on Oct 5, 2019, 11:44

There's the -f option to specify the intel hex or motorola srec format. For what you propose an elf parser should be implemented or at least a library to do this.

Also i implemented piping in my last commit so the minipro software can read from stdin all supported formats(binary, intel hex, motorola srec and jedec). But if i remember correctly the objcopy doesn't support writing to streams.

DavidGriffith commented 5 years ago

In GitLab by @xcvista on Oct 6, 2019, 01:48

The trick is that ELF file can 1) use a sparse representation for various memories of the MCU, and 2) put multiple distinct types of memories in one file.

Only certain types of MCU can support ELF for now. But for such MCU, with just -f elf -w program.elf or -f elf -r program.elf all memories would be programmed/read and there would be only one output file.

DavidGriffith commented 4 years ago

In GitLab by @oloftangrot on Jan 6, 2020, 09:21

I belive avrdude has this feature.

DavidGriffith commented 4 years ago

In GitLab by @xcvista on Jan 6, 2020, 09:33

Since this is GPLv3 code, you can just use libbfd from GNU binutils to parse and generate ELF files. For PIC and AVR the exact layout used by xc8 and avr-gcc is used. For everything else we can treat ELF as simply a sparse binary format for writing and not allow it for reading.

DavidGriffith commented 4 years ago

In GitLab by @hpax on Aug 31, 2020, 22:29

Note that the srec or Intel hex formats also support sparse addresses.