CORTEX_VTOR_INIT

Discussions and support about ChibiOS/RT, the free embedded RTOS.
alexblack
Posts: 277
Joined: Mon Sep 24, 2012 3:52 pm
Been thanked: 33 times

CORTEX_VTOR_INIT

Post by alexblack »

Hi.
In readme.txt is now written:
- VAR: Cortex-M VTOR initialization is now performed in startup files and
no more in port initialization.
But I can't find any mention of CORTEX_VTOR_INIT constant. How to initialise a Cortex VTOR now?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: CORTEX_VTOR_INIT

Post by Giovanni »

Hi,

It is done automatically in the startup file. It is loaded with the start address of the vectors segment (see ld files).

Giovanni
alexblack
Posts: 277
Joined: Mon Sep 24, 2012 3:52 pm
Been thanked: 33 times

Re: CORTEX_VTOR_INIT

Post by alexblack »

How about KEIL and IAR?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: CORTEX_VTOR_INIT

Post by Giovanni »

Not implemented yet but will be aligned.

Giovanni
Al B
Posts: 24
Joined: Thu Jun 09, 2016 4:01 am
Been thanked: 2 times

Re: CORTEX_VTOR_INIT for IAR

Post by Al B »

Hi,

I have an IAR implementation that does VTOR initializations as well as interrupt and process stack initializations to 0x55.

Includes all the modified IAR project and .icf files for L476, and modified generic cstartup.s and vectors.s files, and is working fine for me. Should be easy enough to modify for any other STM32 processor.

Problem is, I am new to this group and can't see how to go about posting this.
Suggestions and pointers to procedures on how best to do this would be most appreciated.

Thanks,
Al
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: CORTEX_VTOR_INIT

Post by Giovanni »

Hi Al,

Just attach it in this thread zipped.

Giovanni
Al B
Posts: 24
Joined: Thu Jun 09, 2016 4:01 am
Been thanked: 2 times

Re: CORTEX_VTOR_INIT

Post by Al B »

Hi Giovanni,

Here are the IAR related files that I modified.
Hopefully that it covers all of the changes.
There are also some minor L4xx related typos and things included.
I commented out the VTOR initialization in my local copy of base files (not included), which corresponds to your removal of it in the latest Chibios main stream.
And I deleted all other files from the .zip that weren't changed.

I addition, I also added a readme.txt file in the IAR folder to give guidance on usage and on how to modifying it to handle new processors/boards.

Let me know if you have any problems, or if any suggestions on changes.

Thanks,
Al
Attachments
RT-STM32L476RG-NUCLEO-IAR.zip
(596.85 KiB) Downloaded 599 times
Al B
Posts: 24
Joined: Thu Jun 09, 2016 4:01 am
Been thanked: 2 times

Re: CORTEX_VTOR_INIT for IAR

Post by Al B »

Hi,

Was adding heap initialization code to analyze some code, and noticed that I submitted an incorrect cstartup.s file.
Here is the correct one including the heap initialization routine, along with all the corresponding IAR files for the L476RG-Nucleo board.
Note there are some minor doc changes in these files as well.

Sorry about that,
Al
Attachments
IAR.zip
(7.08 KiB) Downloaded 610 times
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: CORTEX_VTOR_INIT

Post by Giovanni »

Hi,

I merged the startup file but not the demo files, the code needs to be compatible with trunk version, the demo is done for 16.1.x.

Giovanni
Al B
Posts: 24
Joined: Thu Jun 09, 2016 4:01 am
Been thanked: 2 times

Re: CORTEX_VTOR_INIT

Post by Al B »

Hi Giovanni,

That's great. I presume by startup file you mean both the cstartup.s and the vector.s.

Just for my info, does the trunk generally have the latest verified code, and the latest branch (like 16.1.x) is experimental?
What is the trunk based off of, 2.6, 3.0 or what?
i.e. where is the best place to branch from to create L476 projects?

I'll bring the IAR parts onto a L476 trunk project and submit that in a bit.

Thanks,
Al
Post Reply