AT91SAM: data abort starting first task

bernd07 wrote on Monday, November 23, 2009:

Hi,

I want to use freeRTOS together with the AT91SAM9263 controller. At the moment I always get a data abort error at this position:

vPortStartFirstTask
portRESTORE_CONTEXT

It seams that there`s somehting not defined - but I don`t know what… At the starting point, I use one sample project from freeRTOS, and made only a few changes according to this controller.

Here`s my main-function:

int main( void )
{
/* Setup the ports. */
prvSetupHardware();

/* Setup the IO required for the LED’s. */
vParTestInitialise();

vStartLEDFlashTasks( mainFLASH_PRIORITY );

vTaskStartScheduler();

return(0);

The scheduler will be started.

I hope someone could give me some hints to find this error…

best regards
Bernd  

davedoors wrote on Monday, November 23, 2009:

Do you set the SAM9 into Supervisor mode before calling main()? It must be in Supervisor mode before portRESTORE_CONTEXT is called doing this before main() is called in normally the easiest way of achieving this.

bernd07 wrote on Monday, November 23, 2009:

ah ok… now the led is flashing - but only for a short time, then I also get a data abort error…. (within the vListInsert() function…)

bernd07 wrote on Monday, November 23, 2009:

I found the reason for this second data abort:
the pxList item is 0x00!

vTaskPlaceOnEventList( &( pxQueue->xTasksWaitingToSend ), xTicksToWait );

It seams that pxQueue->xTasksWaitingToSend  is 0x00 and therefore  the pxList item is 0x00:

Which tasks are essential to be initializied at the startup? I think this problem will occur, because I didn`t made any inits to the queues?

best regards
Bernd

davedoors wrote on Monday, November 23, 2009:

I presume you are creating the queue before using it?

bernd07 wrote on Monday, November 23, 2009:

I didn`t create any queue… I only use the “simple” example from freeRTOS…

vStartLEDFlashTasks( mainFLASH_PRIORITY );

That`s the only function befor the scheduler starts… 

bernd07 wrote on Monday, November 23, 2009:

by the way: it is only important to be in the supervisor mode if I start the scheduler? vTaskStartScheduler();

Because within the normal user functions, the arm mode is always the user mode.

rtel wrote on Monday, November 23, 2009:

Tasks run in System mode.  The kernel runs in Supervisor mode.

Regards.

bernd07 wrote on Monday, November 23, 2009:

I`ve still another question:

; chip specific addresses and constants:
AT91C_BASE_PITC EQU 0xFFFFFD30
PITC_PIVR EQU 8 
AT91C_BASE_AIC EQU 0xFFFFF000
AIC_EOICR EQU 304 ; 130 ; 304

Is the definition for AIC_EOICR correct? Because in the “AT91SAM9263.H” header file:
#define AIC_EOICR       (AT91_CAST(AT91_REG *) 0x00000130)

Moreover if someone had a idea why the led task is only running for round about 10sec - I appreciate the solution *g*

regards

edwards3 wrote on Monday, November 23, 2009:

Look the address up in the data sheet.

bernd07 wrote on Tuesday, November 24, 2009:

if I change this setting according to the data sheet from the controller, the led is not flashing at all. The prvIdleTask() is running the whole time.

bernd07 wrote on Tuesday, November 24, 2009:

everything is working fine now: the problem was the dbug interface (which was not installed and therefore the default printf() call in the IdleTaks generates an data abort).

best regards (and many thanks for your help)