I didn't receive much help on the forum for resolving this under other threads so I am sharing a solution that works for me. The NDK can run on the C66x core but the current transport driver does not support the interrupt mapping required by the C66x, EventCombiner. Thus you have to add it to the ethernet driver and then rebuild the PDK. Presently I am using pdk_am57xx_101 and processor_sdk_rtos_am57xx_2_00_01_07. The driver is located in C:\ti\pdk_am57xx_1_0_1\packages\ti\transport\ndk\nimu\src\v4. Edit cpsw_ethdriver.c, removing the existing Interrupt_init() routing and replacing it with the code below. You can then rebuild the PDK using the directions from the wiki:
http://processors.wiki.ti.com/index.php/Rebuilding_The_PDK
The interrupts in the NIMU test project should be mapped something like:
#define GMAC_SW_IRQ_RX_PULSE_INT_NUM (4) // Low level DSP Interrupt desired, 4 to 15 valid
#define GMAC_SW_IRQ_TX_PULSE_INT_NUM (5) // Low level DSP Interrupt desired, 4 to 15 valid
#define GMAC_SW_IRQ_RX_THRESH_PULSE_INT_NUM (CSL_XBAR_INST_DSP1_IRQ_76) // used to map DSP Event
#define GMAC_SW_IRQ_MISC_PULSE_INT_NUM (CSL_XBAR_INST_DSP1_IRQ_77) // used to map DSP Event
Since NIMU_Config structure does not contain enough entries to handle the multiple layers of mapping needed for the interrupts the rxThreshIntrNum and miscIntrNum interrupt entries are used to pass the DSP Event being used that is mapped via the crossbar. They don't seem to be used by the PDK.
NIMU_Config NIMU_config =
{
CSL_DSP_ISS_REGS,
CSL_DSP_IMDIO_REGS,
CSL_DSP_IWR_REGS,
CSL_DSP_IALE_REGS,
CSL_DSP_ICPDMA_REGS,
(CSL_DSP_ISS_REGS + 0x2000U),
CSL_DSP_IPORT_REGS,
(CSL_DSP_ISS_REGS + 0x900U),
GMAC_SW_IRQ_RX_PULSE_INT_NUM,
GMAC_SW_IRQ_RX_THRESH_PULSE_INT_NUM,
GMAC_SW_IRQ_TX_PULSE_INT_NUM,
GMAC_SW_IRQ_MISC_PULSE_INT_NUM,
{
{
CSL_DSP_IPORT_REGS,
CSL_DSP_ISL1_REGS,
0U,
},
{
CSL_DSP_IPORT_REGS,
CSL_DSP_ISL2_REGS,
1U,
}
}
};
Create yourself a Sysbios project using the attached cfg and main.c files (will attempt to put in following post) which originated from the NIMU_BasicExample_evmAM572x_armExampleproject. To debug you must run the boardinit() code from the arm project on the A15, then load your program into the DSP1 core and execute it. You should be able to ping 192.168.1.4, change the IP address in the cfg file if needed.
Edit C:\ti\pdk_am57xx_1_0_1\packages\ti\transport\ndk\nimu\src\v4\cpsw_ethdriver.c and replace Interrupt_init() with the below code, then rebuild PDK, ignore XDC warnings with regards to typedef name already declared:
#if defined(ti_targets_elf_C66) && (defined(SOC_AM571x) || defined(SOC_AM572x))
#include <ti/sysbios/family/c64p/EventCombiner.h>
#include <ti/sysbios/family/shared/vayu/IntXbar.h>
#include <ti/csl/cslr_device.h>
#include <ti/csl/soc/am572x/src/cslr_soc.h>
#endif
void Interrupt_init(void)
{
HwiP_Handle rxHwiHandle;
HwiP_Handle txHwiHandle;
static Uint32 cookie = 0;
cookie = NIMU_osalHardwareIntDisable();
HwiP_Params hwiParams;
NIMU_osalHwiParamsInit(&hwiParams);
#if defined(ti_targets_elf_C66) && (defined(SOC_AM571x) || defined(SOC_AM572x))
NIMU_drv_log("RX Interrupt being setup using EventCombiner.\n");
// Maps crossbar input to DSP event. Use NIMU_config.rxThreshIntrNum as place holder since existing
// structure does not allow for it and it does not seem to be used elsewhere. The Crossbar input
// is hard coded since it does not change on the AM5728.
IntXbar_connectIRQ(NIMU_config.rxThreshIntrNum, CSL_XBAR_GMAC_SW_IRQ_RX_PULSE); // Maps crossbar input to DSP event
/* Plug an ISR for DSP event from NIMU_config table */
EventCombiner_dispatchPlug(NIMU_config.rxThreshIntrNum, &Cpsw_HwIntRx, NIMU_config.rxThreshIntrNum, TRUE);
hwiParams.arg = NIMU_config.rxThreshIntrNum / 32; // There are up to 128 events in array of ints
hwiParams.evtId = hwiParams.arg;
hwiParams.priority = 0x20; //TODO Rename
rxHwiHandle = NIMU_osalRegisterInterrupt(NIMU_config.rxIntrNum, &EventCombiner_dispatch, &hwiParams);
#else
hwiParams.arg = (uintptr_t)NULL;
hwiParams.evtId = NIMU_config.rxIntrNum;
hwiParams.priority = 0x20; //TODO Rename
// Set interrupt handler to be EventCombiner_dispatch, it will jump to Cpsw_HwIntTx after analyzing interrupt
rxHwiHandle = NIMU_osalRegisterInterrupt(NIMU_config.rxIntrNum, &Cpsw_HwIntRx, &hwiParams);
#endif
if(rxHwiHandle == NULL)
NIMU_drv_log("Error setting up Rx Interrupts \n");
#if defined(ti_targets_elf_C66) && (defined(SOC_AM571x) || defined(SOC_AM572x))
NIMU_drv_log("TX Interrupt being setup using EventCombiner.\n");
// Maps crossbar input to DSP event. Use NIMU_config.rxThreshIntrNum as place holder since existing
// structure does not allow for it and it does not seem to be used elsewhere. The Crossbar input
// is hard coded since it does not change on the AM5728.
IntXbar_connectIRQ(NIMU_config.miscIntrNum, CSL_XBAR_GMAC_SW_IRQ_TX_PULSE); // Maps crossbar input to DSP event
/* Plug an ISR for DSP event from NIMU_config table */
EventCombiner_dispatchPlug(NIMU_config.miscIntrNum, &Cpsw_HwIntTx, NIMU_config.miscIntrNum, TRUE);
hwiParams.arg = NIMU_config.miscIntrNum / 32; // There are up to 128 events in array of ints
hwiParams.evtId = hwiParams.arg;
hwiParams.priority = 0x20; //TODO Rename
// Set interrupt handler to be EventCombiner_dispatch, it will jump to Cpsw_HwIntTx after analyzing interrupt
txHwiHandle = NIMU_osalRegisterInterrupt(NIMU_config.txIntrNum, &EventCombiner_dispatch, &hwiParams);
#else
hwiParams.arg = (uintptr_t)NULL;
hwiParams.evtId = NIMU_config.txIntrNum;
hwiParams.priority = 0x20; //TODO Rename
txHwiHandle = NIMU_osalRegisterInterrupt(NIMU_config.txIntrNum, &Cpsw_HwIntTx, &hwiParams);
#endif
if(txHwiHandle == NULL)
NIMU_drv_log("Error setting up Rx Interrupts \n");
/* Restore global interrupts */
NIMU_osalHardwareIntRestore(cookie);
}