Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT




Loading

AT91SAM: data abort starting first task

Posted by Bernd Schuster on 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


RE: AT91SAM: data abort starting first task

Posted by Dave on 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.

RE: AT91SAM: data abort starting first task

Posted by Bernd Schuster on 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...)

RE: AT91SAM: data abort starting first task

Posted by Bernd Schuster on 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

RE: AT91SAM: data abort starting first task

Posted by Dave on November 23, 2009
I presume you are creating the queue before using it?

RE: AT91SAM: data abort starting first task

Posted by Bernd Schuster on 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...

RE: AT91SAM: data abort starting first task

Posted by Bernd Schuster on 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.

RE: AT91SAM: data abort starting first task

Posted by Richard on November 23, 2009
Tasks run in System mode. The kernel runs in Supervisor mode.

Regards.

RE: AT91SAM: data abort starting first task

Posted by Bernd Schuster on November 23, 2009
I`ve still another question:

; chip specific addresses and constants:
AT91C_BASE_PITCEQU0xFFFFFD30
PITC_PIVREQU8
AT91C_BASE_AICEQU0xFFFFF000
AIC_EOICREQU304 ; 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



RE: AT91SAM: data abort starting first task

Posted by MEdwards on November 23, 2009
Look the address up in the data sheet.

RE: AT91SAM: data abort starting first task

Posted by Bernd Schuster on 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.


RE: AT91SAM: data abort starting first task

Posted by Bernd Schuster on 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)


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS