Quality RTOS & Embedded Software

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




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) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists