Closed vikas-yadav77 closed 2 years ago
In addition to above question, we have 2 more questions here:
We could not find usage of OD_attributes_t fields "ODA_TSRDO" OR "ODA_RSRDO" in the canOpenNode stack. Can we use them for internal purposes?
We were also referring CANOpen 301 standard for endianness. In Section 7, we found that it expects the numerical data to be transferred at little endian format. Is this understanding correct? Please find screenshot below:
@martinwag - quick response is highly appreciated.
Hi, quick response but I can't really help you there...
Thanks for your response.
While exploring on the big-endian data conversion feature, we have one observation around SDO transactions, As we know SDO Packet is formatted as follows: 1st byte - Command Buffer, 2nd& 3rd Byte - Index , 4th Byte - SubIndex, 5-8th Byte - Data
Index always handled in little endian format and data bytes are swapped.
So in below cases , we see that Data Bytes(5-8th Bytes) are also Swapped in case of big endian architecture.
@CANopenNode @martinwag - quick response is highly appreciated.
CANopen defines endianes on bus as little-endian (301-7.1.1). You need to ensure that all values > 1 byte are encoded in that way, otherwise you will have compatibility problems. I did not do any analysis of endianes swapping in CANopenNode as our processor uses little endian anyway. So I don't have any clue if this is done correctly in all the possible places.
I think yes, but please verify correctness of byte order also by observing raw CANopen messages.
Hi,
I am compiling CANopenNode stack on BIGENDIAN machine where __BYTE_ORDER == __BIG_ENDIAN. During compilation I am getting below error, Do we need to change dataOD to dataTPDO or is there any code part missing in TPDO functionality for BIG_ENDIAN architecture
CANopenNode/301/CO_PDO.c:1269:27: error: ‘dataOD’ undeclared (first use in this function); did you mean ‘dataTPDO’? 1269 | uint8_t *lo = dataOD; | ^
~| dataTPDO CANopenNode/301/CO_PDO.c:1269:27: note: each undeclared identifier is reported only once for each function it appears in make: *** [Makefile:76: CANopenNode/301/CO_PDO.o] Error 1