Skip to content

Commit af8fbc4

Browse files
authored
Merge pull request #238 from HyperloopUPV-H8/development
Development
2 parents 4e9e4aa + ca2a5a7 commit af8fbc4

114 files changed

Lines changed: 79252 additions & 1522 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cproject

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
<listOptionValue builtIn="false" value="DEBUG"/>
5757
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
5858
<listOptionValue builtIn="false" value="STM32H723xx"/>
59+
<listOptionValue builtIn="false" value="NUCLEO"/>
5960
</option>
6061
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths.1706685625" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths" useByScannerDiscovery="false" valueType="includePath">
6162
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32H7xx/Include"/>
@@ -73,13 +74,19 @@
7374
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/LWIP/Target}&quot;"/>
7475
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Inc/ST-LIB_HIGH}&quot;"/>
7576
</option>
77+
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.otherflags.788339115" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.otherflags" useByScannerDiscovery="true" valueType="stringList">
78+
<listOptionValue builtIn="false" value="-Wno-pointer-arith"/>
79+
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.otherflags.1860767925" name="Other flags" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.otherflags" useByScannerDiscovery="true" valueType="stringList">
80+
<listOptionValue builtIn="false" value="-Wno-volatile"/>
81+
</option>
7682
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.1475030527" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
7783
</tool>
7884
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.1661936536" name="MCU G++ Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler">
7985
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.1174736451" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.value.g3" valueType="enumerated"/>
8086
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.976783598" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level" useByScannerDiscovery="false"/>
8187
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.definedsymbols.1331033218" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
8288
<listOptionValue builtIn="false" value="DEBUG"/>
89+
<listOptionValue builtIn="false" value="NUCLEO"/>
8390
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
8491
<listOptionValue builtIn="false" value="STM32H723xx"/>
8592
</option>
@@ -113,13 +120,20 @@
113120
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Inc/ST-LIB_HIGH}&quot;"/>
114121
</option>
115122
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.languagestandard.1092333469" name="Language standard" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.languagestandard" useByScannerDiscovery="true" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.languagestandard.value.gnupp20" valueType="enumerated"/>
123+
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.otherflags.1968500486" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.otherflags" useByScannerDiscovery="true" valueType="stringList">
124+
<listOptionValue builtIn="false" value="-Wno-pointer-arith"/>
125+
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.otherflags.1641936875" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.otherflags" useByScannerDiscovery="true" valueType="stringList">
126+
<listOptionValue builtIn="false" value="-Wno-volatile"/>
127+
</option>
116128
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.input.cpp.2042651219" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.input.cpp"/>
117129
</tool>
118130
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.1252531761" name="MCU GCC Linker" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker"/>
119131
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker.538369617" name="MCU G++ Linker" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker">
120132
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker.option.script.1977419935" name="Linker Script (-T)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker.option.script" value="${workspace_loc:/${ProjName}/STM32H723ZGTX_FLASH.ld}" valueType="string"/>
121133
</tool>
122-
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver.660510340" name="MCU GCC Archiver" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver"/>
134+
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver.660510340" name="MCU GCC Archiver" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver">
135+
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver.option.otherflags.426871032" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver.option.otherflags" useByScannerDiscovery="false" valueType="stringList"/>
136+
</tool>
123137
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.size.830977599" name="MCU Size" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.size"/>
124138
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objdump.listfile.983818571" name="MCU Output Converter list file" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objdump.listfile"/>
125139
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.hex.1225404283" name="MCU Output Converter Hex" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.hex"/>
@@ -204,34 +218,38 @@
204218
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.644859847" name="MCU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler">
205219
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.1044845739" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.value.g0" valueType="enumerated"/>
206220
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.includepaths.608211099" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.includepaths" valueType="includePath">
207-
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Inc/HALAL/Models}&quot;"/>
208-
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Inc/HALAL/Services/}&quot;"/>
221+
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Inc}&quot;"/>
209222
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Inc/ST-LIB_LOW}&quot;"/>
210-
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Drivers/CMSIS/Include}&quot;"/>
223+
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Inc/HALAL/Models}&quot;"/>
211224
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Inc/HALAL/Services}&quot;"/>
212-
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Inc}&quot;"/>
225+
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Drivers/CMSIS/Include}&quot;"/>
213226
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Drivers/BSP/Components}&quot;"/>
214227
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/LWIP/App}&quot;"/>
215228
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/LWIP/Target}&quot;"/>
216229
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Inc/ST-LIB_HIGH}&quot;"/>
230+
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Inc/HALAL/Services/}&quot;"/>
231+
</option>
232+
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols.779603999" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols" valueType="definedSymbols">
233+
<listOptionValue builtIn="false" value="DEBUG"/>
217234
</option>
218235
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input.1583550009" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input"/>
219236
</tool>
220237
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1237569348" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler">
221238
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.322474680" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.value.g0" valueType="enumerated"/>
222239
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.2119042532" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.os" valueType="enumerated"/>
223240
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols.134281155" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
241+
<listOptionValue builtIn="false" value="DEBUG"/>
224242
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
225243
<listOptionValue builtIn="false" value="STM32H723xx"/>
226244
</option>
227245
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths.1420442850" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths" useByScannerDiscovery="false" valueType="includePath">
228246
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32H7xx/Include"/>
229247
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/>
230248
<listOptionValue builtIn="false" value="../Inc"/>
249+
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Inc/ST-LIB_LOW}&quot;"/>
231250
<listOptionValue builtIn="false" value="../Drivers/STM32H7xx_HAL_Driver/Inc"/>
232251
<listOptionValue builtIn="false" value="../Drivers/STM32H7xx_HAL_Driver/Inc/Legacy"/>
233252
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Inc/HALAL/Models}&quot;"/>
234-
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Inc/ST-LIB_LOW}&quot;"/>
235253
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Drivers/CMSIS/Include}&quot;"/>
236254
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Inc/HALAL/Services}&quot;"/>
237255
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Inc}&quot;"/>
@@ -246,11 +264,15 @@
246264
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.772692386" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.value.g0" valueType="enumerated"/>
247265
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.1432865387" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.value.os" valueType="enumerated"/>
248266
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.definedsymbols.1423635322" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
267+
<listOptionValue builtIn="false" value="DEBUG"/>
249268
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
250269
<listOptionValue builtIn="false" value="STM32H723xx"/>
251270
</option>
252271
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.includepaths.724629025" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.includepaths" useByScannerDiscovery="false" valueType="includePath">
253272
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Inc}&quot;"/>
273+
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Drivers/STM32H7xx_HAL_Driver/Inc/Legacy}&quot;"/>
274+
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Drivers/STM32H7xx_HAL_Driver/Inc}&quot;"/>
275+
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Drivers/CMSIS/Device/ST/STM32H7xx/Include}&quot;"/>
254276
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Inc/ST-LIB_LOW}&quot;"/>
255277
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Drivers/CMSIS/Include}&quot;"/>
256278
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ST-LIB/Inc/HALAL/Models}&quot;"/>
@@ -355,5 +377,4 @@
355377
</scannerConfigBuildInfo>
356378
</storageModule>
357379
<storageModule moduleId="refreshScope"/>
358-
</cproject>
359-
380+
</cproject>

