README.rst
1.. zephyr:code-sample:: edac
2 :name: EDAC shell
3 :relevant-api: edac_interface
4
5 Test error detection and correction (EDAC) using shell commands.
6
7Overview
8********
9
10This sample demonstrates the :ref:`EDAC driver API <edac_api>` in a simple EDAC shell sample.
11
12Building and Running
13********************
14
15The sample can be built as follows for the :ref:`intel_ehl_crb` board:
16
17.. zephyr-app-commands::
18 :zephyr-app: samples/subsys/edac
19 :host-os: unix
20 :board: intel_ehl_crb
21 :goals: build
22 :compact:
23
24The Zephyr image that's created can be run on the :ref:`intel_ehl_crb` board
25as per the instructions in the board documentation. Check out the
26:ref:`intel_ehl_crb` for details.
27
28Sample output
29*************
30
31Getting help
32============
33
34After the application has started help can be read with the following
35command:
36
37.. code-block:: console
38
39 uart:~$ edac -h
40 edac - EDAC information
41 Subcommands:
42 info :Show EDAC information
43 edac info <subcommands>
44 inject :Inject ECC error commands
45 edac inject <subcommands>
46
47Help for subcommand info can be read with:
48
49.. code-block:: console
50
51 uart:~$ edac info -h
52 info - Show EDAC information
53 edac info <subcommands>
54 Subcommands:
55 ecc_error :ECC Error Show / Clear commands
56 parity_error :Parity Error Show / Clear commands
57
58Injection help can be received with:
59
60.. code-block:: console
61
62 uart:~$ edac inject -h
63 inject - Inject ECC error commands
64 edac inject <subcommands>
65 Subcommands:
66 param1 :Get / Set injection param 1
67 param2 :Get / Set injection param 2
68 trigger :Trigger injection
69 error_type :Get / Set injection error type
70 disable_nmi :Disable NMI
71 enable_nmi :Enable NMI
72 test_default :Test default injection parameters
73
74Testing Error Injection
75=======================
76
77Set Error Injection parameters with:
78
79.. code-block:: console
80
81 uart:~$ edac inject addr 0x1000
82 Set injection address base to: 0x1000
83
84 uart:~$ edac inject mask 0x7fffffffc0
85 Set injection address mask to 7fffffffc0
86
87 uart:~$ edac inject error_type correctable
88 Set injection error type: correctable
89
90Trigger injection with:
91
92.. code-block:: console
93
94 uart:~$ edac inject trigger
95 Triggering injection
96
97Now Read / Write to the injection address to trigger Error Injection with
98following devmem commands:
99
100.. code-block:: console
101
102 uart:~$ devmem 0x1000 32 0xabcd
103 Mapped 0x1000 to 0x2ffcf000
104
105 Using data width 32
106 Writing value 0xabcd
107
108 uart:~$ devmem 0x1000
109 Mapped 0x1000 to 0x2ffce000
110
111 Using data width 32
112 Read value 0xabcd
113
114We should get the following message on screen indicating an ECC event:
115
116.. code-block:: none
117
118 Got notification about ECC event
119