[i=s] 本帖最后由 OldNewman 于 2025-4-29 10:32 编辑 [/i]
启动流程
- 汇编文件 start.S 中定义了
bl602_start()
函数,相当于 ARM 核的 Reset_Handler()
- `bl602_start()` 最终调用 `bfl_main()` ,初始化一些列硬件和软件环境,最终创建 `aos_loop_proc()` 任务,并调用 `vTaskStartScheduler()` 启动 FreeRTOS 内核;
- 在 `aos_loop_proc()` 中初始化 easyflash 组件、VFS等模块,创建 `app_main_entry()` 最后删除自身这个任务;
- 在 `app_main_entry()` 最终调用用户空间的 `main()` 函数;

Hello World 打印日志
▒Starting bl602 now....
Booting Ai-WB2 Modules...
RISC-V Core Feature:RV32-ACFIMX
Build Version: release_bl_iot_sdk_1.6.40-11-gf4c8dac01
Build Date: Apr 2 2025
Build Time: 15:18:38
blog init set power on level 2, 2, 2.
[IRQ] Clearing and Disable all the pending IRQ...
INFO (0)[hal_boot2.c: 253] [HAL] [BOOT2] Active Partition[0] consumed 596 Bytes
INFO (0)[hal_boot2.c: 53] ======= PtTable_Config @0x4200d180=======
INFO (0)[hal_boot2.c: 54] magicCode 0x54504642;
version 0x0000;
entryCnt 7;
age 0;
crc32 0x12DF9A26
INFO (0)[hal_boot2.c: 60] idx type device activeIndex name Address[0] Address[1] Length[0] Length[1] age
INFO (0)[hal_boot2.c: 62] [00]
00
0
0
FW
0x00010000
0x00140000
0x00130000
0x00100000
0
INFO (0)[hal_boot2.c: 62] [01]
02
0
0
mfg
0x00240000
0x00000000
0x00032000
0x00000000
0
INFO (0)[hal_boot2.c: 62] [02]
03
0
0
media
0x00272000
0x00000000
0x00001000
0x00000000
0
INFO (0)[hal_boot2.c: 62] [03]
04
0
0
PSM
0x00273000
0x00000000
0x00033000
0x00000000
0
INFO (0)[hal_boot2.c: 62] [04]
05
0
0
KEY
0x002a6000
0x00000000
0x00002000
0x00000000
0
INFO (0)[hal_boot2.c: 62] [05]
06
0
0
DATA
0x002a8000
0x00000000
0x00005000
0x00000000
0
INFO (0)[hal_boot2.c: 62] [06]
07
0
0
factory
0x002ad000
0x00000000
0x00007000
0x00000000
0
INFO (0)[bl_flash.c: 362] ======= FlashCfg magiccode @0x42049c18=======
INFO (0)[bl_flash.c: 363] mid 0xC8
INFO (0)[bl_flash.c: 364] clkDelay 0x1
INFO (0)[bl_flash.c: 365] clkInvert 0x1
INFO (0)[bl_flash.c: 366] sector size 4KBytes
INFO (0)[bl_flash.c: 367] page size 256Bytes
INFO (0)[bl_flash.c: 368] ---------------------------------------------------------------
INFO (0)[hal_board.c:1220] [MAIN] [BOARD] [FLASH] addr from partition is 002ad000, ret is 0
INFO (0)[hal_board.c:1228] [MAIN] [BOARD] [XIP] addr from partition is 2329c000, ret is 0
[OS] Starting aos_loop_proc task...
[OS] Starting OS Scheduler...
Hello World.
Build: Apr 2 2025 16:14:33
Restarting in 10 seconds...
Restarting in 9 seconds...
Restarting in 8 seconds...
Restarting in 7 seconds...
Restarting in 6 seconds...
Restarting in 5 seconds...
Restarting in 4 seconds...
Restarting in 3 seconds...
Restarting in 2 seconds...
Restarting in 1 seconds...
Restarting in 0 seconds...