FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [April 2013 Threads] vTaskDelay and vTaskDelayUntil not workingPosted by mcufan on April 29, 2013 Hi,
I have retargeted the LPC2106 GCC demo for my LPC2138 MCU based on the Rowley 2138 demo. Everything seems to work fine except for vTaskDelay and vTaskDelayUntil. It seems that whenever I call any of these it just stucks there forever. I have not disabled the interrupts. Unfortunately I don't have access to a debugger, so I am only relying on LEDs for now. I enable a LED then call vTaskDelay or vTaskDelayUntil, then it will never reach the code part to disable the LED. Do you have any idea what can cause such behavior? By the way if I replace vTaskDelay with an own crappy delay function (like counting to 0xFFFFF) the code works as expected.
RE: vTaskDelay and vTaskDelayUntil not workingPosted by Richard on April 29, 2013 I would guess you have not installed the tick interrupt handler correctly - but unless you can connect a debugger it is pure speculation.
See the special note to Cortex-M users in FAQ 1 on the following page: http://www.freertos.org/FAQHelp.html
Regards.
RE: vTaskDelay and vTaskDelayUntil not workingPosted by mcufan on April 29, 2013 Hi richardbarry,
I understand what you mean. But how does it work for 2106 then? It uses the same GCC/ARM7_LPC2000/port.c as my project, and it does not define these interrupt handlers in its FreeRTOSconfig.h you mention on the FAQ page. Since I don't have an LPC2106 I have not tried that demo without modification, but I can see it uses vTaskDelay, and it works. Anyways I will try that and see if it works. Thanks!
Regards.
RE: vTaskDelay and vTaskDelayUntil not workingPosted by Richard on April 29, 2013 Sorry - my mistake - you are correct that the page I directed you to is relevant only to microcontrollers with Cortex-M cores, whereas you are using an ARM7 core. The 2106 needs vPortYieldProcessor() to be installed on the SWI interrupt vector to manage taskYIELD() calls, and the IRQ vector to autovector to the correct interrupt for timer ticks. On the 2106 that is done using a vector table something like the following in the startup code (assuming you have not changed the timer configuration in the 2106 port layer): b _start /* reset handler */ ldr pc, _undf /* undefined handler */ ldr pc, _swi /* SWI handler */ ldr pc, _pabt /* program abort handler */ ldr pc, _dabt /* data abort handler */ nop /* reserved */ ldr pc, [pc,#-0xFF0] /* IRQ set to read VIC directly */ ldr pc, _fiq /* FIQ handler */
_undf: .word __undf /* undefined */ _swi: .word vPortYieldProcessor /* FreeRTOS Yield. */ _pabt: .word __pabt /* program abort */ _dabt: .word __dabt /* data abort */ _fiq: .word __fiq /* FIQ */
Ensure the tick and yield handler entry points are compiled to ARM instructions (as opposed to THUMB instructions). Regards.
RE: vTaskDelay and vTaskDelayUntil not workingPosted by mcufan on May 2, 2013 Thank you Richard. I think the problem was with the serialISR routines. When I rewrote it to use UART1 instead of UART0 I must have missed something and probably it kept the whole MCU blocked before the scheduler could even start. I started everything again from the LPC2106 example and everything works correctly now.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|