Skip to content
  • Paul Fertser's avatar
    Add BCM2835 (as found in Raspberry Pi) interface driver · 962b3eb4
    Paul Fertser authored
    
    
    This adds support for JTAG programming by bitbanging GPIOs exposed on
    the RaspberryPi's expansion header.
    
    Tested by connecting directly to an STM32VLDiscovery board, without any
    additional circuity. I observed maximum about 4MHz on the TCK pin with an
    old analogue 'scope and about 100kHz when setting the speed to 100kHz.
    Busyloop waiting is needed because even with a single 0ns nanosleep call
    (with FIFO priority) it lowers the TCK speed to ~30kHz which is way too low
    to be useful.
    
    The speed testing with adapter_khz 2000 gave the following results:
    sudo chrt -f 1 nice -n -19 ./src/openocd \
         -f interface/raspberrypi-native.cfg \
         -c "set WORKAREASIZE 0x2000" \
         -f target/stm32f1x.cfg -c "adapter_khz 2000"
    
    wrote 131072 bytes from file random.bin in 3.973677s (32.212 KiB/s)
    dumped 131072 bytes in 1.445699s (88.538 KiB/s)
    
    This is 3.7 times faster for writing and 14.3 times faster for reading
    compared to the generic sysfsgpio driver; probably the writing speed is
    limited by the target itself here and reading speed might be considerably
    higher too with appropriate connection and a capable target.
    
    BCM2835 name is choosen over BCM2708 because the published peripherals
    datasheet uses the particular model name and not family name.
    
    Change-Id: Ib78168be27f53c2a3c88c3dd8154d1190c318c78
    Signed-off-by: default avatarPaul Fertser <fercerpav@gmail.com>
    Reviewed-on: http://openocd.zylin.com/758
    
    
    Tested-by: jenkins
    Reviewed-by: default avatarSpencer Oliver <spen@spen-soft.co.uk>
    962b3eb4