Home Neural Network Nios II software hold/lockup with an exception

Nios II software hold/lockup with an exception

0
Nios II software hold/lockup with an exception

[ad_1]

Hi there, All,

 

Whereas we run this system, we randomly received an exception with the reason for -1 (unknown purpose).  The exception occurred in the identical assertion however not at all times occurred when the assertion is executed.  If no exception handler is added, the software program simply hold or lockup.

1. The exception:
The exception-causing assertion is:
// Allow to boost the fifo nearly empty (AE) interrupt.
altera_avalon_fifo_write_ienable(FIFO_CSR_BASE, ALTERA_AVALON_FIFO_IENABLE_AE_MSK);

its corresponding meeting code are proven under (or within the hooked up image named ExceptionAssemblyCode.png)ExceptionAssemblyCode.png

The precise exception code line is “mov r2,zero”.

The next assertion is known as earlier than calling altera_avalon_fifo_write_ienable():
// Clear the fifo nearly empty (AE) interrupt.
altera_avalon_fifo_clear_event(FIFO_CSR_BASE, ALTERA_AVALON_FIFO_EVENT_AE_MSK);

2. Operate altera_avalon_fifo_write_ienable() implementation:
int altera_avalon_fifo_write_ienable(alt_u32 handle, alt_u32 masks)
{
IOWR_ALTERA_AVALON_FIFO_IENABLE(handle, masks);
if(IORD_ALTERA_AVALON_FIFO_IENABLE(handle) == masks)
return ALTERA_AVALON_FIFO_OK;
else
return ALTERA_AVALON_FIFO_IENABLE_WRITE_ERROR;
}

#outline IOWR_ALTERA_AVALON_FIFO_IENABLE(base, information)
IOWR(base, ALTERA_AVALON_FIFO_IENABLE_REG, information)

#outline IORD_ALTERA_AVALON_FIFO_IENABLE(base)
IORD(base, ALTERA_AVALON_FIFO_IENABLE_REG)

 

3. Processor and Improvement Setting:
It runs within the Cyclone V NIOS II processor. One fifo driver for 2K fifo peripheral is developed with the altera_avalon_fifo capabilities.
It makes use of the uCOS-II real-time OS. The appliance was developed with Quartus II Software program model 13.0.1.123,
which is put in with QuartusSetup-13.0.1.232.exe. The Nios II 13.0sp1 Software program Construct Instruments for Eclipse was a part of the set up and was used.

 

4. What we’ve got performed:
4.1 Turned on the stack overflow debug, no stack overflow exception occurred.
4.2 Tried to make use of the hard-coded values as an alternative of symbolic constants and added the essential part as flows, the identical exception nonetheless occurred.
// FIFO_CSR_BASE = 0x610020
// ALTERA_AVALON_FIFO_EVENT_AE_MSK = 0x08
// ALTERA_AVALON_FIFO_IENABLE_AE_MSK = 0x08
OS_ENTER_CRITICAL();
altera_avalon_fifo_clear_event(0x610020, 0x08);
altera_avalon_fifo_write_ienable(0x610020, 0x08);
OS_EXIT_CRITICAL();
4.3 Tried so as to add the time-delay or yield as follows. The identical exception nonetheless occurred.
IOWR_ALTERA_AVALON_FIFO_EVENT(0x610020, 0x08);
__asm(“nop”);
if((IORD_ALTERA_AVALON_FIFO_EVENT(0x610020) & 0x08) != 0)
{
printf(“ALTERA_AVALON_FIFO_EVENT_CLEAR_ERRORn”);
}
__asm(“nop”);
IOWR_ALTERA_AVALON_FIFO_IENABLE(0x610020, 0x08);
__asm(“nop”);
if(IORD_ALTERA_AVALON_FIFO_IENABLE(0x610020) != 0x08)
{
printf(“ALTERA_AVALON_FIFO_IENABLE_WRITE_ERRORn”);
}
__asm(“nop”);
4.4 After activate the “enable_instrtruction_related_exceptions” with the re-issue of the exception-causing
assertion within the added exception handler, the identical exception nonetheless occurred however stored transferring ahead
with none influence to the software program efficiency, that’s, the software program accomplished what anticipated to do.

 

May you assist to seek out the basis reason behind the exception? Any answer to it?

Thanks.

 

Sincerely

Patrick

 

 

[ad_2]