Просмотр исходного кода

support print to debug in pico

pikastech 4 лет назад
Родитель
Сommit
5de559e817

+ 1 - 39
bsp/pico/MDK/mdk/AC6-flash.BAT

@@ -1,43 +1,5 @@
-SET PATH=C:\Keil_v5\ARM\ARMCLANG\Bin;C:\Keil_v5\ARM\AC6.17\Bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin;C:\Users\liang\AppData\Local\Programs\Python\Python310\Scripts\;C:\Users\liang\AppData\Local\Programs\Python\Python310\;C:\Users\liang\AppData\Local\Microsoft\WindowsApps;C:\Users\liang\AppData\Local\Programs\Microsoft VS Code\bin
+SET PATH=C:\Keil_v5\ARM\ARMCLANG\Bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files\dotnet\;C:\Program Files\PuTTY\;C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin;C:\Users\liang\AppData\Local\Programs\Python\Python310\Scripts\;C:\Users\liang\AppData\Local\Programs\Python\Python310\;C:\Users\liang\AppData\Local\Microsoft\WindowsApps;C:\Users\liang\AppData\Local\Programs\Microsoft VS Code\bin;C:\texlive\2021\bin\win32;C:\Users\liang\.dotnet\tools
 SET CPU_TYPE=ARMCM0P_MPU
 SET CPU_VENDOR=ARM
 SET UV2_TARGET=AC6-flash
 SET CPU_CLOCK=0x00B71B00
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\startup_rp2040.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\system_rp2040.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\clocks.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\watchdog.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\pll.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\platform.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\xosc.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\irq.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\irq_handler_chain._ac"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\gpio.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\multicore.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\sync.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\critical_section.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\lock_core.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\mutex.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\sem.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\time.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\timeout_helper.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\timer.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\claim.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\queue.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\pheap.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\datetime.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\stdlib.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\uart.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\compile_time_choice._ac"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\runtime.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\i2c.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\spi.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\adc.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\bootrom.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\stdio.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\stdio_uart.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\env_wrapper.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\main.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\retarget_io.__i"
-"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmLink" --Via ".\Objects\template.lnp"
-.\axf2uf2.bat

+ 1 - 0
bsp/pico/MDK/mdk/RP2040_debug_in_sram.sct

@@ -77,6 +77,7 @@ LR_IROM1 0x20000000 SRAM_SIZE  {    ; load region size_region
     
     RW_IRAM_UNINIT +0 UNINIT {
         *(.uninitialized_data*)
+        *(.bss.noinit)
     }
     
     

+ 3 - 3
bsp/pico/MDK/mdk/debug_with_cmsis-dap_in_ram.ini

@@ -26,9 +26,9 @@ FUNC void debug_from_ram(void)
     _WWORD(0x40058028 ,Reset_Handler | 0x01);                                   //! scratch 7
     
     exec("RESET");
-    
-    exec("G, Reset_Handler");
-
+    //exec("BS main");
+    //exec("G, Reset_Handler");
+    exec("G, main");
 }
 
 DEFINE BUTTON "Reset Pico", "debug_from_ram()"

+ 83 - 18
bsp/pico/MDK/mdk/perf_counter/GorgonMeducer.perf_counter.pdsc

@@ -3,7 +3,7 @@
 <package schemaVersion="1.4" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="PACK.xsd">
   <vendor>GorgonMeducer</vendor>
   <name>perf_counter</name>
-  <description>A dedicated performance counter for Cortex-M systick. It shares the SysTick with users' original SysTick function without interfere it. This library will bring new functionalities, such as performance counter, delay_us and clock() service defined in time.h</description>
+  <description>A dedicated performance counter for the Cortex-M Systick. It shares the SysTick with users' original SysTick function without interfering with it. This library will bring new functionalities, such as performance counter, delay_us and clock() service defined in time.h</description>
   <url>https://raw.githubusercontent.com/GorgonMeducer/perf_counter/CMSIS-Pack/cmsis-pack/</url>
   <supportContact>https://github.com/GorgonMeducer/perf_counter/issues</supportContact>
   <license>lib/LICENSE</license>
@@ -16,6 +16,14 @@
   <repository type="git">https://github.com/GorgonMeducer/perf_counter.git</repository>
   
   <releases>
+    <release date="2021-12-22" version="1.7.1" url="https://raw.githubusercontent.com/GorgonMeducer/perf_counter/CMSIS-Pack/cmsis-pack/GorgonMeducer.perf_counter.1.7.1.pack">
+      - Add support for FreeRTOS
+      - Other minor update
+    </release>
+    <release date="2021-12-20" version="1.7.0" url="https://raw.githubusercontent.com/GorgonMeducer/perf_counter/CMSIS-Pack/cmsis-pack/GorgonMeducer.perf_counter.1.7.0.pack">
+      - Add new feature for RTOS. Now you can get cycle information for the current thread.
+      - Other minor update
+    </release>
     <release date="2021-12-05" version="1.6.5" url="https://raw.githubusercontent.com/GorgonMeducer/perf_counter/CMSIS-Pack/cmsis-pack/GorgonMeducer.perf_counter.1.6.5.pack">
       - Include stddef.h in perf_counter.h to solve missing NULL definition issue.
     </release>
@@ -77,6 +85,18 @@
             <require Cclass="CMSIS" Cgroup="CORE"/>
         </condition>
         
+        <condition id="RTX5 Patch">
+            <description>Require RTX5 Support</description>
+            <accept Cclass="CMSIS" Cgroup="RTOS2" Csub="Keil RTX5" Cvariant="Source"/>
+            <require Cclass="Utilities" Cgroup="perf_counter" Csub="Core"/>
+        </condition>
+        
+        <condition id="FreeRTOS Patch">
+            <description>Require FreeRTOS Support</description>
+            <accept Cbundle="FreeRTOS" Cclass="RTOS" Cversion="10.3.1"/>
+            <require Cclass="Utilities" Cgroup="perf_counter" Csub="Core"/>
+        </condition>
+        
         <condition id="Cortex-M Arm GCC">
             <description>Compile Cortex-M Processors with GNU Tools for Arm Embedded Processors.</description>
             <require condition="Arm GCC"/>
@@ -101,6 +121,7 @@
             <require condition="CMSIS-CORE"/>
         </condition>
         
+        
     </conditions>
   <!-- apis section (optional - for Application Programming Interface descriptions) -->
   <!-- 
@@ -133,23 +154,67 @@
   -->
 
     <components>
-        <component Cclass="Utilities" Cgroup="Performance" Csub="perf_counter" Cvariant="Library" Cversion="1.6.5" isDefaultVariant="true">
-          <description>A dedicated performance counter for Cortex-M systick.</description>
-          <files>
-            <file category="header"     name="lib/perf_counter.h"/>
-            <file category="library"    name="lib/perf_counter.lib"         condition="Cortex-M Arm Compiler"/>
-            <file category="library"    name="lib/libperf_counter_gcc.a"    condition="Cortex-M Arm GCC"/>
-          </files>
-        </component>
-        <component Cclass="Utilities" Cgroup="Performance" Csub="perf_counter" Cvariant="Source" Cversion="1.6.5" condition="CMSIS-CORE">
-          <description>A dedicated performance counter for Cortex-M systick.</description>
-          <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_gcc.s"        condition="Cortex-M Arm GCC CMSIS-CORE"/>
-          </files>
-        </component>
+        <bundle Cbundle="Performance Counter" Cclass="Utilities" Cversion="1.7.1">
+            <description>A dedicated performance counter for Cortex-M systick.</description>
+            <doc></doc>
+            <component Cgroup="perf_counter" Csub="Core" Cvariant="Library" isDefaultVariant="true">
+              <description>A dedicated performance counter for Cortex-M systick.</description>
+              <files>
+                <file category="header"     name="lib/perf_counter.h"/>
+                <file category="library"    name="lib/perf_counter.lib"         condition="Cortex-M Arm Compiler"/>
+                <file category="library"    name="lib/libperf_counter_gcc.a"    condition="Cortex-M Arm GCC"/>
+              </files>
+            </component>
+
+            <component Cgroup="perf_counter" Csub="Core" Cvariant="Source" condition="CMSIS-CORE">
+              <description>A dedicated performance counter for Cortex-M systick.</description>
+              <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_gcc.s"        condition="Cortex-M Arm GCC CMSIS-CORE"/>
+              </files>
+            </component>
+            
+            <component Cgroup="perf_counter" Csub="RTX5 Patch" condition="RTX5 Patch">
+              <description>A Patch for RTX5</description>
+              <files>
+                <file category="source"     name="lib/perf_os_patch_rtx5.c"/>
+              </files>
+              <Pre_Include_Global_h>
+//! \brief Enable RTOS Patch for perf_counter
+#define __PERF_CNT_USE_RTOS__
+              </Pre_Include_Global_h>
+            </component>
+
+            <component Cgroup="perf_counter" Csub="FreeRTOS Patch" condition="FreeRTOS Patch">
+              <description>A Patch for FreeRTOS</description>
+              <files>
+                <file category="source"     name="lib/perf_os_patch_freertos.c"/>
+              </files>
+              <Pre_Include_Global_h>
+//! \brief Enable RTOS Patch for perf_counter
+#define __PERF_CNT_USE_RTOS__
+              </Pre_Include_Global_h>
+              <RTE_Components_h>              
+#define traceTASK_SWITCHED_OUT_DISABLE  
+#define traceTASK_SWITCHED_IN_DISABLE
+
+#if defined(MPU_WRAPPERS_INCLUDED_FROM_API_FILE)
+
+
+extern void __freertos_evr_on_task_switched_out (void *ptTCB);
+extern void __freertos_evr_on_task_switched_in(void *ptTCB, uint32_t uxTopPriority) ;
+
+#   define traceTASK_SWITCHED_OUT()                                             \
+        __freertos_evr_on_task_switched_out(pxCurrentTCB)
+#   define traceTASK_SWITCHED_IN()                                              \
+        __freertos_evr_on_task_switched_in(pxCurrentTCB, uxTopReadyPriority)
+
+#endif
+              </RTE_Components_h>
+            </component>
+        </bundle>
     </components>
   
   <!-- optional taxonomy section for defining new component Class and Group names -->

+ 1 - 1
bsp/pico/MDK/mdk/perf_counter/README.md

@@ -1,2 +1,2 @@
 # perf_counter
-A dedicated performance counter for Cortex-M systick. It shares the SysTick with users' original SysTick function without interfere it. This library will bring new functionalities, such as performance counter, delay_us and clock() service defined in time.h
+A dedicated performance counter for Cortex-M systick. It shares the SysTick with users' original SysTick function without interfering with it. This library will bring new functionalities, such as performance counter, delay_us and clock() service defined in time.h.

+ 83 - 18
bsp/pico/MDK/mdk/perf_counter/cmsis-pack/GorgonMeducer.perf_counter.pdsc

@@ -3,7 +3,7 @@
 <package schemaVersion="1.4" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="PACK.xsd">
   <vendor>GorgonMeducer</vendor>
   <name>perf_counter</name>
-  <description>A dedicated performance counter for Cortex-M systick. It shares the SysTick with users' original SysTick function without interfere it. This library will bring new functionalities, such as performance counter, delay_us and clock() service defined in time.h</description>
+  <description>A dedicated performance counter for the Cortex-M Systick. It shares the SysTick with users' original SysTick function without interfering with it. This library will bring new functionalities, such as performance counter, delay_us and clock() service defined in time.h</description>
   <url>https://raw.githubusercontent.com/GorgonMeducer/perf_counter/CMSIS-Pack/cmsis-pack/</url>
   <supportContact>https://github.com/GorgonMeducer/perf_counter/issues</supportContact>
   <license>lib/LICENSE</license>
@@ -16,6 +16,14 @@
   <repository type="git">https://github.com/GorgonMeducer/perf_counter.git</repository>
   
   <releases>
+    <release date="2021-12-22" version="1.7.1" url="https://raw.githubusercontent.com/GorgonMeducer/perf_counter/CMSIS-Pack/cmsis-pack/GorgonMeducer.perf_counter.1.7.1.pack">
+      - Add support for FreeRTOS
+      - Other minor update
+    </release>
+    <release date="2021-12-20" version="1.7.0" url="https://raw.githubusercontent.com/GorgonMeducer/perf_counter/CMSIS-Pack/cmsis-pack/GorgonMeducer.perf_counter.1.7.0.pack">
+      - Add new feature for RTOS. Now you can get cycle information for the current thread.
+      - Other minor update
+    </release>
     <release date="2021-12-05" version="1.6.5" url="https://raw.githubusercontent.com/GorgonMeducer/perf_counter/CMSIS-Pack/cmsis-pack/GorgonMeducer.perf_counter.1.6.5.pack">
       - Include stddef.h in perf_counter.h to solve missing NULL definition issue.
     </release>
@@ -77,6 +85,18 @@
             <require Cclass="CMSIS" Cgroup="CORE"/>
         </condition>
         
+        <condition id="RTX5 Patch">
+            <description>Require RTX5 Support</description>
+            <accept Cclass="CMSIS" Cgroup="RTOS2" Csub="Keil RTX5" Cvariant="Source"/>
+            <require Cclass="Utilities" Cgroup="perf_counter" Csub="Core"/>
+        </condition>
+        
+        <condition id="FreeRTOS Patch">
+            <description>Require FreeRTOS Support</description>
+            <accept Cbundle="FreeRTOS" Cclass="RTOS" Cversion="10.3.1"/>
+            <require Cclass="Utilities" Cgroup="perf_counter" Csub="Core"/>
+        </condition>
+        
         <condition id="Cortex-M Arm GCC">
             <description>Compile Cortex-M Processors with GNU Tools for Arm Embedded Processors.</description>
             <require condition="Arm GCC"/>
@@ -101,6 +121,7 @@
             <require condition="CMSIS-CORE"/>
         </condition>
         
+        
     </conditions>
   <!-- apis section (optional - for Application Programming Interface descriptions) -->
   <!-- 
@@ -133,23 +154,67 @@
   -->
 
     <components>
-        <component Cclass="Utilities" Cgroup="Performance" Csub="perf_counter" Cvariant="Library" Cversion="1.6.5" isDefaultVariant="true">
-          <description>A dedicated performance counter for Cortex-M systick.</description>
-          <files>
-            <file category="header"     name="lib/perf_counter.h"/>
-            <file category="library"    name="lib/perf_counter.lib"         condition="Cortex-M Arm Compiler"/>
-            <file category="library"    name="lib/libperf_counter_gcc.a"    condition="Cortex-M Arm GCC"/>
-          </files>
-        </component>
-        <component Cclass="Utilities" Cgroup="Performance" Csub="perf_counter" Cvariant="Source" Cversion="1.6.5" condition="CMSIS-CORE">
-          <description>A dedicated performance counter for Cortex-M systick.</description>
-          <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_gcc.s"        condition="Cortex-M Arm GCC CMSIS-CORE"/>
-          </files>
-        </component>
+        <bundle Cbundle="Performance Counter" Cclass="Utilities" Cversion="1.7.1">
+            <description>A dedicated performance counter for Cortex-M systick.</description>
+            <doc></doc>
+            <component Cgroup="perf_counter" Csub="Core" Cvariant="Library" isDefaultVariant="true">
+              <description>A dedicated performance counter for Cortex-M systick.</description>
+              <files>
+                <file category="header"     name="lib/perf_counter.h"/>
+                <file category="library"    name="lib/perf_counter.lib"         condition="Cortex-M Arm Compiler"/>
+                <file category="library"    name="lib/libperf_counter_gcc.a"    condition="Cortex-M Arm GCC"/>
+              </files>
+            </component>
+
+            <component Cgroup="perf_counter" Csub="Core" Cvariant="Source" condition="CMSIS-CORE">
+              <description>A dedicated performance counter for Cortex-M systick.</description>
+              <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_gcc.s"        condition="Cortex-M Arm GCC CMSIS-CORE"/>
+              </files>
+            </component>
+            
+            <component Cgroup="perf_counter" Csub="RTX5 Patch" condition="RTX5 Patch">
+              <description>A Patch for RTX5</description>
+              <files>
+                <file category="source"     name="lib/perf_os_patch_rtx5.c"/>
+              </files>
+              <Pre_Include_Global_h>
+//! \brief Enable RTOS Patch for perf_counter
+#define __PERF_CNT_USE_RTOS__
+              </Pre_Include_Global_h>
+            </component>
+
+            <component Cgroup="perf_counter" Csub="FreeRTOS Patch" condition="FreeRTOS Patch">
+              <description>A Patch for FreeRTOS</description>
+              <files>
+                <file category="source"     name="lib/perf_os_patch_freertos.c"/>
+              </files>
+              <Pre_Include_Global_h>
+//! \brief Enable RTOS Patch for perf_counter
+#define __PERF_CNT_USE_RTOS__
+              </Pre_Include_Global_h>
+              <RTE_Components_h>              
+#define traceTASK_SWITCHED_OUT_DISABLE  
+#define traceTASK_SWITCHED_IN_DISABLE
+
+#if defined(MPU_WRAPPERS_INCLUDED_FROM_API_FILE)
+
+
+extern void __freertos_evr_on_task_switched_out (void *ptTCB);
+extern void __freertos_evr_on_task_switched_in(void *ptTCB, uint32_t uxTopPriority) ;
+
+#   define traceTASK_SWITCHED_OUT()                                             \
+        __freertos_evr_on_task_switched_out(pxCurrentTCB)
+#   define traceTASK_SWITCHED_IN()                                              \
+        __freertos_evr_on_task_switched_in(pxCurrentTCB, uxTopReadyPriority)
+
+#endif
+              </RTE_Components_h>
+            </component>
+        </bundle>
     </components>
   
   <!-- optional taxonomy section for defining new component Class and Group names -->

+ 10 - 1
bsp/pico/MDK/mdk/perf_counter/gen_pack.sh

@@ -53,6 +53,8 @@ PACK_BASE_FILES="
   perf_counter.h
   systick_wrapper_gcc.s
   systick_wrapper_ual.s
+  perf_os_patch_rtx5.c
+  perf_os_patch_freertos.c
   LICENSE
   README.md
 "
@@ -137,6 +139,10 @@ fi
 # pdsc file is mandatory in base directory:
 cp -f  ./$PACK_VENDOR.$PACK_NAME.pdsc ${PACK_BUILD}
 
+cp -f ./perf_os_patch_rtx5.c ./lib
+cp -f ./perf_os_patch_freertos.c ./lib
+cp -f ./perf_counter.h ./lib
+
 # directories
 echo Adding directories to pack:
 echo $PACK_DIRS
@@ -155,6 +161,8 @@ do
   cp -f  "$f" $PACK_BUILD/ 
 done
 
+
+
 # Run Schema Check (for Linux only):
 # sudo apt-get install libxml2-utils
 
@@ -198,7 +206,8 @@ if [ $errorlevel -ne 0 ]; then
   exit
 fi
 
-cp -f  ./$PACK_VENDOR.$PACK_NAME.pdsc ${PACK_WAREHOUSE}
+cp -f ./$PACK_VENDOR.$PACK_NAME.pdsc ${PACK_WAREHOUSE}
+
 
 echo "build of pack succeeded"
 # Clean up

+ 51 - 16
bsp/pico/MDK/mdk/perf_counter/lib/perf_counter.h

@@ -31,42 +31,41 @@
 //! @{
 
 //! \note for IAR
-#ifdef __IS_COMPILER_IAR__
-#   undef __IS_COMPILER_IAR__
-#endif
+#undef __IS_COMPILER_IAR__
 #if defined(__IAR_SYSTEMS_ICC__)
 #   define __IS_COMPILER_IAR__                  1
 #endif
 
 //! \note for arm compiler 5
-#ifdef __IS_COMPILER_ARM_COMPILER_5__
-#   undef __IS_COMPILER_ARM_COMPILER_5__
-#endif
+#undef __IS_COMPILER_ARM_COMPILER_5__
 #if ((__ARMCC_VERSION >= 5000000) && (__ARMCC_VERSION < 6000000))
 #   define __IS_COMPILER_ARM_COMPILER_5__       1
 #endif
 //! @}
 
 //! \note for arm compiler 6
-#ifdef __IS_COMPILER_ARM_COMPILER_6__
-#   undef __IS_COMPILER_ARM_COMPILER_6__
-#endif
+
+#undef __IS_COMPILER_ARM_COMPILER_6__
 #if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
 #   define __IS_COMPILER_ARM_COMPILER_6__       1
 #endif
 
-#ifdef __IS_COMPILER_LLVM__
-#   undef  __IS_COMPILER_LLVM__
+#undef __IS_COMPILER_ARM_COMPILER__
+#if defined(__IS_COMPILER_ARM_COMPILER_5__) && __IS_COMPILER_ARM_COMPILER_5__   \
+||  defined(__IS_COMPILER_ARM_COMPILER_6__) && __IS_COMPILER_ARM_COMPILER_6__
+
+#   define __IS_COMPILER_ARM_COMPILER__         1
+
 #endif
+
+
+#undef  __IS_COMPILER_LLVM__
 #if defined(__clang__) && !__IS_COMPILER_ARM_COMPILER_6__
 #   define __IS_COMPILER_LLVM__                 1
 #else
 //! \note for gcc
-#   ifdef __IS_COMPILER_GCC__
-#       undef __IS_COMPILER_GCC__
-#   endif
-#   if defined(__GNUC__) && !(  defined(__IS_COMPILER_ARM_COMPILER_5__)         \
-                            ||  defined(__IS_COMPILER_ARM_COMPILER_6__)         \
+#   undef __IS_COMPILER_GCC__
+#   if defined(__GNUC__) && !(  defined(__IS_COMPILER_ARM_COMPILER__)           \
                             ||  defined(__IS_COMPILER_LLVM__))
 #       define __IS_COMPILER_GCC__              1
 #   endif
@@ -254,6 +253,13 @@
             })
                     
 /*============================ TYPES =========================================*/
+typedef struct {
+    uint64_t    dwStart;
+    uint64_t    dwUsedTotal;
+    uint32_t    dwUsedRecent;
+    uint32_t    wActiveCount;
+} task_cycle_info_t;
+            
 /*============================ GLOBAL VARIABLES ==============================*/
 /*============================ LOCAL VARIABLES ===============================*/
 /*============================ PROTOTYPES ====================================*/
@@ -313,6 +319,35 @@ __attribute__((nothrow))
 extern int64_t get_system_ticks(void);
 
 
+#if defined(__PERF_CNT_USE_RTOS__)
+/*! \brief provide cycle information for target task if perf_counter is used
+ *!        together with an RTOS in the support list.
+ *!        
+ *!        Support RTOS List:
+ *!           - RTX5
+ */
+extern task_cycle_info_t * get_rtos_task_cycle_info(void);
+
+/*! \brief start cycle counter for current task
+ */
+extern void start_task_cycle_counter(void);
+
+/*! \brief calculate the elapsed cycle count for current task since the last 
+ *!        start point
+ *! 
+ *! \note you can have multiple stop_cycle_counter following one start point
+ *!  
+ *! \return the elapsed cycle count.
+ */
+extern int32_t stop_task_cycle_counter(void);
+
+#elif !defined(__IMPLEMENT_PERF_COUNTER)
+
+#   define start_task_cycle_counter         start_cycle_counter
+#   define stop_task_cycle_counter          stop_cycle_counter
+
+#endif
+
 /*----------------------------------------------------------------------------*
  * Please ignore the following APIs unless you have encountered some known    *
  * special conditions                                                         *

+ 58 - 0
bsp/pico/MDK/mdk/perf_counter/perf_counter.c

@@ -20,6 +20,8 @@
 #include <stdbool.h>
 #include <string.h>
 #include "cmsis_compiler.h"
+
+#define __IMPLEMENT_PERF_COUNTER
 #include "perf_counter.h"
 
 #if defined(__IS_COMPILER_GCC__)
@@ -153,6 +155,11 @@ typedef struct
   __IOM uint32_t CPACR;                  /*!< Offset: 0x088 (R/W)  Coprocessor Access Control Register */
 } SCB_Type;
 
