All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: Question on CAN FD Driver for mcp251xfd
       [not found] ` <f168b9a4-79ae-7a8b-b074-632f86e8596b@pengutronix.de>
@ 2020-11-20 17:14   ` Jin Park
  2020-11-20 18:34     ` Oliver Hartkopp
  0 siblings, 1 reply; 4+ messages in thread
From: Jin Park @ 2020-11-20 17:14 UTC (permalink / raw)
  To: Marc Kleine-Budde, manivannan.sadhasivam; +Cc: linux-can

Hello Marc,

Here are my answers.
VAR-SOM-MX8M-Nano board drives MCP2517FD/MCP2518FD (CAN FD controller) and TCAN332G (CAN FD Transceiver) for CAN FD communication.

1) Which commands have you tried?
2) What are the error messages?
Please see below a), b), c), and d).

	a) Based on Bit Rate Switching feature in CAN FD, the bit rate at data phase and arbitration phase (or nominal phase) can be set in CAN FD protocol.
So, I tried below.
- command
ip link set can0 type can dbitrate 1000000

- error message
RTNETLINK answers: Operation not supported

	

	b) To turn on FD mode, I tried below.
- command
ip link set can0 type can fd on

- error message
RTNETLINK answers: Operation not supported



	c) To send CAN FD message, I tried below. Th
- command
cansend can0 123##1

- error message
CAN interface is not CAN FD capable - sorry.

- help text for cansend
    <can_id>#{R|data}          for CAN 2.0 frames
    <can_id>##<flags>{data}    for CAN FD frames

<can_id> can have 3 (SFF) or 8 (EFF) hex chars
{data} has 0..8 (0..64 CAN FD) ASCII hex-values (optionally separated by '.')
<flags> a single ASCII Hex value (0 .. F) which defines canfd_frame.flags

e.g. 5A1#11.2233.44556677.88 / 123#DEADBEEF / 5AA# / 123##1 / 213##311
     1F334455#1122334455667788 / 123#R for remote transmission request.





	d) TCAN332G (CAN FD Transceiver) can support 5Mbps at data phase in CAN FD mode. 
Current supported maximum bitrate in the driver is now 1Mbps at nominal rate.
(FYI, bit rate in data phase at CAN FD protocol is up to 8Mbps)
        Where: BITRATE  := { 1..1000000 }
                  SAMPLE-POINT  := { 0.000..0.999 }
                  TQ            := { NUMBER }
                  PROP-SEG      := { 1..8 }
                  PHASE-SEG1    := { 1..8 }
                  PHASE-SEG2    := { 1..8 }
                  SJW           := { 1..4 }
                  RESTART-MS    := { 0 | NUMBER }



3) What doesn't work exactly?

I would like to send and receive messages in CAN FD with Bit Rate Switching (Arbitration phase: 1Mbps, Data phase: 5Mbps).
So far, CAN FD mode doesn't turn on with above commands.

Thanks,
Jin


-----Original Message-----
From: Marc Kleine-Budde <mkl@pengutronix.de> 
Sent: Thursday, November 19, 2020 11:11 PM
To: Jin Park <jpark@enphaseenergy.com>; manivannan.sadhasivam@linaro.org
Subject: Re: Question on CAN FD Driver for mcp251xfd

Hello Jin Park,

please use the linux-can mailing list (linux-can@vger.kernel.org) for community question. There are other people interested in these question, please add list on Cc.

On 11/20/20 4:03 AM, Jin Park wrote:
> I am using MCP251XFD SPI-CAN Network Driver with VAR-SOM-MX8M-NANO 
> board now and would like to ask whether it can support CAN FD features as well.

Yes it does support CAN-FD.

> I tried to command with CAN FD features in terminal and it didn’t work 
> with CAN FD commands.

Which commands have you tried?
What are the error messages?
What doesn't work exactly?

> Is there any plan to release CAN FD Linux Driver in the future, if you 
> have worked on CAN FD?

It should be working.

Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Question on CAN FD Driver for mcp251xfd
  2020-11-20 17:14   ` Question on CAN FD Driver for mcp251xfd Jin Park
@ 2020-11-20 18:34     ` Oliver Hartkopp
  2020-11-20 18:57       ` Jin Park
  0 siblings, 1 reply; 4+ messages in thread
From: Oliver Hartkopp @ 2020-11-20 18:34 UTC (permalink / raw)
  To: Jin Park, Marc Kleine-Budde, manivannan.sadhasivam; +Cc: linux-can



On 20.11.20 18:14, Jin Park wrote:
> Hello Marc,
> 
> Here are my answers.
> VAR-SOM-MX8M-Nano board drives MCP2517FD/MCP2518FD (CAN FD controller) and TCAN332G (CAN FD Transceiver) for CAN FD communication.
> 
> 1) Which commands have you tried?
> 2) What are the error messages?
> Please see below a), b), c), and d).
> 
> 	a) Based on Bit Rate Switching feature in CAN FD, the bit rate at data phase and arbitration phase (or nominal phase) can be set in CAN FD protocol.
> So, I tried below.
> - command
> ip link set can0 type can dbitrate 1000000
> 
> - error message
> RTNETLINK answers: Operation not supported
> 
> 

You need to apply both bitrates at the same time, e.g.

$ ip link set can0 up type can bitrate 500000 sample-point 0.75 dbitrate 
4000000 dsample-point 0.8 fd on

See at:

https://www.kernel.org/doc/Documentation/networking/can.txt

Regards,
Oliver
	
> 
> 	b) To turn on FD mode, I tried below.
> - command
> ip link set can0 type can fd on
> 
> - error message
> RTNETLINK answers: Operation not supported
> 
> 
> 
> 	c) To send CAN FD message, I tried below. Th
> - command
> cansend can0 123##1
> 
> - error message
> CAN interface is not CAN FD capable - sorry.
> 
> - help text for cansend
>      <can_id>#{R|data}          for CAN 2.0 frames
>      <can_id>##<flags>{data}    for CAN FD frames
> 
> <can_id> can have 3 (SFF) or 8 (EFF) hex chars
> {data} has 0..8 (0..64 CAN FD) ASCII hex-values (optionally separated by '.')
> <flags> a single ASCII Hex value (0 .. F) which defines canfd_frame.flags
> 
> e.g. 5A1#11.2233.44556677.88 / 123#DEADBEEF / 5AA# / 123##1 / 213##311
>       1F334455#1122334455667788 / 123#R for remote transmission request.
> 
> 
> 
> 
> 
> 	d) TCAN332G (CAN FD Transceiver) can support 5Mbps at data phase in CAN FD mode.
> Current supported maximum bitrate in the driver is now 1Mbps at nominal rate.
> (FYI, bit rate in data phase at CAN FD protocol is up to 8Mbps)
>          Where: BITRATE  := { 1..1000000 }
>                    SAMPLE-POINT  := { 0.000..0.999 }
>                    TQ            := { NUMBER }
>                    PROP-SEG      := { 1..8 }
>                    PHASE-SEG1    := { 1..8 }
>                    PHASE-SEG2    := { 1..8 }
>                    SJW           := { 1..4 }
>                    RESTART-MS    := { 0 | NUMBER }
> 
> 
> 
> 3) What doesn't work exactly?
> 
> I would like to send and receive messages in CAN FD with Bit Rate Switching (Arbitration phase: 1Mbps, Data phase: 5Mbps).
> So far, CAN FD mode doesn't turn on with above commands.
> 
> Thanks,
> Jin
> 
> 
> -----Original Message-----
> From: Marc Kleine-Budde <mkl@pengutronix.de>
> Sent: Thursday, November 19, 2020 11:11 PM
> To: Jin Park <jpark@enphaseenergy.com>; manivannan.sadhasivam@linaro.org
> Subject: Re: Question on CAN FD Driver for mcp251xfd
> 
> Hello Jin Park,
> 
> please use the linux-can mailing list (linux-can@vger.kernel.org) for community question. There are other people interested in these question, please add list on Cc.
> 
> On 11/20/20 4:03 AM, Jin Park wrote:
>> I am using MCP251XFD SPI-CAN Network Driver with VAR-SOM-MX8M-NANO
>> board now and would like to ask whether it can support CAN FD features as well.
> 
> Yes it does support CAN-FD.
> 
>> I tried to command with CAN FD features in terminal and it didn’t work
>> with CAN FD commands.
> 
> Which commands have you tried?
> What are the error messages?
> What doesn't work exactly?
> 
>> Is there any plan to release CAN FD Linux Driver in the future, if you
>> have worked on CAN FD?
> 
> It should be working.
> 
> Marc
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Question on CAN FD Driver for mcp251xfd
  2020-11-20 18:34     ` Oliver Hartkopp
@ 2020-11-20 18:57       ` Jin Park
  2020-11-20 19:04         ` Oliver Hartkopp
  0 siblings, 1 reply; 4+ messages in thread
From: Jin Park @ 2020-11-20 18:57 UTC (permalink / raw)
  To: Oliver Hartkopp, Marc Kleine-Budde, manivannan.sadhasivam; +Cc: linux-can

Hello Oliver,

It works! 
1) I set it 1Mbps for arbitration phase and 4Mbps for data phase as bit rate switching like below.
ip link set can0 up type can bitrate 1000000 sample-point 0.75 dbitrate 4000000 dsample-point 0.8 fd on

2) Send CAN FD data
cansend can0 123##1122334455667788991011121314151617181920

3) I got the data through CAN bus.
ID=291,Type=F,Length=32,Data=11223344556677889910111213141516171819202122232425

It solved!

Many Thanks,
Jin

-----Original Message-----
From: Oliver Hartkopp <socketcan@hartkopp.net> 
Sent: Friday, November 20, 2020 10:34 AM
To: Jin Park <jpark@enphaseenergy.com>; Marc Kleine-Budde <mkl@pengutronix.de>; manivannan.sadhasivam@linaro.org
Cc: linux-can@vger.kernel.org
Subject: Re: Question on CAN FD Driver for mcp251xfd

EXTERNAL EMAIL - Use caution when responding, clicking, and/or downloading attachments.





On 20.11.20 18:14, Jin Park wrote:
> Hello Marc,
>
> Here are my answers.
> VAR-SOM-MX8M-Nano board drives MCP2517FD/MCP2518FD (CAN FD controller) and TCAN332G (CAN FD Transceiver) for CAN FD communication.
>
> 1) Which commands have you tried?
> 2) What are the error messages?
> Please see below a), b), c), and d).
>
>       a) Based on Bit Rate Switching feature in CAN FD, the bit rate at data phase and arbitration phase (or nominal phase) can be set in CAN FD protocol.
> So, I tried below.
> - command
> ip link set can0 type can dbitrate 1000000
>
> - error message
> RTNETLINK answers: Operation not supported
>
>

You need to apply both bitrates at the same time, e.g.

$ ip link set can0 up type can bitrate 500000 sample-point 0.75 dbitrate
4000000 dsample-point 0.8 fd on

See at:

https://www.kernel.org/doc/Documentation/networking/can.txt

Regards,
Oliver

>
>       b) To turn on FD mode, I tried below.
> - command
> ip link set can0 type can fd on
>
> - error message
> RTNETLINK answers: Operation not supported
>
>
>
>       c) To send CAN FD message, I tried below. Th
> - command
> cansend can0 123##1
>
> - error message
> CAN interface is not CAN FD capable - sorry.
>
> - help text for cansend
>      <can_id>#{R|data}          for CAN 2.0 frames
>      <can_id>##<flags>{data}    for CAN FD frames
>
> <can_id> can have 3 (SFF) or 8 (EFF) hex chars {data} has 0..8 (0..64 
> CAN FD) ASCII hex-values (optionally separated by '.') <flags> a 
> single ASCII Hex value (0 .. F) which defines canfd_frame.flags
>
> e.g. 5A1#11.2233.44556677.88 / 123#DEADBEEF / 5AA# / 123##1 / 213##311
>       1F334455#1122334455667788 / 123#R for remote transmission request.
>
>
>
>
>
>       d) TCAN332G (CAN FD Transceiver) can support 5Mbps at data phase in CAN FD mode.
> Current supported maximum bitrate in the driver is now 1Mbps at nominal rate.
> (FYI, bit rate in data phase at CAN FD protocol is up to 8Mbps)
>          Where: BITRATE  := { 1..1000000 }
>                    SAMPLE-POINT  := { 0.000..0.999 }
>                    TQ            := { NUMBER }
>                    PROP-SEG      := { 1..8 }
>                    PHASE-SEG1    := { 1..8 }
>                    PHASE-SEG2    := { 1..8 }
>                    SJW           := { 1..4 }
>                    RESTART-MS    := { 0 | NUMBER }
>
>
>
> 3) What doesn't work exactly?
>
> I would like to send and receive messages in CAN FD with Bit Rate Switching (Arbitration phase: 1Mbps, Data phase: 5Mbps).
> So far, CAN FD mode doesn't turn on with above commands.
>
> Thanks,
> Jin
>
>
> -----Original Message-----
> From: Marc Kleine-Budde <mkl@pengutronix.de>
> Sent: Thursday, November 19, 2020 11:11 PM
> To: Jin Park <jpark@enphaseenergy.com>; 
> manivannan.sadhasivam@linaro.org
> Subject: Re: Question on CAN FD Driver for mcp251xfd
>
> Hello Jin Park,
>
> please use the linux-can mailing list (linux-can@vger.kernel.org) for community question. There are other people interested in these question, please add list on Cc.
>
> On 11/20/20 4:03 AM, Jin Park wrote:
>> I am using MCP251XFD SPI-CAN Network Driver with VAR-SOM-MX8M-NANO 
>> board now and would like to ask whether it can support CAN FD features as well.
>
> Yes it does support CAN-FD.
>
>> I tried to command with CAN FD features in terminal and it didn’t 
>> work with CAN FD commands.
>
> Which commands have you tried?
> What are the error messages?
> What doesn't work exactly?
>
>> Is there any plan to release CAN FD Linux Driver in the future, if 
>> you have worked on CAN FD?
>
> It should be working.
>
> Marc
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Question on CAN FD Driver for mcp251xfd
  2020-11-20 18:57       ` Jin Park
