Hi,
I'm trying to create an EtherCAT Slave application to run on the Sitara AM3359 (currently using the AM335x ICEv2 board) that uses Distributed Clocks in order to minimize jitter between EtherCAT slave devices. I found that using the SYNC tasks (enabled by default with #define ENABLE_SYNC_TASK) resulted in relatively high jitter (4~8 μs) in the application reacting to D.C. SYNC0 pulses.
Reading the PRU ICSS EtherCAT firmware guide, it appears to switch the SYNC tasks to a HWI all I have to do is comment out two #define's in tiescbsp.h, as per the following instructions:
"if ENABLE_PDI_TASK and ENABLE_SYNC_TASK are NOT defined in tiescbsp.h, PDI and SYNC0 ISR processing will happen in SYS/BIOS HWI context. This is similar to SSC architecture."
However when I un-comment those #define's, I get the following compilation errors:
../EcatStack/tiescbsp.c: In function 'bsp_start_esc_isr':
../EcatStack/tiescbsp.c:1235:5: warning: implicit declaration of function 'PRUSSDRVRegisterIrqHandler' [-Wimplicit-function-declaration]
PRUSSDRVRegisterIrqHandler(HOST_AL_EVENT, 0, &EcatIsr, PRUSS_INSTANCE_IN_USE);
^
../EcatStack/tiescbsp.c:1235:60: error: 'PRUSS_INSTANCE_IN_USE' undeclared (first use in this function)
PRUSSDRVRegisterIrqHandler(HOST_AL_EVENT, 0, &EcatIsr, PRUSS_INSTANCE_IN_USE);
^
../EcatStack/tiescbsp.c:1235:60: note: each undeclared identifier is reported only once for each function it appears in
../EcatStack/tiescbsp.c:1288:5: error: 'pruIsrNum' undeclared (first use in this function)
pruIsrNum = HOST_SYNC0_EVENT;
^
../EcatStack/tiescbsp.c:1305:14: error: redefinition of 'evtOutNum'
uint32_t evtOutNum = HOST_SYNC1_EVENT - 20;
^
../EcatStack/tiescbsp.c:1290:14: note: previous definition of 'evtOutNum' was here
uint32_t evtOutNum = HOST_SYNC0_EVENT - 20;
Is there any additional setup/configuration required to use HWI's for the SYNC0 ISR?
My development environment:
- SYS/BIOS 6.45.1.29
- SYS/BIOS Industrial SDK 2.1.1.2
- XDCtools 3.32.0.06_core
- Compiler GNU v4.9.3 (Linaro)
- AM335x Industrial Communication Engine EVM rev2.1