34 Commits

Author SHA1 Message Date
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
ConvertDevice
e0e04ea938 ci: add convertdevice-xcan01 hardware support 2022-11-14 10:46:19 -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
b24cba3a55 Add config for budgetcan
Update the config.h and CMake to support the budgetcan device which contains the STM32G0B1xK microcontroller.
2022-11-14 10:03:53 -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
Marc Kleine-Budde
439d122d52 cmake: add_link_options(): add LINKER:--print-memory-usage
This gives a nice memory usage overview during linking:

| Memory region         Used Size  Region Size  %age Used
|            FLASH:       15476 B       127 KB     11.90%
|              RAM:        4304 B        16 KB     26.27%
|             DATA:           4 B         1 KB      0.39%
2022-11-11 00:08:56 +01:00
Marc Kleine-Budde
dcdf5564a4 cmake: add_link_options(): use LINKER: instead of -Xlinker
Using "LINKER:" is a portable way to pass options to the linker tool.

Link: https://cmake.org/cmake/help/v3.25/command/add_link_options.html#handling-compiler-driver-differences
2022-11-11 00:05:26 +01:00
Marc Kleine-Budde
2d11092425 cmake: add_compile_options(), add_link_options(): only 1 option per line and sort them
Only cleanups, no functional change intended.
2022-11-11 00:04:59 +01:00
Ryan Edwards
8f9fa7788c cmake: add µC series letter to TGT*_LIST variables
This is a preparation patch to add support for the STM32G0 series.
2022-11-08 21:26:24 +01:00
Daniel Trevitz
4540120e94 Use consistent whitespace
Use tabs in cmake to match c file formatting

Signed-off-by: Daniel Trevitz <daniel.trevitz@wika.com>
2022-10-05 22:30:06 -04:00
Marc Kleine-Budde
c19f3a17e1 cmake: add -Wstrict-prototypes
Suggested-by: fenugrec <fenugrec@users.sourceforge.net>
Link: https://github.com/candle-usb/candleLight_fw/issues/103
Signed-off-by: Marc Kleine-Budde <mkl@blackshift.org>
2022-08-28 21:47:36 +02:00
ReXT3D
3337447233 Add Makerbase CANable-MKS board support
Configuration for Makerbase CANable-MKS and CANable-MKS Pro boards
2022-07-29 10:23:12 -04:00
fenugrec
2df0d420e9 Simplify BOARD_XYZ macros (no more numeric values)
There is currently no reason to assign a numeric value to each BOARD_*
macro.
Fix #83 GH
2022-01-06 17:54:49 -05:00
fenugrec
6b451da2f0 CMake: clean up -mcpu=XYZ compile flags
also remove duplicate link options for F072 targets
2022-01-06 17:38:41 -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
fenugrec
d66fda39f8 Add git version string to USB config descriptor
There was already provisions for this in the code. Tweaked CMake to
generate version.h automatically every build.
2021-04-06 12:03:13 -04:00
fenugrec
9d00e884c7 cmake : forgot to specify ldscript to linker 2020-12-06 12:51:46 -05:00
Hubert Denkmair
e921aeac87 remove useless linker option 2020-12-06 12:51:46 -05:00
Hubert Denkmair
1712fecf5e enable link-time optimizations 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
fenugrec
88ed027020 cmake : clean .bin files, and run dfu-suffix
dfu-util warns when flashing a .bin file that has no "dfu suffix". Now
we use dfu-suffix, if available, to add the dfu suffix; otherwise keep
the original dfu-util command line as a reflash target; fixes #56 GH.

Also add .bin files as BYPRODUCTS so that 'make clean' picks them up
too.
2020-11-01 15:15:34 -05:00
fenugrec
9cf7eccf3d Add new boardtype : cannette
F042-based, galvanically isolated.
2020-10-30 21:55:27 -04:00
fenugrec
70a18e1a1f Update cmake_minimum_required() version
add_link_options() requires cmake >= 3.13

pointed out by @vondraussen in github PR #39
2019-11-30 12:11:30 -05:00
fenugrec
de943d54f2 un-break cmake (missing ") 2019-11-11 16:20:40 -05:00
Brandon Ros
faa164055a CANAlyze support 2019-11-09 14:26:45 -05:00
fenugrec
079882f000 cmake: make each target a configurable option
by default, everything will be compiled. Each target may be disabled
individually.
2019-11-04 20:26:57 -05:00
fenugrec
ad9351243c cmake: add helpers to generate board targets 2019-11-04 20:20:36 -05:00
fenugrec
9003f5ec1d remove trailing whitespace in CMakeLists.txt too 2019-11-04 19:09:15 -05:00
fenugrec
bb6a14a8fc Fix sp-in-clobberlist error again for gcc9
We need to specify -Wno-deprecated at the top level, and not just when
building stm32_HAL because any regular source file that includes in stm32f0xx_hal.h also pulls in those cmsis headers that trigger the deprecation warning.
2019-11-04 18:53:00 -05:00
Hubert Denkmair
e3c7fde27a fix bug #14: candleLight uses F072, cantact F042
was mixed up since a long time (?)
2019-11-03 11:12:18 +01:00
Hubert Denkmair
0352092cda add ASM as cmake language to get init code compiled&linked in 2019-11-02 10:02:24 +01:00
Hubert Denkmair
f24a409d19 add dfu-util flash targets 2019-10-30 20:36:42 +01:00
Hubert Denkmair
f38ddcacf5 generate bin files, show compiled size 2019-10-27 16:09:02 +01:00
Hubert Denkmair
23ebdb8a78 convert to cmake 2019-10-26 16:53:43 +02:00