I have been trying to implement the IPC code given in Problems of using nrfx IPC to send an event from the network core to the application core. I added CONFIG_NRFX_IPC=y the prj.conf for both cores. Whenever I try to build, I get the following error:
gen_isr_tables.py: error: multiple registrations at table_index 42 for irq 42 (0x2a)
Existing handler 0x5261, new handler 0x80b9
Has IRQ_CONNECT or IRQ_DIRECT_CONNECT accidentally been invoked on the same irq multiple times?
My cpunet code:
/// @note Network Core
// System Includes
#include <zephyr.h>
#include <logging/log.h>
#include <nrfx_ipc.h>
// Project Includes
#include "ipc.h"
LOG_MODULE_REGISTER(ipc, LOG_LEVEL_DBG);
void ipc_event_handler(uint32_t event_mask, void * p_context)
{
ARG_UNUSED( p_context );
printk( "callback %d\r\n", event_mask );
}
void ipc_init( void )
{
IRQ_CONNECT (IPC_IRQn, IRQ_PRIO_LOWEST, nrfx_ipc_irq_handler, 0, 0 );
nrfx_err_t err = nrfx_ipc_init( 0, ipc_event_handler, NULL );
if (err != NRFX_SUCCESS)
{
LOG_ERR( "nrfx_ipc_init() failed. Error 0x%x\r\n", err );
}
nrfx_ipc_send_task_channel_assign( 0, 0 );
}
void ipc_sendSignal( uint8_t sigNum )
{
nrfx_ipc_signal( sigNum );
LOG_INF( "Sending IPC %d\n", sigNum );
}
My cpuapp code:
/// @note Application Core
// System Includes
#include <zephyr.h>
#include <logging/log.h>
#include <nrfx_ipc.h>
// Project Includes
#include "ipc.h"
LOG_MODULE_REGISTER( ipc, LOG_LEVEL_DBG );
void ipc_event_handler( uint32_t event_mask, void * p_context )
{
ARG_UNUSED( p_context );
LOG_INF( "Event mask 0x%x\r\n", event_mask );
}
void ipc_init( void )
{
IRQ_CONNECT(IPC_IRQn, 1, nrfx_ipc_irq_handler, 0, 0);
nrfx_err_t err = nrfx_ipc_init( 1, ipc_event_handler, NULL );
if (err != NRFX_SUCCESS)
{
LOG_ERR( "nrfx_ipc_init() failed. Error 0x%x\r\n", err );
}
nrfx_ipc_receive_event_channel_assign( 0, 0 );
nrfx_ipc_receive_event_enable( 0 );
}
Changing the priorities does not resolve the error. I can comment out the IRQ_CONNECT to get it to build, but I don't get the interrupts. I do see all of the appropriate calls in the cpunet console. Any suggestions?