OpenEtherCATsociety / SOEM

Simple Open Source EtherCAT Master
Other
1.3k stars 668 forks source link

Can not go to OP State with SOEM using XMC4800 #667

Open yongzhiliu1006 opened 1 year ago

yongzhiliu1006 commented 1 year ago

Hi : I am using XMC4800 of infineon as ethercat slave controller for a project, and generate slave stack files with SSC Tool 5.12. The problem I met is that when the amount of slaves is more than 4 or 6, they are much more difficult to transit to OP state,using SOEM's simple test. I checked the captured packets with wireshark, the master found all the 11 slaves; ................................................................(omitted some enumeration packets here) . after read from 0x130 AL status regs,(the slaves are all in preop state) ; . the soem master read the regs of 0x5XX from the second slave (adp 0x1002) to the last slave. . the soem master read from the first slave (adp 0x1001) of the 0x9xx regs, just finished the visit of 0x1001 and 0x1002; . then bwr all slaves's Ado 0x120 regs. . then the comunication between seem to be lost . I found in the packet file a huge amount of useless packet of "FPRD",with Adp 0x0,Ado,0x502. Is it a compile error? The first slave should begin with the address of 0x1001, no one at the position of 0x0. Some packets returned with al ctrl or al status error. But I donot know why those errors occured. I attached the wireshark packets file and the esi file below. Both of the file are renamed to .txt to be uploaded. Any help and guidance would be greatly appreciated! Thank you so much. pcap.txt XMC_ESC.txt pcap.zip

ArthurKetels commented 1 year ago

Can you show the output of slaveinfo -map?

I can not see the useless FPRD you mention in the pcap file. It does query the slave status for a long time to see if slaves go to operational.

You mention the slaves return with a AL status error. This is very important because it tells you why the slave refused to go in safe-op. The AL status code for all slaves is 0x001e. This means "Invalid input configuration". Because I see no CoE mailbox data I assume you configured the slave to have EEPROM interface only. This in turn means that your EEPROM PDO configuration does not match the slave expectations when transitioning from pre-op to safe-op.

yongzhiliu1006 commented 1 year ago

Dear sir: Thanks a lot for your advice. The word "useless" is not a proper usage. I reviewed the communication packet between master and slaves,found many packets with "BRD Adp 0x00 " in INIT state. The slaveinfo -map result is posted below. I examined the packets between Twincat and slaves, the AL status are in error when it is in INIT state, after some setting packets, the error bit of AL status is cleared and transit to PREOP state. What should I do with SOEM? Thanks again.

图片

ArthurKetels commented 1 year ago

As far as I can see this is a slave firmware issue and not something SOEM related. Did you test the slave with the slave conformance test tool from the ETG? It is very good at finding firmware issues with any slave.

yongzhiliu1006 commented 1 year ago

Sorry sir, I am not a member of ETG, and donot have a Conformance Test Tool by my hand. But I tried TwinCat ,the slaves can be connected quite easily. Where can I get any clue about what kind of issue it can be with the firmware? Thanks again.

ArthurKetels commented 1 year ago

Well, if you do not want to use the proper methods and proper tools then it will be more of a struggle. One thing that could help is posting a complete set of data instead of small snippets.

The post of slaveinfo -map is not complete (shows only one slave and does not have the '-map' function included). Also the corresponding .pcap file would be useful.

I suspect some mistakes in the eeprom content. Can you post the binary result of eepromtool? I have software to crosscheck the eeprom binary with the .esi.

yongzhiliu1006 commented 1 year ago

Thank you ,sir. The 11 slavesinfo -map result ,the e2prom , the pcap file and the result of simple test are packed together. The slaves can be connected ,maybe once in two or more tries. When it fail, the info can be "invalid input configuration", or "Invalid mailbox configuration", or both. What can I do to make the soem work more stable? Thank you very much.

Pictures.zip