This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

vsprintf crash at interrupt context

Hello all,
why does the following code crash when called from interrupt context, if I turn on all compiler optimizations? the call to vsprintf causes an access violation, even when run on the simulator.

void software_error(const char* a_fmt, ...)
{
	char 	l_buffer[0x80] ;
	va_list l_arg_ptr ;

	PSW_IEN = 0 ;

	va_start(l_arg_ptr, a_fmt) ;
	vsprintf(l_buffer, a_fmt, l_arg_ptr) ;
	va_end(l_arg_ptr) ;

	printf("SOFTWARE ERROR:%s\n", l_buffer) ;

        operational_LED_off() ;
	error_LED_on() ;

	rtos_invoke_failure_hook() ;

	while(1) ; // hang here
}

0