+struct __task_cycle_info_t {
+    uint64_t            dwLastTimeStamp;
+    task_cycle_info_t   tInfo;
+} ;
+
 /*============================ GLOBAL VARIABLES ==============================*/
 extern uint32_t SystemCoreClock;
 
@@ -379,3 +386,54 @@ int64_t get_system_ticks(void)
 
     return lTemp;
 }
+
+
+__WEAK 
+task_cycle_info_t * get_rtos_task_cycle_info(void)
+{
+    return NULL;
+}
+
+void __on_context_switch_in(uint32_t *pwStack)
+{
+
+    struct __task_cycle_info_t *ptFrame = (struct __task_cycle_info_t *)pwStack;
+    uint64_t dwTimeStamp = get_system_ticks();
+    
+    if (0 == ptFrame->tInfo.dwStart) {
+        ptFrame->tInfo.dwStart = dwTimeStamp;
+    }
+    ptFrame->dwLastTimeStamp = dwTimeStamp;
+    ptFrame->tInfo.wActiveCount++;
+
+}
+
+void __on_context_switch_out(uint32_t *pwStack)
+{
+    
+    uint64_t dwTimeStamp = get_system_ticks();
+    struct __task_cycle_info_t *ptFrame = (struct __task_cycle_info_t *)pwStack;
+        
+    ptFrame->tInfo.dwUsedRecent = dwTimeStamp - ptFrame->dwLastTimeStamp;
+    ptFrame->tInfo.dwUsedTotal += ptFrame->tInfo.dwUsedRecent;
+    
+}
+
+void start_task_cycle_counter(void)
+{
+    task_cycle_info_t * ptInfo = get_rtos_task_cycle_info();
+    if (NULL != ptInfo) {
+        ptInfo->dwUsedTotal = 0;
+    }
+}
+
+int32_t stop_task_cycle_counter(void)
+{
+    task_cycle_info_t * ptInfo = get_rtos_task_cycle_info();
+    if (NULL != ptInfo) {
+        return (int32_t)ptInfo->dwUsedTotal;
+    }
+    
+    return 0;
+}
+

+ 51 - 16
bsp/pico/MDK/mdk/perf_counter/perf_counter.h

@@ -31,42 +31,41 @@
 //! @{
 
 //! \note for IAR
-#ifdef __IS_COMPILER_IAR__
-#   undef __IS_COMPILER_IAR__
-#endif
+#undef __IS_COMPILER_IAR__
 #if defined(__IAR_SYSTEMS_ICC__)
 #   define __IS_COMPILER_IAR__                  1
 #endif
 
 //! \note for arm compiler 5
-#ifdef __IS_COMPILER_ARM_COMPILER_5__
-#   undef __IS_COMPILER_ARM_COMPILER_5__
-#endif
+#undef __IS_COMPILER_ARM_COMPILER_5__
 #if ((__ARMCC_VERSION >= 5000000) && (__ARMCC_VERSION < 6000000))
 #   define __IS_COMPILER_ARM_COMPILER_5__       1
 #endif
 //! @}
 
 //! \note for arm compiler 6
-#ifdef __IS_COMPILER_ARM_COMPILER_6__
-#   undef __IS_COMPILER_ARM_COMPILER_6__
-#endif
+
+#undef __IS_COMPILER_ARM_COMPILER_6__
 #if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
 #   define __IS_COMPILER_ARM_COMPILER_6__       1
 #endif
 
-#ifdef __IS_COMPILER_LLVM__
-#   undef  __IS_COMPILER_LLVM__
+#undef __IS_COMPILER_ARM_COMPILER__
+#if defined(__IS_COMPILER_ARM_COMPILER_5__) && __IS_COMPILER_ARM_COMPILER_5__   \
+||  defined(__IS_COMPILER_ARM_COMPILER_6__) && __IS_COMPILER_ARM_COMPILER_6__
+
+#   define __IS_COMPILER_ARM_COMPILER__         1
+
 #endif
+
+
+#undef  __IS_COMPILER_LLVM__
 #if defined(__clang__) && !__IS_COMPILER_ARM_COMPILER_6__
 #   define __IS_COMPILER_LLVM__                 1
 #else
 //! \note for gcc
-#   ifdef __IS_COMPILER_GCC__
-#       undef __IS_COMPILER_GCC__
-#   endif
-#   if defined(__GNUC__) && !(  defined(__IS_COMPILER_ARM_COMPILER_5__)         \
-                            ||  defined(__IS_COMPILER_ARM_COMPILER_6__)         \
+#   undef __IS_COMPILER_GCC__
+#   if defined(__GNUC__) && !(  defined(__IS_COMPILER_ARM_COMPILER__)           \
                             ||  defined(__IS_COMPILER_LLVM__))
 #       define __IS_COMPILER_GCC__              1
 #   endif
@@ -254,6 +253,13 @@
             })
                     
 /*============================ TYPES =========================================*/
+typedef struct {
+    uint64_t    dwStart;
+    uint64_t    dwUsedTotal;
+    uint32_t    dwUsedRecent;
+    uint32_t    wActiveCount;
+} task_cycle_info_t;
+            
 /*============================ GLOBAL VARIABLES ==============================*/
 /*============================ LOCAL VARIABLES ===============================*/
 /*============================ PROTOTYPES ====================================*/
@@ -313,6 +319,35 @@ __attribute__((nothrow))
 extern int64_t get_system_ticks(void);
 
 
