Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT




Loading

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.

Regards.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS