Browse Source

cpp 编译通过

master
zhaohe 2 years ago
parent
commit
ec7f403638
  1. 7
      .clang-format
  2. 3
      .vscode/c_cpp_properties.json
  3. 4
      .vscode/settings.json
  4. 90
      app/MDK-ARM/app.uvguix.h_zha
  5. 86
      app/MDK-ARM/app.uvoptx
  6. 39
      app/MDK-ARM/app.uvprojx
  7. 96
      app/MDK-ARM/startup_stm32f407xx.lst
  8. 2
      dep/libtrinamic
  9. 9
      src/umain.c

7
.clang-format

@ -1,5 +1,10 @@
# Defines the Chromium style for automatic reformatting.
# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
Language: Cpp
BasedOnStyle: Google
ColumnLimit: 160
ColumnLimit: 160
AlignConsecutiveMacros: true
AlignConsecutiveDeclarations: true
AlignConsecutiveAssignments: true
AlignOperands: true

3
.vscode/c_cpp_properties.json

@ -12,7 +12,8 @@
".\\app\\Core\\Src",
".\\dep",
".\\src",
".\\app\\Drivers\\STM32F4xx_HAL_Driver\\Src"
".\\app\\Drivers\\STM32F4xx_HAL_Driver\\Src",
".\\dep\\libtrinamic\\IFLYTOP-TMC-API"
],
"defines": [
"USE_HAL_DRIVER",

4
.vscode/settings.json

@ -8,6 +8,8 @@
"stm32_header.h": "c",
"stm32f4xx_hal_tim.h": "c",
"project_board.h": "c",
"port.h": "c"
"port.h": "c",
"compare": "c",
"tmc4361a_register.h": "c"
}
}

90
app/MDK-ARM/app.uvguix.h_zha
File diff suppressed because it is too large
View File

86
app/MDK-ARM/app.uvoptx

@ -349,7 +349,7 @@
<Group>
<GroupName>Drivers/STM32F4xx_HAL_Driver</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@ -573,7 +573,7 @@
<Group>
<GroupName>Drivers/CMSIS</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@ -613,7 +613,7 @@
<Group>
<GroupName>src</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@ -644,6 +644,86 @@
</Group>
<Group>
<GroupName>libtrinamic</GroupName>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>32</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\dep\libtrinamic\IFLYTOP-TMC-API\tmc\ic\TMC4361A\TMC4361A.c</PathWithFileName>
<FilenameWithoutPath>TMC4361A.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>33</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\dep\libtrinamic\IFLYTOP-TMC-API\tmc\helpers\CRC.c</PathWithFileName>
<FilenameWithoutPath>CRC.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>34</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\dep\libtrinamic\IFLYTOP-TMC-API\tmc\helpers\Functions.c</PathWithFileName>
<FilenameWithoutPath>Functions.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>35</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\dep\libtrinamic\IFLYTOP-TMC-API\tmc\ramp\Ramp.c</PathWithFileName>
<FilenameWithoutPath>Ramp.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>36</FileNumber>
<FileType>8</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\dep\libtrinamic\src\ic\tmc4361A.cpp</PathWithFileName>
<FilenameWithoutPath>tmc4361A.cpp</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>37</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\dep\libtrinamic\IFLYTOP-TMC-API\tmc\ramp\LinearRamp1.c</PathWithFileName>
<FilenameWithoutPath>LinearRamp1.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
<GroupName>::CMSIS</GroupName>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>

39
app/MDK-ARM/app.uvprojx

