CanOpenSTM32 icon indicating copy to clipboard operation
CanOpenSTM32 copied to clipboard

Code for STM Nucleo F-303ZE

Open JTLGE opened this issue 2 years ago • 10 comments

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 avatar Apr 27 '22 10:04 JTLGE

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 ?

JTLGE avatar Apr 27 '22 14:04 JTLGE

@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.

HamedJafarzadeh avatar Apr 27 '22 15:04 HamedJafarzadeh

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

JTLGE avatar Apr 28 '22 07:04 JTLGE

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 .

HamedJafarzadeh avatar Apr 28 '22 07:04 HamedJafarzadeh

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?

JTLGE avatar Apr 29 '22 16:04 JTLGE

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.

HamedJafarzadeh avatar Apr 30 '22 10:04 HamedJafarzadeh

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

JTLGE avatar May 01 '22 07:05 JTLGE

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

HamedJafarzadeh avatar May 03 '22 07:05 HamedJafarzadeh

Thank you so much, I'll try it.

JTLGE avatar May 03 '22 08:05 JTLGE

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

HamedJafarzadeh avatar Aug 11 '22 14:08 HamedJafarzadeh