This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

where is the interrupt vector table for nrf5340?

I am evaluating the nRF5340, but cannot run a simple register based interrupt. Within nRF connect v1.2.0, I can find vector tables for nRF52840, and many other parts, but nothing for nRF5340.

The chip is working OK, but the interrupt routines are not being called. Does this sort of code, that works great on the nRF52840 (our current solution) work on nRF5340?

Any help appreciated! BTW we cannot use zephyr. We have been successful since the introduction of nRF51822, and through nRF52840 programming using registers, works great, and want to continue, but maybe we have to stop with 52840?

void setupTimer(void) {

  NRF_TIMER2_S->TASKS_STOP = 1;
  NRF_TIMER2_S->MODE = TIMER_MODE_MODE_Timer;
  NRF_TIMER2_S->BITMODE = TIMER_BITMODE_BITMODE_32Bit;
  NRF_TIMER2_S->PRESCALER = 0;
  NRF_TIMER2_S->TASKS_CLEAR = 1;
  NRF_TIMER2_S->SHORTS = 1;
    NRF_TIMER2_S->CC[0] = 1000;

  NRF_TIMER2_S->INTENSET = (1UL << TIMER_INTENSET_COMPARE0_Pos);

  NVIC_EnableIRQ(TIMER2_IRQn);
  NRF_TIMER2_S->TASKS_START = 1;
}

void TIMER2_IRQHandler(void) {
  NRF_TIMER2_S->EVENTS_COMPARE[0] = 0;

}

Parents
  • Hi,

    The default (reset) location of the vector table is address 0x00000000. In fact the Cortex M33 has two vector tables, and the locations (INITSVTOR and INITNSVTOR) are both set to 0 by default. See Vector table with the Security Extension for details.

    You should be able to work with the nRF5340 in the same way as before, and you can use it in secure mode only, removing the complication of the secure/non-secure partitioning. You would typically have to handle the two cores though, regardless of your CPU processing needs, since specific peripherals are accessible from either the application core or network core, but not both.

  • OK thanks for the encouragement! I'm still not sure exactly what to do next.

    Do I stay with nRF Connect and Zephyr? Or is there a .emProject file that I can open with ses, like we did with nRF52840?

    When I'm asking about "where is the vector table", I was looking for something like ses_startup_nrf5340.s.

    Such files exist for 52840 in

    /v1.2.0/modules/lib/openthread/third_party/NordicSemiconductor/nrfx/mdk/ses_startup_nrf52840.s

    But /v1.2.0/...... has nothing for 5340.

    Any chance you can point me to an example project, or make a new one, that gets me started with bare bones programming?

    Super appreciate your help!

Reply
  • OK thanks for the encouragement! I'm still not sure exactly what to do next.

    Do I stay with nRF Connect and Zephyr? Or is there a .emProject file that I can open with ses, like we did with nRF52840?

    When I'm asking about "where is the vector table", I was looking for something like ses_startup_nrf5340.s.

    Such files exist for 52840 in

    /v1.2.0/modules/lib/openthread/third_party/NordicSemiconductor/nrfx/mdk/ses_startup_nrf52840.s

    But /v1.2.0/...... has nothing for 5340.

    Any chance you can point me to an example project, or make a new one, that gets me started with bare bones programming?

    Super appreciate your help!

Children
  • Hi,

    I see now that the question was more generic then I read it.

    JayHurleyRingo said:
    Do I stay with nRF Connect and Zephyr? Or is there a .emProject file that I can open with ses, like we did with nRF52840?

    You can access registers directly and skip Zephyr and nRF Connect SDK altogether, but that means that you have to build everything yourself without an SDK, only having the MDK or potentially the nrfx drivers (which are platform-independent). Since the code snippet in your question did just that I did not elaborate on this. However, if you want to make a real decently advanced product, then doing everything yourself is probably not feasible and certainly not efficient. So in that case, using the nRF Connect SDK (including Zephyr) is the only supported approach. There is no SES project for the nRF Connect, but there is a special Nordic edition of SES which can open and configure Zephyr projects in SES (see Building with SES).

    JayHurleyRingo said:
    When I'm asking about "where is the vector table", I was looking for something like ses_startup_nrf5340.s.

    I see. In that case you can refer to the MDK (which is part of nRF Connect SDK, but can also be downloaded separately here). There you for instance have gcc_startup_nrf5340_network.S.

    JayHurleyRingo said:
    Any chance you can point me to an example project, or make a new one, that gets me started with bare bones programming?

    We do not provide any examples of that. As mentioned the nRF5340 is an advanced device, and barebones programming is not a practical option for real product development.

Related