Skip to main content
MLowe.3
Associate
January 13, 2022
Question

Where is ISR vector table and C startup file in CubeIDE?

Hi, where can I access the ISR vector table and C startup file in cube IDE? In Atmel Studio it's listed in startup folder as startup_sam but I can't find it in cube.

This topic has been closed for replies.

6 replies

Tesla DeLorean
Guru
January 13, 2022

Find-in-files "HardFault_Handler"

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
char_array
Associate III
January 13, 2022

The startup file is an s-file found in Core/Startup. The vector is stored in flash and called g_pfnVectors. For the length of the vector table you can count the number of items in this table (and multiply by 4 to get the the length in bytes), or check the datasheet/manual (sometimes you need to know the exact processor/device category for the size).

In C/C++ you can use it like this:

extern uint32_t g_pfnVectors[VECTORTABLE_SIZE/4];

If there is a clean way to get VECTORTABLE_SIZE I'd like to know it. I successfully moved the table to RAM using VTOR (examples can be found in ARM documentation). Make sure the table in RAM is aligned properly. Cortex-M CPUs require the vector table to be aligned to a boundary width of the lowest power of 2 that will fit the entire vector table.

MLowe.3
MLowe.3Author
Associate
January 13, 2022

I dont see any a startup folder or s files in core folder in ide.

MLowe.3
MLowe.3Author
Associate
January 13, 2022

Hmm, I made a different project but used the "include library" button and it comes up now, interesting. For atmel studio the vector table is a struct given a section name which is placed at a certain address by the linker.

TDK
January 13, 2022

It wasn't always in Core/Startup. It used to be in its own Startup folder. No doubt expanding all folders or doing a search would reveal it. It would also be listed when you compile the project, if it exists.

Search -> File...

"If you feel a post has answered your question, please click ""Accept as Solution""."