Closed imyosha closed 5 years ago
Send us the SlaveEditor project and a SOEM slaveinfo Wireshark, support[at]rt-labs.com
The old SlaveEditor was not compatible with LAN9252 due to SPI is configured differently and in conflict with ET1100. The upcoming 3.x will be.
Fixed , esc_hw driver update
Hi, I am trying to run EtherCAT communication between STM32F4 using LAN9252 (via SPI) with the SOES library and computer using examples from the SOEM library. I use the v2.2.0 of SOES library, because this is the latest version compatible with the EtherCAT Slave Editor. Like the hal driver for LAN9252 I use the file _eschw.c taken from SOES/soes/hal/rt-kernel-lan9252. In this file, I replaced only the functions responsible for SPI communication (spi_select, write, read) with the corresponding for STM32 and comment a few lines of SPI initialization (in STM32 this is done differently and elsewhere). I created the project using user manual from rt-labs page, and made minor edits due to the use of STM32. After successfully building the code, I checked the operation of the ESC using EtherCAT Explorer:
but
Next, I made sure that communication between the MCU and the LAN9252 over SPI works using a debugger. After a successful SPI check, I used the simple_test example from the SOEM library and received the following response (instead of XXX… in program response I had my net card address or something like this):
and response form slaveinfo example from SOEM:
The last message is repeated endlessly in the console, but from the source code "simple_test" it is clear that the program should behave differently. In EtherCAT Slave Editor, I added only one record per input and one record per output (2 bytes each) and in the code I made their rewriting and reading in the "cb_get" and "cb_set" functions.
I suspect that the communication does not work on the Application Layer but slaveinfo test shows that there are problems with mailbox (AL STATUS CODE register has value 0). What could be wrong and what should I try to do to properly configure the ESC?