.gitignore

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
#compiler output
22
Debug/
33
Release/
4-
.settings/
54
cmake/build/
65
compile_commands.json
7-
build
86

97
#test folder
108
Pruebas/
119
PRUEBAS/
1210

1311
#ccls cache
1412
.ccls-cache/
15-
.settings
13+
.cache/
1614

1715
#vscode
1816
.vscode
1917
.cproject
18+
.cache
19+
20+
.settings
21+
build
22+
!build/build.sh

CMakeLists.txt

Lines changed: 69 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,58 @@ project (ST-LIB)
44
set(CMAKE_CXX_STANDARD 20)
55
set(CMAKE_CXX_STANDARD_REQUIRED True)
66
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
7+
set(LIBRARY st-lib)
78

8-
add_library(st-lib STATIC Src/ST-LIB.cpp)
9+
file(GLOB_RECURSE SOURCE_C ${CMAKE_SOURCE_DIR}/ *.c)
10+
file(GLOB_RECURSE SOURCE_CPP ${CMAKE_SOURCE_DIR}/ *.cpp)
11+
file(GLOB_RECURSE SOURCE_H ${CMAKE_SOURCE_DIR}/ *.h)
12+
file(GLOB_RECURSE SOURCE_HPP ${CMAKE_SOURCE_DIR}/ *.hpp)
913

10-
target_include_directories(st-lib PUBLIC
14+
add_library(${LIBRARY} STATIC
15+
${SOURCE_C}
16+
${SOURCE_CPP}
17+
${SOURCE_H}
18+
${SOURCE_CPP}
19+
)
20+
21+
target_compile_definitions(${LIBRARY} PUBLIC
22+
-DUSE_HAL_DRIVER
23+
-DSTM32H723xx
24+
-DDEBUG
25+
)
26+
27+
option(BOARD "Board clock config" OFF)
28+
option(NUCLEO "Nucleo clock config" OFF)
29+
30+
if(BOARD)
31+
add_definitions(-DNUCLEO)
32+
add_definitions(-DHSE_VALUE=25000000)
33+
endif()
34+
35+
if(NUCLEO)
36+
add_definitions(-DBOARD)
37+
add_definitions(-DHSE_VALUE=8000000)
38+
endif()
39+
40+
41+
target_compile_options(${LIBRARY} PUBLIC
42+
-mcpu=cortex-m7
43+
-mfpu=fpv5-d16
44+
-mfloat-abi=hard
45+
-mthumb
46+
47+
-O0
48+
-ffunction-sections
49+
-fdata-sections
50+
-fno-exceptions
51+
$<$<COMPILE_LANGUAGE:CXX>:-fno-use-cxa-atexit>
52+
$<$<COMPILE_LANGUAGE:CXX>:-fno-rtti>
53+
54+
-Wno-psabi
55+
--specs=nosys.specs
56+
)
57+
58+
target_include_directories(${LIBRARY} PUBLIC
1159
Drivers/CMSIS/Device/ST/STM32H7xx/Include
1260
Drivers/CMSIS/Include
1361
Drivers/STM32H7xx_HAL_Driver/Inc
@@ -28,6 +76,7 @@ target_include_directories(st-lib PUBLIC
2876
Middlewares/Third_Party/LwIP/src/include/compat/stdc
2977
Middlewares/Third_Party/LwIP/system/arch
3078
Drivers/BSP/Components
79+
Drivers/BSP/Components/lan8742
3180
LWIP/App
3281
LWIP/Target
3382
Inc
@@ -36,3 +85,21 @@ target_include_directories(st-lib PUBLIC
3685
Inc/ST-LIB_LOW
3786
Inc/ST-LIB_HIGH
3887
)
88+
89+
IF(CMAKE_CROSSCOMPILING)
90+
message(STATUS "Cross-compiling")
91+
ELSE()
92+
message(STATUS "NOT Cross-compiling")
93+
ENDIF()
94+
95+
add_custom_command(TARGET ${LIBRARY}
96+
POST_BUILD
97+
COMMAND echo ""
98+
COMMAND echo ""
99+
COMMAND echo ""
100+
COMMAND ls -lh libst-lib.a
101+
COMMAND echo ""
102+
COMMAND echo ""
103+
COMMAND echo ""
104+
)
105+

0 commit comments

Comments
 (0)