This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PROCESSOR-SDK-AM64X: EtherCAT Subdevice object dictionary - general questions

Part Number: PROCESSOR-SDK-AM64X

Hi again,

I am still learning about the EtherCAT subdevice API. I am aware of the documentation here: software-dl.ti.com/.../group___e_c___a_p_i___s_l_v___o_b_d.html

However, I am still missing some info. I am wondering what is the preferred way to store data in the object dictionary?

As far as I get it I have two possibilities:
1) Storing data in the internal / hidden object dictionary of the stack
- If in my application the data of a SDO object changes I will write the changes with EC_API_SLV_CoE_setObjectData(..) to the stack


2) Registering a callback when generating the object
- the `.._odAdd...()` functions allow to register a write and a read callback, access to the variables can then be directly forwarded to application

Questions:
- if I decide to go for 2) is there still some memory acquired/reserved for this entry in the internal object dictonary?
- Where is the data of the internal object dictonary stored? Heap? Can I configure the size of this OD?
- If I have a Read-Write Variable and use the internal storage of the stack how could I check boundaries etc. or get informed about changes the EtherCAT master issues? Will I always need to register a write-callback?
- When do I need to call EC_API_SLV_CoE_generateObjectDict(), I couldn't find it somewhere in the examples but the documentation states it "Generates Object Dictionary"

Thanks!

  • Hi ,

    Thanks for your query.

    I will check on this and get back to you.

    Best Regards

    Ashwani

  • Hi ,,

    Any progress here on your side ?

    I could not work on this due to Diwali vacations.

    I will check on this get back to you.

    Best Regards

    Ashwani

  • Hi Ashwani,

    unfortunately not. I only found the API Reference and there I cannot find any further explanations. I was hoping you have some more information.

  • Anything new on this topic?

  • Hi Domink,

    I am working on this. Please allow me some more time.

    Best Regards

    Ashwani

  • if I decide to go for 2) is there still some memory acquired/reserved for this entry in the internal object dictonary?

    Yes, the stack always allocates memory for the object data regardless these objects are registered with callbacks or not.

    Where is the data of the internal object dictonary stored? Heap? Can I configure the size of this OD?

    Yes, the OD uses heap memory. There is no explicit way to configure the OD size. The only way to do it is by changing the heap size in the linker file.

    If I have a Read-Write Variable and use the internal storage of the stack how could I check boundaries etc. or get informed about changes the EtherCAT master issues? Will I always need to register a write-callback?

    We implemented some checks to prevent the master accessing the memory out of the entry/object boundaries. Regarding to the callbacks, it's the recommended practice. However, you can always poll the entry or the object with getObejctData or getObjectEntryData. Please note that if you are implementing a multi-core project, polling from the application core to the EtherCAT Back-end core causes a lot of inter-processor traffic and you could experience performance or stability issues. These statement only applies to multi-core approach, if you are implementing everything in one core then polling is safe.

    When do I need to call EC_API_SLV_CoE_generateObjectDict(), I couldn't find it somewhere in the examples but the documentation states it "Generates Object Dictionary"

    Please don't use that function. Its used internally by the EC_API_SLV_init function and will disappear in the next release.

    Best Regards

    Ashwani

  • Hi Ashwani,

    thanks for your answers and explanations.

    Yes, the OD uses heap memory. There is no explicit way to configure the OD size. The only way to do it is by changing the heap size in the linker file.

    Okay I understand. As I have no knowledge about the internal structures, do I have any possbility e.g. via a API-function to get the size of the currently allocated memory for OD? Otherwise I will need to find out manually at run-time ...

    We implemented some checks to prevent the master accessing the memory out of the entry/object boundaries

    Alright, that's fine! However, I was thinking more about application specific boundaries. E.g. a specific uint8 Variable XYZ in my application might only be allowed to be in range between 0 and 4. So I guess such application-specific boundaries will be the case for most objects created in OD. And the generated OD will not know about such ranges, therefore I might always need to use the callbacks.

    Please don't use that function. Its used internally by the EC_API_SLV_init function and will disappear in the next release.

    Okay perfect, that's fine

    Thanks again for your help!

    Kind Regards

    Dominik