Browse Source

project init

master
zhaohe 2 years ago
parent
commit
75c3edb6a8
  1. 3
      app/Core/Src/main.c
  2. 9
      app/MDK-ARM/EventRecorderStub.scvd
  3. 10
      app/MDK-ARM/app.uvprojx
  4. 93
      app/MDK-ARM/startup_stm32f103xb.lst
  5. 10
      src/umain.cpp
  6. 4
      src/umain.hpp

3
app/Core/Src/main.c

@ -99,7 +99,8 @@ int main(void)
while (1)
{
/* USER CODE END WHILE */
extern int umain(int argc, char const *argv[]) ;
umain(0,0);
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */

9
app/MDK-ARM/EventRecorderStub.scvd

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<component_viewer schemaVersion="0.1" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="Component_Viewer.xsd">
<component name="EventRecorderStub" version="1.0.0"/> <!--name and version of the component-->
<events>
</events>
</component_viewer>

10
app/MDK-ARM/app.uvprojx

@ -189,7 +189,7 @@
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
<useUlib>0</useUlib>
<useUlib>1</useUlib>
<EndSel>0</EndSel>
<uLtcg>0</uLtcg>
<nSecure>0</nSecure>
@ -313,7 +313,7 @@
</ArmAdsMisc>
<Cads>
<interw>1</interw>
<Optim>2</Optim>
<Optim>1</Optim>
<oTime>0</oTime>
<SplitLS>0</SplitLS>
<OneElfS>1</OneElfS>
@ -328,7 +328,7 @@
<uC99>1</uC99>
<uGnu>0</uGnu>
<useXO>0</useXO>
<v6Lang>5</v6Lang>
<v6Lang>3</v6Lang>
<v6LangP>3</v6LangP>
<vShortEn>1</vShortEn>
<vShortWch>1</vShortWch>
@ -746,8 +746,8 @@
<RTE>
<apis/>
<components>
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="4.3.0" condition="CMSIS Core">
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="4.5.0"/>
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.5.0" condition="ARMv6_7_8-M Device">
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.8.0"/>
<targetInfos>
<targetInfo name="app"/>
</targetInfos>

93
app/MDK-ARM/startup_stm32f103xb.lst

@ -214,9 +214,9 @@ ARM Macro Assembler Page 4
]
130 00000000 IMPORT __main
131 00000000 IMPORT SystemInit
132 00000000 4809 LDR R0, =SystemInit
132 00000000 4806 LDR R0, =SystemInit
133 00000002 4780 BLX R0
134 00000004 4809 LDR R0, =__main
134 00000004 4806 LDR R0, =__main
135 00000006 4700 BX R0
136 00000008 ENDP
137 00000008
@ -442,42 +442,30 @@ ARM Macro Assembler Page 7
280 0000001C ;*******************************************************
************************
281 0000001C IF :DEF:__MICROLIB
288 0000001C
289 0000001C IMPORT __use_two_region_memory
290 0000001C EXPORT __user_initial_stackheap
291 0000001C
292 0000001C __user_initial_stackheap
293 0000001C
294 0000001C 4804 LDR R0, = Heap_Mem
295 0000001E 4905 LDR R1, =(Stack_Mem + Stack_Size)
296 00000020 4A05 LDR R2, = (Heap_Mem + Heap_Size)
297 00000022 4B06 LDR R3, = Stack_Mem
298 00000024 4770 BX LR
282 0000001C
283 0000001C EXPORT __initial_sp
284 0000001C EXPORT __heap_base
285 0000001C EXPORT __heap_limit
286 0000001C
287 0000001C ELSE
302 ENDIF
303 0000001C
304 0000001C END
00000000
00000000
ARM Macro Assembler Page 8
299 00000026
300 00000026 00 00 ALIGN
301 00000028
302 00000028 ENDIF
303 00000028
304 00000028 END
00000000
00000000
00000000
00000400
00000200
00000000
Command Line: --debug --xref --diag_suppress=9931 --cpu=Cortex-M3 --apcs=interw
ork --depend=app\startup_stm32f103xb.d -oapp\startup_stm32f103xb.o -I.\RTE\_app
-IC:\Users\h_zha\AppData\Local\Arm\Packs\ARM\CMSIS\5.8.0\CMSIS\Core\Include -I
C:\Users\h_zha\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.4.0\Device\Include
--predefine="__UVISION_VERSION SETA 535" --predefine="_RTE_ SETA 1" --predefine
="STM32F10X_MD SETA 1" --predefine="_RTE_ SETA 1" --list=startup_stm32f103xb.ls
t startup_stm32f103xb.s
--predefine="__MICROLIB SETA 1" --predefine="__UVISION_VERSION SETA 535" --pred
efine="_RTE_ SETA 1" --predefine="STM32F10X_MD SETA 1" --predefine="_RTE_ SETA
1" --list=startup_stm32f103xb.lst startup_stm32f103xb.s
@ -498,9 +486,8 @@ Symbol: Stack_Mem
Definitions
At line 35 in file startup_stm32f103xb.s
Uses
At line 295 in file startup_stm32f103xb.s
At line 297 in file startup_stm32f103xb.s
None
Comment: Stack_Mem unused
__initial_sp 00000400
Symbol: __initial_sp
@ -508,7 +495,8 @@ Symbol: __initial_sp
At line 36 in file startup_stm32f103xb.s
Uses
At line 60 in file startup_stm32f103xb.s
Comment: __initial_sp used once
At line 283 in file startup_stm32f103xb.s
3 symbols
@ -530,25 +518,24 @@ Symbol: Heap_Mem
Definitions
At line 47 in file startup_stm32f103xb.s
Uses
At line 294 in file startup_stm32f103xb.s
At line 296 in file startup_stm32f103xb.s
None
Comment: Heap_Mem unused
__heap_base 00000000
Symbol: __heap_base
Definitions
At line 46 in file startup_stm32f103xb.s
Uses
None
Comment: __heap_base unused
At line 284 in file startup_stm32f103xb.s
Comment: __heap_base used once
__heap_limit 00000200
Symbol: __heap_limit
Definitions
At line 48 in file startup_stm32f103xb.s
Uses
None
Comment: __heap_limit unused
At line 285 in file startup_stm32f103xb.s
Comment: __heap_limit used once
4 symbols
@ -1130,15 +1117,7 @@ Symbol: WWDG_IRQHandler
At line 78 in file startup_stm32f103xb.s
At line 184 in file startup_stm32f103xb.s
__user_initial_stackheap 0000001C
Symbol: __user_initial_stackheap
Definitions
At line 292 in file startup_stm32f103xb.s
Uses
At line 290 in file startup_stm32f103xb.s
Comment: __user_initial_stackheap used once
56 symbols
55 symbols
@ -1152,8 +1131,7 @@ Symbol: Heap_Size
At line 43 in file startup_stm32f103xb.s
Uses
At line 47 in file startup_stm32f103xb.s
At line 296 in file startup_stm32f103xb.s
Comment: Heap_Size used once
Stack_Size 00000400
Symbol: Stack_Size
@ -1161,8 +1139,7 @@ Symbol: Stack_Size
At line 32 in file startup_stm32f103xb.s
Uses
At line 35 in file startup_stm32f103xb.s
At line 295 in file startup_stm32f103xb.s
Comment: Stack_Size used once
__Vectors_Size 000000EC
Symbol: __Vectors_Size
@ -1194,13 +1171,5 @@ Symbol: __main
Uses
At line 134 in file startup_stm32f103xb.s
Comment: __main used once
__use_two_region_memory 00000000
Symbol: __use_two_region_memory
Definitions
At line 289 in file startup_stm32f103xb.s
Uses
None
Comment: __use_two_region_memory unused
3 symbols
409 symbols in table
2 symbols
406 symbols in table

