Sorry, you need to enable JavaScript to visit this website.

Two core AMP application with lwIP

Unsolved
2 posts / 0 new
jako12's picture
jako12
Junior(0)
Two core AMP application with lwIP

Hello,
I'm trying to run two-core AMP application baremetal-baremetal with lwIP stack on second core (Core 1), on the Core 0 I want to simple poll inputs in 20kHz TTC timer interrupt. 
Both applications when run separately work just fine. However, when set in above configuration, where core 0 starts core 1 (which works and was checked on the uart console), after some time, core 0 stalls somewhere in the main loop (but TTC timer int routine works) and core 1 does not respond (lwIP demo does not respond to ping).
It looks like problem with GIC, but I think I'm configuring it correctly. BSP theme I'm using is standalone v 5_4, which from my understanding includes AMP modifications, -g -DUSE_AMP=1 flag is also set in the BSP's linker.

Interrupt setup in core 0:

static void SetupInterruptSystem(XScuGic *GicInstancePtr, XTtcPs *TtcPsInt)

{

XScuGic_Config *IntcConfig; //GIC config

Xil_ExceptionInit();

 

//initialise the GIC

IntcConfig = XScuGic_LookupConfig(INTC_DEVICE_ID);

 

XScuGic_CfgInitialize(GicInstancePtr, IntcConfig,

IntcConfig->CpuBaseAddress);

 

   //connect to the hardware

Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_INT,

(Xil_ExceptionHandler)XScuGic_InterruptHandler,

GicInstancePtr);

 

XScuGic_Connect(GicInstancePtr, TTC_INTR_ID,

(Xil_ExceptionHandler)TickHandler, (void *)TtcPsInt);

 

 

XScuGic_Enable(GicInstancePtr, TTC_INTR_ID);

XTtcPs_EnableInterrupts(TtcPsInt, XTTCPS_IXR_INTERVAL_MASK);

 

XTtcPs_Start(TtcPsInt);

 

// Enable interrupts in the Processor.

Xil_ExceptionEnableMask(XIL_EXCEPTION_IRQ);

}

 

 

--------------------------------------------------------------------------

 

 

Interrupt system in lwIP example:

void platform_setup_interrupts(void)

{

Xil_ExceptionInit();

 

XScuGic_DeviceInitialize(INTC_DEVICE_ID);

 

/*

* Connect the interrupt controller interrupt handler to the hardware

* interrupt handling logic in the processor.

*/

Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_IRQ_INT,

(Xil_ExceptionHandler)XScuGic_DeviceInterruptHandler,

(void *)INTC_DEVICE_ID);

/*

* Connect the device driver handler that will be called when an

* interrupt for the device occurs, the handler defined above performs

* the specific interrupt processing for the device.

*/

XScuGic_RegisterHandler(INTC_BASE_ADDR, TIMER_IRPT_INTR,

(Xil_ExceptionHandler)timer_callback,

(void *)&TimerInstance);

/*

* Enable the interrupt for scu timer.

*/

XScuGic_EnableIntr(INTC_DIST_BASE_ADDR, TIMER_IRPT_INTR);

 

return;

}

 

Thanks in advance for any suggestions.

 

JFoster's picture
JFoster
Moderator(55)
Hello Jako12,

Hello Jako12,

I am going to suggest you ask this question over at the Digilent forum as they are the main contact for educational purposes.

https://forum.digilentinc.com/

--Josh