Re: [Socketcan-users] socketcan in barebox bootloader
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: 2012-02-10 10:58:35
Attachments
- signature.asc [application/pgp-signature] 262 bytes
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: 2012-02-10 10:58:35
On 02/10/2012 10:33 AM, Oliver Hartkopp wrote:
quoted
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.
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.
That's why I argued to boot into an update linux from the bootloader and use the existing CAN stack and protocols.
quoted
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.
There are people that haver narrower DSL lines :)
Probably that helps to get an impression ;-)
Marc -- Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |