This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3352: EEPROM Read sector wise command

Part Number: AM3352

Hi,

Please let me know how to read eeprom from u-boot# prompt using eeprom read  <bus> <devaddr> addr off cnt and write using eeprom write <bus> <devaddr> addr off cnt.

What address need to pass in addr and offset my chip is connected to 0x50 slave address.

I tried with with below and board resetting

U-Boot# eeprom read 0 0x50 0x10000 0 0x10 


EEPROM @0x50 read: addr 00010000 off 0000 count 16 ... data abort
pc : [<9ff90e8e>] lr : [<9ff8c675>]
reloc pc : [<8081fe8e>] lr : [<8081b675>]
sp : 9df46a18 ip : 431bde82 fp : 00010000
r10: 9ffc7a24 r9 : 9df50eb8 r8 : 9ffc7a13
r7 : 9df46a78 r6 : 00000000 r5 : 00000001 r4 : 44e0b000
r3 : 000000aa r2 : 9ffc7a24 r1 : 00001008 r0 : 00010001
Flags: nzCv IRQs off FIQs on Mode SVC_32 (T)
Code: f3bf 8f5f f10b 0001 (f88b) 3000
Resetting CPU ...

resetting ...
CCCCCCCC

Please help to solve this issue.

u-boot version u-boot-2019.01+gitAUTOINC+8b90adfb16-g8b90adfb16

Regards,

Subramanya

  • Hello Subramanya,

    Please, use this command.
    U-Boot# eeprom read 0 0x50 0x82000000 0 0x10

    Best regards,
    Kemal

  • Hi Kemal,

    Thanks i followed below commands to read

    U-Boot# eeprom read 0 0x50 0x82000000 0 0x10

    U-Boot# md 0x82000000

    U-Boot# eeprom write 0 0x50 0x5455 0 0x4

    i got following error

    U-Boot# eeprom write 0 0x50 0x5544 0 0x4

    EEPROM @0x50 write: addr 00005544 off 0000 count 4 ... data abort
    pc : [<9ff7229e>] lr : [<9ff90781>]
    reloc pc : [<8080129e>] lr : [<8081f781>]
    sp : 9df46a34 ip : 00000002 fp : 9ffb9c34
    r10: 9df51620 r9 : 9df50eb8 r8 : 9df46a48
    r7 : 9df46a48 r6 : 9df51f90 r5 : 00005544 r4 : 00000004
    r3 : 00000006 r2 : 00000000 r1 : 00005544 r0 : 9df46a42
    Flags: nZCv IRQs off FIQs on Mode SVC_32 (T)
    Code: bfc8 f811 3b01 bfa8 (f811) 4b01
    Resetting CPU ...

    Write is not happening is above command is correct to write eeprom.

    Regards,

    Subramanya

  • Hello Subramanya,

    Please, use this command.
    U-Boot# eeprom write 0 0x50 0x82000000 0 0x4

    Best regards,
    Kemal

  • Hi Kemal,

    Thanks. But data is not writing anything i need to write 12345. How to write

    U-Boot# eeprom write 0 0x50 0x82000000 0 0x4

    EEPROM @0x50 write: addr 82000000 off 0000 count 4 ... done
    U-Boot# eeprom read 0 0x50 0x82000000 0 0x10

    EEPROM @0x50 read: addr 82000000 off 0000 count 16 ... done
    U-Boot# md 0x82000000
    82000000: ffaa5511 00000000 9ff746a9 9ffd32c4 .U.......F...2..
    82000010: ffffffff ffffffff ffffffff ffffffff ................
    82000020: 00000424 29282c02 46040502 8a2882a0 $....,()...F..(.
    82000030: 85415204 220242aa 42444404 022b282a .RA..B.".DDB*(+.
    82000040: 51d54114 80a2200a 4c4505d9 206a8888 .A.Q. ....EL..j
    82000050: 42071901 a88aaaa0 10040151 22aa2808 ...B....Q....(."
    82000060: 03511040 a2e20a8a 03505404 888200a8 @.Q......TP.....
    82000070: 53815055 8290a2aa 34500003 0efa8288 UP.S......P4....
    82000080: 51201110 80890aa8 04115440 82a0a022 .. Q....@T.."...
    82000090: 51150028 2b8a8ba2 41a02515 2880a800 (..Q...+.%.A...(
    820000a0: 90010e20 e202aa82 8100c020 ee882820 ....... ... (..
    820000b0: 05000404 0200c2aa 7cc10404 882a22a0 ...........|."*.
    820000c0: 71309050 008a88a0 84124444 aa068086 P.0q....DD......
    820000d0: 90504041 22a222a2 05444351 82a82aa8 A@P.."."QCD..*..
    820000e0: 00a05111 028a84aa 5540224c 2aa020a3 .Q......L"@U. .*
    820000f0: 17141111 06aee280 41001501 88822a2a ...........A**..

    Please let me know how to write.

    Regards,

    Subramanya

  • U-Boot# mw 0x82000000 12345
    U-Boot# eeprom write 0 0x50 0x82000000 0 0x4

  • Hi Kemal,

    It worked only for 4bytes, i tried to write for 8byte it is not happening.

    U-Boot# mw 0x82000000 56789

    U-Boot# eeprom write 0 0x50 0x82000000 0 0x8

    U-Boot# eeprom read 0 0x50 0x82000000 0 0x8

    U-Boot# md 0x82000000
    82000000: 00056789 bbbbbbbb bbbbbbbb bbbbbbbb .g..............
    82000010: aaaabbbb aaaaaaaa aaaaaaaa aaaaaaaa ................
    82000020: bbbbbbbb bbbbbbbb bbbbbbbb bbbbbbbb ................
    82000030: bbbbbbbb bbbbbbbb bbbbbbbb bbbbbbbb ................
    82000040: 00000000 00000000 00000000 00000000 ................
    82000050: 00000000 00000000 00000000 00000000 ................
    82000060: bbbbbbbb bbbbbbbb bbbbbbbb bbbbbbbb ................
    82000070: bbbbbbbb bbbbbbbb bbbbbbbb bbbbbbbb ................
    82000080: bbbbbbbb bbbbbbbb bbbbbbbb bbbbbbbb ................
    82000090: bbbbbbbb bbbbbbbb bbbbbbbb bbbbbbbb ................
    820000a0: bbbbbbbb bbbbbbbb bbbbbbbb bbbbbbbb ................
    820000b0: bbbbbbbb bbbbbbbb bbbbbbbb bbbbbbbb ................
    820000c0: 00000000 00000000 00000000 00000000 ................
    820000d0: 00000000 00000000 00000000 00000000 ................
    820000e0: bbbbbbbb bbbbbbbb bbbbbbbb bbbbbbbb ................
    820000f0: bbbbbbbb bbbbbbbb bbbbbbbb bbbbbbbb ................

    Please let me know how to write to 32bytes.

    Also i have seen that whether eeprom will write maximum of 32bytes at one time?.

    OR we can give any bytes to write and read in eeprom.

    Regards,

    Subramanya

  • Please, refer to this page and this source code.

  • Hello Subramanya,

    If you are done with this thread, please close it by clicking on "This resolved my issue" button.

    Thanks,
    Kemal