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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
Import('rtconfig')
Import('RTT_ROOT')
from building import *
import os
cwd = GetCurrentDir()
if GetDepend(['BSP_USING_LPADC1']):
# add the LPADC1 drivers.
src = Split("""
board.c
MCUX_Config_LPADC1/clock_config.c
MCUX_Config_LPADC1/pin_mux.c
MCUX_Config_LPADC1/peripherals.c
""")
else:
# add the general drivers.
src = Split("""
board.c
MCUX_Config/clock_config.c
MCUX_Config/pin_mux.c
MCUX_Config/peripherals.c
""")
if GetDepend(['BSP_USING_QSPI_FLASH']):
src += ['ports/drv_flexspi_nor_flash.c']
if GetDepend(['BSP_USING_QSPI_FLASH_FS']):
src += ['ports/drv_flexspi_nor_flash.c', 'ports/fal_flash_port.c']
if GetDepend(['BSP_USING_LPADC1']):
CPPPATH = [cwd,cwd + '/MCUX_Config_LPADC1',cwd + '/ports']
else:
CPPPATH = [cwd,cwd + '/MCUX_Config',cwd + '/ports']
CPPDEFINES = ['CPU_MIMXRT1189CVM8C_cm33', 'MCUXPRESSO_SDK', 'MCUX_META_BUILD', 'MIMXRT1189_cm33_SERIES', 'ARM_MATH_CM33']
LINKFLAGS = ''
if rtconfig.PLATFORM in ['gcc']:
CPPDEFINES += ['__STARTUP_INITIALIZE_RAMFUNCTION']
if rtconfig.PLATFORM in ['armcc', 'armclang']:
CPPDEFINES += ['NDEBUG']
if rtconfig.PLATFORM in ['iccarm']:
CPPDEFINES += ['NDEBUG']
if GetDepend(['BSP_USE_HYPERRAM']):
CPPDEFINES += ['USE_HYPERRAM=1']
if GetDepend(['BSP_USE_MULTICORE']):
CPPDEFINES += ['__USE_SHMEM', 'MULTICORE_APP=1']
if rtconfig.PLATFORM in ['gcc']:
LINKFLAGS += ' -Wl,-defsym,__use_shmem__=1'
LINKFLAGS += ' -Wl,-defsym,__multicore__=1'
if rtconfig.PLATFORM in ['armcc', 'armclang']:
LINKFLAGS += ' --predefine="-D__use_shmem__=1"'
LINKFLAGS += ' --predefine="-D__multicore__=1"'
if rtconfig.PLATFORM in ['iccarm']:
LINKFLAGS += ' __use_shmem__=1'
LINKFLAGS += ' __multicore__=1'
if GetDepend(['BSP_USING_ETH']):
CPPDEFINES += ['SDK_NETC_USED=1', 'FSL_ETH_ENABLE_CACHE_CONTROL=1']
if GetDepend(['RT_USING_CHERRYUSB']):
cherryusb_path = os.path.join(RTT_ROOT, 'components', 'drivers', 'usb', 'cherryusb')
src += ['cherryusb_port.c']
if GetDepend(['RT_CHERRYUSB_DEVICE_TEMPLATE_CDC_ACM']):
src += ['cherryusb_cdc_acm.c']
if GetDepend(['BSP_CHERRYUSB_HOST_MOUSE_DEMO']):
src += ['usbh_mouse_demo.c']
CPPPATH += [
cherryusb_path,
os.path.join(cherryusb_path, 'common'),
os.path.join(cherryusb_path, 'core'),
os.path.join(cherryusb_path, 'class', 'hub'),
os.path.join(cherryusb_path, 'class', 'cdc'),
os.path.join(cherryusb_path, 'class', 'hid'),
]
if GetDepend(['BSP_LINKER_SCRIPT_FLEXSPI_NOR']):
CPPDEFINES += ['XIP_BOOT_HEADER_ENABLE=1', 'XIP_EXTERNAL_FLASH=1']
if GetDepend(['BSP_LINKER_SCRIPT_FLEXSPI_NOR_HYPERRAM']):
CPPDEFINES += ['XIP_BOOT_HEADER_ENABLE=1', 'XIP_EXTERNAL_FLASH=1']
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES=CPPDEFINES, LINKFLAGS = LINKFLAGS)
Return('group')
|