peretuset wrote on Sunday, June 15, 2014:
Hello all,
I am about to finish porting FreeRTOS v8.0.1 to the Texas Instruments
CC2538 SoC (Cortex M3 + 802.15.4 radio) for an IoT platform named
OpenMote (http://www.openmote.com/). The basics are already working just
fine (I have a demo with tasks and semaphores using SysTicks), but I am
stuck trying to get tickless support to work. I developed my own
vPortSetupTimerInterrupt, vPortSuppressTicksAndSleep and
SleepTimerHandler functions based on those of the Atmel SAM examples but
replacing the ASF functions from the Atmel library with those of the
Texas Instruments library (which by the way is not as great since it
does no comply to CMSIS). I have also installed the SleepTimerHandler to
the interrupt table.
If I try my RTC code outside of FreeRTOS it works just fine, the uC goes
to low-power mode until the RTC expires and the process is repatead on
and on without problems. However, when I integrate it with FreeRTOS it
stops working. It looks like the interrupt is fired the first time but
does not continue to fire any more. The FreeRTOSConfig.h looks like the
following:
#define configCPU_CLOCK_HZ 16000000
#define configSYSTICK_CLOCK_HZ 32768
#define configUSE_TICKLESS_IDLE 1
#define configTICK_RATE_HZ ( ( TickType_t ) 128 )
#ifdef __NVIC_PRIO_BITS
#define configPRIO_BITS __NVIC_PRIO_BITS
#else
#define configPRIO_BITS 4 /* 15 priority
levels */
#endif
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0x0F
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 10
#define configKERNEL_INTERRUPT_PRIORITY (
configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
#define configMAX_SYSCALL_INTERRUPT_PRIORITY (
configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
If I disable the configUSE_TICKLESS_IDLE and configure the appropriate
values for the clocks then the demo works just fine, so I asume the
vector table and the interrupt priorities are fine.
Any other ideas where I could look at?
Regards,
Pere