+#if defined(__PERF_CNT_USE_RTOS__)
+/*! \brief provide cycle information for target task if perf_counter is used
+ *!        together with an RTOS in the support list.
+ *!        
+ *!        Support RTOS List:
+ *!           - RTX5
+ */
+extern task_cycle_info_t * get_rtos_task_cycle_info(void);
+
+/*! \brief start cycle counter for current task
+ */
+extern void start_task_cycle_counter(void);
+
+/*! \brief calculate the elapsed cycle count for current task since the last 
+ *!        start point
+ *! 
+ *! \note you can have multiple stop_cycle_counter following one start point
+ *!  
+ *! \return the elapsed cycle count.
+ */
+extern int32_t stop_task_cycle_counter(void);
+
+#elif !defined(__IMPLEMENT_PERF_COUNTER)
+
+#   define start_task_cycle_counter         start_cycle_counter
+#   define stop_task_cycle_counter          stop_cycle_counter
+
+#endif
+
 /*----------------------------------------------------------------------------*
  * Please ignore the following APIs unless you have encountered some known    *
  * special conditions                                                         *

+ 311 - 84
bsp/pico/MDK/mdk/template.uvoptx

@@ -167,6 +167,11 @@
           <AccSizeX>0</AccSizeX>
         </Mm>
       </MemoryWindow1>
+      <ScvdPack>
+        <Filename>C:\Keil_v5\ARM\PACK\Keil\ARM_Compiler\1.6.3\EventRecorder.scvd</Filename>
+        <Type>Keil.ARM_Compiler.1.6.3</Type>
+        <SubType>1</SubType>
+      </ScvdPack>
       <ToolboxButtons>
         <Wi>
           <IntNumber>0</IntNumber>
@@ -287,7 +292,7 @@
         <sRfunc>1</sRfunc>
         <sRbox>1</sRbox>
         <tLdApp>1</tLdApp>
-        <tGomain>1</tGomain>
+        <tGomain>0</tGomain>
         <tRbreak>1</tRbreak>
         <tRwatch>1</tRwatch>
         <tRmem>1</tRmem>
@@ -365,6 +370,11 @@
           <AccSizeX>0</AccSizeX>
         </Mm>
       </MemoryWindow1>
+      <ScvdPack>
+        <Filename>C:\Keil_v5\ARM\PACK\Keil\ARM_Compiler\1.6.3\EventRecorder.scvd</Filename>
+        <Type>Keil.ARM_Compiler.1.6.3</Type>
+        <SubType>1</SubType>
+      </ScvdPack>
       <Tracepoint>
         <THDelay>0</THDelay>
       </Tracepoint>
@@ -464,7 +474,7 @@
       <OPTFL>
         <tvExp>1</tvExp>
         <tvExpOptDlg>0</tvExpOptDlg>
-        <IsCurrentTarget>1</IsCurrentTarget>
+        <IsCurrentTarget>0</IsCurrentTarget>
       </OPTFL>
       <CpuCode>7</CpuCode>
       <DebugOpt>
@@ -478,7 +488,7 @@
         <sRfunc>1</sRfunc>
         <sRbox>1</sRbox>
         <tLdApp>1</tLdApp>
-        <tGomain>1</tGomain>
+        <tGomain>0</tGomain>
         <tRbreak>1</tRbreak>
         <tRwatch>1</tRwatch>
         <tRmem>1</tRmem>
@@ -548,13 +558,209 @@
         </SetRegEntry>
       </TargetDriverDllRegistry>
       <Breakpoint/>
-      <WatchWindow1>
-        <Ww>
-          <count>0</count>
+      <MemoryWindow1>
+        <Mm>
           <WinNumber>1</WinNumber>
-          <ItemText>rx_pin</ItemText>
-        </Ww>
-      </WatchWindow1>
+          <SubType>1</SubType>
+          <ItemText>0x2000AC00</ItemText>
+          <AccSizeX>0</AccSizeX>
+        </Mm>
+      </MemoryWindow1>
+      <ScvdPack>
+        <Filename>C:\Keil_v5\ARM\PACK\Keil\ARM_Compiler\1.6.3\EventRecorder.scvd</Filename>
+        <Type>Keil.ARM_Compiler.1.6.3</Type>
+        <SubType>1</SubType>
+      </ScvdPack>
+      <ToolboxButtons>
+        <Wi>
+          <IntNumber>0</IntNumber>
+          <FirstString>Reset Pico</FirstString>
+          <SecondString>debug_from_ram()</SecondString>
+        </Wi>
+      </ToolboxButtons>
+      <Tracepoint>
+        <THDelay>0</THDelay>
+      </Tracepoint>
+      <DebugFlag>
+        <trace>0</trace>
+        <periodic>1</periodic>
+        <aLwin>1</aLwin>
+        <aCover>0</aCover>
+        <aSer1>0</aSer1>
+        <aSer2>0</aSer2>
+        <aPa>0</aPa>
+        <viewmode>1</viewmode>
+        <vrSel>0</vrSel>
+        <aSym>0</aSym>
+        <aTbox>1</aTbox>
+        <AscS1>0</AscS1>
+        <AscS2>0</AscS2>
+        <AscS3>0</AscS3>
+        <aSer3>0</aSer3>
+        <eProf>0</eProf>
+        <aLa>0</aLa>
+        <aPa1>0</aPa1>
+        <AscS4>0</AscS4>
+        <aSer4>1</aSer4>
+        <StkLoc>0</StkLoc>
+        <TrcWin>0</TrcWin>
+        <newCpu>0</newCpu>
+        <uProt>0</uProt>
+      </DebugFlag>
+      <LintExecutable></LintExecutable>
+      <LintConfigFile></LintConfigFile>
+      <bLintAuto>0</bLintAuto>
+      <bAutoGenD>0</bAutoGenD>
+      <LntExFlags>0</LntExFlags>
+      <pMisraName></pMisraName>
+      <pszMrule></pszMrule>
+      <pSingCmds></pSingCmds>
+      <pMultCmds></pMultCmds>
+      <pMisraNamep></pMisraNamep>
+      <pszMrulep></pszMrulep>
+      <pSingCmdsp></pSingCmdsp>
+      <pMultCmdsp></pMultCmdsp>
+    </TargetOption>
+  </Target>
+
+  <Target>
+    <TargetName>AC6-DebugInSRAM-printf</TargetName>
+    <ToolsetNumber>0x4</ToolsetNumber>
+    <ToolsetName>ARM-ADS</ToolsetName>
+    <TargetOption>
+      <CLKADS>12000000</CLKADS>
+      <OPTTT>
+        <gFlags>1</gFlags>
+        <BeepAtEnd>1</BeepAtEnd>
+        <RunSim>0</RunSim>
+        <RunTarget>1</RunTarget>
+        <RunAbUc>0</RunAbUc>
+      </OPTTT>
+      <OPTHX>
+        <HexSelection>1</HexSelection>
+        <FlashByte>65535</FlashByte>
+        <HexRangeLowAddress>0</HexRangeLowAddress>
+        <HexRangeHighAddress>0</HexRangeHighAddress>
+        <HexOffset>0</HexOffset>
+      </OPTHX>
+      <OPTLEX>
+        <PageWidth>79</PageWidth>
+        <PageLength>66</PageLength>
+        <TabStop>8</TabStop>
+        <ListingPath>.\Listings\</ListingPath>
+      </OPTLEX>
+      <ListingPage>
+        <CreateCListing>1</CreateCListing>
+        <CreateAListing>1</CreateAListing>
+        <CreateLListing>1</CreateLListing>
+        <CreateIListing>0</CreateIListing>
+        <AsmCond>1</AsmCond>
+        <AsmSymb>1</AsmSymb>
+        <AsmXref>0</AsmXref>
+        <CCond>1</CCond>
+        <CCode>0</CCode>
+        <CListInc>0</CListInc>
+        <CSymb>0</CSymb>
+        <LinkerCodeListing>0</LinkerCodeListing>
+      </ListingPage>
+      <OPTXL>
+        <LMap>1</LMap>
+        <LComments>1</LComments>
+        <LGenerateSymbols>1</LGenerateSymbols>
+        <LLibSym>1</LLibSym>
+        <LLines>1</LLines>
+        <LLocSym>1</LLocSym>
+        <LPubSym>1</LPubSym>
+        <LXref>0</LXref>
+        <LExpSel>0</LExpSel>
+      </OPTXL>
+      <OPTFL>
+        <tvExp>1</tvExp>
+        <tvExpOptDlg>0</tvExpOptDlg>
+        <IsCurrentTarget>1</IsCurrentTarget>
+      </OPTFL>
+      <CpuCode>7</CpuCode>
+      <DebugOpt>
+        <uSim>0</uSim>
+        <uTrg>1</uTrg>
+        <sLdApp>1</sLdApp>
+        <sGomain>0</sGomain>
+        <sRbreak>1</sRbreak>
+        <sRwatch>1</sRwatch>
+        <sRmem>1</sRmem>
+        <sRfunc>1</sRfunc>
+        <sRbox>1</sRbox>
+        <tLdApp>1</tLdApp>
+        <tGomain>0</tGomain>
+        <tRbreak>1</tRbreak>
+        <tRwatch>1</tRwatch>
+        <tRmem>1</tRmem>
+        <tRfunc>0</tRfunc>
+        <tRbox>1</tRbox>
+        <tRtrace>1</tRtrace>
+        <sRSysVw>1</sRSysVw>
+        <tRSysVw>1</tRSysVw>
+        <sRunDeb>0</sRunDeb>
+        <sLrtime>0</sLrtime>
+        <bEvRecOn>1</bEvRecOn>
+        <bSchkAxf>0</bSchkAxf>
+        <bTchkAxf>0</bTchkAxf>
+        <nTsel>3</nTsel>
+        <sDll></sDll>
+        <sDllPa></sDllPa>
+        <sDlgDll></sDlgDll>
+        <sDlgPa></sDlgPa>
+        <sIfile>.\debug.ini</sIfile>
+        <tDll></tDll>
+        <tDllPa></tDllPa>
+        <tDlgDll></tDlgDll>
+        <tDlgPa></tDlgPa>
+        <tIfile>.\debug_with_cmsis-dap_in_ram.ini</tIfile>
+        <pMon>BIN\CMSIS_AGDI.dll</pMon>
+      </DebugOpt>
+      <TargetDriverDllRegistry>
+        <SetRegEntry>
+          <Number>0</Number>
+          <Key>CMSIS_AGDI</Key>
+          <Name>-X"Any" -UAny -O718 -S0 -C0 -P00000000 -N00("ARM CoreSight SW-DP") -D00(0BC12477) -L00(0) -TO65554 -TC10000000 -TT10000000 -TP20 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC1000 -FN0</Name>
+        </SetRegEntry>
+        <SetRegEntry>
+          <Number>0</Number>
+          <Key>JL2CM3</Key>
+          <Name>-U17935099 -O78 -S2 -ZTIFSpeedSel5000 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(0BC12477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO7 -FD20000000 -FC1000 -FN0</Name>
+        </SetRegEntry>
+        <SetRegEntry>
+          <Number>0</Number>
+          <Key>UL2CM3</Key>
+          <Name>UL2CM3(-S0 -C0 -P0  -FC1000 -FD20000000</Name>
+        </SetRegEntry>
+        <SetRegEntry>
+          <Number>0</Number>
+          <Key>DLGTARM</Key>
+          <Name>(1010=745,553,1156,1055,0)(1007=105,137,312,358,0)(1008=90,121,466,357,0)(1012=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)</Name>
+        </SetRegEntry>
+        <SetRegEntry>
+          <Number>0</Number>
+          <Key>DLGUARM</Key>
+          <Name></Name>
+        </SetRegEntry>
+        <SetRegEntry>
+          <Number>0</Number>
+          <Key>ARMRTXEVENTFLAGS</Key>
+          <Name>-L70 -Z18 -C0 -M0 -T1</Name>
+        </SetRegEntry>
+        <SetRegEntry>
+          <Number>0</Number>
+          <Key>DLGDARM</Key>
+          <Name>(1010=75,104,525,661,1)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=643,307,887,855,1)(1012=-1,-1,-1,-1,0)</Name>
+        </SetRegEntry>
+        <SetRegEntry>
+          <Number>0</Number>
+          <Key>ARMDBGFLAGS</Key>
+          <Name>-T0</Name>
+        </SetRegEntry>
+      </TargetDriverDllRegistry>
+      <Breakpoint/>
       <MemoryWindow1>
         <Mm>
           <WinNumber>1</WinNumber>
@@ -563,6 +769,11 @@
           <AccSizeX>0</AccSizeX>
         </Mm>
       </MemoryWindow1>
+      <ScvdPack>
+        <Filename>C:\Users\liang\AppData\Local\Arm\Packs\Keil\ARM_Compiler\1.6.3\EventRecorder.scvd</Filename>
+        <Type>Keil.ARM_Compiler.1.6.3</Type>
+        <SubType>1</SubType>
+      </ScvdPack>
       <ToolboxButtons>
         <Wi>
           <IntNumber>0</IntNumber>
@@ -593,7 +804,7 @@
         <aLa>0</aLa>
         <aPa1>0</aPa1>
         <AscS4>0</AscS4>
-        <aSer4>0</aSer4>
+        <aSer4>1</aSer4>
         <StkLoc>0</StkLoc>
         <TrcWin>0</TrcWin>
         <newCpu>0</newCpu>
@@ -1024,18 +1235,6 @@
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
       <bDave2>0</bDave2>
-      <PathWithFileName>..\..\pico-sdk\src\rp2_common\pico_stdio\stdio.c</PathWithFileName>
-      <FilenameWithoutPath>stdio.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>1</GroupNumber>
-      <FileNumber>35</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
       <PathWithFileName>..\..\pico-sdk\src\rp2_common\pico_stdio_uart\stdio_uart.c</PathWithFileName>
       <FilenameWithoutPath>stdio_uart.c</FilenameWithoutPath>
       <RteFlg>0</RteFlg>
@@ -1043,7 +1242,7 @@
     </File>
     <File>
       <GroupNumber>1</GroupNumber>
-      <FileNumber>36</FileNumber>
+      <FileNumber>35</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -1063,7 +1262,7 @@
     <RteFlg>0</RteFlg>
     <File>
       <GroupNumber>2</GroupNumber>
-      <FileNumber>37</FileNumber>
+      <FileNumber>36</FileNumber>
       <FileType>5</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -1075,7 +1274,7 @@
     </File>
     <File>
       <GroupNumber>2</GroupNumber>
-      <FileNumber>38</FileNumber>
+      <FileNumber>37</FileNumber>
       <FileType>5</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -1087,7 +1286,7 @@
     </File>
     <File>
       <GroupNumber>2</GroupNumber>
-      <FileNumber>39</FileNumber>
+      <FileNumber>38</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -1099,25 +1298,25 @@
     </File>
     <File>
       <GroupNumber>2</GroupNumber>
-      <FileNumber>40</FileNumber>
+      <FileNumber>39</FileNumber>
       <FileType>5</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
       <bDave2>0</bDave2>
-      <PathWithFileName>.\perf_counter\lib\perf_counter.h</PathWithFileName>
-      <FilenameWithoutPath>perf_counter.h</FilenameWithoutPath>
+      <PathWithFileName>.\wrapper\hardware\sync.h</PathWithFileName>
+      <FilenameWithoutPath>sync.h</FilenameWithoutPath>
       <RteFlg>0</RteFlg>
       <bShared>0</bShared>
     </File>
     <File>
       <GroupNumber>2</GroupNumber>
-      <FileNumber>41</FileNumber>
-      <FileType>5</FileType>
+      <FileNumber>40</FileNumber>
+      <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
       <bDave2>0</bDave2>
-      <PathWithFileName>.\wrapper\hardware\sync.h</PathWithFileName>
-      <FilenameWithoutPath>sync.h</FilenameWithoutPath>
+      <PathWithFileName>.\wrapper\stdio.c</PathWithFileName>
+      <FilenameWithoutPath>stdio.c</FilenameWithoutPath>
       <RteFlg>0</RteFlg>
       <bShared>0</bShared>
     </File>
@@ -1131,7 +1330,7 @@
     <RteFlg>0</RteFlg>
     <File>
       <GroupNumber>3</GroupNumber>
-      <FileNumber>42</FileNumber>
+      <FileNumber>41</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -1151,192 +1350,192 @@
     <RteFlg>0</RteFlg>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>43</FileNumber>
+      <FileNumber>42</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
       <bDave2>0</bDave2>
-      <PathWithFileName>..\..\pikascript\pikascript-core\BaseObj.c</PathWithFileName>
+      <PathWithFileName>..\..\..\..\src\BaseObj.c</PathWithFileName>
       <FilenameWithoutPath>BaseObj.c</FilenameWithoutPath>
       <RteFlg>0</RteFlg>
       <bShared>0</bShared>
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>44</FileNumber>
+      <FileNumber>43</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
       <bDave2>0</bDave2>
-      <PathWithFileName>..\..\pikascript\pikascript-core\dataArg.c</PathWithFileName>
+      <PathWithFileName>..\..\..\..\src\dataArg.c</PathWithFileName>
       <FilenameWithoutPath>dataArg.c</FilenameWithoutPath>
       <RteFlg>0</RteFlg>
       <bShared>0</bShared>
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>45</FileNumber>
+      <FileNumber>44</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
       <bDave2>0</bDave2>
-      <PathWithFileName>..\..\pikascript\pikascript-core\dataArgs.c</PathWithFileName>
+      <PathWithFileName>..\..\..\..\src\dataArgs.c</PathWithFileName>
       <FilenameWithoutPath>dataArgs.c</FilenameWithoutPath>
       <RteFlg>0</RteFlg>
       <bShared>0</bShared>
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>46</FileNumber>
+      <FileNumber>45</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
       <bDave2>0</bDave2>
-      <PathWithFileName>..\..\pikascript\pikascript-core\dataLink.c</PathWithFileName>
+      <PathWithFileName>..\..\..\..\src\dataLink.c</PathWithFileName>
       <FilenameWithoutPath>dataLink.c</FilenameWithoutPath>
       <RteFlg>0</RteFlg>
       <bShared>0</bShared>
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>47</FileNumber>
+      <FileNumber>46</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
       <bDave2>0</bDave2>
-      <PathWithFileName>..\..\pikascript\pikascript-core\dataLinkNode.c</PathWithFileName>
+      <PathWithFileName>..\..\..\..\src\dataLinkNode.c</PathWithFileName>
       <FilenameWithoutPath>dataLinkNode.c</FilenameWithoutPath>
       <RteFlg>0</RteFlg>
       <bShared>0</bShared>
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>48</FileNumber>
+      <FileNumber>47</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
       <bDave2>0</bDave2>
-      <PathWithFileName>..\..\pikascript\pikascript-core\dataMemory.c</PathWithFileName>
+      <PathWithFileName>..\..\..\..\src\dataMemory.c</PathWithFileName>
       <FilenameWithoutPath>dataMemory.c</FilenameWithoutPath>
       <RteFlg>0</RteFlg>
       <bShared>0</bShared>
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>49</FileNumber>
+      <FileNumber>48</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
       <bDave2>0</bDave2>
-      <PathWithFileName>..\..\pikascript\pikascript-core\dataQueue.c</PathWithFileName>
+      <PathWithFileName>..\..\..\..\src\dataQueue.c</PathWithFileName>
       <FilenameWithoutPath>dataQueue.c</FilenameWithoutPath>
       <RteFlg>0</RteFlg>
       <bShared>0</bShared>
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>50</FileNumber>
+      <FileNumber>49</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
       <bDave2>0</bDave2>
-      <PathWithFileName>..\..\pikascript\pikascript-core\dataQueueObj.c</PathWithFileName>
+      <PathWithFileName>..\..\..\..\src\dataQueueObj.c</PathWithFileName>
       <FilenameWithoutPath>dataQueueObj.c</FilenameWithoutPath>
       <RteFlg>0</RteFlg>
       <bShared>0</bShared>
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>51</FileNumber>
+      <FileNumber>50</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
       <bDave2>0</bDave2>
-      <PathWithFileName>..\..\pikascript\pikascript-core\dataStack.c</PathWithFileName>
+      <PathWithFileName>..\..\..\..\src\dataStack.c</PathWithFileName>
       <FilenameWithoutPath>dataStack.c</FilenameWithoutPath>
       <RteFlg>0</RteFlg>
       <bShared>0</bShared>
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>52</FileNumber>
+      <FileNumber>51</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
       <bDave2>0</bDave2>
-      <PathWithFileName>..\..\pikascript\pikascript-core\dataString.c</PathWithFileName>
+      <PathWithFileName>..\..\..\..\src\dataString.c</PathWithFileName>
       <FilenameWithoutPath>dataString.c</FilenameWithoutPath>
       <RteFlg>0</RteFlg>
       <bShared>0</bShared>
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>53</FileNumber>
+      <FileNumber>52</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
       <bDave2>0</bDave2>
-      <PathWithFileName>..\..\pikascript\pikascript-core\dataStrs.c</PathWithFileName>
+      <PathWithFileName>..\..\..\..\src\dataStrs.c</PathWithFileName>
       <FilenameWithoutPath>dataStrs.c</FilenameWithoutPath>
       <RteFlg>0</RteFlg>
       <bShared>0</bShared>
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>54</FileNumber>
+      <FileNumber>53</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
       <bDave2>0</bDave2>
-      <PathWithFileName>..\..\pikascript\pikascript-core\PikaObj.c</PathWithFileName>
+      <PathWithFileName>..\..\..\..\src\PikaObj.c</PathWithFileName>
       <FilenameWithoutPath>PikaObj.c</FilenameWithoutPath>
       <RteFlg>0</RteFlg>
       <bShared>0</bShared>
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>55</FileNumber>
+      <FileNumber>54</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
       <bDave2>0</bDave2>
-      <PathWithFileName>..\..\pikascript\pikascript-core\PikaParser.c</PathWithFileName>
+      <PathWithFileName>..\..\..\..\src\PikaParser.c</PathWithFileName>
       <FilenameWithoutPath>PikaParser.c</FilenameWithoutPath>
       <RteFlg>0</RteFlg>
       <bShared>0</bShared>
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>56</FileNumber>
+      <FileNumber>55</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
       <bDave2>0</bDave2>
-      <PathWithFileName>..\..\pikascript\pikascript-core\PikaPlatform.c</PathWithFileName>
+      <PathWithFileName>..\..\..\..\src\PikaPlatform.c</PathWithFileName>
       <FilenameWithoutPath>PikaPlatform.c</FilenameWithoutPath>
       <RteFlg>0</RteFlg>
       <bShared>0</bShared>
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>57</FileNumber>
+      <FileNumber>56</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
       <bDave2>0</bDave2>
-      <PathWithFileName>..\..\pikascript\pikascript-core\PikaVM.c</PathWithFileName>
+      <PathWithFileName>..\..\..\..\src\PikaVM.c</PathWithFileName>
       <FilenameWithoutPath>PikaVM.c</FilenameWithoutPath>
       <RteFlg>0</RteFlg>
       <bShared>0</bShared>
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>58</FileNumber>
+      <FileNumber>57</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
       <bDave2>0</bDave2>
-      <PathWithFileName>..\..\pikascript\pikascript-core\TinyObj.c</PathWithFileName>
+      <PathWithFileName>..\..\..\..\src\TinyObj.c</PathWithFileName>
       <FilenameWithoutPath>TinyObj.c</FilenameWithoutPath>
       <RteFlg>0</RteFlg>
       <bShared>0</bShared>
@@ -1351,36 +1550,36 @@
     <RteFlg>0</RteFlg>
     <File>
       <GroupNumber>5</GroupNumber>
-      <FileNumber>59</FileNumber>
+      <FileNumber>58</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
       <bDave2>0</bDave2>
-      <PathWithFileName>..\..\pikascript\pikascript-lib\PikaStdLib\PikaStdLib_List.c</PathWithFileName>
-      <FilenameWithoutPath>PikaStdLib_List.c</FilenameWithoutPath>
+      <PathWithFileName>..\..\..\..\package\PikaStdLib\PikaStdLib_MemChecker.c</PathWithFileName>
+      <FilenameWithoutPath>PikaStdLib_MemChecker.c</FilenameWithoutPath>
       <RteFlg>0</RteFlg>
       <bShared>0</bShared>
     </File>
     <File>
       <GroupNumber>5</GroupNumber>
-      <FileNumber>60</FileNumber>
+      <FileNumber>59</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
       <bDave2>0</bDave2>
-      <PathWithFileName>..\..\pikascript\pikascript-lib\PikaStdLib\PikaStdLib_MemChecker.c</PathWithFileName>
-      <FilenameWithoutPath>PikaStdLib_MemChecker.c</FilenameWithoutPath>
+      <PathWithFileName>..\..\..\..\package\PikaStdLib\PikaStdLib_RangeObj.c</PathWithFileName>
+      <FilenameWithoutPath>PikaStdLib_RangeObj.c</FilenameWithoutPath>
       <RteFlg>0</RteFlg>
       <bShared>0</bShared>
     </File>
     <File>
       <GroupNumber>5</GroupNumber>
-      <FileNumber>61</FileNumber>
+      <FileNumber>60</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
       <bDave2>0</bDave2>
-      <PathWithFileName>..\..\pikascript\pikascript-lib\PikaStdLib\PikaStdLib_SysObj.c</PathWithFileName>
+      <PathWithFileName>..\..\..\..\package\PikaStdLib\PikaStdLib_SysObj.c</PathWithFileName>
       <FilenameWithoutPath>PikaStdLib_SysObj.c</FilenameWithoutPath>
       <RteFlg>0</RteFlg>
       <bShared>0</bShared>
@@ -1395,7 +1594,7 @@
     <RteFlg>0</RteFlg>
     <File>
       <GroupNumber>6</GroupNumber>
-      <FileNumber>62</FileNumber>
+      <FileNumber>61</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -1407,7 +1606,7 @@
     </File>
     <File>
       <GroupNumber>6</GroupNumber>
-      <FileNumber>63</FileNumber>
+      <FileNumber>62</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -1419,31 +1618,31 @@
     </File>
     <File>
       <GroupNumber>6</GroupNumber>
-      <FileNumber>64</FileNumber>
+      <FileNumber>63</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
       <bDave2>0</bDave2>
-      <PathWithFileName>..\..\pikascript\pikascript-api\PikaStdLib_List-api.c</PathWithFileName>
-      <FilenameWithoutPath>PikaStdLib_List-api.c</FilenameWithoutPath>
+      <PathWithFileName>..\..\pikascript\pikascript-api\PikaStdLib_MemChecker-api.c</PathWithFileName>
+      <FilenameWithoutPath>PikaStdLib_MemChecker-api.c</FilenameWithoutPath>
       <RteFlg>0</RteFlg>
       <bShared>0</bShared>
     </File>
     <File>
       <GroupNumber>6</GroupNumber>
-      <FileNumber>65</FileNumber>
+      <FileNumber>64</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
       <bDave2>0</bDave2>
-      <PathWithFileName>..\..\pikascript\pikascript-api\PikaStdLib_MemChecker-api.c</PathWithFileName>
-      <FilenameWithoutPath>PikaStdLib_MemChecker-api.c</FilenameWithoutPath>
+      <PathWithFileName>..\..\pikascript\pikascript-api\PikaStdLib_RangeObj-api.c</PathWithFileName>
+      <FilenameWithoutPath>PikaStdLib_RangeObj-api.c</FilenameWithoutPath>
       <RteFlg>0</RteFlg>
       <bShared>0</bShared>
     </File>
     <File>
       <GroupNumber>6</GroupNumber>
-      <FileNumber>66</FileNumber>
+      <FileNumber>65</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -1455,7 +1654,7 @@
     </File>
     <File>
       <GroupNumber>6</GroupNumber>
-      <FileNumber>67</FileNumber>
+      <FileNumber>66</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -1467,6 +1666,26 @@
     </File>
   </Group>
 
+  <Group>
+    <GroupName>Python</GroupName>
+    <tvExp>1</tvExp>
+    <tvExpOptDlg>0</tvExpOptDlg>
+    <cbSel>0</cbSel>
+    <RteFlg>0</RteFlg>
+    <File>
+      <GroupNumber>7</GroupNumber>
+      <FileNumber>67</FileNumber>
+      <FileType>5</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\..\pikascript\main.py</PathWithFileName>
+      <FilenameWithoutPath>main.py</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+  </Group>
+
   <Group>
     <GroupName>::CMSIS</GroupName>
     <tvExp>0</tvExp>
@@ -1483,4 +1702,12 @@
     <RteFlg>1</RteFlg>
   </Group>
 
+  <Group>
+    <GroupName>::Utilities</GroupName>
+    <tvExp>0</tvExp>
+    <tvExpOptDlg>0</tvExpOptDlg>
+    <cbSel>0</cbSel>
+    <RteFlg>1</RteFlg>
+  </Group>
+
 </ProjectOpt>

Разница между файлами не показана из-за своего большого размера
+ 974 - 8
bsp/pico/MDK/mdk/template.uvprojx


+ 57 - 0
bsp/pico/MDK/mdk/wrapper/env_wrapper.c

@@ -20,6 +20,12 @@
 #include "RTE_Components.h"
 #include <stdio.h>
 
+#include "perf_counter.h"
+
+#ifdef RTE_Compiler_EventRecorder
+#   include <EventRecorder.h>
+#endif
+
 /*============================ MACROS ========================================*/
 /*============================ MACROFIED FUNCTIONS ===========================*/
 /*============================ TYPES =========================================*/
