Search Symmetry
Close
  1. Home
  2. Symmetry Blog
  3. From Silicon Labs: "Micrium OS and ASSERTs"

From Silicon Labs: "Micrium OS and ASSERTs"

Symmetry Electronics in Blogs on December 17, 2018

About Symmetry Electronics

Established in 1998, Symmetry Electronics, a Division of Braemac, is a global distributor of electronic components and systems. Combining premier components and comprehensive value-added services with an expert in-house engineering team, Symmetry supports engineers in the design, development, and deployment of a broad range of connected technologies. 

Exponential Technology Group Member

Acquired by Berkshire Hathaway company TTI, Inc. in 2017, Symmetry Electronics is a proud Exponential Technology Group (XTG) member. A collection of specialty semiconductor distributors and engineering design firms, XTG stands alongside industry leaders TTI Inc., Mouser Electronics, and Sager Electronics. Together, we provide a united global supply chain solution with the shared mission of simplifying engineering, offering affordable technologies, and assisting engineers in accelerating time to market. For more information about XTG, visit www.xponentialgroup.com.

If you work with Micrium OS, chances are you will eventually encounter some macro prefixed with RTOS_ASSERT which traps your task in an infinite loop.  Micrium OS has two types of ASSERTs, Critical ASSERTs and Debugging ASSERTs. The former type of ASSERT is intended to catch severe errors which may prevent the system from functioning normally such as a module failing to initialize correctly. On the other hand, Debugging ASSERTs are used to catch ordinary errors returned from an API call so that they are found quickly while debugging. However, the question naturally arises: should my system crash because I passed a bad delay value to OSTimeDly?


 

There are a few options to customize how these conditions are handled in your system.

1. You can disable debugging ASSERTs, which will also disable error checking. This is recommended once the project is stable and ready for production.

2. You can force the ASSERTs to return a value, with some caveats.

In order to make these changes, you must modify this section of rtos_cfg.h.

 


Option 1 requires changing the MASK to RTOS_CFG_MODULE_NONE.



Option 2 requires modifying the DBG macro so that it returns the error value.



However, you must be careful not to use any ASSERT_DBG() macros at the top level of your task; you may unintentionally return from the task if you do so.

 

For more details on ASSERTs, please refer to the following pages:

https://doc.micrium.com/display/OSUM50500/Micrium+OS+Asserts+Programming+Guide

https://doc.micrium.com/display/OSUM50500/RTOS+Compile-Time+Configuration

 

Source: https://www.silabs.com/community/blog.entry.html/2018/12/05/choosing_a_socketap-vfC5 

 

Looking to integrate Silicon Labs products with your design? Our Applications Engineers offer free design and technical help for your latest designs. Contact us today!

Share

Symmetry Electronics in Blogs on December 17, 2018

About Symmetry Electronics

Established in 1998, Symmetry Electronics, a Division of Braemac, is a global distributor of electronic components and systems. Combining premier components and comprehensive value-added services with an expert in-house engineering team, Symmetry supports engineers in the design, development, and deployment of a broad range of connected technologies. 

Exponential Technology Group Member

Acquired by Berkshire Hathaway company TTI, Inc. in 2017, Symmetry Electronics is a proud Exponential Technology Group (XTG) member. A collection of specialty semiconductor distributors and engineering design firms, XTG stands alongside industry leaders TTI Inc., Mouser Electronics, and Sager Electronics. Together, we provide a united global supply chain solution with the shared mission of simplifying engineering, offering affordable technologies, and assisting engineers in accelerating time to market. For more information about XTG, visit www.xponentialgroup.com.

Subscribe

Stay up to date with industry and supplier news!

Browse

See all tags