Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STM32L4系列芯片,Easyflash初始化问题 #8

Open
Remy-Shi opened this issue Dec 22, 2020 · 2 comments
Open

STM32L4系列芯片,Easyflash初始化问题 #8

Remy-Shi opened this issue Dec 22, 2020 · 2 comments

Comments

@Remy-Shi
Copy link

Remy-Shi commented Dec 22, 2020

芯片:STM32L496RGT,使用fal组件和easyflash。flash驱动用的是rtt的drv_flash_l4.c
fal层分区是(0-1000KB)APP、(1000-1024KB)PARAMS。fal层初始化成功,因为曾经移植过littlefs,这部分比较熟悉。

easyflash格式化head不知道是不是成功了,如下:
Read data success. Start from 0x00000000, size is 200. The data is:
Offset (h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
[00000000] 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................
[00000010] FF FF FF FF FF FF FF FF 00 FF FF FF FF FF FF FF ................
[00000020] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................
[00000030] 45 46 34 30 FF FF FF FF FF FF FF FF 00 00 00 00 EF40............
[00000040] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................
[00000050] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................
[00000060] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................
[00000070] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................
[00000080] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................
[00000090] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................
[000000A0] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................
[000000B0] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................
[000000C0] FF FF FF FF FF FF FF FF ........

easyflash的menuconfig配置大致如下:
use ENV
Erase MIN:2048;Write MIN:64bits;Start addr:0
Version:V4.1.0

问题是:初始化默认环境变量时,会从offset=8开始写入flash,而这里已经被head写过了,因此HAL_FLASH_Program函数失败了。

大致看了下代码,了解到写环境变量时将申请flash块地址,而这个申请是easyflash管理的,在不清楚原理的情况下不敢贸然改动。

想请教的是,easyflash移植到L4系列中是否有问题的地方?

@Remy-Shi
Copy link
Author

详细读了项目readme,发现4.0以上版本不支持L4系列片内flash。切换到V3.3.0成功移植。

@armink
Copy link
Member

armink commented Dec 22, 2020

L4 的片上 Flash 不支持逆序写入,所以请使用 V3 版本,V4 版本是没法使用的哈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants