This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RM48L940: RTOS int vector address other than 0x0

Part Number: RM48L940

I have FreeRTOS that runs OK if linker is configured like this:

/***********************THIS MAP WORKS OK****************************/

/*----------------------------------------------------------------------------*/
define memory mem with size = 4G;

define region VECTORS = mem:[from 0x00000000 size 0x00000020];
define region KERNEL = mem:[from 0x00000020 size 0x00008000];
define region FLASH = mem:[from 0x00008020 size 0x00177FE0]
| mem:[from 0x00180000 size 0x00180000];
define region STACK = mem:[from 0x08000000 size 0x00000800];
define region KRAM = mem:[from 0x08000800 size 0x00000800];
define region RAM = mem:[from (0x08000800+0x00000800) size (0x0003F800 - 0x00000800)];
define block HEAP with size = 0x800, alignment = 8{ };

initialize by copy {readwrite};
do not initialize {section .noinit};

place in VECTORS {readonly section .intvecs};
place in KERNEL {readonly section .kernelTEXT};
place in FLASH {readonly};
place in RAM {readwrite section .kernelHEAP};
place in KRAM {readwrite section .kernelBSS};
place in RAM {readwrite};
place in RAM {block HEAP};
/*----------------------------------------------------------------------------*/

When I start from any other address like shown below, the RTOS stalls when it's creating the first task.

It stalls on the instruction "BaseType_t xRunningPrivileged = prvRaisePrivilege()" in xTaskCreate function below. My registers before and after are also shown below.

It vectors to address 0x8 (why isn't it vectoring to address 0x10108 if it's a real vPortSWI?). How should I define my linker cmd file and init vector table?

BaseType_t MPU_xTaskCreate( TaskFunction_t pxTaskCode, const char * const pcName, const uint16_t usStackDepth, void * const pvParameters, UBaseType_t uxPriority, TaskHandle_t * const pxCreatedTask )
{
	BaseType_t xReturn;
	BaseType_t xRunningPrivileged = prvRaisePrivilege();
	xReturn = xTaskCreate( pxTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask );
	portRESET_PRIVILEGE( xRunningPrivileged );
	return xReturn;
}

/***********************THIS MAP DOES NOT WORK****************************/

/*----------------------------------------------------------------------------*/
define memory mem with size = 4G;

define region VECTORS = mem:[from 0x00010100 size 0x00000020];
define region KERNEL = mem:[from 0x00010120 size 0x00008000];
define region FLASH = mem:[from 0x00018120 size 0x00167EE0]
| mem:[from 0x00180000 size 0x00180000];
define region STACK = mem:[from 0x08000000 size 0x00000800];
define region KRAM = mem:[from 0x08000800 size 0x00000800];
define region RAM = mem:[from (0x08000800+0x00000800) size (0x0003F800 - 0x00000800)];
define block HEAP with size = 0x800, alignment = 8{ };

initialize by copy {readwrite};
do not initialize {section .noinit};

place in VECTORS {readonly section .intvecs};
place in KERNEL {readonly section .kernelTEXT};
place in FLASH {readonly};
place in RAM {readwrite section .kernelHEAP};
place in KRAM {readwrite section .kernelBSS};
place in RAM {readwrite};
place in RAM {block HEAP};
/*----------------------------------------------------------------------------*/

 


 

  • Hello,

    The CPU has fixed addresses that it uses for exception vectors. These are all within the address 0x00000000 to 0x00000020, called VECTORS in your original linker command file. If you want your vectors to be starting at an offset of 0x10100, you would still need a "jump table" at the original exception vectors' location. So a reset would first jump to 0x0 and from there it would branch to 0x10100, and so on.

    Regards,
    Sunil