Difference: AssertationLogging (3 vs. 4)

Revision 42021-12-31 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
%DASHBOARD{ section="banner"
Line: 9 to 9
 
Intro
For severe failures e.g. stack overflow the only way to recover for embedded systems is a reset (warm restart, abort). Other asserts (unknown events) can be ignored because they do not have fatal consequences. But for debugging during the development cycle, all asserts should be observed. Therefore Mecrisp-Cube has two types of asserts: fatal asserts and non-fatal asserts. The non-fatal asserts can be ignored in production systems.
Changed:
<
<
After a fatal assert nothing can be considered as working, even the return from a subroutine can be not possible anymore. Therefore the file system cannot be used and the log can only be written after a restart.
>
>
After a fatal assert nothing can be considered as working, even the return from a subroutine can be not possible anymore. Therefore the file system cannot be used and the log can only be written after a warm restart.
  RTC registers are used for accounting the asserts. Those registers are not affected by the reset. After the restart the registers are evaluated and the information is written to the log.
Line: 24 to 24
 fatalassert ( flag n u -- ) abort if flag is false, log n and u after restart assert ( flag n u -- ) abort if flag is false and assertion is activated, log n and u after restart assert? ( -- flag ) Was there an assert?
Changed:
<
<
assert# ( -- u ) How many aseerts occured since cold startup? assert@ ( -- n u ) Assert number and parameter e.g. address where the assert occured
>
>
assert# ( -- u ) How many asserts occurred since cold startup? assert@ ( -- n u ) Assert number and parameter e.g. address where the assert occurred
 .assert ( n u -- ) Print assert message
Changed:
<
<
If logging is activated the logs are written to /var/log/messages
>
>
If logging is activated (CFG_LOG_MSG defined) the logs are written to 0:/var/log/messages

A cold restart is a CPU reset with RTC domain reset. A warm restart is a CPU reset without RTC domain reset.

 

Implementation

Deleted:
<
<
/var/log/messages
  https://en.wikipedia.org/wiki/Assertion_(software_development)
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback