Skip to content

Commit 9c7a061

Browse files
committed
show how to access the EEPROM with stm8flash
1 parent 3eded85 commit 9c7a061

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

docs/api/EEPROM.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,36 @@ void loop()
199199
delay(100);
200200
}
201201
```
202+
203+
204+
## Accessing the EEPROM using `stm8flash`
205+
206+
207+
Write simple test data:
208+
209+
```bash
210+
$ echo -n "abcdefgh" > testdata.bin
211+
$ hd testdata.bin
212+
00000000 61 62 63 64 65 66 67 68 |abcdefgh|
213+
00000008
214+
$ stm8flash -c stlinkv2 -p "stm8s103?3" -s eeprom -w testdata.bin
215+
Determine EEPROM area
216+
Due to its file extension (or lack thereof), "testdata.bin" is considered as RAW BINARY format!
217+
8 bytes at 0x4000... OK
218+
Bytes written: 8
219+
```
220+
221+
read the current EEPROM content:
222+
223+
```bash
224+
$ stm8flash -c stlinkv2 -p "stm8s103?3" -s eeprom -r e2.img
225+
Determine EEPROM area
226+
Due to its file extension (or lack thereof), "e2.img" is considered as RAW BINARY format!
227+
Reading 640 bytes at 0x4000... OK
228+
Bytes received: 640
229+
$ hd e2.img
230+
00000000 61 62 63 64 65 66 67 68 00 00 00 00 00 00 00 00 |abcdefgh........|
231+
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
232+
*
233+
00000280
234+
```

0 commit comments

Comments
 (0)