My first "read" and "write" eeprom portenta H7

I am new to this environment.
I am trying to do my first "read" "write" on the eeprom of the Portea H7 Lite.

Below my "full" code.

#include "api/HardwareSerial.h"
#include <Arduino.h>

#define TXD1              33  // *
#define RXD1              34  // *

#define BAUD_UART 115200
#define BAUD_USB  115200


void setup() {
  delay(100);  // wait for serial port to connect. Needed for native USB port only
  digitalWrite(LED_BUILTIN, HIGH);
  Serial1.begin(BAUD_UART, SERIAL_8N1, RXD1, TXD1);
  Serial1.begin(BAUD_USB);
  delay(500);
  digitalWrite(LED_BUILTIN, LOW);
}

There is an error while compiling " Serial1.begin(BAUD_UART, SERIAL_8N1, RXD1, TXD1);"

Coud you help me with my first "read" and "write"

Your topic has been moved to s amore relevant forum category for the board that you are using

Please post the full error message

Below the full error message.
FQBN: arduino:mbed_portenta:envie_m7
Using board 'envie_m7' from platform in folder: C:\Users\DTI_IP\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.2.1
Using core 'arduino' from platform in folder: C:\Users\DTI_IP\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.2.1

Detecting libraries used...
C:\Users\DTI_IP\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4/bin/arm-none-eabi-g++ -c -w -g3 -nostdlib @C:\Users\DTI_IP\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.2.1\variants\PORTENTA_H7_M7/defines.txt @C:\Users\DTI_IP\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.2.1\variants\PORTENTA_H7_M7/cxxflags.txt -mcpu=cortex-m7 -mfloat-abi=softfp -mfpu=fpv5-d16 -w -x c++ -E -CC -DARDUINO=10607 -DARDUINO_PORTENTA_H7_M7 -DARDUINO_ARCH_MBED_PORTENTA -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=1 -IC:\Users\DTI_IP\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.2.1\cores\arduino -IC:\Users\DTI_IP\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.2.1\variants\PORTENTA_H7_M7 -DCM4_BINARY_START=0x08100000 -DCM4_BINARY_END=0x08200000 -IC:\Users\DTI_IP\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.2.1\cores\arduino/api/deprecated -IC:\Users\DTI_IP\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.2.1\cores\arduino/api/deprecated-avr-comp -iprefixC:\Users\DTI_IP\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.2.1\cores\arduino @C:\Users\DTI_IP\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.2.1\variants\PORTENTA_H7_M7/../PORTENTA_H7_M7/includes.txt C:\Users\DTI_IP\AppData\Local\arduino\sketches\74A735F375F606B1513B7BBC39716F57\sketch\Uart_Portenta.ino.cpp -o nul
Alternative pour EEPROM.h: [EEPROM@2.0]
ResolveLibrary(EEPROM.h)
-> candidates: [EEPROM@2.0]
In file included from C:\Users\DTI_IP\Desktop\IP\portenta\Uart_Portenta\Uart_Portenta.ino:1:0:
d:\DisqueOD\DTIIP\OneDrive - DUHAMEL DTI SAS\Documents\Arduino\libraries\EEPROM/EEPROM.h:26:10: fatal error: avr/eeprom.h: No such file or directory
#include <avr/eeprom.h>
^~~~~~~~~~~~~~
compilation terminated.
C:\Users\DTI_IP\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4/bin/arm-none-eabi-g++ -c -w -g3 -nostdlib @C:\Users\DTI_IP\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.2.1\variants\PORTENTA_H7_M7/defines.txt @C:\Users\DTI_IP\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.2.1\variants\PORTENTA_H7_M7/cxxflags.txt -mcpu=cortex-m7 -mfloat-abi=softfp -mfpu=fpv5-d16 -w -x c++ -E -CC -DARDUINO=10607 -DARDUINO_PORTENTA_H7_M7 -DARDUINO_ARCH_MBED_PORTENTA -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=1 -IC:\Users\DTI_IP\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.2.1\cores\arduino -IC:\Users\DTI_IP\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.2.1\variants\PORTENTA_H7_M7 -Id:\DisqueOD\DTIIP\OneDrive - DUHAMEL DTI SAS\Documents\Arduino\libraries\EEPROM -DCM4_BINARY_START=0x08100000 -DCM4_BINARY_END=0x08200000 -IC:\Users\DTI_IP\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.2.1\cores\arduino/api/deprecated -IC:\Users\DTI_IP\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.2.1\cores\arduino/api/deprecated-avr-comp -iprefixC:\Users\DTI_IP\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.2.1\cores\arduino @C:\Users\DTI_IP\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.2.1\variants\PORTENTA_H7_M7/../PORTENTA_H7_M7/includes.txt C:\Users\DTI_IP\AppData\Local\arduino\sketches\74A735F375F606B1513B7BBC39716F57\sketch\Uart_Portenta.ino.cpp -o nul
Alternative pour avr/eeprom.h: []
ResolveLibrary(avr/eeprom.h)
-> candidates: []
exit status 1

Compilation error: exit status 1

For me here
Serial1.begin(BAUD_UART, SERIAL_8N1, RXD1, TXD1);
It's to specify
BAUD_UART = specify which bauds I would like
SERIAL_8N1 = define "(SERIAL_STOP_BIT_1 | SERIAL_PARITY_NONE | SERIAL_DATA_8)"
TXD1 and RXD1 = pinout TX and RX used to this

Where is my mistake?

There is no form of the begin method, with those parameters:
Short form of answer:
Serial1 is hard coded to use specific pins:

Long form of answer:

UART/Hardware Serial is defined:

class UART : public HardwareSerial {
	public:
		UART(int tx, int rx, int rts = -1, int cts = -1);
		UART(PinName tx, PinName rx, PinName rts = NC, PinName cts = NC) : _tx(tx), _rx(rx), _rts(rts), _cts(cts) {}
		UART() {
			is_usb = true;
		}
		void begin(unsigned long);
		void begin(unsigned long baudrate, uint16_t config);
		void begin(unsigned long baudrate, uint16_t config, bool no_rx_pullup);
		void end();
		int available(void);
...

Which pins are used, is defined into the Serial1 instance of the Serial class.

Serial1 is defined in Arduino.h:
#define Serial1 _UART1_
The UART1 object is defined in Serial.cpp:

UART _UART1_(SERIAL1_TX, SERIAL1_RX, NC, NC);

And which pins are defined for this is defined in the variant.

#define SERIAL1_TX|||(digitalPinToPinName(PIN_SERIAL_TX))
#define SERIAL1_RX|||(digitalPinToPinName(PIN_SERIAL_RX))

where:

#define PIN_SERIAL_RX (13ul)
#define PIN_SERIAL_TX (14ul)

And in variant.cpp file g_APinDescription we have:

  { PA_10,        NULL, NULL, NULL },    // D13
  { PA_9,         NULL, NULL, NULL },    // D14
  Serial1.begin(BAUD_UART, SERIAL_8N1, RXD1, TXD1);
  Serial1.begin(BAUD_USB);

At the very least you do not need to use Serial.begin() twice

Where did you get the code from and what has it got to do with using EEPROM ?

If I good understand, it is therefore not possible to connect 2 sensors (UARTS connector) and 1 USB connection.

I've 2 sensors connected at on pc panel.
So I need :
/* Ports need: Serial USB Via Panel PC
Serial1 sensor T1
Serial2 sensor T2
In first I start serial port

Then sensor result it's write or read to other analyze

 float Write_Flash (float Var_On) {
 int Eaddress = 0;
 EEPROM.begin(1024);
 EEPROM.writeFloat(Eaddress, Var_On);//store the vatibale
 EEPROM.commit();
 delay(1000);
 return (Var_On);}

float Read_Flash (float Var_On) {
 int Eaddress = 0;

 EEPROM.begin(1024);
 EEPROM.get(Eaddress, Var_On);
 return (Var_On);}

Before I was using an ESP32 and now I am trying to use it on "portenta H7 Lite" but I don't have a "EEPROM.h" library.

Because that's the next error :smiley:

@isapon, a Portenta H7 is not an AVR based processor. It looks like you just downloaded an EEPROM library from somewhere in the hope it will work. Does the Portenta H7 have EEPROM?

Not quite. It seems we need to get past using a single Serial connection for two different sensors first

@isapon What sensors are you trying to read from ?

IT's external sensor

Ok, but what type of sensor ? Are they both the same ?

Please post a link to the sensor

Yes, in the hope that it works but without success. :frowning:
It's my first exercise in this language with this application but for now it's all failure.

It's same sensor.

So, how I can replace "eeprom.h"

Yes, but exactly which type of sensor ?
Does it even have a serial interface and, if so, what standard does it use ?

If you post a link we can look for ourselves

Do you have to use the Portenta or could you use a different board ?

I have a portenta H7 Lite

OK, but do you have to use that board ?

Yes my responsable would like use this board.
sensor KELLER PA (pressure) but it's not the problem in this cas ( I think)

That is not a sensor.

Does the sensor have an RS485 serial interface ?

Which one? Please post the link to that sensor so we know what you're talking about.

Concentrating on the EEPROM now. What is the purpose of the EEPROM? Storing measurements or storing configuration? If the former, how much data needs to be stored and how often?