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] [January 2008 Threads] STR912 GCC Tick problemPosted by bosa on January 31, 2008 I ported FreeRTOS IAR to GCC using Ride. I can to create a Task for test and run good when I don´t use delay. So when I use vTaskDelayUntil the scheduler never finish, and the kernel never return to execute the task. In debug mode, I found out the problem occur in WDG_IRQHandler, because in assemble debug the instruction don´t start in begin of the function, but start in the instruction os reset the WDG (WDG->SR &= ~0x0001;) and after execute the vPortEnterCritical and vPortExitCritical and return to WDG Reset, and so on.
My kernel can´t use task delay because this problem.
How to solve this problem?
Jefferson
RE: STR912 GCC Tick problemPosted by Richard on February 1, 2008 I'm not sure if I understand the description of your problem exactly. I am assuming you are using the watchdog peripheral to generate the tick interrupt. Is this correct?
I've just checked the STR75x RIDE port to see how the interrupt is set up. In this example the file crt0_STR75x_FreeRTOS.s has been updated to place the vPortTickISR handler on the TB peripheral (would be the watchdog peripheral in your case). Also the IRQ handler itself is written as:
IRQHandler:
portSAVE_CONTEXT/*; Save the context of the current task. */
LDR r0, =EIC_base_addr LDR r1, =IVR_off_addr LDR lr, =ReturnAddress /*; Load the return address. */ ADD pc,r0,r1/*; Branch to the IRQ handler. */ ReturnAddress: LDR r0, =EIC_base_addr LDR r2, [r0, #CICR_off_addr]/*; Get the IRQ channel number. */ MOV r3,#1 MOV r3,r3,LSL r2 STR r3,[r0, #IPR_off_addr]/*; Clear the corresponding IPR bit. */
portRESTORE_CONTEXT/*; Restore the context of the selected task. */
to ensure the context is saved prior to the branch to vPortTickISR.
This is just one method of doing this, whereby the context is saved and restored by a single IRQ handler before jumping to the peripheral handler. Other examples jump directly to the peripheral handler where the handler can decide if it needs to save and restore the context of not.
vPortTickISR is defined within portISR.c, which must be compiled into ARM mode.
How have you setup your interrupt?
Regards.
RE: STR912 GCC Tick problemPosted by Ben on February 1, 2008 I have got a GCC port working for the STR9, although at the moment it is only running 1 task with a vTaskDelayUntil to flash an LED. I based it on a STR75c GCC port.
I have it configured to use any one of the 4 timers, I wanted to keep the watchdog timer free in case I needed to use it as a watchdog.
I am using it with Eclipse, but you are welcome to a copy if it will help you.
Ben
RE: STR912 GCC Tick problemPosted by bosa on February 1, 2008 Hi, my interrupt was setuped using same as port ARM9 IAR. I use the file boot.s that I got in site st.com in example an2551.
My IRQ handler itself is written as: IRQHandler: portSAVE_CONTEXT LDR r0, =VIC0VECT LDR r0, [r0] LDR r1, =VIC1VECT LDR r1, [r1] MOV lr, pc BX r0 LDR r0, =VIC0VECT STR r0, [r0] LDR r1, =VIC1VECT STR r1, [r1] portRESTORE_CONTEXT
And the SWIHandler itself is written as: SWIHandler: ADDLR, LR, #4 portSAVE_CONTEXT LDR R0, =vTaskSwitchContext MOV lr, pc BX R0 portRESTORE_CONTEXT
The instructions in portmacro.h , the portDISABLE_INTERRUPTS() and portENABLE_INTERRUPTS() are the same the port ARM7_STR75x_GCC.
And I didn´t use the portISR.c, because I do everything in the port.c. Maybe here is my problem.
Ben, could you send your port for my email?
Thanks
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|