-
Notifications
You must be signed in to change notification settings - Fork 0
/
mcuSelect.cmake
65 lines (62 loc) · 3.49 KB
/
mcuSelect.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# We ony enable usb for arm and non small footprint
IF(NOT DEFINED LN_ARCH)
IF(USE_CH32V3x) # RISCV
SET(LN_ENABLED_BOARDS CH32F1 RP STM32F1 NRF51 NRF91 LPC11XX LPC15XX LPC17XX STM32F4 STM32G0 STM32H7 STM32H5 STM32L4 )
# try without crystal...
#SET(LN_USE_INTERNAL_CLOCK True CACHE INTERNAL "")
#SET(LN_MCU_SPEED 48000000 CACHE INTERNAL "") # 96 Mhz
#SET(LN_MCU_SPEED 96000000 CACHE INTERNAL "") # 96 Mhz
SET(LN_MCU_SPEED 144000000 CACHE INTERNAL "") # 144 Mhz
SET(LN_ARCH "RISCV" CACHE INTERNAL "")
SET(LN_MCU "CH32V3x" CACHE INTERNAL "")
SET(LN_MCU_RAM_SIZE 64 CACHE INTERNAL "")
SET(LN_MCU_FLASH_SIZE 256 CACHE INTERNAL "")
SET(LN_MCU_STATIC_RAM 10 CACHE INTERNAL "")
SET(LN_SPEC "picolibc" CACHE INTERNAL "") # if not set we use nano
SET(LN_BOOTLOADER_SIZE 0 CACHE INTERNAL "")
#SET(LN_SPEC "picolibc" CACHE INTERNAL "") # if not set we use nano
ELSE()
IF(USE_GD32F3)
SET(LN_ENABLED_BOARDS CH32F1 RP STM32F1 NRF51 NRF91 LPC11XX LPC15XX LPC17XX STM32F4 STM32G0 STM32H7 STM32H5 STM32L4 )
SET(LN_ARCH "ARM" CACHE INTERNAL "")
SET(LN_MCU "M4" CACHE INTERNAL "")
SET(LN_MCU_FLASH_SIZE 256 CACHE INTERNAL "")
SET(LN_MCU_RAM_SIZE 46 CACHE INTERNAL "")
SET(LN_MCU_STATIC_RAM 8 CACHE INTERNAL "")
#SET(LN_MCU_SPEED 72000000 CACHE INTERNAL "") #=> ok
SET(LN_MCU_SPEED 96000000 CACHE INTERNAL "") #=> ok
# SET(LN_MCU_SPEED 72000000 CACHE INTERNAL "") #=> ok
SET(LN_SPEC "picolibc" CACHE INTERNAL "") # if not set we use nano
SET(LN_BOOTLOADER_SIZE 0 CACHE INTERNAL "")
ELSEIF(USE_RP2040)
SET(LN_ENABLED_BOARDS CH32F1 RP STM32F1 NRF51 NRF91 LPC11XX LPC15XX LPC17XX STM32F4 STM32G0 STM32H7 STM32H5 STM32L4 )
SET(LN_ARCH "ARM" CACHE INTERNAL "")
SET(LN_MCU "RP2040" CACHE INTERNAL "")
SET(LN_MCU_RAM_SIZE 200 CACHE INTERNAL "")
SET(LN_MCU_SPEED 72000000 CACHE INTERNAL "")
SET(LN_MCU_STATIC_RAM 10 CACHE INTERNAL "")
SET(LN_MCU_FLASH_SIZE 2048 CACHE INTERNAL "")
SET(LN_MCU_EEPROM_SIZE 2 CACHE INTERNAL "")
SET(LN_BOOTLOADER_SIZE 0 CACHE INTERNAL "")
SET(LN_SPEC "picolibc" CACHE INTERNAL "") # if not set we use nano
ELSE() # Small bluepill style
SET(LN_ARCH "ARM" CACHE INTERNAL "")
SET(LN_MCU "M3" CACHE INTERNAL "")
SET(LN_MCU_RAM_SIZE 20 CACHE INTERNAL "")
SET(LN_MCU_SPEED 72000000 CACHE INTERNAL "")
SET(LN_ENABLED_BOARDS CH32F1 RP STM32F1 )
IF(USE_SMALLFOOTPRINT)
SET(LN_MCU_STATIC_RAM 3 CACHE INTERNAL "")
SET(LN_MCU_FLASH_SIZE 64 CACHE INTERNAL "")
SET(LN_MCU_EEPROM_SIZE 2 CACHE INTERNAL "")
ELSE() # "Big" flash
SET(LN_MCU_STATIC_RAM 7 CACHE INTERNAL "")
SET(LN_MCU_FLASH_SIZE 188 CACHE INTERNAL "")
SET(LN_MCU_EEPROM_SIZE 2 CACHE INTERNAL "")
SET(LN_BOOTLOADER_SIZE 0 CACHE INTERNAL "")
ENDIF()
SET(LN_SPEC "picolibc" CACHE INTERNAL "") # if not set we use nano
ENDIF() # GD32F3
ENDIF() # CH32V3
ENDIF(NOT DEFINED LN_ARCH)
MESSAGE(STATUS "Architecture ${LN_ARCH}, MCU=${LN_MCU}")