CANopenNode icon indicating copy to clipboard operation
CANopenNode copied to clipboard

incorrect data in OD entry

Open steff1982 opened this issue 1 year ago • 4 comments

Hi, I implemented a Canopennode on an STM32F302 as in the git tutorial, and so far it works. I connect now to a Beckhoff PLC and start to communicate, using the EDS file of the OD Editor. I created 1 TX and 1 RX PDO. Put a device type and also a heartbeat producer with 1000 ms. everything works, but randomly I get wrong data in the OD entries!

e.g. from beckhoff I sen every 10 ms a uint8 like i=i+1; on the STM I have an OD_RAM.x6000_counter variable, which shows the variable from the PLC, but randomly I get the value 12! also on other registers I get randomly the value 12. I checked everything, but I am not able to solve it. I got error 8220 and 8240, but it is really random. I really need to trust the OD values. To get more information, I put a PeakCan on the line, and data send from PLC are correct. Can someone help me or has someone the same issue?

steff1982 avatar Sep 25 '24 23:09 steff1982

try disabling can reception of this one rpdo and then place a memory breakpoint in your debugger. this should give you a stack trace where the write comes from.

martinwag avatar Sep 26 '24 06:09 martinwag

Hi,

I am using the CANopennode the first time, so I do not know where I should disable the reception of the RXPDO. In the OD Editor and recompile?

Best regards,

Stephan Haringer, PhD

CEO / Owner, Scientific-solutions S.r.l.

39020 – Castelbello / Ciardes

Italy (BZ)

Web: http://www.scientific-solutions.eu www.scientific-solutions.eu mail: @.> @.

Phone: EU +39 347 680 5912

From: Martin Wagner @.> Sent: Thursday, September 26, 2024 8:21 AM To: CANopenNode/CANopenNode @.> Cc: steff1982 @.>; Author @.> Subject: Re: [CANopenNode/CANopenNode] incorrect data in OD entry (Issue #544)

try disabling can reception of this one rpdo and then place a memory breakpoint in your debugger. this should give you a stack trace where the write comes from.

— Reply to this email directly, view it on GitHub https://github.com/CANopenNode/CANopenNode/issues/544#issuecomment-2376033389 , or unsubscribe https://github.com/notifications/unsubscribe-auth/BLS36XLYAOR57JZY6ZLXTT3ZYORUTAVCNFSM6AAAAABO3V2M5CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZWGAZTGMZYHE . You are receiving this because you authored the thread. https://github.com/notifications/beacon/BLS36XJBPPH6EC4SFVRITELZYORUTA5CNFSM6AAAAABO3V2M5CWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUNT5SG2.gif Message ID: @.*** @.***> >

steff1982 avatar Sep 26 '24 06:09 steff1982

you can disable a pdo at runtime in the OD.

martinwag avatar Sep 26 '24 10:09 martinwag

Did you made own STM32 driver? This may be a complex task, all details must be controlled, race conditions, etc.

Did you try https://github.com/CANopenNode/CanOpenSTM32/. It is not perfectly maintained, but should work.

CANopenNode avatar Oct 08 '24 15:10 CANopenNode