接上文【BearPi-Pico H3863星闪开发板体验连载】adc和灯闪
案例含有一个SysTick,为一个64位计数器。其SysTick可配置为向上计数或向下计数。此外还有一个64位的比较寄存器,当计数器值和比较寄存器值相同时将触发中断服务。base address``0x40005000
单独编译SysTick 成功
- 案例:点击工具栏中的“系统配置”选项,选择Application目录,勾选“Enable Sample”、“Enable the Sample of peripheral”以及需要要编译的SysTick ,并保存。
. 编译: 点击工具栏中的“重编译”按钮,编译代码
时间比较长。
INFO:root:elf_path: ./output/ws63/acore/ws63-liteos-app/ws63-liteos-app.elf
INFO:root:map_path: ./output/ws63/acore/ws63-liteos-app/ws63-liteos-app.map
INFO:root:compiler_path: d:\\bearpi\\HiSpark Studio\\tools\\Windows\\cc_riscv32_musl_fp_win\\bin
INFO:root:build_config_path: None
INFO:root:prefix: riscv32-linux-musl
INFO:root:environment: windows
INFO:root:undef_addr_sections: ['.debug_info', '.debug_abbrev', '.debug_loc', '.debug_aranges', '.debug_ranges', '.debug_line', '.debug_str', '.comment', '.riscv.attributes', '.debug_frame']
INFO:root:no_size_sections: ['.plat_romtext', '.wifi_romtext', '.btc_romtext', '.bth_romtext', '.bth_romdata', '.plat_rombss', '.plat_text_tcm', '.wifi_text_tcm', '.plat_data_tcm', '.wifi_text_sram', '.btc_text_sram', '.bth_text_sram', '.wifi_data_sram', '.btc_data_sram', '.bth_data_sram', '.heap']
INFO:root:analysis sections: ['.text', '.data', '.bss', 'startup', '.sysintcall.init', '.patch', '.rom_ram_cb_text', '.plat_romdata', '.wifi_romdata', '.btc_romdata', '.bth_rombss', '.wifi_pkt_ram', '.btc_text_tcm', '.patch_on_tcm', '.btc_data_tcm', '.wifi_data_tcm', '.btc_bss_tcm', '.wifi_bss_tcm', '.plat_text_sram', '.patch_on_sram', '.plat_text_flash', '.wifi_text_flash', '.patch_on_flash', '.btc_text_flash', '.bth_text_flash', '.radar_text_flash', '.radar_ai_text_flash', '.btc_data_flash', '.bth_data_flash', '.plat_bss_sram', '.plat_bss_flash', '.wifi_bss_flash', '.radar_bss_flash', '.radar_ai_bss_flash', '.btc_bss_flash', '.bth_bss_flash', '.preserve', '.stacks']
INFO:root:
INFO:root:section_name section_size
INFO:root:startup 424
INFO:root:.sysintcall.init 52
INFO:root:.patch 2344
INFO:root:.rom_ram_cb_text 1816
INFO:root:.plat_romdata 212
INFO:root:.wifi_romdata 98
INFO:root:.btc_romdata 672
INFO:root:.btc_text_tcm 7206
INFO:root:.patch_on_tcm 1528
INFO:root:.btc_data_tcm 57
INFO:root:.wifi_data_tcm 3408
INFO:root:.plat_text_sram 10884
INFO:root:.patch_on_sram 2520
INFO:root:.plat_text_flash 177020
INFO:root:.wifi_text_flash 585302
INFO:root:.patch_on_flash 1908
INFO:root:.btc_text_flash 131560
INFO:root:.bth_text_flash 231154
INFO:root:.radar_text_flash 32012
INFO:root:.radar_ai_text_flash 5868
INFO:root:.text 42040
INFO:root:.btc_data_flash 4896
INFO:root:.bth_data_flash 2364
INFO:root:.data 380
INFO:root:total_size: 1245725
INFO:root:
INFO:root:++++++++++++++++++++++++++++++end buildAnalyzer++++++++++++++++++++++++++++++
project analysis Done!
================================ [SUCCESS] Took 157.56 seconds ================================
* 终端将被任务重用,按任意键关闭。
[烧录镜像]
此程序包括烧录
-
点击工具栏中的“工程配置”, 找到“程序加载”选项, 选择开发板与电脑连接后映射出来的端口。
-
点击工具栏中的“程序加载”,按一下开发板的复位按键就会进行烧录
-
下载完毕后,开发板复位,使用串口工具即可查看运行日志,日志打印波特率为115200。
此程序
com信息:
2024-10-18 12:47:06:309 -> count_after_get_ms = 11355, count_before_get_ms = 10355
2024-10-18 12:47:06:312 -> count_ms = 1000
2024-10-18 12:47:06:315 -> systick get ms work normall.
2024-10-18 12:47:06:316 -> systick delay 20000us!
2024-10-18 12:47:06:335 -> count_after_get_us = 11380825, count_before_get_us = 11360828
2024-10-18 12:47:06:337 -> count_us = 19997
2024-10-18 12:47:06:340 -> systick get us work normall.
2024-10-18 12:47:06:843 -> systick delay 2s!
2024-10-18 12:47:08:845 -> count_after_get_s = 13, count_before_get_s = 11
2024-10-18 12:47:08:846 -> count_s = 2
2024-10-18 12:47:08:848 -> systick get s work normall.
2024-10-18 12:47:08:851 -> systick delay 1000ms!
2024-10-18 12:47:09:992 -> count_after_get_ms = 14895, count_before_get_ms = 13895
2024-10-18 12:47:09:993 -> count_ms = 1000
2024-10-18 12:47:09:993 -> systick get ms work normall.
2024-10-18 12:47:09:993 -> systick delay 20000us!
2024-10-18 12:47:09:993 -> count_after_get_us = 14921373, count_before_get_us = 14901376
2024-10-18 12:47:09:993 -> count_us = 19997
2024-10-18 12:47:09:993 -> systick get us work normall.
2024-10-18 12:47:09:993 -> APP|[SYS INFO] mem: used:92228, free:271856; log: drop/all[0/0], at_recv 0.
2024-10-18 12:47:10:385 -> systick delay 2s!
2024-10-18 12:47:12:385 -> count_after_get_s = 17, count_before_get_s = 15
2024-10-18 12:47:12:385 -> count_s = 2
2024-10-18 12:47:12:388 -> systick get s work normall.
2024-10-18 12:47:12:391 -> systick delay 1000ms!
2024-10-18 12:47:13:390 -> count_after_get_ms = 18436, count_before_get_ms = 17436
2024-10-18 12:47:13:392 -> count_ms = 1000
2024-10-18 12:47:13:395 -> systick get ms work normall.
2024-10-18 12:47:13:395 -> systick delay 20000us!
2024-10-18 12:47:13:415 -> count_after_get_us = 18461794, count_before_get_us = 18441797
2024-10-18 12:47:13:418 -> count_us = 19997
2024-10-18 12:47:13:420 -> systick get us work normall.
2024-10-18 12:47:13:911 -> systick delay 2s!
2024-10-18 12:47:15:914 -> count_after_get_s = 20, count_before_get_s = 18
2024-10-18 12:47:15:914 -> count_s = 2
2024-10-18 12:47:15:917 -> systick get s work normall.
2024-10-18 12:47:15:919 -> systick delay 1000ms!
2024-10-18 12:47:16:918 -> count_after_get_ms = 21976, count_before_get_ms = 20976
2024-10-18 12:47:16:921 -> count_ms = 1000
2024-10-18 12:47:16:924 -> systick get ms work normall.
2024-10-18 12:47:16:924 -> systick delay 20000us!
2024-10-18 12:47:16:944 -> count_after_get_us = 22002309, count_before_get_us = 21982312
2024-10-18 12:47:16:947 -> count_us = 19997
2024-10-18 12:47:16:949 -> systick get us work normall.
2024-10-18 12:47:17:451 -> systick delay 2s!
2024-10-18 12:47:19:454 -> count_after_get_s = 24, count_before_get_s = 22
2024-10-18 12:47:19:455 -> count_s = 2
2024-10-18 12:47:19:457 -> systick get s work normall.
2024-10-18 12:47:19:460 -> systick delay 1000ms!
2024-10-18 12:47:20:459 -> count_after_get_ms = 25517, count_before_get_ms = 24517
2024-10-18 12:47:20:461 -> count_ms = 1000
2024-10-18 12:47:20:464 -> systick get ms work normall.
2024-10-18 12:47:20:464 -> systick delay 20000us!
2024-10-18 12:47:20:484 -> count_after_get_us = 25542762, count_before_get_us = 25522765
2024-10-18 12:47:20:487 -> count_us = 19997
2024-10-18 12:47:20:489 -> systick get us work normall.
2024-10-18 12:47:20:496 -> APP|[SYS INFO] mem: used:92228, free:271856; log: drop/all[0/0], at_recv 0.
2024-10-18 12:47:20:992 -> systick delay 2s!
2024-10-18 12:47:22:995 -> count_after_get_s = 28, count_before_get_s = 26
2024-10-18 12:47:22:995 -> count_s = 2
2024-10-18 12:47:22:997 -> systick get s work normall.
2024-10-18 12:47:23:000 -> systick delay 1000ms!
2024-10-18 12:47:23:999 -> count_after_get_ms = 29057, count_before_get_ms = 28057
2024-10-18 12:47:24:002 -> count_ms = 1000
2024-10-18 12:47:24:004 -> systick get ms work normall.
2024-10-18 12:47:24:004 -> systick delay 20000us!
2024-10-18 12:47:24:025 -> count_after_get_us = 29083341, count_before_get_us = 29063312
2024-10-18 12:47:24:027 -> count_us = 20029
2024-10-18 12:47:24:030 -> systick get us work normall.
2024-10-18 12:47:24:532 -> systick delay 2s!
2024-10-18 12:47:26:535 -> count_after_get_s = 31, count_before_get_s = 29
2024-10-18 12:47:26:535 -> count_s = 2
2024-10-18 12:47:26:538 -> systick get s work normall.
2024-10-18 12:47:26:540 -> systick delay 1000ms!
2024-10-18 12:47:27:539 -> count_after_get_ms = 32597, count_before_get_ms = 31597
2024-10-18 12:47:27:542 -> count_ms = 1000
2024-10-18 12:47:27:545 -> systick get ms work normall.
2024-10-18 12:47:27:545 -> systick delay 20000us!
2024-10-18 12:47:27:564 -> count_after_get_us = 32623129, count_before_get_us = 32603132
2024-10-18 12:47:27:568 -> count_us = 19997
2024-10-18 12:47:27:570 -> systick get us work normall.
2024-10-18 12:47:28:072 -> systick delay 2s!
2024-10-18 12:47:30:075 -> count_after_get_s = 35, count_before_get_s = 33
2024-10-18 12:47:30:076 -> count_s = 2
2024-10-18 12:47:30:078 -> systick get s work normall.
2024-10-18 12:47:30:080 -> systick delay 1000ms!
2024-10-18 12:47:31:079 -> count_after_get_ms = 36137, count_before_get_ms = 35137
2024-10-18 12:47:31:082 -> count_ms = 1000
2024-10-18 12:47:31:085 -> systick get ms work normall.
2024-10-18 12:47:31:085 -> systick delay 20000us!
2024-10-18 12:47:31:105 -> count_after_get_us = 36162853, count_before_get_us = 36142857
2024-10-18 12:47:31:107 -> count_us = 19996
2024-10-18 12:47:31:111 -> systick get us work normall.
2024-10-18 12:47:31:117 -> APP|[SYS INFO] mem: used:92228, free:271856; log: drop/all[0/0], at_recv 0.
2024-10-18 12:47:31:612 -> systick delay 2s!
2024-10-18 12:47:33:615 -> count_after_get_s = 38, count_before_get_s = 36
2024-10-18 12:47:33:616 -> count_s = 2
2024-10-18 12:47:33:618 -> systick get s work normall.
2024-10-18 12:47:33:620 -> systick delay 1000ms!
2024-10-18 12:47:34:620 -> count_after_get_ms = 39676, count_before_get_ms = 38676
2024-10-18 12:47:34:622 -> count_ms = 1000
2024-10-18 12:47:34:625 -> systick get ms work normall.
2024-10-18 12:47:34:625 -> systick delay 20000us!
2024-10-18 12:47:34:645 -> count_after_get_us = 39702388, count_before_get_us = 39682392
2024-10-18 12:47:34:648 -> count_us = 19996
2024-10-18 12:47:34:650 -> systick get us work normall.
2024-10-18 12:47:35:152 -> systick delay 2s!
2024-10-18 12:47:37:155 -> count_after_get_s = 42, count_before_get_s = 40
2024-10-18 12:47:37:155 -> count_s = 2
2024-10-18 12:47:37:158 -> systick get s work normall.
2024-10-18 12:47:37:161 -> systick delay 1000ms!
2024-10-18 12:47:38:159 -> count_after_get_ms = 43216, count_before_get_ms = 42216
2024-10-18 12:47:38:162 -> count_ms = 1000
2024-10-18 12:47:38:165 -> systick get ms work normall.
2024-10-18 12:47:38:165 -> systick delay 20000us!
2024-10-18 12:47:38:185 -> count_after_get_us = 43242081, count_before_get_us = 43222085
2024-10-18 12:47:38:188 -> count_us = 19996
2024-10-18 12:47:38:190 -> systick get us work normall.
2024-10-18 12:47:38:692 -> systick delay 2s!
2024-10-18 12:47:40:695 -> count_after_get_s = 45, count_before_get_s = 43
2024-10-18 12:47:40:696 -> count_s = 2
2024-10-18 12:47:40:698 -> systick get s work normall.
2024-10-18 12:47:40:701 -> systick delay 1000ms!
2024-10-18 12:47:41:700 -> count_after_get_ms = 46756, count_before_get_ms = 45756
2024-10-18 12:47:41:702 -> count_ms = 1000
2024-10-18 12:47:41:705 -> systick get ms work normall.
2024-10-18 12:47:41:705 -> systick delay 20000us!
2024-10-18 12:47:41:725 -> count_after_get_us = 46781869, count_before_get_us = 46761873
2024-10-18 12:47:41:727 -> count_us = 19996
2024-10-18 12:47:41:730 -> systick get us work normall.
2024-10-18 12:47:41:737 -> APP|[SYS INFO] mem: used:92228, free:271856; log: drop/all[0/0], at_recv 0.
2024-10-18 12:47:42:232 -> systick delay 2s!
2024-10-18 12:47:44:235 -> count_after_get_s = 49, count_before_get_s = 47
2024-10-18 12:47:44:236 -> count_s = 2
2024-10-18 12:47:44:238 -> systick get s work normall.
2024-10-18 12:47:44:241 -> systick delay 1000ms!
2024-10-18 12:47:45:239 -> count_after_get_ms = 50295, count_before_get_ms = 49295
2024-10-18 12:47:45:242 -> count_ms = 1000
2024-10-18 12:47:45:245 -> systick get ms work normall.
2024-10-18 12:47:45:245 -> systick delay 20000us!
2024-10-18 12:47:45:268 -> count_after_get_us = 50321531, count_before_get_us = 50301502
2024-10-18 12:47:45:268 -> count_us = 20029
2024-10-18 12:47:45:270 -> systick get us work normall.
2024-10-18 12:47:45:772 -> systick delay 2s!
2024-10-18 12:47:47:775 -> count_after_get_s = 52, count_before_get_s = 50
2024-10-18 12:47:47:775 -> count_s = 2
2024-10-18 12:47:47:778 -> systick get s work normall.
2024-10-18 12:47:47:780 -> systick delay 1000ms!
2024-10-18 12:47:48:780 -> count_after_get_ms = 53835, count_before_get_ms = 52835
2024-10-18 12:47:48:782 -> count_ms = 1000
2024-10-18 12:47:48:785 -> systick get ms work normall.
2024-10-18 12:47:48:785 -> systick delay 20000us!
2024-10-18 12:47:48:805 -> count_after_get_us = 53861224, count_before_get_us = 53841227
2024-10-18 12:47:48:807 -> count_us = 19997
2024-10-18 12:47:48:811 -> systick get us work normall.
2024-10-18 12:47:49:312 -> systick delay 2s!
2024-10-18 12:47:51:315 -> count_after_get_s = 56, count_before_get_s = 54
2024-10-18 12:47:51:315 -> count_s = 2
2024-10-18 12:47:51:318 -> systick get s work normall.
2024-10-18 12:47:51:320 -> systick delay 1000ms!
2024-10-18 12:47:52:319 -> count_after_get_ms = 57375, count_before_get_ms = 56375
2024-10-18 12:47:52:322 -> count_ms = 1000
2024-10-18 12:47:52:325 -> systick get ms work normall.
2024-10-18 12:47:52:325 -> systick delay 20000us!
2024-10-18 12:47:52:345 -> count_after_get_us = 57401012, count_before_get_us = 57381015
2024-10-18 12:47:52:348 -> count_us = 19997
2024-10-18 12:47:52:350 -> systick get us work normall.
2024-10-18 12:47:52:357 -> APP|[SYS INFO] mem: used:92228, free:271856; log: drop/all[0/0], at_recv 0.
2024-10-18 12:47:52:852 -> systick delay 2s!
SysTick和main function
都在运行。