10
src/umain.cpp

@ -2,6 +2,7 @@
#include <limits.h>
#include <stdint.h>
#include "iwdg.h"
using namespace iflytop;
using namespace std;
@ -14,6 +15,14 @@ int random(int max) { return SysTick->VAL % max; }
/*******************************************************************************
* MAIN *
*******************************************************************************/
void Main::generateScheduleTicket() {
static uint32_t lastTicket = 0;
if (m_hardware.getTicket() != lastTicket) {
lastTicket = m_hardware.getTicket();
m_ticket++;
}
}
void Main::main(int argc, char const *argv[]) {
sys_loggger_enable(true);
ZLOGI(TAG, "setup")
@ -23,5 +32,6 @@ void Main::main(int argc, char const *argv[]) {
while (true) {
m_hardware.periodicJob();
m_hardware.debug_light_periodicJob();
HAL_IWDG_Refresh(&hiwdg);
}
}

4
src/umain.hpp

@ -29,11 +29,13 @@ namespace iflytop {
class Main {
public:
Hardware m_hardware;
int32_t m_ticket; // 保证一个数一个数的递增,但不保证时间准确
Main() {}
void main(int argc, char const *argv[]);
public:
private:
void generateScheduleTicket();
};
} // namespace iflytop

Loading…
Cancel
Save