Skip to content

Commit 0b9cd60

Browse files
committed
Updated with crash report region info and new diagrams added
1 parent 8c48a24 commit 0b9cd60

File tree

7 files changed

+8
-5
lines changed

7 files changed

+8
-5
lines changed

docs/design-documents/platform/crash-reporting/crash_reporting.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,22 @@ System should implement mechanism to track number of times the system has auto-r
6767

6868
The below diagram shows overall architecture of crash-reporting implementation.
6969

70-
![System architecture and component interaction](./diagrams/crash-report1.jpg)
70+
![System architecture and component interaction](./diagrams/crash-report-seq.jpg)
7171

7272
As depicted in the above diagram, when the system gets into fatal error state the information collected by error and fault handlers are saved into RAM space allocated for Crash-Report. This is followed by a auto-reboot triggered from error handler. On reboot the the initialization routine validates the contents of Crash-Report space in RAM. This validation serves two purposes - to validate the captured content itself and also it tells the system if the previous reboot was caused by a fatal error. It then reads this information and calls an application defined callback function passing the crash-report information. The callback is invoked just before the entry to main() and thus the callback implementation may access libraries and other resources as other parts of the system have already initialized(like SDK, HAL etc) or can just capture the error information in application space to be acted upon later.
7373

7474
# Detailed design
7575

7676
### Error information collection including exception context
7777

78-
Current error and exception handling implementation in Mbed OS already collects error and exception context. But currently these data structures are implemented as statically allocated memory locations. With this feature these data structures should be placed in an uninitialized RAM region so that the data is retained after auto-reboot(warm-reset). So, this should be allocated as a dedicated region using linker command file(or in scatter file) for the corresponding target for each toolchain. Also note that this region should be marked as uninitialized region using the right toolchain attributes. For example, for ARM compiler we can define a new section as below:
78+
Current error and exception handling implementation in Mbed OS already collects error and exception context. But currently these data structures are implemented as statically allocated memory locations. With this feature these data structures should be placed in an uninitialized RAM region so that the data is retained after auto-reboot(warm-reset). So, this should be allocated as a dedicated region using linker command file(or in scatter file) for the corresponding target for each toolchain. Also note that this region should be marked as uninitialized region(not zero initialized) using the right toolchain attributes. For example, for ARM compiler we can define a new section as below:
7979
```
80-
RW_m_crash_data m_crash_report_ram_start EMPTY m_crash_report_ram_size { ; Dedicated Region to store crash report data
80+
RW_m_crash_data m_crash_report_ram_start EMPTY m_crash_report_ram_size { ; Dedicated Region to store crash report data m_crash_report_ram_size = 256 bytes
8181
}
8282
```
83-
Note that the actual location of the data should be carefully chosen without affecting the current usage of other regions such as interrupt table region, flash configuration area etc. The absolute location of this Crash-Report RAM region may also differ for each target.
83+
Note that the actual location of the data should be carefully chosen without affecting the current usage of other regions such as interrupt table region, flash configuration area etc. The absolute location of this Crash-Report RAM region may also differ for each target. The size of this RAM region should be 256 bytes. And internally the implementation would use the 256 byte region as two sub-areas with 128 bytes each. The upper 128 bytes will be used to store the fault context and the lower 128 bytes for error context, as shown in the diagram below.
84+
85+
![Crash report region](./diagrams/crash-report-region.jpg)
8486

8587
### Mechanism to auto reboot(also called warm-reset) the system without losing RAM contents where error info is stored
8688

13.6 KB
Loading
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<mxfile userAgent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36" version="9.3.1" editor="www.draw.io" type="device"><diagram id="eb75ea10-d55d-edb6-ffc6-9548d3b38861" name="Page-1">3VZNj9sgEP01kdpDJRsnTnJMstn2stJqt1LbIzYTGy0xLsb56K/vYOP4A6dNpbSHrhQtPJgZ5r0Z8CTY7E8fFc3TJ8lATIjHTpPgYUII8cIF/jPIuUZ8n4Q1kijOLNYCr/wHWNCzaMkZFL2NWkqhed4HY5llEOseRpWSx/62nRT9qDlNwAFeYypc9AtnOq3Rxcxr8U/Ak7SJ7Ht2JaLxW6Jkmdl4ExLsqr96eU8bX3Z/kVImjx0o2E6CjZJS16P9aQPCkNvQVts9Xlm9nFtBpm8xCGqDAxWlTf2RlkIjtJGZhpMZfcCfT1BSb33WqAoJcUOwjhSOEjOyqehzQ19FAJgQHi4fU67hNaexWT1ixSCW6r3AmY/DHRdiI4VUlS3SBWEcI15oJd+gs8Lmy8jzLvEOoPCAV/P2L2ximYLcg1Zn3NLU6MIKYCt0OrXzYys3aURNO1I3dtRWWHJx3bKMA0v0OOmhQ3rDaZHTrGF1i3WsbhECw3Xt7qoGm8GCTcfUWJAoCMO/o8aM/EM15lfV0DRCDi+0WjCSeK0NQeUgqTmW4ElW+Qy/l6al1zEyAqqdN2YbRQtj8QK5VEbrl9WT22jvXkBTnqGWxJMH48dTEOFl8d7d+1lqatIks9DcS4OCMcfrH9iAbhYuwv4or7HLoo3HbjqEAcdIN3hfoUHhV23Tq+5+FWcyg0HJW6hJ0KYVrE15c3wfVnZhzxkzYUbbqd9w9+gPf9m/rTy3PwIy0h/kDv2xHOmPAdH4iuVmuBNwWpnnF9OGjNnhQyxoUfD4lxdN6NGlP6/s8HxfLXfV5Ft38gyKYwpGlAp07qWLo/qUwJyXfsA6flpQlYDuPIiuEB2iZyM8N5gCQTU/9COOkW8jPEue6Y7O5Mqr1LgoZKlisFbdZ33oaN53FPoDR3XKjqOqFi5p31QejedOfayiQopSY2N6QsZIiMzce4BBjiVSmJssazX4/bfFf9PUA4mmgdvT/uI+PY3T9pOy1rj9cA+2PwE=</diagram></mxfile>
69.3 KB
Loading
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<mxfile userAgent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36" version="9.3.1" editor="www.draw.io" type="device"><diagram id="58887138-f8ca-3a51-ea37-682e74172fa5" name="Page-1">3Vvbbts4EP0aA+lDAutq5dFJ03axW7RIim37tKAkSuaWFrUUndj9+uVVN8qJ4tiumwBNxSHFy5zhzOFQmXjXy/V7CsrFR5JCPHGn6XrivZ24rjsNI/6fkGyUxJnOZkqSU5RqWSO4Qz+haailK5TCqtOQEYIZKrvChBQFTFhHBiglD91mGcHdUUuQQ0twlwBsS7+ilC2UNAqmjfwDRPnCjOxMdU0Mkh85JatCjzdxvUz+qO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5phcEAafjo/N1+OfVgyjwrBOQ0CjwWN0FkVDMbS+bd1DDHX6B83Q5kF1vOzcofqXLw+i4Ziv7vaUBHEm1hXrSaU6TjiKz/rXP8HO13PBRTfbGRp723dio8/vnRclNnix+dMN1bz5Axnv5n8=</diagram></mxfile>
Binary file not shown.

docs/design-documents/platform/crash-reporting/diagrams/crash-report1.xml

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)