CANopenNode / CanOpenSTM32

CANopenNode on STM32 microcontrollers.
Other
292 stars 116 forks source link

Code for STM Nucleo F-303ZE #9

Closed JTLGE closed 1 year ago

JTLGE commented 2 years ago

I bought 2 Nucleo-F303ZE boards, downloaded the project following the guide, compiled it and finally flashed the 2 boards. I connected the 2 boards using 2 can SN65HVD230 transceivers.

Then I used teraterm to see the debug messages by setting the baud rate 115200 but I only get the following screen when I load the code:


Allocated 4356 bytes for CANopen objects
                                        CANopenNode - Reset communication...
                                                                            CANopenNode - Running...

how can i solve them and test correctly this example?

JTLGE commented 2 years ago

I also observed with the oscilloscope that the CAN_RX(PB8) pin always remains at 3.3V. Do I need to use any particular function to see the exchange of messages between the two nodes ?

HamedJafarzadeh commented 2 years ago

@JTLGE, it seems that the example ran successfully on your board. Try when you turn the board on, you should be able to see a single packet going through the CAN Bus only at the startup procedure. If that's not easy for you to observe, you can use CAN Analyzer or just simply try to set HeartBeat Producer time to 1000. You can do that by generating OD files, or simply open "CANOpen_STM32F3xx/OD.c" and change this line : .x1017_producerHeartbeatTime = 0x03ED, and save the OD and program the microcontroller, and you should be able to see Hearbeat message every 1005ms.

JTLGE commented 2 years ago

I have tried to carry out your modifications, but I have not noticed any changes, I do not see any messages.

HamedJafarzadeh commented 2 years ago

Try to set a breakpoint at prv_send_can_message function and if it is being called, then most probably the problem is with your hardware side, probably wrong pins, wrong inspection method, and etc .

JTLGE commented 2 years ago

I set the breckpoint where you said and i saw that i go in this point of code, but I don't see any received message on the virtual com with teraterm.

I also tried to see the pin CAN_TX PB9 with an oscilloscope but I saw that the signal is fixed at 3.3V How can I verify and see the correctly comunicartion between boards?

HamedJafarzadeh commented 2 years ago

Sorry @JTLGE can't help much there. apparently it is not the CANOpenNode stack issue anymore. it is more like on your hardware side I would say. Double check that you are measuring the right pin, check that your oscilloscope or measuring device logging correctly. I would use logic analyzer anyway to be able to record the transmission. Anyway as far as I can tell, this code is working on my hardware and couple of other people, so be almost sure of the stack side. But I can't tell much about rest of stuff. Maybe try writing a CAN transmission code from zero to just test the hardware first and then switch over to CANOpenNode.

JTLGE commented 2 years ago

thank you @HamedJafarzadeh, could you suggest me a logic analyzer for this application?

HamedJafarzadeh commented 2 years ago

I'm using something like this in conjunction with PulseView.

JTLGE commented 2 years ago

Thank you so much, I'll try it.

HamedJafarzadeh commented 2 years ago

@JTLGE, would you please close this issue if your problem has been solved ?

HamedJafarzadeh commented 1 year ago

No comment after a year. So I'll close it.