[ERROR] class EEPROMClass has no member named length
Posted: Fri Dec 04, 2020 7:21 am
Hey all !!!
I hope y'all are doing well...
I'm using Setup : Digital weighing scale using Renesas chip connected to one channel of Max232, another channel of Max232 connected to STM32. STM32 is connected to PC via FTDI232 serial to USB converter. A push button is attached to STM32, to facilitate data printing on serial monitor when enabled.
I used this tutorial for preliminary setup : "https://www.instructables.com/Getting-S ... duino-IDE/"
Arduino IDE: v1.8.13(Windows Store 1.8.42.0) from Microsoft store
Board Manager: STM32F1XX/GD32F1XX by stm32duino v2020.11.14
Additional board manager URL: "http://dan.drown.org/stm32duino/package ... index.json"
I am trying to save the serially received data into stm32's EEPROM(emulated flash memory in this case). For this, I wrote a dummy code derived from inbuilt examples. The code is :
But unfortunately, while compiling, I get an error like :
When I took a look on EEPROM.h file, length was not defined there. Since i'm a novice programmer, I really dunno how to define length on that library. I tried to figure it out, but I failed to do it and found nothing useful on internet.
Somebody please gimme a suggestion on this concern. Thanks in advance. God bless y'all.
P.S. I use STM32F103C6/8, with 128 KB internal flash.
Hades
I hope y'all are doing well...
I'm using Setup : Digital weighing scale using Renesas chip connected to one channel of Max232, another channel of Max232 connected to STM32. STM32 is connected to PC via FTDI232 serial to USB converter. A push button is attached to STM32, to facilitate data printing on serial monitor when enabled.
I used this tutorial for preliminary setup : "https://www.instructables.com/Getting-S ... duino-IDE/"
Arduino IDE: v1.8.13(Windows Store 1.8.42.0) from Microsoft store
Board Manager: STM32F1XX/GD32F1XX by stm32duino v2020.11.14
Additional board manager URL: "http://dan.drown.org/stm32duino/package ... index.json"
I am trying to save the serially received data into stm32's EEPROM(emulated flash memory in this case). For this, I wrote a dummy code derived from inbuilt examples. The code is :
Code: Select all
#include <EEPROM.h>
int addr = 0;
int address = 0;
int ledPin = PC13;
int inByte;
int inByte_1;
const char welMsg[] = "Ciao, Press :\r\n" \
"0 to write data\r\n" \
"1 to read written data\r\n" \
"2 to display status\r\n";
uint16 DataWrite = 0;
uint16 AddressWrite = 0;
void setup()
{
pinMode(ledPin, OUTPUT);
Serial.begin(115200);
Serial.print(welMsg);
}
void loop()
{
uint16 Status;
uint16 Data;
while (Serial.available())
{
char cmd = (char)Serial.read();
Serial.println(cmd);
if(cmd == '0')
{
Serial.println("Enter something");
inByte = Serial.read();
EEPROM.write(addr, inByte);
addr = addr + 1;
if (addr == EEPROM.length())
{
addr = 0;
}
delay(100);
}
else if (cmd == '1')
{
inByte_1 = EEPROM.read(address);
Serial.print(address);
Serial.print('\t');
Serial.print(inByte_1, DEC);
Serial.println();
address = address + 1;
if (address == EEPROM.length())
{
address = 0;
}
delay(1000);
}
else if (cmd == '2')
{
Status = EEPROM.write(AddressWrite, DataWrite);
Serial.print("EEPROM.write(0x");
Serial.print(AddressWrite, HEX);
Serial.print(", 0x");
Serial.print(DataWrite, HEX);
Serial.print(") : Status : ");
Serial.println(Status, HEX);
}
else
Serial.print(welMsg);
}
digitalWrite(ledPin, HIGH);
delay(1000);
digitalWrite(ledPin, LOW);
delay(1000);
}
Code: Select all
EEPROM_trial:39:26: error: 'class EEPROMClass' has no member named 'length'
if (addr == EEPROM.length())
^
EEPROM_trial:56:29: error: 'class EEPROMClass' has no member named 'length'
if (address == EEPROM.length())
^
Using library EEPROM in folder: C:\Users\IIoT\OneDrive\Documents\ArduinoData\packages\stm32duino\hardware\STM32F1\2020.11.27\libraries\EEPROM (legacy)
exit status 1
'class EEPROMClass' has no member named 'length'
Somebody please gimme a suggestion on this concern. Thanks in advance. God bless y'all.
P.S. I use STM32F103C6/8, with 128 KB internal flash.
Hades