NULL pointer dereference in prvCheckDelayedTa

em1ssnuke wrote on Tuesday, 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

davedoors wrote on Wednesday, 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.

em1ssnuke wrote on Wednesday, 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 )

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

code snippet
…            "MRS    R0, CPSR        \n\t"    /* Get CPSR.                    */   
            "ORR    R0, R0, #0xC0    \n\t"    /* Disable IRQ, FIQ.            */   
            "MSR    CPSR, 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);

rtel wrote on Wednesday, 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.


em1ssnuke wrote on Wednesday, October 22, 2008:

No, this is the GCC/Yagarto tool chain example.