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 Team in Blogs on December 17, 2018

About Symmetry Electronics Team

Established in 1998, Symmetry Electronics is a focused global distributor of wireless connectivity solutions, sensors, and audio-video technologies. Offering comprehensive design support and available-to-ship inventory, Symmetry is committed to helping engineers accelerate time to market, reduce costs, and offer modern solutions for their IoT designs. Acquired by the Berkshire Hathaway company TTI, Inc. in 2017, Symmetry Electronics is headquartered in Los Angeles with international offices in Mexico, Canada, and China.

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 Team in Blogs on December 17, 2018

About Symmetry Electronics Team

Established in 1998, Symmetry Electronics is a focused global distributor of wireless connectivity solutions, sensors, and audio-video technologies. Offering comprehensive design support and available-to-ship inventory, Symmetry is committed to helping engineers accelerate time to market, reduce costs, and offer modern solutions for their IoT designs. Acquired by the Berkshire Hathaway company TTI, Inc. in 2017, Symmetry Electronics is headquartered in Los Angeles with international offices in Mexico, Canada, and China.

Why partner with Symmetry Electronics? Symmetry's technical staff is specially trained by our suppliers to provide a comprehensive level of technical support. Our in-house Applications Engineers provide free design services to help customers early in the design cycle, providing solutions to save them time, money and frustration. Contact Symmetry for more information.

Browse

See all tags

Subscribe

Stay up to date with industry and supplier news!