@@ -59,6 +65,21 @@ int stdin_getchar(void)
     return byte;
 }
 
+#if defined(RTE_Compiler_EventRecorder) && defined(USE_EVR_FOR_STDOUR)
+static int stdout_putchar (int ch) {
+  static uint32_t index = 0U;
+  static uint8_t  buffer[8];
+ 
+  assert(index < sizeof(buffer));
+
+  buffer[index++] = (uint8_t)ch;
+  if ((index == sizeof(buffer)) || (ch == '\n')) {
+    EventRecordData(EventID(EventLevelOp, 0xFE, 0x00), buffer, index);
+    index = 0U;
+  }
+  return (ch);
+}
+#else
 __attribute__((weak))
 int stdout_putchar(int ch)
 {
@@ -71,6 +92,21 @@ int stdout_putchar(int ch)
     
     return _write(1, (char *)&ch, 1);
 }
+
+#endif
+
+
+int fputc (int c, FILE * stream) 
+{
+#if (!defined(RTE_Compiler_IO_STDOUT) && !defined(RTE_Compiler_IO_STDERR))
+  (void)c;
+  (void)stream;
+#endif
+ 
+ 
+  return stdout_putchar(c);
+}
+
 #else
 /*! \note If you want to use semihosting (currently only Arm-DS supports it), 
  *!       pleae open the RTE configuration and unselect the Compiler->I/O->STDIN
@@ -128,3 +164,24 @@ void _sys_exit(int ret)
 }
 
 #endif
+
+
+#if defined(RTE_Compiler_EventRecorder)
+
+uint32_t EventRecorderTimerSetup(void)
+{
+    return 1;
+}
+
+uint32_t EventRecorderTimerGetCount(void)
+{
+    return get_system_ticks();
+}
+
+uint32_t EventRecorderTimerGetFreq (void)
+{
+    extern uint32_t SystemCoreClock;
+    return SystemCoreClock;
+}
+
+#endif

+ 27 - 23
bsp/pico/main.c

@@ -17,9 +17,14 @@
 /*============================ INCLUDES ======================================*/
 #include "pico/stdlib.h"
 #include "perf_counter.h"
-#include "pico/stdio_usb.h"
-#include <stdio.h>
 #include "pikaScript.h"
+#include <stdio.h>
+
+#include "RTE_Components.h"
+#if defined(RTE_Compiler_EventRecorder) && defined(USE_EVR_FOR_STDOUR)
+#   include <EventRecorder.h>
+#endif
+
 /*============================ MACROS ========================================*/
 #define TOP         (0x1FFF)
 
@@ -76,40 +81,39 @@ static void breath_led(void)
 
 static void system_init(void)
 {
+    extern void SystemCoreClockUpdate();
+
+    SystemCoreClockUpdate();
     /*! \note if you do want to use SysTick in your application, please use 
      *!       init_cycle_counter(true); 
      *!       instead of 
      *!       init_cycle_counter(false); 
      */
-    // init_cycle_counter(false);
-    stdio_init_all();
+    init_cycle_counter(false);
+
+#if defined(RTE_Compiler_EventRecorder) && defined(USE_EVR_FOR_STDOUR)
+    EventRecorderInitialize(0, 1);
+#endif
+
     gpio_init(PICO_DEFAULT_LED_PIN);
     gpio_set_dir(PICO_DEFAULT_LED_PIN, GPIO_OUT);
+    
 }
 
+
 int main(void) 
 {
     system_init();
-    printf("pico system init ok.\r\n");
-    
-    printf("------------------------------------------------------------------\r\n");
-    printf("|                                                                |\r\n");
-    printf("|     ____   _   __            _____              _          __  |\r\n");
-    printf("|    / __ \\ (_) / /__ ____ _  / ___/ _____ _____ (_) ____   / /_ |\r\n");
-    printf("|   / /_/ // / / //_// __ `/  \\__ \\ / ___// ___// / / __ \\ / __/ |\r\n");
-    printf("|  / ____// / / ,<  / /_/ /  ___/ // /__ / /   / / / /_/ // /_   |\r\n");
-    printf("| /_/    /_/ /_/|_| \\__,_/  /____/ \\___//_/   /_/ / .___/ \\__/   |\r\n");
-    printf("|                                                /_/             |\r\n");
-    printf("|          PikaScript - An Ultra Lightweight Python Engine       |\r\n");
-    printf("|                                                                |\r\n");
-    printf("|           [ https://github.com/pikastech/pikascript ]          |\r\n");
-    printf("|           [  https://gitee.com/lyon1998/pikascript  ]          |\r\n");
-    printf("|                                                                |\r\n");
-    printf("------------------------------------------------------------------\r\n");
-
-    PikaObj * pikaMain = pikaScriptInit();
+
+    printf("Hello Pico-Template\r\n");
+    uint32_t n = 0;
+    pikaScriptInit();
     while (true) {
-        sleep_ms(500);
+        breath_led();
+        //gpio_put(PICO_DEFAULT_LED_PIN, 1);
+        //sleep_ms(500);
+        //gpio_put(PICO_DEFAULT_LED_PIN, 0);
+        //sleep_ms(500);
     }
     //return 0;
 }

+ 0 - 0
port/linux/api-make-linux.sh


Некоторые файлы не были показаны из-за большого количества измененных файлов