QUERY · ISSUE
RFC: Use board name for firmware files
enhancementports
Description
Whenever I build firmware for a board I need to rename firmware.elf, etc to the board name before distributing it to users. Would it be useful to replace "firmware" with the board name in Makefile to automate this? I have tested it and the result looks like this:
LINK build-PYBV10/PYBV10.elf
text data bss dec hex filename
364920 52 26908 391880 5fac8 build-PYBV10/PYBV10.elf
GEN build-PYBV10/PYBV10-0.bin
GEN build-PYBV10/PYBV10-1.bin
GEN build-PYBV10/PYBV10.hex
GEN build-PYBV10/PYBV10.dfu
If interested I can submit a PR for the stm32 port, and probably other arm ports, but I don't have the build environment to do non-arm ports.
Code Size
No response
Implementation
I intend to implement this feature and would submit a Pull Request if desirable
Code of Conduct
Yes, I agree
CANDIDATE · PULL REQUEST
Put some code into the first 16K of flash
This basically shrinks the remaining size of flash in the portion
that goes after the internal flash drive.
Comparison of the overall flash usage:
BEFORE:
LINK build-PYBV10/firmware.elf
text data bss dec hex filename
228412 392 28104 256908 3eb8c build-PYBV10/firmware.elf
AFTER:
LINK build-PYBV10/firmware.elf
text data bss dec hex filename
228416 392 28104 256912 3eb90 build-PYBV10/firmware.elf
and the section sizes BEFORE:
2885 >objdump -h build-PYBV10/firmware.elf
build-PYBV10/firmware.elf: file format elf32-little
Sections:
Idx Name Size VMA LMA File off Algn
0 .isr_vector 00000188 08000000 08000000 00008000 2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
1 .text 00037ab4 08020000 08020000 00010000 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
2 .data 00000188 20000000 08057ab4 00048000 2**2
CONTENTS, ALLOC, LOAD, DATA
3 .bss 000025c8 20000188 08057c3c 00048188 2**2
ALLOC
4 .heap 00004000 20002750 08057c3c 0004a750 2**0
ALLOC
5 .stack 00000800 20006750 08057c3c 0004e750 2**0
ALLOC
6 .ARM.attributes 00000035 00000000 00000000 00048188 2**0
CONTENTS, READONLY
7 .comment 00000070 00000000 00000000 000481bd 2**0
CONTENTS, READONLY
and AFTER:
2889 >objdump -h build-PYBV10/firmware.elf
build-PYBV10/firmware.elf: file format elf32-little
Sections:
Idx Name Size VMA LMA File off Algn
0 .isr_vector 000033e4 08000000 08000000 00008000 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .text 0003485c 08020000 08020000 00010000 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
2 .data 00000188 20000000 0805485c 00048000 2**2
CONTENTS, ALLOC, LOAD, DATA
3 .bss 000025c8 20000188 080549e4 00048188 2**2
ALLOC
4 .heap 00004000 20002750 080549e4 0004a750 2**0
ALLOC
5 .stack 00000800 20006750 080549e4 0004e750 2**0
ALLOC
6 .ARM.attributes 00000035 00000000 00000000 00048188 2**0
CONTENTS, READONLY
7 .comment 00000070 00000000 00000000 000481bd 2**0
CONTENTS, READONLY