You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Observing the CANbus when writing SDOs, a UINT32 with value 0xFFFFFFFF and then immediately writing a UINT8 with value 0x0C the value seen on the CAN bus is 0x0CFFFFFF. This creates a problem for the target CAN device I am using and throws it into an Emergency State.
To overcome this problem I have changed your code to reset to 0x00 the 4 data bytes in the buffer: not particularly elegant but it does seem to work.
I hope you can fix this issue for me, in the meantime I will use a modified version
Kind Regards
Guy Pender
The text was updated successfully, but these errors were encountered:
gpender
changed the title
CANOpen Write buffer corruption when writing less data bits than the previous data write
CANOpen SDO write buffer corruption when writing less data bits than the previous data write
Dec 9, 2020
Hi Ulrik,
Observing the CANbus when writing SDOs, a UINT32 with value 0xFFFFFFFF and then immediately writing a UINT8 with value 0x0C the value seen on the CAN bus is 0x0CFFFFFF. This creates a problem for the target CAN device I am using and throws it into an Emergency State.
To overcome this problem I have changed your code to reset to 0x00 the 4 data bytes in the buffer: not particularly elegant but it does seem to work.
canOpenStatus SDO :: setData(u32 val, u8 valid, u8 *n)
{
canOpenStatus ret = CANOPEN_ERROR;
if (valid > 0 && valid <= 4)
{
this->can_data_tx[4] = 0x00;
this->can_data_tx[5] = 0x00;
this->can_data_tx[6] = 0x00;
this->can_data_tx[7] = 0x00;
if (valid == 1)
{
::setU8Val((u8)val, this->can_data_tx, 4);
}
else if (valid == 2)
{
::setU16Val((u16)val, this->can_data_tx, 4);
}
I hope you can fix this issue for me, in the meantime I will use a modified version
Kind Regards
Guy Pender
The text was updated successfully, but these errors were encountered: