This is the documentation for the latest (main) development branch. If you are looking for the documentation of previous releases, use the drop-down menu on the left and select the desired version.

EEPROM write,read

Overview

After the application starts, perform the following operations:

  1. Initialize I2C controller drive and EEPROM device drive

  2. Write a string from the EEPROM internal offset of 5

  3. Read a string from the EEPROM internal offset of 5

Requirements

  1. Demo uses EVB Board, EEPROM model is NV24C02, and I2C address on this board is 0x52; When using other board and EEPROM models, pay attention to modifying the configuration in the device table.

Building and flashing

Example location: examples/peripheral/eeprom Other exampleexamples/peripheral/i2c

For operations such as compiling and burning, please refer to: [Quick Start] (../../../../get_started/index. html # build function)

Running result

Successfully running will output the following logs

D/dt              [0.002] add device iflash
D/ptb             [0.002] partition table base 0xe000
D/ft              [0.002] ft_0 base 0, ft_1 base 1000
D/ft              [0.004] ft init too
D/ft              [0.004] ft init 1
D/main            [0.004] boot reason 0
D/main            [0.004] heap size 273160(266.76KB)
D/main            [0.006] flash size 0x200000(2MB)
I/example_eeprom  [0.006] eeprom write/read example.

D/dt              [0.006] add device i2c0
D/dt              [0.008] add device eeprom0
I/example_eeprom  [0.016] write end,len=24,ret=0
I/example_eeprom  [0.016] read end,ret=0
I/example_eeprom  [0.018] read OK:0123456789abcdefghijklmn