1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 <2011> 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 <2011> 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: Handling failures in st.cmd |
From: | Till Straumann <[email protected]> |
To: | "Ernest L. Williams Jr." <[email protected]> |
Cc: | "[email protected]" <[email protected]> |
Date: | Thu, 12 May 2011 19:54:39 -0500 |
On 05/12/2011 07:07 PM, Ernest L. Williams Jr. wrote:
Till Straumann wrote:On 05/12/2011 05:22 PM, Zelazny, Michael Stanley wrote:If, for example, dbLoadRecords, initializing some hardware module, cd("some/dir"), etc. fails while an IOC is booting, is there any way to trap this in my st.cmd and take an action, such as abort the IOC boot?Under RTEMS (cexpsh shell -- every line is a C expression) you can easily do that (provided that the routine you want to trap returns a status) dbLoadRecords(...) && bsp_reset() will reset the board if dbLoadRecords() returns a non-zero value. However, rebooting is maybe not the best way to handle this since you will most likely end up in an endless loop (since the error condition doesn't go away with a reboot).What we really want is for the whole process to just stop. For example, in RTEMS if there is an undefined symbol the system errors out and stops.
On beatnik (and some other BSPs) you can do dbLoadRecords() && BSP_panic("dbLoadRecords failed") This will print a message to the console and wait for the user to press a key and only then proceed to reset the board. HTH -- Till
Or is that vxWorks, I am thinking of? -- ErnestHTH -- Till