Re: [Socketcan-users] socketcan in barebox bootloader
From: Oliver Hartkopp <socketcan@hartkopp.net>
Date: 2012-02-10 09:33:35
On 10.02.2012 09:55, Marc Kleine-Budde wrote:
Now with linux-can on Cc :) On 02/09/2012 10:57 PM, Max S. wrote:quoted
CAN is meant for control messages, not for media, or data transfer.In the automotive world it's quite common to do firmware updates over CAN.
Hi, indeed e.g. the ISO 15765-2 protocol is used to segment PDUs up to 4095 byte into the 8 byte payload of CAN frames. If you want to play with ISO TP on SocketCAN - it's located here: https://gitorious.org/linux-can/can-modules/blobs/master/net/can/isotp.c But then you would need to implement ISO-TP inside the bootloader too.
quoted
That aside, I do use CAN to flash AVR microchips. It can take a few minutes though.What throughput do you usually get when updating over CAN?
I implemented a IP-over-ISOTP tunnel for fun: https://gitorious.org/linux-can/can-utils/blobs/master/isotptun.c and taking into account that ISO-TP uses the first byte inside the CAN frame payload for protocol purposes (1/8 = 12.5% overhead) and the TCP/IP-header of 40 byte within the IP communication i got ~26 kByte/s on a 500kbit/s CAN as throughput. Probably that helps to get an impression ;-) Regards, Oliver