Quality RTOS & Embedded Software

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




Loading

NULL pointer dereference in prvCheckDelayedTa

Posted by Robert Warner on October 21, 2008
I keep getting a __dapt() on execution of the Demo for ARM7_AT91SAM7X256_Eclipse. On the first call to vTaskIncrementTick() it attempts to find if a timeout has expired using prvCheckDelayedTasks(). Unfortunately, it appears prvInitialiseTaskLists() has not executed prior to this point and pxDelayedTaskList has a NULL pointer for it. This causes all kinds of problems.

Any idea why initializations are not preformed prior to allowing ticks to generate? Has this already been found out? (I did browse/search this list and did not find any thing.) Is there a patch for this potential issue?

thnx - bob

RE: NULL pointer dereference in prvCheckDelayedTa

Posted by Dave on October 22, 2008
The tick interrupt is configured as the scheduler is started and after interrupts have been disabled. Interrupts will not be enabled again until the first task is running. This means provided you have created some tasks to run you should not get any tick interrupts until everything has been initialized. The lists get initialized when the first task is created.

RE: NULL pointer dereference in prvCheckDelayedTa

Posted by Robert Warner on October 22, 2008
The problem is on restart after a system reset. The PIT timer does not appear to be disabled upon reinitialization.

code snippet:
static void prvSetupHardware( void )
{
portDISABLE_INTERRUPTS();
...

and portDISABLE_INTERRUPTS() does not appear to disable all interrupts, only IRQ and FIQ

code snippet
..."MRSR0, CPSR\n\t"/* Get CPSR.*/\
"ORRR0, R0, #0xC0\n\t"/* Disable IRQ, FIQ.*/\
"MSRCPSR, R0\n\t"/* Write back modified value.*/\
...

So ... i added the following and it now works as expected.

code snippet:
static void prvSetupHardware( void)
{
AT91F_PITDisableInt( AT91C_BASE_PITC);
portDISABLE_INTERRUPTS();
...

RE: NULL pointer dereference in prvCheckDelayedTa

Posted by Richard on October 22, 2008
Are you using IAR tools? If so the most likely cause is that the debugger macro file (which contains scripts that are run on debug events, such as reset) is not correctly clearing the interrupt peripherals. Look for a file in the debugger settings that has a .mac extension.

Regards.

RE: NULL pointer dereference in prvCheckDelayedTa

Posted by Robert Warner on October 22, 2008
No, this is the GCC/Yagarto tool chain example.


[ 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