Error with GPIOTE interrupt configuration nRF5340

Hi.

I have following error:

gen_isr_tables.py: error: multiple registrations at table_index 13 for irq 13 (0xd)

Existing handler 0x31a7d, new handler 0x9df1

Here is my prj.conf : 

# Peripheral drivers

# I2C
CONFIG_NRFX_TWIM1=y

# Timer
CONFIG_NRFX_TIMER2=y

# GPIO
CONFIG_NRFX_GPIOTE0=y
CONFIG_NRFX_GPIOTE_NUM_OF_EVT_HANDLERS=5

# Flash
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y

# Others
CONFIG_NRFX_PWM0=y
CONFIG_NRFX_SPIM2=y
CONFIG_NRFX_RNG=y
CONFIG_NRFX_UARTE0=y
CONFIG_NRFX_NVMC=y

# BLE
CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DEVICE_NAME_DYNAMIC=y
CONFIG_BT_CTLR_CONN_RSSI=y
CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y
CONFIG_BT_MAX_CONN=1

# Power management
CONFIG_POWEROFF=y
CONFIG_RESET_ON_FATAL_ERROR=y

# Logging
CONFIG_USE_SEGGER_RTT=y

# Enable printf floating point support beware this take up to 7ko of flash
CONFIG_CBPRINTF_FP_SUPPORT=y

# Build options
CONFIG_BUILD_NO_GAP_FILL=y
CONFIG_MAIN_STACK_SIZE=8192

# Needed to share interrupts line and avoid irq conflict? see https://docs.zephyrproject.org/latest/kernel/services/interrupts.html#sharing-interrupt-lines
# CONFIG_SHARED_INTERRUPTS=y


I would like to avoid using CONFIG_SHARED_INTERRUPTS.
Only GPIOTE0 is on IRQ number 11 so I couldn't have connected this number twice. The only way is I have connected GPIOTE0 IRQ twice, but I don't understand how.
Here is how I connect the IRQ:
    IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(0)), IRQ_PRIO_LOWEST,
                NRFX_GPIOTE_INST_HANDLER_GET(0), 0, 0);
By searching IRQ_CONNECT and IRQ_DIRECT_CONNECT in my IDE, I don't see any doubled instruction. Others IRQ_CONNECT are for other perihperal (that can't have the same number if I got this correctly).
What am I missing? Thank you for your help
  • Hi, I workarounded the issues, but I still don't understand why I faced these, and explanation is welcomed. I commented both the init and the connect on my gpiote, assuming that zephyr is doing it fine. If I need it in the future, I'll init and connect the other port. Regarding the I2C, I switched to the I2C2 instead of I2C1. As you see it is a workaround, I didn't solved the original issue. More specifically, why is the IRQ of I2C1 is being connected before main()? Knowing this will allow me to have more control on my firmware. Thank you for your help

  • As I do not have your code, I can not say what you are doing, but regarding the IRQ of I2C1 instance, that would be of the initialization of driver, and as per the driver code (.c file), they have different priority of getting init (like pre-kernel or post-kernel etc).

  • I am aware there are pre/post kernel init, I just wasn't able to find what was causing IRQ of I2C1 to connect automatically. Currently, I have CONFIG_NRFX_TWIM2=y and I can connect the IRQ in my program. With I2C1 somehow, it would be connected twice, and I wasn't able to find why. It might be an issue on my side so I think the case can be closed

Related