@ 2020-11-20 19:04         ` Oliver Hartkopp
  0 siblings, 0 replies; 4+ messages in thread
From: Oliver Hartkopp @ 2020-11-20 19:04 UTC (permalink / raw)
  To: Jin Park, Marc Kleine-Budde, manivannan.sadhasivam; +Cc: linux-can



On 20.11.20 19:57, Jin Park wrote:
> Hello Oliver,
> 
> It works!

Great!

Yes, a CAN FD controller is unhappy if only parts of the needed 
configuration is applied ;-)

https://elixir.bootlin.com/linux/latest/source/drivers/net/can/dev.c#L897

Have fun!

Oliver

> 1) I set it 1Mbps for arbitration phase and 4Mbps for data phase as bit rate switching like below.
> ip link set can0 up type can bitrate 1000000 sample-point 0.75 dbitrate 4000000 dsample-point 0.8 fd on
> 
> 2) Send CAN FD data
> cansend can0 123##1122334455667788991011121314151617181920
> 
> 3) I got the data through CAN bus.
> ID=291,Type=F,Length=32,Data=11223344556677889910111213141516171819202122232425
> 
> It solved!
> 
> Many Thanks,
> Jin
> 
> -----Original Message-----
> From: Oliver Hartkopp <socketcan@hartkopp.net>
> Sent: Friday, November 20, 2020 10:34 AM
> To: Jin Park <jpark@enphaseenergy.com>; Marc Kleine-Budde <mkl@pengutronix.de>; manivannan.sadhasivam@linaro.org
> Cc: linux-can@vger.kernel.org
> Subject: Re: Question on CAN FD Driver for mcp251xfd
> 
> EXTERNAL EMAIL - Use caution when responding, clicking, and/or downloading attachments.
> 
> 
> 
> 
> 
> On 20.11.20 18:14, Jin Park wrote:
>> Hello Marc,
>>
>> Here are my answers.
>> VAR-SOM-MX8M-Nano board drives MCP2517FD/MCP2518FD (CAN FD controller) and TCAN332G (CAN FD Transceiver) for CAN FD communication.
>>
>> 1) Which commands have you tried?
>> 2) What are the error messages?
>> Please see below a), b), c), and d).
>>
>>        a) Based on Bit Rate Switching feature in CAN FD, the bit rate at data phase and arbitration phase (or nominal phase) can be set in CAN FD protocol.
>> So, I tried below.
>> - command
>> ip link set can0 type can dbitrate 1000000
>>
>> - error message
>> RTNETLINK answers: Operation not supported
>>
>>
> 
> You need to apply both bitrates at the same time, e.g.
> 
> $ ip link set can0 up type can bitrate 500000 sample-point 0.75 dbitrate
> 4000000 dsample-point 0.8 fd on
> 
> See at:
> 
> https://www.kernel.org/doc/Documentation/networking/can.txt
> 
> Regards,
> Oliver
> 
>>
>>        b) To turn on FD mode, I tried below.
>> - command
>> ip link set can0 type can fd on
>>
>> - error message
>> RTNETLINK answers: Operation not supported
>>
>>
>>
>>        c) To send CAN FD message, I tried below. Th
>> - command
>> cansend can0 123##1
>>
>> - error message
>> CAN interface is not CAN FD capable - sorry.
>>
>> - help text for cansend
>>       <can_id>#{R|data}          for CAN 2.0 frames
>>       <can_id>##<flags>{data}    for CAN FD frames
>>
>> <can_id> can have 3 (SFF) or 8 (EFF) hex chars {data} has 0..8 (0..64
>> CAN FD) ASCII hex-values (optionally separated by '.') <flags> a
>> single ASCII Hex value (0 .. F) which defines canfd_frame.flags
>>
>> e.g. 5A1#11.2233.44556677.88 / 123#DEADBEEF / 5AA# / 123##1 / 213##311
>>        1F334455#1122334455667788 / 123#R for remote transmission request.
>>
>>
>>
>>
>>
>>        d) TCAN332G (CAN FD Transceiver) can support 5Mbps at data phase in CAN FD mode.
>> Current supported maximum bitrate in the driver is now 1Mbps at nominal rate.
>> (FYI, bit rate in data phase at CAN FD protocol is up to 8Mbps)
>>           Where: BITRATE  := { 1..1000000 }
>>                     SAMPLE-POINT  := { 0.000..0.999 }
>>                     TQ            := { NUMBER }
>>                     PROP-SEG      := { 1..8 }
>>                     PHASE-SEG1    := { 1..8 }
>>                     PHASE-SEG2    := { 1..8 }
>>                     SJW           := { 1..4 }
>>                     RESTART-MS    := { 0 | NUMBER }
>>
>>
>>
>> 3) What doesn't work exactly?
>>
>> I would like to send and receive messages in CAN FD with Bit Rate Switching (Arbitration phase: 1Mbps, Data phase: 5Mbps).
>> So far, CAN FD mode doesn't turn on with above commands.
>>
>> Thanks,
>> Jin
>>
>>
>> -----Original Message-----
>> From: Marc Kleine-Budde <mkl@pengutronix.de>
>> Sent: Thursday, November 19, 2020 11:11 PM
>> To: Jin Park <jpark@enphaseenergy.com>;
>> manivannan.sadhasivam@linaro.org
>> Subject: Re: Question on CAN FD Driver for mcp251xfd
>>
>> Hello Jin Park,
>>
>> please use the linux-can mailing list (linux-can@vger.kernel.org) for community question. There are other people interested in these question, please add list on Cc.
>>
>> On 11/20/20 4:03 AM, Jin Park wrote:
>>> I am using MCP251XFD SPI-CAN Network Driver with VAR-SOM-MX8M-NANO
>>> board now and would like to ask whether it can support CAN FD features as well.
>>
>> Yes it does support CAN-FD.
>>
>>> I tried to command with CAN FD features in terminal and it didn’t
>>> work with CAN FD commands.
>>
>> Which commands have you tried?
>> What are the error messages?
>> What doesn't work exactly?
>>
>>> Is there any plan to release CAN FD Linux Driver in the future, if
>>> you have worked on CAN FD?
>>
>> It should be working.
>>
>> Marc
>>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-11-20 19:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <DM6PR19MB3673FBAAA7A80E458659666EB1FF0@DM6PR19MB3673.namprd19.prod.outlook.com>
     [not found] ` <f168b9a4-79ae-7a8b-b074-632f86e8596b@pengutronix.de>
2020-11-20 17:14   ` Question on CAN FD Driver for mcp251xfd Jin Park
2020-11-20 18:34     ` Oliver Hartkopp
2020-11-20 18:57       ` Jin Park
2020-11-20 19:04         ` Oliver Hartkopp

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.