Ethercat compatible Encoder board tentative STM32F4 + LAN9252

  • vibram
  • Away
  • Senior Member
  • Senior Member
More
17 Dec 2025 09:20 #340236 by vibram
Hello
Thank you for pushing me :)

I took back your project and build with the SPI2, flash you r eeprom and it worked well, im in OP mode in free run.

As I'm a beginner, my goal is to have a working base (basically yours...) and edit in order to adapt my needs.
Now I have the SPI working well, I will try to integrate my encoder from thise base

Please Log in or Create an account to join the conversation.

More
17 Dec 2025 09:34 #340237 by meister
A little tip for non-Windows users: you don't need TwinCat to read, write, edit or convert .bin/.xml esi files.

github.com/multigcs/esitool
The following user(s) said Thank You: vibram

Please Log in or Create an account to join the conversation.

  • vibram
  • Away
  • Senior Member
  • Senior Member
More
17 Dec 2025 11:24 - 17 Dec 2025 11:25 #340238 by vibram
Hello,
I updated the GIT.
I managed to flash my eeprom correctly however with the current I-m stuck in with this compilation issue:
ecat_slv.c.text.RXPDO_update+0x1c): undefined reference to `rxpdo'

I just cleaned the cb_get_inputs(void) and cb_set_outputs(void) compared to the working code and put my eeprom file in folder soes-esi

In order to compile i can add this in main.cpp

[code]// Definition of rxpdo needed when MAX_MAPPINGS_SM2 is 0
uint8_t rxpdo_buffer[512];
uint8_t *rxpdo = rxpdo_buffer;

but if i do so, I-m stuck in ERR PREOP step
[/code]
Last edit: 17 Dec 2025 11:25 by vibram.

Please Log in or Create an account to join the conversation.

  • Hakan
  • Away
  • Platinum Member
  • Platinum Member
More
17 Dec 2025 14:34 - 17 Dec 2025 14:37 #340241 by Hakan
I saw that one, that was a new one to me.
How about not solving it, and instead go around it?
Add a PDO say scale as rxpdo? I mean anything useful, you don't need to do anything with it, just a place holder.
Then you don't need that declaration in main.cpp.
I have always had rxpdos so had not encountered that before.
I can try to see what's going on in the code a bit later.

Meister, I think it is how you go from the comfort zone with Twincat to the deep waters in linux.
I read and write eeprom with "ethercat sii_read" and "ethercat sii_write", the EEPROM_generator
gives me directly the eeprom to download in bin format. The tool you refer to can be used
to take an arbitrary xml file and turn into eeprom format for downloading. It's very useful,
one of the tools to keep in the toolchest.
Last edit: 17 Dec 2025 14:37 by Hakan.
The following user(s) said Thank You: vibram

Please Log in or Create an account to join the conversation.

  • vibram
  • Away
  • Senior Member
  • Senior Member
More
17 Dec 2025 14:51 - 17 Dec 2025 14:59 #340242 by vibram
well done its working !
I need the distributed clocks working if i want it to be compatible with LinuxCNC ?
Last edit: 17 Dec 2025 14:59 by vibram.

Please Log in or Create an account to join the conversation.

  • Hakan
  • Away
  • Platinum Member
  • Platinum Member
More
17 Dec 2025 16:52 #340247 by Hakan
You can choose between free-run and DC-sync (and SM-sync but noone uses that).
But you are not set up for any of that at the moment.
Let's start with free-run
Add this to eeprom-generator
 
The 000 is the one I have in mind, but have both of them in there.
Save all, burn eeprom, compile and upload firmware in the usual way.
In ethercat-conf.xml leave out the <dcConf ... > statement for the slave. That makes it use free-run mode.
It should now work in free run mode. 
 
Attachments:

Please Log in or Create an account to join the conversation.

Time to create page: 0.068 seconds
Powered by Kunena Forum