Skip to content

air001的flash模拟eeprom默认只有128字节 #92

Open

Description

@kuugasama

描述一下这个bug / Describe the bug

用eeprom.get读取只能读取128字节数据,用eeprom.put也是只能写入128字节数据,定义DATA_EEPROM_BASE和DATA_EEPROM_END也不能解决

复现步骤 / To Reproduce

#include <Arduino.h>
#include "Seeed_LDC1612.h"
#include <EEPROM.h>

LDC1612 sensor;

const int n = 60;
u32 z_mini = 0x1000000;
u32 LDC_DATA[n] = {0} ;
u32 addr = 129 ;//写入和读取位置,尝试从第129字节
u32 _pos = 0;
void setup()
{
EEPROM.get(_pos ,LDC_DATA);
EEPROM.get(addr,z_mini);
sensor.init();
Serial.begin(115200);
delay(100);
Serial.print("start! Z0 = ");
Serial.println(z_mini);//打印出来为0
for(int i = 0;i < n ;i++)//测试60个数组
{
Serial.print(LDC_DATA[i]);
Serial.print(",");
}
Serial.println(" ");
Serial.print("eeprom_length = ");
Serial.println(EEPROM.length());//eeprom长度只有128
sensor.get_channel_result(CHANNEL_1,&z_mini);
EEPROM.put(addr, z_mini);
EEPROM.get(addr,z_mini);
Serial.print("start! Z0 = ");
Serial.println(z_mini);//打印出来还是0

// put your setup code here, to run once:

}

void loop() {
// put your main code here, to run repeatedly:

}

如果正常,应该是什么样 / Expected behavior

模拟eeprom可利用空间更大

截图 / Screenshots

_T~A1V$3{@WNVEB41X OY`1

日志 / Logs

image

系统 / System

win10 22h2

PACK包版本 / Version

0.60

验证

  • 检查过该问题,之前没有人提过 / Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • 提供了最小可复现工程或详细的复现步骤,确保开发者可以复现 / The provided reproduction is a minimal reproducible example of the bug.
  • 已经提供了完整的报错信息、日志、截图,没有经过删减。

Activity

  1. kuugasama commented on Dec 1, 2023

    @kuugasama
    Author

    image
    air_eeprom.源文件中eeprom_write_byte函数中用到的HAL库函数无定义

  2. HalfSweet commented on Dec 2, 2023

    @HalfSweet
    Member

    定义DATA_EEPROM_END和DATA_EEPROM_BASE宏,值得注意的是EEPROM的容量是以最小储存的单位的整数倍,在air001中为128字节

  3. walklinewang commented on Dec 13, 2023

    @walklinewang

    @kuugasama 这个是用001片内的Flash当做eeprom直接读写的吗?还需要额外的芯片吗?

  4. kuugasama commented on Dec 15, 2023

    @kuugasama
    Author

    @kuugasama 这个是用001片内的Flash当做eeprom直接读写的吗?还需要额外的芯片吗?

    用flash读写模拟eeprom

  5. sunnyguhz commented on Mar 9, 2024

    @sunnyguhz

    定义DATA_EEPROM_END和DATA_EEPROM_BASE宏,值得注意的是EEPROM的容量是以最小储存的单位的整数倍,在air001中为128字节

    128字节实在是太小了,不够用,能否改成和STM32一样的2048字节?或者提供一个接口、方法供我们这些小白修改EEPROM的大小?

  6. HalfSweet commented on Mar 9, 2024

    @HalfSweet
    Member

    定义DATA_EEPROM_END和DATA_EEPROM_BASE宏,值得注意的是EEPROM的容量是以最小储存的单位的整数倍,在air001中为128字节

    128字节实在是太小了,不够用,能否改成和STM32一样的2048字节?或者提供一个接口、方法供我们这些小白修改EEPROM的大小?

    接口有的,就是在编译的时候通过编译选项注入这两个宏。

  7. sunnyguhz commented on Mar 9, 2024

    @sunnyguhz

    定义DATA_EEPROM_END和DATA_EEPROM_BASE宏,值得注意的是EEPROM的容量是以最小储存的单位的整数倍,在air001中为128字节

    128字节实在是太小了,不够用,能否改成和STM32一样的2048字节?或者提供一个接口、方法供我们这些小白修改EEPROM的大小?

    接口有的,就是在编译的时候通过编译选项注入这两个宏。

    额,我比较小白,不会用啊。能否出个例程?
    或者直接在下个版本改成2K,和STM32看齐得了。我相信很多人是用Air001替代STM32G030F6P6来用的,至少我自己是这样的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions