startup files generated by stm32cubeIDE do this. Mostly useless since
none of our code uses that; the linking step gets rid of those sections
anyway.
objdump before:
200000a8 l .data 00000000 __fini_array_end
200000a4 l .data 00000000 __fini_array_start
200000a4 l .data 00000000 __init_array_end
200000a0 l .data 00000000 __preinit_array_end
200000a0 l .data 00000000 __init_array_start
200000a0 l .data 00000000 __preinit_array_start
after:
0800419c l .fini_array 00000000 __fini_array_end
08004198 l .fini_array 00000000 __fini_array_start
08004198 l .init_array 00000000 __init_array_end
08004194 l .preinit_array 00000000 __preinit_array_end
08004194 l .init_array 00000000 __init_array_start
08004194 l .preinit_array 00000000 __preinit_array_start
99% of the ldscripts is identical, which makes it a pain to maintain.
Now we use cmake 'configure_file()' with a handful of variables to
produce each ldscript from a common template.
There is a pair of USB requests ( GS_USB_BREQ_GET_USER_ID and
_SET_USER_ID) that is not supported by the linux driver, and not used by
any known software :
https://github.com/candle-usb/candleLight_fw/issues/91
Since the firmware returns a unique serial #, there doesn't appear to be
any use case for assigning a user ID. Using a whole flash page for that
purpose can be wasteful on bigger targets .
This removes all the relevant code and adjusts the linker scripts
accordingly.
Add the STM32G0 to the CMake setup. This CMake is specific to the STM32G0B1xK device. Also included the linker file that is required for the make.
Currently G0 targets are disabled by default to keep project buildable
as-is.
This had probably been accidentally reverted in
2ebc665109887bfe95a4ad63ebe5e1d7d13c0fef ? flash_data_rom ended up on the same flash page as other unrelated data, which meant flash_flush() would've erased too much.
Also reduce nvm area to 1k and use variables to calculate area. (F042
devices only have 1kB pages vs 2k for the F072)