README.rst
1.. zephyr:code-sample:: flash-shell
2 :name: Flash shell
3 :relevant-api: flash_interface
4
5 Explore a flash device using shell commands.
6
7Overview
8********
9
10This is a simple shell module that allows arbitrary boards with flash
11driver support to explore the flash device.
12
13Building and Running
14********************
15
16This project can be built and executed on as follows:
17
18.. zephyr-app-commands::
19 :zephyr-app: samples/drivers/flash_shell
20 :host-os: unix
21 :board: qemu_x86
22 :goals: run
23 :compact:
24
25Sample Output
26=============
27
28.. code-block:: console
29
30 uart:~$ flash page_info 0
31 Page for address 0x0:
32 start offset: 0x0
33 size: 4096
34 index: 0
35 uart:~$ flash erase 0x1000
36 Erase success.
37 uart:~$ flash write 0x1000 0x12345678 0x9abcdef0
38 Write OK.
39 Verified.
40 uart:~$ flash write 0x1000 0x11111111
41 Write internal ERROR!
42 uart:~$ flash read 0x1000 0x10
43 00001000: 78 56 34 12 f0 de bc 9a ff ff ff ff ff ff ff ff |xV4..... ........|
44
45 uart:~$ flash write 0x101c 0xabcd1234
46 Write OK.
47 Verified.
48 uart:~$ flash read 0x1000 0x20
49 00001000: 78 56 34 12 f0 de bc 9a ff ff ff ff ff ff ff ff |xV4..... ........|
50 00001010: ff ff ff ff ff ff ff ff ff ff ff ff 34 12 cd ab |........ ....4...|
51