Hello,
Using the AM437x IDK board and PRU-ICSS-EtherCAT_Slave_01.00.02.01 firmware
Ethercat_slave_full_AM437x_arm example is adapted and a TxPdo of size 1KBytes defined to evaluate the am437x EtherCAT performance. It took about 50us to copy the 1k data to PRU in PDI_Isr(). When TxPdo object size is set as 6KBytes, the time increased to 300us. This is unacceptable when running 1ms EtherCAT cycle time.
Trace down the code, the time is mainly coming in function (from tiescbsp.c)
void bsp_write(PRUICSS_Handle pruIcssHandle, Uint8 *pdata, Uint16 address, Uint16 len)
uint8_t *pEsc = (uint8_t *)(((PRUICSS_HwAttrs *)(pruIcssHandle->hwAttrs))->baseAddr + PRU_ICSS_SHARED_RAM);
memcpy(&pEsc[address], pdata, len);
Further investigation I found the MMU configuration for PRU-ICSS0/1 is set as Bufferable in am437x_app.cfg. If change this to Non Bufferable, then It took only 7us to copy the 1k data to PRU. When TxPdo object size is 6KBytes, the time is about 50us.
Questions:
1. Why the PRU shared memory is set as "Bufferable"? this results in a big performance issue
2. Any issue if set the MMU as "Non Bufferable"?
Thank you.