Skip to main content
Visitor II
September 9, 2020
Solved

usage of i2c read command in U-Boot

  • September 9, 2020
  • 2 replies
  • 2136 views

Hi,

I have a custom board with a ST32MP157C and a 24AA025E48 on a i2c bus.

In the U-Boot, I want to read the MAC address located in the 24AA025E48 on the i2c bus 1 at address 0x53 at offset 0xFA.

When I can use the following commands it works (MAC Address: 80:1F:12:36:36:7B)

STM32MP> i2c dev 1

Setting bus to 1

STM32MP> i2c md 53 FA 6

00fa: 80 1f 12 36 36 7b ...66{

STM32MP>

but when i use the i2c read it does not answer anything.

STM32MP> i2c read 53 1 6 FA

STM32MP>

what is wrong with the command ?

who can i do to store the result in a variable in order to change the board ethernet mac address ?

Thanks.

    This topic has been closed for replies.
    Best answer by KnarfB

    > what is wrong with the command ?

    The i2c read command takes the same parameters as md plus one last parameter which is a MPU memory address. The values are read from I2C and written to that memory address, not dumped to the console.

    2 replies

    KnarfBAnswer
    Super User
    September 9, 2020

    > what is wrong with the command ?

    The i2c read command takes the same parameters as md plus one last parameter which is a MPU memory address. The values are read from I2C and written to that memory address, not dumped to the console.

    TJann.1Author
    Visitor II
    September 10, 2020

    Hello,

    thanks, now it works with the command i2c read 53 FA 6 C0000000

    best regards.