ESP32 初始化flash中的内容

M_xiaotao
Posts: 24
Joined: Tue May 25, 2021 1:35 am

ESP32 初始化flash中的内容

Postby M_xiaotao » Tue Jun 22, 2021 2:23 am

  1. const unsigned char gImage_GDEH_BW[4000] __attribute__((at(0x330000)))= {
  2. /* 0X00,0X01,0X80,0X00,0XFA,0X00, */
  3. 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
  4. 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,...}
警告提示:
[930/937] Building C object esp-idf/main/CMakeFiles/__idf_main.dir/epd_gdeh.c.obj
In file included from ../main/epd_gdeh.c:11:
../main/Image_epd_gdeh.h:507:1: warning: 'at' attribute directive ignored [-Wattributes]
const unsigned char gImage_GDEH_BW[4000] __attribute__((at(0x330000)))= {
^~~~~

M_xiaotao
Posts: 24
Joined: Tue May 25, 2021 1:35 am

Re: ESP32 初始化flash中的内容

Postby M_xiaotao » Tue Jun 22, 2021 2:46 am

测试环境
window10 vscode

ESP_Gargamel
Posts: 786
Joined: Wed Nov 14, 2018 8:45 am

Re: ESP32 初始化flash中的内容

Postby ESP_Gargamel » Tue Jun 22, 2021 3:06 am

建议把数据存成 bin 的形式直接烧录到 0x330000,然后用 partition 管理。

M_xiaotao
Posts: 24
Joined: Tue May 25, 2021 1:35 am

Re: ESP32 初始化flash中的内容

Postby M_xiaotao » Tue Jun 22, 2021 3:58 am

使用idf.py 可以完成这个操作吗?

ESP_Gargamel
Posts: 786
Joined: Wed Nov 14, 2018 8:45 am

Re: ESP32 初始化flash中的内容

Postby ESP_Gargamel » Tue Jun 22, 2021 4:11 am

不能,gcc 不支持 at 这个 attribute,参看:https://gcc.gnu.org/onlinedocs/gcc/Comm ... Attributes
gcc 下可以用 section 指定段,但要修改 ld 文件,不是太方便,还是用我前面建议的方式。

Who is online

Users browsing this forum: No registered users and 87 guests