T5 TuyaOS_3.12.12 littlefs读取外置flash文件导致系统重启

Wi-Fi 设备、蜂窝设备、WuKongAI、开发板、TuyaOS 移植等


Post Reply
Memory
Posts: 12

我在使用tkl_fread接口读取一个文件时,系统直接错误重启,看log显示打开文件是成功的,这是什么原因导致,文件大小是937k,应该如何解决。出错部分log和代码如下

Code: Select all

epdImageDataBuffer = (unsigned char *)tkl_system_psram_malloc(480000 * 2 + 200);
if (epdImageDataBuffer == NULL)
{
	TAL_PR_NOTICE("malloc error!\r\n");
	tal_thread_delete(app_eink_tread);
	app_eink_tread = NULL;
	return;
}
snprintf(file_tc_name, 128, "/%s", file_name);
p_tc_file = tkl_fopen(file_tc_name, "w");
if (p_tc_file == NULL)
{
	TAL_PR_NOTICE("FLASH OPEN FILE ERROR\r\n");
	continue;
}
tkl_fread(epdImageDataBuffer, 480000 * 2, p_tc_file);

Code: Select all

tkl_fopen file success, path:/a7248ffa462dbec238c6fb5559347dbb_1752160817470.jpg fd = 1
components/littlefs/lfs.c 3308 func lfs_file_rawread expr (file->flags & LFS_O_RDONLY) == LFS_O_RDONLY
(150678)Assert at: __wrap___assert_func:168
(150678)Assert at: rtos_get_semaphore:271
 
 u_bootloader enter
ty heap base: 28001B00 size: 65280
__read_manage_block: mag->blockid=255, id=0, mag->state=255.
__read_manage_block: mag->magic=0xFFFFFFFF, rescrc=0x0, mag->crc32=0xFFFFFFFF.
__read_manage_block: mag->blockid=255, id=1, mag->state=255.
__read_manage_block: mag->magic=0xFFFFFFFF, rescrc=0x0, mag->crc32=0xFFFFFFFF.
_judge_ota_info checkerr0:1, checkerr1:1
jump toxx:0x2010000
jump toxx:0x2010000
(components/easy_flash/easy_flash_V4.X/src/ef_env.c:1818) ENV start address is 0x007CB000, size is 8192 bytes.
EasyFlash V4.1.0 is initialize success.
You can get the latest version on https://github.com/armink/EasyFlash .
ate enabled is 0
driver_init end
reason - assert
regs - e, e, 0
start user app thread.
-------- left heap: 193048, reset reason: e
go to tuya
temp in otp is:574
rwnx_cal_set_rfconfig(0x101) phy on; rf off
user app entry(0x2082285)
wakeup

Tags:
Post Reply