看上面说明: 外部的flash 名字是norflash0 怎么能实现这个呢?在哪里体现呢?
分区表中的名字如何 和 块设备名字 关联起来呢?
[D/FAL] (fal_flash_init:61) Flash device | GD25Q16B | addr: 0x00000000 | len: 0x00800000 | blk_size: 0x00001000 |initialized finish.
[D/FAL] (fal_partition_init:272) Warning: Do NOT found the flash device(norflash0).
[I/FAL] ==================== FAL partition table ====================
[I/FAL] | name | flash_dev | offset | length |
[I/FAL] -------------------------------------------------------------
[I/FAL] | param | norflash0 | 0x00000000 | 0x00200000 |
[I/FAL] =============================================================
[I/FAL] RT-Thread Flash Abstraction Layer (V0.5.0) initialize success.
flash device 改成GD25Q16B,就正常了。在想教程里为什么是norflash0?
[D/FAL] (fal_flash_init:61) Flash device | GD25Q16B | addr: 0x00000000 | len: 0x00200000 | blk_size: 0x00000100 |initialized finish.
[32;22m[I/FAL] ==================== FAL partition table ====================[0m
[32;22m[I/FAL] | name | flash_dev | offset | length |[0m
[32;22m[I/FAL] -------------------------------------------------------------[0m
[32;22m[I/FAL] | param | GD25Q16B | 0x00000000 | 0x00200000 |[0m
[32;22m[I/FAL] =============================================================[0m
[32;22m[I/FAL] RT-Thread Flash Abstraction Layer (V0.5.0) initialize success.[0m
[I/STORAGE] Flash device : GD25Q16B Flash size : 2048K Partition : param Partition size: 2048K
fal_init(); //先初始化。
msh >fal probe GD25Q16B
启用 FAL 针对 SFUD 的移植文件(默认关闭);
应输入调用 rt_sfud_flash_probe 函数时传入的 FLASH 设备名称(也可以通过 list_device 命令查看 Block Device 的名字获取)。
该名称与分区表中的 Flash 名称对应,只有正确设置设备名字,才能完成对 FLASH 的读写操作。
\ | /
- RT - Thread Operating System
/ | \ 3.1.1 build Nov 7 2021
2006 - 2018 Copyright by rt-thread team
lwIP-2.0.2 initialized!
[SFUD] Find a Winbond flash chip. Size is 16777216 bytes.
[SFUD] w25qxx flash device is initialize success.
[21:41:16.888]收←◆codec initialization done!
PersimUI M3 SDK Version 1.5.0_1212 build a266716, Feb 22 2021
[32m[I/SAL_SOC] Socket Abstraction Layer initialize success.[0m
[D/FAL] (fal_flash_init:63) Flash device | norflash0 | addr: 0x00000000 | len: 0x01000000 | blk_size: 0x00001000 |initialized finish.
[D/FAL] (fal_partition_init:187) Find the partition table on 'norflash0' offset @0x0003f1c0.
[32;22m[I/FAL] ==================== FAL partition table ====================[0m
[32;22m[I/FAL] | name | flash_dev | offset | length |[0m
[32;22m[I/FAL] -------------------------------------------------------------[0m
[32;22m[I/FAL] | bl | norflash0 | 0x00000000 | 0x00050000 |[0m
[32;22m[I/FAL] | env | norflash0 | 0x00050000 | 0x00008000 |[0m
[32;22m[I/FAL] | app | norflash0 | 0x00058000 | 0x00280000 |[0m
[32;22m[I/FAL] | download | norflash0 | 0x002d8000 | 0x00280000 |[0m
[32;22m[I/FAL] | safe | norflash0 | 0x00558000 | 0x00100000 |[0m
[32;22m[I/FAL] | sy | norflash0 | 0x00658000 | 0x00080000 |[0m
[32;22m[I/FAL] | fs | norflash0 | 0x006d8000 | 0x00920000 |[0m
[32;22m[I/FAL] | mnt | norflash0 | 0x00ff8000 | 0x00008000 |[0m
[32;22m[I/FAL] =============================================================[0m
[32;22m[I/FAL] RT-Thread Flash Abstraction Layer (V0.4.99) initialize success.[0m
[36;22m[I/OTA] RT-Thread OTA package(V0.2.2) initialize success.[0m
[32;22m[I/FAL] The FAL mtd device (safe) created successfully[0m
[21:48:17.282]收←◆llist_device
device type ref count
------ -------------------- ----------
MQTT0 Pipe 2
uart0 Character Device 1
w0 Network Interface 0
wlan0 Network Interface 1
wlan1 Network Interface 0
sd0 Block Device 1
lcd Graphic Device 2
mnt MTD Device 1
sy MTD Device 1
fs MTD Device 1
safe MTD Device 1
rtc RTC 0
wdog Miscellaneous Device 1
gpio Miscellaneous Device 0
sound0 Sound Device 1
winusb Miscellaneous Device 1
usbd USB Slave Device 0
tp I2C Bus 4
w25qxx Block Device 0
spi10 SPI Device 0
spi1 SPI Bus 0
spi00 SPI Device 0
spi0 SPI Bus 0
uart2 Character Device 2
发现柿饼派上是norflash0。
直接改成norflash0,应该不行,还得改其他地方。
@小住住 定义的这个FAL_USING_NOR_FLASH_DEV_NAME 最终要和函数rt_sfud_flash_probe内指定相同才行,否则就找不到了