Hi, I'm studying can communication.
I have STM32F4-Disc Board and did loopback test using files in 'testhal/STM32/CAN/*'. Checked LED blink, changed led
Now, I want to test using STM32F4-Disc's external header
Is there a test code about that? or reference homepage?
ChibiOS is hard to me, and I'm trying continue.
Below is thing I checked
In the datasheet,
CAN1_RX : PA11 / PB8 / PD0
CAN1_TX : PA12 / PB9 / PD0
(1) can't use PA11,12 cause the pins are used for OTG
(2) I'm testing PB8, 9 pins
CAN communication using STM32F4-Disc's external header
Moderators: RoccoMarco, barthess
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: CAN communication using STM32F4-Disc's external header
Hi,
The F4 discovery board does not have CAN drivers, how are you planning to connect it?
You should get a board with CAN drivers and use that for your experimentation.
Giovanni
The F4 discovery board does not have CAN drivers, how are you planning to connect it?
You should get a board with CAN drivers and use that for your experimentation.
Giovanni
Re: CAN communication using STM32F4-Disc's external header
Thank you for reply Giovanni.
My target is to use CAN interface on F4 discovery board.
(found '2*CAN interface', in STM32F407 datasheet)
I have found that I need transceiver for CAN communication.
So, I planned test environment like below.
┌─── [transceiver_1] ─ (2) ─ [F4 Board_1]
│ (1)
└─── [transceiver_2] ─ (3) ─ [F4 Board_2]
* connections :
(1)
Can I test CAN communication in this situation?
My target is to use CAN interface on F4 discovery board.
(found '2*CAN interface', in STM32F407 datasheet)
I have found that I need transceiver for CAN communication.
So, I planned test environment like below.
┌─── [transceiver_1] ─ (2) ─ [F4 Board_1]
│ (1)
└─── [transceiver_2] ─ (3) ─ [F4 Board_2]
* connections :
(1)
- transceiver_1's CAN_H ↔ transceiver_2's CAN_H
- transceiver_1's CAN_L ↔ transceiver_2's CAN_L
- F4 Board_1's PB8(CAN1_RX) ↔ transceiver_1's RX
- F4 Board_1's PB9(CAN1_TX) ↔ transceiver_1's TX
- F4 Board_2's PB8(CAN1_RX) ↔ transceiver_2's RX
- F4 Board_2's PB9(CAN1_TX) ↔ transceiver_2's TX
- F4 Board * 2
- transceiver * 2(CJMCU-2551*2 or WCMCU-230*2)
- 120Ω resistor, cables
Can I test CAN communication in this situation?
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: CAN communication using STM32F4-Disc's external header
Yes, keep wiring short and be careful to program GPIOs for CAN.
In the CAN demo you need to remove the loopback option from the configuration structure and it should work almost as-is. Note the all configurations come straight from the STM32 Reference Manual, make sure to read about the settings in the various registers.
Giovanni
In the CAN demo you need to remove the loopback option from the configuration structure and it should work almost as-is. Note the all configurations come straight from the STM32 Reference Manual, make sure to read about the settings in the various registers.
Giovanni
Re: CAN communication using STM32F4-Disc's external header
Alright, Thank you.
I'll test with your advice and reply good result.
I'll test with your advice and reply good result.
Who is online
Users browsing this forum: No registered users and 15 guests