@ -189,7 +189,7 @@
<hadIRAM2>1</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
<useUlib>1</useUlib>
<useUlib>0</useUlib>
<EndSel>0</EndSel>
<uLtcg>0</uLtcg>
<nSecure>0</nSecure>
@ -339,7 +339,7 @@
<MiscControls>--diag_suppress=381 --diag_suppress=1 --diag_suppress=177 --diag_suppress=111 --diag_suppress=1295</MiscControls>
<Define>USE_HAL_DRIVER,STM32F407xx</Define>
<Undefine></Undefine>
<IncludePath>../Core/Inc;../Drivers/STM32F4xx_HAL_Driver/Inc;../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy;../Drivers/CMSIS/Device/ST/STM32F4xx/Include;../Drivers/CMSIS/Include;../../dep;../../src</IncludePath>
<IncludePath>../Core/Inc;../Drivers/STM32F4xx_HAL_Driver/Inc;../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy;../Drivers/CMSIS/Device/ST/STM32F4xx/Include;../Drivers/CMSIS/Include;../../dep;../../src;../../dep/libtrinamic/IFLYTOP-TMC-API</IncludePath>
</VariousControls>
</Cads>
<Aads>
@ -821,6 +821,41 @@
</Files>
</Group>
<Group>
<GroupName>libtrinamic</GroupName>
<Files>
<File>
<FileName>TMC4361A.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\dep\libtrinamic\IFLYTOP-TMC-API\tmc\ic\TMC4361A\TMC4361A.c</FilePath>
</File>
<File>
<FileName>CRC.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\dep\libtrinamic\IFLYTOP-TMC-API\tmc\helpers\CRC.c</FilePath>
</File>
<File>
<FileName>Functions.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\dep\libtrinamic\IFLYTOP-TMC-API\tmc\helpers\Functions.c</FilePath>
</File>
<File>
<FileName>Ramp.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\dep\libtrinamic\IFLYTOP-TMC-API\tmc\ramp\Ramp.c</FilePath>
</File>
<File>
<FileName>tmc4361A.cpp</FileName>
<FileType>8</FileType>
<FilePath>..\..\dep\libtrinamic\src\ic\tmc4361A.cpp</FilePath>
</File>
<File>
<FileName>LinearRamp1.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\dep\libtrinamic\IFLYTOP-TMC-API\tmc\ramp\LinearRamp1.c</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>::CMSIS</GroupName>
</Group>
</Groups>

96
app/MDK-ARM/startup_stm32f407xx.lst

