DieBieEngineering / DieBieSlave

Universal EtherCAT slave based on the LAN9252.
144 stars 54 forks source link

LAN9252 stay in INIT mode #5

Open FCam1 opened 5 years ago

FCam1 commented 5 years ago

Hi, Now my device is reconized as a slave in twincat but is blocked in the INIT state, when I try to force the device to the next state "Pre-Op" I have this error : INIT INIT_ERR.

I flashed the stm32 and I can see the same issue. The code still blocked in middleSOESInit() waiting OP mode :
do{ ESC_read(ESCREG_DLSTATUS, (void *)&ESCvar.DLstatus, sizeof(ESCvar.DLstatus)); //ESCvar.DLstatus = etohs(ESCvar.DLstatus); } while ((ESCvar.DLstatus & 0x0001) == 0);

Nothing is connected on the GPIO, the board is connected alone.

The connection between the EEPROM seems right because is reconized as a slave in twincat.

Do you have an idea of the possible cause of this issue ? Thanks

Florenc

FCam1 commented 5 years ago

I found an other ESI file from mivrochip (Microchip EVB-LAN9252-Add-On-DIGIO-8IN-8OUT.xml) and with this config the LAN9252 go in OP mode without any problem. With this test I think I can validate my hardware is ok but I don't understant with your ESI file is not working on my board.

FCam1 commented 5 years ago

Finally I found an alternative. I succeed to do your harware working using arduino and easyCAT : https://github.com/Gepetto/DieBieSlaveduino