Configuring the fatal error handler

Nick Withers nick.withers at anu.edu.au
Tue Sep 15 22:49:52 UTC 2015


On Tue, 2015-09-15 at 15:58 +0200, soja-misc at aries.uberspace.de wrote:
> Hi,
> 
> We have problems configuring the fatal error handler in RTEMS.
> Following 
> the documentation we did the following:
> 
> void
> fatalErrorHandler(Internal_errors_Source source, bool isInternal, 
> uint32_t errorCode);
> 
> rtems_extensions_table User_extensions = {
> 	NULL,	// task_create_extension,
> 	NULL,	// task_start_extension
> 	NULL,	// task_restart_extension
> 	NULL,	// task_delete_extension,
> 	NULL,	// task_switch_extension,
> 	NULL,	// task_begin_extension
> 	NULL,	// task_exitted_extension
> 	&fatalErrorHandler		// fatal_extension
> };
> 
> #define CONFIGURE_INITIAL_EXTENSIONS	User_extensions
> 
> #define CONFIGURE_INIT
> 
> #include "system.h"
> 
> void
> fatalErrorHandler(Internal_errors_Source source, bool isInternal, 
> uint32_t errorCode)
> {
> 	printf("Fatal error handler: %i, %i, %lu\n", source,
> isInternal, 
> errorCode);
> 	while (1)
> 	{
> 	}
> }
> 
> "system.h" has mainly the configuration options for number of 
> tasks/semaphores/etc.
> 
> Now if I call rtems_fatal_error_occurred in my init task like below I
> would expect to get a printout of the fatalErrorHandler function, but
> I 
> only get the message from before. Is there something else necessary
> to 
> register the error handler?

Don't know that this helps, but I use this formulation successfully on
the MVME3100:
____

void fatal_extension(Internal_errors_Source the_source,
                     bool                   is_internal,
                     Internal_errors_t      the_error);

#define CONFIGURE_INITIAL_EXTENSIONS { .fatal = fatal_extension }
____

I think a printk() would be preferred over a printf() in the handler,
too (but am not sure about that).

> rtems_task task_system_init(rtems_task_argument /*ignored*/)
> {
>      printf("Do fatal error\n");
>      rtems_fatal_error_occurred(33);
> 
> }
> 
> Best regards,
> 
>     Jan
> _______________________________________________
> users mailing list
> users at rtems.org
> http://lists.rtems.org/mailman/listinfo/users



More information about the users mailing list