mirror of
https://github.com/GorgonMeducer/perf_counter.git
synced 2025-01-31 19:33:04 +08:00
Merge branch 'CMSIS-Pack'
This commit is contained in:
commit
1e2c473d3b
@ -16,7 +16,11 @@
|
||||
<repository type="git">https://github.com/GorgonMeducer/perf_counter.git</repository>
|
||||
|
||||
<releases>
|
||||
<release date="2022-11-01" version="1.9.10" url="https://raw.githubusercontent.com/GorgonMeducer/perf_counter/CMSIS-Pack/cmsis-pack/GorgonMeducer.perf_counter.1.9.10.pack">
|
||||
<release date="2022-11-01" version="1.9.11" url="https://raw.githubusercontent.com/GorgonMeducer/perf_counter/CMSIS-Pack/cmsis-pack/GorgonMeducer.perf_counter.1.9.11.pack">
|
||||
- Fix the source variant support for Armv8-M processors
|
||||
- Other minor fixes
|
||||
</release>
|
||||
<release date="2022-11-01" version="1.9.10" url="https://github.com/GorgonMeducer/perf_counter/raw/1115e60d61940b7da833c841d2f4e1bbbcb22793/cmsis-pack/GorgonMeducer.perf_counter.1.9.10.pack">
|
||||
- Fix the support for RT-Thread
|
||||
</release>
|
||||
<release date="2022-09-26" version="1.9.9a" url="https://github.com/GorgonMeducer/perf_counter/raw/77134b23f9259e3ec4215eb30096c3474ed1d01d/cmsis-pack/GorgonMeducer.perf_counter.1.9.9a.pack">
|
||||
@ -85,27 +89,37 @@
|
||||
<description>GNU Tools for Arm Embedded Processors.</description>
|
||||
<accept Tcompiler="GCC"/>
|
||||
</condition>
|
||||
<condition id="Cortex-M Processors">
|
||||
<description>Support All Cortex-M based processors</description>
|
||||
|
||||
|
||||
<condition id="Armv8-M Processors">
|
||||
<accept Dcore="ARMV8MBL"/>
|
||||
<accept Dcore="ARMV8MML"/>
|
||||
<accept Dcore="ARMV81MML"/>
|
||||
<accept Dcore="Star-MC1"/>
|
||||
<accept Dcore="Cortex-M23"/>
|
||||
<accept Dcore="Cortex-M33"/>
|
||||
<accept Dcore="Cortex-M35P"/>
|
||||
<accept Dcore="Cortex-M55"/>
|
||||
<accept Dcore="Cortex-M85"/>
|
||||
</condition>
|
||||
|
||||
<condition id="Previous Generation Cortex-M Processors">
|
||||
<accept Dcore="Cortex-M0"/>
|
||||
<accept Dcore="Cortex-M0+"/>
|
||||
<accept Dcore="Cortex-M1"/>
|
||||
<accept Dcore="Cortex-M3"/>
|
||||
<accept Dcore="Cortex-M4"/>
|
||||
<accept Dcore="Cortex-M7"/>
|
||||
<accept Dcore="Cortex-M23"/>
|
||||
<accept Dcore="Cortex-M33"/>
|
||||
<accept Dcore="Cortex-M35P"/>
|
||||
<accept Dcore="Cortex-M55"/>
|
||||
<accept Dcore="Cortex-M85"/>
|
||||
<accept Dcore="Star-MC1"/>
|
||||
<accept Dcore="SC000"/>
|
||||
<accept Dcore="SC300"/>
|
||||
<accept Dcore="ARMV8MBL"/>
|
||||
<accept Dcore="ARMV8MML"/>
|
||||
<accept Dcore="ARMV81MML"/>
|
||||
</condition>
|
||||
|
||||
|
||||
<condition id="Cortex-M Processors">
|
||||
<description>Support All Cortex-M based processors</description>
|
||||
<accept condition="Previous Generation Cortex-M Processors"/>
|
||||
<accept condition="Armv8-M Processors"/>
|
||||
</condition>
|
||||
|
||||
<condition id="CMSIS-CORE">
|
||||
<description>Require CMSIS-CORE Support</description>
|
||||
<require Cclass="CMSIS" Cgroup="CORE"/>
|
||||
@ -139,6 +153,18 @@
|
||||
<require condition="Cortex-M Processors"/>
|
||||
</condition>
|
||||
|
||||
<condition id="Previous Generation Cortex-M Arm Compiler">
|
||||
<description>Compile Cortex-M Processors with GNU Tools for Arm Embedded Processors.</description>
|
||||
<require condition="Arm Compiler"/>
|
||||
<require condition="Previous Generation Cortex-M Processors"/>
|
||||
</condition>
|
||||
|
||||
<condition id="Armv8-M Arm Compiler">
|
||||
<description>Compile Cortex-M Processors with GNU Tools for Arm Embedded Processors.</description>
|
||||
<require condition="Arm Compiler"/>
|
||||
<require condition="Armv8-M Processors"/>
|
||||
</condition>
|
||||
|
||||
<condition id="Cortex-M Arm GCC CMSIS-CORE">
|
||||
<description>Compile Cortex-M Processors with GNU Tools for Arm Embedded Processors.</description>
|
||||
<require condition="Arm GCC"/>
|
||||
@ -152,6 +178,19 @@
|
||||
<require condition="CMSIS-CORE"/>
|
||||
</condition>
|
||||
|
||||
<condition id="Previous Generation Cortex-M Arm Compiler CMSIS-CORE">
|
||||
<description>Compile Cortex-M Processors with GNU Tools for Arm Embedded Processors.</description>
|
||||
<require condition="Arm Compiler"/>
|
||||
<require condition="Previous Generation Cortex-M Processors"/>
|
||||
<require condition="CMSIS-CORE"/>
|
||||
</condition>
|
||||
<condition id="Armv8-M Arm Compiler CMSIS-CORE">
|
||||
<description>Compile Cortex-M Processors with GNU Tools for Arm Embedded Processors.</description>
|
||||
<require condition="Arm Compiler"/>
|
||||
<require condition="Armv8-M Processors"/>
|
||||
<require condition="CMSIS-CORE"/>
|
||||
</condition>
|
||||
|
||||
|
||||
</conditions>
|
||||
<!-- apis section (optional - for Application Programming Interface descriptions) -->
|
||||
@ -185,7 +224,7 @@
|
||||
-->
|
||||
|
||||
<components>
|
||||
<bundle Cbundle="Performance Counter" Cclass="Utilities" Cversion="1.9.9a">
|
||||
<bundle Cbundle="Performance Counter" Cclass="Utilities" Cversion="1.9.11">
|
||||
<description>A dedicated performance counter for Cortex-M systick.</description>
|
||||
<doc>documents/Doxygen/html/index.html</doc>
|
||||
<component Cgroup="perf_counter" Csub="Core" Cvariant="Library" isDefaultVariant="true" condition="CMSIS-CORE">
|
||||
@ -211,8 +250,9 @@
|
||||
<files>
|
||||
<file category="header" name="lib/perf_counter.h"/>
|
||||
<file category="source" name="perf_counter.c" />
|
||||
<file category="source" name="systick_wrapper_ual.s" condition="Cortex-M Arm Compiler CMSIS-CORE"/>
|
||||
<file category="source" name="systick_wrapper_ual.s" condition="Previous Generation Cortex-M Arm Compiler CMSIS-CORE"/>
|
||||
<file category="source" name="systick_wrapper_gcc.s" condition="Cortex-M Arm GCC CMSIS-CORE"/>
|
||||
<file category="source" name="systick_wrapper_gnu.s" condition="Armv8-M Arm Compiler CMSIS-CORE"/>
|
||||
</files>
|
||||
<RTE_Components_h>
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# perf_counter (v1.9.9)
|
||||
# perf_counter (v1.9.11)
|
||||
A dedicated performance counter for Cortex-M Systick. It shares the SysTick with users' original SysTick function(s) without interfering with it. This library will bring new functionalities, such as performance counter,` delay_us` and `clock()` service defined in `time.h`.
|
||||
|
||||
### Features:
|
||||
|
Binary file not shown.
@ -16,7 +16,11 @@
|
||||
<repository type="git">https://github.com/GorgonMeducer/perf_counter.git</repository>
|
||||
|
||||
<releases>
|
||||
<release date="2022-11-01" version="1.9.10" url="https://raw.githubusercontent.com/GorgonMeducer/perf_counter/CMSIS-Pack/cmsis-pack/GorgonMeducer.perf_counter.1.9.10.pack">
|
||||
<release date="2022-11-01" version="1.9.11" url="https://raw.githubusercontent.com/GorgonMeducer/perf_counter/CMSIS-Pack/cmsis-pack/GorgonMeducer.perf_counter.1.9.11.pack">
|
||||
- Fix the source variant support for Armv8-M processors
|
||||
- Other minor fixes
|
||||
</release>
|
||||
<release date="2022-11-01" version="1.9.10" url="https://github.com/GorgonMeducer/perf_counter/raw/1115e60d61940b7da833c841d2f4e1bbbcb22793/cmsis-pack/GorgonMeducer.perf_counter.1.9.10.pack">
|
||||
- Fix the support for RT-Thread
|
||||
</release>
|
||||
<release date="2022-09-26" version="1.9.9a" url="https://github.com/GorgonMeducer/perf_counter/raw/77134b23f9259e3ec4215eb30096c3474ed1d01d/cmsis-pack/GorgonMeducer.perf_counter.1.9.9a.pack">
|
||||
@ -85,27 +89,37 @@
|
||||
<description>GNU Tools for Arm Embedded Processors.</description>
|
||||
<accept Tcompiler="GCC"/>
|
||||
</condition>
|
||||
<condition id="Cortex-M Processors">
|
||||
<description>Support All Cortex-M based processors</description>
|
||||
|
||||
|
||||
<condition id="Armv8-M Processors">
|
||||
<accept Dcore="ARMV8MBL"/>
|
||||
<accept Dcore="ARMV8MML"/>
|
||||
<accept Dcore="ARMV81MML"/>
|
||||
<accept Dcore="Star-MC1"/>
|
||||
<accept Dcore="Cortex-M23"/>
|
||||
<accept Dcore="Cortex-M33"/>
|
||||
<accept Dcore="Cortex-M35P"/>
|
||||
<accept Dcore="Cortex-M55"/>
|
||||
<accept Dcore="Cortex-M85"/>
|
||||
</condition>
|
||||
|
||||
<condition id="Previous Generation Cortex-M Processors">
|
||||
<accept Dcore="Cortex-M0"/>
|
||||
<accept Dcore="Cortex-M0+"/>
|
||||
<accept Dcore="Cortex-M1"/>
|
||||
<accept Dcore="Cortex-M3"/>
|
||||
<accept Dcore="Cortex-M4"/>
|
||||
<accept Dcore="Cortex-M7"/>
|
||||
<accept Dcore="Cortex-M23"/>
|
||||
<accept Dcore="Cortex-M33"/>
|
||||
<accept Dcore="Cortex-M35P"/>
|
||||
<accept Dcore="Cortex-M55"/>
|
||||
<accept Dcore="Cortex-M85"/>
|
||||
<accept Dcore="Star-MC1"/>
|
||||
<accept Dcore="SC000"/>
|
||||
<accept Dcore="SC300"/>
|
||||
<accept Dcore="ARMV8MBL"/>
|
||||
<accept Dcore="ARMV8MML"/>
|
||||
<accept Dcore="ARMV81MML"/>
|
||||
</condition>
|
||||
|
||||
|
||||
<condition id="Cortex-M Processors">
|
||||
<description>Support All Cortex-M based processors</description>
|
||||
<accept condition="Previous Generation Cortex-M Processors"/>
|
||||
<accept condition="Armv8-M Processors"/>
|
||||
</condition>
|
||||
|
||||
<condition id="CMSIS-CORE">
|
||||
<description>Require CMSIS-CORE Support</description>
|
||||
<require Cclass="CMSIS" Cgroup="CORE"/>
|
||||
@ -139,6 +153,18 @@
|
||||
<require condition="Cortex-M Processors"/>
|
||||
</condition>
|
||||
|
||||
<condition id="Previous Generation Cortex-M Arm Compiler">
|
||||
<description>Compile Cortex-M Processors with GNU Tools for Arm Embedded Processors.</description>
|
||||
<require condition="Arm Compiler"/>
|
||||
<require condition="Previous Generation Cortex-M Processors"/>
|
||||
</condition>
|
||||
|
||||
<condition id="Armv8-M Arm Compiler">
|
||||
<description>Compile Cortex-M Processors with GNU Tools for Arm Embedded Processors.</description>
|
||||
<require condition="Arm Compiler"/>
|
||||
<require condition="Armv8-M Processors"/>
|
||||
</condition>
|
||||
|
||||
<condition id="Cortex-M Arm GCC CMSIS-CORE">
|
||||
<description>Compile Cortex-M Processors with GNU Tools for Arm Embedded Processors.</description>
|
||||
<require condition="Arm GCC"/>
|
||||
@ -152,6 +178,19 @@
|
||||
<require condition="CMSIS-CORE"/>
|
||||
</condition>
|
||||
|
||||
<condition id="Previous Generation Cortex-M Arm Compiler CMSIS-CORE">
|
||||
<description>Compile Cortex-M Processors with GNU Tools for Arm Embedded Processors.</description>
|
||||
<require condition="Arm Compiler"/>
|
||||
<require condition="Previous Generation Cortex-M Processors"/>
|
||||
<require condition="CMSIS-CORE"/>
|
||||
</condition>
|
||||
<condition id="Armv8-M Arm Compiler CMSIS-CORE">
|
||||
<description>Compile Cortex-M Processors with GNU Tools for Arm Embedded Processors.</description>
|
||||
<require condition="Arm Compiler"/>
|
||||
<require condition="Armv8-M Processors"/>
|
||||
<require condition="CMSIS-CORE"/>
|
||||
</condition>
|
||||
|
||||
|
||||
</conditions>
|
||||
<!-- apis section (optional - for Application Programming Interface descriptions) -->
|
||||
@ -185,7 +224,7 @@
|
||||
-->
|
||||
|
||||
<components>
|
||||
<bundle Cbundle="Performance Counter" Cclass="Utilities" Cversion="1.9.9a">
|
||||
<bundle Cbundle="Performance Counter" Cclass="Utilities" Cversion="1.9.11">
|
||||
<description>A dedicated performance counter for Cortex-M systick.</description>
|
||||
<doc>documents/Doxygen/html/index.html</doc>
|
||||
<component Cgroup="perf_counter" Csub="Core" Cvariant="Library" isDefaultVariant="true" condition="CMSIS-CORE">
|
||||
@ -211,8 +250,9 @@
|
||||
<files>
|
||||
<file category="header" name="lib/perf_counter.h"/>
|
||||
<file category="source" name="perf_counter.c" />
|
||||
<file category="source" name="systick_wrapper_ual.s" condition="Cortex-M Arm Compiler CMSIS-CORE"/>
|
||||
<file category="source" name="systick_wrapper_ual.s" condition="Previous Generation Cortex-M Arm Compiler CMSIS-CORE"/>
|
||||
<file category="source" name="systick_wrapper_gcc.s" condition="Cortex-M Arm GCC CMSIS-CORE"/>
|
||||
<file category="source" name="systick_wrapper_gnu.s" condition="Armv8-M Arm Compiler CMSIS-CORE"/>
|
||||
</files>
|
||||
<RTE_Components_h>
|
||||
|
||||
|
@ -1 +0,0 @@
|
||||
"C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021-07\bin\arm-none-eabi-ar" -M <ArInp.Scr
|
@ -1,15 +0,0 @@
|
||||
; *************************************************************
|
||||
; *** Scatter-Loading Description File generated by uVision ***
|
||||
; *************************************************************
|
||||
|
||||
LR_IROM1 0x00000000 0x00400000 { ; load region size_region
|
||||
ER_IROM1 +0 0x00400000 { ; load address = execution address
|
||||
*.o (RESET, +First)
|
||||
*(InRoot$$Sections)
|
||||
.ANY (+RO)
|
||||
.ANY (+XO)
|
||||
}
|
||||
RW_IRAM1 0x20000000 0x00400000 { ; RW data
|
||||
* (+RW +ZI)
|
||||
}
|
||||
}
|
@ -30,26 +30,26 @@
|
||||
; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
;</h>
|
||||
|
||||
Stack_Size EQU 0x00000400
|
||||
;Stack_Size EQU 0x00000400
|
||||
|
||||
AREA STACK, NOINIT, READWRITE, ALIGN=3
|
||||
__stack_limit
|
||||
Stack_Mem SPACE Stack_Size
|
||||
__initial_sp
|
||||
; AREA STACK, NOINIT, READWRITE, ALIGN=3
|
||||
;__stack_limit
|
||||
;Stack_Mem SPACE Stack_Size
|
||||
;__initial_sp
|
||||
|
||||
|
||||
;<h> Heap Configuration
|
||||
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
;</h>
|
||||
;;<h> Heap Configuration
|
||||
;; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
;;</h>
|
||||
|
||||
Heap_Size EQU 0x00000C00
|
||||
;Heap_Size EQU 0x00000C00
|
||||
|
||||
IF Heap_Size != 0 ; Heap is provided
|
||||
AREA HEAP, NOINIT, READWRITE, ALIGN=3
|
||||
__heap_base
|
||||
Heap_Mem SPACE Heap_Size
|
||||
__heap_limit
|
||||
ENDIF
|
||||
; IF Heap_Size != 0 ; Heap is provided
|
||||
; AREA HEAP, NOINIT, READWRITE, ALIGN=3
|
||||
;__heap_base
|
||||
;Heap_Mem SPACE Heap_Size
|
||||
;__heap_limit
|
||||
; ENDIF
|
||||
|
||||
|
||||
PRESERVE8
|
||||
@ -62,8 +62,9 @@ __heap_limit
|
||||
EXPORT __Vectors
|
||||
EXPORT __Vectors_End
|
||||
EXPORT __Vectors_Size
|
||||
|
||||
__Vectors DCD __initial_sp ; Top of Stack
|
||||
IMPORT |Image$$ARM_LIB_STACK$$ZI$$Limit|
|
||||
|
||||
__Vectors DCD |Image$$ARM_LIB_STACK$$ZI$$Limit| ; Top of Stack
|
||||
DCD Reset_Handler ; Reset Handler
|
||||
DCD NMI_Handler ; -14 NMI Handler
|
||||
DCD HardFault_Handler ; -13 Hard Fault Handler
|
||||
@ -154,15 +155,15 @@ $Handler_Name PROC
|
||||
|
||||
; User setup Stack & Heap
|
||||
|
||||
IF :LNOT::DEF:__MICROLIB
|
||||
IMPORT __use_two_region_memory
|
||||
ENDIF
|
||||
; IF :LNOT::DEF:__MICROLIB
|
||||
; IMPORT __use_two_region_memory
|
||||
; ENDIF
|
||||
|
||||
EXPORT __stack_limit
|
||||
EXPORT __initial_sp
|
||||
IF Heap_Size != 0 ; Heap is provided
|
||||
EXPORT __heap_base
|
||||
EXPORT __heap_limit
|
||||
ENDIF
|
||||
; EXPORT __stack_limit
|
||||
; EXPORT __initial_sp
|
||||
; IF Heap_Size != 0 ; Heap is provided
|
||||
; EXPORT __heap_base
|
||||
; EXPORT __heap_limit
|
||||
; ENDIF
|
||||
|
||||
END
|
||||
|
36
example/example.sct
Normal file
36
example/example.sct
Normal file
@ -0,0 +1,36 @@
|
||||
#! armclang --target=arm-arm-none-eabi -mcpu=cortex-m0 -E -xc
|
||||
; *************************************************************
|
||||
; *** Scatter-Loading Description File generated by uVision ***
|
||||
; *************************************************************
|
||||
|
||||
|
||||
#define RAM1_SIZE 0x00020000
|
||||
#define RAM1_BASE 0x20000000
|
||||
#define RAM1_LIMIT (RAM1_BASE + RAM1_SIZE)
|
||||
|
||||
#define STACK_SIZE 0x800
|
||||
|
||||
#define HEAP_ALIGN 8
|
||||
#define HEAP_SIZE (RAM1_LIMIT - AlignExpr(ImageLimit(RW_IRAM1), HEAP_ALIGN))
|
||||
|
||||
|
||||
LR_IROM1 0x00000000 0x00040000 { ; load region size_region
|
||||
ER_IROM1 0x00000000 0x00040000 { ; load address = execution address
|
||||
*.o (RESET, +First)
|
||||
*(InRoot$$Sections)
|
||||
.ANY (+RO)
|
||||
.ANY (+XO)
|
||||
}
|
||||
|
||||
ARM_LIB_STACK RAM1_BASE ALIGN 8 EMPTY FILL 0xDEADBEEF STACK_SIZE {}
|
||||
|
||||
RW_IRAM1 +0 { ; RW data
|
||||
.ANY (+RW +ZI)
|
||||
}
|
||||
|
||||
ARM_LIB_HEAP +0 ALIGN HEAP_ALIGN EMPTY HEAP_SIZE {}
|
||||
|
||||
ScatterAssert(ImageLimit(ARM_LIB_HEAP) <= RAM1_LIMIT)
|
||||
}
|
||||
|
||||
|
@ -165,7 +165,7 @@
|
||||
<Mm>
|
||||
<WinNumber>1</WinNumber>
|
||||
<SubType>1</SubType>
|
||||
<ItemText>0x00</ItemText>
|
||||
<ItemText>0x20000000</ItemText>
|
||||
<AccSizeX>0</AccSizeX>
|
||||
</Mm>
|
||||
</MemoryWindow1>
|
||||
@ -364,54 +364,6 @@
|
||||
<Bp>
|
||||
<Number>0</Number>
|
||||
<Type>0</Type>
|
||||
<LineNumber>94</LineNumber>
|
||||
<EnabledFlag>1</EnabledFlag>
|
||||
<Address>0</Address>
|
||||
<ByteObject>0</ByteObject>
|
||||
<HtxType>0</HtxType>
|
||||
<ManyObjects>0</ManyObjects>
|
||||
<SizeOfObject>0</SizeOfObject>
|
||||
<BreakByAccess>0</BreakByAccess>
|
||||
<BreakIfRCount>0</BreakIfRCount>
|
||||
<Filename><1>.\main.c</Filename>
|
||||
<ExecCommand></ExecCommand>
|
||||
<Expression></Expression>
|
||||
</Bp>
|
||||
<Bp>
|
||||
<Number>1</Number>
|
||||
<Type>0</Type>
|
||||
<LineNumber>93</LineNumber>
|
||||
<EnabledFlag>1</EnabledFlag>
|
||||
<Address>0</Address>
|
||||
<ByteObject>0</ByteObject>
|
||||
<HtxType>0</HtxType>
|
||||
<ManyObjects>0</ManyObjects>
|
||||
<SizeOfObject>0</SizeOfObject>
|
||||
<BreakByAccess>0</BreakByAccess>
|
||||
<BreakIfRCount>0</BreakIfRCount>
|
||||
<Filename><1>.\main.c</Filename>
|
||||
<ExecCommand></ExecCommand>
|
||||
<Expression></Expression>
|
||||
</Bp>
|
||||
<Bp>
|
||||
<Number>2</Number>
|
||||
<Type>0</Type>
|
||||
<LineNumber>92</LineNumber>
|
||||
<EnabledFlag>1</EnabledFlag>
|
||||
<Address>0</Address>
|
||||
<ByteObject>0</ByteObject>
|
||||
<HtxType>0</HtxType>
|
||||
<ManyObjects>0</ManyObjects>
|
||||
<SizeOfObject>0</SizeOfObject>
|
||||
<BreakByAccess>0</BreakByAccess>
|
||||
<BreakIfRCount>0</BreakIfRCount>
|
||||
<Filename><1>.\main.c</Filename>
|
||||
<ExecCommand></ExecCommand>
|
||||
<Expression></Expression>
|
||||
</Bp>
|
||||
<Bp>
|
||||
<Number>3</Number>
|
||||
<Type>0</Type>
|
||||
<LineNumber>62</LineNumber>
|
||||
<EnabledFlag>1</EnabledFlag>
|
||||
<Address>0</Address>
|
||||
@ -741,7 +693,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>application</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@ -849,7 +801,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>::Compiler</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<TargetName>example_arm_compiler_6</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>6180000::V6.18::ARMCLANG</pCCUsed>
|
||||
<pCCUsed>6190000::V6.19::ARMCLANG</pCCUsed>
|
||||
<uAC6>1</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
@ -52,7 +52,7 @@
|
||||
<OutputName>example</OutputName>
|
||||
<CreateExecutable>1</CreateExecutable>
|
||||
<CreateLib>0</CreateLib>
|
||||
<CreateHexFile>0</CreateHexFile>
|
||||
<CreateHexFile>1</CreateHexFile>
|
||||
<DebugInformation>1</DebugInformation>
|
||||
<BrowseInformation>1</BrowseInformation>
|
||||
<ListingPath>.\</ListingPath>
|
||||
@ -190,7 +190,7 @@
|
||||
<hadIRAM2>0</hadIRAM2>
|
||||
<hadIROM2>0</hadIROM2>
|
||||
<StupSel>8</StupSel>
|
||||
<useUlib>1</useUlib>
|
||||
<useUlib>0</useUlib>
|
||||
<EndSel>1</EndSel>
|
||||
<uLtcg>0</uLtcg>
|
||||
<nSecure>0</nSecure>
|
||||
@ -337,7 +337,7 @@
|
||||
<v6WtE>0</v6WtE>
|
||||
<v6Rtti>0</v6Rtti>
|
||||
<VariousControls>
|
||||
<MiscControls>-Wno-missing-prototypes -Wno-reserved-identifier -Wno-sign-conversion -Wno-c11-extensions -Wno-implicit-int-conversion</MiscControls>
|
||||
<MiscControls>-Wno-missing-prototypes -Wno-reserved-identifier -Wno-sign-conversion -Wno-c11-extensions -Wno-implicit-int-conversion -Wno-invalid-utf8</MiscControls>
|
||||
<Define>__PERF_COUNTER_CFG_USE_SYSTICK_WRAPPER__</Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath>..</IncludePath>
|
||||
@ -371,7 +371,7 @@
|
||||
<TextAddressRange></TextAddressRange>
|
||||
<DataAddressRange></DataAddressRange>
|
||||
<pXoBase></pXoBase>
|
||||
<ScatterFile>Blinky.sct</ScatterFile>
|
||||
<ScatterFile>example.sct</ScatterFile>
|
||||
<IncludeLibs></IncludeLibs>
|
||||
<IncludeLibsPath></IncludeLibsPath>
|
||||
<Misc></Misc>
|
||||
@ -530,7 +530,7 @@
|
||||
<TargetName>library</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>6180000::V6.18::ARMCLANG</pCCUsed>
|
||||
<pCCUsed>6190000::V6.19::ARMCLANG</pCCUsed>
|
||||
<uAC6>1</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
@ -1548,7 +1548,7 @@
|
||||
<TextAddressRange></TextAddressRange>
|
||||
<DataAddressRange></DataAddressRange>
|
||||
<pXoBase></pXoBase>
|
||||
<ScatterFile>Blinky.sct</ScatterFile>
|
||||
<ScatterFile>.\example.sct</ScatterFile>
|
||||
<IncludeLibs></IncludeLibs>
|
||||
<IncludeLibsPath></IncludeLibsPath>
|
||||
<Misc></Misc>
|
||||
|
@ -62,6 +62,66 @@ static example_lv0_t s_tItem[8] = {
|
||||
{.chID = 6},
|
||||
{.chID = 7},
|
||||
};
|
||||
#if __IS_COMPILER_ARM_COMPILER__
|
||||
#if defined(__clang__)
|
||||
# pragma clang diagnostic push
|
||||
# pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"
|
||||
# pragma clang diagnostic ignored "-Wdouble-promotion"
|
||||
#endif
|
||||
uint32_t calculate_stack_usage_topdown(void)
|
||||
{
|
||||
extern uint32_t Image$$ARM_LIB_STACK$$Limit[];
|
||||
extern uint32_t Image$$ARM_LIB_STACK$$Length;
|
||||
|
||||
uint32_t *pwStack = Image$$ARM_LIB_STACK$$Limit;
|
||||
uint32_t wStackSize = (uintptr_t)&Image$$ARM_LIB_STACK$$Length / 4;
|
||||
uint32_t wStackUsed = 0;
|
||||
|
||||
|
||||
do {
|
||||
if (*--pwStack == 0xDEADBEEF) {
|
||||
break;
|
||||
}
|
||||
wStackUsed++;
|
||||
} while(--wStackSize);
|
||||
|
||||
|
||||
printf("\r\nStack Usage: [%d/%d] %2.2f%%\r\n",
|
||||
wStackUsed * 4,
|
||||
(uintptr_t)&Image$$ARM_LIB_STACK$$Length,
|
||||
( (float)wStackUsed * 400.0f
|
||||
/ (float)(uintptr_t)&Image$$ARM_LIB_STACK$$Length));
|
||||
|
||||
return wStackUsed * 4;
|
||||
}
|
||||
|
||||
uint32_t calculate_stack_usage_bottomup(void)
|
||||
{
|
||||
extern uint32_t Image$$ARM_LIB_STACK$$Base[];
|
||||
extern uint32_t Image$$ARM_LIB_STACK$$Length;
|
||||
|
||||
uint32_t *pwStack = Image$$ARM_LIB_STACK$$Base;
|
||||
uint32_t wStackSize = (uintptr_t)&Image$$ARM_LIB_STACK$$Length;
|
||||
uint32_t wStackUsed = wStackSize / 4;
|
||||
|
||||
do {
|
||||
if (*pwStack++ != 0xDEADBEEF) {
|
||||
break;
|
||||
}
|
||||
} while(--wStackUsed);
|
||||
|
||||
printf("\r\nStack Usage: [%d/%d] %2.2f%%\r\n",
|
||||
wStackUsed * 4,
|
||||
wStackSize,
|
||||
( (float)wStackUsed * 400.0f / (float)wStackSize));
|
||||
|
||||
return wStackUsed * 4;
|
||||
}
|
||||
|
||||
#if defined(__clang__)
|
||||
# pragma clang diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Main function
|
||||
@ -120,6 +180,11 @@ int main (void)
|
||||
printf("used clock cycle: %d", (int32_t)(get_system_ticks() - tStart));
|
||||
} while(0);
|
||||
|
||||
#if __IS_COMPILER_ARM_COMPILER__
|
||||
calculate_stack_usage_topdown();
|
||||
calculate_stack_usage_bottomup();
|
||||
#endif
|
||||
|
||||
while (1) {
|
||||
printf("\r\nhello world\r\n");
|
||||
delay_ms(1000);
|
||||
|
@ -54,6 +54,7 @@ PACK_BASE_FILES="
|
||||
perf_counter.c
|
||||
perf_counter.h
|
||||
systick_wrapper_gcc.s
|
||||
systick_wrapper_gnu.s
|
||||
systick_wrapper_ual.s
|
||||
LICENSE
|
||||
README.md
|
||||
|
@ -35,9 +35,9 @@ extern "C" {
|
||||
*/
|
||||
#define __PERF_COUNTER_VER_MAJOR__ 1
|
||||
#define __PERF_COUNTER_VER_MINOR__ 9
|
||||
#define __PERF_COUNTER_VER_REVISE__ 10
|
||||
#define __PERF_COUNTER_VER_REVISE__ 11
|
||||
|
||||
#define __PERF_COUNTER_VER_STR__ "dev"
|
||||
#define __PERF_COUNTER_VER_STR__ ""
|
||||
|
||||
#define __PER_COUNTER_VER__ (__PERF_COUNTER_VER_MAJOR__ * 10000ul \
|
||||
+__PERF_COUNTER_VER_MINOR__ * 100ul \
|
||||
@ -285,7 +285,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#if __PLOOC_VA_NUM_ARGS() != 0
|
||||
#warning Please enable GNC extensions, it is required by __cycleof__() and \
|
||||
#warning Please enable GNU extensions, it is required by __cycleof__() and \
|
||||
__super_loop_monitor__()
|
||||
#endif
|
||||
|
||||
@ -472,9 +472,6 @@ __attribute__((noinline))
|
||||
extern int64_t clock(void);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/*! @} */
|
||||
|
||||
/*!
|
||||
@ -607,7 +604,6 @@ extern int64_t __stop_task_cycle_counter(task_cycle_info_t *ptInfo);
|
||||
* special conditions *
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
/*! \brief initialise cycle counter service
|
||||
* \note - don't forget to tell the function whether the systick is already
|
||||
* used by user applications.
|
||||
|
Binary file not shown.
@ -35,9 +35,9 @@ extern "C" {
|
||||
*/
|
||||
#define __PERF_COUNTER_VER_MAJOR__ 1
|
||||
#define __PERF_COUNTER_VER_MINOR__ 9
|
||||
#define __PERF_COUNTER_VER_REVISE__ 10
|
||||
#define __PERF_COUNTER_VER_REVISE__ 11
|
||||
|
||||
#define __PERF_COUNTER_VER_STR__ "dev"
|
||||
#define __PERF_COUNTER_VER_STR__ ""
|
||||
|
||||
#define __PER_COUNTER_VER__ (__PERF_COUNTER_VER_MAJOR__ * 10000ul \
|
||||
+__PERF_COUNTER_VER_MINOR__ * 100ul \
|
||||
@ -285,7 +285,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#if __PLOOC_VA_NUM_ARGS() != 0
|
||||
#warning Please enable GNC extensions, it is required by __cycleof__() and \
|
||||
#warning Please enable GNU extensions, it is required by __cycleof__() and \
|
||||
__super_loop_monitor__()
|
||||
#endif
|
||||
|
||||
@ -472,9 +472,6 @@ __attribute__((noinline))
|
||||
extern int64_t clock(void);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/*! @} */
|
||||
|
||||
/*!
|
||||
@ -607,7 +604,6 @@ extern int64_t __stop_task_cycle_counter(task_cycle_info_t *ptInfo);
|
||||
* special conditions *
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
/*! \brief initialise cycle counter service
|
||||
* \note - don't forget to tell the function whether the systick is already
|
||||
* used by user applications.
|
||||
|
47
systick_wrapper_gnu.s
Normal file
47
systick_wrapper_gnu.s
Normal file
@ -0,0 +1,47 @@
|
||||
;/****************************************************************************
|
||||
;* Copyright 2022 Gorgon Meducer (Email:embedded_zhuoran@hotmail.com) *
|
||||
;* *
|
||||
;* Licensed under the Apache License, Version 2.0 (the "License"); *
|
||||
;* you may not use this file except in compliance with the License. *
|
||||
;* You may obtain a copy of the License at *
|
||||
;* *
|
||||
;* http://www.apache.org/licenses/LICENSE-2.0 *
|
||||
;* *
|
||||
;* Unless required by applicable law or agreed to in writing, software *
|
||||
;* distributed under the License is distributed on an "AS IS" BASIS, *
|
||||
;* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
|
||||
;* See the License for the specific language governing permissions and *
|
||||
;* limitations under the License. *
|
||||
;* *
|
||||
;****************************************************************************/
|
||||
|
||||
|
||||
.syntax unified
|
||||
.arch armv6-m
|
||||
|
||||
|
||||
.eabi_attribute Tag_ABI_align_preserved, 1
|
||||
.text
|
||||
.thumb
|
||||
.thumb_func
|
||||
.align 2
|
||||
.globl $Sub$$SysTick_Handler
|
||||
.type $Sub$$SysTick_Handler, %function
|
||||
|
||||
$Sub$$SysTick_Handler:
|
||||
push {r4, r5}
|
||||
push {r4, lr}
|
||||
ldr R0, =user_code_insert_to_systick_handler
|
||||
blx R0
|
||||
pop {r4, r5}
|
||||
mov lr, r5
|
||||
pop {r4, r5}
|
||||
ldr R0, =$Super$$SysTick_Handler
|
||||
bx R0
|
||||
|
||||
|
||||
.globl __ensure_systick_wrapper
|
||||
.type __ensure_systick_wrapper, %function
|
||||
|
||||
__ensure_systick_wrapper:
|
||||
bx lr
|
Loading…
x
Reference in New Issue
Block a user