17 Commits

Author SHA1 Message Date
fenugrec
dfdcb38336 ldscripts : move init/fini_array sections to flash
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
2022-12-05 13:47:01 -05:00
fenugrec
b3814f5f12 ldscripts : unmark RAM section as executable
It has no business being marked "rwx". Related to #106 on GH, but
doesn't fix the "LOAD segment with RWX permissions" warning.
2022-11-23 10:23:19 -05:00
fenugrec
a0a333ae13 ldscripts: remove .jcr sections 2022-11-17 14:06:23 -05:00
Marc Kleine-Budde
59896b65fd startup: get rid of zero table and fix copy_table 2022-11-17 12:50:07 -05:00
fenugrec
ac24146664 cmake : generate ldscripts automatically
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.
2022-11-17 12:40:26 -05:00
fenugrec
a0caf93e50 Remove flash-as-eeprom emulation for USER_ID
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.
2022-11-14 10:40:27 -05:00
Ryan Edwards
5645f93365 Fix RAM size in linker
I never updated the RAM size in the linker when creating it from the template.  If I ever use 144K I'm writing very poor code!
2022-11-14 10:02:30 -05:00
Ryan Edwards
e8d82ef7ae Add the CMake files to support the STM32G0
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.
2022-11-14 09:15:58 -05:00
Ricky Lopez
d306798923 Add STM32F4 support
Specifically, the STM32F407VE.
Even more specifically, [this](https://stm32-base.org/boards/STM32F407VET6-STM32-F4VE-V2.0.html) dev board
2022-01-06 12:31:05 -05:00
John Whittington
05fe629e5c add user data section to linker scripts
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)
2021-02-16 11:08:11 -05:00
Hubert Denkmair
39c3d0c52a remove old unused linker script 2020-12-06 12:51:46 -05:00
Hubert Denkmair
df9113fb6b set appropriate stack sizes 2020-12-06 12:51:46 -05:00
Hubert Denkmair
fef1d397b5 use startup files and linker scripts from LibreUCpp 2020-12-06 12:51:46 -05:00
Hubert Denkmair
23ebdb8a78 convert to cmake 2019-10-26 16:53:43 +02:00
Hubert Denkmair
2ebc665109 adapt to stm32f042 for candleZero 2017-05-12 23:31:39 +02:00
Hubert Denkmair
1453d70dc9 really implement write user_id to flash 2016-06-11 18:36:59 +02:00
Hubert Denkmair
e3a2a26851 initial checkin 2016-04-08 10:52:20 +02:00