Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7708479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:37:21+00:00 2026-06-01T00:37:21+00:00

I asked this question on the SCB forum but got no answer I’m trying

  • 0

I asked this question on the SCB forum but got no answer
I’m trying to port some projects from uVision ide to SCB.
The problems began with the implementation of vector table. For examle, I have simple C++ code

#define STACK_TOP 0x20000800
typedef void (*handler_ptr)();

void ResetHandler() { while (1); }
void NMIHandler() { while (1); }
void HardFaultHandler() { while (1); }

__attribute__ ((section("vectors"))) handler_ptr const vector_table[] = {
    (handler_ptr) STACK_TOP,
    ResetHandler,
    NMIHandler,
    HardFaultHandler,
};

This code does not compile, because SCB library looking for “int main(void)” declaration.
Ok, I can add this function, but then SCB ignores my vector table implementation and use own (if I call function which address in VT, I see SCB dummy handlers).

How can i rewrite SCB VT implementation by mine?
Please do not offer the use of special SC3 functions names (it’s not good to support with 2 IDE’s) or move vector table to another memory location.

__attribute__ ((section(".isr_vector"))) void (* const g_pfnVectors[])(void)

from Luminary Micro’s “startup_gcc.c – Startup code for use with GNU tools” has no effect too

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T00:37:22+00:00Added an answer on June 1, 2026 at 12:37 am

    When it comes to low-level C extensions for embedded support, you’re unlikely to get away with a single approach for both compilers. Even the official CMSIS distribution from ARM still has separate startups for every supported compiler.

    However, what might work better than the explicit table declaration is not include it. Just declare the handlers you do want to implement; the CMSIS startups usually mark their own stubs as WEAK functions, so yours will take priority. However, you need to make sure you use the standard names for handlers as expected by the linker (e.g. Reset_Handler, NMI_Handler, WWDG_IRQHandler and so on). See CMSIS docs and source files for more info.

    NB: One thing to watch out for is to make sure to add the extern "C" marker if you’re compiling as C++ – otherwise the linker won’t see your handlers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(I asked this question in another way , and got some interesting responses but
I asked this question yesterday got a pretty good answer but can't figure out
I asked this question before and got a great working answer. what is the
i asked this question before but haven't been able to get an answer.. i
Was asked this question recently and did not know the answer. From a high
I asked this question earlier today. After trying out suggestions from a few members,
I asked this question awhile ago, but didn't get a usuable answer. Basically, I
I asked this question a while ago and got an answer that I thought
I asked this question and got an excellent answer (thanks!). Part of the problem
I've asked this question here , but I don't think I got my point

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.