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

STR912 GCC Tick problem

Posted 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 problem

Posted 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 problem

Posted 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 problem

Posted 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





[ 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