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


Crashing in vPortSVCHandler on SAM3S

Posted by dibosco on October 29, 2014

Not sure whether anyone will be able to help with this. I'm having a really odd situation where FreeRTOS is crashing in vPortSVCHandler when the relocated version of the code has been loaded by a [custom] bootloader. If the version of FreeRTOS code loaded by the bootloader - which is relocated to 0x410000 - is loaded directly by Crossworks, it works correctly.

However, even though the code that is loaded by the bootloader looks identical to that loaded by Crossworks, I'm crashing at the line:

bx r14

It takes me to a hard fault handler.

The registers look the same in both cases (I can run the bootloader in the debugger and then let it take me through to the code loaded by the bootloader and see the source code by loading an additional elf file of the relocated file). In other works, what's in r14, r0 etc look the same whether the code that's running is what's been loaded by the bootloader or whether I directly run the relocated code the bootloader loads. (I hope this makes sense.)

So, does anyone have any pointers or suggestions as to why it should crash in the last line of vPortSVCHandler in the version loaded by the bootloader?

I'm not sure what other details to give.

The code works fine in a SAM4S (albeit slightly modified for that architecture).

Would be most grateful for any suggestions/pointers.

Many thanks!

Crashing in vPortSVCHandler on SAM3S

Posted by rtel on October 30, 2014

Normally when there are problems with bootloaders it is because the vector base address register has not been set correctly, but I don't think that applies in this case as you have entered the SVC handler correctly.

What is in the r14 register? Does it match the expected address of the function you want to jump to (the first task presumably) or does it contain an exec return value.


[ 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