Other Parts Discussed in Thread: AM2434
Tool/software:
When am2434 is running Ethercat as a slave, PRU's EcatISr and Sync0 events are registered in all four cores of R5. For EcatISr, when executing PDO_OutputMapping, the last core among the four cores that has completed the Mapping lastly will execute the bsp-process_data_complete function, so that pHost2PruIntfc ->sm_dacessdata [sm_index-2]. lock_state=
LOCK_PD_BUF_HOST_ACCESS_FINISH. But now there is a problem, when the next interrupt comes to perform PDO_Output Mapping, it will be found that pHost2PruIntfc ->sm_decessdata [sm_index -2]. lock_state cannot reach the LOCK_PD_BUF_HOST_ACCESS_START state, so it cannot get the memory location corresponding to pdo in PRU, resulting in abnormal process data. May I ask what conditions are required for pHost2PruIntfc ->smsprocessdata [sm_index -2]. lock_state in Pru to go from LOCK_PD_BUF_HOST_ACCESS_FINISH to LOCK_PD_BUF_AVAILABLE_FOR_HOST and then to LOCK_PD_BUF_HOST_ACCESS_START? Is it necessary to execute PRUICS_SclearEvent (PRUICS_SHandle) args, PRU-ARM_SVENT0) after completing the execution of pHost2PruIntfc->sm_processdata[sm_index -2].lock_state =LOCK_PD_BUF_HOST_ACCESS_FINISH?