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


SVC_Handler and PendSV_Handler

Posted by vincent on October 21, 2011
I am working FreeRTOS in CortexM3 platform. As we know, we need define the following code in startup.s to make sure FREERTOS work.
DCD vPortSVCHandler ; FreeRTOS SVC handler
DCD SVC_Handler ; SVCall Handler
DCD DebugMon_Handler ; Debug Monitor Handler
DCD 0 ; Reserved
DCD xPortPendSVHandler ; FreeRTOS PendSV Handler
DCD PendSV_Handler ; PendSV Handler

But I found that USB otg code will call SVC_Handler and PendSV_Handler when communication with mass storage device.
So, it seems not possible that merge USBOTG function in FreeRTOS environment …

Anyone meet this question ?

RE: SVC_Handler and PendSV_Handler

Posted by Richard on October 21, 2011
I don't know where your USBOTG software came from, not from me that's for sure. If it is using such a major core resource such as SVC then I would imagine it comes with instructions on how to integrate it into you code.

FreeRTOS only uses an SVC 0 call. It uses it once only, to start the scheduler, and then never uses it again. You therefore have three choices:

1) Move the vector table into RAM, then when the kernel has started, rewrite the SVC handler entry to use the USB OTG code.

2) Have two copies of the vector table, one in flash with the FreeRTOS handler as per normal, and one in RAM with the USB handler. Then, when the scheduler has started, remap the vector table using the vector base address register.

3) Update the FreeRTOS handler so it checks the SVC call parameter. Currently it assumes only one thing is using the SVC call, so it does not bother to check it and just assumes it is 0.


RE: SVC_Handler and PendSV_Handler

Posted by vincent on October 24, 2011

first, thanks for your adivise..the usb otg code from ST... I use ST cortex M3 platform..its OTG code refers to SVC handler. ST guys develop a new file system library to operate USB file operation...I think method3 is ok for me .do you help support it ?

RE: SVC_Handler and PendSV_Handler

Posted by vincent on October 26, 2011

I checked FreeRTOS code and find that it call " svc 0" to trigger svc handler...so it is possible to get the parameter of svc handler. would you help to get the parameter in svc_handler function ... if this, I could dispath them to different svcaller ..
thank you

[ 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