@ -464,9 +464,9 @@ ARM Macro Assembler Page 8
171 00000000 IMPORT SystemInit
172 00000000 IMPORT __main
173 00000000
174 00000000 4806 LDR R0, =SystemInit
174 00000000 4809 LDR R0, =SystemInit
175 00000002 4780 BLX R0
176 00000004 4806 LDR R0, =__main
176 00000004 4809 LDR R0, =__main
177 00000006 4700 BX R0
178 00000008 ENDP
179 00000008
@ -818,25 +818,42 @@ ARM Macro Assembler Page 13
398 0000001C ;*******************************************************
************************
399 0000001C IF :DEF:__MICROLIB
400 0000001C
401 0000001C EXPORT __initial_sp
402 0000001C EXPORT __heap_base
403 0000001C EXPORT __heap_limit
404 0000001C
405 0000001C ELSE
420 ENDIF
421 0000001C
422 0000001C END
406 0000001C
407 0000001C IMPORT __use_two_region_memory
408 0000001C EXPORT __user_initial_stackheap
409 0000001C
410 0000001C __user_initial_stackheap
411 0000001C
412 0000001C 4804 LDR R0, = Heap_Mem
413 0000001E 4905 LDR R1, =(Stack_Mem + Stack_Size)
414 00000020 4A05 LDR R2, = (Heap_Mem + Heap_Size)
415 00000022 4B06 LDR R3, = Stack_Mem
416 00000024 4770 BX LR
417 00000026
418 00000026 00 00 ALIGN
419 00000028
420 00000028 ENDIF
421 00000028
422 00000028 END
00000000
00000000
00000000
00000400
00000400
00000000
Command Line: --debug --xref --diag_suppress=9931 --cpu=Cortex-M4.fp.sp --apcs=
interwork --depend=app\startup_stm32f407xx.d -oapp\startup_stm32f407xx.o -I.\RT
ARM Macro Assembler Page 14
E\_app -IC:\Users\h_zha\AppData\Local\Arm\Packs\ARM\CMSIS\5.8.0\CMSIS\Core\Incl
ude -IC:\Users\h_zha\AppData\Local\Arm\Packs\Keil\STM32F4xx_DFP\2.16.0\Drivers\
CMSIS\Device\ST\STM32F4xx\Include --predefine="__MICROLIB SETA 1" --predefine="
__UVISION_VERSION SETA 535" --predefine="_RTE_ SETA 1" --predefine="STM32F407xx
SETA 1" --predefine="_RTE_ SETA 1" --list=startup_stm32f407xx.lst startup_stm3
2f407xx.s
CMSIS\Device\ST\STM32F4xx\Include --predefine="__UVISION_VERSION SETA 535" --pr
edefine="_RTE_ SETA 1" --predefine="STM32F407xx SETA 1" --predefine="_RTE_ SETA
1" --list=startup_stm32f407xx.lst startup_stm32f407xx.s
@ -857,8 +874,9 @@ Symbol: Stack_Mem
Definitions
At line 35 in file startup_stm32f407xx.s
Uses
None
Comment: Stack_Mem unused
At line 413 in file startup_stm32f407xx.s
At line 415 in file startup_stm32f407xx.s
__initial_sp 00000400
Symbol: __initial_sp
@ -866,8 +884,7 @@ Symbol: __initial_sp
At line 36 in file startup_stm32f407xx.s
Uses
At line 60 in file startup_stm32f407xx.s
At line 401 in file startup_stm32f407xx.s
Comment: __initial_sp used once
3 symbols
@ -889,24 +906,25 @@ Symbol: Heap_Mem
Definitions
At line 47 in file startup_stm32f407xx.s
Uses
None
Comment: Heap_Mem unused
At line 412 in file startup_stm32f407xx.s
At line 414 in file startup_stm32f407xx.s
__heap_base 00000000
Symbol: __heap_base
Definitions
At line 46 in file startup_stm32f407xx.s
Uses
At line 402 in file startup_stm32f407xx.s
Comment: __heap_base used once
None
Comment: __heap_base unused
__heap_limit 00000400
Symbol: __heap_limit
Definitions
At line 48 in file startup_stm32f407xx.s
Uses
At line 403 in file startup_stm32f407xx.s
Comment: __heap_limit used once
None
Comment: __heap_limit unused
4 symbols
@ -1866,7 +1884,15 @@ Symbol: WWDG_IRQHandler
At line 78 in file startup_stm32f407xx.s
At line 226 in file startup_stm32f407xx.s
93 symbols
__user_initial_stackheap 0000001C
Symbol: __user_initial_stackheap
Definitions
At line 410 in file startup_stm32f407xx.s
Uses
At line 408 in file startup_stm32f407xx.s
Comment: __user_initial_stackheap used once
94 symbols
@ -1880,7 +1906,8 @@ Symbol: Heap_Size
At line 43 in file startup_stm32f407xx.s
Uses
At line 47 in file startup_stm32f407xx.s
Comment: Heap_Size used once
At line 414 in file startup_stm32f407xx.s
Stack_Size 00000400
Symbol: Stack_Size
@ -1888,7 +1915,8 @@ Symbol: Stack_Size
At line 32 in file startup_stm32f407xx.s
Uses
At line 35 in file startup_stm32f407xx.s
Comment: Stack_Size used once
At line 413 in file startup_stm32f407xx.s
__Vectors_Size 00000188
Symbol: __Vectors_Size
@ -1920,5 +1948,13 @@ Symbol: __main
Uses
At line 176 in file startup_stm32f407xx.s
Comment: __main used once
2 symbols
445 symbols in table
__use_two_region_memory 00000000
Symbol: __use_two_region_memory
Definitions
At line 407 in file startup_stm32f407xx.s
Uses
None
Comment: __use_two_region_memory unused
3 symbols
448 symbols in table

2
dep/libtrinamic

@ -1 +1 @@
Subproject commit f7be628b1f15b46f5dea445dd6f8c8ef81208115
Subproject commit a66eaf2a974dbd93497c167cab4d092f61f4f92a

9
src/umain.c

@ -6,6 +6,15 @@
#include "project_board.h"
#define TAG "main"
/**
* @brief libtrinamic
*
* @param channel
* @param data
* @param length
*/
// void libtrinamic_readWriteArray(uint8_t channel, uint8_t *data, size_t length) {}
int umain(int argc, char const *argv[]) {
sys_loggger_enable(true);

Loading…
Cancel
Save