Community
cancel
Showing results for 
Search instead for 
Did you mean: 
AJuba
Beginner
1,016 Views

Not Able to Detect CAN Bus on my system

Jump to solution

Hello support.

I am not able to detect my CAN bus on my custom board,

this is Cyclone 5 soc device.

 

Please help.

0 Kudos
1 Solution
Fawaz_J_Intel
Employee
134 Views

hello AJuba,

This might fall within 2 reasons:

 

1- the CAN bus is not enabled in device tree. to enable this, you need to modify the dts file, it might be something like this:

 

can0: can@ffc00000 {

compatible = "bosch,d_can";

reg = <0xffc00000 0x1000>;

interrupts = <0 131 4>, <0 132 4>, <0 133 4>, <0 134 4>;

clocks = <&can0_clk>;

status = "disabled";

};

 

can1: can@ffc01000 {

compatible = "bosch,d_can";

reg = <0xffc01000 0x1000>;

interrupts = <0 135 4>, <0 136 4>, <0 137 4>, <0 138 4>;

clocks = <&can1_clk>;

status = "disabled";

};

 

both status="disabled" should be enabled if you have 2 CAN buses.

 

 

2- Make sure to enable CAN bus driver in Linux Kernel menuconfig.

 

-> Networking Support

-> <*> CAN Bus Subsystem Support

-> <*> Raw CAN Protocol

-> <*> Broadcast Manager CAN Protocol

-> <*> CAN Gateway/Router

CAN Device Drivers

-> <*> Platform CAN drivers with Netlink support

-> [*] CAN bit-timing calculation

-> <*> Bosch C_CAN/D_CAN Devices

-> <*> Generic Platform Bus based C_CAN/D_CAN Driver

-> [*] CAN devices debugging messages

 

 

Hope this might help.

 

Thanks

View solution in original post

4 Replies
AJuba
Beginner
134 Views

Anyone can help me on this?

Fawaz_J_Intel
Employee
135 Views

hello AJuba,

This might fall within 2 reasons:

 

1- the CAN bus is not enabled in device tree. to enable this, you need to modify the dts file, it might be something like this:

 

can0: can@ffc00000 {

compatible = "bosch,d_can";

reg = <0xffc00000 0x1000>;

interrupts = <0 131 4>, <0 132 4>, <0 133 4>, <0 134 4>;

clocks = <&can0_clk>;

status = "disabled";

};

 

can1: can@ffc01000 {

compatible = "bosch,d_can";

reg = <0xffc01000 0x1000>;

interrupts = <0 135 4>, <0 136 4>, <0 137 4>, <0 138 4>;

clocks = <&can1_clk>;

status = "disabled";

};

 

both status="disabled" should be enabled if you have 2 CAN buses.

 

 

2- Make sure to enable CAN bus driver in Linux Kernel menuconfig.

 

-> Networking Support

-> <*> CAN Bus Subsystem Support

-> <*> Raw CAN Protocol

-> <*> Broadcast Manager CAN Protocol

-> <*> CAN Gateway/Router

CAN Device Drivers

-> <*> Platform CAN drivers with Netlink support

-> [*] CAN bit-timing calculation

-> <*> Bosch C_CAN/D_CAN Devices

-> <*> Generic Platform Bus based C_CAN/D_CAN Driver

-> [*] CAN devices debugging messages

 

 

Hope this might help.

 

Thanks

View solution in original post

Eneko
Beginner
127 Views

Hello. We have manged to make CAN0 and CAN1 working but we have a problem with the bus speed. We are getting 3 around 39 kbit/s when configuring 125 kbit/s.

Although we have 100Mhz clock configured in Preloader and registers in the clock manager, system reports 40Mhz when listing driver configuration (ip -d -s link show can0).

If we force driver to read 100Mhz clock, we get 15.625 kbit/s, this is, 8 times slower than expected.

If we force driver to read 12.5Mhz clock, we get correct bus speed.

The same is hapening with CAN1. 

 

AJuba
Beginner
134 Views

Hello FJumaah,

Wow amazing....

Thanks for your help.​ I was able to solve my problem by following item 1.

Reply