as the software development for PCAN-Router(s) is already working under Linux when installing the cross-compilation tools (see: http://www.peak-system.com/forum/viewto ... =34&t=1112) the only missing part to move completely to Linux is the lack of the Windows PCAN-Flash functionality.
Especially due to support of Philipp Steil and Michael Maidhof from PEAK-System I was able to build a flash tool pcanflash for Linux which can flash the PCAN-Router firmware (bin-file).
The current implementation should be able to flash
- 1. PCAN-Router
2. PCAN-Router DR
3. PCAN-Router pro
4. PCAN-RS-232
Code: Select all
Examples/1_ROUTING/.out/example_can.bin
Code: Select all
$ ./pcanflash -f example_can.bin can0
found modules:
module id 14 - date 30.09.2008 bootloader v2.0
- hardware 16 (PCAN-Router) flash type 12 (LPC_IAP)
flashing module id : 14
erasing flash sectors:
erasing block at startaddr 0x002000 with block size 0x002000
erasing block at startaddr 0x03C000 with block size 0x002000
writing flash blocks:
writing non empty block at offset 0x2000 with csum 0xEF02
writing non empty block at offset 0x2200 with csum 0xD700
writing non empty block at offset 0x2400 with csum 0xBF0A
writing non empty block at offset 0x2600 with csum 0xE1CF
writing non empty block at offset 0x2800 with csum 0xD61A
writing non empty block at offset 0x2A00 with csum 0x9AE0
writing non empty block at offset 0x2C00 with csum 0xC503
writing non empty block at offset 0x2E00 with csum 0xBE2D
writing non empty block at offset 0x3000 with csum 0xCFB0
writing non empty block at offset 0x3200 with csum 0xDCE4
writing non empty block at offset 0x3400 with csum 0xE6AD
writing non empty block at offset 0x3600 with csum 0xE0C6
writing non empty block at offset 0x3800 with csum 0xDE77
writing non empty block at offset 0x3A00 with csum 0x3102
str=CRC-Arrays ver=0x21 D/M/Y=5/5/6 mode=1 count=1
block[0] .address=0x2000 .len=0x1B8C .crc=0x0
block[0] .address=0x2000 .len=0x1B8C .crc=0x8833
writing non empty block at offset 0x3DE00 with csum 0xD55A
done.
As there's no flow control when a flash block is transferred the tx-queue-len should be extendend:
Code: Select all
ip link set can0 up type can bitrate 500000
ip link set can0 txqueuelen 500
https://github.com/hartkopp/pcanflash
and run 'make' to build pcanflash.
Feedback & (probably) bug reports are welcome!
Have fun,
Oliver