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

Usage fault exception when calling vPortSVCHandler

Posted by ltancerel on November 8, 2013

Hello, I am running an evaluation of FreeRTOS to run a custom HW embedding Cortex-M3 core. As my HW is not available, I used LM3S811_GCC demo as it is close to what I am targeting.

I run the demo inside Eclipse, and qemu-system-arm to avoid buying other HW and was successful in building, linking and starting the demo.

However I am getting wrong behavior when calling prvPortStartFirstTask() when executing "svc 0" instruction, it is jumping onto vPortSVCHandler as expected. However, at that point lr = 0xFFFFFFF9 whereas before that instruction, I had lr = 0x0000079F Note that I get LR being at that value upon breakpoint onto vPortSVCHandler, as for some reason the debugger seems to be puzzled by "svc 0" call.

As such, when executing : "bx lr" in the vPortSVCHandler, I am getting the UsageFault exception

I would like to know if I am doing anything wrong, I did not make any specific changes compared to initial demo. From ARM instruction set, I don't see why LR is changing.

Although I am out of usual FreeRTOS bounds with my QEMU emulation, I would appreciate any help regarding this issue. Could that come from emulation itself ?

Thanks, Ludovic


Usage fault exception when calling vPortSVCHandler

Posted by richardbarry on November 8, 2013

As a general (ish) rule we are extremely shy of attempting to support anything that is running on an emulator. Experience shows that most issues reported are in the emulator, and it proves to be a huge time sink with no benefit.

However, in this case, take a look at the ARMv7M architecture manuals, and you will see that you in fact do expect LR to change when entering an exception. What you are seeing in the EXC_RETURN value, which tells the hardware how to behave when returning from the exception. The real LR value is safely on the stack, ready to be popped off on exception exit.

Regards.


[ 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